X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/d08b4abef4de825b3aecbb7c7e7601ac010806fc..0845bc813c1cc48b18cdefff0b387c110647463c:/print-gre.c diff --git a/print-gre.c b/print-gre.c index b0eeb56e..ee26d0d3 100644 --- a/print-gre.c +++ b/print-gre.c @@ -44,7 +44,7 @@ #include -#include "interface.h" +#include "netdissect.h" #include "extract.h" #include "ethertype.h" @@ -77,9 +77,9 @@ static const struct tok gre_flag_values[] = { static void gre_print_0(netdissect_options *, const u_char *, u_int); static void gre_print_1(netdissect_options *, const u_char *, u_int); -static void gre_sre_print(netdissect_options *, u_int16_t, u_int8_t, u_int8_t, const u_char *, u_int); -static void gre_sre_ip_print(netdissect_options *, u_int8_t, u_int8_t, const u_char *, u_int); -static void gre_sre_asn_print(netdissect_options *, u_int8_t, u_int8_t, const u_char *, u_int); +static void gre_sre_print(netdissect_options *, uint16_t, uint8_t, uint8_t, const u_char *, u_int); +static void gre_sre_ip_print(netdissect_options *, uint8_t, uint8_t, const u_char *, u_int); +static void gre_sre_asn_print(netdissect_options *, uint8_t, uint8_t, const u_char *, u_int); void gre_print(netdissect_options *ndo, const u_char *bp, u_int length) @@ -110,7 +110,7 @@ static void gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) { u_int len = length; - u_int16_t flags, prot; + uint16_t flags, prot; flags = EXTRACT_16BITS(bp); if (ndo->ndo_vflag) @@ -159,9 +159,9 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) if (flags & GRE_RP) { for (;;) { - u_int16_t af; - u_int8_t sreoff; - u_int8_t srelen; + uint16_t af; + uint8_t sreoff; + uint8_t srelen; if (len < 4) goto trunc; @@ -199,22 +199,20 @@ gre_print_0(netdissect_options *ndo, const u_char *bp, u_int length) case ETHERTYPE_IP: ip_print(ndo, bp, len); break; -#ifdef INET6 case ETHERTYPE_IPV6: ip6_print(ndo, bp, len); break; -#endif case ETHERTYPE_MPLS: - mpls_print(bp, len); + mpls_print(ndo, bp, len); break; case ETHERTYPE_IPX: - ipx_print(bp, len); + ipx_print(ndo, bp, len); break; case ETHERTYPE_ATALK: - atalk_print(bp, len); + atalk_print(ndo, bp, len); break; case ETHERTYPE_GRE_ISO: - isoclns_print(bp, len, len); + isoclns_print(ndo, bp, len, len); break; case ETHERTYPE_TEB: ether_print(ndo, bp, len, len, NULL, NULL); @@ -232,7 +230,7 @@ static void gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length) { u_int len = length; - u_int16_t flags, prot; + uint16_t flags, prot; flags = EXTRACT_16BITS(bp); len -= 2; @@ -250,7 +248,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length) if (flags & GRE_KP) { - u_int32_t k; + uint32_t k; if (len < 4) goto trunc; @@ -296,7 +294,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length) switch (prot) { case ETHERTYPE_PPP: - ppp_print(bp, len); + ppp_print(ndo, bp, len); break; default: ND_PRINT((ndo, "gre-proto-0x%x", prot)); @@ -309,27 +307,27 @@ trunc: } static void -gre_sre_print(netdissect_options *ndo, u_int16_t af, u_int8_t sreoff, - u_int8_t srelen, const u_char *bp, u_int len) +gre_sre_print(netdissect_options *ndo, uint16_t af, uint8_t sreoff, + uint8_t srelen, const u_char *bp, u_int len) { switch (af) { case GRESRE_IP: ND_PRINT((ndo, ", (rtaf=ip")); gre_sre_ip_print(ndo, sreoff, srelen, bp, len); - ND_PRINT((ndo, ") ")); + ND_PRINT((ndo, ")")); break; case GRESRE_ASN: ND_PRINT((ndo, ", (rtaf=asn")); gre_sre_asn_print(ndo, sreoff, srelen, bp, len); - ND_PRINT((ndo, ") ")); + ND_PRINT((ndo, ")")); break; default: - ND_PRINT((ndo, ", (rtaf=0x%x) ", af)); + ND_PRINT((ndo, ", (rtaf=0x%x)", af)); } } static void -gre_sre_ip_print(netdissect_options *ndo, u_int8_t sreoff, u_int8_t srelen, +gre_sre_ip_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen, const u_char *bp, u_int len) { struct in_addr a; @@ -364,7 +362,7 @@ gre_sre_ip_print(netdissect_options *ndo, u_int8_t sreoff, u_int8_t srelen, } static void -gre_sre_asn_print(netdissect_options *ndo, u_int8_t sreoff, u_int8_t srelen, +gre_sre_asn_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen, const u_char *bp, u_int len) { const u_char *up = bp;