| 1 | --- a/Makefile.in |
| 2 | +++ b/Makefile.in |
| 3 | @@ -68,6 +68,22 @@ RANLIB = @RANLIB@ |
| 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-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 | @@ -99,6 +115,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 | @@ -361,10 +379,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 | @@ -547,10 +547,10 @@ linkaddr_string(const u_char *ep, const unsigned int type, const unsigned int le |
| 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 | @@ -1150,6 +1150,7 @@ init_addrtoname(u_int32_t localnet, u_int32_t mask) |
| 64 | init_ipxsaparray(); |
| 65 | } |
| 66 | |
| 67 | +#ifndef TCPDUMP_MINI |
| 68 | const char * |
| 69 | dnaddr_string(u_short dnaddr) |
| 70 | { |
| 71 | @@ -1169,6 +1170,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 | @@ -338,6 +338,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 | @@ -356,10 +357,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 | @@ -372,9 +376,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 | @@ -383,6 +389,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 | @@ -395,7 +402,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 | @@ -403,10 +410,12 @@ 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 | return (1); |
| 141 | +#endif |
| 142 | |
| 143 | case ETHERTYPE_LAT: |
| 144 | case ETHERTYPE_SCA: |
| 145 | --- a/print-gre.c |
| 146 | +++ b/print-gre.c |
| 147 | @@ -213,6 +213,7 @@ gre_print_0(const u_char *bp, u_int length) |
| 148 | ip6_print(gndo, bp, len); |
| 149 | break; |
| 150 | #endif |
| 151 | +#ifndef TCPDUMP_MINI |
| 152 | case ETHERTYPE_MPLS: |
| 153 | mpls_print(bp, len); |
| 154 | break; |
| 155 | @@ -228,6 +229,7 @@ gre_print_0(const u_char *bp, u_int length) |
| 156 | case ETHERTYPE_TEB: |
| 157 | ether_print(gndo, bp, len, len, NULL, NULL); |
| 158 | break; |
| 159 | +#endif |
| 160 | default: |
| 161 | printf("gre-proto-0x%x", prot); |
| 162 | } |
| 163 | --- a/print-igmp.c |
| 164 | +++ b/print-igmp.c |
| 165 | @@ -305,6 +305,7 @@ igmp_print(register const u_char *bp, register u_int len) |
| 166 | TCHECK2(bp[4], 4); |
| 167 | (void)printf("igmp leave %s", ipaddr_string(&bp[4])); |
| 168 | break; |
| 169 | +#ifndef TCPDUMP_MINI |
| 170 | case 0x13: |
| 171 | (void)printf("igmp dvmrp"); |
| 172 | if (len < 8) |
| 173 | @@ -316,6 +317,7 @@ igmp_print(register const u_char *bp, register u_int len) |
| 174 | (void)printf("igmp pimv1"); |
| 175 | pimv1_print(bp, len); |
| 176 | break; |
| 177 | +#endif |
| 178 | case 0x1e: |
| 179 | print_mresp(bp, len); |
| 180 | break; |
| 181 | --- a/print-ip.c |
| 182 | +++ b/print-ip.c |
| 183 | @@ -328,6 +328,7 @@ ip_print_demux(netdissect_options *ndo, |
| 184 | again: |
| 185 | switch (ipds->nh) { |
| 186 | |
| 187 | +#ifndef TCPDUMP_MINI |
| 188 | case IPPROTO_AH: |
| 189 | ipds->nh = *ipds->cp; |
| 190 | ipds->advance = ah_print(ipds->cp); |
| 191 | @@ -362,14 +363,16 @@ again: |
| 192 | ipds->nh = enh & 0xff; |
| 193 | goto again; |
| 194 | } |
| 195 | - |
| 196 | +#endif |
| 197 | case IPPROTO_SCTP: |
| 198 | sctp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len); |
| 199 | break; |
| 200 | |
| 201 | +#ifndef TCPDUMP_MINI |
| 202 | case IPPROTO_DCCP: |
| 203 | dccp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len); |
| 204 | break; |
| 205 | +#endif |
| 206 | |
| 207 | case IPPROTO_TCP: |
| 208 | /* pass on the MF bit plus the offset to detect fragments */ |
| 209 | @@ -389,6 +392,7 @@ again: |
| 210 | ipds->off & (IP_MF|IP_OFFMASK)); |
| 211 | break; |
| 212 | |
| 213 | +#ifndef TCPDUMP_MINI |
| 214 | case IPPROTO_PIGP: |
| 215 | /* |
| 216 | * XXX - the current IANA protocol number assignments |
| 217 | @@ -409,15 +413,16 @@ again: |
| 218 | case IPPROTO_EIGRP: |
| 219 | eigrp_print(ipds->cp, ipds->len); |
| 220 | break; |
| 221 | - |
| 222 | +#endif |
| 223 | case IPPROTO_ND: |
| 224 | ND_PRINT((ndo, " nd %d", ipds->len)); |
| 225 | break; |
| 226 | |
| 227 | +#ifndef TCPDUMP_MINI |
| 228 | case IPPROTO_EGP: |
| 229 | egp_print(ipds->cp, ipds->len); |
| 230 | break; |
| 231 | - |
| 232 | +#endif |
| 233 | case IPPROTO_OSPF: |
| 234 | ospf_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); |
| 235 | break; |
| 236 | @@ -451,10 +456,10 @@ again: |
| 237 | gre_print(ipds->cp, ipds->len); |
| 238 | break; |
| 239 | |
| 240 | +#ifndef TCPDUMP_MINI |
| 241 | case IPPROTO_MOBILE: |
| 242 | mobile_print(ipds->cp, ipds->len); |
| 243 | break; |
| 244 | - |
| 245 | case IPPROTO_PIM: |
| 246 | vec[0].ptr = ipds->cp; |
| 247 | vec[0].len = ipds->len; |
| 248 | @@ -480,7 +485,7 @@ again: |
| 249 | case IPPROTO_PGM: |
| 250 | pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); |
| 251 | break; |
| 252 | - |
| 253 | +#endif |
| 254 | default: |
| 255 | if ((proto = getprotobynumber(ipds->nh)) != NULL) |
| 256 | ND_PRINT((ndo, " %s", proto->p_name)); |
| 257 | --- a/print-ip6.c |
| 258 | +++ b/print-ip6.c |
| 259 | @@ -192,9 +192,11 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) |
| 260 | case IPPROTO_SCTP: |
| 261 | sctp_print(cp, (const u_char *)ip6, len); |
| 262 | return; |
| 263 | +#ifndef TCPDUMP_MINI |
| 264 | case IPPROTO_DCCP: |
| 265 | dccp_print(cp, (const u_char *)ip6, len); |
| 266 | return; |
| 267 | +#endif |
| 268 | case IPPROTO_TCP: |
| 269 | tcp_print(cp, len, (const u_char *)ip6, fragmented); |
| 270 | return; |
| 271 | @@ -204,6 +206,7 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) |
| 272 | case IPPROTO_ICMPV6: |
| 273 | icmp6_print(ndo, cp, len, (const u_char *)ip6, fragmented); |
| 274 | return; |
| 275 | +#ifndef TCPDUMP_MINI |
| 276 | case IPPROTO_AH: |
| 277 | advance = ah_print(cp); |
| 278 | nh = *cp; |
| 279 | @@ -228,7 +231,7 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) |
| 280 | pim_print(cp, len, nextproto6_cksum(ip6, cp, len, |
| 281 | IPPROTO_PIM)); |
| 282 | return; |
| 283 | - |
| 284 | +#endif |
| 285 | case IPPROTO_OSPF: |
| 286 | ospf6_print(cp, len); |
| 287 | return; |
| 288 | @@ -240,11 +243,11 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) |
| 289 | case IPPROTO_IPV4: |
| 290 | ip_print(ndo, cp, len); |
| 291 | return; |
| 292 | - |
| 293 | +#ifndef TCPDUMP_MINI |
| 294 | case IPPROTO_PGM: |
| 295 | pgm_print(cp, len, (const u_char *)ip6); |
| 296 | return; |
| 297 | - |
| 298 | +#endif |
| 299 | case IPPROTO_GRE: |
| 300 | gre_print(cp, len); |
| 301 | return; |
| 302 | --- a/print-llc.c |
| 303 | +++ b/print-llc.c |
| 304 | @@ -195,7 +195,7 @@ llc_print(const u_char *p, u_int length, u_int caplen, |
| 305 | control = EXTRACT_LE_16BITS(p + 2); |
| 306 | is_u = 0; |
| 307 | } |
| 308 | - |
| 309 | +#ifndef TCPDUMP_MINI |
| 310 | if (ssap_field == LLCSAP_GLOBAL && dsap_field == LLCSAP_GLOBAL) { |
| 311 | /* |
| 312 | * This is an Ethernet_802.3 IPX frame; it has an |
| 313 | @@ -218,6 +218,7 @@ llc_print(const u_char *p, u_int length, u_int caplen, |
| 314 | ipx_print(p, length); |
| 315 | return (1); |
| 316 | } |
| 317 | +#endif |
| 318 | |
| 319 | dsap = dsap_field & ~LLC_IG; |
| 320 | ssap = ssap_field & ~LLC_GSAP; |
| 321 | @@ -250,6 +251,7 @@ llc_print(const u_char *p, u_int length, u_int caplen, |
| 322 | return (1); |
| 323 | } |
| 324 | |
| 325 | +#ifndef TCPDUMP_MINI |
| 326 | if (ssap == LLCSAP_IPX && dsap == LLCSAP_IPX && |
| 327 | control == LLC_UI) { |
| 328 | /* |
| 329 | @@ -265,6 +267,7 @@ llc_print(const u_char *p, u_int length, u_int caplen, |
| 330 | ipx_print(p+3, length-3); |
| 331 | return (1); |
| 332 | } |
| 333 | +#endif |
| 334 | |
| 335 | #ifdef TCPDUMP_DO_SMB |
| 336 | if (ssap == LLCSAP_NETBEUI && dsap == LLCSAP_NETBEUI |
| 337 | @@ -296,11 +299,13 @@ llc_print(const u_char *p, u_int length, u_int caplen, |
| 338 | return (1); |
| 339 | } |
| 340 | #endif |
| 341 | +#ifndef TCPDUMP_MINI |
| 342 | if (ssap == LLCSAP_ISONS && dsap == LLCSAP_ISONS |
| 343 | && control == LLC_UI) { |
| 344 | isoclns_print(p + 3, length - 3, caplen - 3); |
| 345 | return (1); |
| 346 | } |
| 347 | +#endif |
| 348 | |
| 349 | if (ssap == LLCSAP_SNAP && dsap == LLCSAP_SNAP |
| 350 | && control == LLC_UI) { |
| 351 | @@ -443,6 +448,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad) |
| 352 | case PID_CISCO_CDP: |
| 353 | cdp_print(p, length, caplen); |
| 354 | return (1); |
| 355 | +#ifndef TCPDUMP_MINI |
| 356 | case PID_CISCO_DTP: |
| 357 | dtp_print(p, length); |
| 358 | return (1); |
| 359 | @@ -452,6 +458,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad) |
| 360 | case PID_CISCO_VTP: |
| 361 | vtp_print(p, length); |
| 362 | return (1); |
| 363 | +#endif |
| 364 | case PID_CISCO_PVST: |
| 365 | stp_print(p, length); |
| 366 | return (1); |
| 367 | @@ -482,6 +489,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad) |
| 368 | ether_print(gndo, p, length, caplen, NULL, NULL); |
| 369 | return (1); |
| 370 | |
| 371 | +#ifndef TCPDUMP_MINI |
| 372 | case PID_RFC2684_802_5_FCS: |
| 373 | case PID_RFC2684_802_5_NOFCS: |
| 374 | /* |
| 375 | @@ -523,6 +531,7 @@ snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad) |
| 376 | */ |
| 377 | fddi_print(p, length, caplen); |
| 378 | return (1); |
| 379 | +#endif |
| 380 | |
| 381 | case PID_RFC2684_BPDU: |
| 382 | stp_print(p, length); |
| 383 | --- a/print-null.c |
| 384 | +++ b/print-null.c |
| 385 | @@ -128,7 +128,7 @@ null_if_print(const struct pcap_pkthdr *h, const u_char *p) |
| 386 | ip6_print(gndo, p, length); |
| 387 | break; |
| 388 | #endif |
| 389 | - |
| 390 | +#ifndef TCPDUMP_MINI |
| 391 | case BSD_AFNUM_ISO: |
| 392 | isoclns_print(p, length, caplen); |
| 393 | break; |
| 394 | @@ -140,7 +140,7 @@ null_if_print(const struct pcap_pkthdr *h, const u_char *p) |
| 395 | case BSD_AFNUM_IPX: |
| 396 | ipx_print(p, length); |
| 397 | break; |
| 398 | - |
| 399 | +#endif |
| 400 | default: |
| 401 | /* unknown AF_ value */ |
| 402 | if (!eflag) |
| 403 | --- a/print-ppp.c |
| 404 | +++ b/print-ppp.c |
| 405 | @@ -1262,7 +1262,7 @@ trunc: |
| 406 | return 0; |
| 407 | } |
| 408 | |
| 409 | - |
| 410 | +#ifndef TCPDUMP_MINI |
| 411 | static void |
| 412 | ppp_hdlc(const u_char *p, int length) |
| 413 | { |
| 414 | @@ -1327,17 +1327,19 @@ cleanup: |
| 415 | free(b); |
| 416 | return; |
| 417 | } |
| 418 | +#endif |
| 419 | |
| 420 | |
| 421 | /* PPP */ |
| 422 | static void |
| 423 | handle_ppp(u_int proto, const u_char *p, int length) |
| 424 | { |
| 425 | +#ifndef TCPDUMP_MINI |
| 426 | if ((proto & 0xff00) == 0x7e00) {/* is this an escape code ? */ |
| 427 | ppp_hdlc(p-1, length); |
| 428 | return; |
| 429 | } |
| 430 | - |
| 431 | +#endif |
| 432 | switch (proto) { |
| 433 | case PPP_LCP: /* fall through */ |
| 434 | case PPP_IPCP: |
| 435 | @@ -1371,6 +1373,7 @@ handle_ppp(u_int proto, const u_char *p, int length) |
| 436 | ip6_print(gndo, p, length); |
| 437 | break; |
| 438 | #endif |
| 439 | +#ifndef TCPDUMP_MINI |
| 440 | case ETHERTYPE_IPX: /*XXX*/ |
| 441 | case PPP_IPX: |
| 442 | ipx_print(p, length); |
| 443 | @@ -1382,6 +1385,7 @@ handle_ppp(u_int proto, const u_char *p, int length) |
| 444 | case PPP_MPLS_MCAST: |
| 445 | mpls_print(p, length); |
| 446 | break; |
| 447 | +#endif |
| 448 | case PPP_COMP: |
| 449 | printf("compressed PPP data"); |
| 450 | break; |
| 451 | @@ -1520,6 +1524,7 @@ ppp_if_print(const struct pcap_pkthdr *h, register const u_char *p) |
| 452 | return (0); |
| 453 | } |
| 454 | |
| 455 | +#ifndef TCPDUMP_MINI |
| 456 | /* |
| 457 | * PPP I/F printer to use if we know that RFC 1662-style PPP in HDLC-like |
| 458 | * framing, or Cisco PPP with HDLC framing as per section 4.3.1 of RFC 1547, |
| 459 | @@ -1747,7 +1752,7 @@ printx: |
| 460 | #endif /* __bsdi__ */ |
| 461 | return (hdrlength); |
| 462 | } |
| 463 | - |
| 464 | +#endif |
| 465 | |
| 466 | /* |
| 467 | * Local Variables: |
| 468 | --- a/print-tcp.c |
| 469 | +++ b/print-tcp.c |
| 470 | @@ -652,8 +652,10 @@ tcp_print(register const u_char *bp, register u_int length, |
| 471 | else if (sport == SMB_PORT || dport == SMB_PORT) |
| 472 | smb_tcp_print(bp, length); |
| 473 | #endif |
| 474 | +#ifndef TCPDUMP_MINI |
| 475 | else if (sport == BEEP_PORT || dport == BEEP_PORT) |
| 476 | beep_print(bp, length); |
| 477 | +#endif |
| 478 | else if (length > 2 && |
| 479 | (sport == NAMESERVER_PORT || dport == NAMESERVER_PORT || |
| 480 | sport == MULTICASTDNS_PORT || dport == MULTICASTDNS_PORT)) { |
| 481 | @@ -662,6 +664,7 @@ tcp_print(register const u_char *bp, register u_int length, |
| 482 | * XXX packet could be unaligned, it can go strange |
| 483 | */ |
| 484 | ns_print(bp + 2, length - 2, 0); |
| 485 | +#ifndef TCPDUMP_MINI |
| 486 | } else if (sport == MSDP_PORT || dport == MSDP_PORT) { |
| 487 | msdp_print(bp, length); |
| 488 | } else if (sport == RPKI_RTR_PORT || dport == RPKI_RTR_PORT) { |
| 489 | @@ -669,6 +672,7 @@ tcp_print(register const u_char *bp, register u_int length, |
| 490 | } |
| 491 | else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) { |
| 492 | ldp_print(bp, length); |
| 493 | +#endif |
| 494 | } |
| 495 | |
| 496 | return; |
| 497 | --- a/print-udp.c |
| 498 | +++ b/print-udp.c |
| 499 | @@ -418,11 +418,12 @@ udp_print(register const u_char *bp, u_int length, |
| 500 | vat_print((void *)(up + 1), up); |
| 501 | break; |
| 502 | |
| 503 | +#ifndef TCPDUMP_MINI |
| 504 | case PT_WB: |
| 505 | udpipaddr_print(ip, sport, dport); |
| 506 | wb_print((void *)(up + 1), length); |
| 507 | break; |
| 508 | - |
| 509 | +#endif |
| 510 | case PT_RPC: |
| 511 | rp = (struct sunrpc_msg *)(up + 1); |
| 512 | direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction); |
| 513 | @@ -450,11 +451,12 @@ udp_print(register const u_char *bp, u_int length, |
| 514 | snmp_print((const u_char *)(up + 1), length); |
| 515 | break; |
| 516 | |
| 517 | +#ifndef TCPDUMP_MINI |
| 518 | case PT_CNFP: |
| 519 | udpipaddr_print(ip, sport, dport); |
| 520 | cnfp_print(cp, (const u_char *)ip); |
| 521 | break; |
| 522 | - |
| 523 | +#endif |
| 524 | case PT_TFTP: |
| 525 | udpipaddr_print(ip, sport, dport); |
| 526 | tftp_print(cp, length); |
| 527 | @@ -497,6 +499,7 @@ udp_print(register const u_char *bp, u_int length, |
| 528 | } |
| 529 | #endif |
| 530 | } |
| 531 | +#ifndef TCPDUMP_MINI |
| 532 | if (TTEST(((struct LAP *)cp)->type) && |
| 533 | ((struct LAP *)cp)->type == lapDDP && |
| 534 | (atalk_port(sport) || atalk_port(dport))) { |
| 535 | @@ -505,6 +508,7 @@ udp_print(register const u_char *bp, u_int length, |
| 536 | llap_print(cp, length); |
| 537 | return; |
| 538 | } |
| 539 | +#endif |
| 540 | } |
| 541 | udpipaddr_print(ip, sport, dport); |
| 542 | |
| 543 | @@ -555,14 +559,18 @@ udp_print(register const u_char *bp, u_int length, |
| 544 | ns_print((const u_char *)(up + 1), length, 0); |
| 545 | else if (ISPORT(MULTICASTDNS_PORT)) |
| 546 | ns_print((const u_char *)(up + 1), length, 1); |
| 547 | +#ifndef TCPDUMP_MINI |
| 548 | else if (ISPORT(TIMED_PORT)) |
| 549 | timed_print((const u_char *)(up + 1)); |
| 550 | +#endif |
| 551 | else if (ISPORT(TFTP_PORT)) |
| 552 | tftp_print((const u_char *)(up + 1), length); |
| 553 | else if (ISPORT(IPPORT_BOOTPC) || ISPORT(IPPORT_BOOTPS)) |
| 554 | bootp_print((const u_char *)(up + 1), length); |
| 555 | +#ifndef TCPDUMP_MINI |
| 556 | else if (ISPORT(RIP_PORT)) |
| 557 | rip_print((const u_char *)(up + 1), length); |
| 558 | +#endif |
| 559 | else if (ISPORT(AODV_PORT)) |
| 560 | aodv_print((const u_char *)(up + 1), length, |
| 561 | #ifdef INET6 |
| 562 | @@ -570,6 +578,7 @@ udp_print(register const u_char *bp, u_int length, |
| 563 | #else |
| 564 | 0); |
| 565 | #endif |
| 566 | +#ifndef TCPDUMP_MINI |
| 567 | else if (ISPORT(ISAKMP_PORT)) |
| 568 | isakmp_print(gndo, (const u_char *)(up + 1), length, bp2); |
| 569 | else if (ISPORT(ISAKMP_PORT_NATT)) |
| 570 | @@ -578,12 +587,15 @@ udp_print(register const u_char *bp, u_int length, |
| 571 | else if (ISPORT(ISAKMP_PORT_USER1) || ISPORT(ISAKMP_PORT_USER2)) |
| 572 | isakmp_print(gndo, (const u_char *)(up + 1), length, bp2); |
| 573 | #endif |
| 574 | +#endif |
| 575 | else if (ISPORT(SNMP_PORT) || ISPORT(SNMPTRAP_PORT)) |
| 576 | snmp_print((const u_char *)(up + 1), length); |
| 577 | else if (ISPORT(NTP_PORT)) |
| 578 | ntp_print((const u_char *)(up + 1), length); |
| 579 | +#ifndef TCPDUMP_MINI |
| 580 | else if (ISPORT(KERBEROS_PORT) || ISPORT(KERBEROS_SEC_PORT)) |
| 581 | krb_print((const void *)(up + 1)); |
| 582 | +#endif |
| 583 | else if (ISPORT(L2TP_PORT)) |
| 584 | l2tp_print((const u_char *)(up + 1), length); |
| 585 | #ifdef TCPDUMP_DO_SMB |
| 586 | @@ -594,6 +606,7 @@ udp_print(register const u_char *bp, u_int length, |
| 587 | #endif |
| 588 | else if (dport == 3456) |
| 589 | vat_print((const void *)(up + 1), up); |
| 590 | +#ifndef TCPDUMP_MINI |
| 591 | else if (ISPORT(ZEPHYR_SRV_PORT) || ISPORT(ZEPHYR_CLT_PORT)) |
| 592 | zephyr_print((const void *)(up + 1), length); |
| 593 | /* |
| 594 | @@ -604,6 +617,7 @@ udp_print(register const u_char *bp, u_int length, |
| 595 | (dport >= RX_PORT_LOW && dport <= RX_PORT_HIGH)) |
| 596 | rx_print((const void *)(up + 1), length, sport, dport, |
| 597 | (u_char *) ip); |
| 598 | +#endif |
| 599 | #ifdef INET6 |
| 600 | else if (ISPORT(RIPNG_PORT)) |
| 601 | ripng_print((const u_char *)(up + 1), length); |
| 602 | @@ -615,21 +629,25 @@ udp_print(register const u_char *bp, u_int length, |
| 603 | /* |
| 604 | * Kludge in test for whiteboard packets. |
| 605 | */ |
| 606 | +#ifndef TCPDUMP_MINI |
| 607 | else if (dport == 4567) |
| 608 | wb_print((const void *)(up + 1), length); |
| 609 | else if (ISPORT(CISCO_AUTORP_PORT)) |
| 610 | cisco_autorp_print((const void *)(up + 1), length); |
| 611 | +#endif |
| 612 | else if (ISPORT(RADIUS_PORT) || |
| 613 | ISPORT(RADIUS_NEW_PORT) || |
| 614 | ISPORT(RADIUS_ACCOUNTING_PORT) || |
| 615 | ISPORT(RADIUS_NEW_ACCOUNTING_PORT) ) |
| 616 | radius_print((const u_char *)(up+1), length); |
| 617 | +#ifndef TCPDUMP_MINI |
| 618 | else if (dport == HSRP_PORT) |
| 619 | hsrp_print((const u_char *)(up + 1), length); |
| 620 | else if (ISPORT(LWRES_PORT)) |
| 621 | lwres_print((const u_char *)(up + 1), length); |
| 622 | else if (ISPORT(LDP_PORT)) |
| 623 | ldp_print((const u_char *)(up + 1), length); |
| 624 | +#endif |
| 625 | else if (ISPORT(OLSR_PORT)) |
| 626 | olsr_print((const u_char *)(up + 1), length, |
| 627 | #if INET6 |
| 628 | @@ -637,6 +655,7 @@ udp_print(register const u_char *bp, u_int length, |
| 629 | #else |
| 630 | 0); |
| 631 | #endif |
| 632 | +#ifndef TCPDUMP_MINI |
| 633 | else if (ISPORT(MPLS_LSP_PING_PORT)) |
| 634 | lspping_print((const u_char *)(up + 1), length); |
| 635 | else if (dport == BFD_CONTROL_PORT || |
| 636 | @@ -654,6 +673,7 @@ udp_print(register const u_char *bp, u_int length, |
| 637 | lwapp_control_print((const u_char *)(up + 1), length, 0); |
| 638 | else if (ISPORT(LWAPP_DATA_PORT)) |
| 639 | lwapp_data_print((const u_char *)(up + 1), length); |
| 640 | +#endif |
| 641 | else if (ISPORT(SIP_PORT)) |
| 642 | sip_print((const u_char *)(up + 1), length); |
| 643 | else if (ISPORT(SYSLOG_PORT)) |
| 644 | --- a/tcpdump.c |
| 645 | +++ b/tcpdump.c |
| 646 | @@ -148,6 +148,7 @@ struct ndo_printer { |
| 647 | |
| 648 | |
| 649 | static struct printer printers[] = { |
| 650 | +#ifndef TCPDUMP_MINI |
| 651 | { arcnet_if_print, DLT_ARCNET }, |
| 652 | #ifdef DLT_ARCNET_LINUX |
| 653 | { arcnet_linux_if_print, DLT_ARCNET_LINUX }, |
| 654 | @@ -166,19 +167,23 @@ static struct printer printers[] = { |
| 655 | #ifdef DLT_SLIP_BSDOS |
| 656 | { sl_bsdos_if_print, DLT_SLIP_BSDOS }, |
| 657 | #endif |
| 658 | +#endif |
| 659 | { ppp_if_print, DLT_PPP }, |
| 660 | #ifdef DLT_PPP_WITHDIRECTION |
| 661 | { ppp_if_print, DLT_PPP_WITHDIRECTION }, |
| 662 | #endif |
| 663 | +#ifndef TCPDUMP_MINI |
| 664 | #ifdef DLT_PPP_BSDOS |
| 665 | { ppp_bsdos_if_print, DLT_PPP_BSDOS }, |
| 666 | #endif |
| 667 | { fddi_if_print, DLT_FDDI }, |
| 668 | +#endif |
| 669 | { null_if_print, DLT_NULL }, |
| 670 | #ifdef DLT_LOOP |
| 671 | { null_if_print, DLT_LOOP }, |
| 672 | #endif |
| 673 | { raw_if_print, DLT_RAW }, |
| 674 | +#ifndef TCPDUMP_MINI |
| 675 | { atm_if_print, DLT_ATM_RFC1483 }, |
| 676 | #ifdef DLT_C_HDLC |
| 677 | { chdlc_if_print, DLT_C_HDLC }, |
| 678 | @@ -189,15 +194,19 @@ static struct printer printers[] = { |
| 679 | #ifdef DLT_PPP_SERIAL |
| 680 | { ppp_hdlc_if_print, DLT_PPP_SERIAL }, |
| 681 | #endif |
| 682 | +#endif |
| 683 | #ifdef DLT_PPP_ETHER |
| 684 | { pppoe_if_print, DLT_PPP_ETHER }, |
| 685 | #endif |
| 686 | +#ifndef TCPDUMP_MINI |
| 687 | #ifdef DLT_LINUX_SLL |
| 688 | { sll_if_print, DLT_LINUX_SLL }, |
| 689 | #endif |
| 690 | +#endif |
| 691 | #ifdef DLT_IEEE802_11 |
| 692 | { ieee802_11_if_print, DLT_IEEE802_11}, |
| 693 | #endif |
| 694 | +#ifndef TCPDUMP_MINI |
| 695 | #ifdef DLT_LTALK |
| 696 | { ltalk_if_print, DLT_LTALK }, |
| 697 | #endif |
| 698 | @@ -216,12 +225,14 @@ static struct printer printers[] = { |
| 699 | #ifdef DLT_IP_OVER_FC |
| 700 | { ipfc_if_print, DLT_IP_OVER_FC }, |
| 701 | #endif |
| 702 | +#endif |
| 703 | #ifdef DLT_PRISM_HEADER |
| 704 | { prism_if_print, DLT_PRISM_HEADER }, |
| 705 | #endif |
| 706 | #ifdef DLT_IEEE802_11_RADIO |
| 707 | { ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO }, |
| 708 | #endif |
| 709 | +#ifndef TCPDUMP_MINI |
| 710 | #ifdef DLT_ENC |
| 711 | { enc_if_print, DLT_ENC }, |
| 712 | #endif |
| 713 | @@ -231,9 +242,11 @@ static struct printer printers[] = { |
| 714 | #ifdef DLT_APPLE_IP_OVER_IEEE1394 |
| 715 | { ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 }, |
| 716 | #endif |
| 717 | +#endif |
| 718 | #ifdef DLT_IEEE802_11_RADIO_AVS |
| 719 | { ieee802_11_radio_avs_if_print, DLT_IEEE802_11_RADIO_AVS }, |
| 720 | #endif |
| 721 | +#ifndef TCPDUMP_MINI |
| 722 | #ifdef DLT_JUNIPER_ATM1 |
| 723 | { juniper_atm1_print, DLT_JUNIPER_ATM1 }, |
| 724 | #endif |
| 725 | @@ -299,6 +312,7 @@ static struct printer printers[] = { |
| 726 | #ifdef DLT_IPV6 |
| 727 | { raw_if_print, DLT_IPV6 }, |
| 728 | #endif |
| 729 | +#endif |
| 730 | { NULL, 0 }, |
| 731 | }; |
| 732 | |
| 733 | @@ -307,6 +321,7 @@ static struct ndo_printer ndo_printers[] = { |
| 734 | #ifdef DLT_IPNET |
| 735 | { ipnet_if_print, DLT_IPNET }, |
| 736 | #endif |
| 737 | +#ifndef TCPDUMP_MINI |
| 738 | #ifdef DLT_IEEE802_15_4 |
| 739 | { ieee802_15_4_if_print, DLT_IEEE802_15_4 }, |
| 740 | #endif |
| 741 | @@ -316,6 +331,7 @@ static struct ndo_printer ndo_printers[] = { |
| 742 | #ifdef DLT_PPI |
| 743 | { ppi_if_print, DLT_PPI }, |
| 744 | #endif |
| 745 | +#endif |
| 746 | #ifdef DLT_NETANALYZER |
| 747 | { netanalyzer_if_print, DLT_NETANALYZER }, |
| 748 | #endif |
| 749 | |