b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 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 | @@ -677,8 +677,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 | @@ -1257,6 +1259,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 | @@ -1273,6 +1276,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 | @@ -543,6 +543,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 | @@ -573,6 +574,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 | @@ -585,9 +587,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 | @@ -596,6 +600,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 | @@ -608,19 +613,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 | @@ -650,6 +659,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 | @@ -205,6 +205,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 | @@ -217,6 +218,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 | @@ -1369,7 +1369,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 | @@ -1377,7 +1377,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 | @@ -267,6 +267,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 | @@ -278,6 +279,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 | @@ -46,6 +46,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 | @@ -83,7 +84,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 | @@ -91,7 +94,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 | @@ -120,6 +123,7 @@ again: |
| 284 | } |
| 285 | break; |
| 286 | |
| 287 | +#ifndef TCPDUMP_MINI |
| 288 | case IPPROTO_PIGP: |
| 289 | /* |
| 290 | * XXX - the current IANA protocol number assignments |
| 291 | @@ -140,14 +144,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 | @@ -184,6 +191,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 | @@ -203,6 +211,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 | @@ -133,10 +133,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 | @@ -371,6 +372,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 | @@ -401,7 +403,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 | @@ -205,6 +205,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 | @@ -227,6 +228,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 | @@ -290,6 +292,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 | @@ -303,6 +306,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 | @@ -321,12 +325,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 | @@ -482,6 +487,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 | @@ -494,6 +500,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 | @@ -506,6 +513,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 | @@ -567,6 +575,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 | @@ -114,6 +114,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 | @@ -125,6 +126,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 | @@ -1354,6 +1354,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 | nd_pop_packet_info(ndo); |
| 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 | @@ -463,12 +463,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 | @@ -612,6 +612,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 | @@ -635,7 +636,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 | @@ -720,6 +721,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 | @@ -735,12 +737,15 @@ tcp_print(netdissect_options *ndo, |
| 561 | } |
| 562 | return; |
| 563 | } |
| 564 | +#endif |
| 565 | |
| 566 | if (IS_SRC_OR_DST_PORT(FTP_PORT)) { |
| 567 | ND_PRINT(": "); |
| 568 | ftp_print(ndo, bp, length); |
| 569 | +#ifndef TCPDUMP_MINI |
| 570 | } else if (IS_SRC_OR_DST_PORT(SSH_PORT)) { |
| 571 | ssh_print(ndo, bp, length); |
| 572 | +#endif |
| 573 | } else if (IS_SRC_OR_DST_PORT(TELNET_PORT)) { |
| 574 | telnet_print(ndo, bp, length); |
| 575 | } else if (IS_SRC_OR_DST_PORT(SMTP_PORT)) { |
| 576 | @@ -759,10 +764,12 @@ tcp_print(netdissect_options *ndo, |
| 577 | } else if (IS_SRC_OR_DST_PORT(NETBIOS_SSN_PORT)) { |
| 578 | nbt_tcp_print(ndo, bp, length); |
| 579 | #endif |
| 580 | +#ifndef TCPDUMP_MINI |
| 581 | } else if (IS_SRC_OR_DST_PORT(BGP_PORT)) { |
| 582 | - bgp_print(ndo, bp, length); |
| 583 | + bgp_print(ndo, bp, length); |
| 584 | } else if (IS_SRC_OR_DST_PORT(RPKI_RTR_PORT)) { |
| 585 | rpki_rtr_print(ndo, bp, length); |
| 586 | +#endif |
| 587 | #ifdef ENABLE_SMB |
| 588 | } else if (IS_SRC_OR_DST_PORT(SMB_PORT)) { |
| 589 | smb_tcp_print(ndo, bp, length); |
| 590 | @@ -770,18 +777,22 @@ tcp_print(netdissect_options *ndo, |
| 591 | } else if (IS_SRC_OR_DST_PORT(RTSP_PORT)) { |
| 592 | ND_PRINT(": "); |
| 593 | rtsp_print(ndo, bp, length); |
| 594 | +#ifndef TCPDUMP_MINI |
| 595 | } else if (IS_SRC_OR_DST_PORT(MSDP_PORT)) { |
| 596 | msdp_print(ndo, bp, length); |
| 597 | } else if (IS_SRC_OR_DST_PORT(LDP_PORT)) { |
| 598 | ldp_print(ndo, bp, length); |
| 599 | - } else if (IS_SRC_OR_DST_PORT(PPTP_PORT)) |
| 600 | +#endif |
| 601 | + } else if (IS_SRC_OR_DST_PORT(PPTP_PORT)) { |
| 602 | pptp_print(ndo, bp); |
| 603 | - else if (IS_SRC_OR_DST_PORT(REDIS_PORT)) |
| 604 | +#ifndef TCPDUMP_MINI |
| 605 | + } else if (IS_SRC_OR_DST_PORT(REDIS_PORT)) |
| 606 | resp_print(ndo, bp, length); |
| 607 | else if (IS_SRC_OR_DST_PORT(BEEP_PORT)) |
| 608 | beep_print(ndo, bp, length); |
| 609 | else if (IS_SRC_OR_DST_PORT(OPENFLOW_PORT_OLD) || IS_SRC_OR_DST_PORT(OPENFLOW_PORT_IANA)) { |
| 610 | openflow_print(ndo, bp, length); |
| 611 | +#endif |
| 612 | } else if (IS_SRC_OR_DST_PORT(HTTP_PORT_ALT)) { |
| 613 | ND_PRINT(": "); |
| 614 | http_print(ndo, bp, length); |
| 615 | --- a/print-udp.c |
| 616 | +++ b/print-udp.c |
| 617 | @@ -433,10 +433,12 @@ udp_print(netdissect_options *ndo, const |
| 618 | vat_print(ndo, cp, length); |
| 619 | break; |
| 620 | |
| 621 | +#ifndef TCPDUMP_MINI |
| 622 | case PT_WB: |
| 623 | udpipaddr_print(ndo, ip, sport, dport); |
| 624 | wb_print(ndo, cp, length); |
| 625 | break; |
| 626 | +#endif |
| 627 | |
| 628 | case PT_RPC: |
| 629 | rp = (const struct sunrpc_msg *)cp; |
| 630 | @@ -465,10 +467,12 @@ udp_print(netdissect_options *ndo, const |
| 631 | snmp_print(ndo, cp, length); |
| 632 | break; |
| 633 | |
| 634 | +#ifndef TCPDUMP_MINI |
| 635 | case PT_CNFP: |
| 636 | udpipaddr_print(ndo, ip, sport, dport); |
| 637 | cnfp_print(ndo, cp); |
| 638 | break; |
| 639 | +#endif |
| 640 | |
| 641 | case PT_TFTP: |
| 642 | udpipaddr_print(ndo, ip, sport, dport); |
| 643 | @@ -485,6 +489,7 @@ udp_print(netdissect_options *ndo, const |
| 644 | radius_print(ndo, cp, length); |
| 645 | break; |
| 646 | |
| 647 | +#ifndef TCPDUMP_MINI |
| 648 | case PT_VXLAN: |
| 649 | udpipaddr_print(ndo, ip, sport, dport); |
| 650 | vxlan_print(ndo, cp, length); |
| 651 | @@ -507,6 +512,7 @@ udp_print(netdissect_options *ndo, const |
| 652 | udpipaddr_print(ndo, ip, sport, dport); |
| 653 | someip_print(ndo, cp, length); |
| 654 | break; |
| 655 | +#endif |
| 656 | case PT_DOMAIN: |
| 657 | udpipaddr_print(ndo, ip, sport, dport); |
| 658 | /* over_tcp: FALSE, is_mdns: FALSE */ |
| 659 | @@ -594,8 +600,12 @@ udp_print(netdissect_options *ndo, const |
| 660 | bootp_print(ndo, cp, length); |
| 661 | else if (IS_SRC_OR_DST_PORT(TFTP_PORT)) |
| 662 | tftp_print(ndo, cp, length); |
| 663 | +#ifndef TCPDUMP_MINI |
| 664 | +#ifdef ENABLE_SMB |
| 665 | else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT)) |
| 666 | krb_print(ndo, (const u_char *)cp); |
| 667 | +#endif |
| 668 | +#endif |
| 669 | else if (IS_SRC_OR_DST_PORT(NTP_PORT)) |
| 670 | ntp_print(ndo, cp, length); |
| 671 | #ifdef ENABLE_SMB |
| 672 | @@ -607,6 +617,7 @@ udp_print(netdissect_options *ndo, const |
| 673 | else if (IS_SRC_OR_DST_PORT(SNMP_PORT) || |
| 674 | IS_SRC_OR_DST_PORT(SNMPTRAP_PORT)) |
| 675 | snmp_print(ndo, cp, length); |
| 676 | +#ifndef TCPDUMP_MINI |
| 677 | else if (IS_SRC_OR_DST_PORT(PTP_EVENT_PORT) || |
| 678 | IS_SRC_OR_DST_PORT(PTP_GENERAL_PORT)) |
| 679 | ptp_print(ndo, cp, length); |
| 680 | @@ -614,38 +625,50 @@ udp_print(netdissect_options *ndo, const |
| 681 | cisco_autorp_print(ndo, cp, length); |
| 682 | else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT)) |
| 683 | isakmp_print(ndo, cp, length, bp2); |
| 684 | +#endif |
| 685 | else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT)) |
| 686 | syslog_print(ndo, cp, length); |
| 687 | +#ifndef TCPDUMP_MINI |
| 688 | else if (IS_SRC_OR_DST_PORT(RIP_PORT)) |
| 689 | rip_print(ndo, cp, length); |
| 690 | else if (IS_SRC_OR_DST_PORT(RIPNG_PORT)) |
| 691 | ripng_print(ndo, cp, length); |
| 692 | else if (IS_SRC_OR_DST_PORT(TIMED_PORT)) |
| 693 | timed_print(ndo, (const u_char *)cp); |
| 694 | +#endif |
| 695 | else if (IS_SRC_OR_DST_PORT(DHCP6_SERV_PORT) || |
| 696 | IS_SRC_OR_DST_PORT(DHCP6_CLI_PORT)) |
| 697 | dhcp6_print(ndo, cp, length); |
| 698 | +#ifndef TCPDUMP_MINI |
| 699 | else if (IS_SRC_OR_DST_PORT(LDP_PORT)) |
| 700 | ldp_print(ndo, cp, length); |
| 701 | else if (IS_SRC_OR_DST_PORT(AODV_PORT)) |
| 702 | aodv_print(ndo, cp, length, IP_V(ip) == 6); |
| 703 | +#endif |
| 704 | else if (IS_SRC_OR_DST_PORT(OLSR_PORT)) |
| 705 | olsr_print(ndo, cp, length, IP_V(ip) == 6); |
| 706 | +#ifndef TCPDUMP_MINI |
| 707 | else if (IS_SRC_OR_DST_PORT(LMP_PORT)) |
| 708 | lmp_print(ndo, cp, length); |
| 709 | +#ifdef ENABLE_SMB |
| 710 | else if (IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT)) |
| 711 | krb_print(ndo, (const u_char *)cp); |
| 712 | +#endif |
| 713 | else if (IS_SRC_OR_DST_PORT(LWRES_PORT)) |
| 714 | lwres_print(ndo, cp, length); |
| 715 | else if (IS_SRC_OR_DST_PORT(MULTICASTDNS_PORT)) |
| 716 | /* over_tcp: FALSE, is_mdns: TRUE */ |
| 717 | domain_print(ndo, cp, length, FALSE, TRUE); |
| 718 | +#ifdef ENABLE_SMB |
| 719 | else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT)) |
| 720 | isakmp_rfc3948_print(ndo, cp, length, bp2, IP_V(ip), fragmented, ttl_hl); |
| 721 | else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2)) |
| 722 | isakmp_print(ndo, cp, length, bp2); |
| 723 | +#endif |
| 724 | +#endif |
| 725 | else if (IS_SRC_OR_DST_PORT(L2TP_PORT)) |
| 726 | l2tp_print(ndo, cp, length); |
| 727 | +#ifndef TCPDUMP_MINI |
| 728 | else if (dport == VAT_PORT) |
| 729 | vat_print(ndo, cp, length); |
| 730 | else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT)) |
| 731 | @@ -669,6 +692,7 @@ udp_print(netdissect_options *ndo, const |
| 732 | */ |
| 733 | else if (dport == WB_PORT) |
| 734 | wb_print(ndo, cp, length); |
| 735 | +#endif |
| 736 | else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) || |
| 737 | IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT) || |
| 738 | IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT) || |
| 739 | @@ -676,6 +700,7 @@ udp_print(netdissect_options *ndo, const |
| 740 | IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT) || |
| 741 | IS_SRC_OR_DST_PORT(RADIUS_COA_PORT) ) |
| 742 | radius_print(ndo, cp, length); |
| 743 | +#ifndef TCPDUMP_MINI |
| 744 | else if (dport == HSRP_PORT) |
| 745 | hsrp_print(ndo, cp, length); |
| 746 | else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT)) |
| 747 | @@ -695,8 +720,10 @@ udp_print(netdissect_options *ndo, const |
| 748 | lwapp_control_print(ndo, cp, length, 0); |
| 749 | else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT)) |
| 750 | lwapp_data_print(ndo, cp, length); |
| 751 | +#endif |
| 752 | else if (IS_SRC_OR_DST_PORT(SIP_PORT)) |
| 753 | sip_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 | @@ -721,6 +748,7 @@ udp_print(netdissect_options *ndo, const |
| 759 | someip_print(ndo, cp, length); |
| 760 | else if (sport == BCM_LI_PORT) |
| 761 | bcm_li_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 | @@ -46,6 +46,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 | @@ -84,7 +85,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 | @@ -92,6 +95,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 | @@ -101,6 +105,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 | @@ -113,9 +118,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 | @@ -170,19 +177,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 | @@ -198,6 +209,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 | @@ -209,6 +221,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 | @@ -241,6 +254,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 | |