]> The Tcpdump Group git mirrors - tcpdump/commitdiff
remove two needless macros
authorDenis Ovsienko <[email protected]>
Tue, 26 Nov 2013 14:45:33 +0000 (18:45 +0400)
committerDenis Ovsienko <[email protected]>
Tue, 26 Nov 2013 14:45:33 +0000 (18:45 +0400)
ETH_ALEN in print-rrcp.c was unused. OFP_ETH_ALEN in
print-openflow-1.0.c was a reinvention of ETHER_ADDR_LEN.

print-openflow-1.0.c
print-rrcp.c

index 95a93a99e21e2b654c8c2f2dc3cd869ec541bc6f..435b424b20073add79f3d70247ce17516c76a40b 100644 (file)
@@ -51,6 +51,7 @@
 #include "interface.h"
 #include "extract.h"
 #include "addrtoname.h"
+#include "ether.h"
 #include "ethertype.h"
 #include "ipproto.h"
 #include "openflow.h"
@@ -573,7 +574,6 @@ static const struct tok empty_str[] = {
 #define OFP_MAX_PORT_NAME_LEN      16
 #define DESC_STR_LEN              256
 #define SERIAL_NUM_LEN             32
-#define OFP_ETH_ALEN                6
 #define OFP_VLAN_NONE          0xffff
 
 static const char *
@@ -682,9 +682,9 @@ of10_phy_ports_print(const u_char *cp, const u_char *ep, u_int len) {
                printf("\n\t  port_no %s", tok2str(ofpp_str, "%u", EXTRACT_16BITS(cp)));
                cp += 2;
                /* hw_addr */
-               TCHECK2(*cp, OFP_ETH_ALEN);
+               TCHECK2(*cp, ETHER_ADDR_LEN);
                printf(", hw_addr %s", etheraddr_string(cp));
-               cp += OFP_ETH_ALEN;
+               cp += ETHER_ADDR_LEN;
                /* name */
                TCHECK2(*cp, OFP_MAX_PORT_NAME_LEN);
                printf(", name '");
@@ -882,15 +882,15 @@ of10_match_print(const char *pfx, const u_char *cp, const u_char *ep) {
                printf("%smatch in_port %s", pfx, tok2str(ofpp_str, "%u", EXTRACT_16BITS(cp)));
        cp += 2;
        /* dl_src */
-       TCHECK2(*cp, OFP_ETH_ALEN);
+       TCHECK2(*cp, ETHER_ADDR_LEN);
        if (! (wildcards & OFPFW_DL_SRC))
                printf("%smatch dl_src %s", pfx, etheraddr_string(cp));
-       cp += OFP_ETH_ALEN;
+       cp += ETHER_ADDR_LEN;
        /* dl_dst */
-       TCHECK2(*cp, OFP_ETH_ALEN);
+       TCHECK2(*cp, ETHER_ADDR_LEN);
        if (! (wildcards & OFPFW_DL_DST))
                printf("%smatch dl_dst %s", pfx, etheraddr_string(cp));
-       cp += OFP_ETH_ALEN;
+       cp += ETHER_ADDR_LEN;
        /* dl_vlan */
        TCHECK2(*cp, 2);
        if (! (wildcards & OFPFW_DL_VLAN))
@@ -1058,9 +1058,9 @@ of10_actions_print(const char *pfx, const u_char *cp, const u_char *ep,
                case OFPAT_SET_DL_SRC:
                case OFPAT_SET_DL_DST:
                        /* dl_addr */
-                       TCHECK2(*cp, OFP_ETH_ALEN);
+                       TCHECK2(*cp, ETHER_ADDR_LEN);
                        printf(", dl_addr %s", etheraddr_string(cp));
-                       cp += OFP_ETH_ALEN;
+                       cp += ETHER_ADDR_LEN;
                        /* pad */
                        TCHECK2(*cp, 6);
                        cp += 6;
@@ -1228,9 +1228,9 @@ of10_port_mod_print(const u_char *cp, const u_char *ep) {
        printf("\n\t port_no %s", tok2str(ofpp_str, "%u", EXTRACT_16BITS(cp)));
        cp += 2;
        /* hw_addr */
-       TCHECK2(*cp, OFP_ETH_ALEN);
+       TCHECK2(*cp, ETHER_ADDR_LEN);
        printf(", hw_addr %s", etheraddr_string(cp));
-       cp += OFP_ETH_ALEN;
+       cp += ETHER_ADDR_LEN;
        /* config */
        TCHECK2(*cp, 4);
        printf("\n\t config 0x%08x", EXTRACT_32BITS(cp));
index c5b1fdd96a20fb1a0dd731760f6de2986867be74..d4af9a43d367c65d0c282f64cb5151e0d716e160 100644 (file)
@@ -40,10 +40,6 @@ static const char rcsid[] _U_ =
 #include "extract.h"
 #include "ether.h"
 
-#ifndef ETH_ALEN 
-#define ETH_ALEN 6
-#endif
-
 #define RRCP_OPCODE_MASK       0x7F    /* 0x00 = hello, 0x01 = get, 0x02 = set */
 #define RRCP_ISREPLY           0x80    /* 0 = request to switch, 0x80 = reply from switch */