Permalink
Browse files

experimental matches (OXM): (#108)

- fixed bug in oxm_length for all experimental matches
- added OFDPA-2 related experimental matches
  • Loading branch information...
akoepsel committed Jan 4, 2018
1 parent d2e4267 commit e62645a3001492001b6522120ae0a66b42d5f45c
View
@@ -9,6 +9,11 @@ Legend:
Change log
==========
v0.13.1
[+] added experimental matches from OFDPA-2:
VRF, OVID, ALLOW_VLAN_TRANSLATION, ACTSET_OUTPUT
[B] fixed invalid length fields for experimental OXM matches
v0.13.0
[+] thread pool
@@ -18,22 +18,24 @@ enum oxm_ofx_match_fields {
OFPXMT_OFX_CAPWAP_FLAGS = 29,
};
static unsigned int const OXM_EXP_ID_SIZE = sizeof(uint32_t); // length of experimenter id field
/* OXM Flow match field types for OpenFlow basic class. */
enum oxm_tlv_match_fields {
OXM_TLV_EXPR_CAPWAP_WBID =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_CAPWAP_WBID << 9) | 1,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_CAPWAP_WBID << 9) | (OXM_EXP_ID_SIZE + 1),
OXM_TLV_EXPR_CAPWAP_WBID_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_CAPWAP_WBID << 9) | 2 |
(OFPXMT_OFX_CAPWAP_WBID << 9) | (OXM_EXP_ID_SIZE + 2) |
HAS_MASK_FLAG,
OXM_TLV_EXPR_CAPWAP_RID =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_CAPWAP_RID << 9) | 1,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_CAPWAP_RID << 9) | (OXM_EXP_ID_SIZE + 1),
OXM_TLV_EXPR_CAPWAP_RID_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_CAPWAP_RID << 9) | 2 |
(OFPXMT_OFX_CAPWAP_RID << 9) | (OXM_EXP_ID_SIZE + 2) |
HAS_MASK_FLAG,
OXM_TLV_EXPR_CAPWAP_FLAGS =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_CAPWAP_FLAGS << 9) | 2,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_CAPWAP_FLAGS << 9) | (OXM_EXP_ID_SIZE + 2),
OXM_TLV_EXPR_CAPWAP_FLAGS_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_CAPWAP_FLAGS << 9) | 4 |
(OFPXMT_OFX_CAPWAP_FLAGS << 9) | (OXM_EXP_ID_SIZE + 4) |
HAS_MASK_FLAG,
};
@@ -25,22 +25,24 @@ enum oxm_ofx_match_fields {
OFPXMT_OFX_GRE_KEY = 39, /* GRE key */
};
static unsigned int const OXM_EXP_ID_SIZE = sizeof(uint32_t); // length of experimenter id field
/* OXM Flow match field types for OpenFlow basic class. */
enum oxm_tlv_match_fields {
OXM_TLV_EXPR_GRE_VERSION =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GRE_VERSION << 9) | 2,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GRE_VERSION << 9) | (OXM_EXP_ID_SIZE + 2),
OXM_TLV_EXPR_GRE_VERSION_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_GRE_VERSION << 9) | 4 |
(OFPXMT_OFX_GRE_VERSION << 9) | (OXM_EXP_ID_SIZE + 4) |
HAS_MASK_FLAG,
OXM_TLV_EXPR_GRE_PROT_TYPE =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GRE_PROT_TYPE << 9) | 2,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GRE_PROT_TYPE << 9) | (OXM_EXP_ID_SIZE + 2),
OXM_TLV_EXPR_GRE_PROT_TYPE_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_GRE_PROT_TYPE << 9) | 4 |
(OFPXMT_OFX_GRE_PROT_TYPE << 9) | (OXM_EXP_ID_SIZE + 4) |
HAS_MASK_FLAG,
OXM_TLV_EXPR_GRE_KEY =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GRE_KEY << 9) | 4,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GRE_KEY << 9) | (OXM_EXP_ID_SIZE + 4),
OXM_TLV_EXPR_GRE_KEY_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_GRE_KEY << 9) | 8 | HAS_MASK_FLAG,
(OFPXMT_OFX_GRE_KEY << 9) | (OXM_EXP_ID_SIZE + 8) | HAS_MASK_FLAG,
};
/** OXM_OFX_GRE_VERSION
@@ -17,17 +17,19 @@ enum oxm_ofx_match_fields {
OFPXMT_OFX_GTP_TEID = 26, /* GTP tunnel endpoint identifier */
};
static unsigned int const OXM_EXP_ID_SIZE = sizeof(uint32_t); // length of experimenter id field
/* OXM Flow match field types for OpenFlow basic class. */
enum oxm_tlv_match_fields {
OXM_TLV_EXPR_GTP_MSGTYPE =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GTP_MSGTYPE << 9) | 1,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GTP_MSGTYPE << 9) | (OXM_EXP_ID_SIZE + 1),
OXM_TLV_EXPR_GTP_MSGTYPE_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_GTP_MSGTYPE << 9) | 2 |
(OFPXMT_OFX_GTP_MSGTYPE << 9) | (OXM_EXP_ID_SIZE + 2) |
HAS_MASK_FLAG,
OXM_TLV_EXPR_GTP_TEID =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GTP_TEID << 9) | 4,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_GTP_TEID << 9) | (OXM_EXP_ID_SIZE + 4),
OXM_TLV_EXPR_GTP_TEID_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_GTP_TEID << 9) | 8 | HAS_MASK_FLAG,
(OFPXMT_OFX_GTP_TEID << 9) | (OXM_EXP_ID_SIZE + 8) | HAS_MASK_FLAG,
};
/** OXM_OFX_GTP_TEID
@@ -38,22 +38,25 @@ enum oxm_ofx_match_fields_ofdpa {
OFPXMT_OFX_OFDPA_ALLOW_VLAN_TRANSLATION = 24,
OFPXMT_OFX_OFDPA_ACTSET_OUTPUT = 43,
};
static unsigned int const OXM_EXP_ID_SIZE = sizeof(uint32_t); // length of experimenter id field
/* OXM Flow match field types for OpenFlow experimenter class. */
enum oxm_tlv_match_fields_ofdpa {
OXM_TLV_EXPR_VRF =
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_VRF << 9) | 2,
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_VRF << 9) | (OXM_EXP_ID_SIZE + 2),
OXM_TLV_EXPR_VRF_MASK =
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_VRF << 9) | 4 | HAS_MASK_FLAG,
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_VRF << 9) | (OXM_EXP_ID_SIZE + 4) | HAS_MASK_FLAG,
OXM_TLV_EXPR_OVID =
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_OVID << 9) | 2,
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_OVID << 9) | (OXM_EXP_ID_SIZE + 2),
OXM_TLV_EXPR_ALLOW_VLAN_TRANSLATION =
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_ALLOW_VLAN_TRANSLATION << 9) | 5,
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_ALLOW_VLAN_TRANSLATION << 9) | (OXM_EXP_ID_SIZE + 1),
OXM_TLV_EXPR_ACTSET_OUTPUT =
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_ACTSET_OUTPUT << 9) | 8,
(openflow::OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_OFDPA_ACTSET_OUTPUT << 9) | (OXM_EXP_ID_SIZE + 4),
};
class coxmatch_ofb_vrf : public openflow::coxmatch_exp {
@@ -19,16 +19,18 @@ enum oxm_ofx_match_fields {
OFPXMT_OFX_PPP_PROT = 24, /* PPP protocol */
};
static unsigned int const OXM_EXP_ID_SIZE = sizeof(uint32_t); // length of experimenter id field
/* OXM Flow match field types for OpenFlow basic class. */
enum oxm_tlv_match_fields {
OXM_TLV_EXPR_PPPOE_CODE =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPPOE_CODE << 9) | 1,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPPOE_CODE << 9) | (OXM_EXP_ID_SIZE + 1),
OXM_TLV_EXPR_PPPOE_TYPE =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPPOE_TYPE << 9) | 1,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPPOE_TYPE << 9) | (OXM_EXP_ID_SIZE + 1),
OXM_TLV_EXPR_PPPOE_SID =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPPOE_SID << 9) | 2,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPPOE_SID << 9) | (OXM_EXP_ID_SIZE + 2),
OXM_TLV_EXPR_PPP_PROT =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPP_PROT << 9) | 2,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_PPP_PROT << 9) | (OXM_EXP_ID_SIZE + 2),
};
/** OXM_OF_PPPOE_CODE
@@ -22,40 +22,42 @@ enum oxm_ofx_match_fields {
OFPXMT_OFX_WLAN_ADDRESS_3 = 36,
};
static unsigned int const OXM_EXP_ID_SIZE = sizeof(uint32_t); // length of experimenter id field
/* OXM Flow match field types for OpenFlow basic class. */
enum oxm_tlv_match_fields {
OXM_TLV_EXPR_WLAN_FC =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_FC << 9) | 2,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_FC << 9) | (OXM_EXP_ID_SIZE + 2),
OXM_TLV_EXPR_WLAN_FC_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_WLAN_FC << 9) | 4 | HAS_MASK_FLAG,
(OFPXMT_OFX_WLAN_FC << 9) | (OXM_EXP_ID_SIZE + 4) | HAS_MASK_FLAG,
OXM_TLV_EXPR_WLAN_TYPE =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_TYPE << 9) | 1,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_TYPE << 9) | (OXM_EXP_ID_SIZE + 1),
OXM_TLV_EXPR_WLAN_TYPE_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_WLAN_TYPE << 9) | 2 | HAS_MASK_FLAG,
(OFPXMT_OFX_WLAN_TYPE << 9) | (OXM_EXP_ID_SIZE + 2) | HAS_MASK_FLAG,
OXM_TLV_EXPR_WLAN_SUBTYPE =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_SUBTYPE << 9) | 1,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_SUBTYPE << 9) | (OXM_EXP_ID_SIZE + 1),
OXM_TLV_EXPR_WLAN_SUBTYPE_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_WLAN_SUBTYPE << 9) | 2 |
(OFPXMT_OFX_WLAN_SUBTYPE << 9) | (OXM_EXP_ID_SIZE + 2) |
HAS_MASK_FLAG,
OXM_TLV_EXPR_WLAN_DIRECTION =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_DIRECTION << 9) | 1,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_DIRECTION << 9) | (OXM_EXP_ID_SIZE + 1),
OXM_TLV_EXPR_WLAN_DIRECTION_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_WLAN_DIRECTION << 9) | 2 |
(OFPXMT_OFX_WLAN_DIRECTION << 9) | (OXM_EXP_ID_SIZE + 2) |
HAS_MASK_FLAG,
OXM_TLV_EXPR_WLAN_ADDRESS_1 =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_ADDRESS_1 << 9) | 6,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_ADDRESS_1 << 9) | (OXM_EXP_ID_SIZE + 6),
OXM_TLV_EXPR_WLAN_ADDRESS_1_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_WLAN_ADDRESS_1 << 9) | 12 |
(OFPXMT_OFX_WLAN_ADDRESS_1 << 9) | (OXM_EXP_ID_SIZE + 12) |
HAS_MASK_FLAG,
OXM_TLV_EXPR_WLAN_ADDRESS_2 =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_ADDRESS_2 << 9) | 6,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_ADDRESS_2 << 9) | (OXM_EXP_ID_SIZE + 6),
OXM_TLV_EXPR_WLAN_ADDRESS_2_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_WLAN_ADDRESS_2 << 9) | 12 |
(OFPXMT_OFX_WLAN_ADDRESS_2 << 9) | (OXM_EXP_ID_SIZE + 12) |
HAS_MASK_FLAG,
OXM_TLV_EXPR_WLAN_ADDRESS_3 =
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_ADDRESS_3 << 9) | 6,
(OFPXMC_EXPERIMENTER << 16) | (OFPXMT_OFX_WLAN_ADDRESS_3 << 9) | (OXM_EXP_ID_SIZE + 6),
OXM_TLV_EXPR_WLAN_ADDRESS_3_MASK = (OFPXMC_EXPERIMENTER << 16) |
(OFPXMT_OFX_WLAN_ADDRESS_3 << 9) | 12 |
(OFPXMT_OFX_WLAN_ADDRESS_3 << 9) | (OXM_EXP_ID_SIZE + 12) |
HAS_MASK_FLAG,
};

0 comments on commit e62645a

Please sign in to comment.