]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Raw IP: Update the link-layer dissector to a void function
authorFrancois-Xavier Le Bail <[email protected]>
Fri, 7 Feb 2020 17:05:05 +0000 (18:05 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 7 Feb 2020 19:36:30 +0000 (20:36 +0100)
Moreover:
Remove trailing "_if" from protocol name.

netdissect.h
print-raw.c
print.c

index 3d521537171abd0cfc9bfe72d8e27f6339056a5c..4b42f4a16f71ac5e45c037f9af11c2bcceb05e22 100644 (file)
@@ -514,7 +514,7 @@ extern u_int ppp_hdlc_if_print IF_PRINTER_ARGS;
 extern u_int ppp_if_print IF_PRINTER_ARGS;
 extern u_int pppoe_if_print IF_PRINTER_ARGS;
 extern u_int prism_if_print IF_PRINTER_ARGS;
-extern u_int raw_if_print IF_PRINTER_ARGS;
+extern void raw_if_print IF_PRINTER_ARGS;
 extern u_int sl_bsdos_if_print IF_PRINTER_ARGS;
 extern u_int sl_if_print IF_PRINTER_ARGS;
 extern u_int sll_if_print IF_PRINTER_ARGS;
index 8d27a06ace4867f76fb3849ca350c43094c3765b..ff1ca2d550845104e3c3a47a0fdc09510549521e 100644 (file)
  * The DLT_RAW packet has no header. It contains a raw IP packet.
  */
 
-u_int
+void
 raw_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
-       ndo->ndo_protocol = "raw_if";
+       ndo->ndo_protocol = "raw";
+       ndo->ndo_ll_header_length += 0;
        if (ndo->ndo_eflag)
                ND_PRINT("ip: ");
 
        ipN_print(ndo, p, h->len);
 
-       return (0);
+       return;
 }
diff --git a/print.c b/print.c
index 1465c07ddf050eb24f757f07d13b3f3b1ba11c48..e82c631ffd107be5e7923bab16c013f0d1e84bab 100644 (file)
--- a/print.c
+++ b/print.c
@@ -97,13 +97,6 @@ static const struct uint_printer uint_printers[] = {
        { arcnet_if_print,      DLT_ARCNET },
 #ifdef DLT_ARCNET_LINUX
        { arcnet_linux_if_print, DLT_ARCNET_LINUX },
-#endif
-       { raw_if_print,         DLT_RAW },
-#ifdef DLT_IPV4
-       { raw_if_print,         DLT_IPV4 },
-#endif
-#ifdef DLT_IPV6
-       { raw_if_print,         DLT_IPV6 },
 #endif
 #ifdef DLT_IPOIB
        { ipoib_if_print,       DLT_IPOIB },
@@ -242,6 +235,13 @@ static const struct void_printer void_printers[] = {
 #endif
 #ifdef DLT_BLUETOOTH_HCI_H4_WITH_PHDR
        { bt_if_print,          DLT_BLUETOOTH_HCI_H4_WITH_PHDR},
+#endif
+       { raw_if_print,         DLT_RAW },
+#ifdef DLT_IPV4
+       { raw_if_print,         DLT_IPV4 },
+#endif
+#ifdef DLT_IPV6
+       { raw_if_print,         DLT_IPV6 },
 #endif
 #ifdef DLT_SUNATM
        { sunatm_if_print,      DLT_SUNATM },