Blame doc/functions/gnutls_dtls_cookie_send

Packit aea12f
Packit aea12f
Packit aea12f
Packit aea12f
@deftypefun {int} {gnutls_dtls_cookie_send} (gnutls_datum_t * @var{key}, void * @var{client_data}, size_t @var{client_data_size}, gnutls_dtls_prestate_st * @var{prestate}, gnutls_transport_ptr_t @var{ptr}, gnutls_push_func @var{push_func})
Packit aea12f
@var{key}: is a random key to be used at cookie generation
Packit aea12f
Packit aea12f
@var{client_data}: contains data identifying the client (i.e. address)
Packit aea12f
Packit aea12f
@var{client_data_size}: The size of client's data
Packit aea12f
Packit aea12f
@var{prestate}: The previous cookie returned by @code{gnutls_dtls_cookie_verify()} 
Packit aea12f
Packit aea12f
@var{ptr}: A transport pointer to be used by  @code{push_func} 
Packit aea12f
Packit aea12f
@var{push_func}: A function that will be used to reply
Packit aea12f
Packit aea12f
This function can be used to prevent denial of service
Packit aea12f
attacks to a DTLS server by requiring the client to
Packit aea12f
reply using a cookie sent by this function. That way
Packit aea12f
it can be ensured that a client we allocated resources
Packit aea12f
for (i.e. @code{gnutls_session_t} ) is the one that the 
Packit aea12f
original incoming packet was originated from.
Packit aea12f
Packit aea12f
This function must be called at the first incoming packet,
Packit aea12f
prior to allocating any resources and must be succeeded
Packit aea12f
by @code{gnutls_dtls_cookie_verify()} .
Packit aea12f
Packit aea12f
@strong{Returns:} the number of bytes sent, or a negative error code.  
Packit aea12f
Packit aea12f
@strong{Since:} 3.0
Packit aea12f
@end deftypefun