Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:00:16

0001 /*
0002  * Copyright (C) 2011-2012 Free Software Foundation, Inc.
0003  *
0004  * Author: Nikos Mavrogiannopoulos
0005  *
0006  * This file is part of GnuTLS.
0007  *
0008  * The GnuTLS is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU Lesser General Public License
0010  * as published by the Free Software Foundation; either version 2.1 of
0011  * the License, or (at your option) any later version.
0012  *
0013  * This library is distributed in the hope that it will be useful, but
0014  * WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  * Lesser General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public License
0019  * along with this program.  If not, see <https://www.gnu.org/licenses/>
0020  *
0021  */
0022 
0023 /* This file contains the types and prototypes for the X.509
0024  * certificate and CRL handling functions.
0025  */
0026 
0027 #ifndef GNUTLS_DTLS_H
0028 #define GNUTLS_DTLS_H
0029 
0030 #include <gnutls/gnutls.h>
0031 
0032 #ifdef __cplusplus
0033 extern "C" {
0034 #endif
0035 
0036 #define GNUTLS_COOKIE_KEY_SIZE 16
0037 
0038 void gnutls_dtls_set_timeouts(gnutls_session_t session,
0039                   unsigned int retrans_timeout,
0040                   unsigned int total_timeout);
0041 
0042 unsigned int gnutls_dtls_get_mtu(gnutls_session_t session);
0043 unsigned int gnutls_dtls_get_data_mtu(gnutls_session_t session);
0044 
0045 void gnutls_dtls_set_mtu(gnutls_session_t session, unsigned int mtu);
0046 int gnutls_dtls_set_data_mtu(gnutls_session_t session, unsigned int mtu);
0047 
0048 unsigned int gnutls_dtls_get_timeout(gnutls_session_t session);
0049 
0050 /**
0051  * gnutls_dtls_prestate_st:
0052  * @record_seq: record sequence number
0053  * @hsk_read_seq: handshake read sequence number
0054  * @hsk_write_seq: handshake write sequence number
0055  *
0056  * DTLS cookie prestate struct.  This is usually never modified by
0057  * the application, it is used to carry the cookie data between
0058  * gnutls_dtls_cookie_send(), gnutls_dtls_cookie_verify() and
0059  * gnutls_dtls_prestate_set().
0060  */
0061 typedef struct {
0062     unsigned int record_seq;
0063     unsigned int hsk_read_seq;
0064     unsigned int hsk_write_seq;
0065 } gnutls_dtls_prestate_st;
0066 
0067 int gnutls_dtls_cookie_send(gnutls_datum_t *key, void *client_data,
0068                 size_t client_data_size,
0069                 gnutls_dtls_prestate_st *prestate,
0070                 gnutls_transport_ptr_t ptr,
0071                 gnutls_push_func push_func);
0072 
0073 int gnutls_dtls_cookie_verify(gnutls_datum_t *key, void *client_data,
0074                   size_t client_data_size, void *_msg,
0075                   size_t msg_size,
0076                   gnutls_dtls_prestate_st *prestate);
0077 
0078 void gnutls_dtls_prestate_set(gnutls_session_t session,
0079                   gnutls_dtls_prestate_st *prestate);
0080 
0081 unsigned int gnutls_record_get_discarded(gnutls_session_t session);
0082 
0083 #ifdef __cplusplus
0084 }
0085 #endif
0086 
0087 #endif /* GNUTLS_DTLS_H */