1/* Copyright (c) 2012-2013 Apple Inc. All Rights Reserved. */ 2 3#ifndef _SECURITY_AUTH_SERVER_H_ 4#define _SECURITY_AUTH_SERVER_H_ 5 6#include "authd_private.h" 7#include <xpc/xpc.h> 8 9#if defined(__cplusplus) 10extern "C" { 11#endif 12 13OSStatus server_init(void); 14void server_cleanup(void); 15bool server_in_dark_wake(void); 16authdb_t server_get_database(void); 17 18AUTH_NONNULL_ALL 19connection_t server_register_connection(xpc_connection_t); 20 21AUTH_NONNULL_ALL 22void server_unregister_connection(connection_t); 23 24AUTH_NONNULL_ALL 25void server_register_auth_token(auth_token_t); 26 27AUTH_NONNULL_ALL 28void server_unregister_auth_token(auth_token_t); 29 30AUTH_NONNULL_ALL 31auth_token_t server_find_copy_auth_token(AuthorizationBlob * blob); 32 33AUTH_NONNULL_ALL 34session_t server_find_copy_session(session_id_t,bool create); 35 36void server_dev(void); 37 38/* API */ 39 40AUTH_NONNULL_ALL 41OSStatus authorization_create(connection_t,xpc_object_t,xpc_object_t); 42 43AUTH_NONNULL_ALL 44OSStatus authorization_create_with_audit_token(connection_t,xpc_object_t,xpc_object_t); 45 46AUTH_NONNULL_ALL 47OSStatus authorization_free(connection_t,xpc_object_t,xpc_object_t); 48 49AUTH_NONNULL_ALL 50OSStatus authorization_copy_rights(connection_t,xpc_object_t,xpc_object_t); 51 52AUTH_NONNULL_ALL 53OSStatus authorization_copy_info(connection_t,xpc_object_t,xpc_object_t); 54 55AUTH_NONNULL_ALL 56OSStatus authorization_make_external_form(connection_t,xpc_object_t,xpc_object_t); 57 58AUTH_NONNULL_ALL 59OSStatus authorization_create_from_external_form(connection_t,xpc_object_t,xpc_object_t); 60 61AUTH_NONNULL_ALL 62OSStatus authorization_right_get(connection_t,xpc_object_t,xpc_object_t); 63 64AUTH_NONNULL_ALL 65OSStatus authorization_right_set(connection_t,xpc_object_t,xpc_object_t); 66 67AUTH_NONNULL_ALL 68OSStatus authorization_enable_smartcard(connection_t,xpc_object_t,xpc_object_t); 69 70AUTH_NONNULL_ALL 71OSStatus authorization_right_remove(connection_t,xpc_object_t,xpc_object_t); 72 73AUTH_NONNULL_ALL 74OSStatus session_set_user_preferences(connection_t,xpc_object_t,xpc_object_t); 75 76#if defined(__cplusplus) 77} 78#endif 79 80#endif /* !_SECURITY_AUTH_SERVER_H_ */ 81