xine-lib: xine-lib-1.2.13/src/input/tls/tls_gnutls.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Functions | Variables
tls_gnutls.c File Reference
`#include <stdlib.h>`
`#include <errno.h>`
`#include <gnutls/gnutls.h>`
`#include <gnutls/x509.h>`
`#include <string.h>`
`#include <sys/stat.h>`
`#include <dirent.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/io_helper.h>`
`#include <xine/xine_plugin.h>`
`#include "xine_tls_plugin.h"`

## Data Structures
struct | tls_gnutls_t

## Macros
#define | XINE_GNUTLS_INIT_FLAGS GNUTLS_CLIENT
#define | LOG_MODULE "gnutls"
#define | list_t uint32_t

## Functions
static ssize_t | gnutls_tcp_pull (gnutls_transport_ptr_t tp, void *buf, size_t len)
static ssize_t | gnutls_tcp_push (gnutls_transport_ptr_t tp, const void *buf, size_t len)
static ssize_t | _gnutls_write (tls_plugin_t *this_gen, const void *buf, size_t len)
static ssize_t | _gnutls_read (tls_plugin_t *this_gen, void *buf, size_t len)
static ssize_t | _gnutls_part_read (tls_plugin_t *this_gen, void *buf, size_t min, size_t max)
static int | _gnutls_load_certs (tls_gnutls_t *this, const char *dirname)
static void | _gnutls_shutdown (tls_plugin_t *this_gen)
static int | _gnutls_handshake (tls_plugin_t *this_gen, const char *host, int verify)
static void | _gnutls_dispose (xine_module_t *this_gen)
static xine_module_t * | gnutls_get_instance (xine_module_class_t *cls_gen, const void *params_gen)
static void * | gnutls_init_class (xine_t *xine, const void *data)

## Variables
static const xine_module_info_t | module_info_gnutls
const plugin_info_t xine_plugin_info[] | EXPORTED

## Macro Definition Documentation

## ◆ list_t

#define list_t uint32_t

Referenced by _gnutls_load_certs().

## ◆ LOG_MODULE

#define LOG_MODULE "gnutls"

Referenced by _gnutls_handshake(), _gnutls_part_read(), _gnutls_read(), _gnutls_write(), and gnutls_get_instance().

## ◆ XINE_GNUTLS_INIT_FLAGS

#define XINE_GNUTLS_INIT_FLAGS GNUTLS_CLIENT

Referenced by _gnutls_handshake().

## Function Documentation

## ◆ _gnutls_dispose()

static void _gnutls_dispose | ( | xine_module_t * | this_gen | ) |
| static

References _gnutls_shutdown().

Referenced by gnutls_get_instance().

## ◆ _gnutls_handshake()

static int _gnutls_handshake | ( | tls_plugin_t * | this_gen,
|  | const char * | host,
|  | int | verify )
| static

References _gnutls_load_certs(), _x_assert, _x_io_select(), _x_query_network_timeout(), gnutls_tcp_pull(), gnutls_tcp_push(), LOG_MODULE, NULL, tls_get_verify_tls_cert(), XINE_GNUTLS_INIT_FLAGS, XINE_VERBOSITY_LOG, XIO_READ_READY, XIO_READY, XIO_WRITE_READY, and xprintf.

Referenced by gnutls_get_instance().

## ◆ _gnutls_load_certs()

static int _gnutls_load_certs | ( | tls_gnutls_t * | this,
|  | const char * | dirname )
| static

References list_t, NULL, S_ISREG, XINE_VERBOSITY_DEBUG, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _gnutls_handshake().

## ◆ _gnutls_part_read()

static ssize_t _gnutls_part_read | ( | tls_plugin_t * | this_gen,
|  | void * | buf,
|  | size_t | min,
|  | size_t | max )
| static

References _x_io_select(), _x_query_network_timeout(), LOG_MODULE, XINE_VERBOSITY_LOG, XIO_READ_READY, XIO_READY, XIO_WRITE_READY, and xprintf.

