[ovs-dev] [PATCH 2/2] ofp-msgs: Move most OpenFlow header definitions here.

Jarno Rajahalme jarno at ovn.org
Thu Feb 18 18:47:06 UTC 2016


Acked-by: Jarno Rajahalme <jarno at ovn.org>

> On Jan 27, 2016, at 3:50 PM, Ben Pfaff <blp at ovn.org> wrote:
> 
> This code was the only user for OpenFlow header definitions other than
> struct ofp_header itself.
> 
> Signed-off-by: Ben Pfaff <blp at ovn.org>
> ---
> include/openflow/nicira-ext.h   |  9 ---------
> include/openflow/openflow-1.0.h | 20 --------------------
> include/openflow/openflow-1.1.h | 11 +----------
> lib/ofp-msgs.c                  | 39 +++++++++++++++++++++++++++++++++++++++
> 4 files changed, 40 insertions(+), 39 deletions(-)
> 
> diff --git a/include/openflow/nicira-ext.h b/include/openflow/nicira-ext.h
> index fdee330..a209e6a 100644
> --- a/include/openflow/nicira-ext.h
> +++ b/include/openflow/nicira-ext.h
> @@ -68,15 +68,6 @@ struct nx_vendor_error {
> 
> /* Nicira vendor requests and replies. */
> 
> -/* Header for Nicira vendor stats request and reply messages in OpenFlow
> - * 1.0. */
> -struct nicira10_stats_msg {
> -    struct ofp10_vendor_stats_msg vsm; /* Vendor NX_VENDOR_ID. */
> -    ovs_be32 subtype;           /* One of NXST_* below. */
> -    uint8_t pad[4];             /* Align to 64-bits. */
> -};
> -OFP_ASSERT(sizeof(struct nicira10_stats_msg) == 24);
> -
> /* Fields to use when hashing flows. */
> enum nx_hash_fields {
>     /* Ethernet source address (NXM_OF_ETH_SRC) only. */
> diff --git a/include/openflow/openflow-1.0.h b/include/openflow/openflow-1.0.h
> index db629f7..68c7952 100644
> --- a/include/openflow/openflow-1.0.h
> +++ b/include/openflow/openflow-1.0.h
> @@ -331,15 +331,6 @@ struct ofp10_flow_removed {
> };
> OFP_ASSERT(sizeof(struct ofp10_flow_removed) == 80);
> 
> -/* Statistics request or reply message. */
> -struct ofp10_stats_msg {
> -    struct ofp_header header;
> -    ovs_be16 type;              /* One of the OFPST_* constants. */
> -    ovs_be16 flags;             /* Requests: always 0.
> -                                 * Replies: 0 or OFPSF_REPLY_MORE. */
> -};
> -OFP_ASSERT(sizeof(struct ofp10_stats_msg) == 12);
> -
> /* Stats request of type OFPST_AGGREGATE or OFPST_FLOW. */
> struct ofp10_flow_stats_request {
>     struct ofp10_match match; /* Fields to match. */
> @@ -444,15 +435,4 @@ struct ofp10_queue_stats {
> };
> OFP_ASSERT(sizeof(struct ofp10_queue_stats) == 32);
> 
> -/* Vendor extension stats message. */
> -struct ofp10_vendor_stats_msg {
> -    struct ofp10_stats_msg osm; /* Type OFPST_VENDOR. */
> -    ovs_be32 vendor;            /* Vendor ID:
> -                                 * - MSB 0: low-order bytes are IEEE OUI.
> -                                 * - MSB != 0: defined by OpenFlow
> -                                 *   consortium. */
> -    /* Followed by vendor-defined arbitrary additional data. */
> -};
> -OFP_ASSERT(sizeof(struct ofp10_vendor_stats_msg) == 16);
> -
> #endif /* openflow/openflow-1.0.h */
> diff --git a/include/openflow/openflow-1.1.h b/include/openflow/openflow-1.1.h
> index 63d8b41..805f222 100644
> --- a/include/openflow/openflow-1.1.h
> +++ b/include/openflow/openflow-1.1.h
> @@ -1,4 +1,4 @@
> -/* Copyright (c) 2008, 2011, 2012, 2013, 2014 The Board of Trustees of The Leland Stanford
> +/* Copyright (c) 2008, 2011, 2012, 2013, 2014, 2016 The Board of Trustees of The Leland Stanford
>  * Junior University
>  *
>  * We are making the OpenFlow specification and associated documentation
> @@ -382,15 +382,6 @@ struct ofp11_queue_get_config_reply {
> };
> OFP_ASSERT(sizeof(struct ofp11_queue_get_config_reply) == 8);
> 
> -struct ofp11_stats_msg {
> -    struct ofp_header header;
> -    ovs_be16 type;              /* One of the OFPST_* constants. */
> -    ovs_be16 flags;             /* OFPSF_REQ_* flags (none yet defined). */
> -    uint8_t pad[4];
> -    /* Followed by the body of the request. */
> -};
> -OFP_ASSERT(sizeof(struct ofp11_stats_msg) == 16);
> -
> /* Stats request of type OFPST_FLOW. */
> struct ofp11_flow_stats_request {
>     uint8_t table_id;         /* ID of table to read (from ofp_table_stats),
> diff --git a/lib/ofp-msgs.c b/lib/ofp-msgs.c
> index fcfbb50..bc38f40 100644
> --- a/lib/ofp-msgs.c
> +++ b/lib/ofp-msgs.c
> @@ -52,6 +52,35 @@ struct ofp_vendor_header {
> };
> OFP_ASSERT(sizeof(struct ofp_vendor_header) == 16);
> 
> +/* Statistics request or reply message. */
> +struct ofp10_stats_msg {
> +    struct ofp_header header;
> +    ovs_be16 type;              /* One of the OFPST_* constants. */
> +    ovs_be16 flags;             /* Requests: always 0.
> +                                 * Replies: 0 or OFPSF_REPLY_MORE. */
> +};
> +OFP_ASSERT(sizeof(struct ofp10_stats_msg) == 12);
> +
> +/* Vendor extension stats message. */
> +struct ofp10_vendor_stats_msg {
> +    struct ofp10_stats_msg osm; /* Type OFPST_VENDOR. */
> +    ovs_be32 vendor;            /* Vendor ID:
> +                                 * - MSB 0: low-order bytes are IEEE OUI.
> +                                 * - MSB != 0: defined by OpenFlow
> +                                 *   consortium. */
> +    /* Followed by vendor-defined arbitrary additional data. */
> +};
> +OFP_ASSERT(sizeof(struct ofp10_vendor_stats_msg) == 16);
> +
> +struct ofp11_stats_msg {
> +    struct ofp_header header;
> +    ovs_be16 type;              /* One of the OFPST_* constants. */
> +    ovs_be16 flags;             /* OFPSF_REQ_* flags (none yet defined). */
> +    uint8_t pad[4];
> +    /* Followed by the body of the request. */
> +};
> +OFP_ASSERT(sizeof(struct ofp11_stats_msg) == 16);
> +
> /* Vendor extension stats message. */
> struct ofp11_vendor_stats_msg {
>     struct ofp11_stats_msg osm; /* Type OFPST_VENDOR. */
> @@ -68,6 +97,16 @@ struct ofp11_vendor_stats_msg {
>     /* Followed by vendor-defined additional data. */
> };
> OFP_ASSERT(sizeof(struct ofp11_vendor_stats_msg) == 24);
> +
> +/* Header for Nicira vendor stats request and reply messages in OpenFlow
> + * 1.0. */
> +struct nicira10_stats_msg {
> +    struct ofp10_vendor_stats_msg vsm; /* Vendor NX_VENDOR_ID. */
> +    ovs_be32 subtype;           /* One of NXST_* below. */
> +    uint8_t pad[4];             /* Align to 64-bits. */
> +};
> +OFP_ASSERT(sizeof(struct nicira10_stats_msg) == 24);
> +
> /* A thin abstraction of OpenFlow headers:
>  *
>  *   - 'version' and 'type' come straight from struct ofp_header, so these are
> -- 
> 2.1.3
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list