X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fofp-util.h;h=20efa287642627ddce91dfe1a0d604f9698229fa;hb=9c4dbc1caa7f83c16775406547f9cfba38c8d513;hp=f62aa020677ee5512c2541a02c68df118ac33a1a;hpb=7e9f8266a4b6a951d3b8c0892d0874f4c9d44b3f;p=sliver-openvswitch.git diff --git a/lib/ofp-util.h b/lib/ofp-util.h index f62aa0206..20efa2876 100644 --- a/lib/ofp-util.h +++ b/lib/ofp-util.h @@ -20,9 +20,9 @@ #include #include #include -#include "classifier.h" #include "compiler.h" #include "flow.h" +#include "list.h" #include "match.h" #include "netdev.h" #include "openflow/nicira-ext.h" @@ -108,7 +108,8 @@ enum ofputil_protocol { * variant. */ OFPUTIL_P_OF12_OXM = 1 << 5, OFPUTIL_P_OF13_OXM = 1 << 6, -#define OFPUTIL_P_ANY_OXM (OFPUTIL_P_OF12_OXM | OFPUTIL_P_OF13_OXM) + OFPUTIL_P_OF14_OXM = 1 << 7, +#define OFPUTIL_P_ANY_OXM (OFPUTIL_P_OF12_OXM | OFPUTIL_P_OF13_OXM | OFPUTIL_P_OF14_OXM) #define OFPUTIL_P_NXM_OF11_UP (OFPUTIL_P_OF10_NXM_ANY | OFPUTIL_P_OF11_STD | \ OFPUTIL_P_ANY_OXM) @@ -121,8 +122,10 @@ enum ofputil_protocol { #define OFPUTIL_P_OF13_UP (OFPUTIL_P_OF13_OXM) +#define OFPUTIL_P_OF14_UP (OFPUTIL_P_OF14_OXM) + /* All protocols. */ -#define OFPUTIL_P_ANY ((1 << 7) - 1) +#define OFPUTIL_P_ANY ((1 << 8) - 1) /* Protocols in which a specific table may be specified in flow_mods. */ #define OFPUTIL_P_TID (OFPUTIL_P_OF10_STD_TID | \ @@ -321,11 +324,11 @@ struct ofputil_flow_stats { struct match match; ovs_be64 cookie; uint8_t table_id; - uint32_t duration_sec; - uint32_t duration_nsec; uint16_t priority; uint16_t idle_timeout; uint16_t hard_timeout; + uint32_t duration_sec; + uint32_t duration_nsec; int idle_age; /* Seconds since last packet, -1 if unknown. */ int hard_age; /* Seconds since last change, -1 if unknown. */ uint64_t packet_count; /* Packet count, UINT64_MAX if unknown. */ @@ -359,8 +362,8 @@ enum ofperr ofputil_decode_aggregate_stats_reply( /* Flow removed message, independent of protocol. */ struct ofputil_flow_removed { struct match match; - uint16_t priority; ovs_be64 cookie; + uint16_t priority; uint8_t reason; /* One of OFPRR_*. */ uint8_t table_id; /* 255 if message didn't include table ID. */ uint32_t duration_sec; @@ -591,7 +594,7 @@ struct ofpbuf *ofputil_encode_port_mod(const struct ofputil_port_mod *, /* Abstract ofp_table_mod. */ struct ofputil_table_mod { uint8_t table_id; /* ID of the table, 0xff indicates all tables. */ - uint32_t config; + enum ofp_table_config config; }; enum ofperr ofputil_decode_table_mod(const struct ofp_header *, @@ -770,9 +773,9 @@ struct ofputil_flow_update { uint16_t idle_timeout; uint16_t hard_timeout; uint8_t table_id; + uint16_t priority; ovs_be64 cookie; struct match *match; - uint16_t priority; struct ofpact *ofpacts; size_t ofpacts_len; @@ -848,6 +851,7 @@ enum OVS_PACKED_ENUM ofputil_action_code { OFPUTIL_ACTION_INVALID, #define OFPAT10_ACTION(ENUM, STRUCT, NAME) OFPUTIL_##ENUM, #define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM, +#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM, #define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) OFPUTIL_##ENUM, #include "ofp-util.def" }; @@ -856,6 +860,7 @@ enum OVS_PACKED_ENUM ofputil_action_code { enum { #define OFPAT10_ACTION(ENUM, STRUCT, NAME) + 1 #define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1 +#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1 #define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) + 1 OFPUTIL_N_ACTIONS = 1 #include "ofp-util.def" @@ -886,6 +891,9 @@ void *ofputil_put_action(enum ofputil_action_code, struct ofpbuf *buf); #define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ void ofputil_init_##ENUM(struct STRUCT *); \ struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *); +#define OFPAT13_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ + void ofputil_init_##ENUM(struct STRUCT *); \ + struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *); #define NXAST_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) \ void ofputil_init_##ENUM(struct STRUCT *); \ struct STRUCT *ofputil_put_##ENUM(struct ofpbuf *); @@ -991,12 +999,16 @@ struct ofputil_group_stats { struct bucket_counter *bucket_stats; }; -/* Group features reply, independent of protocol. */ +/* Group features reply, independent of protocol. + * + * Only OF1.2 and later support group features replies. */ struct ofputil_group_features { uint32_t types; /* Bitmap of OFPGT_* values supported. */ uint32_t capabilities; /* Bitmap of OFPGFC12_* capability supported. */ uint32_t max_groups[4]; /* Maximum number of groups for each type. */ - uint32_t actions[4]; /* Bitmaps of OFPAT_* that are supported. */ + + /* Bitmaps of OFPAT_* that are supported. OF1.2+ actions only. */ + uint32_t actions[4]; }; /* Group desc reply, independent of protocol. */ @@ -1008,6 +1020,13 @@ struct ofputil_group_desc { void ofputil_bucket_list_destroy(struct list *buckets); +static inline bool +ofputil_bucket_has_liveness(const struct ofputil_bucket *bucket) +{ + return (bucket->watch_port != OFPP_ANY || + bucket->watch_group != OFPG_ANY); +} + struct ofpbuf *ofputil_encode_group_stats_request(enum ofp_version, uint32_t group_id); enum ofperr ofputil_decode_group_stats_request(