Changeset 1854
- Timestamp:
- Mar 9, 2008 11:52:48 PM (17 years ago)
- Location:
- pjproject/trunk/pjnath
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/include/pjnath.h
r1495 r1854 28 28 #include <pjnath/stun_session.h> 29 29 #include <pjnath/stun_transaction.h> 30 #include <pjnath/turn_session.h> 30 31 #include <pjnath/types.h> 31 32 -
pjproject/trunk/pjnath/src/pjturn-srv/allocation.c
r1852 r1854 39 39 #define MAX_LIFETIME 600 40 40 #define DEF_LIFETIME 300 41 42 43 44 /* ChannelData header */45 typedef struct channel_data_hdr46 {47 pj_uint16_t ch_number;48 pj_uint16_t length;49 } channel_data_hdr;50 41 51 42 … … 913 904 * This is not a STUN packet, must be ChannelData packet. 914 905 */ 915 channel_data_hdr *cd = (channel_data_hdr*)pkt->pkt;906 pj_turn_channel_data *cd = (pj_turn_channel_data*)pkt->pkt; 916 907 pj_turn_permission *perm; 917 908 pj_ssize_t len; 909 910 pj_assert(sizeof(*cd)==4); 918 911 919 912 /* For UDP check the packet length */ … … 979 972 if (perm->channel != PJ_TURN_INVALID_CHANNEL) { 980 973 /* Send ChannelData */ 981 channel_data_hdr *cd = (channel_data_hdr*)rel->tp.tx_pkt;974 pj_turn_channel_data *cd = (pj_turn_channel_data*)rel->tp.tx_pkt; 982 975 983 976 if (len > PJ_TURN_MAX_PKT_LEN) { … … 995 988 996 989 /* Copy data */ 997 pj_memcpy(rel->tp.rx_pkt+sizeof( channel_data_hdr), pkt, len);990 pj_memcpy(rel->tp.rx_pkt+sizeof(pj_turn_channel_data), pkt, len); 998 991 999 992 /* Send to client */ 1000 993 pj_turn_listener_sendto(alloc->listener, rel->tp.tx_pkt, 1001 len+sizeof( channel_data_hdr), 0,994 len+sizeof(pj_turn_channel_data), 0, 1002 995 &alloc->hkey.clt_addr, 1003 996 pj_sockaddr_get_len(&alloc->hkey.clt_addr)); -
pjproject/trunk/pjnath/src/pjturn-srv/main.c
r1852 r1854 1 /* $Id$ */ 2 /* 3 * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 */ 1 19 #include "turn.h" 2 20 -
pjproject/trunk/pjnath/src/pjturn-srv/turn.h
r1852 r1854 31 31 32 32 33 #define PJ_TURN_INVALID_CHANNEL 0xFFFF34 33 #define PJ_TURN_INVALID_LIS_ID ((unsigned)-1) 35 #define PJ_TURN_NO_TIMEOUT ((long)0x7FFFFFFF)36 #define PJ_TURN_MAX_PKT_LEN 300037 #define PJ_TURN_PERM_TIMEOUT 30038 #define PJ_TURN_CHANNEL_TIMEOUT 60039 40 /** Transport types */41 enum {42 PJ_TURN_TP_UDP = 16, /**< UDP. */43 PJ_TURN_TP_TCP = 6 /**< TCP. */44 };45 34 46 35 /**
Note: See TracChangeset
for help on using the changeset viewer.