Added commnts and license

FossilOrigin-Name: c5c2fc78b0052b28e494617675605aeeda5b056a0bd70c194707fefd4c08085a
This commit is contained in:
7u83@mail.ru 2016-03-12 08:52:14 +00:00
parent a1c9895cdb
commit 9b2d0d6550

View File

@ -1,4 +1,25 @@
/*
This file is part of actube.
actube 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/>.
*/
/**
* @file
* @brief Implements dtls_gnutls_connect
*/
#include "gnutls/dtls.h" #include "gnutls/dtls.h"
@ -10,7 +31,10 @@
#include "dbg.h" #include "dbg.h"
#include "sock.h" #include "sock.h"
/**
* Establish a DTLS connection using gnutls library
* @see #dtls_connect
*/
int dtls_gnutls_connect(struct conn *conn) int dtls_gnutls_connect(struct conn *conn)
{ {
struct dtls_gnutls_data *d; struct dtls_gnutls_data *d;
@ -29,6 +53,7 @@ int dtls_gnutls_connect(struct conn *conn)
gnutls_dtls_set_mtu(d->session, 1500); gnutls_dtls_set_mtu(d->session, 1500);
int rc; int rc;
cw_dbg(DBG_DTLS,"Starting handshake");
do { do {
rc = gnutls_handshake(d->session); rc = gnutls_handshake(d->session);
} while (rc == GNUTLS_E_AGAIN); } while (rc == GNUTLS_E_AGAIN);