ReactOS  0.4.14-dev-599-g2d4d3f5
ifenum.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _InterfaceIndexTable
 

Macros

#define MAX_INTERFACE_PHYSADDR   8
 
#define MAX_INTERFACE_DESCRIPTION   256
 

Typedefs

typedef struct _InterfaceIndexTable InterfaceIndexTable
 

Functions

void interfaceMapInit (void)
 
void interfaceMapFree (void)
 
DWORD getNumInterfaces (void)
 
DWORD getNumNonLoopbackInterfaces (void)
 
InterfaceIndexTablegetInterfaceIndexTable (void)
 
InterfaceIndexTablegetNonLoopbackInterfaceIndexTable (void)
 
const chargetInterfaceNameByIndex (DWORD index)
 
void consumeInterfaceName (const char *ifname)
 
DWORD getInterfaceIndexByName (const char *name, PDWORD index)
 
DWORD getInterfaceIPAddrByName (const char *name)
 
DWORD getInterfaceIPAddrByIndex (DWORD index)
 
DWORD getInterfaceMaskByName (const char *name)
 
DWORD getInterfaceMaskByIndex (DWORD index)
 
DWORD getInterfaceBCastAddrByName (const char *name)
 
DWORD getInterfaceBCastAddrByIndex (DWORD index)
 
DWORD getInterfacePhysicalByName (const char *name, PDWORD len, PBYTE addr, PDWORD type)
 
DWORD getInterfacePhysicalByIndex (DWORD index, PDWORD len, PBYTE addr, PDWORD type)
 
DWORD getInterfaceStatusByName (const char *name, PDWORD status)
 
DWORD getInterfaceStatusByIndex (DWORD index, PDWORD status)
 
DWORD getInterfaceMtuByName (const char *name, PDWORD mtu)
 
DWORD getInterfaceMtuByIndex (DWORD index, PDWORD mtu)
 
DWORD getInterfaceEntryByName (const char *name, PMIB_IFROW entry)
 
DWORD getInterfaceEntryByIndex (DWORD index, PMIB_IFROW entry)
 
chartoIPAddressString (unsigned int addr, char string[16])
 
NTSTATUS addIPAddress (IPAddr Address, IPMask Mask, DWORD IfIndex, PULONG NteContext, PULONG NteInstance)
 
NTSTATUS deleteIpAddress (ULONG NteContext)
 
DWORD createIpForwardEntryOS (PMIB_IPFORWARDROW pRoute)
 
BOOL isLoopback (HANDLE tcpFile, TDIEntityID *loop_maybe)
 

Macro Definition Documentation

◆ MAX_INTERFACE_DESCRIPTION

#define MAX_INTERFACE_DESCRIPTION   256

Definition at line 48 of file ifenum.h.

◆ MAX_INTERFACE_PHYSADDR

#define MAX_INTERFACE_PHYSADDR   8

Definition at line 47 of file ifenum.h.

Typedef Documentation

◆ InterfaceIndexTable

Function Documentation

◆ addIPAddress()

NTSTATUS addIPAddress ( IPAddr  Address,
IPMask  Mask,
DWORD  IfIndex,
PULONG  NteContext,
PULONG  NteInstance 
)

Definition at line 643 of file ifenum_reactos.c.

645 {
646  HANDLE tcpFile;
650 
651  TRACE("Called.\n");
652 
653  if( !NT_SUCCESS(status) ) return status;
654 
655  Data.NteContext = IfIndex;
656  Data.NewAddress = Address;
657  Data.NewNetmask = Mask;
658 
659  status = NtDeviceIoControlFile( tcpFile,
660  NULL,
661  NULL,
662  NULL,
663  &Iosb,
665  &Data,
666  sizeof(Data),
667  &Data,
668  sizeof(Data) );
669 
670  closeTcpFile( tcpFile );
671 
672  if( NT_SUCCESS(status) ) {
673  *NteContext = Iosb.Information;
674  *NteInstance = Data.NewAddress;
675  }
676 
677  if (!NT_SUCCESS(status)) {
678  ERR("addIPAddress for if %d returning 0x%lx\n", IfIndex, status);
679  }
680 
681  return status;
682 
683 }
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define FILE_READ_DATA
Definition: nt_native.h:628
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
#define FILE_WRITE_DATA
Definition: nt_native.h:631
#define TRACE(s)
Definition: solgame.cpp:4
return Iosb
Definition: create.c:4426
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID closeTcpFile(HANDLE h)
Definition: handle.c:43
#define ERR(fmt,...)
Definition: debug.h:109
#define IOCTL_SET_IP_ADDRESS
Definition: ticonsts.h:48
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
Definition: handle.c:12
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by AddIPAddress().

