ReactOS  0.4.14-dev-317-g96040ec
iphlpapi_private.h
Go to the documentation of this file.
1 #ifndef IPPRIVATE_H
2 #define IPPRIVATE_H
3 
4 #define NtCurrentTeb NtXCurrentTeb
5 
6 #include <stdio.h>
7 #include <stdlib.h>
8 //#include <sys/types.h>
9 #ifdef HAVE_NETINET_IN_H
10 # include <netinet/in.h>
11 #endif
12 #ifdef HAVE_ARPA_INET_H
13 # include <arpa/inet.h>
14 #endif
15 #ifdef HAVE_ARPA_NAMESER_H
16 # include <arpa/nameser.h>
17 #endif
18 #ifdef HAVE_RESOLV_H
19 # include <resolv.h>
20 #endif
21 
22 #define WIN32_NO_STATUS
23 #define _INC_WINDOWS
24 #define COM_NO_WINDOWS_H
25 
26 #include <windef.h>
27 #include <winbase.h>
28 #include <winreg.h>
29 #include <winnls.h>
30 #include <ws2tcpip.h>
31 #define NTOS_MODE_USER
32 #include <ndk/iofuncs.h>
33 #include <ndk/obfuncs.h>
34 #include <ndk/rtlfuncs.h>
35 #include <iphlpapi.h>
36 #include "resinfo.h"
37 #include <wine/debug.h>
38 
39 #include "dhcp.h"
40 #include <dhcpcsdk.h>
41 #include <dhcpcapi.h>
42 
43 #include <tdiinfo.h>
44 #include <tcpioctl.h>
45 
46 #include <tdilib.h>
47 
48 #include "ifenum.h"
49 #include "ipstats.h"
50 #include "route.h"
51 
52 #ifndef ETH_ALEN
53 #define ETH_ALEN 6
54 #endif
55 
56 #ifndef INADDR_NONE
57 #define INADDR_NONE (~0U)
58 #endif
59 
60 #ifndef IFENT_SOFTWARE_LOOPBACK
61 #define IFENT_SOFTWARE_LOOPBACK 24 /* This is an SNMP constant from rfc1213 */
62 #endif/*IFENT_SOFTWARE_LOOPBACK*/
63 
64 #define INDEX_IS_LOOPBACK 0x00800000
65 
66 /* Type declarations */
67 
68 #ifndef IFNAMSIZ
69 #define IFNAMSIZ 0x20
70 #endif/*IFNAMSIZ*/
71 
72 #define TCP_REQUEST_QUERY_INFORMATION_INIT { { { 0 } } }
73 #define TCP_REQUEST_SET_INFORMATION_INIT { { 0 } }
74 
75 /* FIXME: ROS headers suck */
76 #ifndef GAA_FLAG_SKIP_UNICAST
77 #define GAA_FLAG_SKIP_UNICAST 0x0001
78 #endif
79 
80 #ifndef GAA_FLAG_SKIP_FRIENDLY_NAME
81 #define GAA_FLAG_SKIP_FRIENDLY_NAME 0x0020
82 #endif
83 
84 // As in the mib from RFC 1213
85 
86 typedef struct _IPRouteEntry {
88  ULONG ire_index; //matches if_index in IFEntry and iae_index in IPAddrEntry
100 } IPRouteEntry;
101 
102 /* No caddr_t in reactos headers */
103 typedef char *caddr_t;
104 
105 typedef union _IFEntrySafelySized {
106  CHAR MaxSize[sizeof(DWORD) +
107  sizeof(IFEntry) +
111 
114  sizeof(IPRouteEntry)];
118 
121  sizeof(MIB_IPNETROW)];
125 
126 /* Encapsulates information about an interface */
127 typedef struct _IFInfo {
131 } IFInfo;
132 
133 typedef struct _IP_SET_DATA {
138 
139 typedef enum _IPHLPAddrType {
141 } IPHLPAddrType;
142 
146  IPAddrEntry **addrs, PDWORD numAddrs );
149  PWCHAR ChildKeyName,
150  PHKEY ReturnHandle );
155 void ConsumeRegValueString( PWCHAR NameServer );
156 BOOL isInterface( TDIEntityID *if_maybe );
157 BOOL hasArp( HANDLE tcpFile, TDIEntityID *arp_maybe );
158 
160  PWCHAR NameServer,
161  PVOID Data );
164  char *name,
165  DWORD index,
166  IFInfo *ifInfo);
167 DWORD TCPSendIoctl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, PULONG pInBufferSize, LPVOID lpOutBuffer, PULONG pOutBufferSize);
168 
169 #include <w32api.h>
170 /* This is here until we switch to version 2.5 of the mingw headers */
171 #if (__W32API_MAJOR_VERSION < 2 || __W32API_MINOR_VERSION < 5)
172 BOOL WINAPI
173 GetComputerNameExA(COMPUTER_NAME_FORMAT,LPSTR,LPDWORD);
174 #endif
175 
176 #endif /* IPPRIVATE_H */
union _TCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY TCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY
LONG OpenChildKeyRead(HANDLE RegHandle, PWCHAR ChildKeyName, PHKEY ReturnHandle)
Definition: registry.c:25
union _TCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY * PTCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY
struct _IP_SET_DATA * PIP_SET_DATA
struct _IP_SET_DATA IP_SET_DATA
char CHAR
Definition: xmlstorage.h:175
LONG NTSTATUS
Definition: precomp.h:26
TDIEntityID entity_id
GLdouble n
Definition: glext.h:7729
NTSTATUS getNthIpEntity(HANDLE tcpFile, DWORD index, TDIEntityID *ent)
_IPHLPAddrType
struct _IPRouteEntry IPRouteEntry
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT, LPSTR, LPDWORD)
Definition: compname.c:370
uint16_t * PWCHAR
Definition: typedefs.h:54
char * LPSTR
Definition: xmlstorage.h:182
IPAddrEntry ip_addr
#define DWORD
Definition: nt_native.h:44
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
BOOL hasArp(HANDLE tcpFile, TDIEntityID *arp_maybe)
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
TCP_REQUEST_SET_INFORMATION_EX Req
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
_In_opt_ PETWENABLECALLBACK _In_opt_ PVOID _Out_ PREGHANDLE RegHandle
Definition: wmifuncs.h:76
GLuint index
Definition: glext.h:6031
enum _IPHLPAddrType IPHLPAddrType
NTSTATUS getIPAddrEntryForIf(HANDLE tcpFile, char *name, DWORD index, IFInfo *ifInfo)
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
char * caddr_t
union _IFEntrySafelySized IFEntrySafelySized
#define WINAPI
Definition: msvc.h:8
int GetLongestChildKeyName(HANDLE RegHandle)
Definition: registry.c:3
unsigned long DWORD
Definition: ntddk_ex.h:95
CHAR MaxSize[sizeof(DWORD)+sizeof(IFEntry)+MAX_ADAPTER_DESCRIPTION_LENGTH+1]
PWCHAR QueryRegistryValueString(HANDLE RegHandle, PWCHAR ValueName)
Definition: registry.c:119
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
union _TCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY * PTCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY
TCP_REQUEST_SET_INFORMATION_EX Req
#define VOID
Definition: acefi.h:82
CHAR MaxSize[sizeof(TCP_REQUEST_SET_INFORMATION_EX) - 1+sizeof(MIB_IPNETROW)]
void ConsumeRegValueString(PWCHAR NameServer)
Definition: registry.c:140
CHAR MaxSize[sizeof(TCP_REQUEST_SET_INFORMATION_EX) - 1+sizeof(IPRouteEntry)]
NTSTATUS tdiGetIpAddrsForIpEntity(HANDLE tcpFile, TDIEntityID *ent, IPAddrEntry **addrs, PDWORD numAddrs)
unsigned int * PULONG
Definition: retypes.h:1
void ConsumeChildKeyName(PWCHAR Name)
Definition: registry.c:63
DWORD * PDWORD
Definition: pedump.c:68
struct _TCP_REQUEST_SET_INFORMATION_EX TCP_REQUEST_SET_INFORMATION_EX
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32
union _TCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY TCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY
#define MAX_ADAPTER_DESCRIPTION_LENGTH
Definition: iinfo.c:16
Definition: name.c:36
uint32_t * LPDWORD
Definition: typedefs.h:57
LSTATUS EnumNameServers(HKEY RegHandle, LPWSTR Interface, PVOID Data, EnumNameServersFunc cb)
unsigned int ULONG
Definition: retypes.h:1
IFEntrySafelySized if_info
struct _IFInfo IFInfo
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL isInterface(TDIEntityID *if_maybe)
PWCHAR * QueryRegistryValueStringMulti(HANDLE RegHandle, PWCHAR ValueName)
Definition: registry.c:144
VOID(* EnumNameServersFunc)(PWCHAR Interface, PWCHAR NameServer, PVOID Data)
PWCHAR GetNthChildKeyName(HANDLE RegHandle, DWORD n)
Definition: registry.c:39
DWORD TCPSendIoctl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, PULONG pInBufferSize, LPVOID lpOutBuffer, PULONG pOutBufferSize)
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700