Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.11.1.2
Routing Configuration

Routing Configuration OpEN API

This document provides a brief description of the Routing Configuration OpEN API. The Routing Configuration OpEN API allows processes outside of the EFOS main process (switchdrvr) access to Routing Management services. It provides the following services:

Example C Application routing_example

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
Test API 30: Find a BFD session: routing_example API 30 <Address_family> <Dest IP>
Test API 31: Iterate the configured VRFs
Test API 32: Show the ifnum for a VLAN Routing Interface: routing_example API 32 <VLAN Id>
Test API 34: Get the router discovery mode on given interface: routing_example API 34 <interface>
Test API 35: Enable/Disable the router discovery mode on given interface: routing_example API 34 <interface> <mode>
Test API 36: Get advertisement packet's destination address: routing_example API 36 <interface>
Test API 37: Set advertisement packet's destination address: routing_example API 37 <interface> <address>
Test API 38: Get max time allowed between router advertisements from interface: routing_example API 38 <interface>
Test API 39: Set max time allowed between router advertisements from interface: routing_example API 39 <interface> <time>
Test API 40: Get min time allowed between router advertisements from interface: routing_example API 40 <interface>
Test API 41: Set min time allowed between router advertisements from interface: routing_example API 41 <interface> <time>
Test API 42: Get the default minimum advertisement interval on interface: routing_example API 42 <interface>
Test API 43: Revert MinAdvertisementInterval to its default value on interface: routing_example API 43 <interface>
Test API 44: Get lifetime field value of router advertisement sent from given interface: routing_example API 44 <interface>
Test API 45: Set lifetime field value of router advertisement sent from given interface: routing_example API 45 <interface> <time>
Test API 46: Get the default value of lifetime field of router advertisement sent from interface: routing_example API 46 <interface>
Test API 47: Revert AdvertisementLifetime to its default value on interface: routing_example API 47 <interface>
Test API 48: Get the preferability of the address as a default router address: routing_example API 48 <interface>
Test API 49: Set the preferability of the address as a default router address: routing_example API 49 <interface> <pref-level>
Test API 50: Get the Grat ARP mode on given unnumbered interface: routing_example API 50 <interface>
Test API 51: Set the Grat ARP mode on given unnumbered interface: routing_example API 51 <interface> <grat-arp-mode>
Test API 52: Enable or disable gratitious ARP on an interface: routing_example API 52 <interface> <grat-arp-mode>
Test API 53: Enable or disable the ARP dynamic entry renew mode: routing_example API 53 <mode>
Test API 54: Displays the ARP dynamic entry renew mode: routing_example API 54
Test API 55: Sets the maximum number of entries in the ARP cache: routing_example API 55 <cache-size>
Test API 56: Sets the ARP request max retries count: routing_example API 56 <count>
Test API 57: Displays whether local proxy ARP is enabled on an interface: routing_example API 57 <interface>
Test API 58: Enable or disable the local proxy ARP on an interface: routing_example API 58 <interface> <mode>
Test API 59: Displays whether proxy ARP is enabled on an interface: routing_example API 59 <interface>
Test API 60: Sets the ARP request response timeout: routing_example API 60 <timeout>
Test API 61: Sets the ARP entry ageout time: routing_example API 61 <timeout>
Test API 62: Retrieve various ARP cache statistics: routing_example API 62 <vrfName>
Test API 63: Purges a specific dynamic/gateway entry from the ARP cache: routing_example API 63 <vrfName> <ipAddress> <interface>
Test API 64: Clears the ARP cache of all dynamic/gateway entries: routing_example API 64 <vrfName> <gateway-flag>
Test API 65: Delete a static ARP entry of a given VRF instance: routing_example API 65 <vrfName> <ipAddress> <interface>
Test API 66: Add a static ARP entry of a given VRF instance: routing_example API 66 <vrfName> <ipAddress> <interface> <mac-addr-str>
Test API 67: Display all static ARP entries currently configured:routing_example API 67 <vrfName> Test API 68: Get the configured IP MTU value on the given interface: routing_example API 68 <ifNum>
Test API 69: Get the maximum IP MTU that may be set on a given interface: routing_example API 69 <ifNum>
Test API 70: Get the IP MTU value being enforced on a given interface: routing_example API 70 <ifNum>
Test API 71: Set the current IP ECMP global load balancing mode: routing_example API 71 <lbMode>
Test API 72: Determines the current IP ECMP global load balancing mode: routing_example API 72
Test API 73: Set the current IP ECMP IPSEC SPI Hashing mode: routing_example API 73 <spiMode>
Test API 74: Determines the current IP ECMP IPSEC SPI Mode: routing_example API 74
Test API 75: Get the admin mode for IP forwarding of net-directed broadcasts: routing_example API 75 <ifNum>
Test API 76: Set the unnumbered status of an interface: routing_example API 76 <ifNum> <isUnnumbered> <numberedIfc>
Test API 77: Determine whether given interface is unnumbered and if so, determine the interface whose address it borrows: routing_example API 77 <ifNum>
Test API 78: Determine whether an interface is configured to forward multicast packets: routing_example API 78 <ifNum>
Test API 79: Get the router interface mode: routing_example API 79 <ifNum>
Test API 80: Get the mode of AutoState feature of an interface: routing_example API 80 <ifNum>
Test API 81: Enable or disable the mode of AutoState feature of an interface: routing_example API 81 <ifNum><mode>
Test API 82: Determine whether a given IP interface is up for IPv4: routing_example API 82 <ifNum>
Test API 83: Get the next vlan after this vlan on which routing is enabled: routing_example API 83 <vlanId>
Test API 84: Get the VLAN ID corresponding to the given internal interface number: routing_example API 84 <ifNum>
Test API 85: Get the interface ID for a given VLAN: routing_example API 85 <vlanId>
Test API 86: Get the internal interface number associated with the port-based routing interface corresponding to this internal VLAN: routing_example API 86 <vlanId>
Test API 87: Get the first valid interface: routing_example API 87
Test API 88: Get the next valid interface: routing_example API 88 <prevIfNum>
Test API 89: Get the administrative mode of sending ICMP Unreachables: routing_example API 89 <ifNum>
Test API 90: Get the interface mode of sending ICMP Redirects: routing_example API 90 <ifNum>
Test API 91: Get the bandwidth of the specified interface: routing_example API 91 <ifNum>
Test API 92: Set the bandwidth of the specified interface: routing_example API 92 <ifNum>
Test API 93: Get the bandwidth of the specified interface without making any modification to the SET bandwidth: routing_example API 93 <ifNum>
Test API 94: Get the routing max equal cost entries: routing_example API 94
Test API 95: Get the routing max routes entries: routing_example API 95
Test API 96: Invokes the IPMAP API funciton to get the dampening operational values: routing_example API 96 <ifNum>
Test API 97: Get the next protocol ID by iterating through all registered protocols: routing_example API 97 <protoId>
Test API 98: Get the protocol ID for a given route type: routing_example API 98 <routeType>
Test API 99: Get the global resilient hashing mode for ECMP trunks: routing_example API 99
Test API 100: Set the global resilient hashing mode for ECMP trunks: routing_example API 100 <resHashMode>
Test API 101: Get the packets forwarded by CPU: routing_example API 101
Test API 102: Get the IP packets count received by IP-Stack: routing_example API 102
Test API 103: Get source IP interface from Syslog, SNMP Traps, SNTP, DNS Client, RADIUS, TACACS+ and sFlow apps: routing_example API 103
Test API 104: Set source IP interface for Syslog, SNMP Traps, SNTP, DNS Client, RADIUS, TACACS+ and sFlow apps: routing_example API 104 <ifNum>
Test API 105: Get the configured IPv4 Management interface: routing_example API 105
Test API 106: Set the IPv4 Management interface: routing_example API 106 <ifNum>
Test API 107: Set the IPv4 Management interface and enable dhcp or configure static IP on the management interface: routing_example API 107 <ifNum> <dhcpEnabled> <ipAddr> <subnetMask>
Test API 108: Get the System mode for uRPF: routing_example API 108
Test API 109: Set the System mode for uRPF: routing_example API 109 <urpfEnabled>
Test API 110: Get the interface uRPF mode and allowDefault option: routing_example API 110 <ifNum>
Test API 111: Set the interface uRPF mode and allowDefault option: routing_example API 111 <ifNum> <mode> <allowDefault>
Test API 112: Get the administrative mode of sending ICMP Echo Replies: routing_example API 112 <vrfName>
Test API 113: Get the ICMP Rate Limiting parameters like burst size and interval: routing_example API 113 <vrfName>
Test API 114: Get the internal interface number of the given VRF and IPv4 address: routing_example API 114 <vrfName> <ipAddr>
Test API 115: Get the Router preference for the given protocol and VRF name: routing_example API 115 <vrfName> <origin>
Test API 116: Set the Router preference for the given protocol and VRF name: routing_example API 116 <vrfName> <origin> <pref>
Test API 117: Get the administrative mode of sending ICMP Redirects: routing_example API 117 <vrfName>
Test API 118: Set the administrative mode of sending ICMP Redirects: routing_example API 118 <vrfName> <mode>
Test API 119: Set ignore mode for ICMP ECHO Requests: routing_example API 119 <vrfName> <mode>
Test API 120: Set the ICMP Rate Limiting parameters like burst size and interval: routing_example API 120 <vrfName> <burstSize> <interval>
Test API 121: Clear the Address Conflict Detection Status of a given VRF instance: routing_example API 121 <vrfName>
Test API 122: Get the Address Conflict Detection Status of a VRF instance: routing_example API 1022 <vrfName>
Test API 123: Get the MAC Address of the last detected address conflict in a VRF instance: routing_example API 123 <vrfName>
Test API 124: Get the time in seconds since the last address conflict was detected in a VRF instance: routing_example API 124 <vrfName>
Test API 125: Delete all net-prototype route entries: routing_example API 125 <vrfName> <protoId>
Test API 126: Unset the VRF participation on an interface: routing_example API 126 <ifNum>
Test API 127: Set the VRF participation of an interface: routing_example API 127 <ifNum> <vrfName>
Test API 128: Clear the switch management ARP entries: routing_example API 128
Test API 129: Set or reset the IPv6 address mode on a given router interface: routing_example API 129 <ifNum> <addrMode> <setFlag>

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_example

