Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
openvswitch.h File Reference
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  ovs_header
 
struct  ovs_dp_stats
 
struct  ovs_vport_stats
 
struct  ovs_flow_stats
 
struct  ovs_key_ethernet
 
struct  ovs_key_ipv4
 
struct  ovs_key_ipv6
 
struct  ovs_key_tcp
 
struct  ovs_key_udp
 
struct  ovs_key_icmp
 
struct  ovs_key_icmpv6
 
struct  ovs_key_arp
 
struct  ovs_key_nd
 
struct  ovs_action_push_vlan
 

Macros

#define OVS_DATAPATH_FAMILY   "ovs_datapath"
 
#define OVS_DATAPATH_MCGROUP   "ovs_datapath"
 
#define OVS_DATAPATH_VERSION   0x1
 
#define OVS_DP_ATTR_MAX   (__OVS_DP_ATTR_MAX - 1)
 
#define OVSP_LOCAL   ((__u16)0)
 
#define OVS_PACKET_FAMILY   "ovs_packet"
 
#define OVS_PACKET_VERSION   0x1
 
#define OVS_PACKET_ATTR_MAX   (__OVS_PACKET_ATTR_MAX - 1)
 
#define OVS_VPORT_FAMILY   "ovs_vport"
 
#define OVS_VPORT_MCGROUP   "ovs_vport"
 
#define OVS_VPORT_VERSION   0x1
 
#define OVS_VPORT_TYPE_MAX   (__OVS_VPORT_TYPE_MAX - 1)
 
#define OVS_VPORT_ATTR_MAX   (__OVS_VPORT_ATTR_MAX - 1)
 
#define OVS_FLOW_FAMILY   "ovs_flow"
 
#define OVS_FLOW_MCGROUP   "ovs_flow"
 
#define OVS_FLOW_VERSION   0x1
 
#define OVS_KEY_ATTR_MAX   (__OVS_KEY_ATTR_MAX - 1)
 
#define OVS_FRAG_TYPE_MAX   (__OVS_FRAG_TYPE_MAX - 1)
 
#define OVS_FLOW_ATTR_MAX   (__OVS_FLOW_ATTR_MAX - 1)
 
#define OVS_SAMPLE_ATTR_MAX   (__OVS_SAMPLE_ATTR_MAX - 1)
 
#define OVS_USERSPACE_ATTR_MAX   (__OVS_USERSPACE_ATTR_MAX - 1)
 
#define OVS_ACTION_ATTR_MAX   (__OVS_ACTION_ATTR_MAX - 1)
 

Enumerations

enum  ovs_datapath_cmd {
  OVS_DP_CMD_UNSPEC, OVS_DP_CMD_NEW, OVS_DP_CMD_DEL, OVS_DP_CMD_GET,
  OVS_DP_CMD_SET
}
 
enum  ovs_datapath_attr {
  OVS_DP_ATTR_UNSPEC, OVS_DP_ATTR_NAME, OVS_DP_ATTR_UPCALL_PID, OVS_DP_ATTR_STATS,
  __OVS_DP_ATTR_MAX
}
 
enum  ovs_packet_cmd { OVS_PACKET_CMD_UNSPEC, OVS_PACKET_CMD_MISS, OVS_PACKET_CMD_ACTION, OVS_PACKET_CMD_EXECUTE }
 
enum  ovs_packet_attr {
  OVS_PACKET_ATTR_UNSPEC, OVS_PACKET_ATTR_PACKET, OVS_PACKET_ATTR_KEY, OVS_PACKET_ATTR_ACTIONS,
  OVS_PACKET_ATTR_USERDATA, __OVS_PACKET_ATTR_MAX
}
 
enum  ovs_vport_cmd {
  OVS_VPORT_CMD_UNSPEC, OVS_VPORT_CMD_NEW, OVS_VPORT_CMD_DEL, OVS_VPORT_CMD_GET,
  OVS_VPORT_CMD_SET
}
 
enum  ovs_vport_type { OVS_VPORT_TYPE_UNSPEC, OVS_VPORT_TYPE_NETDEV, OVS_VPORT_TYPE_INTERNAL, __OVS_VPORT_TYPE_MAX }
 
