gsasl  2.2.1
Functions | Variables
suggest.c File Reference
#include <config.h>
#include "internal.h"

Go to the source code of this file.

Functions

int gsasl_mechanism_name_p (const char *mech)
 
const char * gsasl_client_suggest_mechanism (Gsasl *ctx, const char *mechlist)
 

Variables

const char * _GSASL_VALID_MECHANISM_CHARACTERS
 

Function Documentation

◆ gsasl_client_suggest_mechanism()

const char* gsasl_client_suggest_mechanism ( Gsasl ctx,
const char *  mechlist 
)

gsasl_client_suggest_mechanism:

Parameters
ctxlibgsasl handle.
mechlistinput 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, or NULL if no supported mechanism is found.

Definition at line 88 of file suggest.c.

◆ gsasl_mechanism_name_p()

int gsasl_mechanism_name_p ( const char *  mech)

gsasl_mechanism_name_p:

Parameters
mechinput variable with mechanism name string.

Check if the mechanism name string @mech follows syntactical rules. It does not check that the name is registered with IANA. It does not check that the mechanism name is actually implemented and supported.

SASL mechanisms are named by strings, from 1 to 20 characters in length, consisting of upper-case letters, digits, hyphens, and/or underscores.

Returns: non-zero when mechanism name string @mech conforms to rules, zero when it does not meet the requirements.

Since: 2.0.0

Definition at line 53 of file suggest.c.

Variable Documentation

◆ _GSASL_VALID_MECHANISM_CHARACTERS

const char* _GSASL_VALID_MECHANISM_CHARACTERS
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"

Definition at line 32 of file suggest.c.