Moreover:
Fix two probably copy & paste errors (s/SLL_HDR_LEN/SLL2_HDR_LEN/).
Remove trailing "_if" from the protocol name.
extern void raw_if_print IF_PRINTER_ARGS;
extern void sl_bsdos_if_print IF_PRINTER_ARGS;
extern void sl_if_print IF_PRINTER_ARGS;
extern void raw_if_print IF_PRINTER_ARGS;
extern void sl_bsdos_if_print IF_PRINTER_ARGS;
extern void sl_if_print IF_PRINTER_ARGS;
-extern u_int sll_if_print IF_PRINTER_ARGS;
-extern u_int sll2_if_print IF_PRINTER_ARGS;
+extern void sll_if_print IF_PRINTER_ARGS;
+extern void sll2_if_print IF_PRINTER_ARGS;
extern void sunatm_if_print IF_PRINTER_ARGS;
extern void symantec_if_print IF_PRINTER_ARGS;
extern u_int token_if_print IF_PRINTER_ARGS;
extern void sunatm_if_print IF_PRINTER_ARGS;
extern void symantec_if_print IF_PRINTER_ARGS;
extern u_int token_if_print IF_PRINTER_ARGS;
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
sll_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
sll_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
int llc_hdrlen;
u_int hdrlen;
int llc_hdrlen;
u_int hdrlen;
- ndo->ndo_protocol = "sll_if";
+ ndo->ndo_protocol = "sll";
if (caplen < SLL_HDR_LEN) {
/*
* XXX - this "can't happen" because "pcap-linux.c" always
if (caplen < SLL_HDR_LEN) {
/*
* XXX - this "can't happen" because "pcap-linux.c" always
* cooked socket capture.
*/
nd_print_trunc(ndo);
* cooked socket capture.
*/
nd_print_trunc(ndo);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
sllp = (const struct sll_header *)p;
}
sllp = (const struct sll_header *)p;
* This is an packet with a radiotap header;
* just dissect the payload as such.
*/
* This is an packet with a radiotap header;
* just dissect the payload as such.
*/
- return (SLL_HDR_LEN + ieee802_11_radio_print(ndo, p, length, caplen));
+ ndo->ndo_ll_hdr_len += SLL_HDR_LEN;
+ ndo->ndo_ll_hdr_len += ieee802_11_radio_print(ndo, p, length, caplen);
+ return;
}
ether_type = GET_BE_U_2(sllp->sll_protocol);
}
ether_type = GET_BE_U_2(sllp->sll_protocol);
if (caplen < 4) {
ndo->ndo_protocol = "vlan";
nd_print_trunc(ndo);
if (caplen < 4) {
ndo->ndo_protocol = "vlan";
nd_print_trunc(ndo);
- return (hdrlen + caplen);
+ ndo->ndo_ll_hdr_len += hdrlen + caplen;
+ return;
}
if (ndo->ndo_eflag) {
uint16_t tag = GET_BE_U_2(p);
}
if (ndo->ndo_eflag) {
uint16_t tag = GET_BE_U_2(p);
+ ndo->ndo_ll_hdr_len += hdrlen;
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
sll2_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
sll2_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
char ifname[IF_NAMESIZE];
#endif
char ifname[IF_NAMESIZE];
#endif
- ndo->ndo_protocol = "sll2_if";
+ ndo->ndo_protocol = "sll2";
if (caplen < SLL2_HDR_LEN) {
/*
* XXX - this "can't happen" because "pcap-linux.c" always
if (caplen < SLL2_HDR_LEN) {
/*
* XXX - this "can't happen" because "pcap-linux.c" always
* cooked socket capture.
*/
nd_print_trunc(ndo);
* cooked socket capture.
*/
nd_print_trunc(ndo);
+ ndo->ndo_ll_hdr_len += caplen;
+ return;
}
sllp = (const struct sll2_header *)p;
}
sllp = (const struct sll2_header *)p;
* This is an packet with a radiotap header;
* just dissect the payload as such.
*/
* This is an packet with a radiotap header;
* just dissect the payload as such.
*/
- return (SLL_HDR_LEN + ieee802_11_radio_print(ndo, p, length, caplen));
+ ndo->ndo_ll_hdr_len += SLL2_HDR_LEN;
+ ndo->ndo_ll_hdr_len += ieee802_11_radio_print(ndo, p, length, caplen);
+ return;
}
ether_type = GET_BE_U_2(sllp->sll2_protocol);
}
ether_type = GET_BE_U_2(sllp->sll2_protocol);
if (caplen < 4) {
ndo->ndo_protocol = "vlan";
nd_print_trunc(ndo);
if (caplen < 4) {
ndo->ndo_protocol = "vlan";
nd_print_trunc(ndo);
- return (hdrlen + caplen);
+ ndo->ndo_ll_hdr_len += hdrlen + caplen;
+ return;
}
if (ndo->ndo_eflag) {
uint16_t tag = GET_BE_U_2(p);
}
if (ndo->ndo_eflag) {
uint16_t tag = GET_BE_U_2(p);
if (ethertype_print(ndo, ether_type, p, length, caplen, NULL, NULL) == 0) {
/* ether_type not known, print raw packet */
if (!ndo->ndo_eflag)
if (ethertype_print(ndo, ether_type, p, length, caplen, NULL, NULL) == 0) {
/* ether_type not known, print raw packet */
if (!ndo->ndo_eflag)
- sll2_print(ndo, sllp, length + SLL_HDR_LEN);
+ sll2_print(ndo, sllp, length + SLL2_HDR_LEN);
if (!ndo->ndo_suppress_default_print)
ND_DEFAULTPRINT(p, caplen);
}
}
if (!ndo->ndo_suppress_default_print)
ND_DEFAULTPRINT(p, caplen);
}
}
+ ndo->ndo_ll_hdr_len += hdrlen;
{ pflog_if_print, DLT_PFLOG },
#endif
{ token_if_print, DLT_IEEE802 },
{ pflog_if_print, DLT_PFLOG },
#endif
{ token_if_print, DLT_IEEE802 },
-#ifdef DLT_LINUX_SLL
- { sll_if_print, DLT_LINUX_SLL },
-#endif
-#ifdef DLT_LINUX_SLL2
- { sll2_if_print, DLT_LINUX_SLL2 },
-#endif
#ifdef DLT_FR
{ fr_if_print, DLT_FR },
#endif
#ifdef DLT_FR
{ fr_if_print, DLT_FR },
#endif
{ sl_bsdos_if_print, DLT_SLIP_BSDOS },
#endif
{ sl_if_print, DLT_SLIP },
{ sl_bsdos_if_print, DLT_SLIP_BSDOS },
#endif
{ sl_if_print, DLT_SLIP },
+#ifdef DLT_LINUX_SLL
+ { sll_if_print, DLT_LINUX_SLL },
+#endif
+#ifdef DLT_LINUX_SLL2
+ { sll2_if_print, DLT_LINUX_SLL2 },
+#endif
#ifdef DLT_SUNATM
{ sunatm_if_print, DLT_SUNATM },
#endif
#ifdef DLT_SUNATM
{ sunatm_if_print, DLT_SUNATM },
#endif