Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.6.0.3
|
This document provides a brief description of the IP Route Table and Status OpEN APIs. It provides the following services:
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.
section OPENADKSWITCHPORT_CONFIG_EXAMPLE Example C Application ipRouteTable_example
ipRouteTable_example is a sample application that demonstrates the use of the IP Route Table OpEN API's. ipRouteTable_example is started from the command line and has the following usage syntax:
Usage: ipRouteTable_example
ICOS version = 8.16.6.46 Route destination IP address(integer) is: 0 Route mask is(integer): 0 Route protocol(integer) is: 18 Route preference is: 1 Route metric is: 0 Route age is: 10090 Hardware failure status is: 0 Next hop interfaces: 0/23 Next hop IP addresses: 192.168.10.0
In addition to ipRouteTable_example.c, a python implementation has also been provided for demonstration purposes. This python ipRouteTable_example.py script essentially duplicates the ipRouteTable_example.c implementation:
Route destination IP address(integer) is: 0 Route mask is(integer): 0 Route protocol(integer) is: 18 Route preference is: 1 Route metric is: 0 Route age is: 10090 Hardware failure status is: 0 Next hop interfaces: 0/23 Next hop IP addresses: 192.168.10.0
ipRouteTable_example.c is a sample application that demonstrates the use of the ip route table OpEN API. ipRouteTable_example is started from the command line, use it to demonstrate how to get route entry and read/modify property of this entry.