Test Agents: Portable Commands Handler

Overview

// global functions

int rcf_pch_run(const char* confstr, const char* info);
void rcf_pch_get_id(char* id);
void rcf_pch_rpc_init(const char* tmp_path);
te_errno rpcserver_plugin_enable(const char* install, const char* action, const char* uninstall);
te_errno rpcserver_plugin_disable(void);
te_errno rcf_pch_find_node(const char* oid_str, rcf_pch_cfg_object** node);
te_errno rcf_pch_add_node(const char* father, rcf_pch_cfg_object* node);
te_errno rcf_pch_del_node(rcf_pch_cfg_object* node);

// macros

#define RCF_PCH_MAX_ID_LEN

Detailed Documentation

Global Functions

int rcf_pch_run(const char* confstr, const char* info)

Start Portable Command Handler.

Caller is blocked until shutdown command is received or error occur. Custom and default command handlers are called when commands via Test Protocol are received.

Parameters:

confstr

configuration string for communication library

info

if not NULL, the string to be send to the engine after initialisation

Returns:

Status code

void rcf_pch_get_id(char* id)

Get the rcf session identifier.

Parameters:

id

Location for the id.

void rcf_pch_rpc_init(const char* tmp_path)

Initialize RCF RPC server structures and link RPC configuration nodes to the root.

Parameters:

tmp_path

Path to folder where temporary files should be stored

te_errno rpcserver_plugin_enable(const char* install, const char* action, const char* uninstall)

Find all callbacks and enable the RPC server plugin.

Parameters:

install

Function name for install plugin or empty string or NULL

action

Function name for plugin action or empty string or NULL

uninstall

Function name for uninstall plugin or empty string or NULL

Returns:

Status code

te_errno rpcserver_plugin_disable(void)

Disable the RPC server plugin.

Returns:

Status code

te_errno rcf_pch_find_node(const char* oid_str, rcf_pch_cfg_object** node)

Find a node corresponding to an object with a given OID.

Parameters:

oid_str

OID string.

node

Where to save pointer to the node.

Returns:

Status code.

te_errno rcf_pch_add_node(const char* father, rcf_pch_cfg_object* node)

Add subtree into the configuration tree.

Parameters:

father

OID of father

node

node to be inserted

Returns:

Status code

te_errno rcf_pch_del_node(rcf_pch_cfg_object* node)

Delete subtree into the configuration tree.

Parameters:

node

node to be deleted

Returns:

Status code