In this patch we cover the basic registeration of OVS_PACKET_CMD_EXECUTE command handler.
Signed-off-by: Ankur Sharma <ankursha...@vmware.com> --- datapath-windows/ovsext/Datapath.c | 18 +++++++++++++----- datapath-windows/ovsext/User.c | 18 ++++++++++++++++++ datapath-windows/ovsext/User.h | 5 +++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 04b34e4..0456327 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -175,14 +175,22 @@ NETLINK_FAMILY nlDatapathFamilyOps = { }; /* Netlink packet family. */ -/* XXX: Add commands here. */ + +NETLINK_CMD nlPacketFamilyCmdOps[] = { + { .cmd = OVS_PACKET_CMD_EXECUTE, + .handler = OvsNlExecuteCmdHandler, + .supportedDevOp = OVS_TRANSACTION_DEV_OP, + .validateDpIndex = TRUE + } +}; + NETLINK_FAMILY nlPacketFamilyOps = { .name = OVS_PACKET_FAMILY, .id = OVS_WIN_NL_PACKET_FAMILY_ID, .version = OVS_PACKET_VERSION, .maxAttr = OVS_PACKET_ATTR_MAX, - .cmds = NULL, /* XXX: placeholder. */ - .opsCount = 0 + .cmds = nlPacketFamilyCmdOps, + .opsCount = ARRAY_SIZE(nlPacketFamilyCmdOps) }; /* Netlink vport family. */ @@ -772,8 +780,8 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject, nlFamilyOps = &nlFLowFamilyOps; break; case OVS_WIN_NL_PACKET_FAMILY_ID: - status = STATUS_NOT_IMPLEMENTED; - goto done; + nlFamilyOps = &nlPacketFamilyOps; + break; case OVS_WIN_NL_VPORT_FAMILY_ID: nlFamilyOps = &nlVportFamilyOps; break; diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c index 26cd431..1accb87 100644 --- a/datapath-windows/ovsext/User.c +++ b/datapath-windows/ovsext/User.c @@ -300,6 +300,24 @@ OvsAllocateNBLForUserBuffer(POVS_SWITCH_CONTEXT switchContext, return nbl; } +/* + *---------------------------------------------------------------------------- + * OvsNlExecuteCmdHandler -- + * Handler for OVS_PACKET_CMD_EXECUTE command. + *---------------------------------------------------------------------------- + */ +NTSTATUS +OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen) +{ + NTSTATUS rc = STATUS_SUCCESS; + + UNREFERENCED_PARAMETER(usrParamsCtx); + UNREFERENCED_PARAMETER(replyLen); + + return rc; +} + NTSTATUS OvsExecuteDpIoctl(PVOID inputBuffer, UINT32 inputLength, diff --git a/datapath-windows/ovsext/User.h b/datapath-windows/ovsext/User.h index ed41f14..cbe0e4e 100644 --- a/datapath-windows/ovsext/User.h +++ b/datapath-windows/ovsext/User.h @@ -21,6 +21,8 @@ #ifndef __USER_H_ #define __USER_H_ 1 +#include "Datapath.h" + /* * Even we have more cores, I don't think we need * more than 32 queues for processing packets to @@ -111,4 +113,7 @@ NTSTATUS OvsPurgeDpIoctl(PFILE_OBJECT fileObject); NTSTATUS OvsWaitDpIoctl(PIRP irp, PFILE_OBJECT fileObject); +NTSTATUS OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, + UINT32 *replyLen); + #endif /* __USER_H_ */ -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev