Syntax for C++ action

unsigned int

action(const char *res_name, const char *action_token,

void **attr_val, char **args, char *action_output);

You may select any name for the function. The agent framework truncates the output for the action entry point to a maximum of 2048 bytes.

Set the VCSAgValidateAndSetEntryPoint() parameter to the name of the entry point's function.

For example:

extern "C"

unsigned int res_action (const char *res_name, const char

*token, void **attr_val, char **args, char

*action_output)

{

const int output_buffer_size = 2048;

//

// checks on the attr_val entry point arg list

//

//

// perform an action based on the action token passed in

//

if (!strcmp(token, "token1")) {

//

// Perform action corresponding to token1

//

} else if (!strcmp(token, "token2") {

//

// Perform action corresponding to token2

//

}

:

:

:

} else {

//

// a token for which no action is implemented yet

//

VCSAgSnprintf(action_output, output_buffer_size,

"No implementation provided for token(%s)",

token);

}

//

// Any other checks to be done

//

//

// return value should indicate whether the ep succeeded or

// not:

// return 0 on success

// any other value on failure

//

if (success)

return 0;

else

return 1;

}