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

Miscellaneous 1.4 and 1.5 fixes #636

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 1 addition & 8 deletions openflow_input/oxm-1.5
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ struct of_oxm_actset_output_masked : of_oxm {
of_port_no_t value_mask;
};


struct of_oxm_packet_type : of_oxm {
uint32_t type_len == 0x80005804;
uint8_t value;
};

struct of_oxm_packet_type_masked : of_oxm {
uint32_t type_len == 0x80005908;
uint8_t value;
uint8_t value_mask;
enum ofp_packet_type value;
};
128 changes: 124 additions & 4 deletions openflow_input/standard-1.4
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ enum ofp_instruction_type(wire_type=uint16_t, bitmask=True) {
OFPIT_EXPERIMENTER = 0xffff,
};

enum ofp_flow_monitor_flags (wire_type=uint16_t, bitmask=True){
OFPFMF_INITIAL = 0x1,
OFPFMF_ADD = 0x2,
OFPFMF_REMOVED = 0x4,
OFPFMF_MODIFY = 0x8,
OFPFMF_INSTRUCTIONS = 0x10,
OFPFMF_NO_ABBREV = 0x20,
OFPFMF_ONLY_OWN = 0x40,
};

enum ofp_flow_mod_command(wire_type=uint8_t) {
OFPFC_ADD = 0,
OFPFC_MODIFY = 1,
Expand Down Expand Up @@ -880,7 +890,7 @@ struct of_port_desc_prop_experimenter : of_port_desc_prop {
uint16_t type == 0xffff;
uint16_t length;
uint32_t experimenter == ?;
//uint32_t exp_type;
uint32_t exp_type;
};

struct of_port_desc {
Expand Down Expand Up @@ -2130,6 +2140,118 @@ struct of_group_stats_reply : of_stats_reply {
list(of_group_stats_entry_t) entries;
};

/* Flow monitor commands */
enum ofp_flow_monitor_command(wire_type=uint8_t) {
OFPFMC_ADD = 0,
OFPFMC_MODIFY = 1,
OFPFMC_DELETE = 2,
};

struct of_flow_monitor_entry {
uint32_t monitor_id;
uint32_t out_port;
uint32_t out_group;
enum ofp_flow_monitor_flags flags;
uint8_t table_id;
enum ofp_flow_monitor_command command;
of_match_t match;
};

/* Body of OFPMP_FLOW_MONITOR request */
struct of_flow_monitor_request : of_stats_request {
uint8_t version;
uint8_t type == 18;
uint16_t length;
uint32_t xid;
uint16_t stats_type == 16;
enum ofp_stats_request_flags flags;
pad(4);
list(of_flow_monitor_entry_t) entries;
};

enum ofp_flow_update_event(wire_type=uint16_t) {
OFPFME_INITIAL = 0,
OFPFME_ADDED = 1,
OFPFME_REMOVED = 2,
OFPFME_MODIFIED = 3,
OFPFME_ABBREV = 4,
OFPFME_PAUSED = 5,
OFPFME_RESUMED = 6,
};

struct of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event == ?;
};

/* Body of OFPMP_FLOW_MONITOR reply */
struct of_flow_monitor_reply : of_stats_reply {
uint8_t version;
uint8_t type == 19;
uint16_t length;
uint32_t xid;
uint16_t stats_type == 16;
enum ofp_stats_reply_flags flags;
pad(4);
list(of_flow_monitor_reply_entry_t) entries;
};

struct of_flow_update_full_initial : of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event == 0;
uint8_t table_id;
uint8_t reason;
uint16_t idle_timeout;
uint16_t hard_timeout;
uint16_t priority;
pad(4);
uint64_t cookie;
of_match_t match;
list(of_instruction_t) instructions;
};

struct of_flow_update_full_added : of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event == 1;
uint8_t table_id;
uint8_t reason;
uint16_t idle_timeout;
uint16_t hard_timeout;
uint16_t priority;
pad(4);
uint64_t cookie;
of_match_t match;
list(of_instruction_t) instructions;
};

struct of_flow_update_full_removed : of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event == 2;
uint8_t table_id;
uint8_t reason;
uint16_t idle_timeout;
uint16_t hard_timeout;
uint16_t priority;
pad(4);
uint64_t cookie;
of_match_t match;
list(of_instruction_t) instructions;
};

