tcpdump: bump to 4.9.2
[openwrt/openwrt.git] / package / network / utils / tcpdump / patches / 100-tcpdump_mini.patch
1 --- a/Makefile.in
2 +++ b/Makefile.in
3 @@ -70,6 +70,82 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
4 @rm -f $@
5 $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
6
7 +ifdef TCPDUMP_MINI
8 +
9 +CSRC=\
10 + tcpdump.c \
11 + netdissect.c \
12 + setsignal.c \
13 + addrtoname.c \
14 + addrtostr.c \
15 + af.c \
16 + ascii_strcasecmp.c \
17 + checksum.c \
18 + cpack.c \
19 + gmpls.c \
20 + gmt2local.c \
21 + in_cksum.c \
22 + ipproto.c \
23 + l2vpn.c \
24 + machdep.c \
25 + nlpid.c \
26 + oui.c \
27 + parsenfsfh.c \
28 + print.c \
29 + print-802_11.c \
30 + print-aodv.c \
31 + print-arp.c \
32 + print-ascii.c \
33 + print-bootp.c \
34 + print-dhcp6.c \
35 + print-domain.c \
36 + print-eap.c \
37 + print-ether.c \
38 + print-ftp.c \
39 + print-gre.c \
40 + print-http.c \
41 + print-icmp.c \
42 + print-icmp6.c \
43 + print-igmp.c \
44 + print-ip.c \
45 + print-ip6.c \
46 + print-ip6opts.c \
47 + print-ipnet.c \
48 + print-l2tp.c \
49 + print-llc.c \
50 + print-lldp.c \
51 + print-loopback.c \
52 + print-nfs.c \
53 + print-ntp.c \
54 + print-null.c \
55 + print-olsr.c \
56 + print-ospf.c \
57 + print-ospf6.c \
58 + print-ppp.c \
59 + print-pppoe.c \
60 + print-pptp.c \
61 + print-radius.c \
62 + print-raw.c \
63 + print-rsvp.c \
64 + print-rt6.c \
65 + print-rtsp.c \
66 + print-sip.c \
67 + print-sll.c \
68 + print-smtp.c \
69 + print-snmp.c \
70 + print-stp.c \
71 + print-sunrpc.c \
72 + print-syslog.c \
73 + print-tcp.c \
74 + print-telnet.c \
75 + print-tftp.c \
76 + print-udp.c \
77 + signature.c \
78 + strtoaddr.c \
79 + util-print.c
80 +
81 +else
82 +
83 CSRC = setsignal.c tcpdump.c
84
85 LIBNETDISSECT_SRC=\
86 @@ -237,12 +313,16 @@ LIBNETDISSECT_SRC=\
87 strtoaddr.c \
88 util-print.c
89
90 +endif
91 +
92 LOCALSRC = @LOCALSRC@
93 GENSRC = version.c
94 LIBOBJS = @LIBOBJS@
95
96 +ifndef TCPDUMP_MINI
97 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
98 LIBNETDISSECT=libnetdissect.a
99 +endif
100
101
102 SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC)
103 @@ -373,10 +453,12 @@ $(PROG): $(OBJ) @V_PCAPDEP@
104 @rm -f $@
105 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
106
107 +ifndef TCPDUMP_MINI
108 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
109 @rm -f $@
110 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
111 $(RANLIB) $@
112 +endif
113
114 datalinks.o: $(srcdir)/missing/datalinks.c
115 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
116 --- a/addrtoname.c
117 +++ b/addrtoname.c
118 @@ -578,8 +578,10 @@ linkaddr_string(netdissect_options *ndo,
119 if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN)
120 return (etheraddr_string(ndo, ep));
121
122 +#ifndef TCPDUMP_MINI
123 if (type == LINKADDR_FRELAY)
124 return (q922_string(ndo, ep, len));
125 +#endif
126
127 tp = lookup_bytestring(ndo, ep, len);
128 if (tp->bs_name)
129 @@ -1214,6 +1216,7 @@ init_addrtoname(netdissect_options *ndo,
130 init_ipxsaparray(ndo);
131 }
132
133 +#ifndef TCPDUMP_MINI
134 const char *
135 dnaddr_string(netdissect_options *ndo, u_short dnaddr)
136 {
137 @@ -1233,6 +1236,7 @@ dnaddr_string(netdissect_options *ndo, u
138
139 return(tp->name);
140 }
141 +#endif
142
143 /* Return a zero'ed hnamemem struct and cuts down on calloc() overhead */
144 struct hnamemem *
145 --- a/print.c
146 +++ b/print.c
147 @@ -48,6 +48,7 @@ static const struct printer printers[] =
148 #ifdef DLT_IPNET
149 { ipnet_if_print, DLT_IPNET },
150 #endif
151 +#ifndef TCPDUMP_MINI
152 #ifdef DLT_IEEE802_15_4
153 { ieee802_15_4_if_print, DLT_IEEE802_15_4 },
154 #endif
155 @@ -57,12 +58,14 @@ static const struct printer printers[] =
156 #ifdef DLT_PPI
157 { ppi_if_print, DLT_PPI },
158 #endif
159 +#endif
160 #ifdef DLT_NETANALYZER
161 { netanalyzer_if_print, DLT_NETANALYZER },
162 #endif
163 #ifdef DLT_NETANALYZER_TRANSPARENT
164 { netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT },
165 #endif
166 +#ifndef TCPDUMP_MINI
167 #if defined(DLT_NFLOG) && defined(HAVE_PCAP_NFLOG_H)
168 { nflog_if_print, DLT_NFLOG},
169 #endif
170 @@ -75,10 +78,12 @@ static const struct printer printers[] =
171 #ifdef DLT_IP_OVER_FC
172 { ipfc_if_print, DLT_IP_OVER_FC },
173 #endif
174 +#endif
175 { null_if_print, DLT_NULL },
176 #ifdef DLT_LOOP
177 { null_if_print, DLT_LOOP },
178 #endif
179 +#ifndef TCPDUMP_MINI
180 #ifdef DLT_APPLE_IP_OVER_IEEE1394
181 { ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 },
182 #endif
183 @@ -92,7 +97,9 @@ static const struct printer printers[] =
184 #ifdef DLT_ARCNET_LINUX
185 { arcnet_linux_if_print, DLT_ARCNET_LINUX },
186 #endif
187 +#endif
188 { raw_if_print, DLT_RAW },
189 +#ifndef TCPDUMP_MINI
190 #ifdef DLT_IPV4
191 { raw_if_print, DLT_IPV4 },
192 #endif
193 @@ -116,17 +123,21 @@ static const struct printer printers[] =
194 #ifdef DLT_HDLC
195 { chdlc_if_print, DLT_HDLC },
196 #endif
197 +#endif
198 #ifdef DLT_PPP_ETHER
199 { pppoe_if_print, DLT_PPP_ETHER },
200 #endif
201 +#ifndef TCPDUMP_MINI
202 #if defined(DLT_PFLOG) && defined(HAVE_NET_IF_PFLOG_H)
203 { pflog_if_print, DLT_PFLOG },
204 #endif
205 { token_if_print, DLT_IEEE802 },
206 { fddi_if_print, DLT_FDDI },
207 +#endif
208 #ifdef DLT_LINUX_SLL
209 { sll_if_print, DLT_LINUX_SLL },
210 #endif
211 +#ifndef TCPDUMP_MINI
212 #ifdef DLT_FR
213 { fr_if_print, DLT_FR },
214 #endif
215 @@ -198,6 +209,7 @@ static const struct printer printers[] =
216 #ifdef DLT_PKTAP
217 { pktap_if_print, DLT_PKTAP },
218 #endif
219 +#endif
220 #ifdef DLT_IEEE802_11_RADIO
221 { ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO },
222 #endif
223 @@ -214,12 +226,14 @@ static const struct printer printers[] =
224 #ifdef DLT_PPP_WITHDIRECTION
225 { ppp_if_print, DLT_PPP_WITHDIRECTION },
226 #endif
227 +#ifndef TCPDUMP_MINI
228 #ifdef DLT_PPP_BSDOS
229 { ppp_bsdos_if_print, DLT_PPP_BSDOS },
230 #endif
231 #ifdef DLT_PPP_SERIAL
232 { ppp_hdlc_if_print, DLT_PPP_SERIAL },
233 #endif
234 +#endif
235 { NULL, 0 },
236 };
237
238 --- a/print-ether.c
239 +++ b/print-ether.c
240 @@ -342,6 +342,7 @@ ethertype_print(netdissect_options *ndo,
241 arp_print(ndo, p, length, caplen);
242 return (1);
243
244 +#ifndef TCPDUMP_MINI
245 case ETHERTYPE_DN:
246 decnet_print(ndo, p, length, caplen);
247 return (1);
248 @@ -368,6 +369,7 @@ ethertype_print(netdissect_options *ndo,
249 }
250 isoclns_print(ndo, p + 1, length - 1);
251 return(1);
252 +#endif
253
254 case ETHERTYPE_PPPOED:
255 case ETHERTYPE_PPPOES:
256 @@ -380,9 +382,11 @@ ethertype_print(netdissect_options *ndo,
257 eap_print(ndo, p, length);
258 return (1);
259
260 +#ifndef TCPDUMP_MINI
261 case ETHERTYPE_RRCP:
262 rrcp_print(ndo, p, length, src, dst);
263 return (1);
264 +#endif
265
266 case ETHERTYPE_PPP:
267 if (length) {
268 @@ -391,6 +395,7 @@ ethertype_print(netdissect_options *ndo,
269 }
270 return (1);
271
272 +#ifndef TCPDUMP_MINI
273 case ETHERTYPE_MPCP:
274 mpcp_print(ndo, p, length);
275 return (1);
276 @@ -403,6 +408,7 @@ ethertype_print(netdissect_options *ndo,
277 case ETHERTYPE_CFM_OLD:
278 cfm_print(ndo, p, length);
279 return (1);
280 +#endif
281
282 case ETHERTYPE_LLDP:
283 lldp_print(ndo, p, length);
284 @@ -412,6 +418,7 @@ ethertype_print(netdissect_options *ndo,
285 loopback_print(ndo, p, length);
286 return (1);
287
288 +#ifndef TCPDUMP_MINI
289 case ETHERTYPE_MPLS:
290 case ETHERTYPE_MPLS_MULTI:
291 mpls_print(ndo, p, length);
292 @@ -441,6 +448,7 @@ ethertype_print(netdissect_options *ndo,
293 case ETHERTYPE_MEDSA:
294 medsa_print(ndo, p, length, caplen, src, dst);
295 return (1);
296 +#endif
297
298 case ETHERTYPE_LAT:
299 case ETHERTYPE_SCA:
300 --- a/print-gre.c
301 +++ b/print-gre.c
302 @@ -216,6 +216,7 @@ gre_print_0(netdissect_options *ndo, con
303 case ETHERTYPE_IPV6:
304 ip6_print(ndo, bp, len);
305 break;
306 +#ifndef TCPDUMP_MINI
307 case ETHERTYPE_MPLS:
308 mpls_print(ndo, bp, len);
309 break;
310 @@ -231,6 +232,7 @@ gre_print_0(netdissect_options *ndo, con
311 case ETHERTYPE_TEB:
312 ether_print(ndo, bp, len, ndo->ndo_snapend - bp, NULL, NULL);
313 break;
314 +#endif
315 default:
316 ND_PRINT((ndo, "gre-proto-0x%x", prot));
317 }
318 --- a/print-igmp.c
319 +++ b/print-igmp.c
320 @@ -306,6 +306,7 @@ igmp_print(netdissect_options *ndo,
321 ND_TCHECK2(bp[4], 4);
322 ND_PRINT((ndo, "igmp leave %s", ipaddr_string(ndo, &bp[4])));
323 break;
324 +#ifndef TCPDUMP_MINI
325 case 0x13:
326 ND_PRINT((ndo, "igmp dvmrp"));
327 if (len < 8)
328 @@ -317,6 +318,7 @@ igmp_print(netdissect_options *ndo,
329 ND_PRINT((ndo, "igmp pimv1"));
330 pimv1_print(ndo, bp, len);
331 break;
332 +#endif
333 case 0x1e:
334 print_mresp(ndo, bp, len);
335 break;
336 --- a/print-ip6.c
337 +++ b/print-ip6.c
338 @@ -305,6 +305,7 @@ ip6_print(netdissect_options *ndo, const
339 return;
340 nh = *cp;
341 break;
342 +#ifndef TCPDUMP_MINI
343 case IPPROTO_FRAGMENT:
344 advance = frag6_print(ndo, cp, (const u_char *)ip6);
345 if (advance < 0 || ndo->ndo_snapend <= cp + advance)
346 @@ -328,6 +329,7 @@ ip6_print(netdissect_options *ndo, const
347 return;
348 nh = *cp;
349 return;
350 +#endif
351 case IPPROTO_ROUTING:
352 ND_TCHECK(*cp);
353 advance = rt6_print(ndo, cp, (const u_char *)ip6);
354 @@ -335,12 +337,14 @@ ip6_print(netdissect_options *ndo, const
355 return;
356 nh = *cp;
357 break;
358 +#ifndef TCPDUMP_MINI
359 case IPPROTO_SCTP:
360 sctp_print(ndo, cp, (const u_char *)ip6, len);
361 return;
362 case IPPROTO_DCCP:
363 dccp_print(ndo, cp, (const u_char *)ip6, len);
364 return;
365 +#endif
366 case IPPROTO_TCP:
367 tcp_print(ndo, cp, len, (const u_char *)ip6, fragmented);
368 return;
369 @@ -350,6 +354,7 @@ ip6_print(netdissect_options *ndo, const
370 case IPPROTO_ICMPV6:
371 icmp6_print(ndo, cp, len, (const u_char *)ip6, fragmented);
372 return;
373 +#ifndef TCPDUMP_MINI
374 case IPPROTO_AH:
375 advance = ah_print(ndo, cp);
376 if (advance < 0)
377 @@ -382,6 +387,7 @@ ip6_print(netdissect_options *ndo, const
378 case IPPROTO_PIM:
379 pim_print(ndo, cp, len, (const u_char *)ip6);
380 return;
381 +#endif
382
383 case IPPROTO_OSPF:
384 ospf6_print(ndo, cp, len);
385 @@ -395,9 +401,11 @@ ip6_print(netdissect_options *ndo, const
386 ip_print(ndo, cp, len);
387 return;
388
389 +#ifndef TCPDUMP_MINI
390 case IPPROTO_PGM:
391 pgm_print(ndo, cp, len, (const u_char *)ip6);
392 return;
393 +#endif
394
395 case IPPROTO_GRE:
396 gre_print(ndo, cp, len);
397 --- a/print-ip.c
398 +++ b/print-ip.c
399 @@ -344,6 +344,7 @@ ip_print_demux(netdissect_options *ndo,
400 again:
401 switch (ipds->nh) {
402
403 +#ifndef TCPDUMP_MINI
404 case IPPROTO_AH:
405 if (!ND_TTEST(*ipds->cp)) {
406 ND_PRINT((ndo, "[|AH]"));
407 @@ -382,7 +383,9 @@ again:
408 */
409 break;
410 }
411 +#endif
412
413 +#ifndef TCPDUMP_MINI
414 case IPPROTO_SCTP:
415 sctp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len);
416 break;
417 @@ -390,6 +393,7 @@ again:
418 case IPPROTO_DCCP:
419 dccp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len);
420 break;
421 +#endif
422
423 case IPPROTO_TCP:
424 /* pass on the MF bit plus the offset to detect fragments */
425 @@ -409,6 +413,7 @@ again:
426 ipds->off & (IP_MF|IP_OFFMASK));
427 break;
428
429 +#ifndef TCPDUMP_MINI
430 case IPPROTO_PIGP:
431 /*
432 * XXX - the current IANA protocol number assignments
433 @@ -429,14 +434,17 @@ again:
434 case IPPROTO_EIGRP:
435 eigrp_print(ndo, ipds->cp, ipds->len);
436 break;
437 +#endif
438
439 case IPPROTO_ND:
440 ND_PRINT((ndo, " nd %d", ipds->len));
441 break;
442
443 +#ifndef TCPDUMP_MINI
444 case IPPROTO_EGP:
445 egp_print(ndo, ipds->cp, ipds->len);
446 break;
447 +#endif
448
449 case IPPROTO_OSPF:
450 ospf_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip);
451 @@ -469,6 +477,7 @@ again:
452 gre_print(ndo, ipds->cp, ipds->len);
453 break;
454
455 +#ifndef TCPDUMP_MINI
456 case IPPROTO_MOBILE:
457 mobile_print(ndo, ipds->cp, ipds->len);
458 break;
459 @@ -497,6 +506,7 @@ again:
460 case IPPROTO_PGM:
461 pgm_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip);
462 break;
463 +#endif
464
465 default:
466 if (ndo->ndo_nflag==0 && (p_name = netdb_protoname(ipds->nh)) != NULL)
467 --- a/print-llc.c
468 +++ b/print-llc.c
469 @@ -206,6 +206,7 @@ llc_print(netdissect_options *ndo, const
470 hdrlen = 4; /* DSAP, SSAP, 2-byte control field */
471 }
472
473 +#ifndef TCPDUMP_MINI
474 if (ssap_field == LLCSAP_GLOBAL && dsap_field == LLCSAP_GLOBAL) {
475 /*
476 * This is an Ethernet_802.3 IPX frame; it has an
477 @@ -228,6 +229,7 @@ llc_print(netdissect_options *ndo, const
478 ipx_print(ndo, p, length);
479 return (0); /* no LLC header */
480 }
481 +#endif
482
483 dsap = dsap_field & ~LLC_IG;
484 ssap = ssap_field & ~LLC_GSAP;
485 @@ -291,6 +293,7 @@ llc_print(netdissect_options *ndo, const
486 return (hdrlen);
487 }
488
489 +#ifndef TCPDUMP_MINI
490 if (ssap == LLCSAP_IPX && dsap == LLCSAP_IPX &&
491 control == LLC_UI) {
492 /*
493 @@ -304,6 +307,7 @@ llc_print(netdissect_options *ndo, const
494 ipx_print(ndo, p, length);
495 return (hdrlen);
496 }
497 +#endif
498
499 #ifdef ENABLE_SMB
500 if (ssap == LLCSAP_NETBEUI && dsap == LLCSAP_NETBEUI
501 @@ -322,12 +326,13 @@ llc_print(netdissect_options *ndo, const
502 return (hdrlen);
503 }
504 #endif
505 +#ifndef TCPDUMP_MINI
506 if (ssap == LLCSAP_ISONS && dsap == LLCSAP_ISONS
507 && control == LLC_UI) {
508 isoclns_print(ndo, p, length);
509 return (hdrlen);
510 }
511 -
512 +#endif
513 if (!ndo->ndo_eflag) {
514 if (ssap == dsap) {
515 if (src == NULL || dst == NULL)
516 @@ -480,6 +485,7 @@ snap_print(netdissect_options *ndo, cons
517
518 case OUI_CISCO:
519 switch (et) {
520 +#ifndef TCPDUMP_MINI
521 case PID_CISCO_CDP:
522 cdp_print(ndo, p, length, caplen);
523 return (1);
524 @@ -492,6 +498,7 @@ snap_print(netdissect_options *ndo, cons
525 case PID_CISCO_VTP:
526 vtp_print(ndo, p, length);
527 return (1);
528 +#endif
529 case PID_CISCO_PVST:
530 case PID_CISCO_VLANBRIDGE:
531 stp_print(ndo, p, length);
532 @@ -504,6 +511,7 @@ snap_print(netdissect_options *ndo, cons
533 case OUI_RFC2684:
534 switch (et) {
535
536 +#ifndef TCPDUMP_MINI
537 case PID_RFC2684_ETH_FCS:
538 case PID_RFC2684_ETH_NOFCS:
539 /*
540 @@ -565,6 +573,7 @@ snap_print(netdissect_options *ndo, cons
541 */
542 fddi_print(ndo, p, length, caplen);
543 return (1);
544 +#endif
545
546 case PID_RFC2684_BPDU:
547 stp_print(ndo, p, length);
548 --- a/print-null.c
549 +++ b/print-null.c
550 @@ -116,6 +116,7 @@ null_if_print(netdissect_options *ndo, c
551 ip6_print(ndo, p, length);
552 break;
553
554 +#ifndef TCPDUMP_MINI
555 case BSD_AFNUM_ISO:
556 isoclns_print(ndo, p, length);
557 break;
558 @@ -127,6 +128,7 @@ null_if_print(netdissect_options *ndo, c
559 case BSD_AFNUM_IPX:
560 ipx_print(ndo, p, length);
561 break;
562 +#endif
563
564 default:
565 /* unknown AF_ value */
566 --- a/print-ppp.c
567 +++ b/print-ppp.c
568 @@ -1367,6 +1367,7 @@ trunc:
569 return 0;
570 }
571
572 +#ifndef TCPDUMP_MINI
573 static void
574 ppp_hdlc(netdissect_options *ndo,
575 const u_char *p, int length)
576 @@ -1445,6 +1446,7 @@ trunc:
577 free(b);
578 ND_PRINT((ndo, "[|ppp]"));
579 }
580 +#endif
581
582
583 /* PPP */
584 @@ -1452,10 +1454,12 @@ static void
585 handle_ppp(netdissect_options *ndo,
586 u_int proto, const u_char *p, int length)
587 {
588 +#ifndef TCPDUMP_MINI
589 if ((proto & 0xff00) == 0x7e00) { /* is this an escape code ? */
590 ppp_hdlc(ndo, p - 1, length);
591 return;
592 }
593 +#endif
594
595 switch (proto) {
596 case PPP_LCP: /* fall through */
597 @@ -1488,6 +1492,7 @@ handle_ppp(netdissect_options *ndo,
598 case PPP_IPV6:
599 ip6_print(ndo, p, length);
600 break;
601 +#ifndef TCPDUMP_MINI
602 case ETHERTYPE_IPX: /*XXX*/
603 case PPP_IPX:
604 ipx_print(ndo, p, length);
605 @@ -1499,6 +1504,7 @@ handle_ppp(netdissect_options *ndo,
606 case PPP_MPLS_MCAST:
607 mpls_print(ndo, p, length);
608 break;
609 +#endif
610 case PPP_COMP:
611 ND_PRINT((ndo, "compressed PPP data"));
612 break;
613 @@ -1639,6 +1645,7 @@ ppp_if_print(netdissect_options *ndo,
614 return (0);
615 }
616
617 +#ifndef TCPDUMP_MINI
618 /*
619 * PPP I/F printer to use if we know that RFC 1662-style PPP in HDLC-like
620 * framing, or Cisco PPP with HDLC framing as per section 4.3.1 of RFC 1547,
621 @@ -1866,6 +1873,7 @@ printx:
622 #endif /* __bsdi__ */
623 return (hdrlength);
624 }
625 +#endif
626
627
628 /*
629 --- a/print-sll.c
630 +++ b/print-sll.c
631 @@ -238,12 +238,14 @@ recurse:
632 */
633 switch (ether_type) {
634
635 +#ifndef TCPDUMP_MINI
636 case LINUX_SLL_P_802_3:
637 /*
638 * Ethernet_802.3 IPX frame.
639 */
640 ipx_print(ndo, p, length);
641 break;
642 +#endif
643
644 case LINUX_SLL_P_802_2:
645 /*
646 --- a/print-tcp.c
647 +++ b/print-tcp.c
648 @@ -589,12 +589,14 @@ tcp_print(netdissect_options *ndo,
649 ND_PRINT((ndo, " %u", utoval));
650 break;
651
652 +#ifndef TCPDUMP_MINI
653 case TCPOPT_MPTCP:
654 datalen = len - 2;
655 LENCHECK(datalen);
656 if (!mptcp_print(ndo, cp-2, len, flags))
657 goto bad;
658 break;
659 +#endif
660
661 case TCPOPT_FASTOPEN:
662 datalen = len - 2;
663 @@ -670,6 +672,7 @@ tcp_print(netdissect_options *ndo,
664 return;
665 }
666
667 +#ifndef TCPDUMP_MINI
668 if (ndo->ndo_packettype) {
669 switch (ndo->ndo_packettype) {
670 case PT_ZMTP1:
671 @@ -681,28 +684,36 @@ tcp_print(netdissect_options *ndo,
672 }
673 return;
674 }
675 +#endif
676
677 if (IS_SRC_OR_DST_PORT(TELNET_PORT)) {
678 telnet_print(ndo, bp, length);
679 } else if (IS_SRC_OR_DST_PORT(SMTP_PORT)) {
680 ND_PRINT((ndo, ": "));
681 smtp_print(ndo, bp, length);
682 - } else if (IS_SRC_OR_DST_PORT(BGP_PORT))
683 + }
684 +#ifndef TCPDUMP_MINI
685 + else if (IS_SRC_OR_DST_PORT(BGP_PORT))
686 bgp_print(ndo, bp, length);
687 +#endif
688 else if (IS_SRC_OR_DST_PORT(PPTP_PORT))
689 pptp_print(ndo, bp);
690 +#ifndef TCPDUMP_MINI
691 else if (IS_SRC_OR_DST_PORT(REDIS_PORT))
692 resp_print(ndo, bp, length);
693 +#endif
694 #ifdef ENABLE_SMB
695 else if (IS_SRC_OR_DST_PORT(NETBIOS_SSN_PORT))
696 nbt_tcp_print(ndo, bp, length);
697 else if (IS_SRC_OR_DST_PORT(SMB_PORT))
698 smb_tcp_print(ndo, bp, length);
699 #endif
700 +#ifndef TCPDUMP_MINI
701 else if (IS_SRC_OR_DST_PORT(BEEP_PORT))
702 beep_print(ndo, bp, length);
703 else if (IS_SRC_OR_DST_PORT(OPENFLOW_PORT_OLD) || IS_SRC_OR_DST_PORT(OPENFLOW_PORT_IANA))
704 openflow_print(ndo, bp, length);
705 +#endif
706 else if (IS_SRC_OR_DST_PORT(FTP_PORT)) {
707 ND_PRINT((ndo, ": "));
708 ftp_print(ndo, bp, length);
709 @@ -719,6 +730,7 @@ tcp_print(netdissect_options *ndo,
710 * XXX packet could be unaligned, it can go strange
711 */
712 ns_print(ndo, bp + 2, length - 2, 0);
713 +#ifndef TCPDUMP_MINI
714 } else if (IS_SRC_OR_DST_PORT(MSDP_PORT)) {
715 msdp_print(ndo, bp, length);
716 } else if (IS_SRC_OR_DST_PORT(RPKI_RTR_PORT)) {
717 @@ -726,6 +738,7 @@ tcp_print(netdissect_options *ndo,
718 }
719 else if (length > 0 && (IS_SRC_OR_DST_PORT(LDP_PORT))) {
720 ldp_print(ndo, bp, length);
721 +#endif
722 }
723 else if ((IS_SRC_OR_DST_PORT(NFS_PORT)) &&
724 length >= 4 && ND_TTEST2(*bp, 4)) {
725 --- a/print-udp.c
726 +++ b/print-udp.c
727 @@ -430,10 +430,12 @@ udp_print(netdissect_options *ndo, regis
728 vat_print(ndo, (const void *)(up + 1), up);
729 break;
730
731 +#ifndef TCPDUMP_MINI
732 case PT_WB:
733 udpipaddr_print(ndo, ip, sport, dport);
734 wb_print(ndo, (const void *)(up + 1), length);
735 break;
736 +#endif
737
738 case PT_RPC:
739 rp = (const struct sunrpc_msg *)(up + 1);
740 @@ -462,10 +464,12 @@ udp_print(netdissect_options *ndo, regis
741 snmp_print(ndo, (const u_char *)(up + 1), length);
742 break;
743
744 +#ifndef TCPDUMP_MINI
745 case PT_CNFP:
746 udpipaddr_print(ndo, ip, sport, dport);
747 cnfp_print(ndo, cp);
748 break;
749 +#endif
750
751 case PT_TFTP:
752 udpipaddr_print(ndo, ip, sport, dport);
753 @@ -483,6 +487,7 @@ udp_print(netdissect_options *ndo, regis
754 radius_print(ndo, cp, length);
755 break;
756
757 +#ifndef TCPDUMP_MINI
758 case PT_VXLAN:
759 udpipaddr_print(ndo, ip, sport, dport);
760 vxlan_print(ndo, (const u_char *)(up + 1), length);
761 @@ -497,6 +502,7 @@ udp_print(netdissect_options *ndo, regis
762 udpipaddr_print(ndo, ip, sport, dport);
763 lmp_print(ndo, cp, length);
764 break;
765 +#endif
766 }
767 return;
768 }
769 @@ -574,31 +580,40 @@ udp_print(netdissect_options *ndo, regis
770 ns_print(ndo, (const u_char *)(up + 1), length, 0);
771 else if (IS_SRC_OR_DST_PORT(MULTICASTDNS_PORT))
772 ns_print(ndo, (const u_char *)(up + 1), length, 1);
773 +#ifndef TCPDUMP_MINI
774 else if (IS_SRC_OR_DST_PORT(TIMED_PORT))
775 timed_print(ndo, (const u_char *)(up + 1));
776 +#endif
777 else if (IS_SRC_OR_DST_PORT(TFTP_PORT))
778 tftp_print(ndo, (const u_char *)(up + 1), length);
779 else if (IS_SRC_OR_DST_PORT(BOOTPC_PORT) || IS_SRC_OR_DST_PORT(BOOTPS_PORT))
780 bootp_print(ndo, (const u_char *)(up + 1), length);
781 +#ifndef TCPDUMP_MINI
782 else if (IS_SRC_OR_DST_PORT(RIP_PORT))
783 rip_print(ndo, (const u_char *)(up + 1), length);
784 +#endif
785 else if (IS_SRC_OR_DST_PORT(AODV_PORT))
786 aodv_print(ndo, (const u_char *)(up + 1), length,
787 ip6 != NULL);
788 +#ifndef TCPDUMP_MINI
789 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT))
790 isakmp_print(ndo, (const u_char *)(up + 1), length, bp2);
791 +
792 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT))
793 isakmp_rfc3948_print(ndo, (const u_char *)(up + 1), length, bp2);
794 #if 1 /*???*/
795 else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2))
796 isakmp_print(ndo, (const u_char *)(up + 1), length, bp2);
797 #endif
798 +#endif
799 else if (IS_SRC_OR_DST_PORT(SNMP_PORT) || IS_SRC_OR_DST_PORT(SNMPTRAP_PORT))
800 snmp_print(ndo, (const u_char *)(up + 1), length);
801 else if (IS_SRC_OR_DST_PORT(NTP_PORT))
802 ntp_print(ndo, (const u_char *)(up + 1), length);
803 +#ifndef TCPDUMP_MINI
804 else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT))
805 krb_print(ndo, (const void *)(up + 1));
806 +#endif
807 else if (IS_SRC_OR_DST_PORT(L2TP_PORT))
808 l2tp_print(ndo, (const u_char *)(up + 1), length);
809 #ifdef ENABLE_SMB
810 @@ -609,6 +624,7 @@ udp_print(netdissect_options *ndo, regis
811 #endif
812 else if (dport == VAT_PORT)
813 vat_print(ndo, (const void *)(up + 1), up);
814 +#ifndef TCPDUMP_MINI
815 else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT))
816 zephyr_print(ndo, (const void *)(up + 1), length);
817 /*
818 @@ -621,8 +637,11 @@ udp_print(netdissect_options *ndo, regis
819 (const u_char *) ip);
820 else if (IS_SRC_OR_DST_PORT(RIPNG_PORT))
821 ripng_print(ndo, (const u_char *)(up + 1), length);
822 +#endif
823 +
824 else if (IS_SRC_OR_DST_PORT(DHCP6_SERV_PORT) || IS_SRC_OR_DST_PORT(DHCP6_CLI_PORT))
825 dhcp6_print(ndo, (const u_char *)(up + 1), length);
826 +#ifndef TCPDUMP_MINI
827 else if (IS_SRC_OR_DST_PORT(AHCP_PORT))
828 ahcp_print(ndo, (const u_char *)(up + 1), length);
829 else if (IS_SRC_OR_DST_PORT(BABEL_PORT) || IS_SRC_OR_DST_PORT(BABEL_PORT_OLD))
830 @@ -636,6 +655,7 @@ udp_print(netdissect_options *ndo, regis
831 wb_print(ndo, (const void *)(up + 1), length);
832 else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT))
833 cisco_autorp_print(ndo, (const void *)(up + 1), length);
834 +#endif
835 else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) ||
836 IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT) ||
837 IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT) ||
838 @@ -643,15 +663,18 @@ udp_print(netdissect_options *ndo, regis
839 IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT) ||
840 IS_SRC_OR_DST_PORT(RADIUS_COA_PORT) )
841 radius_print(ndo, (const u_char *)(up+1), length);
842 +#ifndef TCPDUMP_MINI
843 else if (dport == HSRP_PORT)
844 hsrp_print(ndo, (const u_char *)(up + 1), length);
845 else if (IS_SRC_OR_DST_PORT(LWRES_PORT))
846 lwres_print(ndo, (const u_char *)(up + 1), length);
847 else if (IS_SRC_OR_DST_PORT(LDP_PORT))
848 ldp_print(ndo, (const u_char *)(up + 1), length);
849 +#endif
850 else if (IS_SRC_OR_DST_PORT(OLSR_PORT))
851 olsr_print(ndo, (const u_char *)(up + 1), length,
852 (IP_V(ip) == 6) ? 1 : 0);
853 +#ifndef TCPDUMP_MINI
854 else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT))
855 lspping_print(ndo, (const u_char *)(up + 1), length);
856 else if (dport == BFD_CONTROL_PORT ||
857 @@ -669,10 +692,12 @@ udp_print(netdissect_options *ndo, regis
858 lwapp_control_print(ndo, (const u_char *)(up + 1), length, 0);
859 else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT))
860 lwapp_data_print(ndo, (const u_char *)(up + 1), length);
861 +#endif
862 else if (IS_SRC_OR_DST_PORT(SIP_PORT))
863 sip_print(ndo, (const u_char *)(up + 1), length);
864 else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT))
865 syslog_print(ndo, (const u_char *)(up + 1), length);
866 +#ifndef TCPDUMP_MINI
867 else if (IS_SRC_OR_DST_PORT(OTV_PORT))
868 otv_print(ndo, (const u_char *)(up + 1), length);
869 else if (IS_SRC_OR_DST_PORT(VXLAN_PORT))
870 @@ -689,7 +714,9 @@ udp_print(netdissect_options *ndo, regis
871 if (ndo->ndo_vflag)
872 ND_PRINT((ndo, "kip "));
873 llap_print(ndo, cp, length);
874 - } else {
875 + }
876 +#endif
877 + else {
878 if (ulen > length)
879 ND_PRINT((ndo, "UDP, bad length %u > %u",
880 ulen, length));