Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Macros | Functions
Application Controls [OPENAPI_APP_CTRL]

Macros

#define OPEN_APP_CTRL_NAME_SIZE   17
 
#define OPEN_APP_CTRL_STATUS_SIZE   512
 
#define OPEN_APP_CTRL_VERSION_SIZE   20
 

Functions

open_error_t openapiAppCtrlAttrGet (openapiClientHandle_t *client_handle, open_buffdesc *appName, OPEN_CONTROL_t *startOnBoot, OPEN_CONTROL_t *autoRestart, uint32_t *cpuShare, uint32_t *maxMemory)
 Gets start on boot, auto-restart, CPU sharing and memory limit settings for the process entry. More...
 
open_error_t openapiAppCtrlAttrSet (openapiClientHandle_t *client_handle, open_buffdesc *appName, OPEN_CONTROL_t *startOnBoot, OPEN_CONTROL_t *autoRestart, uint32_t *cpuShare, uint32_t *maxMemory)
 Sets start on boot, auto-restart, CPU sharing and memory limit settings for the process entry. More...
 
open_error_t openapiAppCtrlEntryCreate (openapiClientHandle_t *client_handle, open_buffdesc *appName)
 Creates a new Application Process Table entry for the given file name. More...
 
open_error_t openapiAppCtrlEntryDelete (openapiClientHandle_t *client_handle, open_buffdesc *appName)
 Deletes an Application Process Table entry for the given file name. More...
 
open_error_t openapiAppCtrlStart (openapiClientHandle_t *client_handle, open_buffdesc *appName)
 Starts the process with Process Manager using the parameters configured in the process entry. More...
 
open_error_t openapiAppCtrlStatusGet (openapiClientHandle_t *client_handle, open_buffdesc *appName, open_buffdesc *status)
 Get application operational status. More...
 
open_error_t openapiAppCtrlStatusSet (openapiClientHandle_t *client_handle, open_buffdesc *appName, open_buffdesc *status)
 Set application operational status. More...
 
open_error_t openapiAppCtrlStop (openapiClientHandle_t *client_handle, open_buffdesc *appName)
 Stops the process with Process Manager. More...
 
open_error_t openapiAppCtrlVersionGet (openapiClientHandle_t *client_handle, open_buffdesc *appName, open_buffdesc *version)
 Get application version identifier. More...
 
open_error_t openapiAppCtrlVersionSet (openapiClientHandle_t *client_handle, open_buffdesc *appName, open_buffdesc *version)
 Set application version identifier. More...
 

Detailed Description

Function Documentation

open_error_t openapiAppCtrlAttrGet ( openapiClientHandle_t client_handle,
open_buffdesc appName,
OPEN_CONTROL_t startOnBoot,
OPEN_CONTROL_t autoRestart,
uint32_t *  cpuShare,
uint32_t *  maxMemory 
)

Gets start on boot, auto-restart, CPU sharing and memory limit settings for the process entry.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
[out]startOnBootReturns OPEN_ENABLE if start on boot enabled, else OPEN_DISABLE if not
[out]autoRestartReturns OPEN_ENABLE if auto-restart enabled, else OPEN_DISABLE if not
[out]cpuSharePointer to CPU share percentage
[out]maxMemoryPointer to maximum memory in megabytes the application is allowed to consume
Return values
OPEN_E_NONEIf successful.
OPEN_E_PARAMInvalid parameter is supplied.
OPEN_E_ERRORIf failure.

OpEN API Version: 1.11

Examples:
app_ctrl_example.c.
open_error_t openapiAppCtrlAttrSet ( openapiClientHandle_t client_handle,
open_buffdesc appName,
OPEN_CONTROL_t startOnBoot,
OPEN_CONTROL_t autoRestart,
uint32_t *  cpuShare,
uint32_t *  maxMemory 
)

Sets start on boot, auto-restart, CPU sharing and memory limit settings for the process entry.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
[in]startOnBootStart on boot
[in]autoRestartAuto restart
[in]cpuShareCPU share percentage Maximum value OPEN_MAX_CPU_SHARE
[in]maxMemoryMaximum memory in megabytes the application is allowed to consume Maximum value OPEN_MAX_MEMORY_LIMIT
Return values
OPEN_E_NONEIf successful.
OPEN_E_PARAMInvalid parameter is supplied.
OPEN_E_ERRORIf failure.
Note
When changing only some of these parameters, first call openapiAppCtrlAttrGet to retrieve all of the values, then modify the ones being changed prior to setting the values.
Alternate approach is to use NULL pointer for any parameter whose value is not being set.

OpEN API Version: 1.11

