ifndef _IFDEF_
define _IFDEF_

include winapifamily.inc

if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

include ipifcons.inc

NET_IF_COMPARTMENT_ID	typedef UINT32
PNET_IF_COMPARTMENT_ID	typedef ptr UINT32

define NET_IF_COMPARTMENT_ID_UNSPECIFIED  0
define NET_IF_COMPARTMENT_ID_PRIMARY	  1

NET_IF_NETWORK_GUID	typedef GUID
PNET_IF_NETWORK_GUID	typedef ptr GUID

.enum _NET_IF_OPER_STATUS {
    NET_IF_OPER_STATUS_UP = 1,
    NET_IF_OPER_STATUS_DOWN = 2,
    NET_IF_OPER_STATUS_TESTING = 3,
    NET_IF_OPER_STATUS_UNKNOWN = 4,
    NET_IF_OPER_STATUS_DORMANT = 5,
    NET_IF_OPER_STATUS_NOT_PRESENT = 6,
    NET_IF_OPER_STATUS_LOWER_LAYER_DOWN = 7
    }
NET_IF_OPER_STATUS	typedef _NET_IF_OPER_STATUS
PNET_IF_OPER_STATUS	typedef ptr _NET_IF_OPER_STATUS

NET_IF_OBJECT_ID	typedef ULONG32
PNET_IF_OBJECT_ID	typedef ptr ULONG32

.enum _NET_IF_ADMIN_STATUS {
    NET_IF_ADMIN_STATUS_UP = 1,
    NET_IF_ADMIN_STATUS_DOWN = 2,
    NET_IF_ADMIN_STATUS_TESTING = 3
    }
NET_IF_ADMIN_STATUS	typedef _NET_IF_ADMIN_STATUS
PNET_IF_ADMIN_STATUS	typedef ptr _NET_IF_ADMIN_STATUS

define NET_IF_OPER_STATUS_DOWN_NOT_AUTHENTICATED	   0x00000001
define NET_IF_OPER_STATUS_DOWN_NOT_MEDIA_CONNECTED	   0x00000002
define NET_IF_OPER_STATUS_DORMANT_PAUSED		   0x00000004
define NET_IF_OPER_STATUS_DORMANT_LOW_POWER		   0x00000008

NET_IF_COMPARTMENT_SCOPE  typedef UINT32
PNET_IF_COMPARTMENT_SCOPE typedef ptr UINT32

define NET_IF_COMPARTMENT_SCOPE_UNSPECIFIED	0
define NET_IF_COMPARTMENT_SCOPE_ALL		(-1)

define NET_IF_OID_IF_ALIAS	       0x00000001
define NET_IF_OID_COMPARTMENT_ID       0x00000002
define NET_IF_OID_NETWORK_GUID	       0x00000003
define NET_IF_OID_IF_ENTRY	       0x00000004

define NET_SET_UNSPECIFIED_NETWORK_GUID(_pNetworkGuid)
define NET_IS_UNSPECIFIED_NETWORK_GUID(_NetworkGuidValue)

define NET_SITEID_UNSPECIFIED (0)
define NET_SITEID_MAXUSER (0x07ffffff)
define NET_SITEID_MAXSYSTEM (0x0fffffff)
C_ASSERT(NET_SITEID_MAXUSER lt NET_SITEID_MAXSYSTEM)

.enum _NET_IF_RCV_ADDRESS_TYPE {
    NET_IF_RCV_ADDRESS_TYPE_OTHER = 1,
    NET_IF_RCV_ADDRESS_TYPE_VOLATILE = 2,
    NET_IF_RCV_ADDRESS_TYPE_NON_VOLATILE = 3
    }
NET_IF_RCV_ADDRESS_TYPE typedef _NET_IF_RCV_ADDRESS_TYPE
PNET_IF_RCV_ADDRESS_TYPE typedef ptr _NET_IF_RCV_ADDRESS_TYPE


NET_IF_RCV_ADDRESS_LH	STRUC
ifRcvAddressType	NET_IF_RCV_ADDRESS_TYPE ?
ifRcvAddressLength	dw ?
ifRcvAddressOffset	dw ?
NET_IF_RCV_ADDRESS_LH	ENDS
PNET_IF_RCV_ADDRESS_LH	typedef ptr NET_IF_RCV_ADDRESS_LH

NET_IF_ALIAS_LH		STRUC
ifAliasLength		dw ?
ifAliasOffset		dw ?
NET_IF_ALIAS_LH		ENDS
PNET_IF_ALIAS_LH	typedef ptr NET_IF_ALIAS_LH

NET_LUID_LH		UNION
Value			ULONG64 ?
struct Info
 record
  Reserved		ULONG64 : 24 ?
  NetLuidIndex		ULONG64 : 24 ?
  IfType		ULONG64 : 16 ?
 ends
ends
NET_LUID_LH		ENDS
PNET_LUID_LH		typedef ptr NET_LUID_LH


