/* Followed by at least the first 64 bytes of the failed request. */
};
\f
-/* Specific Nicira extension error numbers.
- *
- * These are the "code" values used in nx_vendor_error. So far, the "type"
- * values in nx_vendor_error are the same as those in ofp_error_msg. That is,
- * at Nicira so far we've only needed additional vendor-specific 'code' values,
- * so we're using the existing 'type' values to avoid having to invent new ones
- * that duplicate the current ones' meanings. */
-
-/* Additional "code" values for OFPET_BAD_REQUEST. */
-enum nx_bad_request_code {
-/* Nicira Extended Match (NXM) errors. */
-
- /* Generic error code used when there is an error in an NXM sent to the
- * switch. The switch may use one of the more specific error codes below,
- * if there is an appropriate one, to simplify debugging, but it is not
- * required to do so. */
- NXBRC_NXM_INVALID = 0x100,
-
- /* The nxm_type, or nxm_type taken in combination with nxm_hasmask or
- * nxm_length or both, is invalid or not implemented. */
- NXBRC_NXM_BAD_TYPE = 0x101,
-
- /* Invalid nxm_value. */
- NXBRC_NXM_BAD_VALUE = 0x102,
-
- /* Invalid nxm_mask. */
- NXBRC_NXM_BAD_MASK = 0x103,
-
- /* A prerequisite was not met. */
- NXBRC_NXM_BAD_PREREQ = 0x104,
-
- /* A given nxm_type was specified more than once. */
- NXBRC_NXM_DUP_TYPE = 0x105,
-
-/* Other errors. */
-
- /* A request specified a nonexistent table ID. (But NXFMFC_BAD_TABLE_ID is
- * used instead, when it is appropriate, because that is such a special
- * case.) */
- NXBRC_BAD_TABLE_ID = 0x200,
-
- /* NXT_ROLE_REQUEST specified an invalid role. */
- NXBRC_BAD_ROLE = 0x201,
-
- /* The in_port in an ofp_packet_out request is invalid. */
- NXBRC_BAD_IN_PORT = 0x202
-};
-
-/* Additional "code" values for OFPET_FLOW_MOD_FAILED. */
-enum nx_flow_mod_failed_code {
- /* Generic hardware error. */
- NXFMFC_HARDWARE = 0x100,
-
- /* A nonexistent table ID was specified in the "command" field of struct
- * ofp_flow_mod, when the nxt_flow_mod_table_id extension is enabled. */
- NXFMFC_BAD_TABLE_ID = 0x101
-};
-\f
/* Nicira vendor requests and replies. */
/* Header for Nicira vendor requests and replies. */
/* Alternative PACKET_IN message formats. */
NXT_SET_PACKET_IN_FORMAT = 16, /* Set Packet In format. */
- NXT_PACKET_IN = 17 /* Nicira Packet In. */
+ NXT_PACKET_IN = 17, /* Nicira Packet In. */
+
+ /* Are the idle_age and hard_age members in struct nx_flow_stats supported?
+ * If so, the switch does not reply to this message (which consists only of
+ * a "struct nicira_header"). If not, the switch sends an error reply. */
+ NXT_FLOW_AGE = 18,
};
/* Header for Nicira vendor stats request and reply messages. */
struct nicira_header nxh;
ovs_be32 role; /* One of NX_ROLE_*. */
};
+OFP_ASSERT(sizeof(struct nx_role_request) == 20);
enum nx_role {
NX_ROLE_OTHER, /* Default role, full access. */
*
* Format: 16-bit integer in network byte order.
*
- * Masking: Not maskable. */
+ * Masking: Fully maskable, in Open vSwitch 1.6 and later. Not maskable, in
+ * earlier versions. */
#define NXM_OF_TCP_SRC NXM_HEADER (0x0000, 9, 2)
+#define NXM_OF_TCP_SRC_W NXM_HEADER_W(0x0000, 9, 2)
#define NXM_OF_TCP_DST NXM_HEADER (0x0000, 10, 2)
+#define NXM_OF_TCP_DST_W NXM_HEADER_W(0x0000, 10, 2)
/* The source or destination port in the UDP header.
*
*
* Format: 16-bit integer in network byte order.
*
- * Masking: Not maskable. */
+ * Masking: Fully maskable, in Open vSwitch 1.6 and later. Not maskable, in
+ * earlier versions. */
#define NXM_OF_UDP_SRC NXM_HEADER (0x0000, 11, 2)
+#define NXM_OF_UDP_SRC_W NXM_HEADER_W(0x0000, 11, 2)
#define NXM_OF_UDP_DST NXM_HEADER (0x0000, 12, 2)
+#define NXM_OF_UDP_DST_W NXM_HEADER_W(0x0000, 12, 2)
/* The type or code in the ICMP header.
*
OFP_ASSERT(sizeof(struct nx_flow_stats_request) == 32);
/* Body for Nicira vendor stats reply of type NXST_FLOW (analogous to
- * OFPST_FLOW reply). */
+ * OFPST_FLOW reply).
+ *
+ * The values of 'idle_age' and 'hard_age' are only meaningful when talking to
+ * a switch that implements the NXT_FLOW_AGE extension. Zero means that the
+ * true value is unknown, perhaps because hardware does not track the value.
+ * (Zero is also the value that one should ordinarily expect to see talking to
+ * a switch that does not implement NXT_FLOW_AGE, since those switches zero the
+ * padding bytes that these fields replaced.) A nonzero value X represents X-1
+ * seconds. A value of 65535 represents 65534 or more seconds.
+ *
+ * 'idle_age' is the number of seconds that the flow has been idle, that is,
+ * the number of seconds since a packet passed through the flow. 'hard_age' is
+ * the number of seconds since the flow was last modified (e.g. OFPFC_MODIFY or
+ * OFPFC_MODIFY_STRICT). (The 'duration_*' fields are the elapsed time since
+ * the flow was added, regardless of subsequent modifications.)
+ *
+ * For a flow with an idle or hard timeout, 'idle_age' or 'hard_age',
+ * respectively, will ordinarily be smaller than the timeout, but flow
+ * expiration times are only approximate and so one must be prepared to
+ * tolerate expirations that occur somewhat early or late.
+ */
struct nx_flow_stats {
ovs_be16 length; /* Length of this entry. */
uint8_t table_id; /* ID of table flow came from. */
ovs_be16 idle_timeout; /* Number of seconds idle before expiration. */
ovs_be16 hard_timeout; /* Number of seconds before expiration. */
ovs_be16 match_len; /* Length of nx_match. */
- uint8_t pad2[4]; /* Align to 64 bits. */
+ ovs_be16 idle_age; /* Seconds since last packet, plus one. */
+ ovs_be16 hard_age; /* Seconds since last modification, plus one. */
ovs_be64 cookie; /* Opaque controller-issued identifier. */
ovs_be64 packet_count; /* Number of packets, UINT64_MAX if unknown. */
ovs_be64 byte_count; /* Number of bytes, UINT64_MAX if unknown. */