enum  ovs_vport_attr {
  OVS_VPORT_ATTR_UNSPEC, OVS_VPORT_ATTR_PORT_NO, OVS_VPORT_ATTR_TYPE, OVS_VPORT_ATTR_NAME,
  OVS_VPORT_ATTR_OPTIONS, OVS_VPORT_ATTR_UPCALL_PID, OVS_VPORT_ATTR_STATS, __OVS_VPORT_ATTR_MAX
}
 
enum  ovs_flow_cmd {
  OVS_FLOW_CMD_UNSPEC, OVS_FLOW_CMD_NEW, OVS_FLOW_CMD_DEL, OVS_FLOW_CMD_GET,
  OVS_FLOW_CMD_SET
}
 
enum  ovs_key_attr {
  OVS_KEY_ATTR_UNSPEC, OVS_KEY_ATTR_ENCAP, OVS_KEY_ATTR_PRIORITY, OVS_KEY_ATTR_IN_PORT,
  OVS_KEY_ATTR_ETHERNET, OVS_KEY_ATTR_VLAN, OVS_KEY_ATTR_ETHERTYPE, OVS_KEY_ATTR_IPV4,
  OVS_KEY_ATTR_IPV6, OVS_KEY_ATTR_TCP, OVS_KEY_ATTR_UDP, OVS_KEY_ATTR_ICMP,
  OVS_KEY_ATTR_ICMPV6, OVS_KEY_ATTR_ARP, OVS_KEY_ATTR_ND, __OVS_KEY_ATTR_MAX
}
 
enum  ovs_frag_type { OVS_FRAG_TYPE_NONE, OVS_FRAG_TYPE_FIRST, OVS_FRAG_TYPE_LATER, __OVS_FRAG_TYPE_MAX }
 
enum  ovs_flow_attr {
  OVS_FLOW_ATTR_UNSPEC, OVS_FLOW_ATTR_KEY, OVS_FLOW_ATTR_ACTIONS, OVS_FLOW_ATTR_STATS,
  OVS_FLOW_ATTR_TCP_FLAGS, OVS_FLOW_ATTR_USED, OVS_FLOW_ATTR_CLEAR, __OVS_FLOW_ATTR_MAX
}
 
enum  ovs_sample_attr { OVS_SAMPLE_ATTR_UNSPEC, OVS_SAMPLE_ATTR_PROBABILITY, OVS_SAMPLE_ATTR_ACTIONS, __OVS_SAMPLE_ATTR_MAX }
 
enum  ovs_userspace_attr { OVS_USERSPACE_ATTR_UNSPEC, OVS_USERSPACE_ATTR_PID, OVS_USERSPACE_ATTR_USERDATA, __OVS_USERSPACE_ATTR_MAX }
 
enum  ovs_action_attr {
  OVS_ACTION_ATTR_UNSPEC, OVS_ACTION_ATTR_OUTPUT, OVS_ACTION_ATTR_USERSPACE, OVS_ACTION_ATTR_SET,
  OVS_ACTION_ATTR_PUSH_VLAN, OVS_ACTION_ATTR_POP_VLAN, OVS_ACTION_ATTR_SAMPLE, __OVS_ACTION_ATTR_MAX
}
 

Macro Definition Documentation

#define OVS_ACTION_ATTR_MAX   (__OVS_ACTION_ATTR_MAX - 1)

Definition at line 450 of file openvswitch.h.

#define OVS_DATAPATH_FAMILY   "ovs_datapath"

Definition at line 39 of file openvswitch.h.

#define OVS_DATAPATH_MCGROUP   "ovs_datapath"

Definition at line 40 of file openvswitch.h.

#define OVS_DATAPATH_VERSION   0x1

Definition at line 41 of file openvswitch.h.

#define OVS_DP_ATTR_MAX   (__OVS_DP_ATTR_MAX - 1)

Definition at line 76 of file openvswitch.h.

#define OVS_FLOW_ATTR_MAX   (__OVS_FLOW_ATTR_MAX - 1)

Definition at line 364 of file openvswitch.h.

#define OVS_FLOW_FAMILY   "ovs_flow"

Definition at line 213 of file openvswitch.h.

#define OVS_FLOW_MCGROUP   "ovs_flow"

Definition at line 214 of file openvswitch.h.

#define OVS_FLOW_VERSION   0x1

Definition at line 215 of file openvswitch.h.

