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