X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/0b08cf5378648279efb96ecf03ea2e3f75bc4eff..1a84a1e1142f2c60dc045c2557ed4d484b576d8b:/print-ahcp.c diff --git a/print-ahcp.c b/print-ahcp.c index 1d498735..280372da 100644 --- a/print-ahcp.c +++ b/print-ahcp.c @@ -29,13 +29,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#define NETDISSECT_REWORKED #ifdef HAVE_CONFIG_H #include "config.h" #endif #include -#include "netdissect.h" +#include "interface.h" #include "extract.h" #include "addrtoname.h" @@ -150,13 +151,11 @@ ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha if (cp + 16 > ep) goto corrupt; ND_TCHECK2(*cp, 16); - ND_PRINT((ndo, "%s%s", sep, #ifdef INET6 - ip6addr_string(cp) + ND_PRINT((ndo, "%s%s", sep, ip6addr_string(ndo, cp))); #else - "(compiled w/o IPv6)" + ND_PRINT((ndo, "%s(compiled w/o IPv6)", sep)); #endif /* INET6 */ - )); cp += 16; sep = ", "; } @@ -179,7 +178,7 @@ ahcp_ipv4_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha if (cp + 4 > ep) goto corrupt; ND_TCHECK2(*cp, 4); - ND_PRINT((ndo, "%s%s", sep, ipaddr_string(cp))); + ND_PRINT((ndo, "%s%s", sep, ipaddr_string(ndo, cp))); cp += 4; sep = ", "; } @@ -202,13 +201,11 @@ ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char if (cp + 17 > ep) goto corrupt; ND_TCHECK2(*cp, 17); - ND_PRINT((ndo, "%s%s/%u", sep, #ifdef INET6 - ip6addr_string(cp), + ND_PRINT((ndo, "%s%s/%u", sep, ip6addr_string(ndo, cp), *(cp + 16))); #else - "(compiled w/o IPv6)", + ND_PRINT((ndo, "%s(compiled w/o IPv6)/%u", sep, *(cp + 16))); #endif /* INET6 */ - *(cp + 16))); cp += 17; sep = ", "; } @@ -231,7 +228,7 @@ ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char if (cp + 5 > ep) goto corrupt; ND_TCHECK2(*cp, 5); - ND_PRINT((ndo, "%s%s/%u", sep, ipaddr_string(cp), *(cp + 4))); + ND_PRINT((ndo, "%s%s/%u", sep, ipaddr_string(ndo, cp), *(cp + 4))); cp += 5; sep = ", "; } @@ -389,11 +386,11 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len) { cp += 4; /* Source Id */ ND_TCHECK2(*cp, 8); - ND_PRINT((ndo, ", Source Id %s", linkaddr_string(cp, 0, 8))); + ND_PRINT((ndo, ", Source Id %s", linkaddr_string(ndo, cp, 0, 8))); cp += 8; /* Destination Id */ ND_TCHECK2(*cp, 8); - ND_PRINT((ndo, ", Destination Id %s", linkaddr_string(cp, 0, 8))); + ND_PRINT((ndo, ", Destination Id %s", linkaddr_string(ndo, cp, 0, 8))); cp += 8; } /* Body */