diff options
author | Nithin Raju <nithin@vmware.com> | 2014-08-19 13:51:52 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2014-08-19 14:23:17 -0700 |
commit | 4f3988e0f6e3efcb418a3ba9de433970a64bfca4 (patch) | |
tree | 72a0e59cc168e9f910a92f50ff3fc35fa3bbceb8 /datapath-windows/ovsext/Datapath.h | |
parent | 107331906b32c606eddd3e0fc42b42d0a3bc7372 (diff) | |
download | openvswitch-4f3988e0f6e3efcb418a3ba9de433970a64bfca4.tar.gz |
datapath-windows: Add Datapath.[ch] and OVS_USE_NL_INTERFACE CPP
In this change we create peer to OvsIoctl.[ch] that would interface
with userspace using the netlink interface. The new files are called
Datapath.[ch]. We are not deleting OvsIoctl.[ch] yet. Datapath.[ch]
provides bare minimum functionality to register a pseudo device for
communication with userspace.
We also define a CPP called OVS_USE_NL_INTERFACE in the ovsext project.
This defines if the old interface (pre-netlink based) or the new
interface (netlink- based) should be enabled in the kernel. By default,
the value is 0 since the Datapath.[ch] are minimal. In the next change,
we'll turn it to 1.
Since Datapath.[ch] containes code copied from OvsIoctl.[ch], acking
the original author as well.
Signed-off-by: Nithin Raju <nithin@vmware.com>
Co-authored-by: Guolin Yang <gyang@vmware.com>
Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Saurabh Shah <ssaurabh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Datapath.h')
-rw-r--r-- | datapath-windows/ovsext/Datapath.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Datapath.h b/datapath-windows/ovsext/Datapath.h new file mode 100644 index 000000000..b68010bcf --- /dev/null +++ b/datapath-windows/ovsext/Datapath.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2014 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * XXX: OVS_USE_NL_INTERFACE is being used to keep the legacy DPIF interface + * alive while we transition over to the netlink based interface. + * OVS_USE_NL_INTERFACE = 0 => legacy inteface to use with dpif-windows.c + * OVS_USE_NL_INTERFACE = 1 => netlink inteface to use with ported dpif-linux.c + */ +#if defined OVS_USE_NL_INTERFACE && OVS_USE_NL_INTERFACE == 0 +#include "OvsIoctl.h" + +#else + +#ifndef __OVS_DATAPATH_H_ +#define __OVS_DATAPATH_H_ 1 + +typedef struct _OVS_DEVICE_EXTENSION { + INT numberOpenInstance; + INT pidCount; +} OVS_DEVICE_EXTENSION, *POVS_DEVICE_EXTENSION; + + +/* + * Private context for each handle on the device. + */ +typedef struct _OVS_OPEN_INSTANCE { + UINT32 cookie; + PFILE_OBJECT fileObject; + PVOID eventQueue; + PVOID packetQueue; +} OVS_OPEN_INSTANCE, *POVS_OPEN_INSTANCE; + +NDIS_STATUS OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle); +VOID OvsDeleteDeviceObject(); + +POVS_OPEN_INSTANCE OvsGetOpenInstance(PFILE_OBJECT fileObject, + UINT32 dpNo); + +NTSTATUS OvsCompleteIrpRequest(PIRP irp, ULONG_PTR infoPtr, NTSTATUS status); + +#endif /* __OVS_DATAPATH_H_ */ + +#endif /* OVS_USE_NL_INTERFACE */ |