VB网络开发的全部声明

2012-04-05  金城  1748

Public Const MAX_INTERFACE_NAME_LEN = 256
Public Const MAX_TRANSPORT_NAME_LEN = 40
Public Const MAX_MEDIA_NAME = 16
Public Const MAX_PORT_NAME = 16
Public Const MAX_DEVICE_NAME = 128
Public Const MAX_PHONE_NUMBER_LEN = 128
Public Const MAX_DEVICETYPE_NAME = 16
Public Const MAXLEN_IFDESCR = 256
Public Const MAXLEN_PHYSADDR = 8
Public Type MIB_IFROW
                 wszName(MAX_INTERFACE_NAME_LEN)  As String
                 dwIndex  As Long
                 dwType  As Long
                 dwMtu  As Long
                 dwSpeed  As Long
                 dwPhysAddrLen  As Long
                 bPhysAddr(MAXLEN_PHYSADDR)  As Byte
                 dwAdminStatus  As Long
                 dwOperStatus  As Long
                 dwLastChange  As Long
                 dwInOctets  As Long
                 dwInUcastPkts  As Long
                 dwInNUcastPkts  As Long
                 dwInDiscards  As Long
                 dwInErrors  As Long
                 dwInUnknownProtos  As Long
                 dwOutOctets  As Long
                 dwOutUcastPkts  As Long
                 dwOutNUcastPkts  As Long
                 dwOutDiscards  As Long
                 dwOutErrors  As Long
                 dwOutQLen  As Long
                 dwDescrLen  As Long
                 bDescr(MAXLEN_IFDESCR)  As Byte
End Type
Const ANY_SIZE = 1
Public Type PMIB_IFTABLE
         dwNumEntries  As Long
         table(ANY_SIZE)  As MIB_IFROW
End Type
Public Type MIB_IPADDRROW
         dwAddr  As Long
         dwIndex  As Long
         dwMask  As Long
         dwBCastAddr  As Long
         dwReasmSize  As Long
         unused1  As Integer
         wType  As Integer
End Type
Public Type MIB_IPADDRTABLE
         dwNumEntries  As Long
         table(ANY_SIZE)  As MIB_IPADDRROW
End Type
Public Type MIB_IPNETROW
         dwIndex  As Long
         dwPhysAddrLen  As Long
         bPhysAddr(MAXLEN_PHYSADDR)  As Byte
         dwAddr  As Long
         dwType  As Long
End Type
Public Type MIB_IPNETTABLE
         dwNumEntries  As Long
         table(ANY_SIZE)  As MIB_IPNETROW
End Type
Public Type MIB_IPFORWARDROW
         dwForwardDest  As Long
         dwForwardMask  As Long
         dwForwardPolicy  As Long
         dwForwardNextHop  As Long
         dwForwardIfIndex  As Long
         dwForwardType  As Long
         dwForwardProto  As Long
         dwForwardAge  As Long
         dwForwardNextHopAS  As Long
         dwForwardMetric1  As Long
         dwForwardMetric2  As Long
         dwForwardMetric3  As Long
         dwForwardMetric4  As Long
         dwForwardMetric5  As Long
End Type
Public Type MIB_IPFORWARDTABLE
         dwNumEntries  As Long
         table(ANY_SIZE)  As MIB_IPFORWARDROW
End Type
Public Type MIB_TCPROW
         dwState  As Long
         dwLocalAddr  As Long
         dwLocalPort  As Long
         dwRemoteAddr  As Long
       &n bsp; dwRemotePort  As Long
End Type
Public Const MIB_TCP_STATE_CLOSED = 1
Public Const MIB_TCP_STATE_LISTEN = 2
Public Const MIB_TCP_STATE_SYN_SENT = 3
Public Const MIB_TCP_STATE_SYN_RCVD = 4
Public Const MIB_TCP_STATE_ESTAB = 5
Public Const MIB_TCP_STATE_FIN_WAIT1 = 6
Public Const MIB_TCP_STATE_FIN_WAIT2 = 7
Public Const MIB_TCP_STATE_CLOSE_WAIT = 8
Public Const MIB_TCP_STATE_CLOSING = 9
Public Const MIB_TCP_STATE_LAST_ACK = 10
Public Const MIB_TCP_STATE_TIME_WAIT = 11
Public Const MIB_TCP_STATE_DELETE_TCB = 12
Public Type MIB_TCPTABLE
         dwNumEntries  As Long
         table(ANY_SIZE)  As MIB_TCPROW
End Type
Public Type MIB_UDPROW
         dwLocalAddr  As Long
         dwLocalPort  As Long
End Type
Public Type MIB_UDPTABLE
         dwNumEntries  As Long
         table(ANY_SIZE)  As MIB_UDPROW
End Type
Public Type MIB_IPSTATS
         dwForwarding  As Long
         dwDefaultTTL  As Long
         dwInReceives  As Long
         dwInHdrErrors  As Long
         dwInAddrErrors  As Long
         dwForwDatagrams  As Long
         dwInUnknownProtos  As Long
         dwInDiscards  As Long
         dwInDelivers  As Long
         dwOutRequests  As Long
         dwRoutingDiscards  As Long
         dwOutDiscards  As Long
         dwOutNoRoutes  As Long
         dwReasmTimeout  As Long
         dwReasmReqds  As Long
         dwReasmOks  As Long
         dwReasmFails  As Long
         dwFragOks  As Long
         dwFragFails  As Long
         dwFragCreates  As Long
         dwNumIf  As Long
         dwNumAddr  As Long
         dwNumRoutes  As Long
