FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
tls.c File Reference
#include "avformat.h"
#include "url.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "network.h"
#include "os_support.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  TLSContext
 

Macros

#define OFFSET(x)   offsetof(TLSContext, x)
 
#define D   AV_OPT_FLAG_DECODING_PARAM
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int do_tls_poll (URLContext *h, int ret)
 
static void set_options (URLContext *h, const char *uri)
 
static int tls_open (URLContext *h, const char *uri, int flags)
 
static int tls_read (URLContext *h, uint8_t *buf, int size)
 
static int tls_write (URLContext *h, const uint8_t *buf, int size)
 
static int tls_close (URLContext *h)
 

Variables

static const AVOption options []
 
static const AVClass tls_class
 
URLProtocol ff_tls_protocol
 

Macro Definition Documentation

#define OFFSET (   x)    offsetof(TLSContext, x)

Definition at line 78 of file tls.c.

Definition at line 79 of file tls.c.

Definition at line 80 of file tls.c.

Function Documentation

static int do_tls_poll ( URLContext h,
int  ret 
)
static

Definition at line 98 of file tls.c.

Referenced by tls_open(), tls_read(), and tls_write().

static void set_options ( URLContext h,
const char *  uri 
)
static

Definition at line 141 of file tls.c.

Referenced by tls_open().

static int tls_open ( URLContext h,
const char *  uri,
int  flags 
)
static

Definition at line 166 of file tls.c.

static int tls_read ( URLContext h,
uint8_t buf,
int  size 
)
static

Definition at line 347 of file tls.c.

static int tls_write ( URLContext h,
const uint8_t buf,
int  size 
)
static

Definition at line 362 of file tls.c.

static int tls_close ( URLContext h)
static

Definition at line 377 of file tls.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{"ca_file", "Certificate Authority database file", OFFSET(ca_file), AV_OPT_TYPE_STRING, .flags = D|E },
{"cafile", "Certificate Authority database file", OFFSET(ca_file), AV_OPT_TYPE_STRING, .flags = D|E },
{"tls_verify", "Verify the peer certificate", OFFSET(verify), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = D|E },
{"cert_file", "Certificate file", OFFSET(cert_file), AV_OPT_TYPE_STRING, .flags = D|E },
{"key_file", "Private key file", OFFSET(key_file), AV_OPT_TYPE_STRING, .flags = D|E },
{"listen", "Listen for incoming connections", OFFSET(listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = D|E },
{ NULL }
}

Definition at line 81 of file tls.c.

const AVClass tls_class
static
Initial value:
= {
.class_name = "tls",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 91 of file tls.c.

URLProtocol ff_tls_protocol
Initial value:
= {
.name = "tls",
.url_open = tls_open,
.url_read = tls_read,
.url_write = tls_write,
.url_close = tls_close,
.priv_data_size = sizeof(TLSContext),
.priv_data_class = &tls_class,
}

Definition at line 387 of file tls.c.