auth-client.h revision 8eea67470c1bd8562a62e7445d930bb2079b1a43
64e244defe74f513ce94f33d000a048ddbe2ea23Timo Sirainen const unsigned char *initial_resp_data;
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen/* reply is NULL if auth connection died */
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainentypedef void auth_request_callback_t(struct auth_request *request,
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainentypedef void auth_connect_notify_callback_t(struct auth_client *client,
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen/* Create new authentication client. */
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainenstruct auth_client *auth_client_new(unsigned int client_pid);
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainenvoid auth_client_free(struct auth_client *client);
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainenint auth_client_is_connected(struct auth_client *client);
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainenvoid auth_client_set_connect_notify(struct auth_client *client,
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainenauth_client_get_available_mechs(struct auth_client *client,
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen unsigned int *mech_count);
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainenauth_client_find_mech(struct auth_client *client, const char *name);
8eea67470c1bd8562a62e7445d930bb2079b1a43Timo Sirainen/* Reserve connection for specific mechanism. The id can be given to
8eea67470c1bd8562a62e7445d930bb2079b1a43Timo Sirainen auth_client_request_new() to force it to use the same connection, or fail.
8eea67470c1bd8562a62e7445d930bb2079b1a43Timo Sirainen This is currently useful only for APOP authentication. Returns TRUE if
8eea67470c1bd8562a62e7445d930bb2079b1a43Timo Sirainen successfull. */
8eea67470c1bd8562a62e7445d930bb2079b1a43Timo Sirainenint auth_client_reserve_connection(struct auth_client *client, const char *mech,
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen/* Create a new authentication request. callback is called whenever something
8eea67470c1bd8562a62e7445d930bb2079b1a43Timo Sirainen happens for the request. id can be NULL. */
8eea67470c1bd8562a62e7445d930bb2079b1a43Timo Sirainenauth_client_request_new(struct auth_client *client, struct auth_connect_id *id,
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen auth_request_callback_t *callback, void *context,
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen const char **error_r);
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen/* Continue authentication. Call when
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen reply->result == AUTH_CLIENT_REQUEST_CONTINUE */
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainenvoid auth_client_request_continue(struct auth_request *request,
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen/* Abort ongoing authentication request. */
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainenvoid auth_client_request_abort(struct auth_request *request);
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen/* Return ID of this request. */
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainenunsigned int auth_client_request_get_id(struct auth_request *request);
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainen/* Return the PID of the server that handled this request. */
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainenunsigned int auth_client_request_get_server_pid(struct auth_request *request);
acf3b7bf3a8891b118a71c45e6c48d17bc90b259Timo Sirainen/* -- Using lib-auth with external I/O loop -- */
acf3b7bf3a8891b118a71c45e6c48d17bc90b259Timo Sirainentypedef void *input_func_add_t(int fd, void (*cb)(void *), void *context);
acf3b7bf3a8891b118a71c45e6c48d17bc90b259Timo Sirainenstruct auth_client *auth_client_new_external(unsigned int client_pid,
acf3b7bf3a8891b118a71c45e6c48d17bc90b259Timo Sirainen/* Call every few seconds. */