summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Datapath.h
diff options
context:
space:
mode:
authorNithin Raju <nithin@vmware.com>2014-08-19 13:51:53 -0700
committerBen Pfaff <blp@nicira.com>2014-08-19 14:28:21 -0700
commit3b89ffba9cee84a12462f7374904f963d4d45aa8 (patch)
tree1aaba368db5b539566d6785ddbf05d0b8674c138 /datapath-windows/ovsext/Datapath.h
parent4f3988e0f6e3efcb418a3ba9de433970a64bfca4 (diff)
downloadopenvswitch-3b89ffba9cee84a12462f7374904f963d4d45aa8.tar.gz
datapath-windows: add infrastructure for supporting netlink
In this change, we define netlink families and commands supported by the Windows datapath. Only the control family and one command is supported today to get the PID. We also implement the 3 ioctls: read, write and transact. This is bare minimum and can be used to implement the equivalent of a recv, send, and send-recv in userspace netlink. This interface is subject to change as iron out the details of the user-kernel interface for operations around packet receive, events, dump, etc. We also turn on OVS_USE_NL_INTERFACE to 1 in the ovsext project. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com> Acked-by: Ankur Sharma <ankursharma@vmware.com> Acked-by: Saurabh Shah <ssaurabh@vmware.com> Reported-at: https://github.com/openvswitch/ovs-issues/issues/18 Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Datapath.h')
-rw-r--r--datapath-windows/ovsext/Datapath.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/datapath-windows/ovsext/Datapath.h b/datapath-windows/ovsext/Datapath.h
index b68010bcf..2bea0fd2c 100644
--- a/datapath-windows/ovsext/Datapath.h
+++ b/datapath-windows/ovsext/Datapath.h
@@ -42,6 +42,21 @@ typedef struct _OVS_OPEN_INSTANCE {
PFILE_OBJECT fileObject;
PVOID eventQueue;
PVOID packetQueue;
+ UINT32 pid;
+
+ /*
+ * On platforms that support netlink natively, there's generally some form of
+ * serialization between concurrent calls to netlink sockets. However, OVS
+ * userspace guarantees that a given netlink handle is not concurrently used.
+ * Despite this, we do want to have some basic checks in the kernel to make
+ * sure that things don't break if there are concurrent calls.
+ *
+ * This is generally not an issue since kernel data structure access should
+ * be sychronized anyway. Only reason to have this safeguared is to protect
+ * the state in "state-aware" read calls which rely on previous state. This
+ * restriction might go away as the userspace code gets implemented.
+ */
+ INT inUse;
} OVS_OPEN_INSTANCE, *POVS_OPEN_INSTANCE;
NDIS_STATUS OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle);
@@ -52,6 +67,16 @@ POVS_OPEN_INSTANCE OvsGetOpenInstance(PFILE_OBJECT fileObject,
NTSTATUS OvsCompleteIrpRequest(PIRP irp, ULONG_PTR infoPtr, NTSTATUS status);
+/*
+ * Structure of any message passed between userspace and kernel.
+ */
+typedef struct _OVS_MESSAGE {
+ struct nlmsghdr nlMsg;
+ struct genlmsghdr genlMsg;
+ struct ovs_header ovsHdr;
+ /* Variable length nl_attrs follow. */
+} OVS_MESSAGE, *POVS_MESSAGE;
+
#endif /* __OVS_DATAPATH_H_ */
#endif /* OVS_USE_NL_INTERFACE */