100-tcpdump_mini.patch 22 KB

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