extern void atalk_print(const u_char *, u_int);
extern void bootp_print(const u_char *, u_int);
extern void bgp_print(const u_char *, int);
-extern void cnfp_print(const u_char *, const u_char *);
extern void decnet_print(const u_char *, u_int, u_int);
extern void default_print(const u_char *, u_int);
-extern void dvmrp_print(const u_char *, u_int);
-extern void egp_print(const u_char *, u_int);
-extern u_int enc_if_print(const struct pcap_pkthdr *, const u_char *);
extern char *q922_string(const u_char *);
extern u_int ieee802_11_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int ieee802_11_radio_if_print(const struct pcap_pkthdr *,
extern u_int ppp_hdlc_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int ppp_bsdos_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int prism_if_print(const struct pcap_pkthdr *, const u_char *);
-extern u_int sl_if_print(const struct pcap_pkthdr *, const u_char *);
-extern u_int sl_bsdos_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_atm1_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_atm2_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_mfr_print(const struct pcap_pkthdr *, register const u_char *);
extern u_int juniper_chdlc_print(const struct pcap_pkthdr *, const u_char *);
extern void snmp_print(const u_char *, u_int);
extern void tcp_print(const u_char *, u_int, const u_char *, int);
-extern void tftp_print(const u_char *, u_int);
extern void timed_print(const u_char *);
extern void rx_print(register const u_char *, int, int, int, u_char *);
extern void netbeui_print(u_short, const u_char *, int);
extern void vtp_print(netdissect_options *, const u_char *, u_int);
extern int mptcp_print(netdissect_options *, const u_char *, u_int, u_char);
extern void ntp_print(netdissect_options *, const u_char *, u_int);
+extern void cnfp_print(netdissect_options *, const u_char *, const u_char *);
+extern void dvmrp_print(netdissect_options *, const u_char *, u_int);
+extern void egp_print(netdissect_options *, const u_char *, u_int);
+extern u_int enc_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
+extern u_int sl_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
+extern u_int sl_bsdos_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
+extern void tftp_print(netdissect_options *, const u_char *, u_int);
/* stuff that has not yet been rototiled */
extern const u_char * ns_nprint (register const u_char *, register const u_char *);
extern void bxxp_print(netdissect_options *,const u_char *, u_int);
extern void cisco_autorp_print(netdissect_options *,
const u_char *, u_int);
-extern void cnfp_print(netdissect_options *,const u_char *cp,
- u_int len, const u_char *bp);
extern void decnet_print(netdissect_options *,const u_char *,
u_int, u_int);
extern void default_print(netdissect_options *,const u_char *, u_int);
-extern void dvmrp_print(netdissect_options *,const u_char *, u_int);
-extern void egp_print(netdissect_options *,const u_char *, u_int,
- const u_char *);
extern void hsrp_print(netdissect_options *ndo,
register const u_char *bp, register u_int len);
const u_char *bp, const u_char *bp2,
u_int sctpPacketLength);
-extern void sl_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
-
extern void lane_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
-extern void sl_bsdos_if_print(u_char *,
- const struct pcap_pkthdr *, const u_char *);
extern void sll_if_print(u_char *,
const struct pcap_pkthdr *, const u_char *);
extern void snmp_print(netdissect_options *,const u_char *, u_int);
extern void tcp_print(netdissect_options *,const u_char *, u_int,
const u_char *, int);
-extern void tftp_print(netdissect_options *,const u_char *, u_int);
extern void timed_print(netdissect_options *,const u_char *, u_int);
extern void esp_print_decodesecret(netdissect_options *ndo);
extern void rx_print(netdissect_options *,register const u_char *,
/* Cisco NetFlow protocol */
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
};
void
-cnfp_print(const u_char *cp, const u_char *bp _U_)
+cnfp_print(netdissect_options *ndo,
+ const u_char *cp, const u_char *bp _U_)
{
register const struct nfhdr *nh;
register const struct nfrec *nr;
nh = (const struct nfhdr *)cp;
- if ((const u_char *)(nh + 1) > snapend)
+ if ((const u_char *)(nh + 1) > ndo->ndo_snapend)
return;
nrecs = EXTRACT_32BITS(&nh->ver_cnt) & 0xffff;
t = EXTRACT_32BITS(&nh->utc_sec);
#endif
- printf("NetFlow v%x, %u.%03u uptime, %u.%09u, ", ver,
+ ND_PRINT((ndo, "NetFlow v%x, %u.%03u uptime, %u.%09u, ", ver,
EXTRACT_32BITS(&nh->msys_uptime)/1000,
EXTRACT_32BITS(&nh->msys_uptime)%1000,
- EXTRACT_32BITS(&nh->utc_sec), EXTRACT_32BITS(&nh->utc_nsec));
+ EXTRACT_32BITS(&nh->utc_sec), EXTRACT_32BITS(&nh->utc_nsec)));
if (ver == 5 || ver == 6) {
- printf("#%u, ", EXTRACT_32BITS(&nh->sequence));
+ ND_PRINT((ndo, "#%u, ", EXTRACT_32BITS(&nh->sequence)));
nr = (const struct nfrec *)&nh[1];
- snaplen -= 24;
+ ndo->ndo_snaplen -= 24;
} else {
nr = (const struct nfrec *)&nh->sequence;
- snaplen -= 16;
+ ndo->ndo_snaplen -= 16;
}
- printf("%2u recs", nrecs);
+ ND_PRINT((ndo, "%2u recs", nrecs));
- for (; nrecs-- && (const u_char *)(nr + 1) <= snapend; nr++) {
+ for (; nrecs-- && (const u_char *)(nr + 1) <= ndo->ndo_snapend; nr++) {
char buf[20];
char asbuf[20];
- printf("\n started %u.%03u, last %u.%03u",
+ ND_PRINT((ndo, "\n started %u.%03u, last %u.%03u",
EXTRACT_32BITS(&nr->start_time)/1000,
EXTRACT_32BITS(&nr->start_time)%1000,
EXTRACT_32BITS(&nr->last_time)/1000,
- EXTRACT_32BITS(&nr->last_time)%1000);
+ EXTRACT_32BITS(&nr->last_time)%1000));
asbuf[0] = buf[0] = '\0';
if (ver == 5 || ver == 6) {
snprintf(asbuf, sizeof(asbuf), ":%u",
(EXTRACT_32BITS(&nr->asses) >> 16) & 0xffff);
}
- printf("\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf,
- EXTRACT_32BITS(&nr->ports) >> 16);
+ ND_PRINT((ndo, "\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf,
+ EXTRACT_32BITS(&nr->ports) >> 16));
if (ver == 5 || ver ==6) {
snprintf(buf, sizeof(buf), "/%d",
snprintf(asbuf, sizeof(asbuf), ":%u",
EXTRACT_32BITS(&nr->asses) & 0xffff);
}
- printf("> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf,
- EXTRACT_32BITS(&nr->ports) & 0xffff);
+ ND_PRINT((ndo, "> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf,
+ EXTRACT_32BITS(&nr->ports) & 0xffff));
- printf(">> %s\n ", intoa(nr->nhop_ina.s_addr));
+ ND_PRINT((ndo, ">> %s\n ", intoa(nr->nhop_ina.s_addr)));
pent = getprotobynumber((EXTRACT_32BITS(&nr->proto_tos) >> 8) & 0xff);
- if (!pent || nflag)
- printf("%u ",
- (EXTRACT_32BITS(&nr->proto_tos) >> 8) & 0xff);
+ if (!pent || ndo->ndo_nflag)
+ ND_PRINT((ndo, "%u ",
+ (EXTRACT_32BITS(&nr->proto_tos) >> 8) & 0xff));
else
- printf("%s ", pent->p_name);
+ ND_PRINT((ndo, "%s ", pent->p_name));
/* tcp flags for tcp only */
if (pent && pent->p_proto == IPPROTO_TCP) {
flags = (EXTRACT_32BITS(&nr->asses) >> 24) & 0xff;
else
flags = (EXTRACT_32BITS(&nr->proto_tos) >> 16) & 0xff;
- if (flags & TH_FIN) putchar('F');
- if (flags & TH_SYN) putchar('S');
- if (flags & TH_RST) putchar('R');
- if (flags & TH_PUSH) putchar('P');
- if (flags & TH_ACK) putchar('A');
- if (flags & TH_URG) putchar('U');
- if (flags)
- putchar(' ');
+ ND_PRINT((ndo, "%s%s%s%s%s%s%s",
+ flags & TH_FIN ? "F" : "",
+ flags & TH_SYN ? "S" : "",
+ flags & TH_RST ? "R" : "",
+ flags & TH_PUSH ? "P" : "",
+ flags & TH_ACK ? "A" : "",
+ flags & TH_URG ? "U" : "",
+ flags ? " " : ""));
}
buf[0]='\0';
(EXTRACT_32BITS(&nr->masks) >> 8) & 0xff,
(EXTRACT_32BITS(&nr->masks)) & 0xff);
}
- printf("tos %u, %u (%u octets) %s",
+ ND_PRINT((ndo, "tos %u, %u (%u octets) %s",
EXTRACT_32BITS(&nr->proto_tos) & 0xff,
EXTRACT_32BITS(&nr->packets),
- EXTRACT_32BITS(&nr->octets), buf);
+ EXTRACT_32BITS(&nr->octets), buf));
}
}
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
#include "interface.h"
#include "extract.h"
#include "addrtoname.h"
#define DVMRP_NF_DISABLED 0x20 /* administratively disabled */
#define DVMRP_NF_QUERIER 0x40 /* I am the subnet's querier */
-static int print_probe(const u_char *, const u_char *, u_int);
-static int print_report(const u_char *, const u_char *, u_int);
-static int print_neighbors(const u_char *, const u_char *, u_int);
-static int print_neighbors2(const u_char *, const u_char *, u_int);
-static int print_prune(const u_char *);
-static int print_graft(const u_char *);
-static int print_graft_ack(const u_char *);
+static int print_probe(netdissect_options *, const u_char *, const u_char *, u_int);
+static int print_report(netdissect_options *, const u_char *, const u_char *, u_int);
+static int print_neighbors(netdissect_options *, const u_char *, const u_char *, u_int);
+static int print_neighbors2(netdissect_options *, const u_char *, const u_char *, u_int);
+static int print_prune(netdissect_options *, const u_char *);
+static int print_graft(netdissect_options *, const u_char *);
+static int print_graft_ack(netdissect_options *, const u_char *);
static u_int32_t target_level;
void
-dvmrp_print(register const u_char *bp, register u_int len)
+dvmrp_print(netdissect_options *ndo,
+ register const u_char *bp, register u_int len)
{
register const u_char *ep;
register u_char type;
- ep = (const u_char *)snapend;
+ ep = (const u_char *)ndo->ndo_snapend;
if (bp >= ep)
return;
- TCHECK(bp[1]);
+ ND_TCHECK(bp[1]);
type = bp[1];
/* Skip IGMP header */
switch (type) {
case DVMRP_PROBE:
- printf(" Probe");
- if (vflag) {
- if (print_probe(bp, ep, len) < 0)
+ ND_PRINT((ndo, " Probe"));
+ if (ndo->ndo_vflag) {
+ if (print_probe(ndo, bp, ep, len) < 0)
goto trunc;
}
break;
case DVMRP_REPORT:
- printf(" Report");
- if (vflag > 1) {
- if (print_report(bp, ep, len) < 0)
+ ND_PRINT((ndo, " Report"));
+ if (ndo->ndo_vflag > 1) {
+ if (print_report(ndo, bp, ep, len) < 0)
goto trunc;
}
break;
case DVMRP_ASK_NEIGHBORS:
- printf(" Ask-neighbors(old)");
+ ND_PRINT((ndo, " Ask-neighbors(old)"));
break;
case DVMRP_NEIGHBORS:
- printf(" Neighbors(old)");
- if (print_neighbors(bp, ep, len) < 0)
+ ND_PRINT((ndo, " Neighbors(old)"));
+ if (print_neighbors(ndo, bp, ep, len) < 0)
goto trunc;
break;
case DVMRP_ASK_NEIGHBORS2:
- printf(" Ask-neighbors2");
+ ND_PRINT((ndo, " Ask-neighbors2"));
break;
case DVMRP_NEIGHBORS2:
- printf(" Neighbors2");
+ ND_PRINT((ndo, " Neighbors2"));
/*
* extract version and capabilities from IGMP group
* address field
*/
bp -= 4;
- TCHECK2(bp[0], 4);
+ ND_TCHECK2(bp[0], 4);
target_level = (bp[0] << 24) | (bp[1] << 16) |
(bp[2] << 8) | bp[3];
bp += 4;
- if (print_neighbors2(bp, ep, len) < 0)
+ if (print_neighbors2(ndo, bp, ep, len) < 0)
goto trunc;
break;
case DVMRP_PRUNE:
- printf(" Prune");
- if (print_prune(bp) < 0)
+ ND_PRINT((ndo, " Prune"));
+ if (print_prune(ndo, bp) < 0)
goto trunc;
break;
case DVMRP_GRAFT:
- printf(" Graft");
- if (print_graft(bp) < 0)
+ ND_PRINT((ndo, " Graft"));
+ if (print_graft(ndo, bp) < 0)
goto trunc;
break;
case DVMRP_GRAFT_ACK:
- printf(" Graft-ACK");
- if (print_graft_ack(bp) < 0)
+ ND_PRINT((ndo, " Graft-ACK"));
+ if (print_graft_ack(ndo, bp) < 0)
goto trunc;
break;
default:
- printf(" [type %d]", type);
+ ND_PRINT((ndo, " [type %d]", type));
break;
}
return;
trunc:
- printf("[|dvmrp]");
+ ND_PRINT((ndo, "[|dvmrp]"));
return;
}
static int
-print_report(register const u_char *bp, register const u_char *ep,
- register u_int len)
+print_report(netdissect_options *ndo,
+ register const u_char *bp, register const u_char *ep,
+ register u_int len)
{
register u_int32_t mask, origin;
register int metric, done;
while (len > 0) {
if (len < 3) {
- printf(" [|]");
+ ND_PRINT((ndo, " [|]"));
return (0);
}
- TCHECK2(bp[0], 3);
+ ND_TCHECK2(bp[0], 3);
mask = (u_int32_t)0xff << 24 | bp[0] << 16 | bp[1] << 8 | bp[2];
width = 1;
if (bp[0])
if (bp[2])
width = 4;
- printf("\n\tMask %s", intoa(htonl(mask)));
+ ND_PRINT((ndo, "\n\tMask %s", intoa(htonl(mask))));
bp += 3;
len -= 3;
do {
if (bp + width + 1 > ep) {
- printf(" [|]");
+ ND_PRINT((ndo, " [|]"));
return (0);
}
if (len < width + 1) {
- printf("\n\t [Truncated Report]");
+ ND_PRINT((ndo, "\n\t [Truncated Report]"));
return (0);
}
origin = 0;
for (i = 0; i < width; ++i) {
- TCHECK(*bp);
+ ND_TCHECK(*bp);
origin = origin << 8 | *bp++;
}
for ( ; i < 4; ++i)
origin <<= 8;
- TCHECK(*bp);
+ ND_TCHECK(*bp);
metric = *bp++;
done = metric & 0x80;
metric &= 0x7f;
- printf("\n\t %s metric %d", intoa(htonl(origin)),
- metric);
+ ND_PRINT((ndo, "\n\t %s metric %d", intoa(htonl(origin)),
+ metric));
len -= width + 1;
} while (!done);
}
}
static int
-print_probe(register const u_char *bp, register const u_char *ep,
- register u_int len)
+print_probe(netdissect_options *ndo,
+ register const u_char *bp, register const u_char *ep,
+ register u_int len)
{
register u_int32_t genid;
- TCHECK2(bp[0], 4);
+ ND_TCHECK2(bp[0], 4);
if ((len < 4) || ((bp + 4) > ep)) {
/* { (ctags) */
- printf(" [|}");
+ ND_PRINT((ndo, " [|}"));
return (0);
}
genid = (bp[0] << 24) | (bp[1] << 16) | (bp[2] << 8) | bp[3];
bp += 4;
len -= 4;
- if (vflag > 1)
- printf("\n\t");
- else
- printf(" ");
- printf("genid %u", genid);
- if (vflag < 2)
+ ND_PRINT((ndo, ndo->ndo_vflag > 1 ? "\n\t" : " "));
+ ND_PRINT((ndo, "genid %u", genid));
+ if (ndo->ndo_vflag < 2)
return (0);
while ((len > 0) && (bp < ep)) {
- TCHECK2(bp[0], 4);
- printf("\n\tneighbor %s", ipaddr_string(bp));
+ ND_TCHECK2(bp[0], 4);
+ ND_PRINT((ndo, "\n\tneighbor %s", ipaddr_string(bp)));
bp += 4; len -= 4;
}
return (0);
}
static int
-print_neighbors(register const u_char *bp, register const u_char *ep,
- register u_int len)
+print_neighbors(netdissect_options *ndo,
+ register const u_char *bp, register const u_char *ep,
+ register u_int len)
{
const u_char *laddr;
register u_char metric;
register int ncount;
while (len > 0 && bp < ep) {
- TCHECK2(bp[0], 7);
+ ND_TCHECK2(bp[0], 7);
laddr = bp;
bp += 4;
metric = *bp++;
ncount = *bp++;
len -= 7;
while (--ncount >= 0) {
- TCHECK2(bp[0], 4);
- printf(" [%s ->", ipaddr_string(laddr));
- printf(" %s, (%d/%d)]",
- ipaddr_string(bp), metric, thresh);
+ ND_TCHECK2(bp[0], 4);
+ ND_PRINT((ndo, " [%s ->", ipaddr_string(laddr)));
+ ND_PRINT((ndo, " %s, (%d/%d)]",
+ ipaddr_string(bp), metric, thresh));
bp += 4;
len -= 4;
}
}
static int
-print_neighbors2(register const u_char *bp, register const u_char *ep,
- register u_int len)
+print_neighbors2(netdissect_options *ndo,
+ register const u_char *bp, register const u_char *ep,
+ register u_int len)
{
const u_char *laddr;
register u_char metric, thresh, flags;
register int ncount;
- printf(" (v %d.%d):",
+ ND_PRINT((ndo, " (v %d.%d):",
(int)target_level & 0xff,
- (int)(target_level >> 8) & 0xff);
+ (int)(target_level >> 8) & 0xff));
while (len > 0 && bp < ep) {
- TCHECK2(bp[0], 8);
+ ND_TCHECK2(bp[0], 8);
laddr = bp;
bp += 4;
metric = *bp++;
ncount = *bp++;
len -= 8;
while (--ncount >= 0 && (len >= 4) && (bp + 4) <= ep) {
- printf(" [%s -> ", ipaddr_string(laddr));
- printf("%s (%d/%d", ipaddr_string(bp),
- metric, thresh);
+ ND_PRINT((ndo, " [%s -> ", ipaddr_string(laddr)));
+ ND_PRINT((ndo, "%s (%d/%d", ipaddr_string(bp),
+ metric, thresh));
if (flags & DVMRP_NF_TUNNEL)
- printf("/tunnel");
+ ND_PRINT((ndo, "/tunnel"));
if (flags & DVMRP_NF_SRCRT)
- printf("/srcrt");
+ ND_PRINT((ndo, "/srcrt"));
if (flags & DVMRP_NF_QUERIER)
- printf("/querier");
+ ND_PRINT((ndo, "/querier"));
if (flags & DVMRP_NF_DISABLED)
- printf("/disabled");
+ ND_PRINT((ndo, "/disabled"));
if (flags & DVMRP_NF_DOWN)
- printf("/down");
- printf(")]");
+ ND_PRINT((ndo, "/down"));
+ ND_PRINT((ndo, ")]"));
bp += 4;
len -= 4;
}
if (ncount != -1) {
- printf(" [|]");
+ ND_PRINT((ndo, " [|]"));
return (0);
}
}
}
static int
-print_prune(register const u_char *bp)
+print_prune(netdissect_options *ndo,
+ register const u_char *bp)
{
- TCHECK2(bp[0], 12);
- printf(" src %s grp %s", ipaddr_string(bp), ipaddr_string(bp + 4));
+ ND_TCHECK2(bp[0], 12);
+ ND_PRINT((ndo, " src %s grp %s", ipaddr_string(bp), ipaddr_string(bp + 4)));
bp += 8;
- (void)printf(" timer ");
+ ND_PRINT((ndo, " timer "));
relts_print(EXTRACT_32BITS(bp));
return (0);
trunc:
}
static int
-print_graft(register const u_char *bp)
+print_graft(netdissect_options *ndo,
+ register const u_char *bp)
{
- TCHECK2(bp[0], 8);
- printf(" src %s grp %s", ipaddr_string(bp), ipaddr_string(bp + 4));
+ ND_TCHECK2(bp[0], 8);
+ ND_PRINT((ndo, " src %s grp %s", ipaddr_string(bp), ipaddr_string(bp + 4)));
return (0);
trunc:
return (-1);
}
static int
-print_graft_ack(register const u_char *bp)
+print_graft_ack(netdissect_options *ndo,
+ register const u_char *bp)
{
- TCHECK2(bp[0], 8);
- printf(" src %s grp %s", ipaddr_string(bp), ipaddr_string(bp + 4));
+ ND_TCHECK2(bp[0], 8);
+ ND_PRINT((ndo, " src %s grp %s", ipaddr_string(bp), ipaddr_string(bp + 4)));
return (0);
trunc:
return (-1);
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
-#include <stdio.h>
-
#include "interface.h"
#include "addrtoname.h"
#include "extract.h"
-#include "ip.h"
-
struct egp_packet {
u_int8_t egp_version;
#define EGP_VERSION 2
};
static void
-egpnrprint(register const struct egp_packet *egp)
+egpnrprint(netdissect_options *ndo,
+ register const struct egp_packet *egp)
{
register const u_int8_t *cp;
u_int32_t addr;
for (gateways = 0; gateways < t_gateways; ++gateways) {
/* Pickup host part of gateway address */
addr = 0;
- TCHECK2(cp[0], 4 - netlen);
+ ND_TCHECK2(cp[0], 4 - netlen);
switch (netlen) {
case 1:
addr = (addr << 8) | *cp++;
}
addr |= net;
- TCHECK2(cp[0], 1);
+ ND_TCHECK2(cp[0], 1);
distances = *cp++;
- printf(" %s %s ",
+ ND_PRINT((ndo, " %s %s ",
gateways < (int)egp->egp_intgw ? "int" : "ext",
- ipaddr_string(&addr));
+ ipaddr_string(&addr)));
comma = "";
- putchar('(');
+ ND_PRINT((ndo, "("));
while (--distances >= 0) {
- TCHECK2(cp[0], 2);
- printf("%sd%d:", comma, (int)*cp++);
+ ND_TCHECK2(cp[0], 2);
+ ND_PRINT((ndo, "%sd%d:", comma, (int)*cp++));
comma = ", ";
networks = *cp++;
while (--networks >= 0) {
/* Pickup network number */
- TCHECK2(cp[0], 1);
+ ND_TCHECK2(cp[0], 1);
addr = (u_int32_t)*cp++ << 24;
if (IN_CLASSB(addr)) {
- TCHECK2(cp[0], 1);
+ ND_TCHECK2(cp[0], 1);
addr |= (u_int32_t)*cp++ << 16;
} else if (!IN_CLASSA(addr)) {
- TCHECK2(cp[0], 2);
+ ND_TCHECK2(cp[0], 2);
addr |= (u_int32_t)*cp++ << 16;
addr |= (u_int32_t)*cp++ << 8;
}
- printf(" %s", ipaddr_string(&addr));
+ ND_PRINT((ndo, " %s", ipaddr_string(&addr)));
}
}
- putchar(')');
+ ND_PRINT((ndo, ")"));
}
return;
trunc:
- fputs("[|]", stdout);
+ ND_PRINT((ndo, "[|]"));
}
void
-egp_print(register const u_int8_t *bp, register u_int length)
+egp_print(netdissect_options *ndo,
+ register const u_int8_t *bp, register u_int length)
{
register const struct egp_packet *egp;
register int status;
register int type;
egp = (struct egp_packet *)bp;
- if (!TTEST2(*egp, length)) {
- printf("[|egp]");
+ if (!ND_TTEST2(*egp, length)) {
+ ND_PRINT((ndo, "[|egp]"));
return;
}
- if (!vflag) {
- printf("EGPv%u, AS %u, seq %u, length %u",
+ if (!ndo->ndo_vflag) {
+ ND_PRINT((ndo, "EGPv%u, AS %u, seq %u, length %u",
egp->egp_version,
EXTRACT_16BITS(&egp->egp_as),
EXTRACT_16BITS(&egp->egp_sequence),
- length);
+ length));
return;
} else
- printf("EGPv%u, length %u",
+ ND_PRINT((ndo, "EGPv%u, length %u",
egp->egp_version,
- length);
+ length));
if (egp->egp_version != EGP_VERSION) {
- printf("[version %d]", egp->egp_version);
+ ND_PRINT((ndo, "[version %d]", egp->egp_version));
return;
}
switch (type) {
case EGPT_ACQUIRE:
- printf(" acquire");
+ ND_PRINT((ndo, " acquire"));
switch (code) {
case EGPC_REQUEST:
case EGPC_CONFIRM:
- printf(" %s", egp_acquire_codes[code]);
+ ND_PRINT((ndo, " %s", egp_acquire_codes[code]));
switch (status) {
case EGPS_UNSPEC:
case EGPS_ACTIVE:
case EGPS_PASSIVE:
- printf(" %s", egp_acquire_status[status]);
+ ND_PRINT((ndo, " %s", egp_acquire_status[status]));
break;
default:
- printf(" [status %d]", status);
+ ND_PRINT((ndo, " [status %d]", status));
break;
}
- printf(" hello:%d poll:%d",
+ ND_PRINT((ndo, " hello:%d poll:%d",
EXTRACT_16BITS(&egp->egp_hello),
- EXTRACT_16BITS(&egp->egp_poll));
+ EXTRACT_16BITS(&egp->egp_poll)));
break;
case EGPC_REFUSE:
case EGPC_CEASE:
case EGPC_CEASEACK:
- printf(" %s", egp_acquire_codes[code]);
+ ND_PRINT((ndo, " %s", egp_acquire_codes[code]));
switch (status ) {
case EGPS_UNSPEC:
case EGPS_NORES:
case EGPS_GODOWN:
case EGPS_PARAM:
case EGPS_PROTO:
- printf(" %s", egp_acquire_status[status]);
+ ND_PRINT((ndo, " %s", egp_acquire_status[status]));
break;
default:
- printf("[status %d]", status);
+ ND_PRINT((ndo, "[status %d]", status));
break;
}
break;
default:
- printf("[code %d]", code);
+ ND_PRINT((ndo, "[code %d]", code));
break;
}
break;
case EGPC_HELLO:
case EGPC_HEARDU:
- printf(" %s", egp_reach_codes[code]);
+ ND_PRINT((ndo, " %s", egp_reach_codes[code]));
if (status <= EGPS_DOWN)
- printf(" state:%s", egp_status_updown[status]);
+ ND_PRINT((ndo, " state:%s", egp_status_updown[status]));
else
- printf(" [status %d]", status);
+ ND_PRINT((ndo, " [status %d]", status));
break;
default:
- printf("[reach code %d]", code);
+ ND_PRINT((ndo, "[reach code %d]", code));
break;
}
break;
case EGPT_POLL:
- printf(" poll");
+ ND_PRINT((ndo, " poll"));
if (egp->egp_status <= EGPS_DOWN)
- printf(" state:%s", egp_status_updown[status]);
+ ND_PRINT((ndo, " state:%s", egp_status_updown[status]));
else
- printf(" [status %d]", status);
- printf(" net:%s", ipaddr_string(&egp->egp_sourcenet));
+ ND_PRINT((ndo, " [status %d]", status));
+ ND_PRINT((ndo, " net:%s", ipaddr_string(&egp->egp_sourcenet)));
break;
case EGPT_UPDATE:
- printf(" update");
+ ND_PRINT((ndo, " update"));
if (status & EGPS_UNSOL) {
status &= ~EGPS_UNSOL;
- printf(" unsolicited");
+ ND_PRINT((ndo, " unsolicited"));
}
if (status <= EGPS_DOWN)
- printf(" state:%s", egp_status_updown[status]);
+ ND_PRINT((ndo, " state:%s", egp_status_updown[status]));
else
- printf(" [status %d]", status);
- printf(" %s int %d ext %d",
+ ND_PRINT((ndo, " [status %d]", status));
+ ND_PRINT((ndo, " %s int %d ext %d",
ipaddr_string(&egp->egp_sourcenet),
egp->egp_intgw,
- egp->egp_extgw);
- if (vflag)
- egpnrprint(egp);
+ egp->egp_extgw));
+ if (ndo->ndo_vflag)
+ egpnrprint(ndo, egp);
break;
case EGPT_ERROR:
- printf(" error");
+ ND_PRINT((ndo, " error"));
if (status <= EGPS_DOWN)
- printf(" state:%s", egp_status_updown[status]);
+ ND_PRINT((ndo, " state:%s", egp_status_updown[status]));
else
- printf(" [status %d]", status);
+ ND_PRINT((ndo, " [status %d]", status));
if (EXTRACT_16BITS(&egp->egp_reason) <= EGPR_UVERSION)
- printf(" %s", egp_reasons[EXTRACT_16BITS(&egp->egp_reason)]);
+ ND_PRINT((ndo, " %s", egp_reasons[EXTRACT_16BITS(&egp->egp_reason)]));
else
- printf(" [reason %d]", EXTRACT_16BITS(&egp->egp_reason));
+ ND_PRINT((ndo, " [reason %d]", EXTRACT_16BITS(&egp->egp_reason)));
break;
default:
- printf("[type %d]", type);
+ ND_PRINT((ndo, "[type %d]", type));
break;
}
}
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define ENC_PRINT_TYPE(wh, xf, nam) \
if ((wh) & (xf)) { \
- printf("%s%s", nam, (wh) == (xf) ? "): " : ","); \
+ ND_PRINT((ndo, "%s%s", nam, (wh) == (xf) ? "): " : ",")); \
(wh) &= ~(xf); \
}
u_int
-enc_if_print(const struct pcap_pkthdr *h, register const u_char *p)
+enc_if_print(netdissect_options *ndo,
+ const struct pcap_pkthdr *h, register const u_char *p)
{
register u_int length = h->len;
register u_int caplen = h->caplen;
const struct enchdr *hdr;
if (caplen < ENC_HDRLEN) {
- printf("[|enc]");
+ ND_PRINT((ndo, "[|enc]"));
goto out;
}
hdr = (struct enchdr *)p;
flags = hdr->flags;
if (flags == 0)
- printf("(unprotected): ");
+ ND_PRINT((ndo, "(unprotected): "));
else
- printf("(");
+ ND_PRINT((ndo, "("));
ENC_PRINT_TYPE(flags, M_AUTH, "authentic");
ENC_PRINT_TYPE(flags, M_CONF, "confidential");
/* ENC_PRINT_TYPE(flags, M_TUNNEL, "tunnel"); */
- printf("SPI 0x%08x: ", EXTRACT_32BITS(&hdr->spi));
+ ND_PRINT((ndo, "SPI 0x%08x: ", EXTRACT_32BITS(&hdr->spi)));
length -= ENC_HDRLEN;
caplen -= ENC_HDRLEN;
switch (hdr->af) {
case AF_INET:
- ip_print(gndo, p, length);
+ ip_print(ndo, p, length);
break;
#ifdef INET6
case AF_INET6:
- ip6_print(gndo, p, length);
+ ip6_print(ndo, p, length);
break;
#endif /*INET6*/
}
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
-#include <stdio.h>
-#include <string.h>
-
#include "interface.h"
#include "extract.h"
#include "addrtoname.h"
Sub-part 1: Media-Independent Functionality
*/
+#define GEONET_ADDR_LEN 8
+
static const struct tok msg_type_values[] = {
{ 0, "CAM" },
{ 1, "DENM" },
};
static void
-print_btp_body(const u_char *bp, u_int length)
+print_btp_body(netdissect_options *ndo,
+ const u_char *bp, u_int length)
{
int version;
int msg_type;
msg_type = bp[1];
msg_type_str = tok2str(msg_type_values, "unknown (%u)", msg_type);
- printf("; ItsPduHeader v:%d t:%d-%s", version, msg_type, msg_type_str);
+ ND_PRINT((ndo, "; ItsPduHeader v:%d t:%d-%s", version, msg_type, msg_type_str));
}
static void
-print_btp(const u_char *bp)
+print_btp(netdissect_options *ndo,
+ const u_char *bp)
{
u_int16_t dest = EXTRACT_16BITS(bp+0);
u_int16_t src = EXTRACT_16BITS(bp+2);
- printf("; BTP Dst:%u Src:%u", dest, src);
+ ND_PRINT((ndo, "; BTP Dst:%u Src:%u", dest, src));
}
static void
-print_long_pos_vector(const u_char *bp)
+print_long_pos_vector(netdissect_options *ndo,
+ const u_char *bp)
{
- int i;
u_int32_t lat, lon;
- printf("GN_ADDR:");
- for (i=0; i<8; i++) {
- if (i) printf(":");
- printf("%02x", bp[i]);
- }
- printf(" ");
+ ND_PRINT((ndo, "GN_ADDR:%s ", linkaddr_string (bp, 0, GEONET_ADDR_LEN)));
lat = EXTRACT_32BITS(bp+12);
- printf("lat:%d ", lat);
+ ND_PRINT((ndo, "lat:%d ", lat));
lon = EXTRACT_32BITS(bp+16);
- printf("lon:%d", lon);
+ ND_PRINT((ndo, "lon:%d", lon));
}
void
geonet_print(netdissect_options *ndo, const u_char *eth, const u_char *bp, u_int length)
{
- printf("GeoNet src:%s; ", etheraddr_string(eth+6));
+ ND_PRINT((ndo, "GeoNet src:%s; ", etheraddr_string(eth+6)));
if (length >= 36) {
/* Process Common Header */
break;
}
- printf("v:%d ", version);
- printf("NH:%d-%s ", next_hdr, next_hdr_txt);
- printf("HT:%d-%d-%s ", hdr_type, hdr_subtype, hdr_type_txt);
- printf("HopLim:%d ", hop_limit);
- printf("Payload:%d ", payload_length);
- print_long_pos_vector(bp + 8);
+ ND_PRINT((ndo, "v:%d ", version));
+ ND_PRINT((ndo, "NH:%d-%s ", next_hdr, next_hdr_txt));
+ ND_PRINT((ndo, "HT:%d-%d-%s ", hdr_type, hdr_subtype, hdr_type_txt));
+ ND_PRINT((ndo, "HopLim:%d ", hop_limit));
+ ND_PRINT((ndo, "Payload:%d ", payload_length));
+ print_long_pos_vector(ndo, bp + 8);
/* Skip Common Header */
length -= 36;
break;
case 1:
case 2: /* BTP A/B */
- print_btp(bp);
+ print_btp(ndo, bp);
length -= 4;
bp += 4;
- print_btp_body(bp, length);
+ print_btp_body(ndo, bp, length);
break;
case 3: /* IPv6 */
break;
}
}
} else {
- printf("Malformed (small) ");
+ ND_PRINT((ndo, "Malformed (small) "));
}
/* Print user data part */
if (ndo->ndo_vflag)
- default_print(bp, length);
+ ndo->ndo_default_print(ndo, bp, length);
}
if (len < 8)
ND_PRINT((ndo, " [len %d]", len));
else
- dvmrp_print(bp, len);
+ dvmrp_print(ndo, bp, len);
break;
case 0x14:
ND_PRINT((ndo, "igmp pimv1"));
break;
case IPPROTO_EGP:
- egp_print(ipds->cp, ipds->len);
+ egp_print(ndo, ipds->cp, ipds->len);
break;
case IPPROTO_OSPF:
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
-#include <stdio.h>
-
#include "interface.h"
#include "extract.h" /* must come after interface.h */
static u_int lastlen[2][256];
static u_int lastconn = 255;
-static void sliplink_print(const u_char *, const struct ip *, u_int);
-static void compressed_sl_print(const u_char *, const struct ip *, u_int, int);
+static void sliplink_print(netdissect_options *, const u_char *, const struct ip *, u_int);
+static void compressed_sl_print(netdissect_options *, const u_char *, const struct ip *, u_int, int);
u_int
-sl_if_print(const struct pcap_pkthdr *h, const u_char *p)
+sl_if_print(netdissect_options *ndo,
+ const struct pcap_pkthdr *h, const u_char *p)
{
register u_int caplen = h->caplen;
register u_int length = h->len;
register const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
- printf("%s", tstr);
+ ND_PRINT((ndo, "%s", tstr));
return (caplen);
}
ip = (struct ip *)(p + SLIP_HDRLEN);
- if (eflag)
- sliplink_print(p, ip, length);
+ if (ndo->ndo_eflag)
+ sliplink_print(ndo, p, ip, length);
switch (IP_V(ip)) {
case 4:
- ip_print(gndo, (u_char *)ip, length);
+ ip_print(ndo, (u_char *)ip, length);
break;
#ifdef INET6
case 6:
- ip6_print(gndo, (u_char *)ip, length);
+ ip6_print(ndo, (u_char *)ip, length);
break;
#endif
default:
}
u_int
-sl_bsdos_if_print(const struct pcap_pkthdr *h, const u_char *p)
+sl_bsdos_if_print(netdissect_options *ndo,
+ const struct pcap_pkthdr *h, const u_char *p)
{
register u_int caplen = h->caplen;
register u_int length = h->len;
register const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
- printf("%s", tstr);
+ ND_PRINT((ndo, "%s", tstr));
return (caplen);
}
ip = (struct ip *)(p + SLIP_HDRLEN);
#ifdef notdef
- if (eflag)
- sliplink_print(p, ip, length);
+ if (ndo->ndo_eflag)
+ sliplink_print(ndo, p, ip, length);
#endif
- ip_print(gndo, (u_char *)ip, length);
+ ip_print(ndo, (u_char *)ip, length);
return (SLIP_HDRLEN);
}
static void
-sliplink_print(register const u_char *p, register const struct ip *ip,
- register u_int length)
+sliplink_print(netdissect_options *ndo,
+ register const u_char *p, register const struct ip *ip,
+ register u_int length)
{
int dir;
u_int hlen;
dir = p[SLX_DIR];
- putchar(dir == SLIPDIR_IN ? 'I' : 'O');
- putchar(' ');
+ ND_PRINT((ndo, dir == SLIPDIR_IN ? "I " : "O "));
- if (nflag) {
+ if (ndo->ndo_nflag) {
/* XXX just dump the header */
register int i;
for (i = SLX_CHDR; i < SLX_CHDR + CHDR_LEN - 1; ++i)
- printf("%02x.", p[i]);
- printf("%02x: ", p[SLX_CHDR + CHDR_LEN - 1]);
+ ND_PRINT((ndo, "%02x.", p[i]));
+ ND_PRINT((ndo, "%02x: ", p[SLX_CHDR + CHDR_LEN - 1]));
return;
}
switch (p[SLX_CHDR] & 0xf0) {
case TYPE_IP:
- printf("ip %d: ", length + SLIP_HDRLEN);
+ ND_PRINT((ndo, "ip %d: ", length + SLIP_HDRLEN));
break;
case TYPE_UNCOMPRESSED_TCP:
hlen = IP_HL(ip);
hlen += TH_OFF((struct tcphdr *)&((int *)ip)[hlen]);
lastlen[dir][lastconn] = length - (hlen << 2);
- printf("utcp %d: ", lastconn);
+ ND_PRINT((ndo, "utcp %d: ", lastconn));
break;
default:
if (p[SLX_CHDR] & TYPE_COMPRESSED_TCP) {
- compressed_sl_print(&p[SLX_CHDR], ip,
+ compressed_sl_print(ndo, &p[SLX_CHDR], ip,
length, dir);
- printf(": ");
+ ND_PRINT((ndo, ": "));
} else
- printf("slip-%d!: ", p[SLX_CHDR]);
+ ND_PRINT((ndo, "slip-%d!: ", p[SLX_CHDR]));
}
}
static const u_char *
-print_sl_change(const char *str, register const u_char *cp)
+print_sl_change(netdissect_options *ndo,
+ const char *str, register const u_char *cp)
{
register u_int i;
i = EXTRACT_16BITS(cp);
cp += 2;
}
- printf(" %s%d", str, i);
+ ND_PRINT((ndo, " %s%d", str, i));
return (cp);
}
static const u_char *
-print_sl_winchange(register const u_char *cp)
+print_sl_winchange(netdissect_options *ndo,
+ register const u_char *cp)
{
register short i;
cp += 2;
}
if (i >= 0)
- printf(" W+%d", i);
+ ND_PRINT((ndo, " W+%d", i));
else
- printf(" W%d", i);
+ ND_PRINT((ndo, " W%d", i));
return (cp);
}
static void
-compressed_sl_print(const u_char *chdr, const struct ip *ip,
- u_int length, int dir)
+compressed_sl_print(netdissect_options *ndo,
+ const u_char *chdr, const struct ip *ip,
+ u_int length, int dir)
{
register const u_char *cp = chdr;
register u_int flags, hlen;
flags = *cp++;
if (flags & NEW_C) {
lastconn = *cp++;
- printf("ctcp %d", lastconn);
+ ND_PRINT((ndo, "ctcp %d", lastconn));
} else
- printf("ctcp *");
+ ND_PRINT((ndo, "ctcp *"));
/* skip tcp checksum */
cp += 2;
switch (flags & SPECIALS_MASK) {
case SPECIAL_I:
- printf(" *SA+%d", lastlen[dir][lastconn]);
+ ND_PRINT((ndo, " *SA+%d", lastlen[dir][lastconn]));
break;
case SPECIAL_D:
- printf(" *S+%d", lastlen[dir][lastconn]);
+ ND_PRINT((ndo, " *S+%d", lastlen[dir][lastconn]));
break;
default:
if (flags & NEW_U)
- cp = print_sl_change("U=", cp);
+ cp = print_sl_change(ndo, "U=", cp);
if (flags & NEW_W)
- cp = print_sl_winchange(cp);
+ cp = print_sl_winchange(ndo, cp);
if (flags & NEW_A)
- cp = print_sl_change("A+", cp);
+ cp = print_sl_change(ndo, "A+", cp);
if (flags & NEW_S)
- cp = print_sl_change("S+", cp);
+ cp = print_sl_change(ndo, "S+", cp);
break;
}
if (flags & NEW_I)
- cp = print_sl_change("I+", cp);
+ cp = print_sl_change(ndo, "I+", cp);
/*
* 'hlen' is the length of the uncompressed TCP/IP header (in words).
hlen = IP_HL(ip);
hlen += TH_OFF((struct tcphdr *)&((int32_t *)ip)[hlen]);
lastlen[dir][lastconn] = length - (hlen << 2);
- printf(" %d (%ld)", lastlen[dir][lastconn], (long)(cp - chdr));
+ ND_PRINT((ndo, " %d (%ld)", lastlen[dir][lastconn], (long)(cp - chdr)));
}
* Format and print trivial file transfer protocol packets.
*/
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
-#include <stdio.h>
#include <string.h>
#include "interface.h"
* Print trivial file transfer program requests
*/
void
-tftp_print(register const u_char *bp, u_int length)
+tftp_print(netdissect_options *ndo,
+ register const u_char *bp, u_int length)
{
register const struct tftphdr *tp;
register const char *cp;
tp = (const struct tftphdr *)bp;
/* Print length */
- printf(" %d", length);
+ ND_PRINT((ndo, " %d", length));
/* Print tftp request type */
- TCHECK(tp->th_opcode);
+ ND_TCHECK(tp->th_opcode);
opcode = EXTRACT_16BITS(&tp->th_opcode);
cp = tok2str(op2str, "tftp-#%d", opcode);
- printf(" %s", cp);
+ ND_PRINT((ndo, " %s", cp));
/* Bail if bogus opcode */
if (*cp == 't')
return;
case WRQ:
case OACK:
p = (u_char *)tp->th_stuff;
- putchar(' ');
+ ND_PRINT((ndo, " "));
/* Print filename or first option */
if (opcode != OACK)
- putchar('"');
- i = fn_print(p, snapend);
+ ND_PRINT((ndo, "\""));
+ i = fn_print(p, ndo->ndo_snapend);
if (opcode != OACK)
- putchar('"');
+ ND_PRINT((ndo, "\""));
/* Print the mode (RRQ and WRQ only) and any options */
while ((p = (const u_char *)strchr((const char *)p, '\0')) != NULL) {
break;
p++;
if (*p != '\0') {
- putchar(' ');
- fn_print(p, snapend);
+ ND_PRINT((ndo, " "));
+ fn_print(p, ndo->ndo_snapend);
}
}
case ACK:
case DATA:
- TCHECK(tp->th_block);
- printf(" block %d", EXTRACT_16BITS(&tp->th_block));
+ ND_TCHECK(tp->th_block);
+ ND_PRINT((ndo, " block %d", EXTRACT_16BITS(&tp->th_block)));
break;
case TFTP_ERROR:
/* Print error code string */
- TCHECK(tp->th_code);
- printf(" %s \"", tok2str(err2str, "tftp-err-#%d \"",
- EXTRACT_16BITS(&tp->th_code)));
+ ND_TCHECK(tp->th_code);
+ ND_PRINT((ndo, " %s \"", tok2str(err2str, "tftp-err-#%d \"",
+ EXTRACT_16BITS(&tp->th_code))));
/* Print error message string */
- i = fn_print((const u_char *)tp->th_data, snapend);
- putchar('"');
+ i = fn_print((const u_char *)tp->th_data, ndo->ndo_snapend);
+ ND_PRINT((ndo, "\""));
if (i)
goto trunc;
break;
default:
/* We shouldn't get here */
- printf("(unknown #%d)", opcode);
+ ND_PRINT((ndo, "(unknown #%d)", opcode));
break;
}
return;
trunc:
- fputs(tstr, stdout);
+ ND_PRINT((ndo, tstr));
return;
}
case PT_CNFP:
udpipaddr_print(ndo, ip, sport, dport);
- cnfp_print(cp, (const u_char *)ip);
+ cnfp_print(ndo, cp, (const u_char *)ip);
break;
case PT_TFTP:
udpipaddr_print(ndo, ip, sport, dport);
- tftp_print(cp, length);
+ tftp_print(ndo, cp, length);
break;
case PT_AODV:
else if (ISPORT(TIMED_PORT))
timed_print((const u_char *)(up + 1));
else if (ISPORT(TFTP_PORT))
- tftp_print((const u_char *)(up + 1), length);
+ tftp_print(ndo, (const u_char *)(up + 1), length);
else if (ISPORT(IPPORT_BOOTPC) || ISPORT(IPPORT_BOOTPS))
bootp_print((const u_char *)(up + 1), length);
else if (ISPORT(RIP_PORT))
static const struct printer printers[] = {
- { sl_if_print, DLT_SLIP },
-#ifdef DLT_SLIP_BSDOS
- { sl_bsdos_if_print, DLT_SLIP_BSDOS },
-#endif
{ ppp_if_print, DLT_PPP },
#ifdef DLT_PPP_WITHDIRECTION
{ ppp_if_print, DLT_PPP_WITHDIRECTION },
#ifdef DLT_IEEE802_11_RADIO
{ ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO },
#endif
-#ifdef DLT_ENC
- { enc_if_print, DLT_ENC },
-#endif
#ifdef DLT_IEEE802_11_RADIO_AVS
{ ieee802_11_radio_avs_if_print, DLT_IEEE802_11_RADIO_AVS },
#endif
{ atm_if_print, DLT_ATM_RFC1483 },
#ifdef DLT_SUNATM
{ sunatm_if_print, DLT_SUNATM },
+#endif
+#ifdef DLT_ENC
+ { enc_if_print, DLT_ENC },
+#endif
+ { sl_if_print, DLT_SLIP },
+#ifdef DLT_SLIP_BSDOS
+ { sl_bsdos_if_print, DLT_SLIP_BSDOS },
#endif
{ NULL, 0 },
};