Blame lib/hello_ext_lib.h

Packit aea12f
/*
Packit aea12f
 * Copyright (C) 2017 Red Hat, Inc.
Packit aea12f
 *
Packit aea12f
 * Author: Nikos Mavrogiannopoulos
Packit aea12f
 *
Packit aea12f
 * This file is part of GnuTLS.
Packit aea12f
 *
Packit aea12f
 * The GnuTLS is free software; you can redistribute it and/or
Packit aea12f
 * modify it under the terms of the GNU Lesser General Public License
Packit aea12f
 * as published by the Free Software Foundation; either version 2.1 of
Packit aea12f
 * the License, or (at your option) any later version.
Packit aea12f
 *
Packit aea12f
 * This library is distributed in the hope that it will be useful, but
Packit aea12f
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit aea12f
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit aea12f
 * Lesser General Public License for more details.
Packit aea12f
 *
Packit aea12f
 * You should have received a copy of the GNU Lesser General Public License
Packit aea12f
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
Packit aea12f
 *
Packit aea12f
 */
Packit aea12f
Packit aea12f
#ifndef GNUTLS_LIB_HELLO_EXT_LIB_H
Packit aea12f
#define GNUTLS_LIB_HELLO_EXT_LIB_H
Packit aea12f
Packit aea12f
#include <gnutls/gnutls.h>
Packit aea12f
#include "hello_ext.h"
Packit aea12f
Packit aea12f
/* Functions to use at the send() or recv() extension function to temporarily
Packit aea12f
 * store and retrieve data related to the extension.
Packit aea12f
 */
Packit aea12f
int
Packit aea12f
_gnutls_hello_ext_set_datum(gnutls_session_t session,
Packit aea12f
			    extensions_t id, const gnutls_datum_t *data);
Packit aea12f
int
Packit aea12f
_gnutls_hello_ext_get_datum(gnutls_session_t session,
Packit aea12f
			    extensions_t id, gnutls_datum_t *data /* constant contents */);
Packit aea12f
Packit aea12f
int
Packit aea12f
_gnutls_hello_ext_get_resumed_datum(gnutls_session_t session,
Packit aea12f
				    extensions_t id, gnutls_datum_t *data /* constant contents */);
Packit aea12f
Packit aea12f
/* clear up any set data for the extension */
Packit aea12f
#if 0 /* defined in hello_ext.h */
Packit aea12f
void
Packit aea12f
_gnutls_hello_ext_unset_priv(gnutls_session_t session,
Packit aea12f
                              extensions_t id);
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* Function that will deinitialize the temporal data. Must be set
Packit aea12f
 * as the deinit_func in the hello_ext_entry_st if the functions above
Packit aea12f
 * are used.
Packit aea12f
 */
Packit aea12f
void _gnutls_hello_ext_default_deinit(gnutls_ext_priv_data_t priv);
Packit aea12f
Packit aea12f
/* Functions to pack and unpack data if they need to be stored at
Packit aea12f
 * session resumption data. Must be set as the pack_func and unpack_func
Packit aea12f
 * of hello_ext_entry_st if the set and get functions above are used,
Packit aea12f
 * and data must be accessible on resumed sessions.
Packit aea12f
 */
Packit aea12f
int
Packit aea12f
_gnutls_hello_ext_default_pack(gnutls_ext_priv_data_t epriv, gnutls_buffer_st *ps);
Packit aea12f
Packit aea12f
int
Packit aea12f
_gnutls_hello_ext_default_unpack(gnutls_buffer_st *ps, gnutls_ext_priv_data_t *epriv);
Packit aea12f
Packit aea12f
#endif /* GNUTLS_LIB_HELLO_EXT_LIB_H */