Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.6.0.3
|
This document provides a brief description of the Hash Prediction OpEN API. The Hash Prediction OpEN API allows processes outside of the ICOS main process (switchdrvr) access to Hash Prediction. It provides the following service:
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.
hash_example.c is a sample application that demonstrates the use of the Hash Prediction OpEN API's. hash_example is started from the command line. It then exercises the Hash Prediction OpEN APIs with appropriate arguments.
The example provide a way to get an egress physical port on a LAG,
./hash_example lag 1 0/12 00101899f74e 00002021ae8a 0 0800 1 7.0.0.2 3.0.0.2 6 67 68 # The destination port is 1/0/32
Alternatively, it is also can be used to get an egress physical port over an ECMP,
./hash_example ecmp 10.10.0.2 16 0/3 00101899f74e 00002021ae8a 0 0800 1 7.0.0.2 3.0.0.2 6 67 68 # The destination port is 1/0/30
CLI Command | OpEN API Reference |
---|---|
(Priv-User Mode)# show hashdest {lag <lag-id> | ecmp <prefix/prefix-length>} in_port <u/s/p> src-mac <macaddr> dst-mac <macaddr> [vlan <vlan-id>] ethertype <0xXXXX> [src-ip {<ipv4-addr> | <ipv6-addr>} dst-ip {<ipv4-addr> | <ipv6-addr>} protocol <pid> src-l4-port <port-num> dst-l4-port <port-num>] | openapiHashIntfUnitSlotPortGet() openapiHashDestGet() |