1gnutls_server_name_get(3) gnutls gnutls_server_name_get(3)
2
3
4
6 gnutls_server_name_get - Used to get the server name indicator send by
7 a client
8
10 #include <gnutls/gnutls.h>
11
12 int gnutls_server_name_get(gnutls_session_t session, void * data,
13 size_t * data_length, unsigned int * type, unsigned int indx);
14
16 gnutls_session_t session
17 is a gnutls_session_t structure.
18
19 void * data will hold the data
20
21 size_t * data_length
22 will hold the data length. Must hold the maximum size of
23 data.
24
25 unsigned int * type
26 will hold the server name indicator type
27
28 unsigned int indx
29 is the index of the server_name
30
32 This function will allow you to get the name indication (if any), a
33 client has sent. The name indication may be any of the enumeration
34 gnutls_server_name_type_t.
35
36 If type is GNUTLS_NAME_DNS, then this function is to be used by servers
37 that support virtual hosting, and the data will be a null terminated
38 UTF-8 string.
39
40 If data has not enough size to hold the server name GNUTLS_E_SHORT_MEM‐
41 ORY_BUFFER is returned, and data_length will hold the required size.
42
43 index is used to retrieve more than one server names (if sent by the
44 client). The first server name has an index of 0, the second 1 and so
45 on. If no name with the given index exists
46 GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE is returned.
47
49 On success, GNUTLS_E_SUCCESS (zero) is returned, otherwise an error
50 code is returned.
51
53 Report bugs to <bug-gnutls@gnu.org>. GnuTLS home page:
54 http://www.gnu.org/software/gnutls/ General help using GNU software:
55 http://www.gnu.org/gethelp/
56
58 Copyright © 2008 Free Software Foundation.
59 Copying and distribution of this file, with or without modification,
60 are permitted in any medium without royalty provided the copyright
61 notice and this notice are preserved.
62
64 The full documentation for gnutls is maintained as a Texinfo manual.
65 If the info and gnutls programs are properly installed at your site,
66 the command
67
68 info gnutls
69
70 should give you access to the complete manual.
71
72
73
74gnutls 2.8.6 gnutls_server_name_get(3)