]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - tests/src/xdmcp-client.h
Refactored code to replace hardcoded signal identification strings by constants.
[sojka/lightdm.git] / tests / src / xdmcp-client.h
1 #ifndef XDMCP_CLIENT_H_
2 #define XDMCP_CLIENT_H_
3
4 #include <glib-object.h>
5 #include <gio/gio.h>
6
7 #define XDMCP_VERSION 1
8 #define XDMCP_PORT 177
9
10 #define XDMCP_CLIENT_SIGNAL_QUERY   "query"
11 #define XDMCP_CLIENT_SIGNAL_WILLING "willing"
12 #define XDMCP_CLIENT_SIGNAL_ACCEPT  "accept"
13 #define XDMCP_CLIENT_SIGNAL_DECLINE "decline"
14 #define XDMCP_CLIENT_SIGNAL_FAILED  "failed"
15
16 typedef struct
17 {
18     gchar *authentication_name;
19     gchar *hostname;
20     gchar *status;
21 } XDMCPWilling;
22
23 typedef struct
24 {
25     guint32 session_id;
26     gchar *authentication_name;
27     gchar *authorization_name;
28     guint16 authorization_data_length;
29     guint8 *authorization_data;
30 } XDMCPAccept;
31
32 typedef struct
33 {
34     gchar *status;
35     gchar *authentication_name;
36 } XDMCPDecline;
37
38 typedef struct
39 {
40     guint32 session_id;
41     gchar *status;
42 } XDMCPFailed;
43
44 typedef struct XDMCPClientPrivate XDMCPClientPrivate;
45
46 typedef struct
47 {
48    GObject             parent_instance;
49    XDMCPClientPrivate *priv;
50 } XDMCPClient;
51
52 typedef struct
53 {
54    GObjectClass parent_class;
55    void (*query)(XDMCPClient *client);
56    void (*willing)(XDMCPClient *client, XDMCPWilling *message);
57    void (*accept)(XDMCPClient *client, XDMCPAccept *message);
58    void (*decline)(XDMCPClient *client, XDMCPDecline *message);
59    void (*failed)(XDMCPClient *client, XDMCPFailed *message);
60 } XDMCPClientClass;
61
62 GType xdmcp_client_get_type (void);
63
64 XDMCPClient *xdmcp_client_new (void);
65
66 void xdmcp_client_set_hostname (XDMCPClient *client, const gchar *hostname);
67
68 void xdmcp_client_set_port (XDMCPClient *client, guint16 port);
69
70 gboolean xdmcp_client_start (XDMCPClient *client);
71
72 GInetAddress *xdmcp_client_get_local_address (XDMCPClient *client);
73
74 void xdmcp_client_send_query (XDMCPClient *client);
75
76 void xdmcp_client_send_request (XDMCPClient *client,
77                                 guint16 display_number,
78                                 GInetAddress **addresses,
79                                 const gchar *authentication_name,
80                                 const guint8 *authentication_data, guint16 authentication_data_length,
81                                 gchar **authorization_names, const gchar *mfid);
82
83 void xdmcp_client_send_manage (XDMCPClient *client, guint32 session_id, guint16 display_number, gchar *display_class);
84
85 G_END_DECLS
86
87 #endif /* XDMCP_CLIENT_H_ */