#define OVS_FRAG_TYPE_MAX   (__OVS_FRAG_TYPE_MAX - 1)

Definition at line 267 of file openvswitch.h.

#define OVS_KEY_ATTR_MAX   (__OVS_KEY_ATTR_MAX - 1)

Definition at line 249 of file openvswitch.h.

#define OVS_PACKET_ATTR_MAX   (__OVS_PACKET_ATTR_MAX - 1)

Definition at line 144 of file openvswitch.h.

#define OVS_PACKET_FAMILY   "ovs_packet"

Definition at line 101 of file openvswitch.h.

#define OVS_PACKET_VERSION   0x1

Definition at line 102 of file openvswitch.h.

#define OVS_SAMPLE_ATTR_MAX   (__OVS_SAMPLE_ATTR_MAX - 1)

Definition at line 385 of file openvswitch.h.

#define OVS_USERSPACE_ATTR_MAX   (__OVS_USERSPACE_ATTR_MAX - 1)

Definition at line 401 of file openvswitch.h.

#define OVS_VPORT_ATTR_MAX   (__OVS_VPORT_ATTR_MAX - 1)

Definition at line 209 of file openvswitch.h.

#define OVS_VPORT_FAMILY   "ovs_vport"

Definition at line 148 of file openvswitch.h.

#define OVS_VPORT_MCGROUP   "ovs_vport"

Definition at line 149 of file openvswitch.h.

#define OVS_VPORT_TYPE_MAX   (__OVS_VPORT_TYPE_MAX - 1)

Definition at line 167 of file openvswitch.h.

#define OVS_VPORT_VERSION   0x1

Definition at line 150 of file openvswitch.h.

#define OVSP_LOCAL   ((__u16)0)

Definition at line 97 of file openvswitch.h.

Enumeration Type Documentation

enum ovs_action_attr - Action types.

: Output packet to port. : Send packet to userspace according to nested OVS_USERSPACE_ATTR_* attributes. : Replaces the contents of an existing header. The single nested OVS_KEY_ATTR_* attribute specifies a header to modify and its value. : Push a new outermost 802.1Q header onto the packet. : Pop the outermost 802.1Q header off the packet. : Probabilitically executes actions, as specified in the nested OVS_SAMPLE_ATTR_* attributes.

Only a single header can be set with a single OVS_ACTION_ATTR_SET. Not all fields within a header are modifiable, e.g. the IPv4 protocol and fragment type may not be changed.

Enumerator:
OVS_ACTION_ATTR_UNSPEC 
OVS_ACTION_ATTR_OUTPUT 
OVS_ACTION_ATTR_USERSPACE 
OVS_ACTION_ATTR_SET 
OVS_ACTION_ATTR_PUSH_VLAN 
OVS_ACTION_ATTR_POP_VLAN 
OVS_ACTION_ATTR_SAMPLE 
__OVS_ACTION_ATTR_MAX 

Definition at line 439 of file openvswitch.h.

enum ovs_datapath_attr - attributes for OVS_DP_* commands. : Name of the network device that serves as the "local port". This is the name of the network device whose dp_ifindex is given in the &struct ovs_header. Always present in notifications. Required in OVS_DP_NEW requests. May be used as an alternative to specifying dp_ifindex in other requests (with a dp_ifindex of 0). : The Netlink socket in userspace that is initially set on the datapath port (for OVS_ACTION_ATTR_MISS). Only valid on OVS_DP_CMD_NEW requests. A value of zero indicates that upcalls should not be sent. : Statistics about packets that have passed through the datapath. Always present in notifications.

These attributes follow the &struct ovs_header within the Generic Netlink payload for OVS_DP_* commands.

Enumerator:
OVS_DP_ATTR_UNSPEC 
OVS_DP_ATTR_NAME 
OVS_DP_ATTR_UPCALL_PID 
OVS_DP_ATTR_STATS 
__OVS_DP_ATTR_MAX 

Definition at line 68 of file openvswitch.h.

Enumerator:
OVS_DP_CMD_UNSPEC 
OVS_DP_CMD_NEW 
OVS_DP_CMD_DEL 
OVS_DP_CMD_GET 
OVS_DP_CMD_SET 

Definition at line 43 of file openvswitch.h.