◆ consumeInterfaceName()

void consumeInterfaceName ( const char ifname)

Definition at line 377 of file ifenum_reactos.c.

377  {
378  HeapFree( GetProcessHeap(), 0, (char *)name );
379 }
#define GetProcessHeap()
Definition: compat.h:403
Definition: name.c:38
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by GetAdaptersInfo(), GetIfEntry(), and GetInterfaceInfo().

◆ createIpForwardEntryOS()

DWORD createIpForwardEntryOS ( PMIB_IPFORWARDROW  pRoute)

◆ deleteIpAddress()

NTSTATUS deleteIpAddress ( ULONG  NteContext)

Definition at line 685 of file ifenum_reactos.c.

686 {
687  HANDLE tcpFile;
690 
691  TRACE("Called.\n");
692 
693  if( !NT_SUCCESS(status) ) return status;
694 
695  status = NtDeviceIoControlFile( tcpFile,
696  NULL,
697  NULL,
698  NULL,
699  &Iosb,
701  &NteContext,
702  sizeof(USHORT),
703  NULL,
704  0 );
705 
706  closeTcpFile( tcpFile );
707 
708  if (!NT_SUCCESS(status)) {
709  ERR("deleteIpAddress(%lu) returning 0x%lx\n", NteContext, status);
710  }
711 
712  return status;
713 }
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define FILE_READ_DATA
Definition: nt_native.h:628
smooth NULL
Definition: ftsmooth.c:416
#define IOCTL_DELETE_IP_ADDRESS
Definition: ticonsts.h:51
#define FILE_WRITE_DATA
Definition: nt_native.h:631
#define TRACE(s)
Definition: solgame.cpp:4
return Iosb
Definition: create.c:4426
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID closeTcpFile(HANDLE h)
Definition: handle.c:43
#define ERR(fmt,...)
Definition: debug.h:109
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
Definition: handle.c:12
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by DeleteIPAddress().

◆ getInterfaceBCastAddrByIndex()

DWORD getInterfaceBCastAddrByIndex ( DWORD  index)

Definition at line 509 of file ifenum_reactos.c.

509  {
510  return getAddrByIndexOrName( 0, index, IPABcast );
511 }
GLuint index
Definition: glext.h:6031
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)

Referenced by GetIpAddrTable().

◆ getInterfaceBCastAddrByName()

DWORD getInterfaceBCastAddrByName ( const char name)

Definition at line 505 of file ifenum_reactos.c.

505  {
506  return getAddrByIndexOrName( (char *)name, 0, IPABcast );
507 }
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)
Definition: name.c:38

◆ getInterfaceEntryByIndex()

DWORD getInterfaceEntryByIndex ( DWORD  index,
PMIB_IFROW  entry 
)

Definition at line 608 of file ifenum_reactos.c.

609 {
610  HANDLE tcpFile;
611  IFInfo info;
612  NTSTATUS status = openTcpFile( &tcpFile, FILE_READ_DATA );
613 
614  TRACE("Called.\n");
615 
616  if( NT_SUCCESS(status) ) {
617  status = getInterfaceInfoByIndex( tcpFile, index, &info );
618 
619  if( NT_SUCCESS(status) ) {
620  memcpy( &entry->wszName[MAX_INTERFACE_NAME_LEN],
621  &info.if_info,
622  sizeof(info.if_info) );
623  }
624 
625  closeTcpFile( tcpFile );
626  }
627 
628  return status;
629 }
LONG NTSTATUS
Definition: precomp.h:26
struct _test_info info[]
Definition: SetCursorPos.c:19
#define FILE_READ_DATA
Definition: nt_native.h:628
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID closeTcpFile(HANDLE h)
Definition: handle.c:43
#define MAX_INTERFACE_NAME_LEN
Definition: ifmib.h:31
uint32_t entry
Definition: isohybrid.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
NTSTATUS getInterfaceInfoByIndex(HANDLE tcpFile, DWORD index, IFInfo *info)
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
Definition: handle.c:12
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by GetIfEntry().

◆ getInterfaceEntryByName()

DWORD getInterfaceEntryByName ( const char name,
PMIB_IFROW  entry 
)

Definition at line 583 of file ifenum_reactos.c.

