This chapter provides a reference to various Sun JavaTM System Access Manager functions that do not belong in other collections. Function summaries include a short description, syntax, parameters and returns, and header file.
The following functions are included in this chapter:
Cleans up any memory allocated by C SDK.
This function must be called when a caller is done with C SDK interfaces to cleanup memory allocated by the C SDK.
#include "am_h.h" AM_EXPORT am_status_t am_cleanup(void);
This function takes no parameters.
This function returns am_status_t with one of the following values:
Description
If XML message was successfully parsed and processed.
If any input parameter is invalid.
If any other error occurred.
This should be called only once at the end of C SDK calls, after which the initialize functions am_*_init() must be called again to initialize the C SDK before using any of its interfaces.
Any properties input parameter given to the init functions am_sso_init(), am_auth_init() or am_policy_init() should be destroyed only after am_cleanup is called.
Parses and processes an SSO or policy notification message as an XML string. If the message is an SSO notification, any SSO Token listeners registered using am_sso_add_listener() will be called. If the notification message is a policy notification, the internal policy cache maintained by the policy module in the C SDK will be updated with the notification information if the policy module in the C SDK has been initialized (using am_policy_init() and am_policy_service_init() ).
#include "am_notify.h" AM_EXPORT am_status_t am_notify(const char *xmlmsg, am_policy_t policy_handle);
This function takes the following parameters:
Description
XML message containing the notification message.
The policy handle created from am_policy_service_init(). NULL if policy is not initialized or not used.
This function returns am_status_t with one of the following values:
Description
If XML message was successfully parsed and processed.
If any input parameter is invalid.
If there was an error parsing the XML message.
If there was an error dispatching the listener(s).
If any other error occurred.
This function should be called by the service listening on the notification URL given in the properties file if notification is enabled.
Allocates space for an am_string_set_t and space for size strings. Also initializes size to the given size.
#include "am_string.h" AM_EXPORT am_string_set_t * am_string_set_allocate(int size);
This function takes the following parameters:
Description
Size of set to allocate.
This function returns a pointer to allocated am_string_set_t, or NULL if size is less than 0.
Frees memory held by the parameter, by freeing each string in the set of strings, followed by the strings pointer, followed by the struct itself.
#include "am_string_set.h" AM_EXPORT void am_string_set_destroy(am_string_set_t *string_set);
This function takes the following parameters:
Description
The am_string_set_t pointer to be freed.
None
Returns the name of the given status code as a string. For example, the name of AM_SUCCESS is AM_SUCCCESS.
#include "am_types.h" AM_EXPORT const char * am_status_to_name(am_status_t status);
This function takes the following parameters:
Description
The status code.
This function returns the name of the status code as a const char * .
Returns the message for the given status code. For example, the message for AM_SUCCESS issuccess.
#include "am_types.h" AM_EXPORT const char * am_status_to_string(am_status_t status);
This function takes the following parameters:
Description
The status code.
This function returns the message for the status code as a const char *.
The header file for this function is am_types.h
URL encodes a HTTP cookie.
#include "am_utls.h" AM_EXPORT am_status_t am_http_cookie_encode(const char *cookie, char *buf, int len);
This function takes the following parameters:
Description
The cookie to be URL encoded.
The buffer to put the encoded cookie.
The size of the buffer.
This function returns am_status_t with one of the following values:
Description
If the cookie was successfully encoded and copied into buf.
If the cookie or buffer was NULL or len was smaller than the size of the encoded value.
Other error occurred while encoding cookie.
URL decodes a HTTP cookie.
#include "am_utls.h" AM_EXPORT am_status_t am_http_cookie_decode(const char *cookie, char *buf, int len);
This function takes the following parameters:
Description
The cookie to be URL decoded.
The buffer to put the decoded cookie
The size of the buffer
This function returns am_status_t with one of the following values:
Description
If the cookie was successfully decoded and copied into buf.
If the cookie or buffer was NULL or len was smaller than the size of the decoded value.
Other error occurred while decoding cookie.