cipher.h   cipher.h 
skipping to change at line 128 skipping to change at line 128
* plaintext, and ciphertext values that are known to be correct for a * plaintext, and ciphertext values that are known to be correct for a
* particular cipher. this data can be used to test an implementation * particular cipher. this data can be used to test an implementation
* in an on-the-fly self test of the correcness of the implementation. * in an on-the-fly self test of the correcness of the implementation.
* (see the cipher_type_self_test() function below) * (see the cipher_type_self_test() function below)
*/ */
typedef struct cipher_test_case_t { typedef struct cipher_test_case_t {
int key_length_octets; /* octets in key * / int key_length_octets; /* octets in key * /
uint8_t *key; /* key * / uint8_t *key; /* key * /
uint8_t *idx; /* packet index * / uint8_t *idx; /* packet index * /
int plaintext_length_octets; /* octets in plaintext * / unsigned int plaintext_length_octets; /* octets in plaintext */
uint8_t *plaintext; /* plaintext * / uint8_t *plaintext; /* plaintext * /
int ciphertext_length_octets; /* octets in plaintext * / unsigned int ciphertext_length_octets; /* octets in plaintext * /
uint8_t *ciphertext; /* ciphertext * / uint8_t *ciphertext; /* ciphertext * /
struct cipher_test_case_t *next_test_case; /* pointer to next testcase * / struct cipher_test_case_t *next_test_case; /* pointer to next testcase * /
} cipher_test_case_t; } cipher_test_case_t;
/* cipher_type_t defines the 'metadata' for a particular cipher type */ /* cipher_type_t defines the 'metadata' for a particular cipher type */
typedef struct cipher_type_t { typedef struct cipher_type_t {
cipher_alloc_func_t alloc; cipher_alloc_func_t alloc;
cipher_dealloc_func_t dealloc; cipher_dealloc_func_t dealloc;
cipher_init_func_t init; cipher_init_func_t init;
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 config_auto.h   config_auto.h 
/* pjmedia/include/pjmedia/config_auto.h. Generated by configure. */ /* pjmedia/include/pjmedia/config_auto.h. Generated from config_auto.h.in by configure. */
/* $Id: config_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: config_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 config_site_sample.h   config_site_sample.h 
skipping to change at line 51 skipping to change at line 51
/* We probably need more buffers on WM, so increase the limit */ /* We probably need more buffers on WM, so increase the limit */
#define PJMEDIA_SOUND_BUFFER_COUNT 32 #define PJMEDIA_SOUND_BUFFER_COUNT 32
/* Fine tune Speex's default settings for best performance/quality */ /* Fine tune Speex's default settings for best performance/quality */
#define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5 #define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5
/* For CPU reason, disable speex AEC and use the echo suppressor. */ /* For CPU reason, disable speex AEC and use the echo suppressor. */
#define PJMEDIA_HAS_SPEEX_AEC 0 #define PJMEDIA_HAS_SPEEX_AEC 0
/* Shouldn't use resampling for performance reason too. */ /* Previously, resampling is disabled due to performance reason and
#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE * this condition prevented some 'light' wideband codecs (e.g: G722.1)
* to work along with narrowband codecs. Lately, some tests showed
* that 16kHz <-> 8kHz resampling using libresample small filter was
* affordable on ARM9 260 MHz, so here we decided to enable resampling.
* Note that it is important to make sure that libresample is created
* using small filter. For example PJSUA_DEFAULT_CODEC_QUALITY must
* be set to 3 or 4 so pjsua-lib will apply small filter resampling.
*/
//#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE
#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE
/* Use the lighter WSOLA implementation */ /* Use the lighter WSOLA implementation */
#define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE #define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE
/* /*
* PJSIP settings. * PJSIP settings.
*/ */
/* Set maximum number of dialog/transaction/calls to minimum to reduce /* Set maximum number of dialog/transaction/calls to minimum to reduce
* memory usage * memory usage
*/ */
#define PJSIP_MAX_TSX_COUNT 31 #define PJSIP_MAX_TSX_COUNT 31
#define PJSIP_MAX_DIALOG_COUNT 31 #define PJSIP_MAX_DIALOG_COUNT 31
#define PJSUA_MAX_CALLS 4 #define PJSUA_MAX_CALLS 4
/* /*
* PJSUA settings * PJSUA settings
*/ */
/* Default codec (Speex) quality */ /* Default codec quality, previously was set to 5, however it is now
#define PJSUA_DEFAULT_CODEC_QUALITY 5 * set to 4 to make sure pjsua instantiates resampler with small filter
.
*/
#define PJSUA_DEFAULT_CODEC_QUALITY 4
/* Set maximum number of objects to minimum to reduce memory usage */ /* Set maximum number of objects to minimum to reduce memory usage */
#define PJSUA_MAX_ACC 4 #define PJSUA_MAX_ACC 4
#define PJSUA_MAX_PLAYERS 4 #define PJSUA_MAX_PLAYERS 4
#define PJSUA_MAX_RECORDERS 4 #define PJSUA_MAX_RECORDERS 4
#define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX _PLAYERS) #define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX _PLAYERS)
#define PJSUA_MAX_BUDDIES 32 #define PJSUA_MAX_BUDDIES 32
#endif /* PJ_WIN32_WINCE */ #endif /* PJ_WIN32_WINCE */
skipping to change at line 133 skipping to change at line 144
#define PJMEDIA_HAS_L16_CODEC 0 #define PJMEDIA_HAS_L16_CODEC 0
#define PJMEDIA_HAS_ILBC_CODEC 0 #define PJMEDIA_HAS_ILBC_CODEC 0
#define PJMEDIA_HAS_G722_CODEC 0 #define PJMEDIA_HAS_G722_CODEC 0
/* Fine tune Speex's default settings for best performance/quality */ /* Fine tune Speex's default settings for best performance/quality */
#define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5 #define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5
/* For CPU reason, disable speex AEC and use the echo suppressor. */ /* For CPU reason, disable speex AEC and use the echo suppressor. */
#define PJMEDIA_HAS_SPEEX_AEC 0 #define PJMEDIA_HAS_SPEEX_AEC 0
/* Shouldn't use resampling for performance reason too. */ /* Previously, resampling is disabled due to performance reason and
#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE * this condition prevented some 'light' wideband codecs (e.g: G722.1)
* to work along with narrowband codecs. Lately, some tests showed
* that 16kHz <-> 8kHz resampling using libresample small filter was
* affordable on ARM9 222 MHz, so here we decided to enable resampling.
* Note that it is important to make sure that libresample is created
* using small filter. For example PJSUA_DEFAULT_CODEC_QUALITY must
* be set to 3 or 4 so pjsua-lib will apply small filter resampling.
*/
//#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE
#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE
/* Use the lighter WSOLA implementation */ /* Use the lighter WSOLA implementation */
#define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE #define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE
/* We probably need more buffers especially if MDA audio backend /* We probably need more buffers especially if MDA audio backend
* is used, so increase the limit * is used, so increase the limit
*/ */
#define PJMEDIA_SOUND_BUFFER_COUNT 32 #define PJMEDIA_SOUND_BUFFER_COUNT 32
/* /*
skipping to change at line 172 skipping to change at line 192
#define PJSIP_POOL_INC_UA 1000 #define PJSIP_POOL_INC_UA 1000
#define PJSIP_POOL_TSX_LAYER_LEN 256 #define PJSIP_POOL_TSX_LAYER_LEN 256
#define PJSIP_POOL_TSX_LAYER_INC 256 #define PJSIP_POOL_TSX_LAYER_INC 256
#define PJSIP_POOL_TSX_LEN 512 #define PJSIP_POOL_TSX_LEN 512
#define PJSIP_POOL_TSX_INC 128 #define PJSIP_POOL_TSX_INC 128
/* /*
* PJSUA settings. * PJSUA settings.
*/ */
/* Default codec quality */ /* Default codec quality, previously was set to 5, however it is now
#define PJSUA_DEFAULT_CODEC_QUALITY 5 * set to 4 to make sure pjsua instantiates resampler with small filter
.
*/
#define PJSUA_DEFAULT_CODEC_QUALITY 4
/* Set maximum number of dialog/transaction/calls to minimum */ /* Set maximum number of dialog/transaction/calls to minimum */
#define PJSIP_MAX_TSX_COUNT 31 #define PJSIP_MAX_TSX_COUNT 31
#define PJSIP_MAX_DIALOG_COUNT 31 #define PJSIP_MAX_DIALOG_COUNT 31
#define PJSUA_MAX_CALLS 4 #define PJSUA_MAX_CALLS 4
/* Other pjsua settings */ /* Other pjsua settings */
#define PJSUA_MAX_ACC 4 #define PJSUA_MAX_ACC 4
#define PJSUA_MAX_PLAYERS 4 #define PJSUA_MAX_PLAYERS 4
#define PJSUA_MAX_RECORDERS 4 #define PJSUA_MAX_RECORDERS 4
 End of changes. 4 change blocks. 
8 lines changed or deleted 32 lines changed or added


 ice_session.h   ice_session.h 
/* $Id: ice_session.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: ice_session.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 33 skipping to change at line 33
/** /**
* @file ice_session.h * @file ice_session.h
* @brief ICE session management * @brief ICE session management
*/ */
#include <pjnath/types.h> #include <pjnath/types.h>
#include <pjnath/stun_session.h> #include <pjnath/stun_session.h>
#include <pjnath/errno.h> #include <pjnath/errno.h>
#include <pj/sock.h> #include <pj/sock.h>
#include <pj/timer.h> #include <pj/timer.h>
/**
* @defgroup PJNATH_ICE Interactive Connectivity Establishment (ICE)
* @brief Interactive Connectivity Establishment (ICE)
*/
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJNATH_ICE_SESSION ICE Session * @addtogroup PJNATH_ICE_SESSION
* @brief Transport Independent ICE Session
* @ingroup PJNATH_ICE
* @{ * @{
* *
* This module describes #pj_ice_sess, a transport independent ICE session, * This module describes #pj_ice_sess, a transport independent ICE session,
* part of PJNATH - the Open Source NAT helper library. * part of PJNATH - the Open Source NAT helper library.
* *
* \section pj_ice_sess_sec ICE Session * \section pj_ice_sess_sec ICE Session
* *
* An ICE session, represented by #pj_ice_sess structure, is the lowest * An ICE session, represented by #pj_ice_sess structure, is the lowest
* abstraction of ICE in PJNATH, and it is used to perform and manage * abstraction of ICE in PJNATH, and it is used to perform and manage
* connectivity checks of transport address candidates <b>within a * connectivity checks of transport address candidates <b>within a
skipping to change at line 202 skipping to change at line 195
*/ */
pj_stun_session *stun_sess; pj_stun_session *stun_sess;
} pj_ice_sess_comp; } pj_ice_sess_comp;
/** /**
* Data structure to be attached to internal message processing. * Data structure to be attached to internal message processing.
*/ */
typedef struct pj_ice_msg_data typedef struct pj_ice_msg_data
{ {
/** Transport ID for this message */
unsigned transport_id; unsigned transport_id;
/** Flag to indicate whether data.req contains data */
pj_bool_t has_req_data; pj_bool_t has_req_data;
/** The data */
union data { union data {
/** Request data */
struct request_data { struct request_data {
pj_ice_sess *ice; pj_ice_sess *ice; /**< ICE session */
pj_ice_sess_checklist *clist; pj_ice_sess_checklist *clist; /**< Checklist */
unsigned ckid; unsigned ckid; /**< Check ID */
} req; } req;
} data; } data;
} pj_ice_msg_data; } pj_ice_msg_data;
/** /**
* This structure describes an ICE candidate. * This structure describes an ICE candidate.
* ICE candidate is a transport address that is to be tested by ICE * ICE candidate is a transport address that is to be tested by ICE
* procedures in order to determine its suitability for usage for * procedures in order to determine its suitability for usage for
* receipt of media. Candidates also have properties - their type * receipt of media. Candidates also have properties - their type
* (server reflexive, relayed or host), priority, foundation, and * (server reflexive, relayed or host), priority, foundation, and
* base. * base.
*/ */
skipping to change at line 529 skipping to change at line 528
* This structure represents an incoming check (an incoming Binding * This structure represents an incoming check (an incoming Binding
* request message), and is mainly used to keep early checks in the * request message), and is mainly used to keep early checks in the
* list in the ICE session. An early check is a request received * list in the ICE session. An early check is a request received
* from remote when we haven't received SDP answer yet, therefore we * from remote when we haven't received SDP answer yet, therefore we
* can't perform triggered check. For such cases, keep the incoming * can't perform triggered check. For such cases, keep the incoming
* request in a list, and we'll do triggered checks (simultaneously) * request in a list, and we'll do triggered checks (simultaneously)
* as soon as we receive answer. * as soon as we receive answer.
*/ */
typedef struct pj_ice_rx_check typedef struct pj_ice_rx_check
{ {
PJ_DECL_LIST_MEMBER(struct pj_ice_rx_check); PJ_DECL_LIST_MEMBER(struct pj_ice_rx_check); /**< Standard list */
unsigned comp_id; /**< Component ID. */ unsigned comp_id; /**< Component ID. */
unsigned transport_id; /**< Transport ID. */ unsigned transport_id; /**< Transport ID. */
pj_sockaddr src_addr; /**< Source address of reque st */ pj_sockaddr src_addr; /**< Source address of reque st */
unsigned src_addr_len; /**< Length of src address. */ unsigned src_addr_len; /**< Length of src address. */
pj_bool_t use_candidate; /**< USE-CANDIDATE is present? */ pj_bool_t use_candidate; /**< USE-CANDIDATE is present? */
pj_uint32_t priority; /**< PRIORITY value in the r eq. */ pj_uint32_t priority; /**< PRIORITY value in the r eq. */
pj_stun_uint64_attr *role_attr; /**< ICE-CONTROLLING/CONTROLLED */ pj_stun_uint64_attr *role_attr; /**< ICE-CONTROLLING/CONTROLLED */
skipping to change at line 589 skipping to change at line 588
pj_ice_sess_comp comp[PJ_ICE_MAX_COMP]; /**< Component array */ pj_ice_sess_comp comp[PJ_ICE_MAX_COMP]; /**< Component array */
/* Local candidates */ /* Local candidates */
unsigned lcand_cnt; /**< # of local cand. */ unsigned lcand_cnt; /**< # of local cand. */
pj_ice_sess_cand lcand[PJ_ICE_MAX_CAND]; /**< Array of cand. */ pj_ice_sess_cand lcand[PJ_ICE_MAX_CAND]; /**< Array of cand. */
/* Remote candidates */ /* Remote candidates */
unsigned rcand_cnt; /**< # of remote cand. */ unsigned rcand_cnt; /**< # of remote cand. */
pj_ice_sess_cand rcand[PJ_ICE_MAX_CAND]; /**< Array of cand. */ pj_ice_sess_cand rcand[PJ_ICE_MAX_CAND]; /**< Array of cand. */
/* Array of transport datas */ /** Array of transport datas */
pj_ice_msg_data tp_data[4]; pj_ice_msg_data tp_data[4];
/* List of eearly checks */ /* List of eearly checks */
pj_ice_rx_check early_check; /**< Early checks. */ pj_ice_rx_check early_check; /**< Early checks. */
/* Checklist */ /* Checklist */
pj_ice_sess_checklist clist; /**< Active checklist */ pj_ice_sess_checklist clist; /**< Active checklist */
/* Valid list */ /* Valid list */
pj_ice_sess_checklist valid_list; /**< Valid list. */ pj_ice_sess_checklist valid_list; /**< Valid list. */
/* Temporary buffer for misc stuffs to avoid using stack too much */ /** Temporary buffer for misc stuffs to avoid using stack too much */
union { union {
char txt[128]; char txt[128];
char errmsg[PJ_ERR_MSG_SIZE]; char errmsg[PJ_ERR_MSG_SIZE];
} tmp; } tmp;
}; };
/** /**
* This is a utility function to retrieve the string name for the * This is a utility function to retrieve the string name for the
* particular candidate type. * particular candidate type.
* *
 End of changes. 12 change blocks. 
15 lines changed or deleted 14 lines changed or added


 ice_strans.h   ice_strans.h 
/* $Id: ice_strans.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: ice_strans.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 37 skipping to change at line 37
#include <pjnath/ice_session.h> #include <pjnath/ice_session.h>
#include <pjnath/stun_sock.h> #include <pjnath/stun_sock.h>
#include <pjnath/turn_sock.h> #include <pjnath/turn_sock.h>
#include <pjlib-util/resolver.h> #include <pjlib-util/resolver.h>
#include <pj/ioqueue.h> #include <pj/ioqueue.h>
#include <pj/timer.h> #include <pj/timer.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJNATH_ICE_STREAM_TRANSPORT ICE Stream Transport * @addtogroup PJNATH_ICE_STREAM_TRANSPORT
* @brief Transport for media streams using ICE
* @ingroup PJNATH_ICE
* @{ * @{
* *
* This module describes ICE stream transport, as represented by #pj_ice_st rans * This module describes ICE stream transport, as represented by #pj_ice_st rans
* structure, and is part of PJNATH - the Open Source NAT traversal helper * structure, and is part of PJNATH - the Open Source NAT traversal helper
* library. * library.
* *
* ICE stream transport, as represented by #pj_ice_strans structure, is an ICE * ICE stream transport, as represented by #pj_ice_strans structure, is an ICE
* capable class for transporting media streams within a media session. * capable class for transporting media streams within a media session.
* It consists of one or more transport sockets (typically two for RTP * It consists of one or more transport sockets (typically two for RTP
* based communication - one for RTP and one for RTCP), and an * based communication - one for RTP and one for RTCP), and an
* \ref PJNATH_ICE_SESSION for performing connectivity checks among the. * \ref PJNATH_ICE_SESSION for performing connectivity checks among the.
* various candidates of the transport addresses. * various candidates of the transport addresses.
* *
*
* \section ice_strans_using_sec Using the ICE stream transport
*
* The steps below describe how to use ICE session:
*
* - initialize a #pj_ice_strans_cfg structure. This contains various
* settings for the ICE stream transport, and among other things contain
s
* the STUN and TURN settings.\n\n
* - create the instance with #pj_ice_strans_create(). Among other things,
* the function needs the following arguments:
* - the #pj_ice_strans_cfg structure for the main configurations
* - number of components to be supported
* - instance of #pj_ice_strans_cb structure to report callbacks to
* application.\n\n
* - while the #pj_ice_strans_create() call completes immediately, the
* initialization will be running in the background to gather the
* candidates (for example STUN and TURN candidates, if they are enabled
* in the #pj_ice_strans_cfg setting). Application will be notified when
* the initialization completes in the \a on_ice_complete callback of
* the #pj_ice_strans_cb structure (the \a op argument of this callback
* will be PJ_ICE_STRANS_OP_INIT).\n\n
* - when media stream is to be started (for example, a call is to be
* started), create an ICE session by calling #pj_ice_strans_init_ice().
\n\n
* - the application now typically will need to communicate local ICE
* information to remote host. It can achieve this by using the followin
g
* functions to query local ICE information:
* - #pj_ice_strans_get_ufrag_pwd()
* - #pj_ice_strans_enum_cands()
* - #pj_ice_strans_get_def_cand()\n
* The application may need to encode the above information as SDP.\n\n
* - when the application receives remote ICE information (for example, fr
om
* the SDP received from remote), it can now start ICE negotiation, by
* calling #pj_ice_strans_start_ice(). This function requires some
* information about remote ICE agent such as remote ICE username fragme
nt
* and password as well as array of remote candidates.\n\n
* - note that the PJNATH library does not work with SDP; application woul
d
* need to encode and parse the SDP itself.\n\n
* - once ICE negotiation has been started, application will be notified
* about the completion in the \a on_ice_complete() callback of the
* #pj_ice_strans_cb.\n\n
* - at any time, application may send or receive data. However the ICE
* stream transport may not be able to send it depending on its current
* state. Before ICE negotiation is started, the data will be sent using
* default candidate of the component. After negotiation is completed,
* data will be sent using the candidate from the successful/nominated
* pair. The ICE stream transport may not be able to send data while
* negotiation is in progress.\n\n
* - application sends data by using #pj_ice_strans_sendto(). Incoming
* data will be reported in \a on_rx_data() callback of the
* #pj_ice_strans_cb.\n\n
* - once the media session has finished (e.g. user hangs up the call),
* destroy the ICE session with #pj_ice_strans_stop_ice().\n\n
* - at this point, application may destroy the ICE stream transport itsel
f,
* or let it run so that it can be reused to create other ICE session.
* The benefit of letting the ICE stream transport alive (without any
* session active) is to avoid delay with the initialization, howerver
* keeping the transport alive means the transport needs to keep the
* STUN binding open by using keep-alive and also TURN allocation alive,
* and this will consume power which is an important issue for mobile
* applications.\n\n
*/ */
/** Forward declaration for ICE stream transport. */ /** Forward declaration for ICE stream transport. */
typedef struct pj_ice_strans pj_ice_strans; typedef struct pj_ice_strans pj_ice_strans;
/** Transport operation types to be reported on \a on_status() callback */ /** Transport operation types to be reported on \a on_status() callback */
typedef enum pj_ice_strans_op typedef enum pj_ice_strans_op
{ {
/** Initialization (candidate gathering) */ /** Initialization (candidate gathering) */
PJ_ICE_STRANS_OP_INIT, PJ_ICE_STRANS_OP_INIT,
 End of changes. 3 change blocks. 
4 lines changed or deleted 69 lines changed or added


 jbuf.h   jbuf.h 
/* $Id: jbuf.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: jbuf.h 2578 2009-04-06 17:05:34Z nanang $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 64 skipping to change at line 64
PJMEDIA_JB_ZERO_EMPTY_FRAME = 3 /**< Zero frame is being ret urned PJMEDIA_JB_ZERO_EMPTY_FRAME = 3 /**< Zero frame is being ret urned
because JB is empty. */ because JB is empty. */
}; };
/** /**
* @see pjmedia_jb_frame_type. * @see pjmedia_jb_frame_type.
*/ */
typedef enum pjmedia_jb_frame_type pjmedia_jb_frame_type; typedef enum pjmedia_jb_frame_type pjmedia_jb_frame_type;
/** /**
* This structure describes jitter buffer current status. * This structure describes jitter buffer state.
*/ */
struct pjmedia_jb_state struct pjmedia_jb_state
{ {
/* Setting */
unsigned frame_size; /**< Individual frame size, in bytes. */ unsigned frame_size; /**< Individual frame size, in bytes. */
unsigned prefetch; /**< Current prefetch value, in frames */
unsigned min_prefetch; /**< Minimum allowed prefetch, in frms. */ unsigned min_prefetch; /**< Minimum allowed prefetch, in frms. */
unsigned max_prefetch; /**< Maximum allowed prefetch, in frms. */ unsigned max_prefetch; /**< Maximum allowed prefetch, in frms. */
/* Status */
unsigned prefetch; /**< Current prefetch value, in frames
*/
unsigned size; /**< Current buffer size, in frames. */ unsigned size; /**< Current buffer size, in frames. */
/* Statistic */
unsigned avg_delay; /**< Average delay, in ms. */ unsigned avg_delay; /**< Average delay, in ms. */
unsigned min_delay; /**< Minimum delay, in ms. */ unsigned min_delay; /**< Minimum delay, in ms. */
unsigned max_delay; /**< Maximum delay, in ms. */ unsigned max_delay; /**< Maximum delay, in ms. */
unsigned dev_delay; /**< Standard deviation of delay, in ms. unsigned dev_delay; /**< Standard deviation of delay, in ms.
*/ */
unsigned avg_burst; /**< Average burst, in frames.
*/
unsigned lost; /**< Number of lost frames.
*/
unsigned discard; /**< Number of discarded frames.
*/
unsigned empty; /**< Number of empty on GET events.
*/
}; };
/** /**
* @see pjmedia_jb_state * @see pjmedia_jb_state
*/ */
typedef struct pjmedia_jb_state pjmedia_jb_state; typedef struct pjmedia_jb_state pjmedia_jb_state;
/** /**
* The constant PJMEDIA_JB_DEFAULT_INIT_DELAY specifies default jitter * The constant PJMEDIA_JB_DEFAULT_INIT_DELAY specifies default jitter
* buffer prefetch count during jitter buffer creation. * buffer prefetch count during jitter buffer creation.
 End of changes. 7 change blocks. 
5 lines changed or deleted 19 lines changed or added


 m_auto.h   m_auto.h 
/* pjlib/include/pj/compat/m_auto.h. Generated by configure. */ /* pjlib/include/pj/compat/m_auto.h. Generated from m_auto.h.in by configu re. */
/* $Id: m_auto.h.in 2510 2009-03-13 12:15:43Z bennylp $ */ /* $Id: m_auto.h.in 2510 2009-03-13 12:15:43Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 math.h   math.h 
/* $Id: math.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: math.h 2577 2009-04-06 16:41:54Z nanang $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 143 skipping to change at line 143
stat->min = val; stat->min = val;
if (stat->max < val) if (stat->max < val)
stat->max = val; stat->max = val;
} else { } else {
stat->min = stat->max = val; stat->min = stat->max = val;
} }
#if PJ_HAS_FLOATING_POINT #if PJ_HAS_FLOATING_POINT
delta = val - stat->fmean_; delta = val - stat->fmean_;
stat->fmean_ += delta/stat->n; stat->fmean_ += delta/stat->n;
stat->mean = (int) stat->fmean_;
/* Return mean value with 'rounding' */
stat->mean = (int) (stat->fmean_ + 0.5);
stat->m2_ += (int)(delta * (val-stat->fmean_)); stat->m2_ += (int)(delta * (val-stat->fmean_));
#else #else
delta = val - stat->mean; delta = val - stat->mean;
stat->mean += delta/stat->n; stat->mean += delta/stat->n;
stat->mean_res_ += delta % stat->n; stat->mean_res_ += delta % stat->n;
if (stat->mean_res_ >= stat->n) { if (stat->mean_res_ >= stat->n) {
++stat->mean; ++stat->mean;
stat->mean_res_ -= stat->n; stat->mean_res_ -= stat->n;
} else if (stat->mean_res_ <= -stat->n) { } else if (stat->mean_res_ <= -stat->n) {
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added


 nat_detect.h   nat_detect.h 
/* $Id: nat_detect.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: nat_detect.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 34 skipping to change at line 34
* @file ice_session.h * @file ice_session.h
* @brief ICE session management * @brief ICE session management
*/ */
#include <pjnath/stun_session.h> #include <pjnath/stun_session.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJNATH_NAT_DETECT NAT Classification/Detection Tool * @defgroup PJNATH_NAT_DETECT NAT Classification/Detection Tool
* @brief NAT Classification/Detection Tool * @brief NAT Classification/Detection Tool
* @ingroup PJNATH
* @{ * @{
* *
* This module provides one function to perform NAT classification and * This module provides one function to perform NAT classification and
* detection. NAT type detection is performed by calling * detection. NAT type detection is performed by calling
* #pj_stun_detect_nat_type() function. * #pj_stun_detect_nat_type() function.
*/ */
/** /**
* This enumeration describes the NAT types, as specified by RFC 3489 * This enumeration describes the NAT types, as specified by RFC 3489
* Section 5, NAT Variations. * Section 5, NAT Variations.
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 os.h   os.h 
/* $Id: os.h 2481 2009-03-02 15:48:45Z nanang $ */ /* $Id: os.h 2560 2009-03-30 18:22:16Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 1251 skipping to change at line 1251
* @param stop The end timestamp. * @param stop The end timestamp.
* *
* @return Elapsed time in milisecond. * @return Elapsed time in milisecond.
* *
* @see pj_elapsed_time(), pj_elapsed_cycle(), pj_elapsed_nanosec() * @see pj_elapsed_time(), pj_elapsed_cycle(), pj_elapsed_nanosec()
*/ */
PJ_DECL(pj_uint32_t) pj_elapsed_msec( const pj_timestamp *start, PJ_DECL(pj_uint32_t) pj_elapsed_msec( const pj_timestamp *start,
const pj_timestamp *stop ); const pj_timestamp *stop );
/** /**
* Variant of #pj_elapsed_msec() which returns 64bit value.
*/
PJ_DECL(pj_uint64_t) pj_elapsed_msec64(const pj_timestamp *start,
const pj_timestamp *stop );
/**
* Calculate the elapsed time in 32-bit microseconds. * Calculate the elapsed time in 32-bit microseconds.
* This function calculates the elapsed time using highest precision * This function calculates the elapsed time using highest precision
* calculation that is available for current platform, considering * calculation that is available for current platform, considering
* whether floating point or 64-bit precision arithmetic is available. * whether floating point or 64-bit precision arithmetic is available.
* For maximum portability, application should prefer to use this function * For maximum portability, application should prefer to use this function
* rather than calculating the elapsed time by itself. * rather than calculating the elapsed time by itself.
* *
* @param start The starting timestamp. * @param start The starting timestamp.
* @param stop The end timestamp. * @param stop The end timestamp.
* *
 End of changes. 2 change blocks. 
1 lines changed or deleted 7 lines changed or added


 os_auto.h   os_auto.h 
/* pjlib/include/pj/compat/os_auto.h. Generated by configure. */ /* pjlib/include/pj/compat/os_auto.h. Generated from os_auto.h.in by confi gure. */
/* $Id: os_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: os_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 os_win32_wince.h   os_win32_wince.h 
/* $Id: os_win32_wince.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: os_win32_wince.h 2660 2009-04-28 19:38:43Z nanang $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 31 skipping to change at line 31
#define __PJ_COMPAT_OS_WIN32_WINCE_H__ #define __PJ_COMPAT_OS_WIN32_WINCE_H__
/** /**
* @file os_win32.h * @file os_win32.h
* @brief Describes Win32 operating system family specifics. * @brief Describes Win32 operating system family specifics.
*/ */
#define PJ_OS_NAME "win32-wince" #define PJ_OS_NAME "win32-wince"
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define RPC_NO_WINDOWS_H
//#define PJ_WIN32_WINNT 0x0400 //#define PJ_WIN32_WINNT 0x0400
//#define _WIN32_WINNT PJ_WIN32_WINNT //#define _WIN32_WINNT PJ_WIN32_WINNT
#define PJ_HAS_ARPA_INET_H 0 #define PJ_HAS_ARPA_INET_H 0
#define PJ_HAS_ASSERT_H 1 #define PJ_HAS_ASSERT_H 1
#define PJ_HAS_CTYPE_H 1 #define PJ_HAS_CTYPE_H 1
#define PJ_HAS_ERRNO_H 0 /* Must be zero, otherwise errno_tes t() fails. */ #define PJ_HAS_ERRNO_H 0 /* Must be zero, otherwise errno_tes t() fails. */
#define PJ_HAS_LINUX_SOCKET_H 0 #define PJ_HAS_LINUX_SOCKET_H 0
#define PJ_HAS_MALLOC_H 1 #define PJ_HAS_MALLOC_H 1
#define PJ_HAS_NETDB_H 0 #define PJ_HAS_NETDB_H 0
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 pjmedia-codec.h   pjmedia-codec.h 
/* $Id: pjmedia-codec.h 2506 2009-03-12 18:11:37Z bennylp $ */ /* $Id: pjmedia-codec.h 2563 2009-04-01 12:05:34Z nanang $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 33 skipping to change at line 33
/** /**
* @file pjmedia-codec.h * @file pjmedia-codec.h
* @brief Include all codecs API in PJMEDIA-CODEC * @brief Include all codecs API in PJMEDIA-CODEC
*/ */
#include <pjmedia-codec/l16.h> #include <pjmedia-codec/l16.h>
#include <pjmedia-codec/gsm.h> #include <pjmedia-codec/gsm.h>
#include <pjmedia-codec/speex.h> #include <pjmedia-codec/speex.h>
#include <pjmedia-codec/ilbc.h> #include <pjmedia-codec/ilbc.h>
#include <pjmedia-codec/g722.h> #include <pjmedia-codec/g722.h>
#include <pjmedia-codec/g7221.h>
#include <pjmedia-codec/ipp_codecs.h> #include <pjmedia-codec/ipp_codecs.h>
#include <pjmedia-codec/passthrough.h> #include <pjmedia-codec/passthrough.h>
#endif /* __PJMEDIA_CODEC_PJMEDIA_CODEC_H__ */ #endif /* __PJMEDIA_CODEC_PJMEDIA_CODEC_H__ */
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 pjsua.h   pjsua.h 
/* $Id: pjsua.h 2506 2009-03-12 18:11:37Z bennylp $ */ /* $Id: pjsua.h 2686 2009-05-07 16:56:04Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 464 skipping to change at line 464
* Log decoration. * Log decoration.
*/ */
unsigned decor; unsigned decor;
/** /**
* Optional log filename. * Optional log filename.
*/ */
pj_str_t log_filename; pj_str_t log_filename;
/** /**
* Additional flags to be given to #pj_file_open() when opening
* the log file. By default, the flag is PJ_O_WRONLY. Application
* may set PJ_O_APPEND here so that logs are appended to existing
* file instead of overwriting it.
*
* Default is 0.
*/
unsigned log_file_flags;
/**
* Optional callback function to be called to write log to * Optional callback function to be called to write log to
* application specific device. This function will be called for * application specific device. This function will be called for
* log messages on input verbosity level. * log messages on input verbosity level.
* *
* \par Sample Python Syntax: * \par Sample Python Syntax:
* \code * \code
# level: integer # level: integer
# data: string # data: string
# len: integer # len: integer
skipping to change at line 1981 skipping to change at line 1991
* Default registration interval. * Default registration interval.
*/ */
#ifndef PJSUA_REG_INTERVAL #ifndef PJSUA_REG_INTERVAL
# define PJSUA_REG_INTERVAL 300 # define PJSUA_REG_INTERVAL 300
#endif #endif
/** /**
* Default PUBLISH expiration * Default PUBLISH expiration
*/ */
#ifndef PJSUA_PUBLISH_EXPIRATION #ifndef PJSUA_PUBLISH_EXPIRATION
# define PJSUA_PUBLISH_EXPIRATION 600 # define PJSUA_PUBLISH_EXPIRATION PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED
#endif #endif
/** /**
* Default account priority. * Default account priority.
*/ */
#ifndef PJSUA_DEFAULT_ACC_PRIORITY #ifndef PJSUA_DEFAULT_ACC_PRIORITY
# define PJSUA_DEFAULT_ACC_PRIORITY 0 # define PJSUA_DEFAULT_ACC_PRIORITY 0
#endif #endif
/** /**
skipping to change at line 3387 skipping to change at line 3397
/** /**
* Max buddies in buddy list. * Max buddies in buddy list.
*/ */
#ifndef PJSUA_MAX_BUDDIES #ifndef PJSUA_MAX_BUDDIES
# define PJSUA_MAX_BUDDIES 256 # define PJSUA_MAX_BUDDIES 256
#endif #endif
/** /**
* This specifies how long the library should retry resending SUBSCRIBE * This specifies how long the library should retry resending SUBSCRIBE
* if the previous SUBSCRIBE failed. * if the previous SUBSCRIBE failed. This also controls the duration
* before failed PUBLISH request will be retried.
* *
* Default: 300 seconds * Default: 300 seconds
*/ */
#ifndef PJSUA_PRES_TIMER #ifndef PJSUA_PRES_TIMER
# define PJSUA_PRES_TIMER 300 # define PJSUA_PRES_TIMER 300
#endif #endif
/** /**
* This structure describes buddy configuration when adding a buddy to * This structure describes buddy configuration when adding a buddy to
* the buddy list with #pjsua_buddy_add(). Application MUST initialize * the buddy list with #pjsua_buddy_add(). Application MUST initialize
 End of changes. 4 change blocks. 
3 lines changed or deleted 14 lines changed or added


 publish.h   publish.h 
/* $Id: publish.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: publish.h 2661 2009-04-28 22:19:49Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 75 skipping to change at line 75
* has finished. * has finished.
*/ */
struct pjsip_publishc_cbparam struct pjsip_publishc_cbparam
{ {
pjsip_publishc *pubc; /**< Client publication structure. */ pjsip_publishc *pubc; /**< Client publication structure. */
void *token; /**< Arbitrary token. */ void *token; /**< Arbitrary token. */
pj_status_t status; /**< Error status. */ pj_status_t status; /**< Error status. */
int code; /**< SIP status code received. */ int code; /**< SIP status code received. */
pj_str_t reason; /**< SIP reason phrase received. */ pj_str_t reason; /**< SIP reason phrase received. */
pjsip_rx_data *rdata; /**< The complete received response. */ pjsip_rx_data *rdata; /**< The complete received response. */
int expiration;/**< Next expiration interval. int expiration;/**< Next expiration interval. I
*/ f the
value is -1, it means the session
will not renew itself.
*/
}; };
/** Type declaration for callback to receive publication result. */ /** Type declaration for callback to receive publication result. */
typedef void pjsip_publishc_cb(struct pjsip_publishc_cbparam *param); typedef void pjsip_publishc_cb(struct pjsip_publishc_cbparam *param);
/** /**
* Initialize client publication module. * Initialize client publication module.
* *
* @param endpt SIP endpoint. * @param endpt SIP endpoint.
* *
skipping to change at line 177 skipping to change at line 179
* *
* @param pubc The client publication structure. * @param pubc The client publication structure.
* @param rs List containing Route headers. * @param rs List containing Route headers.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjsip_publishc_set_route_set(pjsip_publishc *pubc, PJ_DECL(pj_status_t) pjsip_publishc_set_route_set(pjsip_publishc *pubc,
const pjsip_route_hdr *rs) ; const pjsip_route_hdr *rs) ;
/** /**
* Set list of headers to be added to each PUBLISH request generated by
* the client publication session. Note that application can also add
* the headers to the request after calling #pjsip_publishc_publish()
* or #pjsip_publishc_unpublish(), but the benefit of this function is
* the headers will also be added to requests generated internally by
* the session, such as during session renewal/refresh.
*
* Note that calling this function will clear the previously added list
* of headers.
*
* @param pubc The client publication structure.
* @param hdr_list The list of headers.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_publishc_set_headers(pjsip_publishc *pubc,
const pjsip_hdr *hdr_list);
/**
* Create PUBLISH request for the specified client publication structure. * Create PUBLISH request for the specified client publication structure.
* Application can use this function to both create initial publication * Application can use this function to both create initial publication
* or to modify existing publication. * or to modify existing publication.
* *
* After the PUBLISH request is created, application MUST fill in the * After the PUBLISH request is created, application MUST fill in the
* body part of the request with the appropriate content for the Event * body part of the request with the appropriate content for the Event
* being published. * being published.
* *
* Note that publication refresh are handled automatically by the session * Note that publication refresh are handled automatically by the session
* (as long as auto_refresh argument below is non-zero), and application * (as long as auto_refresh argument below is non-zero), and application
 End of changes. 3 change blocks. 
3 lines changed or deleted 25 lines changed or added


 sip_autoconf.h   sip_autoconf.h 
/* pjsip/include/pjsip/sip_autoconf.h. Generated by configure. */ /* pjsip/include/pjsip/sip_autoconf.h. Generated from sip_autoconf.h.in by configure. */
/* $Id: sip_autoconf.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: sip_autoconf.h.in 2394 2008-12-23 17:27:53Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 sip_inv.h   sip_inv.h 
/* $Id: sip_inv.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: sip_inv.h 2647 2009-04-26 11:30:22Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 638 skipping to change at line 638
* *
* @return PJ_SUCCESS if local answer can be accepted by * @return PJ_SUCCESS if local answer can be accepted by
* SDP negotiator. * SDP negotiator.
*/ */
PJ_DECL(pj_status_t) pjsip_inv_set_sdp_answer(pjsip_inv_session *inv, PJ_DECL(pj_status_t) pjsip_inv_set_sdp_answer(pjsip_inv_session *inv,
const pjmedia_sdp_session *sdp ); const pjmedia_sdp_session *sdp );
/** /**
* Create a SIP message to initiate invite session termination. Depending o n * Create a SIP message to initiate invite session termination. Depending o n
* the state of the session, this function may return CANCEL request, * the state of the session, this function may return CANCEL request,
* a non-2xx final response, or a BYE request. If the session has not answe * a non-2xx final response, a BYE request, or even no request.
red *
* the incoming INVITE, this function creates the non-2xx final response wi * For UAS, if the session has not answered the incoming INVITE, this funct
th ion
* the specified status code in st_code and optional status text in st_text * creates the non-2xx final response with the specified status code in
. * \a st_code and optional status text in \a st_text.
*
* For UAC, if the original INVITE has not been answered with a final
* response, the behavior depends on whether provisional response has been
* received. If provisional response has been received, this function will
* create CANCEL request. If no provisional response has been received, the
* function will not create CANCEL request (the function will return
* PJ_SUCCESS but the \a p_tdata will contain NULL) because we cannot send
* CANCEL before receiving provisional response. If then a provisional
* response is received, the invite session will send CANCEL automatically.
*
* For both UAC and UAS, if the INVITE session has been answered with final
* response, a BYE request will be created.
* *
* @param inv The invite session. * @param inv The invite session.
* @param st_code Status code to be used for terminating the session. * @param st_code Status code to be used for terminating the session.
* @param st_text Optional status text. * @param st_text Optional status text.
* @param p_tdata Pointer to receive the message to be created. * @param p_tdata Pointer to receive the message to be created. Note
* that it's possible to receive NULL here while the
* function returns PJ_SUCCESS, see the description.
* *
* @return PJ_SUCCESS if termination message can be created. * @return PJ_SUCCESS if termination is initiated.
*/ */
PJ_DECL(pj_status_t) pjsip_inv_end_session( pjsip_inv_session *inv, PJ_DECL(pj_status_t) pjsip_inv_end_session( pjsip_inv_session *inv,
int st_code, int st_code,
const pj_str_t *st_text, const pj_str_t *st_text,
pjsip_tx_data **p_tdata ); pjsip_tx_data **p_tdata );
/** /**
* Create a re-INVITE request. * Create a re-INVITE request.
* *
* @param inv The invite session. * @param inv The invite session.
 End of changes. 4 change blocks. 
9 lines changed or deleted 23 lines changed or added


 sip_parser.h   sip_parser.h 
/* $Id: sip_parser.h 2522 2009-03-18 18:24:40Z bennylp $ */ /* $Id: sip_parser.h 2660 2009-04-28 19:38:43Z nanang $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 306 skipping to change at line 306
* successfully parsed headers. * successfully parsed headers.
*/ */
PJ_DECL(pj_status_t) pjsip_parse_headers( pj_pool_t *pool, PJ_DECL(pj_status_t) pjsip_parse_headers( pj_pool_t *pool,
char *input, pj_size_t size, char *input, pj_size_t size,
pj_list *hlist ); pj_list *hlist );
/** /**
* @} * @}
*/ */
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4510) // default constructor could not be genera
ted
# pragma warning(disable:4512) // assignment operator could not be genera
ted
# pragma warning(disable:4610) // user defined constructor required
#endif
/** /**
* Parser constants. @see pjsip_parser_const() * Parser constants. @see pjsip_parser_const()
*/ */
typedef struct pjsip_parser_const_t typedef struct pjsip_parser_const_t
{ {
const pj_str_t pjsip_USER_STR; /**< "user" string constant. */ const pj_str_t pjsip_USER_STR; /**< "user" string constant. */
const pj_str_t pjsip_METHOD_STR; /**< "method" string constant */ const pj_str_t pjsip_METHOD_STR; /**< "method" string constant */
const pj_str_t pjsip_TRANSPORT_STR; /**< "transport" string cons t. */ const pj_str_t pjsip_TRANSPORT_STR; /**< "transport" string cons t. */
const pj_str_t pjsip_MADDR_STR; /**< "maddr" string const. */ const pj_str_t pjsip_MADDR_STR; /**< "maddr" string const. */
const pj_str_t pjsip_LR_STR; /**< "lr" string const. */ const pj_str_t pjsip_LR_STR; /**< "lr" string const. */
skipping to change at line 363 skipping to change at line 370
pj_cis_t pjsip_NOT_NEWLINE; /**< For eating up header, b asically pj_cis_t pjsip_NOT_NEWLINE; /**< For eating up header, b asically
any chars except newlines or any chars except newlines or
zero. */ zero. */
pj_cis_t pjsip_NOT_COMMA_OR_NEWLINE;/**< Array elements. */ pj_cis_t pjsip_NOT_COMMA_OR_NEWLINE;/**< Array elements. */
pj_cis_t pjsip_DISPLAY_SPEC; /**< Used when searching for display pj_cis_t pjsip_DISPLAY_SPEC; /**< Used when searching for display
name. */ name. */
pj_cis_t pjsip_OTHER_URI_CONTENT; /**< Generic URI content. */ pj_cis_t pjsip_OTHER_URI_CONTENT; /**< Generic URI content. */
} pjsip_parser_const_t; } pjsip_parser_const_t;
#ifdef _MSC_VER
# pragma warning(pop)
#endif
/** /**
* Get parser constants. * Get parser constants.
*/ */
PJ_DECL(const pjsip_parser_const_t*) pjsip_parser_const(void); PJ_DECL(const pjsip_parser_const_t*) pjsip_parser_const(void);
/* /*
* Parser utilities. * Parser utilities.
*/ */
enum enum
{ {
 End of changes. 3 change blocks. 
1 lines changed or deleted 14 lines changed or added


 sip_transaction.h   sip_transaction.h 
/* $Id: sip_transaction.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: sip_transaction.h 2646 2009-04-26 11:02:04Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 326 skipping to change at line 326
int code ); int code );
/** /**
* Cease retransmission on the UAC transaction. The UAC transaction is * Cease retransmission on the UAC transaction. The UAC transaction is
* still considered running, and it will complete when either final * still considered running, and it will complete when either final
* response is received or the transaction times out. * response is received or the transaction times out.
* *
* This operation normally is used for INVITE transaction only, when * This operation normally is used for INVITE transaction only, when
* the transaction is cancelled before any provisional response has been * the transaction is cancelled before any provisional response has been
* received. * received.
*
* @param tsx The transaction.
*
* @return PJ_SUCCESS or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pjsip_tsx_stop_retransmit(pjsip_transaction *tsx); PJ_DECL(pj_status_t) pjsip_tsx_stop_retransmit(pjsip_transaction *tsx);
/** /**
* Start a timer to terminate transaction after the specified time
* has elapsed. This function is only valid for INVITE transaction,
* and only before final response is received for the INVITE transaction.
* It is normally called after the UAC has sent CANCEL for this
* INVITE transaction.
*
* The purpose of this function is to terminate the transaction if UAS
* does not send final response to this INVITE transaction even after
* it sends 200/OK to CANCEL (for example when the UAS complies to RFC
* 2543).
*
* Once this timer is set, the transaction will be terminated either when
* a final response is received or the timer expires.
*
* @param tsx The transaction.
* @param millisec Timeout value in milliseconds.
*
* @return PJ_SUCCESS or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_tsx_set_timeout(pjsip_transaction *tsx,
unsigned millisec);
/**
* Get the transaction instance in the incoming message. If the message * Get the transaction instance in the incoming message. If the message
* has a corresponding transaction, this function will return non NULL * has a corresponding transaction, this function will return non NULL
* value. * value.
* *
* @param rdata The incoming message buffer. * @param rdata The incoming message buffer.
* *
* @return The transaction instance associated with this message, * @return The transaction instance associated with this message,
* or NULL if the message doesn't match any transactions. * or NULL if the message doesn't match any transactions.
*/ */
PJ_DECL(pjsip_transaction*) pjsip_rdata_get_tsx( pjsip_rx_data *rdata ); PJ_DECL(pjsip_transaction*) pjsip_rdata_get_tsx( pjsip_rx_data *rdata );
 End of changes. 3 change blocks. 
1 lines changed or deleted 28 lines changed or added


 srtp_priv.h   srtp_priv.h 
skipping to change at line 62 skipping to change at line 62
/* /*
* an srtp_hdr_t represents the srtp header * an srtp_hdr_t represents the srtp header
* *
* in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned * in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned
* *
* (note that this definition follows that of RFC 1889 Appendix A, but * (note that this definition follows that of RFC 1889 Appendix A, but
* is not identical) * is not identical)
*/ */
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4214) // bit field types other than int
#endif
#ifndef WORDS_BIGENDIAN #ifndef WORDS_BIGENDIAN
/* /*
* srtp_hdr_t represents an RTP or SRTP header. The bit-fields in * srtp_hdr_t represents an RTP or SRTP header. The bit-fields in
* this structure should be declared "unsigned int" instead of * this structure should be declared "unsigned int" instead of
* "unsigned char", but doing so causes the MS compiler to not * "unsigned char", but doing so causes the MS compiler to not
* fully pack the bit fields. * fully pack the bit fields.
*/ */
typedef struct { typedef struct {
unsigned char cc:4; /* CSRC count */ unsigned char cc:4; /* CSRC count */
unsigned char x:1; /* header extension flag */ unsigned char x:1; /* header extension flag */
unsigned char p:1; /* padding flag */ unsigned char p:1; /* padding flag */
unsigned char version:2; /* protocol version */ unsigned char version:2; /* protocol version */
unsigned char pt:7; /* payload type */ unsigned char pt:7; /* payload type */
unsigned char m:1; /* marker bit */ unsigned char m:1; /* marker bit */
uint16_t seq; /* sequence number */ uint16_t seq; /* sequence number */
uint32_t ts; /* timestamp */ uint32_t ts; /* timestamp */
uint32_t ssrc; /* synchronization source */ uint32_t ssrc; /* synchronization source */
skipping to change at line 157 skipping to change at line 161
typedef struct { typedef struct {
unsigned int e:1; /* encrypted? 1=yes */ unsigned int e:1; /* encrypted? 1=yes */
unsigned int index:31; /* srtcp packet index */ unsigned int index:31; /* srtcp packet index */
/* optional mikey/etc go here */ /* optional mikey/etc go here */
/* and then the variable-length auth tag */ /* and then the variable-length auth tag */
} srtcp_trailer_t; } srtcp_trailer_t;
#endif #endif
#ifdef _MSC_VER
# pragma warning( pop )
#endif
/* /*
* the following declarations are libSRTP internal functions * the following declarations are libSRTP internal functions
*/ */
/* /*
* srtp_get_stream(ssrc) returns a pointer to the stream corresponding * srtp_get_stream(ssrc) returns a pointer to the stream corresponding
* to ssrc, or NULL if no stream exists for that ssrc * to ssrc, or NULL if no stream exists for that ssrc
*/ */
srtp_stream_t srtp_stream_t
 End of changes. 3 change blocks. 
1 lines changed or deleted 9 lines changed or added


 stun_auth.h   stun_auth.h 
/* $Id: stun_auth.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: stun_auth.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 36 skipping to change at line 36
*/ */
#include <pjnath/stun_msg.h> #include <pjnath/stun_msg.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJNATH_STUN_AUTH STUN Authentication * @defgroup PJNATH_STUN_AUTH STUN Authentication
* @brief STUN authentication helper * @brief STUN authentication helper
* @ingroup PJNATH_STUN * @ingroup PJNATH_STUN_BASE
* @{ * @{
*/ */
/** /**
* Type of authentication. * Type of authentication.
*/ */
typedef enum pj_stun_auth_type typedef enum pj_stun_auth_type
{ {
/** /**
* No authentication. * No authentication.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 stun_config.h   stun_config.h 
/* $Id: stun_config.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: stun_config.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 39 skipping to change at line 39
#include <pj/assert.h> #include <pj/assert.h>
#include <pj/errno.h> #include <pj/errno.h>
#include <pj/string.h> #include <pj/string.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJNATH_STUN_CONFIG STUN Config * @defgroup PJNATH_STUN_CONFIG STUN Config
* @brief STUN config * @brief STUN config
* @ingroup PJNATH_STUN * @ingroup PJNATH_STUN_BASE
* @{ * @{
*/ */
/** /**
* STUN configuration. * STUN configuration.
*/ */
typedef struct pj_stun_config typedef struct pj_stun_config
{ {
/** /**
* Pool factory to be used. * Pool factory to be used.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 stun_msg.h   stun_msg.h 
/* $Id: stun_msg.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: stun_msg.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 36 skipping to change at line 36
*/ */
#include <pjnath/types.h> #include <pjnath/types.h>
#include <pj/sock.h> #include <pj/sock.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJNATH_STUN_MSG STUN Message Representation and Parsing * @defgroup PJNATH_STUN_MSG STUN Message Representation and Parsing
* @ingroup PJNATH_STUN * @ingroup PJNATH_STUN_BASE
* @brief Low-level representation and parsing of STUN messages. * @brief Low-level representation and parsing of STUN messages.
* @{ * @{
*/ */
/** /**
* STUN magic cookie. * STUN magic cookie.
*/ */
#define PJ_STUN_MAGIC 0x2112A442 #define PJ_STUN_MAGIC 0x2112A442
/** /**
skipping to change at line 82 skipping to change at line 82
* STUN/TURN Send indication as defined by draft-ietf-behave-turn * STUN/TURN Send indication as defined by draft-ietf-behave-turn
*/ */
PJ_STUN_SEND_METHOD = 6, PJ_STUN_SEND_METHOD = 6,
/** /**
* STUN/TURN Data indication as defined by draft-ietf-behave-turn * STUN/TURN Data indication as defined by draft-ietf-behave-turn
*/ */
PJ_STUN_DATA_METHOD = 7, PJ_STUN_DATA_METHOD = 7,
/** /**
* STUN/TURN CreatePermission method as defined by draft-ietf-behave-tu
rn
*/
PJ_STUN_CREATE_PERM_METHOD = 8,
/**
* STUN/TURN ChannelBind as defined by draft-ietf-behave-turn * STUN/TURN ChannelBind as defined by draft-ietf-behave-turn
*/ */
PJ_STUN_CHANNEL_BIND_METHOD = 9, PJ_STUN_CHANNEL_BIND_METHOD = 9,
/** /**
* All known methods. * All known methods.
*/ */
PJ_STUN_METHOD_MAX PJ_STUN_METHOD_MAX
}; };
skipping to change at line 240 skipping to change at line 245
* TURN Send indication * TURN Send indication
*/ */
PJ_STUN_SEND_INDICATION = 0x0016, PJ_STUN_SEND_INDICATION = 0x0016,
/** /**
* TURN Data indication * TURN Data indication
*/ */
PJ_STUN_DATA_INDICATION = 0x0017, PJ_STUN_DATA_INDICATION = 0x0017,
/** /**
* TURN CreatePermission request
*/
PJ_STUN_CREATE_PERM_REQUEST = 0x0008,
/**
* TURN CreatePermission successful response.
*/
PJ_STUN_CREATE_PERM_RESPONSE = 0x0108,
/**
* TURN CreatePermission failure response
*/
PJ_STUN_CREATE_PERM_ERROR_RESPONSE = 0x0118,
/**
* STUN/TURN ChannelBind Request * STUN/TURN ChannelBind Request
*/ */
PJ_STUN_CHANNEL_BIND_REQUEST = 0x0009, PJ_STUN_CHANNEL_BIND_REQUEST = 0x0009,
/** /**
* Successful response to STUN ChannelBind request * Successful response to STUN ChannelBind request
*/ */
PJ_STUN_CHANNEL_BIND_RESPONSE = 0x0109, PJ_STUN_CHANNEL_BIND_RESPONSE = 0x0109,
/** /**
skipping to change at line 276 skipping to change at line 296
PJ_STUN_ATTR_USERNAME = 0x0006,/**< USERNAME attribute. */ PJ_STUN_ATTR_USERNAME = 0x0006,/**< USERNAME attribute. */
PJ_STUN_ATTR_PASSWORD = 0x0007,/**< was PASSWORD attribute. */ PJ_STUN_ATTR_PASSWORD = 0x0007,/**< was PASSWORD attribute. */
PJ_STUN_ATTR_MESSAGE_INTEGRITY = 0x0008,/**< MESSAGE-INTEGRITY. */ PJ_STUN_ATTR_MESSAGE_INTEGRITY = 0x0008,/**< MESSAGE-INTEGRITY. */
PJ_STUN_ATTR_ERROR_CODE = 0x0009,/**< ERROR-CODE. */ PJ_STUN_ATTR_ERROR_CODE = 0x0009,/**< ERROR-CODE. */
PJ_STUN_ATTR_UNKNOWN_ATTRIBUTES = 0x000A,/**< UNKNOWN-ATTRIBUTES. */ PJ_STUN_ATTR_UNKNOWN_ATTRIBUTES = 0x000A,/**< UNKNOWN-ATTRIBUTES. */
PJ_STUN_ATTR_REFLECTED_FROM = 0x000B,/**< REFLECTED-FROM (de precatd)*/ PJ_STUN_ATTR_REFLECTED_FROM = 0x000B,/**< REFLECTED-FROM (de precatd)*/
PJ_STUN_ATTR_CHANNEL_NUMBER = 0x000C,/**< TURN CHANNEL-NUMBE R */ PJ_STUN_ATTR_CHANNEL_NUMBER = 0x000C,/**< TURN CHANNEL-NUMBE R */
PJ_STUN_ATTR_LIFETIME = 0x000D,/**< TURN LIFETIME attr. */ PJ_STUN_ATTR_LIFETIME = 0x000D,/**< TURN LIFETIME attr. */
PJ_STUN_ATTR_MAGIC_COOKIE = 0x000F,/**< MAGIC-COOKIE attr (deprec) */ PJ_STUN_ATTR_MAGIC_COOKIE = 0x000F,/**< MAGIC-COOKIE attr (deprec) */
PJ_STUN_ATTR_BANDWIDTH = 0x0010,/**< TURN BANDWIDTH (deprec) */ PJ_STUN_ATTR_BANDWIDTH = 0x0010,/**< TURN BANDWIDTH (deprec) */
PJ_STUN_ATTR_PEER_ADDR = 0x0012,/**< TURN PEER-ADDRESS attr. */ PJ_STUN_ATTR_XOR_PEER_ADDR = 0x0012,/**< TURN XOR-PEER-ADDRESS */
PJ_STUN_ATTR_DATA = 0x0013,/**< DATA attribute. */ PJ_STUN_ATTR_DATA = 0x0013,/**< DATA attribute. */
PJ_STUN_ATTR_REALM = 0x0014,/**< REALM attribute. */ PJ_STUN_ATTR_REALM = 0x0014,/**< REALM attribute. */
PJ_STUN_ATTR_NONCE = 0x0015,/**< NONCE attribute. */ PJ_STUN_ATTR_NONCE = 0x0015,/**< NONCE attribute. */
PJ_STUN_ATTR_RELAYED_ADDR = 0x0016,/**< RELAYED-ADDRESS attribute. */ PJ_STUN_ATTR_XOR_RELAYED_ADDR = 0x0016,/**< TURN XOR-RELAYED-ADDRESS */
PJ_STUN_ATTR_REQ_ADDR_TYPE = 0x0017,/**< REQUESTED-ADDRESS-TYPE */ PJ_STUN_ATTR_REQ_ADDR_TYPE = 0x0017,/**< REQUESTED-ADDRESS-TYPE */
PJ_STUN_ATTR_REQ_PROPS = 0x0018,/**< REQUESTED-PROPS PJ_STUN_ATTR_EVEN_PORT = 0x0018,/**< TURN EVEN-PORT
*/ */
PJ_STUN_ATTR_REQ_TRANSPORT = 0x0019,/**< REQUESTED-TRANSPORT PJ_STUN_ATTR_REQ_TRANSPORT = 0x0019,/**< TURN REQUESTED-TRANSPORT
*/ */
PJ_STUN_ATTR_DONT_FRAGMENT = 0x001A,/**< TURN DONT-FRAGMENT
*/
PJ_STUN_ATTR_XOR_MAPPED_ADDR = 0x0020,/**< XOR-MAPPED-ADDRESS */ PJ_STUN_ATTR_XOR_MAPPED_ADDR = 0x0020,/**< XOR-MAPPED-ADDRESS */
PJ_STUN_ATTR_TIMER_VAL = 0x0021,/**< TIMER-VAL attribute. */ PJ_STUN_ATTR_TIMER_VAL = 0x0021,/**< TIMER-VAL attribute. */
PJ_STUN_ATTR_RESERVATION_TOKEN = 0x0022,/**< TURN RESERVATION-TOKEN */ PJ_STUN_ATTR_RESERVATION_TOKEN = 0x0022,/**< TURN RESERVATION-TOKEN */
PJ_STUN_ATTR_XOR_REFLECTED_FROM = 0x0023,/**< XOR-REFLECTED-FROM */ PJ_STUN_ATTR_XOR_REFLECTED_FROM = 0x0023,/**< XOR-REFLECTED-FROM */
PJ_STUN_ATTR_PRIORITY = 0x0024,/**< PRIORITY */ PJ_STUN_ATTR_PRIORITY = 0x0024,/**< PRIORITY */
PJ_STUN_ATTR_USE_CANDIDATE = 0x0025,/**< USE-CANDIDATE */ PJ_STUN_ATTR_USE_CANDIDATE = 0x0025,/**< USE-CANDIDATE */
PJ_STUN_ATTR_ICMP = 0x0030,/**< ICMP (TURN) */ PJ_STUN_ATTR_ICMP = 0x0030,/**< ICMP (TURN) */
PJ_STUN_ATTR_END_MANDATORY_ATTR, PJ_STUN_ATTR_END_MANDATORY_ATTR,
skipping to change at line 315 skipping to change at line 336
} pj_stun_attr_type; } pj_stun_attr_type;
/** /**
* STUN error codes, which goes into STUN ERROR-CODE attribute. * STUN error codes, which goes into STUN ERROR-CODE attribute.
*/ */
typedef enum pj_stun_status typedef enum pj_stun_status
{ {
PJ_STUN_SC_TRY_ALTERNATE = 300, /**< Try Alternate */ PJ_STUN_SC_TRY_ALTERNATE = 300, /**< Try Alternate */
PJ_STUN_SC_BAD_REQUEST = 400, /**< Bad Request */ PJ_STUN_SC_BAD_REQUEST = 400, /**< Bad Request */
PJ_STUN_SC_UNAUTHORIZED = 401, /**< Unauthorized */ PJ_STUN_SC_UNAUTHORIZED = 401, /**< Unauthorized */
PJ_STUN_SC_FORBIDDEN = 403, /**< Forbidden (TURN) */
PJ_STUN_SC_UNKNOWN_ATTRIBUTE = 420, /**< Unknown Attribute */ PJ_STUN_SC_UNKNOWN_ATTRIBUTE = 420, /**< Unknown Attribute */
#if 0 #if 0
/* These were obsolete in recent rfc3489bis */ /* These were obsolete in recent rfc3489bis */
//PJ_STUN_SC_STALE_CREDENTIALS = 430, /**< Stale Credentials */ //PJ_STUN_SC_STALE_CREDENTIALS = 430, /**< Stale Credentials */
//PJ_STUN_SC_INTEGRITY_CHECK_FAILURE= 431, /**< Integrity Chk Fail */ //PJ_STUN_SC_INTEGRITY_CHECK_FAILURE= 431, /**< Integrity Chk Fail */
//PJ_STUN_SC_MISSING_USERNAME = 432, /**< Missing Username */ //PJ_STUN_SC_MISSING_USERNAME = 432, /**< Missing Username */
//PJ_STUN_SC_USE_TLS = 433, /**< Use TLS */ //PJ_STUN_SC_USE_TLS = 433, /**< Use TLS */
//PJ_STUN_SC_MISSING_REALM = 434, /**< Missing Realm */ //PJ_STUN_SC_MISSING_REALM = 434, /**< Missing Realm */
//PJ_STUN_SC_MISSING_NONCE = 435, /**< Missing Nonce */ //PJ_STUN_SC_MISSING_NONCE = 435, /**< Missing Nonce */
//PJ_STUN_SC_UNKNOWN_USERNAME = 436, /**< Unknown Username */ //PJ_STUN_SC_UNKNOWN_USERNAME = 436, /**< Unknown Username */
#endif #endif
PJ_STUN_SC_ALLOCATION_MISMATCH = 437, /**< TURN Alloc Mismatch */ PJ_STUN_SC_ALLOCATION_MISMATCH = 437, /**< TURN Alloc Mismatch */
PJ_STUN_SC_STALE_NONCE = 438, /**< Stale Nonce */ PJ_STUN_SC_STALE_NONCE = 438, /**< Stale Nonce */
PJ_STUN_SC_TRANSITIONING = 439, /**< Transitioning. */ PJ_STUN_SC_TRANSITIONING = 439, /**< Transitioning. */
PJ_STUN_SC_WRONG_CREDENTIALS = 441, /**< TURN Wrong Credentials */ PJ_STUN_SC_WRONG_CREDENTIALS = 441, /**< TURN Wrong Credentials */
PJ_STUN_SC_UNSUPP_TRANSPORT_PROTO = 442, /**< Unsupported Transport or PJ_STUN_SC_UNSUPP_TRANSPORT_PROTO = 442, /**< Unsupported Transport or
Protocol (TURN) */ Protocol (TURN) */
PJ_STUN_SC_INVALID_IP_ADDR = 443, /**< Invalid IP Address(TURN
)*/
PJ_STUN_SC_INVALID_PORT = 444, /**< Invalid Port (TURN)
*/
PJ_STUN_SC_OPER_TCP_ONLY = 445, /**< Operation for TCP Only */ PJ_STUN_SC_OPER_TCP_ONLY = 445, /**< Operation for TCP Only */
PJ_STUN_SC_CONNECTION_FAILURE = 446, /**< Connection Failure */ PJ_STUN_SC_CONNECTION_FAILURE = 446, /**< Connection Failure */
PJ_STUN_SC_CONNECTION_TIMEOUT = 447, /**< Connection Timeout */ PJ_STUN_SC_CONNECTION_TIMEOUT = 447, /**< Connection Timeout */
PJ_STUN_SC_ALLOCATION_QUOTA_REACHED = 486, /**< Allocation Quota Reach ed PJ_STUN_SC_ALLOCATION_QUOTA_REACHED = 486, /**< Allocation Quota Reach ed
(TURN) */ (TURN) */
PJ_STUN_SC_ROLE_CONFLICT = 487, /**< Role Conflict */ PJ_STUN_SC_ROLE_CONFLICT = 487, /**< Role Conflict */
PJ_STUN_SC_SERVER_ERROR = 500, /**< Server Error */ PJ_STUN_SC_SERVER_ERROR = 500, /**< Server Error */
PJ_STUN_SC_INSUFFICIENT_CAPACITY = 507, /**< Insufficient Capacity PJ_STUN_SC_INSUFFICIENT_CAPACITY = 508, /**< Insufficient Capacity
(TURN) */
PJ_STUN_SC_INSUFFICIENT_PORT_CAPACITY=508, /**< Insufficient Port Capa
city
(TURN) */ (TURN) */
PJ_STUN_SC_GLOBAL_FAILURE = 600 /**< Global Failure */ PJ_STUN_SC_GLOBAL_FAILURE = 600 /**< Global Failure */
} pj_stun_status; } pj_stun_status;
/** /**
* This structure describes STUN message header. A STUN message has the * This structure describes STUN message header. A STUN message has the
* following format: * following format:
* *
* \verbatim * \verbatim
skipping to change at line 866 skipping to change at line 884
/** /**
* This describes STUN BANDWIDTH attribute. * This describes STUN BANDWIDTH attribute.
* The bandwidth attribute represents the peak bandwidth, measured in * The bandwidth attribute represents the peak bandwidth, measured in
* kbits per second, that the client expects to use on the binding. The * kbits per second, that the client expects to use on the binding. The
* value represents the sum in the receive and send directions. * value represents the sum in the receive and send directions.
*/ */
typedef struct pj_stun_uint_attr pj_stun_bandwidth_attr; typedef struct pj_stun_uint_attr pj_stun_bandwidth_attr;
/** /**
* This describes the STUN PEER-ADDRESS attribute. * This describes the STUN XOR-PEER-ADDRESS attribute.
* The PEER-ADDRESS specifies the address and port of the peer as seen * The XOR-PEER-ADDRESS specifies the address and port of the peer as seen
* from the TURN server. It is encoded in the same way as XOR-MAPPED- * from the TURN server. It is encoded in the same way as XOR-MAPPED-
* ADDRESS. * ADDRESS.
*/ */
typedef struct pj_stun_sockaddr_attr pj_stun_peer_addr_attr; typedef struct pj_stun_sockaddr_attr pj_stun_xor_peer_addr_attr;
/** /**
* This describes the STUN DATA attribute. * This describes the STUN DATA attribute.
* The DATA attribute is present in Send Indications and Data * The DATA attribute is present in Send Indications and Data
* Indications. It contains raw payload data that is to be sent (in the * Indications. It contains raw payload data that is to be sent (in the
* case of a Send Request) or was received (in the case of a Data * case of a Send Request) or was received (in the case of a Data
* Indication).. * Indication)..
*/ */
typedef struct pj_stun_binary_attr pj_stun_data_attr; typedef struct pj_stun_binary_attr pj_stun_data_attr;
/** /**
* This describes the STUN RELAYED-ADDRESS attribute. * This describes the STUN XOR-RELAYED-ADDRESS attribute. The
* The RELAYED-ADDRESS is present in Allocate responses. It specifies the * XOR-RELAYED-ADDRESS is present in Allocate responses. It specifies the
* address and port that the server allocated to the client. It is * address and port that the server allocated to the client. It is
* encoded in the same way as XOR-MAPPED-ADDRESS. * encoded in the same way as XOR-MAPPED-ADDRESS.
*/ */
typedef struct pj_stun_sockaddr_attr pj_stun_relayed_addr_attr; typedef struct pj_stun_sockaddr_attr pj_stun_xor_relayed_addr_attr;
/** /**
* This describes the REQUESTED-ADDRESS-TYPE attribute. * This describes the REQUESTED-ADDRESS-TYPE attribute.
* The REQUESTED-ADDRESS-TYPE attribute is used by clients to request * The REQUESTED-ADDRESS-TYPE attribute is used by clients to request
* the allocation of a specific address type from a server. The * the allocation of a specific address type from a server. The
* following is the format of the REQUESTED-ADDRESS-TYPE attribute. * following is the format of the REQUESTED-ADDRESS-TYPE attribute.
\verbatim \verbatim
0 1 2 3 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Family | Reserved | | Family | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\endverbatim \endverbatim
*/ */
typedef struct pj_stun_uint_attr pj_stun_req_addr_type; typedef struct pj_stun_uint_attr pj_stun_req_addr_type_attr;
/** /**
* This describes the TURN REQUESTED-PROPS attribute, encoded as * This describes the TURN REQUESTED-TRANSPORT attribute, encoded in
* STUN 32bit integer attribute. Few macros are provided to manipulate * STUN generic integer attribute.
* the values in this attribute: #PJ_STUN_GET_PROP_TYPE(), and
* #PJ_STUN_SET_PROP_TYPE().
*
* This attribute allows the client to request that the allocation have
* certain properties, and by the server to indicate which properties
* are supported. The attribute is 32 bits long. Its format is:
\verbatim
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Prop-type | Reserved = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\endverbatim
* The field labeled "Prop-type" is an 8-bit field specifying the
* desired property. The rest of the attribute is RFFU (Reserved For
* Future Use) and MUST be set to 0 on transmission and ignored on
* reception.
* *
* The "Prop-type" field is formatted as follows: * This attribute allows the client to request that the port in the
* relayed-transport-address be even, and (optionally) that the server
\verbatim * reserve the next-higher port number. The attribute is 8 bits long.
* Its format is:
\verbatim
0
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
|E|R|P| | |R| RFFU |
+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
\endverbatim \endverbatim
The bits in "Prop-type" are:
E: If 1, the port number for the relayed-transport-address must be
even. If 0, the port number can be even or odd.
R: If 1, the server must reserve the next highest port for a
subsequent allocation. If 0, no such reservation is requested.
If the client sets the R bit to 1, it MUST also set the E bit to 1
(however, the E bit may be 1 when the R bit is 0).
P: If 1, the allocation must be a Preserving allocation. If 0, the
allocation can be either Preserving or Non-Preserving.
*/
typedef struct pj_stun_uint_attr pj_stun_req_props_attr;
/**
* Get the 8bit Prop-type value from a 32bit integral value of TURN
* TURN REQUESTED-PROPS attribute.
*/
#define PJ_STUN_GET_PROP_TYPE(u32) (u32 >> 24)
/** * The attribute contains a single 1-bit flag:
* Convert 8bit Prop-type value to a 32bit integral value of TURN *
* REQUESTED-PROPS attribute. * R: If 1, the server is requested to reserve the next higher port
* number (on the same IP address) for a subsequent allocation. If
* 0, no such reservation is requested.
*
* The other 7 bits of the attribute must be set to zero on transmission
* and ignored on reception.
*/ */
#define PJ_STUN_SET_PROP_TYPE(PropType) (PropType << 24) typedef struct pj_stun_uint_attr pj_stun_even_port_attr;
/** /**
* This describes the TURN REQUESTED-TRANSPORT attribute, encoded in * This describes the TURN REQUESTED-TRANSPORT attribute, encoded in
* STUN generic integer attribute. * STUN generic integer attribute.
* *
* This attribute is used by the client to request a specific transport * This attribute is used by the client to request a specific transport
* protocol for the allocated transport address. It has the following * protocol for the allocated transport address. It has the following
* format: * format:
\verbatim \verbatim
skipping to change at line 1013 skipping to change at line 996
*/ */
#define PJ_STUN_GET_RT_PROTO(u32) (u32 >> 24) #define PJ_STUN_GET_RT_PROTO(u32) (u32 >> 24)
/** /**
* Convert protocol value to be placed in 32bit TURN REQUESTED-TRANSPORT * Convert protocol value to be placed in 32bit TURN REQUESTED-TRANSPORT
* attribute. * attribute.
*/ */
#define PJ_STUN_SET_RT_PROTO(proto) (((pj_uint32_t)(proto)) << 24) #define PJ_STUN_SET_RT_PROTO(proto) (((pj_uint32_t)(proto)) << 24)
/** /**
* This describes the TURN DONT-FRAGMENT attribute.
*
* This attribute is used by the client to request that the server set
* the DF (Don't Fragment) bit in the IP header when relaying the
* application data onward to the peer. This attribute has no value
* part and thus the attribute length field is 0.
*/
typedef struct pj_stun_empty_attr pj_stun_dont_fragment_attr;
/**
* This describes the TURN RESERVATION-TOKEN attribute. * This describes the TURN RESERVATION-TOKEN attribute.
* The RESERVATION-TOKEN attribute contains a token that uniquely * The RESERVATION-TOKEN attribute contains a token that uniquely
* identifies a relayed transport address being held in reserve by the * identifies a relayed transport address being held in reserve by the
* server. The server includes this attribute in a success response to * server. The server includes this attribute in a success response to
* tell the client about the token, and the client includes this * tell the client about the token, and the client includes this
* attribute in a subsequent Allocate request to request the server use * attribute in a subsequent Allocate request to request the server use
* that relayed transport address for the allocation. * that relayed transport address for the allocation.
* *
* The attribute value is a 64-bit-long field containing the token * The attribute value is a 64-bit-long field containing the token
* value. * value.
 End of changes. 23 change blocks. 
77 lines changed or deleted 69 lines changed or added


 stun_session.h   stun_session.h 
/* $Id: stun_session.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: stun_session.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 39 skipping to change at line 39
#include <pjnath/stun_auth.h> #include <pjnath/stun_auth.h>
#include <pjnath/stun_config.h> #include <pjnath/stun_config.h>
#include <pjnath/stun_transaction.h> #include <pjnath/stun_transaction.h>
#include <pj/list.h> #include <pj/list.h>
#include <pj/timer.h> #include <pj/timer.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJNATH_STUN_SESSION STUN Client/Server Session * @addtogroup PJNATH_STUN_SESSION
* @brief STUN client and server session
* @ingroup PJNATH_STUN
* @{ * @{
*
* This is is a transport-independent object to manage a client or server
* STUN session. It has the following features:
*
* - <b>transport independent</b>:\n
* the object does not have it's own socket, but rather it provides
* functions and callbacks to send and receive packets. This way the
* object can be used by different transport types (e.g. UDP, TCP,
* TLS, etc.) as well as better integration to application which
* already has its own means to send and receive packets.
*
* - <b>authentication management</b>:\n
* the object manages STUN authentication throughout the lifetime of
* the session. For client sessions, once it's given a credential to
* authenticate itself with the server, the object will automatically
* add authentication info (the MESSAGE-INTEGRITY) to the request as
* well as authenticate the response. It will also handle long-term
* authentication challenges, including handling of nonce expiration,
* and retry the request automatically. For server sessions, it can
* be configured to authenticate incoming requests automatically.
*
* - <b>static or dynamic credential</b>:\n
* application may specify static or dynamic credential to be used by
* the STUN session. Static credential means a static combination of
* username and password (and these cannot change during the session
* duration), while dynamic credential provides callback to ask the
* application about which username/password to use everytime
* authentication is about to be performed.
*
* - <b>client transaction management</b>:\n
* outgoing requests may be sent with a STUN transaction for reliability
,
* and the object will manage the transaction internally (including
* performing retransmissions). Application will be notified about the
* result of the request when the response arrives (or the transaction
* times out). When the request is challenged with authentication, the
* object will retry the request with new authentication info, and
* application will be notified about the final result of this request.
*
* - <b>server transaction management</b>:\n
* application may ask response to incoming requests to be cached by
* the object, and in this case the object will check for cached
* response everytime request is received. The cached response will be
* deleted once a timer expires.
*
* \section using_stun_sess_sec Using the STUN session
*
* The following steps describes how to use the STUN session:
*
* - <b>create the object configuration</b>:\n
* The #pj_stun_config contains the configuration to create the STUN
* session, such as the timer heap to register internal timers and
* various STUN timeout values. You can initialize this structure by
* calling #pj_stun_config_init()
*
* - <b>create the STUN session</b>:\n
* by calling #pj_stun_session_create(). Among other things, this
* function requires the instance of #pj_stun_config and also
* #pj_stun_session_cb structure which stores callbacks to send
* outgoing packets as well as to notify application about incoming
* STUN requests, responses, and indicates and other events.
*
* - <b>configure credential:</b>\n
* if authentication is required for the session, configure the
* credential with #pj_stun_session_set_credential()
*
* - <b>configuring other settings:</b>\n
* several APIs are provided to configure the behavior of the STUN
* session (for example, to set the SOFTWARE attribute value, controls
* the logging behavior, fine tune the mutex locking, etc.). Please see
* the API reference for more info.
*
* - <b>creating outgoing STUN requests or indications:</b>\n
* create the STUN message by using #pj_stun_session_create_req() or
* #pj_stun_session_create_ind(). This will create a transmit data
* buffer containing a blank STUN request or indication. You will then
* typically need to add STUN attributes that are relevant to the
* request or indication, but note that some default attributes will
* be added by the session later when the message is sent (such as
* SOFTWARE attribute and attributes related to authentication).
* The message is now ready to be sent.
*
* - <b>sending outgoing message:</b>\n
* use #pj_stun_session_send_msg() to send outgoing STUN messages (this
* includes STUN requests, indications, and responses). The function has
* options whether to retransmit the request (for non reliable transport
s)
* or to cache the response if we're sending response. This function in
* turn will call the \a on_send_msg() callback of #pj_stun_session_cb
* to request the application to send the packet.
*
* - <b>handling incoming packet:</b>\n
* call #pj_stun_session_on_rx_pkt() everytime the application receives
* a STUN packet. This function will decode the packet and process the
* packet according to the message, and normally this will cause one
* of the callback in the #pj_stun_session_cb to be called to notify
* the application about the event.
*
* - <b>handling incoming requests:</b>\n
* incoming requests are notified to application in the \a on_rx_request
* callback of the #pj_stun_session_cb. If authentication is enabled in
* the session, the application will only receive this callback after
* the incoming request has been authenticated (if the authentication
* fails, the session would respond automatically with 401 error and
* the callback will not be called). Application now must create and
* send response for this request.
*
* - <b>creating and sending response:</b>\n
* create the STUN response with #pj_stun_session_create_res(). This wil
l
* create a transmit data buffer containing a blank STUN response. You
* will then typically need to add STUN attributes that are relevant to
* the response, but note that some default attributes will
* be added by the session later when the message is sent (such as
* SOFTWARE attribute and attributes related to authentication).
* The message is now ready to be sent. Use #pj_stun_session_send_msg()
* (as explained above) to send the response.
*
* - <b>convenient way to send response:</b>\n
* the #pj_stun_session_respond() is provided as a convenient way to
* create and send simple STUN responses, such as error responses.
*
* - <b>destroying the session:</b>\n
* once the session is done, use #pj_stun_session_destroy() to destroy
* the session.
*/ */
/** Forward declaration for pj_stun_tx_data */ /** Forward declaration for pj_stun_tx_data */
typedef struct pj_stun_tx_data pj_stun_tx_data; typedef struct pj_stun_tx_data pj_stun_tx_data;
/** Forward declaration for pj_stun_rx_data */ /** Forward declaration for pj_stun_rx_data */
typedef struct pj_stun_rx_data pj_stun_rx_data; typedef struct pj_stun_rx_data pj_stun_rx_data;
/** Forward declaration for pj_stun_session */ /** Forward declaration for pj_stun_session */
typedef struct pj_stun_session pj_stun_session; typedef struct pj_stun_session pj_stun_session;
skipping to change at line 322 skipping to change at line 442
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param lock New lock instance to be used by the STUN session. * @param lock New lock instance to be used by the STUN session.
* @param auto_del Specify whether STUN session should destroy this * @param auto_del Specify whether STUN session should destroy this
* lock instance when it's destroyed. * lock instance when it's destroyed.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_set_lock(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_set_lock(pj_stun_session *sess,
pj_lock_t *lock, pj_lock_t *lock,
pj_bool_t auto_del); pj_bool_t auto_del);
/** /**
* Set server name to be included in all response. * Set SOFTWARE name to be included in all requests and responses.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param srv_name Server name string. * @param sw Software name string. If this argument is NULL or
* empty, the session will not include SOFTWARE attribute
* in STUN requests and responses.
* *
* @return The user data associated with this STUN session. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_set_server_name(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_set_software_name(pj_stun_session *ses
const pj_str_t *srv_nam s,
e); const pj_str_t *sw);
/** /**
* Set credential to be used by this session. Once credential is set, all * Set credential to be used by this session. Once credential is set, all
* outgoing messages will include MESSAGE-INTEGRITY, and all incoming * outgoing messages will include MESSAGE-INTEGRITY, and all incoming
* message will be authenticated against this credential. * message will be authenticated against this credential.
* *
* To disable authentication after it has been set, call this function * To disable authentication after it has been set, call this function
* again with NULL as the argument. * again with NULL as the argument.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
 End of changes. 7 change blocks. 
10 lines changed or deleted 135 lines changed or added


 stun_sock.h   stun_sock.h 
/* $Id: stun_sock.h 2484 2009-03-04 12:56:32Z bennylp $ */ /* $Id: stun_sock.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 35 skipping to change at line 35
* @brief STUN aware socket transport * @brief STUN aware socket transport
*/ */
#include <pjnath/stun_config.h> #include <pjnath/stun_config.h>
#include <pjlib-util/resolver.h> #include <pjlib-util/resolver.h>
#include <pj/ioqueue.h> #include <pj/ioqueue.h>
#include <pj/sock.h> #include <pj/sock.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJNATH_STUN_SOCK STUN aware socket transport * @addtogroup PJNATH_STUN_SOCK
* @brief STUN aware socket transport
* @ingroup PJNATH_STUN
* @{ * @{
* *
* The STUN transport provides asynchronous UDP like socket transport * The STUN transport provides asynchronous UDP like socket transport
* with the additional capability to query the publicly mapped transport * with the additional STUN capability. It has the following features:
* address (using STUN resolution), to refresh the NAT binding, and to *
* demultiplex internal STUN messages from application data (the * - API to send and receive UDP packets
* application data may be a STUN message as well). *
* - multiplex STUN and non-STUN incoming packets and distinguish between
* STUN responses that belong to internal requests with application data
* (the application data may be STUN packets as well)
*
* - DNS SRV resolution to the STUN server (if wanted), along with fallbac
k
* to DNS A resolution if SRV record is not found.
*
* - STUN keep-alive maintenance, and handle changes to the mapped address
* (when the NAT binding changes)
*
*/ */
/** /**
* Opaque type to represent a STUN transport. * Opaque type to represent a STUN transport.
*/ */
typedef struct pj_stun_sock pj_stun_sock; typedef struct pj_stun_sock pj_stun_sock;
/** /**
* Types of operation being reported in \a on_status() callback of * Types of operation being reported in \a on_status() callback of
* pj_stun_sock_cb. Application may retrieve the string representation * pj_stun_sock_cb. Application may retrieve the string representation
skipping to change at line 268 skipping to change at line 276
* @param af Address family of socket. Currently pj_AF_INET() * @param af Address family of socket. Currently pj_AF_INET()
* and pj_AF_INET6() are supported. * and pj_AF_INET6() are supported.
* @param name Optional name to be given to this transport to * @param name Optional name to be given to this transport to
* assist debugging. * assist debugging.
* @param cb Callback to receive events/data from the transport. * @param cb Callback to receive events/data from the transport.
* @param cfg Optional transport settings. * @param cfg Optional transport settings.
* @param user_data Arbitrary application data to be associated with * @param user_data Arbitrary application data to be associated with
* this transport. * this transport.
* @param p_sock Pointer to receive the created transport instance. * @param p_sock Pointer to receive the created transport instance.
* *
* @restun PJ_SUCCESS if the operation has been successful, * @return PJ_SUCCESS if the operation has been successful,
* or the appropriate error code on failure. * or the appropriate error code on failure.
*/ */
PJ_DECL(pj_status_t) pj_stun_sock_create(pj_stun_config *stun_cfg, PJ_DECL(pj_status_t) pj_stun_sock_create(pj_stun_config *stun_cfg,
const char *name, const char *name,
int af, int af,
const pj_stun_sock_cb *cb, const pj_stun_sock_cb *cb,
const pj_stun_sock_cfg *cfg, const pj_stun_sock_cfg *cfg,
void *user_data, void *user_data,
pj_stun_sock **p_sock); pj_stun_sock **p_sock);
skipping to change at line 319 skipping to change at line 327
PJ_DECL(pj_status_t) pj_stun_sock_start(pj_stun_sock *stun_sock, PJ_DECL(pj_status_t) pj_stun_sock_start(pj_stun_sock *stun_sock,
const pj_str_t *domain, const pj_str_t *domain,
pj_uint16_t default_port, pj_uint16_t default_port,
pj_dns_resolver *resolver); pj_dns_resolver *resolver);
/** /**
* Destroy the STUN transport. * Destroy the STUN transport.
* *
* @param sock The STUN transport socket. * @param sock The STUN transport socket.
* *
* @restun PJ_SUCCESS if the operation has been successful, * @return PJ_SUCCESS if the operation has been successful,
* or the appropriate error code on failure. * or the appropriate error code on failure.
*/ */
PJ_DECL(pj_status_t) pj_stun_sock_destroy(pj_stun_sock *sock); PJ_DECL(pj_status_t) pj_stun_sock_destroy(pj_stun_sock *sock);
/** /**
* Associate a user data with this STUN transport. The user data may then * Associate a user data with this STUN transport. The user data may then
* be retrieved later with #pj_stun_sock_get_user_data(). * be retrieved later with #pj_stun_sock_get_user_data().
* *
* @param stun_sock The STUN transport instance. * @param stun_sock The STUN transport instance.
* @param user_data Arbitrary data. * @param user_data Arbitrary data.
* *
* @restun PJ_SUCCESS if the operation has been successful, * @return PJ_SUCCESS if the operation has been successful,
* or the appropriate error code on failure. * or the appropriate error code on failure.
*/ */
PJ_DECL(pj_status_t) pj_stun_sock_set_user_data(pj_stun_sock *stun_sock, PJ_DECL(pj_status_t) pj_stun_sock_set_user_data(pj_stun_sock *stun_sock,
void *user_data); void *user_data);
/** /**
* Retrieve the previously assigned user data associated with this STUN * Retrieve the previously assigned user data associated with this STUN
* transport. * transport.
* *
* @param stun_sock The STUN transport instance. * @param stun_sock The STUN transport instance.
* *
* @restun The user/application data. * @return The user/application data.
*/ */
PJ_DECL(void*) pj_stun_sock_get_user_data(pj_stun_sock *stun_sock); PJ_DECL(void*) pj_stun_sock_get_user_data(pj_stun_sock *stun_sock);
/** /**
* Get the STUN transport info. The transport info contains, among other * Get the STUN transport info. The transport info contains, among other
* things, the allocated relay address. * things, the allocated relay address.
* *
* @param stun_sock The STUN transport instance. * @param stun_sock The STUN transport instance.
* @param info Pointer to be filled with STUN transport info. * @param info Pointer to be filled with STUN transport info.
* *
* @restun PJ_SUCCESS if the operation has been successful, * @return PJ_SUCCESS if the operation has been successful,
* or the appropriate error code on failure. * or the appropriate error code on failure.
*/ */
PJ_DECL(pj_status_t) pj_stun_sock_get_info(pj_stun_sock *stun_sock, PJ_DECL(pj_status_t) pj_stun_sock_get_info(pj_stun_sock *stun_sock,
pj_stun_sock_info *info); pj_stun_sock_info *info);
/** /**
* Send a data to the specified address. This function may complete * Send a data to the specified address. This function may complete
* asynchronously and in this case \a on_data_sent() will be called. * asynchronously and in this case \a on_data_sent() will be called.
* *
* @param stun_sock The STUN transport instance. * @param stun_sock The STUN transport instance.
* @param op_key Optional send key for sending the packet down to * @param send_key Optional send key for sending the packet down to
* the ioqueue. This value will be given back to * the ioqueue. This value will be given back to
* \a on_data_sent() callback * \a on_data_sent() callback
* @param pkt The data/packet to be sent to peer. * @param pkt The data/packet to be sent to peer.
* @param pkt_len Length of the data. * @param pkt_len Length of the data.
* @param flag pj_ioqueue_sendto() flag. * @param flag pj_ioqueue_sendto() flag.
* @param dst_addr The remote address. * @param dst_addr The remote address.
* @param addr_len Length of the address. * @param addr_len Length of the address.
* *
* @return PJ_SUCCESS if data has been sent immediately, or * @return PJ_SUCCESS if data has been sent immediately, or
* PJ_EPENDING if data cannot be sent immediately. In * PJ_EPENDING if data cannot be sent immediately. In
 End of changes. 9 change blocks. 
14 lines changed or deleted 23 lines changed or added


 stun_transaction.h   stun_transaction.h 
/* $Id: stun_transaction.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: stun_transaction.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 37 skipping to change at line 37
#include <pjnath/stun_msg.h> #include <pjnath/stun_msg.h>
#include <pjnath/stun_config.h> #include <pjnath/stun_config.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJNATH_STUN_TRANSACTION STUN Client Transaction * @defgroup PJNATH_STUN_TRANSACTION STUN Client Transaction
* @brief STUN client transaction * @brief STUN client transaction
* @ingroup PJNATH_STUN * @ingroup PJNATH_STUN_BASE
* @{ * @{
* *
The @ref PJNATH_STUN_TRANSACTION is used to manage outgoing STUN request, The @ref PJNATH_STUN_TRANSACTION is used to manage outgoing STUN request,
for example to retransmit the request and to notify application about the for example to retransmit the request and to notify application about the
completion of the request. completion of the request.
The @ref PJNATH_STUN_TRANSACTION does not use any networking operations, The @ref PJNATH_STUN_TRANSACTION does not use any networking operations,
but instead application must supply the transaction with a callback to but instead application must supply the transaction with a callback to
be used by the transaction to send outgoing requests. This way the STUN be used by the transaction to send outgoing requests. This way the STUN
transaction is made more generic and can work with different types of transaction is made more generic and can work with different types of
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 transport_srtp.h   transport_srtp.h 
/* $Id: transport_srtp.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: transport_srtp.h 2597 2009-04-14 15:18:30Z nanang $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 191 skipping to change at line 191
pjmedia_srtp_use use; pjmedia_srtp_use use;
/** /**
* Specify the peer's usage policy. * Specify the peer's usage policy.
*/ */
pjmedia_srtp_use peer_use; pjmedia_srtp_use peer_use;
} pjmedia_srtp_info; } pjmedia_srtp_info;
/** /**
* Initialize SRTP library. This function should be called before
* any SRTP functions, however calling #pjmedia_transport_srtp_create()
* will also invoke this function. This function will also register SRTP
* library deinitialization to #pj_atexit(), so the deinitialization
* of SRTP library will be performed automatically by PJLIB destructor.
*/
PJ_DECL(pj_status_t) pjmedia_srtp_init_lib(void);
/**
* Initialize SRTP setting with its default values. * Initialize SRTP setting with its default values.
* *
* @param opt SRTP setting to be initialized. * @param opt SRTP setting to be initialized.
*/ */
PJ_DECL(void) pjmedia_srtp_setting_default(pjmedia_srtp_setting *opt); PJ_DECL(void) pjmedia_srtp_setting_default(pjmedia_srtp_setting *opt);
/** /**
* Create an SRTP media transport. * Create an SRTP media transport.
* *
* @param endpt The media endpoint instance. * @param endpt The media endpoint instance.
 End of changes. 2 change blocks. 
1 lines changed or deleted 10 lines changed or added


 turn_session.h   turn_session.h 
/* $Id: turn_session.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: turn_session.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 32 skipping to change at line 32
/** /**
* @file turn_session.h * @file turn_session.h
* @brief Transport independent TURN client session. * @brief Transport independent TURN client session.
*/ */
#include <pjnath/stun_session.h> #include <pjnath/stun_session.h>
#include <pjlib-util/resolver.h> #include <pjlib-util/resolver.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/**
* @defgroup PJNATH_TURN TURN Client Library
*/
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJNATH_TURN_SESSION Transport independent TURN client session @addtogroup PJNATH_TURN_SESSION
* @brief Transport independent TURN client session @{
* @ingroup PJNATH_TURN
* @{ The \ref PJNATH_TURN_SESSION is a transport-independent object to
* manage a client TURN session. It contains the core logic for manage
* This module describes the transport independent TURN client session. Thi the TURN client session as listed in \ref turn_op_sec, but
s in transport-independent manner (i.e. it doesn't have a socket), so
* interface is provided for implementors of a TURN client transport, and that developer can integrate TURN client functionality into existing
* application usually will want to use \ref PJNATH_TURN_SOCK instead. framework that already has its own means to send and receive data,
* or to support new transport types to TURN, such as TLS.
* The transport independent TURN client session is created to facilitate
* the creation of different types of transports between the client and the \section turn_sess_using_sec Using the TURN session
* TURN server.
These steps describes how to use the TURN session:
- <b>Creating the session</b>:\n
use #pj_turn_session_create() to create the session.
- <b>Configuring credential</b>:\n
all TURN operations requires the use of authentication (it uses STUN
long term autentication method). Use #pj_turn_session_set_credential()
to configure the TURN credential to be used by the session.
- <b>Configuring server</b>:\n
application must call #pj_turn_session_set_server() before it can send
Allocate request (with pj_turn_session_alloc()). This function will
resolve the TURN server using DNS SRV resolution if the \a resolver
is set. The server resolution process will complete asynchronously,
and application will be notified in \a on_state() callback of the
#pj_turn_session_cb structurewith the session state set to
PJ_TURN_STATE_RESOLVED.
- <b>Creating allocation</b>:\n
create one "relay port" (or called <b>relayed-transport-address</b>
in TURN terminology) in the TURN server by using #pj_turn_session_alloc(
).
This will send Allocate request to the server. This function will comple
te
immediately, and application will be notified about the allocation
result in the \a on_state() callback of the #pj_turn_session_cb structur
e.
- <b>Getting the allocation result</b>:\n
if allocation is successful, the session state will progress to
\a PJ_TURN_STATE_READY, otherwise the state will be
\a PJ_TURN_STATE_DEALLOCATED or higher. Session state progression is
reported in the \a on_state() callback of the #pj_turn_session_cb
structure. On successful allocation, application may retrieve the
allocation info by calling #pj_turn_session_get_info().
- <b>Sending data through the relay</b>.\n
Once allocation has been created, client may send data to any remote
endpoints (called peers in TURN terminology) via the "relay port". It do
es
so by calling #pj_turn_session_sendto(), giving the peer address
in the function argument. But note that at this point peers are not allo
wed
to send data towards the client (via the "relay port") before permission
is
installed for that peer.
- <b>Creating permissions</b>.\n
Permission needs to be created in the TURN server so that a peer can sen
d
data to the client via the relay port (a peer in this case is identified
by
its IP address). Without this, when the TURN server receives data from t
he
peer in the "relay port", it will drop this data. Create the permission
by
calling #pj_turn_session_set_perm(), specifying the peer IP address in t
he
argument (the port part of the address is ignored). More than one IP
addresses may be specified.
- <b>Receiving data from peers</b>.\n
Once permission has been installed for the peer, any data received by th
e
TURN server (from that peer) in the "relay port" will be relayed back to
client by the server, and application will be notified via \a on_rx_data
callback of the #pj_turn_session_cb.
- <b>Using ChannelData</b>.\n
TURN provides optimized framing to the data by using ChannelData
packetization. The client activates this format for the specified peer b
y
calling #pj_turn_session_bind_channel(). Data sent or received to/for
this peer will then use ChannelData format instead of Send or Data
Indications.
- <b>Refreshing the allocation, permissions, and channel bindings</b>.\n
Allocations, permissions, and channel bindings will be refreshed by the
session automatically when they about to expire.
- <b>Destroying the allocation</b>.\n
Once the "relay port" is no longer needed, client destroys the allocatio
n
by calling #pj_turn_session_shutdown(). This function will return
immediately, and application will be notified about the deallocation
result in the \a on_state() callback of the #pj_turn_session_cb structur
e.
Once the state has reached PJ_TURN_STATE_DESTROYING, application must
assume that the session will be destroyed shortly after.
*/ */
/** /**
* Opaque declaration for TURN client session. * Opaque declaration for TURN client session.
*/ */
typedef struct pj_turn_session pj_turn_session; typedef struct pj_turn_session pj_turn_session;
/** /**
* TURN transport types, which will be used both to specify the connection * TURN transport types, which will be used both to specify the connection
* type for reaching TURN server and the type of allocation transport to be * type for reaching TURN server and the type of allocation transport to be
skipping to change at line 424 skipping to change at line 497
/** /**
* Configure message logging. By default all flags are enabled. * Configure message logging. By default all flags are enabled.
* *
* @param sess The TURN client session. * @param sess The TURN client session.
* @param flags Bitmask combination of #pj_stun_sess_msg_log _flag * @param flags Bitmask combination of #pj_stun_sess_msg_log _flag
*/ */
PJ_DECL(void) pj_turn_session_set_log(pj_turn_session *sess, PJ_DECL(void) pj_turn_session_set_log(pj_turn_session *sess,
unsigned flags); unsigned flags);
/** /**
* Configure the SOFTWARE name to be sent in all STUN requests by the
* TURN session.
*
* @param sess The TURN client session.
* @param sw Software name string. If this argument is NULL or
* empty, the session will not include SOFTWARE attribute
* in STUN requests and responses.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_turn_session_set_software_name(pj_turn_session *ses
s,
const pj_str_t *sw);
/**
* Set the server or domain name of the server. Before the application * Set the server or domain name of the server. Before the application
* can send Allocate request (with pj_turn_session_alloc()), it must first * can send Allocate request (with pj_turn_session_alloc()), it must first
* resolve the server address(es) using this function. This function will * resolve the server address(es) using this function. This function will
* resolve the TURN server using DNS SRV resolution if the \a resolver * resolve the TURN server using DNS SRV resolution if the \a resolver
* is set. The server resolution process will complete asynchronously, * is set. The server resolution process will complete asynchronously,
* and application will be notified in \a on_state() callback with the * and application will be notified in \a on_state() callback with the
* session state set to PJ_TURN_STATE_RESOLVED. * session state set to PJ_TURN_STATE_RESOLVED.
* *
* Application may call with pj_turn_session_alloc() before the server * Application may call with pj_turn_session_alloc() before the server
* resolution completes. In this case, the operation will be queued by * resolution completes. In this case, the operation will be queued by
skipping to change at line 503 skipping to change at line 590
* @param sess The TURN client session. * @param sess The TURN client session.
* @param param Optional TURN allocation parameter. * @param param Optional TURN allocation parameter.
* *
* @return PJ_SUCCESS if the operation has been successfully * @return PJ_SUCCESS if the operation has been successfully
* initiated or the appropriate error code on failure. * initiated or the appropriate error code on failure.
*/ */
PJ_DECL(pj_status_t) pj_turn_session_alloc(pj_turn_session *sess, PJ_DECL(pj_status_t) pj_turn_session_alloc(pj_turn_session *sess,
const pj_turn_alloc_param *param) ; const pj_turn_alloc_param *param) ;
/** /**
* Create or renew permission in the TURN server for the specified peer IP
* addresses. Application must install permission for a particular (peer)
* IP address before it sends any data to that IP address, or otherwise
* the TURN server will drop the data.
*
* @param sess The TURN client session.
* @param addr_cnt Number of IP addresses.
* @param addr Array of peer IP addresses. Only the address family
* and IP address portion of the socket address matter.
* @param options Specify 1 to let the TURN client session automatical
ly
* renew the permission later when they are about to
* expire.
*
* @return PJ_SUCCESS if the operation has been successfully
* issued, or the appropriate error code. Note that
* the operation itself will complete asynchronously.
*/
PJ_DECL(pj_status_t) pj_turn_session_set_perm(pj_turn_session *sess,
unsigned addr_cnt,
const pj_sockaddr addr[],
unsigned options);
/**
* Send a data to the specified peer address via the TURN relay. This * Send a data to the specified peer address via the TURN relay. This
* function will encapsulate the data as STUN Send Indication or TURN * function will encapsulate the data as STUN Send Indication or TURN
* ChannelData packet and send the message to the TURN server. The TURN * ChannelData packet and send the message to the TURN server. The TURN
* server then will send the data to the peer. * server then will send the data to the peer.
* *
* The allocation (pj_turn_session_alloc()) must have been successfully * The allocation (pj_turn_session_alloc()) must have been successfully
* created before application can relay any data. * created before application can relay any data.
* *
* Since TURN session is transport independent, this function will * Since TURN session is transport independent, this function will
* ultimately call \a on_send_pkt() callback to request the application * ultimately call \a on_send_pkt() callback to request the application
 End of changes. 5 change blocks. 
18 lines changed or deleted 144 lines changed or added


 turn_sock.h   turn_sock.h 
/* $Id: turn_sock.h 2394 2008-12-23 17:27:53Z bennylp $ */ /* $Id: turn_sock.h 2642 2009-04-22 17:20:24Z bennylp $ */
/* /*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 33 skipping to change at line 33
/** /**
* @file turn_sock.h * @file turn_sock.h
* @brief TURN relay using UDP client as transport protocol * @brief TURN relay using UDP client as transport protocol
*/ */
#include <pjnath/turn_session.h> #include <pjnath/turn_session.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJNATH_TURN_SOCK TURN client transport @addtogroup PJNATH_TURN_SOCK
* @brief Client transport utilizing TURN relay @{
* @ingroup PJNATH_TURN
* @{ This is a ready to use object for relaying application data via a TURN serv
* er,
* The TURN relay client transport can be used to relay data from the clien by managing all the operations in \ref turn_op_sec.
t
* to peer via a TURN relay. The application establishes TURN connection to \section turnsock_using_sec Using TURN transport
* the TURN server using UDP or TCP as the transport, then creates a relay
* address in the TURN server to be advertised to remote peer(s) as the This object provides a thin wrapper to the \ref PJNATH_TURN_SESSION, hence
* transport address. When application sends data to a remote address via the
* this transport, the data will be sent via the TURN relay, and vice versa API is very much the same (apart from the obvious difference in the names).
. Please see \ref PJNATH_TURN_SESSION for the documentation on how to use the
session.
\section turnsock_samples_sec Samples
The \ref turn_client_sample is a sample application to use the
\ref PJNATH_TURN_SOCK.
Also see <b>\ref samples_page</b> for other samples.
*/ */
/** /**
* Opaque declaration for TURN client. * Opaque declaration for TURN client.
*/ */
typedef struct pj_turn_sock pj_turn_sock; typedef struct pj_turn_sock pj_turn_sock;
/** /**
* This structure contains callbacks that will be called by the TURN * This structure contains callbacks that will be called by the TURN
* transport. * transport.
skipping to change at line 201 skipping to change at line 210
* Set STUN message logging for this TURN session. * Set STUN message logging for this TURN session.
* See #pj_stun_session_set_log(). * See #pj_stun_session_set_log().
* *
* @param turn_sock The TURN transport instance. * @param turn_sock The TURN transport instance.
* @param flags Bitmask combination of #pj_stun_sess_msg_log _flag * @param flags Bitmask combination of #pj_stun_sess_msg_log _flag
*/ */
PJ_DECL(void) pj_turn_sock_set_log(pj_turn_sock *turn_sock, PJ_DECL(void) pj_turn_sock_set_log(pj_turn_sock *turn_sock,
unsigned flags); unsigned flags);
/** /**
* Configure the SOFTWARE name to be sent in all STUN requests by the
* TURN session.
*
* @param turn_sock The TURN transport instance.
* @param sw Software name string. If this argument is NULL or
* empty, the session will not include SOFTWARE attribute
* in STUN requests and responses.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_turn_sock_set_software_name(pj_turn_sock *turn_sock
,
const pj_str_t *sw);
/**
* Allocate a relay address/resource in the TURN server. This function * Allocate a relay address/resource in the TURN server. This function
* will resolve the TURN server using DNS SRV (if desired) and send TURN * will resolve the TURN server using DNS SRV (if desired) and send TURN
* \a Allocate request using the specified credential to allocate a relay * \a Allocate request using the specified credential to allocate a relay
* address in the server. This function completes asynchronously, and * address in the server. This function completes asynchronously, and
* application will be notified when the allocation process has been * application will be notified when the allocation process has been
* successful in the \a on_state() callback when the state is set to * successful in the \a on_state() callback when the state is set to
* PJ_TURN_STATE_READY. If the allocation fails, the state will be set * PJ_TURN_STATE_READY. If the allocation fails, the state will be set
* to PJ_TURN_STATE_DEALLOCATING or greater. * to PJ_TURN_STATE_DEALLOCATING or greater.
* *
* @param turn_sock The TURN transport instance. * @param turn_sock The TURN transport instance.
skipping to change at line 243 skipping to change at line 266
* *
*/ */
PJ_DECL(pj_status_t) pj_turn_sock_alloc(pj_turn_sock *turn_sock, PJ_DECL(pj_status_t) pj_turn_sock_alloc(pj_turn_sock *turn_sock,
const pj_str_t *domain, const pj_str_t *domain,
int default_port, int default_port,
pj_dns_resolver *resolver, pj_dns_resolver *resolver,
const pj_stun_auth_cred *cred, const pj_stun_auth_cred *cred,
const pj_turn_alloc_param *param); const pj_turn_alloc_param *param);
/** /**
* Create or renew permission in the TURN server for the specified peer IP
* addresses. Application must install permission for a particular (peer)
* IP address before it sends any data to that IP address, or otherwise
* the TURN server will drop the data.
*
* @param turn_sock The TURN transport instance.
* @param addr_cnt Number of IP addresses.
* @param addr Array of peer IP addresses. Only the address family
* and IP address portion of the socket address matter.
* @param options Specify 1 to let the TURN client session automatical
ly
* renew the permission later when they are about to
* expire.
*
* @return PJ_SUCCESS if the operation has been successfully
* issued, or the appropriate error code. Note that
* the operation itself will complete asynchronously.
*/
PJ_DECL(pj_status_t) pj_turn_sock_set_perm(pj_turn_sock *turn_sock,
unsigned addr_cnt,
const pj_sockaddr addr[],
unsigned options);
/**
* Send a data to the specified peer address via the TURN relay. This * Send a data to the specified peer address via the TURN relay. This
* function will encapsulate the data as STUN Send Indication or TURN * function will encapsulate the data as STUN Send Indication or TURN
* ChannelData packet and send the message to the TURN server. The TURN * ChannelData packet and send the message to the TURN server. The TURN
* server then will send the data to the peer. * server then will send the data to the peer.
* *
* The allocation (pj_turn_sock_alloc()) must have been successfully * The allocation (pj_turn_sock_alloc()) must have been successfully
* created before application can relay any data. * created before application can relay any data.
* *
* @param turn_sock The TURN transport instance. * @param turn_sock The TURN transport instance.
* @param pkt The data/packet to be sent to peer. * @param pkt The data/packet to be sent to peer.
 End of changes. 4 change blocks. 
14 lines changed or deleted 62 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/