2014-08-03 08:46:42 +02:00
|
|
|
/*
|
|
|
|
This file is part of libcapwap.
|
|
|
|
|
|
|
|
libcapwap is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
libcapwap is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-02-08 16:28:04 +01:00
|
|
|
/*
|
|
|
|
* GnuTLS specific definitions for DTLS
|
|
|
|
*/
|
|
|
|
|
2014-08-03 08:46:42 +02:00
|
|
|
#ifndef __DTLS_GNUTLS_H
|
|
|
|
#define __DTLS_GNUTLS_H
|
|
|
|
|
2015-02-07 10:53:21 +01:00
|
|
|
#include <gnutls/gnutls.h>
|
|
|
|
|
2014-08-03 08:46:42 +02:00
|
|
|
#include "conn.h"
|
|
|
|
|
2015-02-08 16:28:04 +01:00
|
|
|
/* "public" functions */
|
2014-08-03 08:46:42 +02:00
|
|
|
extern int dtls_gnutls_init();
|
|
|
|
extern int dtls_gnutls_accept(struct conn * conn);
|
2015-02-08 16:28:04 +01:00
|
|
|
extern int dtls_gnutls_connect(struct conn * conn);
|
2014-08-03 08:46:42 +02:00
|
|
|
extern const char * dtls_gnutls_get_cipher(struct conn * conn);
|
2015-02-09 22:04:54 +01:00
|
|
|
struct dtls_ssl_cert dtls_gnutls_get_peers_cert(struct conn * conn,unsigned int n);
|
2015-04-10 17:14:55 +02:00
|
|
|
extern int dtls_gnutls_shutdown(struct conn *conn);
|
2014-08-03 08:46:42 +02:00
|
|
|
|
2015-02-08 16:28:04 +01:00
|
|
|
|
|
|
|
/* functions used only by capwap libray */
|
|
|
|
|
2015-02-07 10:53:21 +01:00
|
|
|
extern ssize_t dtls_gnutls_bio_read(gnutls_transport_ptr_t b, void *out, size_t maxlen);
|
|
|
|
extern ssize_t dtls_gnutls_bio_write(gnutls_transport_ptr_t b, const void *data, size_t len);
|
2015-02-08 16:28:04 +01:00
|
|
|
extern int dtls_gnutls_bio_wait(gnutls_transport_ptr_t ptr, unsigned int ms);
|
|
|
|
extern int dtls_gnutls_read(struct conn * conn, uint8_t *buffer, int len);
|
|
|
|
extern int dtls_gnutls_write(struct conn * conn, const uint8_t *buffer, int len);
|
|
|
|
|
|
|
|
struct dtls_gnutls_data {
|
|
|
|
gnutls_session_t session;
|
|
|
|
gnutls_certificate_credentials_t x509_cred;
|
|
|
|
gnutls_priority_t priority_cache;
|
2015-03-09 23:51:48 +01:00
|
|
|
gnutls_dh_params_t dh_params;
|
2015-02-08 16:28:04 +01:00
|
|
|
};
|
|
|
|
|
2015-02-08 21:07:55 +01:00
|
|
|
struct dtls_gnutls_data *dtls_gnutls_data_create(struct conn *conn,int config);
|
2014-08-03 08:46:42 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|