Server Library Functions


Functions

xacml_result_t xacml_server_init (xacml_server_t *server, xacml_authorization_handler_t handler, void *arg)
xacml_result_t xacml_server_set_port (xacml_server_t server, unsigned short port)
xacml_result_t xacml_server_get_port (const xacml_server_t server, unsigned short *port)
xacml_result_t xacml_server_start (xacml_server_t server)
void xacml_server_destroy (xacml_server_t server)

Function Documentation

void xacml_server_destroy ( xacml_server_t  server  ) 

Destroy an XACML server

Stop servicing XACML authorization queries, and destroy the server handle. The server should not be used after this function returns.

Parameters:
server Server to destroy.
Returns:
void
See also:
xacml_server_init(), xacml_server_start()

xacml_result_t xacml_server_get_port ( const xacml_server_t  server,
unsigned short *  port 
)

Get the TCP port for a server

Return the TCP port to use for an XACML server.

Parameters:
server Server to query.
port Pointer to be set to the TCP port number to use for connections.
Return values:
XACML_RESULT_SUCCESS Success.
XACML_RESULT_INVALID_PARAMETER Invalid parameter.
See also:
xacml_server_set_port()

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.

xacml_result_t xacml_server_init ( xacml_server_t *  server,
xacml_authorization_handler_t  handler,
void *  arg 
)

Initialize XACML server

Create a new XACML authorization server instance. This service, when started with xacml_server_start(), will accept TCP/IP connections, parse an XACML authorization query, and then call the handler callback function with the request information. By default, the server will listen for connections on TCP port 8080.

Parameters:
server Pointer to the service handle to intialize.
handler Callback function to perform authorization and create obligations.
arg Application-specific argument to handler.
Return values:
XACML_RESULT_SUCCESS Success.
XACML_RESULT_INVALID_PARAMETER Invalid parameter.
See also:
xacml_server_start(), xacml_server_destroy()

References XACML_RESULT_INVALID_PARAMETER, and XACML_RESULT_SUCCESS.

xacml_result_t xacml_server_set_port ( xacml_server_t  server,
unsigned short  port 
)

Set the TCP port for a server

Change the TCP port to use for an XACML server. This must be called before the server has been started, or an XACML_RESULT_INVALID_STATE error will result.

Parameters:
server Server to modify.
port TCP port number to use for connections.
Return values:
XACML_RESULT_SUCCESS Success.
XACML_RESULT_INVALID_PARAMETER Invalid parameter.
XACML_RESULT_INVALID_STATE Invalid state.
See also:
xacml_server_get_port()

References XACML_RESULT_INVALID_PARAMETER, XACML_RESULT_INVALID_STATE, and XACML_RESULT_SUCCESS.

xacml_result_t xacml_server_start ( xacml_server_t  server  ) 

Start processing XACML Authorization Queries

Creates a thread to procss XACML authorization queries. This thread will continue to do so until xacml_server_destroy() is called. When a legitimate XACML query has been parsed, the authorization handler function passed to xacml_server_init() will be called with the parsed XACML Authorization query and the application specific argument.

Parameters:
server XACML server to start.
Return values:
XACML_RESULT_SUCCESS Success
XACML_RESULT_INVALID_PARAMETER Invalid parameter
XACML_RESULT_INVALID_STATE; Invalid state
See also:
xacml_server_init(), xacml_server_destroy()

References XACML_RESULT_INVALID_STATE, and XACML_RESULT_SUCCESS.