Next: , Previous: Mechanisms, Up: Top


6 Global Functions

gsasl_init

— Function: int gsasl_init (Gsasl ** ctx)

ctx: pointer to libgsasl handle.

This functions initializes libgsasl. The handle pointed to by ctx is valid for use with other libgsasl functions iff this function is successful. It also register all builtin SASL mechanisms, using gsasl_register().

Return value: GSASL_OK iff successful, otherwise GSASL_MALLOC_ERROR.

gsasl_done

— Function: void gsasl_done (Gsasl * ctx)

ctx: libgsasl handle.

This function destroys a libgsasl handle. The handle must not be used with other libgsasl functions after this call.

gsasl_client_mechlist

— Function: int gsasl_client_mechlist (Gsasl * ctx, char ** out)

ctx: libgsasl handle.

out: newly allocated output character array.

Return a newly allocated string containing SASL names, separated by space, of mechanisms supported by the libgsasl client. out is allocated by this function, and it is the responsibility of caller to deallocate it.

Return value: Returns GSASL_OK if successful, or error code.

gsasl_server_mechlist

— Function: int gsasl_server_mechlist (Gsasl * ctx, char ** out)

ctx: libgsasl handle.

out: newly allocated output character array.

Return a newly allocated string containing SASL names, separated by space, of mechanisms supported by the libgsasl server. out is allocated by this function, and it is the responsibility of caller to deallocate it.

Return value: Returns GSASL_OK if successful, or error code.

gsasl_client_support_p

— Function: int gsasl_client_support_p (Gsasl * ctx, const char * name)

ctx: libgsasl handle.

name: name of SASL mechanism.

Decide whether there is client-side support for a specified mechanism.

Return value: Returns 1 if the libgsasl client supports the named mechanism, otherwise 0.

gsasl_server_support_p

— Function: int gsasl_server_support_p (Gsasl * ctx, const char * name)

ctx: libgsasl handle.

name: name of SASL mechanism.

Decide whether there is server-side support for a specified mechanism.

Return value: Returns 1 if the libgsasl server supports the named mechanism, otherwise 0.

gsasl_client_suggest_mechanism

— Function: const char * gsasl_client_suggest_mechanism (Gsasl * ctx, const char * mechlist)

ctx: libgsasl handle.

mechlist: input character array with SASL mechanism names, separated by invalid characters (e.g. SPC).

Given a list of mechanisms, suggest which to use.

Return value: Returns name of "best" SASL mechanism supported by the libgsasl client which is present in the input string.

gsasl_register

— Function: int gsasl_register (Gsasl * ctx, const Gsasl_mechanism * mech)

ctx: pointer to libgsasl handle.

mech: plugin structure with information about plugin.

This function initialize given mechanism, and if successful, add it to the list of plugins that is used by the library.

Return value: GSASL_OK iff successful, otherwise GSASL_MALLOC_ERROR.

Since: 0.2.0