Referenced by gnutls_get_instance().

## ◆ _gnutls_read()

static ssize_t _gnutls_read | ( | tls_plugin_t * | this_gen,
|  | void * | buf,
|  | size_t | len )
| static

References _x_io_select(), _x_query_network_timeout(), LOG_MODULE, XINE_VERBOSITY_LOG, XIO_READ_READY, XIO_READY, XIO_WRITE_READY, and xprintf.

Referenced by gnutls_get_instance().

## ◆ _gnutls_shutdown()

static void _gnutls_shutdown | ( | tls_plugin_t * | this_gen | ) |
| static

References _x_io_select(), _x_query_network_timeout(), NULL, XIO_READ_READY, XIO_READY, and XIO_WRITE_READY.

Referenced by _gnutls_dispose(), and gnutls_get_instance().

## ◆ _gnutls_write()

static ssize_t _gnutls_write | ( | tls_plugin_t * | this_gen,
|  | const void * | buf,
|  | size_t | len )
| static

References _x_io_select(), _x_query_network_timeout(), LOG_MODULE, XINE_VERBOSITY_LOG, XIO_READ_READY, XIO_READY, XIO_WRITE_READY, and xprintf.

Referenced by gnutls_get_instance().

## ◆ gnutls_get_instance()

static xine_module_t * gnutls_get_instance | ( | xine_module_class_t * | cls_gen,
|  | const void * | params_gen )
| static

References _gnutls_dispose(), _gnutls_handshake(), _gnutls_part_read(), _gnutls_read(), _gnutls_shutdown(), _gnutls_write(), tls_plugin_params_t::fd, LOG_MODULE, NULL, tls_plugin_params_t::stream, tls_plugin_params_t::xine, XINE_VERBOSITY_LOG, and xprintf.

Referenced by gnutls_init_class().

## ◆ gnutls_init_class()

static void * gnutls_init_class | ( | xine_t * | xine,
|  | const void * | data )
| static

References xine_s::config, xine_module_s::dispose, xine_module_class_s::get_instance, gnutls_get_instance(), N_, NULL, and tls_register_config_keys().

## ◆ gnutls_tcp_pull()

static ssize_t gnutls_tcp_pull | ( | gnutls_transport_ptr_t | tp,
|  | void * | buf,
|  | size_t | len )
| static

References _x_io_tcp_part_read(), _x_io_tcp_read(), xine_fast_memcpy, and xine_small_memcpy.

Referenced by _gnutls_handshake().

## ◆ gnutls_tcp_push()

static ssize_t gnutls_tcp_push | ( | gnutls_transport_ptr_t | tp,
|  | const void * | buf,
|  | size_t | len )
| static

References _x_io_tcp_write().

Referenced by _gnutls_handshake().

## Variable Documentation

## ◆ EXPORTED

const plugin_info_t xine_plugin_info [] EXPORTED

Initial value:
= {
{ PLUGIN_XINE_MODULE, 1, "gnutls", XINE_VERSION_CODE, &module_info_gnutls, gnutls_init_class },
{ PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
}
gnutls_init_class
static void * gnutls_init_class(xine_t *xine, const void *data)
Definition tls_gnutls.c:513
module_info_gnutls
static const xine_module_info_t module_info_gnutls
Definition tls_gnutls.c:534
XINE_VERSION_CODE
#define XINE_VERSION_CODE
Definition xine_internal.h:57
NULL
NULL
Definition xine_plugin.c:78
PLUGIN_NONE
#define PLUGIN_NONE
Definition xine_plugin.h:29
PLUGIN_XINE_MODULE
#define PLUGIN_XINE_MODULE
Definition xine_plugin.h:41

## ◆ module_info_gnutls

const xine_module_info_t module_info_gnutls
| static

Initial value:
= {
.priority = 10,
.type = "tls_v1",
}