summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-02 11:50:35 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-02 11:50:46 +0200
commite2e1906cff6ab7d5de40f587b89039713dac6d82 (patch)
tree745cc1a99a3b1ab94cb2f8a47763becf2d069662
parentcfbae609a18fa6d61d09a8b263ceaf389f510e9b (diff)
downloadtcpdump-e2e1906cff6ab7d5de40f587b89039713dac6d82.tar.gz
CIP: Update the link-layer dissector to a void function
Moreover: Remove trailing "_if" from the protocol name.
-rw-r--r--netdissect.h2
-rw-r--r--print-cip.c8
-rw-r--r--print.c12
3 files changed, 11 insertions, 11 deletions
diff --git a/netdissect.h b/netdissect.h
index a563a521..8cee597c 100644
--- a/netdissect.h
+++ b/netdissect.h
@@ -473,7 +473,7 @@ extern void bt_if_print IF_PRINTER_ARGS;
extern void brcm_tag_if_print IF_PRINTER_ARGS;
extern void brcm_tag_prepend_if_print IF_PRINTER_ARGS;
extern u_int chdlc_if_print IF_PRINTER_ARGS;
-extern u_int cip_if_print IF_PRINTER_ARGS;
+extern void cip_if_print IF_PRINTER_ARGS;
extern void dsa_if_print IF_PRINTER_ARGS;
extern void edsa_if_print IF_PRINTER_ARGS;
extern void enc_if_print IF_PRINTER_ARGS;
diff --git a/print-cip.c b/print-cip.c
index e69999a0..8838dc99 100644
--- a/print-cip.c
+++ b/print-cip.c
@@ -56,7 +56,7 @@ cip_print(netdissect_options *ndo, u_int length)
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
-u_int
+void
cip_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
@@ -64,7 +64,7 @@ cip_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
size_t cmplen;
int llc_hdrlen;
- ndo->ndo_protocol = "cip_if";
+ ndo->ndo_protocol = "cip";
cmplen = sizeof(rfcllc);
if (cmplen > caplen)
cmplen = caplen;
@@ -76,7 +76,7 @@ cip_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
if (cmplen == 0) {
nd_print_trunc(ndo);
- return 0;
+ return;
}
if (memcmp(rfcllc, p, cmplen) == 0) {
/*
@@ -97,5 +97,5 @@ cip_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
ip_print(ndo, p, length);
}
- return (llc_hdrlen);
+ ndo->ndo_ll_hdr_len += llc_hdrlen;
}
diff --git a/print.c b/print.c
index 84df9a1a..56438353 100644
--- a/print.c
+++ b/print.c
@@ -53,12 +53,6 @@ struct void_printer {
};
static const struct uint_printer uint_printers[] = {
-#ifdef DLT_CIP
- { cip_if_print, DLT_CIP },
-#endif
-#ifdef DLT_ATM_CLIP
- { cip_if_print, DLT_ATM_CLIP },
-#endif
#ifdef DLT_IP_OVER_FC
{ ipfc_if_print, DLT_IP_OVER_FC },
#endif
@@ -125,6 +119,12 @@ static const struct void_printer void_printers[] = {
#ifdef DLT_BLUETOOTH_HCI_H4_WITH_PHDR
{ bt_if_print, DLT_BLUETOOTH_HCI_H4_WITH_PHDR},
#endif
+#ifdef DLT_ATM_CLIP
+ { cip_if_print, DLT_ATM_CLIP },
+#endif
+#ifdef DLT_CIP
+ { cip_if_print, DLT_CIP },
+#endif
#ifdef DLT_DSA_TAG_DSA
{ dsa_if_print, DLT_DSA_TAG_DSA },
#endif