ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

iphlpapi_private.h
Go to the documentation of this file.
00001 #ifndef IPPRIVATE_H
00002 #define IPPRIVATE_H
00003 
00004 #define NtCurrentTeb NtXCurrentTeb
00005 
00006 #include <stdarg.h>
00007 #include <stdio.h>
00008 #include <stdlib.h>
00009 #include <sys/types.h>
00010 #ifdef HAVE_NETINET_IN_H
00011 # include <netinet/in.h>
00012 #endif
00013 #ifdef HAVE_ARPA_INET_H
00014 # include <arpa/inet.h>
00015 #endif
00016 #ifdef HAVE_ARPA_NAMESER_H
00017 # include <arpa/nameser.h>
00018 #endif
00019 #ifdef HAVE_RESOLV_H
00020 # include <resolv.h>
00021 #endif
00022 
00023 #define WIN32_NO_STATUS
00024 #include <winsock2.h>
00025 #include <ws2tcpip.h>
00026 #include <windows.h>
00027 #define NTOS_MODE_USER
00028 #include <ndk/iofuncs.h>
00029 #include <ndk/obfuncs.h>
00030 #include <ndk/rtlfuncs.h>
00031 #include <nspapi.h>
00032 #include <iptypes.h>
00033 #include "iphlpapi.h"
00034 #include "resinfo.h"
00035 #include "wine/debug.h"
00036 
00037 #include "dhcp.h"
00038 #include "dhcpcsdk.h"
00039 #include "dhcpcapi.h"
00040 #include <assert.h>
00041 
00042 //#include "ntddndis.h"
00043 #include "tdiinfo.h"
00044 #include "tcpioctl.h"
00045 
00046 #include "tdilib.h"
00047 
00048 #include "ifenum.h"
00049 
00050 #include "ipstats.h"
00051 #include "route.h"
00052 
00053 #ifndef ETH_ALEN
00054 #define ETH_ALEN 6
00055 #endif
00056 
00057 #ifndef INADDR_NONE
00058 #define INADDR_NONE (~0U)
00059 #endif
00060 
00061 #ifndef IFENT_SOFTWARE_LOOPBACK
00062 #define IFENT_SOFTWARE_LOOPBACK 24 /* This is an SNMP constant from rfc1213 */
00063 #endif/*IFENT_SOFTWARE_LOOPBACK*/
00064 
00065 #define INDEX_IS_LOOPBACK 0x00800000
00066 
00067 /* Type declarations */
00068 
00069 #ifndef IFNAMSIZ
00070 #define IFNAMSIZ 0x20
00071 #endif/*IFNAMSIZ*/
00072 
00073 #define TCP_REQUEST_QUERY_INFORMATION_INIT { { { 0 } } }
00074 #define TCP_REQUEST_SET_INFORMATION_INIT { { 0 } }
00075 
00076 /* FIXME: ROS headers suck */
00077 #ifndef GAA_FLAG_SKIP_UNICAST
00078 #define GAA_FLAG_SKIP_UNICAST      0x0001
00079 #endif
00080 
00081 #ifndef GAA_FLAG_SKIP_FRIENDLY_NAME
00082 #define GAA_FLAG_SKIP_FRIENDLY_NAME 0x0020
00083 #endif
00084 
00085 // As in the mib from RFC 1213
00086 
00087 typedef struct _IPRouteEntry {
00088     ULONG ire_dest;
00089     ULONG ire_index;            //matches if_index in IFEntry and iae_index in IPAddrEntry
00090     ULONG ire_metric1;
00091     ULONG ire_metric2;
00092     ULONG ire_metric3;
00093     ULONG ire_metric4;
00094     ULONG ire_gw;
00095     ULONG ire_type;
00096     ULONG ire_proto;
00097     ULONG ire_age;
00098     ULONG ire_mask;
00099     ULONG ire_metric5;
00100     ULONG ire_info;
00101 } IPRouteEntry;
00102 
00103 /* No caddr_t in reactos headers */
00104 typedef char *caddr_t;
00105 
00106 typedef union _IFEntrySafelySized {
00107     CHAR MaxSize[sizeof(DWORD) +
00108          sizeof(IFEntry) +
00109          MAX_ADAPTER_DESCRIPTION_LENGTH + 1];
00110     IFEntry ent;
00111 } IFEntrySafelySized;
00112 
00113 typedef union _TCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY {
00114     CHAR MaxSize[sizeof(TCP_REQUEST_SET_INFORMATION_EX) - 1 +
00115          sizeof(IPRouteEntry)];
00116     TCP_REQUEST_SET_INFORMATION_EX Req;
00117 } TCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY,
00118     *PTCP_REQUEST_SET_INFORMATION_EX_ROUTE_ENTRY;
00119 
00120 typedef union _TCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY {
00121     CHAR MaxSize[sizeof(TCP_REQUEST_SET_INFORMATION_EX) - 1 +
00122          sizeof(MIB_IPNETROW)];
00123     TCP_REQUEST_SET_INFORMATION_EX Req;
00124 } TCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY,
00125     *PTCP_REQUEST_SET_INFORMATION_EX_ARP_ENTRY;
00126 
00127 /* Encapsulates information about an interface */
00128 typedef struct _IFInfo {
00129     TDIEntityID        entity_id;
00130     IFEntrySafelySized if_info;
00131     IPAddrEntry        ip_addr;
00132 } IFInfo;
00133 
00134 typedef struct _IP_SET_DATA {
00135     ULONG NteContext;
00136     ULONG NewAddress;
00137     ULONG NewNetmask;
00138 } IP_SET_DATA, *PIP_SET_DATA;
00139 
00140 typedef enum _IPHLPAddrType {
00141     IPAAddr, IPABcast, IPAMask, IFMtu, IFStatus
00142 } IPHLPAddrType;
00143 
00145 NTSTATUS getNthIpEntity( HANDLE tcpFile, DWORD index, TDIEntityID *ent );
00146 NTSTATUS tdiGetIpAddrsForIpEntity( HANDLE tcpFile, TDIEntityID *ent,
00147                    IPAddrEntry **addrs, PDWORD numAddrs );
00148 int GetLongestChildKeyName( HANDLE RegHandle );
00149 LONG OpenChildKeyRead( HANDLE RegHandle,
00150                PWCHAR ChildKeyName,
00151                PHKEY ReturnHandle );
00152 PWCHAR GetNthChildKeyName( HANDLE RegHandle, DWORD n );
00153 void ConsumeChildKeyName( PWCHAR Name );
00154 PWCHAR QueryRegistryValueString( HANDLE RegHandle, PWCHAR ValueName );
00155 PWCHAR *QueryRegistryValueStringMulti( HANDLE RegHandle, PWCHAR ValueName );
00156 void ConsumeRegValueString( PWCHAR NameServer );
00157 BOOL isInterface( TDIEntityID *if_maybe );
00158 BOOL hasArp( HANDLE tcpFile, TDIEntityID *arp_maybe );
00159 
00160 typedef VOID (*EnumNameServersFunc)( PWCHAR Interface,
00161                      PWCHAR NameServer,
00162                      PVOID Data );
00163 LSTATUS EnumNameServers( HKEY RegHandle, LPWSTR Interface, PVOID Data, EnumNameServersFunc cb );
00164 NTSTATUS getIPAddrEntryForIf(HANDLE tcpFile,
00165                              char *name,
00166                              DWORD index,
00167                              IFInfo *ifInfo);
00168 
00169 #include <w32api.h>
00170 /* This is here until we switch to version 2.5 of the mingw headers */
00171 #if (__W32API_MAJOR_VERSION < 2 || __W32API_MINOR_VERSION < 5)
00172 BOOL WINAPI
00173 GetComputerNameExA(COMPUTER_NAME_FORMAT,LPSTR,LPDWORD);
00174 #endif
00175 
00176 #endif/*IPPRIVATE_H*/

Generated on Mon May 28 2012 04:23:52 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.