1gnutls_session_ext_register(3) gnutls gnutls_session_ext_register(3)
2
3
4
6 gnutls_session_ext_register - API function
7
9 #include <gnutls/gnutls.h>
10
11 int gnutls_session_ext_register(gnutls_session_t session, const char *
12 name, int id, gnutls_ext_parse_type_t parse_type, gnutls_ext_recv_func
13 recv_func, gnutls_ext_send_func send_func, gnutls_ext_deinit_data_func
14 deinit_func, gnutls_ext_pack_func pack_func, gnutls_ext_unpack_func
15 unpack_func, unsigned flags);
16
18 gnutls_session_t session
19 the session for which this extension will be set
20
21 const char * name
22 the name of the extension to register
23
24 int id the numeric id of the extension
25
26 gnutls_ext_parse_type_t parse_type
27 the parse type of the extension (see
28 gnutls_ext_parse_type_t)
29
30 gnutls_ext_recv_func recv_func
31 a function to receive the data
32
33 gnutls_ext_send_func send_func
34 a function to send the data
35
36 gnutls_ext_deinit_data_func deinit_func
37 a function deinitialize any private data
38
39 gnutls_ext_pack_func pack_func
40 a function which serializes the extension's private data
41 (used on session packing for resumption)
42
43 gnutls_ext_unpack_func unpack_func
44 a function which will deserialize the extension's private
45 data
46
47 unsigned flags
48 must be zero or flags from gnutls_ext_flags_t
49
51 This function will register a new extension type. The extension will be
52 only usable within the registered session. If the extension type is
53 already registered then GNUTLS_E_ALREADY_REGISTERED will be returned,
54 unless the flag GNUTLS_EXT_FLAG_OVERRIDE_INTERNAL is specified. The
55 latter flag when specified can be used to override certain extensions
56 introduced after 3.6.0. It is expected to be used by applications which
57 handle custom extensions that are not currently supported in GnuTLS,
58 but direct support for them may be added in the future.
59
60 Each registered extension can store temporary data into the gnutls_ses‐
61 sion_t structure using gnutls_ext_set_data(), and they can be retrieved
62 using gnutls_ext_get_data().
63
64 The validity of the extension registered can be given by the appropri‐
65 ate flags of gnutls_ext_flags_t. If no validity is given, then the reg‐
66 istered extension will be valid for client and TLS1.2 server hello (or
67 encrypted extensions for TLS1.3).
68
70 GNUTLS_E_SUCCESS on success, otherwise a negative error code.
71
73 3.5.5
74
76 Report bugs to <bugs@gnutls.org>.
77 Home page: http://www.gnutls.org
78
79
81 Copyright © 2001-2018 Free Software Foundation, Inc., and others.
82 Copying and distribution of this file, with or without modification,
83 are permitted in any medium without royalty provided the copyright
84 notice and this notice are preserved.
85
87 The full documentation for gnutls is maintained as a Texinfo manual.
88 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
89 visit
90
91 http://www.gnutls.org/manual/
92
93gnutls 3.6.5 gnutls_session_ext_register(3)