End Type
Public Type MIBICMPSTATS
         dwMsgs  As Long
         dwErrors  As Long
         dwDestUnreachs  As Long
         dwTimeExcds  As Long
         dwParmProbs  As Long
         dwSrcQuenchs  As Long
         dwRedirects  As Long
         dwEchos  As Long
         dwEchoReps  As Long
         dwTimestamps  As Long
         dwTimestampReps  As Long
         dwAddrMasks  As Long
         dwAddrMaskReps  As Long
End Type
Public Type MIBICMPINFO
         icmpInStats  As MIBICMPSTATS
         icmpOutStats  As MIBICMPSTATS
End Type
Public Type MIB_ICMP
           stats  As MIBICMPINFO
End Type
Public Type MIB_TCPSTATS
         dwRtoAlgorithm  As Long
         dwRtoMin  As Long
         dwRtoMax  As Long
         dwMaxConn  As Long
         dwActiveOpens  As Long
         dwPassiveOpens  As Long
         dwAttemptFails  As Long
         dwEstabResets  As Long
         dwCurrEstab  As Long
         dwInSegs  As Long
         dwOutSegs  As Long
         dwRetransSegs  As Long
         dwInErrs  As Long
         dwOutRsts  As Long
         dwNumConns  As Long
End Type
Public Type MIB_UDPSTATS
         dwInDatagrams  As Long
         dwNoPorts  As Long
         dwInErrors  As Long
         dwOutDatagrams  As Long
         dwNumAddrs  As Long
End Type
Public Const MAX_ADAPTER_NAME = 255
Public Type IP_ADAPTER_INDEX_MAP
     Index  As Long
     StrName(MAX_ADAPTER_NAME)  As String
End Type
Public Type IP_INTERFACE_INFO
     NumAdapters  As Long
     Adapter(1)  As IP_ADAPTER_INDEX_MAP
End Type
Public Type IP_UNIDIRECTIONAL_ADAPTER_ADDRESS
     NumAdapters  As Long
     Address(1)  As Long
End Type
Public Type OVERLAPPED
         Internal  As Long
         InternalHigh  As Long
         Offset  As Long
         OffsetHigh  As Long
         hEvent  As Long
End Type
Public Const MAX_ADAPTER_DESCRIPTION_LENGTH = 128
Public Const MAX_ADAPTER_NAME_LENGTH = 256
Public Const MAX_ADAPTER_ADDRESS_LENGTH = 8
Public Const DEFAULT_MINIMUM_ENTITIES = 32
Public Const MAX_HOSTNAME_LEN = 128
Public Const MAX_DOMAIN_NAME_LEN = 128
Public Const MAX_SCOPE_ID_LEN = 256
Public Type IP_STRING
         IpChar(4)  As String * 4
End Type
Public Type IP_ADDRESS_STRING
         STRING_CHAR  As IP_STRING
End Type
Public Type IP_MASK_STRING
         STRING_CHAR  As IP_STRING
End Type
Public Type IP_ADDR_STRING
           Next  As Long
           IpAddress  As IP_ADDRESS_STRING
           IpMask  As IP_MASK_STRING
           Context  As Long
End Type
Public Type FIXED_INFO
         HostName(MAX_HOSTNAME_LEN + 4)      As String
         DomainName(MAX_DOMAIN_NAME_LEN + 4)      As String
         CurrentDnsServer  As IP_ADDR_STRING
         DnsServerList  As IP_ADDR_STRING
         NodeType  As Long
         ScopeId(MAX_SCOPE_ID_LEN + 4)      As String
         EnableRouting  As Long
         EnableProxy  As Long
         EnableDns    As Long
End Type
Public Type SYSTEMTIME
                 wYear  As Integer
                 wMonth  As Integer
                 wDayOfWeek  As Integer
                 wDay  As Integer
                 wHour  As Integer
                 wMinute  As Integer
                 wSecond  As Integer
                 wMilliseconds  As Integer
End Type
Public Type IP_ADAPTER_INFO
         Next  As Long
         ComboIndex  As Long
         AdapterName(MAX_ADAPTER_NAME_LENGTH + 4)      As String
         Description(MAX_ADAPTER_DESCRIPTION_LENGTH + 4)      As String
         AddressLength  As Long
         Address(MAX_ADAPTER_ADDRESS_LENGTH)  As Byte
         Index  As Long
         Type  As Long
         DhcpEnabled  As Long
         CurrentIpAddress  As IP_ADDR_STRING
         IpAddressList  As IP_ADDR_STRING
         GatewayList  As IP_ADDR_STRING
         DhcpServer  As IP_ADDR_STRING
         HaveWins  As Boolean
         PrimaryWinsServer  As Boolean
         SecondaryWinsServer  As IP_ADDR_STRING
         LeaseObtained  As SYSTEMTIME
         LeaseExpires  As SYSTEMTIME
End Type
Public Type IP_PER_ADAPTER_INFO
         AutoconfigEnabled  As Long
         AutoconfigActive  As Long
         CurrentDnsServer  As IP_ADDR_STRING
         DnsServerList  As IP_ADDR_STRING
End Type