Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.6.0.3
|
This document provides a brief description of the Routing Configuration OpEN API. The Routing Configuration OpEN API allows processes outside of the ICOS main process (switchdrvr) access to Routing Management services. It provides the following services:
routing_example.c is a sample application that demonstrates the use of the Routing Configuration OpEN API's. routing_example is started from the command line and has the following usage syntax:
Usage: routing_example API <test_number> [<arg1>][<arg2>] ...
Test API 1: Add IP address on an interface: routing_example API 1 <interface> <address_family> <address_type> <IP_Address> <Pfx_length> <arg1>
Test API 2: Delete IP address on an interface: routing_example API 2 <interface> <address_family> <address_type> <IP_Address> <Pfx_length> <arg1>
Test API 3: Enable/Disable IP Routing Globally: routing_example API 3 <address_family> <mode>
Test API 4: Add a test static ARP entry {192.168.1.1 00:11:22:33:44:55} : routing_example API 4
Test API 5: Delete the test static ARP entry {192.168.1.1 00:11:22:33:44:55}: routing_example API 5
Test API 6: Display all ARP entries: routing_example API 6
Test API 7: Enable/Disable IP Redirects mode: routing_example API 7 <mode>
Test API 8: Enable/Disable IP ICMP Echo Reply mode: routing_example API 8 <mode>
Test API 9: Enable/Disable IP Helper mode: routing_example API 9 <mode>
Test API 10: Add IP Helper address: routing_example API 10 <IP_Address> <UDP_Port>
Test API 11: Delete IP Helper address: routing_example API 11 <IP_Address> <UDP_Port>
Test API 12: Configure Interface MTU: routing_example API 12 <interface> <address_family> <MTU>
Test API 13: Enable/Disable IP Net Directed BCast mode: routing_example API 13 <interface> <mode>
Test API 14: Enable/Disable IP Proxy ARP mode: routing_example API 14 <interface> <mode>
Test API 15: Enable/Disable IP Redirects mode: routing_example API 15 <interface> <mode>
Test API 16: Enable/Disable IP Destination Unreachable mode: routing_example API 16 <interface> <mode>
Test API 17: Enable/Disable IP Interface Routing mode: routing_example API 17 <interface> <mode>
Test API 18: Add Interface IP Helper address: routing_example API 18 <interface> <IP_Address> <UDP_Port>
Test API 19: Delete Interface IP Helper address: routing_example API 19 <interface> <IP_Address> <UDP_Port>
Test API 20: Add Interface IP Helper Discard entry: routing_example API 20 <interface> <UDP_Port>
Test API 21: Delete Interface IP Helper Discard entry: routing_example API 21 <interface> <UDP_Port>
Test API 22: Add an IP route: routing_example API 22 <address_family> <IP_Address> <Pfx_length> <Next_Hop> <interface> <rtePref> <mpls-label1> <mpls-label2> <mpls-label3>
Test API 23: Delete an IP route: routing_example API 23 <address_family> <IP_Address> <Pfx_length> <Next_Hop> <interface>
Test API 24: Create a VLAN Routing Interface: routing_example API 24 <VLAN_Id>
Test API 25: Delete a VLAN Routing Interface: routing_example API 25 <VLAN_Id>
Test API 26: Test Routing Configuration OpEN APIs sanity: routing_example API 26
Test API 27: Create a BFD session: routing_example API 27 <Intf> <Dest IP> <Src IP>
Test API 28: Delete a BFD session: routing_example API 28 <Intf> <Dest IP> <Src IP>
Test API 29: Show BFD neighbors: routing_example API 29
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_example.c exercises all the Routing Configuration OpEN APIs with appropriate arguments to manage the Routing component in the ICOS main process (switchdrvr).
CLI Command | OpEN API Reference |
---|---|
(Config)# arp <ipaddr> <macaddr> | openapiArpEntryAdd() |
(Config)# no arp <ipaddr> | openapiArpEntryDel() |
(Config)# ip helper-address <ip-addr> | openapiIpHelperAddressAdd() |
(Config)# no ip helper-address <ip-addr> | openapiIpHelperAddressDel() |
(Config)# [no]ip helper enable | openapiIpHelperModeSet() |
(Config)# [no]ip icmp echo-reply | openapiIpICMPEchoReplyModeSet() |
(Config)# [no]ip redirects | openapiIpRedirectsModeSet() |
(Config)# ip route <ip addr> <subnet mask> {<nextHopRtr> | Null0} [preference] | openapiIpRouteAdd() |
(Config)# no ip route <ip-addr> <mask> {<nextHopRtr> | Null0} | openapiIpRouteDel() |
(Config)# [no]ip routing/ipv6 unicast-routing | openapiRtrAdminModeSet() |
(Interface-Config Mode)# ip address {<ipaddr> <subnet-mask | prefix-length> [secondary] | dhcp [client-id]} | openapiRtrIntfIpAddrAdd() |
(Interface-Config Mode)# no ip address [<ipaddr> [<subnet-mask | prefix-length>] | dhcp [client-id]] | openapiRtrIntfIpAddrDel() |
(Interface-Config Mode)# [no]ip unreachables | openapiRtrIntfIpDestUnreachableModeSet() |
(Interface-Config Mode)# ip helper-address <ip-addr> <udp-port> | openapiRtrIntfIpHelperAddressAdd() |
(Interface-Config Mode)# [no]ip helper-address <ip-addr> <udp-port> | openapiRtrIntfIpHelperAddressDel() |
(Interface-Config Mode)# ip helper-address discard <udp-port> | openapiRtrIntfIpHelperDiscardAdd() |
(Interface-Config Mode)# [no]ip helper-address discard <udp-port> | openapiRtrIntfIpHelperDiscardDel() |
(Interface-Config Mode)# [no]ip netdirbcast | openapiRtrIntfIpNetDirBroadcastModeSet() |
(Interface-Config Mode)# [no]ip proxy-arp | openapiRtrIntfIpProxyArpModeSet() |
(Interface-Config Mode)# [no]ip redirects | openapiRtrIntfIpRedirectsModeSet() |
(Interface-Config Mode)# [no]ip mtu <mtu-size> | openapiRtrIntfMTUSet() |
(Interface-Config Mode)# [no]routing | openapiRtrIntfRtrAdminModeSet() |
(Vlan)# vlan routing <vlan> [<interface ID>] | openapiRtrVlanIntfCreate() |
(Vlan)# no vlan routing <vlan> | openapiRtrVlanIntfDelete() |
(Priv-User Mode)# show arp [brief] | openapiArpEntryNextGet() |