.\" DO NOT MODIFY THIS FILE! It was generated by gdoc. .TH "gnutls_ia_set_server_avp_function" 3 "2.4.2" "gnutls" "gnutls" .SH NAME gnutls_ia_set_server_avp_function \- Used to set a AVP callback .SH SYNOPSIS .B #include .sp .BI "void gnutls_ia_set_server_avp_function(gnutls_ia_server_credentials_t " cred ", gnutls_ia_avp_func " avp_func ");" .SH ARGUMENTS .IP "gnutls_ia_server_credentials_t cred" 12 is a \fBgnutls_ia_server_credentials_t\fP structure. .IP "gnutls_ia_avp_func avp_func" 12 .SH "DESCRIPTION" Set the TLS/IA AVP callback handler used for the session. The callback's function form is: int (*avp_func) (gnutls_session_t session, void *ptr, const char *last, size_t lastlen, char **next, size_t *nextlen); The \fIsession\fP parameter is the \fBgnutls_session_t\fP structure corresponding to the current session. The \fIptr\fP parameter is the application hook pointer, set through \fBgnutls_ia_set_server_avp_ptr()\fP. The AVP received from the client is present in \fIlast\fP of \fIlastlen\fP size. The newly allocated output AVP to send to the client should be placed in *\fInext\fP of *\fInextlen\fP size. The AVP callback is called to process incoming AVPs from the client, and to get a new AVP to send to the client. It can also be used to instruct the TLS/IA handshake to do go into the Intermediate or Final phases. It return a negative error code, or an \fBgnutls_ia_apptype_t\fP message type. The callback may invoke \fBgnutls_ia_permute_inner_secret()\fP to mix any generated session keys with the TLS/IA inner secret. Specifically, return \fBGNUTLS_IA_APPLICATION_PAYLOAD\fP (0) to send another AVP to the client, return \fBGNUTLS_IA_INTERMEDIATE_PHASE_FINISHED\fP (1) to indicate that an IntermediatePhaseFinished message should be sent, and return \fBGNUTLS_IA_FINAL_PHASE_FINISHED\fP (2) to indicate that an FinalPhaseFinished message should be sent. In the last two cases, the contents of the \fInext\fP and \fInextlen\fP parameter is not used. Note that the callback must use allocate the \fInext\fP parameter using \fBgnutls_malloc()\fP, because it is released via \fBgnutls_free()\fP by the TLS/IA handshake function. .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT Copyright \(co 2008 Free Software Foundation. .br Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. .SH "SEE ALSO" The full documentation for .B gnutls is maintained as a Texinfo manual. If the .B info and .B gnutls programs are properly installed at your site, the command .IP .B info gnutls .PP should give you access to the complete manual.