#include "interface.h"
#include "extract.h"
#include "addrtoname.h"
+#include "ether.h"
#include "ethertype.h"
#include "ipproto.h"
#include "openflow.h"
#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 *
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 '");
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))
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;
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));