' ########################################################################################
' Microsoft Windows
' File: ifmib.inc
' Contents: Public definitions and structures for the non-TCP/IP specific parts of MIB-II.
' These definitions were previously in iprtrmib.h, which now includes this file.
' 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_ifmib_PBI)
#DEFINE PBX_ifmib_PBI
%EQUATE `IFMIB_INC = 1
#INCLUDE ONCE "Core/Windows.inc"
#INCLUDE ONCE "Legacy/System/ifdef.inc"
#IF NOT %DEF(%ANY_SIZE)
%EQUATE `ANY_SIZE = 1
#ENDIF
' // Serie = 4 bytes
TYPE MIB_IFNUMBER DWORD
 dwValue AS DWORD
END TYPE
'//
'// $REVIEW: This has always been defined as 8. However, this is not
'// sufficient for all media types.
'//
%EQUATE `MAXLEN_PHYSADDR = 8
%EQUATE `MAXLEN_IFDESCR = 256
%EQUATE `MAX_INTERFACE_NAME_LEN = 256
' // Serie = 860 bytes
TYPE MIB_IFROW DWORD
 wszName AS WSTRINGZ * %MAX_INTERFACE_NAME_LEN ' WCHAR
 dwIndex AS DWORD ' IF_INDEX
 dwType AS DWORD ' IFTYPE
 dwMtu AS DWORD
 dwSpeed AS DWORD
 dwPhysAddrLen AS DWORD
 bPhysAddr(%MAXLEN_PHYSADDR - 1) AS BYTE ' UCHAR
 dwAdminStatus AS DWORD
 dwOperStatus AS DWORD ' INTERNAL_IF_OPER_STATUS enum
 dwLastChange AS DWORD
 dwInOctets AS DWORD
 dwInUcastPkts AS DWORD
 dwInNUcastPkts AS DWORD
 dwInDiscards AS DWORD
 dwInErrors AS DWORD
 dwInUnknownProtos AS DWORD
 dwOutOctets AS DWORD
 dwOutUcastPkts AS DWORD
 dwOutNUcastPkts AS DWORD
 dwOutDiscards AS DWORD
 dwOutErrors AS DWORD
 dwOutQLen AS DWORD
 dwDescrLen AS DWORD
 bDescr(%MAXLEN_IFDESCR - 1) AS BYTE ' UCHAR
END TYPE
' // Serie = 864 bytes
TYPE MIB_IFTABLE DWORD
 dwNumEntries AS DWORD
 table(0) AS MIB_IFROW ' MIB_IFROW table[ANY_SIZE]
END TYPE
'#define SIZEOF_IFTABLE(X) (FIELD_OFFSET(MIB_IFTABLE,table[0]) + \
' ((X) * sizeof(MIB_IFROW)) + ALIGN_SIZE)
#ENDIF
