00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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 DBusAuth* _dbus_auth_server_new (const DBusString *guid);
00045 DBusAuth* _dbus_auth_client_new (void);
00046 DBusAuth* _dbus_auth_ref (DBusAuth *auth);
00047 void _dbus_auth_unref (DBusAuth *auth);
00048 dbus_bool_t _dbus_auth_set_mechanisms (DBusAuth *auth,
00049 const char **mechanisms);
00050 DBusAuthState _dbus_auth_do_work (DBusAuth *auth);
00051 dbus_bool_t _dbus_auth_get_bytes_to_send (DBusAuth *auth,
00052 const DBusString **str);
00053 void _dbus_auth_bytes_sent (DBusAuth *auth,
00054 int bytes_sent);
00055 void _dbus_auth_get_buffer (DBusAuth *auth,
00056 DBusString **buffer);
00057 void _dbus_auth_return_buffer (DBusAuth *auth,
00058 DBusString *buffer,
00059 int bytes_read);
00060 void _dbus_auth_get_unused_bytes (DBusAuth *auth,
00061 const DBusString **str);
00062 void _dbus_auth_delete_unused_bytes (DBusAuth *auth);
00063 dbus_bool_t _dbus_auth_needs_encoding (DBusAuth *auth);
00064 dbus_bool_t _dbus_auth_encode_data (DBusAuth *auth,
00065 const DBusString *plaintext,
00066 DBusString *encoded);
00067 dbus_bool_t _dbus_auth_needs_decoding (DBusAuth *auth);
00068 dbus_bool_t _dbus_auth_decode_data (DBusAuth *auth,
00069 const DBusString *encoded,
00070 DBusString *plaintext);
00071 void _dbus_auth_set_credentials (DBusAuth *auth,
00072 const DBusCredentials *credentials);
00073 void _dbus_auth_get_identity (DBusAuth *auth,
00074 DBusCredentials *credentials);
00075 dbus_bool_t _dbus_auth_set_context (DBusAuth *auth,
00076 const DBusString *context);
00077 const char* _dbus_auth_get_guid_from_server(DBusAuth *auth);
00078
00079
00080 DBUS_END_DECLS
00081
00082 #endif