From 16287fb56c86be44410d3c7206c346ea6590e7fe Mon Sep 17 00:00:00 2001 From: Praseed Balakrishnan Date: Thu, 4 Sep 2014 10:30:40 -0700 Subject: [PATCH 01/17] Initial test of optical OXC experimenter messages --- c_gen/c_test_gen.py | 2 ++ .../openflow/protocol/match/MatchField.java | 9 +++++++++ .../openflow/protocol/match/MatchFields.java | 2 ++ .../projectfloodlight/protocol/OFOxmTest.java | 2 ++ .../match/MatchFieldIteration13Test.java | 12 ++++++++++++ .../protocol/match/MatchFieldIterationBase.java | 2 +- openflow_input/oxm-1.3 | 16 ++++++++++++++++ 7 files changed, 44 insertions(+), 1 deletion(-) diff --git a/c_gen/c_test_gen.py b/c_gen/c_test_gen.py index 71615e69d..9b70e52b6 100644 --- a/c_gen/c_test_gen.py +++ b/c_gen/c_test_gen.py @@ -105,6 +105,8 @@ def var_name_map(m_type): of_bsn_vport_q_in_q_t="vport", of_bitmap_128_t="bitmap_128", of_checksum_128_t="checksum_128", + #Circuit extensions + oxm_of_och_sig_id_t="sig_id", ) if m_type.find("of_list_") == 0: diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java index 78e6075af..1acc1a26e 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java @@ -235,6 +235,15 @@ private MatchField(final String name, final MatchFields id, Prerequisite... p public final static MatchField BSN_VLAN_XLATE_PORT_GROUP_ID = new MatchField("bsn_vlan_xlate_port_group_id", MatchFields.BSN_VLAN_XLATE_PORT_GROUP_ID); + + public final static MatchField OCH_SIGID = + new MatchField("och_sigid", + MatchFields.OCH_SIGID); + + public final static MatchField OCH_SIGTYPE = + new MatchField("och_sigid", + MatchFields.OCH_SIGTYPE); + public String getName() { return name; } diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java index 863634e52..43a77854c 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java @@ -57,4 +57,6 @@ public enum MatchFields { BSN_UDF7, BSN_TCP_FLAGS, BSN_VLAN_XLATE_PORT_GROUP_ID, + OCH_SIGID, + OCH_SIGTYPE; } diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/OFOxmTest.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/OFOxmTest.java index 8482886b9..04034cca2 100644 --- a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/OFOxmTest.java +++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/OFOxmTest.java @@ -59,4 +59,6 @@ public void testGetCanonicalNormalMask() { OFOxm canonical = ipv4SrcMasked.getCanonical(); assertEquals(ipv4SrcMasked, canonical); } + + } diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java index b654a5386..9656406c7 100644 --- a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java +++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java @@ -1,10 +1,22 @@ package org.projectfloodlight.protocol.match; +import org.junit.Test; import org.projectfloodlight.openflow.protocol.OFFactories; import org.projectfloodlight.openflow.protocol.OFVersion; +import org.projectfloodlight.openflow.protocol.match.Match; +import org.projectfloodlight.openflow.protocol.match.MatchField; +import org.projectfloodlight.openflow.types.U64; public class MatchFieldIteration13Test extends MatchFieldIterationBase { public MatchFieldIteration13Test() { super(OFFactories.getFactory(OFVersion.OF_13)); } + + @Test + public void matchCircuitFields() + { + Match.Builder builder = factory.buildMatchV3().setExact(MatchField + .OCH_SIGTYPE, U64.ZERO); + + } } diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIterationBase.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIterationBase.java index 9c72e37fb..892c5a07e 100644 --- a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIterationBase.java +++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIterationBase.java @@ -25,7 +25,7 @@ public class MatchFieldIterationBase { - private OFFactory factory; + protected OFFactory factory; protected MatchFieldIterationBase(OFFactory factory) { this.factory = factory; diff --git a/openflow_input/oxm-1.3 b/openflow_input/oxm-1.3 index 2dbab4208..a25b8b29a 100644 --- a/openflow_input/oxm-1.3 +++ b/openflow_input/oxm-1.3 @@ -40,3 +40,19 @@ struct of_oxm_tunnel_id_masked : of_oxm { uint64_t value; uint64_t value_mask; }; + +struct of_oxm_och_sigtype : of_oxm { + uint32_t type_len == 0x80005c08; + uint64_t value; +}; + + +struct of_oxm_och_sigid : of_oxm { + uint32_t type_len == 0x80005d10; + uint64_t value; +}; + + + + + From f78068b33d709d87282f981364cb11a0d9bc1999 Mon Sep 17 00:00:00 2001 From: Praseed Balakrishnan Date: Thu, 4 Sep 2014 10:30:40 -0700 Subject: [PATCH 02/17] Initial test of optical OXC experimenter messages --- c_gen/c_test_gen.py | 2 + .../openflow/protocol/match/MatchField.java | 9 ++ .../openflow/protocol/match/MatchFields.java | 2 + .../projectfloodlight/protocol/OFOxmTest.java | 2 + .../match/MatchFieldIteration13Test.java | 12 ++ .../match/MatchFieldIterationBase.java | 2 +- openflow_input/circuit | 104 ++++++++++++++++++ openflow_input/oxm-1.3 | 16 +++ 8 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 openflow_input/circuit diff --git a/c_gen/c_test_gen.py b/c_gen/c_test_gen.py index 71615e69d..9b70e52b6 100644 --- a/c_gen/c_test_gen.py +++ b/c_gen/c_test_gen.py @@ -105,6 +105,8 @@ def var_name_map(m_type): of_bsn_vport_q_in_q_t="vport", of_bitmap_128_t="bitmap_128", of_checksum_128_t="checksum_128", + #Circuit extensions + oxm_of_och_sig_id_t="sig_id", ) if m_type.find("of_list_") == 0: diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java index 78e6075af..1acc1a26e 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java @@ -235,6 +235,15 @@ private MatchField(final String name, final MatchFields id, Prerequisite... p public final static MatchField BSN_VLAN_XLATE_PORT_GROUP_ID = new MatchField("bsn_vlan_xlate_port_group_id", MatchFields.BSN_VLAN_XLATE_PORT_GROUP_ID); + + public final static MatchField OCH_SIGID = + new MatchField("och_sigid", + MatchFields.OCH_SIGID); + + public final static MatchField OCH_SIGTYPE = + new MatchField("och_sigid", + MatchFields.OCH_SIGTYPE); + public String getName() { return name; } diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java index 863634e52..43a77854c 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java @@ -57,4 +57,6 @@ public enum MatchFields { BSN_UDF7, BSN_TCP_FLAGS, BSN_VLAN_XLATE_PORT_GROUP_ID, + OCH_SIGID, + OCH_SIGTYPE; } diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/OFOxmTest.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/OFOxmTest.java index 8482886b9..04034cca2 100644 --- a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/OFOxmTest.java +++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/OFOxmTest.java @@ -59,4 +59,6 @@ public void testGetCanonicalNormalMask() { OFOxm canonical = ipv4SrcMasked.getCanonical(); assertEquals(ipv4SrcMasked, canonical); } + + } diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java index b654a5386..9656406c7 100644 --- a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java +++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java @@ -1,10 +1,22 @@ package org.projectfloodlight.protocol.match; +import org.junit.Test; import org.projectfloodlight.openflow.protocol.OFFactories; import org.projectfloodlight.openflow.protocol.OFVersion; +import org.projectfloodlight.openflow.protocol.match.Match; +import org.projectfloodlight.openflow.protocol.match.MatchField; +import org.projectfloodlight.openflow.types.U64; public class MatchFieldIteration13Test extends MatchFieldIterationBase { public MatchFieldIteration13Test() { super(OFFactories.getFactory(OFVersion.OF_13)); } + + @Test + public void matchCircuitFields() + { + Match.Builder builder = factory.buildMatchV3().setExact(MatchField + .OCH_SIGTYPE, U64.ZERO); + + } } diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIterationBase.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIterationBase.java index 9c72e37fb..892c5a07e 100644 --- a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIterationBase.java +++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIterationBase.java @@ -25,7 +25,7 @@ public class MatchFieldIterationBase { - private OFFactory factory; + protected OFFactory factory; protected MatchFieldIterationBase(OFFactory factory) { this.factory = factory; diff --git a/openflow_input/circuit b/openflow_input/circuit new file mode 100644 index 000000000..9377d6db7 --- /dev/null +++ b/openflow_input/circuit @@ -0,0 +1,104 @@ +#version 4 + +/* WDM grid types */ +enum ofp_grid_type { + OFPGRIDT_RES = 0, + OFPGRIDT_DWDM = 1, + OFPGRIDT_CWDM = 2, + OFPGRIDT_FLEX = 3, +}; + +/* WDM grid channel spacing */ +enum ofp_channel_spacing { + OFPCS_RES = 0, + OFPCS_GHZ_100 = 1, + OFPCS_GHZ_50 = 2, + OFPCS_GHZ_24 = 3, + OFPCS_GHZ_12P5 = 4, /* 12.5 GHZ */ + OFPCS_GHZ_6P25 = 5, /* 6.25 GHZ */ +}; + +/* Layer classes (families) supported for optical transport port. */ +enum ofp_port_optical_transport_layer_class { + OFPPOTL_PORT = 1, /* Class of base port layer signal types */ + OFPPOTL_OCH = 2, /* Class of OCH layer signal types*/ + OFPPOTL_ODU = 3, /* Class of ODU layer signal types*/ + OFPPOTL_ODUCLT = 4, /* Class of ODU client layer signal types*/ +}; + +/* Base port layer signal types */ +enum ofp_otport_signal_type { + OFPOTPT_OTSn = 1, + OFPOTPT_OMSn = 2, + OFPOTPT_OPSn = 3, + OFPOTPT_OPSM = 4, + OFPOTPT_OCH = 5, + OFPOTPT_OTU1 = 11, + OFPOTPT_OTU2 = 12, + OFPOTPT_OTU3 = 13, + OFPOTPT_OTU4 = 14, +}; + +/* OCH layer signal types */ +enum ofp_och_signal_type { + OFPOCHT_FIX_GRID = 1, + OFPOCHT_FLEX_GRID = 2, +}; + + +struct oxm_of_och_sig_id { + + uint8_t grid; //Type of WDM grid - OFPGRIDT_* + uint8_t cs; //Channel Spacing - OFPCS_* + uint16_t n; // Used to calculate frequency as in [ITU G.694.1] + // Frequency(THz)= 193.1 THz + n * chan_spacing + uint16_t m; // Used to calculate spectral width [ITU G.694.1] + // Spectral Width (GHz) = m * 12.5 + // For fix grid networks, m=1 +}; + +// circuit extension message +struct of_circuit_header : of_experimenter { + uint8_t version; + uint8_t type == 4; + uint16_t length; + uint32_t xid; + uint32_t experimenter == 0xffff; + uint32_t subtype == ?; + uint8_t sigtype; + oxm_of_och_sig_id_t sig_id; +}; + + + +// circuit extension action +struct of_action_circuit: of_action_experimenter { + uint16_t type == 65535; + uint16_t len; + uint32_t experimenter == 0xffff; + +}; + +struct of_circuit_ports_request : of_experimenter_stats_request { + uint8_t version; + uint8_t type == 18; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_request_flags flags; + pad(4); + uint32_t experimenter == 0x5c16c8; + uint32_t subtype == 15; +}; + +struct of_circuit_ports_reply : of_experimenter_stats_reply { + uint8_t version; + uint8_t type == 19; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_reply_flags flags; + pad(4); + uint32_t experimenter == 0x5c16c8; + uint32_t subtype == ?; +}; diff --git a/openflow_input/oxm-1.3 b/openflow_input/oxm-1.3 index 2dbab4208..a25b8b29a 100644 --- a/openflow_input/oxm-1.3 +++ b/openflow_input/oxm-1.3 @@ -40,3 +40,19 @@ struct of_oxm_tunnel_id_masked : of_oxm { uint64_t value; uint64_t value_mask; }; + +struct of_oxm_och_sigtype : of_oxm { + uint32_t type_len == 0x80005c08; + uint64_t value; +}; + + +struct of_oxm_och_sigid : of_oxm { + uint32_t type_len == 0x80005d10; + uint64_t value; +}; + + + + + From 7f71878dd967da2eba3e2dd633e95d7a470e22e2 Mon Sep 17 00:00:00 2001 From: Praseed Balakrishnan Date: Thu, 18 Sep 2014 17:02:48 -0700 Subject: [PATCH 03/17] experimenter optical multipart request and reply messages to work with LINC-OE --- c_gen/c_code_gen.py | 1 + c_gen/c_test_gen.py | 7 ++++-- c_gen/of_g_legacy.py | 6 ++++- java_gen/java_type.py | 2 ++ loxi_ir/ir_offset.py | 4 ++- openflow_input/circuit | 57 +++++++++++++++++++++++++++++++++++++++--- 6 files changed, 69 insertions(+), 8 deletions(-) diff --git a/c_gen/c_code_gen.py b/c_gen/c_code_gen.py index 6556d3b0b..484e94135 100644 --- a/c_gen/c_code_gen.py +++ b/c_gen/c_code_gen.py @@ -653,6 +653,7 @@ def base_h_content(out): /* Currently these are categorized as scalars */ typedef char of_port_name_t[OF_MAX_PORT_NAME_LEN]; +typedef char of_app_code_t[OF_APP_CODE_LEN]; typedef char of_table_name_t[OF_MAX_TABLE_NAME_LEN]; typedef char of_desc_str_t[OF_DESC_STR_LEN]; typedef char of_serial_num_t[OF_SERIAL_NUM_LEN]; diff --git a/c_gen/c_test_gen.py b/c_gen/c_test_gen.py index 9b70e52b6..8cd73c50e 100644 --- a/c_gen/c_test_gen.py +++ b/c_gen/c_test_gen.py @@ -106,7 +106,10 @@ def var_name_map(m_type): of_bitmap_128_t="bitmap_128", of_checksum_128_t="checksum_128", #Circuit extensions - oxm_of_och_sig_id_t="sig_id", + oxm_of_och_sig_id_t="sig_id", + of_app_code_t="app_code", + #of_port_optical_transport_application_code_t="tappcode", + of_port_desc_prop_optical_transport_t="desc1", ) if m_type.find("of_list_") == 0: @@ -121,7 +124,7 @@ def var_name_map(m_type): string_types = [ "of_port_name_t", "of_table_name_t", "of_desc_str_t", "of_serial_num_t", "of_mac_addr_t", "of_ipv6_t", "of_bitmap_128_t", "of_checksum_128_t", - "of_str64_t"] + "of_str64_t","of_app_code_t"] scalar_types = integer_types[:] scalar_types.extend(string_types) diff --git a/c_gen/of_g_legacy.py b/c_gen/of_g_legacy.py index b58ca088d..c0267cab7 100644 --- a/c_gen/of_g_legacy.py +++ b/c_gen/of_g_legacy.py @@ -87,7 +87,8 @@ OF_MAX_PORT_NAME_LEN = 16, OF_ETH_ALEN = 6, OF_DESC_STR_LEN = 256, - OF_SERIAL_NUM_LEN = 32 + OF_SERIAL_NUM_LEN = 32, + OF_APP_CODE_LEN = 15, ) ## List of mixed data types @@ -208,6 +209,9 @@ of_octets_t = dict(bytes=-1, short_name="octets"), of_bitmap_128_t = dict(bytes=16, short_name="bitmap_128"), of_checksum_128_t = dict(bytes=16, short_name="checksum_128"), + of_app_code_t = dict(bytes=ofp_constants["OF_APP_CODE_LEN"], + short_name="app_code"), + ) of_scalar_types = ["char", "uint8_t", "uint16_t", "uint32_t", "uint64_t", diff --git a/java_gen/java_type.py b/java_gen/java_type.py index 12d6260c2..6b97f690c 100644 --- a/java_gen/java_type.py +++ b/java_gen/java_type.py @@ -352,6 +352,7 @@ def gen_fixed_length_string_jtype(length): default="MacAddress.NONE") port_name = gen_fixed_length_string_jtype(16) +app_code = gen_fixed_length_string_jtype(15) desc_str = gen_fixed_length_string_jtype(256) serial_num = gen_fixed_length_string_jtype(32) table_name = gen_fixed_length_string_jtype(32) @@ -549,6 +550,7 @@ def gen_fixed_length_string_jtype(length): 'of_bitmap_128_t': port_bitmap, 'of_checksum_128_t': u128, 'of_bsn_vport_t': bsn_vport, + 'of_app_code_t': app_code, } ## Map that defines exceptions from the standard loxi->java mapping scheme diff --git a/loxi_ir/ir_offset.py b/loxi_ir/ir_offset.py index 9c6a5c1c9..2d5c71c7d 100644 --- a/loxi_ir/ir_offset.py +++ b/loxi_ir/ir_offset.py @@ -25,7 +25,8 @@ OF_MAX_PORT_NAME_LEN = 16, OF_ETH_ALEN = 6, OF_DESC_STR_LEN = 256, - OF_SERIAL_NUM_LEN = 32 + OF_SERIAL_NUM_LEN = 32, + OF_APP_CODE_LEN = 15 ) @@ -102,6 +103,7 @@ of_octets_t = (0, False), of_bitmap_128_t = (16, True), of_checksum_128_t = (16, True), + of_app_code_t = (15,True), ) def type_dec_to_count_base(m_type): diff --git a/openflow_input/circuit b/openflow_input/circuit index 9377d6db7..87be0236f 100644 --- a/openflow_input/circuit +++ b/openflow_input/circuit @@ -79,6 +79,7 @@ struct of_action_circuit: of_action_experimenter { }; + struct of_circuit_ports_request : of_experimenter_stats_request { uint8_t version; uint8_t type == 18; @@ -87,10 +88,11 @@ struct of_circuit_ports_request : of_experimenter_stats_request { uint16_t stats_type == 0xffff; enum ofp_stats_request_flags flags; pad(4); - uint32_t experimenter == 0x5c16c8; - uint32_t subtype == 15; + uint32_t experimenter == 0x748771; + uint32_t subtype == 13; }; + struct of_circuit_ports_reply : of_experimenter_stats_reply { uint8_t version; uint8_t type == 19; @@ -99,6 +101,53 @@ struct of_circuit_ports_reply : of_experimenter_stats_reply { uint16_t stats_type == 0xffff; enum ofp_stats_reply_flags flags; pad(4); - uint32_t experimenter == 0x5c16c8; - uint32_t subtype == ?; + uint32_t experimenter == 0x748771; + uint32_t subtype == 13; + list(of_port_optical_t) entries; +}; + + +struct of_port_optical { + of_port_no_t port_no; + uint16_t length; + pad(2); + of_mac_addr_t hw_addr; + pad(2); + of_port_name_t name; + enum ofp_port_config config; + enum ofp_port_state state; + list(of_port_desc_prop_optical_transport_t) desc; +}; + +struct of_port_desc_prop_optical_transport { + uint16_t type; + uint16_t length; + uint8_t port_signal_type; + uint8_t reserved; + pad(2); }; + +struct of_port_optical_transport_application_code +{ + uint16_t feature_type; + uint8_t oic_type; + of_app_code_t app_code; +}; + + +struct of_port_optical_transport_layer_entry { + uint8_t layer_class; + uint8_t signal_type; + uint8_t adaptation; + pad(5); +}; + + +/* ODU Layer Stack Feature Encoding */ +struct of_port_optical_transport_layer_stack { + uint16_t feature_type; + uint16_t length; + pad(4); + list(of_port_optical_transport_layer_entry_t) entries; +}; + From 2ed6da0c951f063294bad766161695b3c5b28548 Mon Sep 17 00:00:00 2001 From: Praseed Balakrishnan Date: Thu, 18 Sep 2014 17:02:48 -0700 Subject: [PATCH 04/17] optical circuit experimenter changes --- c_gen/c_test_gen.py | 4 +- c_gen/of_g_legacy.py | 4 +- java_gen/java_type.py | 8 ++ .../openflow/protocol/match/MatchField.java | 20 ++- .../openflow/protocol/match/MatchFields.java | 5 +- .../openflow/types/CircuitSignalID.java | 122 ++++++++++++++++++ .../match/MatchFieldIteration13Test.java | 4 +- loxi_ir/ir_offset.py | 1 + openflow_input/circuit | 42 +++--- openflow_input/oxm-1.3 | 16 --- 10 files changed, 181 insertions(+), 45 deletions(-) create mode 100644 java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java diff --git a/c_gen/c_test_gen.py b/c_gen/c_test_gen.py index 8cd73c50e..2f9353640 100644 --- a/c_gen/c_test_gen.py +++ b/c_gen/c_test_gen.py @@ -106,10 +106,8 @@ def var_name_map(m_type): of_bitmap_128_t="bitmap_128", of_checksum_128_t="checksum_128", #Circuit extensions - oxm_of_och_sig_id_t="sig_id", of_app_code_t="app_code", - #of_port_optical_transport_application_code_t="tappcode", - of_port_desc_prop_optical_transport_t="desc1", + of_sig_id_t="sig_id", ) if m_type.find("of_list_") == 0: diff --git a/c_gen/of_g_legacy.py b/c_gen/of_g_legacy.py index c0267cab7..0c48eddb6 100644 --- a/c_gen/of_g_legacy.py +++ b/c_gen/of_g_legacy.py @@ -89,6 +89,7 @@ OF_DESC_STR_LEN = 256, OF_SERIAL_NUM_LEN = 32, OF_APP_CODE_LEN = 15, + OF_SIGID_LEN=6, ) ## List of mixed data types @@ -211,7 +212,8 @@ of_checksum_128_t = dict(bytes=16, short_name="checksum_128"), of_app_code_t = dict(bytes=ofp_constants["OF_APP_CODE_LEN"], short_name="app_code"), - + of_sig_id_t = dict(bytes=ofp_constants["OF_SIGID_LEN"], + short_name="sig_id"), ) of_scalar_types = ["char", "uint8_t", "uint16_t", "uint32_t", "uint64_t", diff --git a/java_gen/java_type.py b/java_gen/java_type.py index 6b97f690c..5ff987d48 100644 --- a/java_gen/java_type.py +++ b/java_gen/java_type.py @@ -492,6 +492,9 @@ def gen_fixed_length_string_jtype(length): .op(read="OFBufferId.of(bb.readInt())", write="bb.writeInt($name.getInt())", default="OFBufferId.NO_BUFFER") lag_id = JType("LagId") \ .op(version=ANY, read="LagId.read4Bytes(bb)", write="$name.write4Bytes(bb)", default="LagId.NONE") + +sig_id = JType("CircuitSignalID") \ + .op(version=ANY, read="CircuitSignalID.read6Bytes(bb)", write="$name.write6Bytes(bb)", default="CircuitSignalID.NONE") vrf = JType("VRF") \ .op(version=ANY, read="VRF.read4Bytes(bb)", write="$name.write4Bytes(bb)", default="VRF.ZERO") class_id = JType("ClassId") \ @@ -551,6 +554,7 @@ def gen_fixed_length_string_jtype(length): 'of_checksum_128_t': u128, 'of_bsn_vport_t': bsn_vport, 'of_app_code_t': app_code, + 'of_sig_id_t': sig_id, } ## Map that defines exceptions from the standard loxi->java mapping scheme @@ -698,6 +702,10 @@ def gen_fixed_length_string_jtype(length): 'of_bsn_log': { 'data': var_string }, 'of_features_reply' : { 'auxiliary_id' : of_aux_id}, + 'of_oxm_och_sigtype' : { 'value' : u8obj }, + 'of_oxm_och_sigtype_basic' : { 'value' : u8obj }, + 'of_oxm_och_sigid' : {'value' : sig_id}, + 'of_oxm_och_sigid_basic' : {'value' : sig_id}, } diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java index 1acc1a26e..01a1fa58b 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java @@ -27,6 +27,7 @@ import org.projectfloodlight.openflow.types.UDF; import org.projectfloodlight.openflow.types.VRF; import org.projectfloodlight.openflow.types.VlanPcp; +import org.projectfloodlight.openflow.types.CircuitSignalID; @SuppressWarnings("unchecked") public class MatchField> { @@ -235,15 +236,24 @@ private MatchField(final String name, final MatchFields id, Prerequisite... p public final static MatchField BSN_VLAN_XLATE_PORT_GROUP_ID = new MatchField("bsn_vlan_xlate_port_group_id", MatchFields.BSN_VLAN_XLATE_PORT_GROUP_ID); - - public final static MatchField OCH_SIGID = - new MatchField("och_sigid", + + public final static MatchField OCH_SIGID = + new MatchField("och_sigid", MatchFields.OCH_SIGID); - public final static MatchField OCH_SIGTYPE = - new MatchField("och_sigid", + public final static MatchField OCH_SIGTYPE = + new MatchField("och_sigtype", MatchFields.OCH_SIGTYPE); + + public final static MatchField OCH_SIGID_BASIC = + new MatchField("och_sigid_basic", + MatchFields.OCH_SIGID); + public final static MatchField OCH_SIGTYPE_BASIC = + new MatchField("och_sigtype_basic", + MatchFields.OCH_SIGTYPE_BASIC); + + public String getName() { return name; } diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java index 43a77854c..ccf56b2f6 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java @@ -58,5 +58,8 @@ public enum MatchFields { BSN_TCP_FLAGS, BSN_VLAN_XLATE_PORT_GROUP_ID, OCH_SIGID, - OCH_SIGTYPE; + OCH_SIGTYPE, + OCH_SIGID_BASIC, + OCH_SIGTYPE_BASIC, +; } diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java new file mode 100644 index 000000000..f3473878a --- /dev/null +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java @@ -0,0 +1,122 @@ +package org.projectfloodlight.openflow.types; + +import com.google.common.collect.ComparisonChain; +import org.jboss.netty.buffer.ChannelBuffer; +import org.projectfloodlight.openflow.exceptions.OFParseError; + +import com.google.common.hash.PrimitiveSink; + + +public class CircuitSignalID implements OFValueType { + static final int length = 6; + + private byte gridType; + private byte channelSpacing ; + private short channelNumber; + private short spectralWidth; + + public static final CircuitSignalID NONE = new CircuitSignalID((byte)0, + (byte)0, + (short)0, + (short)0); + + + public CircuitSignalID(byte gridType, byte channelSpacing, + short channelNumber, + short spectralWidth) + { + this.gridType = gridType; + this.channelSpacing = channelSpacing; + this.channelNumber = channelNumber; + this.spectralWidth = spectralWidth; + + } + + @Override + public int getLength() { + return length; + } + + + public void write6Bytes(ChannelBuffer c) { + c.writeByte(gridType); + c.writeByte(channelSpacing); + c.writeShort(channelNumber); + c.writeShort(spectralWidth); + } + + public static CircuitSignalID read6Bytes(ChannelBuffer c) throws OFParseError { + return new CircuitSignalID((byte)c.readUnsignedByte(), + (byte)c.readUnsignedByte(), + (short)c.readUnsignedShort(), + (short)c.readUnsignedShort()); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + CircuitSignalID that = (CircuitSignalID) o; + + if (channelNumber != that.channelNumber) return false; + if (channelSpacing != that.channelSpacing) return false; + if (gridType != that.gridType) return false; + if (spectralWidth != that.spectralWidth) return false; + + return true; + } + + @Override + public int hashCode() { + int result = (int) gridType; + result = 31 * result + (int) channelSpacing; + result = 31 * result + (int) channelNumber; + result = 31 * result + (int) spectralWidth; + return result; + } + + @Override + public String toString() { + return "CircuitSignalID{" + + "gridType=" + gridType + + ", channelSpacing=" + channelSpacing + + ", channelNumber=" + channelNumber + + ", spectralWidth=" + spectralWidth + + '}'; + } + + @Override + public CircuitSignalID applyMask(CircuitSignalID mask) { + return new CircuitSignalID((byte) (this.gridType & mask.gridType), + (byte) (this.channelSpacing & mask + .channelSpacing), + (short) (this.channelNumber & mask + .channelNumber), + (short) (this.spectralWidth & mask + .spectralWidth)); + } + + + @Override + public int compareTo(CircuitSignalID o) { + return ComparisonChain.start() + .compare(gridType,o.gridType) + .compare(channelSpacing,o.channelSpacing) + .compare(channelNumber,o.channelNumber) + .compare(spectralWidth,o.spectralWidth) + .result(); + } + + + @Override + public void putTo(PrimitiveSink sink) { + sink.putByte(gridType); + sink.putByte(channelSpacing); + sink.putShort(channelNumber); + sink.putShort(spectralWidth); + } + + + +} diff --git a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java index 9656406c7..1bd3efee1 100644 --- a/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java +++ b/java_gen/pre-written/src/test/java/org/projectfloodlight/protocol/match/MatchFieldIteration13Test.java @@ -5,7 +5,7 @@ import org.projectfloodlight.openflow.protocol.OFVersion; import org.projectfloodlight.openflow.protocol.match.Match; import org.projectfloodlight.openflow.protocol.match.MatchField; -import org.projectfloodlight.openflow.types.U64; +import org.projectfloodlight.openflow.types.U8; public class MatchFieldIteration13Test extends MatchFieldIterationBase { public MatchFieldIteration13Test() { @@ -16,7 +16,7 @@ public MatchFieldIteration13Test() { public void matchCircuitFields() { Match.Builder builder = factory.buildMatchV3().setExact(MatchField - .OCH_SIGTYPE, U64.ZERO); + .OCH_SIGTYPE, U8.ZERO); } } diff --git a/loxi_ir/ir_offset.py b/loxi_ir/ir_offset.py index 2d5c71c7d..1d6611515 100644 --- a/loxi_ir/ir_offset.py +++ b/loxi_ir/ir_offset.py @@ -104,6 +104,7 @@ of_bitmap_128_t = (16, True), of_checksum_128_t = (16, True), of_app_code_t = (15,True), + of_sig_id_t = (6, True), ) def type_dec_to_count_base(m_type): diff --git a/openflow_input/circuit b/openflow_input/circuit index 87be0236f..01a1432b5 100644 --- a/openflow_input/circuit +++ b/openflow_input/circuit @@ -45,9 +45,8 @@ enum ofp_och_signal_type { OFPOCHT_FLEX_GRID = 2, }; - -struct oxm_of_och_sig_id { - +// Not used .. just for info on structure. +struct ofp_och_signal_id { uint8_t grid; //Type of WDM grid - OFPGRIDT_* uint8_t cs; //Channel Spacing - OFPCS_* uint16_t n; // Used to calculate frequency as in [ITU G.694.1] @@ -57,26 +56,35 @@ struct oxm_of_och_sig_id { // For fix grid networks, m=1 }; -// circuit extension message -struct of_circuit_header : of_experimenter { - uint8_t version; - uint8_t type == 4; - uint16_t length; - uint32_t xid; - uint32_t experimenter == 0xffff; - uint32_t subtype == ?; - uint8_t sigtype; - oxm_of_och_sig_id_t sig_id; +struct of_oxm_och_sigtype : of_oxm { + uint32_t type_len == 0x00085801; + uint8_t value; }; +struct of_oxm_och_sigid : of_oxm { + uint32_t type_len == 0x00085A06; + of_sig_id_t value; +}; +struct of_oxm_och_sigtype_basic : of_oxm { + uint32_t type_len == 0x80005801; + uint8_t value; +}; -// circuit extension action -struct of_action_circuit: of_action_experimenter { +struct of_oxm_och_sigid_basic : of_oxm { + uint32_t type_len == 0x80005A06; + of_sig_id_t value; +}; + + +struct of_action_circuit : of_action_experimenter { uint16_t type == 65535; uint16_t len; - uint32_t experimenter == 0xffff; - + uint32_t experimenter == 0x748771; + uint16_t subtype == 25; + uint16_t hlength == 16; // fix length of OXM field + of_oxm_t field; + pad(2); }; diff --git a/openflow_input/oxm-1.3 b/openflow_input/oxm-1.3 index a25b8b29a..2dbab4208 100644 --- a/openflow_input/oxm-1.3 +++ b/openflow_input/oxm-1.3 @@ -40,19 +40,3 @@ struct of_oxm_tunnel_id_masked : of_oxm { uint64_t value; uint64_t value_mask; }; - -struct of_oxm_och_sigtype : of_oxm { - uint32_t type_len == 0x80005c08; - uint64_t value; -}; - - -struct of_oxm_och_sigid : of_oxm { - uint32_t type_len == 0x80005d10; - uint64_t value; -}; - - - - - From db949d4e9ca6858a3e2da5ca0684f7b6e8d1e8cc Mon Sep 17 00:00:00 2001 From: Praseed Balakrishnan Date: Tue, 2 Dec 2014 14:28:20 -0800 Subject: [PATCH 05/17] changed order of sigtype and sigid Conflicts: java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java --- .../openflow/protocol/match/MatchField.java | 18 ++++++------- .../openflow/protocol/match/MatchFields.java | 5 ++-- .../openflow/types/CircuitSignalID.java | 15 +++++++++++ openflow_input/circuit | 27 +++++++++++++++++-- 4 files changed, 51 insertions(+), 14 deletions(-) diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java index 01a1fa58b..9fb3fd4fa 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchField.java @@ -236,23 +236,23 @@ private MatchField(final String name, final MatchFields id, Prerequisite... p public final static MatchField BSN_VLAN_XLATE_PORT_GROUP_ID = new MatchField("bsn_vlan_xlate_port_group_id", MatchFields.BSN_VLAN_XLATE_PORT_GROUP_ID); - - public final static MatchField OCH_SIGID = - new MatchField("och_sigid", - MatchFields.OCH_SIGID); public final static MatchField OCH_SIGTYPE = new MatchField("och_sigtype", MatchFields.OCH_SIGTYPE); - - public final static MatchField OCH_SIGID_BASIC = - new MatchField("och_sigid_basic", - MatchFields.OCH_SIGID); public final static MatchField OCH_SIGTYPE_BASIC = new MatchField("och_sigtype_basic", MatchFields.OCH_SIGTYPE_BASIC); - + + + public final static MatchField OCH_SIGID = + new MatchField("och_sigid", + MatchFields.OCH_SIGID); + + public final static MatchField OCH_SIGID_BASIC = + new MatchField("och_sigid_basic", + MatchFields.OCH_SIGID); public String getName() { return name; diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java index ccf56b2f6..3bf717b52 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/protocol/match/MatchFields.java @@ -57,9 +57,8 @@ public enum MatchFields { BSN_UDF7, BSN_TCP_FLAGS, BSN_VLAN_XLATE_PORT_GROUP_ID, - OCH_SIGID, OCH_SIGTYPE, - OCH_SIGID_BASIC, OCH_SIGTYPE_BASIC, -; + OCH_SIGID, + OCH_SIGID_BASIC,; } diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java index f3473878a..7a304f679 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java @@ -37,6 +37,21 @@ public int getLength() { return length; } + public byte getGridType() { + return gridType; + } + + public byte getChannelSpacing() { + return channelSpacing; + } + + public short getChannelNumber() { + return channelNumber; + } + + public short getSpectralWidth() { + return spectralWidth; + } public void write6Bytes(ChannelBuffer c) { c.writeByte(gridType); diff --git a/openflow_input/circuit b/openflow_input/circuit index 01a1432b5..0f436a42a 100644 --- a/openflow_input/circuit +++ b/openflow_input/circuit @@ -114,7 +114,6 @@ struct of_circuit_ports_reply : of_experimenter_stats_reply { list(of_port_optical_t) entries; }; - struct of_port_optical { of_port_no_t port_no; uint16_t length; @@ -132,9 +131,33 @@ struct of_port_desc_prop_optical_transport { uint16_t length; uint8_t port_signal_type; uint8_t reserved; - pad(2); + pad(1); + uint8_t port_type; +}; + +struct of_circuit_port_status : of_experimenter { + uint8_t version; + uint8_t type == 4; + uint16_t length; + uint32_t xid; + uint32_t experimenter == 0x748771; + uint32_t exp_type == 12; + enum ofp_port_reason reason; + pad(7); + of_port_no_t port_no; + uint16_t lengths; + pad(2); + of_mac_addr_t hw_addr; + pad(2); + of_port_name_t name; + enum ofp_port_config config; + enum ofp_port_state state; + uint64_t ignore; }; + + + struct of_port_optical_transport_application_code { uint16_t feature_type; From 3efb663dff6e47bab26eb841a7792b3eed0223bf Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Wed, 3 Dec 2014 14:00:13 -0800 Subject: [PATCH 06/17] Changing openflowj groupID and version in pom.xml --- java_gen/pre-written/pom.xml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/java_gen/pre-written/pom.xml b/java_gen/pre-written/pom.xml index f45e39fe5..9f21b24fa 100644 --- a/java_gen/pre-written/pom.xml +++ b/java_gen/pre-written/pom.xml @@ -8,9 +8,9 @@ 7 - org.projectfloodlight + org.onosproject openflowj - 0.3.8-SNAPSHOT + 0.3.7.oe jar OpenFlowJ-Loxi @@ -232,11 +232,10 @@ i ${env.NODE_NAME} - + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.5 + true + + ossrh + https://oss.sonatype.org/ + + From 19ba9fc52ea5fbd19b3b4b03126035f35844a6d0 Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Wed, 3 Dec 2014 19:29:53 -0800 Subject: [PATCH 07/17] fixing java pom.xml --- java_gen/pre-written/pom.xml | 87 +++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/java_gen/pre-written/pom.xml b/java_gen/pre-written/pom.xml index 9f21b24fa..631544e1a 100644 --- a/java_gen/pre-written/pom.xml +++ b/java_gen/pre-written/pom.xml @@ -224,38 +224,13 @@ ${env.BUILD_ID} ${env.BUILD_TAG} ${env.JOB_NAME} -i ${env.NODE_NAME} + ${env.NODE_NAME} - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.5 - true - - ossrh - https://oss.sonatype.org/ - - @@ -267,4 +242,64 @@ i ${env.NODE_NAME} + + + release + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.5 + true + + ossrh + https://oss.sonatype.org/ + false + + + + + + From 820eaee6dd9a01cd686f131404483791a28accc8 Mon Sep 17 00:00:00 2001 From: alshabib Date: Mon, 12 Jan 2015 18:49:28 -0800 Subject: [PATCH 08/17] fix for port showing up as negative --- .../main/java/org/projectfloodlight/openflow/types/OFPort.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPort.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPort.java index 155a9dbd2..d96942f53 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPort.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OFPort.java @@ -434,7 +434,7 @@ public static OFPort ofShort(final short portNumber) { if (portNumber < 0 && portNumber > OFPP_MAX_SHORT) throw new IllegalArgumentException("Unknown special port number: " + portNumber); - return new OFPort(portNumber); + return new OFPort(U16.f(portNumber)); } } From 58a73e3defe918b6d6f262ad28d34124e9afee17 Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Thu, 28 May 2015 11:51:27 -0700 Subject: [PATCH 09/17] Adding OCS OpenFlow Protocol Extensions from Calient --- c_gen/c_code_gen.py | 2 + c_gen/c_test_gen.py | 5 +- c_gen/of_g_legacy.py | 4 +- c_gen/templates/loci_dump.h | 2 + c_gen/templates/loci_show.h | 2 + c_gen/templates/of_wire_buf.h | 46 +++++++++++ java_gen/java_type.py | 4 + loxi_ir/ir_offset.py | 2 + openflow_input/calient | 33 ++++++++ openflow_input/calient_flow_stats | 84 +++++++++++++++++++ openflow_input/calient_port_desc_stats | 92 +++++++++++++++++++++ openflow_input/calient_port_stats | 54 ++++++++++++ py_gen/oftype.py | 2 + wireshark_gen/field_info.py | 4 + wireshark_gen/templates/_oftype_readers.lua | 8 ++ 15 files changed, 342 insertions(+), 2 deletions(-) create mode 100644 openflow_input/calient create mode 100644 openflow_input/calient_flow_stats create mode 100644 openflow_input/calient_port_desc_stats create mode 100644 openflow_input/calient_port_stats diff --git a/c_gen/c_code_gen.py b/c_gen/c_code_gen.py index 896e9add8..d138103d5 100644 --- a/c_gen/c_code_gen.py +++ b/c_gen/c_code_gen.py @@ -664,6 +664,8 @@ def base_h_content(out): typedef char of_desc_str_t[OF_DESC_STR_LEN]; typedef char of_serial_num_t[OF_SERIAL_NUM_LEN]; typedef char of_str64_t[64]; +typedef char of_str32_t[32]; +typedef char of_str6_t[6]; typedef struct of_bitmap_128_s { uint64_t hi; diff --git a/c_gen/c_test_gen.py b/c_gen/c_test_gen.py index 0784fd4fd..50d496b1b 100644 --- a/c_gen/c_test_gen.py +++ b/c_gen/c_test_gen.py @@ -93,6 +93,8 @@ def var_name_map(m_type): of_desc_str_t="desc_str", of_serial_num_t="ser_num", of_str64_t="str64", + of_str32_t="str32", + of_str6_t="str6", of_mac_addr_t="mac_addr", of_ipv6_t="ipv6", # Non-scalars; more TBD @@ -124,7 +126,8 @@ def var_name_map(m_type): string_types = [ "of_port_name_t", "of_table_name_t", "of_desc_str_t", "of_serial_num_t", "of_mac_addr_t", "of_ipv6_t", "of_bitmap_128_t", "of_checksum_128_t", - "of_str64_t", "of_app_code_t", "of_bitmap_512_t"] + "of_str64_t", "of_str32_t", "of_str6_t", + "of_app_code_t", "of_bitmap_512_t"] scalar_types = integer_types[:] scalar_types.extend(string_types) diff --git a/c_gen/of_g_legacy.py b/c_gen/of_g_legacy.py index caabc1a9c..fe58e5662 100644 --- a/c_gen/of_g_legacy.py +++ b/c_gen/of_g_legacy.py @@ -201,6 +201,8 @@ of_serial_num_t = dict(bytes=ofp_constants["OF_SERIAL_NUM_LEN"], short_name="ser_num"), of_str64_t = dict(bytes=64, short_name="str64"), + of_str32_t = dict(bytes=32, short_name="str32"), + of_str6_t = dict(bytes=6, short_name="str6"), of_match_v1_t = dict(bytes=40, to_w="match_v1_hton", from_w="match_v1_ntoh", short_name="match_v1"), @@ -228,7 +230,7 @@ "of_match_bmap_t", "of_port_name_t", "of_table_name_t", "of_desc_str_t", "of_serial_num_t", "of_mac_addr_t", "of_ipv6_t", "of_ipv4_t", "of_bitmap_128_t", "of_checksum_128_t", - "of_str64_t", "of_bitmap_512_t"] + "of_str64_t", "of_str32_t", "of_str6_t", "of_bitmap_512_t"] ## # LOXI identifiers diff --git a/c_gen/templates/loci_dump.h b/c_gen/templates/loci_dump.h index 89c5f2a83..2eb11b77b 100644 --- a/c_gen/templates/loci_dump.h +++ b/c_gen/templates/loci_dump.h @@ -91,6 +91,8 @@ typedef int (*loci_obj_dump_f)(loci_writer_f writer, void *cookie, of_object_t * #define LOCI_DUMP_desc_str(writer, cookie, val) LOCI_DUMP_string(writer, cookie, val) #define LOCI_DUMP_ser_num(writer, cookie, val) LOCI_DUMP_string(writer, cookie, val) #define LOCI_DUMP_str64(writer, cookie, val) LOCI_DUMP_string(writer, cookie, val) +#define LOCI_DUMP_str6(writer, cookie, val) LOCI_DUMP_string(writer, cookie, val) +#define LOCI_DUMP_str32(writer, cookie, val) LOCI_DUMP_string(writer, cookie, val) int loci_dump_match(loci_writer_f writer, void* cookie, of_match_t *match); #define LOCI_DUMP_match(writer, cookie, val) loci_dump_match(writer, cookie, &val) diff --git a/c_gen/templates/loci_show.h b/c_gen/templates/loci_show.h index dc35959ca..6aa2f81ab 100644 --- a/c_gen/templates/loci_show.h +++ b/c_gen/templates/loci_show.h @@ -105,6 +105,8 @@ typedef int (*loci_obj_show_f)(loci_writer_f writer, #define LOCI_SHOW_desc_str(writer, cookie, val) LOCI_SHOW_string(writer, cookie, val) #define LOCI_SHOW_ser_num(writer, cookie, val) LOCI_SHOW_string(writer, cookie, val) #define LOCI_SHOW_str64(writer, cookie, val) LOCI_SHOW_string(writer, cookie, val) +#define LOCI_SHOW_str6(writer, cookie, val) LOCI_SHOW_string(writer, cookie, val) +#define LOCI_SHOW_str32(writer, cookie, val) LOCI_SHOW_string(writer, cookie, val) int loci_show_match(loci_writer_f writer, void *cookie, of_match_t *match); #define LOCI_SHOW_match(writer, cookie, val) loci_show_match(writer, cookie, &val) diff --git a/c_gen/templates/of_wire_buf.h b/c_gen/templates/of_wire_buf.h index 9ade2c42d..4edc3a6bc 100644 --- a/c_gen/templates/of_wire_buf.h +++ b/c_gen/templates/of_wire_buf.h @@ -888,6 +888,52 @@ _wbuf_octets_get(of_wire_buffer_t *wbuf, int offset, uint8_t *dst, int bytes) { #define of_wire_buffer_checksum_128_set(buf, offset, checksum) \ (of_wire_buffer_u64_set(buf, offset, checksum.hi), of_wire_buffer_u64_set(buf, offset+8, checksum.lo)) +/** + * Get a str32 string from a wire buffer + * @param wbuf The pointer to the wire buffer structure + * @param offset Offset in the wire buffer + * @param s The string + * + * Uses the octets function. + */ + +#define of_wire_buffer_str32_get(buf, offset, s) \ + _wbuf_octets_get(buf, offset, (uint8_t *)s, 32) + +/** + * Set a str32 string in a wire buffer + * @param wbuf The pointer to the wire buffer structure + * @param offset Offset in the wire buffer + * @param s Where to store the str32 + * + * Uses the octets function. + */ + +#define of_wire_buffer_str32_set(buf, offset, s) \ + _wbuf_octets_set(buf, offset, (uint8_t *)s, 32) + +/** + * Get a str6 string from a wire buffer + * @param wbuf The pointer to the wire buffer structure + * @param offset Offset in the wire buffer + * @param s The string + * + * Uses the octets function. + */ + +#define of_wire_buffer_str6_get(buf, offset, s) \ + _wbuf_octets_get(buf, offset, (uint8_t *)s, 6) +/** + * Set a str6 string in a wire buffer + * @param wbuf The pointer to the wire buffer structure + * @param offset Offset in the wire buffer + * @param s Where to store the str6 + * + * Uses the octets function. + */ + +#define of_wire_buffer_str6_set(buf, offset, s) \ + _wbuf_octets_set(buf, offset, (uint8_t *)s, 6) /** * Get a bitmap_512 from a wire buffer diff --git a/java_gen/java_type.py b/java_gen/java_type.py index 00debb5b3..1a48d86f4 100644 --- a/java_gen/java_type.py +++ b/java_gen/java_type.py @@ -360,6 +360,8 @@ def gen_fixed_length_string_jtype(length): serial_num = gen_fixed_length_string_jtype(32) table_name = gen_fixed_length_string_jtype(32) str64 = gen_fixed_length_string_jtype(64) +str32 = gen_fixed_length_string_jtype(32) +str6 = gen_fixed_length_string_jtype(6) ipv4 = JType("IPv4Address") \ .op(read="IPv4Address.read4Bytes(bb)", \ write="$name.write4Bytes(bb)", @@ -576,6 +578,8 @@ def gen_fixed_length_string_jtype(length): 'of_port_name_t': port_name, 'of_table_name_t': table_name, 'of_str64_t': str64, + 'of_str32_t': str32, + 'of_str6_t': str6, 'of_ipv4_t': ipv4, 'of_ipv6_t': ipv6, 'of_wc_bmap_t': flow_wildcards, diff --git a/loxi_ir/ir_offset.py b/loxi_ir/ir_offset.py index 490c6b025..64c01b6dd 100644 --- a/loxi_ir/ir_offset.py +++ b/loxi_ir/ir_offset.py @@ -104,6 +104,8 @@ of_desc_str_t = (ofp_constants["OF_DESC_STR_LEN"], True), of_serial_num_t = (ofp_constants["OF_SERIAL_NUM_LEN"], True), of_str64_t = (64, True), + of_str32_t = (32, True), + of_str6_t = (6, True), of_match_v1_t = (40, True), of_match_v2_t = (88, True), of_match_v3_t = (8, False), diff --git a/openflow_input/calient b/openflow_input/calient new file mode 100644 index 000000000..2818e6442 --- /dev/null +++ b/openflow_input/calient @@ -0,0 +1,33 @@ +#version 4 + +struct of_calient_stats_request : of_experimenter_stats_request { + uint8_t version; + uint8_t type == 18; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_request_flags flags; + pad(4); + uint32_t experimenter == 0x0080F958; + uint32_t subtype == ?; +}; + +struct of_calient_stats_reply : of_experimenter_stats_reply { + uint8_t version; + uint8_t type == 19; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_reply_flags flags; + pad(4); + uint32_t experimenter == 0x0080F958; + uint32_t subtype == ?; +}; + +enum ofp_calient_ocs_alarm(wire_type=uint8_t, bitmask=True){ + OFPOCSALM_CLEAR = 1, /* Clear- no alarm */ + OFPOCSALM_Minor = 2, /* loss is greater than 5.25 */ + OFPOCSALM_Major = 3, /* loss is greater than 7.25 */ + OFPOCSALM_Critical = 4, /* loss is greater than 10.25 */ +}; + diff --git a/openflow_input/calient_flow_stats b/openflow_input/calient_flow_stats new file mode 100644 index 000000000..241cc0461 --- /dev/null +++ b/openflow_input/calient_flow_stats @@ -0,0 +1,84 @@ +#version 4 + +struct of_calient_flow_stats_request : of_calient_stats_request { + uint8_t version; + uint8_t type == 18; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_request_flags flags; + pad(4); + uint32_t experimenter == 0x0080F958; + uint32_t subtype == 2; /* OFPEMPFS = 2 */ + uint8_t table_id; /* Recommended to be set to 0. Ignored */ + pad(3); + uint32_t out_port; /* Require matching entries to include this as an output port. + A value of OFPP_ANY indicates no restriction. Ignored */ + uint32_t out_group; /* Require matching entries to include this as an output group. + A value of OFPP_ANY indicates no restriction. Ignored */ + pad(4); /* Align to 64 bits */ + uint64_t cookie; /* Ignored */ + uint64_t cookie_mask; /* Ignored */ + of_match_t match; /* Fields to match. Variable size */ +}; + +enum ofp_calient_cflow_admin_state(wire_type=uint8_t, bitmask=True){ + OFPCAS_InService = 1, /* when the connection is activated */ + OFPCAS_UnderManagement = 2,/*Default Connection state – (when connection is not activated)*/ +}; + + +enum ofp_calient_cflow_operational_state(wire_type=uint8_t, bitmask=True){ + OFPCOS_InService = 1, /* When connection is activated */ + OFPCOS_OutOfService = 2,/*When connection has a critical alarm ( activated or otherwise) */ + OFPCOS_Ready = 3, /*When AS state is UnderManagement */ + OFPCOS_Degraded = 4, /*When connection is activated and has a Major alarm */ +}; + +enum ofp_calient_cflow_Capability(wire_type=uint8_t, bitmask=True){ + OFPCCS_Ok = 1, /* Connection has been made successfully */ + OFPCCS_Failed = 2, /* Connection has Failed */ + OFPCCS_Initializing = 3,/* Connection making is in progress */ +}; + +struct of_calient_flow_stats_entry { + uint16_t length; + uint8_t table_id; /* Ignored */ + pad(1); + uint32_t duration_sec; /* Not supported for now */ + uint32_t duration_nsec; /* Not supported for now */ + uint16_t priority; /* Not supported */ + uint16_t idle_timeout; /* Set to 0 as entries must be explicitly removed */ + uint16_t hard_timeout; /* Set to 0 as entries must be explicitly removed */ + enum ofp_flow_mod_flags flags; + pad(4); + uint64_t cookie; /* Ignored */ + enum ofp_calient_cflow_admin_state admin_status; /* AS = IS(Activated)/UMA */ + enum ofp_calient_cflow_operational_state oper_status; /* OS = UMA/OOS */ + enum ofp_calient_cflow_Capability oper_capability; /* OC = FAIL/OK/INIT */ + enum ofp_calient_ocs_alarm alarm; /* Alarm = NA/MJ/MN/CR */ + of_str6_t port_power; + pad(2); + of_str6_t connected_port_power; + pad(2); + of_str64_t cflow_name; /* Connection name */ + of_match_t match; +}; + + +struct of_calient_flow_stats_reply : of_calient_stats_reply { + uint8_t version; + uint8_t type == 19; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_reply_flags flags; + pad(4); + uint32_t experimenter == 0x0080F958; + uint32_t subtype == 2; + uint16_t data_length; + pad(6); + list(of_calient_flow_stats_entry_t)flow_stats; +}; + + diff --git a/openflow_input/calient_port_desc_stats b/openflow_input/calient_port_desc_stats new file mode 100644 index 000000000..f4b336785 --- /dev/null +++ b/openflow_input/calient_port_desc_stats @@ -0,0 +1,92 @@ +#version 4 + +struct of_calient_port_desc_stats_request : of_calient_stats_request { + uint8_t version; + uint8_t type == 18; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_request_flags flags; + pad(4); + uint32_t experimenter == 0x0080F958; + uint32_t subtype == 1; +}; + + +struct of_calient_port_desc_prop { + uint16_t type == ?; /* One of OFPPDPT_*. */ + uint16_t length; /* Length in bytes of this property. */ +}; + + +enum ofp_calient_optical_port_admin_state(wire_type=uint8_t, bitmask=True){ + OFPAS_IN_SERVICE = 1, /*Circuit Port in Service*/ + OFPAS_OUT_OF_SERVICE = 2, /*Circuit Port out of Service*/ + OFPAS_OOS_NP = 3 /*Circuit Port out of Service, not provisioned*/ +}; + +enum ofp_calient_optical_port_oper_state(wire_type=uint8_t, bitmask=True){ + OFPOS_IN_SERVICE = 8, /*Circuit Port in Service*/ + OFPOS_OUT_OF_SERVICE = 16 /*Circuit Port out of Service*/ +}; + +enum ofp_calient_optical_port_oper_capability(wire_type=uint8_t, bitmask=True){ + OFPCS_NoHardware = 1, /* when port is not in connection */ + OFPCS_Ok = 2, /* port is in Connection which is made successfully */ + OFPCS_Failed = 3, /* when port is in Connection which is Failed */ + OFPCS_Initializing = 4,/* when port is in Connection which is being made */ +}; + + + + + +struct of_calient_port_desc_prop_optical : of_calient_port_desc_prop{ + uint16_t type == 2; /* OFPPDPT_OPTICAL_CIRCUIT */ + uint16_t length; /* Length in bytes of this property. */ + enum ofp_calient_optical_port_admin_state in_admin_status; + enum ofp_calient_optical_port_oper_state in_oper_status; + enum ofp_calient_optical_port_oper_capability in_oper_capability; + enum ofp_calient_optical_port_admin_state out_admin_status; + enum ofp_calient_optical_port_oper_state out_oper_status; + enum ofp_calient_optical_port_oper_capability out_oper_capability; + of_str6_t inport_power; /* Input Port Power */ + of_str6_t outport_power; /* Output Port Power */ + pad(2); + uint64_t in_peer_node; /* Peer node datapath id connected to the input optical port */ + uint64_t out_peer_node; /* Peer node datapath id connected to the output optical port */ + uint16_t in_peer_port; /* Peer port number connected to the input optical port */ + uint16_t out_peer_port; /* Peer port number connected to the output optical port */ + pad(4); + of_str32_t in_circuit_id; /* Circuit Id associated with the input port */ + of_str32_t out_circuit_id; /* Circuit id associated with the output port */ + of_str64_t in_alias; /* Alias(name) for the input port */ + of_str64_t out_alias; /* Alias(name) for the output port */ +}; + +struct of_calient_port_desc_stats_entry { + uint16_t length; + pad(2); + of_port_no_t port_no; + of_mac_addr_t hw_addr; + pad(2); + of_port_name_t name; /* Not used.NULL */ + uint32_t config; /* Not used. Always 0. */ + uint32_t state; /* Not used. Always 0. */ + list(of_calient_port_desc_prop_t) properties; +}; + +struct of_calient_port_desc_stats_reply : of_calient_stats_reply { + uint8_t version; + uint8_t type == 19; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_reply_flags flags; + pad(4); + uint32_t experimenter == 0x0080F958; + uint32_t subtype == 1; + list(of_calient_port_desc_stats_entry_t)port_desc; +}; + + diff --git a/openflow_input/calient_port_stats b/openflow_input/calient_port_stats new file mode 100644 index 000000000..2d2e8ea0c --- /dev/null +++ b/openflow_input/calient_port_stats @@ -0,0 +1,54 @@ +#version 4 + +struct of_calient_port_stats_request : of_calient_stats_request { + uint8_t version; + uint8_t type == 18; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_request_flags flags; + pad(4); + uint32_t experimenter == 0x0080F958; + uint32_t subtype == 3; + of_port_no_t port_no; + pad(4); +}; + + +struct of_calient_port_stats_entry { + uint16_t length; + pad(2); + of_port_no_t port_no; + enum ofp_calient_optical_port_admin_state in_admin_status; /* Input port admin status */ + enum ofp_calient_optical_port_oper_state in_oper_status; /* Input port operational status */ + enum ofp_calient_optical_port_oper_capability in_oper_capability; /* Input port operational capability */ + enum ofp_calient_ocs_alarm in_alarm;/* Alarm on Input port */ + of_str6_t inport_power; /* Input port power */ + pad(2); + of_str6_t outport_power; /* Output port power */ + pad(2); + enum ofp_calient_optical_port_admin_state out_admin_status; /* Output port Admin status */ + enum ofp_calient_optical_port_oper_state out_oper_status; /* Output port operational status */ + enum ofp_calient_optical_port_oper_capability out_oper_capability;/* Output port operational capability */ + enum ofp_calient_ocs_alarm out_alarm;/* Alarm on Output port */ + pad(4); + of_str32_t in_circuit_id; /* Circuit id associated with the input port */ + of_str32_t out_circuit_id; /* Circuit id associated with the output port */ +}; + +struct of_calient_port_stats_reply : of_calient_stats_reply { + uint8_t version; + uint8_t type == 19; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_reply_flags flags; + pad(4); + uint32_t experimenter == 0x0080F958; + uint32_t subtype == 3; + uint16_t data_length; + pad(6); + list(of_calient_port_stats_entry_t) entries; +}; + + diff --git a/py_gen/oftype.py b/py_gen/oftype.py index 76eebd0f0..6c130158d 100644 --- a/py_gen/oftype.py +++ b/py_gen/oftype.py @@ -132,6 +132,8 @@ 'of_serial_num_t': 32, 'of_desc_str_t': 256, 'of_str64_t': 64, + 'of_str32_t': 32, + 'of_str6_t': 6, } for (cls, length) in fixed_length_strings.items(): diff --git a/wireshark_gen/field_info.py b/wireshark_gen/field_info.py index bc111703a..3158697e1 100644 --- a/wireshark_gen/field_info.py +++ b/wireshark_gen/field_info.py @@ -40,6 +40,8 @@ "of_desc_str_t": "stringz", "of_serial_num_t": "stringz", "of_str64_t": "stringz", + "of_str32_t": "stringz", + "of_str6_t": "stringz", "of_octets_t": "bytes", "of_port_no_t": "uint32", "of_port_desc_t": "stringz", @@ -69,6 +71,8 @@ "of_desc_str_t": "NONE", "of_serial_num_t": "NONE", "of_str64_t": "NONE", + "of_str32_t": "NONE", + "of_str6_t": "NONE", "of_octets_t": "NONE", "of_port_no_t": "DEC", "of_port_desc_t": "NONE", diff --git a/wireshark_gen/templates/_oftype_readers.lua b/wireshark_gen/templates/_oftype_readers.lua index 9695c59d9..700b236e7 100644 --- a/wireshark_gen/templates/_oftype_readers.lua +++ b/wireshark_gen/templates/_oftype_readers.lua @@ -139,6 +139,14 @@ function read_of_str64_t(reader, version, subtree, field_name) read_scalar(reader, subtree, field_name, 64) end +function read_of_str32_t(reader, version, subtree, field_name) + read_scalar(reader, subtree, field_name, 32) +end + +function read_of_str6_t(reader, version, subtree, field_name) + read_scalar(reader, subtree, field_name, 6) +end + function read_of_port_desc_t(reader, version, subtree, field_name) if reader.is_empty() then return From 65e22574c25b6a73bd72dbd2b802b9fc9f84711e Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Mon, 1 Jun 2015 11:23:58 -0700 Subject: [PATCH 10/17] Bumping version to 0.3.10.oe-SNAPSHOT --- java_gen/pre-written/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java_gen/pre-written/pom.xml b/java_gen/pre-written/pom.xml index 631544e1a..c21447138 100644 --- a/java_gen/pre-written/pom.xml +++ b/java_gen/pre-written/pom.xml @@ -10,7 +10,7 @@ org.onosproject openflowj - 0.3.7.oe + 0.3.10.oe-SNAPSHOT jar OpenFlowJ-Loxi From c59ad1169e3024529bd390723e130f96fec56cbd Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Thu, 4 Jun 2015 15:31:44 -0700 Subject: [PATCH 11/17] Updating openflowj version to 0.4.0.onos --- java_gen/pre-written/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java_gen/pre-written/pom.xml b/java_gen/pre-written/pom.xml index c21447138..b7df8384b 100644 --- a/java_gen/pre-written/pom.xml +++ b/java_gen/pre-written/pom.xml @@ -10,7 +10,7 @@ org.onosproject openflowj - 0.3.10.oe-SNAPSHOT + 0.4.0.onos jar OpenFlowJ-Loxi From 7a1eb28f18bdad2c60f53a79076463075ea38c6d Mon Sep 17 00:00:00 2001 From: alshabib Date: Fri, 21 Aug 2015 10:27:47 -0700 Subject: [PATCH 12/17] onosproject optical additions. --- java_gen/pre-written/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java_gen/pre-written/pom.xml b/java_gen/pre-written/pom.xml index b7df8384b..7f4b41e37 100644 --- a/java_gen/pre-written/pom.xml +++ b/java_gen/pre-written/pom.xml @@ -8,11 +8,11 @@ 7 - org.onosproject + org.projectfloodlight openflowj - 0.4.0.onos + 0.9.0-SNAPSHOT jar - + OpenFlowJ-Loxi OpenFlowJ API supporting OpenFlow versions 1.0 through 1.3.1, generated by LoxiGen http://www.projectfloodlight.org/projects/ From 10119eaf04c01ca998534c6742b961d0ba679836 Mon Sep 17 00:00:00 2001 From: alshabib Date: Fri, 21 Aug 2015 10:33:37 -0700 Subject: [PATCH 13/17] removing release profile --- java_gen/pre-written/pom.xml | 60 ------------------------------------ 1 file changed, 60 deletions(-) diff --git a/java_gen/pre-written/pom.xml b/java_gen/pre-written/pom.xml index 7f4b41e37..aae44e876 100644 --- a/java_gen/pre-written/pom.xml +++ b/java_gen/pre-written/pom.xml @@ -242,64 +242,4 @@ - - - release - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.9.1 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.5 - true - - ossrh - https://oss.sonatype.org/ - false - - - - - - From 7569e99e0b2dde0e585f987603584086dcb5aeb6 Mon Sep 17 00:00:00 2001 From: alshabib Date: Fri, 21 Aug 2015 10:50:03 -0700 Subject: [PATCH 14/17] capitalizing enums in calient openflow input --- openflow_input/calient | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openflow_input/calient b/openflow_input/calient index 2818e6442..fc34e1be4 100644 --- a/openflow_input/calient +++ b/openflow_input/calient @@ -26,8 +26,8 @@ struct of_calient_stats_reply : of_experimenter_stats_reply { enum ofp_calient_ocs_alarm(wire_type=uint8_t, bitmask=True){ OFPOCSALM_CLEAR = 1, /* Clear- no alarm */ - OFPOCSALM_Minor = 2, /* loss is greater than 5.25 */ - OFPOCSALM_Major = 3, /* loss is greater than 7.25 */ - OFPOCSALM_Critical = 4, /* loss is greater than 10.25 */ + OFPOCSALM_MINOR = 2, /* loss is greater than 5.25 */ + OFPOCSALM_MAJOR = 3, /* loss is greater than 7.25 */ + OFPOCSALM_CRITICAL = 4, /* loss is greater than 10.25 */ }; From e464a25ce216ff61d1d227b0364e7750420efca1 Mon Sep 17 00:00:00 2001 From: alshabib Date: Fri, 21 Aug 2015 11:06:50 -0700 Subject: [PATCH 15/17] adding copyrights --- openflow_input/calient | 32 ++++++++++++++++++++++++++ openflow_input/calient_flow_stats | 32 ++++++++++++++++++++++++++ openflow_input/calient_port_desc_stats | 32 ++++++++++++++++++++++++++ openflow_input/calient_port_stats | 32 ++++++++++++++++++++++++++ openflow_input/circuit | 32 ++++++++++++++++++++++++++ 5 files changed, 160 insertions(+) diff --git a/openflow_input/calient b/openflow_input/calient index fc34e1be4..8a54b2caf 100644 --- a/openflow_input/calient +++ b/openflow_input/calient @@ -1,3 +1,35 @@ +// Copyright 2013, Big Switch Networks, Inc. +// Copyright 2015, Open Networking Laboratory +// +// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with +// the following special exception: +// +// LOXI Exception +// +// As a special exception to the terms of the EPL, you may distribute libraries +// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided +// that copyright and licensing notices generated by LoxiGen are not altered or removed +// from the LoxiGen Libraries and the notice provided below is (i) included in +// the LoxiGen Libraries, if distributed in source code form and (ii) included in any +// documentation for the LoxiGen Libraries, if distributed in binary form. +// +// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler." +// +// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain +// a copy of the EPL at: +// +// http://www.eclipse.org/legal/epl-v10.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// EPL for the specific language governing permissions and limitations +// under the EPL. +// +// Also derived from the OpenFlow header files which have these copyrights: +// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University +// Copyright (c) 2011, 2012 Open Networking Foundation + #version 4 struct of_calient_stats_request : of_experimenter_stats_request { diff --git a/openflow_input/calient_flow_stats b/openflow_input/calient_flow_stats index 241cc0461..7c732dfc9 100644 --- a/openflow_input/calient_flow_stats +++ b/openflow_input/calient_flow_stats @@ -1,3 +1,35 @@ +// Copyright 2013, Big Switch Networks, Inc. +// Copyright 2015, Open Networking Laboratory +// +// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with +// the following special exception: +// +// LOXI Exception +// +// As a special exception to the terms of the EPL, you may distribute libraries +// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided +// that copyright and licensing notices generated by LoxiGen are not altered or removed +// from the LoxiGen Libraries and the notice provided below is (i) included in +// the LoxiGen Libraries, if distributed in source code form and (ii) included in any +// documentation for the LoxiGen Libraries, if distributed in binary form. +// +// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler." +// +// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain +// a copy of the EPL at: +// +// http://www.eclipse.org/legal/epl-v10.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// EPL for the specific language governing permissions and limitations +// under the EPL. +// +// Also derived from the OpenFlow header files which have these copyrights: +// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University +// Copyright (c) 2011, 2012 Open Networking Foundation + #version 4 struct of_calient_flow_stats_request : of_calient_stats_request { diff --git a/openflow_input/calient_port_desc_stats b/openflow_input/calient_port_desc_stats index f4b336785..70dcd3d75 100644 --- a/openflow_input/calient_port_desc_stats +++ b/openflow_input/calient_port_desc_stats @@ -1,3 +1,35 @@ +// Copyright 2013, Big Switch Networks, Inc. +// Copyright 2015, Open Networking Laboratory +// +// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with +// the following special exception: +// +// LOXI Exception +// +// As a special exception to the terms of the EPL, you may distribute libraries +// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided +// that copyright and licensing notices generated by LoxiGen are not altered or removed +// from the LoxiGen Libraries and the notice provided below is (i) included in +// the LoxiGen Libraries, if distributed in source code form and (ii) included in any +// documentation for the LoxiGen Libraries, if distributed in binary form. +// +// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler." +// +// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain +// a copy of the EPL at: +// +// http://www.eclipse.org/legal/epl-v10.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// EPL for the specific language governing permissions and limitations +// under the EPL. +// +// Also derived from the OpenFlow header files which have these copyrights: +// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University +// Copyright (c) 2011, 2012 Open Networking Foundation + #version 4 struct of_calient_port_desc_stats_request : of_calient_stats_request { diff --git a/openflow_input/calient_port_stats b/openflow_input/calient_port_stats index 2d2e8ea0c..9e6cf4bc0 100644 --- a/openflow_input/calient_port_stats +++ b/openflow_input/calient_port_stats @@ -1,3 +1,35 @@ +// Copyright 2013, Big Switch Networks, Inc. +// Copyright 2015, Open Networking Laboratory +// +// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with +// the following special exception: +// +// LOXI Exception +// +// As a special exception to the terms of the EPL, you may distribute libraries +// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided +// that copyright and licensing notices generated by LoxiGen are not altered or removed +// from the LoxiGen Libraries and the notice provided below is (i) included in +// the LoxiGen Libraries, if distributed in source code form and (ii) included in any +// documentation for the LoxiGen Libraries, if distributed in binary form. +// +// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler." +// +// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain +// a copy of the EPL at: +// +// http://www.eclipse.org/legal/epl-v10.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// EPL for the specific language governing permissions and limitations +// under the EPL. +// +// Also derived from the OpenFlow header files which have these copyrights: +// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University +// Copyright (c) 2011, 2012 Open Networking Foundation + #version 4 struct of_calient_port_stats_request : of_calient_stats_request { diff --git a/openflow_input/circuit b/openflow_input/circuit index 0f436a42a..23e7c7289 100644 --- a/openflow_input/circuit +++ b/openflow_input/circuit @@ -1,3 +1,35 @@ +// Copyright 2013, Big Switch Networks, Inc. +// Copyright 2015, Open Networking Laboratory +// +// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with +// the following special exception: +// +// LOXI Exception +// +// As a special exception to the terms of the EPL, you may distribute libraries +// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided +// that copyright and licensing notices generated by LoxiGen are not altered or removed +// from the LoxiGen Libraries and the notice provided below is (i) included in +// the LoxiGen Libraries, if distributed in source code form and (ii) included in any +// documentation for the LoxiGen Libraries, if distributed in binary form. +// +// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler." +// +// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain +// a copy of the EPL at: +// +// http://www.eclipse.org/legal/epl-v10.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// EPL for the specific language governing permissions and limitations +// under the EPL. +// +// Also derived from the OpenFlow header files which have these copyrights: +// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University +// Copyright (c) 2011, 2012 Open Networking Foundation + #version 4 /* WDM grid types */ From f26163c74483f245c5581c3e681b8274903c1ab2 Mon Sep 17 00:00:00 2001 From: alshabib Date: Tue, 25 Aug 2015 13:28:57 -0700 Subject: [PATCH 16/17] Bundle-ifying the generated jar. fixes for javadoc generation. --- java_gen/pre-written/pom.xml | 8 +++++++- java_gen/templates/custom/OFPortDesc.java | 2 +- java_gen/templates/custom/interface/OFPortDesc.java | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/java_gen/pre-written/pom.xml b/java_gen/pre-written/pom.xml index aae44e876..9e217717d 100644 --- a/java_gen/pre-written/pom.xml +++ b/java_gen/pre-written/pom.xml @@ -11,7 +11,7 @@ org.projectfloodlight openflowj 0.9.0-SNAPSHOT - jar + bundle OpenFlowJ-Loxi OpenFlowJ API supporting OpenFlow versions 1.0 through 1.3.1, generated by LoxiGen @@ -231,6 +231,12 @@ + + org.apache.felix + maven-bundle-plugin + 2.5.4 + true + diff --git a/java_gen/templates/custom/OFPortDesc.java b/java_gen/templates/custom/OFPortDesc.java index ccfbedb13..a2f05cf85 100644 --- a/java_gen/templates/custom/OFPortDesc.java +++ b/java_gen/templates/custom/OFPortDesc.java @@ -13,7 +13,7 @@ public boolean isEnabled() { * Returns the current generation ID of this port. * * The generationId is reported by the switch as a @{link OFPortDescProp} in - * @link{OFPortDescStatsReply} and @link{OFPortStatus} messages. If the + * {@link OFPortDescStatsReply} and {@link OFPortStatus} messages. If the * current OFPortDesc does not contain a generation Id, returns U64.ZERO; * * For OpenFlow versions earlier than 1.4, always returns U64.ZERO; diff --git a/java_gen/templates/custom/interface/OFPortDesc.java b/java_gen/templates/custom/interface/OFPortDesc.java index 247464de1..45e2dfb86 100644 --- a/java_gen/templates/custom/interface/OFPortDesc.java +++ b/java_gen/templates/custom/interface/OFPortDesc.java @@ -12,7 +12,7 @@ * Returns the current generation ID of this port. * * The generationId is reported by the switch as a @{link OFPortDescProp} in - * @link{OFPortDescStatsReply} and @link{OFPortStatus} messages. If the + * {@link OFPortDescStatsReply} and {@link OFPortStatus} messages. If the * current OFPortDesc does not contain a generation Id, returns U64.ZERO; * * For OpenFlow versions earlier than 1.4, always returns U64.ZERO; From 8bcdd5fa03dd1c59f237dac8a2dc53706a8fba12 Mon Sep 17 00:00:00 2001 From: Marc De Leenheer Date: Mon, 21 Sep 2015 17:45:29 -0700 Subject: [PATCH 17/17] Proper class hierarchies for LINC optical circuit extensions --- openflow_input/linc | 67 ++++++++++++++++++++++++ openflow_input/{circuit => linc_circuit} | 53 +++++++------------ 2 files changed, 86 insertions(+), 34 deletions(-) create mode 100644 openflow_input/linc rename openflow_input/{circuit => linc_circuit} (85%) diff --git a/openflow_input/linc b/openflow_input/linc new file mode 100644 index 000000000..45e0e1df7 --- /dev/null +++ b/openflow_input/linc @@ -0,0 +1,67 @@ +// Copyright 2013, Big Switch Networks, Inc. +// Copyright 2015, Open Networking Laboratory +// +// LoxiGen is licensed under the Eclipse Public License, version 1.0 (EPL), with +// the following special exception: +// +// LOXI Exception +// +// As a special exception to the terms of the EPL, you may distribute libraries +// generated by LoxiGen (LoxiGen Libraries) under the terms of your choice, provided +// that copyright and licensing notices generated by LoxiGen are not altered or removed +// from the LoxiGen Libraries and the notice provided below is (i) included in +// the LoxiGen Libraries, if distributed in source code form and (ii) included in any +// documentation for the LoxiGen Libraries, if distributed in binary form. +// +// Notice: "Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler." +// +// You may not use this file except in compliance with the EPL or LOXI Exception. You may obtain +// a copy of the EPL at: +// +// http://www.eclipse.org/legal/epl-v10.html +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// EPL for the specific language governing permissions and limitations +// under the EPL. +// +// Also derived from the OpenFlow header files which have these copyrights: +// Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University +// Copyright (c) 2011, 2012 Open Networking Foundation + +#version 4 + +// LINC-OE Optical Emulator Switch extensions +struct of_action_linc : of_action_experimenter { + uint16_t type == 65535; + uint16_t len; + uint32_t experimenter == 0x748771; + uint16_t subtype == ?; + pad(2); + pad(4); +}; + +struct of_linc_ports_request : of_experimenter_stats_request { + uint8_t version; + uint8_t type == 18; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_request_flags flags; + pad(4); + uint32_t experimenter == 0x748771; + uint32_t subtype == ?; +}; + +struct of_linc_ports_reply : of_experimenter_stats_reply { + uint8_t version; + uint8_t type == 19; + uint16_t length; + uint32_t xid; + uint16_t stats_type == 0xffff; + enum ofp_stats_reply_flags flags; + pad(4); + uint32_t experimenter == 0x748771; + uint32_t subtype == ?; +}; diff --git a/openflow_input/circuit b/openflow_input/linc_circuit similarity index 85% rename from openflow_input/circuit rename to openflow_input/linc_circuit index 23e7c7289..61d030004 100644 --- a/openflow_input/circuit +++ b/openflow_input/linc_circuit @@ -89,27 +89,16 @@ struct ofp_och_signal_id { }; struct of_oxm_och_sigtype : of_oxm { - uint32_t type_len == 0x00085801; + uint32_t type_len == 0x00085801; uint8_t value; }; struct of_oxm_och_sigid : of_oxm { - uint32_t type_len == 0x00085A06; + uint32_t type_len == 0x00085A06; of_sig_id_t value; }; -struct of_oxm_och_sigtype_basic : of_oxm { - uint32_t type_len == 0x80005801; - uint8_t value; -}; - -struct of_oxm_och_sigid_basic : of_oxm { - uint32_t type_len == 0x80005A06; - of_sig_id_t value; -}; - - -struct of_action_circuit : of_action_experimenter { +struct of_action_linc_circuit : of_action_linc { uint16_t type == 65535; uint16_t len; uint32_t experimenter == 0x748771; @@ -120,7 +109,7 @@ struct of_action_circuit : of_action_experimenter { }; -struct of_circuit_ports_request : of_experimenter_stats_request { +struct of_linc_circuit_ports_request : of_linc_ports_request { uint8_t version; uint8_t type == 18; uint16_t length; @@ -133,7 +122,7 @@ struct of_circuit_ports_request : of_experimenter_stats_request { }; -struct of_circuit_ports_reply : of_experimenter_stats_reply { +struct of_linc_circuit_ports_reply : of_linc_ports_reply { uint8_t version; uint8_t type == 19; uint16_t length; @@ -143,7 +132,7 @@ struct of_circuit_ports_reply : of_experimenter_stats_reply { pad(4); uint32_t experimenter == 0x748771; uint32_t subtype == 13; - list(of_port_optical_t) entries; + list(of_port_optical_t) entries; }; struct of_port_optical { @@ -155,16 +144,16 @@ struct of_port_optical { of_port_name_t name; enum ofp_port_config config; enum ofp_port_state state; - list(of_port_desc_prop_optical_transport_t) desc; + list(of_port_desc_prop_optical_transport_t) desc; }; struct of_port_desc_prop_optical_transport { - uint16_t type; + uint16_t type; uint16_t length; - uint8_t port_signal_type; + uint8_t port_signal_type; uint8_t reserved; pad(1); - uint8_t port_type; + uint8_t port_type; }; struct of_circuit_port_status : of_experimenter { @@ -184,22 +173,18 @@ struct of_circuit_port_status : of_experimenter { of_port_name_t name; enum ofp_port_config config; enum ofp_port_state state; - uint64_t ignore; + uint64_t ignore; }; - - - -struct of_port_optical_transport_application_code -{ - uint16_t feature_type; - uint8_t oic_type; +struct of_port_optical_transport_application_code { + uint16_t feature_type; + uint8_t oic_type; of_app_code_t app_code; }; struct of_port_optical_transport_layer_entry { - uint8_t layer_class; + uint8_t layer_class; uint8_t signal_type; uint8_t adaptation; pad(5); @@ -208,9 +193,9 @@ struct of_port_optical_transport_layer_entry { /* ODU Layer Stack Feature Encoding */ struct of_port_optical_transport_layer_stack { - uint16_t feature_type; - uint16_t length; - pad(4); - list(of_port_optical_transport_layer_entry_t) entries; + uint16_t feature_type; + uint16_t length; + pad(4); + list(of_port_optical_transport_layer_entry_t) entries; };