584 {
585  HANDLE tcpFile;
586  IFInfo info;
587  NTSTATUS status = openTcpFile( &tcpFile, FILE_READ_DATA );
588 
589  TRACE("Called.\n");
590 
591  if( NT_SUCCESS(status) ) {
592  status = getInterfaceInfoByName( tcpFile, (char *)name, &info );
593 
594  if( NT_SUCCESS(status) ) {
595  memcpy( &entry->wszName[MAX_INTERFACE_NAME_LEN],
596  &info.if_info,
597  sizeof(info.if_info) );
598  }
599 
600  TRACE("entry->bDescr = %s\n", entry->bDescr);
601 
602  closeTcpFile( tcpFile );
603  }
604 
605  return status;
606 }
LONG NTSTATUS
Definition: precomp.h:26
struct _test_info info[]
Definition: SetCursorPos.c:19
NTSTATUS getInterfaceInfoByName(HANDLE tcpFile, char *name, IFInfo *info)
#define FILE_READ_DATA
Definition: nt_native.h:628
#define TRACE(s)
Definition: solgame.cpp:4
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID closeTcpFile(HANDLE h)
Definition: handle.c:43
#define MAX_INTERFACE_NAME_LEN
Definition: ifmib.h:31
uint32_t entry
Definition: isohybrid.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
Definition: handle.c:12
Definition: name.c:38
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ getInterfaceIndexByName()

DWORD getInterfaceIndexByName ( const char name,
PDWORD  index 
)

Definition at line 381 of file ifenum_reactos.c.

382 {
383  IFInfo ifInfo;
384  HANDLE tcpFile;
385  NTSTATUS status = openTcpFile( &tcpFile, FILE_READ_DATA );
386 
387  if( NT_SUCCESS(status) ) {
388  status = getInterfaceInfoByName( tcpFile, (char *)name, &ifInfo );
389 
390  if( NT_SUCCESS(status) ) {
391  *index = ifInfo.if_info.ent.if_index;
392  }
393 
394  closeTcpFile( tcpFile );
395  }
396 
397  return status;
398 }
LONG NTSTATUS
Definition: precomp.h:26
ULONG if_index
Definition: tcpioctl.h:105
NTSTATUS getInterfaceInfoByName(HANDLE tcpFile, char *name, IFInfo *info)
#define FILE_READ_DATA
Definition: nt_native.h:628
GLuint index
Definition: glext.h:6031
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID closeTcpFile(HANDLE h)
Definition: handle.c:43
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
Definition: handle.c:12
Definition: name.c:38
IFEntrySafelySized if_info
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ getInterfaceIndexTable()

InterfaceIndexTable* getInterfaceIndexTable ( void  )

Definition at line 447 of file ifenum_reactos.c.

447  {
449 }
InterfaceIndexTable * getInterfaceIndexTableInt(BOOL nonLoopbackOnly)

Referenced by GetIfTable(), and GetIpAddrTable().

◆ getInterfaceIPAddrByIndex()

DWORD getInterfaceIPAddrByIndex ( DWORD  index)

Definition at line 501 of file ifenum_reactos.c.

501  {
502  return getAddrByIndexOrName( 0, index, IPAAddr );
503 }
GLuint index
Definition: glext.h:6031
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)

Referenced by GetAdaptersInfo(), and GetIpAddrTable().

◆ getInterfaceIPAddrByName()

DWORD getInterfaceIPAddrByName ( const char name)

Definition at line 455 of file ifenum_reactos.c.

456 {
457  return INADDR_ANY;
458 }
#define INADDR_ANY
Definition: StrAddr.c:4

◆ getInterfaceMaskByIndex()

DWORD getInterfaceMaskByIndex ( DWORD  index)

Definition at line 517 of file ifenum_reactos.c.

517  {
518  return getAddrByIndexOrName( 0, index, IPAMask );
519 }
GLuint index
Definition: glext.h:6031
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)

Referenced by GetAdaptersInfo(), and GetIpAddrTable().

◆ getInterfaceMaskByName()

DWORD getInterfaceMaskByName ( const char name)

Definition at line 513 of file ifenum_reactos.c.

513  {
514  return getAddrByIndexOrName( (char *)name, 0, IPAMask );
515 }
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)
Definition: name.c:38

◆ getInterfaceMtuByIndex()

DWORD getInterfaceMtuByIndex ( DWORD  index,
PDWORD  mtu 
)

Definition at line 567 of file ifenum_reactos.c.

567  {
568  *mtu = getAddrByIndexOrName( 0, index, IFMtu );
569  return STATUS_SUCCESS;
570 }
GLuint index
Definition: glext.h:6031
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ getInterfaceMtuByName()

