Skip to content

Commit 09dbb91

Browse files
committed
Apple IPoIEEE1394: Update the link-layer dissector to a void function
1 parent 0a96339 commit 09dbb91

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

netdissect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ extern if_printer_t lookup_printer(netdissect_options *, int);
461461

462462
/* The DLT printer routines */
463463

464-
extern u_int ap1394_if_print IF_PRINTER_ARGS;
464+
extern void ap1394_if_print IF_PRINTER_ARGS;
465465
extern u_int arcnet_if_print IF_PRINTER_ARGS;
466466
extern u_int arcnet_linux_if_print IF_PRINTER_ARGS;
467467
extern u_int atm_if_print IF_PRINTER_ARGS;

print-ap1394.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ap1394_hdr_print(netdissect_options *ndo, const u_char *bp, u_int length)
8585
* 'h->len' is the length of the packet off the wire, and 'h->caplen'
8686
* is the number of bytes actually captured.
8787
*/
88-
u_int
88+
void
8989
ap1394_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
9090
{
9191
u_int length = h->len;
@@ -96,9 +96,11 @@ ap1394_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch
9696

9797
ndo->ndo_protocol = "ap1394_if";
9898
if (caplen < FIREWIRE_HDRLEN) {
99+
ndo->ndo_ll_header_length += caplen;
99100
nd_print_trunc(ndo);
100-
return FIREWIRE_HDRLEN;
101+
return;
101102
}
103+
ndo->ndo_ll_header_length += FIREWIRE_HDRLEN;
102104

103105
if (ndo->ndo_eflag)
104106
ap1394_hdr_print(ndo, p, length);
@@ -122,5 +124,5 @@ ap1394_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch
122124
ND_DEFAULTPRINT(p, caplen);
123125
}
124126

125-
return FIREWIRE_HDRLEN;
127+
return;
126128
}

print.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ static const struct uint_printer uint_printers[] = {
9191
#ifdef DLT_LOOP
9292
{ null_if_print,DLT_LOOP },
9393
#endif
94-
#ifdef DLT_APPLE_IP_OVER_IEEE1394
95-
{ ap1394_if_print,DLT_APPLE_IP_OVER_IEEE1394 },
96-
#endif
9794
#ifdef DLT_BLUETOOTH_HCI_H4_WITH_PHDR
9895
{ bt_if_print,DLT_BLUETOOTH_HCI_H4_WITH_PHDR},
9996
#endif
@@ -255,6 +252,9 @@ static const struct uint_printer uint_printers[] = {
255252
};
256253

257254
static const struct void_printer void_printers[] = {
255+
#ifdef DLT_APPLE_IP_OVER_IEEE1394
256+
{ ap1394_if_print,DLT_APPLE_IP_OVER_IEEE1394 },
257+
#endif
258258
{ NULL, 0 },
259259
};
260260

0 commit comments

Comments
 (0)