FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
tls_mbedtls.c File Reference
#include <mbedtls/certs.h>
#include <mbedtls/config.h>
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/entropy.h>
#include <mbedtls/net_sockets.h>
#include <mbedtls/platform.h>
#include <mbedtls/ssl.h>
#include <mbedtls/x509_crt.h>
#include "avformat.h"
#include "internal.h"
#include "url.h"
#include "tls.h"
#include "libavutil/parseutils.h"

Go to the source code of this file.

Data Structures

struct  TLSContext
 

Macros

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

Functions

static int tls_close (URLContext *h)
 
static int handle_transport_error (URLContext *h, const char *func_name, int react_on_eagain, int ret)
 
static int mbedtls_send (void *ctx, const unsigned char *buf, size_t len)
 
static int mbedtls_recv (void *ctx, unsigned char *buf, size_t len)
 
static void handle_pk_parse_error (URLContext *h, int ret)
 
static void handle_handshake_error (URLContext *h, int ret)
 
static void parse_options (TLSContext *tls_ctxc, const char *uri)
 
static int tls_open (URLContext *h, const char *uri, int flags, AVDictionary **options)
 
static int handle_tls_error (URLContext *h, const char *func_name, int ret)
 
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_get_file_handle (URLContext *h)
 

Variables

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

Macro Definition Documentation

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

Definition at line 50 of file tls_mbedtls.c.

Function Documentation

static int tls_close ( URLContext h)
static

Definition at line 52 of file tls_mbedtls.c.

Referenced by tls_open().

static int handle_transport_error ( URLContext h,
const char *  func_name,
int  react_on_eagain,
int  ret 
)
static

Definition at line 68 of file tls_mbedtls.c.

Referenced by mbedtls_recv(), and mbedtls_send().

static int mbedtls_send ( void ctx,
const unsigned char *  buf,
size_t  len 
)
static

Definition at line 85 of file tls_mbedtls.c.

Referenced by tls_open().

static int mbedtls_recv ( void ctx,
unsigned char *  buf,
size_t  len 
)
static

Definition at line 98 of file tls_mbedtls.c.

Referenced by tls_open().

static void handle_pk_parse_error ( URLContext h,
int  ret 
)
static

Definition at line 111 of file tls_mbedtls.c.

Referenced by tls_open().

static void handle_handshake_error ( URLContext h,
int  ret 
)
static

Definition at line 129 of file tls_mbedtls.c.

Referenced by tls_open().

static void parse_options ( TLSContext tls_ctxc,
const char *  uri 
)
static

Definition at line 150 of file tls_mbedtls.c.

Referenced by tls_open().

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

Definition at line 161 of file tls_mbedtls.c.

static int handle_tls_error ( URLContext h,
const char *  func_name,
int  ret 
)
static

Definition at line 277 of file tls_mbedtls.c.

Referenced by tls_read(), and tls_write().

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

Definition at line 296 of file tls_mbedtls.c.

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

Definition at line 309 of file tls_mbedtls.c.

static int tls_get_file_handle ( URLContext h)
static

Definition at line 322 of file tls_mbedtls.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{"key_password", "Password for the private key file", OFFSET(priv_key_pw), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define TLS_OPTFL
Definition: tls.h:44
#define OFFSET(x)
Definition: tls_mbedtls.c:50
#define TLS_COMMON_OPTIONS(pstruct, options_field)
Definition: tls.h:45

Definition at line 328 of file tls_mbedtls.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:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption options[]
Definition: tls_mbedtls.c:328

Definition at line 334 of file tls_mbedtls.c.

const URLProtocol ff_tls_protocol
Initial value:
= {
.name = "tls",
.url_open2 = tls_open,
.url_read = tls_read,
.url_write = tls_write,
.url_close = tls_close,
.url_get_file_handle = tls_get_file_handle,
.priv_data_size = sizeof(TLSContext),
.priv_data_class = &tls_class,
}
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:34
static int tls_read(URLContext *h, uint8_t *buf, int size)
Definition: tls_mbedtls.c:296
static int tls_get_file_handle(URLContext *h)
Definition: tls_mbedtls.c:322
static int tls_write(URLContext *h, const uint8_t *buf, int size)
Definition: tls_mbedtls.c:309
static const AVClass tls_class
Definition: tls_mbedtls.c:334
static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **options)
Definition: tls_mbedtls.c:161
static int tls_close(URLContext *h)
Definition: tls_mbedtls.c:52
#define flags(name, subs,...)
Definition: cbs_av1.c:596

Definition at line 341 of file tls_mbedtls.c.