All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
sctp.c File Reference

sctp url_protocol More...

#include <netinet/in.h>
#include <netinet/sctp.h>
#include "config.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/parseutils.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
#include "network.h"
#include "os_support.h"
#include "url.h"

Go to the source code of this file.

Data Structures

struct  SCTPContext


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


static int ff_sctp_recvmsg (int s, void *msg, size_t len, struct sockaddr *from, socklen_t *fromlen, struct sctp_sndrcvinfo *sinfo, int *msg_flags)
static int ff_sctp_send (int s, const void *msg, size_t len, const struct sctp_sndrcvinfo *sinfo, int flags)
static int sctp_open (URLContext *h, const char *uri, int flags)
static int sctp_wait_fd (int fd, int write)
static int sctp_read (URLContext *h, uint8_t *buf, int size)
static int sctp_write (URLContext *h, const uint8_t *buf, int size)
static int sctp_close (URLContext *h)
static int sctp_get_file_handle (URLContext *h)


static const AVOption options []
static const AVClass sctp_class
const URLProtocol ff_sctp_protocol

Detailed Description

sctp url_protocol

url syntax: sctp://host:port[?option=val...] option: 'listen' : listen for an incoming connection 'max_streams=n' : set the maximum number of streams 'reuse=1' : enable reusing the socket [TBD]

by setting the maximum number of streams the protocol will use the first two bytes of the incoming/outgoing buffer to store the stream number of the packet being read/written.

See Also

Definition in file sctp.c.

Macro Definition Documentation

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

Definition at line 160 of file sctp.c.

Definition at line 161 of file sctp.c.

Definition at line 162 of file sctp.c.

Function Documentation

static int ff_sctp_recvmsg ( int  s,
void msg,
size_t  len,
struct sockaddr *  from,
socklen_t *  fromlen,
struct sctp_sndrcvinfo *  sinfo,
int msg_flags 

Definition at line 74 of file sctp.c.

Referenced by sctp_read().

static int ff_sctp_send ( int  s,
const void msg,
size_t  len,
const struct sctp_sndrcvinfo *  sinfo,
int  flags 

Definition at line 116 of file sctp.c.

Referenced by sctp_write().

static int sctp_open ( URLContext h,
const char *  uri,
int  flags 

Definition at line 178 of file sctp.c.

static int sctp_wait_fd ( int  fd,
int  write 

Definition at line 290 of file sctp.c.

Referenced by sctp_read(), and sctp_write().

static int sctp_read ( URLContext h,
uint8_t buf,
int  size 

Definition at line 300 of file sctp.c.

static int sctp_write ( URLContext h,
const uint8_t buf,
int  size 

Definition at line 323 of file sctp.c.

static int sctp_close ( URLContext h)

Definition at line 349 of file sctp.c.

static int sctp_get_file_handle ( URLContext h)

Definition at line 356 of file sctp.c.

Variable Documentation

const AVOption options[]
Initial value:
= {
{ "listen", "Listen for incoming connections", OFFSET(listen), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, .flags = D|E },
{ "timeout", "Connection timeout (in milliseconds)", OFFSET(timeout), AV_OPT_TYPE_INT, { .i64 = 10000 }, INT_MIN, INT_MAX, .flags = D|E },
{ "listen_timeout", "Bind timeout (in milliseconds)", OFFSET(listen_timeout), AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, .flags = D|E },
{ "max_streams", "Max stream to allocate", OFFSET(max_streams), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT16_MAX, .flags = D|E },
{ NULL }
#define NULL
Definition: coverity.c:32
#define D
Definition: sctp.c:161
#define E
Definition: sctp.c:162
#define OFFSET(x)
Definition: sctp.c:160

Definition at line 163 of file sctp.c.

const AVClass sctp_class
Initial value:
= {
.class_name = "sctp",
.item_name = av_default_item_name,
.option = options,
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: sctp.c:163

Definition at line 171 of file sctp.c.

const URLProtocol ff_sctp_protocol
Initial value:
= {
.name = "sctp",
.url_open = sctp_open,
.url_read = sctp_read,
.url_write = sctp_write,
.url_close = sctp_close,
.url_get_file_handle = sctp_get_file_handle,
.priv_data_size = sizeof(SCTPContext),
.priv_data_class = &sctp_class,
Definition: url.h:34
static const AVClass sctp_class
Definition: sctp.c:171
static int sctp_write(URLContext *h, const uint8_t *buf, int size)
Definition: sctp.c:323
#define flags(name, subs,...)
Definition: cbs_h2645.c:263
static int sctp_close(URLContext *h)
Definition: sctp.c:349
static int sctp_get_file_handle(URLContext *h)
Definition: sctp.c:356
static int sctp_open(URLContext *h, const char *uri, int flags)
Definition: sctp.c:178
static int sctp_read(URLContext *h, uint8_t *buf, int size)
Definition: sctp.c:300

Definition at line 362 of file sctp.c.