On Tue, Mar 8, 2016 at 9:24 PM, Ajmer Singh <ajmersingh.t...@gmail.com> wrote:
> I have now question related to mapping of ofp_header->type (OFPT_) with
> OFPRAW_contants
>
> struct ofp_header {
>     uint8_t version;    /* An OpenFlow version number, e.g. OFP10_VERSION.
> */
>     uint8_t type;       /* One of the OFPT_ constants. */
>     ovs_be16 length;    /* Length including this ofp_header. */
>     ovs_be32 xid;       /* Transaction id associated with this packet.
> Replies use the same id as was in the request to facilitate pairing. */
> };
> OFP_ASSERT(sizeof(struct ofp_header) == 8);
>
> ofphdrs_decode(): openVswitch/lib/ofp-msg.c
> this function assumes that openflow header type contains only below enum
> constants. My query is why it is not taking care of lot many openflow
> messages (PACKET_OUT, FLOW_MOD etc..). your response is much appreciated.
> OFPT_VENDOR
> OFPT10_STATS_REQUEST
> OFPT10_STATS_REPLY
> OFPT11_STATS_REQUEST
> OFPT11_STATS_REQUEST

The comment above struct ofphdrs describes what information is contained in it:

/* A thin abstraction of OpenFlow headers:
 *
 *   - 'version' and 'type' come straight from struct ofp_header, so these are
 *     always present and meaningful.
 *
 *   - 'stat' comes from the 'type' member in statistics messages only.  It is
 *     meaningful, therefore, only if 'version' and 'type' taken together
 *     specify a statistics request or reply.  Otherwise it is 0.
 *
 *   - 'vendor' is meaningful only for vendor messages, that is, if 'version'
 *     and 'type' specify a vendor message or if 'version' and 'type' specify
 *     a statistics message and 'stat' specifies a vendor statistic type.
 *     Otherwise it is 0.
 *
 *   - 'subtype' is meaningful only for vendor messages and otherwise 0.  It
 *     specifies a vendor-defined subtype.  There is no standard format for
 *     these but 32 bits seems like it should be enough. */

It is not handling any message types, just extracting this
information. However, none of this needs to be modified to add a new
tunnel type.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to