diff options
author | Ben Pfaff <blp@nicira.com> | 2011-12-06 22:33:49 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2012-03-07 14:05:04 -0800 |
commit | 87ea5e5e26c97598cd66ef64c8386afac2b77fff (patch) | |
tree | 3e52212871b54a831c56d08c0e67abf855bdb907 /include/openflow/openflow-1.0.h | |
parent | 539315543cc6123ae4efec162e291f7f90d0ccf0 (diff) | |
download | openvswitch-87ea5e5e26c97598cd66ef64c8386afac2b77fff.tar.gz |
Begin breaking openflow-1.0.h into common and version-specific definitions.
The intention is that, as each OpenFlow 1.1 and 1.2 feature is added to Open
vSwitch, the corresponding protocol definitions will be broken up this way:
- Definitions that are the same in OF1.0 and OF1.1 will retain the "OFP"
or "ofp" prefix and move to openflow-common.h.
- Definitions that are specific to OF1.0 will be renamed with an "OFP10"
or "ofp10" prefix and stay in openflow-1.0.h.
- Definitions that are specific to OF1.1 or to OF1.1 and OF1.2 will be
renamed with an "OFP11" or "ofp11" prefix and move to openflow-1.1.h.
- Definitions that are specific to OF1.2 will be renamed with an "OFP12"
or "ofp12" prefix and move to openflow-1.2.h.
This commit starts this process with some basic OpenFlow definitions.
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'include/openflow/openflow-1.0.h')
-rw-r--r-- | include/openflow/openflow-1.0.h | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/include/openflow/openflow-1.0.h b/include/openflow/openflow-1.0.h index d86243f95..7cc53831e 100644 --- a/include/openflow/openflow-1.0.h +++ b/include/openflow/openflow-1.0.h @@ -19,37 +19,7 @@ #ifndef OPENFLOW_OPENFLOW10_H #define OPENFLOW_OPENFLOW10_H 1 -#include "openvswitch/types.h" - -#ifdef SWIG -#define OFP_ASSERT(EXPR) /* SWIG can't handle OFP_ASSERT. */ -#elif !defined(__cplusplus) -/* Build-time assertion for use in a declaration context. */ -#define OFP_ASSERT(EXPR) \ - extern int (*build_assert(void))[ sizeof(struct { \ - unsigned int build_assert_failed : (EXPR) ? 1 : -1; })] -#else /* __cplusplus */ -#include <boost/static_assert.hpp> -#define OFP_ASSERT BOOST_STATIC_ASSERT -#endif /* __cplusplus */ - -/* Version number: - * Non-experimental versions released: 0x01 - * Experimental versions released: 0x81 -- 0x99 - */ -/* The most significant bit being set in the version field indicates an - * experimental OpenFlow version. - */ -#define OFP_VERSION 0x01 -#define OFP10_VERSION 0x01 - -#define OFP_MAX_TABLE_NAME_LEN 32 -#define OFP_MAX_PORT_NAME_LEN 16 - -#define OFP_TCP_PORT 6633 -#define OFP_SSL_PORT 6633 - -#define OFP_ETH_ALEN 6 /* Bytes in an Ethernet address. */ +#include "openflow/openflow-common.h" /* Port numbering. Physical ports are numbered starting from 1. */ enum ofp_port { @@ -113,7 +83,7 @@ enum ofp_type { /* Header on all OpenFlow packets. */ struct ofp_header { - uint8_t version; /* OFP_VERSION. */ + 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. |