vlc_tls.h
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
00023
00024 #ifndef VLC_TLS_H
00025 # define VLC_TLS_H
00026
00027
00028
00029
00030
00031
00032 # include <vlc_network.h>
00033
00034 typedef struct tls_server_sys_t tls_server_sys_t;
00035
00036 struct tls_server_t
00037 {
00038 VLC_COMMON_MEMBERS
00039
00040 module_t *p_module;
00041 tls_server_sys_t *p_sys;
00042
00043 int (*pf_add_CA) ( tls_server_t *, const char * );
00044 int (*pf_add_CRL) ( tls_server_t *, const char * );
00045
00046 tls_session_t * (*pf_open) ( tls_server_t * );
00047 void (*pf_close) ( tls_server_t *, tls_session_t * );
00048 };
00049
00050 typedef struct tls_session_sys_t tls_session_sys_t;
00051
00052 struct tls_session_t
00053 {
00054 VLC_COMMON_MEMBERS
00055
00056 module_t *p_module;
00057 tls_session_sys_t *p_sys;
00058
00059 struct virtual_socket_t sock;
00060 void (*pf_set_fd) ( tls_session_t *, int );
00061 int (*pf_handshake) ( tls_session_t * );
00062 };
00063
00064
00065 tls_server_t *tls_ServerCreate (vlc_object_t *, const char *, const char *);
00066 void tls_ServerDelete (tls_server_t *);
00067 int tls_ServerAddCA (tls_server_t *srv, const char *path);
00068 int tls_ServerAddCRL (tls_server_t *srv, const char *path);
00069
00070 tls_session_t *tls_ServerSessionPrepare (tls_server_t *);
00071 int tls_ServerSessionHandshake (tls_session_t *, int fd);
00072 int tls_SessionContinueHandshake (tls_session_t *);
00073 void tls_ServerSessionClose (tls_session_t *);
00074
00075 VLC_EXPORT( tls_session_t *, tls_ClientCreate, ( vlc_object_t *, int, const char * ) );
00076 VLC_EXPORT( void, tls_ClientDelete, ( tls_session_t * ) );
00077
00078
00079 # define tls_Send( a, b, c ) (((tls_session_t *)a)->sock.pf_send (a, b, c ))
00080
00081 # define tls_Recv( a, b, c ) (((tls_session_t *)a)->sock.pf_recv (a, b, c ))
00082
00083 #endif