optical circuit experimenter changes
diff --git a/c_gen/c_test_gen.py b/c_gen/c_test_gen.py
index 8cd73c5..2f93536 100644
--- a/c_gen/c_test_gen.py
+++ b/c_gen/c_test_gen.py
@@ -106,10 +106,8 @@
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 c0267ca..0c48edd 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 6b97f69..5ff987d 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -492,6 +492,9 @@
.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 @@
'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 @@
'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 1acc1a2..01a1fa5 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<F extends OFValueType<F>> {
@@ -235,15 +236,24 @@
public final static MatchField<ClassId> BSN_VLAN_XLATE_PORT_GROUP_ID =
new MatchField<ClassId>("bsn_vlan_xlate_port_group_id", MatchFields.BSN_VLAN_XLATE_PORT_GROUP_ID);
-
- public final static MatchField<U64> OCH_SIGID =
- new MatchField<U64>("och_sigid",
+
+ public final static MatchField<CircuitSignalID> OCH_SIGID =
+ new MatchField<CircuitSignalID>("och_sigid",
MatchFields.OCH_SIGID);
- public final static MatchField<U64> OCH_SIGTYPE =
- new MatchField<U64>("och_sigid",
+ public final static MatchField<U8> OCH_SIGTYPE =
+ new MatchField<U8>("och_sigtype",
MatchFields.OCH_SIGTYPE);
+
+ public final static MatchField<CircuitSignalID> OCH_SIGID_BASIC =
+ new MatchField<CircuitSignalID>("och_sigid_basic",
+ MatchFields.OCH_SIGID);
+ public final static MatchField<U8> OCH_SIGTYPE_BASIC =
+ new MatchField<U8>("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 43a7785..ccf56b2 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 @@
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 0000000..f347387
--- /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<CircuitSignalID> {
+ 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 9656406..1bd3efe 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 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 2d5c71c..1d66115 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 87be023..01a1432 100644
--- a/openflow_input/circuit
+++ b/openflow_input/circuit
@@ -45,9 +45,8 @@
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 @@
// 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;
+};
+
+struct of_oxm_och_sigid_basic : of_oxm {
+ uint32_t type_len == 0x80005A06;
+ of_sig_id_t value;
};
-
-// circuit extension action
-struct of_action_circuit: of_action_experimenter {
+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 a25b8b2..2dbab42 100644
--- a/openflow_input/oxm-1.3
+++ b/openflow_input/oxm-1.3
@@ -40,19 +40,3 @@
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;
-};
-
-
-
-
-