Skip to content

Commit

Permalink
Extensions added as per new OVS NSH patch
Browse files Browse the repository at this point in the history
Change-Id: Iae1d9db03dea20120d9c689ea25d262104e937e4
  • Loading branch information
Phaneendra-Huawei committed May 12, 2016
1 parent 28e0563 commit adcb3e7
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 102 deletions.
54 changes: 42 additions & 12 deletions java_gen/java_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,23 +811,53 @@ def gen_fixed_length_string_jtype(length):
'of_oxm_reg7' : { 'value' : u32obj },
'of_oxm_reg7_masked' : { 'value' : u32obj, 'value_mask' : u32obj },

'of_oxm_nsh_spi' : { 'value' : u32obj },
'of_oxm_nsh_spi_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
'of_oxm_nsp' : { 'value' : u32obj },
'of_oxm_nsp_masked' : { 'value' : u32obj, 'value_mask' : u32obj },

'of_oxm_nsh_si' : { 'value' : u8obj },
'of_oxm_nsh_si_masked' : { 'value' : u8obj, 'value_mask' : u8obj },
'of_oxm_nsi' : { 'value' : u8obj },
'of_oxm_nsi_masked' : { 'value' : u8obj, 'value_mask' : u8obj },

'of_oxm_nsh_ch1' : { 'value' : u32obj },
'of_oxm_nsh_ch1_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
'of_oxm_nsh_c1' : { 'value' : u32obj },
'of_oxm_nsh_c1_masked' : { 'value' : u32obj, 'value_mask' : u32obj },

'of_oxm_nsh_ch2' : { 'value' : u32obj },
'of_oxm_nsh_ch2_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
'of_oxm_nsh_c2' : { 'value' : u32obj },
'of_oxm_nsh_c2_masked' : { 'value' : u32obj, 'value_mask' : u32obj },

'of_oxm_nsh_ch3' : { 'value' : u32obj },
'of_oxm_nsh_ch3_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
'of_oxm_nsh_c3' : { 'value' : u32obj },
'of_oxm_nsh_c3_masked' : { 'value' : u32obj, 'value_mask' : u32obj },

'of_oxm_nsh_ch4' : { 'value' : u32obj },
'of_oxm_nsh_ch4_masked' : { 'value' : u32obj, 'value_mask' : u32obj },
'of_oxm_nsh_c4' : { 'value' : u32obj },
'of_oxm_nsh_c4_masked' : { 'value' : u32obj, 'value_mask' : u32obj },

'of_oxm_nsh_mdtype' : { 'value' : u8obj },
'of_oxm_nsh_mdtype_masked' : { 'value' : u8obj, 'value_mask' : u8obj },

'of_oxm_nsh_np' : { 'value' : u8obj },
'of_oxm_nsh_np_masked' : { 'value' : u8obj, 'value_mask' : u8obj },

'of_oxm_encap_eth_src' : { 'value' : mac_addr },
'of_oxm_encap_eth_src_masked' : { 'value' : mac_addr, 'value_mask' : mac_addr },

'of_oxm_encap_eth_dst' : { 'value' : mac_addr },
'of_oxm_encap_eth_dst_masked' : { 'value' : mac_addr, 'value_mask' : mac_addr },

'of_oxm_encap_eth_type' : { 'value' : u16obj },
'of_oxm_encap_eth_type_masked' : { 'value' : u16obj, 'value_mask' : u16obj },

'of_oxm_tun_flags' : { 'value' : u16obj },
'of_oxm_tun_flags_masked' : { 'value' : u16obj, 'value_mask' : u16obj },

'of_oxm_tun_gbp_id' : { 'value' : u16obj },
'of_oxm_tun_gbp_id_masked' : { 'value' : u16obj, 'value_mask' : u16obj },

'of_oxm_tun_gbp_flags' : { 'value' : u8obj },
'of_oxm_tun_gbp_flags_masked' : { 'value' : u8obj, 'value_mask' : u8obj },

