Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optical Additions used in ONOS #416

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
16287fb
Initial test of optical OXC experimenter messages
Sep 4, 2014
f78068b
Initial test of optical OXC experimenter messages
Sep 4, 2014
59c0d4e
Merge branch 'optical_experimenter' of github.com:bpraseed/loxigen in…
Sep 6, 2014
7f71878
experimenter optical multipart request and reply messages to work wit…
Sep 19, 2014
2ed6da0
optical circuit experimenter changes
Sep 19, 2014
db949d4
changed order of sigtype and sigid
Dec 2, 2014
3efb663
Changing openflowj groupID and version in pom.xml
bocon13 Dec 3, 2014
19ba9fc
fixing java pom.xml
bocon13 Dec 4, 2014
820eaee
fix for port showing up as negative
alshabib Jan 13, 2015
78e24b9
Merge remote-tracking branch 'upstream/master'
alshabib Jan 28, 2015
8bd3661
Merge remote-tracking branch 'upstream/master'
bocon13 May 28, 2015
58a73e3
Adding OCS OpenFlow Protocol Extensions from Calient
bocon13 May 28, 2015
65e2257
Bumping version to 0.3.10.oe-SNAPSHOT
bocon13 Jun 1, 2015
c59ad11
Updating openflowj version to 0.4.0.onos
bocon13 Jun 4, 2015
46ba5bc
Merge tag '0.4.0.onos' into HEAD
alshabib Aug 21, 2015
7a1eb28
onosproject optical additions.
alshabib Aug 21, 2015
10119ea
removing release profile
alshabib Aug 21, 2015
7569e99
capitalizing enums in calient openflow input
alshabib Aug 21, 2015
e464a25
adding copyrights
alshabib Aug 21, 2015
f26163c
Bundle-ifying the generated jar.
alshabib Aug 25, 2015
8bcdd5f
Proper class hierarchies for LINC optical circuit extensions
Sep 22, 2015
1ceafeb
Merge pull request #1 from leenheer/hierarchy
alshabib Sep 25, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions c_gen/c_code_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,13 @@ 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];
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;
Expand Down
8 changes: 7 additions & 1 deletion c_gen/c_test_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -107,6 +109,9 @@ def var_name_map(m_type):
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:
Expand All @@ -121,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_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)
Expand Down
12 changes: 10 additions & 2 deletions c_gen/of_g_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -199,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"),
Expand All @@ -215,14 +219,18 @@
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_scalar_types = ["char", "uint8_t", "uint16_t", "uint32_t", "uint64_t",
"of_port_no_t", "of_fm_cmd_t", "of_wc_bmap_t",
"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
Expand Down
2 changes: 2 additions & 0 deletions c_gen/templates/loci_dump.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions c_gen/templates/loci_show.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
46 changes: 46 additions & 0 deletions c_gen/templates/of_wire_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions java_gen/java_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,13 @@ 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)
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)",
Expand Down Expand Up @@ -512,6 +515,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") \
Expand Down Expand Up @@ -572,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,
Expand All @@ -581,6 +589,8 @@ def gen_fixed_length_string_jtype(length):
'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,
}

Expand Down Expand Up @@ -756,6 +766,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},

'of_bundle_add_msg' : { 'data' : of_message },
}
Expand Down
21 changes: 2 additions & 19 deletions java_gen/pre-written/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<artifactId>openflowj</artifactId>
<version>0.9.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>OpenFlowJ-Loxi</name>
<description>OpenFlowJ API supporting OpenFlow versions 1.0 through 1.3.1, generated by LoxiGen</description>
<url>http://www.projectfloodlight.org/projects/</url>
Expand Down Expand Up @@ -224,30 +224,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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,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;

public class MatchField<F extends OFValueType<F>> {
private final String name;
Expand Down Expand Up @@ -259,6 +260,22 @@ private MatchField(final String name, final MatchFields id, Prerequisite<?>... p
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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ public enum MatchFields {
BSN_INNER_ETH_DST,
BSN_INNER_ETH_SRC,
BSN_INNER_VLAN_VID,
OCH_SIGTYPE,
OCH_SIGTYPE_BASIC,
OCH_SIGID,
OCH_SIGID_BASIC,
}
Loading