[Freeswitch-svn] [commit] r13426 - in freeswitch/trunk/src: . include

FreeSWITCH SVN anthm at freeswitch.org
Fri May 22 11:19:55 PDT 2009


Author: anthm
Date: Fri May 22 13:19:55 2009
New Revision: 13426

Log:
add some stuff for zrtp

Modified:
   freeswitch/trunk/src/include/switch_core.h
   freeswitch/trunk/src/include/switch_frame.h
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/switch_core_memory.c
   freeswitch/trunk/src/switch_core_session.c

Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h	(original)
+++ freeswitch/trunk/src/include/switch_core.h	Fri May 22 13:19:55 2009
@@ -448,6 +448,11 @@
 */
 #define switch_core_destroy_memory_pool(p) switch_core_perform_destroy_memory_pool(p, __FILE__, __SWITCH_FUNC__, __LINE__)
 
+
+SWITCH_DECLARE(void) switch_core_memory_pool_set_data(switch_memory_pool_t *pool, const char *key, void *data);
+SWITCH_DECLARE(void *) switch_core_memory_pool_get_data(switch_memory_pool_t *pool, const char *key);
+
+
 /*! 
   \brief Start the session's state machine
   \param session the session on which to start the state machine

Modified: freeswitch/trunk/src/include/switch_frame.h
==============================================================================
--- freeswitch/trunk/src/include/switch_frame.h	(original)
+++ freeswitch/trunk/src/include/switch_frame.h	Fri May 22 13:19:55 2009
@@ -46,9 +46,11 @@
 	/*! the originating source of the frame */
 	const char *source;
 	/*! the raw packet */
-	void *packet;
+	void *packet;	
 	/*! the size of the raw packet when applicable */
 	uint32_t packetlen;
+	/*! the extra frame data */
+	void *extra_data;
 	/*! the frame data */
 	void *data;
 	/*! the size of the buffer that is in use */

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Fri May 22 13:19:55 2009
@@ -920,7 +920,8 @@
 	SFF_PLC = (1 << 3),
 	SFF_RFC2833 = (1 << 4),
 	SFF_PROXY_PACKET = (1 << 5),
-	SFF_DYNAMIC = (1 << 6)
+	SFF_DYNAMIC = (1 << 6),
+	SFF_ZRTP = (1 << 7)
 } switch_frame_flag_enum_t;
 typedef uint32_t switch_frame_flag_t;
 

Modified: freeswitch/trunk/src/switch_core_memory.c
==============================================================================
--- freeswitch/trunk/src/switch_core_memory.c	(original)
+++ freeswitch/trunk/src/switch_core_memory.c	Fri May 22 13:19:55 2009
@@ -304,6 +304,20 @@
 	return duped;
 }
 
+SWITCH_DECLARE(void) switch_core_memory_pool_set_data(switch_memory_pool_t *pool, const char *key, void *data)
+{
+	apr_pool_userdata_set(data, key, NULL, pool);
+}
+
+SWITCH_DECLARE(void *) switch_core_memory_pool_get_data(switch_memory_pool_t *pool, const char *key)
+{
+	void *data = NULL;
+
+	apr_pool_userdata_get(&data, key, pool);
+
+	return data;
+}
+
 SWITCH_DECLARE(void) switch_core_memory_pool_tag(switch_memory_pool_t *pool, const char *tag)
 {
 	apr_pool_tag(pool, tag);

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Fri May 22 13:19:55 2009
@@ -1206,6 +1206,8 @@
 
 	session = switch_core_alloc(usepool, sizeof(*session));
 	session->pool = usepool;
+
+	switch_core_memory_pool_set_data(session->pool, "__session", session);
 	
 	if (switch_channel_alloc(&session->channel, direction, session->pool) != SWITCH_STATUS_SUCCESS) {
 		abort();



More information about the Freeswitch-svn mailing list