Qt 4.8
qnetworkinterface_win_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtNetwork module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QNETWORKINTERFACE_WIN_P_H
43 #define QNETWORKINTERFACE_WIN_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists for the convenience
50 // of the QLibrary class. This header file may change from
51 // version to version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include <winsock2.h>
57 #include <qt_windows.h>
58 #include <time.h>
59 
61 
62 #ifndef GAA_FLAG_INCLUDE_ALL_INTERFACES
63 # define GAA_FLAG_INCLUDE_ALL_INTERFACES 0x0100
64 #endif
65 #ifndef MAX_ADAPTER_ADDRESS_LENGTH
66 // definitions from iptypes.h
67 # define MAX_ADAPTER_DESCRIPTION_LENGTH 128 // arb.
68 # define MAX_ADAPTER_NAME_LENGTH 256 // arb.
69 # define MAX_ADAPTER_ADDRESS_LENGTH 8 // arb.
70 # define DEFAULT_MINIMUM_ENTITIES 32 // arb.
71 # define MAX_HOSTNAME_LEN 128 // arb.
72 # define MAX_DOMAIN_NAME_LEN 128 // arb.
73 # define MAX_SCOPE_ID_LEN 256 // arb.
74 
75 # define GAA_FLAG_SKIP_UNICAST 0x0001
76 # define GAA_FLAG_SKIP_ANYCAST 0x0002
77 # define GAA_FLAG_SKIP_MULTICAST 0x0004
78 # define GAA_FLAG_SKIP_DNS_SERVER 0x0008
79 # define GAA_FLAG_INCLUDE_PREFIX 0x0010
80 # define GAA_FLAG_SKIP_FRIENDLY_NAME 0x0020
81 
82 # define IP_ADAPTER_DDNS_ENABLED 0x01
83 # define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX 0x02
84 # define IP_ADAPTER_DHCP_ENABLED 0x04
85 # define IP_ADAPTER_RECEIVE_ONLY 0x08
86 # define IP_ADAPTER_NO_MULTICAST 0x10
87 # define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x20
88 
89 # define MIB_IF_TYPE_OTHER 1
90 # define MIB_IF_TYPE_ETHERNET 6
91 # define MIB_IF_TYPE_TOKENRING 9
92 # define MIB_IF_TYPE_FDDI 15
93 # define MIB_IF_TYPE_PPP 23
94 # define MIB_IF_TYPE_LOOPBACK 24
95 # define MIB_IF_TYPE_SLIP 28
96 
97 #endif
98 // copied from qnativesocketengine_win.cpp
99 struct qt_in6_addr {
100  u_char qt_s6_addr[16];
101 };
102 typedef struct {
103  short sin6_family; /* AF_INET6 */
104  u_short sin6_port; /* Transport level port number */
105  u_long sin6_flowinfo; /* IPv6 flow information */
106  struct qt_in6_addr sin6_addr; /* IPv6 address */
107  u_long sin6_scope_id; /* set of interfaces for a scope */
109 
110 // copied from MSDN online help
111 typedef enum {
118 
119 typedef enum {
127 
128 typedef enum {
134 } IP_DAD_STATE;
135 
136 typedef enum {
145 
147  union {
148  ULONGLONG Alignment;
149  struct {
150  ULONG Length;
151  DWORD Flags;
152  };
153  };
155  SOCKET_ADDRESS Address;
163 
164 typedef struct _IP_ADAPTER_ANYCAST_ADDRESS
166 
167 typedef struct _IP_ADAPTER_MULTICAST_ADDRESS
170 
171 typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS
174 
175 typedef struct _IP_ADAPTER_PREFIX {
176  union {
177  ULONGLONG Alignment;
178  struct {
179  ULONG Length;
180  DWORD Flags;
181  };
182  };
184  SOCKET_ADDRESS Address;
188 
189 typedef struct _IP_ADAPTER_ADDRESSES {
190  union {
191  ULONGLONG Alignment;
192  struct {
193  ULONG Length;
194  DWORD IfIndex;
195  };
196  };
198  PCHAR AdapterName;
199  PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress;
203  PWCHAR DnsSuffix;
204  PWCHAR Description;
205  PWCHAR FriendlyName;
208  DWORD Flags;
209  DWORD Mtu;
210  DWORD IfType;
212  DWORD Ipv6IfIndex;
213  DWORD ZoneIndices[16];
214  PIP_ADAPTER_PREFIX FirstPrefix;
217 
218 typedef struct {
219  char String[4 * 4];
221 
222 typedef struct _IP_ADDR_STRING {
225  IP_MASK_STRING IpMask;
226  DWORD Context;
227 } IP_ADDR_STRING,
229 
230 typedef struct _IP_ADAPTER_INFO {
232  DWORD ComboIndex;
237  DWORD Index;
238  UINT Type;
240  PIP_ADDR_STRING CurrentIpAddress;
244  BOOL HaveWins;
249 } IP_ADAPTER_INFO,
251 
252 typedef struct {
253  char HostName[MAX_HOSTNAME_LEN + 4];
254  char DomainName[MAX_DOMAIN_NAME_LEN + 4];
255  PIP_ADDR_STRING CurrentDnsServer;
257  UINT NodeType;
258  char ScopeId[MAX_SCOPE_ID_LEN + 4];
261  UINT EnableDns;
263 
265 
266 #endif
struct _IP_ADAPTER_ANYCAST_ADDRESS IP_ADAPTER_ANYCAST_ADDRESS
char Description[MAX_ADAPTER_DESCRIPTION_LENGTH+4]
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
struct _IP_ADAPTER_INFO IP_ADAPTER_INFO
#define MAX_ADAPTER_DESCRIPTION_LENGTH
#define BYTE
#define MAX_ADAPTER_ADDRESS_LENGTH
struct _IP_ADAPTER_PREFIX * PIP_ADAPTER_PREFIX
IP_ADDRESS_STRING IpAddress
struct _IP_ADDR_STRING * Next
IP_ADDR_STRING SecondaryWinsServer
PIP_ADAPTER_MULTICAST_ADDRESS FirstMulticastAddress
PIP_ADDR_STRING CurrentDnsServer
struct _IP_ADAPTER_MULTICAST_ADDRESS IP_ADAPTER_MULTICAST_ADDRESS
struct _IP_ADAPTER_UNICAST_ADDRESS IP_ADAPTER_UNICAST_ADDRESS
char AdapterName[MAX_ADAPTER_NAME_LENGTH+4]
#define MAX_HOSTNAME_LEN
#define u_char
struct _IP_ADAPTER_MULTICAST_ADDRESS * PIP_ADAPTER_MULTICAST_ADDRESS
#define MAX_DOMAIN_NAME_LEN
struct IP_ADDRESS_STRING IP_MASK_STRING
PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
#define u_long
struct _IP_ADAPTER_PREFIX IP_ADAPTER_PREFIX
unsigned long time_t
BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH]
#define u_short
struct FIXED_INFO * PFIXED_INFO
struct _IP_ADAPTER_DNS_SERVER_ADDRESS * PIP_ADAPTER_DNS_SERVER_ADDRESS
BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH]
struct _IP_ADAPTER_UNICAST_ADDRESS * Next
struct _IP_ADAPTER_DNS_SERVER_ADDRESS IP_ADAPTER_DNS_SERVER_ADDRESS
struct IP_ADDRESS_STRING * PIP_MASK_STRING
struct _IP_ADAPTER_ADDRESSES * PIP_ADAPTER_ADDRESSES
struct _IP_ADAPTER_PREFIX * Next
#define MAX_SCOPE_ID_LEN
u_char qt_s6_addr[16]
#define MAX_ADAPTER_NAME_LENGTH
PIP_ADAPTER_DNS_SERVER_ADDRESS FirstDnsServerAddress
struct _IP_ADAPTER_ANYCAST_ADDRESS * PIP_ADAPTER_ANYCAST_ADDRESS
struct _IP_ADAPTER_ADDRESSES * Next
IP_ADDR_STRING PrimaryWinsServer
struct _IP_ADAPTER_UNICAST_ADDRESS * PIP_ADAPTER_UNICAST_ADDRESS
struct _IP_ADAPTER_ADDRESSES IP_ADAPTER_ADDRESSES
PIP_ADDR_STRING CurrentIpAddress
IP_ADDR_STRING DnsServerList
PIP_ADAPTER_ANYCAST_ADDRESS FirstAnycastAddress
struct _IP_ADDR_STRING IP_ADDR_STRING
struct _IP_ADAPTER_INFO * Next
struct _IP_ADDR_STRING * PIP_ADDR_STRING
struct _IP_ADAPTER_INFO * PIP_ADAPTER_INFO
PIP_ADAPTER_PREFIX FirstPrefix
IP_ADDR_STRING IpAddressList
struct IP_ADDRESS_STRING * PIP_ADDRESS_STRING