if (NTDDI_VERSION GE NTDDI_VISTA)
NET_IF_RCV_ADDRESS	typedef NET_IF_RCV_ADDRESS_LH
PNET_IF_RCV_ADDRESS	typedef ptr NET_IF_RCV_ADDRESS
NET_IF_ALIAS		typedef NET_IF_ALIAS_LH
PNET_IF_ALIAS		typedef ptr NET_IF_ALIAS
endif

NET_LUID		typedef NET_LUID_LH
PNET_LUID		typedef ptr NET_LUID
IF_LUID			typedef NET_LUID
PIF_LUID		typedef ptr NET_LUID
NET_IFINDEX		typedef DWORD
PNET_IFINDEX		typedef ptr DWORD
NET_IFTYPE		typedef WORD
PNET_IFTYPE		typedef ptr WORD

NET_IFINDEX_UNSPECIFIED equ (0)
NET_IFLUID_UNSPECIFIED	equ (0)

define NET_IFINDEX_UNSPECIFIED (0)
define NET_IFLUID_UNSPECIFIED (0)

ifndef __IF_INDEX_DEFINED__
define __IF_INDEX_DEFINED__
endif

IF_INDEX		typedef NET_IFINDEX
PIF_INDEX		typedef ptr NET_IFINDEX

.enum _NET_IF_CONNECTION_TYPE {
   NET_IF_CONNECTION_DEDICATED = 1,
   NET_IF_CONNECTION_PASSIVE = 2,
   NET_IF_CONNECTION_DEMAND = 3,
   NET_IF_CONNECTION_MAXIMUM = 4
   }
NET_IF_CONNECTION_TYPE	typedef _NET_IF_CONNECTION_TYPE
PNET_IF_CONNECTION_TYPE typedef ptr _NET_IF_CONNECTION_TYPE

.enum TUNNEL_TYPE {
    TUNNEL_TYPE_NONE = 0,
    TUNNEL_TYPE_OTHER = 1,
    TUNNEL_TYPE_DIRECT = 2,
    TUNNEL_TYPE_6TO4 = 11,
    TUNNEL_TYPE_ISATAP = 13,
    TUNNEL_TYPE_TEREDO = 14,
    TUNNEL_TYPE_IPHTTPS = 15,
    }
PTUNNEL_TYPE		typedef ptr TUNNEL_TYPE

define IFI_UNSPECIFIED NET_IFINDEX_UNSPECIFIED

define NIIF_HARDWARE_INTERFACE	       0x00000001
define NIIF_FILTER_INTERFACE	       0x00000002
define NIIF_NDIS_RESERVED1	       0x00000004
define NIIF_NDIS_RESERVED2	       0x00000008
define NIIF_NDIS_RESERVED3	       0x00000010
define NIIF_NDIS_WDM_INTERFACE	       0x00000020
define NIIF_NDIS_ENDPOINT_INTERFACE    0x00000040
define NIIF_NDIS_ISCSI_INTERFACE       0x00000080
define NIIF_NDIS_RESERVED4	       0x00000100

define NIIF_WAN_TUNNEL_TYPE_UNKNOWN    (-1)

.enum _NET_IF_ACCESS_TYPE {
    NET_IF_ACCESS_LOOPBACK = 1,
    NET_IF_ACCESS_BROADCAST = 2,
    NET_IF_ACCESS_POINT_TO_POINT = 3,
    NET_IF_ACCESS_POINT_TO_MULTI_POINT = 4,
    NET_IF_ACCESS_MAXIMUM = 5
    }
NET_IF_ACCESS_TYPE	typedef _NET_IF_ACCESS_TYPE
PNET_IF_ACCESS_TYPE	typedef ptr _NET_IF_ACCESS_TYPE


.enum _NET_IF_DIRECTION_TYPE {
    NET_IF_DIRECTION_SENDRECEIVE,
    NET_IF_DIRECTION_SENDONLY,
    NET_IF_DIRECTION_RECEIVEONLY,
    NET_IF_DIRECTION_MAXIMUM
    }
NET_IF_DIRECTION_TYPE	typedef _NET_IF_DIRECTION_TYPE
PNET_IF_DIRECTION_TYPE	typedef ptr _NET_IF_DIRECTION_TYPE


.enum _NET_IF_MEDIA_CONNECT_STATE {
    MediaConnectStateUnknown,
    MediaConnectStateConnected,
    MediaConnectStateDisconnected
    }
NET_IF_MEDIA_CONNECT_STATE  typedef _NET_IF_MEDIA_CONNECT_STATE
PNET_IF_MEDIA_CONNECT_STATE typedef ptr _NET_IF_MEDIA_CONNECT_STATE

define NET_IF_LINK_SPEED_UNKNOWN   (-1)

.enum _NET_IF_MEDIA_DUPLEX_STATE {
    MediaDuplexStateUnknown,
    MediaDuplexStateHalf,
    MediaDuplexStateFull
    }
NET_IF_MEDIA_DUPLEX_STATE  typedef _NET_IF_MEDIA_DUPLEX_STATE
PNET_IF_MEDIA_DUPLEX_STATE typedef ptr _NET_IF_MEDIA_DUPLEX_STATE


