1 /***********************************************************************\
2 *                               iptypes.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                           by Stewart Gordon                           *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module win32.iptypes;
12 version(Windows):
13 
14 import win32.windef;
15 version(Tango){
16     private import tango.stdc.time;
17 }else{
18     private import std.c.time;
19 }
20 //#include <sys/types.h>
21 
22 const size_t
23 	DEFAULT_MINIMUM_ENTITIES       =  32,
24 	MAX_ADAPTER_ADDRESS_LENGTH     =   8,
25 	MAX_ADAPTER_DESCRIPTION_LENGTH = 128,
26 	MAX_ADAPTER_NAME_LENGTH        = 256,
27 	MAX_DOMAIN_NAME_LEN            = 128,
28 	MAX_HOSTNAME_LEN               = 128,
29 	MAX_SCOPE_ID_LEN               = 256;
30 
31 const UINT
32 	BROADCAST_NODETYPE    = 1,
33 	PEER_TO_PEER_NODETYPE = 2,
34 	MIXED_NODETYPE        = 4,
35 	HYBRID_NODETYPE       = 8;
36 
37 enum : UINT {
38 	IF_OTHER_ADAPTERTYPE,
39 	IF_ETHERNET_ADAPTERTYPE,
40 	IF_TOKEN_RING_ADAPTERTYPE,
41 	IF_FDDI_ADAPTERTYPE,
42 	IF_PPP_ADAPTERTYPE,
43 	IF_LOOPBACK_ADAPTERTYPE // = 5
44 }
45 
46 struct IP_ADDRESS_STRING {
47 	char[16] String;
48 }
49 alias IP_ADDRESS_STRING IP_MASK_STRING;
50 alias IP_ADDRESS_STRING* PIP_ADDRESS_STRING, PIP_MASK_STRING;
51 
52 struct IP_ADDR_STRING {
53 	IP_ADDR_STRING*   Next;
54 	IP_ADDRESS_STRING IpAddress;
55 	IP_MASK_STRING    IpMask;
56 	DWORD             Context;
57 }
58 alias IP_ADDR_STRING* PIP_ADDR_STRING;
59 
60 struct IP_ADAPTER_INFO {
61 	IP_ADAPTER_INFO* Next;
62 	DWORD ComboIndex;
63 	char[MAX_ADAPTER_NAME_LENGTH+4]        AdapterName;
64 	char[MAX_ADAPTER_DESCRIPTION_LENGTH+4] Description;
65 	UINT             AddressLength;
66 	BYTE[MAX_ADAPTER_ADDRESS_LENGTH]       Address;
67 	DWORD            Index;
68 	UINT             Type;
69 	UINT             DhcpEnabled;
70 	PIP_ADDR_STRING  CurrentIpAddress;
71 	IP_ADDR_STRING   IpAddressList;
72 	IP_ADDR_STRING   GatewayList;
73 	IP_ADDR_STRING   DhcpServer;
74 	BOOL             HaveWins;
75 	IP_ADDR_STRING   PrimaryWinsServer;
76 	IP_ADDR_STRING   SecondaryWinsServer;
77 	time_t           LeaseObtained;
78 	time_t           LeaseExpires;
79 }
80 alias IP_ADAPTER_INFO* PIP_ADAPTER_INFO;
81 
82 struct IP_PER_ADAPTER_INFO {
83 	UINT AutoconfigEnabled;
84 	UINT AutoconfigActive;
85 	PIP_ADDR_STRING CurrentDnsServer;
86 	IP_ADDR_STRING DnsServerList;
87 }
88 alias IP_PER_ADAPTER_INFO* PIP_PER_ADAPTER_INFO;
89 
90 struct FIXED_INFO {
91 	char[MAX_HOSTNAME_LEN+4]    HostName;
92 	char[MAX_DOMAIN_NAME_LEN+4] DomainName;
93 	PIP_ADDR_STRING             CurrentDnsServer;
94 	IP_ADDR_STRING              DnsServerList;
95 	UINT                        NodeType;
96 	char[MAX_SCOPE_ID_LEN+4]    ScopeId;
97 	UINT                        EnableRouting;
98 	UINT                        EnableProxy;
99 	UINT                        EnableDns;
100 }
101 alias FIXED_INFO* PFIXED_INFO;