4e2933c620 2015-04-21 kinaba: /***********************************************************************\ 4e2933c620 2015-04-21 kinaba: * iprtrmib.d * 4e2933c620 2015-04-21 kinaba: * * 4e2933c620 2015-04-21 kinaba: * Windows API header module * 4e2933c620 2015-04-21 kinaba: * * 4e2933c620 2015-04-21 kinaba: * Translated from MinGW Windows headers * 4e2933c620 2015-04-21 kinaba: * by Stewart Gordon * 4e2933c620 2015-04-21 kinaba: * * 4e2933c620 2015-04-21 kinaba: * Placed into public domain * 4e2933c620 2015-04-21 kinaba: \***********************************************************************/ 4e2933c620 2015-04-21 kinaba: module win32.iprtrmib; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: import win32.ipifcons; 4e2933c620 2015-04-21 kinaba: private import win32.windef; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: // FIXME: check types of constants 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: const size_t 4e2933c620 2015-04-21 kinaba: MAXLEN_PHYSADDR = 8, 4e2933c620 2015-04-21 kinaba: MAXLEN_IFDESCR = 256, 4e2933c620 2015-04-21 kinaba: MAX_INTERFACE_NAME_LEN = 256; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: enum { 4e2933c620 2015-04-21 kinaba: MIB_IPNET_TYPE_OTHER = 1, 4e2933c620 2015-04-21 kinaba: MIB_IPNET_TYPE_INVALID, 4e2933c620 2015-04-21 kinaba: MIB_IPNET_TYPE_DYNAMIC, 4e2933c620 2015-04-21 kinaba: MIB_IPNET_TYPE_STATIC 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: enum { 4e2933c620 2015-04-21 kinaba: MIB_TCP_RTO_OTHER = 1, 4e2933c620 2015-04-21 kinaba: MIB_TCP_RTO_CONSTANT, 4e2933c620 2015-04-21 kinaba: MIB_TCP_RTO_RSRE, 4e2933c620 2015-04-21 kinaba: MIB_TCP_RTO_VANJ 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: enum { 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_CLOSED = 1, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_LISTEN, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_SYN_SENT, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_SYN_RCVD, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_ESTAB, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_FIN_WAIT1, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_FIN_WAIT2, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_CLOSE_WAIT, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_CLOSING, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_LAST_ACK, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_TIME_WAIT, 4e2933c620 2015-04-21 kinaba: MIB_TCP_STATE_DELETE_TCB // = 12 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: const DWORD 4e2933c620 2015-04-21 kinaba: MIB_USE_CURRENT_TTL = -1, 4e2933c620 2015-04-21 kinaba: MIB_USE_CURRENT_FORWARDING = -1, 4e2933c620 2015-04-21 kinaba: MIB_TCP_MAXCONN_DYNAMIC = -1; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_IPADDRROW { 4e2933c620 2015-04-21 kinaba: DWORD dwAddr; 4e2933c620 2015-04-21 kinaba: DWORD dwIndex; 4e2933c620 2015-04-21 kinaba: DWORD dwMask; 4e2933c620 2015-04-21 kinaba: DWORD dwBCastAddr; 4e2933c620 2015-04-21 kinaba: DWORD dwReasmSize; 4e2933c620 2015-04-21 kinaba: ushort unused1; 4e2933c620 2015-04-21 kinaba: ushort unused2; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_IPADDRROW* PMIB_IPADDRROW; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_IPADDRTABLE { 4e2933c620 2015-04-21 kinaba: DWORD dwNumEntries; 4e2933c620 2015-04-21 kinaba: MIB_IPADDRROW[1] _table; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: MIB_IPADDRROW* table() { return _table.ptr; } 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_IPADDRTABLE* PMIB_IPADDRTABLE; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_IPFORWARDROW { 4e2933c620 2015-04-21 kinaba: DWORD dwForwardDest; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardMask; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardPolicy; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardNextHop; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardIfIndex; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardType; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardProto; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardAge; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardNextHopAS; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardMetric1; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardMetric2; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardMetric3; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardMetric4; 4e2933c620 2015-04-21 kinaba: DWORD dwForwardMetric5; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_IPFORWARDROW* PMIB_IPFORWARDROW; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_IPFORWARDTABLE { 4e2933c620 2015-04-21 kinaba: DWORD dwNumEntries; 4e2933c620 2015-04-21 kinaba: MIB_IPFORWARDROW[1] _table; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: MIB_IPFORWARDROW* table() { return _table.ptr; } 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_IPFORWARDTABLE* PMIB_IPFORWARDTABLE; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_IPNETROW { 4e2933c620 2015-04-21 kinaba: DWORD dwIndex; 4e2933c620 2015-04-21 kinaba: DWORD dwPhysAddrLen; 4e2933c620 2015-04-21 kinaba: BYTE[MAXLEN_PHYSADDR] bPhysAddr; 4e2933c620 2015-04-21 kinaba: DWORD dwAddr; 4e2933c620 2015-04-21 kinaba: DWORD dwType; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_IPNETROW* PMIB_IPNETROW; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_IPNETTABLE { 4e2933c620 2015-04-21 kinaba: DWORD dwNumEntries; 4e2933c620 2015-04-21 kinaba: MIB_IPNETROW[1] _table; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: MIB_IPNETROW* table() { return _table.ptr; } 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_IPNETTABLE* PMIB_IPNETTABLE; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIBICMPSTATS { 4e2933c620 2015-04-21 kinaba: DWORD dwMsgs; 4e2933c620 2015-04-21 kinaba: DWORD dwErrors; 4e2933c620 2015-04-21 kinaba: DWORD dwDestUnreachs; 4e2933c620 2015-04-21 kinaba: DWORD dwTimeExcds; 4e2933c620 2015-04-21 kinaba: DWORD dwParmProbs; 4e2933c620 2015-04-21 kinaba: DWORD dwSrcQuenchs; 4e2933c620 2015-04-21 kinaba: DWORD dwRedirects; 4e2933c620 2015-04-21 kinaba: DWORD dwEchos; 4e2933c620 2015-04-21 kinaba: DWORD dwEchoReps; 4e2933c620 2015-04-21 kinaba: DWORD dwTimestamps; 4e2933c620 2015-04-21 kinaba: DWORD dwTimestampReps; 4e2933c620 2015-04-21 kinaba: DWORD dwAddrMasks; 4e2933c620 2015-04-21 kinaba: DWORD dwAddrMaskReps; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIBICMPSTATS* PMIBICMPSTATS; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIBICMPINFO { 4e2933c620 2015-04-21 kinaba: MIBICMPSTATS icmpInStats; 4e2933c620 2015-04-21 kinaba: MIBICMPSTATS icmpOutStats; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIBICMPINFO* PMIBICMPINFO; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_ICMP { 4e2933c620 2015-04-21 kinaba: MIBICMPINFO stats; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_ICMP* PMIB_ICMP; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_IFROW { 4e2933c620 2015-04-21 kinaba: WCHAR[MAX_INTERFACE_NAME_LEN] wszName; 4e2933c620 2015-04-21 kinaba: DWORD dwIndex; 4e2933c620 2015-04-21 kinaba: DWORD dwType; 4e2933c620 2015-04-21 kinaba: DWORD dwMtu; 4e2933c620 2015-04-21 kinaba: DWORD dwSpeed; 4e2933c620 2015-04-21 kinaba: DWORD dwPhysAddrLen; 4e2933c620 2015-04-21 kinaba: BYTE[MAXLEN_PHYSADDR] bPhysAddr; 4e2933c620 2015-04-21 kinaba: DWORD dwAdminStatus; 4e2933c620 2015-04-21 kinaba: DWORD dwOperStatus; 4e2933c620 2015-04-21 kinaba: DWORD dwLastChange; 4e2933c620 2015-04-21 kinaba: DWORD dwInOctets; 4e2933c620 2015-04-21 kinaba: DWORD dwInUcastPkts; 4e2933c620 2015-04-21 kinaba: DWORD dwInNUcastPkts; 4e2933c620 2015-04-21 kinaba: DWORD dwInDiscards; 4e2933c620 2015-04-21 kinaba: DWORD dwInErrors; 4e2933c620 2015-04-21 kinaba: DWORD dwInUnknownProtos; 4e2933c620 2015-04-21 kinaba: DWORD dwOutOctets; 4e2933c620 2015-04-21 kinaba: DWORD dwOutUcastPkts; 4e2933c620 2015-04-21 kinaba: DWORD dwOutNUcastPkts; 4e2933c620 2015-04-21 kinaba: DWORD dwOutDiscards; 4e2933c620 2015-04-21 kinaba: DWORD dwOutErrors; 4e2933c620 2015-04-21 kinaba: DWORD dwOutQLen; 4e2933c620 2015-04-21 kinaba: DWORD dwDescrLen; 4e2933c620 2015-04-21 kinaba: BYTE[MAXLEN_IFDESCR] bDescr; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_IFROW* PMIB_IFROW; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_IFTABLE { 4e2933c620 2015-04-21 kinaba: DWORD dwNumEntries; 4e2933c620 2015-04-21 kinaba: MIB_IFROW[1] _table; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: MIB_IFROW* table() { return _table.ptr; } 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_IFTABLE* PMIB_IFTABLE; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_IPSTATS { 4e2933c620 2015-04-21 kinaba: DWORD dwForwarding; 4e2933c620 2015-04-21 kinaba: DWORD dwDefaultTTL; 4e2933c620 2015-04-21 kinaba: DWORD dwInReceives; 4e2933c620 2015-04-21 kinaba: DWORD dwInHdrErrors; 4e2933c620 2015-04-21 kinaba: DWORD dwInAddrErrors; 4e2933c620 2015-04-21 kinaba: DWORD dwForwDatagrams; 4e2933c620 2015-04-21 kinaba: DWORD dwInUnknownProtos; 4e2933c620 2015-04-21 kinaba: DWORD dwInDiscards; 4e2933c620 2015-04-21 kinaba: DWORD dwInDelivers; 4e2933c620 2015-04-21 kinaba: DWORD dwOutRequests; 4e2933c620 2015-04-21 kinaba: DWORD dwRoutingDiscards; 4e2933c620 2015-04-21 kinaba: DWORD dwOutDiscards; 4e2933c620 2015-04-21 kinaba: DWORD dwOutNoRoutes; 4e2933c620 2015-04-21 kinaba: DWORD dwReasmTimeout; 4e2933c620 2015-04-21 kinaba: DWORD dwReasmReqds; 4e2933c620 2015-04-21 kinaba: DWORD dwReasmOks; 4e2933c620 2015-04-21 kinaba: DWORD dwReasmFails; 4e2933c620 2015-04-21 kinaba: DWORD dwFragOks; 4e2933c620 2015-04-21 kinaba: DWORD dwFragFails; 4e2933c620 2015-04-21 kinaba: DWORD dwFragCreates; 4e2933c620 2015-04-21 kinaba: DWORD dwNumIf; 4e2933c620 2015-04-21 kinaba: DWORD dwNumAddr; 4e2933c620 2015-04-21 kinaba: DWORD dwNumRoutes; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_IPSTATS* PMIB_IPSTATS; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_TCPSTATS { 4e2933c620 2015-04-21 kinaba: DWORD dwRtoAlgorithm; 4e2933c620 2015-04-21 kinaba: DWORD dwRtoMin; 4e2933c620 2015-04-21 kinaba: DWORD dwRtoMax; 4e2933c620 2015-04-21 kinaba: DWORD dwMaxConn; 4e2933c620 2015-04-21 kinaba: DWORD dwActiveOpens; 4e2933c620 2015-04-21 kinaba: DWORD dwPassiveOpens; 4e2933c620 2015-04-21 kinaba: DWORD dwAttemptFails; 4e2933c620 2015-04-21 kinaba: DWORD dwEstabResets; 4e2933c620 2015-04-21 kinaba: DWORD dwCurrEstab; 4e2933c620 2015-04-21 kinaba: DWORD dwInSegs; 4e2933c620 2015-04-21 kinaba: DWORD dwOutSegs; 4e2933c620 2015-04-21 kinaba: DWORD dwRetransSegs; 4e2933c620 2015-04-21 kinaba: DWORD dwInErrs; 4e2933c620 2015-04-21 kinaba: DWORD dwOutRsts; 4e2933c620 2015-04-21 kinaba: DWORD dwNumConns; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_TCPSTATS* PMIB_TCPSTATS; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_TCPROW { 4e2933c620 2015-04-21 kinaba: DWORD dwState; 4e2933c620 2015-04-21 kinaba: DWORD dwLocalAddr; 4e2933c620 2015-04-21 kinaba: DWORD dwLocalPort; 4e2933c620 2015-04-21 kinaba: DWORD dwRemoteAddr; 4e2933c620 2015-04-21 kinaba: DWORD dwRemotePort; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_TCPROW* PMIB_TCPROW; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_TCPTABLE { 4e2933c620 2015-04-21 kinaba: DWORD dwNumEntries; 4e2933c620 2015-04-21 kinaba: MIB_TCPROW[1] _table; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: MIB_TCPROW* table() { return _table.ptr; } 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_TCPTABLE* PMIB_TCPTABLE; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_UDPSTATS { 4e2933c620 2015-04-21 kinaba: DWORD dwInDatagrams; 4e2933c620 2015-04-21 kinaba: DWORD dwNoPorts; 4e2933c620 2015-04-21 kinaba: DWORD dwInErrors; 4e2933c620 2015-04-21 kinaba: DWORD dwOutDatagrams; 4e2933c620 2015-04-21 kinaba: DWORD dwNumAddrs; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_UDPSTATS* PMIB_UDPSTATS; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_UDPROW { 4e2933c620 2015-04-21 kinaba: DWORD dwLocalAddr; 4e2933c620 2015-04-21 kinaba: DWORD dwLocalPort; 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_UDPROW* PMIB_UDPROW; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: struct MIB_UDPTABLE { 4e2933c620 2015-04-21 kinaba: DWORD dwNumEntries; 4e2933c620 2015-04-21 kinaba: MIB_UDPROW[1] _table; 4e2933c620 2015-04-21 kinaba: 4e2933c620 2015-04-21 kinaba: MIB_UDPROW* table() { return _table.ptr; } 4e2933c620 2015-04-21 kinaba: } 4e2933c620 2015-04-21 kinaba: alias MIB_UDPTABLE* PMIB_UDPTABLE;