kernel channels definitions
This commit is contained in:
parent
36d491dfe8
commit
3540c85441
@ -1,3 +1,7 @@
|
||||
05/07/2014 Oleg Moskalenko <mom040267@gmail.com>
|
||||
Version 4.0.0.1 'Threetrees':
|
||||
- Kernel channel placeholder definitions.
|
||||
|
||||
05/02/2014 Oleg Moskalenko <mom040267@gmail.com>
|
||||
Version 4.0.0.0 'Threetrees':
|
||||
- Multi-tenant server.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
# Common settings script.
|
||||
|
||||
TURNVERSION=4.0.0.0
|
||||
TURNVERSION=4.0.0.1
|
||||
BUILDDIR=~/rpmbuild
|
||||
ARCH=`uname -p`
|
||||
TURNSERVER_SVN_URL=http://coturn.googlecode.com/svn
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
Name: turnserver
|
||||
Version: 4.0.0.0
|
||||
Version: 4.0.0.1
|
||||
Release: 0%{dist}
|
||||
Summary: Coturn TURN Server
|
||||
|
||||
@ -288,6 +288,8 @@ fi
|
||||
%{_includedir}/turn/client/TurnMsgLib.h
|
||||
|
||||
%changelog
|
||||
* Wed May 07 2014 Oleg Moskalenko <mom040267@gmail.com>
|
||||
- Sync to 4.0.0.1
|
||||
* Wed Apr 30 2014 Oleg Moskalenko <mom040267@gmail.com>
|
||||
- Sync to 4.0.0.0
|
||||
* Tue Feb 04 2014 Oleg Moskalenko <mom040267@gmail.com>
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
#ifndef __IOADEFS__
|
||||
#define __IOADEFS__
|
||||
|
||||
#define TURN_SERVER_VERSION "4.0.0.0"
|
||||
#define TURN_SERVER_VERSION "4.0.0.1"
|
||||
#define TURN_SERVER_VERSION_NAME "Threetrees"
|
||||
#define TURN_SOFTWARE "Coturn-"TURN_SERVER_VERSION" '"TURN_SERVER_VERSION_NAME"'"
|
||||
|
||||
@ -174,6 +174,20 @@ typedef enum _SHATYPE SHATYPE;
|
||||
|
||||
#define SHA_TOO_WEAK (426)
|
||||
|
||||
//////////////// KERNEL-LEVEL CHANNEL HANDLERS /////////
|
||||
|
||||
#if !defined(TURN_CHANNEL_HANDLER_KERNEL)
|
||||
#define TURN_CHANNEL_HANDLER_KERNEL void*
|
||||
#endif
|
||||
|
||||
#if !defined(CREATE_TURN_CHANNEL_KERNEL)
|
||||
#define CREATE_TURN_CHANNEL_KERNEL(channel_number, address_family_client, address_family_peer, protocol_client, client_addr, local_addr, local_relay_addr, peer_addr) ((TURN_CHANNEL_HANDLER_KERNEL)(1))
|
||||
#endif
|
||||
|
||||
#if !defined(DELETE_TURN_CHANNEL_KERNEL)
|
||||
#define DELETE_TURN_CHANNEL_KERNEL(handler)
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -215,10 +215,14 @@ static turn_permission_info* get_from_turn_permission_hashtable(turn_permission_
|
||||
}
|
||||
|
||||
static void ch_info_clean(ch_info* c) {
|
||||
if(c) {
|
||||
IOA_EVENT_DEL(c->lifetime_ev);
|
||||
ns_bzero(c,sizeof(ch_info));
|
||||
}
|
||||
if (c) {
|
||||
if (c->kernel_channel) {
|
||||
DELETE_TURN_CHANNEL_KERNEL(c->kernel_channel);
|
||||
c->kernel_channel = 0;
|
||||
}
|
||||
IOA_EVENT_DEL(c->lifetime_ev);
|
||||
ns_bzero(c,sizeof(ch_info));
|
||||
}
|
||||
}
|
||||
|
||||
static int delete_channel_info_from_allocation_map(ur_map_key_type key, ur_map_value_type value)
|
||||
|
||||
@ -127,6 +127,7 @@ typedef struct _ch_info {
|
||||
turn_time_t expiration_time;
|
||||
ioa_timer_handle lifetime_ev;
|
||||
void *owner; //perm
|
||||
TURN_CHANNEL_HANDLER_KERNEL kernel_channel;
|
||||
} ch_info;
|
||||
|
||||
///////////// "channel" map /////////////////////
|
||||
|
||||
@ -2241,6 +2241,19 @@ static int handle_turn_channel_bind(turn_turnserver *server,
|
||||
stun_set_channel_bind_response_str(ioa_network_buffer_data(nbh), &len, tid, 0, NULL);
|
||||
ioa_network_buffer_set_size(nbh,len);
|
||||
*resp_constructed = 1;
|
||||
|
||||
if(get_ioa_socket_type(ss->client_session.s) == UDP_SOCKET ||
|
||||
get_ioa_socket_type(ss->client_session.s) == TCP_SOCKET) {
|
||||
chn->kernel_channel = CREATE_TURN_CHANNEL_KERNEL(chn->chnum,
|
||||
get_ioa_socket_address_family(ss->client_session.s),
|
||||
get_ioa_socket_address_family(ss->alloc.relay_session.s),
|
||||
get_ioa_socket_type(ss->client_session.s)==UDP_SOCKET ? IPPROTO_UDP : IPPROTO_TCP,
|
||||
&(get_remote_addr_from_ioa_socket(ss->client_session.s)->ss),
|
||||
&(get_local_addr_from_ioa_socket(ss->client_session.s)->ss),
|
||||
&(get_local_addr_from_ioa_socket(ss->alloc.relay_session.s)),
|
||||
&(get_remote_addr_from_ioa_socket(ss->alloc.relay_session.s))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user