X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ee68aa36460d7efeca48747f33b7f2adc0900bfb..296d466cd6bbf2f7e75e15bb6a01268e88c76ed0:/print-cnfp.c diff --git a/print-cnfp.c b/print-cnfp.c index 0ce51144..553b051d 100644 --- a/print-cnfp.c +++ b/print-cnfp.c @@ -37,17 +37,14 @@ * * See * - * http://www.cisco.com/c/en/us/td/docs/net_mgmt/netflow_collection_engine/3-6/user/guide/format.html#wp1005892 + * https://www.cisco.com/c/en/us/td/docs/net_mgmt/netflow_collection_engine/3-6/user/guide/format.html#wp1005892 */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" #include -#include #include "netdissect.h" #include "addrtoname.h" @@ -247,7 +244,6 @@ cnfp_v1_print(netdissect_options *ndo, const u_char *cp) trunc: nd_print_trunc(ndo); - return; } static void @@ -301,16 +297,16 @@ cnfp_v5_print(netdissect_options *ndo, const u_char *cp) GET_BE_U_4(nr->last_time)%1000); asbuf[0] = buf[0] = '\0'; - nd_snprintf(buf, sizeof(buf), "/%u", GET_U_1(nr->src_mask)); - nd_snprintf(asbuf, sizeof(asbuf), ":%u", + snprintf(buf, sizeof(buf), "/%u", GET_U_1(nr->src_mask)); + snprintf(asbuf, sizeof(asbuf), ":%u", GET_BE_U_2(nr->src_as)); ND_PRINT("\n %s%s%s:%u ", intoa(GET_IPV4_TO_NETWORK_ORDER(nr->src_ina)), buf, asbuf, GET_BE_U_2(nr->srcport)); - nd_snprintf(buf, sizeof(buf), "/%u", GET_U_1(nr->dst_mask)); - nd_snprintf(asbuf, sizeof(asbuf), ":%u", + snprintf(buf, sizeof(buf), "/%u", GET_U_1(nr->dst_mask)); + snprintf(asbuf, sizeof(asbuf), ":%u", GET_BE_U_2(nr->dst_as)); ND_PRINT("> %s%s%s:%u ", intoa(GET_IPV4_TO_NETWORK_ORDER(nr->dst_ina)), @@ -350,7 +346,6 @@ cnfp_v5_print(netdissect_options *ndo, const u_char *cp) trunc: nd_print_trunc(ndo); - return; } static void @@ -404,16 +399,16 @@ cnfp_v6_print(netdissect_options *ndo, const u_char *cp) GET_BE_U_4(nr->last_time)%1000); asbuf[0] = buf[0] = '\0'; - nd_snprintf(buf, sizeof(buf), "/%u", GET_U_1(nr->src_mask)); - nd_snprintf(asbuf, sizeof(asbuf), ":%u", + snprintf(buf, sizeof(buf), "/%u", GET_U_1(nr->src_mask)); + snprintf(asbuf, sizeof(asbuf), ":%u", GET_BE_U_2(nr->src_as)); ND_PRINT("\n %s%s%s:%u ", intoa(GET_IPV4_TO_NETWORK_ORDER(nr->src_ina)), buf, asbuf, GET_BE_U_2(nr->srcport)); - nd_snprintf(buf, sizeof(buf), "/%u", GET_U_1(nr->dst_mask)); - nd_snprintf(asbuf, sizeof(asbuf), ":%u", + snprintf(buf, sizeof(buf), "/%u", GET_U_1(nr->dst_mask)); + snprintf(asbuf, sizeof(asbuf), ":%u", GET_BE_U_2(nr->dst_as)); ND_PRINT("> %s%s%s:%u ", intoa(GET_IPV4_TO_NETWORK_ORDER(nr->dst_ina)), @@ -444,7 +439,7 @@ cnfp_v6_print(netdissect_options *ndo, const u_char *cp) } buf[0]='\0'; - nd_snprintf(buf, sizeof(buf), "(%u<>%u encaps)", + snprintf(buf, sizeof(buf), "(%u<>%u encaps)", (GET_BE_U_2(nr->flags) >> 8) & 0xff, (GET_BE_U_2(nr->flags)) & 0xff); ND_PRINT("tos %u, %u (%u octets) %s", @@ -456,7 +451,6 @@ cnfp_v6_print(netdissect_options *ndo, const u_char *cp) trunc: nd_print_trunc(ndo); - return; } void @@ -468,7 +462,6 @@ cnfp_print(netdissect_options *ndo, const u_char *cp) * First 2 bytes are the version number. */ ndo->ndo_protocol = "cnfp"; - ND_TCHECK_2(cp); ver = GET_BE_U_2(cp); switch (ver) { @@ -488,9 +481,4 @@ cnfp_print(netdissect_options *ndo, const u_char *cp) ND_PRINT("NetFlow v%x", ver); break; } - return; - -trunc: - nd_print_trunc(ndo); - return; }