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