FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
tls_openssl.c File Reference
#include "avformat.h"
#include "internal.h"
#include "network.h"
#include "os_support.h"
#include "url.h"
#include "tls.h"
#include "libavcodec/internal.h"
#include "libavutil/avstring.h"
#include "libavutil/avutil.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/thread.h"
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

Go to the source code of this file.

Data Structures

struct  TLSContext
 

Functions

int ff_openssl_init (void)
 
void ff_openssl_deinit (void)
 
static int print_tls_error (URLContext *h, int ret)
 
static int tls_close (URLContext *h)
 
static int url_bio_create (BIO *b)
 
static int url_bio_destroy (BIO *b)
 
static int url_bio_bread (BIO *b, char *buf, int len)
 
static int url_bio_bwrite (BIO *b, const char *buf, int len)
 
static long url_bio_ctrl (BIO *b, int cmd, long num, void *ptr)
 
static int url_bio_bputs (BIO *b, const char *str)
 
static int tls_open (URLContext *h, const char *uri, int flags, AVDictionary **options)
 
static int tls_read (URLContext *h, uint8_t *buf, int size)
 
static int tls_write (URLContext *h, const uint8_t *buf, int size)
 

Variables

static int openssl_init
 
static BIO_METHOD url_bio_method
 
static const AVOption options []
 
static const AVClass tls_class
 
URLProtocol ff_tls_openssl_protocol
 

Function Documentation

int ff_openssl_init ( void  )

Definition at line 66 of file tls_openssl.c.

Referenced by ff_tls_init(), and tls_open().

void ff_openssl_deinit ( void  )

Definition at line 96 of file tls_openssl.c.

Referenced by ff_tls_deinit(), and tls_close().

static int print_tls_error ( URLContext h,
int  ret 
)
static

Definition at line 114 of file tls_openssl.c.

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

static int tls_close ( URLContext h)
static

Definition at line 120 of file tls_openssl.c.

Referenced by tls_open().

static int url_bio_create ( BIO *  b)
static

Definition at line 135 of file tls_openssl.c.

static int url_bio_destroy ( BIO *  b)
static

Definition at line 143 of file tls_openssl.c.

static int url_bio_bread ( BIO *  b,
char *  buf,
int  len 
)
static

Definition at line 148 of file tls_openssl.c.

static int url_bio_bwrite ( BIO *  b,
const char *  buf,
int  len 
)
static

Definition at line 160 of file tls_openssl.c.

Referenced by url_bio_bputs().

static long url_bio_ctrl ( BIO *  b,
int  cmd,
long  num,
void ptr 
)
static

Definition at line 172 of file tls_openssl.c.

static int url_bio_bputs ( BIO *  b,
const char *  str 
)
static

Definition at line 181 of file tls_openssl.c.

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

Definition at line 198 of file tls_openssl.c.

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

Definition at line 264 of file tls_openssl.c.

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

Definition at line 275 of file tls_openssl.c.

Variable Documentation

int openssl_init
static

Definition at line 39 of file tls_openssl.c.

Referenced by ff_openssl_deinit(), and ff_openssl_init().

BIO_METHOD url_bio_method
static
Initial value:
= {
.type = BIO_TYPE_SOURCE_SINK,
.name = "urlprotocol bio",
.bwrite = url_bio_bwrite,
.bread = url_bio_bread,
.bputs = url_bio_bputs,
.bgets = NULL,
.ctrl = url_bio_ctrl,
.create = url_bio_create,
.destroy = url_bio_destroy,
}
#define NULL
Definition: coverity.c:32
static int url_bio_bwrite(BIO *b, const char *buf, int len)
Definition: tls_openssl.c:160
static int url_bio_bread(BIO *b, char *buf, int len)
Definition: tls_openssl.c:148
static int url_bio_bputs(BIO *b, const char *str)
Definition: tls_openssl.c:181
static int url_bio_destroy(BIO *b)
Definition: tls_openssl.c:143
static long url_bio_ctrl(BIO *b, int cmd, long num, void *ptr)
Definition: tls_openssl.c:172
static int url_bio_create(BIO *b)
Definition: tls_openssl.c:135

Definition at line 186 of file tls_openssl.c.

const AVOption options[]
static
Initial value:
= {
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define TLS_COMMON_OPTIONS(pstruct, options_field)
Definition: tls.h:47

Definition at line 286 of file tls_openssl.c.

const AVClass tls_class
static
Initial value:
= {
.class_name = "tls",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:62
av_default_item_name
static const AVOption options[]
Definition: tls_openssl.c:286

Definition at line 291 of file tls_openssl.c.

URLProtocol ff_tls_openssl_protocol
Initial value:
= {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
.url_write = tls_write,
.url_close = tls_close,
.priv_data_size = sizeof(TLSContext),
.priv_data_class = &tls_class,
}
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:35
static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **options)
Definition: tls_openssl.c:198
static const AVClass tls_class
Definition: tls_openssl.c:291
static int tls_write(URLContext *h, const uint8_t *buf, int size)
Definition: tls_openssl.c:275
static int tls_read(URLContext *h, uint8_t *buf, int size)
Definition: tls_openssl.c:264
static int tls_close(URLContext *h)
Definition: tls_openssl.c:120
static int flags
Definition: cpu.c:47

Definition at line 298 of file tls_openssl.c.