]> The Tcpdump Group git mirrors - tcpdump/commitdiff
IPFC: Update the link-layer dissector to a void function
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 2 Aug 2020 11:46:55 +0000 (13:46 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 2 Aug 2020 20:11:51 +0000 (22:11 +0200)
Moreover:
Remove trailing "_if" from the protocol name.

netdissect.h
print-ipfc.c
print.c

index b98c85c8c3d6d026a0d9423db66130333e654910..34051267a3647b3fb71efcf35f5ff2d16439a3b8 100644 (file)
@@ -485,7 +485,7 @@ extern void ieee802_11_radio_avs_if_print IF_PRINTER_ARGS;
 extern void ieee802_11_radio_if_print IF_PRINTER_ARGS;
 extern void ieee802_15_4_if_print IF_PRINTER_ARGS;
 extern void ieee802_15_4_tap_if_print IF_PRINTER_ARGS;
 extern void ieee802_11_radio_if_print IF_PRINTER_ARGS;
 extern void ieee802_15_4_if_print IF_PRINTER_ARGS;
 extern void ieee802_15_4_tap_if_print IF_PRINTER_ARGS;
-extern u_int ipfc_if_print IF_PRINTER_ARGS;
+extern void ipfc_if_print IF_PRINTER_ARGS;
 extern void ipoib_if_print IF_PRINTER_ARGS;
 extern void ipnet_if_print IF_PRINTER_ARGS;
 extern void juniper_atm1_if_print IF_PRINTER_ARGS;
 extern void ipoib_if_print IF_PRINTER_ARGS;
 extern void ipnet_if_print IF_PRINTER_ARGS;
 extern void juniper_atm1_if_print IF_PRINTER_ARGS;
index 7add1b7b0965cbdc358fd8d274dcdef19ea4d11d..5222e51248e3207f7e964ef098daaa1fcd753f28 100644 (file)
@@ -139,9 +139,9 @@ trunc:
  * 'h->len' is the length of the packet off the wire, and 'h->caplen'
  * is the number of bytes actually captured.
  */
  * 'h->len' is the length of the packet off the wire, and 'h->caplen'
  * is the number of bytes actually captured.
  */
-u_int
+void
 ipfc_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
 ipfc_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
-       ndo->ndo_protocol = "ipfc_if";
-       return (ipfc_print(ndo, p, h->len, h->caplen));
+       ndo->ndo_protocol = "ipfc";
+       ndo->ndo_ll_hdr_len += ipfc_print(ndo, p, h->len, h->caplen);
 }
 }
diff --git a/print.c b/print.c
index 8922b7cea5bc1eb7afabae36ac6db6318334437b..14a7f5f0e30b54407c3b13f7a969c4ce665bda59 100644 (file)
--- a/print.c
+++ b/print.c
@@ -53,9 +53,6 @@ struct void_printer {
 };
 
 static const struct uint_printer uint_printers[] = {
 };
 
 static const struct uint_printer uint_printers[] = {
-#ifdef DLT_IP_OVER_FC
-       { ipfc_if_print,        DLT_IP_OVER_FC },
-#endif
 #ifdef DLT_LANE8023
        { lane_if_print,        DLT_LANE8023 },
 #endif
 #ifdef DLT_LANE8023
        { lane_if_print,        DLT_LANE8023 },
 #endif
@@ -146,6 +143,9 @@ static const struct void_printer void_printers[] = {
 #ifdef DLT_IEEE802_15_4_TAP
        { ieee802_15_4_tap_if_print, DLT_IEEE802_15_4_TAP },
 #endif
 #ifdef DLT_IEEE802_15_4_TAP
        { ieee802_15_4_tap_if_print, DLT_IEEE802_15_4_TAP },
 #endif
+#ifdef DLT_IP_OVER_FC
+       { ipfc_if_print,        DLT_IP_OVER_FC },
+#endif
 #ifdef DLT_IPNET
        { ipnet_if_print,       DLT_IPNET },
 #endif
 #ifdef DLT_IPNET
        { ipnet_if_print,       DLT_IPNET },
 #endif