/* * 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 "protos.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) { ssize_t hdr_len; size_t i; 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) || hdr_len < 0){ 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++) tprintf("%02x", *pkt_pull(pkt, 1)); tprintf(" ]\n"); pkt_set_proto(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_proto(pkt, ð_lay3, auth_ops->h_next_header); } struct protocol ip_auth_ops = { .key = 0x33, .print_full = auth_hdr, .print_less = auth_hdr_less, }; 8f23e90119e21dbb3'>diff
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-07-14 17:47:40 +0200
committerArnd Bergmann <arnd@arndb.de>2016-07-14 17:47:40 +0200
commit943283ee6b40b74a9d30ced8f23e90119e21dbb3 (patch)
treeec0d5d3f26608b9affd179482aa3c2f025115b8a
parent73dd5c5bb04711841d56f336c1af4c60314b290a (diff)
parent34993594181dc1b34eaf8e3b878dde5ed810e61f (diff)
Merge tag 'tegra-for-4.8-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/late
Merge "arm64: tegra: Device tree changes for v4.8-rc1" from Thierry Reding: A slew of updates for Tegra210 support: PMIC and regulator additions, which in turn allow a bunch of features to be enabled. Some assemblies of the Jetson TX1 come with a DSI panel that is now supported. For all other assemblies, this set of changes enables the HDMI output. Jetson TX1 can now also make use of the XUSB controller. PMIC and regulator support is also added for Smaug, which will allow a number of interesting feature additions in future releases. * tag 'tegra-for-4.8-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: tegra: Enable HDMI on Jetson TX1 arm64: tegra: Add sor1_src clock arm64: tegra: Add XUSB powergates on Tegra210 arm64: tegra: Add DPAUX pinctrl bindings arm64: tegra: Add ACONNECT bus node for Tegra210 arm64: tegra: Add audio powergate node for Tegra210 arm64: tegra: Add regulators for Tegra210 Smaug arm64: tegra: Correct Tegra210 XUSB mailbox interrupt arm64: tegra: Enable XUSB controller on Jetson TX1 arm64: tegra: Enable debug serial on Jetson TX1 arm64: tegra: Add Tegra210 XUSB controller arm64: tegra: Add Tegra210 XUSB pad controller arm64: tegra: Add DSI panel on Jetson TX1 arm64: tegra: p2597: Add SDMMC power supplies arm64: tegra: Add PMIC support on Jetson TX1