This document provides a brief description of the diffServ service OpEN APIs. It provides the following services:
- Create a new row in the Service Table for the specified interface and direction.
- Delete a row from the Service Table for the specified interface and direction.
- Fetch a row from the Service Table for the specified interface and direction.
- Determine next sequential row in the Service Table.
- Set the policy index attached to the specified interface and direction.
- Get the policy index attached to the specified interface and direction.
- Get the service interface operational status for the specified Service Table row.
- Check if the specified internal interface number is in use by the ACL component.
- Set the given status for the specified Service Table row.
- Get the current status for the specified Service Table row.
- Verifies the current status for the specified Service Table row.
- Get the inbound offered packets count for the specified policy class instance.
- Get the outbound offered packets count for the specified policy class instance.
- Get the inbound discarded packet count for the specified policy class instance.
- Get the outbound discarded packet count for the specified policy class instance.
Example C Application diffserv_service_example
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.
diffserv_service_example
diffserv_service_example.c is a sample application that demonstrates the use of OpEN's diffServ service APIs. diffserv_service_example is started from the command line and can be used to exercise the various APIs by specifying arguments on the command line.
Sample Output
- Usage: ./diffserv_service_example <test#> <arg1> <arg2> ...
- Test 1: Create a new row in the Service Table for the specified interface and direction: diffserv_service_example 1 <intIfNum><ifDir><activateRow>
- Test 2: Delete a row from the Service Table for the specified interface and direction: diffserv_service_example 2 <intIfNum><ifDir>
- Test 3: Fetch a row from the Service Table for the specified interface and direction: diffserv_service_example 3 <intIfNum><ifDir>
- Test 4: Determine next sequential row in the Service Table: diffserv_service_example 4 <intIfNum><ifDir>
- Test 5: Set the policy index attached to the specified interface and direction: diffserv_service_example 5 <intIfNum><ifDir><policyIndex>
- Test 6: Get the policy index attached to the specified interface and direction: diffserv_service_example 6 <intIfNum><ifDir>
- Test 7: Get the service interface operational status for the specified Service Table row: diffserv_service_example 7 <intIfNum><ifDir>
- Test 8: Check if the specified internal interface number is in use by the ACL component: diffserv_service_example 8 <intIfNum><ifDir>
- Test 9: Set the given status for the specified Service Table row: diffserv_service_example 9 <intIfNum><ifDir><status>
- Test 10: Get the current status for the specified Service Table row: diffserv_service_example 10 <intIfNum><ifDir>
- Test 11: Verifies the current status for the specified Service Table row: diffserv_service_example 11 <intIfNum><ifDir><status>
- Test 12: Get the inbound offered packets count for the specified policy class instance: diffserv_service_example 12 <policyIndex><policyInstIndex><intIfNum>
- Test 13: Get the outbound offered packets count for the specified policy class instance: diffserv_service_example 13 <policyIndex><policyInstIndex><intIfNum>
- Test 14: Get the inbound discarded packet count for the specified policy class instance: diffserv_service_example 14 <policyIndex><policyInstIndex><intIfNum>
- Test 15: Get the outbound discarded packet count for the specified policy class instance: diffserv_service_example 15 <policyIndex><policyInstIndex><intIfNum>
- Test 16: Run API sanity checks: diffserv_service_example 16
diffServ service CLI/API Cross Reference