Examples:
app_ctrl_example.c.
open_error_t openapiAppCtrlEntryCreate ( openapiClientHandle_t client_handle,
open_buffdesc appName 
)

Creates a new Application Process Table entry for the given file name.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
Return values
OPEN_E_NONEIf successful.
OPEN_E_PARAMInvalid parameter is supplied.
OPEN_E_ERRORIf failure.

OpEN API Version: 1.11

Examples:
app_ctrl_example.c.
open_error_t openapiAppCtrlEntryDelete ( openapiClientHandle_t client_handle,
open_buffdesc appName 
)

Deletes an Application Process Table entry for the given file name.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
Return values
OPEN_E_NONEIf successful.
OPEN_E_PARAMInvalid parameter is supplied.
OPEN_E_ERRORIf failure.
Note
Calling this function will stop the applications process, if it is running, before the entry is deleted.

OpEN API Version: 1.11

Examples:
app_ctrl_example.c.
open_error_t openapiAppCtrlStart ( openapiClientHandle_t client_handle,
open_buffdesc appName 
)

Starts the process with Process Manager using the parameters configured in the process entry.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
Return values
OPEN_E_NONEIf successful.
OPEN_E_PARAMInvalid parameter is supplied.
OPEN_E_ERRORIf failure.

OpEN API Version: 1.11

Examples:
app_ctrl_example.c.
open_error_t openapiAppCtrlStatusGet ( openapiClientHandle_t client_handle,
open_buffdesc appName,
open_buffdesc status 
)

Get application operational status.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
[out]statusApplication status buffer
  • Buffer allocated size must be at least
  • OPENAPI_APP_STATUS_SIZE bytes
Return values
OPEN_E_NONEif successful.
OPEN_E_FAILif get operation has failed.
OPEN_E_PARAMif invalid parameter is supplied.

OpEN API Version: 1.8

Examples:
app_ctrl_example.c.
open_error_t openapiAppCtrlStatusSet ( openapiClientHandle_t client_handle,
open_buffdesc appName,
open_buffdesc status 
)

Set application operational status.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
[in]statusApplication status buffer
Return values
OPEN_E_NONEif application status is set successfully.
OPEN_E_FAILif application status contains non printable characters.
OPEN_E_PARAMif invalid parameter is passed.
Note
A user application uses this API to set a free-form string indicating its current operational status. The caller is responsible for any formatting of the displayed string (tabs, newlines, etc.).
Calling this API does not change the running configuration of the switch. The application status is set during run-time operation and does not persist following a switch reset.
At most, OPENAPI_APP_STATUS_SIZE characters of the status string are stored and is truncated to fit (with null termination).

OpEN API Version: 1.8

Examples:
app_ctrl_example.c.
open_error_t openapiAppCtrlStop ( openapiClientHandle_t client_handle,
open_buffdesc appName 
)

Stops the process with Process Manager.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
Return values
OPEN_E_NONEIf successful.
OPEN_E_PARAMInvalid parameter is supplied.
OPEN_E_ERRORIf failure.

OpEN API Version: 1.11

Examples:
app_ctrl_example.c.
open_error_t openapiAppCtrlVersionGet ( openapiClientHandle_t client_handle,
open_buffdesc appName,
open_buffdesc version 
)

Get application version identifier.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
[out]versionApplication version buffer
  • Buffer allocated size must be at least
  • OPENAPI_APP_VERSION_SIZE bytes
Return values
OPEN_E_NONEif successful.
OPEN_E_FAILif get operation has failed.
OPEN_E_PARAMif invalid parameter is supplied.

OpEN API Version: 1.8

Examples:
app_ctrl_example.c.
open_error_t openapiAppCtrlVersionSet ( openapiClientHandle_t client_handle,
open_buffdesc appName,
open_buffdesc version 
)

Set application version identifier.

Parameters
[in]client_handleClient handle from registration API
[in]appNameApplication name
-Maximum length is (OPENAPI_APP_NAME_SIZE - 1)
[in]versionApplication version buffer
Return values
OPEN_E_NONEif application version is set successfully.
OPEN_E_FAILif application version contains non printable characters.
OPEN_E_PARAMif invalid parameter is passed.
Note
A user application uses this API to set a simple, free-form string identifying its version number. The string typically consists of printable alphanumeric characters with separator characters (space, dot, dash, slash, etc.), but must not contain control characters (tab, newline, etc.). The caller is responsible for providing a suitable string for display.
Calling this API does not change the running configuration of the switch. The application version is set during run-time operation and does not persist following a switch reset.
Maximum size for version string is OPENAPI_APP_VERSION_SIZE characters (including null termination).

OpEN API Version: 1.8

Examples:
app_ctrl_example.c.