]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - tests/src/x-authority.h
Refactored code to replace hardcoded signal identification strings by constants
[sojka/lightdm.git] / tests / src / x-authority.h
1 #ifndef X_AUTHORITY_H_
2 #define X_AUTHORITY_H_
3
4 #include <glib-object.h>
5 #include <gio/gio.h>
6
7 G_BEGIN_DECLS
8
9 enum
10 {
11     XAUTH_FAMILY_INTERNET = 0,
12     XAUTH_FAMILY_DECNET = 1,
13     XAUTH_FAMILY_CHAOS = 2,
14     XAUTH_FAMILY_SERVER_INTERPRETED = 5,
15     XAUTH_FAMILY_INTERNET6 = 6,
16     XAUTH_FAMILY_LOCALHOST = 252,
17     XAUTH_FAMILY_KRB5_PRINCIPAL = 253,
18     XAUTH_FAMILY_NETNAME = 254,
19     XAUTH_FAMILY_LOCAL = 256,
20     XAUTH_FAMILY_WILD = 65535
21 };
22
23 typedef struct XAuthorityPrivate XAuthorityPrivate;
24
25 typedef struct
26 {
27     GObjectClass parent_instance;
28     XAuthorityPrivate *priv;
29 } XAuthority;
30
31 typedef struct
32 {
33     GObjectClass parent_class;
34 } XAuthorityClass;
35
36 typedef struct XAuthorityRecordPrivate XAuthorityRecordPrivate;
37
38 typedef struct
39 {
40     GObjectClass parent_instance;
41     XAuthorityRecordPrivate *priv;
42 } XAuthorityRecord;
43
44 typedef struct
45 {
46     GObjectClass parent_class;
47 } XAuthorityRecordClass;
48
49 GType x_authority_get_type (void);
50
51 GType x_authority_record_get_type (void);
52
53 XAuthority *x_authority_new (void);
54
55 gboolean x_authority_load (XAuthority *authority, const gchar *filename, GError **error);
56
57 XAuthorityRecord *x_authority_match_local (XAuthority *authority, const gchar *authorization_name);
58
59 XAuthorityRecord *x_authority_match_localhost (XAuthority *authority, const gchar *authorization_name);
60
61 XAuthorityRecord *x_authority_match_inet (XAuthority *authority, GInetAddress *address, const gchar *authorization_name);
62
63 guint16 x_authority_record_get_authorization_data_length (XAuthorityRecord *record);
64
65 const guint8 *x_authority_record_get_authorization_data (XAuthorityRecord *record);
66
67 gboolean x_authority_record_check_cookie (XAuthorityRecord *record, const guint8 *cookie_data, guint16 cookie_data_length);
68
69 G_END_DECLS
70
71 #endif /* X_AUTHORITY_H_ */