'of_oxm_tun_gpe_np' : { 'value' : u8obj },
'of_oxm_tun_gpe_np_masked' : { 'value' : u8obj, 'value_mask' : u8obj },

'of_oxm_tun_gpe_flags' : { 'value' : u8obj },
'of_oxm_tun_gpe_flags_masked' : { 'value' : u8obj, 'value_mask' : u8obj },
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,23 +336,53 @@ private MatchField(final String name, final MatchFields id, Prerequisite<?>... p
public final static MatchField<U32> REG7 =
new MatchField<U32>("reg7", MatchFields.REG7);

public final static MatchField<U32> NSH_SPI =
new MatchField<U32>("set_nsp", MatchFields.NSH_SPI);
public final static MatchField<U32> NSP =
new MatchField<U32>("nsp", MatchFields.NSP);

public final static MatchField<U8> NSH_SI =
new MatchField<U8>("set_nsi", MatchFields.NSH_SI);
public final static MatchField<U8> NSI =
new MatchField<U8>("nsi", MatchFields.NSI);

public final static MatchField<U32> NSH_CH1 =
new MatchField<U32>("set_nshc1", MatchFields.NSH_CH1);
public final static MatchField<U32> NSH_C1 =
new MatchField<U32>("nshc1", MatchFields.NSH_C1);

public final static MatchField<U32> NSH_CH2 =
new MatchField<U32>("set_nshc2", MatchFields.NSH_CH2);
public final static MatchField<U32> NSH_C2 =
new MatchField<U32>("nshc2", MatchFields.NSH_C2);

public final static MatchField<U32> NSH_CH3 =
new MatchField<U32>("set_nshc3", MatchFields.NSH_CH3);
public final static MatchField<U32> NSH_C3 =
new MatchField<U32>("nshc3", MatchFields.NSH_C3);

public final static MatchField<U32> NSH_CH4 =
new MatchField<U32>("set_nshc4", MatchFields.NSH_CH4);
public final static MatchField<U32> NSH_C4 =
new MatchField<U32>("nshc4", MatchFields.NSH_C4);

public final static MatchField<U8> NSH_MDTYPE =
new MatchField<U8>("nsh_mdtype", MatchFields.NSH_MDTYPE);

public final static MatchField<U8> NSH_NP =
new MatchField<U8>("nsh_np", MatchFields.NSH_NP);

public final static MatchField<MacAddress> ENCAP_ETH_SRC =
new MatchField<MacAddress>("encap_eth_src", MatchFields.ENCAP_ETH_SRC);

public final static MatchField<MacAddress> ENCAP_ETH_DST =
new MatchField<MacAddress>("encap_eth_dst", MatchFields.ENCAP_ETH_DST);

public final static MatchField<U16> ENCAP_ETH_TYPE =
new MatchField<U16>("encap_eth_type", MatchFields.ENCAP_ETH_TYPE);

public final static MatchField<U16> TUN_FLAGS =
new MatchField<U16>("tun_flags", MatchFields.TUN_FLAGS);

public final static MatchField<U16> TUN_GBP_ID =
new MatchField<U16>("tun_gbp_id", MatchFields.TUN_GBP_ID);

public final static MatchField<U8> TUN_GBP_FLAGS =
new MatchField<U8>("tun_gbp_flags", MatchFields.TUN_GBP_FLAGS);

public final static MatchField<U8> TUN_GPE_NP =
new MatchField<U8>("tun_gpe_np", MatchFields.TUN_GPE_NP);

public final static MatchField<U8> TUN_GPE_FLAGS =
new MatchField<U8>("tun_gpe_flags", MatchFields.TUN_GPE_NP);

public String getName() {
return name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,20 @@ public enum MatchFields {
REG5,
REG6,
REG7,
NSH_SPI,
NSH_SI,
NSH_CH1,
NSH_CH2,
NSH_CH3,
NSH_CH4,
NSP,
NSI,
NSH_C1,
NSH_C2,
NSH_C3,
NSH_C4,
NSH_MDTYPE,
NSH_NP,
ENCAP_ETH_SRC,
ENCAP_ETH_DST,
ENCAP_ETH_TYPE,
TUN_FLAGS,
TUN_GBP_ID,
TUN_GBP_FLAGS,
TUN_GPE_NP,
TUN_GPE_FLAGS,
}
48 changes: 6 additions & 42 deletions openflow_input/nicira_set_nsh
Original file line number Diff line number Diff line change
Expand Up @@ -27,56 +27,20 @@

#version any

struct of_action_nicira_set_nsp : of_action_nicira {
struct of_action_nicira_push_nsh : of_action_nicira {
uint16_t type == 65535;
uint16_t len;
uint32_t experimenter == 0x2320;
uint16_t subtype == 32;
uint16_t subtype == 38;
pad(2);
uint32_t nsp;
pad(4);
};

struct of_action_nicira_set_nsi : of_action_nicira {
struct of_action_nicira_pop_nsh : of_action_nicira {
uint16_t type == 65535;
uint16_t len;
uint32_t experimenter == 0x2320;
uint16_t subtype == 33;
uint8_t nsi;
pad(5);
};

struct of_action_nicira_set_nshc1 : of_action_nicira {
uint16_t type == 65535;
uint16_t len;
uint32_t experimenter == 0x2320;
uint16_t subtype == 34;
pad(2);
uint32_t nshc1;
};

struct of_action_nicira_set_nshc2 : of_action_nicira {
uint16_t type == 65535;
uint16_t len;
uint32_t experimenter == 0x2320;
uint16_t subtype == 35;
pad(2);
uint32_t nshc2;
};

struct of_action_nicira_set_nshc3 : of_action_nicira {
uint16_t type == 65535;
uint16_t len;
uint32_t experimenter == 0x2320;
uint16_t subtype == 36;
pad(2);
uint32_t nshc3;
};

struct of_action_nicira_set_nshc4 : of_action_nicira {
uint16_t type == 65535;
uint16_t len;
uint32_t experimenter == 0x2320;
uint16_t subtype == 37;
uint16_t subtype == 39;
pad(2);
uint32_t nshc4;
pad(4);
};
126 changes: 96 additions & 30 deletions openflow_input/oxm_nicira_nsh
Original file line number Diff line number Diff line change
Expand Up @@ -29,75 +29,141 @@
#version 4
#version 5

// Nicira extension for nsh_spi (37)
struct of_oxm_nsh_spi : of_oxm {
uint32_t type_len == 0x00014a04;
// Nicira extension for nsp (113)
struct of_oxm_nsp : of_oxm {
uint32_t type_len == 0x0001e204;
uint32_t value;
};

struct of_oxm_nsh_spi_masked : of_oxm {
uint32_t type_len == 0x00014b08;
struct of_oxm_nsp_masked : of_oxm {
uint32_t type_len == 0x0001e308;
uint32_t value;
uint32_t value_mask;
};

// Nicira extension for nsh_si (38)
struct of_oxm_nsh_si : of_oxm {
uint32_t type_len == 0x00014c04;
// Nicira extension for nsi (114)
struct of_oxm_nsi : of_oxm {
uint32_t type_len == 0x0001e401;
uint8_t value;
};

struct of_oxm_nsh_si_masked : of_oxm {
uint32_t type_len == 0x00014d08;
struct of_oxm_nsi_masked : of_oxm {
uint32_t type_len == 0x0001e502;
uint8_t value;
uint8_t value_mask;
};

// Nicira extension for nsh_ch1 (39)
struct of_oxm_nsh_ch1 : of_oxm {
uint32_t type_len == 0x00014e04;
// Nicira extension for nsh_c1 (115)
struct of_oxm_nsh_c1 : of_oxm {
uint32_t type_len == 0x0001e604;
uint32_t value;
};

struct of_oxm_nsh_ch1_masked : of_oxm {
uint32_t type_len == 0x00014f08;
struct of_oxm_nsh_c1_masked : of_oxm {
uint32_t type_len == 0x0001e708;
uint32_t value;
uint32_t value_mask;
};

// Nicira extension for nsh_ch2 (40)
struct of_oxm_nsh_ch2 : of_oxm {
uint32_t type_len == 0x00015004;
// Nicira extension for nsh_c2 (116)
struct of_oxm_nsh_c2 : of_oxm {
uint32_t type_len == 0x0001e804;
uint32_t value;
};

struct of_oxm_nsh_ch2_masked : of_oxm {
uint32_t type_len == 0x00015108;
struct of_oxm_nsh_c2_masked : of_oxm {
uint32_t type_len == 0x0001e908;
uint32_t value;
uint32_t value_mask;
};


// Nicira extension for nsh_ch3 (41)
struct of_oxm_nsh_ch3 : of_oxm {
uint32_t type_len == 0x00015204;
// Nicira extension for nsh_c3 (117)
struct of_oxm_nsh_c3 : of_oxm {
uint32_t type_len == 0x0001ea04;
uint32_t value;
};

struct of_oxm_nsh_ch3_masked : of_oxm {
uint32_t type_len == 0x00015308;
struct of_oxm_nsh_c3_masked : of_oxm {
uint32_t type_len == 0x0001eb08;
uint32_t value;
uint32_t value_mask;
};

// Nicira extension for nsh_ch4 (42)
struct of_oxm_nsh_ch4 : of_oxm {
uint32_t type_len == 0x00015404;
// Nicira extension for nsh_c4 (118)
struct of_oxm_nsh_c4 : of_oxm {
uint32_t type_len == 0x0001ec04;
uint32_t value;
};

struct of_oxm_nsh_ch4_masked : of_oxm {
uint32_t type_len == 0x00015508;
struct of_oxm_nsh_c4_masked : of_oxm {
uint32_t type_len == 0x0001ed08;
uint32_t value;
uint32_t value_mask;
};


// Nicira extension for nsh_mdtype (119)
struct of_oxm_nsh_mdtype : of_oxm {
uint32_t type_len == 0x0001ee01;
uint8_t value;
};

struct of_oxm_nsh_mdtype_masked : of_oxm {
uint32_t type_len == 0x0001ef02;
uint8_t value;
uint8_t value_mask;
};


// Nicira extension for nsh_np (120)
struct of_oxm_nsh_np : of_oxm {
uint32_t type_len == 0x0001f001;
uint8_t value;
};

struct of_oxm_nsh_np_masked : of_oxm {
uint32_t type_len == 0x0001f102;
uint8_t value;
uint8_t value_mask;
};


// Nicira extension for encap_eth_src (121)
struct of_oxm_encap_eth_src : of_oxm {
uint32_t type_len == 0x0001f206;
of_mac_addr_t value;
};

struct of_oxm_encap_eth_src_masked : of_oxm {
uint32_t type_len == 0x0001f30c;
of_mac_addr_t value;
of_mac_addr_t value_mask;

};


// Nicira extension for encap_eth_dst (122)
struct of_oxm_encap_eth_dst : of_oxm {
uint32_t type_len == 0x0001f406;
of_mac_addr_t value;
};

struct of_oxm_encap_eth_dst_masked : of_oxm {
uint32_t type_len == 0x0001f50c;
of_mac_addr_t value;
of_mac_addr_t value_mask;
};


// Nicira extension for encap_eth_type (123)
struct of_oxm_encap_eth_type : of_oxm {
uint32_t type_len == 0x0001f602;
uint16_t value;
};

struct of_oxm_encap_eth_type_masked : of_oxm {
uint32_t type_len == 0x0001f704;
uint16_t value;
uint16_t value_mask;
};
Loading

0 comments on commit adcb3e7

Please sign in to comment.