DWORD getInterfaceMtuByName ( const char name,
PDWORD  mtu 
)

Definition at line 562 of file ifenum_reactos.c.

562  {
563  *mtu = getAddrByIndexOrName( (char *)name, 0, IFMtu );
564  return STATUS_SUCCESS;
565 }
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)
Definition: name.c:38
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ getInterfaceNameByIndex()

const char* getInterfaceNameByIndex ( DWORD  index)

Definition at line 352 of file ifenum_reactos.c.

353 {
354  IFInfo ifInfo;
355  HANDLE tcpFile;
356  char *interfaceName = NULL;
357  NTSTATUS status = openTcpFile( &tcpFile, FILE_READ_DATA );
358 
359  if( NT_SUCCESS(status) ) {
360  status = getInterfaceInfoByIndex( tcpFile, index, &ifInfo );
361 
362  if( NT_SUCCESS(status) ) {
363  interfaceName = HeapAlloc( GetProcessHeap(), 0,
364  ifInfo.if_info.ent.if_descrlen + 1 );
365  if( interfaceName ) {
366  memcpy(interfaceName, ifInfo.if_info.ent.if_descr, ifInfo.if_info.ent.if_descrlen);
367  interfaceName[ifInfo.if_info.ent.if_descrlen] = '\0';
368  }
369  }
370 
371  closeTcpFile( tcpFile );
372  }
373 
374  return interfaceName;
375 }
ULONG if_descrlen
Definition: tcpioctl.h:126
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_READ_DATA
Definition: nt_native.h:628
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID closeTcpFile(HANDLE h)
Definition: handle.c:43
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
NTSTATUS getInterfaceInfoByIndex(HANDLE tcpFile, DWORD index, IFInfo *info)
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
Definition: handle.c:12
IFEntrySafelySized if_info
UCHAR if_descr[1]
Definition: tcpioctl.h:127
Definition: ps.c:97

Referenced by GetAdaptersInfo(), GetIfEntry(), GetInterfaceInfo(), and GetPerAdapterInfo().

◆ getInterfacePhysicalByIndex()

DWORD getInterfacePhysicalByIndex ( DWORD  index,
PDWORD  len,
PBYTE  addr,
PDWORD  type 
)

Definition at line 545 of file ifenum_reactos.c.

547 {
548  HANDLE tcpFile;
549  IFInfo info;
550  NTSTATUS status = openTcpFile( &tcpFile, FILE_READ_DATA );
551 
552  if( NT_SUCCESS(status) ) {
553  status = getInterfaceInfoByIndex( tcpFile, index, &info );
554  if( NT_SUCCESS(status) )
556  closeTcpFile( tcpFile );
557  }
558 
559  return status;
560 }
LONG NTSTATUS
Definition: precomp.h:26
void getInterfacePhysicalFromInfo(IFInfo *info, PDWORD len, PBYTE addr, PDWORD type)
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
struct _test_info info[]
Definition: SetCursorPos.c:19
#define FILE_READ_DATA
Definition: nt_native.h:628
GLuint index
Definition: glext.h:6031
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID closeTcpFile(HANDLE h)
Definition: handle.c:43
GLenum const GLvoid * addr
Definition: glext.h:9621
GLenum GLsizei len
Definition: glext.h:6722
NTSTATUS getInterfaceInfoByIndex(HANDLE tcpFile, DWORD index, IFInfo *info)
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
Definition: handle.c:12
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by GetAdaptersInfo().

◆ getInterfacePhysicalByName()

DWORD getInterfacePhysicalByName ( const char name,
PDWORD  len,
PBYTE  addr,
PDWORD  type 
)

Definition at line 528 of file ifenum_reactos.c.

530 {
531  HANDLE tcpFile;
532  IFInfo info;
533  NTSTATUS status = openTcpFile( &tcpFile, FILE_READ_DATA );
534 
535  if( NT_SUCCESS(status) ) {
536  status = getInterfaceInfoByName( tcpFile, (char *)name, &info );
537  if( NT_SUCCESS(status) )
539  closeTcpFile( tcpFile );
540  }
541 
542  return status;
543 }
LONG NTSTATUS
Definition: precomp.h:26
void getInterfacePhysicalFromInfo(IFInfo *info, PDWORD len, PBYTE addr, PDWORD type)
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
struct _test_info info[]
Definition: SetCursorPos.c:19
NTSTATUS getInterfaceInfoByName(HANDLE tcpFile, char *name, IFInfo *info)
#define FILE_READ_DATA
Definition: nt_native.h:628
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID closeTcpFile(HANDLE h)
Definition: handle.c:43
GLenum const GLvoid * addr
Definition: glext.h:9621
GLenum GLsizei len
Definition: glext.h:6722
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
Definition: handle.c:12
Definition: name.c:38
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ getInterfaceStatusByIndex()

