示例#1
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockWrite(
    PVM_SOCKET              pSocket,
    const struct sockaddr*  pClientAddress,
    socklen_t               addrLength,
    PVM_SOCK_IO_BUFFER      pIoBuffer
)
{
    DWORD dwError = 0;

    if (!pSocket || !pIoBuffer)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnWrite(
                            pSocket,
                            pClientAddress,
                            addrLength,
                            pIoBuffer);
    BAIL_ON_VMSOCK_ERROR(dwError);

error:

    return dwError;
}
示例#2
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockAllocateIoBuffer(
    VM_SOCK_EVENT_TYPE          eventType,
    PVM_SOCK_EVENT_CONTEXT      pEventContext,
    DWORD                       dwSize,
    PVM_SOCK_IO_BUFFER*         ppIoBuffer
    )
{
    DWORD dwError = 0;

    if (!ppIoBuffer)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnAllocateIoBuffer(
                                                  eventType,
                                                  pEventContext,
                                                  dwSize,
                                                  ppIoBuffer
                                                  );
    BAIL_ON_VMSOCK_ERROR(dwError);

error:

    return dwError;
}
示例#3
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockGetEventContext(
    PVM_SOCK_IO_BUFFER      pIoBuffer,
    PVM_SOCK_EVENT_CONTEXT* ppEventContext
    )
{
    DWORD dwError = 0;

    if (!pIoBuffer || !ppEventContext)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnGetEventContext(pIoBuffer, ppEventContext);
    BAIL_ON_VMSOCK_ERROR(dwError);

cleanup:

    return dwError;
error:

    if (ppEventContext)
    {
        *ppEventContext = NULL;
    }
    goto cleanup;
}
示例#4
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockOpenClient(
    PCSTR                pszHost,
    USHORT               usPort,
    VM_SOCK_CREATE_FLAGS dwFlags,
    DWORD                dwTimeoutMS,
    PVM_SOCKET*          ppSocket
    )
{
    DWORD dwError = 0;

    if (!pszHost || !usPort || !ppSocket )
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnOpenClientSocket(
                                    pszHost,
                                    usPort,
                                    dwFlags,
                                    dwTimeoutMS,
                                    ppSocket);

error:

    return dwError;
}
示例#5
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockWaitForEvent(
    PVM_SOCK_EVENT_QUEUE pQueue,
    int                  iTimeoutMS,
    PVM_SOCKET*          ppSocket,
    PVM_SOCK_EVENT_TYPE  pEventType,
    PVM_SOCK_IO_BUFFER*  ppIoEvent
    )
{
    DWORD dwError = 0;

    if (!pQueue || !ppSocket || !pEventType)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnWaitForEvent(
                                    pQueue,
                                    iTimeoutMS,
                                    ppSocket,
                                    pEventType,
                                    ppIoEvent
                                    );

error:

    return dwError;
}
示例#6
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockOpenServer(
    USHORT               usPort,
    int                  iListenQueueSize,
    VM_SOCK_CREATE_FLAGS dwFlags,
    PVM_SOCKET*          ppSocket
    )
{
    DWORD dwError = 0;

    if (!usPort || !ppSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnOpenServerSocket(
                                    usPort,
                                    iListenQueueSize,
                                    dwFlags,
                                    ppSocket);
error:

    return dwError;
}
示例#7
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockClose(
    PVM_SOCKET pSocket
    )
{
    DWORD dwError = 0;

    if (!pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnCloseSocket(pSocket);
    BAIL_ON_VMSOCK_ERROR(dwError);

error:

    return dwError;
}
示例#8
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockStartListening(
    PVM_SOCKET           pSocket,
    int                  iListenQueueSize
    )
{
    DWORD dwError = 0;

    if (!pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnStartListening(pSocket, iListenQueueSize);
    BAIL_ON_VMSOCK_ERROR(dwError);

error:

    return dwError;
}
示例#9
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockGetAddress(
    PVM_SOCKET                  pSocket,
    struct sockaddr_storage*    pAddress,
    socklen_t*                  addresLen
    )
{
    DWORD dwError = 0;

    if (!pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnGetAddress(pSocket, pAddress, addresLen);
    BAIL_ON_VMSOCK_ERROR(dwError);

error:

    return dwError;
}
示例#10
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockReleaseIoBuffer(
    PVM_SOCK_IO_BUFFER  pIoBuffer
    )
{
    DWORD dwError = 0;

    if (!pIoBuffer)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    gpVmDnsSockPackage->pfnReleaseIoBuffer(pIoBuffer);

error:

    return dwError;
}
示例#11
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockSetNonBlocking(
    PVM_SOCKET pSocket
    )
{
    DWORD dwError = 0;

    if (!pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnSetNonBlocking(pSocket);

error:

    return dwError;
}
示例#12
0
文件: api.c 项目: numberer6/lightwave
DWORD
VmwSockEventQueueAdd(
    PVM_SOCK_EVENT_QUEUE pQueue,
    PVM_SOCKET           pSocket
    )
{
    DWORD dwError = 0;

    if (!pQueue || !pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmSockPackage->pfnAddEventQueue(pQueue, pSocket);

error:

    return dwError;
}
示例#13
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockGetData(
    PVM_SOCKET          pSocket,
    PVOID*              ppData
    )
{
    DWORD dwError = 0;

    if (!pSocket || !ppData)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnGetData(pSocket, ppData);

error:

    return dwError;
}
示例#14
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockGetProtocol(
    PVM_SOCKET           pSocket,
    PDWORD               pdwProtocol
    )
{
    DWORD dwError = 0;

    if (!pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnGetProtocol(pSocket, pdwProtocol);

error:

    return dwError;
}
示例#15
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockCreateEventQueue(
    int                   iEventQueueSize,  /*         OPTIONAL */
    PVM_SOCK_EVENT_QUEUE* ppQueue           /*     OUT          */
    )
{
    DWORD dwError = 0;

    if (!iEventQueueSize || !ppQueue)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnCreateEventQueue(iEventQueueSize, ppQueue);

error:

    return dwError;
}
示例#16
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockEventQueueRearm(
    PVM_SOCK_EVENT_QUEUE pQueue,
    BOOL                 bOneShot,
    PVM_SOCKET           pSocket
    )
{
    DWORD dwError = 0;

    if (!pQueue || !pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnRearmEventQueue(pQueue, bOneShot, pSocket);

error:

    return dwError;
}
示例#17
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockEventQueueRemove(
    PVM_SOCK_EVENT_QUEUE pQueue,
    PVM_SOCKET           pSocket
    )
{
    DWORD dwError = 0;

#ifndef WIN32
    if (!pQueue || !pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnRemoveEventQueue(pQueue, pSocket);
#endif

error:
    return dwError;
}
示例#18
0
文件: api.c 项目: numberer6/lightwave
DWORD
VmwSockSetData(
    PVM_SOCKET           pSocket,
    PVOID                pData,
    PVOID*               ppOldData
    )
{
    DWORD dwError = 0;

    if (!pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmSockPackage->pfnSetData(pSocket, pData, ppOldData);

error:

    return dwError;
}
示例#19
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockCreateTimerSocket(
    DWORD       dwInitialMS,
    DWORD       dwIntervalMS,
    PVM_SOCKET* ppSocket
    )
{
    DWORD dwError = 0;

    if (!ppSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    gpVmDnsSockPackage->pfnCreateTimerSocket(dwInitialMS, dwIntervalMS, ppSocket);

error:

    return dwError;
}
示例#20
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockRead(
    PVM_SOCKET          pSocket,
    PVM_SOCK_IO_BUFFER  pIoBuffer
    )
{
    DWORD dwError = 0;

    if (!pSocket || !pIoBuffer)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    dwError = gpVmDnsSockPackage->pfnRead(
                            pSocket,
                            pIoBuffer);

error:

    return dwError;
}
示例#21
0
文件: api.c 项目: vmware/lightwave
DWORD
VmDnsSockSetTimeOut(
    PVM_SOCKET pSocket,
    DWORD      dwTimeOut
    )
{
    DWORD dwError = 0;

    if (!pSocket)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMSOCK_ERROR(dwError);
    }

    if (dwTimeOut)
    {
        dwError = gpVmDnsSockPackage->pfnSetTimeOut(pSocket, dwTimeOut);
    }

error:

    return dwError;
}