00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef IP_TYPES_INCLUDED
00034 #define IP_TYPES_INCLUDED
00035
00036 #if _MSC_VER > 1000
00037 #pragma once
00038 #endif
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00044 #pragma warning(push)
00045 #pragma warning(disable:4201)
00046
00047 #include <time.h>
00048
00049
00050
00051 #define MAX_ADAPTER_DESCRIPTION_LENGTH 128 // arb.
00052 #define MAX_ADAPTER_NAME_LENGTH 256 // arb.
00053 #define MAX_ADAPTER_ADDRESS_LENGTH 8 // arb.
00054 #define DEFAULT_MINIMUM_ENTITIES 32 // arb.
00055 #define MAX_HOSTNAME_LEN 128 // arb.
00056 #define MAX_DOMAIN_NAME_LEN 128 // arb.
00057 #define MAX_SCOPE_ID_LEN 256 // arb.
00058
00059
00060
00061
00062
00063
00064
00065 #define BROADCAST_NODETYPE 1
00066 #define PEER_TO_PEER_NODETYPE 2
00067 #define MIXED_NODETYPE 4
00068 #define HYBRID_NODETYPE 8
00069
00070
00071
00072
00073
00074 typedef struct {
00075 char String[4 * 4];
00076 } IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
00077
00078
00079
00080
00081
00082
00083 typedef struct _IP_ADDR_STRING {
00084 struct _IP_ADDR_STRING* Next;
00085 IP_ADDRESS_STRING IpAddress;
00086 IP_MASK_STRING IpMask;
00087 DWORD Context;
00088 } IP_ADDR_STRING, *PIP_ADDR_STRING;
00089
00090
00091
00092
00093
00094
00095 typedef struct _IP_ADAPTER_INFO {
00096 struct _IP_ADAPTER_INFO* Next;
00097 DWORD ComboIndex;
00098 char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
00099 char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
00100 UINT AddressLength;
00101 BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
00102 DWORD Index;
00103 UINT Type;
00104 UINT DhcpEnabled;
00105 PIP_ADDR_STRING CurrentIpAddress;
00106 IP_ADDR_STRING IpAddressList;
00107 IP_ADDR_STRING GatewayList;
00108 IP_ADDR_STRING DhcpServer;
00109 BOOL HaveWins;
00110 IP_ADDR_STRING PrimaryWinsServer;
00111 IP_ADDR_STRING SecondaryWinsServer;
00112 time_t LeaseObtained;
00113 time_t LeaseExpires;
00114 } IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
00115
00116 #ifdef _WINSOCK2API_
00117
00118
00119
00120
00121
00122 typedef enum {
00123 IpPrefixOriginOther = 0,
00124 IpPrefixOriginManual,
00125 IpPrefixOriginWellKnown,
00126 IpPrefixOriginDhcp,
00127 IpPrefixOriginRouterAdvertisement,
00128 } IP_PREFIX_ORIGIN;
00129
00130 typedef enum {
00131 IpSuffixOriginOther = 0,
00132 IpSuffixOriginManual,
00133 IpSuffixOriginWellKnown,
00134 IpSuffixOriginDhcp,
00135 IpSuffixOriginLinkLayerAddress,
00136 IpSuffixOriginRandom,
00137 } IP_SUFFIX_ORIGIN;
00138
00139 typedef enum {
00140 IpDadStateInvalid = 0,
00141 IpDadStateTentative,
00142 IpDadStateDuplicate,
00143 IpDadStateDeprecated,
00144 IpDadStatePreferred,
00145 } IP_DAD_STATE;
00146
00147 typedef struct _IP_ADAPTER_UNICAST_ADDRESS {
00148 union {
00149 ULONGLONG Alignment;
00150 struct {
00151 ULONG Length;
00152 DWORD Flags;
00153 };
00154 };
00155 struct _IP_ADAPTER_UNICAST_ADDRESS *Next;
00156 SOCKET_ADDRESS Address;
00157
00158 IP_PREFIX_ORIGIN PrefixOrigin;
00159 IP_SUFFIX_ORIGIN SuffixOrigin;
00160 IP_DAD_STATE DadState;
00161
00162 ULONG ValidLifetime;
00163 ULONG PreferredLifetime;
00164 ULONG LeaseLifetime;
00165 } IP_ADAPTER_UNICAST_ADDRESS, *PIP_ADAPTER_UNICAST_ADDRESS;
00166
00167 typedef struct _IP_ADAPTER_ANYCAST_ADDRESS {
00168 union {
00169 ULONGLONG Alignment;
00170 struct {
00171 ULONG Length;
00172 DWORD Flags;
00173 };
00174 };
00175 struct _IP_ADAPTER_ANYCAST_ADDRESS *Next;
00176 SOCKET_ADDRESS Address;
00177 } IP_ADAPTER_ANYCAST_ADDRESS, *PIP_ADAPTER_ANYCAST_ADDRESS;
00178
00179 typedef struct _IP_ADAPTER_MULTICAST_ADDRESS {
00180 union {
00181 ULONGLONG Alignment;
00182 struct {
00183 ULONG Length;
00184 DWORD Flags;
00185 };
00186 };
00187 struct _IP_ADAPTER_MULTICAST_ADDRESS *Next;
00188 SOCKET_ADDRESS Address;
00189 } IP_ADAPTER_MULTICAST_ADDRESS, *PIP_ADAPTER_MULTICAST_ADDRESS;
00190
00191
00192
00193
00194 #define IP_ADAPTER_ADDRESS_DNS_ELIGIBLE 0x01
00195 #define IP_ADAPTER_ADDRESS_TRANSIENT 0x02
00196
00197 typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS {
00198 union {
00199 ULONGLONG Alignment;
00200 struct {
00201 ULONG Length;
00202 DWORD Reserved;
00203 };
00204 };
00205 struct _IP_ADAPTER_DNS_SERVER_ADDRESS *Next;
00206 SOCKET_ADDRESS Address;
00207 } IP_ADAPTER_DNS_SERVER_ADDRESS, *PIP_ADAPTER_DNS_SERVER_ADDRESS;
00208
00209 typedef struct _IP_ADAPTER_PREFIX {
00210 union {
00211 ULONGLONG Alignment;
00212 struct {
00213 ULONG Length;
00214 DWORD Flags;
00215 };
00216 };
00217 struct _IP_ADAPTER_PREFIX *Next;
00218 SOCKET_ADDRESS Address;
00219 ULONG PrefixLength;
00220 } IP_ADAPTER_PREFIX, *PIP_ADAPTER_PREFIX;
00221
00222
00223
00224
00225 #define IP_ADAPTER_DDNS_ENABLED 0x01
00226 #define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX 0x02
00227 #define IP_ADAPTER_DHCP_ENABLED 0x04
00228 #define IP_ADAPTER_RECEIVE_ONLY 0x08
00229 #define IP_ADAPTER_NO_MULTICAST 0x10
00230 #define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x20
00231
00232
00233
00234
00235 typedef enum {
00236 IfOperStatusUp = 1,
00237 IfOperStatusDown,
00238 IfOperStatusTesting,
00239 IfOperStatusUnknown,
00240 IfOperStatusDormant,
00241 IfOperStatusNotPresent,
00242 IfOperStatusLowerLayerDown
00243 } IF_OPER_STATUS;
00244
00245
00246
00247
00248 typedef enum {
00249 ScopeLevelInterface = 1,
00250 ScopeLevelLink = 2,
00251 ScopeLevelSubnet = 3,
00252 ScopeLevelAdmin = 4,
00253 ScopeLevelSite = 5,
00254 ScopeLevelOrganization = 8,
00255 ScopeLevelGlobal = 14
00256 } SCOPE_LEVEL;
00257
00258 typedef struct _IP_ADAPTER_ADDRESSES {
00259 union {
00260 ULONGLONG Alignment;
00261 struct {
00262 ULONG Length;
00263 DWORD IfIndex;
00264 };
00265 };
00266 struct _IP_ADAPTER_ADDRESSES *Next;
00267 PCHAR AdapterName;
00268 PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress;
00269 PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress;
00270 PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress;
00271 PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress;
00272 PWCHAR DnsSuffix;
00273 PWCHAR Description;
00274 PWCHAR FriendlyName;
00275 BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
00276 DWORD PhysicalAddressLength;
00277 DWORD Flags;
00278 DWORD Mtu;
00279 DWORD IfType;
00280 IF_OPER_STATUS OperStatus;
00281 DWORD Ipv6IfIndex;
00282 DWORD ZoneIndices[16];
00283 PIP_ADAPTER_PREFIX FirstPrefix;
00284 } IP_ADAPTER_ADDRESSES, *PIP_ADAPTER_ADDRESSES;
00285
00286
00287
00288
00289
00290
00291 #define GAA_FLAG_SKIP_UNICAST 0x0001
00292 #define GAA_FLAG_SKIP_ANYCAST 0x0002
00293 #define GAA_FLAG_SKIP_MULTICAST 0x0004
00294 #define GAA_FLAG_SKIP_DNS_SERVER 0x0008
00295 #define GAA_FLAG_INCLUDE_PREFIX 0x0010
00296 #define GAA_FLAG_SKIP_FRIENDLY_NAME 0x0020
00297
00298 #endif
00299
00300
00301
00302
00303
00304 typedef struct _IP_PER_ADAPTER_INFO {
00305 UINT AutoconfigEnabled;
00306 UINT AutoconfigActive;
00307 PIP_ADDR_STRING CurrentDnsServer;
00308 IP_ADDR_STRING DnsServerList;
00309 } IP_PER_ADAPTER_INFO, *PIP_PER_ADAPTER_INFO;
00310
00311
00312
00313
00314
00315 typedef struct {
00316 char HostName[MAX_HOSTNAME_LEN + 4] ;
00317 char DomainName[MAX_DOMAIN_NAME_LEN + 4];
00318 PIP_ADDR_STRING CurrentDnsServer;
00319 IP_ADDR_STRING DnsServerList;
00320 UINT NodeType;
00321 char ScopeId[MAX_SCOPE_ID_LEN + 4];
00322 UINT EnableRouting;
00323 UINT EnableProxy;
00324 UINT EnableDns;
00325 } FIXED_INFO, *PFIXED_INFO;
00326
00327 #ifndef IP_INTERFACE_NAME_INFO_DEFINED
00328 #define IP_INTERFACE_NAME_INFO_DEFINED
00329
00330 typedef struct ip_interface_name_info {
00331 ULONG Index;
00332 ULONG MediaType;
00333 UCHAR ConnectionType;
00334 UCHAR AccessType;
00335 GUID DeviceGuid;
00336
00337 GUID InterfaceGuid;
00338
00339 } IP_INTERFACE_NAME_INFO, *PIP_INTERFACE_NAME_INFO;
00340
00341 #endif
00342
00343 #pragma warning(pop)
00344
00345 #ifdef __cplusplus
00346 }
00347 #endif
00348
00349 #endif