]> git.sesse.net Git - vlc/blobdiff - include/vlc_tls.h
* modules/audio_output/directx.c: backport of directx audio changes (13374). Needs...
[vlc] / include / vlc_tls.h
index 2982f9553317f1533e15b546ca45230ee193cdda..b9ef4afb88cfcf7af4c80b1de00d404813c8bab7 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * tls.c
  *****************************************************************************
- * Copyright (C) 2004 VideoLAN
- * $Id: httpd.c 8263 2004-07-24 09:06:58Z courmisch $
+ * Copyright (C) 2004-2005 the VideoLAN team
+ * $Id$
  *
- * Authors: Remi Denis-Courmont <courmisch@via.ecp.fr>
+ * Authors: Remi Denis-Courmont <rem # videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -34,13 +34,15 @@ struct tls_t
     module_t  *p_module;
     void *p_sys;
 
-    tls_server_t * (*pf_server_create) ( tls_t *, const char *, const char * );
-    tls_session_t * (*pf_client_create) ( tls_t *, const char * );
+    tls_server_t * (*pf_server_create) ( tls_t *, const char *,
+                                         const char * );
+    tls_session_t * (*pf_client_create) ( tls_t * );
 };
 
 struct tls_server_t
 {
-    tls_t *p_tls;
+    VLC_COMMON_MEMBERS
+
     void *p_sys;
 
     void (*pf_delete) ( tls_server_t * );
@@ -53,13 +55,12 @@ struct tls_server_t
 
 struct tls_session_t
 {
-    tls_t *p_tls;
-    tls_server_t *p_server;
+    VLC_COMMON_MEMBERS
 
     void *p_sys;
 
     struct virtual_socket_t sock;
-    int (*pf_handshake) ( tls_session_t *, int );
+    int (*pf_handshake) ( tls_session_t *, int, const char * );
     int (*pf_handshake2) ( tls_session_t * );
     void (*pf_close) ( tls_session_t * );
 };
@@ -71,7 +72,6 @@ struct tls_session_t
  * Allocates a whole server's TLS credentials.
  * Returns NULL on error.
  *****************************************************************************/
-# define __tls_ServerCreate( a, b, c ) (((tls_t *)a)->pf_server_create (a, b, c))
 VLC_EXPORT( tls_server_t *, tls_ServerCreate, ( vlc_object_t *, const char *, const char * ) );
 
 /*****************************************************************************
@@ -92,20 +92,20 @@ VLC_EXPORT( tls_server_t *, tls_ServerCreate, ( vlc_object_t *, const char *, co
 # define tls_ServerAddCRL( a, b ) (((tls_server_t *)a)->pf_add_CRL (a, b))
 
 
-# define __tls_ServerDelete( a ) (((tls_server_t *)a)->pf_delete ( a ))
 VLC_EXPORT( void, tls_ServerDelete, ( tls_server_t * ) );
 
 
 # define tls_ServerSessionPrepare( a ) (((tls_server_t *)a)->pf_session_prepare (a))
+# define tls_ServerSessionHandshake( a, b ) (((tls_session_t *)a)->pf_handshake (a, b, NULL))
+# define tls_ServerSessionClose( a ) (((tls_session_t *)a)->pf_close (a))
 
-# define __tls_ClientCreate( a, b ) (((tls_t *)a)->pf_client_create (a, b ))
-VLC_EXPORT( tls_session_t *, tls_ClientCreate, ( vlc_object_t *, const char *, int ) );
+VLC_EXPORT( tls_session_t *, tls_ClientCreate, ( vlc_object_t *, int, const char * ) );
 VLC_EXPORT( void, tls_ClientDelete, ( tls_session_t * ) );
 
-# define tls_SessionHandshake( a, b ) (((tls_session_t *)a)->pf_handshake (a, b))
+# define tls_ClientSessionHandshake( a, b, c ) (((tls_session_t *)a)->pf_handshake (a, b, c))
+
 # define tls_SessionContinueHandshake( a ) (((tls_session_t *)a)->pf_handshake2 (a))
 
-# define tls_SessionClose( a ) (((tls_session_t *)a)->pf_close (a))
 
 /* NOTE: It is assumed that a->sock.p_sys = a */
 # define tls_Send( a, b, c ) (((tls_session_t *)a)->sock.pf_send (a, b, c ))