proton
0
|
Typedefs | |
typedef struct pn_sasl_t | pn_sasl_t |
Enumerations | |
enum | pn_sasl_outcome_t { PN_SASL_NONE =-1, PN_SASL_OK =0, PN_SASL_AUTH =1, PN_SASL_SYS =2, PN_SASL_PERM =3, PN_SASL_TEMP =4 } |
The result of the SASL negotiation. More... | |
enum | pn_sasl_state_t { PN_SASL_CONF, PN_SASL_IDLE, PN_SASL_STEP, PN_SASL_PASS, PN_SASL_FAIL } |
The state of the SASL negotiation process. More... | |
Functions | |
PN_EXTERN pn_sasl_t * | pn_sasl (pn_transport_t *transport) |
Construct an Authentication and Security Layer object. More... | |
PN_EXTERN pn_sasl_state_t | pn_sasl_state (pn_sasl_t *sasl) |
Access the current state of the layer. More... | |
PN_EXTERN void | pn_sasl_mechanisms (pn_sasl_t *sasl, const char *mechanisms) |
Set the acceptable SASL mechanisms for the layer. More... | |
PN_EXTERN const char * | pn_sasl_remote_mechanisms (pn_sasl_t *sasl) |
Retrieve the list of SASL mechanisms provided by the remote. More... | |
PN_EXTERN void | pn_sasl_client (pn_sasl_t *sasl) |
Configure the SASL layer to act as a SASL client. More... | |
PN_EXTERN void | pn_sasl_server (pn_sasl_t *sasl) |
Configure the SASL layer to act as a server. More... | |
PN_EXTERN void | pn_sasl_plain (pn_sasl_t *sasl, const char *username, const char *password) |
Configure the SASL layer to use the "PLAIN" mechanism. More... | |
PN_EXTERN size_t | pn_sasl_pending (pn_sasl_t *sasl) |
Determine the size of the bytes available via pn_sasl_recv(). More... | |
PN_EXTERN ssize_t | pn_sasl_recv (pn_sasl_t *sasl, char *bytes, size_t size) |
Read challenge/response data sent from the peer. More... | |
PN_EXTERN ssize_t | pn_sasl_send (pn_sasl_t *sasl, const char *bytes, size_t size) |
Send challenge or response data to the peer. More... | |
PN_EXTERN void | pn_sasl_done (pn_sasl_t *sasl, pn_sasl_outcome_t outcome) |
Set the outcome of SASL negotiation. More... | |
PN_EXTERN pn_sasl_outcome_t | pn_sasl_outcome (pn_sasl_t *sasl) |
Retrieve the outcome of SASL negotiation. More... | |
enum pn_sasl_outcome_t |
enum pn_sasl_state_t |
PN_EXTERN pn_sasl_t* pn_sasl | ( | pn_transport_t * | transport | ) |
Construct an Authentication and Security Layer object.
Configure the SASL layer to act as a SASL client.
The role of client is similar to a TCP client - the peer requesting the connection.
[in] | sasl | the SASL layer to configure as a client |
PN_EXTERN void pn_sasl_done | ( | pn_sasl_t * | sasl, |
pn_sasl_outcome_t | outcome | ||
) |
Set the outcome of SASL negotiation.
Used by the server to set the result of the negotiation process.
Set the acceptable SASL mechanisms for the layer.
[in] | sasl | the layer to update |
[in] | mechanisms | a list of acceptable SASL mechanisms, separated by space |
PN_EXTERN pn_sasl_outcome_t pn_sasl_outcome | ( | pn_sasl_t * | sasl | ) |
Retrieve the outcome of SASL negotiation.
Determine the size of the bytes available via pn_sasl_recv().
Returns the size in bytes available via pn_sasl_recv().
[in] | sasl | the SASL layer. |
Configure the SASL layer to use the "PLAIN" mechanism.
A utility function to configure a simple client SASL layer using PLAIN authentication.
[in] | sasl | the layer to configure. |
[in] | username | credential for the PLAIN authentication mechanism |
[in] | password | credential for the PLAIN authentication mechanism |
Read challenge/response data sent from the peer.
Use pn_sasl_pending to determine the size of the data.
[in] | sasl | the layer to read from. |
[out] | bytes | written with up to size bytes of inbound data. |
[in] | size | maximum number of bytes that bytes can accept. |
Retrieve the list of SASL mechanisms provided by the remote.
[in] | sasl | the SASL layer. |
Send challenge or response data to the peer.
[in] | sasl | The SASL layer. |
[in] | bytes | The challenge/response data. |
[in] | size | The number of data octets in bytes. |
Configure the SASL layer to act as a server.
The role of server is similar to a TCP server - the peer accepting the connection.
[in] | sasl | the SASL layer to configure as a server |
PN_EXTERN pn_sasl_state_t pn_sasl_state | ( | pn_sasl_t * | sasl | ) |
Access the current state of the layer.
[in] | sasl | the layer to retrieve the state from. |