Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef VLC_TLS_H
00023 # define VLC_TLS_H
00024
00025
00026
00027
00028
00029
00030 # include <vlc_network.h>
00031
00032 typedef struct vlc_tls_sys vlc_tls_sys_t;
00033
00034 typedef struct vlc_tls
00035 {
00036 VLC_COMMON_MEMBERS
00037
00038 union {
00039 module_t *module;
00040 void (*close) (struct vlc_tls *);
00041 } u;
00042 vlc_tls_sys_t *sys;
00043
00044 struct virtual_socket_t sock;
00045 int (*handshake) (struct vlc_tls *);
00046 } vlc_tls_t;
00047
00048 VLC_API vlc_tls_t *vlc_tls_ClientCreate (vlc_object_t *, int fd,
00049 const char *hostname);
00050 VLC_API void vlc_tls_ClientDelete (vlc_tls_t *);
00051
00052
00053 # define tls_Send( a, b, c ) (((vlc_tls_t *)a)->sock.pf_send (a, b, c))
00054
00055 # define tls_Recv( a, b, c ) (((vlc_tls_t *)a)->sock.pf_recv (a, b, c))
00056
00057
00058 typedef struct vlc_tls_creds_sys vlc_tls_creds_sys_t;
00059
00060
00061 typedef struct vlc_tls_creds
00062 {
00063 VLC_COMMON_MEMBERS
00064
00065 module_t *module;
00066 vlc_tls_creds_sys_t *sys;
00067
00068 int (*add_CA) (struct vlc_tls_creds *, const char *path);
00069 int (*add_CRL) (struct vlc_tls_creds *, const char *path);
00070
00071 vlc_tls_t *(*open) (struct vlc_tls_creds *, int fd);
00072 } vlc_tls_creds_t;
00073
00074 vlc_tls_creds_t *vlc_tls_ServerCreate (vlc_object_t *,
00075 const char *cert, const char *key);
00076 void vlc_tls_ServerDelete (vlc_tls_creds_t *);
00077 int vlc_tls_ServerAddCA (vlc_tls_creds_t *srv, const char *path);
00078 int vlc_tls_ServerAddCRL (vlc_tls_creds_t *srv, const char *path);
00079
00080 vlc_tls_t *vlc_tls_ServerSessionCreate (vlc_tls_creds_t *, int fd);
00081 int vlc_tls_ServerSessionHandshake (vlc_tls_t *);
00082 void vlc_tls_ServerSessionDelete (vlc_tls_t *);
00083
00084 #endif