routing_example.c exercises all the Routing Configuration OpEN APIs with appropriate arguments to manage the Routing component in the EFOS main process (switchdrvr).

Routing Configuration CLI/API Cross Reference

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()
(Interface-Config Mode)#
[no] ip irdp
openapiRtrDiscAdvertiseSet()
(Interface-Config Mode)#
[no] ip irdp multicast <ipaddr>
openapiRtrDiscAdvAddrSet()
(Interface-Config Mode)#
[no] ip irdp maxadvertinterval <max>
openapiRtrDiscMaxAdvIntervalSet()
(Interface-Config Mode)#
[no] ip irdp minadvertinterval <min>
openapiRtrDiscMinAdvIntervalSet()
(Interface-Config Mode)#
no ip irdp minadvertinterval
openapiRtrDiscMinAdvIntervalRevert()
(Interface-Config Mode)#
[no] ip irdp holdtime <holdtime>
openapiRtrDiscAdvLifetimeSet()
(Interface-Config Mode)#
no ip irdp holdtime
openapiRtrDiscAdvLifetimeRevert()
(Interface-Config Mode)#
[no] ip irdp preference <pref>
openapiRtrDiscPreferenceLevelSet()
(Vlan)#
vlan routing <vlan> [<interface ID>]
openapiRtrVlanIntfCreate()
(Vlan)#
no vlan routing <vlan>
openapiRtrVlanIntfDelete()
(Priv-User Mode)#
show arp [brief]
openapiArpEntryNextGet()
(Priv-User Mode)#
show ip irdp <u/s/p>
openapiRtrDiscAdvertiseGet()
(Priv-User Mode)#
show ip irdp <u/s/p>
openapiRtrDiscAdvAddrGet()
(Priv-User Mode)#
show ip irdp <u/s/p>
openapiRtrDiscMaxAdvIntervalGet()
(Priv-User Mode)#
show ip irdp <u/s/p>
openapiRtrDiscMinAdvIntervalGet()
(Priv-User Mode)#
show ip irdp <u/s/p>
openapiRtrDiscAdvLifetimeGet()
(Priv-User Mode)#
show ip irdp <u/s/p>
openapiRtrDiscPreferenceLevelGet()
(Priv-User Mode)#
show ip irdp <u/s/p>
openapiRtrDiscPreferenceLevelGet()
(Priv-User Mode)#
show running-config
openapiRtrDiscMinAdvIntervalDefaultGet()
(Priv-User Mode)#
show running-config
openapiRtrDiscAdvLifetimeDefaultGet()
(Priv-User Mode)#
show running-config
openapiRtrIpUnnumberedGratArpGet()
(Priv-User Mode)#arp purge <ipaddr> openapiRtrIpArpEntryPurge()
(Priv-User Mode)#clear arp-cache [gateway] openapiRtrIpArpCacheClear()
(Config)#
arp dynamicrenew
openapiRtrIpArpDynamicRenewSet()
(Config)#
arp timeout <seconds>
openapiRtrIpArpAgeTimeSet()
(Config)#
arp resptime <seconds>
openapiRtrIpArpRespTimeSet()
(Config)#
arp retries <retries value>="">
openapiRtrIpArpRetriesSet()
(Config)#
arp cachesize <maxCacheSize>
openapiRtrIpArpCacheSizeSet()
(Priv-User Mode)#
show arp [vrf <vrfname>]
openapiRtrIpMapStaticArpGetAll()
(Priv-User Mode)#
show arp [vrf <vrfname>]
openapiRtrIpArpDynamicRenewGet()
(Priv-User Mode)#
show ip interface
openapiRtrIntfIpProxyArpModeGet()
(Priv-User Mode)#
show ip interface
openapiRtrLocalProxyArpModeGet()
(Interface-Config Mode)#
ip local-proxy-arp
openapiRtrLocalProxyArpModeSet()

