78 int (*get_fd)(
struct vlc_tls *,
short *events);
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);
114 int (*shutdown)(
struct vlc_tls *,
bool duplex);
122 void (*close)(
struct vlc_tls *);
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);
229 int (*handshake)(
vlc_tls_t *session,
char ** alp);
273 const char *
const *alpn);
405 while (session != NULL);
466 const char *hostname,
unsigned port);
478 const char *hostname,
unsigned port,
480 const char *
const *alpn,
char **alp);
vlc_tls_client_t * vlc_tls_ClientCreate(vlc_object_t *)
Allocates TLS client-side credentials.
Definition: tls.c:108
vlc_tls_t * vlc_tls_SocketOpenAddrInfo(const struct addrinfo *ai, bool defer_connect)
Creates a transport-layer stream from a struct addrinfo.
vlc_tls_server_t * vlc_tls_ServerCreate(vlc_object_t *, const char *cert, const char *key)
Allocates server TLS credentials.
Definition: tls.c:76
void vlc_tls_SessionDelete(vlc_tls_t *)
Destroys a TLS session.
Definition: tls.c:139
struct vlc_tls_client vlc_tls_client_t
TLS client-side credentials.
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
int(* shutdown)(struct vlc_tls *, bool duplex)
Callback for shutting down.
Definition: vlc_tls.h:115
TLS client-side credentials.
Definition: vlc_tls.h:140
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:153
ssize_t vlc_tls_Read(vlc_tls_t *, void *buf, size_t len, bool waitall)
Receives data through a socket.
Definition: stream.c:53
Definition: vlc_tls.h:226
struct vlc_tls_server vlc_tls_server_t
TLS server-side credentials.
const struct vlc_tls_server_operations * ops
Definition: vlc_tls.h:221
static int vlc_tls_GetFD(vlc_tls_t *tls)
Returns the underlying file descriptor.
Definition: vlc_tls.h:325
void vlc_tls_ServerDelete(vlc_tls_server_t *)
Releases server-side TLS credentials.
Definition: tls.c:98
char * vlc_tls_GetLine(vlc_tls_t *)
Receives a text line through a socket.
Definition: stream.c:133
Transport layer socket.
Definition: vlc_tls.h:65
int vlc_tls_SocketPair(int family, int protocol, vlc_tls_t *[2])
Creates a connected pair of transport-layer sockets.
Definition: stream.c:255
static int vlc_tls_GetPollFD(vlc_tls_t *tls, short *events)
Generates an event polling description.
Definition: vlc_tls.h:314
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:221
static void vlc_tls_Close(vlc_tls_t *session)
Closes a connection and its underlying resources.
Definition: vlc_tls.h:397
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:209
Definitions for sockets and low-level networking.
int(* get_fd)(struct vlc_tls *, short *events)
Callback for events polling.
Definition: vlc_tls.h:79
TLS server-side credentials.
Definition: vlc_tls.h:218
#define VLC_API
Definition: fourcc_gen.c:31
static int vlc_tls_Shutdown(vlc_tls_t *tls, bool duplex)
Shuts a connection down.
Definition: vlc_tls.h:381
ssize_t vlc_tls_Write(vlc_tls_t *, const void *buf, size_t len)
Sends data through a socket.
Definition: stream.c:94
vlc_tls_t * vlc_tls_SocketOpen(int fd)
Creates a transport-layer stream from a socket.
Definition: stream.c:250
Definition: vlc_tls.h:147
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:429
struct vlc_tls vlc_tls_t
Transport layer socket.
VLC object common members.
Definition: vlc_objects.h:43
void vlc_tls_ClientDelete(vlc_tls_client_t *)
Releases TLS client-side credentials.
Definition: tls.c:126
int(* handshake)(vlc_tls_t *session, char **alp)
Definition: vlc_tls.h:230
static int vlc_tls_SessionHandshake(vlc_tls_server_t *crd, vlc_tls_t *tls)
Definition: vlc_tls.h:247