Go to the documentation of this file.
32 #define TRACE_LEVEL SNMP_TRACE_LEVEL
46 #if (MIB2_SUPPORT == ENABLED && MIB2_IF_GROUP_SUPPORT == ENABLED)
115 if(
osStrcmp(object->name,
"ifIndex") == 0)
118 value->integer = index;
121 else if(
osStrcmp(object->name,
"ifDescr") == 0)
141 else if(
osStrcmp(object->name,
"ifType") == 0)
143 #if (ETH_VLAN_SUPPORT == ENABLED)
145 if(interface->vlanId != 0)
154 if(physicalInterface->nicDriver != NULL)
157 switch(physicalInterface->nicDriver->type)
185 else if(
osStrcmp(object->name,
"ifMtu") == 0)
188 if(physicalInterface->nicDriver != NULL)
190 value->integer = physicalInterface->nicDriver->mtu;
198 else if(
osStrcmp(object->name,
"ifSpeed") == 0)
201 value->gauge32 = interface->linkSpeed;
203 #if (ETH_SUPPORT == ENABLED)
205 else if(
osStrcmp(object->name,
"ifPhysAddress") == 0)
228 else if(
osStrcmp(object->name,
"ifAdminStatus") == 0)
231 if(physicalInterface->nicDriver != NULL)
241 else if(
osStrcmp(object->name,
"ifOperStatus") == 0)
244 if(interface->linkState)
254 else if(
osStrcmp(object->name,
"ifLastChange") == 0)
260 else if(
osStrcmp(object->name,
"ifInOctets") == 0)
266 else if(
osStrcmp(object->name,
"ifInUcastPkts") == 0)
272 else if(
osStrcmp(object->name,
"ifInNUcastPkts") == 0)
278 else if(
osStrcmp(object->name,
"ifInDiscards") == 0)
284 else if(
osStrcmp(object->name,
"ifInErrors") == 0)
290 else if(
osStrcmp(object->name,
"ifInUnknownProtos") == 0)
296 else if(
osStrcmp(object->name,
"ifOutOctets") == 0)
302 else if(
osStrcmp(object->name,
"ifOutUcastPkts") == 0)
308 else if(
osStrcmp(object->name,
"ifOutNUcastPkts") == 0)
314 else if(
osStrcmp(object->name,
"ifOutDiscards") == 0)
320 else if(
osStrcmp(object->name,
"ifOutErrors") == 0)
326 else if(
osStrcmp(object->name,
"ifOutQLen") == 0)
332 else if(
osStrcmp(object->name,
"ifSpecific") == 0)
371 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
378 if(*nextOidLen < object->
oidLen)
382 osMemcpy(nextOid, object->oid, object->oidLen);
error_t mib2SetIfEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set ifEntry object value.
#define MIB2_PHYS_ADDRESS_SIZE
@ MIB2_IF_TYPE_ETHERNET_CSMACD
error_t mib2GetIfEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ifEntry object value.
uint8_t ifSpecific[MIB2_IF_SPECIFIC_SIZE]
#define NET_INTERFACE_COUNT
@ MIB2_IF_TYPE_IEEE_802_15_4
Mib2IfEntry ifTable[NET_INTERFACE_COUNT]
int_t oidComp(const uint8_t *oid1, size_t oidLen1, const uint8_t *oid2, size_t oidLen2)
Compare object identifiers.
#define macCopyAddr(destMacAddr, srcMacAddr)
@ MIB2_IF_ADMIN_STATUS_UP
#define osMemcpy(dest, src, length)
NetInterface * nicGetPhysicalInterface(NetInterface *interface)
Retrieve physical interface.
@ ERROR_INSTANCE_NOT_FOUND
@ MIB2_IF_OPER_STATUS_DOWN
General definitions for cryptographic algorithms.
@ MIB2_IF_ADMIN_STATUS_DOWN
uint32_t ifInUnknownProtos
@ NIC_TYPE_PPP
PPP interface.
MIB-II module implementation.
error_t mibDecodeIndex(const uint8_t *oid, size_t oidLen, size_t *pos, uint_t *index)
Decode instance identifier (index)
MIB-II module implementation (Interface group)
Common definitions for MIB modules.
error_t mib2GetNextIfEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ifEntry object.
error_t mibEncodeIndex(uint8_t *oid, size_t maxOidLen, size_t *pos, uint_t index)
Encode instance identifier (index)
Mib2Base mib2Base
MIB-II base.
@ NIC_TYPE_6LOWPAN
6LoWPAN interface
NetInterface * nicGetLogicalInterface(NetInterface *interface)
Retrieve logical interface.
ASN.1 (Abstract Syntax Notation One)
@ NIC_TYPE_ETHERNET
Ethernet interface.