' ########################################################################################
' Microsoft Windows
' File: nldef.inc
' Contents: Basic network layer definitions.
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_nldef_PBI)
#DEFINE PBX_nldef_PBI
%EQUATE `NLDEF_INC = 1
'#define NL_MAX_METRIC_COMPONENT ((((ULONG) 1) << 31) - 1)
%EQUATE `NL_MAX_METRIC_COMPONENT = &H7FFFFFFF
' enum NL_PREFIX_ORIGIN
' //
' // These values are from iptypes.h.
' // They need to fit in a 4 bit field.
' //
%EQUATE `IpPrefixOriginOther = 0
%EQUATE `IpPrefixOriginManual = 1
%EQUATE `IpPrefixOriginWellKnown = 2
%EQUATE `IpPrefixOriginDhcp = 3
%EQUATE `IpPrefixOriginRouterAdvertisement = 4
%EQUATE `IpPrefixOriginUnchanged = &H10 ' 1 << 4
'//
'// TODO: Remove these definitions.
'//
%EQUATE `NlpoOther = %IpPrefixOriginOther
%EQUATE `NlpoManual = %IpPrefixOriginManual
%EQUATE `NlpoWellKnown = %IpPrefixOriginWellKnown
%EQUATE `NlpoDhcp = %IpPrefixOriginDhcp
%EQUATE `NlpoRouterAdvertisement = %IpPrefixOriginRouterAdvertisement
' enum NL_SUFFIX_ORIGIN
'//
'// TODO: Remove the Nlso* definitions.
'//
%EQUATE `NlsoOther = 0
%EQUATE `NlsoManual = 1
%EQUATE `NlsoWellKnown = 2
%EQUATE `NlsoDhcp = 3
%EQUATE `NlsoLinkLayerAddress = 4
%EQUATE `NlsoRandom = 5
'//
'// These values are from in iptypes.h.
'// They need to fit in a 4 bit field.
'//
%EQUATE `IpSuffixOriginOther = 0
%EQUATE `IpSuffixOriginManual = 1
%EQUATE `IpSuffixOriginWellKnown = 2
%EQUATE `IpSuffixOriginDhcp = 3
%EQUATE `IpSuffixOriginLinkLayerAddress = 4
%EQUATE `IpSuffixOriginRandom = 5
%EQUATE `IpSuffixOriginUnchanged = &H10 ' 1 << 4
' enum NL_DAD_STATE
'//
'// TODO: Remove the Nlds* definitions.
'//
%EQUATE `NldsInvalid = 0
%EQUATE `NldsTentative = 1
%EQUATE `NldsDuplicate = 2
%EQUATE `NldsDeprecated = 3
%EQUATE `NldsPreferred = 4
'//
'// These values are from in iptypes.h.
'//
%EQUATE `IpDadStateInvalid = 0
%EQUATE `IpDadStateTentative = 1
%EQUATE `IpDadStateDuplicate = 2
%EQUATE `IpDadStateDeprecated = 3
%EQUATE `IpDadStatePreferred = 4
'//
'// MIB_IPPROTO_* values were previously in iprtrmib.h.
'// PROTO_IP_* values were previously in routprot.h.
'//
'#define MAKE_ROUTE_PROTOCOL(suffix, value) \
' MIB_IPPROTO_ ## suffix = value, \
' PROTO_IP_ ## suffix = value
'//
'// Routing protocol values from RFC.
'//
' enum NL_ROUTE_PROTOCOL
'//
'// TODO: Remove the RouteProtocol* definitions.
'//
%EQUATE `RouteProtocolOther = 1
%EQUATE `RouteProtocolLocal = 2
%EQUATE `RouteProtocolNetMgmt = 3
%EQUATE `RouteProtocolIcmp = 4
%EQUATE `RouteProtocolEgp = 5
%EQUATE `RouteProtocolGgp = 6
%EQUATE `RouteProtocolHello = 7
%EQUATE `RouteProtocolRip = 8
%EQUATE `RouteProtocolIsIs = 9
%EQUATE `RouteProtocolEsIs = 10
%EQUATE `RouteProtocolCisco = 11
%EQUATE `RouteProtocolBbn = 12
%EQUATE `RouteProtocolOspf = 13
%EQUATE `RouteProtocolBgp = 14
%EQUATE `MIB_IPPROTO_OTHER = 1
%EQUATE `MIB_IPPROTO_LOCAL = 2
%EQUATE `MIB_IPPROTO_NETMGMT = 3
%EQUATE `MIB_IPPROTO_ICMP = 4
%EQUATE `MIB_IPPROTO_EGP = 5
%EQUATE `MIB_IPPROTO_GGP = 6
%EQUATE `MIB_IPPROTO_HELLO = 7
%EQUATE `MIB_IPPROTO_RIP = 8
%EQUATE `MIB_IPPROTO_IS_IS = 9
%EQUATE `MIB_IPPROTO_ES_IS = 10
%EQUATE `MIB_IPPROTO_CISCO = 11
%EQUATE `MIB_IPPROTO_BBN = 12
%EQUATE `MIB_IPPROTO_OSPF = 13
%EQUATE `MIB_IPPROTO_PROTOCOL = 14
'//
'// Windows-specific definitions.
'//
%EQUATE `MIB_IPPROTO_NT_AUTOSTATIC = 10002
%EQUATE `MIB_IPPROTO_NT_STATIC = 10006
%EQUATE `MIB_IPPROTO_NT_STATIC_NON_DOD = 10007
' enum NL_ADDRESS_TYPE
%EQUATE `NlatUnspecified = 0
%EQUATE `NlatUnicast = 1
%EQUATE `NlatAnycast = 2
%EQUATE `NlatMulticast = 3
%EQUATE `NlatBroadcast = 4
%EQUATE `NlatInvalid = 5
'//
'// NL_ROUTE_ORIGIN
'//
'// Define route origin values.
'//
' enum NL_ROUTE_ORIGIN
%EQUATE `NlroManual = 0
%EQUATE `NlroWellKnown = 1
%EQUATE `NlroDHCP = 2
%EQUATE `NlroRouterAdvertisement = 3
%EQUATE `Nlro6to4 = 4
'//
'// NL_NEIGHBOR_STATE
'//
'// Define network layer neighbor state. RFC 2461, section 7.3.2 has details.
'// Note: Only state names are documented, we chose the values used here.
'//
' enum NL_NEIGHBOR_STATE {
%EQUATE `NlnsUnreachable = 0
%EQUATE `NlnsIncomplete = 1
%EQUATE `NlnsProbe = 2
%EQUATE `NlnsDelay = 3
%EQUATE `NlnsStale = 4
%EQUATE `NlnsReachable = 5
%EQUATE `NlnsPermanent = 6
%EQUATE `NlnsMaximum = 7
' enum NL_LINK_LOCAL_ADDRESS_BEHAVIOR{
%EQUATE `LinkLocalAlwaysOff = 0 ' // Never use link locals.
%EQUATE `LinkLocalDelayed = 1 ' // Use link locals only if no other addresses.
 ' // (default for IPv4).
 ' // Legacy mapping: IPAutoconfigurationEnabled.
