Sm_AgentApi_SetDefaultAgentId()

Sets the name of a v5.x or later agent that is configured through Central Host Configuration.
casso127
Sets the name of a v5.x or later agent that is configured through Central Host Configuration.
Syntax
int SM_EXTERN Sm_AgentApi_SetDefaultAgentId(
   const char *pszAgentIdentity,
   void* pHandle
);
Parameter
I/O
Description
pszAgentIdentity
I
Specifies the name to set as the default agent name. This name must match the name of the corresponding agent object on the Policy Server.
pHandle
I
Agent API session handle returned in parameter
ppHandle
of Sm_AgentApi_Init().
Return Values
  • SM_AGENTAPI_SUCCESS. The default agent name was set successfully.
  • SM_AGENTAPI_FAILURE. Parameter
    pszAgentIdentity
    was NULL or exceeded SM_AGENTAPI_SIZE_NAME.
  • SM_AGENTAPI_NOCONNECTION. Parameter
    pHandle
    was NULL.
Remarks
Call this function after calling Sm_AgentApi_Init() and before calling any other function in the Agent API. Doing so avoids having to pass the name of the agent with each Agent API request.
This function is only used with v5 or later custom agents that are configured through central host configuration.