struct of_flow_update_full_modified : of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event == 3;
uint8_t table_id;
uint8_t reason;
uint16_t idle_timeout;
uint16_t hard_timeout;
uint16_t priority;
pad(4);
uint64_t cookie;
of_match_t match;
list(of_instruction_t) instructions;
};

struct of_group_desc_stats_request : of_stats_request {
uint8_t version;
uint8_t type == 18;
Expand Down Expand Up @@ -2671,7 +2793,5 @@ struct of_requestforward : of_header {
uint8_t type == 32;
uint16_t length;
uint32_t xid;
uint32_t role;
// TODO support embedding of_header
of_octets_t data;
of_header_t request;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build of the C-library currently fails, because of_header_t is not defined.

Traceback (most recent call last):
  File "./loxigen.py", line 176, in <module>
    lang_module.generate(options.install_dir)
  File "/home/bsn/workspace/Organization_loxigen_PR-636-IVHAZVYHIZ5OV4QL2OQZ7AR7AOERX5COOOHWIZVMSQFMDJ7WHSOQ/lang_c.py", line 125, in generate
    fn(outfile, os.path.basename(name))
  File "/home/bsn/workspace/Organization_loxigen_PR-636-IVHAZVYHIZ5OV4QL2OQZ7AR7AOERX5COOOHWIZVMSQFMDJ7WHSOQ/c_gen/c_test_gen.py", line 1796, in dup_c_gen
    gen_version_dup(out)
  File "/home/bsn/workspace/Organization_loxigen_PR-636-IVHAZVYHIZ5OV4QL2OQZ7AR7AOERX5COOOHWIZVMSQFMDJ7WHSOQ/c_gen/c_test_gen.py", line 1739, in gen_version_dup
    gen_dup_cls(out, cls, version)
  File "/home/bsn/workspace/Organization_loxigen_PR-636-IVHAZVYHIZ5OV4QL2OQZ7AR7AOERX5COOOHWIZVMSQFMDJ7WHSOQ/c_gen/c_test_gen.py", line 1657, in gen_dup_cls
    """  % dict(m_type=m_type, v_name=var_name_map(m_type)))
  File "/home/bsn/workspace/Organization_loxigen_PR-636-IVHAZVYHIZ5OV4QL2OQZ7AR7AOERX5COOOHWIZVMSQFMDJ7WHSOQ/c_gen/c_test_gen.py", line 121, in var_name_map
    return _var_name_map[m_type]
KeyError: 'of_header_t'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(you should see the same result if you run make on your local code).

};
62 changes: 57 additions & 5 deletions openflow_input/standard-1.5
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,7 @@ enum ofp_flow_update_event(wire_type=uint16_t) {

struct of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event;
enum ofp_flow_update_event event == ?;
};

/* Body of OFPMP_FLOW_MONITOR reply */
Expand All @@ -2311,6 +2311,62 @@ struct of_flow_monitor_reply : of_stats_reply {
list(of_flow_monitor_reply_entry_t) entries;
};

struct of_flow_update_full_initial : of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event == 0;
uint8_t table_id;
uint8_t reason;
uint16_t idle_timeout;
uint16_t hard_timeout;
uint16_t priority;
pad(4);
uint64_t cookie;
of_match_t match;
list(of_instruction_t) instructions;
};

struct of_flow_update_full_added : of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event == 1;
uint8_t table_id;
uint8_t reason;
uint16_t idle_timeout;
uint16_t hard_timeout;
uint16_t priority;
pad(4);
uint64_t cookie;
of_match_t match;
list(of_instruction_t) instructions;
};

struct of_flow_update_full_removed : of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event == 2;
uint8_t table_id;
uint8_t reason;
uint16_t idle_timeout;
uint16_t hard_timeout;
uint16_t priority;
pad(4);
uint64_t cookie;
of_match_t match;
list(of_instruction_t) instructions;
};

struct of_flow_update_full_modified : of_flow_monitor_reply_entry {
uint16_t length;
enum ofp_flow_update_event event == 3;
uint8_t table_id;
uint8_t reason;
uint16_t idle_timeout;
uint16_t hard_timeout;
uint16_t priority;
pad(4);
uint64_t cookie;
of_match_t match;
list(of_instruction_t) instructions;
};

/* Body of OFPMP_TABLE_DESC request. */
struct of_table_desc_stats_request : of_stats_request {
uint8_t version;
Expand Down Expand Up @@ -3604,7 +3660,3 @@ struct of_packet_queue {
pad(6);
list(of_queue_prop_t) properties;
};