]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-fddi.c
On Solaris, for 64-bit builds, use the 64-bit pcap-config.
[tcpdump] / print-fddi.c
index 825866fb007781916bf34110ba7d24581089ed97..fb8d3ed57ca1e113ad270deff78c7c3c84cc7acb 100644 (file)
 /* \summary: Fiber Distributed Data Interface (FDDI) printer */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 
-#include <netdissect-stdinc.h>
+#include "netdissect-stdinc.h"
 
 #include <string.h>
 
@@ -158,7 +158,7 @@ static const u_char fddi_bit_swap[] = {
 /*
  * Print FDDI frame-control bits
  */
-static inline void
+static void
 print_fddi_fc(netdissect_options *ndo, u_char fc)
 {
        switch (fc) {
@@ -226,7 +226,7 @@ print_fddi_fc(netdissect_options *ndo, u_char fc)
 }
 
 /* Extract src, dst addresses */
-static inline void
+static void
 extract_fddi_addrs(const struct fddi_header *fddip, char *fsrc, char *fdst)
 {
        int i;
@@ -250,7 +250,7 @@ extract_fddi_addrs(const struct fddi_header *fddip, char *fsrc, char *fdst)
 /*
  * Print the FDDI MAC header
  */
-static inline void
+static void
 fddi_hdr_print(netdissect_options *ndo,
                const struct fddi_header *fddip, u_int length,
                const u_char *fsrc, const u_char *fdst)
@@ -261,13 +261,13 @@ fddi_hdr_print(netdissect_options *ndo,
        dstname = etheraddr_string(ndo, fdst);
 
        if (!ndo->ndo_qflag)
-               print_fddi_fc(ndo, EXTRACT_U_1(fddip->fddi_fc));
+               print_fddi_fc(ndo, GET_U_1(fddip->fddi_fc));
        ND_PRINT("%s > %s, length %u: ",
               srcname, dstname,
               length);
 }
 
-static inline void
+static void
 fddi_smt_print(netdissect_options *ndo, const u_char *p _U_, u_int length _U_)
 {
        ND_PRINT("<SMT printer not yet implemented>");
@@ -282,12 +282,13 @@ fddi_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
        struct lladdr_info src, dst;
        int llc_hdrlen;
 
+       ndo->ndo_protocol = "fddi";
        if (caplen < FDDI_HDRLEN) {
-               ND_PRINT("[|fddi]");
+               nd_print_trunc(ndo);
                return (caplen);
        }
 
-       fc = EXTRACT_U_1(fddip->fddi_fc);
+       fc = GET_U_1(fddip->fddi_fc);
 
        /*
         * Get the FDDI addresses into a canonical form
@@ -341,8 +342,9 @@ fddi_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
  * 'h->len' is the length of the packet off the wire, and 'h->caplen'
  * is the number of bytes actually captured.
  */
-u_int
+void
 fddi_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *p)
 {
-       return (fddi_print(ndo, p, h->len, h->caplen));
+       ndo->ndo_protocol = "fddi";
+       ndo->ndo_ll_hdr_len += fddi_print(ndo, p, h->len, h->caplen);
 }