2 * Copyright (c) 2014 VMware, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __OVS_DP_INTERFACE_EXT_H_
18 #define __OVS_DP_INTERFACE_EXT_H_ 1
20 /* Windows kernel datapath extensions to the standard datapath interface. */
22 /* Version number of the datapath interface extensions. */
23 #define OVS_DATAPATH_EXT_VERSION 1
25 /* Name of the device. */
26 #define OVS_DEVICE_NAME_NT L"\\Device\\OpenvSwitchDevice"
27 #define OVS_DEVICE_NAME_DOS L"\\DosDevices\\OpenvSwitchDevice"
28 #define OVS_DEVICE_NAME_USER TEXT("\\\\.\\OpenvSwitchDevice")
30 #define OVS_IOCTL_DEVICE_TYPE 45000
32 /* We used Direct I/O (zero copy) for the buffers. */
33 #define OVS_IOCTL_START 0x100
34 #define OVS_IOCTL_READ \
35 CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x0, METHOD_OUT_DIRECT,\
37 #define OVS_IOCTL_READ_EVENT \
38 CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x1, METHOD_OUT_DIRECT, \
40 #define OVS_IOCTL_READ_PACKET \
41 CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x2, METHOD_OUT_DIRECT, \
43 #define OVS_IOCTL_WRITE \
44 CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x3, METHOD_IN_DIRECT,\
46 #define OVS_IOCTL_TRANSACT \
47 CTL_CODE (OVS_IOCTL_DEVICE_TYPE, OVS_IOCTL_START + 0x4, METHOD_OUT_DIRECT,\
51 * On platforms that support netlink natively, the operating system assigns a
52 * dynamic value to a netlink family when it is registered. In the absense of
53 * such mechanism, defined hard-coded values that are known both to userspace
56 #define OVS_WIN_NL_INVALID_FAMILY_ID 0
57 #define OVS_WIN_NL_CTRL_FAMILY_ID (NLMSG_MIN_TYPE + 1)
58 #define OVS_WIN_NL_DATAPATH_FAMILY_ID (NLMSG_MIN_TYPE + 2)
59 #define OVS_WIN_NL_PACKET_FAMILY_ID (NLMSG_MIN_TYPE + 3)
60 #define OVS_WIN_NL_VPORT_FAMILY_ID (NLMSG_MIN_TYPE + 4)
61 #define OVS_WIN_NL_FLOW_FAMILY_ID (NLMSG_MIN_TYPE + 5)
63 #define OVS_WIN_NL_INVALID_MCGRP_ID 0
64 #define OVS_WIN_NL_MCGRP_START_ID 100
65 #define OVS_WIN_NL_VPORT_MCGRP_ID (OVS_WIN_NL_MCGRP_START_ID + 1)
68 * Define a family of netlink command specific to Windows. This is part of the
71 #define OVS_WIN_CONTROL_FAMILY "ovs_win_control"
72 #define OVS_WIN_CONTROL_MCGROUP "ovs_win_control"
73 #define OVS_WIN_CONTROL_VERSION 1
74 #define OVS_WIN_CONTROL_ATTR_MAX (__OVS_FLOW_ATTR_MAX - 1)
76 /* Commands available under the OVS_WIN_CONTROL_FAMILY. */
77 enum ovs_win_control_cmd {
78 OVS_CTRL_CMD_WIN_GET_PID,
79 OVS_CTRL_CMD_WIN_PEND_REQ,
80 OVS_CTRL_CMD_MC_SUBSCRIBE_REQ,
82 /* This command is logically belong to the Vport family */
83 OVS_CTRL_CMD_EVENT_NOTIFY
86 /* NL Attributes for joining/unjoining an MC group */
87 enum ovs_nl_mcast_attr {
88 OVS_NL_ATTR_MCAST_GRP, /* (UINT32) Join an MC group */
89 OVS_NL_ATTR_MCAST_JOIN, /* (UINT8) 1/0 - Join/Unjoin */
92 typedef struct ovs_dp_stats OVS_DP_STATS;
93 typedef enum ovs_vport_type OVS_VPORT_TYPE;
95 #endif /* __OVS_DP_INTERFACE_EXT_H_ */