define NIIF_BUS_NUMBER_UNKNOWN	       (-1)
define NIIF_SLOT_NUMBER_UNKNOWN	       (-1)
define NIIF_FUNCTION_NUMBER_UNKNOWN    (-1)

NET_PHYSICAL_LOCATION_LH STRUC
BusNumber		ULONG ?
SlotNumber		ULONG ?
FunctionNumber		ULONG ?
NET_PHYSICAL_LOCATION_LH ENDS
PNET_PHYSICAL_LOCATION_LH typedef ptr NET_PHYSICAL_LOCATION_LH

define IF_MAX_STRING_SIZE 256

IF_COUNTED_STRING_LH	STRUC
Length			dw ?
String			WCHAR IF_MAX_STRING_SIZE + 1 dup(?)
IF_COUNTED_STRING_LH	ENDS
PIF_COUNTED_STRING_LH	typedef ptr IF_COUNTED_STRING_LH

define IF_MAX_PHYS_ADDRESS_LENGTH 32

IF_PHYSICAL_ADDRESS_LH	STRUC
Length			dw ?
Address			db IF_MAX_PHYS_ADDRESS_LENGTH dup(?)
IF_PHYSICAL_ADDRESS_LH	ENDS
PIF_PHYSICAL_ADDRESS_LH typedef ptr IF_PHYSICAL_ADDRESS_LH

if (NTDDI_VERSION GE NTDDI_VISTA)
NET_PHYSICAL_LOCATION	typedef NET_PHYSICAL_LOCATION_LH
PNET_PHYSICAL_LOCATION	typedef ptr NET_PHYSICAL_LOCATION
IF_COUNTED_STRING	typedef IF_COUNTED_STRING_LH
PIF_COUNTED_STRING	typedef ptr IF_COUNTED_STRING
IF_PHYSICAL_ADDRESS	typedef IF_PHYSICAL_ADDRESS_LH
PIF_PHYSICAL_ADDRESS	typedef ptr IF_PHYSICAL_ADDRESS
endif

.enum _IF_ADMINISTRATIVE_STATE {
    IF_ADMINISTRATIVE_DISABLED,
    IF_ADMINISTRATIVE_ENABLED,
    IF_ADMINISTRATIVE_DEMANDDIAL,
    }
IF_ADMINISTRATIVE_STATE typedef _IF_ADMINISTRATIVE_STATE
PIF_ADMINISTRATIVE_STATE typedef ptr _IF_ADMINISTRATIVE_STATE

.enum IF_OPER_STATUS {
    IfOperStatusUp = 1,
    IfOperStatusDown,
    IfOperStatusTesting,
    IfOperStatusUnknown,
    IfOperStatusDormant,
    IfOperStatusNotPresent,
    IfOperStatusLowerLayerDown
    }


_NDIS_INTERFACE_INFORMATION STRUC
ifOperStatus		NET_IF_OPER_STATUS ?
ifOperStatusFlags	ULONG ?
MediaConnectState	NET_IF_MEDIA_CONNECT_STATE ?
MediaDuplexState	NET_IF_MEDIA_DUPLEX_STATE ?
ifMtu			ULONG ?
ifPromiscuousMode	BOOLEAN ?
ifDeviceWakeUpEnable	BOOLEAN ?
XmitLinkSpeed		ULONG64 ?
RcvLinkSpeed		ULONG64 ?
ifLastChange		ULONG64 ?
ifCounterDiscontinuityTime ULONG64 ?
ifInUnknownProtos	ULONG64 ?
ifInDiscards		ULONG64 ?
ifInErrors		ULONG64 ?
ifHCInOctets		ULONG64 ?
ifHCInUcastPkts		ULONG64 ?
ifHCInMulticastPkts	ULONG64 ?
ifHCInBroadcastPkts	ULONG64 ?
ifHCOutOctets		ULONG64 ?
ifHCOutUcastPkts	ULONG64 ?
ifHCOutMulticastPkts	ULONG64 ?
ifHCOutBroadcastPkts	ULONG64 ?
ifOutErrors		ULONG64 ?
ifOutDiscards		ULONG64 ?
ifHCInUcastOctets	ULONG64 ?
ifHCInMulticastOctets	ULONG64 ?
ifHCInBroadcastOctets	ULONG64 ?
ifHCOutUcastOctets	ULONG64 ?
ifHCOutMulticastOctets	ULONG64 ?
ifHCOutBroadcastOctets	ULONG64 ?
CompartmentId		NET_IF_COMPARTMENT_ID ?
SupportedStatistics	ULONG ?
_NDIS_INTERFACE_INFORMATION ENDS
NDIS_INTERFACE_INFORMATION  typedef NDIS_INTERFACE_INFORMATION
PNDIS_INTERFACE_INFORMATION typedef ptr NDIS_INTERFACE_INFORMATION

endif ;; WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

endif ;; _IFDEF_
