ReactOS 0.4.15-dev-5669-g09dde2c
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
86typedef struct _IPRouteEntry {
88 ULONG ire_index; //matches if_index in IFEntry and iae_index in IPAddrEntry
101
102/* No caddr_t in reactos headers */
103typedef char *caddr_t;
104
105typedef union _IFEntrySafelySized {
107 sizeof(IFEntry) +
111
114 sizeof(IPRouteEntry)];
118
121 sizeof(MIB_IPNETROW)];
125
126/* Encapsulates information about an interface */
127typedef struct _IFInfo {
132
133typedef struct _IP_SET_DATA {
138
139typedef enum _IPHLPAddrType {
142
146 IPAddrEntry **addrs, PDWORD numAddrs );
149 PWCHAR ChildKeyName,
150 PHKEY ReturnHandle );
155void ConsumeRegValueString( PWCHAR NameServer );
156BOOL isInterface( TDIEntityID *if_maybe );
157BOOL hasArp( HANDLE tcpFile, TDIEntityID *arp_maybe );
158
160 PWCHAR NameServer,
161 PVOID Data );
164 char *name,
165 DWORD index,
166 IFInfo *ifInfo);
167DWORD 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)
173GetComputerNameExA(COMPUTER_NAME_FORMAT,LPSTR,LPDWORD);
174#endif
175
176#endif /* IPPRIVATE_H */
#define VOID
Definition: acefi.h:82
LONG NTSTATUS
Definition: precomp.h:26
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble n
Definition: glext.h:7729
GLuint index
Definition: glext.h:6031
#define MAX_ADAPTER_DESCRIPTION_LENGTH
Definition: iinfo.c:16
PWCHAR QueryRegistryValueString(HANDLE RegHandle, PWCHAR ValueName)
Definition: registry.c:119
struct _IPRouteEntry IPRouteEntry
union _TCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY TCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY
struct _IFInfo IFInfo
_IPHLPAddrType
@ IFMtu
@ IPABcast
@ IPAMask
@ IFStatus
@ IPAAddr
enum _IPHLPAddrType IPHLPAddrType
LONG OpenChildKeyRead(HANDLE RegHandle, PWCHAR ChildKeyName, PHKEY ReturnHandle)
Definition: registry.c:25
struct _IP_SET_DATA * PIP_SET_DATA
union _IFEntrySafelySized IFEntrySafelySized
int GetLongestChildKeyName(HANDLE RegHandle)
Definition: registry.c:3
VOID(* EnumNameServersFunc)(PWCHAR Interface, PWCHAR NameServer, PVOID Data)
char * caddr_t
BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT, LPSTR, LPDWORD)
Definition: compname.c:376
void ConsumeRegValueString(PWCHAR NameServer)
Definition: registry.c:140
union _TCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY * PTCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY
LSTATUS EnumNameServers(HKEY RegHandle, LPWSTR Interface, PVOID Data, EnumNameServersFunc cb)
void ConsumeChildKeyName(PWCHAR Name)
Definition: registry.c:63
PWCHAR * QueryRegistryValueStringMulti(HANDLE RegHandle, PWCHAR ValueName)
Definition: registry.c:144
BOOL hasArp(HANDLE tcpFile, TDIEntityID *arp_maybe)
DWORD TCPSendIoctl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, PULONG pInBufferSize, LPVOID lpOutBuffer, PULONG pOutBufferSize)
NTSTATUS tdiGetIpAddrsForIpEntity(HANDLE tcpFile, TDIEntityID *ent, IPAddrEntry **addrs, PDWORD numAddrs)
NTSTATUS getNthIpEntity(HANDLE tcpFile, DWORD index, TDIEntityID *ent)
BOOL isInterface(TDIEntityID *if_maybe)
struct _IP_SET_DATA IP_SET_DATA
PWCHAR GetNthChildKeyName(HANDLE RegHandle, DWORD n)
Definition: registry.c:39
NTSTATUS getIPAddrEntryForIf(HANDLE tcpFile, char *name, DWORD index, IFInfo *ifInfo)
union _TCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY TCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY
union _TCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY * PTCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define DWORD
Definition: nt_native.h:44
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
IFEntrySafelySized if_info
TDIEntityID entity_id
IPAddrEntry ip_addr
Definition: name.c:39
struct _TCP_REQUEST_SET_INFORMATION_EX TCP_REQUEST_SET_INFORMATION_EX
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t * LPDWORD
Definition: typedefs.h:59
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
CHAR MaxSize[sizeof(DWORD)+sizeof(IFEntry)+MAX_ADAPTER_DESCRIPTION_LENGTH+1]
CHAR MaxSize[sizeof(TCP_REQUEST_SET_INFORMATION_EX) - 1+sizeof(MIB_IPNETROW)]
TCP_REQUEST_SET_INFORMATION_EX Req
CHAR MaxSize[sizeof(TCP_REQUEST_SET_INFORMATION_EX) - 1+sizeof(IPRouteEntry)]
TCP_REQUEST_SET_INFORMATION_EX Req
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700
#define WINAPI
Definition: msvc.h:6
_In_opt_ PETWENABLECALLBACK _In_opt_ PVOID _Out_ PREGHANDLE RegHandle
Definition: wmifuncs.h:78
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char CHAR
Definition: xmlstorage.h:175