Merge "Add Oplink experimenter messages"
diff --git a/java_gen/java_type.py b/java_gen/java_type.py
index 9bce653..72827a1 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -779,6 +779,9 @@
         'of_oxm_och_sigid' : {'value' : sig_id},
         'of_oxm_och_sigid_basic' : {'value' : sig_id},
 
+        'of_oxm_och_sigatt' : { 'value' : u32obj },
+        'of_oxm_och_sigatt_basic' : { 'value' : u32obj },
+
         'of_bundle_add_msg' : { 'data' : of_message },
 
         'of_oxm_exp_odu_sigtype' : { 'value' : u8obj },
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 45887a2..ba645ea 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
@@ -277,6 +277,14 @@
             new MatchField<CircuitSignalID>("och_sigid_basic",
                                     MatchFields.OCH_SIGID);
 
+    public final static MatchField<U32> OCH_SIGATT =
+            new MatchField<U32>("och_sigatt",
+                                    MatchFields.OCH_SIGATT);
+
+    public final static MatchField<U32> OCH_SIGATT_BASIC =
+            new MatchField<U32>("och_sigatt_basic",
+                                    MatchFields.OCH_SIGATT_BASIC);
+
     public final static MatchField<OFBooleanValue> BSN_L2_CACHE_HIT =
             new MatchField<OFBooleanValue>("bsn_l2_cache_hit", MatchFields.BSN_L2_CACHE_HIT);
 
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 ed8a230..0e88a1e 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
@@ -73,6 +73,8 @@
     OCH_SIGTYPE_BASIC,
     OCH_SIGID,
     OCH_SIGID_BASIC,
+    OCH_SIGATT,
+    OCH_SIGATT_BASIC,
     EXP_ODU_SIG_ID,
     EXP_ODU_SIGTYPE,
     EXP_OCH_SIG_ID,
diff --git a/openflow_input/oplink b/openflow_input/oplink
new file mode 100644
index 0000000..920eab2
--- /dev/null
+++ b/openflow_input/oplink
@@ -0,0 +1,169 @@
+// Copyright 2016, Big Switch Networks, Inc.
+//
+// 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, 2015 Open Networking Foundation
+
+#version 4
+
+/* Oplink experimenter message header*/
+struct of_oplink_exp_header : of_experimenter {
+    uint8_t version;
+    uint8_t type == 4;
+    uint16_t length;
+    uint32_t xid;
+    uint32_t experimenter == 0xFF000088;
+    uint32_t exp_type == ?;
+};
+
+/* this message is used for OFP_SET_POWER */
+struct of_oplink_port_power_set : of_oplink_exp_header {
+    uint8_t version;
+    uint8_t type == 4;
+    uint16_t length;
+    uint32_t xid;
+    uint32_t experimenter == 0xFF000088;
+    uint32_t exp_type == 10;
+    uint16_t port;
+    uint16_t power_value;
+};
+
+enum ofp_oplink_stat_exp_subtype (wire_type=uint32_t, bitmask=True){
+    OFP_PD_POWER    = 20,
+    OFP_CH_POWER    = 21
+};
+
+struct of_oplink_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 == 0xFF000088;
+    uint32_t subtype == ?;
+};
+
+struct of_oplink_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 == 0xFF000088;
+    uint32_t subtype == ?;
+};
+
+struct of_oplink_port_power_request : of_oplink_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 == 0xFF000088;
+    uint32_t subtype == 20;
+};
+
+struct of_oplink_port_power {
+    uint16_t port;
+    uint16_t power_value;
+};
+
+struct of_oplink_port_power_reply : of_oplink_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 == 0xFF000088;
+    uint32_t subtype == 20;
+    list(of_oplink_port_power_t) entries;
+};
+
+
+struct of_oplink_channel_power {
+    uint16_t in_port;
+    uint16_t out_port;
+    uint16_t channel;
+    uint16_t power_value;
+};
+
+struct of_oplink_channel_power_request : of_oplink_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 == 0xFF000088;
+    uint32_t subtype == 21;
+};
+
+struct of_oplink_channel_power_reply : of_oplink_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 == 0xFF000088;
+    uint32_t subtype == 21;
+    list(of_oplink_channel_power_t) entries;
+};
+
+/* Oplink roadm attenuation defined with ONOS type */
+struct of_oxm_och_sigatt : of_oxm {
+    uint32_t type_len == 0x00085C04;
+    uint32_t value;
+};
+
+/* Oplink roadm attenuation defined with standard type */
+struct of_oxm_och_sigatt_basic : of_oxm {
+    uint32_t type_len == 0x80005C04;
+    uint32_t value;
+};
+
+/* Oplink roadm attenuation action */
+struct of_action_oplink_att : of_action_experimenter {
+    uint16_t type == 65535;
+    uint16_t len;
+    uint32_t experimenter == 0xFF000088;
+    uint16_t subtype == 1;
+    uint16_t hlength == 16; // fix length of OXM field
+    of_oxm_t field;
+    pad(4);
+};