Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Routing Stats

Routing Stats OpEN API

This document provides a brief description of the Routing Stats OpEN API. The Routing Stats OpEN API allows processes outside of the ICOS main process (switchdrvr) access to route protocol statistics. The API provides access to most of the data that is obtainable at the CLI, using the "show ip route summary" and "show ipv6 route summary" commands. It provides the following services:

Example C Application stats_example

stats_example.c is a sample application that demonstrates the use of the Routing Stats OpEN APIs. The output displayed closely resembles the output that is obtained when running both "show ip route summary" and "show ipv6 route summary" from the switch CLI. stats_example is started from the command line and has the following usage syntax:

Usage: arptable_example [-v vrfname] [-b]

-v vrfname: specify a relevant vrf name (IPv4 only)
-b show best routes only

Initialization

In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.

Routing Stats CLI/API Cross Reference

The mapping between the OpEN APIs and CLI commands is shown below.

CLI Command | OpEN API Functions
--------------------------------------—

(Config)# show ip route summary | openapiIpv4RouteTableStatsGet(), openapiIpMapDynamicProtoNextGet(), openapiIpMapProtoNameGet(), openapiIpMapProtoNameLenGet(), openapiIpMapRouteTypeNameGet(), openapiIpMapRouteTypeNameLenGet(), openapiGetReportableRouteStats()
(Config)# show ipv6 route summary | openapiIpv6RouteTableStatsGet(), openapiGetReportableRouteStats()