Class CInterfaces::
GetInterfaces()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: GetFlagsNext page: GetMask    Show member index
Public Function Declared in:
Interfaces.h

'Declaration' icon -- Shortcut to top of page. Declaration

BOOL GetInterfaces();

'Description' icon -- Shortcut to top of page. Description

Retreive the list of all the interfaces

'Function Body' icon -- Shortcut to top of page. Function Body

if (!m_iMaxInterfaces)
{
    //structure not allocated
    ReportError("GetInterfaces","You constructed the class with 0 parameter!");
    return FALSE;
}

try
{
    //Allocate a socket
    SOCKET sok;
    sok=socket(AF_INET,SOCK_DGRAM,0);

    //Check it's valid
    if (sok==INVALID_SOCKET)
    {
        SetLastError("GetInterfaces");
        return FALSE;
    }

    //Get the interface list
    unsigned long ulBytes;
    if (WSAIoctl(sok,SIO_GET_INTERFACE_LIST,NULL,NULL,m_pInfo,
                 sizeof(INTERFACE_INFO)*m_iMaxInterfaces,&ulBytes,NULL,NULL))
    {
        SetLastError("GetInterfaces");

        //Close the socket
        closesocket(sok);

        return FALSE;
    }

    //Check how many structures we have
    m_iStructures=ulBytes/sizeof(INTERFACE_INFO);

    //Set our position to zero
    m_iPosition=0;

    //Close the socket
    closesocket(sok);

    return TRUE;
}
ERROR_HANDLER_RETURN("GetInterfaces",FALSE)

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CSpoofBase  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 27 Jun 2001.