If a few things seem "disconnected" or "missing", or some of the comments seem odd or incomplete, its because I had to remove or change them for the posted code due to the proprietary requirements to be allowed to post the 'test bed' code and had to make it as 'generic' as possible before posting. This means that all the GUI stuff and the lists, along with some other things, were also removed but I put in a ton of debugs so you get the same information, so you can change it to suit your needs.
"interfaceinfo_enums_and_types.pbi"
Code: Select all
; this is XIncludeFile "interfaceinfo_enums_and_types.pbi"
; prototypes and init
Prototype PGetAdaptersAddresses(Family, Flags, Null, pAddresses, outBufLen)
Prototype PWSAAddressToString(lpsaAddress,dwAddressLength,lpProtocolInfo,lpszAddressString,lpdwAddressStringLength)
Prototype PConvertInterfaceLuidToIndex(pLUID, out_index)
Prototype PConvertInterfaceLuidToGuid(pLUID, out_guid)
Prototype PConvertConvertInterfaceGuidToLuid(pIn_GUID, pOut_LUID)
Prototype PGetIfEntry2(pIfRow)
Prototype PFreeMibTable(pIfRow)
Prototype PGetIpNetTable(pIpNetTable,pdwSize,bOrder)
Prototype PGetIpNetTable2(family, ptable)
Prototype PGetTeredoPort(torport)
Prototype PGetIpInterfaceTable(Family, Table)
Prototype PGetIpInterfaceEntry(in_out_pRow)
Prototype PInitializeIpInterfaceEntry(pRow)
Prototype Pif_indextoname(InterfaceIndex, InterfaceName)
Prototype PGetAdapterIndex(AdapterName, If_Index) ; AdapterName is LPWSTR A pointer to a Unicode string that specifies the name of the adapter
Prototype PGetIfTable2(pRow)
Prototype PRtlIpv6AddressToString(Addr, LPTSTR_S)
Prototype PRtlIpv4AddressToString(Addr, LPTSTR_S)
Prototype PInetNtop(Family, pAddr, pStringBuf, StringBufSize)
Prototype PGetIfStackTable(Tablex)
Prototype PGetIpNetEntry2(Row)
;Prototype PGetIpStatistics(pStats)
;
;Prototype PZeroMemory(pIf_Row, size)
;
Global GetIfEntry2.PGetIfEntry2
Global GetAdaptersAddresses.PGetAdaptersAddresses
Global ConvertInterfaceLuidToIndex.PConvertInterfaceLuidToIndex
Global ConvertInterfaceLuidToGuid.PConvertInterfaceLuidToGuid
Global ConvertInterfaceGuidToLuid.PConvertConvertInterfaceGuidToLuid
Global FreeMibTable.PFreeMibTable
Global WSAAddressToString.PWSAAddressToString
Global GetIpNetTable.PGetIpNetTable
Global GetIpNetTable2.PGetIpNetTable2
Global GetTeredoPort.PGetTeredoPort
Global GetIpInterfaceTable.PGetIpInterfaceTable
Global GetIpInterfaceEntry.PGetIpInterfaceEntry
Global InitializeIpInterfaceEntry.PInitializeIpInterfaceEntry
Global if_indextoname.Pif_indextoname
Global GetAdapterIndex.PGetAdapterIndex
Global GetIfTable2.PGetIfTable2
Global RtlIpv6AddressToString.PRtlIpv6AddressToString
Global RtlIpv4AddressToString.PRtlIpv4AddressToString
Global InetNtop.PInetNtop
Global GetIfStackTable.PGetIfStackTable
Global GetIpNetEntry2.PGetIpNetEntry2
;Global GetIpStatistics.PGetIpStatistics
;Global ZeroMemory.PZeroMemory
Procedure LoadLibraries()
Global Lib_iphlpapi.i, Lib_Winsock.i, Lib_Ntdll.i;, Lib_Kernel.i
Lib_iphlpapi = OpenLibrary(#PB_Any,"iphlpapi.dll")
If Lib_iphlpapi<> 0
GetAdaptersAddresses.PGetAdaptersAddresses=GetFunction(Lib_iphlpapi,"GetAdaptersAddresses")
ConvertInterfaceLuidToIndex.PConvertInterfaceLuidToIndex=GetFunction(Lib_iphlpapi,"ConvertInterfaceLuidToIndex")
ConvertInterfaceLuidToGuid.PConvertInterfaceLuidToGuid=GetFunction(Lib_iphlpapi,"ConvertInterfaceLuidToGuid")
ConvertInterfaceGuidToLuid.PConvertConvertInterfaceGuidToLuid=GetFunction(Lib_iphlpapi,"ConvertInterfaceGuidToLuid")
GetIfEntry2.PGetIfEntry2=GetFunction(Lib_iphlpapi,"GetIfEntry2")
FreeMibTable.PFreeMibTable=GetFunction(Lib_iphlpapi,"FreeMibTable")
GetIpNetTable.PGetIpNetTable=GetFunction(Lib_iphlpapi,"GetIpNetTable")
GetIpNetTable2.PGetIpNetTable2= GetFunction(Lib_iphlpapi,"GetIpNetTable2")
GetTeredoPort.PGetTeredoPort=GetFunction(Lib_iphlpapi,"GetTeredoPort")
GetIpInterfaceTable.PGetIpInterfaceTable=GetFunction(Lib_iphlpapi,"GetIpInterfaceTable")
GetIpInterfaceEntry.PGetIpInterfaceEntry=GetFunction(Lib_iphlpapi,"GetIpInterfaceEntry")
InitializeIpInterfaceEntry.PInitializeIpInterfaceEntry=GetFunction(Lib_iphlpapi,"InitializeIpInterfaceEntry")
if_indextoname.Pif_indextoname=GetFunction(Lib_iphlpapi,"if_indextoname")
GetAdapterIndex.PGetAdapterIndex=GetFunction(Lib_iphlpapi,"GetAdapterIndex")
GetIfTable2.PGetIfTable2=GetFunction(Lib_iphlpapi,"GetIfTable2")
GetIfStackTable.PGetIfStackTable=GetFunction(Lib_iphlpapi,"GetIfStackTable")
GetIpNetEntry2.PGetIpNetEntry2=GetFunction(Lib_iphlpapi,"GetIpNetEntry2")
;GetIpStatistics.PGetIpStatistics=GetFunction(Lib_iphlpapi,"GetIpStatistics")
EndIf
Lib_Winsock = OpenLibrary(#PB_Any,"ws2_32.dll")
If Lib_Winsock
CompilerIf #PB_Compiler_Unicode ; if compiled in unicode use this
WSAAddressToString.PWSAAddressToString=GetFunction(Lib_Winsock,"WSAAddressToStringW")
InetNtop.PInetNtop=GetFunction(Lib_Winsock,"InetNtopW")
CompilerElse ; if not compiled in unicode use this
WSAAddressToString.PWSAAddressToString=GetFunction(Lib_Winsock,"WSAAddressToStringA")
InetNtop.PInetNtop=GetFunction(Lib_Winsock,"inet_ntop")
CompilerEndIf
EndIf
Lib_Ntdll = OpenLibrary(#PB_Any,"Ntdll.dll")
If Lib_Ntdll
CompilerIf #PB_Compiler_Unicode ; if compiled in unicode use this
RtlIpv6AddressToString.PRtlIpv6AddressToString=GetFunction(Lib_Ntdll,"RtlIpv6AddressToStringW")
RtlIpv4AddressToString.PRtlIpv4AddressToString=GetFunction(Lib_Ntdll,"RtlIpv4AddressToStringW")
CompilerElse ; if not compiled in unicode use this
RtlIpv6AddressToString.PRtlIpv6AddressToString=GetFunction(Lib_Ntdll,"RtlIpv6AddressToStringA")
RtlIpv4AddressToString.PRtlIpv4AddressToString=GetFunction(Lib_Ntdll,"RtlIpv4AddressToStringA")
CompilerEndIf
EndIf
; Lib_Kernel = OpenLibrary(#PB_Any,"kernel32.dll")
; If Lib_Kernel
; ZeroMemory.PZeroMemory=GetFunction(Lib_Kernel,"RtlSecureZeroMemory")
; EndIf
If Lib_iphlpapi <> 0 And Lib_Winsock <> 0 And Lib_Ntdll <> 0 ;And Lib_Kernel <> 0
ProcedureReturn #True
Else
ProcedureReturn #False
EndIf
EndProcedure
;*****************************************************************************************
#ANY_SIZE = 1
;the family type values
#AF_UNSPEC = 0 ; unspecified
#AF_UNIX = 1 ; local To host (pipes, portals)
#AF_INET = 2 ; internetwork: UDP, TCP, etc. - IPv4
#AF_IMPLINK = 3 ; arpanet imp addresses
#AF_PUP = 4 ; pup protocols: e.g. BSP
#AF_CHAOS = 5 ; mit CHAOS protocols
#AF_NS = 6 ; XEROX NS protocols
#AF_IPX = #AF_NS ; IPX protocols: IPX, SPX, etc.
#AF_ISO = 7 ; ISO protocols
#AF_OSI = #AF_ISO ; OSI is ISO
#AF_ECMA = 8 ; european computer manufacturers
#AF_DATAKIT = 9 ; datakit protocols
#AF_CCITT = 10 ; CCITT protocols, X.25 etc
#AF_SNA = 11 ; IBM SNA
#AF_DECnet = 12 ; DECnet
#AF_DLI = 13 ; Direct Data link Interface
#AF_LAT = 14 ; LAT
#AF_HYLINK = 15 ; NSC Hyperchannel
#AF_APPLETALK = 16 ; AppleTalk
#AF_NETBIOS = 17 ; NetBios-style addresses
#AF_VOICEVIEW = 18 ; VoiceView
#AF_FIREFOX = 19 ; Protocols from Firefox
#AF_UNKNOWN1 = 20 ; Somebody is using this!
#AF_BAN = 21 ; Banyan
#AF_ATM = 22 ; Native ATM Services
#AF_INET6 = 23 ; Internetwork Version 6 - IPv6
#AF_CLUSTER = 24 ; Microsoft Wolfpack
#AF_12844 = 25 ; IEEE 1284.4 WG AF
#AF_IRDA = 26 ; IrDA
#AF_NETDES = 28 ; Network Designers OSI & gateway
; #if(_WIN32_WINNT < 0x0501)
; #AF_MAX = 29
; #else //(_WIN32_WINNT < 0x0501)
#AF_TCNPROCESS = 29
#AF_TCNMESSAGE = 30
#AF_ICLFXBM = 31
; #if(_WIN32_WINNT < 0x0600)
; #AF_MAX = 32
; #else //(_WIN32_WINNT < 0x0600)
#AF_BTH = 32 ; Bluetooth RFCOMM/L2CAP protocols
; #if(_WIN32_WINNT < 0x0601)
; #AF_MAX = 33
; #else //(_WIN32_WINNT < 0x0601)
#AF_LINK = 33
#AF_MAXx = 34 ; - this value is changed for this use - Purebasic has the wrong value for #AF_MAX as 18 - win 7 SDK has it as 34, no wonder i was getting crashes with my code, making my own variation with correct value fixed it
; #AF_INET = 2 = ipv4
#MAX_ADAPTER_NAME=128
#MAX_ADAPTER_NAME_LENGTH=256
#MAX_ADAPTER_DESCRIPTION_LENGTH=128
#MAX_ADAPTER_ADDRESS_LENGTH=8
#MAX_HOSTNAME_LEN = 128
#MAX_DOMAIN_NAME_LEN = 128
#MAX_SCOPE_ID_LEN = 256
#ERROR_UNKNOWN = 1776
#BROADCAST_NODETYPE = 1 ; A broadcast nodetype
#PEER_TO_PEER_NODETYPE = 2 ; A peer To peer nodetype
#MIXED_NODETYPE = 4 ; A mixed nodetype
#HYBRID_NODETYPE = 8 ; A hybrid nodetype
#MAX_DHCPV6_DUID_LENGTH = 130
#MAX_DNS_SUFFIX_STRING_LENGTH = 256
#DNS_MAX_NAME_BUFFER_LENGTH = 256
;"SKIP" = do not include
;"INCLUDE" = include
#GAA_FLAG_SKIP_UNICAST = $1
#GAA_FLAG_SKIP_ANYCAST = $2
#GAA_FLAG_SKIP_MULTICAST = $4
#GAA_FLAG_SKIP_DNS_SERVER = $8
#GAA_FLAG_INCLUDE_PREFIX = $10
#GAA_FLAG_SKIP_FRIENDLY_NAME = $20
#GAA_FLAG_INCLUDE_WINS_INFO = $40
#GAA_FLAG_INCLUDE_GATEWAYS = $80
#GAA_FLAG_INCLUDE_ALL_INTERFACES = $100
#GAA_FLAG_INCLUDE_ALL_COMPARTMENTS = $200 ; to get only the hardware interfaces
#GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER = $400
;
#GAA_FLAG_OMIT = #GAA_FLAG_SKIP_UNICAST | #GAA_FLAG_SKIP_ANYCAST | #GAA_FLAG_SKIP_MULTICAST | #GAA_FLAG_SKIP_DNS_SERVER | #GAA_FLAG_INCLUDE_PREFIX | #GAA_FLAG_SKIP_FRIENDLY_NAME
#GAA_FLAG_GET = #GAA_FLAG_INCLUDE_WINS_INFO | #GAA_FLAG_INCLUDE_GATEWAYS | #GAA_FLAG_INCLUDE_ALL_INTERFACES | #GAA_FLAG_INCLUDE_ALL_COMPARTMENTS | #GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER
;If this parameter is zero, then unicast, anycast, and multicast IP addresses will be returned
#GAA_FLAG_UNI_MULT_ANY = 0
#GAA_FLAG_INCLUDE_IP_PREFIX_STUFF = #GAA_FLAG_UNI_MULT_ANY ;| #GAA_FLAG_GET ;| #GAA_FLAG_INCLUDE_PREFIX ;|#GAA_FLAG_INCLUDE_GATEWAYS ;|#GAA_FLAG_INCLUDE_WINS_INFO ;|#GAA_FLAG_INCLUDE_ALL_COMPARTMENTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; buffer minimum address string lenghts
#INET_ADDRSTRLEN = 22
#INET6_ADDRSTRLEN = 65
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#IP_ADAPTER_DDNS_ENABLED = $00000001
#IP_ADAPTER_REGISTER_ADAPTER_SUFFIX = $00000002
#IP_ADAPTER_DHCP_ENABLED = $00000004
#IP_ADAPTER_RECEIVE_ONLY = $00000008
#IP_ADAPTER_NO_MULTICAST = $00000010
#IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG = $00000020
#IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED = $00000040
#IP_ADAPTER_IPV4_ENABLED = $00000080
#IP_ADAPTER_IPV6_ENABLED = $00000100
#IP_ADAPTER_IPV6_MANAGE_ADDRESS_CONFIG = $00000200
#ERROR_ADDRESS_NOT_ASSOCIATED = 1228
#IF_TYPE_OTHER = 1 ; "Some other type of network interface"
#IF_TYPE_ETHERNET_CSMACD = 6 ; "An Ethernet network interface"
#IF_TYPE_ISO88025_TOKENRING = 9 ; "A token ring network interface"
#IF_TYPE_PPP = 23 ; "A PPP network interface"
#IF_TYPE_SOFTWARE_LOOPBACK = 24 ; "A software loopback network interface"
#IF_TYPE_ATM = 37 ; "An ATM network interface"
#IF_TYPE_IEEE80211 = 71 ; "An IEEE 802.11 wireless network interface. On Windows Vista and later, wireless network cards are reported as IF_TYPE_IEEE80211. On earlier versions of Windows, wireless network cards are reported as IF_TYPE_ETHERNET_CSMACD"
#IF_TYPE_TUNNEL = 131 ; "A tunnel type encapsulation network interface"
#IF_TYPE_IEEE1394 = 144 ; "An IEEE 1394 (Firewire) high performance serial bus network interface"
;Bit values of IP_ADAPTER_ADDRESSES Flags field.
#IP_ADAPTER_DDNS_ENABLED = $1
#IP_ADAPTER_REGISTER_ADAPTER_SUFFIX = $2
#IP_ADAPTER_DHCP_ENABLED = $4
#IP_ADAPTER_RECEIVE_ONLY = $8
#IP_ADAPTER_NO_MULTICAST = $10
#IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG = $20
#IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED = $40
#IP_ADAPTER_IPV4_ENABLED = $80
#IP_ADAPTER_IPV6_ENABLED = $100
#IP_ADAPTER_IPV6_MANAGE_ADDRESS_CONFIG = $200
#MAXLEN_PHYSADDR = 8
#IP_ADAPTER_ADDRESS_DNS_ELIGIBLE = 1
#IP_ADAPTER_ADDRESS_TRANSIENT = 2
#FLAG_ICC_FORCE_CONNECTION = 1
#IF_MAX_STRING_SIZE = 256
#NDIS_IF_MAX_STRING_SIZE = #IF_MAX_STRING_SIZE
#IF_NAMESIZE = #IF_MAX_STRING_SIZE
;********************************************************************************
;compartment ID type
#IF_COMPARTMENT_ID_UNSPECIFIED = 0
#IF_COMPARTMENT_ID_PRIMARY = 1
;#NET_IF_OID_IF_ALIAS = $1 ;identifies the ifAlias string For an Interface
;#NET_IF_OID_COMPARTMENT_ID = $2 ;identifies the compartment ID For an Interface.
;#NET_IF_OID_NETWORK_GUID = $3 ;identifies the NetworkGuid For an Interface.
;#NET_IF_OID_IF_ENTRY = $4 ;identifies statistics For an Interface
;********************************************************************************
#IF_MAX_STRING_SIZE = 256
#IF_MAX_PHYS_ADDRESS_LENGTH = 32
#MIB_IPADDR_PRIMARY = $0001
#MIB_IPADDR_DYNAMIC = $0004
#MIB_IPADDR_DISCONNECTED = $0008
#MIB_IPADDR_DELETED = $0040
#MIB_IPADDR_TRANSIENT = $0080
#MIB_IPADDR_DNS_ELIGIBLE = $0100 ; Address is published in DNS.
; IF_Type
#MIN_IF_TYPE = 1
#IF_TYPE_OTHER = 1 ; None of the below
#IF_TYPE_REGULAR_1822 = 2
#IF_TYPE_HDH_1822 = 3
#IF_TYPE_DDN_X25 = 4
#IF_TYPE_RFC877_X25 = 5
#IF_TYPE_ETHERNET_CSMACD = 6
#IF_TYPE_IS088023_CSMACD = 7
#IF_TYPE_ISO88024_TOKENBUS = 8
#IF_TYPE_ISO88025_TOKENRING = 9
#IF_TYPE_ISO88026_MAN = 10
#IF_TYPE_STARLAN = 11
#IF_TYPE_PROTEON_10MBIT = 12
#IF_TYPE_PROTEON_80MBIT = 13
#IF_TYPE_HYPERCHANNEL = 14
#IF_TYPE_FDDI = 15
#IF_TYPE_LAP_B = 16
#IF_TYPE_SDLC = 17
#IF_TYPE_DS1 = 18 ; DS1-MIB
#IF_TYPE_E1 = 19 ; Obsolete; see DS1-MIB
#IF_TYPE_BASIC_ISDN = 20
#IF_TYPE_PRIMARY_ISDN = 21
#IF_TYPE_PROP_POINT2POINT_SERIAL = 22 ; proprietary serial
#IF_TYPE_PPP = 23
#IF_TYPE_SOFTWARE_LOOPBACK = 24
#IF_TYPE_EON = 25 ; CLNP over IP
#IF_TYPE_ETHERNET_3MBIT = 26
#IF_TYPE_NSIP = 27 ; XNS over IP
#IF_TYPE_SLIP = 28 ; Generic Slip
#IF_TYPE_ULTRA = 29 ; ULTRA Technologies
#IF_TYPE_DS3 = 30 ; DS3-MIB
#IF_TYPE_SIP = 31 ; SMDS, coffee
#IF_TYPE_FRAMERELAY = 32 ; DTE only
#IF_TYPE_RS232 = 33
#IF_TYPE_PARA = 34 ; Parallel port
#IF_TYPE_ARCNET = 35
#IF_TYPE_ARCNET_PLUS = 36
#IF_TYPE_ATM = 37 ; ATM cells
#IF_TYPE_MIO_X25 = 38
#IF_TYPE_SONET = 39 ; SONET Or SDH
#IF_TYPE_X25_PLE = 40
#IF_TYPE_ISO88022_LLC = 41
#IF_TYPE_LOCALTALK = 42
#IF_TYPE_SMDS_DXI = 43
#IF_TYPE_FRAMERELAY_SERVICE = 44 ; FRNETSERV-MIB
#IF_TYPE_V35 = 45
#IF_TYPE_HSSI = 46
#IF_TYPE_HIPPI = 47
#IF_TYPE_MODEM = 48 ; Generic Modem
#IF_TYPE_AAL5 = 49 ; AAL5 over ATM
#IF_TYPE_SONET_PATH = 50
#IF_TYPE_SONET_VT = 51
#IF_TYPE_SMDS_ICIP = 52 ; SMDS InterCarrier Interface
#IF_TYPE_PROP_VIRTUAL = 53 ; Proprietary virtual/internal
#IF_TYPE_PROP_MULTIPLEXOR = 54 ; Proprietary multiplexing
#IF_TYPE_IEEE80212 = 55 ; 100BaseVG
#IF_TYPE_FIBRECHANNEL = 56
#IF_TYPE_HIPPIINTERFACE = 57
#IF_TYPE_FRAMERELAY_INTERCONNECT = 58 ; Obsolete, use 32 Or 44
#IF_TYPE_AFLANE_8023 = 59 ; ATM Emulated LAN For 802.3
#IF_TYPE_AFLANE_8025 = 60 ; ATM Emulated LAN For 802.5
#IF_TYPE_CCTEMUL = 61 ; ATM Emulated circuit
#IF_TYPE_FASTETHER = 62 ; Fast Ethernet (100BaseT)
#IF_TYPE_ISDN = 63 ; ISDN And X.25
#IF_TYPE_V11 = 64 ; CCITT V.11/X.21
#IF_TYPE_V36 = 65 ; CCITT V.36
#IF_TYPE_G703_64K = 66 ; CCITT G703 at 64Kbps
#IF_TYPE_G703_2MB = 67 ; Obsolete; see DS1-MIB
#IF_TYPE_QLLC = 68 ; SNA QLLC
#IF_TYPE_FASTETHER_FX = 69 ; Fast Ethernet (100BaseFX)
#IF_TYPE_CHANNEL = 70
#IF_TYPE_IEEE80211 = 71 ; Radio spread spectrum
#IF_TYPE_IBM370PARCHAN = 72 ; IBM System 360/370 OEMI Channel
#IF_TYPE_ESCON = 73 ; IBM Enterprise Systems Connection
#IF_TYPE_DLSW = 74 ; Data Link Switching
#IF_TYPE_ISDN_S = 75 ; ISDN S/T Interface
#IF_TYPE_ISDN_U = 76 ; ISDN U Interface
#IF_TYPE_LAP_D = 77 ; Link Access Protocol D
#IF_TYPE_IPSWITCH = 78 ; IP Switching Objects
#IF_TYPE_RSRB = 79 ; Remote Source Route Bridging
#IF_TYPE_ATM_LOGICAL = 80 ; ATM Logical Port
#IF_TYPE_DS0 = 81 ; Digital Signal Level 0
#IF_TYPE_DS0_BUNDLE = 82 ; Group of ds0s on the same ds1
#IF_TYPE_BSC = 83 ; Bisynchronous Protocol
#IF_TYPE_ASYNC = 84 ; Asynchronous Protocol
#IF_TYPE_CNR = 85 ; Combat Net Radio
#IF_TYPE_ISO88025R_DTR = 86 ; ISO 802.5r DTR
#IF_TYPE_EPLRS = 87 ; Ext Pos Loc Report Sys
#IF_TYPE_ARAP = 88 ; Appletalk Remote Access Protocol
#IF_TYPE_PROP_CNLS = 89 ; Proprietary Connectionless Proto
#IF_TYPE_HOSTPAD = 90 ; CCITT-ITU X.29 PAD Protocol
#IF_TYPE_TERMPAD = 91 ; CCITT-ITU X.3 PAD Facility
#IF_TYPE_FRAMERELAY_MPI = 92 ; Multiproto Interconnect over FR
#IF_TYPE_X213 = 93 ; CCITT-ITU X213
#IF_TYPE_ADSL = 94 ; Asymmetric Digital Subscrbr Loop
#IF_TYPE_RADSL = 95 ; Rate-Adapt Digital Subscrbr Loop
#IF_TYPE_SDSL = 96 ; Symmetric Digital Subscriber Loop
#IF_TYPE_VDSL = 97 ; Very H-Speed Digital Subscrb Loop
#IF_TYPE_ISO88025_CRFPRINT = 98 ; ISO 802.5 CRFP
#IF_TYPE_MYRINET = 99 ; Myricom Myrinet
#IF_TYPE_VOICE_EM = 100 ; Voice recEive And transMit
#IF_TYPE_VOICE_FXO = 101 ; Voice Foreign Exchange Office
#IF_TYPE_VOICE_FXS = 102 ; Voice Foreign Exchange Station
#IF_TYPE_VOICE_ENCAP = 103 ; Voice encapsulation
#IF_TYPE_VOICE_OVERIP = 104 ; Voice over IP encapsulation
#IF_TYPE_ATM_DXI = 105 ; ATM DXI
#IF_TYPE_ATM_FUNI = 106 ; ATM FUNI
#IF_TYPE_ATM_IMA = 107 ; ATM IMA
#IF_TYPE_PPPMULTILINKBUNDLE = 108 ; PPP Multilink Bundle
#IF_TYPE_IPOVER_CDLC = 109 ; IBM ipOverCdlc
#IF_TYPE_IPOVER_CLAW = 110 ; IBM Common Link Access To Workstn
#IF_TYPE_STACKTOSTACK = 111 ; IBM stackToStack
#IF_TYPE_VIRTUALIPADDRESS = 112 ; IBM VIPA
#IF_TYPE_MPC = 113 ; IBM multi-proto channel support
#IF_TYPE_IPOVER_ATM = 114 ; IBM ipOverAtm
#IF_TYPE_ISO88025_FIBER = 115 ; ISO 802.5j Fiber Token Ring
#IF_TYPE_TDLC = 116 ; IBM twinaxial Data link control
#IF_TYPE_GIGABITETHERNET = 117
#IF_TYPE_HDLC = 118
#IF_TYPE_LAP_F = 119
#IF_TYPE_V37 = 120
#IF_TYPE_X25_MLP = 121 ; Multi-Link Protocol
#IF_TYPE_X25_HUNTGROUP = 122 ; X.25 Hunt Group
#IF_TYPE_TRANSPHDLC = 123
#IF_TYPE_INTERLEAVE = 124 ; Interleave channel
#IF_TYPE_FAST = 125 ; Fast channel
#IF_TYPE_IP = 126 ; IP (For APPN HPR in IP networks)
#IF_TYPE_DOCSCABLE_MACLAYER = 127 ; CATV Mac Layer
#IF_TYPE_DOCSCABLE_DOWNSTREAM = 128 ; CATV Downstream Interface
#IF_TYPE_DOCSCABLE_UPSTREAM = 129 ; CATV Upstream Interface
#IF_TYPE_A12MPPSWITCH = 130 ; Avalon Parallel Processor
#IF_TYPE_TUNNEL = 131 ; Encapsulation Interface
#IF_TYPE_COFFEE = 132 ; Coffee pot
#IF_TYPE_CES = 133 ; Circuit Emulation Service
#IF_TYPE_ATM_SUBINTERFACE = 134 ; ATM Sub Interface
#IF_TYPE_L2_VLAN = 135 ; Layer 2 Virtual LAN using 802.1Q
#IF_TYPE_L3_IPVLAN = 136 ; Layer 3 Virtual LAN using IP
#IF_TYPE_L3_IPXVLAN = 137 ; Layer 3 Virtual LAN using IPX
#IF_TYPE_DIGITALPOWERLINE = 138 ; IP over Power Lines
#IF_TYPE_MEDIAMAILOVERIP = 139 ; Multimedia Mail over IP
#IF_TYPE_DTM = 140 ; Dynamic syncronous Transfer Mode
#IF_TYPE_DCN = 141 ; Data Communications Network
#IF_TYPE_IPFORWARD = 142 ; IP Forwarding Interface
#IF_TYPE_MSDSL = 143 ; Multi-rate Symmetric DSL
#IF_TYPE_IEEE1394 = 144 ; IEEE1394 High Perf Serial Bus
#IF_TYPE_IF_GSN = 145
#IF_TYPE_DVBRCC_MACLAYER = 146
#IF_TYPE_DVBRCC_DOWNSTREAM = 147
#IF_TYPE_DVBRCC_UPSTREAM = 148
#IF_TYPE_ATM_VIRTUAL = 149
#IF_TYPE_MPLS_TUNNEL = 150
#IF_TYPE_SRP = 151
#IF_TYPE_VOICEOVERATM = 152
#IF_TYPE_VOICEOVERFRAMERELAY = 153
#IF_TYPE_IDSL = 154
#IF_TYPE_COMPOSITELINK = 155
#IF_TYPE_SS7_SIGLINK = 156
#IF_TYPE_PROP_WIRELESS_P2P = 157
#IF_TYPE_FR_FORWARD = 158
#IF_TYPE_RFC1483 = 159
#IF_TYPE_USB = 160
#IF_TYPE_IEEE8023AD_LAG = 161
#IF_TYPE_BGP_POLICY_ACCOUNTING = 162
#IF_TYPE_FRF16_MFR_BUNDLE = 163
#IF_TYPE_H323_GATEKEEPER = 164
#IF_TYPE_H323_PROXY = 165
#IF_TYPE_MPLS = 166
#IF_TYPE_MF_SIGLINK = 167
#IF_TYPE_HDSL2 = 168
#IF_TYPE_SHDSL = 169
#IF_TYPE_DS1_FDL = 170
#IF_TYPE_POS = 171
#IF_TYPE_DVB_ASI_IN = 172
#IF_TYPE_DVB_ASI_OUT = 173
#IF_TYPE_PLC = 174
#IF_TYPE_NFAS = 175
#IF_TYPE_TR008 = 176
#IF_TYPE_GR303_RDT = 177
#IF_TYPE_GR303_IDT = 178
#IF_TYPE_ISUP = 179
#IF_TYPE_PROP_DOCS_WIRELESS_MACLAYER = 180
#IF_TYPE_PROP_DOCS_WIRELESS_DOWNSTREAM = 181
#IF_TYPE_PROP_DOCS_WIRELESS_UPSTREAM = 182
#IF_TYPE_HIPERLAN2 = 183
#IF_TYPE_PROP_BWA_P2MP = 184
#IF_TYPE_SONET_OVERHEAD_CHANNEL = 185
#IF_TYPE_DIGITAL_WRAPPER_OVERHEAD_CHANNEL = 186
#IF_TYPE_AAL2 = 187
#IF_TYPE_RADIO_MAC = 188
#IF_TYPE_ATM_RADIO = 189
#IF_TYPE_IMT = 190
#IF_TYPE_MVL = 191
#IF_TYPE_REACH_DSL = 192
#IF_TYPE_FR_DLCI_ENDPT = 193
#IF_TYPE_ATM_VCI_ENDPT = 194
#IF_TYPE_OPTICAL_CHANNEL = 195
#IF_TYPE_OPTICAL_TRANSPORT = 196
#IF_TYPE_IEEE80216_WMAN = 237
#IF_TYPE_WWANPP = 243 ; WWAN devices based on GSM technology
#IF_TYPE_WWANPP2 = 244 ; WWAN devices based on CDMA technology
#MAX_IF_TYPE = 244
; Access types
;****************************************************************************
Enumeration ;_#IF_ACCESS_TYPE {
#IF_ACCESS_LOOPBACK = 1
#IF_ACCESS_BROADCAST = 2
#IF_ACCESS_POINT_TO_POINT = 3 ; New definition.
#IF_ACCESS_POINT_TO_MULTI_POINT = 4 ; New definition.
#NET_IF_ACCESS_MAXIMUM = 5 ; The maximum possible value for the NET_IF_ACCESS_TYPE enumeration type. This is not a legal value for AccessType member.
EndEnumeration
;****************************************************************************
; Interface Capabilities (bit flags)
;****************************************************************************
#IF_CHECK_NONE = $0
#IF_CHECK_MCAST = $1
#IF_CHECK_SEND = $2
;****************************************************************************
; Flags To extend operational status - used for NDIS driver/IF status
;
#NET_IF_OPER_STATUS_DOWN_NOT_AUTHENTICATED = $1
#NET_IF_OPER_STATUS_DOWN_NOT_MEDIA_CONNECTED = $2
#NET_IF_OPER_STATUS_DORMANT_PAUSED = $4
#NET_IF_OPER_STATUS_DORMANT_LOW_POWER = $8
;****************************************************************************
; Connection Types
;****************************************************************************
Enumeration ; NET_IF_CONNECTION_TYPE
#NET_IF_CONNECTION_DEDICATED = 1
#NET_IF_CONNECTION_PASSIVE = 2
#NET_IF_CONNECTION_DEMAND = 3
#NET_IF_CONNECTION_MAXIMUM = 4
EndEnumeration
#IF_CONNECTION_DEDICATED = 1
#IF_CONNECTION_PASSIVE = 2
#IF_CONNECTION_DEMAND = 3
#IF_ADMIN_STATUS_UP = 1
#IF_ADMIN_STATUS_DOWN = 2
#IF_ADMIN_STATUS_TESTING = 3
;***************************************************************************
; ;
; The following are the the operational states For WAN And LAN interfaces. ;
; The order of the states seems weird, but is done For a purpose. All ;
; states >= CONNECTED can transmit Data right away. States >= DISCONNECTED ;
; can tx Data but some set up might be needed. States < DISCONNECTED can ;
; Not transmit Data. ;
; A card is marked UNREACHABLE If Dim calls InterfaceUnreachable For ;
; reasons other than failure To connect. ;
; ;
; NON_OPERATIONAL -- Valid For LAN Interfaces. Means the card is Not ;
; working Or Not plugged in Or has no address. ;
; UNREACHABLE -- Valid For WAN Interfaces. Means the remote site is ;
; Not reachable at this time. ;
; DISCONNECTED -- Valid For WAN Interfaces. Means the remote site is ;
; Not connected at this time. ;
; CONNECTING -- Valid For WAN Interfaces. Means a connection attempt ;
; has been initiated To the remote site. ;
; CONNECTED -- Valid For WAN Interfaces. Means the remote site is ;
; connected. ;
; OPERATIONAL -- Valid For LAN Interfaces. Means the card is plugged ;
; in And working. ;
; ;
; It is the users duty To convert these values To MIB-II values If they ;
; are To be used by a subagent ;
; ;
;***************************************************************************
Enumeration ; _INTERNAL_IF_OPER_STATUS
#IF_OPER_STATUS_NON_OPERATIONAL = 0
#IF_OPER_STATUS_UNREACHABLE = 1
#IF_OPER_STATUS_DISCONNECTED = 2
#IF_OPER_STATUS_CONNECTING = 3
#IF_OPER_STATUS_CONNECTED = 4
#IF_OPER_STATUS_OPERATIONAL = 5
EndEnumeration
#MIB_IF_TYPE_OTHER = 1
#MIB_IF_TYPE_ETHERNET = 6
#MIB_IF_TYPE_TOKENRING = 9
#MIB_IF_TYPE_FDDI = 15
#MIB_IF_TYPE_PPP = 23
#MIB_IF_TYPE_LOOPBACK = 24
#MIB_IF_TYPE_SLIP = 28
#MIB_IF_ADMIN_STATUS_UP = 1
#MIB_IF_ADMIN_STATUS_DOWN = 2
#MIB_IF_ADMIN_STATUS_TESTING = 3
;Medium the Ndis Driver is running on (OID_GEN_MEDIA_SUPPORTED/ OID_GEN_MEDIA_IN_USE).
Enumeration ; _#Ndis_MEDIUM
#NdisMedium802_3
#NdisMedium802_5
#NdisMediumFddi
#NdisMediumWan
#NdisMediumLocalTalk
#NdisMediumDix ;defined For convenience, Not a real medium
#NdisMediumArcnetRaw
#NdisMediumArcnet878_2
#NdisMediumAtm
#NdisMediumWirelessWan
#NdisMediumIrda
#NdisMediumBpc
#NdisMediumCoWan
#NdisMedium1394
#NdisMediumInfiniBand
#NdisMediumTunnel
#NdisMediumNative802_11
#NdisMediumLoopback
#NdisMediumWiMAX
#NdisMediumIP
#NdisMediumMax ; Not a real medium, defined As an upper-bound
EndEnumeration
;Physical Medium Type definitions.
Enumeration ; _NDIS_PHYSICAL_MEDIUM
#NdisPhysicalMediumUnspecified
#NdisPhysicalMediumWirelessLan
#NdisPhysicalMediumCableModem
#NdisPhysicalMediumPhoneLine
#NdisPhysicalMediumPowerLine
#NdisPhysicalMediumDSL ; includes ADSL And UADSL (G.Lite)
#NdisPhysicalMediumFibreChannel
#NdisPhysicalMedium1394
#NdisPhysicalMediumWirelessWan
#NdisPhysicalMediumNative802_11
#NdisPhysicalMediumBluetooth
#NdisPhysicalMediumInfiniband
#NdisPhysicalMediumWiMax
#NdisPhysicalMediumUWB
#NdisPhysicalMedium802_3
#NdisPhysicalMedium802_5
#NdisPhysicalMediumIrda
#NdisPhysicalMediumWiredWAN
#NdisPhysicalMediumWiredCoWan
#NdisPhysicalMediumOther
#NdisPhysicalMediumMax ; Not a real physical type defined As an upper-bound
EndEnumeration
Enumeration ;#NET_IF_DIRECTION_TYPE
#NET_IF_DIRECTION_SENDRECEIVE
#NET_IF_DIRECTION_SENDONLY
#NET_IF_DIRECTION_RECEIVEONLY
#NET_IF_DIRECTION_MAXIMUM
EndEnumeration
Enumeration ; _#NET_IF_ADMIN_STATUS
#NET_IF_ADMIN_STATUS_UP = 1
#NET_IF_ADMIN_STATUS_DOWN = 2
#NET_IF_ADMIN_STATUS_TESTING = 3
EndEnumeration
Enumeration ; NET_IF_MEDIA_CONNECT_STATE
#MediaConnectStateUnknown
#MediaConnectStateConnected
#MediaConnectStateDisconnected
EndEnumeration
Enumeration ; NET_IF_MEDIA_DUPLEX_STATE
#MediaDuplexStateUnknown
#MediaDuplexStateHalf
#MediaDuplexStateFull
EndEnumeration
Enumeration; _MIB_IF_TABLE_LEVEL
#MibIfTableNormal
#MibIfTableRaw
EndEnumeration
Enumeration; 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
EndEnumeration
;#MibIfTableNormal ; Calling the GetIfTable2Ex function with the Level parameter set to MibIfTableNormal retrieves the same results as calling the GetIfTable2 function.
;The values of statistics And state returned in members of the MIB_IF_ROW2 Structure in the MIB_IF_TABLE2 Structure pointed To by the Table parameter
;are returned from the top of the filter stack when this parameter is specified. Calling the GetIfTable2Ex function with the Level parameter set to
; MibIfTableNormal retrieves the same results as calling the GetIfTable2 function.
;#MibIfTableRaw ; The values of statistics and state returned in members of the MIB_IF_ROW2 Structure in the MIB_IF_TABLE2 Structure pointed To by the Table
;parameter are returned directly For the Interface being queried.
Enumeration
#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
EndEnumeration
Enumeration ; IF_OPER_STATUS - the type in MIB_IF_ROW2
#IfOperStatusUp = 1
#IfOperStatusDown
#IfOperStatusTesting
#IfOperStatusUnknown
#IfOperStatusDormant
#IfOperStatusNotPresent
#IfOperStatusLowerLayerDown
EndEnumeration
Enumeration ; IP_PREFIX_ORIGIN
#IpPrefixOriginOther = 0
#IpPrefixOriginManual
#IpPrefixOriginWellKnown
#IpPrefixOriginDhcp
#IpPrefixOriginRouterAdvertisement
#IpPrefixOriginUnchanged = 16
EndEnumeration
; Bit values of IP_ADAPTER_UNICAST_ADDRESS Flags field.
#IP_ADAPTER_ADDRESS_DNS_ELIGIBLE = $1
#IP_ADAPTER_ADDRESS_TRANSIENT = $2
Enumeration ;NET_ADDRESS_FORMAT
#NET_ADDRESS_FORMAT_UNSPECIFIED = 0
#NET_ADDRESS_DNS_NAME
#NET_ADDRESS_IPV4
#NET_ADDRESS_IPV6
EndEnumeration
Enumeration ; #MIB_IPNET_TYPE
#MIB_IPNET_TYPE_OTHER = 1
#MIB_IPNET_TYPE_INVALID = 2
#MIB_IPNET_TYPE_DYNAMIC = 3
#MIB_IPNET_TYPE_STATIC = 4
EndEnumeration
Enumeration ; #Scope_LEVEL
#ScopeLevelInterface = 1
#ScopeLevelLink = 2
#ScopeLevelSubnet = 3
#ScopeLevelAdmin = 4
#ScopeLevelSite = 5
#ScopeLevelOrganization = 8
#ScopeLevelGlobal = 14
#ScopeLevelCount = 16
EndEnumeration
Enumeration ; IP_PREFIX_ORIGIN flags
#IpPrefixOriginOther = 0
#IpPrefixOriginManual
#IpPrefixOriginWellKnown
#IpPrefixOriginDhcp
#IpPrefixOriginRouterAdvertisement
#IpPrefixOriginUnchanged = 16
EndEnumeration
Enumeration ;IP_SUFFIX_ORIGIN
#IpSuffixOriginOther = 0
#IpSuffixOriginManual
#IpSuffixOriginWellKnown
#IpSuffixOriginDhcp
#IpSuffixOriginLinkLayerAddress
#IpSuffixOriginRandom
#IpSuffixOriginUnchanged = 16
EndEnumeration
Enumeration ;IP_DAD_STATE
#IpDadStateInvalid = 0
#IpDadStateTentative
#IpDadStateDuplicate
#IpDadStateDeprecated
#IpDadStatePreferred
EndEnumeration
Enumeration ; MIB_IPSTATS_FORWARDING
#MIB_IP_FORWARDING = 1
#MIB_IP_NOT_FORWARDING = 2
EndEnumeration
;***************************************************************************
; ; utility and support procedures from here
;***************************************************************************
Procedure.s NDISMedium(in_media_type.i)
Select in_media_type
Case #NdisMedium802_3
ndismedium$ = "An Ethernet (802.3) network."
Case #NdisMedium802_5
ndismedium$ = "A Token Ring (802.5) network."
Case #NdisMediumFddi
ndismedium$ = "A Fiber Distributed Data Interface (FDDI) network."
Case #NdisMediumWan
ndismedium$ = "A wide area network (WAN). This type covers various forms of point-to-point and WAN NICs, as well as variant address/header formats that must be negotiated between the protocol driver and the underlying driver after the binding is established."
Case #NdisMediumLocalTalk
ndismedium$ = "A LocalTalk network."
Case #NdisMediumDix ;defined For convenience, Not a real medium
ndismedium$ = "An Ethernet network for which the drivers use the DIX Ethernet header format."
Case #NdisMediumArcnetRaw
ndismedium$ = "An ARCNET network."
Case #NdisMediumArcnet878_2
ndismedium$ = "An ARCNET (878.2) network."
Case #NdisMediumAtm
ndismedium$ = "An ATM network."
Case #NdisMediumWirelessWan
ndismedium$ = "A wireless network. Can also be for Mobile Broadband only on Windows 7."
Case #NdisMediumIrda
ndismedium$ = "An infrared (IrDA) network."
Case #NdisMediumBpc
ndismedium$ = "A broadcast PC network."
Case #NdisMediumCoWan
ndismedium$ = "A wide area network in a connection-oriented environment."
Case #NdisMedium1394
ndismedium$ = "An IEEE 1394 (fire wire) network."
Case #NdisMediumInfiniBand
ndismedium$ = "An InfiniBand network."
Case #NdisMediumTunnel
ndismedium$ = "A tunnel network."
Case #NdisMediumNative802_11
ndismedium$ = "A native IEEE 802.11 network."
Case #NdisMediumLoopback
ndismedium$ = "An NDIS loopback network."
Case #NdisMediumWiMAX
ndismedium$ = "A WiMax newtwork."
Case #NdisMediumIP
ndismedium$ = "Plain/Simple IP network."
Default
ndismedium$ = "The Media Type is unknown."
;Case #NdisMediumMax ; Not a real medium, defined As an upper-bound
EndSelect
ProcedureReturn ndismedium$
EndProcedure
Procedure.s NDIS_Physical_Medium(in_phys_medium_type.i)
Select in_phys_medium_type
Case #NdisPhysicalMediumUnspecified
physmedia$ = "The physical medium is unspecified. (Note: Also a normal condition for non-hardware interfaces.)"
Case #NdisPhysicalMediumWirelessLan
physmedia$ = "Packets are transferred over a wireless LAN network through a miniport driver that conforms to the 802.11 interface specification."
Case #NdisPhysicalMediumCableModem
physmedia$ = "Packets are transferred over a DOCSIS-based cable network."
Case #NdisPhysicalMediumPhoneLine
physmedia$ = "Packets are transferred over standard phone lines. This includes HomePNA media, for example."
Case #NdisPhysicalMediumPowerLine
physmedia$ = "Packets are transferred over wiring that is connected to a power distribution system."
Case #NdisPhysicalMediumDSL ; includes ADSL And UADSL (G.Lite)
physmedia$ = "Packets are transferred over a Digital Subscriber Line (DSL) network. This includes ADSL, UADSL (G.Lite), and SDSL, for example."
Case #NdisPhysicalMediumFibreChannel
physmedia$ = "Packets are transferred over a Fibre Channel interconnect."
Case #NdisPhysicalMedium1394
physmedia$ = "Packets are transferred over an IEEE 1394 bus."
Case #NdisPhysicalMediumWirelessWan
physmedia$ = "Packets are transferred over a Wireless WAN link. This includes CDPD, CDMA and GPRS, for example."
Case #NdisPhysicalMediumNative802_11
physmedia$ = "Packets are transferred over a wireless LAN network through a miniport driver that conforms to the Native 802.11 interface. Note: The Native 802.11 Interface is supported in NDIS 6.0 And later versions."
Case #NdisPhysicalMediumBluetooth
physmedia$ = "Packets are transferred over a Bluetooth network. Bluetooth is a short-range wireless technology that uses the 2.4 GHz spectrum."
Case #NdisPhysicalMediumInfiniband
physmedia$ = "Packets are transferred over an Infiniband interconnect."
Case #NdisPhysicalMediumWiMax
physmedia$ = "Packets are transferred over a WiMax network. "
Case #NdisPhysicalMediumUWB
physmedia$ = "Packets are transferred over an ultra wide band network."
Case #NdisPhysicalMedium802_3
physmedia$ = "Packets are transferred over an Ethernet (802.3) network."
Case #NdisPhysicalMedium802_5
physmedia$ = "Packets are transferred over a Token Ring (802.5) network."
Case #NdisPhysicalMediumIrda
physmedia$ = "Packets are transferred over an infrared (IrDA) network."
Case #NdisPhysicalMediumWiredWAN
physmedia$ = "Packets are transferred over a wired WAN network."
Case #NdisPhysicalMediumWiredCoWan
physmedia$ = "Packets are transferred over a wide area network in a connection-oriented environment."
Case #NdisPhysicalMediumOther
physmedia$ = "Packets are transferred over a network that is not described by other possible values."
Default
physmedia$ = "The physical medium is unknown."
;Case #NdisPhysicalMediumMax ; Not a real physical type defined As an upper-bound
EndSelect
ProcedureReturn physmedia$
EndProcedure
Procedure.s AccessType(in_acces_type.i)
Select in_acces_type
Case #NET_IF_ACCESS_LOOPBACK
accesstype$ = "Loopback access type. This access type indicates that the interface loops back transmit data as receive data."
Case #NET_IF_ACCESS_BROADCAST
accesstype$ = "LAN access type which includes Ethernet. This access type indicates the interface provides native support for multicast or broadcast services."
Case #NET_IF_ACCESS_POINT_TO_POINT
accesstype$ = "Point-to-point access that supports CoNDIS/WAN, except for non-broadcast multi-access (NBMA) interfaces."
Case #NET_IF_ACCESS_POINT_TO_MULTI_POINT
accesstype$ = "Point-to-multipoint access that supports non-broadcast multi-access (NBMA) media, including the 'RAS Internal' interface, and native (non-LANE) ATM."
Case #NET_IF_ACCESS_MAXIMUM
accesstype$ = "Type of access is unspecific, unknown, or not defined."
Default
accesstype$ = "Type of access is unspecific, unknown, or not defined."
; #NET_IF_ACCESS_MAXIMUM = 5 ; The maximum possible value for the NET_IF_ACCESS_TYPE enumeration type. This is not a legal value for AccessType member.
EndSelect
ProcedureReturn accesstype$
EndProcedure
Procedure.l IntFromAddress(ip$)
ProcedureReturn inet_addr_(ip$)
EndProcedure
Procedure.s AddressFromInt(ip.l)
ProcedureReturn PeekS (inet_ntoa_(ip))
EndProcedure
Procedure.s ShowAPIError(CheckReturnValue)
Buffer.s = Space (4096)
NumberOfChars = FormatMessage_(#FORMAT_MESSAGE_FROM_SYSTEM, 0, CheckReturnValue, 0, Buffer.s, Len(Buffer.s), 0)
ProcedureReturn Left (Buffer.s, NumberOfChars-2)
EndProcedure
Procedure.s ReadMIBRowBitField(number.l, index.l, length)
Protected bitfield$
bitfield$=RSet(Bin(number), 32, "0")
ProcedureReturn Mid(bitfield$, 32-index, length)
EndProcedure
Procedure.s Availibility_Info(availinfo.i)
Select availinfo
Case 1
Avail_Stat$ = "Other"
Case 2
Avail_Stat$ = "Unknown"
Case 3
Avail_Stat$ = "Running or Full Power"
Case 4
Avail_Stat$ = "Warning"
Case 5
Avail_Stat$ = "In Test"
Case 6
Avail_Stat$ = "Not Applicable"
Case 7
Avail_Stat$ = "Power Off"
Case 8
Avail_Stat$ = "Offline"
Case 9
Avail_Stat$ = "Off Duty"
Case 10
Avail_Stat$ = "Degraded"
Case 11
Avail_Stat$ = "Not Installed"
Case 12
Avail_Stat$ = "Install Error"
Case 13
Avail_Stat$ = "Power Save - Unknown (The device is known to be in a power save mode, but its exact status is unknown.)"
Case 14
Avail_Stat$ = "Power Save - Low Power Mode (The device is in a power save state, but still functioning, and may exhibit degraded performance.)"
Case 15
Avail_Stat$ = "Power Save - Standby (The device is not functioning, but could be brought to full power quickly.)"
Case 16
Avail_Stat$ = "Power Cycle"
Case 17
Avail_Stat$ = "Power Save - Warning (The device is in a warning state, but also in a power save mode.)"
EndSelect
ProcedureReturn Avail_Stat$
EndProcedure
Procedure.s ConfigManager_ErrorCode(cm_ec.i)
Select cm_ec
Case 0
Error_Code_Type$ = "Device is working properly"
Case 1
Error_Code_Type$ = "Device is not configured correctly."
Case 2
Error_Code_Type$ = "Windows cannot load the driver for this device."
Case 3
Error_Code_Type$ = "Driver For this device might be corrupted, or the system may be low on memory or other resources."
Case 4
Error_Code_Type$ = "Device is not working properly. One of its drivers or the registry might be corrupted."
Case 5
Error_Code_Type$ = "Driver for the device requires a resource that Windows cannot manage."
Case 6
Error_Code_Type$ = "Boot configuration for the device conflicts with other devices."
Case 7
Error_Code_Type$ = "Cannot filter."
Case 8
Error_Code_Type$ = "Driver loader for the device is missing."
Case 9
Error_Code_Type$ = "Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device."
Case 10
Error_Code_Type$ = "Device cannot start."
Case 11
Error_Code_Type$ = "Device failed."
Case 12
Error_Code_Type$ = "Device cannot find enough free resources to use."
Case 13
Error_Code_Type$ = "Windows cannot verify the device's resources."
Case 14
Error_Code_Type$ = "Device cannot work properly Until the computer is restarted."
Case 15
Error_Code_Type$ = "Device is not working properly due to a possible re-enumeration problem."
Case 16
Error_Code_Type$ = "Windows cannot identify all of the resources that the device uses."
Case 17
Error_Code_Type$ = "Device is requesting an unknown resource type."
Case 18
Error_Code_Type$ = "Device drivers must be reinstalled."
Case 19
Error_Code_Type$ = "Failure using the VxD loader."
Case 20
Error_Code_Type$ = "Registry might be corrupted."
Case 21
Error_Code_Type$ = "System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device."
Case 22
Error_Code_Type$ = "Device is disabled."
Case 23
Error_Code_Type$ = "System failure. If changing the device driver is ineffective, see the hardware documentation."
Case 24
Error_Code_Type$ = "Device is not present, not working properly, or does not have all of its drivers installed."
Case 25
Error_Code_Type$ = "Windows is still setting up the device."
Case 26
Error_Code_Type$ = "Windows is still setting up the device."
Case 27
Error_Code_Type$ = "Device does not have a valid log configuration."
Case 28
Error_Code_Type$ = "Device drivers are not installed."
Case 29
Error_Code_Type$ = "Device is disabled. The device firmware did not provide the required resources."
Case 30
Error_Code_Type$ = "Device is using an IRQ resource that another device is using."
Case 31
Error_Code_Type$ = "Device is not working properly. Windows cannot load the required device drivers."
EndSelect
ProcedureReturn Error_Code_Type$
EndProcedure
Procedure.s ConvertUnicodeToAnsi(in_pointer)
Buffer.s=Space(512)
WideCharToMultiByte_(#CP_ACP,0,in_pointer,-1,@Buffer,512,0,0)
ProcedureReturn Buffer
EndProcedure
Procedure ConvertAnsiToUnicode(in_string.s)
*uniout = AllocateMemory(Len(in_string)*4)
MultiByteToWideChar_(#CP_ACP, 0, in_string, -1, *uniout, Len(in_string))
ProcedureReturn *uniout
EndProcedure
; string to WCHAR
Procedure MakeBSTR(String$)
Unicode$ = Space(Len(String$)*2+2)
MultiByteToWideChar_(#CP_ACP, 0, @String$, -1, @Unicode$, Len(String$)*2+2)
ProcedureReturn SysAllocString_(@Unicode$)
EndProcedure