100-tcpdump_mini.patch 23 KB

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