enum ovs_flow_attr - attributes for OVS_FLOW_* commands. : Nested OVS_KEY_ATTR_* attributes specifying the flow key. Always present in notifications. Required for all requests (except dumps). : Nested OVS_ACTION_ATTR_* attributes specifying the actions to take for packets that match the key. Always present in notifications. Required for OVS_FLOW_CMD_NEW requests, optional for OVS_FLOW_CMD_SET requests. : &struct ovs_flow_stats giving statistics for this flow. Present in notifications if the stats would be nonzero. Ignored in requests. : An 8-bit value giving the OR'd value of all of the TCP flags seen on packets in this flow. Only present in notifications for TCP flows, and only if it would be nonzero. Ignored in requests. : A 64-bit integer giving the time, in milliseconds on the system monotonic clock, at which a packet was last processed for this flow. Only present in notifications if a packet has been processed for this flow. Ignored in requests. : If present in a OVS_FLOW_CMD_SET request, clears the last-used time, accumulated TCP flags, and statistics for this flow. Otherwise ignored in requests. Never present in notifications.

These attributes follow the &struct ovs_header within the Generic Netlink payload for OVS_FLOW_* commands.

Enumerator:
OVS_FLOW_ATTR_UNSPEC 
OVS_FLOW_ATTR_KEY 
OVS_FLOW_ATTR_ACTIONS 
OVS_FLOW_ATTR_STATS 
OVS_FLOW_ATTR_TCP_FLAGS 
OVS_FLOW_ATTR_USED 
OVS_FLOW_ATTR_CLEAR 
__OVS_FLOW_ATTR_MAX 

Definition at line 353 of file openvswitch.h.

Enumerator:
OVS_FLOW_CMD_UNSPEC 
OVS_FLOW_CMD_NEW 
OVS_FLOW_CMD_DEL 
OVS_FLOW_CMD_GET 
OVS_FLOW_CMD_SET 

Definition at line 217 of file openvswitch.h.

enum ovs_frag_type - IPv4 and IPv6 fragment type : Packet is not a fragment. : Packet is a fragment with offset 0. : Packet is a fragment with nonzero offset.

Used as the in &struct ovs_key_ipv4 and as &struct ovs_key_ipv6.

Enumerator:
OVS_FRAG_TYPE_NONE 
OVS_FRAG_TYPE_FIRST 
OVS_FRAG_TYPE_LATER 
__OVS_FRAG_TYPE_MAX 

Definition at line 260 of file openvswitch.h.

Enumerator:
OVS_KEY_ATTR_UNSPEC 
OVS_KEY_ATTR_ENCAP 
OVS_KEY_ATTR_PRIORITY 
OVS_KEY_ATTR_IN_PORT 
OVS_KEY_ATTR_ETHERNET 
OVS_KEY_ATTR_VLAN 
OVS_KEY_ATTR_ETHERTYPE 
OVS_KEY_ATTR_IPV4 
OVS_KEY_ATTR_IPV6 
OVS_KEY_ATTR_TCP 
OVS_KEY_ATTR_UDP 
OVS_KEY_ATTR_ICMP 
OVS_KEY_ATTR_ICMPV6 
OVS_KEY_ATTR_ARP 
OVS_KEY_ATTR_ND 
__OVS_KEY_ATTR_MAX 

Definition at line 230 of file openvswitch.h.

enum ovs_packet_attr - attributes for OVS_PACKET_* commands. : Present for all notifications. Contains the entire packet as received, from the start of the Ethernet header onward. For OVS_PACKET_CMD_ACTION, OVS_PACKET_ATTR_PACKET reflects changes made by actions preceding OVS_ACTION_ATTR_USERSPACE, but OVS_PACKET_ATTR_KEY is the flow key extracted from the packet as originally received. : Present for all notifications. Contains the flow key extracted from the packet as nested OVS_KEY_ATTR_* attributes. This allows userspace to adapt its flow setup strategy by comparing its notion of the flow key against the kernel's. : Contains actions for the packet. Used for OVS_PACKET_CMD_EXECUTE. It has nested OVS_ACTION_ATTR_* attributes. : Present for an OVS_PACKET_CMD_ACTION notification if the OVS_ACTION_ATTR_USERSPACE action specified an OVS_USERSPACE_ATTR_USERDATA attribute.

These attributes follow the &struct ovs_header within the Generic Netlink payload for OVS_PACKET_* commands.

