Skip to content

Commit

Permalink
experimenter optical multipart request and reply messages to work wit…
Browse files Browse the repository at this point in the history
…h LINC-OE
  • Loading branch information
Praseed Balakrishnan committed Sep 19, 2014
1 parent 59c0d4e commit 7f71878
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 8 deletions.
1 change: 1 addition & 0 deletions c_gen/c_code_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,7 @@ def base_h_content(out):
/* Currently these are categorized as scalars */
typedef char of_port_name_t[OF_MAX_PORT_NAME_LEN];
typedef char of_app_code_t[OF_APP_CODE_LEN];
typedef char of_table_name_t[OF_MAX_TABLE_NAME_LEN];
typedef char of_desc_str_t[OF_DESC_STR_LEN];
typedef char of_serial_num_t[OF_SERIAL_NUM_LEN];
Expand Down
7 changes: 5 additions & 2 deletions c_gen/c_test_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ def var_name_map(m_type):
of_bitmap_128_t="bitmap_128",
of_checksum_128_t="checksum_128",
#Circuit extensions
oxm_of_och_sig_id_t="sig_id",
oxm_of_och_sig_id_t="sig_id",
of_app_code_t="app_code",
#of_port_optical_transport_application_code_t="tappcode",
of_port_desc_prop_optical_transport_t="desc1",
)

if m_type.find("of_list_") == 0:
Expand All @@ -121,7 +124,7 @@ def var_name_map(m_type):
string_types = [ "of_port_name_t", "of_table_name_t",
"of_desc_str_t", "of_serial_num_t", "of_mac_addr_t",
"of_ipv6_t", "of_bitmap_128_t", "of_checksum_128_t",
"of_str64_t"]
"of_str64_t","of_app_code_t"]

scalar_types = integer_types[:]
scalar_types.extend(string_types)
Expand Down
6 changes: 5 additions & 1 deletion c_gen/of_g_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
OF_MAX_PORT_NAME_LEN = 16,
OF_ETH_ALEN = 6,
OF_DESC_STR_LEN = 256,
OF_SERIAL_NUM_LEN = 32
OF_SERIAL_NUM_LEN = 32,
OF_APP_CODE_LEN = 15,
)

## List of mixed data types
Expand Down Expand Up @@ -208,6 +209,9 @@
of_octets_t = dict(bytes=-1, short_name="octets"),
of_bitmap_128_t = dict(bytes=16, short_name="bitmap_128"),
of_checksum_128_t = dict(bytes=16, short_name="checksum_128"),
of_app_code_t = dict(bytes=ofp_constants["OF_APP_CODE_LEN"],
short_name="app_code"),

)

of_scalar_types = ["char", "uint8_t", "uint16_t", "uint32_t", "uint64_t",
Expand Down
2 changes: 2 additions & 0 deletions java_gen/java_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def gen_fixed_length_string_jtype(length):
default="MacAddress.NONE")

port_name = gen_fixed_length_string_jtype(16)
app_code = gen_fixed_length_string_jtype(15)
desc_str = gen_fixed_length_string_jtype(256)
serial_num = gen_fixed_length_string_jtype(32)
table_name = gen_fixed_length_string_jtype(32)
Expand Down Expand Up @@ -549,6 +550,7 @@ def gen_fixed_length_string_jtype(length):
'of_bitmap_128_t': port_bitmap,
'of_checksum_128_t': u128,
'of_bsn_vport_t': bsn_vport,
'of_app_code_t': app_code,
}

## Map that defines exceptions from the standard loxi->java mapping scheme
Expand Down
4 changes: 3 additions & 1 deletion loxi_ir/ir_offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand Down Expand Up @@ -102,6 +103,7 @@
of_octets_t = (0, False),
of_bitmap_128_t = (16, True),
of_checksum_128_t = (16, True),
of_app_code_t = (15,True),
)

def type_dec_to_count_base(m_type):
Expand Down
57 changes: 53 additions & 4 deletions openflow_input/circuit
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct of_action_circuit: of_action_experimenter {

};


struct of_circuit_ports_request : of_experimenter_stats_request {
uint8_t version;
uint8_t type == 18;
Expand All @@ -87,10 +88,11 @@ struct of_circuit_ports_request : of_experimenter_stats_request {
uint16_t stats_type == 0xffff;
enum ofp_stats_request_flags flags;
pad(4);
uint32_t experimenter == 0x5c16c8;
uint32_t subtype == 15;
uint32_t experimenter == 0x748771;
uint32_t subtype == 13;
};


struct of_circuit_ports_reply : of_experimenter_stats_reply {
uint8_t version;
uint8_t type == 19;
Expand All @@ -99,6 +101,53 @@ struct of_circuit_ports_reply : of_experimenter_stats_reply {
uint16_t stats_type == 0xffff;
enum ofp_stats_reply_flags flags;
pad(4);
uint32_t experimenter == 0x5c16c8;
uint32_t subtype == ?;
uint32_t experimenter == 0x748771;
uint32_t subtype == 13;
list(of_port_optical_t) entries;
};


struct of_port_optical {
of_port_no_t port_no;
uint16_t length;
pad(2);
of_mac_addr_t hw_addr;
pad(2);
of_port_name_t name;
enum ofp_port_config config;
enum ofp_port_state state;
list(of_port_desc_prop_optical_transport_t) desc;
};

struct of_port_desc_prop_optical_transport {
uint16_t type;
uint16_t length;
uint8_t port_signal_type;
uint8_t reserved;
pad(2);
};

struct of_port_optical_transport_application_code
{
uint16_t feature_type;
uint8_t oic_type;
of_app_code_t app_code;
};


struct of_port_optical_transport_layer_entry {
uint8_t layer_class;
uint8_t signal_type;
uint8_t adaptation;
pad(5);
};


/* ODU Layer Stack Feature Encoding */
struct of_port_optical_transport_layer_stack {
uint16_t feature_type;
uint16_t length;
pad(4);
list(of_port_optical_transport_layer_entry_t) entries;
};

0 comments on commit 7f71878

Please sign in to comment.