65 WARN(
"TdiGetMibForIfEntity(tcpFile %p,entityId %p)\n",
84 WARN(
"IOCTL Failed\n");
88 TRACE(
"TdiGetMibForIfEntity() => {\n"
89 " if_index ....................... %x\n"
90 " if_type ........................ %x\n"
91 " if_mtu ......................... %d\n"
92 " if_speed ....................... %x\n"
93 " if_physaddrlen ................. %d\n",
98 entry->ent.if_physaddrlen);
99 TRACE(
" if_physaddr .................... %02x:%02x:%02x:%02x:%02x:%02x\n"
100 " if_descr ....................... %*s\n",
101 entry->ent.if_physaddr[0] & 0xff,
102 entry->ent.if_physaddr[1] & 0xff,
103 entry->ent.if_physaddr[2] & 0xff,
104 entry->ent.if_physaddr[3] & 0xff,
105 entry->ent.if_physaddr[4] & 0xff,
106 entry->ent.if_physaddr[5] & 0xff,
107 entry->ent.if_descrlen,
108 entry->ent.if_descr);
163 int curInterf = 0,
i;
166 ERR(
"getInterfaceInfoSet: tdiGetEntityIDSet() failed: 0x%lx\n",
status);
171 sizeof(
IFInfo) * numEntities );
174 for(
i = 0;
i < numEntities;
i++ ) {
176 infoSetInt[curInterf].
entity_id = entIDSet[
i];
180 &infoSetInt[curInterf].if_info );
191 ( tcpFile, &ip_ent, &addrs, &numAddrs );
193 TRACE(
"ADDR %d: index %d (target %d)\n",
j, addrs[
j].iae_index, infoSetInt[curInterf].if_info.ent.if_index);
194 if( addrs[
j].iae_index ==
195 infoSetInt[curInterf].if_info.ent.if_index ) {
198 sizeof( addrs[
j] ) );
212 *infoSet = infoSetInt;
213 *numInterfaces = curInterf;
227 DWORD numEntities, numInterfaces = 0;
236 WARN(
"getNumInterfaces: failed %08x\n",
status );
243 WARN(
"getNumInterfaces: failed %08x\n",
status );
248 for(
i = 0;
i < numEntities;
i++ ) {
250 (!onlyNonLoopback || !
isLoopback( tcpFile, &entitySet[
i] )) )
254 TRACE(
"getNumInterfaces: success: %d %d %08x\n",
255 onlyNonLoopback, numInterfaces,
status );
261 return numInterfaces;
275 DWORD numEntities = 0;
276 DWORD numInterfaces = 0;
284 for(
i = 0;
i < numEntities;
i++ ) {
286 if( numInterfaces ==
index )
break;
287 else numInterfaces++;
291 TRACE(
"Index %d is entity #%d - %04x:%08x\n",
index,
i,
292 entitySet[
i].tei_entity, entitySet[
i].tei_instance );
294 if( numInterfaces ==
index &&
i < numEntities ) {
295 memcpy( ent, &entitySet[
i],
sizeof(*ent) );
312 for(
i = 0;
i < numInterfaces;
i++ ) {
313 if( ifInfo[
i].if_info.ent.if_index ==
index ) {
335 for(
i = 0;
i < numInterfaces;
i++ ) {
356 char *interfaceName =
NULL;
365 if( interfaceName ) {
374 return interfaceName;
401 DWORD numInterfaces, curInterface = 0;
411 TRACE(
"InterfaceInfoSet: %08x, %04x:%08x\n",
420 (numInterfaces - 1) *
sizeof(
DWORD));
423 ret->numAllocated = numInterfaces;
424 TRACE(
"NumInterfaces = %d\n", numInterfaces);
426 for(
i = 0;
i < numInterfaces;
i++ ) {
427 TRACE(
"Examining interface %d\n",
i);
428 if( !nonLoopbackOnly ||
430 TRACE(
"Interface %d matches (%d)\n",
i, curInterface);
431 ret->indexes[curInterface++] =
436 ret->numIndexes = curInterface;
470 ERR(
"getIPAddrEntryForIf returning %lx\n",
status);
523 *
len =
info->if_info.ent.if_physaddrlen;
597 sizeof(
info.if_info) );
622 sizeof(
info.if_info) );
655 Data.NteContext = IfIndex;
673 *NteContext =
Iosb.Information;
674 *NteInstance =
Data.NewAddress;
678 ERR(
"addIPAddress for if %d returning 0x%lx\n", IfIndex,
status);
709 ERR(
"deleteIpAddress(%lu) returning 0x%lx\n", NteContext,
status);
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define NT_SUCCESS(StatCode)
#define HeapFree(x, y, z)
GLuint GLuint GLsizei GLenum type
GLenum const GLvoid * addr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
void interfaceMapFree(void)
static NTSTATUS getInterfaceInfoSet(HANDLE tcpFile, IFInfo **infoSet, PDWORD numInterfaces)
DWORD getInterfaceStatusByName(const char *name, PDWORD status)
DWORD getInterfacePhysicalByIndex(DWORD index, PDWORD len, PBYTE addr, PDWORD type)
DWORD getInterfaceEntryByName(const char *name, PMIB_IFROW entry)
void consumeInterfaceName(const char *name)
DWORD getInterfaceMtuByName(const char *name, PDWORD mtu)
NTSTATUS getInterfaceInfoByIndex(HANDLE tcpFile, DWORD index, IFInfo *info)
DWORD getNumNonLoopbackInterfaces(void)
DWORD getAddrByIndexOrName(char *name, DWORD index, IPHLPAddrType addrType)
NTSTATUS tdiGetMibForIfEntity(HANDLE tcpFile, TDIEntityID *ent, IFEntrySafelySized *entry)
DWORD getNumInterfaces(void)
static DWORD getNumInterfacesInt(BOOL onlyNonLoopback)
void getInterfacePhysicalFromInfo(IFInfo *info, PDWORD len, PBYTE addr, PDWORD type)
DWORD getInterfaceBCastAddrByName(const char *name)
DWORD getInterfaceStatusByIndex(DWORD index, PDWORD status)
DWORD getNthInterfaceEntity(HANDLE tcpFile, DWORD index, TDIEntityID *ent)
DWORD getInterfaceMaskByIndex(DWORD index)
InterfaceIndexTable * getNonLoopbackInterfaceIndexTable(void)
NTSTATUS getInterfaceInfoByName(HANDLE tcpFile, char *name, IFInfo *info)
DWORD getInterfaceEntryByIndex(DWORD index, PMIB_IFROW entry)
DWORD getInterfaceMtuByIndex(DWORD index, PDWORD mtu)
const char * getInterfaceNameByIndex(DWORD index)
DWORD getInterfaceBCastAddrByIndex(DWORD index)
DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr, PDWORD type)
DWORD getInterfaceMaskByName(const char *name)
DWORD getInterfaceIPAddrByName(const char *name)
BOOL hasArp(HANDLE tcpFile, TDIEntityID *arp_maybe)
DWORD getInterfaceIndexByName(const char *name, PDWORD index)
InterfaceIndexTable * getInterfaceIndexTableInt(BOOL nonLoopbackOnly)
void interfaceMapInit(void)
InterfaceIndexTable * getInterfaceIndexTable(void)
BOOL isInterface(TDIEntityID *if_maybe)
char * toIPAddressString(unsigned int addr, char string[16])
NTSTATUS addIPAddress(IPAddr Address, IPMask Mask, DWORD IfIndex, PULONG NteContext, PULONG NteInstance)
DWORD getInterfaceIPAddrByIndex(DWORD index)
NTSTATUS getIPAddrEntryForIf(HANDLE tcpFile, char *name, DWORD index, IFInfo *ifInfo)
NTSTATUS deleteIpAddress(ULONG NteContext)
BOOL isLoopback(HANDLE tcpFile, TDIEntityID *loop_maybe)
#define MAX_INTERFACE_NAME_LEN
enum _IPHLPAddrType IPHLPAddrType
NTSTATUS tdiGetIpAddrsForIpEntity(HANDLE tcpFile, TDIEntityID *ent, IPAddrEntry **addrs, PDWORD numAddrs)
NTSTATUS getNthIpEntity(HANDLE tcpFile, DWORD index, TDIEntityID *ent)
#define IFENT_SOFTWARE_LOOPBACK
#define TCP_REQUEST_QUERY_INFORMATION_INIT
#define memcpy(s1, s2, n)
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)
VOID tdiFreeThingSet(PVOID things)
NTSTATUS tdiGetEntityIDSet(HANDLE tcpFile, TDIEntityID **entitySet, PDWORD numEntities)
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
VOID closeTcpFile(HANDLE h)
IFEntrySafelySized if_info
#define IOCTL_SET_IP_ADDRESS
#define IOCTL_DELETE_IP_ADDRESS
#define INFO_CLASS_PROTOCOL
#define INFO_CLASS_GENERIC
#define INFO_TYPE_PROVIDER
#define IOCTL_TCP_QUERY_INFORMATION_EX
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES