extern u_int pflog_if_print IF_PRINTER_ARGS;
extern void pktap_if_print IF_PRINTER_ARGS;
extern void ppi_if_print IF_PRINTER_ARGS;
-extern u_int ppp_bsdos_if_print IF_PRINTER_ARGS;
-extern u_int ppp_hdlc_if_print IF_PRINTER_ARGS;
-extern u_int ppp_if_print IF_PRINTER_ARGS;
+extern void ppp_bsdos_if_print IF_PRINTER_ARGS;
+extern void ppp_hdlc_if_print IF_PRINTER_ARGS;
+extern void ppp_if_print IF_PRINTER_ARGS;
extern void pppoe_if_print IF_PRINTER_ARGS;
extern void prism_if_print IF_PRINTER_ARGS;
extern void raw_if_print IF_PRINTER_ARGS;
/* PPP I/F printer */
-u_int
+void
ppp_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
u_int length = h->len;
u_int caplen = h->caplen;
- ndo->ndo_protocol = "ppp_if";
+ ndo->ndo_protocol = "ppp";
if (caplen < PPP_HDRLEN) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
+ ndo->ndo_ll_hdr_len += PPP_HDRLEN;
#if 0
/*
#endif
ppp_print(ndo, p, length);
-
- return (0);
}
/*
*
* This handles, for example, DLT_PPP_SERIAL in NetBSD.
*/
-u_int
+void
ppp_hdlc_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h, const u_char *p)
{
u_int proto;
u_int hdrlen = 0;
- ndo->ndo_protocol = "ppp_hdlc_if";
+ ndo->ndo_protocol = "ppp_hdlc";
if (caplen < 2) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
switch (GET_U_1(p)) {
case PPP_ADDRESS:
if (caplen < 4) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
if (ndo->ndo_eflag)
case CHDLC_UNICAST:
case CHDLC_BCAST:
- return (chdlc_if_print(ndo, h, p));
+ ndo->ndo_ll_hdr_len += chdlc_if_print(ndo, h, p);
+ return;
default:
if (caplen < 4) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
if (ndo->ndo_eflag)
break;
}
- return (hdrlen);
+ ndo->ndo_ll_hdr_len += hdrlen;
}
#define PPP_BSDI_HDRLEN 24
/* BSD/OS specific PPP printer */
-u_int
-ppp_bsdos_if_print(netdissect_options *ndo _U_,
+void
+ppp_bsdos_if_print(netdissect_options *ndo,
const struct pcap_pkthdr *h _U_, const u_char *p _U_)
{
u_int hdrlength;
const u_char *q;
u_int i;
- ndo->ndo_protocol = "ppp_bsdos_if";
+ ndo->ndo_protocol = "ppp_bsdos";
if (caplen < PPP_BSDI_HDRLEN) {
nd_print_trunc(ndo);
- return (caplen);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
hdrlength = 0;
#else /* __bsdi */
hdrlength = 0;
#endif /* __bsdi__ */
- return (hdrlength);
+ ndo->ndo_ll_hdr_len += hdrlength;
}
#endif
#ifdef DLT_LTALK
{ ltalk_if_print, DLT_LTALK },
-#endif
- { ppp_if_print, DLT_PPP },
-#ifdef DLT_PPP_WITHDIRECTION
- { ppp_if_print, DLT_PPP_WITHDIRECTION },
-#endif
-#ifdef DLT_PPP_BSDOS
- { ppp_bsdos_if_print, DLT_PPP_BSDOS },
-#endif
-#ifdef DLT_PPP_SERIAL
- { ppp_hdlc_if_print, DLT_PPP_SERIAL },
#endif
{ NULL, 0 },
};
#ifdef DLT_PPI
{ ppi_if_print, DLT_PPI },
#endif
+#ifdef DLT_PPP_BSDOS
+ { ppp_bsdos_if_print, DLT_PPP_BSDOS },
+#endif
+#ifdef DLT_PPP_SERIAL
+ { ppp_hdlc_if_print, DLT_PPP_SERIAL },
+#endif
+ { ppp_if_print, DLT_PPP },
+#ifdef DLT_PPP_WITHDIRECTION
+ { ppp_if_print, DLT_PPP_WITHDIRECTION },
+#endif
#ifdef DLT_PPP_ETHER
{ pppoe_if_print, DLT_PPP_ETHER },
#endif