Tizen 2.0 Release
[external/libgnutls26.git] / doc / manpages / gnutls_ia_set_server_avp_function.3
1 .\" DO NOT MODIFY THIS FILE!  It was generated by gdoc.
2 .TH "gnutls_ia_set_server_avp_function" 3 "2.12.6.1" "gnutls" "gnutls"
3 .SH NAME
4 gnutls_ia_set_server_avp_function \- API function
5 .SH SYNOPSIS
6 .B #include <gnutls/extra.h>
7 .sp
8 .BI "void gnutls_ia_set_server_avp_function(gnutls_ia_server_credentials_t " cred ", gnutls_ia_avp_func " avp_func ");"
9 .SH ARGUMENTS
10 .IP "gnutls_ia_server_credentials_t cred" 12
11 is a \fBgnutls_ia_server_credentials_t\fP structure.
12 .IP "gnutls_ia_avp_func avp_func" 12
13 .SH "DESCRIPTION"
14 Set the TLS/IA AVP callback handler used for the session.
15
16 The callback's function form is:
17 int (*avp_func) (gnutls_session_t session, void *ptr,
18 const char *last, size_t lastlen,
19 char **next, size_t *nextlen);
20
21 The \fIsession\fP parameter is the \fBgnutls_session_t\fP structure
22 corresponding to the current session.  The \fIptr\fP parameter is the
23 application hook pointer, set through
24 \fBgnutls_ia_set_server_avp_ptr()\fP.  The AVP received from the client
25 is present in \fIlast\fP of \fIlastlen\fP size.  The newly allocated output
26 AVP to send to the client should be placed in *\fInext\fP of *\fInextlen\fP
27 size.
28
29 The AVP callback is called to process incoming AVPs from the
30 client, and to get a new AVP to send to the client.  It can also be
31 used to instruct the TLS/IA handshake to do go into the
32 Intermediate or Final phases.  It return a negative error code, or
33 a \fBgnutls_ia_apptype_t\fP message type.
34
35 The callback may invoke \fBgnutls_ia_permute_inner_secret()\fP to mix any
36 generated session keys with the TLS/IA inner secret.
37
38 Specifically, return \fBGNUTLS_IA_APPLICATION_PAYLOAD\fP (0) to send
39 another AVP to the client, return
40 \fBGNUTLS_IA_INTERMEDIATE_PHASE_FINISHED\fP (1) to indicate that an
41 IntermediatePhaseFinished message should be sent, and return
42 \fBGNUTLS_IA_FINAL_PHASE_FINISHED\fP (2) to indicate that an
43 FinalPhaseFinished message should be sent.  In the last two cases,
44 the contents of the \fInext\fP and \fInextlen\fP parameter is not used.
45
46 Note that the callback must use allocate the \fInext\fP parameter using
47 \fBgnutls_malloc()\fP, because it is released via \fBgnutls_free()\fP by the
48 TLS/IA handshake function.
49 .SH "REPORTING BUGS"
50 Report bugs to <bug-gnutls@gnu.org>.
51 GnuTLS home page: http://www.gnu.org/software/gnutls/
52 General help using GNU software: http://www.gnu.org/gethelp/
53 .SH COPYRIGHT
54 Copyright \(co 2008 Free Software Foundation.
55 .br
56 Copying and distribution of this file, with or without modification,
57 are permitted in any medium without royalty provided the copyright
58 notice and this notice are preserved.
59 .SH "SEE ALSO"
60 The full documentation for
61 .B gnutls
62 is maintained as a Texinfo manual.  If the
63 .B info
64 and
65 .B gnutls
66 programs are properly installed at your site, the command
67 .IP
68 .B info gnutls
69 .PP
70 should give you access to the complete manual.