Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Application Control

The application support provided through OpEN API allows an external application to perform certain control operations.

Application Control OpEN API

This document provides a brief description of the application control OpEN APIs that may be used to provide information to the ICOS main process (switchdrvr).

The following services are supported:

The status and version string 'Set' operations affect information stored in the switch for a designated application. Note that this information is not persistent, that is, it is not stored as part of the switch configuration.

These OpEN APIs allow an external application to communicate its internal version number to the end-user of the switch by doing a 'Set' operation when the application starts running. This information is held in the switch and can be seen via the CLI. Likewise, the application can 'Set' a free-form status string to convey its current operational status as seen through the CLI. These 'Set' APIs may be called repeatedly, overwriting the stored string contents each time.

Example C Application app_ctrl_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.

app_ctrl_example

app_ctrl_example.c is a sample application that demonstrates the use of the Application Control OpEN APIs. app_ctrl_example is started from the command line and has the following syntax:

Usage: app_ctrl_example <test#> <arg1> <arg2> ...

It exercises all the app_ctrl OpEN APIs with appropriate arguments to manage the app_ctrl feature in the ICOS main process (switchdrvr).

Application Control CLI/API Cross Reference

CLI Command OpEN API Reference
(Config)#
application install <app-name>
openapiAppCtrlEntryCreate()
openapiAppCtrlEntryDelete()
openapiAppCtrlAttrSet()
openapiAppCtrlVersionSet()
(Priv-EXEC Mode)#
application start <app-name>
openapiAppCtrlStart()
(Priv-EXEC Mode)#
application stop <app-name>
openapiAppCtrlStop()
(Priv-User Mode)#
show application
openapiAppCtrlVersionGet()
(Priv-User Mode)#
show application status <appname>
openapiAppCtrlStatusGet()
N/A
(accessed through OpEN API directly)
openapiAppCtrlStatusSet()
openapiAppCtrlVersionSet()