auth-client.h revision 90ed03ab289947f5576d2c616ada27724f50e9cd
da7f1a07f583df8905684a7b78469960afd7c78dPhil Carmody const char *mech;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainentypedef void auth_request_callback_t(struct auth_client_request *request,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainentypedef void auth_connect_notify_callback_t(struct auth_client *client,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* Create new authentication client. */
8ae72ad7d0c69e972cfa65d1e2ce4e3e9a8b765cTimo Sirainenauth_client_init(const char *auth_socket_path, unsigned int client_pid,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenvoid auth_client_deinit(struct auth_client **client);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenvoid auth_client_connect(struct auth_client *client);
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainenvoid auth_client_disconnect(struct auth_client *client);
300e4e43ed1ca46d0614459161ca2fb460ef661aTimo Sirainenbool auth_client_is_connected(struct auth_client *client);
35fcdde46a71ac151c2518d48c841019f1181bb2Timo Sirainenvoid auth_client_set_connect_notify(struct auth_client *client,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenauth_client_get_available_mechs(struct auth_client *client,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int *mech_count);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenauth_client_find_mech(struct auth_client *client, const char *name);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* Return current connection's identifiers. */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenvoid auth_client_get_connect_id(struct auth_client *client,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int *connect_uid_r);
cf7857bce68a33cdabe88bb15568e21921eb5ac7Aki Tuomi/* Create a new authentication request. callback is called whenever something
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen happens for the request. */
74c369c0587c5f6bb13d730675d8bc455c5c3f8eTimo Sirainenauth_client_request_new(struct auth_client *client,
311cf367b949f360c9a90822f06f39df31ec69e3Timo Sirainen auth_request_callback_t *callback, void *context);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* Continue authentication. Call when
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reply->result == AUTH_CLIENT_REQUEST_CONTINUE */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenvoid auth_client_request_continue(struct auth_client_request *request,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* Abort ongoing authentication request. */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenvoid auth_client_request_abort(struct auth_client_request **request);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* Return ID of this request. */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenunsigned int auth_client_request_get_id(struct auth_client_request *request);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* Return the PID of the server that handled this request. */
cf7857bce68a33cdabe88bb15568e21921eb5ac7Aki Tuomiauth_client_request_get_server_pid(struct auth_client_request *request);
861f53be0cc2fa5665f3c107a7576e2a53bb2eb0Timo Sirainen/* Return cookie of the server that handled this request. */