From: Francois-Xavier Le Bail Date: Sun, 8 Mar 2020 12:48:42 +0000 (+0100) Subject: IPv4/IPv6 demux: Rename a printer X-Git-Tag: tcpdump-4.99-bp~483 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/6a66f110963d96a92de4f4d2e757ef2893c3c3ee IPv4/IPv6 demux: Rename a printer Rename ip_print_demux() to ip_demux_print(), with _print suffix like in most similar cases. Moreover: Rename a test. --- diff --git a/netdissect.h b/netdissect.h index 01cc60bb..4fbfad67 100644 --- a/netdissect.h +++ b/netdissect.h @@ -719,7 +719,7 @@ extern uint16_t in_cksum(const struct cksum_vec *, int); extern uint16_t in_cksum_shouldbe(uint16_t, uint16_t); /* IP protocol demuxing routines */ -extern void ip_print_demux(netdissect_options *, const u_char *, u_int, u_int, int, u_int, uint8_t, const u_char *); +extern void ip_demux_print(netdissect_options *, const u_char *, u_int, u_int, int, u_int, uint8_t, const u_char *); extern uint16_t nextproto4_cksum(netdissect_options *, const struct ip *, const uint8_t *, u_int, u_int, uint8_t); diff --git a/print-esp.c b/print-esp.c index 0b3ecc91..0717c5cb 100644 --- a/print-esp.c +++ b/print-esp.c @@ -902,7 +902,7 @@ esp_print(netdissect_options *ndo, ND_PRINT(": "); /* Now dissect the plaintext. */ - ip_print_demux(ndo, pt, payloadlen - (padlen + 2), ver, fragmented, + ip_demux_print(ndo, pt, payloadlen - (padlen + 2), ver, fragmented, ttl_hl, nh, bp2); /* Pop the buffer, freeing it. */ diff --git a/print-ip-demux.c b/print-ip-demux.c index f18055d6..b6d6b706 100644 --- a/print-ip-demux.c +++ b/print-ip-demux.c @@ -37,7 +37,7 @@ #include "ipproto.h" void -ip_print_demux(netdissect_options *ndo, +ip_demux_print(netdissect_options *ndo, const u_char *bp, u_int length, u_int ver, int fragmented, u_int ttl_hl, uint8_t nh, const u_char *iph) diff --git a/print-ip.c b/print-ip.c index 8001f774..9e26d842 100644 --- a/print-ip.c +++ b/print-ip.c @@ -490,7 +490,7 @@ ip_print(netdissect_options *ndo, GET_IPADDR_STRING(ip->ip_src), GET_IPADDR_STRING(ip->ip_dst)); } - ip_print_demux(ndo, (const u_char *)ip + hlen, len, 4, + ip_demux_print(ndo, (const u_char *)ip + hlen, len, 4, off & IP_MF, GET_U_1(ip->ip_ttl), nh, bp); } else { /* diff --git a/print-ip6.c b/print-ip6.c index fd28cb23..6fef7ba9 100644 --- a/print-ip6.c +++ b/print-ip6.c @@ -468,7 +468,7 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) len -= total_advance; } } - ip_print_demux(ndo, cp, len, 6, fragmented, + ip_demux_print(ndo, cp, len, 6, fragmented, GET_U_1(ip6->ip6_hlim), nh, bp); nd_pop_packet_info(ndo); return; diff --git a/tests/TESTLIST b/tests/TESTLIST index c12259bd..150effb9 100644 --- a/tests/TESTLIST +++ b/tests/TESTLIST @@ -458,7 +458,7 @@ heapoverflow-EXTRACT_16BITS heapoverflow-EXTRACT_16BITS.pcap heapoverflow-EXTRAC heapoverflow-ppp_hdlc_if_print heapoverflow-ppp_hdlc_if_print.pcap heapoverflow-ppp_hdlc_if_print.out -v heapoverflow-q933_printq heapoverflow-q933_printq.pcap heapoverflow-q933_printq.out -v heapoverflow-sl_if_print heapoverflow-sl_if_print.pcap heapoverflow-sl_if_print.out -v -heapoverflow-ip_print_demux heapoverflow-ip_print_demux.pcap heapoverflow-ip_print_demux.out -v +heapoverflow-ip_demux_print heapoverflow-ip_demux_print.pcap heapoverflow-ip_demux_print.out -v heapoverflow-in_checksum heapoverflow-in_checksum.pcap heapoverflow-in_checksum.out -v heapoverflow-tcp_print heapoverflow-tcp_print.pcap heapoverflow-tcp_print.out -v gre-heapoverflow-1 gre-heapoverflow-1.pcap gre-heapoverflow-1.out -v diff --git a/tests/heapoverflow-ip_print_demux.out b/tests/heapoverflow-ip_demux_print.out similarity index 100% rename from tests/heapoverflow-ip_print_demux.out rename to tests/heapoverflow-ip_demux_print.out diff --git a/tests/heapoverflow-ip_print_demux.pcap b/tests/heapoverflow-ip_demux_print.pcap similarity index 100% rename from tests/heapoverflow-ip_print_demux.pcap rename to tests/heapoverflow-ip_demux_print.pcap