D-Bus
1.10.12
|
00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 00002 /* dbus-auth.h Authentication 00003 * 00004 * Copyright (C) 2002 Red Hat Inc. 00005 * 00006 * Licensed under the Academic Free License version 2.1 00007 * 00008 * This program is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 * 00022 */ 00023 #ifndef DBUS_AUTH_H 00024 #define DBUS_AUTH_H 00025 00026 #include <dbus/dbus-macros.h> 00027 #include <dbus/dbus-errors.h> 00028 #include <dbus/dbus-string.h> 00029 #include <dbus/dbus-sysdeps.h> 00030 00031 DBUS_BEGIN_DECLS 00032 00033 typedef struct DBusAuth DBusAuth; 00034 00035 typedef enum 00036 { 00037 DBUS_AUTH_STATE_WAITING_FOR_INPUT, 00038 DBUS_AUTH_STATE_WAITING_FOR_MEMORY, 00039 DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND, 00040 DBUS_AUTH_STATE_NEED_DISCONNECT, 00041 DBUS_AUTH_STATE_AUTHENTICATED 00042 } DBusAuthState; 00043 00044 DBUS_PRIVATE_EXPORT 00045 DBusAuth* _dbus_auth_server_new (const DBusString *guid); 00046 DBUS_PRIVATE_EXPORT 00047 DBusAuth* _dbus_auth_client_new (void); 00048 DBUS_PRIVATE_EXPORT 00049 DBusAuth* _dbus_auth_ref (DBusAuth *auth); 00050 DBUS_PRIVATE_EXPORT 00051 void _dbus_auth_unref (DBusAuth *auth); 00052 DBUS_PRIVATE_EXPORT 00053 dbus_bool_t _dbus_auth_set_mechanisms (DBusAuth *auth, 00054 const char **mechanisms); 00055 DBUS_PRIVATE_EXPORT 00056 DBusAuthState _dbus_auth_do_work (DBusAuth *auth); 00057 DBUS_PRIVATE_EXPORT 00058 dbus_bool_t _dbus_auth_get_bytes_to_send (DBusAuth *auth, 00059 const DBusString **str); 00060 DBUS_PRIVATE_EXPORT 00061 void _dbus_auth_bytes_sent (DBusAuth *auth, 00062 int bytes_sent); 00063 DBUS_PRIVATE_EXPORT 00064 void _dbus_auth_get_buffer (DBusAuth *auth, 00065 DBusString **buffer); 00066 DBUS_PRIVATE_EXPORT 00067 void _dbus_auth_return_buffer (DBusAuth *auth, 00068 DBusString *buffer); 00069 DBUS_PRIVATE_EXPORT 00070 void _dbus_auth_get_unused_bytes (DBusAuth *auth, 00071 const DBusString **str); 00072 DBUS_PRIVATE_EXPORT 00073 void _dbus_auth_delete_unused_bytes (DBusAuth *auth); 00074 dbus_bool_t _dbus_auth_needs_encoding (DBusAuth *auth); 00075 dbus_bool_t _dbus_auth_encode_data (DBusAuth *auth, 00076 const DBusString *plaintext, 00077 DBusString *encoded); 00078 dbus_bool_t _dbus_auth_needs_decoding (DBusAuth *auth); 00079 dbus_bool_t _dbus_auth_decode_data (DBusAuth *auth, 00080 const DBusString *encoded, 00081 DBusString *plaintext); 00082 DBUS_PRIVATE_EXPORT 00083 dbus_bool_t _dbus_auth_set_credentials (DBusAuth *auth, 00084 DBusCredentials *credentials); 00085 DBUS_PRIVATE_EXPORT 00086 DBusCredentials* _dbus_auth_get_identity (DBusAuth *auth); 00087 DBUS_PRIVATE_EXPORT 00088 dbus_bool_t _dbus_auth_set_context (DBusAuth *auth, 00089 const DBusString *context); 00090 const char* _dbus_auth_get_guid_from_server(DBusAuth *auth); 00091 00092 void _dbus_auth_set_unix_fd_possible(DBusAuth *auth, dbus_bool_t b); 00093 dbus_bool_t _dbus_auth_get_unix_fd_negotiated(DBusAuth *auth); 00094 00095 DBUS_END_DECLS 00096 00097 #endif /* DBUS_AUTH_H */