(Interface-Config Mode)#
ip unnumbered {loopback <ipaddr> | <slot/port> } | openapiRtrIpUnnumberedGratArpSet() (Config)#
ip load-sharing <mode> [inner/outer] | openapiIpEcmpLbSet() (Priv-User Mode)#
show ip load-sharing | openapiIpEcmpLbGet() (Config)#
[no] ip ipsec-load-sharing spi | openapiIpEcmpIpsecSpiSet() (Priv-User Mode)#
show ip load-sharing | openapiIpEcmpIpsecSpiGet() (Priv-User Mode)#
show running-config | openapiIntfIpMtuGet() (Priv-User Mode)#
show ip interface | openapiIntfEffectiveIpMtuGet() (Priv-User Mode)#
show ip interface | openapiIpNetDirectBcastsGet() (Priv-User Mode)#
show ip interface | openapiIpUnnumberedSet() (Priv-User Mode)#
show running-config | openapiIpUnnumberedGet() (Priv-User Mode)#
show running-config | openapiIpMcastsFwdModeGet() (Priv-User Mode)#
show ip interface | openapiIpRtrIntfModeGet() (Priv-User Mode)#
show ip interface | openapiIpRtrIntfAutoStateModeGet() (Interface Config)# autostate | openapiIpRtrIntfAutoStateModeSet() (Priv-User Mode)#
show ip interface | openapiIpRtrIntfOperModeGet() (Priv-User Mode)#
show ip vlan | openapiIpVlanRtrVlanIdGetNext() (Priv-User Mode)#
show running-config | openapiIpVlanRtrIntIfNumToVlanId() (Priv-User Mode)#
show running-config | openapiVlanIntfIdGet() (Priv-User Mode)#
show running-config | openapiIpRtrInternalVlanIdToIntIfNum() (Priv-User Mode)#
show running-config | openapiIpMapValidIntfFirstGet() (Priv-User Mode)#
show running-config | openapiIpMapValidIntfNextGet() (Priv-User Mode)#
show ip interface | openapiIpMapICMPUnreachablesModeGet() (Priv-User Mode)#
show ip interface | openapiIpMapIfICMPRedirectsModeGet() (Config)#
bandwidth<L7_L3_MIN_BW - L7_L3_MAX_BW> | openapiIfBandwidthGet() (Priv-User Mode)#
show ip interface | openapiIfBandwidthSet() (Priv-User Mode)#
show running-config | openapiIfBWGet() (Priv-User Mode)#
show running-config | openapiRtrRouteMaxEqualCostEntriesGet() (Config)#
maximum routes <limit> | openapiRtrRouteMaxRouteEntriesGet() (Priv-User Mode)#
show ip ospf | openapiIpMapProtoNextGet() (Priv-User Mode)#
show ip route | openapiIpMapRouteTypeToProtoId() (Config)#
ip resilient-hashing | openapiIpMapResilientHashingModeGet() (Priv-User Mode)#
show ip resilient-hashing | openapiIpMapResilientHashingModeSet() (Priv-User Mode)#clear arp-switch | openapiRtrArpSwitchClear() (Interface-Config Mode)#
[no] ipv6 {enable | address autoconfig | address dhcp} | openapiRtrIntfIpv6AddressModeSet()