1.. saslman:: sasl_encodev(3)
2
3.. _sasl-reference-manpages-library-sasl_encodev:
4
5
6==================================================================
7**sasl_encodev** - Encode data for transport to authenticated host
8==================================================================
9
10Synopsis
11========
12
13.. code-block:: C
14
15    #include <sasl/sasl.h>
16
17    int sasl_encode(sasl_conn_t *conn,
18                    const char * input,
19                    unsigned inputlen,
20                    const char ** output,
21                    unsigned * outputlen);
22
23    int sasl_encodev(sasl_conn_t *conn,
24                    const struct iovec * invec,
25                    unsigned numiov,
26                    const char ** output,
27                    unsigned * outputlen);
28
29
30Description
31===========
32
33**sasl_encode** encodes data to be sent to be sent to a remote host  who  we’ve
34had  a successful authentication session with. If there  is  a  negotiated
35security  the  data  in signed/encrypted  and  the  output  should be sent
36without modification to the remote host. If there is  no  security layer the
37output is identical to the input.
38
39**sasl_encodev** does the same, but for a `struct iovec` instead
40of a character buffer.
41
42.. c:function:: int sasl_encode(sasl_conn_t *conn,
43            const char * input,
44            unsigned inputlen,
45            const char ** output,
46            unsigned * outputlen);
47
48    :param conn: is the SASL connection context
49
50    :param output: contains the decoded data and is allocated/freed by
51        the library.
52
53    :param outputlen: length of `output`.
54
55    .. c:function:: int sasl_encodev(sasl_conn_t *conn,
56                const struct iovec * invec,
57                unsigned numiov,
58                const char ** output,
59                unsigned * outputlen);
60
61    :param conn: is the SASL connection context
62
63    :param output: contains the decoded data and is allocated/freed by
64        the library.
65
66    :param outputlen: length of `output`.
67
68
69Return Value
70============
71
72SASL  callback  functions should return SASL return codes.
73See sasl.h for a complete list. :c:macro:`SASL_OK` indicates success.
74
75Other return codes indicate errors and should be handled.
76
77See Also
78========
79
80:rfc:`4422`,:saslman:`sasl(3)`, :saslman:`sasl_decode(3)`,
81:saslman:`sasl_errors(3)`
82