xine-lib: xine-lib-1.2.12/src/input/tls/xine_tls.c File Reference

xine-lib 1.2.12

Data Structures | Macros | Functions
xine_tls.c File Reference
`#include "xine_tls.h"`
`#include <stdlib.h>`
`#include <errno.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/io_helper.h>`
`#include "xine_tls_plugin.h"`

## Data Structures
struct | xine_tls

## Macros
#define | LOG_MODULE "input_tls"

## Functions
static tls_plugin_t * | _x_find_tls_plugin (xine_t *xine, tls_plugin_params_t *params)
static void | _x_free_tls_plugin (xine_t *xine, tls_plugin_t **tls)
ssize_t | _x_tls_write (xine_tls_t *t, const void *buf, size_t len)
ssize_t | _x_tls_part_read (xine_tls_t *t, void *buf, size_t min, size_t max)
ssize_t | _x_tls_read (xine_tls_t *t, void *buf, size_t len)
ssize_t | _x_tls_read_line (xine_tls_t *t, char *buf, size_t buf_size)
void | _x_tls_shutdown (xine_tls_t *t)
void | _x_tls_close (xine_tls_t **pt)
void | _x_tls_deinit (xine_tls_t **pt)
xine_tls_t * | _x_tls_init (xine_t *xine, xine_stream_t *stream, int fd)
xine_tls_t * | _x_tls_connect (xine_t *xine, xine_stream_t *stream, const char *host, int port)
int | _x_tls_handshake (xine_tls_t *t, const char *host, int verify)
int | _x_tls_get_verify_tls_cert (config_values_t *config)
int | _x_tls_available (xine_t *xine)

## Macro Definition Documentation

## ◆ LOG_MODULE

#define LOG_MODULE "input_tls"

## Function Documentation

## ◆ _x_find_tls_plugin()

static tls_plugin_t * _x_find_tls_plugin | ( | xine_t * | xine,
|  | tls_plugin_params_t * | params
| ) |  |
| inlinestatic

References _x_find_module(), and NULL.

Referenced by _x_tls_available(), and _x_tls_handshake().

## ◆ _x_free_tls_plugin()

static void _x_free_tls_plugin | ( | xine_t * | xine,
|  | tls_plugin_t ** | tls
| ) |  |
| inlinestatic

References _x_free_module().

Referenced by _x_tls_available(), _x_tls_close(), and _x_tls_deinit().

## ◆ _x_tls_available()

int _x_tls_available | ( | xine_t * | xine | ) |

References _x_find_tls_plugin(), _x_free_tls_plugin(), and tls_plugin_params_t::xine.

Referenced by http_can_handle().

## ◆ _x_tls_close()

void _x_tls_close | ( | xine_tls_t ** | pt | ) |

References _x_free_tls_plugin(), _x_freep(), _x_io_tcp_close(), _x_tls_shutdown(), xine_tls::fd, xine_tls::stream, xine_tls::tls, and xine_tls::xine.

Referenced by _ftp_dispose(), and net_plugin_dispose().

## ◆ _x_tls_connect()

xine_tls_t * _x_tls_connect | ( | xine_t * | xine,
|  | xine_stream_t * | stream,
|  | const char * | host,
|  | int | port
| ) |  |

References _x_io_tcp_close(), _x_io_tcp_connect(), xine_tls::fd, NULL, xine_tls::stream, and xine_tls::xine.

Referenced by net_plugin_open().

## ◆ _x_tls_deinit()

void _x_tls_deinit | ( | xine_tls_t ** | pt | ) |

References _x_free_tls_plugin(), _x_freep(), _x_tls_shutdown(), xine_tls::fd, xine_tls::tls, and xine_tls::xine.

Referenced by http_close(), http_plugin_handshake(), and http_restart().

## ◆ _x_tls_get_verify_tls_cert()

int _x_tls_get_verify_tls_cert | ( | config_values_t * | config | ) |

References tls_get_verify_tls_cert().

Referenced by _ftp_connect().

## ◆ _x_tls_handshake()

int _x_tls_handshake | ( | xine_tls_t * | t,
|  | const char * | host,
|  | int | verify
| ) |  |

Initialize TLS

Parameters

  host | Host name to check certificate against (may be NULL ex. if numeric address).
  verify | verify certificate. 0 - no, 1 - yes, < 0 - fetch value from xine config.

Returns
  < 0 on error.

References _x_find_tls_plugin(), xine_tls::enabled, xine_tls::fd, tls_plugin_s::handshake, LOG_MODULE, xine_tls::stream, xine_tls::tls, xine_tls::xine, tls_plugin_params_t::xine, XINE_VERBOSITY_LOG, and xprintf.

Referenced by _auth_tls(), http_plugin_handshake(), and net_plugin_open().

## ◆ _x_tls_init()

xine_tls_t * _x_tls_init | ( | xine_t * | xine,
|  | xine_stream_t * | stream,
|  | int | fd
| ) |  |

References xine_tls::fd, NULL, xine_tls::stream, and xine_tls::xine.

Referenced by _ftp_connect(), and http_plugin_handshake().

## ◆ _x_tls_part_read()

ssize_t _x_tls_part_read | ( | xine_tls_t * | t,
|  | void * | buf,
|  | size_t | min,
|  | size_t | max
| ) |  |

References _x_io_tcp_part_read(), xine_tls::enabled, xine_tls::fd, tls_plugin_s::part_read, xine_tls::stream, and xine_tls::tls.

Referenced by sbuf_get_string().

## ◆ _x_tls_read()

ssize_t _x_tls_read | ( | xine_tls_t * | t,
|  | void * | buf,
|  | size_t | len
| ) |  |

References _x_io_tcp_read(), xine_tls::enabled, xine_tls::fd, tls_plugin_s::read, xine_tls::stream, and xine_tls::tls.

Referenced by _x_tls_read_line(), net_plugin_open(), net_plugin_read(), and sbuf_get_bytes().

## ◆ _x_tls_read_line()

ssize_t _x_tls_read_line | ( | xine_tls_t * | t,
|  | char * | buf,
|  | size_t | buf_size
| ) |  |

References _x_io_tcp_read_line(), _x_tls_read(), xine_tls::enabled, xine_tls::fd, and xine_tls::stream.

Referenced by _read_response().

## ◆ _x_tls_shutdown()

void _x_tls_shutdown | ( | xine_tls_t * | t | ) |

Shutdown TLS (stop encryption).

Underlying socket remains open.

References xine_tls::enabled, tls_plugin_s::shutdown, and xine_tls::tls.

Referenced by _x_tls_close(), and _x_tls_deinit().

## ◆ _x_tls_write()

ssize_t _x_tls_write | ( | xine_tls_t * | t,
|  | const void * | buf,
|  | size_t | len
| ) |  |

References _x_io_tcp_write(), xine_tls::enabled, xine_tls::fd, xine_tls::stream, xine_tls::tls, and tls_plugin_s::write.

Referenced by _write_command(), http_plugin_handshake(), and net_plugin_open().