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