1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
.TH libaxl_send_handshake 3 libaxl
.SH NAME
libaxl_send_handshake - Initiate connection handshake
.SH SYNOPSIS
.nf
#include <libaxl.h>
int libaxl_send_handshake(LIBAXL_CONTEXT *\fIctx\fP, const char *\fIauth_name\fP, size_t \fIauth_name_len\fP,
const char *\fIauth_data\fP, size_t \fIauth_data_len\fP, int \fIflags\fP);
.fi
.SH DESCRIPTION
The
.BR libaxl_send_handshake ()
function sends the clients part of the handshake
to the display server.
.PP
The value of the
.I ctx
parameter shall be the thread's state for the
connection to the display server.
.PP
The value of the
.I auth_name
shall be the protocol name of the authorisation
the client expects the server to use, and the
value of the
.I auth_name_len
shall be the length of the name, or 0 if
.I auth_name
is
.IR NULL .
The value of the
.I auth_data
shall be the authorisation data, which is specific
to the choosen authorisation mechanism, and the
value of the
.I auth_data_len
shall be the length of the authorisation data,
or 0 if
.I auth_data
is
.IR NULL .
.PP
This function is called immediately after connecting
to the socket for the display, and shall not be called
again except of the authorisation failed, in which
case a new authorisation mechanism can be tried.
.SH RETURN VALUE
The
.BR libaxl_send_handshake ()
function return 0 upon successful completion, or a
negative libaxl error code on failure.
.SH ERRORS
The
.BR libaxl_send_handshake ()
function can only fail if:
.TP
.IR LIBAXL_ERROR_SYSTEM " with " EINVAL
.I auth_name_len
or
.I auth_data_len
is greater than 65535.
.TP
.IR LIBAXL_ERROR_SYSTEM " with " EALREADY
There is an incompleted send pending, that must
be flushed with the
.BR libaxl_flush (3)
function first.
.TP
.IR LIBAXL_ERROR_SYSTEM " with " EINPROGRESS
The message could not be fully sent (why
.BR send (3)
failed can be found in the causal of the error)
and must be completed by flushing it with the
.BR libaxl_flush (3)
function.
.SH NOTES
Valid authorisation mechanisms are not part of
the core X protocol.
.SH SEE ALSO
.BR libaxl_connect (3),
.BR libaxl_create (3),
.BR libaxl_parse_display (3),
.BR libaxl_receive_handshake (3),
.BR libaxl_connect_without_handshake (3)
|