X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fopenflow%2Fopenflow.h;h=9a02669d4893bc4b307d8cc02536b0c8389403a3;hb=d15a5ee594f46a855788652e687aa5d736d530fb;hp=b77cd701137bb3fac0413007fa23475a2c718b13;hpb=a0bc29a541fc7dc6e20137d5558e2094d614e6ab;p=sliver-openvswitch.git diff --git a/include/openflow/openflow.h b/include/openflow/openflow.h index b77cd7011..9a02669d4 100644 --- a/include/openflow/openflow.h +++ b/include/openflow/openflow.h @@ -419,6 +419,18 @@ struct ofp_action_header { }; OFP_ASSERT(sizeof(struct ofp_action_header) == 8); +/* OFPAT_ENQUEUE action struct: send packets to given queue on port. */ +struct ofp_action_enqueue { + uint16_t type; /* OFPAT_ENQUEUE. */ + uint16_t len; /* Len is 16. */ + uint16_t port; /* Port that queue belongs. Should + refer to a valid physical port + (i.e. < OFPP_MAX) or OFPP_IN_PORT. */ + uint8_t pad[6]; /* Pad for 64-bit alignment. */ + uint32_t queue_id; /* Where to enqueue the packets. */ +}; +OFP_ASSERT(sizeof(struct ofp_action_enqueue) == 16); + union ofp_action { uint16_t type; struct ofp_action_header header; @@ -544,7 +556,8 @@ enum ofp_flow_mod_flags { OFPFF_SEND_FLOW_REM = 1 << 0, /* Send flow removed message when flow * expires or is deleted. */ OFPFF_CHECK_OVERLAP = 1 << 1, /* Check for overlapping entries first. */ - OFPFF_EMERG = 1 << 2 /* Ramark this is for emergency. */ + OFPFF_EMERG = 1 << 2 /* Use emergency flow cache (not supported + * by Open vSwitch). */ }; /* Flow setup and teardown (controller -> datapath). */ @@ -554,7 +567,8 @@ struct ofp_flow_mod { uint64_t cookie; /* Opaque controller-issued identifier. */ /* Flow actions. */ - uint16_t command; /* One of OFPFC_*. */ + uint16_t command; /* One of OFPFC_* (NXT_FLOW_MOD_TABLE_ID + * affects interpretation of high 8 bits). */ uint16_t idle_timeout; /* Idle time before discarding (seconds). */ uint16_t hard_timeout; /* Max time before discarding (seconds). */ uint16_t priority; /* Priority level of flow entry. */ @@ -564,7 +578,7 @@ struct ofp_flow_mod { matching entries to include this as an output port. A value of OFPP_NONE indicates no restriction. */ - uint16_t flags; /* One of OFPFF_*. */ + uint16_t flags; /* Zero or more of OFPFF_*. */ struct ofp_action_header actions[0]; /* The action length is inferred from the length field in the header. */ @@ -713,8 +727,8 @@ enum ofp_stats_types { OFPST_PORT, /* Queue statistics for a port - * The request body defines the port - * The reply body is an array of struct ofp_queue_stats */ + * The request body is struct ofp_queue_stats_request. + * The reply body is an array of struct ofp_queue_stats. */ OFPST_QUEUE, /* Vendor extension. @@ -859,6 +873,29 @@ struct ofp_port_stats { }; OFP_ASSERT(sizeof(struct ofp_port_stats) == 104); +/* All ones is used to indicate all queues in a port (for stats retrieval). */ +#define OFPQ_ALL 0xffffffff + +/* Body for ofp_stats_request of type OFPST_QUEUE. */ +struct ofp_queue_stats_request { + uint16_t port_no; /* All ports if OFPP_ALL. */ + uint8_t pad[2]; /* Align to 32-bits. */ + uint32_t queue_id; /* All queues if OFPQ_ALL. */ +}; +OFP_ASSERT(sizeof(struct ofp_queue_stats_request) == 8); + +/* Body for ofp_stats_reply of type OFPST_QUEUE consists of an array of this + * structure type. */ +struct ofp_queue_stats { + uint16_t port_no; + uint8_t pad[2]; /* Align to 32-bits. */ + uint32_t queue_id; /* Queue id. */ + uint64_t tx_bytes; /* Number of transmitted bytes. */ + uint64_t tx_packets; /* Number of transmitted packets. */ + uint64_t tx_errors; /* Number of packets dropped due to overrun. */ +}; +OFP_ASSERT(sizeof(struct ofp_queue_stats) == 32); + /* Vendor extension. */ struct ofp_vendor_header { struct ofp_header header; /* Type OFPT_VENDOR. */