%EQUATE `LinkLocalAlwaysOn = 2 ' // Always use link locals (default for IPv6).
%EQUATE `LinkLocalUnchanged = -1
'typedef struct _NL_INTERFACE_OFFLOAD_ROD {
' BOOLEAN NlChecksumSupported : 1;
' BOOLEAN NlOptionsSupported : 1;
' BOOLEAN TlDatagramChecksumSupported : 1;
' BOOLEAN TlStreamChecksumSupported : 1;
' BOOLEAN TlStreamOptionsSupported : 1;
' BOOLEAN FastPathCompatible : 1;
' BOOLEAN TlLargeSendOffloadSupported : 1;
' BOOLEAN TlGiantSendOffloadSupported : 1;
'} NL_INTERFACE_OFFLOAD_ROD, *PNL_INTERFACE_OFFLOAD_ROD;
' // Size = 1 byte
TYPE NL_INTERFACE_OFFLOAD_ROD BYTE
 NlChecksumSupported AS BIT * 1 IN BYTE
 NlOptionsSupported AS BIT * 1
 TlDatagramChecksumSupported AS BIT * 1
 TlStreamChecksumSupported AS BIT * 1
 TlStreamOptionsSupported AS BIT * 1
 FastPathCompatible AS BIT * 1
 TlLargeSendOffloadSupported AS BIT * 1
 TlGiantSendOffloadSupported AS BIT * 1
END TYPE
' enum NL_ROUTER_DISCOVERY_BEHAVIOR {
%EQUATE `RouterDiscoveryDisabled = 0
%EQUATE `RouterDiscoveryEnabled = 1
%EQUATE `RouterDiscoveryDhcp = 2
%EQUATE `RouterDiscoveryUnchanged = -1
' enum NL_BANDWIDTH_FLAG {
%EQUATE `NlbwDisabled = 0
%EQUATE `NlbwEnabled = 1
%EQUATE `NlbwUnchanged = -1
' // Size = 24 bytes
TYPE NL_PATH_BANDWIDTH_ROD QWORD ' Must be 8 byte aligned
 Bandwidth AS QUAD ' ULONG64
 Instability AS QUAD ' ULONG64
 BandwidthPeaked AS BYTE ' BOOLEAN
END TYPE
' enum _NL_NETWORK_CATEGORY
%EQUATE `NetworkCategoryPublic = 0
%EQUATE `NetworkCategoryPrivate = 1
%EQUATE `NetworkCategoryDomainAuthenticated = 2
%EQUATE `NetworkCategoryUnchanged = -1 ' // used in a set operation
%EQUATE `NetworkCategoryUnknown = -1 ' // returned in a query operation
%EQUATE `NET_IF_CURRENT_SESSION = &HFFFFFFFF ' ((ULONG)-1)
#ENDIF