Enumerator:
OVS_PACKET_ATTR_UNSPEC 
OVS_PACKET_ATTR_PACKET 
OVS_PACKET_ATTR_KEY 
OVS_PACKET_ATTR_ACTIONS 
OVS_PACKET_ATTR_USERDATA 
__OVS_PACKET_ATTR_MAX 

Definition at line 135 of file openvswitch.h.

Enumerator:
OVS_PACKET_CMD_UNSPEC 
OVS_PACKET_CMD_MISS 
OVS_PACKET_CMD_ACTION 
OVS_PACKET_CMD_EXECUTE 

Definition at line 104 of file openvswitch.h.

enum ovs_sample_attr - Attributes for OVS_ACTION_ATTR_SAMPLE action. : 32-bit fraction of packets to sample with . A value of 0 samples no packets, a value of UINT32_MAX samples all packets and intermediate values sample intermediate fractions of packets. : Set of actions to execute in sampling event. Actions are passed as nested attributes.

Executes the specified actions with the given probability on a per-packet basis.

Enumerator:
OVS_SAMPLE_ATTR_UNSPEC 
OVS_SAMPLE_ATTR_PROBABILITY 
OVS_SAMPLE_ATTR_ACTIONS 
__OVS_SAMPLE_ATTR_MAX 

Definition at line 378 of file openvswitch.h.

enum ovs_userspace_attr - Attributes for OVS_ACTION_ATTR_USERSPACE action. : u32 Netlink PID to which the OVS_PACKET_CMD_ACTION message should be sent. Required. : If present, its u64 argument is copied to the OVS_PACKET_CMD_ACTION message as OVS_PACKET_ATTR_USERDATA,

Enumerator:
OVS_USERSPACE_ATTR_UNSPEC 
OVS_USERSPACE_ATTR_PID 
OVS_USERSPACE_ATTR_USERDATA 
__OVS_USERSPACE_ATTR_MAX 

Definition at line 394 of file openvswitch.h.

enum ovs_vport_attr - attributes for OVS_VPORT_* commands. : 32-bit port number within datapath. : 32-bit OVS_VPORT_TYPE_* constant describing the type of vport. : Name of vport. For a vport based on a network device this is the name of the network device. Maximum length IFNAMSIZ-1 bytes plus a null terminator. : Vport-specific configuration information. : The Netlink socket in userspace that OVS_PACKET_CMD_MISS upcalls will be directed to for packets received on this port. A value of zero indicates that upcalls should not be sent. : A &struct ovs_vport_stats giving statistics for packets sent or received through the vport.

These attributes follow the &struct ovs_header within the Generic Netlink payload for OVS_VPORT_* commands.

For OVS_VPORT_CMD_NEW requests, the OVS_VPORT_ATTR_TYPE and OVS_VPORT_ATTR_NAME attributes are required. OVS_VPORT_ATTR_PORT_NO is optional; if not specified a free port number is automatically selected. Whether OVS_VPORT_ATTR_OPTIONS is required or optional depends on the type of vport. and other attributes are ignored.

For other requests, if OVS_VPORT_ATTR_NAME is specified then it is used to look up the vport to operate on; otherwise dp_idx from the &struct ovs_header plus OVS_VPORT_ATTR_PORT_NO determine the vport.

Enumerator:
OVS_VPORT_ATTR_UNSPEC 
OVS_VPORT_ATTR_PORT_NO 
OVS_VPORT_ATTR_TYPE 
OVS_VPORT_ATTR_NAME 
OVS_VPORT_ATTR_OPTIONS 
OVS_VPORT_ATTR_UPCALL_PID 
OVS_VPORT_ATTR_STATS 
__OVS_VPORT_ATTR_MAX 

Definition at line 198 of file openvswitch.h.

Enumerator:
OVS_VPORT_CMD_UNSPEC 
OVS_VPORT_CMD_NEW 
OVS_VPORT_CMD_DEL 
OVS_VPORT_CMD_GET 
OVS_VPORT_CMD_SET 

Definition at line 152 of file openvswitch.h.

Enumerator:
OVS_VPORT_TYPE_UNSPEC 
OVS_VPORT_TYPE_NETDEV 
OVS_VPORT_TYPE_INTERNAL 
__OVS_VPORT_TYPE_MAX 

Definition at line 160 of file openvswitch.h.