auth-client.h revision ff2f20bbc039ad8e362ead199366e21bc41f18ed
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase /* Skip penalty checks for this request */
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase /* Support final SASL response */
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase /* Enable auth_debug=yes logging for this request */
6f84d8dbc4edca35b7e69c8296a257ea17e3b74fTim Reddehase /* If TLS was used */
10be32b36246121321399ec3ab26d4d723d550e3Tim Reddehase AUTH_REQUEST_FLAG_TRANSPORT_SECURITY_TLS = 0x20,
db8aaeeeb3b24f487a5d02c60d18e96e55f6ba85Tim Reddehase struct ip_addr local_ip, remote_ip, real_local_ip, real_remote_ip;
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehase in_port_t local_port, remote_port, real_local_port, real_remote_port;
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehasetypedef void auth_request_callback_t(struct auth_client_request *request,
4949048bda09e116ee3627383e831455954cbe41Tim Reddehasetypedef void auth_connect_notify_callback_t(struct auth_client *client,
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehase/* Create new authentication client. */
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehaseauth_client_init(const char *auth_socket_path, unsigned int client_pid,
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehasevoid auth_client_deinit(struct auth_client **client);
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehasevoid auth_client_connect(struct auth_client *client);
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehasevoid auth_client_disconnect(struct auth_client *client, const char *reason);
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehasebool auth_client_is_connected(struct auth_client *client);
4949048bda09e116ee3627383e831455954cbe41Tim Reddehasebool auth_client_is_disconnected(struct auth_client *client);
4949048bda09e116ee3627383e831455954cbe41Tim Reddehasevoid auth_client_set_connect_notify(struct auth_client *client,
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehaseauth_client_get_available_mechs(struct auth_client *client,
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehase unsigned int *mech_count);
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehaseauth_client_find_mech(struct auth_client *client, const char *name);
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehase/* Return current connection's identifiers. */
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehasevoid auth_client_get_connect_id(struct auth_client *client,
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehase unsigned int *connect_uid_r);
23f0ab4a423943eb59109df37074ef0c330d07c0Tim Reddehase/* Create a new authentication request. callback is called whenever something
4949048bda09e116ee3627383e831455954cbe41Tim Reddehase happens for the request. */
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksaauth_client_request_new(struct auth_client *client,
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksa auth_request_callback_t *callback, void *context)
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksa/* Continue authentication. Call when
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksa reply->result == AUTH_CLIENT_REQUEST_CONTINUE */
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksavoid auth_client_request_continue(struct auth_client_request *request,
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksa/* Abort ongoing authentication request. */
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksavoid auth_client_request_abort(struct auth_client_request **request);
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksa/* Return ID of this request. */
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksaunsigned int auth_client_request_get_id(struct auth_client_request *request);
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksa/* Return the PID of the server that handled this request. */
1f3a52128a4c9a5830936e25b071ce6a81fec1beEugen Kuksaauth_client_request_get_server_pid(struct auth_client_request *request);
9ade3006d75c25cfa77d51526e4a6cdd2370be5cEugen Kuksa/* Return cookie of the server that handled this request. */
9ade3006d75c25cfa77d51526e4a6cdd2370be5cEugen Kuksaconst char *auth_client_request_get_cookie(struct auth_client_request *request);
9ade3006d75c25cfa77d51526e4a6cdd2370be5cEugen Kuksa/* Tell auth process to drop specified request from memory */
9ade3006d75c25cfa77d51526e4a6cdd2370be5cEugen Kuksavoid auth_client_send_cancel(struct auth_client *client, unsigned int id);