]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-cnfp.c
CMake: Fix the comment about versions. [skip ci]
[tcpdump] / print-cnfp.c
index 0ce51144c6e8ed473deb0910a6d07a83a179c56f..553b051d483b451f5cb04f1d656340fabe37c419 100644 (file)
  *
  * 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 <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
 #include <stdio.h>
-#include <string.h>
 
 #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;
 }