add rtp port allocator

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6658 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-12-11 19:15:02 +00:00
parent 4968e0f6a1
commit efb1b62938
9 changed files with 194 additions and 50 deletions
+5 -3
View File
@@ -216,14 +216,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
\return SWITCH_STATUS_SUCCESS if the operation was a success
*/
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_new(switch_port_t start,
switch_port_t end, uint8_t inc, switch_core_port_allocator_t **new_allocator);
switch_port_t end, switch_port_flag_t flags, switch_core_port_allocator_t **new_allocator);
/*!
\brief Get a port from the port allocator
\param alloc the allocator object
\return the port
\param port a pointer to the port
\return SUCCESS
*/
SWITCH_DECLARE(switch_port_t) switch_core_port_allocator_request_port(switch_core_port_allocator_t *alloc);
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_request_port(switch_core_port_allocator_t *alloc, switch_port_t *port_ptr);
SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_free_port(switch_core_port_allocator_t *alloc, switch_port_t port);
/*!
\brief destroythe port allocator
+3 -1
View File
@@ -53,6 +53,7 @@ typedef void (*switch_rtp_invalid_handler_t) (switch_rtp_t *rtp_session,
\note Generally called by the core_init
*/
SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool);
SWITCH_DECLARE(void) switch_rtp_shutdown(void);
/*!
\brief Set/Get RTP start port
@@ -70,9 +71,10 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_set_end_port(switch_port_t port);
/*!
\brief Request a new port to be used for media
\param ip the ip to request a port from
\return the new port to use
*/
SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void);
SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(const char *ip);
/*!
\brief create a new RTP session handle
+6
View File
@@ -136,6 +136,12 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_BITS_PER_BYTE 8
typedef uint8_t switch_byte_t;
typedef enum {
SPF_NONE = 0,
SPF_ODD = (1 << 0),
SPF_EVEN = (1 << 1)
} switch_port_flag_t;
typedef enum {
ED_MUX_READ = (1 << 0),
ED_MUX_WRITE = (1 << 1),