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. @@ -680,8 +680,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. @@ -1260,6 +1262,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. @@ -1276,6 +1279,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. @@ -545,6 +545,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. @@ -575,6 +576,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. @@ -587,9 +589,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. @@ -598,6 +602,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. @@ -610,19 +615,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. @@ -652,6 +661,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. @@ -207,6 +207,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. @@ -219,6 +220,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. @@ -1371,7 +1371,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. @@ -1379,7 +1379,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. @@ -269,6 +269,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. @@ -280,6 +281,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. @@ -48,6 +48,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. @@ -85,7 +86,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. @@ -93,7 +96,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. @@ -122,6 +125,7 @@ again:
  263. }
  264. break;
  265. +#ifndef TCPDUMP_MINI
  266. case IPPROTO_PIGP:
  267. /*
  268. * XXX - the current IANA protocol number assignments
  269. @@ -142,14 +146,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. @@ -186,6 +193,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. @@ -205,6 +213,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. @@ -135,10 +135,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. @@ -375,6 +376,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. @@ -405,7 +407,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. @@ -207,6 +207,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. @@ -229,6 +230,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. @@ -292,6 +294,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. @@ -305,6 +308,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. @@ -323,12 +327,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. @@ -484,6 +489,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. @@ -496,6 +502,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. @@ -508,6 +515,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. @@ -569,6 +577,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. @@ -116,6 +116,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. @@ -127,6 +128,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. @@ -1355,6 +1355,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. ndo->ndo_snapend = se;
  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. @@ -465,12 +465,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. @@ -614,6 +614,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. @@ -637,7 +638,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. @@ -722,6 +723,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. @@ -737,6 +739,7 @@ tcp_print(netdissect_options *ndo,
  517. }
  518. return;
  519. }
  520. +#endif
  521. if (IS_SRC_OR_DST_PORT(TELNET_PORT)) {
  522. telnet_print(ndo, bp, length);
  523. @@ -746,24 +749,31 @@ tcp_print(netdissect_options *ndo,
  524. } else if (IS_SRC_OR_DST_PORT(WHOIS_PORT)) {
  525. ND_PRINT(": ");
  526. whois_print(ndo, bp, length);
  527. - } else if (IS_SRC_OR_DST_PORT(BGP_PORT))
  528. + }
  529. +#ifndef TCPDUMP_MINI
  530. + else if (IS_SRC_OR_DST_PORT(BGP_PORT))
  531. bgp_print(ndo, bp, length);
  532. +#endif
  533. else if (IS_SRC_OR_DST_PORT(PPTP_PORT))
  534. pptp_print(ndo, bp);
  535. +#ifndef TCPDUMP_MINI
  536. else if (IS_SRC_OR_DST_PORT(REDIS_PORT))
  537. resp_print(ndo, bp, length);
  538. else if (IS_SRC_OR_DST_PORT(SSH_PORT))
  539. ssh_print(ndo, bp, length);
  540. +#endif
  541. #ifdef ENABLE_SMB
  542. else if (IS_SRC_OR_DST_PORT(NETBIOS_SSN_PORT))
  543. nbt_tcp_print(ndo, bp, length);
  544. else if (IS_SRC_OR_DST_PORT(SMB_PORT))
  545. smb_tcp_print(ndo, bp, length);
  546. #endif
  547. +#ifndef TCPDUMP_MINI
  548. else if (IS_SRC_OR_DST_PORT(BEEP_PORT))
  549. beep_print(ndo, bp, length);
  550. else if (IS_SRC_OR_DST_PORT(OPENFLOW_PORT_OLD) || IS_SRC_OR_DST_PORT(OPENFLOW_PORT_IANA))
  551. openflow_print(ndo, bp, length);
  552. +#endif
  553. else if (IS_SRC_OR_DST_PORT(FTP_PORT)) {
  554. ND_PRINT(": ");
  555. ftp_print(ndo, bp, length);
  556. @@ -776,12 +786,14 @@ tcp_print(netdissect_options *ndo,
  557. } else if (IS_SRC_OR_DST_PORT(NAMESERVER_PORT)) {
  558. /* over_tcp: TRUE, is_mdns: FALSE */
  559. domain_print(ndo, bp, length, TRUE, FALSE);
  560. +#ifndef TCPDUMP_MINI
  561. } else if (IS_SRC_OR_DST_PORT(MSDP_PORT)) {
  562. msdp_print(ndo, bp, length);
  563. } else if (IS_SRC_OR_DST_PORT(RPKI_RTR_PORT)) {
  564. rpki_rtr_print(ndo, bp, length);
  565. } else if (IS_SRC_OR_DST_PORT(LDP_PORT)) {
  566. ldp_print(ndo, bp, length);
  567. +#endif
  568. } else if ((IS_SRC_OR_DST_PORT(NFS_PORT)) &&
  569. length >= 4 && ND_TTEST_4(bp)) {
  570. /*
  571. --- a/print-udp.c
  572. +++ b/print-udp.c
  573. @@ -435,10 +435,12 @@ udp_print(netdissect_options *ndo, const
  574. vat_print(ndo, cp, length);
  575. break;
  576. +#ifndef TCPDUMP_MINI
  577. case PT_WB:
  578. udpipaddr_print(ndo, ip, sport, dport);
  579. wb_print(ndo, cp, length);
  580. break;
  581. +#endif
  582. case PT_RPC:
  583. rp = (const struct sunrpc_msg *)cp;
  584. @@ -467,10 +469,12 @@ udp_print(netdissect_options *ndo, const
  585. snmp_print(ndo, cp, length);
  586. break;
  587. +#ifndef TCPDUMP_MINI
  588. case PT_CNFP:
  589. udpipaddr_print(ndo, ip, sport, dport);
  590. cnfp_print(ndo, cp);
  591. break;
  592. +#endif
  593. case PT_TFTP:
  594. udpipaddr_print(ndo, ip, sport, dport);
  595. @@ -488,6 +492,7 @@ udp_print(netdissect_options *ndo, const
  596. radius_print(ndo, cp, length);
  597. break;
  598. +#ifndef TCPDUMP_MINI
  599. case PT_VXLAN:
  600. udpipaddr_print(ndo, ip, sport, dport);
  601. vxlan_print(ndo, cp, length);
  602. @@ -510,6 +515,7 @@ udp_print(netdissect_options *ndo, const
  603. udpipaddr_print(ndo, ip, sport, dport);
  604. someip_print(ndo, cp, length);
  605. break;
  606. +#endif
  607. case PT_DOMAIN:
  608. udpipaddr_print(ndo, ip, sport, dport);
  609. /* over_tcp: FALSE, is_mdns: FALSE */
  610. @@ -596,29 +602,37 @@ udp_print(netdissect_options *ndo, const
  611. else if (IS_SRC_OR_DST_PORT(MULTICASTDNS_PORT))
  612. /* over_tcp: FALSE, is_mdns: TRUE */
  613. domain_print(ndo, cp, length, FALSE, TRUE);
  614. +#ifndef TCPDUMP_MINI
  615. else if (IS_SRC_OR_DST_PORT(TIMED_PORT))
  616. timed_print(ndo, (const u_char *)cp);
  617. +#endif
  618. else if (IS_SRC_OR_DST_PORT(TFTP_PORT))
  619. tftp_print(ndo, cp, length);
  620. else if (IS_SRC_OR_DST_PORT(BOOTPC_PORT) || IS_SRC_OR_DST_PORT(BOOTPS_PORT))
  621. bootp_print(ndo, cp, length);
  622. +#ifndef TCPDUMP_MINI
  623. else if (IS_SRC_OR_DST_PORT(RIP_PORT))
  624. rip_print(ndo, cp, length);
  625. +#endif
  626. else if (IS_SRC_OR_DST_PORT(AODV_PORT))
  627. aodv_print(ndo, cp, length,
  628. ip6 != NULL);
  629. +#ifndef TCPDUMP_MINI
  630. else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT))
  631. isakmp_print(ndo, cp, length, bp2);
  632. else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_NATT))
  633. isakmp_rfc3948_print(ndo, cp, length, bp2, IP_V(ip), fragmented, ttl_hl);
  634. else if (IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER1) || IS_SRC_OR_DST_PORT(ISAKMP_PORT_USER2))
  635. isakmp_print(ndo, cp, length, bp2);
  636. +#endif
  637. else if (IS_SRC_OR_DST_PORT(SNMP_PORT) || IS_SRC_OR_DST_PORT(SNMPTRAP_PORT))
  638. snmp_print(ndo, cp, length);
  639. else if (IS_SRC_OR_DST_PORT(NTP_PORT))
  640. ntp_print(ndo, cp, length);
  641. +#ifndef TCPDUMP_MINI
  642. else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT))
  643. krb_print(ndo, (const u_char *)cp);
  644. +#endif
  645. else if (IS_SRC_OR_DST_PORT(L2TP_PORT))
  646. l2tp_print(ndo, cp, length);
  647. #ifdef ENABLE_SMB
  648. @@ -629,6 +643,7 @@ udp_print(netdissect_options *ndo, const
  649. #endif
  650. else if (dport == VAT_PORT)
  651. vat_print(ndo, cp, length);
  652. +#ifndef TCPDUMP_MINI
  653. else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT))
  654. zephyr_print(ndo, cp, length);
  655. /*
  656. @@ -641,8 +656,11 @@ udp_print(netdissect_options *ndo, const
  657. (const u_char *) ip);
  658. else if (IS_SRC_OR_DST_PORT(RIPNG_PORT))
  659. ripng_print(ndo, cp, length);
  660. +#endif
  661. +
  662. else if (IS_SRC_OR_DST_PORT(DHCP6_SERV_PORT) || IS_SRC_OR_DST_PORT(DHCP6_CLI_PORT))
  663. dhcp6_print(ndo, cp, length);
  664. +#ifndef TCPDUMP_MINI
  665. else if (IS_SRC_OR_DST_PORT(AHCP_PORT))
  666. ahcp_print(ndo, cp, length);
  667. else if (IS_SRC_OR_DST_PORT(BABEL_PORT) || IS_SRC_OR_DST_PORT(BABEL_PORT_OLD))
  668. @@ -656,6 +674,7 @@ udp_print(netdissect_options *ndo, const
  669. wb_print(ndo, cp, length);
  670. else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT))
  671. cisco_autorp_print(ndo, cp, length);
  672. +#endif
  673. else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) ||
  674. IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT) ||
  675. IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT) ||
  676. @@ -663,15 +682,18 @@ udp_print(netdissect_options *ndo, const
  677. IS_SRC_OR_DST_PORT(RADIUS_CISCO_COA_PORT) ||
  678. IS_SRC_OR_DST_PORT(RADIUS_COA_PORT) )
  679. radius_print(ndo, cp, length);
  680. +#ifndef TCPDUMP_MINI
  681. else if (dport == HSRP_PORT)
  682. hsrp_print(ndo, cp, length);
  683. else if (IS_SRC_OR_DST_PORT(LWRES_PORT))
  684. lwres_print(ndo, cp, length);
  685. else if (IS_SRC_OR_DST_PORT(LDP_PORT))
  686. ldp_print(ndo, cp, length);
  687. +#endif
  688. else if (IS_SRC_OR_DST_PORT(OLSR_PORT))
  689. olsr_print(ndo, cp, length,
  690. (IP_V(ip) == 6) ? 1 : 0);
  691. +#ifndef TCPDUMP_MINI
  692. else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT))
  693. lspping_print(ndo, cp, length);
  694. else if (sport == BCM_LI_PORT)
  695. @@ -693,10 +715,12 @@ udp_print(netdissect_options *ndo, const
  696. lwapp_control_print(ndo, cp, length, 0);
  697. else if (IS_SRC_OR_DST_PORT(LWAPP_DATA_PORT))
  698. lwapp_data_print(ndo, cp, length);
  699. +#endif
  700. else if (IS_SRC_OR_DST_PORT(SIP_PORT))
  701. sip_print(ndo, cp, length);
  702. else if (IS_SRC_OR_DST_PORT(SYSLOG_PORT))
  703. syslog_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. @@ -722,6 +746,7 @@ udp_print(netdissect_options *ndo, const
  709. ptp_print(ndo, cp, length);
  710. } else if (IS_SRC_OR_DST_PORT(SOMEIP_PORT))
  711. someip_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. @@ -48,6 +48,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. @@ -86,7 +87,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. @@ -94,6 +97,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. @@ -103,6 +107,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. @@ -115,9 +120,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. @@ -172,19 +179,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. @@ -200,6 +211,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. @@ -211,6 +223,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. @@ -243,6 +256,7 @@ static const struct printer printers[] =
  804. #ifdef DLT_VSOCK
  805. { vsock_if_print, DLT_VSOCK },
  806. #endif
  807. +#endif
  808. { NULL, 0 },
  809. };