100-tcpdump_mini.patch 23 KB

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