-/* Port numbering. Physical ports are numbered starting from 1. */
-enum ofp_port {
- /* Maximum number of physical switch ports. */
- OFPP_MAX = 0xff00,
-
- /* Fake output "ports". */
- OFPP_IN_PORT = 0xfff8, /* Send the packet out the input port. This
- virtual port must be explicitly used
- in order to send back out of the input
- port. */
- OFPP_TABLE = 0xfff9, /* Perform actions in flow table.
- NB: This can only be the destination
- port for packet-out messages. */
- OFPP_NORMAL = 0xfffa, /* Process with normal L2/L3 switching. */
- OFPP_FLOOD = 0xfffb, /* All physical ports except input port and
- those disabled by STP. */
- OFPP_ALL = 0xfffc, /* All physical ports except input port. */
- OFPP_CONTROLLER = 0xfffd, /* Send to controller. */
- OFPP_LOCAL = 0xfffe, /* Local openflow "port". */
- OFPP_NONE = 0xffff /* Not associated with a physical port. */
-};
-
-/* OpenFlow 1.0 specific message types, in addition to the common message
- * types. */
-enum ofp10_type {
- /* Controller command messages. */
- OFPT10_PACKET_OUT = 13, /* Controller/switch message */
- OFPT10_FLOW_MOD, /* Controller/switch message */
- OFPT10_PORT_MOD, /* Controller/switch message */
-
- /* Statistics messages. */
- OFPT10_STATS_REQUEST, /* Controller/switch message */
- OFPT10_STATS_REPLY, /* Controller/switch message */
-
- /* Barrier messages. */
- OFPT10_BARRIER_REQUEST, /* Controller/switch message */
- OFPT10_BARRIER_REPLY, /* Controller/switch message */
-
- /* Queue Configuration messages. */
- OFPT10_QUEUE_GET_CONFIG_REQUEST, /* Controller/switch message */
- OFPT10_QUEUE_GET_CONFIG_REPLY /* Controller/switch message */
-};
-
-/* Header on all OpenFlow packets. */
-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);
-
-/* OFPT_HELLO. This message has an empty body, but implementations must
- * ignore any data included in the body, to allow for future extensions. */
-struct ofp_hello {
- struct ofp_header header;
-};
-
-#define OFP_DEFAULT_MISS_SEND_LEN 128
-
-enum ofp_config_flags {
- /* Handling of IP fragments. */
- OFPC_FRAG_NORMAL = 0, /* No special handling for fragments. */
- OFPC_FRAG_DROP = 1, /* Drop fragments. */
- OFPC_FRAG_REASM = 2, /* Reassemble (only if OFPC_IP_REASM set). */
- OFPC_FRAG_NX_MATCH = 3, /* Make first fragments available for matching. */
- OFPC_FRAG_MASK = 3,
-
- /* TTL processing - applicable for IP and MPLS packets. */
- OFPC_INVALID_TTL_TO_CONTROLLER = 1 << 2, /* Send packets with invalid TTL
- to the controller. */
-};
-
-/* Switch configuration. */
-struct ofp_switch_config {
- struct ofp_header header;
- ovs_be16 flags; /* OFPC_* flags. */
- ovs_be16 miss_send_len; /* Max bytes of new flow that datapath should
- send to the controller. */
-};
-OFP_ASSERT(sizeof(struct ofp_switch_config) == 12);
-
-/* Capabilities supported by the datapath. */
-enum ofp_capabilities {
- OFPC_FLOW_STATS = 1 << 0, /* Flow statistics. */
- OFPC_TABLE_STATS = 1 << 1, /* Table statistics. */
- OFPC_PORT_STATS = 1 << 2, /* Port statistics. */
- OFPC_STP = 1 << 3, /* 802.1d spanning tree. */
- OFPC_RESERVED = 1 << 4, /* Reserved, must not be set. */
- OFPC_IP_REASM = 1 << 5, /* Can reassemble IP fragments. */
- OFPC_QUEUE_STATS = 1 << 6, /* Queue statistics. */
- OFPC_ARP_MATCH_IP = 1 << 7 /* Match IP addresses in ARP
- pkts. */
-};