DWORD getInterfaceStatusByIndex ( DWORD  index,
PDWORD  status 
)

Definition at line 577 of file ifenum_reactos.c.

578 {
580  return STATUS_SUCCESS;
581 }
GLuint index
Definition: glext.h:6031
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)
return STATUS_SUCCESS
Definition: btrfs.c:2938
Definition: ps.c:97

◆ getInterfaceStatusByName()

DWORD getInterfaceStatusByName ( const char name,
PDWORD  status 
)

Definition at line 572 of file ifenum_reactos.c.

572  {
573  *status = getAddrByIndexOrName( (char *)name, 0, IFStatus );
574  return STATUS_SUCCESS;
575 }
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)
Definition: name.c:38
return STATUS_SUCCESS
Definition: btrfs.c:2938
Definition: ps.c:97

◆ getNonLoopbackInterfaceIndexTable()

InterfaceIndexTable* getNonLoopbackInterfaceIndexTable ( void  )

Definition at line 451 of file ifenum_reactos.c.

451  {
453 }
#define TRUE
Definition: types.h:120
InterfaceIndexTable * getInterfaceIndexTableInt(BOOL nonLoopbackOnly)

Referenced by GetAdaptersInfo(), and GetInterfaceInfo().

◆ getNumInterfaces()

DWORD getNumInterfaces ( void  )

Definition at line 264 of file ifenum_reactos.c.

265 {
266  return getNumInterfacesInt( FALSE );
267 }
static DWORD getNumInterfacesInt(BOOL onlyNonLoopback)

Referenced by GetIfTable(), GetIpAddrTable(), and GetNumberOfInterfaces().

◆ getNumNonLoopbackInterfaces()

DWORD getNumNonLoopbackInterfaces ( void  )

Definition at line 269 of file ifenum_reactos.c.

270 {
271  return getNumInterfacesInt( TRUE );
272 }
#define TRUE
Definition: types.h:120
static DWORD getNumInterfacesInt(BOOL onlyNonLoopback)

Referenced by GetAdaptersInfo(), and GetInterfaceInfo().

◆ interfaceMapFree()

void interfaceMapFree ( void  )

Definition at line 54 of file ifenum_reactos.c.

55 {
56  /* Ditto. */
57 }

Referenced by DllMain().

◆ interfaceMapInit()

void interfaceMapInit ( void  )

Definition at line 49 of file ifenum_reactos.c.

50 {
51  /* For now, nothing */
52 }

Referenced by DllMain().

◆ isLoopback()

BOOL isLoopback ( HANDLE  tcpFile,
TDIEntityID loop_maybe 
)

Definition at line 119 of file ifenum_reactos.c.

119  {
120  IFEntrySafelySized entryInfo;
122 
123  status = tdiGetMibForIfEntity( tcpFile,
124  loop_maybe,
125  &entryInfo );
126 
127  return NT_SUCCESS(status) &&
128  (entryInfo.ent.if_type == IFENT_SOFTWARE_LOOPBACK);
129 }
LONG NTSTATUS
Definition: precomp.h:26
ULONG if_type
Definition: tcpioctl.h:106
#define IFENT_SOFTWARE_LOOPBACK
NTSTATUS tdiGetMibForIfEntity(HANDLE tcpFile, TDIEntityID *ent, IFEntrySafelySized *entry)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by getInterfaceIndexTableInt(), and getNumInterfacesInt().

◆ toIPAddressString()

char* toIPAddressString ( unsigned int  addr,
char  string[16] 
)

Definition at line 631 of file ifenum_reactos.c.

632 {
633  struct in_addr iAddr;
634 
635  iAddr.s_addr = addr;
636 
637  if (string)
638  strncpy(string, inet_ntoa(iAddr), 16);
639 
640  return inet_ntoa(iAddr);
641 }
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
u32_t s_addr
Definition: inet.h:45
#define inet_ntoa(addr)
Definition: inet.h:100
Definition: tcpip.h:125
GLenum const GLvoid * addr
Definition: glext.h:9621

Referenced by GetAdaptersInfo().