92 ssize_t (*
readv)(
struct vlc_tls *,
struct iovec *iov,
unsigned len);
106 ssize_t (*
writev)(
struct vlc_tls *,
const struct iovec *iov,
unsigned len);
149 const char *host,
const char *
const *alpn);
151 const char *hostname,
const char *service,
200 const char *
const *alpn,
228 const char *
const *alpn);
273 const char *
const *alpn);
405 while (session != NULL);
470 const char *hostname,
unsigned port);
482 const char *hostname,
unsigned port,
484 const char *
const *alpn,
char **alp);
#define VLC_API
Definition: fourcc_gen.c:31
void vlc_tls_ClientDelete(vlc_tls_client_t *)
Releases TLS client-side credentials.
Definition: tls.c:123
struct vlc_tls_client vlc_tls_client_t
TLS client-side credentials.
vlc_tls_client_t * vlc_tls_ClientCreate(vlc_object_t *)
Allocates TLS client-side credentials.
Definition: tls.c:94
vlc_tls_t * vlc_tls_ClientSessionCreate(vlc_tls_client_t *creds, vlc_tls_t *sock, const char *host, const char *service, const char *const *alpn, char **alp)
Initiates a client TLS session.
Definition: tls.c:150
struct vlc_tls_server vlc_tls_server_t
TLS server-side credentials.
static int vlc_tls_SessionHandshake(vlc_tls_server_t *crd, vlc_tls_t *tls)
Definition: vlc_tls.h:247
vlc_tls_server_t * vlc_tls_ServerCreate(vlc_object_t *, const char *cert, const char *key)
Allocates server TLS credentials.
Definition: tls.c:51
vlc_tls_t * vlc_tls_ServerSessionCreate(vlc_tls_server_t *creds, vlc_tls_t *sock, const char *const *alpn)
Creates a TLS server session.
Definition: tls.c:206
void vlc_tls_ServerDelete(vlc_tls_server_t *)
Releases server-side TLS credentials.
Definition: tls.c:84
ssize_t vlc_tls_Read(vlc_tls_t *, void *buf, size_t len, bool waitall)
Receives data through a socket.
Definition: stream.c:53
vlc_tls_t * vlc_tls_SocketOpenTCP(vlc_object_t *obj, const char *hostname, unsigned port)
Creates a transport-layer TCP stream from a name and port.
Definition: stream.c:431
vlc_tls_t * vlc_tls_SocketOpenAddrInfo(const struct addrinfo *ai, bool defer_connect)
Creates a transport-layer stream from a struct addrinfo.
char * vlc_tls_GetLine(vlc_tls_t *)
Receives a text line through a socket.
Definition: stream.c:133
vlc_tls_t * vlc_tls_SocketOpen(int fd)
Creates a transport-layer stream from a socket.
Definition: stream.c:252
void vlc_tls_SessionDelete(vlc_tls_t *)
Destroys a TLS session.
Definition: tls.c:136
static int vlc_tls_GetFD(vlc_tls_t *tls)
Returns the underlying file descriptor.
Definition: vlc_tls.h:325
ssize_t vlc_tls_Write(vlc_tls_t *, const void *buf, size_t len)
Sends data through a socket.
Definition: stream.c:94
int vlc_tls_SocketPair(int family, int protocol, vlc_tls_t *[2])
Creates a connected pair of transport-layer sockets.
Definition: stream.c:257
vlc_tls_t * vlc_tls_SocketOpenTLS(vlc_tls_client_t *crd, const char *hostname, unsigned port, const char *service, const char *const *alpn, char **alp)
Initiates a TLS session over TCP.
Definition: tls.c:218
static void vlc_tls_Close(vlc_tls_t *session)
Closes a connection and its underlying resources.
Definition: vlc_tls.h:397
static int vlc_tls_GetPollFD(vlc_tls_t *tls, short *events)
Generates an event polling description.
Definition: vlc_tls.h:314
struct vlc_tls vlc_tls_t
Transport layer socket.
static int vlc_tls_Shutdown(vlc_tls_t *tls, bool duplex)
Shuts a connection down.
Definition: vlc_tls.h:381
VLC object common members.
Definition: vlc_objects.h:45
Definition: vlc_tls.h:148
void(* destroy)(struct vlc_tls_client *)
Definition: vlc_tls.h:154
int(* handshake)(vlc_tls_t *session, const char *hostname, const char *service, char **alp)
Definition: vlc_tls.h:151
TLS client-side credentials.
Definition: vlc_tls.h:141
void * sys
Definition: vlc_tls.h:144
const struct vlc_tls_client_operations * ops
Definition: vlc_tls.h:143
struct vlc_object_t obj
Definition: vlc_tls.h:142
ssize_t(* writev)(struct vlc_tls *, const struct iovec *iov, unsigned len)
Callback for sending data.
Definition: vlc_tls.h:107
void(* close)(struct vlc_tls *)
Callback for closing.
Definition: vlc_tls.h:123
int(* get_fd)(struct vlc_tls *, short *restrict events)
Callback for events polling.
Definition: vlc_tls.h:79
ssize_t(* readv)(struct vlc_tls *, struct iovec *iov, unsigned len)
Callback for receiving data.
Definition: vlc_tls.h:93
int(* shutdown)(struct vlc_tls *, bool duplex)
Callback for shutting down.
Definition: vlc_tls.h:115
Definition: vlc_tls.h:227
int(* handshake)(vlc_tls_t *session, char **alp)
Definition: vlc_tls.h:230
void(* destroy)(struct vlc_tls_server *)
Definition: vlc_tls.h:231
TLS server-side credentials.
Definition: vlc_tls.h:219
struct vlc_object_t obj
Definition: vlc_tls.h:220
void * sys
Definition: vlc_tls.h:222
const struct vlc_tls_server_operations * ops
Definition: vlc_tls.h:221
Transport layer socket.
Definition: vlc_tls.h:66
struct vlc_tls * p
Reserved.
Definition: vlc_tls.h:70
const struct vlc_tls_operations * ops
Callbacks to operate on the stream.
Definition: vlc_tls.h:68
This file is a collection of common definitions and types.
Definitions for sockets and low-level networking.