]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lane.c
Use more the ND_TTEST_1() macro
[tcpdump] / print-lane.c
index ba5208425bc3319f90e580acbc78ad68b0146b91..cc4cb6bb0d1a0a60f8437b9c4b987b5618cb7ff5 100644 (file)
 
 #include "netdissect.h"
 #include "extract.h"
-#include "ether.h"
 
 struct lecdatahdr_8023 {
   uint16_t le_header;
-  uint8_t h_dest[ETHER_ADDR_LEN];
-  uint8_t h_source[ETHER_ADDR_LEN];
+  nd_mac_addr h_dest;
+  nd_mac_addr h_source;
   uint16_t h_type;
 };
 
@@ -69,7 +68,7 @@ static const struct tok lecop2str[] = {
 static void
 lane_hdr_print(netdissect_options *ndo, const u_char *bp)
 {
-       ND_PRINT((ndo, "lecid:%x ", EXTRACT_16BITS(bp)));
+       ND_PRINT((ndo, "lecid:%x ", EXTRACT_BE_U_2(bp)));
 }
 
 /*
@@ -91,13 +90,13 @@ lane_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
        }
 
        lec = (const struct lane_controlhdr *)p;
-       if (EXTRACT_16BITS(&lec->lec_header) == 0xff00) {
+       if (EXTRACT_BE_U_2(&lec->lec_header) == 0xff00) {
                /*
                 * LE Control.
                 */
                ND_PRINT((ndo, "lec: proto %x vers %x %s",
                    lec->lec_proto, lec->lec_vers,
-                   tok2str(lecop2str, "opcode-#%u", EXTRACT_16BITS(&lec->lec_opcode))));
+                   tok2str(lecop2str, "opcode-#%u", EXTRACT_BE_U_2(&lec->lec_opcode))));
                return;
        }