/* * netsniff-ng - the packet sniffing beast * Copyright 2012 Markus Amend , Deutsche Flugsicherung GmbH * Subject to the GPL, version 2. * * IP Authentication Header described in RFC4302 */ #include #include #include /* for ntohs() */ #include "proto.h" #include "dissector_eth.h" #include "built_in.h" #include "pkt_buff.h" struct auth_hdr { uint8_t h_next_header; uint8_t h_payload_len; uint16_t h_reserved; uint32_t h_spi; uint32_t h_snf; } __packed; static void auth_hdr(struct pkt_buff *pkt) { size_t i, hdr_len; struct auth_hdr *auth_ops; auth_ops = (struct auth_hdr *) pkt_pull(pkt, sizeof(*auth_ops)); if (auth_ops == NULL) return; hdr_len = (auth_ops->h_payload_len * 4) + 8; tprintf(" [ Authentication Header "); tprintf("NextHdr (%u), ", auth_ops->h_next_header); if (hdr_len > pkt_len(pkt)) { tprintf("HdrLen (%u, %zd Bytes %s), ", auth_ops->h_payload_len, hdr_len, colorize_start_full(black, red) "invalid" colorize_end()); return; } tprintf("HdrLen (%u, %zd Bytes), ",auth_ops->h_payload_len, hdr_len); tprintf("Reserved (0x%x), ", ntohs(auth_ops->h_reserved)); /* TODO * Upgrade for Extended (64-bit) Sequence Number * http://tools.ietf.org/html/rfc4302#section-2.5.1 */ tprintf("SPI (0x%x), ", ntohl(auth_ops->h_spi)); tprintf("SNF (0x%x), ", ntohl(auth_ops->h_snf)); tprintf("ICV 0x"); for (i = sizeof(struct auth_hdr); i < hdr_len; i++) { uint8_t *data = pkt_pull(pkt, 1); if (data == NULL) { tprintf("%sinvalid%s", colorize_start_full(black, red), colorize_end()); break; } tprintf("%02x", *data); } tprintf(" ]\n"); pkt_set_dissector(pkt, ð_lay3, auth_ops->h_next_header); } static void auth_hdr_less(struct pkt_buff *pkt) { ssize_t hdr_len; struct auth_hdr *auth_ops; auth_ops = (struct auth_hdr *) pkt_pull(pkt, sizeof(*auth_ops)); if (auth_ops == NULL) return; hdr_len = (auth_ops->h_payload_len * 4) + 8; if (hdr_len > pkt_len(pkt) || hdr_len < 0) return; tprintf(" AH"); pkt_pull(pkt, hdr_len - sizeof(*auth_ops)); pkt_set_dissector(pkt, ð_lay3, auth_ops->h_next_header); } struct protocol ip_auth_ops = { .key = 0x33, .print_full = auth_hdr, .print_less = auth_hdr_less, }; 9617a3eb85'>diff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-11-16 09:39:55 +1000
committerDave Airlie <airlied@redhat.com>2016-11-16 09:39:55 +1000
commit4473904ccd7fc27b7e9e575c36dc709617a3eb85 (patch)
tree58be4542b362c7c498cbc7bb55aa5091f74374b1 /Documentation/i2c
parent1a3865d64a0d8151c7fe23f4b57a587615ccc5bb (diff)
parent47d7fbb32c57c8d1722a3e9bd21e501e80fd0741 (diff)
Merge tag 'sunxi-drm-for-4.10' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux into drm-next
sun4i-drm changes for 4.10 Support for the Allwinner A31 SoC display engine using the sun4i-drm driver. * tag 'sunxi-drm-for-4.10' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux: drm/sun4i: Add a few formats drm/sun4i: Add compatible strings for A31/A31s display pipelines drm/sun4i: Add compatible string for A31/A31s TCON (timing controller) drm/sun4i: tcon: Move SoC specific quirks to a DT matched data structure drm/sun4i: sun6i-drc: Support DRC on A31 and A31s
Diffstat (limited to 'Documentation/i2c')