1 /*
2  * Copyright (C) 2012 Free Software Foundation, Inc.
3  * Copyright (C) 2013 Nikos Mavrogiannopoulos
4  *
5  * Author: Nikos Mavrogiannopoulos
6  *
7  * This file is part of GnuTLS.
8  *
9  * The GnuTLS is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1 of
12  * the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program.  If not, see <https://www.gnu.org/licenses/>
21  *
22  */
23 
24 #ifndef GNUTLS_LIB_EXT_HEARTBEAT_H
25 #define GNUTLS_LIB_EXT_HEARTBEAT_H
26 
27 #include <hello_ext.h>
28 
29 #define HEARTBEAT_REQUEST 1
30 #define HEARTBEAT_RESPONSE 2
31 
32 #define MAX_HEARTBEAT_LENGTH DEFAULT_MAX_RECORD_SIZE
33 
34 #define LOCAL_ALLOWED_TO_SEND (1<<2)
35 #define LOCAL_NOT_ALLOWED_TO_SEND (1<<3)
36 
37 #define HEARTBEAT_DEFAULT_POLICY PEER_NOT_ALLOWED_TO_SEND
38 
39 extern const hello_ext_entry_st ext_mod_heartbeat;
40 
41 int _gnutls_heartbeat_handle(gnutls_session_t session, mbuffer_st * bufel);
42 int _gnutls_heartbeat_enabled(gnutls_session_t session, int local);
43 
44 #endif /* GNUTLS_LIB_EXT_HEARTBEAT_H */
45