RTS API Documentation  1.10.11
Functions
Port Allocation
+ Collaboration diagram for Port Allocation:

Functions

switch_status_t switch_core_port_allocator_new (_In_ const char *ip, _In_ switch_port_t start, _In_ switch_port_t end, _In_ switch_port_flag_t flags, _Out_ switch_core_port_allocator_t **new_allocator)
 Initilize the port allocator. More...
 
switch_status_t switch_core_port_allocator_request_port (_In_ switch_core_port_allocator_t *alloc, _Out_ switch_port_t *port_ptr)
 Get a port from the port allocator. More...
 
switch_status_t switch_core_port_allocator_free_port (_In_ switch_core_port_allocator_t *alloc, _In_ switch_port_t port)
 Return unused port to the port allocator. More...
 
void switch_core_port_allocator_destroy (_Inout_ switch_core_port_allocator_t **alloc)
 destroythe port allocator More...
 

Detailed Description

Function Documentation

◆ switch_core_port_allocator_destroy()

void switch_core_port_allocator_destroy ( _Inout_ switch_core_port_allocator_t **  alloc)

destroythe port allocator

Parameters
allocthe allocator object

Referenced by switch_rtp_shutdown().

◆ switch_core_port_allocator_free_port()

switch_status_t switch_core_port_allocator_free_port ( _In_ switch_core_port_allocator_t alloc,
_In_ switch_port_t  port 
)

Return unused port to the port allocator.

Parameters
allocthe allocator object
portthe port
Returns
SUCCESS

Referenced by switch_rtp_release_port().

◆ switch_core_port_allocator_new()

switch_status_t switch_core_port_allocator_new ( _In_ const char *  ip,
_In_ switch_port_t  start,
_In_ switch_port_t  end,
_In_ switch_port_flag_t  flags,
_Out_ switch_core_port_allocator_t **  new_allocator 
)

Initilize the port allocator.

Parameters
startthe starting port
endthe ending port
flagsflags to change allocator behaviour (e.g. only even/odd portnumbers)
new_allocatornew pointer for the return value
Returns
SWITCH_STATUS_SUCCESS if the operation was a success

Referenced by switch_rtp_request_port().

◆ switch_core_port_allocator_request_port()

switch_status_t switch_core_port_allocator_request_port ( _In_ switch_core_port_allocator_t alloc,
_Out_ switch_port_t port_ptr 
)

Get a port from the port allocator.

Parameters
allocthe allocator object
port_ptra pointer to the port
Returns
SUCCESS

Referenced by switch_rtp_request_port().