This document provides a brief description of the cos OpEN APIs. It provides the following services:
- Sets the CoS global trust mode.
- Gets CoS global trust mode.
- Sets the CoS interface trust mode.
- Gets CoS internal trust mode.
- Gets specified trust mode interface index status.
- Gets next sequential specified trust mode interface.
- Gets CoS untrusted port default traffic class for given internal interface.
- Gets specified queue config interface index status.
- Gets next sequential specified queue config interface index.
- Gets if the specified interface is valid for COS queue config.
- Gets specified queueId index status.
- Gets next sequential specified queueId index.
- Sets minimum bandwidth for a specific queue on a given interface.
- Gets minimum bandwidth list for all queues on a given interface.
- Sets scheduler type for a specific queue on a given interface.
- Gets scheduler type list for all queues on a given interface.
- Sets queue management type for a specific queue on a given interface.
- Gets queue management type list for all queues on a given interface.
- Sets dot1d traffic class.
- Gets dot1d traffic class information.
- Gets status of user priority to traffic class mapping for a given interface.
- Gets next sequential user priority to traffic class mapping.
- Gets status of specified IP DSCP mapping table index.
- Gets next sequential ip DSCP mapping table index.
- Sets the assigned traffic class (queue) for given Ip DSCP.
- Gets the assigned traffic class (queue) for given ip DSCP.
- Gets the default traffic class mapping for specified ip DSCP value.
- Restore default ip DSCP mappings for given interface.
- Gets status of specified ip DSCP mapping table interface index.
- Gets next sequential ip DSCP mapping table interface index.
- Gets factory default dot1d traffic class information.
Example C Application cos_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.
cos_example
cos_example.c is a sample application that demonstrates the use of OpEN's cos APIs. cos_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: ./cos_example <test#> <arg1> <arg2> ...
- Test 1: Sets the CoS global trust mode: cos_example 1 <trustMode>
- Test 2: Gets CoS global trust mode: cos_example 2
- Test 3: Sets the CoS interface trust mode: cos_example 3 <intIfNum> <trustMode>
- Test 4: Gets CoS internal trust mode: cos_example 4 <intIfNum>
- Test 5: Gets specified trust mode interface index status: cos_example 5 <intIfNum>
- Test 6: Gets next sequential specified trust mode interface: cos_example 6 <intIfNum>
- Test 7: Gets CoS untrusted port default traffic class for given internal interface: cos_example 7 <intIfNum>
- Test 8: Gets specified queue config interface index status: cos_example 8 <intIfNum>
- Test 9: Gets next sequential specified queue config interface index: cos_example 9 <intIfNum>
- Test 10: Gets if the specified interface is valid for COS queue config: cos_example 10 <intIfNum>
- Test 11: Gets specified queueId index status: cos_example 11 <queueId>
- Test 12: Gets next sequential specified queueId index: cos_example 12 <queueId>
- Test 13: Sets minimum bandwidth for a specific queue on a given interface: cos_example 13 <intIfNum> <queueId> <minBwVal>
- Test 14: Gets minimum bandwidth list for all queues on a given interface: cos_example 14 <intIfNum>
- Test 15: Sets scheduler type for a specific queue on a given interface: cos_example 15 <intIfNum> <queueId> <schTypeVal>
- Test 16: Gets scheduler type list for all queues on a given interface: cos_example 16 <intIfNum>
- Test 17: Sets queue management type for a specific queue on a given interface: cos_example 17 <intIfNum> <queueId> <qMgmtType>
- Test 18: Gets queue management type list for all queues on a given interface: cos_example 18 <intIfNum>
- Test 19: Sets dot1d traffic class: cos_example 19 <intIfNum> <priority> <tc>
- Test 20: Gets dot1d traffic class information: cos_example 20 <intIfNum> <priority>
- Test 21: Gets status of user priority to traffic class mapping for a given interface: cos_example 21 <intIfNum> <priority>
- Test 22: Gets next sequential user priority to traffic class mapping: cos_example 22 <intIfNum> <priority>
- Test 23: Gets status of specified IP DSCP mapping table index: cos_example 23 <dscp>
- Test 24: Gets next sequential ip DSCP mapping table index: cos_example 24 <dscp>
- Test 25: Sets the assigned traffic class (queue) for given Ip DSCP: cos_example 25 <intIfNum> <dscp> <tc>
- Test 26: Gets the assigned traffic class (queue) for given ip DSCP: cos_example 26 <intIfNum> <dscp>
- Test 27: Gets the default traffic class mapping for specified ip DSCP value: cos_example 27 <intIfNum> <dscp>
- Test 28: Restore default ip DSCP mappings for given interface: cos_example 28 <intIfNum>
- Test 29: Gets status of specified ip DSCP mapping table interface index: cos_example 29 <intIfNum>
- Test 30: Gets next sequential ip DSCP mapping table interface index: cos_example 30 <intIfNum>
- Test 31: Run API sanity checks: cos_example 31
- Test 32: Gets interface information to denote global config operation: cos_example 32
- Test 33: Gets factory default dot1d traffic class information: cos_example 33 <intIfNum> <priority>
cos CLI/API Cross Reference