Skip to content

Commit

Permalink
datapath-windows: Add stub handlers for netdev commands
Browse files Browse the repository at this point in the history
In this patch, we add stub handlers for the netdev commands.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
nithinrajub authored and blp committed Oct 6, 2014
1 parent 3e648bc commit 2b144cb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
27 changes: 25 additions & 2 deletions datapath-windows/ovsext/Datapath.c
Expand Up @@ -87,13 +87,15 @@ typedef struct _NETLINK_FAMILY {

/* Handlers for the various netlink commands. */
static NetlinkCmdHandler OvsGetPidCmdHandler,
OvsGetDpCmdHandler,
OvsPendEventCmdHandler,
OvsSubscribeEventCmdHandler,
OvsSetDpCmdHandler,
OvsReadEventCmdHandler,
OvsGetDpCmdHandler,
OvsSetDpCmdHandler,
OvsGetVportCmdHandler;

NetlinkCmdHandler OvsGetNetdevCmdHandler;

static NTSTATUS HandleGetDpTransaction(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
UINT32 *replyLen);
static NTSTATUS HandleGetDpDump(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
Expand Down Expand Up @@ -231,6 +233,24 @@ NETLINK_FAMILY nlFLowFamilyOps = {
.opsCount = ARRAY_SIZE(nlFlowFamilyCmdOps)
};

/* Netlink netdev family. */
NETLINK_CMD nlNetdevFamilyCmdOps[] = {
{ .cmd = OVS_WIN_NETDEV_CMD_GET,
.handler = OvsGetNetdevCmdHandler,
.supportedDevOp = OVS_TRANSACTION_DEV_OP,
.validateDpIndex = FALSE
},
};

NETLINK_FAMILY nlNetdevFamilyOps = {
.name = OVS_WIN_NETDEV_FAMILY,
.id = OVS_WIN_NL_NETDEV_FAMILY_ID,
.version = OVS_WIN_NETDEV_VERSION,
.maxAttr = OVS_WIN_NETDEV_ATTR_MAX,
.cmds = nlNetdevFamilyCmdOps,
.opsCount = ARRAY_SIZE(nlNetdevFamilyCmdOps)
};

static NTSTATUS MapIrpOutputBuffer(PIRP irp,
UINT32 bufferLength,
UINT32 requiredLength,
Expand Down Expand Up @@ -751,6 +771,9 @@ OvsDeviceControl(PDEVICE_OBJECT deviceObject,
case OVS_WIN_NL_VPORT_FAMILY_ID:
nlFamilyOps = &nlVportFamilyOps;
break;
case OVS_WIN_NL_NETDEV_FAMILY_ID:
nlFamilyOps = &nlNetdevFamilyOps;
break;
default:
status = STATUS_INVALID_PARAMETER;
goto done;
Expand Down
14 changes: 14 additions & 0 deletions datapath-windows/ovsext/Vport.c
Expand Up @@ -23,6 +23,7 @@
#include "Vxlan.h"
#include "IpHelper.h"
#include "Oid.h"
#include "Datapath.h"

#ifdef OVS_DBG_MOD
#undef OVS_DBG_MOD
Expand Down Expand Up @@ -1402,6 +1403,19 @@ OvsGetExtInfoIoctl(PVOID inputBuffer,
*replyLen, status);
return status;
}
/*
* --------------------------------------------------------------------------
* Command Handler for 'OVS_WIN_NETDEV_CMD_GET'.
* --------------------------------------------------------------------------
*/
NTSTATUS
OvsGetNetdevCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
UINT32 *replyLen)
{
UNREFERENCED_PARAMETER(usrParamsCtx);
UNREFERENCED_PARAMETER(replyLen);
return STATUS_NOT_IMPLEMENTED;
}


static __inline VOID
Expand Down

0 comments on commit 2b144cb

Please sign in to comment.