Go to the documentation of this file.
32 #define TRACE_LEVEL SNMP_TRACE_LEVEL
52 #if (IP_MIB_SUPPORT == ENABLED)
79 #if (IPV4_SUPPORT == ENABLED)
88 #if (IPV6_SUPPORT == ENABLED)
162 if(index < 1 || index > context->numInterfaces)
165 #if (IPV4_SUPPORT == ENABLED)
167 if(
osStrcmp(object->name,
"ipv4InterfaceReasmMaxSize") == 0)
173 else if(
osStrcmp(object->name,
"ipv4InterfaceEnableStatus") == 0)
179 else if(
osStrcmp(object->name,
"ipv4InterfaceRetransmitTime") == 0)
208 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
219 if(*nextOidLen < object->
oidLen)
223 osMemcpy(nextOid, object->oid, object->oidLen);
226 for(index = 1; index <= context->numInterfaces; index++)
310 if(index < 1 || index > context->numInterfaces)
314 interface = &context->interfaces[index - 1];
318 #if (IPV6_SUPPORT == ENABLED)
320 if(
osStrcmp(object->name,
"ipv6InterfaceReasmMaxSize") == 0)
326 else if(
osStrcmp(object->name,
"ipv6InterfaceIdentifier") == 0)
329 if(*valueLen >=
sizeof(
Eui64))
339 *valueLen =
sizeof(
Eui64);
348 else if(
osStrcmp(object->name,
"ipv6InterfaceEnableStatus") == 0)
354 else if(
osStrcmp(object->name,
"ipv6InterfaceReachableTime") == 0)
357 value->unsigned32 = interface->ndpContext.reachableTime;
360 else if(
osStrcmp(object->name,
"ipv6InterfaceRetransmitTime") == 0)
363 value->unsigned32 = interface->ndpContext.retransTimer;
366 else if(
osStrcmp(object->name,
"ipv6InterfaceForwarding") == 0)
369 if(interface->ipv6Context.isRouter)
402 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
413 if(*nextOidLen < object->
oidLen)
417 osMemcpy(nextOid, object->oid, object->oidLen);
420 for(index = 1; index <= context->numInterfaces; index++)
483 #if (IPV4_SUPPORT == ENABLED && IPV4_STATS_SUPPORT == ENABLED)
488 ipSystemStats = &context->ipv4SystemStats;
492 #if (IPV6_SUPPORT == ENABLED && IPV6_STATS_SUPPORT == ENABLED)
497 ipSystemStats = &context->ipv6SystemStats;
504 ipSystemStats = NULL;
508 if(ipSystemStats != NULL)
511 if(
osStrcmp(object->name,
"ipSystemStatsInReceives") == 0)
516 else if(
osStrcmp(object->name,
"ipSystemStatsHCInReceives") == 0)
521 else if(
osStrcmp(object->name,
"ipSystemStatsInOctets") == 0)
526 else if(
osStrcmp(object->name,
"ipSystemStatsHCInOctets") == 0)
531 else if(
osStrcmp(object->name,
"ipSystemStatsInHdrErrors") == 0)
536 else if(
osStrcmp(object->name,
"ipSystemStatsInNoRoutes") == 0)
541 else if(
osStrcmp(object->name,
"ipSystemStatsInAddrErrors") == 0)
546 else if(
osStrcmp(object->name,
"ipSystemStatsInUnknownProtos") == 0)
551 else if(
osStrcmp(object->name,
"ipSystemStatsInTruncatedPkts") == 0)
556 else if(
osStrcmp(object->name,
"ipSystemStatsInForwDatagrams") == 0)
561 else if(
osStrcmp(object->name,
"ipSystemStatsHCInForwDatagrams") == 0)
566 else if(
osStrcmp(object->name,
"ipSystemStatsReasmReqds") == 0)
571 else if(
osStrcmp(object->name,
"ipSystemStatsReasmOKs") == 0)
576 else if(
osStrcmp(object->name,
"ipSystemStatsReasmFails") == 0)
581 else if(
osStrcmp(object->name,
"ipSystemStatsInDiscards") == 0)
586 else if(
osStrcmp(object->name,
"ipSystemStatsInDelivers") == 0)
591 else if(
osStrcmp(object->name,
"ipSystemStatsHCInDelivers") == 0)
596 else if(
osStrcmp(object->name,
"ipSystemStatsOutRequests") == 0)
601 else if(
osStrcmp(object->name,
"ipSystemStatsHCOutRequests") == 0)
606 else if(
osStrcmp(object->name,
"ipSystemStatsOutNoRoutes") == 0)
611 else if(
osStrcmp(object->name,
"ipSystemStatsOutForwDatagrams") == 0)
616 else if(
osStrcmp(object->name,
"ipSystemStatsHCOutForwDatagrams") == 0)
621 else if(
osStrcmp(object->name,
"ipSystemStatsOutDiscards") == 0)
626 else if(
osStrcmp(object->name,
"ipSystemStatsOutFragReqds") == 0)
631 else if(
osStrcmp(object->name,
"ipSystemStatsOutFragOKs") == 0)
636 else if(
osStrcmp(object->name,
"ipSystemStatsOutFragFails") == 0)
641 else if(
osStrcmp(object->name,
"ipSystemStatsOutFragCreates") == 0)
646 else if(
osStrcmp(object->name,
"ipSystemStatsOutTransmits") == 0)
651 else if(
osStrcmp(object->name,
"ipSystemStatsHCOutTransmits") == 0)
656 else if(
osStrcmp(object->name,
"ipSystemStatsOutOctets") == 0)
661 else if(
osStrcmp(object->name,
"ipSystemStatsHCOutOctets") == 0)
666 else if(
osStrcmp(object->name,
"ipSystemStatsInMcastPkts") == 0)
671 else if(
osStrcmp(object->name,
"ipSystemStatsHCInMcastPkts") == 0)
676 else if(
osStrcmp(object->name,
"ipSystemStatsInMcastOctets") == 0)
681 else if(
osStrcmp(object->name,
"ipSystemStatsHCInMcastOctets") == 0)
686 else if(
osStrcmp(object->name,
"ipSystemStatsOutMcastPkts") == 0)
691 else if(
osStrcmp(object->name,
"ipSystemStatsHCOutMcastPkts") == 0)
696 else if(
osStrcmp(object->name,
"ipSystemStatsOutMcastOctets") == 0)
701 else if(
osStrcmp(object->name,
"ipSystemStatsHCOutMcastOctets") == 0)
706 else if(
osStrcmp(object->name,
"ipSystemStatsInBcastPkts") == 0)
711 else if(
osStrcmp(object->name,
"ipSystemStatsHCInBcastPkts") == 0)
716 else if(
osStrcmp(object->name,
"ipSystemStatsOutBcastPkts") == 0)
721 else if(
osStrcmp(object->name,
"ipSystemStatsHCOutBcastPkts") == 0)
726 else if(
osStrcmp(object->name,
"ipSystemStatsDiscontinuityTime") == 0)
731 else if(
osStrcmp(object->name,
"ipSystemStatsRefreshRate") == 0)
763 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
770 if(*nextOidLen < object->
oidLen)
774 osMemcpy(nextOid, object->oid, object->oidLen);
779 #if (IPV4_SUPPORT == DISABLED || IPV4_STATS_SUPPORT == DISABLED)
787 #if (IPV6_SUPPORT == DISABLED || IPV6_STATS_SUPPORT == DISABLED)
865 if(index < 1 || index > context->numInterfaces)
868 #if (IPV4_SUPPORT == ENABLED && IPV4_STATS_SUPPORT == ENABLED)
873 ipIfStats = &context->interfaces[index - 1].ipv4IfStats;
877 #if (IPV6_SUPPORT == ENABLED && IPV6_STATS_SUPPORT == ENABLED)
882 ipIfStats = &context->interfaces[index - 1].ipv6IfStats;
893 if(ipIfStats != NULL)
896 if(
osStrcmp(object->name,
"ipIfStatsInReceives") == 0)
901 else if(
osStrcmp(object->name,
"ipIfStatsHCInReceives") == 0)
906 else if(
osStrcmp(object->name,
"ipIfStatsInOctets") == 0)
911 else if(
osStrcmp(object->name,
"ipIfStatsHCInOctets") == 0)
916 else if(
osStrcmp(object->name,
"ipIfStatsInHdrErrors") == 0)
921 else if(
osStrcmp(object->name,
"ipIfStatsInNoRoutes") == 0)
926 else if(
osStrcmp(object->name,
"ipIfStatsInAddrErrors") == 0)
931 else if(
osStrcmp(object->name,
"ipIfStatsInUnknownProtos") == 0)
936 else if(
osStrcmp(object->name,
"ipIfStatsInTruncatedPkts") == 0)
941 else if(
osStrcmp(object->name,
"ipIfStatsInForwDatagrams") == 0)
946 else if(
osStrcmp(object->name,
"ipIfStatsHCInForwDatagrams") == 0)
951 else if(
osStrcmp(object->name,
"ipIfStatsReasmReqds") == 0)
956 else if(
osStrcmp(object->name,
"ipIfStatsReasmOKs") == 0)
961 else if(
osStrcmp(object->name,
"ipIfStatsReasmFails") == 0)
966 else if(
osStrcmp(object->name,
"ipIfStatsInDiscards") == 0)
971 else if(
osStrcmp(object->name,
"ipIfStatsInDelivers") == 0)
976 else if(
osStrcmp(object->name,
"ipIfStatsHCInDelivers") == 0)
981 else if(
osStrcmp(object->name,
"ipIfStatsOutRequests") == 0)
986 else if(
osStrcmp(object->name,
"ipIfStatsHCOutRequests") == 0)
991 else if(
osStrcmp(object->name,
"ipIfStatsOutForwDatagrams") == 0)
996 else if(
osStrcmp(object->name,
"ipIfStatsHCOutForwDatagrams") == 0)
1001 else if(
osStrcmp(object->name,
"ipIfStatsOutDiscards") == 0)
1006 else if(
osStrcmp(object->name,
"ipIfStatsOutFragReqds") == 0)
1011 else if(
osStrcmp(object->name,
"ipIfStatsOutFragOKs") == 0)
1016 else if(
osStrcmp(object->name,
"ipIfStatsOutFragFails") == 0)
1021 else if(
osStrcmp(object->name,
"ipIfStatsOutFragCreates") == 0)
1026 else if(
osStrcmp(object->name,
"ipIfStatsOutTransmits") == 0)
1031 else if(
osStrcmp(object->name,
"ipIfStatsHCOutTransmits") == 0)
1036 else if(
osStrcmp(object->name,
"ipIfStatsOutOctets") == 0)
1041 else if(
osStrcmp(object->name,
"ipIfStatsHCOutOctets") == 0)
1046 else if(
osStrcmp(object->name,
"ipIfStatsInMcastPkts") == 0)
1051 else if(
osStrcmp(object->name,
"ipIfStatsHCInMcastPkts") == 0)
1056 else if(
osStrcmp(object->name,
"ipIfStatsInMcastOctets") == 0)
1061 else if(
osStrcmp(object->name,
"ipIfStatsHCInMcastOctets") == 0)
1066 else if(
osStrcmp(object->name,
"ipIfStatsOutMcastPkts") == 0)
1071 else if(
osStrcmp(object->name,
"ipIfStatsHCOutMcastPkts") == 0)
1076 else if(
osStrcmp(object->name,
"ipIfStatsOutMcastOctets") == 0)
1081 else if(
osStrcmp(object->name,
"ipIfStatsHCOutMcastOctets") == 0)
1086 else if(
osStrcmp(object->name,
"ipIfStatsInBcastPkts") == 0)
1091 else if(
osStrcmp(object->name,
"ipIfStatsHCInBcastPkts") == 0)
1096 else if(
osStrcmp(object->name,
"ipIfStatsOutBcastPkts") == 0)
1101 else if(
osStrcmp(object->name,
"ipIfStatsHCOutBcastPkts") == 0)
1106 else if(
osStrcmp(object->name,
"ipIfStatsDiscontinuityTime") == 0)
1111 else if(
osStrcmp(object->name,
"ipIfStatsRefreshRate") == 0)
1143 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
1155 if(*nextOidLen < object->
oidLen)
1159 osMemcpy(nextOid, object->oid, object->oidLen);
1164 #if (IPV4_SUPPORT == DISABLED || IPV4_STATS_SUPPORT == DISABLED)
1172 #if (IPV6_SUPPORT == DISABLED || IPV6_STATS_SUPPORT == DISABLED)
1182 for(index = 1; index <= context->numInterfaces; index++)
1269 if(index < 1 || index > context->numInterfaces)
1273 interface = &context->interfaces[index - 1];
1275 #if (IPV4_SUPPORT == ENABLED)
1285 entry = &interface->ipv4Context.addrList[i];
1306 if(
osStrcmp(object->name,
"ipAddressPrefixOrigin") == 0)
1312 else if(
osStrcmp(object->name,
"ipAddressPrefixOnLinkFlag") == 0)
1319 else if(
osStrcmp(object->name,
"ipAddressPrefixAutonomousFlag") == 0)
1326 else if(
osStrcmp(object->name,
"ipAddressPrefixAdvPreferredLifetime") == 0)
1330 value->unsigned32 = UINT32_MAX;
1333 else if(
osStrcmp(object->name,
"ipAddressPrefixAdvValidLifetime") == 0)
1337 value->unsigned32 = UINT32_MAX;
1354 #if (IPV6_SUPPORT == ENABLED)
1364 entry = &interface->ipv6Context.prefixList[i];
1385 if(
osStrcmp(object->name,
"ipAddressPrefixOrigin") == 0)
1398 else if(
osStrcmp(object->name,
"ipAddressPrefixOnLinkFlag") == 0)
1412 else if(
osStrcmp(object->name,
"ipAddressPrefixAutonomousFlag") == 0)
1426 else if(
osStrcmp(object->name,
"ipAddressPrefixAdvPreferredLifetime") == 0)
1432 value->unsigned32 = UINT32_MAX;
1440 else if(
osStrcmp(object->name,
"ipAddressPrefixAdvValidLifetime") == 0)
1446 value->unsigned32 = UINT32_MAX;
1490 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
1514 if(*nextOidLen < object->
oidLen)
1518 osMemcpy(nextOid, object->oid, object->oidLen);
1520 #if (IPV4_SUPPORT == ENABLED)
1522 for(curIndex = 1; curIndex <= context->numInterfaces; curIndex++)
1527 interface = &context->interfaces[curIndex - 1];
1533 entry = &interface->ipv4Context.addrList[i];
1575 else if(curIndex < index)
1579 else if(curIndex > index)
1591 else if(curLength <
length)
1614 #if (IPV6_SUPPORT == ENABLED)
1616 for(curIndex = 1; curIndex <= context->numInterfaces; curIndex++)
1621 interface = &context->interfaces[curIndex - 1];
1627 entry = &interface->ipv6Context.prefixList[i];
1668 else if(curIndex < index)
1672 else if(curIndex > index)
1684 else if(curLength <
length)
1758 value->integer, commit);
1840 #if (IPV4_SUPPORT == ENABLED)
1847 for(index = 1; index <= context->numInterfaces; index++)
1850 interface = &context->interfaces[index - 1];
1856 entry = &interface->ipv4Context.addrList[i];
1873 if(index <= context->numInterfaces)
1876 if(
osStrcmp(object->name,
"ipAddressIfIndex") == 0)
1880 value->integer = index;
1883 else if(
osStrcmp(object->name,
"ipAddressType") == 0)
1889 else if(
osStrcmp(object->name,
"ipAddressPrefix") == 0)
1895 const uint8_t ipAddressPrefixOriginOid[] = {43, 6, 1, 2, 1, 4, 32, 1, 5};
1904 n =
sizeof(ipAddressPrefixOriginOid);
1936 else if(
osStrcmp(object->name,
"ipAddressOrigin") == 0)
1938 #if (AUTO_IP_SUPPORT == ENABLED)
1940 if(interface->autoIpContext != NULL &&
1941 interface->autoIpContext->running)
1948 #if (DHCP_CLIENT_SUPPORT == ENABLED)
1950 if(interface->dhcpClientContext != NULL &&
1951 interface->dhcpClientContext->running)
1965 else if(
osStrcmp(object->name,
"ipAddressStatus") == 0)
1982 else if(
osStrcmp(object->name,
"ipAddressCreated") == 0)
1985 value->timeTicks = 0;
1988 else if(
osStrcmp(object->name,
"ipAddressLastChanged") == 0)
1991 value->timeTicks = 0;
1994 else if(
osStrcmp(object->name,
"ipAddressRowStatus") == 0)
2000 else if(
osStrcmp(object->name,
"ipAddressStorageType") == 0)
2020 #if (IPV6_SUPPORT == ENABLED)
2027 for(index = 1; index <= context->numInterfaces; index++)
2030 interface = &context->interfaces[index - 1];
2036 entry = &interface->ipv6Context.addrList[i];
2053 if(index <= context->numInterfaces)
2056 if(
osStrcmp(object->name,
"ipAddressIfIndex") == 0)
2060 value->integer = index;
2063 else if(
osStrcmp(object->name,
"ipAddressType") == 0)
2069 else if(
osStrcmp(object->name,
"ipAddressPrefix") == 0)
2072 const uint8_t unknownOid[] = {0};
2075 if(*valueLen <
sizeof(unknownOid))
2081 *valueLen =
sizeof(unknownOid);
2084 else if(
osStrcmp(object->name,
"ipAddressOrigin") == 0)
2090 else if(
osStrcmp(object->name,
"ipAddressStatus") == 0)
2111 else if(
osStrcmp(object->name,
"ipAddressCreated") == 0)
2114 value->timeTicks = 0;
2117 else if(
osStrcmp(object->name,
"ipAddressLastChanged") == 0)
2120 value->timeTicks = 0;
2123 else if(
osStrcmp(object->name,
"ipAddressRowStatus") == 0)
2129 else if(
osStrcmp(object->name,
"ipAddressStorageType") == 0)
2171 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
2190 if(*nextOidLen < object->
oidLen)
2194 osMemcpy(nextOid, object->oid, object->oidLen);
2196 #if (IPV4_SUPPORT == ENABLED)
2198 for(index = 1; index <= context->numInterfaces; index++)
2203 interface = &context->interfaces[index - 1];
2209 entry = &interface->ipv4Context.addrList[i];
2255 #if (IPV6_SUPPORT == ENABLED)
2257 for(index = 1; index <= context->numInterfaces; index++)
2262 interface = &context->interfaces[index - 1];
2268 entry = &interface->ipv6Context.addrList[i];
2399 if(index < 1 || index > context->numInterfaces)
2403 interface = &context->interfaces[index - 1];
2407 #if (IPV4_SUPPORT == ENABLED && ETH_SUPPORT == ENABLED)
2420 if(
osStrcmp(object->name,
"ipNetToPhysicalPhysAddress") == 0)
2423 if(*valueLen >=
sizeof(
MacAddr))
2437 else if(
osStrcmp(object->name,
"ipNetToPhysicalLastUpdated") == 0)
2443 else if(
osStrcmp(object->name,
"ipNetToPhysicalType") == 0)
2449 else if(
osStrcmp(object->name,
"ipNetToPhysicalState") == 0)
2455 else if(
osStrcmp(object->name,
"ipNetToPhysicalRowStatus") == 0)
2475 #if (IPV6_SUPPORT == ENABLED)
2488 if(
osStrcmp(object->name,
"ipNetToPhysicalPhysAddress") == 0)
2491 if(*valueLen >=
sizeof(
MacAddr))
2505 else if(
osStrcmp(object->name,
"ipNetToPhysicalLastUpdated") == 0)
2511 else if(
osStrcmp(object->name,
"ipNetToPhysicalType") == 0)
2517 else if(
osStrcmp(object->name,
"ipNetToPhysicalState") == 0)
2546 else if(
osStrcmp(object->name,
"ipNetToPhysicalRowStatus") == 0)
2588 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
2609 if(*nextOidLen < object->
oidLen)
2613 osMemcpy(nextOid, object->oid, object->oidLen);
2616 for(curIndex = 1; curIndex <= context->numInterfaces; curIndex++)
2619 interface = &context->interfaces[curIndex - 1];
2627 #if (IPV4_SUPPORT == ENABLED && ETH_SUPPORT == ENABLED)
2634 entry = &interface->arpCache[i];
2668 else if(curIndex < index)
2672 else if(curIndex > index)
2697 #if (IPV6_SUPPORT == ENABLED)
2704 entry = &interface->ndpContext.neighborCache[i];
2738 else if(curIndex < index)
2742 else if(curIndex > index)
2831 if(index < 1 || index > context->numInterfaces)
2835 if(
osStrcmp(object->name,
"ipv6ScopeZoneIndexLinkLocal") == 0)
2837 value->unsigned32 = index;
2840 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndex3") == 0)
2842 value->unsigned32 = 0;
2845 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndexAdminLocal") == 0)
2847 value->unsigned32 = 0;
2850 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndexSiteLocal") == 0)
2852 value->unsigned32 = 0;
2855 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndex6") == 0)
2857 value->unsigned32 = 0;
2860 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndex7") == 0)
2862 value->unsigned32 = 0;
2865 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndexOrganizationLocal") == 0)
2867 value->unsigned32 = 0;
2870 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndex9") == 0)
2872 value->unsigned32 = 0;
2875 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndexA") == 0)
2877 value->unsigned32 = 0;
2880 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndexB") == 0)
2882 value->unsigned32 = 0;
2885 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndexC") == 0)
2887 value->unsigned32 = 0;
2890 else if(
osStrcmp(object->name,
"ipv6ScopeZoneIndexD") == 0)
2892 value->unsigned32 = 0;
2916 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
2927 if(*nextOidLen < object->
oidLen)
2931 osMemcpy(nextOid, object->oid, object->oidLen);
2934 for(index = 1; index <= context->numInterfaces; index++)
3007 if(index < 1 || index > context->numInterfaces)
3011 interface = &context->interfaces[index - 1];
3013 #if (IPV4_SUPPORT == ENABLED)
3023 entry = &interface->ipv4Context.addrList[i];
3037 if(
osStrcmp(object->name,
"ipDefaultRouterLifetime") == 0)
3040 value->unsigned32 = UINT16_MAX;
3043 else if(
osStrcmp(object->name,
"ipDefaultRouterPreference") == 0)
3063 #if (IPV6_SUPPORT == ENABLED)
3073 entry = &interface->ipv6Context.routerList[i];
3090 if(
osStrcmp(object->name,
"ipDefaultRouterLifetime") == 0)
3095 value->unsigned32 = UINT16_MAX;
3103 else if(
osStrcmp(object->name,
"ipDefaultRouterPreference") == 0)
3160 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
3181 if(*nextOidLen < object->
oidLen)
3185 osMemcpy(nextOid, object->oid, object->oidLen);
3187 #if (IPV4_SUPPORT == ENABLED)
3189 for(curIndex = 1; curIndex <= context->numInterfaces; curIndex++)
3194 interface = &context->interfaces[curIndex - 1];
3200 entry = &interface->ipv4Context.addrList[i];
3243 else if(curIndex < index)
3265 #if (IPV6_SUPPORT == ENABLED)
3267 for(curIndex = 1; curIndex <= context->numInterfaces; curIndex++)
3272 interface = &context->interfaces[curIndex - 1];
3278 entry = &interface->ipv6Context.routerList[i];
3320 else if(curIndex < index)
3385 #if (IPV6_SUPPORT == ENABLED)
3388 value->integer, commit);
3409 #if (IPV6_SUPPORT == ENABLED)
3457 #if (IPV6_SUPPORT == ENABLED && NDP_ROUTER_ADV_SUPPORT == ENABLED)
3480 if(index < 1 || index > context->numInterfaces)
3484 routerAdvContext = context->interfaces[index - 1].ndpRouterAdvContext;
3487 if(routerAdvContext != NULL)
3490 if(
osStrcmp(object->name,
"ipv6RouterAdvertSendAdverts") == 0)
3495 if(routerAdvContext->running)
3505 else if(
osStrcmp(object->name,
"ipv6RouterAdvertMaxInterval") == 0)
3509 value->unsigned32 = routerAdvContext->maxRtrAdvInterval;
3512 else if(
osStrcmp(object->name,
"ipv6RouterAdvertMinInterval") == 0)
3516 value->unsigned32 = routerAdvContext->minRtrAdvInterval;
3519 else if(
osStrcmp(object->name,
"ipv6RouterAdvertManagedFlag") == 0)
3523 if(routerAdvContext->managedFlag)
3533 else if(
osStrcmp(object->name,
"ipv6RouterAdvertOtherConfigFlag") == 0)
3537 if(routerAdvContext->otherConfigFlag)
3547 else if(
osStrcmp(object->name,
"ipv6RouterAdvertLinkMTU") == 0)
3551 value->unsigned32 = routerAdvContext->linkMtu;
3554 else if(
osStrcmp(object->name,
"ipv6RouterAdvertReachableTime") == 0)
3558 value->unsigned32 = routerAdvContext->reachableTime;
3561 else if(
osStrcmp(object->name,
"ipv6RouterAdvertRetransmitTime") == 0)
3565 value->unsigned32 = routerAdvContext->retransTimer;
3568 else if(
osStrcmp(object->name,
"ipv6RouterAdvertCurHopLimit") == 0)
3572 value->unsigned32 = routerAdvContext->curHopLimit;
3575 else if(
osStrcmp(object->name,
"ipv6RouterAdvertDefaultLifetime") == 0)
3579 value->unsigned32 = routerAdvContext->defaultLifetime;
3582 else if(
osStrcmp(object->name,
"ipv6RouterAdvertRowStatus") == 0)
3620 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
3622 #if (IPV6_SUPPORT == ENABLED && NDP_ROUTER_ADV_SUPPORT == ENABLED)
3632 if(*nextOidLen < object->
oidLen)
3636 osMemcpy(nextOid, object->oid, object->oidLen);
3639 for(index = 1; index <= context->numInterfaces; index++)
3642 if(context->interfaces[index - 1].ndpRouterAdvContext != NULL)
3707 #if (IPV4_SUPPORT == ENABLED && ICMP_STATS_SUPPORT == ENABLED)
3712 icmpStats = &context->icmpStats;
3716 #if (IPV6_SUPPORT == ENABLED && ICMPV6_STATS_SUPPORT == ENABLED)
3721 icmpStats = &context->icmpv6Stats;
3732 if(icmpStats != NULL)
3735 if(
osStrcmp(object->name,
"icmpStatsInMsgs") == 0)
3740 else if(
osStrcmp(object->name,
"icmpStatsInErrors") == 0)
3745 else if(
osStrcmp(object->name,
"icmpStatsOutMsgs") == 0)
3750 else if(
osStrcmp(object->name,
"icmpStatsOutErrors") == 0)
3782 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
3789 if(*nextOidLen < object->
oidLen)
3793 osMemcpy(nextOid, object->oid, object->oidLen);
3798 #if (IPV4_SUPPORT == DISABLED || ICMP_STATS_SUPPORT == DISABLED)
3806 #if (IPV6_SUPPORT == DISABLED || ICMPV6_STATS_SUPPORT == DISABLED)
3887 #if (IPV4_SUPPORT == ENABLED && ICMP_STATS_SUPPORT == ENABLED)
3892 icmpStats = &context->icmpStats;
3896 #if (IPV6_SUPPORT == ENABLED && ICMPV6_STATS_SUPPORT == ENABLED)
3901 icmpStats = &context->icmpv6Stats;
3912 if(icmpStats != NULL)
3915 if(
osStrcmp(object->name,
"icmpMsgStatsInPkts") == 0)
3920 else if(
osStrcmp(object->name,
"icmpMsgStatsOutPkts") == 0)
3952 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen)
3965 if(*nextOidLen < object->
oidLen)
3969 osMemcpy(nextOid, object->oid, object->oidLen);
3974 #if (IPV4_SUPPORT == ENABLED && ICMP_STATS_SUPPORT == ENABLED)
3979 icmpStats = &context->icmpStats;
3983 #if (IPV6_SUPPORT == ENABLED && ICMPV6_STATS_SUPPORT == ENABLED)
3988 icmpStats = &context->icmpv6Stats;
3999 if(icmpStats != NULL)
@ IPV6_ADDR_STATE_TENTATIVE
An address whose uniqueness on a link is being verified.
error_t ipMibGetIpAddressPrefixEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipAddressPrefixEntry object value.
@ IP_MIB_ROUTER_PREFERENCE_MEDIUM
error_t ipMibGetIpDefaultRouterEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipDefaultRouterEntry object value.
NdpNeighborCacheEntry * ndpFindNeighborCacheEntry(NetInterface *interface, const Ipv6Addr *ipAddr)
Search the Neighbor cache for a given IPv6 address.
IPv6 (Internet Protocol Version 6)
error_t ipMibGetNextIpSystemStatsEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipSystemStatsEntry object.
@ IP_MIB_ROUTER_PREFERENCE_RESERVED
systime_t lifetime
Router lifetime.
@ IP_MIB_PREFIX_ORIGIN_MANUAL
uint32_t discontinuityTime
error_t mibEncodeIpAddr(uint8_t *oid, size_t maxOidLen, size_t *pos, const IpAddr *ipAddr)
Encode instance identifier (IP address)
error_t ipMibSetIpv6RouterAdvertSpinLock(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set ipv6RouterAdvertSpinLock object value.
@ NDP_ROUTER_SEL_PREFERENCE_MEDIUM
error_t ipMibGetIpAddressEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipAddressEntry object value.
@ IP_MIB_ADDR_STATUS_TENTATIVE
Ipv4Addr addr
IPv4 address.
int32_t ipv6RouterAdvertSpinLock
error_t ipMibInit(void)
IP MIB module initialization.
int32_t ipAddressSpinLock
error_t ipMibGetNextIcmpStatsEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next icmpStatsEntry object.
@ IP_MIB_ADDR_TYPE_UNICAST
uint32_t netGetRandRange(NetContext *context, uint32_t min, uint32_t max)
Generate a random value in the specified range.
systime_t preferredLifetime
Preferred lifetime.
error_t ipMibGetIpSystemStatsEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipSystemStatsEntry object value.
@ NDP_ROUTER_SEL_PREFERENCE_LOW
error_t ipMibGetIpAddressSpinLock(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipAddressSpinLock object value.
const IpAddr IP_ADDR_UNSPECIFIED
#define NDP_NEIGHBOR_CACHE_SIZE
Ipv6Addr addr
IPv6 address.
error_t ipMibGetNextIpAddressEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipAddressEntry object.
@ IP_MIB_NET_TO_PHYS_STATE_PROBE
bool_t autonomousFlag
Autonomous flag.
systime_t validLifetime
Valid lifetime.
@ IP_MIB_ADDR_ORIGIN_RANDOM
@ IP_MIB_NET_TO_PHYS_STATE_UNKNOWN
Ipv4AddrState state
IPv4 address state.
#define ipv6CompAddr(ipAddr1, ipAddr2)
uint32_t discontinuityTime
uint_t ipv4GetPrefixLength(Ipv4Addr mask)
Calculate prefix length for a given subnet mask.
error_t ipMibGetNextIpv4InterfaceEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipv4InterfaceEntry object.
Ipv6Addr prefix
IPv6 prefix information.
#define IPV4_MAX_FRAG_DATAGRAM_SIZE
Ipv6Addr addr
Router address.
error_t ipMibGetIcmpStatsEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get icmpStatsEntry object value.
@ IP_MIB_IP_FORWARDING_ENABLED
uint32_t Ipv4Addr
IPv4 network address.
uint64_t outForwDatagrams
int_t oidComp(const uint8_t *oid1, size_t oidLen1, const uint8_t *oid2, size_t oidLen2)
Compare object identifiers.
#define IPV6_DEFAULT_HOP_LIMIT
#define macCopyAddr(destMacAddr, srcMacAddr)
@ IPV6_ADDR_STATE_INVALID
An address that is not assigned to any interface.
int32_t ipv6IpDefaultHopLimit
Router advertisement service.
systime_t timestamp
Timestamp to manage entry lifetime.
int_t mibCompIpAddr(const IpAddr *ipAddr1, const IpAddr *ipAddr2)
Compare IP addresses.
Helper functions for IPv4.
#define NdpRouterAdvContext
Ipv4Addr defaultGateway
Default gateway.
#define osMemcpy(dest, src, length)
MacAddr macAddr
Link layer address associated with the IPv6 address.
@ IP_MIB_PREFIX_ORIGIN_ROUTER_ADV
error_t ipMibGetIcmpMsgStatsEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get icmpMsgStatsEntry object value.
@ IPV4_ADDR_STATE_TENTATIVE
An address whose uniqueness on a link is being verified.
@ IP_MIB_ADDR_STATUS_PREFERRED
@ ERROR_INSTANCE_NOT_FOUND
error_t ipMibGetNextIpv6RouterAdvertEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipv6RouterAdvertEntry object.
#define eui64CopyAddr(destEui64Addr, srcEui64Addr)
MacAddr macAddr
Link layer address associated with the IPv4 address.
error_t ipMibSetIpv6InterfaceEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set ipv6InterfaceEntry object value.
error_t ipMibGetIpNetToPhysicalEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipNetToPhysicalEntry object value.
uint8_t preference
Preference value.
error_t ipMibGetNextIpDefaultRouterEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipDefaultRouterEntry object.
@ IP_MIB_NET_TO_PHYS_STATE_INCOMPLETE
@ IP_MIB_ADDR_ORIGIN_DHCP
@ IP_MIB_NET_TO_PHYS_STATE_REACHABLE
error_t ipMibGetIpv6RouterAdvertSpinLock(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipv6RouterAdvertSpinLock object value.
General definitions for cryptographic algorithms.
#define IPV6_MAX_FRAG_DATAGRAM_SIZE
IP MIB module implementation.
Helper functions for IPv6.
NetContext * netGetDefaultContext(void)
Get default TCP/IP stack context.
IpMibBase ipMibBase
IP MIB base.
error_t ipMibGetNextIpv6InterfaceEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipv6InterfaceEntry object.
error_t ipMibGetIpv6InterfaceEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipv6InterfaceEntry object value.
#define IPV4_ADDR_LIST_SIZE
error_t ipMibSetIpv6RouterAdvertEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set ipv6RouterAdvertEntry object value.
#define IPV4_FRAG_TIME_TO_LIVE
Neighbor and destination cache management.
@ IP_MIB_NET_TO_PHYS_STATE_STALE
ArpState state
Reachability state.
error_t ipMibGetNextIpNetToPhysicalEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipNetToPhysicalEntry object.
@ IP_MIB_ROUTER_PREFERENCE_LOW
bool_t onLinkFlag
On-link flag.
bool_t permanent
Permanently assigned prefix.
System-wide IP statistics.
uint8_t prefixLen
IPv6 prefix length.
error_t mibDecodeIndex(const uint8_t *oid, size_t oidLen, size_t *pos, uint_t *index)
Decode instance identifier (index)
Ipv4Addr subnetMask
Subnet mask.
error_t ipMibSetIpNetToPhysicalEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set ipNetToPhysicalEntry object value.
Ipv6Addr ipAddr
Unicast IPv6 address.
error_t ipMibGetIpv6ScopeZoneIndexEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipv6ScopeZoneIndexEntry object value.
error_t ipMibGetNextIcmpMsgStatsEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next icmpMsgStatsEntry object.
Default router list entry.
@ NDP_ROUTER_SEL_PREFERENCE_HIGH
ArpCacheEntry * arpFindEntry(NetInterface *interface, Ipv4Addr ipAddr)
Search the ARP cache for a given IPv4 address.
@ IP_MIB_ROUTER_PREFERENCE_HIGH
error_t ipMibSetIpAddressEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set ipAddressEntry object value.
Per-interface IP statistics.
Common definitions for MIB modules.
#define IPV6_ROUTER_LIST_SIZE
error_t ipMibGetIpIfStatsEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipIfStatsEntry object value.
error_t ipMibGetIpv4InterfaceEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipv4InterfaceEntry object value.
#define IPV6_ADDR_LIST_SIZE
NdpState state
Reachability state.
error_t ipMibGetNextIpv6ScopeZoneIndexEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipv6ScopeZoneIndexEntry object.
systime_t timestamp
Timestamp to manage entry lifetime.
bool_t ipv6CompPrefix(const Ipv6Addr *ipAddr1, const Ipv6Addr *ipAddr2, size_t length)
Compare IPv6 address prefixes.
error_t mibDecodeIpAddr(const uint8_t *oid, size_t oidLen, size_t *pos, IpAddr *ipAddr)
Decode instance identifier (IP address)
@ MIB_STORAGE_TYPE_VOLATILE
error_t mibDecodeUnsigned32(const uint8_t *oid, size_t oidLen, size_t *pos, uint32_t *value)
Decode instance identifier (unsigned 32-bit integer)
error_t ipMibGetNextIpIfStatsEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipIfStatsEntry object.
error_t mibEncodeIndex(uint8_t *oid, size_t maxOidLen, size_t *pos, uint_t index)
Encode instance identifier (index)
@ IPV4_ADDR_STATE_VALID
An address assigned to an interface whose use is unrestricted.
@ IP_MIB_IP_FORWARDING_DISABLED
error_t mibTestAndIncSpinLock(int32_t *spinLock, int32_t value, bool_t commit)
Test and increment spin lock.
error_t mibEncodeUnsigned32(uint8_t *oid, size_t maxOidLen, size_t *pos, uint32_t value)
Encode instance identifier (unsigned 32-bit integer)
IPv4 (Internet Protocol Version 4)
@ IPV6_ADDR_STATE_PREFERRED
An address assigned to an interface whose use is unrestricted.
Ipv6AddrState state
IPv6 address state.
#define IPV6_PREFIX_LIST_SIZE
#define osMemset(p, value, length)
NetInterface * nicGetLogicalInterface(NetInterface *interface)
Retrieve logical interface.
@ IP_MIB_ADDR_ORIGIN_MANUAL
@ IPV6_ADDR_STATE_DEPRECATED
An address assigned to an interface whose use is discouraged.
error_t ipMibGetNextIpAddressPrefixEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next ipAddressPrefixEntry object.
@ IP_MIB_NET_TO_PHYS_TYPE_DYNAMIC
@ IP_MIB_NET_TO_PHYS_STATE_DELAY
#define ARP_REQUEST_TIMEOUT
error_t ipMibSetIpv4InterfaceEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set ipv4InterfaceEntry object value.
error_t ipMibGetIpv6RouterAdvertEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get ipv6RouterAdvertEntry object value.
@ IP_MIB_ADDR_STATUS_DEPRECATED
error_t ipMibSetIpAddressSpinLock(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set ipAddressSpinLock object value.
Ipv4Addr ipAddr
Unicast IPv4 address.
@ IP_MIB_ADDR_STATUS_UNKNOWN
ASN.1 (Abstract Syntax Notation One)
#define IPV4_UNSPECIFIED_ADDR
uint64_t outForwDatagrams