2 * Copyright 2015 Hans Leidekker for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_NETIOAPI_H
20 #define __WINE_NETIOAPI_H
24 typedef enum _MIB_NOTIFICATION_TYPE
26 MibParameterNotification
,
29 MibInitialNotification
,
30 } MIB_NOTIFICATION_TYPE
, *PMIB_NOTIFICATION_TYPE
;
32 typedef struct _MIB_IF_ROW2
34 NET_LUID InterfaceLuid
;
35 NET_IFINDEX InterfaceIndex
;
37 WCHAR Alias
[IF_MAX_STRING_SIZE
+ 1];
38 WCHAR Description
[IF_MAX_STRING_SIZE
+ 1];
39 ULONG PhysicalAddressLength
;
40 UCHAR PhysicalAddress
[IF_MAX_PHYS_ADDRESS_LENGTH
];
41 UCHAR PermanentPhysicalAddress
[IF_MAX_PHYS_ADDRESS_LENGTH
];
44 TUNNEL_TYPE TunnelType
;
45 NDIS_MEDIUM MediaType
;
46 NDIS_PHYSICAL_MEDIUM PhysicalMediumType
;
47 NET_IF_ACCESS_TYPE AccessType
;
48 NET_IF_DIRECTION_TYPE DirectionType
;
51 BOOLEAN HardwareInterface
: 1;
52 BOOLEAN FilterInterface
: 1;
53 BOOLEAN ConnectorPresent
: 1;
54 BOOLEAN NotAuthenticated
: 1;
55 BOOLEAN NotMediaConnected
: 1;
58 BOOLEAN EndPointInterface
: 1;
59 } InterfaceAndOperStatusFlags
;
60 IF_OPER_STATUS OperStatus
;
61 NET_IF_ADMIN_STATUS AdminStatus
;
62 NET_IF_MEDIA_CONNECT_STATE MediaConnectState
;
63 NET_IF_NETWORK_GUID NetworkGuid
;
64 NET_IF_CONNECTION_TYPE ConnectionType
;
65 ULONG64 TransmitLinkSpeed
;
66 ULONG64 ReceiveLinkSpeed
;
72 ULONG64 InUnknownProtos
;
73 ULONG64 InUcastOctets
;
74 ULONG64 InMulticastOctets
;
75 ULONG64 InBroadcastOctets
;
78 ULONG64 OutNUcastPkts
;
81 ULONG64 OutUcastOctets
;
82 ULONG64 OutMulticastOctets
;
83 ULONG64 OutBroadcastOctets
;
85 } MIB_IF_ROW2
, *PMIB_IF_ROW2
;
87 typedef struct _MIB_IF_TABLE2
91 } MIB_IF_TABLE2
, *PMIB_IF_TABLE2
;
93 typedef struct _MIB_UNICASTIPADDRESS_ROW
95 SOCKADDR_INET Address
;
96 NET_LUID InterfaceLuid
;
97 NET_IFINDEX InterfaceIndex
;
98 NL_PREFIX_ORIGIN PrefixOrigin
;
99 NL_SUFFIX_ORIGIN SuffixOrigin
;
101 ULONG PreferredLifetime
;
102 UINT8 OnLinkPrefixLength
;
103 BOOLEAN SkipAsSource
;
104 NL_DAD_STATE DadState
;
106 LARGE_INTEGER CreationTimeStamp
;
107 } MIB_UNICASTIPADDRESS_ROW
, *PMIB_UNICASTIPADDRESS_ROW
;
109 typedef VOID (WINAPI
*PUNICAST_IPADDRESS_CHANGE_CALLBACK
)(PVOID
, PMIB_UNICASTIPADDRESS_ROW
,
110 MIB_NOTIFICATION_TYPE
);
112 DWORD WINAPI
ConvertInterfaceGuidToLuid(const GUID
*,NET_LUID
*);
113 DWORD WINAPI
ConvertInterfaceIndexToLuid(NET_IFINDEX
,NET_LUID
*);
114 DWORD WINAPI
ConvertInterfaceLuidToGuid(const NET_LUID
*,GUID
*);
115 DWORD WINAPI
ConvertInterfaceLuidToIndex(const NET_LUID
*,NET_IFINDEX
*);
116 DWORD WINAPI
ConvertInterfaceLuidToNameA(const NET_LUID
*,char*,SIZE_T
);
117 DWORD WINAPI
ConvertInterfaceLuidToNameW(const NET_LUID
*,WCHAR
*,SIZE_T
);
118 DWORD WINAPI
ConvertInterfaceNameToLuidA(const char*,NET_LUID
*);
119 DWORD WINAPI
ConvertInterfaceNameToLuidW(const WCHAR
*,NET_LUID
*);
120 void WINAPI
FreeMibTable(void*);
121 DWORD WINAPI
GetIfEntry2(MIB_IF_ROW2
*);
122 DWORD WINAPI
GetIfTable2(MIB_IF_TABLE2
**);
123 DWORD WINAPI
GetUnicastIpAddressEntry(MIB_UNICASTIPADDRESS_ROW
*);
125 #endif /* __WINE_NETIOAPI_H */