Back to index

lightdm  1.3.2
xauthority.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010-2011 Robert Ancell.
00003  * Author: Robert Ancell <robert.ancell@canonical.com>
00004  * 
00005  * This program is free software: you can redistribute it and/or modify it under
00006  * the terms of the GNU General Public License as published by the Free Software
00007  * Foundation, either version 3 of the License, or (at your option) any later
00008  * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
00009  * license.
00010  */
00011 
00012 #ifndef _XAUTHORITY_H_
00013 #define _XAUTHORITY_H_
00014 
00015 #include <glib-object.h>
00016 #include <gio/gio.h>
00017 
00018 G_BEGIN_DECLS
00019 
00020 #define XAUTHORITY_TYPE (xauth_get_type())
00021 #define XAUTHORITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XAUTHORITY_TYPE, XAuthority));
00022 
00023 typedef struct XAuthorityPrivate XAuthorityPrivate;
00024 
00025 typedef struct
00026 {
00027     GObject         parent_instance;
00028     XAuthorityPrivate *priv;
00029 } XAuthority;
00030 
00031 typedef struct
00032 {
00033     GObjectClass parent_class;
00034 } XAuthorityClass;
00035 
00036 #define XAUTH_FAMILY_INTERNET 0
00037 #define XAUTH_FAMILY_DECNET 1
00038 #define XAUTH_FAMILY_CHAOS 2
00039 #define XAUTH_FAMILY_SERVER_INTERPRETED 5
00040 #define XAUTH_FAMILY_INTERNET6 6
00041 #define XAUTH_FAMILY_LOCALHOST 252
00042 #define XAUTH_FAMILY_KRB5_PRINCIPAL 253
00043 #define XAUTH_FAMILY_NETNAME 254
00044 #define XAUTH_FAMILY_LOCAL 256
00045 #define XAUTH_FAMILY_WILD 65535
00046 
00047 typedef enum
00048 {
00049    XAUTH_WRITE_MODE_REPLACE,
00050    XAUTH_WRITE_MODE_REMOVE,
00051    XAUTH_WRITE_MODE_SET  
00052 } XAuthWriteMode;
00053 
00054 GType xauth_get_type (void);
00055 
00056 XAuthority *xauth_new (guint16 family, const guint8 *address, gsize address_length, const gchar *number, const gchar *name, const guint8 *data, gsize data_length);
00057 
00058 XAuthority *xauth_new_cookie (guint16 family, const guint8 *address, gsize address_length, const gchar *number);
00059 
00060 void xauth_set_family (XAuthority *auth, guint16 family);
00061 
00062 guint16 xauth_get_family (XAuthority *auth);
00063 
00064 void xauth_set_address (XAuthority *auth, const guint8 *address, gsize address_length);
00065 
00066 const guint8 *xauth_get_address (XAuthority *auth);
00067 
00068 const gsize xauth_get_address_length (XAuthority *auth);
00069 
00070 void xauth_set_number (XAuthority *auth, const gchar *number);
00071 
00072 const gchar *xauth_get_number (XAuthority *auth);
00073 
00074 void xauth_set_authorization_name (XAuthority *auth, const gchar *name);
00075 
00076 const gchar *xauth_get_authorization_name (XAuthority *auth);
00077 
00078 void xauth_set_authorization_data (XAuthority *auth, const guint8 *data, gsize data_length);
00079 
00080 const guint8 *xauth_get_authorization_data (XAuthority *auth);
00081 
00082 guint8 *xauth_copy_authorization_data (XAuthority *auth);
00083 
00084 gsize xauth_get_authorization_data_length (XAuthority *auth);
00085 
00086 gboolean xauth_write (XAuthority *auth, XAuthWriteMode mode, GFile *file, GError **error);
00087 
00088 G_END_DECLS
00089 
00090 #endif /* _XAUTHORITY_H_ */