auth-client.h revision bdd36cfdba3ff66d25570a9ff568d69e1eb543cf
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina /* Skip penalty checks for this request */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio /* Support final SASL response */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio AUTH_REQUEST_FLAG_SUPPORT_FINAL_RESP = 0x08
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek const char *mech;
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidênciotypedef void auth_request_callback_t(struct auth_client_request *request,
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidênciotypedef void auth_connect_notify_callback_t(struct auth_client *client,
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio/* Create new authentication client. */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncioauth_client_init(const char *auth_socket_path, unsigned int client_pid,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinavoid auth_client_deinit(struct auth_client **client);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinavoid auth_client_connect(struct auth_client *client);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinavoid auth_client_disconnect(struct auth_client *client, const char *reason);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinabool auth_client_is_connected(struct auth_client *client);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinabool auth_client_is_disconnected(struct auth_client *client);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinavoid auth_client_set_connect_notify(struct auth_client *client,
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozekauth_client_get_available_mechs(struct auth_client *client,
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek unsigned int *mech_count);
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozekauth_client_find_mech(struct auth_client *client, const char *name);
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek/* Return current connection's identifiers. */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozekvoid auth_client_get_connect_id(struct auth_client *client,
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek unsigned int *server_pid_r,
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek unsigned int *connect_uid_r);
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek/* Create a new authentication request. callback is called whenever something
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek happens for the request. */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozekauth_client_request_new(struct auth_client *client,
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek auth_request_callback_t *callback, void *context)
f2047f6c5b56d6759bd8e6d504f572a593476c65Pavel Březina/* Continue authentication. Call when
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek reply->result == AUTH_CLIENT_REQUEST_CONTINUE */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozekvoid auth_client_request_continue(struct auth_client_request *request,
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio/* Abort ongoing authentication request. */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidênciovoid auth_client_request_abort(struct auth_client_request **request);
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio/* Return ID of this request. */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidênciounsigned int auth_client_request_get_id(struct auth_client_request *request);
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio/* Return the PID of the server that handled this request. */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinaauth_client_request_get_server_pid(struct auth_client_request *request);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina/* Return cookie of the server that handled this request. */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinaconst char *auth_client_request_get_cookie(struct auth_client_request *request);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina/* Tell auth process to drop specified request from memory */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinavoid auth_client_send_cancel(struct auth_client *client, unsigned int id);