Merge remote-tracking branch 'upstream/master' into HEAD
Change-Id: I98c5244ab0c96dcb174d0263d39f5cfbf478907a
diff --git a/c_gen/c_code_gen.py b/c_gen/c_code_gen.py
index 9add81b..d138103 100644
--- a/c_gen/c_code_gen.py
+++ b/c_gen/c_code_gen.py
@@ -659,10 +659,13 @@
/* 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];
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 955f34f..50d496b 100644
--- a/c_gen/c_test_gen.py
+++ b/c_gen/c_test_gen.py
@@ -93,6 +93,8 @@
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
@@ -107,6 +109,9 @@
of_bitmap_128_t="bitmap_128",
of_bitmap_512_t="bitmap_512",
of_checksum_128_t="checksum_128",
+ #Circuit extensions
+ of_app_code_t="app_code",
+ of_sig_id_t="sig_id",
)
if m_type.find("of_list_") == 0:
@@ -121,7 +126,8 @@
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_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 9c0722c..4eed4da 100644
--- a/c_gen/of_g_legacy.py
+++ b/c_gen/of_g_legacy.py
@@ -86,7 +86,9 @@
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,
+ OF_SIGID_LEN=6,
)
## List of mixed data types
@@ -162,6 +164,31 @@
5: "of_match_v3_t", # Currently uses same match as 1.2 (v3).
"short_name":"match"
},
+ of_calient_port_desc_stats_entry_t = {
+ 1: "of_calient_port_desc_stats_entry_t",
+ 2: "of_calient_port_desc_stats_entry_t",
+ 3: "of_calient_port_desc_stats_entry_t",
+ 4: "of_calient_port_desc_stats_entry_t",
+ 5: "of_calient_port_desc_stats_entry_t",
+ "short_name":"calient_port_desc_stats_entry"
+ },
+ of_odu_sig_id_t = {
+ 1: "of_odu_sig_id_t",
+ 2: "of_odu_sig_id_t",
+ 3: "of_odu_sig_id_t",
+ 4: "of_odu_sig_id_t",
+ 5: "of_odu_sig_id_t",
+ "short_name":"odu_sig_id"
+ },
+ of_och_sig_id_t = {
+ 1: "of_sig_id_t",
+ 2: "of_sig_id_t",
+ 3: "of_sig_id_t",
+ 4: "of_sig_id_t",
+ 5: "of_sig_id_t",
+ "short_name":"sig_id"
+ },
+
)
## Base data types
@@ -199,6 +226,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"),
@@ -215,6 +244,11 @@
of_bitmap_128_t = dict(bytes=16, short_name="bitmap_128"),
of_bitmap_512_t = dict(bytes=64, short_name="bitmap_512"),
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_odu_sig_id_t = dict(bytes=1, short_name="odu_sig_id"),
)
of_scalar_types = ["char", "uint8_t", "uint16_t", "uint32_t", "uint64_t",
@@ -222,7 +256,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 89c5f2a..2eb11b7 100644
--- a/c_gen/templates/loci_dump.h
+++ b/c_gen/templates/loci_dump.h
@@ -91,6 +91,8 @@
#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 dc35959..6aa2f81 100644
--- a/c_gen/templates/loci_show.h
+++ b/c_gen/templates/loci_show.h
@@ -105,6 +105,8 @@
#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 9ade2c4..4edc3a6 100644
--- a/c_gen/templates/of_wire_buf.h
+++ b/c_gen/templates/of_wire_buf.h
@@ -888,6 +888,52 @@
#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 c007d52..24df9b6 100644
--- a/java_gen/java_type.py
+++ b/java_gen/java_type.py
@@ -355,10 +355,13 @@
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)
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)",
@@ -512,6 +515,12 @@
.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")
+odu_sig_id = JType("OduSignalID") \
+ .op(read="OduSignalID.readFrom(bb)", \
+ write="$name.writeTo(bb)",
+ default='OduSignalID.DEFAULT')
+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") \
@@ -540,6 +549,8 @@
generic_t = JType("T")
+calient_port_desc_stats_entry = JType('OFCalientPortDescStatsEntry').op(read='OFCalientPortDescStatsEntryVer$version.READER.readFrom(bb)', write='$name.writeTo(bb)')
+
table_desc = JType('OFTableDesc') \
.op(read='OFTableDescVer$version.READER.readFrom(bb)', \
write='$name.writeTo(bb)')
@@ -572,6 +583,9 @@
'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_calient_port_desc_stats_entry_t': calient_port_desc_stats_entry,
'of_ipv4_t': ipv4,
'of_ipv6_t': ipv6,
'of_wc_bmap_t': flow_wildcards,
@@ -581,7 +595,11 @@
'of_bitmap_512_t': port_bitmap_512,
'of_checksum_128_t': u128,
'of_bsn_vport_t': bsn_vport,
+ 'of_app_code_t': app_code,
+ 'of_sig_id_t': sig_id,
'of_table_desc_t': table_desc,
+ 'of_odu_sig_id_t': odu_sig_id,
+ 'of_och_sig_id_t' : sig_id,
}
## Map that defines exceptions from the standard loxi->java mapping scheme
@@ -756,8 +774,15 @@
'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},
'of_bundle_add_msg' : { 'data' : of_message },
+
+ 'of_oxm_exp_odu_sigtype' : { 'value' : u8obj },
+ 'of_oxm_exp_och_sigtype' : { 'value' : u8obj },
}
diff --git a/java_gen/pre-written/pom.xml b/java_gen/pre-written/pom.xml
index 307710d..4063b0c 100644
--- a/java_gen/pre-written/pom.xml
+++ b/java_gen/pre-written/pom.xml
@@ -8,9 +8,9 @@
<version>7</version>
</parent>
- <groupId>org.projectfloodlight</groupId>
+ <groupId>org.onosproject</groupId>
<artifactId>openflowj</artifactId>
- <version>0.10.0-SNAPSHOT</version>
+ <version>0.9.0.onos-SNAPSHOT</version>
<packaging>jar</packaging>
<name>OpenFlowJ-Loxi</name>
@@ -33,6 +33,13 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
+ <distributionManagement>
+ <snapshotRepository>
+ <id>ossrh</id>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
+
<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
@@ -224,30 +231,13 @@
<ciBuildId>${env.BUILD_ID}</ciBuildId>
<ciBuildTag>${env.BUILD_TAG}</ciBuildTag>
<ciJobName>${env.JOB_NAME}</ciJobName>
-i <ciNodeName>${env.NODE_NAME}</ciNodeName>
+ <ciNodeName>${env.NODE_NAME}</ciNodeName>
</manifestEntries>
</manifestSection>
</manifestSections>
</archive>
</configuration>
</plugin>
-
- <!--
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-gpg-plugin</artifactId>
- <version>1.4</version>
- <executions>
- <execution>
- <id>sign-artifacts</id>
- <phase>verify</phase>
- <goals>
- <goal>sign</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- -->
</plugins>
<resources>
<resource>
@@ -259,4 +249,64 @@
</resource>
</resources>
</build>
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.2.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.9.1</version>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.plugins</groupId>
+ <artifactId>nexus-staging-maven-plugin</artifactId>
+ <version>1.6.5</version>
+ <extensions>true</extensions>
+ <configuration>
+ <serverId>ossrh</serverId>
+ <nexusUrl>https://oss.sonatype.org/</nexusUrl>
+ <autoReleaseAfterClose>false</autoReleaseAfterClose>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
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 11a5705..2250832 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
@@ -28,6 +28,8 @@
import org.projectfloodlight.openflow.types.UDF;
import org.projectfloodlight.openflow.types.VRF;
import org.projectfloodlight.openflow.types.VlanPcp;
+import org.projectfloodlight.openflow.types.CircuitSignalID;
+import org.projectfloodlight.openflow.types.OduSignalID;
public class MatchField<F extends OFValueType<F>> {
private final String name;
@@ -259,6 +261,22 @@
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<U8> OCH_SIGTYPE =
+ new MatchField<U8>("och_sigtype",
+ MatchFields.OCH_SIGTYPE);
+
+ public final static MatchField<U8> OCH_SIGTYPE_BASIC =
+ new MatchField<U8>("och_sigtype_basic",
+ MatchFields.OCH_SIGTYPE_BASIC);
+
+ public final static MatchField<CircuitSignalID> OCH_SIGID =
+ new MatchField<CircuitSignalID>("och_sigid",
+ MatchFields.OCH_SIGID);
+
+ public final static MatchField<CircuitSignalID> OCH_SIGID_BASIC =
+ new MatchField<CircuitSignalID>("och_sigid_basic",
+ MatchFields.OCH_SIGID);
+
public final static MatchField<OFBooleanValue> BSN_L2_CACHE_HIT =
new MatchField<OFBooleanValue>("bsn_l2_cache_hit", MatchFields.BSN_L2_CACHE_HIT);
@@ -274,6 +292,18 @@
public final static MatchField<OFVlanVidMatch> BSN_INNER_VLAN_VID =
new MatchField<OFVlanVidMatch>("bsn_inner_vlan_vid", MatchFields.BSN_INNER_VLAN_VID);
+ public final static MatchField<OduSignalID> EXP_ODU_SIG_ID =
+ new MatchField<OduSignalID>("exp_odu_sig_id", MatchFields.EXP_ODU_SIG_ID);
+
+ public final static MatchField<U8> EXP_ODU_SIGTYPE =
+ new MatchField<U8>("exp_odu_sigtype", MatchFields.EXP_ODU_SIGTYPE);
+
+ public final static MatchField<CircuitSignalID> EXP_OCH_SIG_ID =
+ new MatchField<CircuitSignalID>("exp_och_sig_id", MatchFields.EXP_OCH_SIG_ID);
+
+ public final static MatchField<U8> EXP_OCH_SIGTYPE =
+ new MatchField<U8>("exp_och_sigtype", MatchFields.EXP_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 73aa24f..4c80d7f 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
@@ -69,4 +69,12 @@
BSN_INNER_ETH_DST,
BSN_INNER_ETH_SRC,
BSN_INNER_VLAN_VID,
+ OCH_SIGTYPE,
+ OCH_SIGTYPE_BASIC,
+ OCH_SIGID,
+ OCH_SIGID_BASIC,
+ EXP_ODU_SIG_ID,
+ EXP_ODU_SIGTYPE,
+ EXP_OCH_SIG_ID,
+ EXP_OCH_SIGTYPE,
}
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..7a304f6
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/CircuitSignalID.java
@@ -0,0 +1,137 @@
+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 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);
+ 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/main/java/org/projectfloodlight/openflow/types/OduSignalID.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OduSignalID.java
new file mode 100644
index 0000000..c97c4d0
--- /dev/null
+++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/OduSignalID.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2015, ECI Telecom, Inc.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * 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 License for the specific language governing permissions and
+ * limitations under the License.
+
+ */
+package org.projectfloodlight.openflow.types;
+
+
+import java.util.List;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+
+import com.google.common.collect.ComparisonChain;
+import com.google.common.primitives.UnsignedBytes;
+import com.google.common.hash.PrimitiveSink;
+
+import org.projectfloodlight.openflow.exceptions.OFParseError;
+import org.projectfloodlight.openflow.protocol.*;
+import com.google.common.hash.Funnel;
+import org.projectfloodlight.openflow.util.*;
+import java.util.Arrays;
+
+public class OduSignalID implements OFValueType<OduSignalID> {
+
+ // version: 1.3
+ final static byte WIRE_VERSION = 4;
+ final static int MINIMUM_LENGTH = 4;
+
+ private final static int DEFAULT_TPN = 0x0;
+ private final static int DEFAULT_TSLEN = 80;
+ private final static byte[] DEFAULT_TSMAP = new byte[10];
+
+ // OF message fields
+ private final int tpn;
+ private final int tslen;
+ private final byte[] tsmap;
+
+ // Immutable default instance
+ public final static OduSignalID DEFAULT = new OduSignalID(
+ DEFAULT_TPN, DEFAULT_TSLEN, DEFAULT_TSMAP
+ );
+
+ // package private constructor - used by readers, builders, and factory
+ public OduSignalID(int tpn, int tslen, byte[] tsmap) {
+ this.tpn = tpn;
+ this.tslen = tslen;
+ this.tsmap = tsmap;
+ }
+
+ public int getTpn() {
+ return tpn;
+ }
+
+ public int getTslen() {
+ return tslen;
+ }
+
+ public byte[] getTsmap() {
+ return tsmap;
+ }
+
+
+ @Override
+ public int getLength() {
+ return MINIMUM_LENGTH + 12; // tslen == 80
+ }
+
+ public void writeTo(ChannelBuffer c) {
+ c.writeShort(tpn);
+ c.writeShort(tslen);
+ c.writeBytes(tsmap); // 10 bytes
+ c.writeZero(2); // write bytes for add padding alignment (the size of bytes in tsmap must be divided in 4)
+ }
+
+ public static OduSignalID readFrom(ChannelBuffer c) {
+ int tpn = U16.f(c.readShort());
+ int tslen = U16.f(c.readShort());
+ byte[] tsmap = null;
+ tsmap =ChannelUtils.readBytes(c, 10);
+ ChannelUtils.readBytes(c, 2); // skip padding
+ OduSignalID oduSigId = new OduSignalID(
+ tpn,
+ tslen,
+ tsmap
+ );
+ return oduSigId;
+ }
+
+
+ public void putTo(PrimitiveSink sink) {
+ FUNNEL.funnel(this, sink);
+ }
+
+ final static OduSignalIDFunnel FUNNEL = new OduSignalIDFunnel();
+ static class OduSignalIDFunnel implements Funnel< OduSignalID> {
+ private static final long serialVersionUID = 1L;
+ @Override
+ public void funnel( OduSignalID message, PrimitiveSink sink) {
+ sink.putInt(message.tpn);
+ sink.putInt(message.tslen);
+ sink.putBytes(message.tsmap);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder b = new StringBuilder(" OduSignalID(");
+ b.append("tpn=").append(tpn);
+ b.append(", ");
+ b.append("tslen=").append(tslen);
+ b.append(", ");
+ b.append("tsmap=").append(Arrays.toString(tsmap));
+ b.append(")");
+ return b.toString();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ OduSignalID other = (OduSignalID) obj;
+
+ if( tpn != other.tpn)
+ return false;
+ if( tslen != other.tslen)
+ return false;
+ if (!Arrays.equals(tsmap, other.tsmap))
+ return false;
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+
+ result = prime * result + tpn;
+ result = prime * result + tslen;
+ result = prime * result + Arrays.hashCode(tsmap);
+ return result;
+ }
+
+ @Override
+ public OduSignalID applyMask(OduSignalID mask) {
+ byte[] maskTsmap = null;
+ if (this.tsmap!=null && this.tsmap.length > 0) {
+ maskTsmap = new byte[this.tsmap.length];
+ int i = 0;
+ for (byte b : this.tsmap){
+ maskTsmap[i] =(byte) (b & mask.tsmap[i++]);
+ }
+ }
+ return new OduSignalID(this.tpn & mask.tpn,
+ (short) (this.tslen & mask
+ .tslen),
+ maskTsmap);
+ }
+
+ @Override
+ public int compareTo(OduSignalID o) {
+ return ComparisonChain.start()
+ .compare(tpn,o.tpn)
+ .compare(tslen,o.tslen)
+ .compare(tsmap,o.tsmap, UnsignedBytes.lexicographicalComparator())
+ .result();
+ }
+
+}
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 8482886..04034cc 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 @@
OFOxm<IPv4Address> 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 b654a53..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
@@ -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.U8;
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, U8.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 9c72e37..892c5a0 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/loxi_ir/ir_offset.py b/loxi_ir/ir_offset.py
index 5eff8e0..59d659a 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
)
@@ -103,13 +104,19 @@
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),
of_octets_t = (0, False),
of_bitmap_128_t = (16, True),
of_checksum_128_t = (16, True),
+ of_app_code_t = (15,True),
+ of_sig_id_t = (6, True),
of_bitmap_512_t = (64, True),
+ of_odu_sig_id_t = (16, True),
+ of_och_sig_id_t = (6, True),
)
def type_dec_to_count_base(m_type):
diff --git a/openflow_input/calient b/openflow_input/calient
new file mode 100644
index 0000000..2818e64
--- /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 0000000..c07f4f1
--- /dev/null
+++ b/openflow_input/calient_flow_stats
@@ -0,0 +1,83 @@
+#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);
+ of_port_no_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 */
+};
+/*oper_capability,alarm,cflow_name not present in the backend */
+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_port_no_t out_port;
+ 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;
+ list(of_calient_flow_stats_entry_t)entries;
+};
+
+
diff --git a/openflow_input/calient_port_desc_stats b/openflow_input/calient_port_desc_stats
new file mode 100644
index 0000000..8734852
--- /dev/null
+++ b/openflow_input/calient_port_desc_stats
@@ -0,0 +1,104 @@
+#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;/* currently not present in backend */
+ 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;
+};
+
+
+struct of_calient_port_status : of_experimenter{
+ uint8_t version;
+ uint8_t type == 4;
+ uint16_t length;
+ uint32_t xid;
+ uint32_t experimenter == 0x0080F958;
+ uint32_t subtype == 1;
+ enum ofp_port_reason reason;
+ pad(7);
+ of_calient_port_desc_stats_entry_t desc;
+ };
+
diff --git a/openflow_input/calient_port_stats b/openflow_input/calient_port_stats
new file mode 100644
index 0000000..6a951b8
--- /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);
+};
+
+
+/* in_admin_status,in_oper_status,in_oper_capability,in_alarm,in_circuit_id not present in the backkend */
+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 */
+ pad(4);
+ 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;
+ list(of_calient_port_stats_entry_t) entries;
+};
+
+
diff --git a/openflow_input/circuit b/openflow_input/circuit
new file mode 100644
index 0000000..7e02014
--- /dev/null
+++ b/openflow_input/circuit
@@ -0,0 +1,184 @@
+#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(wire_type=uint8_t){
+ 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,
+};
+
+// 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]
+ // 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
+};
+
+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;
+};
+
+
+struct of_action_circuit : of_action_experimenter {
+ uint16_t type == 65535;
+ uint16_t len;
+ uint32_t experimenter == 0x748771;
+ uint16_t subtype == 25;
+ uint16_t hlength == 16; // fix length of OXM field
+ of_oxm_t field;
+ pad(2);
+};
+
+
+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 == 0x748771;
+ uint32_t subtype == 13;
+};
+
+
+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 == 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(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;
+ 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;
+};
+
diff --git a/openflow_input/optical_tras_ext b/openflow_input/optical_tras_ext
new file mode 100644
index 0000000..ddb08df
--- /dev/null
+++ b/openflow_input/optical_tras_ext
@@ -0,0 +1,212 @@
+/* This file input supports the Optical Transport Protocol Extentions - version 1.0 */
+
+#version 4
+/*Supported signal types for layer class OFPOTPL_ODU */
+enum ofp_odu_signal_type (wire_type=uint8_t) {
+ OFPODUT_ODU1 = 1,
+ OFPODUT_ODU2 = 2,
+ OFPODUT_ODU3 = 3,
+ OFPODUT_ODU4 = 4,
+ OFPODUT_ODU0 = 10,
+ OFPODUT_ODU2E = 11,
+ OFPODUT_ODUfCBR = 20,
+ OFPODUT_ODUfGFPfHAO = 21,
+ OFPODUT_ODUfGFPf = 22,
+};
+
+
+//enum ofp_experimenter_multipart_type_exp (wire_type=uint32_t){
+ //OFPEMPTE = 1,
+//};
+
+//enum ofp_port_desc_prop_type_exp (wire_type=uint32_t){
+ //OFPPDPT_OPTICAL_TRAMSPORT = 2,
+//};
+
+/* Supported signal types for layer class OFPPOTL_PORT */
+enum ofp_port_optical_transport_signal_type (wire_type=uint8_t) {
+ OFPPOTST_OTSn = 1,
+ OFPPOTST_OMSn = 2,
+ OFPPOTST_OPSn = 3,
+ OFPPOTST_OPSM = 4,
+ OFPPOTST_OCH = 5,
+ OFPPOTST_OTU1 = 11,
+ OFPPOTST_OTU2 = 12,
+ OFPPOTST_OTU3 = 13,
+ OFPPOTST_OTU4 = 14,
+};
+
+
+/* Features of optical transport ports available in switch. */
+enum ofp_port_optical_transport_feature_type (wire_type=uint16_t) {
+ OFPPOTFT_OPT_INTERFACE_CLASS = 1, /* Application code/ID encoding */
+ OFPPOTFT_LAYER_STACK = 2, /* Supported signal types and adaptations */
+};
+
+
+/*Supported signal types for layer class OFPOTPL_ODUCLT */
+enum ofp_oduclt_signal_type(wire_type=uint8_t) {
+ OFPODUCLT_STM16 = 1,
+ OFPODUCLT_STM64 = 2,
+ OFPODUCLT_STM256 = 3,
+ OFPODUCLT_STM1 = 4,
+ OFPODUCLT_STM4 = 5,
+ OFPODUCLT_GBE1 = 6,
+ OFPODUCLT_GBE10 = 7,
+ OFPODUCLT_GBE40 = 8,
+ OFPODUCLT_GBE100 = 9,
+ OFPODUCLT_FC100 = 10,
+ OFPODUCLT_FC200 = 11,
+ OFPODUCLT_FC400 = 12,
+ OFPODUCLT_FC800 = 13,
+ OFPODUCLT_FC1200 = 14,
+ OFPODUCLT_GPON = 15,
+ OFPODUCLT_XGPON = 16,
+ OFPODUCLT_IB_SDR = 17,
+ OFPODUCLT_IB_DDR = 18,
+ OFPODUCLT_IB_QDR = 19,
+ OFPODUCLT_SBCON_ESCON = 20,
+ OFPODUCLT_DVBASI = 21,
+ OFPODUCLT_SDI = 22,
+ OFPODUCLT_SDI1G5 = 23,
+ OFPODUCLT_SDI3G = 24,
+ OFPODUCLT_ATM = 25,
+ OFPODUCLT_ETH = 26,
+ OFPODUCLT_MPLS = 27,
+ OFPODUCLT_IP = 28,
+};
+
+/* Supported adaptations for optical transport port layer stack*/
+enum ofp_adaptations_type (wire_type=uint8_t){
+ OFPADAPT_OTS_OMS = 1,
+ OFPADAPT_OMS_OCH = 2,
+ OFPADAPT_OPS_OCHr = 3,
+ OFPADAPT_OPSM_OTUk = 4,
+ OFPADAPT_OCH_OTUk = 5,
+ OFPADAPT_ODUk_ODUij = 6,
+ OFPADAPT_ODUk_ODUj21 = 7,
+ OFPADAPT_ODUkh_ODUj21 = 8,
+ OFPADAPT_ODU0_CBRx = 9,
+ OFPADAPT_ODUk_CBRx = 10,
+ OFPADAPT_ODUk_CBRxg = 11,
+ OFPADAPT_ODUk_RSn = 12,
+ OFPADAPT_ODUk_ATM = 13,
+ OFPADAPT_ODUk_ETH = 14,
+ OFPADAPT_ODUkh_ETH = 15,
+ OFPADAPT_ODUk_ETHPPOS = 16,
+};
+
+struct of_oxm_exp_odu_sigtype : of_oxm {
+ uint32_t type_len == 0xFFFF0401;
+ uint32_t experimenter == 0xFF000007;
+ uint8_t value;
+};
+
+struct of_oxm_exp_odu_sig_id : of_oxm {
+ uint32_t type_len == 0xFFFF0610;
+ uint32_t experimenter == 0xFF000007;
+ of_odu_sig_id_t value;// size of this struct is 16 bytes 2+2+10+2(pad)
+};
+
+//This struct defenition is unnecessury for the openflow java ("make java" command )
+//It is reqiured for wireshark dissector ("make wireshark" command)
+struct of_odu_sig_id_t {
+ uint16_t tpn; //Tributary Port Number
+ uint16_t length; // Number of Tributary Slots included in tsmap,
+ // based on the Server ODU type and TS Granularity
+ of_octets_t tsmap; //tsmap;
+};
+
+struct of_oxm_exp_och_sigtype : of_oxm {
+ uint32_t type_len == 0xFFFF0801;
+ uint32_t experimenter == 0xFF000007;
+ uint8_t value;
+};
+
+struct of_oxm_exp_och_sig_id : of_oxm {
+ uint32_t type_len == 0xFFFF0A06;
+ uint32_t experimenter == 0xFF000007;
+ of_och_sig_id_t value;
+};
+
+
+// open flow extention - support port description Extentions for OTN Ports
+struct of_exp_port_desc_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 == 0xFF000007;
+ uint32_t subtype == 1;//enum ofp_experimenter_multipart_type exp_type == 1;
+};
+
+struct of_exp_port_desc_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 == 0xFF000007;
+ uint32_t subtype == 1;//enum ofp_experimenter_multipart_type subtype == 1;
+ list(of_exp_port_t) entries;
+};
+
+struct of_exp_port {
+ 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_exp_port_desc_prop_optical_transport_t) properties;
+};
+
+struct of_exp_port_des_prop_header {
+ uint16_t type == 2; //enum ofp_port_desc_prop_type_exp type == 2;
+ uint16_t length;
+};
+
+struct of_exp_port_desc_prop_optical_transport // : of_exp_port_des_prop_header
+{
+ uint16_t type == 2;
+ uint16_t length; // length in bytes of this property
+ enum ofp_port_optical_transport_signal_type port_signal_type;
+ //base port layer signal type (enum ofp_port_optical_transport_signal_type)
+ uint8_t reserved;
+ pad(2);
+ list(of_exp_port_optical_transport_layer_stack_t) features; // list of of_port_optical_transport_feature_header
+};
+
+struct of_exp_port_optical_transport_feature_header {
+ uint16_t feature_type == ?; // from enum ofp_port_optical_transport_feature_type
+ uint16_t length;
+};
+
+/* OTN Layer Stack Feature Encoding */ //of_port_optical_transport_layer_stack (in circuit )
+struct of_exp_port_optical_transport_layer_stack// : of_exp_port_optical_transport_feature_header
+{
+ uint16_t feature_type == 2; /* Set to OFPOTPF_LAYER_STACK */
+ uint16_t length; /* length of feature excluding padding*/
+ pad(4); /* Zero bytes-see above for sizing */
+ list(of_exp_port_optical_transport_layer_entry_t) value; /* 0 or more fields */
+};
+
+/*OTN Layer Stack Entry Encoding */ // can be found in circut of_port_optical_transport_layer_entry
+struct of_exp_port_optical_transport_layer_entry {
+ enum ofp_port_optical_transport_layer_class layer_class; /* OFPPOTL_* */
+ uint8_t signal_type; /*OFP(OTP/OCH/ODU/ODUCL)T_*/
+ enum ofp_adaptations_type adaptation;/* OFPADAPT_*/
+ pad(5); /* Align to 64-bit boundary */
+};
+
+
+
+
+
diff --git a/py_gen/oftype.py b/py_gen/oftype.py
index 76eebd0..6c13015 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/test_data/of13/exp_port_desc_reply.data b/test_data/of13/exp_port_desc_reply.data
new file mode 100644
index 0000000..df1eeec
--- /dev/null
+++ b/test_data/of13/exp_port_desc_reply.data
@@ -0,0 +1,85 @@
+-- binary
+04 13 # version, type
+00 58 # length
+12 34 56 78 # xid
+ff ff # stats_type
+00 00 # flags
+00 00 00 00 # pad
+FF 00 00 07 # experimenter
+00 00 00 01 # subtype
+# entries[0]
+00 00 00 01 # port
+00 40 # length - ????????
+00 00 # pad
+00 00 00 00 00 00 # entries[0].hw_addr
+00 00 # pad
+69 6e 74 65 72 66 61 63 65 31 32 33 34 35 36 37 # entries[0].name
+00 00 00 60 # entries[0].config
+00 00 00 04 # entries[0].state
+# properties[0]
+00 02 # entries[0].properties[0].type
+00 18 # entries[0].properties[0].length ???????
+0C # port_signal_type OMSn = 2,OCH = 5,OTU2 = 12(oduclt-10),OTU4 = 14(oduclt-100)
+00 #reserved
+00 00 #pad
+# features[0]
+00 02
+00 10 # length - ????????
+00 00 00 00
+# layeres[0]
+03 # layer class (PORT=1,OCH=2,ODU=3,DUCLT=4)
+01 # signal_type; /*OFP(OTP/OCH/ODU/ODUCL)T_*/
+06 #(OTS_OMS=1,OMS_OCH=2,OPS_OCHr=3,OPSM_OTUk=4,OCH_OTUk=5,ODUk_ODUij=6,ODUk_ODUj21=7,
+ #ODUkh_ODUj21=8,ODU0_CBRx=9,ODUk_CBRx=10,ODUk_CBRxg=11,ODUk_RSn=12,ODUk_ATM=13,ODUk_ETH=14,ODUkh_ETH=15,ODUk_ETHPPOS=16
+00 00 00 00 00
+
+-- python
+ofp.message.exp_port_desc_stats_reply(
+ xid=0x12345678,
+ flags=0,
+ entries=[
+ ofp.exp_port_desc(
+ port_no=1,
+ hw_addr=[0,0,0,0,0,0],
+ name="interface1234567",
+ config=0x60,
+ state=0x03,
+ properties=[
+ ofp.exp_port_desc_prop.ethernet(
+ curr=0x70,
+ max_speed=0x80)])])
+
+
+-- java
+builder
+ .setXid(0x12345678)
+ .setFlags(ImmutableSet.<OFStatsReplyFlags>of())
+ .setEntries(ImmutableList.of(
+ factory.buildExpPort()
+ .setPortNo(OFPort.of(1))
+ .setHwAddr(MacAddress.of("00:00:00:00:00:00"))
+ .setName("interface1234567")
+ .setConfig(Sets.immutableEnumSet(OFPortConfig.NO_FWD, OFPortConfig.NO_PACKET_IN))
+ .setState(Sets.immutableEnumSet(OFPortState.LIVE))
+ .setProperties(ImmutableList.of(
+ factory.buildExpPortDescPropOpticalTransport()
+ .setPortSignalType(OFPortOpticalTransportSignalType.OTU2)
+ .setFeatures(ImmutableList.of(
+ factory.buildExpPortOpticalTransportLayerStack()
+ .setValue(ImmutableList.of(
+ factory.buildExpPortOpticalTransportLayerEntry()
+ .setLayerClass(OFPortOpticalTransportLayerClass.ODU)
+ .setSignalType((short)1)
+ .setAdaptation(OFAdaptationsType.ODUK_ODUIJ)
+ .build()))
+ .build()))
+ .build()))
+ .build()))
+ .build();
+
+
+
+
+
+
+
diff --git a/test_data/of13/exp_port_desc_reply_och b/test_data/of13/exp_port_desc_reply_och
new file mode 100644
index 0000000..b32d9a8
--- /dev/null
+++ b/test_data/of13/exp_port_desc_reply_och
@@ -0,0 +1,86 @@
+# To be included in exp_port_dest_reply.data
+-- binary
+04 13 # version, type
+00 58 # length
+12 34 56 78 # xid
+ff ff # stats_type
+00 00 # flags
+00 00 00 00 # pad
+FF 00 00 07 # experimenter
+00 00 00 01 # subtype
+# entries[0]
+00 00 00 01 # port
+00 40 # length - ????????
+00 00 # pad
+00 00 00 00 00 00 # entries[0].hw_addr
+00 00 # pad
+69 6e 74 65 72 66 61 63 65 31 32 33 34 35 36 37 # entries[0].name
+00 00 00 60 # entries[0].config
+00 00 00 04 # entries[0].state
+# properties[0]
+00 02 # entries[0].properties[0].type
+00 18 # entries[0].properties[0].length ???????
+05 # port_signal_type OMSn = 2,OCH = 5,OTU2 = 12(oduclt-10),OTU4 = 14(oduclt-100)
+00 #reserved
+00 00 #pad
+# features[0]
+00 02
+00 10 # length - ????????
+00 00 00 00
+# layeres[0]
+03 # layer class (PORT=1,OCH=2,ODU=3,DUCLT=4)
+01 # signal_type; /*OFP(OTP/OCH/ODU/ODUCL)T_*/
+06 #(OTS_OMS=1,OMS_OCH=2,OPS_OCHr=3,OPSM_OTUk=4,OCH_OTUk=5,ODUk_ODUij=6,ODUk_ODUj21=7,
+ #ODUkh_ODUj21=8,ODU0_CBRx=9,ODUk_CBRx=10,ODUk_CBRxg=11,ODUk_RSn=12,ODUk_ATM=13,ODUk_ETH=14,ODUkh_ETH=15,ODUk_ETHPPOS=16
+00 00 00 00 00
+
+-- python
+ofp.message.exp_port_desc_stats_reply(
+ xid=0x12345678,
+ flags=0,
+ entries=[
+ ofp.exp_port_desc(
+ port_no=1,
+ hw_addr=[0,0,0,0,0,0],
+ name="interface1234567",
+ config=0x60,
+ state=0x03,
+ properties=[
+ ofp.exp_port_desc_prop.ethernet(
+ curr=0x70,
+ max_speed=0x80)])])
+
+
+-- java
+builder
+ .setXid(0x12345678)
+ .setFlags(ImmutableSet.<OFStatsReplyFlags>of())
+ .setEntries(ImmutableList.of(
+ factory.buildExpPort()
+ .setPortNo(OFPort.of(1))
+ .setHwAddr(MacAddress.of("00:00:00:00:00:00"))
+ .setName("interface1234567")
+ .setConfig(Sets.immutableEnumSet(OFPortConfig.NO_FWD, OFPortConfig.NO_PACKET_IN))
+ .setState(Sets.immutableEnumSet(OFPortState.LIVE))
+ .setProperties(ImmutableList.of(
+ factory.buildExpPortDescPropOpticalTransport()
+ .setPortSignalType(OFPortOpticalTransportSignalType.OCH)
+ .setFeatures(ImmutableList.of(
+ factory.buildExpPortOpticalTransportLayerStack()
+ .setValue(ImmutableList.of(
+ factory.buildExpPortOpticalTransportLayerEntry()
+ .setLayerClass(OFPortOpticalTransportLayerClass.ODU)
+ .setSignalType((short)1)
+ .setAdaptation(OFAdaptationsType.ODUK_ODUIJ)
+ .build()))
+ .build()))
+ .build()))
+ .build()))
+ .build();
+
+
+
+
+
+
+
diff --git a/test_data/of13/exp_port_desc_reply_oms b/test_data/of13/exp_port_desc_reply_oms
new file mode 100644
index 0000000..67a03e8
--- /dev/null
+++ b/test_data/of13/exp_port_desc_reply_oms
@@ -0,0 +1,87 @@
+#To put this code in exp_port_desc_reply.data
+
+-- binary
+04 13 # version, type
+00 58 # length
+12 34 56 78 # xid
+ff ff # stats_type
+00 00 # flags
+00 00 00 00 # pad
+FF 00 00 07 # experimenter
+00 00 00 01 # subtype
+# entries[0]
+00 00 00 01 # port
+00 40 # length - ????????
+00 00 # pad
+00 00 00 00 00 00 # entries[0].hw_addr
+00 00 # pad
+69 6e 74 65 72 66 61 63 65 31 32 33 34 35 36 37 # entries[0].name
+00 00 00 60 # entries[0].config
+00 00 00 04 # entries[0].state
+# properties[0]
+00 02 # entries[0].properties[0].type
+00 18 # entries[0].properties[0].length ???????
+02 # port_signal_type OMSn = 2,OCH = 5,OTU2 = 12(oduclt-10),OTU4 = 14(oduclt-100)
+00 #reserved
+00 00 #pad
+# features[0]
+00 02
+00 10 # length - ????????
+00 00 00 00
+# layeres[0]
+02 # layer class (PORT=1,OCH=2,ODU=3,DUCLT=4)
+01 # signal_type; /*OFP(OTP/OCH/ODU/ODUCL)T_*/
+02 #(OTS_OMS=1,OMS_OCH=2,OPS_OCHr=3,OPSM_OTUk=4,OCH_OTUk=5,ODUk_ODUij=6,ODUk_ODUj21=7,
+ #ODUkh_ODUj21=8,ODU0_CBRx=9,ODUk_CBRx=10,ODUk_CBRxg=11,ODUk_RSn=12,ODUk_ATM=13,ODUk_ETH=14,ODUkh_ETH=15,ODUk_ETHPPOS=16
+00 00 00 00 00
+
+-- python
+ofp.message.exp_port_desc_stats_reply(
+ xid=0x12345678,
+ flags=0,
+ entries=[
+ ofp.exp_port_desc(
+ port_no=1,
+ hw_addr=[0,0,0,0,0,0],
+ name="interface1234567",
+ config=0x60,
+ state=0x03,
+ properties=[
+ ofp.exp_port_desc_prop.ethernet(
+ curr=0x70,
+ max_speed=0x80)])])
+
+
+-- java
+builder
+ .setXid(0x12345678)
+ .setFlags(ImmutableSet.<OFStatsReplyFlags>of())
+ .setEntries(ImmutableList.of(
+ factory.buildExpPort()
+ .setPortNo(OFPort.of(1))
+ .setHwAddr(MacAddress.of("00:00:00:00:00:00"))
+ .setName("interface1234567")
+ .setConfig(Sets.immutableEnumSet(OFPortConfig.NO_FWD, OFPortConfig.NO_PACKET_IN))
+ .setState(Sets.immutableEnumSet(OFPortState.LIVE))
+ .setProperties(ImmutableList.of(
+ factory.buildExpPortDescPropOpticalTransport()
+ .setPortSignalType(OFPortOpticalTransportSignalType.OMSN)
+ .setFeatures(ImmutableList.of(
+ factory.buildExpPortOpticalTransportLayerStack()
+ .setValue(ImmutableList.of(
+ factory.buildExpPortOpticalTransportLayerEntry()
+ .setLayerClass(OFPortOpticalTransportLayerClass.OCH)
+ .setSignalType((short)1)
+ .setAdaptation(OFAdaptationsType.OMS_OCH)
+ .build()))
+ .build()))
+ .build()))
+ .build()))
+ .build();
+
+
+
+
+
+
+
diff --git a/test_data/of13/exp_port_desc_reply_otu b/test_data/of13/exp_port_desc_reply_otu
new file mode 100644
index 0000000..441d837
--- /dev/null
+++ b/test_data/of13/exp_port_desc_reply_otu
@@ -0,0 +1,87 @@
+#To put this code in exp_port_desc_reply.data
+
+-- binary
+04 13 # version, type
+00 58 # length
+12 34 56 78 # xid
+ff ff # stats_type
+00 00 # flags
+00 00 00 00 # pad
+FF 00 00 07 # experimenter
+00 00 00 01 # subtype
+# entries[0]
+00 00 00 01 # port
+00 40 # length - ????????
+00 00 # pad
+00 00 00 00 00 00 # entries[0].hw_addr
+00 00 # pad
+69 6e 74 65 72 66 61 63 65 31 32 33 34 35 36 37 # entries[0].name
+00 00 00 60 # entries[0].config
+00 00 00 04 # entries[0].state
+# properties[0]
+00 02 # entries[0].properties[0].type
+00 18 # entries[0].properties[0].length ???????
+0C # port_signal_type OMSn = 2,OCH = 5,OTU2 = 12(oduclt-10),OTU4 = 14(oduclt-100)
+00 #reserved
+00 00 #pad
+# features[0]
+00 02
+00 10 # length - ????????
+00 00 00 00
+# layeres[0]
+03 # layer class (PORT=1,OCH=2,ODU=3,DUCLT=4)
+01 # signal_type; /*OFP(OTP/OCH/ODU/ODUCL)T_*/
+06 #(OTS_OMS=1,OMS_OCH=2,OPS_OCHr=3,OPSM_OTUk=4,OCH_OTUk=5,ODUk_ODUij=6,ODUk_ODUj21=7,
+ #ODUkh_ODUj21=8,ODU0_CBRx=9,ODUk_CBRx=10,ODUk_CBRxg=11,ODUk_RSn=12,ODUk_ATM=13,ODUk_ETH=14,ODUkh_ETH=15,ODUk_ETHPPOS=16
+00 00 00 00 00
+
+-- python
+ofp.message.exp_port_desc_stats_reply(
+ xid=0x12345678,
+ flags=0,
+ entries=[
+ ofp.exp_port_desc(
+ port_no=1,
+ hw_addr=[0,0,0,0,0,0],
+ name="interface1234567",
+ config=0x60,
+ state=0x03,
+ properties=[
+ ofp.exp_port_desc_prop.ethernet(
+ curr=0x70,
+ max_speed=0x80)])])
+
+
+-- java
+builder
+ .setXid(0x12345678)
+ .setFlags(ImmutableSet.<OFStatsReplyFlags>of())
+ .setEntries(ImmutableList.of(
+ factory.buildExpPort()
+ .setPortNo(OFPort.of(1))
+ .setHwAddr(MacAddress.of("00:00:00:00:00:00"))
+ .setName("interface1234567")
+ .setConfig(Sets.immutableEnumSet(OFPortConfig.NO_FWD, OFPortConfig.NO_PACKET_IN))
+ .setState(Sets.immutableEnumSet(OFPortState.LIVE))
+ .setProperties(ImmutableList.of(
+ factory.buildExpPortDescPropOpticalTransport()
+ .setPortSignalType(OFPortOpticalTransportSignalType.OTU2)
+ .setFeatures(ImmutableList.of(
+ factory.buildExpPortOpticalTransportLayerStack()
+ .setValue(ImmutableList.of(
+ factory.buildExpPortOpticalTransportLayerEntry()
+ .setLayerClass(OFPortOpticalTransportLayerClass.ODU)
+ .setSignalType((short)1)
+ .setAdaptation(OFAdaptationsType.ODUK_ODUIJ)
+ .build()))
+ .build()))
+ .build()))
+ .build()))
+ .build();
+
+
+
+
+
+
+
diff --git a/test_data/of13/exp_port_desc_request.data b/test_data/of13/exp_port_desc_request.data
new file mode 100644
index 0000000..1c1b637
--- /dev/null
+++ b/test_data/of13/exp_port_desc_request.data
@@ -0,0 +1,14 @@
+-- binary
+04 12 # version, type
+00 18 # length
+11 11 11 11 # xid
+ff ff # stats_type
+00 00 # flags
+00 00 00 00 # pad
+FF 00 00 07 # experimenter
+00 00 00 01 # subtype
+
+-- python
+ofp.message.exp_port_desc_request(
+ xid=0x111111)
+
diff --git a/test_data/of13/flow_add.data b/test_data/of13/flow_add.data
index d566096..a1359c9 100644
--- a/test_data/of13/flow_add.data
+++ b/test_data/of13/flow_add.data
@@ -1,6 +1,6 @@
-- binary
04 0e # version, type
-00 80 # length
+00 B8 # length
12 34 56 78 # xid
fe dc ba 98 76 54 32 10 # cookie
@@ -21,7 +21,7 @@
00 00 # pad
00 01 # match.type
-00 3F # match.length # 59 bytes OXMs + 4 bytes match header
+00 77 # match.length #
80 00 01 08 # match.oxm_list[0].type_len - IN_PORT
00 00 00 04 # match.oxm_list[0].value
@@ -37,6 +37,31 @@
1C CA FE 1C B1 10 1C 00 00 28 00 00 00 00 00 00 # match.oxm_list[3].value
FF FF FF FF FF F0 FF FF 1C 2C 3C 00 00 00 00 00 # match.oxm_list[3].mask
+FF FF # experimenter class
+06 10 # type_len - EXP_ODU_SIG_ID
+FF 00 00 07 # experimenter id
+55 55 # tpn
+00 50 # tslen
+01 01 01 01 01 01 01 01 01 01 00 00 # tsmap
+
+FF FF # experimenter class
+04 01 # type_len - EXP_ODU_SIG_TYPE
+FF 00 00 07 # experimenter id
+08 # value
+
+FF FF # experimenter class
+0A 06 # type_len - EXP_OCH_SIG_ID
+FF 00 00 07 # experimenter id
+02 # gridType
+01 # channelSpacing
+00 04 # channelNumber
+00 01 # spectralWidth
+
+FF FF # experimenter class
+08 01 # type_len - EXP_OCH_SIG_TYPE
+FF 00 00 07 # experimenter id
+16 # value
+
00 # match.pad
00 01 # instructions[0].type
@@ -68,6 +93,10 @@
ofp.oxm.ipv6_src_masked(
value ='\x1C\xCA\xFE\x1C\xB1\x10\x1C\x00\x00\x28\x00\x00\x00\x00\x00\x00',
value_mask='\xFF\xFF\xFF\xFF\xFF\xF0\xFF\xFF\x1C\x2C\x3C\x00\x00\x00\x00\x00')
+ ofp.oxm.exp_odu_sig_id(21845,80,new byte {1,1,1,1,1,1,1,1,1,1}),
+ ofp.oxm.exp_odu_sigtype(8),
+ ofp.oxm.exp_och_sig_id(2,1,4,1),
+ ofp.oxm.exp_och_sigtype(22)
]),
instructions=[
ofp.instruction.goto_table(table_id=4),
@@ -92,6 +121,10 @@
.setMasked(MatchField.IPV6_SRC,
IPv6Address.of(0x1CCAFE1CB1101C00l, 0x0028000000000000l),
IPv6Address.of(0xFFFFFFFFFFF0FFFFl, 0x1C2C3C0000000000l))
+ .setExact(MatchField.EXP_ODU_SIG_ID, new OduSignalID((short)21845, (short)80,new byte[] {1,1,1,1,1,1,1,1,1,1}))
+ .setExact(MatchField.EXP_ODU_SIGTYPE, U8.of((short) 8 ))
+ .setExact(MatchField.EXP_OCH_SIG_ID, new CircuitSignalID((byte)2,(byte)1,(short)4,(short)1))
+ .setExact(MatchField.EXP_OCH_SIGTYPE, U8.of((short) 22))
.build()
)
.setInstructions(
diff --git a/test_data/of13/flow_delete.data b/test_data/of13/flow_delete.data
index bf9c453..0c1387f 100644
--- a/test_data/of13/flow_delete.data
+++ b/test_data/of13/flow_delete.data
@@ -1,6 +1,6 @@
-- binary
04 0e # version, type
-00 80 # length
+00 B8 # length
12 34 56 78 # xid
fe dc ba 98 76 54 32 10 # cookie
@@ -21,7 +21,7 @@
00 00 # pad
00 01 # match.type
-00 3F # match.length # 59 bytes OXMs + 4 bytes match header
+00 77 # match.length #
80 00 01 08 # match.oxm_list[0].type_len - IN_PORT
00 00 00 04 # match.oxm_list[0].value
@@ -37,6 +37,31 @@
1C CA FE 1C B1 10 1C 00 00 28 00 00 00 00 00 00 # match.oxm_list[3].value
FF FF FF FF FF F0 FF FF 1C 2C 3C 00 00 00 00 00 # match.oxm_list[3].mask
+FF FF # experimenter class
+06 10 # type_len - EXP_ODU_SIG_ID
+FF 00 00 07 # experimenter id
+55 55 # tpn
+00 50 # tslen
+01 01 01 01 01 01 01 01 01 01 00 00 # tsmap
+
+FF FF # experimenter class
+04 01 # type_len - EXP_ODU_SIG_TYPE
+FF 00 00 07 # experimenter id
+08 # value
+
+FF FF # experimenter class
+0A 06 # type_len - EXP_OCH_SIG_ID
+FF 00 00 07 # experimenter id
+02 # gridType
+01 # channelSpacing
+00 04 # channelNumber
+00 01 # spectralWidth
+
+FF FF # experimenter class
+08 01 # type_len - EXP_OCH_SIG_TYPE
+FF 00 00 07 # experimenter id
+16 # value
+
00 # match.pad
00 01 # instructions[0].type
@@ -47,6 +72,7 @@
00 01 # instructions[1].type
00 08 # instructions[1].length
07 # instructions[1].table_id
+
00 00 00 # pad
-- python
ofp.message.flow_delete(
@@ -92,6 +118,10 @@
.setMasked(MatchField.IPV6_SRC,
IPv6Address.of(0x1CCAFE1CB1101C00l, 0x0028000000000000l),
IPv6Address.of(0xFFFFFFFFFFF0FFFFl, 0x1C2C3C0000000000l))
+ .setExact(MatchField.EXP_ODU_SIG_ID, new OduSignalID((short)21845, (short)80,new byte[] {1,1,1,1,1,1,1,1,1,1}))
+ .setExact(MatchField.EXP_ODU_SIGTYPE, U8.of((short) 8 ))
+ .setExact(MatchField.EXP_OCH_SIG_ID, new CircuitSignalID((byte)2,(byte)1,(short)4,(short)1))
+ .setExact(MatchField.EXP_OCH_SIGTYPE, U8.of((short) 22))
.build()
)
.setInstructions(
diff --git a/test_data/of13/flow_modify.data b/test_data/of13/flow_modify.data
index 6f3ebee..1c02f5a 100644
--- a/test_data/of13/flow_modify.data
+++ b/test_data/of13/flow_modify.data
@@ -1,6 +1,6 @@
-- binary
04 0e # version, type
-00 80 # length
+00 B8 # length
12 34 56 78 # xid
fe dc ba 98 76 54 32 10 # cookie
@@ -21,7 +21,7 @@
00 00 # pad
00 01 # match.type
-00 3F # match.length # 59 bytes OXMs + 4 bytes match header
+00 77 # match.length #
80 00 01 08 # match.oxm_list[0].type_len - IN_PORT
00 00 00 04 # match.oxm_list[0].value
@@ -37,6 +37,31 @@
1C CA FE 1C B1 10 1C 00 00 28 00 00 00 00 00 00 # match.oxm_list[3].value
FF FF FF FF FF F0 FF FF 1C 2C 3C 00 00 00 00 00 # match.oxm_list[3].mask
+FF FF # experimenter class
+06 10 # type_len - EXP_ODU_SIG_ID
+FF 00 00 07 # experimenter id
+55 55 # tpn
+00 50 # tslen
+01 01 01 01 01 01 01 01 01 01 00 00 # tsmap
+
+FF FF # experimenter class
+04 01 # type_len - EXP_ODU_SIG_TYPE
+FF 00 00 07 # experimenter id
+08 # value
+
+FF FF # experimenter class
+0A 06 # type_len - EXP_OCH_SIG_ID
+FF 00 00 07 # experimenter id
+02 # gridType
+01 # channelSpacing
+00 04 # channelNumber
+00 01 # spectralWidth
+
+FF FF # experimenter class
+08 01 # type_len - EXP_OCH_SIG_TYPE
+FF 00 00 07 # experimenter id
+16 # value
+
00 # match.pad
00 01 # instructions[0].type
@@ -69,6 +94,10 @@
value ='\x1C\xCA\xFE\x1C\xB1\x10\x1C\x00\x00\x28\x00\x00\x00\x00\x00\x00',
value_mask='\xFF\xFF\xFF\xFF\xFF\xF0\xFF\xFF\x1C\x2C\x3C\x00\x00\x00\x00\x00')
]),
+ ofp.oxm.exp_odu_sig_id(21845,4,10),
+ ofp.oxm.exp_odu_sigtype(8),
+ ofp.oxm.exp_och_sig_id(2,1,4,1),
+ ofp.oxm.exp_och_sigtype(22),
instructions=[
ofp.instruction.goto_table(table_id=4),
ofp.instruction.goto_table(table_id=7)])
@@ -92,6 +121,10 @@
.setMasked(MatchField.IPV6_SRC,
IPv6Address.of(0x1CCAFE1CB1101C00l, 0x0028000000000000l),
IPv6Address.of(0xFFFFFFFFFFF0FFFFl, 0x1C2C3C0000000000l))
+ .setExact(MatchField.EXP_ODU_SIG_ID, new OduSignalID((short)21845, (short)80,new byte[] {1,1,1,1,1,1,1,1,1,1}))
+ .setExact(MatchField.EXP_ODU_SIGTYPE, U8.of((short) 8 ))
+ .setExact(MatchField.EXP_OCH_SIG_ID, new CircuitSignalID((byte)2,(byte)1,(short)4,(short)1))
+ .setExact(MatchField.EXP_OCH_SIGTYPE, U8.of((short) 22))
.build()
)
.setInstructions(
diff --git a/test_data/of13/match_v3.data b/test_data/of13/match_v3.data
index 8d42019..3b5a4f5 100644
--- a/test_data/of13/match_v3.data
+++ b/test_data/of13/match_v3.data
@@ -1,6 +1,6 @@
-- binary
00 01 # type
-00 3C # length
+00 74 # length
80 00 # oxm_list[0].class
05 10 # oxm_list[0].type_len - METADATA
FE DC BA 98 12 14 12 10 # oxm_list[0].value
@@ -15,6 +15,32 @@
36 10 # oxm_list[4].type_len - IPV6_DST
12 12 12 12 12 12 12 12 # oxm_list[4].value
12 12 12 12 12 12 12 12 # ...
+
+FF FF # experimenter class
+06 10 # type_len - EXP_ODU_SIG_ID
+FF 00 00 07 # experimenter id
+55 55 # tpn
+00 50 # tslen
+01 01 01 01 01 01 01 01 01 01 00 00 # tsmap
+
+FF FF # experimenter class
+04 01 # type_len - EXP_ODU_SIG_TYPE
+FF 00 00 07 # experimenter id
+08 # value
+
+FF FF # experimenter class
+0A 06 # type_len - EXP_OCH_SIG_ID
+FF 00 00 07 # experimenter id
+02 # gridType
+01 # channelSpacing
+00 04 # channelNumber
+00 01 # spectralWidth
+
+FF FF # experimenter class
+08 01 # type_len - EXP_OCH_SIG_TYPE
+FF 00 00 07 # experimenter id
+16 # value
+
00 00 00 00 # pad
-- python
ofp.match([
@@ -22,6 +48,10 @@
ofp.oxm.eth_src([1,2,3,4,5,6]),
ofp.oxm.udp_dst(53),
ofp.oxm.ipv6_dst("\x12" * 16),
+ ofp.oxm.exp_odu_sig_id(21845,4,10),
+ ofp.oxm.exp_odu_sigtype(8),
+ ofp.oxm.exp_och_sig_id(2,1,4,1),
+ ofp.oxm.exp_och_sigtype(22)
])
-- java
builder
@@ -30,4 +60,8 @@
.setExact(MatchField.UDP_DST, TransportPort.of(53))
.setExact(MatchField.IPV6_DST, IPv6Address.of(new byte[] { 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12 }))
+ .setExact(MatchField.EXP_ODU_SIG_ID, new OduSignalID((short)21845, (short)80,new byte[] {1,1,1,1,1,1,1,1,1,1}))
+ .setExact(MatchField.EXP_ODU_SIGTYPE, U8.of((short) 8 ))
+ .setExact(MatchField.EXP_OCH_SIG_ID, new CircuitSignalID((byte)2,(byte)1,(short)4,(short)1))
+ .setExact(MatchField.EXP_OCH_SIGTYPE, U8.of((short) 22))
\ No newline at end of file
diff --git a/wireshark_gen/field_info.py b/wireshark_gen/field_info.py
index bc11170..3158697 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 9695c59..700b236 100644
--- a/wireshark_gen/templates/_oftype_readers.lua
+++ b/wireshark_gen/templates/_oftype_readers.lua
@@ -139,6 +139,14 @@
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