Makefile.am   Makefile.am 
pkginclude_HEADERS = \
portaudiocpp/AutoSystem.hxx \
portaudiocpp/BlockingStream.hxx \
portaudiocpp/CallbackInterface.hxx \
portaudiocpp/CallbackStream.hxx \
portaudiocpp/CFunCallbackStream.hxx \
portaudiocpp/CppFunCallbackStream.hxx \
portaudiocpp/Device.hxx \
portaudiocpp/DirectionSpecificStreamParameters.hxx \
portaudiocpp/Exception.hxx \
portaudiocpp/HostApi.hxx \
portaudiocpp/InterfaceCallbackStream.hxx \
portaudiocpp/MemFunCallbackStream.hxx \
portaudiocpp/PortAudioCpp.hxx \
portaudiocpp/SampleDataFormat.hxx \
portaudiocpp/Stream.hxx \
portaudiocpp/StreamParameters.hxx \
portaudiocpp/SystemDeviceIterator.hxx \
portaudiocpp/SystemHostApiIterator.hxx \
portaudiocpp/System.hxx
SUBDIRS = speex # portaudiocpp/AsioDeviceAdapter.hxx
 End of changes. 2 change blocks. 
0 lines changed or deleted 20 lines changed or added


 addr_resolv.h   addr_resolv.h 
/* $Id: addr_resolv.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: addr_resolv.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 77 skipping to change at line 77
char **h_aliases; /**< Aliases list. */ char **h_aliases; /**< Aliases list. */
int h_addrtype; /**< Host address type. */ int h_addrtype; /**< Host address type. */
int h_length; /**< Length of address. */ int h_length; /**< Length of address. */
char **h_addr_list; /**< List of addresses. */ char **h_addr_list; /**< List of addresses. */
} pj_hostent; } pj_hostent;
/** Shortcut to h_addr_list[0] */ /** Shortcut to h_addr_list[0] */
#define h_addr h_addr_list[0] #define h_addr h_addr_list[0]
/** /**
* This structure describes address information pj_getaddrinfo().
*/
typedef struct pj_addrinfo
{
char ai_canonname[PJ_MAX_HOSTNAME]; /**< Canonical name for host
*/
pj_sockaddr ai_addr; /**< Binary address.
*/
} pj_addrinfo;
/**
* This function fills the structure of type pj_hostent for a given host na me. * This function fills the structure of type pj_hostent for a given host na me.
* For host resolution function that also works with IPv6, please see
* #pj_getaddrinfo().
* *
* @param name Host name, or IPv4 or IPv6 address in standard dot notat * @param name Host name, or IPv4 address in standard dot notation.
ion. * @param he The pj_hostent structure to be filled. Note that
* @param he The pj_hostent structure to be filled. * the pointers in this structure points to temporary
* variables which value will be reset upon subsequent
* invocation.
* *
* @return PJ_SUCCESS, or the appropriate error codes. * @return PJ_SUCCESS, or the appropriate error codes.
*/ */
PJ_DECL(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he) ; PJ_DECL(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he) ;
/** /**
* Resolve the primary IP address of local host. * Resolve the primary IP address of local host.
* *
* @param ip_addr On successful resolution, this will be filled up with * @param af The desired address family to query. Valid values
* the host IP address, in network byte order. * are pj_AF_INET() or pj_AF_INET6().
* @param addr On successful resolution, the address family and addres
s
* part of this socket address will be filled up with the h
ost
* IP address, in network byte order. Other parts of the so
cket
* address are untouched.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_gethostip(int af, pj_sockaddr *addr);
/**
* Get the IP address of the default interface. Default interface is the
* interface of the default route.
*
* @param af The desired address family to query. Valid values
* are pj_AF_INET() or pj_AF_INET6().
* @param addr On successful resolution, the address family and addres
s
* part of this socket address will be filled up with the h
ost
* IP address, in network byte order. Other parts of the so
cket
* address are untouched.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_getdefaultipinterface(int af,
pj_sockaddr *addr);
/**
* This function translates the name of a service location (for example,
* a host name) and returns a set of addresses and associated information
* to be used in creating a socket with which to address the specified
* service.
*
* @param af The desired address family to query. Valid values
* are pj_AF_INET(), pj_AF_INET6(), or pj_AF_UNSPEC().
* @param name Descriptive name or an address string, such as host
* name.
* @param count On input, it specifies the number of elements in
* \a ai array. On output, this will be set with the
* number of address informations found for the
* specified name.
* @param ai Array of address info to be filled with the information
* about the host.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_gethostip(pj_in_addr *ip_addr); PJ_DECL(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *name,
unsigned *count, pj_addrinfo ai[]);
/** @} */ /** @} */
PJ_END_DECL PJ_END_DECL
#endif /* __PJ_ADDR_RESOLV_H__ */ #endif /* __PJ_ADDR_RESOLV_H__ */
 End of changes. 7 change blocks. 
8 lines changed or deleted 71 lines changed or added


 alaw_ulaw.h   alaw_ulaw.h 
/* $Id: alaw_ulaw.h 1210 2007-04-22 12:48:30Z bennylp $ */ /* $Id: alaw_ulaw.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 array.h   array.h 
/* $Id: array.h 986 2007-02-20 14:58:40Z bennylp $ */ /* $Id: array.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 assert.h   assert.h 
/* $Id: assert.h 1334 2007-06-01 09:58:57Z bennylp $ */ /* $Id: assert.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 base64.h   base64.h 
/* $Id: base64.h 1490 2007-10-10 13:12:37Z bennylp $ */ /* $Id: base64.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 bidirectional.h   bidirectional.h 
/* $Id: bidirectional.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: bidirectional.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJMEDIA_BIDIRECTIONAL_H__ #ifndef __PJMEDIA_BIDIRECTIONAL_H__
#define __PJMEDIA_BIDIRECTIONAL_H__ #define __PJMEDIA_BIDIRECTIONAL_H__
/** /**
* @file bidirectional.h * @file bidirectional.h
* @brief Create bidirectional port from two unidirectional ports. * @brief Bidirectional media port.
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
/** /**
* @defgroup PJMEDIA_BIDIRECTIONAL_PORT Bidirectional Port * @defgroup PJMEDIA_BIDIRECTIONAL_PORT Bidirectional Port
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief Create bidirectional port from two unidirectional ports. * @brief A bidirectional port combines two unidirectional ports into one
* bidirectional port
* @{ * @{
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Create bidirectional port from two unidirectional ports * Create bidirectional port from two unidirectional ports
* *
* @param pool Pool to allocate memory. * @param pool Pool to allocate memory.
* @param get_port Port where get_frame() will be directed to. * @param get_port Port where get_frame() will be directed to.
 End of changes. 4 change blocks. 
4 lines changed or deleted 5 lines changed or added


 cc_armcc.h   cc_armcc.h 
/* $Id: cc_armcc.h 1269 2007-05-12 15:03:23Z bennylp $ */ /* $Id: cc_armcc.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 cc_codew.h   cc_codew.h 
/* $Id: cc_codew.h 1235 2007-04-30 21:03:32Z bennylp $ */ /* $Id: cc_codew.h 1858 2008-03-11 13:38:37Z bennylp $ */
/* /*
* Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2006 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJ_COMPAT_CC_GCC_H__ #ifndef __PJ_COMPAT_CC_CODEW_H__
#define __PJ_COMPAT_CC_GCC_H__ #define __PJ_COMPAT_CC_CODEW_H__
/** /**
* @file cc_codew.h * @file cc_codew.h
* @brief Describes MetroWerks Code Warrior compiler specifics. * @brief Describes MetroWerks Code Warrior compiler specifics.
*/ */
#ifndef __MWERKS__ #ifndef __MWERKS__
# error "This file is only for Code Warrior!" # error "This file is only for Code Warrior!"
#endif #endif
skipping to change at line 46 skipping to change at line 46
#define PJ_INLINE_SPECIFIER static inline #define PJ_INLINE_SPECIFIER static inline
#define PJ_THREAD_FUNC #define PJ_THREAD_FUNC
#define PJ_NORETURN #define PJ_NORETURN
#define PJ_ATTR_NORETURN #define PJ_ATTR_NORETURN
#define PJ_HAS_INT64 1 #define PJ_HAS_INT64 1
typedef long long pj_int64_t; typedef long long pj_int64_t;
typedef unsigned long long pj_uint64_t; typedef unsigned long long pj_uint64_t;
#define PJ_INT64(val) val##LL
#define PJ_UINT64(val) val##LLU
#define PJ_INT64_FMT "L" #define PJ_INT64_FMT "L"
#endif /* __PJ_COMPAT_CC_GCC_H__ */ #endif /* __PJ_COMPAT_CC_CODEW_H__ */
 End of changes. 4 change blocks. 
3 lines changed or deleted 5 lines changed or added


 cc_gcc.h   cc_gcc.h 
/* $Id: cc_gcc.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: cc_gcc.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 cc_gcce.h   cc_gcce.h 
/* $Id: cc_gcce.h 1246 2007-05-03 13:31:21Z bennylp $ */ /* $Id: cc_gcce.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 46 skipping to change at line 46
#define PJ_INLINE_SPECIFIER static inline #define PJ_INLINE_SPECIFIER static inline
#define PJ_THREAD_FUNC #define PJ_THREAD_FUNC
#define PJ_NORETURN #define PJ_NORETURN
#define PJ_ATTR_NORETURN __attribute__ ((noreturn)) #define PJ_ATTR_NORETURN __attribute__ ((noreturn))
#define PJ_HAS_INT64 1 #define PJ_HAS_INT64 1
typedef long long pj_int64_t; typedef long long pj_int64_t;
typedef unsigned long long pj_uint64_t; typedef unsigned long long pj_uint64_t;
#define PJ_INT64(val) val##LL
#define PJ_UINT64(val) val##LLU
#define PJ_INT64_FMT "L" #define PJ_INT64_FMT "L"
#endif /* __PJ_COMPAT_CC_GCCE_H__ */ #endif /* __PJ_COMPAT_CC_GCCE_H__ */
 End of changes. 3 change blocks. 
2 lines changed or deleted 4 lines changed or added


 cc_msvc.h   cc_msvc.h 
/* $Id: cc_msvc.h 1405 2007-07-20 08:08:30Z bennylp $ */ /* $Id: cc_msvc.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 cc_mwcc.h   cc_mwcc.h 
/* $Id: cc_mwcc.h 1235 2007-04-30 21:03:32Z bennylp $ */ /* $Id: cc_mwcc.h 1858 2008-03-11 13:38:37Z bennylp $ */
/* /*
* Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2006 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 46 skipping to change at line 46
#define PJ_INLINE_SPECIFIER static inline #define PJ_INLINE_SPECIFIER static inline
#define PJ_THREAD_FUNC #define PJ_THREAD_FUNC
#define PJ_NORETURN #define PJ_NORETURN
#define PJ_ATTR_NORETURN __attribute__ ((noreturn)) #define PJ_ATTR_NORETURN __attribute__ ((noreturn))
#define PJ_HAS_INT64 1 #define PJ_HAS_INT64 1
typedef long long pj_int64_t; typedef long long pj_int64_t;
typedef unsigned long long pj_uint64_t; typedef unsigned long long pj_uint64_t;
#define PJ_INT64(val) val##LL
#define PJ_UINT64(val) val##LLU
#define PJ_INT64_FMT "L" #define PJ_INT64_FMT "L"
#endif /* __PJ_COMPAT_CC_MWCC_H__ */ #endif /* __PJ_COMPAT_CC_MWCC_H__ */
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added


 clock.h   clock.h 
/* $Id: clock.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: clock.h 2075 2008-06-27 16:18:13Z nanang $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 29 skipping to change at line 29
#ifndef __PJMEDIA_CLOCK_H__ #ifndef __PJMEDIA_CLOCK_H__
#define __PJMEDIA_CLOCK_H__ #define __PJMEDIA_CLOCK_H__
/** /**
* @file clock.h * @file clock.h
* @brief Media clock. * @brief Media clock.
*/ */
#include <pjmedia/types.h> #include <pjmedia/types.h>
/** /**
* @defgroup PJMEDIA_PORT_CLOCK Clock/Timing
* @ingroup PJMEDIA_PORT
* @brief Various types of classes that provide timing.
* @{
The media clock/timing extends the media port concept that is explained
in @ref PJMEDIA_PORT. When clock is present in the ports
interconnection, media will flow automatically (and with correct timing to
o!)
from one media port to another.
There are few objects in PJMEDIA that are able to provide clock/timing
to media ports interconnection:
- @ref PJMED_SND_PORT\n
The sound device makes a good candidate as the clock source, and
PJMEDIA @ref PJMED_SND is designed so that it is able to invoke
operations according to timing driven by the sound hardware clock
(this may sound complicated, but actually it just means that
the sound device abstraction provides callbacks to be called when
it has/wants media frames).\n
See @ref PJMED_SND_PORT for more details.
- @ref PJMEDIA_MASTER_PORT\n
The master port uses @ref PJMEDIA_CLOCK as the clock source. By using
@ref PJMEDIA_MASTER_PORT, it is possible to interconnect passive
media ports and let the frames flow automatically in timely manner.\n
Please see @ref PJMEDIA_MASTER_PORT for more details.
@}
*/
/**
* @addtogroup PJMEDIA_CLOCK Clock Generator * @addtogroup PJMEDIA_CLOCK Clock Generator
* @ingroup PJMEDIA_PORT_CLOCK * @ingroup PJMEDIA_PORT_CLOCK
* @brief Interface for generating clock. * @brief Interface for generating clock.
* @{ * @{
* *
* The clock generator provides the application with media timing, * The clock generator provides the application with media timing,
* and it is used by the @ref PJMEDIA_MASTER_PORT for its sound clock. * and it is used by the @ref PJMEDIA_MASTER_PORT for its sound clock.
* *
* The clock generator may be configured to run <b>asynchronously</b> * The clock generator may be configured to run <b>asynchronously</b>
* (the default behavior) or <b>synchronously</b>. When it is run * (the default behavior) or <b>synchronously</b>. When it is run
skipping to change at line 62 skipping to change at line 94
/** /**
* Options when creating the clock. * Options when creating the clock.
*/ */
enum pjmedia_clock_options enum pjmedia_clock_options
{ {
/** /**
* Prevents the clock from running asynchronously. In this case, * Prevents the clock from running asynchronously. In this case,
* application must poll the clock continuously by calling * application must poll the clock continuously by calling
* #pjmedia_clock_wait() in order to synchronize timing. * #pjmedia_clock_wait() in order to synchronize timing.
*/ */
PJMEDIA_CLOCK_NO_ASYNC = 1 PJMEDIA_CLOCK_NO_ASYNC = 1,
/**
* Prevent the clock from setting it's thread to highest priority.
*/
PJMEDIA_CLOCK_NO_HIGHEST_PRIO = 2
}; };
/** /**
* Type of media clock callback. * Type of media clock callback.
* *
* @param ts Current timestamp, in samples. * @param ts Current timestamp, in samples.
* @param user_data Application data that is passed when * @param user_data Application data that is passed when
* the clock was created. * the clock was created.
*/ */
typedef void pjmedia_clock_callback(const pj_timestamp *ts, typedef void pjmedia_clock_callback(const pj_timestamp *ts,
void *user_data); void *user_data);
/** /**
* Create media clock. * Create media clock.
* *
* @param pool Pool to allocate memory. * @param pool Pool to allocate memory.
* @param clock_rate Number of samples per second. * @param clock_rate Number of samples per second.
* @param channel_count Number of channel.
* @param samples_per_frame Number of samples per frame. This argument * @param samples_per_frame Number of samples per frame. This argument
* along with clock_rate, specifies the interval * along with clock_rate and channel_count, specifi
* of each clock run (or clock ticks). es
* @param options By default, the callback will be called * the interval of each clock run (or clock ticks).
* asynchronously (depending on the clock * @param options Bitmask of pjmedia_clock_options.
* implementation backend, a thread may be
* created). If PJMEDIA_CLOCK_NO_ASYNC is set,
* application must poll the clock with
* #pjmedia_clock_wait() to let the clock runs.
* @param cb Callback to be called for each clock tick. * @param cb Callback to be called for each clock tick.
* @param user_data User data, which will be passed to the callback. * @param user_data User data, which will be passed to the callback.
* @param p_clock Pointer to receive the clock instance. * @param p_clock Pointer to receive the clock instance.
* *
* @return PJ_SUCCESS on success, or the appropriate error * @return PJ_SUCCESS on success, or the appropriate error
* code. * code.
*/ */
PJ_DECL(pj_status_t) pjmedia_clock_create( pj_pool_t *pool, PJ_DECL(pj_status_t) pjmedia_clock_create( pj_pool_t *pool,
unsigned clock_rate, unsigned clock_rate,
unsigned channel_count,
unsigned samples_per_frame, unsigned samples_per_frame,
unsigned options, unsigned options,
pjmedia_clock_callback *cb, pjmedia_clock_callback *cb,
void *user_data, void *user_data,
pjmedia_clock **p_clock); pjmedia_clock **p_clock);
/** /**
* Start the clock. For clock created with asynchronous flag set to TRUE, * Start the clock. For clock created with asynchronous flag set to TRUE,
* this may start a worker thread for the clock (depending on the * this may start a worker thread for the clock (depending on the
* backend clock implementation being used). * backend clock implementation being used).
 End of changes. 7 change blocks. 
11 lines changed or deleted 47 lines changed or added


 codec.h   codec.h 
/* $Id: codec.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: codec.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 34 skipping to change at line 34
* @brief Codec framework. * @brief Codec framework.
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
#include <pj/list.h> #include <pj/list.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJMEDIA_CODEC Codec Framework * @defgroup PJMEDIA_CODEC Codec Framework
* @ingroup PJMEDIA
* @brief Media codec framework and management * @brief Media codec framework and management
* @{ * @{
* *
* @section codec_mgmt_sec Codec Management * @section codec_mgmt_sec Codec Management
* @subsection codec_fact_sec Codec Manager * @subsection codec_fact_sec Codec Manager
* *
* The codec manager is used to manage all codec capabilities in the endpoi nt. * The codec manager is used to manage all codec capabilities in the endpoi nt.
* When used with media endpoint (pjmedia_endpt), application can retrieve * When used with media endpoint (pjmedia_endpt), application can retrieve
* the codec manager instance by calling #pjmedia_endpt_get_codec_mgr(). * the codec manager instance by calling #pjmedia_endpt_get_codec_mgr().
* *
skipping to change at line 251 skipping to change at line 250
typedef struct pjmedia_codec_param typedef struct pjmedia_codec_param
{ {
/** /**
* The "info" part of codec param describes the capability of the codec , * The "info" part of codec param describes the capability of the codec ,
* and the value should NOT be changed by application. * and the value should NOT be changed by application.
*/ */
struct { struct {
unsigned clock_rate; /**< Sampling rate in Hz */ unsigned clock_rate; /**< Sampling rate in Hz */
unsigned channel_cnt; /**< Channel count. */ unsigned channel_cnt; /**< Channel count. */
pj_uint32_t avg_bps; /**< Average bandwidth in bits/sec */ pj_uint32_t avg_bps; /**< Average bandwidth in bits/sec */
pj_uint32_t max_bps; /**< Maximum bandwidth in bits/sec */
pj_uint16_t frm_ptime; /**< Decoder frame ptime in msec. */ pj_uint16_t frm_ptime; /**< Decoder frame ptime in msec. */
pj_uint16_t enc_ptime; /**< Encoder ptime, or zero if it's pj_uint16_t enc_ptime; /**< Encoder ptime, or zero if it's
equal to decoder ptime. */ equal to decoder ptime. */
pj_uint8_t pcm_bits_per_sample; /**< Bits/sample in the PCM side */ pj_uint8_t pcm_bits_per_sample; /**< Bits/sample in the PCM side */
pj_uint8_t pt; /**< Payload type. */ pj_uint8_t pt; /**< Payload type. */
} info; } info;
/** /**
* The "setting" part of codec param describes various settings to be * The "setting" part of codec param describes various settings to be
* applied to the codec. When the codec param is retrieved from the cod ec * applied to the codec. When the codec param is retrieved from the cod ec
skipping to change at line 370 skipping to change at line 370
*/ */
pj_status_t (*parse)( pjmedia_codec *codec, pj_status_t (*parse)( pjmedia_codec *codec,
void *pkt, void *pkt,
pj_size_t pkt_size, pj_size_t pkt_size,
const pj_timestamp *timestamp, const pj_timestamp *timestamp,
unsigned *frame_cnt, unsigned *frame_cnt,
pjmedia_frame frames[]); pjmedia_frame frames[]);
/** /**
* Instruct the codec to encode the specified input frame. The input * Instruct the codec to encode the specified input frame. The input
* PCM samples MUST have ptime that is exactly equal to base frame * PCM samples MUST have ptime that is multiplication of base frame
* ptime (i.e. the value of info.frm_ptime in #pjmedia_codec_param). * ptime (i.e. the value of info.frm_ptime in #pjmedia_codec_param).
* *
* @param codec The codec instance. * @param codec The codec instance.
* @param input The input frame. * @param input The input frame.
* @param out_size The length of buffer in the output frame. * @param out_size The length of buffer in the output frame.
* @param output The output frame. * @param output The output frame.
* *
* @return PJ_SUCCESS on success; * @return PJ_SUCCESS on success;
*/ */
pj_status_t (*encode)(pjmedia_codec *codec, pj_status_t (*encode)(pjmedia_codec *codec,
 End of changes. 5 change blocks. 
4 lines changed or deleted 4 lines changed or added


 conference.h   conference.h 
/* $Id: conference.h 1301 2007-05-25 06:13:55Z bennylp $ */ /* $Id: conference.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 31 skipping to change at line 31
/** /**
* @file conference.h * @file conference.h
* @brief Conference bridge. * @brief Conference bridge.
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
/** /**
* @defgroup PJMEDIA_CONF Conference Bridge * @defgroup PJMEDIA_CONF Conference Bridge
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief The implementation of conference bridge * @brief Audio conference bridge implementation
* @{ * @{
* *
* This describes the conference bridge implementation in PJMEDIA. The * This describes the conference bridge implementation in PJMEDIA. The
* conference bridge provides powerful and very efficient mechanism to * conference bridge provides powerful and very efficient mechanism to
* route the audio flow and mix the audio signal when required. * route the audio flow and mix the audio signal when required.
* *
* Some more information about the media flow when conference bridge is * Some more information about the media flow when conference bridge is
* used is described in http://www.pjsip.org/trac/wiki/media-flow . * used is described in http://www.pjsip.org/trac/wiki/media-flow .
*/ */
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 config.h   config.h 
/* $Id: config.h 1410 2007-07-28 02:44:55Z bennylp $ */ /* $Id: config.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 248 skipping to change at line 248
/* /*
* PowerPC, big endian * PowerPC, big endian
*/ */
# undef PJ_M_POWERPC # undef PJ_M_POWERPC
# define PJ_M_POWERPC 1 # define PJ_M_POWERPC 1
# define PJ_M_NAME "powerpc" # define PJ_M_NAME "powerpc"
# define PJ_HAS_PENTIUM 0 # define PJ_HAS_PENTIUM 0
# define PJ_IS_LITTLE_ENDIAN 0 # define PJ_IS_LITTLE_ENDIAN 0
# define PJ_IS_BIG_ENDIAN 1 # define PJ_IS_BIG_ENDIAN 1
#elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \
defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2)
/*
* Nios2, little endian
*/
# undef PJ_M_NIOS2
# define PJ_M_NIOS2 1
# define PJ_M_NAME "nios2"
# define PJ_HAS_PENTIUM 0
# define PJ_IS_LITTLE_ENDIAN 1
# define PJ_IS_BIG_ENDIAN 0
#else #else
# error "Please specify target machine." # error "Please specify target machine."
#endif #endif
/* Include size_t definition. */ /* Include size_t definition. */
#include <pj/compat/size_t.h> #include <pj/compat/size_t.h>
/* Include site/user specific configuration to control PJLIB features. /* Include site/user specific configuration to control PJLIB features.
* YOU MUST CREATE THIS FILE YOURSELF!! * YOU MUST CREATE THIS FILE YOURSELF!!
*/ */
skipping to change at line 282 skipping to change at line 294
# undef PJ_POOL_DEBUG # undef PJ_POOL_DEBUG
# undef PJ_HAS_TCP # undef PJ_HAS_TCP
# undef PJ_MAX_HOSTNAME # undef PJ_MAX_HOSTNAME
# undef PJ_IOQUEUE_MAX_HANDLES # undef PJ_IOQUEUE_MAX_HANDLES
# undef FD_SETSIZE # undef FD_SETSIZE
# undef PJ_HAS_SEMAPHORE # undef PJ_HAS_SEMAPHORE
# undef PJ_HAS_EVENT_OBJ # undef PJ_HAS_EVENT_OBJ
# undef PJ_ENABLE_EXTRA_CHECK # undef PJ_ENABLE_EXTRA_CHECK
# undef PJ_EXCEPTION_USE_WIN32_SEH # undef PJ_EXCEPTION_USE_WIN32_SEH
# undef PJ_HAS_ERROR_STRING # undef PJ_HAS_ERROR_STRING
# define PJ_HAS_IPV6 1
#endif #endif
/** /**
* @defgroup pj_config Build Configuration * @defgroup pj_config Build Configuration
* @ingroup PJ
* @{ * @{
* *
* This section contains macros that can set during PJLIB build process * This section contains macros that can set during PJLIB build process
* to controll various aspects of the library. * to controll various aspects of the library.
* *
* <b>Note</b>: the values in this page does NOT necessarily reflect to the * <b>Note</b>: the values in this page does NOT necessarily reflect to the
* macro values during the build process. * macro values during the build process.
*/ */
/** /**
skipping to change at line 420 skipping to change at line 433
* Specify this as \a stack_size argument in #pj_thread_create() to specify * Specify this as \a stack_size argument in #pj_thread_create() to specify
* that thread should use default stack size for the current platform. * that thread should use default stack size for the current platform.
* *
* Default: 8192 * Default: 8192
*/ */
#ifndef PJ_THREAD_DEFAULT_STACK_SIZE #ifndef PJ_THREAD_DEFAULT_STACK_SIZE
# define PJ_THREAD_DEFAULT_STACK_SIZE 8192 # define PJ_THREAD_DEFAULT_STACK_SIZE 8192
#endif #endif
/** /**
* Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of
* the stack. The OS implementation may check that no stack overflow
* occurs, and it also may collect statistic about stack usage. Note
* that this will increase the footprint of the libraries since it
* tracks the filename and line number of each functions.
*/
#ifndef PJ_OS_HAS_CHECK_STACK
# define PJ_OS_HAS_CHECK_STACK 0
#endif
/**
* Do we have alternate pool implementation? * Do we have alternate pool implementation?
* *
* Default: 0 * Default: 0
*/ */
#ifndef PJ_HAS_POOL_ALT_API #ifndef PJ_HAS_POOL_ALT_API
# define PJ_HAS_POOL_ALT_API PJ_POOL_DEBUG # define PJ_HAS_POOL_ALT_API PJ_POOL_DEBUG
#endif #endif
/** /**
* \def PJ_HAS_TCP
* Support TCP in the library. * Support TCP in the library.
* Disabling TCP will reduce the footprint slightly (about 6KB). * Disabling TCP will reduce the footprint slightly (about 6KB).
* *
* Default: 1 * Default: 1
*/ */
#ifndef PJ_HAS_TCP #ifndef PJ_HAS_TCP
# define PJ_HAS_TCP 1 # define PJ_HAS_TCP 1
#endif #endif
/** /**
* Support IPv6 in the library. If this support is disabled, some IPv6
* related functions will return PJ_EIPV6NOTSUP.
*
* Default: 0 (disabled, for now)
*/
#ifndef PJ_HAS_IPV6
# define PJ_HAS_IPV6 0
#endif
/**
* Maximum hostname length. * Maximum hostname length.
* Libraries sometimes needs to make copy of an address to stack buffer; * Libraries sometimes needs to make copy of an address to stack buffer;
* the value here affects the stack usage. * the value here affects the stack usage.
* *
* Default: 128 * Default: 128
*/ */
#ifndef PJ_MAX_HOSTNAME #ifndef PJ_MAX_HOSTNAME
# define PJ_MAX_HOSTNAME (128) # define PJ_MAX_HOSTNAME (128)
#endif #endif
/** /**
* Constants for declaring the maximum handles that can be supported by * Constants for declaring the maximum handles that can be supported by
* a single IOQ framework. This constant might not be relevant to the * a single IOQ framework. This constant might not be relevant to the
* underlying I/O queue impelementation, but still, developers should be * underlying I/O queue impelementation, but still, developers should be
* aware of this constant, to make sure that the program will not break whe n * aware of this constant, to make sure that the program will not break whe n
* the underlying implementation changes. * the underlying implementation changes.
*
* For implementation based on select(), the value here will be used as the
* maximum number of socket handles passed to select() (i.e. FD_SETSIZE wil
l
* be set to this value).
*
* Default: if FD_SETSIZE is defined and the value is greather than 256,
* then it will be used. Otherwise 256 (64 for WinCE).
*/ */
#ifndef PJ_IOQUEUE_MAX_HANDLES #ifndef PJ_IOQUEUE_MAX_HANDLES
# if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 # define PJ_IOQUEUE_MAX_HANDLES (64)
# define PJ_IOQUEUE_MAX_HANDLES (64)
# else
# define PJ_IOQUEUE_MAX_HANDLES (256)
# endif
#endif #endif
/** /**
* If PJ_IOQUEUE_HAS_SAFE_UNREG macro is defined, then ioqueue will do more * If PJ_IOQUEUE_HAS_SAFE_UNREG macro is defined, then ioqueue will do more
* things to ensure thread safety of handle unregistration operation by * things to ensure thread safety of handle unregistration operation by
* employing reference counter to each handle. * employing reference counter to each handle.
* *
* In addition, the ioqueue will preallocate memory for the handles, * In addition, the ioqueue will preallocate memory for the handles,
* according to the maximum number of handles that is specified during * according to the maximum number of handles that is specified during
* ioqueue creation. * ioqueue creation.
skipping to change at line 493 skipping to change at line 515
* - there is no dynamic unregistration to all ioqueues. * - there is no dynamic unregistration to all ioqueues.
* - there is no threading, or there is no preemptive multitasking. * - there is no threading, or there is no preemptive multitasking.
* *
* Default: 1 * Default: 1
*/ */
#ifndef PJ_IOQUEUE_HAS_SAFE_UNREG #ifndef PJ_IOQUEUE_HAS_SAFE_UNREG
# define PJ_IOQUEUE_HAS_SAFE_UNREG 1 # define PJ_IOQUEUE_HAS_SAFE_UNREG 1
#endif #endif
/** /**
* Default concurrency setting for sockets/handles registered to ioqueue.
* This controls whether the ioqueue is allowed to call the key's callback
* concurrently/in parallel. The default is yes, which means that if there
* are more than one pending operations complete simultaneously, more
* than one threads may call the key's callback at the same time. This
* generally would promote good scalability for application, at the
* expense of more complexity to manage the concurrent accesses.
*
* Please see the ioqueue documentation for more info.
*/
#ifndef PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY
# define PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY 1
#endif
/* Sanity check:
* if ioqueue concurrency is disallowed, PJ_IOQUEUE_HAS_SAFE_UNREG
* must be enabled.
*/
#if (PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY==0) && (PJ_IOQUEUE_HAS_SAFE_UNREG
==0)
# error PJ_IOQUEUE_HAS_SAFE_UNREG must be enabled if ioqueue concurrency
\
is disabled
#endif
/**
* When safe unregistration (PJ_IOQUEUE_HAS_SAFE_UNREG) is configured in * When safe unregistration (PJ_IOQUEUE_HAS_SAFE_UNREG) is configured in
* ioqueue, the PJ_IOQUEUE_KEY_FREE_DELAY macro specifies how long the * ioqueue, the PJ_IOQUEUE_KEY_FREE_DELAY macro specifies how long the
* ioqueue key is kept in closing state before it can be reused. * ioqueue key is kept in closing state before it can be reused.
* *
* The value is in miliseconds. * The value is in miliseconds.
* *
* Default: 500 msec. * Default: 500 msec.
*/ */
#ifndef PJ_IOQUEUE_KEY_FREE_DELAY #ifndef PJ_IOQUEUE_KEY_FREE_DELAY
# define PJ_IOQUEUE_KEY_FREE_DELAY 500 # define PJ_IOQUEUE_KEY_FREE_DELAY 500
#endif #endif
/** /**
* Determine if FD_SETSIZE is changeable/set-able. If so, then we will
* set it to PJ_IOQUEUE_MAX_HANDLES. Currently we detect this by checking
* for Winsock.
*/
#ifndef PJ_FD_SETSIZE_SETABLE
# if (defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H!=0) || \
(defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0)
# define PJ_FD_SETSIZE_SETABLE 1
# else
# define PJ_FD_SETSIZE_SETABLE 0
# endif
#endif
/**
* Overrides FD_SETSIZE so it is consistent throughout the library. * Overrides FD_SETSIZE so it is consistent throughout the library.
* OS specific configuration header (compat/os_*) might have declared * We only do this if we detected that FD_SETSIZE is changeable. If
* FD_SETSIZE, thus we only set if it hasn't been declared. * FD_SETSIZE is not set-able, then PJ_IOQUEUE_MAX_HANDLES must be
* * set to value lower than FD_SETSIZE.
* Default: #PJ_IOQUEUE_MAX_HANDLES */
*/ #if PJ_FD_SETSIZE_SETABLE
#ifndef FD_SETSIZE /* Only override FD_SETSIZE if the value has not been set */
# define FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES # ifndef FD_SETSIZE
# define FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES
# endif
#else
/* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES
* is lower than FD_SETSIZE value.
*/
# ifdef FD_SETSIZE
# if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE
# error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE"
# endif
# endif
#endif #endif
/** /**
* Has semaphore functionality? * Has semaphore functionality?
* *
* Default: 1 * Default: 1
*/ */
#ifndef PJ_HAS_SEMAPHORE #ifndef PJ_HAS_SEMAPHORE
# define PJ_HAS_SEMAPHORE 1 # define PJ_HAS_SEMAPHORE 1
#endif #endif
skipping to change at line 639 skipping to change at line 710
# define PJ_HAS_STRICMP_ALNUM 0 # define PJ_HAS_STRICMP_ALNUM 0
#endif #endif
/** @} */ /** @} */
/******************************************************************** /********************************************************************
* General macros. * General macros.
*/ */
/** /**
* Guide for building dynamic link libraries (DLL). * @defgroup pj_dll_target Building Dynamic Link Libraries (DLL/DSO)
* @ingroup pj_config
* @{
* *
* The libraries support generation of dynamic link libraries for * The libraries support generation of dynamic link libraries for
* Symbian ABIv2 target (.dso files, in S60 3rd Edition). Similar * Symbian ABIv2 target (.dso/Dynamic Shared Object files, in Symbian
* procedures may be applied for Win32 DLL too, with some modification. * terms). Similar procedures may be applied for Win32 DLL with some
* modification.
*
* Depending on the platforms, these steps may be necessary in order to
* produce the dynamic libraries:
* - Create the (Visual Studio) projects to produce DLL output. PJLIB
* does not provide ready to use project files to produce DLL, so
* you need to create these projects yourself. For Symbian, the MMP
* files have been setup to produce DSO files for targets that
* require them.
* - In the (Visual Studio) projects, some macros need to be declared
* so that appropriate modifiers are added to symbol declarations
* and definitions. Please see the macro section below for information
* regarding these macros. For Symbian, these have been taken care by th
e
* MMP files.
* - Some build systems require .DEF file to be specified when creating
* the DLL. For Symbian, .DEF files are included in pjlib distribution,
* in <tt>pjlib/build.symbian</tt> directory. These DEF files are
* created by running <tt>./makedef.sh all</tt> from this directory,
* inside Mingw.
* *
* Macros related for building DLL/DSO files: * Macros related for building DLL/DSO files:
* - For platforms that supports dynamic link libraries generation, * - For platforms that supports dynamic link libraries generation,
* it must declare PJ_EXPORT_SPECIFIER macro which value contains * it must declare <tt>PJ_EXPORT_SPECIFIER</tt> macro which value contai ns
* the prefix to be added to symbol definition, to export this * the prefix to be added to symbol definition, to export this
* symbol in the DLL/DSO. For example, on Win32/Visual Studio, the * symbol in the DLL/DSO. For example, on Win32/Visual Studio, the
* value of this macro is "__declspec(dllexport)", and for ARM * value of this macro is \a __declspec(dllexport), and for ARM
* ABIv2/Symbian, the value is \a EXPORT_C. * ABIv2/Symbian, the value is \a EXPORT_C.
* - For platforms that supports linking with dynamic link libraries, * - For platforms that supports linking with dynamic link libraries,
* it must declare PJ_IMPORT_SPECIFIER macro which value contains * it must declare <tt>PJ_IMPORT_SPECIFIER</tt> macro which value contai ns
* the prefix to be added to symbol declaration, to import this * the prefix to be added to symbol declaration, to import this
* symbol from a DLL/DSO. For example, on Win32/Visual Studio, the * symbol from a DLL/DSO. For example, on Win32/Visual Studio, the
* value of this macro is "__declspec(dllimport)", and for ARM * value of this macro is \a __declspec(dllimport), and for ARM
* ABIv2/Symbian, the value is \a IMPORT_C. * ABIv2/Symbian, the value is \a IMPORT_C.
* - When PJLIB is built as DLL/DSO, both \a PJ_DLL and \a PJ_EXPORTING * - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt>
* macros must be declared, so that PJ_EXPORT_SPECIFIER prefix will be * macros above can be declared in your \a config_site.h if they are not
* added into function definition. * declared by pjlib.
* - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and
* <tt>PJ_EXPORTING</tt> macros must be declared, so that
* <tt>PJ_EXPORT_SPECIFIER</tt> modifier will be added into function
* definition.
* - When application wants to link dynamically with PJLIB, then it * - When application wants to link dynamically with PJLIB, then it
* must declare \a PJ_DLL macro when using/including PJLIB header, * must declare <tt>PJ_DLL</tt> macro when using/including PJLIB header,
* so that PJ_IMPORT_SPECIFIER is properly added into symbol * so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into
* declarations. * symbol declarations.
* *
* When \a PJ_DLL macro is not declared, static linking is assumed. * When <b>PJ_DLL</b> macro is not declared, static linking is assumed.
*
* For example, here are some settings to produce DLLs with Visual Studio
* on Windows/Win32:
* - Create Visual Studio projects to produce DLL. Add the appropriate
* project dependencies to avoid link errors.
* - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt>
* macros.
* - Declare these macros in your <tt>config_site.h</tt>:
\verbatim
#define PJ_EXPORT_SPECIFIER __declspec(dllexport)
#define PJ_IMPORT_SPECIFIER __declspec(dllimport)
\endverbatim
* - And in the application (that links with the DLL) project, add
* <tt>PJ_DLL</tt> in the macro declarations.
*/ */
/** @} */
/** /**
* @def PJ_INLINE(type) * @defgroup pj_config Build Configuration
* @param type The return type of the function. * @{
* Expand the function as inline.
*/ */
#define PJ_INLINE(type) PJ_INLINE_SPECIFIER type
/** /**
* @def PJ_DECL_NO_RETURN(type) * @def PJ_INLINE(type)
* @param type The return type of the function. * @param type The return type of the function.
* Declare a function that will not return. * Expand the function as inline.
*/
/**
* @def PJ_BEGIN_DECL
* Mark beginning of declaration section in a header file.
*/
/**
* @def PJ_END_DECL
* Mark end of declaration section in a header file.
*/ */
#ifdef __cplusplus #define PJ_INLINE(type) PJ_INLINE_SPECIFIER type
# define PJ_DECL_NO_RETURN(type) type PJ_NORETURN
# define PJ_IDECL_NO_RETURN(type) PJ_INLINE(type) PJ_NORETURN
# define PJ_BEGIN_DECL extern "C" {
# define PJ_END_DECL }
#else
# define PJ_DECL_NO_RETURN(type) PJ_NORETURN type
# define PJ_IDECL_NO_RETURN(type) PJ_NORETURN PJ_INLINE(type)
# define PJ_BEGIN_DECL
# define PJ_END_DECL
#endif
/** /**
* This macro declares platform/compiler specific specifier prefix * This macro declares platform/compiler specific specifier prefix
* to be added to symbol declaration to export the symbol when PJLIB * to be added to symbol declaration to export the symbol when PJLIB
* is built as dynamic library. * is built as dynamic library.
* *
* This macro should have been added by platform specific headers, * This macro should have been added by platform specific headers,
* if the platform supports building dynamic library target. * if the platform supports building dynamic library target.
*/ */
#ifndef PJ_EXPORT_DECL_SPECIFIER #ifndef PJ_EXPORT_DECL_SPECIFIER
skipping to change at line 774 skipping to change at line 866
* @param type The return type of the function. * @param type The return type of the function.
* Define a function. * Define a function.
*/ */
#if defined(PJ_DLL) && defined(PJ_EXPORTING) #if defined(PJ_DLL) && defined(PJ_EXPORTING)
# define PJ_DEF(type) PJ_EXPORT_DEF_SPECIFIER type # define PJ_DEF(type) PJ_EXPORT_DEF_SPECIFIER type
#elif !defined(PJ_DEF) #elif !defined(PJ_DEF)
# define PJ_DEF(type) type # define PJ_DEF(type) type
#endif #endif
/** /**
* @def PJ_DECL_NO_RETURN(type)
* @param type The return type of the function.
* Declare a function that will not return.
*/
/**
* @def PJ_IDECL_NO_RETURN(type)
* @param type The return type of the function.
* Declare an inline function that will not return.
*/
/**
* @def PJ_BEGIN_DECL
* Mark beginning of declaration section in a header file.
*/
/**
* @def PJ_END_DECL
* Mark end of declaration section in a header file.
*/
#ifdef __cplusplus
# define PJ_DECL_NO_RETURN(type) PJ_DECL(type) PJ_NORETURN
# define PJ_IDECL_NO_RETURN(type) PJ_INLINE(type) PJ_NORETURN
# define PJ_BEGIN_DECL extern "C" {
# define PJ_END_DECL }
#else
# define PJ_DECL_NO_RETURN(type) PJ_NORETURN PJ_DECL(type)
# define PJ_IDECL_NO_RETURN(type) PJ_NORETURN PJ_INLINE(type)
# define PJ_BEGIN_DECL
# define PJ_END_DECL
#endif
/**
* @def PJ_DECL_DATA(type) * @def PJ_DECL_DATA(type)
* @param type The data type. * @param type The data type.
* Declare a global data. * Declare a global data.
*/ */
#if defined(PJ_DLL) #if defined(PJ_DLL)
# if defined(PJ_EXPORTING) # if defined(PJ_EXPORTING)
# define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type # define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type
# else # else
# define PJ_DECL_DATA(type) PJ_IMPORT_DECL_SPECIFIER extern type # define PJ_DECL_DATA(type) PJ_IMPORT_DECL_SPECIFIER extern type
# endif # endif
skipping to change at line 842 skipping to change at line 964
# define PJ_TODO(id) TODO___##id: # define PJ_TODO(id) TODO___##id:
#endif #endif
/** /**
* Function attributes to inform that the function may throw exception. * Function attributes to inform that the function may throw exception.
* *
* @param x The exception list, enclosed in parenthesis. * @param x The exception list, enclosed in parenthesis.
*/ */
#define __pj_throw__(x) #define __pj_throw__(x)
/** @} */
/******************************************************************** /********************************************************************
* Sanity Checks * Sanity Checks
*/ */
#ifndef PJ_HAS_HIGH_RES_TIMER #ifndef PJ_HAS_HIGH_RES_TIMER
# error "PJ_HAS_HIGH_RES_TIMER is not defined!" # error "PJ_HAS_HIGH_RES_TIMER is not defined!"
#endif #endif
#if !defined(PJ_HAS_PENTIUM) #if !defined(PJ_HAS_PENTIUM)
# error "PJ_HAS_PENTIUM is not defined!" # error "PJ_HAS_PENTIUM is not defined!"
#endif #endif
 End of changes. 29 change blocks. 
64 lines changed or deleted 190 lines changed or added


 config_site_sample.h   config_site_sample.h 
skipping to change at line 26 skipping to change at line 26
# define PJMEDIA_HAS_G711_PLC 0 # define PJMEDIA_HAS_G711_PLC 0
//# define PJMEDIA_HAS_SMALL_FILTER 1 //# define PJMEDIA_HAS_SMALL_FILTER 1
//# define PJMEDIA_HAS_LARGE_FILTER 0 //# define PJMEDIA_HAS_LARGE_FILTER 0
# define PJMEDIA_HAS_L16_CODEC 0 # define PJMEDIA_HAS_L16_CODEC 0
/*# define PJMEDIA_HAS_GSM_CODEC 0*/ /*# define PJMEDIA_HAS_GSM_CODEC 0*/
/*# define PJMEDIA_HAS_ILBC_CODEC 0*/ /*# define PJMEDIA_HAS_ILBC_CODEC 0*/
/*# define PJMEDIA_HAS_SPEEX_CODEC 0*/ /*# define PJMEDIA_HAS_SPEEX_CODEC 0*/
# define PJMEDIA_HAS_SPEEX_AEC 0 # define PJMEDIA_HAS_SPEEX_AEC 0
# undef PJMEDIA_RESAMPLE_IMP # undef PJMEDIA_RESAMPLE_IMP
# define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE # define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE
# define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE
/* Speex default quality settings */
# define PJSUA_DEFAULT_CODEC_QUALITY 5
# define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5
#endif #endif
/* /*
* Typical configuration for Symbian OS target * Typical configuration for Symbian OS target
*/ */
#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
/* We don't want to use float, for now */ /* We don't want to use float, for now */
# undef PJ_HAS_FLOATING_POINT # undef PJ_HAS_FLOATING_POINT
# define PJ_HAS_FLOATING_POINT 0 # define PJ_HAS_FLOATING_POINT 0
# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND # define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND
/* Misc PJLIB setting */
# define PJ_MAXPATH 80
/* SRTP has not been ported to Symbian yet */
# define PJMEDIA_HAS_SRTP 1
/* Disable these */ /* Disable these */
# define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE # define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE
# define PJMEDIA_HAS_SPEEX_AEC 0 # define PJMEDIA_HAS_SPEEX_AEC 0
# define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE
/* Disable all codecs but G.711, for now */ /* Disable all codecs but G.711 and GSM, for now */
# define PJMEDIA_HAS_GSM_CODEC 1
# define PJMEDIA_HAS_L16_CODEC 0 # define PJMEDIA_HAS_L16_CODEC 0
# define PJMEDIA_HAS_GSM_CODEC 0
# define PJMEDIA_HAS_ILBC_CODEC 0 # define PJMEDIA_HAS_ILBC_CODEC 0
# define PJMEDIA_HAS_SPEEX_CODEC 0 # define PJMEDIA_HAS_SPEEX_CODEC 1
# define PJMEDIA_HAS_G722_CODEC 0
/* Need larger sound buffers */
# define PJMEDIA_SOUND_BUFFER_COUNT 16
/* Disable safe module access */ /* Disable safe module access */
# define PJSIP_SAFE_MODULE 0 # define PJSIP_SAFE_MODULE 0
# define PJSIP_MAX_PKT_LEN 2000 # define PJSIP_MAX_PKT_LEN 2000
/* Since we don't have threads, log buffer can use static buffer */ /* Since we don't have threads, log buffer can use static buffer */
# define PJ_LOG_USE_STACK_BUFFER 0 # define PJ_LOG_USE_STACK_BUFFER 0
/* Disable check stack since it increases footprint */
# undef PJ_OS_HAS_CHECK_STACK
# define PJ_OS_HAS_CHECK_STACK 0
/* Symbian has problem with too many large blocks */ /* Symbian has problem with too many large blocks */
# define PJSIP_POOL_LEN_ENDPT 1000 # define PJSIP_POOL_LEN_ENDPT 1000
# define PJSIP_POOL_INC_ENDPT 1000 # define PJSIP_POOL_INC_ENDPT 1000
# define PJSIP_POOL_RDATA_LEN 2000 # define PJSIP_POOL_RDATA_LEN 2000
# define PJSIP_POOL_RDATA_INC 2000 # define PJSIP_POOL_RDATA_INC 2000
# define PJSIP_POOL_LEN_TDATA 2000 # define PJSIP_POOL_LEN_TDATA 2000
# define PJSIP_POOL_INC_TDATA 512 # define PJSIP_POOL_INC_TDATA 512
# define PJSIP_POOL_LEN_UA 2000 # define PJSIP_POOL_LEN_UA 2000
# 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
/* 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 31 # define PJSUA_MAX_CALLS 4
/* Other pjsua settings */
# define PJSUA_MAX_ACC 4
# define PJSUA_MAX_PLAYERS 4
# define PJSUA_MAX_RECORDERS 4
# define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX
_PLAYERS)
# define PJSUA_MAX_BUDDIES 32
/* Speex default quality settings */
# define PJSUA_DEFAULT_CODEC_QUALITY 5
# define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5
#endif #endif
/* /*
* Minimum size * Minimum size
*/ */
#ifdef PJ_CONFIG_MINIMAL_SIZE #ifdef PJ_CONFIG_MINIMAL_SIZE
# undef PJ_OS_HAS_CHECK_STACK # undef PJ_OS_HAS_CHECK_STACK
# define PJ_OS_HAS_CHECK_STACK 0 # define PJ_OS_HAS_CHECK_STACK 0
# define PJ_LOG_MAX_LEVEL 0 # define PJ_LOG_MAX_LEVEL 0
# define PJ_ENABLE_EXTRA_CHECK 0 # define PJ_ENABLE_EXTRA_CHECK 0
# define PJ_HAS_ERROR_STRING 0 # define PJ_HAS_ERROR_STRING 0
# undef PJ_IOQUEUE_MAX_HANDLES # undef PJ_IOQUEUE_MAX_HANDLES
# define PJ_IOQUEUE_MAX_HANDLES 16 /* Putting max handles to lower than 32 will make pj_fd_set_t size smaller
# define PJ_IOQUEUE_HAS_SAFE_UNREG 0 * than native fdset_t and will trigger assertion on sock_select.c.
*/
# define PJ_IOQUEUE_MAX_HANDLES 32
# define PJSIP_MAX_TSX_COUNT 15 # define PJSIP_MAX_TSX_COUNT 15
# define PJSIP_MAX_DIALOG_COUNT 15 # define PJSIP_MAX_DIALOG_COUNT 15
# define PJSIP_UDP_SO_SNDBUF_SIZE 4000 # define PJSIP_UDP_SO_SNDBUF_SIZE 4000
# define PJSIP_UDP_SO_RCVBUF_SIZE 4000 # define PJSIP_UDP_SO_RCVBUF_SIZE 4000
# define PJMEDIA_HAS_LARGE_FILTER 0 # define PJMEDIA_HAS_LARGE_FILTER 0
# define PJMEDIA_HAS_SMALL_FILTER 0 # define PJMEDIA_HAS_SMALL_FILTER 0
#elif defined(PJ_CONFIG_MAXIMUM_SPEED) #elif defined(PJ_CONFIG_MAXIMUM_SPEED)
# define PJ_SCANNER_USE_BITWISE 0 # define PJ_SCANNER_USE_BITWISE 0
# undef PJ_OS_HAS_CHECK_STACK # undef PJ_OS_HAS_CHECK_STACK
 End of changes. 10 change blocks. 
6 lines changed or deleted 39 lines changed or added


 crc32.h   crc32.h 
/* $Id: crc32.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: crc32.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 ctype.h   ctype.h 
/* $Id: ctype.h 1410 2007-07-28 02:44:55Z bennylp $ */ /* $Id: ctype.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 dns.h   dns.h 
/* $Id: dns.h 1032 2007-03-02 14:46:15Z bennylp $ */ /* $Id: dns.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 33 skipping to change at line 33
* @file dns.h * @file dns.h
* @brief Low level DNS message parsing and packetization. * @brief Low level DNS message parsing and packetization.
*/ */
#include <pjlib-util/types.h> #include <pjlib-util/types.h>
#include <pj/sock.h> #include <pj/sock.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJ_DNS DNS and Asynchronous DNS Resolver * @defgroup PJ_DNS DNS and Asynchronous DNS Resolver
* @ingroup PJLIB_UTIL * @ingroup PJ_PROTOCOLS
*/ */
/** /**
* @defgroup PJ_DNS_PARSING Low-level DNS Message Parsing and Packetization * @defgroup PJ_DNS_PARSING Low-level DNS Message Parsing and Packetization
* @ingroup PJ_DNS * @ingroup PJ_DNS
* @{ * @{
* *
* This module provides low-level services to parse and packetize DNS queri es * This module provides low-level services to parse and packetize DNS queri es
* and responses. The functions support building a DNS query packet and par se * and responses. The functions support building a DNS query packet and par se
* the data in the DNS response. * the data in the DNS response. This implementation conforms to the
* following specifications:
* - RFC 1035: DOMAIN NAMES - IMPLEMENTATION AND SPECIFICATION
* - RFC 1886: DNS Extensions to support IP version 6
* *
* To create a DNS query packet, application should call #pj_dns_make_query () * To create a DNS query packet, application should call #pj_dns_make_query ()
* function, specifying the desired DNS query type, the name to be resolved , * function, specifying the desired DNS query type, the name to be resolved ,
* and the buffer where the DNS packet will be built into. * and the buffer where the DNS packet will be built into.
* *
* When incoming DNS query or response packet arrives, application can use * When incoming DNS query or response packet arrives, application can use
* #pj_dns_parse_packet() to parse the TCP/UDP payload into parsed DNS pack et * #pj_dns_parse_packet() to parse the TCP/UDP payload into parsed DNS pack et
* structure. * structure.
* *
* This module does not provide any networking functionalities to send or * This module does not provide any networking functionalities to send or
skipping to change at line 254 skipping to change at line 257
pj_str_t name; /**< Primary name server. */ pj_str_t name; /**< Primary name server. */
} ns; } ns;
/** PTR Resource Data (PJ_DNS_TYPE_PTR, 12) */ /** PTR Resource Data (PJ_DNS_TYPE_PTR, 12) */
struct ptr { struct ptr {
pj_str_t name; /**< PTR name. */ pj_str_t name; /**< PTR name. */
} ptr; } ptr;
/** A Resource Data (PJ_DNS_TYPE_A, 1) */ /** A Resource Data (PJ_DNS_TYPE_A, 1) */
struct a { struct a {
pj_in_addr ip_addr;/**< IP host address string. */ pj_in_addr ip_addr;/**< IPv4 address in network byte order. */
} a; } a;
/** AAAA Resource Data (PJ_DNS_TYPE_AAAA, 28) */
struct aaaa {
pj_in6_addr ip_addr;/**< IPv6 address in network byte order.
*/
} aaaa;
} rdata; } rdata;
} pj_dns_parsed_rr; } pj_dns_parsed_rr;
/** /**
* This structure describes the parsed repersentation of the raw DNS packet . * This structure describes the parsed repersentation of the raw DNS packet .
* Note that all integral values in the parsed packet are represented in * Note that all integral values in the parsed packet are represented in
* host byte order. * host byte order.
*/ */
typedef struct pj_dns_parsed_packet typedef struct pj_dns_parsed_packet
skipping to change at line 355 skipping to change at line 363
/** /**
* Utility function to get the type name string of the specified DNS type. * Utility function to get the type name string of the specified DNS type.
* *
* @param type DNS type (see #pj_dns_type). * @param type DNS type (see #pj_dns_type).
* *
* @return String name of the type (e.g. "A", "SRV", etc.). * @return String name of the type (e.g. "A", "SRV", etc.).
*/ */
PJ_DECL(const char *) pj_dns_get_type_name(int type); PJ_DECL(const char *) pj_dns_get_type_name(int type);
/** /**
* Initialize DNS record as DNS SRV record.
*
* @param rec The DNS resource record to be initialized as DNS
* SRV record.
* @param res_name Resource name.
* @param dnsclass DNS class.
* @param ttl Resource TTL value.
* @param prio DNS SRV priority.
* @param weight DNS SRV weight.
* @param port Target port.
* @param target Target name.
*/
PJ_DECL(void) pj_dns_init_srv_rr(pj_dns_parsed_rr *rec,
const pj_str_t *res_name,
unsigned dnsclass,
unsigned ttl,
unsigned prio,
unsigned weight,
unsigned port,
const pj_str_t *target);
/**
* Initialize DNS record as DNS CNAME record.
*
* @param rec The DNS resource record to be initialized as DNS
* CNAME record.
* @param res_name Resource name.
* @param dnsclass DNS class.
* @param ttl Resource TTL value.
* @param name Host name.
*/
PJ_DECL(void) pj_dns_init_cname_rr(pj_dns_parsed_rr *rec,
const pj_str_t *res_name,
unsigned dnsclass,
unsigned ttl,
const pj_str_t *name);
/**
* Initialize DNS record as DNS A record.
*
* @param rec The DNS resource record to be initialized as DNS
* A record.
* @param res_name Resource name.
* @param dnsclass DNS class.
* @param ttl Resource TTL value.
* @param ip_addr Host address.
*/
PJ_DECL(void) pj_dns_init_a_rr(pj_dns_parsed_rr *rec,
const pj_str_t *res_name,
unsigned dnsclass,
unsigned ttl,
const pj_in_addr *ip_addr);
/**
* Dump DNS packet to standard log. * Dump DNS packet to standard log.
* *
* @param res The DNS packet. * @param res The DNS packet.
*/ */
PJ_DECL(void) pj_dns_dump_packet(const pj_dns_parsed_packet *res); PJ_DECL(void) pj_dns_dump_packet(const pj_dns_parsed_packet *res);
/** /**
* @} * @}
*/ */
 End of changes. 7 change blocks. 
5 lines changed or deleted 68 lines changed or added


 doxygen.h   doxygen.h 
/* $Id: doxygen.h 1450 2007-09-24 19:46:41Z bennylp $ */ /* $Id: doxygen.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 56 skipping to change at line 56
* PJLIB and all documentation can be downloaded from * PJLIB and all documentation can be downloaded from
* http://www.pjsip.org. * http://www.pjsip.org.
* *
* *
* @section how_to_use_sec About This Documentation * @section how_to_use_sec About This Documentation
* *
* This document is generated directly from PJLIB source file using * This document is generated directly from PJLIB source file using
* \a doxygen (http://www.doxygen.org). Doxygen is a great (and free!) * \a doxygen (http://www.doxygen.org). Doxygen is a great (and free!)
* tools for generating such documentation. * tools for generating such documentation.
* *
* @subsection doc_ver_subsec Version
*
* This document corresponds to PJLIB version 0.7.0-trunk.
*
* *
* @subsection find_samples_subsec How to Read This Document * @subsection find_samples_subsec How to Read This Document
* *
* This documentation is laid out more to be a reference guide instead * This documentation is laid out more to be a reference guide instead
* of tutorial, therefore first time users may find it difficult to * of tutorial, therefore first time users may find it difficult to
* grasp PJLIB by reading this document alone. * grasp PJLIB by reading this document alone.
* *
* However, we've tried our best to make this document easy to follow. * However, we've tried our best to make this document easy to follow.
* For first time users, we would suggest that you follow these steps * For first time users, we would suggest that you follow these steps
* when reading this documentation: * when reading this documentation:
 End of changes. 3 change blocks. 
6 lines changed or deleted 2 lines changed or added


 echo.h   echo.h 
/* $Id: echo.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: echo.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 echo_port.h   echo_port.h 
/* $Id: echo_port.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: echo_port.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 31 skipping to change at line 31
/** /**
* @file echo_port.h * @file echo_port.h
* @brief AEC (Accoustic Echo Cancellation) media port. * @brief AEC (Accoustic Echo Cancellation) media port.
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
/** /**
* @defgroup PJMEDIA_ECHO_PORT Echo Cancellation Port * @defgroup PJMEDIA_ECHO_PORT Echo Cancellation Port
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief Echo Cancellation Port * @brief Echo Cancellation
*
* Echo canceller media port, using @ref PJMEDIA_Echo_Cancel backend.
* @{ * @{
*
* Wrapper to \ref PJMEDIA_Echo_Cancel into media port interface.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Create echo canceller port. * Create echo canceller port.
* *
* @param pool Pool to allocate memory. * @param pool Pool to allocate memory.
* @param dn_port Downstream port. * @param dn_port Downstream port.
* @param tail_ms Tail length in miliseconds. * @param tail_ms Tail length in miliseconds.
 End of changes. 4 change blocks. 
5 lines changed or deleted 5 lines changed or added


 endpoint.h   endpoint.h 
/* $Id: endpoint.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: endpoint.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 28 skipping to change at line 28
*/ */
#ifndef __PJMEDIA_MEDIAMGR_H__ #ifndef __PJMEDIA_MEDIAMGR_H__
#define __PJMEDIA_MEDIAMGR_H__ #define __PJMEDIA_MEDIAMGR_H__
/** /**
* @file endpoint.h * @file endpoint.h
* @brief Media endpoint. * @brief Media endpoint.
*/ */
/** /**
* @defgroup PJMED_ENDPT The Endpoint * @defgroup PJMED_ENDPT The Endpoint
* @ingroup PJMEDIA
* @{ * @{
* *
* The media endpoint acts as placeholder for endpoint capabilities. Each * The media endpoint acts as placeholder for endpoint capabilities. Each
* media endpoint will have a codec manager to manage list of codecs instal led * media endpoint will have a codec manager to manage list of codecs instal led
* in the endpoint and a sound device factory. * in the endpoint and a sound device factory.
* *
* A reference to media endpoint instance is required when application want s * A reference to media endpoint instance is required when application want s
* to create a media session (#pjmedia_session_create()). * to create a media session (#pjmedia_session_create()).
*/ */
skipping to change at line 84 skipping to change at line 83
/** /**
* Get the ioqueue instance of the media endpoint. * Get the ioqueue instance of the media endpoint.
* *
* @param endpt The media endpoint instance. * @param endpt The media endpoint instance.
* *
* @return The ioqueue instance of the media endpoint. * @return The ioqueue instance of the media endpoint.
*/ */
PJ_DECL(pj_ioqueue_t*) pjmedia_endpt_get_ioqueue(pjmedia_endpt *endpt); PJ_DECL(pj_ioqueue_t*) pjmedia_endpt_get_ioqueue(pjmedia_endpt *endpt);
/** /**
* Get the number of worker threads on the media endpoint
*
* @param endpt The media endpoint instance.
* @return The number of worker threads on the media endpoint
*/
PJ_DECL(unsigned) pjmedia_endpt_get_thread_count(pjmedia_endpt *endpt);
/**
* Get a reference to one of the worker threads of the media endpoint
*
* @param endpt The media endpoint instance.
* @param index The index of the thread: 0<= index < thread_
cnt
*
* @return pj_thread_t or NULL
*/
PJ_DECL(pj_thread_t*) pjmedia_endpt_get_thread(pjmedia_endpt *endpt,
unsigned index);
/**
* Request the media endpoint to create pool. * Request the media endpoint to create pool.
* *
* @param endpt The media endpoint instance. * @param endpt The media endpoint instance.
* @param name Name to be assigned to the pool. * @param name Name to be assigned to the pool.
* @param initial Initial pool size, in bytes. * @param initial Initial pool size, in bytes.
* @param increment Increment size, in bytes. * @param increment Increment size, in bytes.
* *
* @return Memory pool. * @return Memory pool.
*/ */
PJ_DECL(pj_pool_t*) pjmedia_endpt_create_pool( pjmedia_endpt *endpt, PJ_DECL(pj_pool_t*) pjmedia_endpt_create_pool( pjmedia_endpt *endpt,
 End of changes. 4 change blocks. 
3 lines changed or deleted 22 lines changed or added


 errno.h   errno.h 
/* $Id: errno.h 1469 2007-10-03 18:28:49Z bennylp $ */ /* $Id: errno.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 33 skipping to change at line 33
* @file errno.h * @file errno.h
* @brief PJLIB Error Codes * @brief PJLIB Error Codes
*/ */
#include <pj/types.h> #include <pj/types.h>
#include <pj/compat/errno.h> #include <pj/compat/errno.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup pj_errno Error Codes * @defgroup pj_errno Error Codes
* @ingroup PJ
* @{ * @{
* *
* In PJLIB, error/status codes from operating system are translated * In PJLIB, error/status codes from operating system are translated
* into PJLIB error namespace, and stored in @a pj_status_t. All functions * into PJLIB error namespace, and stored in @a pj_status_t. All functions
* that work with @a pj_status_t expect to get PJLIB error code instead * that work with @a pj_status_t expect to get PJLIB error code instead
* of native codes. * of native codes.
* *
* @section pj_errno_retval Return Values * @section pj_errno_retval Return Values
* *
* All functions that returns @a pj_status_t returns @a PJ_SUCCESS if the * All functions that returns @a pj_status_t returns @a PJ_SUCCESS if the
skipping to change at line 113 skipping to change at line 112
* @param statcode The error code. * @param statcode The error code.
* @param buf Buffer to hold the error message string. * @param buf Buffer to hold the error message string.
* @param bufsize Size of the buffer. * @param bufsize Size of the buffer.
* *
* @return The error message as NULL terminated string, * @return The error message as NULL terminated string,
* wrapped with pj_str_t. * wrapped with pj_str_t.
*/ */
PJ_DECL(pj_str_t) pj_strerror( pj_status_t statcode, PJ_DECL(pj_str_t) pj_strerror( pj_status_t statcode,
char *buf, pj_size_t bufsize); char *buf, pj_size_t bufsize);
typedef pj_str_t (*pjsip_error_callback)(pj_status_t, char*, pj_size_t); /**
* Type of callback to be specified in #pj_register_strerror()
*
* @param e The error code to lookup.
* @param msg Buffer to store the error message.
* @param max Length of the buffer.
*
* @return The error string.
*/
typedef pj_str_t (*pj_error_callback)(pj_status_t e, char *msg, pj_size_t m
ax);
/** /**
* Register strerror message handler for the specified error space. * Register strerror message handler for the specified error space.
* Application can register its own handler to supply the error message * Application can register its own handler to supply the error message
* for the specified error code range. This handler will be called * for the specified error code range. This handler will be called
* by #pj_strerror(). * by #pj_strerror().
* *
* @param start_code The starting error code where the handler should * @param start_code The starting error code where the handler should
* be called to retrieve the error message. * be called to retrieve the error message.
* @param err_space The size of error space. The error code range then * @param err_space The size of error space. The error code range then
* will fall in start_code to start_code+err_space-1 * will fall in start_code to start_code+err_space-1
skipping to change at line 135 skipping to change at line 144
* @param f The handler to be called when #pj_strerror() is * @param f The handler to be called when #pj_strerror() is
* supplied with error code that falls into this range. * supplied with error code that falls into this range.
* *
* @return PJ_SUCCESS or the specified error code. The * @return PJ_SUCCESS or the specified error code. The
* registration may fail when the error space has been * registration may fail when the error space has been
* occupied by other handler, or when there are too man y * occupied by other handler, or when there are too man y
* handlers registered to PJLIB. * handlers registered to PJLIB.
*/ */
PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code, PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
pj_status_t err_space, pj_status_t err_space,
pjsip_error_callback f); pj_error_callback f);
/** /**
* @hideinitializer * @hideinitializer
* Return platform os error code folded into pj_status_t code. This is * Return platform os error code folded into pj_status_t code. This is
* the macro that is used throughout the library for all PJLIB's functions * the macro that is used throughout the library for all PJLIB's functions
* that returns error from operating system. Application may override * that returns error from operating system. Application may override
* this macro to reduce size (e.g. by defining it to always return * this macro to reduce size (e.g. by defining it to always return
* #PJ_EUNKNOWN). * #PJ_EUNKNOWN).
* *
* Note: * Note:
skipping to change at line 308 skipping to change at line 317
/** /**
* @hideinitializer * @hideinitializer
* Size is too small. * Size is too small.
*/ */
#define PJ_ETOOSMALL (PJ_ERRNO_START_STATUS + 19)/* 70019 */ #define PJ_ETOOSMALL (PJ_ERRNO_START_STATUS + 19)/* 70019 */
/** /**
* @hideinitializer * @hideinitializer
* Ignored * Ignored
*/ */
#define PJ_EIGNORED (PJ_ERRNO_START_STATUS + 20)/* 70020 */ #define PJ_EIGNORED (PJ_ERRNO_START_STATUS + 20)/* 70020 */
/**
* @hideinitializer
* IPv6 is not supported
*/
#define PJ_EIPV6NOTSUP (PJ_ERRNO_START_STATUS + 21)/* 70021 */
/**
* @hideinitializer
* Unsupported address family
*/
#define PJ_EAFNOTSUP (PJ_ERRNO_START_STATUS + 22)/* 70022 */
/** @} */ /* pj_errnum */ /** @} */ /* pj_errnum */
/** @} */ /* pj_errno */ /** @} */ /* pj_errno */
/** /**
* PJ_ERRNO_START is where PJLIB specific error values start. * PJ_ERRNO_START is where PJLIB specific error values start.
*/ */
#define PJ_ERRNO_START 20000 #define PJ_ERRNO_START 20000
 End of changes. 6 change blocks. 
5 lines changed or deleted 25 lines changed or added


 evsub.h   evsub.h 
/* $Id: evsub.h 1417 2007-08-16 10:11:44Z bennylp $ */ /* $Id: evsub.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJSIP_SIMPLE_EVSUB_H__ #ifndef __PJSIP_SIMPLE_EVSUB_H__
#define __PJSIP_SIMPLE_EVSUB_H__ #define __PJSIP_SIMPLE_EVSUB_H__
/** /**
* @file event_notify.h * @file evsub.h
* @brief SIP Specific Event Notification Extension (RFC 3265) * @brief SIP Specific Event Notification Extension (RFC 3265)
*/ */
#include <pjsip-simple/types.h> #include <pjsip-simple/types.h>
/** /**
* @defgroup PJSIP_EVENT_NOT SIP Event Notification (RFC 3265) Module * @defgroup PJSIP_EVENT_NOT SIP Event Notification (RFC 3265) Module
* @ingroup PJSIP_SIMPLE * @ingroup PJSIP_SIMPLE
* @brief Core Event Subscription framework, used by presence, call transfe r, etc. * @brief Core Event Subscription framework, used by presence, call transfe r, etc.
* @{ * @{
skipping to change at line 130 skipping to change at line 130
* This callback is called when incoming SUBSCRIBE (or any method that * This callback is called when incoming SUBSCRIBE (or any method that
* establishes the subscription in the first place) is received. It * establishes the subscription in the first place) is received. It
* allows application to specify what response should be sent to * allows application to specify what response should be sent to
* remote, along with additional headers and message body to be put * remote, along with additional headers and message body to be put
* in the response. * in the response.
* *
* This callback is OPTIONAL. * This callback is OPTIONAL.
* *
* However, implementation MUST send NOTIFY request upon receiving this * However, implementation MUST send NOTIFY request upon receiving this
* callback. The suggested behavior is to call * callback. The suggested behavior is to call
* #pjsip_evsub_last_notify(), since this function takes care * #pjsip_evsub_current_notify(), since this function takes care
* about unsubscription request and calculates the appropriate expirati on * about unsubscription request and calculates the appropriate expirati on
* interval. * interval.
*/ */
void (*on_rx_refresh)( pjsip_evsub *sub, void (*on_rx_refresh)( pjsip_evsub *sub,
pjsip_rx_data *rdata, pjsip_rx_data *rdata,
int *p_st_code, int *p_st_code,
pj_str_t **p_st_text, pj_str_t **p_st_text,
pjsip_hdr *res_hdr, pjsip_hdr *res_hdr,
pjsip_msg_body **p_body); pjsip_msg_body **p_body);
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 evsub_msg.h   evsub_msg.h 
/* $Id: evsub_msg.h 1417 2007-08-16 10:11:44Z bennylp $ */ /* $Id: evsub_msg.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__ #ifndef __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__
#define __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__ #define __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__
/** /**
* @file event_notify_msg.h * @file evsub_msg.h
* @brief SIP Event Notification Headers (RFC 3265) * @brief SIP Event Notification Headers (RFC 3265)
*/ */
#include <pjsip/sip_msg.h> #include <pjsip/sip_msg.h>
/** /**
* @defgroup PJSIP_EVENT_HDRS Additional Header Fields * @defgroup PJSIP_EVENT_HDRS Additional Header Fields
* @ingroup PJSIP_EVENT_NOT * @ingroup PJSIP_EVENT_NOT
* @{ * @{
*/ */
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 except.h   except.h 
/* $Id: except.h 1269 2007-05-12 15:03:23Z bennylp $ */ /* $Id: except.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 fifobuf.h   fifobuf.h 
/* $Id: fifobuf.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: fifobuf.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 file_access.h   file_access.h 
/* $Id: file_access.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: file_access.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 file_io.h   file_io.h 
/* $Id: file_io.h 1074 2007-03-16 09:25:47Z bennylp $ */ /* $Id: file_io.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 g711.h   g711.h 
/* $Id: g711.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: g711.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 getopt.h   getopt.h 
/* $Id: getopt.h 754 2006-10-08 13:56:07Z bennylp $ */ /* $Id: getopt.h 2037 2008-06-20 21:39:02Z bennylp $ */
/* This file has now become GPL. */ /* This file has now become GPL. */
/* Declarations for pj_getopt. /* Declarations for pj_getopt.
Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc . Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc .
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version. License, or (at your option) any later version.
skipping to change at line 32 skipping to change at line 32
#ifndef __PJ_GETOPT_H__ #ifndef __PJ_GETOPT_H__
#define __PJ_GETOPT_H__ 1 #define __PJ_GETOPT_H__ 1
/** /**
* @file getopt.h * @file getopt.h
* @brief Compile time settings * @brief Compile time settings
*/ */
/** /**
* @defgroup PJLIB_UTIL_GETOPT Getopt * @defgroup PJLIB_UTIL_GETOPT Getopt
* @ingroup PJLIB_UTIL * @ingroup PJLIB_TEXT
* @{ * @{
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* For communication from `pj_getopt' to the caller. /* For communication from `pj_getopt' to the caller.
When `pj_getopt' finds an option that takes an argument, When `pj_getopt' finds an option that takes an argument,
the argument value is returned here. the argument value is returned here.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 gsm.h   gsm.h 
/* $Id: gsm.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: gsm.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 34 skipping to change at line 34
* @brief GSM 06.10 codec. * @brief GSM 06.10 codec.
*/ */
#include <pjmedia-codec/types.h> #include <pjmedia-codec/types.h>
/** /**
* @defgroup PJMED_GSM GSM 06.10 Codec * @defgroup PJMED_GSM GSM 06.10 Codec
* @ingroup PJMEDIA_CODEC * @ingroup PJMEDIA_CODEC
* @brief Implementation of GSM FR based on GSM 06.10 library * @brief Implementation of GSM FR based on GSM 06.10 library
* @{ * @{
*
* This section describes functions to register and register GSM codec * This section describes functions to register and register GSM codec
* factory to the codec manager. After the codec factory has been registere d, * factory to the codec manager. After the codec factory has been registere d,
* application can use @ref PJMEDIA_CODEC API to manipulate the codec. * application can use @ref PJMEDIA_CODEC API to manipulate the codec.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Initialize and register GSM codec factory to pjmedia endpoint. * Initialize and register GSM codec factory to pjmedia endpoint.
* *
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added


 guid.h   guid.h 
/* $Id */ /* $Id: guid.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 32 skipping to change at line 32
/** /**
* @file guid.h * @file guid.h
* @brief GUID Globally Unique Identifier. * @brief GUID Globally Unique Identifier.
*/ */
#include <pj/types.h> #include <pj/types.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJ_DS Data Structure. * @defgroup PJ_DS Data Structure.
* @ingroup PJ
*/ */
/** /**
* @defgroup PJ_GUID Globally Unique Identifier * @defgroup PJ_GUID Globally Unique Identifier
* @ingroup PJ_DS * @ingroup PJ_DS
* @{ * @{
* *
* This module provides API to create string that is globally unique. * This module provides API to create string that is globally unique.
* If application doesn't require that strong requirement, it can just * If application doesn't require that strong requirement, it can just
* use #pj_create_random_string() instead. * use #pj_create_random_string() instead.
*/ */
/** /**
* PJ_GUID_STRING_LENGTH specifies length of GUID string. The value is * PJ_GUID_STRING_LENGTH specifies length of GUID string. The value is
* dependent on the algorithm used internally to generate the GUID string. * dependent on the algorithm used internally to generate the GUID string.
* If real GUID generator is used, then the length will be between 32 and * If real GUID generator is used, then the length will be between 32 and
* 36 bytes. If shadow GUID generator is used, then the length * 36 bytes. Application should not assume which algorithm will
* will be 20 bytes. Application should not assume which algorithm will
* be used by GUID generator. * be used by GUID generator.
* *
* Regardless of the actual length of the GUID, it will not exceed * Regardless of the actual length of the GUID, it will not exceed
* PJ_GUID_MAX_LENGTH characters. * PJ_GUID_MAX_LENGTH characters.
* *
* @see pj_GUID_STRING_LENGTH() * @see pj_GUID_STRING_LENGTH()
* @see PJ_GUID_MAX_LENGTH * @see PJ_GUID_MAX_LENGTH
*/ */
PJ_DECL_DATA(const unsigned) PJ_GUID_STRING_LENGTH; PJ_DECL_DATA(const unsigned) PJ_GUID_STRING_LENGTH;
 End of changes. 4 change blocks. 
5 lines changed or deleted 3 lines changed or added


 hash.h   hash.h 
/* $Id: hash.h 1307 2007-05-28 11:49:46Z bennylp $ */ /* $Id: hash.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 high_precision.h   high_precision.h 
/* $Id: high_precision.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: high_precision.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 hmac_md5.h   hmac_md5.h 
/* $Id: hmac_md5.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: hmac_md5.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 hmac_sha1.h   hmac_sha1.h 
/* $Id: hmac_sha1.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: hmac_sha1.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 ice_session.h   ice_session.h 
/* $Id: ice_session.h 1487 2007-10-07 12:51:15Z bennylp $ */ /* $Id: ice_session.h 2031 2008-06-19 13:54:21Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 28 skipping to change at line 28
*/ */
#ifndef __PJNATH_ICE_SESSION_H__ #ifndef __PJNATH_ICE_SESSION_H__
#define __PJNATH_ICE_SESSION_H__ #define __PJNATH_ICE_SESSION_H__
/** /**
* @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 <pj/sock.h> #include <pj/sock.h>
#include <pj/timer.h> #include <pj/timer.h>
/** /**
* @defgroup PJNATH_ICE Interactive Connectivity Establishment (ICE) * @defgroup PJNATH_ICE Interactive Connectivity Establishment (ICE)
* @brief Interactive Connectivity Establishment (ICE) * @brief Interactive Connectivity Establishment (ICE)
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
skipping to change at line 129 skipping to change at line 130
* in #pj_ice_sess_create() above. * in #pj_ice_sess_create() above.
* *
* When application receives any packets on the underlying sockets, it * When application receives any packets on the underlying sockets, it
* must call #pj_ice_sess_on_rx_pkt(). The ICE session will inspect the * must call #pj_ice_sess_on_rx_pkt(). The ICE session will inspect the
* packet to decide whether to process it locally (if the packet is a * packet to decide whether to process it locally (if the packet is a
* STUN message and is part of ICE session) or otherwise pass it back to * STUN message and is part of ICE session) or otherwise pass it back to
* application via \a on_rx_data callback. * application via \a on_rx_data callback.
*/ */
/** /**
* Forward declaration for checklist.
*/
typedef struct pj_ice_sess_checklist pj_ice_sess_checklist;
/**
* This enumeration describes the type of an ICE candidate. * This enumeration describes the type of an ICE candidate.
*/ */
typedef enum pj_ice_cand_type typedef enum pj_ice_cand_type
{ {
/** /**
* ICE host candidate. A host candidate represents the actual local * ICE host candidate. A host candidate represents the actual local
* transport address in the host. * transport address in the host.
*/ */
PJ_ICE_CAND_TYPE_HOST, PJ_ICE_CAND_TYPE_HOST,
skipping to change at line 191 skipping to change at line 197
/** /**
* The STUN session to be used to send and receive STUN messages for th is * The STUN session to be used to send and receive STUN messages for th is
* component. * component.
*/ */
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.
*/
typedef struct pj_ice_msg_data
{
unsigned transport_id;
pj_bool_t has_req_data;
union data {
struct request_data {
pj_ice_sess *ice;
pj_ice_sess_checklist *clist;
unsigned ckid;
} req;
} 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.
*/ */
typedef struct pj_ice_sess_cand typedef struct pj_ice_sess_cand
{ {
/** /**
* The candidate type, as described in #pj_ice_cand_type enumeration.
*/
pj_ice_cand_type type;
/**
* Status of this candidate. The value will be PJ_SUCCESS if candidate
* address has been resolved successfully, PJ_EPENDING when the address
* resolution process is in progress, or other value when the address
* resolution has completed with failure.
*/
pj_status_t status;
/**
* The component ID of this candidate. Note that component IDs starts * The component ID of this candidate. Note that component IDs starts
* with one for RTP and two for RTCP. In other words, it's not zero * with one for RTP and two for RTCP. In other words, it's not zero
* based. * based.
*/ */
pj_uint32_t comp_id; pj_uint8_t comp_id;
/** /**
* The candidate type, as described in #pj_ice_cand_type enumeration. * Transport ID to be used to send packets for this candidate.
*/ */
pj_ice_cand_type type; pj_uint8_t transport_id;
/**
* Local preference value, which typically is 65535.
*/
pj_uint16_t local_pref;
/** /**
* The foundation string, which is an identifier which value will be * The foundation string, which is an identifier which value will be
* equivalent for two candidates that are of the same type, share the * equivalent for two candidates that are of the same type, share the
* same base, and come from the same STUN server. The foundation is * same base, and come from the same STUN server. The foundation is
* used to optimize ICE performance in the Frozen algorithm. * used to optimize ICE performance in the Frozen algorithm.
*/ */
pj_str_t foundation; pj_str_t foundation;
/** /**
skipping to change at line 376 skipping to change at line 417
* either successfully or with failure. * either successfully or with failure.
*/ */
PJ_ICE_SESS_CHECKLIST_ST_COMPLETED PJ_ICE_SESS_CHECKLIST_ST_COMPLETED
} pj_ice_sess_checklist_state; } pj_ice_sess_checklist_state;
/** /**
* This structure represents ICE check list, that is an ordered set of * This structure represents ICE check list, that is an ordered set of
* candidate pairs that an agent will use to generate checks. * candidate pairs that an agent will use to generate checks.
*/ */
typedef struct pj_ice_sess_checklist struct pj_ice_sess_checklist
{ {
/** /**
* The checklist state. * The checklist state.
*/ */
pj_ice_sess_checklist_state state; pj_ice_sess_checklist_state state;
/** /**
* Number of candidate pairs (checks). * Number of candidate pairs (checks).
*/ */
unsigned count; unsigned count;
skipping to change at line 398 skipping to change at line 439
/** /**
* Array of candidate pairs (checks). * Array of candidate pairs (checks).
*/ */
pj_ice_sess_check checks[PJ_ICE_MAX_CHECKS]; pj_ice_sess_check checks[PJ_ICE_MAX_CHECKS];
/** /**
* A timer used to perform periodic check for this checklist. * A timer used to perform periodic check for this checklist.
*/ */
pj_timer_entry timer; pj_timer_entry timer;
} pj_ice_sess_checklist; };
/** /**
* This structure contains callbacks that will be called by the ICE * This structure contains callbacks that will be called by the ICE
* session. * session.
*/ */
typedef struct pj_ice_sess_cb typedef struct pj_ice_sess_cb
{ {
/** /**
* An optional callback that will be called by the ICE session when * An optional callback that will be called by the ICE session when
* ICE negotiation has completed, successfully or with failure. * ICE negotiation has completed, successfully or with failure.
skipping to change at line 422 skipping to change at line 463
* successful, or some error code. * successful, or some error code.
*/ */
void (*on_ice_complete)(pj_ice_sess *ice, pj_status_t status); void (*on_ice_complete)(pj_ice_sess *ice, pj_status_t status);
/** /**
* A mandatory callback which will be called by the ICE session when * A mandatory callback which will be called by the ICE session when
* it needs to send outgoing STUN packet. * it needs to send outgoing STUN packet.
* *
* @param ice The ICE session. * @param ice The ICE session.
* @param comp_id ICE component ID. * @param comp_id ICE component ID.
* @param transport_id Transport ID.
* @param pkt The STUN packet. * @param pkt The STUN packet.
* @param size The size of the packet. * @param size The size of the packet.
* @param dst_addr Packet destination address. * @param dst_addr Packet destination address.
* @param dst_addr_len Length of destination address. * @param dst_addr_len Length of destination address.
*/ */
pj_status_t (*on_tx_pkt)(pj_ice_sess *ice, unsigned comp_id, pj_status_t (*on_tx_pkt)(pj_ice_sess *ice, unsigned comp_id,
unsigned transport_id,
const void *pkt, pj_size_t size, const void *pkt, pj_size_t size,
const pj_sockaddr_t *dst_addr, const pj_sockaddr_t *dst_addr,
unsigned dst_addr_len); unsigned dst_addr_len);
/** /**
* A mandatory callback which will be called by the ICE session when * A mandatory callback which will be called by the ICE session when
* it receives packet which is not part of ICE negotiation. * it receives packet which is not part of ICE negotiation.
* *
* @param ice The ICE session. * @param ice The ICE session.
* @param comp_id ICE component ID. * @param comp_id ICE component ID.
* @param transport_id Transport ID.
* @param pkt The whole packet. * @param pkt The whole packet.
* @param size Size of the packet. * @param size Size of the packet.
* @param src_addr Source address where this packet was received * @param src_addr Source address where this packet was received
* from. * from.
* @param src_addr_len The length of source address. * @param src_addr_len The length of source address.
*/ */
void (*on_rx_data)(pj_ice_sess *ice, unsigned comp_id, void (*on_rx_data)(pj_ice_sess *ice, unsigned comp_id,
unsigned transport_id,
void *pkt, pj_size_t size, void *pkt, pj_size_t size,
const pj_sockaddr_t *src_addr, const pj_sockaddr_t *src_addr,
unsigned src_addr_len); unsigned src_addr_len);
} pj_ice_sess_cb; } pj_ice_sess_cb;
/** /**
* This enumeration describes the role of the ICE agent. * This enumeration describes the role of the ICE agent.
*/ */
typedef enum pj_ice_sess_role typedef enum pj_ice_sess_role
{ {
/** /**
* The ICE agent is in controlled role. * The role is unknown.
*/ */
PJ_ICE_SESS_ROLE_UNKNOWN, PJ_ICE_SESS_ROLE_UNKNOWN,
/** /**
* The ICE agent is in controlled role. * The ICE agent is in controlled role.
*/ */
PJ_ICE_SESS_ROLE_CONTROLLED, PJ_ICE_SESS_ROLE_CONTROLLED,
/** /**
* The ICE agent is in controlling role. * The ICE agent is in controlling role.
skipping to change at line 486 skipping to change at line 531
* 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);
unsigned comp_id; /**< Component ID. */ unsigned comp_id; /**< Component 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 */
} pj_ice_rx_check; } pj_ice_rx_check;
skipping to change at line 542 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 */
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 */
union {
char txt[128];
char errmsg[PJ_ERR_MSG_SIZE];
} 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.
* *
* @param type Candidate type. * @param type Candidate type.
* *
* @return The string representation of the candidate type. * @return The string representation of the candidate type.
*/ */
PJ_DECL(const char*) pj_ice_get_cand_type_name(pj_ice_cand_type type); PJ_DECL(const char*) pj_ice_get_cand_type_name(pj_ice_cand_type type);
/** /**
* This is a utility function to retrieve the string name for the
* particular role type.
*
* @param role Role type.
*
* @return The string representation of the role.
*/
PJ_DECL(const char*) pj_ice_sess_role_name(pj_ice_sess_role role);
/**
* This is a utility function to calculate the foundation identification * This is a utility function to calculate the foundation identification
* for a candidate. * for a candidate.
* *
* @param pool Pool to allocate the foundation string. * @param pool Pool to allocate the foundation string.
* @param foundation Pointer to receive the foundation string. * @param foundation Pointer to receive the foundation string.
* @param type Candidate type. * @param type Candidate type.
* @param base_addr Base address of the candidate. * @param base_addr Base address of the candidate.
*/ */
PJ_DECL(void) pj_ice_calc_foundation(pj_pool_t *pool, PJ_DECL(void) pj_ice_calc_foundation(pj_pool_t *pool,
pj_str_t *foundation, pj_str_t *foundation,
skipping to change at line 661 skipping to change at line 726
PJ_DECL(pj_status_t) pj_ice_sess_set_prefs(pj_ice_sess *ice, PJ_DECL(pj_status_t) pj_ice_sess_set_prefs(pj_ice_sess *ice,
const pj_uint8_t prefs[4]); const pj_uint8_t prefs[4]);
/** /**
* Add a candidate to this ICE session. Application must add candidates for * Add a candidate to this ICE session. Application must add candidates for
* each components ID before it can start pairing the candidates and * each components ID before it can start pairing the candidates and
* performing connectivity checks. * performing connectivity checks.
* *
* @param ice ICE session instance. * @param ice ICE session instance.
* @param comp_id Component ID of this candidate. * @param comp_id Component ID of this candidate.
* @param transport_id Transport ID to be used to send packets for this
* candidate.
* @param type Candidate type. * @param type Candidate type.
* @param local_pref Local preference for this candidate, which * @param local_pref Local preference for this candidate, which
* normally should be set to 65535. * normally should be set to 65535.
* @param foundation Foundation identification. * @param foundation Foundation identification.
* @param addr The candidate address. * @param addr The candidate address.
* @param base_addr The candidate's base address. * @param base_addr The candidate's base address.
* @param rel_addr Optional related address. * @param rel_addr Optional related address.
* @param addr_len Length of addresses. * @param addr_len Length of addresses.
* @param p_cand_id Optional pointer to receive the candidate ID. * @param p_cand_id Optional pointer to receive the candidate ID.
* *
* @return PJ_SUCCESS if candidate is successfully added. * @return PJ_SUCCESS if candidate is successfully added.
*/ */
PJ_DECL(pj_status_t) pj_ice_sess_add_cand(pj_ice_sess *ice, PJ_DECL(pj_status_t) pj_ice_sess_add_cand(pj_ice_sess *ice,
unsigned comp_id, unsigned comp_id,
unsigned transport_id,
pj_ice_cand_type type, pj_ice_cand_type type,
pj_uint16_t local_pref, pj_uint16_t local_pref,
const pj_str_t *foundation, const pj_str_t *foundation,
const pj_sockaddr_t *addr, const pj_sockaddr_t *addr,
const pj_sockaddr_t *base_addr, const pj_sockaddr_t *base_addr,
const pj_sockaddr_t *rel_addr, const pj_sockaddr_t *rel_addr,
int addr_len, int addr_len,
unsigned *p_cand_id); unsigned *p_cand_id);
/** /**
skipping to change at line 772 skipping to change at line 840
/** /**
* Report the arrival of packet to the ICE session. Since ICE session * Report the arrival of packet to the ICE session. Since ICE session
* itself doesn't have any transports, it relies on application or * itself doesn't have any transports, it relies on application or
* higher layer component to give incoming packets to the ICE session. * higher layer component to give incoming packets to the ICE session.
* If the packet is not a STUN packet, this packet will be given back * If the packet is not a STUN packet, this packet will be given back
* to application via \a on_rx_data() callback in #pj_ice_sess_cb. * to application via \a on_rx_data() callback in #pj_ice_sess_cb.
* *
* @param ice The ICE session. * @param ice The ICE session.
* @param comp_id Component ID. * @param comp_id Component ID.
* @param transport_id Number to identify where this packet was received
* from. This parameter will be returned back to
* application in \a on_tx_pkt() callback.
* @param pkt Incoming packet. * @param pkt Incoming packet.
* @param pkt_size Size of incoming packet. * @param pkt_size Size of incoming packet.
* @param src_addr Source address of the packet. * @param src_addr Source address of the packet.
* @param src_addr_len Length of the address. * @param src_addr_len Length of the address.
* *
* @return PJ_SUCCESS or the appropriate error code. * @return PJ_SUCCESS or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_ice_sess_on_rx_pkt(pj_ice_sess *ice, PJ_DECL(pj_status_t) pj_ice_sess_on_rx_pkt(pj_ice_sess *ice,
unsigned comp_id, unsigned comp_id,
unsigned transport_id,
void *pkt, void *pkt,
pj_size_t pkt_size, pj_size_t pkt_size,
const pj_sockaddr_t *src_addr, const pj_sockaddr_t *src_addr,
int src_addr_len); int src_addr_len);
/** /**
* @} * @}
*/ */
PJ_END_DECL PJ_END_DECL
 End of changes. 23 change blocks. 
7 lines changed or deleted 79 lines changed or added


 ice_strans.h   ice_strans.h 
/* $Id: ice_strans.h 1487 2007-10-07 12:51:15Z bennylp $ */ /* $Id: ice_strans.h 2031 2008-06-19 13:54:21Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 27 skipping to change at line 27
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJNATH_ICE_STRANS_H__ #ifndef __PJNATH_ICE_STRANS_H__
#define __PJNATH_ICE_STRANS_H__ #define __PJNATH_ICE_STRANS_H__
/** /**
* @file ice_strans.h * @file ice_strans.h
* @brief ICE Stream Transport * @brief ICE Stream Transport
*/ */
#include <pjnath/ice_session.h> #include <pjnath/ice_session.h>
#include <pjnath/stun_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 * @defgroup PJNATH_ICE_STREAM_TRANSPORT ICE Stream Transport
* @brief Transport for media streams using ICE * @brief Transport for media streams using ICE
* @ingroup PJNATH_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 component 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 PJNATH_ICE_STREAM_TRANSPORT_USING Using the ICE Stream Transpor
t
*
* Application may use the ICE stream transport in two ways:
* - it can create the ICE stream transports once during application
* initialization and keep them alive throughout application lifetime, o
r
* - it can create and destroy the ICE stream transport as needed everytim
e
* a call is made and destroyed.
*
* Keeping the ICE stream transport alive throughout
* application's lifetime is normally preferable, as initializing the
* ICE stream transport may incur delay because the ICE stream transport
* would need to communicate with the STUN/TURN server to get the
* server reflexive and relayed candidates for the transports.
*
* Regardless of which usage scenario is being used, the ICE stream
* transport is capable for restarting the ICE session being used and to
* send STUN keep-alives for its STUN server reflexive and relayed
* candidates. When ICE stream transport detects that the STUN mapped
* address has changed in the keep-alive response, it will automatically
* update its address to the new address, and notify the application via
* \a on_addr_change() function of the #pj_ice_strans_cb callback.
*
* \subsection PJNATH_ICE_ST_TRA_INIT Initialization
*
* Application creates the ICE stream transport by calling
* #pj_ice_strans_create() function. Among other things, application needs
* to specify:
* - STUN configuration (pj_stun_config), containing STUN settings
* such as timeout values and the instances of timer heap and
* ioqueue.
* - Session name, useful for identifying this session in the log.
* - Number of ICE components.
* - Arbitrary user data, useful when associating the ICE session
* with some application's data structure.
* - A callback (#pj_ice_strans_cb) to receive events from the ICE
* stream transport. Two of the most important fields in this
* callback structure are \a on_rx_data() to notify application
* about incoming data (perhaps RTP or RTCP packet), and
* \a on_ice_complete() to notify application that ICE negotiation
* has completed, either successfully or with failure.
*
* After the ICE stream transport is created, application may set up the
* STUN servers to be used to obtain STUN server reflexive and relayed
* candidate, by calling #pj_ice_strans_set_stun_domain() or
* #pj_ice_strans_set_stun_srv().
*
* Application then creates each component by calling
* #pj_ice_strans_create_comp(); this would create an actual socket
* which listens to the specified local address, and it would also
* perform lookup to find various transport address candidates for this
* socket.
*
* Adding component may involve contacting STUN and TURN servers to get
* STUN mapped address and allocate TURN relay channel, and this process
* may take some time to complete. Once application has added all
* components, it can check whether server reflexive and relayed
* candidates have been acquired, by calling #pj_ice_strans_get_comps_statu
s().
*
* \subsection PJNATH_ICE_ST_TRA_INIT_ICE Starting ICE Session
*
* When application is about to send an offer containing ICE capability,
* or when it receives an offer containing ICE capability, it would
* create the ICE session by calling #pj_ice_strans_init_ice(). This would
* register all transport address aliases for each component to the ICE
* session as candidates. After this application can enumerate all local
* candidates by calling #pj_ice_strans_enum_cands(), and encode these
* candidates in the SDP to be sent to remote agent.
*
* \subsection PJNATH_ICE_ST_TRA_START Starting Connectivity Checks
*
* Once application receives the SDP from remote, it pairs local candidates
* with remote candidates, and can start ICE connectivity checks. This is
* done by calling #pj_ice_strans_start_ice(), specifying
* the remote candidate list, and remote username and password. If the
* pairing process is successful, ICE connectivity checks will begin
* immediately. The ICE session/transport will then notify the application
* via the callback when ICE connectivity checks completes, either
* successfully or with failure.
*
* \subsection PJNATH_ICE_ST_TRA_SEND_RECV Sending and Receiving Data
*
* Application can send data (normally RTP or RTCP packets) at any time
* by calling #pj_ice_strans_sendto(). This function takes a destination
* address as one of the arguments, and this destination address should
* be taken from the default transport address of the component (that is
* the address in SDP c= and m= lines, or in a=rtcp attribute).
* If ICE negotiation is in progress, this function will send the data
* to the destination address. Otherwise if ICE negotiation has completed
* successfully, this function will send the data to the nominated remote
* address, as negotiated by ICE.
*
* Upon receiving incoming data (that is a non-STUN message), the ICE
* stream transport will notify the application by calling \a on_rx_data()
* of the #pj_ice_strans_cb callback.
*
* \subsection PJNATH_ICE_ST_TRA_STOP Stopping ICE Session
*
* Once the call is terminated, application no longer needs to keep the
* ICE session, so it should call #pj_ice_strans_stop_ice() to destroy the
* ICE session within this ICE stream transport. Note that this WILL NOT
* destroy the sockets/transports, it only destroys the ICE session
* within this ICE stream transport. It is recommended that application
* retains the ICE stream transport to speed up the process of setting up
* the next call. The ICE stream transport will continue to send STUN
* keep-alive packets to keep the NAT binding open and to detect change
* in STUN mapped address.
*
* \subsection PJNATH_ICE_ST_TRA_RESTART Restarting ICE Session
*
* When a new call is made, application can repeat the above
* #pj_ice_strans_init_ice() to #pj_ice_strans_stop_ice() cycle for
* the new call, using this same ICE stream transport.
*
* \subsection PJNATH_ICE_ST_TRA_DESTROY Destroying ICE Stream Transport
*
* Finally, when the ICE stream transport itself is no longer needed,
* for example when the application quits, application should call
* #pj_ice_strans_destroy() to release back all resources allocated by this
* ICE stream transport.
*
*/ */
/** 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 */
typedef enum pj_ice_strans_op
{
/** Initialization (candidate gathering) */
PJ_ICE_STRANS_OP_INIT,
/** Negotiation */
PJ_ICE_STRANS_OP_NEGOTIATION
} pj_ice_strans_op;
/** /**
* This structure contains callbacks that will be called by the * This structure contains callbacks that will be called by the
* ICE stream transport. * ICE stream transport.
*/ */
typedef struct pj_ice_strans_cb typedef struct pj_ice_strans_cb
{ {
/** /**
* This callback will be called when the ICE transport receives * This callback will be called when the ICE transport receives
* incoming packet from the sockets which is not related to ICE * incoming packet from the sockets which is not related to ICE
* (for example, normal RTP/RTCP packet destined for application). * (for example, normal RTP/RTCP packet destined for application).
skipping to change at line 200 skipping to change at line 93
* @param src_addr Source address of the packet. * @param src_addr Source address of the packet.
* @param src_addr_len Length of the source address. * @param src_addr_len Length of the source address.
*/ */
void (*on_rx_data)(pj_ice_strans *ice_st, void (*on_rx_data)(pj_ice_strans *ice_st,
unsigned comp_id, unsigned comp_id,
void *pkt, pj_size_t size, void *pkt, pj_size_t size,
const pj_sockaddr_t *src_addr, const pj_sockaddr_t *src_addr,
unsigned src_addr_len); unsigned src_addr_len);
/** /**
* This callback will be called when ICE checks have completed. * Callback to report status.
* This callback is optional.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* @param status The ICE connectivity check status. * @param op The operation
* @param status Operation status.
*/ */
void (*on_ice_complete)(pj_ice_strans *ice_st, void (*on_ice_complete)(pj_ice_strans *ice_st,
pj_ice_strans_op op,
pj_status_t status); pj_status_t status);
/**
* This callback will be called when ICE transport has detected that
* the STUN mapped address of a candidate has changed.
*
* @param ice_st The ICE stream transport.
* @param comp_id Component ID.
* @param cand_id Candidate ID.
*/
void (*on_addr_change)(pj_ice_strans *ice_st,
unsigned comp_id,
unsigned cand_id);
} pj_ice_strans_cb; } pj_ice_strans_cb;
/** /**
* Various flags that can be specified when creating a component with * This structure describes ICE stream transport configuration. Application
* #pj_ice_strans_create_comp(). These options may be combined together * should initialize the structure by calling #pj_ice_strans_cfg_default()
* with bitmask operation. * before changing the settings.
*/ */
enum pj_ice_strans_option typedef struct pj_ice_strans_cfg
{ {
/** /**
* If this option is specified, only a listening socket will be * Address family, IPv4 or IPv6. Currently only pj_AF_INET() (IPv4)
* created for the component, and no candidate will be added to * is supported, and this is the default value.
* the component. Application must add the component manually
* by inspecting the socket and transport address of the component.
*/
PJ_ICE_ST_OPT_DONT_ADD_CAND = 1,
/**
* If this option is specified, then no STUN reflexive candidate
* will be added to the component.
*/
PJ_ICE_ST_OPT_DISABLE_STUN = 2,
/**
* If this option is specified, then no STUN relay candidate
* will be added to the component.
*/ */
PJ_ICE_ST_OPT_DISABLE_RELAY = 4, int af;
/** /**
* If this option is specified, then when the function fails to * STUN configuration which contains the timer heap and
* bind the socket to the specified port, it WILL NOT try to * ioqueue instance to be used, and STUN retransmission
* bind the socket to the next available port. * settings. This setting is mandatory.
* *
* If this option is NOT specified, then the function will try to * The default value is all zero. Application must initialize
* bind the socket to next port+2, repetitively until the socket * this setting with #pj_stun_config_init().
* is bound successfully.
*/
PJ_ICE_ST_OPT_NO_PORT_RETRY = 8,
};
/**
* This structure describes ICE stream transport candidate. A "candidate"
* in ICE stream transport can be viewed as alias transport address
* for the socket.
*/
typedef struct pj_ice_strans_cand
{
/**
* Candidate type.
*/ */
pj_ice_cand_type type; pj_stun_config stun_cfg;
/** /**
* Status of this candidate. This status is useful for ICE reflexive * DNS resolver to be used to resolve servers. If DNS SRV
* and relay candidate, where the address needs to be resolved * resolution is required, the resolver must be set.
* asynchronously by sending STUN request to STUN server.
* *
* The value will be PJ_SUCCESS if candidate address has been resolved * The default value is NULL.
* successfully, PJ_EPENDING when the address resolution process is
* in progress, or other value when the address resolution has
* completed with failure.
*/ */
pj_status_t status; pj_dns_resolver *resolver;
/** /**
* The candidate transport address. * STUN and local transport settings. This specifies the
*/ * settings for local UDP socket, which will be resolved
pj_sockaddr addr; * to get the STUN mapped address.
*/
/** struct {
* The ICE session candidate ID after this candidate has been registere /**
d * Optional configuration for STUN transport. The default
* to an ICE session. Before ICE session is created, or after ICE * value will be initialized with #pj_stun_sock_cfg_default().
* session has been destroyed, the value will be -1. */
*/ pj_stun_sock_cfg cfg;
int ice_cand_id;
/**
/** * Disable host candidates. When this option is set, no
* Local preference value, which typically is 65535. * host candidates will be added.
*/ *
pj_uint16_t local_pref; * Default: PJ_FALSE
*/
/** pj_bool_t no_host_cands;
* Foundation associated with this candidate, which value normally will
be /**
* calculated by the function. * Include loopback addresses in the host candidates.
*/ *
pj_str_t foundation; * Default: PJ_FALSE
*/
} pj_ice_strans_cand; pj_bool_t loop_addr;
/** /**
* This structure describes an ICE stream transport component. A component * Specify the STUN server domain or hostname or IP address.
* in ICE stream transport typically corresponds to a single socket created * If DNS SRV resolution is required, application must fill
* for this component, and bound to a specific transport address. This * in this setting with the domain name of the STUN server
* component may have multiple alias addresses, for example one alias * and set the resolver instance in the \a resolver field.
* address for each interfaces in multi-homed host, another for server * Otherwise if the \a resolver setting is not set, this
* reflexive alias, and another for relayed alias. For each transport * field will be resolved with hostname resolution and in
* address alias, an ICE stream transport candidate (#pj_ice_strans_cand) w * this case the \a port field must be set.
ill *
* be created, and these candidates will eventually registered to the ICE * The \a port field should also be set even when DNS SRV
* session. * resolution is used, in case the DNS SRV resolution fails.
*/ *
typedef struct pj_ice_strans_comp * When this field is empty, STUN mapped address resolution
{ * will not be performed. In this case only ICE host candidates
pj_ice_strans *ice_st; /**< ICE stream transport. */ * will be added to the ICE transport, unless if \a no_host_cands
unsigned comp_id; /**< Component ID. */ * field is set. In this case, both host and srflx candidates
pj_uint32_t options; /**< Option flags. * are disabled.
*/ *
pj_sock_t sock; /**< Socket descriptor. */ * The default value is empty.
*/
pj_stun_session *stun_sess; /**< STUN session. */ pj_str_t server;
pj_uint8_t ka_tsx_id[12]; /**< ID for keep STUN alives */
/**
pj_sockaddr local_addr; /**< Local/base address. * The port number of the STUN server, when \a server
*/ * field specifies a hostname rather than domain name. This
* field should also be set even when the \a server
unsigned pending_cnt; /**< Pending resolution cnt. */ * specifies a domain name, to allow DNS SRV resolution
pj_status_t last_status; /**< Last status. * to fallback to DNS A/AAAA resolution when the DNS SRV
*/ * resolution fails.
*
unsigned cand_cnt; /**< # of candidates/aliaes. */ * The default value is PJ_STUN_PORT.
pj_ice_strans_cand cand_list[PJ_ICE_ST_MAX_CAND]; /**< Cand array */ */
int default_cand; /**< Default candidate selec pj_uint16_t port;
ted */
} stun;
pj_ioqueue_key_t *key; /**< ioqueue key. */
pj_uint8_t pkt[1500]; /**< Incoming packet buffer. */ /**
pj_ioqueue_op_key_t read_op; /**< ioqueue read operation * TURN specific settings.
key */ */
pj_ioqueue_op_key_t write_op; /**< ioqueue write op. key struct {
*/ /**
pj_sockaddr src_addr; /**< source packet address b * Specify the TURN server domain or hostname or IP address.
uf. */ * If DNS SRV resolution is required, application must fill
int src_addr_len; /**< length of src addr. buf * in this setting with the domain name of the TURN server
. */ * and set the resolver instance in the \a resolver field.
* Otherwise if the \a resolver setting is not set, this
} pj_ice_strans_comp; * field will be resolved with hostname resolution and in
* this case the \a port field must be set.
/** *
* This structure represents the ICE stream transport. * The \a port field should also be set even when DNS SRV
*/ * resolution is used, in case the DNS SRV resolution fails.
struct pj_ice_strans *
{ * When this field is empty, relay candidate will not be
char obj_name[PJ_MAX_OBJ_NAME]; /**< Log ID. */ * created.
*
pj_pool_t *pool; /**< Pool used by this object. */ * The default value is empty.
void *user_data; /**< Application data. */ */
pj_stun_config stun_cfg; /**< STUN settings. */ pj_str_t server;
pj_ice_strans_cb cb; /**< Application callback. */
/**
pj_ice_sess *ice; /**< ICE session. * The port number of the TURN server, when \a server
*/ * field specifies a hostname rather than domain name. This
* field should also be set even when the \a server
unsigned comp_cnt; /**< Number of components. */ * specifies a domain name, to allow DNS SRV resolution
pj_ice_strans_comp **comp; /**< Components array. */ * to fallback to DNS A/AAAA resolution when the DNS SRV
* resolution fails.
pj_dns_resolver *resolver; /**< The resolver instance. */ *
pj_bool_t has_rjob; /**< Has pending resolve? */ * Default is zero.
pj_sockaddr_in stun_srv; /**< STUN server address. */ */
pj_sockaddr_in turn_srv; /**< TURN server address. */ pj_uint16_t port;
pj_timer_entry ka_timer; /**< STUN keep-alive timer. */ /**
}; * Type of connection to the TURN server.
*
* Default is PJ_TURN_TP_UDP.
*/
pj_turn_tp_type conn_type;
/**
* Credential to be used for the TURN session. This setting
* is mandatory.
*
* Default is to have no credential.
*/
pj_stun_auth_cred auth_cred;
/**
* Optional TURN Allocate parameter. The default value will be
* initialized by #pj_turn_alloc_param_default().
*/
pj_turn_alloc_param alloc_param;
} turn;
} pj_ice_strans_cfg;
/**
* Initialize ICE transport configuration with default values.
*
* @param cfg The configuration to be initialized.
*/
PJ_DECL(void) pj_ice_strans_cfg_default(pj_ice_strans_cfg *cfg);
/**
* Copy configuration.
*
* @param pool Pool.
* @param dst Destination.
* @param src Source.
*/
PJ_DECL(void) pj_ice_strans_cfg_copy(pj_pool_t *pool,
pj_ice_strans_cfg *dst,
const pj_ice_strans_cfg *src);
/** /**
* Create the ICE stream transport containing the specified number of * Create and initialize the ICE stream transport with the specified
* components. After the ICE stream transport is created, application * parameters.
* may initialize the STUN server settings, and after that it has to
* initialize each components by calling #pj_ice_strans_create_comp()
* function.
* *
* @param stun_cfg The STUN settings.
* @param name Optional name for logging identification. * @param name Optional name for logging identification.
* @param cfg Configuration.
* @param comp_cnt Number of components. * @param comp_cnt Number of components.
* @param user_data Arbitrary user data to be associated with this * @param user_data Arbitrary user data to be associated with this
* ICE stream transport. * ICE stream transport.
* @param cb Callback. * @param cb Callback.
* @param p_ice_st Pointer to receive the ICE stream transport * @param p_ice_st Pointer to receive the ICE stream transport
* instance. * instance.
* *
* @return PJ_SUCCESS if ICE stream transport is created * @return PJ_SUCCESS if ICE stream transport is created
* successfully. * successfully.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_create(pj_stun_config *stun_cfg, PJ_DECL(pj_status_t) pj_ice_strans_create(const char *name,
const char *name, const pj_ice_strans_cfg *cfg,
unsigned comp_cnt, unsigned comp_cnt,
void *user_data, void *user_data,
const pj_ice_strans_cb *cb, const pj_ice_strans_cb *cb,
pj_ice_strans **p_ice_st); pj_ice_strans **p_ice_st);
/** /**
* Destroy the ICE stream transport. This will destroy the ICE session * Destroy the ICE stream transport. This will destroy the ICE session
* inside the ICE stream transport, close all sockets and release all * inside the ICE stream transport, close all sockets and release all
* other resources. * other resources.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_SUCCESS, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_destroy(pj_ice_strans *ice_st); PJ_DECL(pj_status_t) pj_ice_strans_destroy(pj_ice_strans *ice_st);
/** /**
* Set the domain to be used when resolving the STUN servers. If applicatio * Get the user data associated with the ICE stream transport.
n
* wants to utillize STUN, then STUN server must be specified, either by
* calling this function or by calling #pj_ice_strans_set_stun_srv().
*
* If application calls this function, then the STUN/TURN servers will
* be resolved by querying DNS SRV records for the specified domain.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* @param resolver The resolver instance that will be used to
* resolve the STUN/TURN servers.
* @param domain The target domain.
* *
* @return PJ_SUCCESS if DNS SRV resolution job can be * @return The user data.
* started. The resolution process itself will
* complete asynchronously.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_set_stun_domain(pj_ice_strans *ice_st, PJ_DECL(void*) pj_ice_strans_get_user_data(pj_ice_strans *ice_st);
pj_dns_resolver *resolver
,
const pj_str_t *domain);
/** /**
* Set the STUN and TURN server addresses. If application * Initialize the ICE session in the ICE stream transport.
* wants to utillize STUN, then STUN server must be specified, either by * When application is about to send an offer containing ICE capability,
* calling this function or by calling #pj_ice_strans_set_stun_domain(). * or when it receives an offer containing ICE capability, it must
* * call this function to initialize the internal ICE session. This would
* With this function, the STUN and TURN server addresses will be * register all transport address aliases for each component to the ICE
* assigned immediately, that is no DNS resolution will need to be * session as candidates. Then application can enumerate all local
* performed. * candidates by calling #pj_ice_strans_enum_cands(), and encode these
* candidates in the SDP to be sent to remote agent.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* @param stun_srv The STUN server address, or NULL if STUN * @param role ICE role.
* reflexive candidate is not to be used. * @param local_ufrag Optional local username fragment.
* @param turn_srv The TURN server address, or NULL if STUN * @param local_passwd Optional local password.
* relay candidate is not to be used.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_SUCCESS, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) PJ_DECL(pj_status_t) pj_ice_strans_init_ice(pj_ice_strans *ice_st,
pj_ice_strans_set_stun_srv( pj_ice_strans *ice_st, pj_ice_sess_role role,
const pj_sockaddr_in *stun_srv, const pj_str_t *local_ufrag,
const pj_sockaddr_in *turn_srv); const pj_str_t *local_passwd);
/** /**
* Create and initialize the specified component. This function will * Check if the ICE stream transport has the ICE session created. The
* instantiate the socket descriptor for this component, optionally * ICE session is created with #pj_ice_strans_init_ice().
* bind the socket to the specified address (or bind to any address/port
* if the \a addr parameter is NULL), and start finding all alias
* addresses for this socket. For each alias addresses that if finds,
* it will add an ICE stream transport candidate for this component.
*
* After all components have been initialized, application should poll
* the #pj_ice_strans_get_comps_status() peridically to check if STUN
* server reflexive and relayed candidates have been obtained
* successfully.
*
* @param ice_st The ICE stream transport.
* @param comp_id The component ID, which value must be greater than
* zero and less than or equal to the number of
* components in this ICE stream transport.
* @param options Options, see #pj_ice_strans_option.
* @param addr Local address where socket will be bound to. This
* address will be used as follows:
* - if the value is NULL, then socket will be bound
* to any available port.
* - if the value is not NULL, then if the port number
* is not zero, it will used as the starting port
* where the socket will be bound to. If bind() to
* this port fails, this function will try to bind
* to port+2, repeatedly until it succeeded.
* If application doesn't want this function to
* retry binding the socket to other port, it can
* specify PJ_ICE_ST_OPT_NO_PORT_RETRY option.
* - if the value is not NULL, then if the address
* is not INADDR_ANY, this function will bind the
* socket to this particular interface only, and
* no other host candidates will be added for this
* socket.
* *
* @param ice_st The ICE stream transport.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_TRUE if #pj_ice_strans_init_ice() has been
* called.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_create_comp(pj_ice_strans *ice_st, PJ_DECL(pj_bool_t) pj_ice_strans_has_sess(pj_ice_strans *ice_st);
unsigned comp_id,
pj_uint32_t options, /**
const pj_sockaddr_in *addr); * Check if ICE negotiation is still running.
/**
* Manually add a candidate (transport address alias) for the specified
* component. Normally application shouldn't need to use this function,
* as candidates will be added automatically when component is created
* with #pj_ice_strans_create_comp().
*
* @param ice_st ICE stream transport.
* @param comp_id The component ID.
* @param type The candidate type.
* @param local_pref The local preference for this candidate
* (typically the value is 65535).
* @param addr The candidate address.
* @param set_default Set to non-zero to make this candidate the
* default candidate for this component.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @param ice_st The ICE stream transport.
*
* @return PJ_TRUE if ICE session has been created and ICE
* negotiation negotiation is in progress.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_add_cand(pj_ice_strans *ice_st, PJ_DECL(pj_bool_t) pj_ice_strans_sess_is_running(pj_ice_strans *ice_st);
unsigned comp_id,
pj_ice_cand_type type,
pj_uint16_t local_pref,
const pj_sockaddr_in *addr,
pj_bool_t set_default);
/** /**
* Get the status of components in the ICE stream transports. Since * Check if ICE negotiation has completed.
* some IP address candidates have to be obtained asynchronously (for
* example, the STUN reflexive or relay candidate), application can
* use this function to know whether the address resolution has
* completed.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* *
* @return PJ_SUCCESS if all candidates have been resolved * @return PJ_TRUE if ICE session has been created and the
* successfully, PJ_EPENDING if transport resolution * negotiation is complete.
* is still in progress, or other status on failure.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_get_comps_status(pj_ice_strans *ice_st); PJ_DECL(pj_bool_t) pj_ice_strans_sess_is_complete(pj_ice_strans *ice_st);
/** /**
* Initialize the ICE session in the ICE stream transport. * Get the current/running component count. If ICE negotiation has not
* been started, the number of components will be equal to the number
* when the ICE stream transport was created. Once negotiation been
* started, the number of components will be the lowest number of
* component between local and remote agents.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* @param role ICE role.
* @param local_ufrag Optional local username fragment.
* @param local_passwd Optional local password.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return The running number of components.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_init_ice(pj_ice_strans *ice_st, PJ_DECL(unsigned) pj_ice_strans_get_running_comp_cnt(pj_ice_strans *ice_st)
pj_ice_sess_role role, ;
const pj_str_t *local_ufrag,
const pj_str_t *local_passwd); /**
* Get the ICE username fragment and password of the ICE session. The
* local username fragment and password can only be retrieved once ICE
* session has been created with #pj_ice_strans_init_ice(). The remote
* username fragment and password can only be retrieved once ICE session
* has been started with #pj_ice_strans_start_ice().
*
* Note that the string returned by this function is only valid throughout
* the duration of the ICE session, and the application must not modify
* these strings. Once the ICE session has been stopped with
* #pj_ice_strans_stop_ice(), the pointer in the string will no longer be
* valid.
*
* @param ice_st The ICE stream transport.
* @param loc_ufrag Optional pointer to receive ICE username fragment
* of local endpoint from the ICE session.
* @param loc_pwd Optional pointer to receive ICE password of local
* endpoint from the ICE session.
* @param rem_ufrag Optional pointer to receive ICE username fragment
* of remote endpoint from the ICE session.
* @param rem_pwd Optional pointer to receive ICE password of remote
* endpoint from the ICE session.
*
* @return PJ_SUCCESS if the strings have been retrieved
* successfully.
*/
PJ_DECL(pj_status_t) pj_ice_strans_get_ufrag_pwd(pj_ice_strans *ice_st,
pj_str_t *loc_ufrag,
pj_str_t *loc_pwd,
pj_str_t *rem_ufrag,
pj_str_t *rem_pwd);
/** /**
* Enumerate the local candidates. This function can only be called * Enumerate the local candidates for the specified component.
* after the ICE session has been created in the ICE stream transport.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* @param comp_id Component ID.
* @param count On input, it specifies the maximum number of * @param count On input, it specifies the maximum number of
* elements. On output, it will be filled with * elements. On output, it will be filled with
* the number of candidates copied to the * the number of candidates copied to the
* array. * array.
* @param cand Array of candidates. * @param cand Array of candidates.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_SUCCESS, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_enum_cands(pj_ice_strans *ice_st, PJ_DECL(pj_status_t) pj_ice_strans_enum_cands(pj_ice_strans *ice_st,
unsigned comp_id,
unsigned *count, unsigned *count,
pj_ice_sess_cand cand[]); pj_ice_sess_cand cand[]);
/** /**
* Get the default candidate for the specified component. When this
* function is called before ICE negotiation completes, the default
* candidate is selected according to local preference criteria. When
* this function is called after ICE negotiation completes, the
* default candidate is the candidate that forms the valid pair.
*
* @param ice_st The ICE stream transport.
* @param comp_id Component ID.
* @param cand Pointer to receive the default candidate
* information.
*/
PJ_DECL(pj_status_t) pj_ice_strans_get_def_cand(pj_ice_strans *ice_st,
unsigned comp_id,
pj_ice_sess_cand *cand);
/**
* Get the current ICE role. ICE session must have been initialized
* before this function can be called.
*
* @param ice_st The ICE stream transport.
*
* @return Current ICE role.
*/
PJ_DECL(pj_ice_sess_role) pj_ice_strans_get_role(pj_ice_strans *ice_st);
/**
* Change session role. This happens for example when ICE session was
* created with controlled role when receiving an offer, but it turns out
* that the offer contains "a=ice-lite" attribute when the SDP gets
* inspected. ICE session must have been initialized before this function
* can be called.
*
* @param ice_st The ICE stream transport.
* @param new_role The new role to be set.
*
* @return PJ_SUCCESS on success, or the appropriate error.
*/
PJ_DECL(pj_status_t) pj_ice_strans_change_role(pj_ice_strans *ice_st,
pj_ice_sess_role new_role);
/**
* Start ICE connectivity checks. This function can only be called * Start ICE connectivity checks. This function can only be called
* after the ICE session has been created in the ICE stream transport. * after the ICE session has been created in the ICE stream transport
* with #pj_ice_strans_init_ice().
* *
* This function will pair the local and remote candidates to create * This function must be called once application has received remote
* check list. Once the check list is created and sorted based on the * candidate list (typically from the remote SDP). This function pairs
* priority, ICE periodic checks will be started. This function will * local candidates with remote candidates, and starts ICE connectivity
* return immediately, and application will be notified about the * checks. The ICE session/transport will then notify the application
* connectivity check status in the callback. * via the callback when ICE connectivity checks completes, either
* successfully or with failure.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* @param rem_ufrag Remote ufrag, as seen in the SDP received from * @param rem_ufrag Remote ufrag, as seen in the SDP received from
* the remote agent. * the remote agent.
* @param rem_passwd Remote password, as seen in the SDP received from * @param rem_passwd Remote password, as seen in the SDP received from
* the remote agent. * the remote agent.
* @param rem_cand_cnt Number of remote candidates. * @param rcand_cnt Number of remote candidates in the array.
* @param rem_cand Remote candidate array. * @param rcand Remote candidates array.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_SUCCESS, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) PJ_DECL(pj_status_t) pj_ice_strans_start_ice(pj_ice_strans *ice_st,
pj_ice_strans_start_ice( pj_ice_strans *ice_st, const pj_str_t *rem_ufrag,
const pj_str_t *rem_ufrag, const pj_str_t *rem_passwd,
const pj_str_t *rem_passwd, unsigned rcand_cnt,
unsigned rem_cand_cnt, const pj_ice_sess_cand rcand[])
const pj_ice_sess_cand rem_cand[]); ;
/** /**
* Stop and destroy the ICE session inside this media transport. * Retrieve the candidate pair that has been nominated and successfully
* checked for the specified component. If ICE negotiation is still in
* progress or it has failed, this function will return NULL.
*
* @param ice_st The ICE stream transport.
* @param comp_id Component ID.
*
* @return The valid pair as ICE checklist structure if the
* pair exist.
*/
PJ_DECL(const pj_ice_sess_check*)
pj_ice_strans_get_valid_pair(const pj_ice_strans *ice_st,
unsigned comp_id);
/**
* Stop and destroy the ICE session inside this media transport. Applicatio
n
* needs to call this function once the media session is over (the call has
* been disconnected).
*
* Application MAY reuse this ICE stream transport for subsequent calls.
* In this case, it must call #pj_ice_strans_stop_ice() when the call is
* disconnected, and reinitialize the ICE stream transport for subsequent
* call with #pj_ice_strans_init_ice()/#pj_ice_strans_start_ice(). In this
* case, the ICE stream transport will maintain the internal sockets and
* continue to send STUN keep-alive packets and TURN Refresh request to
* keep the NAT binding/TURN allocation open and to detect change in STUN
* mapped address.
*
* If application does not want to reuse the ICE stream transport for
* subsequent calls, it must call #pj_ice_strans_destroy() to destroy the
* ICE stream transport altogether.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_SUCCESS, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_stop_ice(pj_ice_strans *ice_st); PJ_DECL(pj_status_t) pj_ice_strans_stop_ice(pj_ice_strans *ice_st);
/** /**
* Send outgoing packet using this transport. If ICE checks have not * Send outgoing packet using this transport.
* produced a valid check for the specified component ID, this function * Application can send data (normally RTP or RTCP packets) at any time
* send to the destination address. Otherwise it will send the packet to * by calling this function. This function takes a destination
* remote destination using the nominated local candidate as have been chec * address as one of the arguments, and this destination address should
ked * be taken from the default transport address of the component (that is
* previously. * the address in SDP c= and m= lines, or in a=rtcp attribute).
* If ICE negotiation is in progress, this function will send the data
* to the destination address. Otherwise if ICE negotiation has completed
* successfully, this function will send the data to the nominated remote
* address, as negotiated by ICE.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* @param comp_id Component ID. * @param comp_id Component ID.
* @param data The data or packet to be sent. * @param data The data or packet to be sent.
* @param data_len Size of data or packet, in bytes. * @param data_len Size of data or packet, in bytes.
* @param dst_addr The destination address. * @param dst_addr The destination address.
* @param dst_addr_len Length of destination address. * @param dst_addr_len Length of destination address.
* *
* @return PJ_SUCCESS if data is sent successfully. * @return PJ_SUCCESS if data is sent successfully.
*/ */
 End of changes. 53 change blocks. 
433 lines changed or deleted 360 lines changed or added


 ilbc.h   ilbc.h 
/* $Id: ilbc.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: ilbc.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 34 skipping to change at line 34
* @brief iLBC codec. * @brief iLBC codec.
*/ */
#include <pjmedia-codec/types.h> #include <pjmedia-codec/types.h>
/** /**
* @defgroup PJMED_ILBC iLBC Codec * @defgroup PJMED_ILBC iLBC Codec
* @ingroup PJMEDIA_CODEC * @ingroup PJMEDIA_CODEC
* @brief Implementation of iLBC Codec * @brief Implementation of iLBC Codec
* @{ * @{
*
* This section describes functions to register and register iLBC codec * This section describes functions to register and register iLBC codec
* factory to the codec manager. After the codec factory has been registere d, * factory to the codec manager. After the codec factory has been registere d,
* application can use @ref PJMEDIA_CODEC API to manipulate the codec. * application can use @ref PJMEDIA_CODEC API to manipulate the codec.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Initialize and register iLBC codec factory to pjmedia endpoint. * Initialize and register iLBC codec factory to pjmedia endpoint.
* *
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added


 ioqueue.h   ioqueue.h 
/* $Id: ioqueue.h 1405 2007-07-20 08:08:30Z bennylp $ /* $Id: ioqueue.h 2039 2008-06-20 22:44:47Z bennylp $
*/ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 104 skipping to change at line 104
* a much faster replacement for select() on Linux (and more importantly * a much faster replacement for select() on Linux (and more importantly
* doesn't have limitation on number of descriptors). * doesn't have limitation on number of descriptors).
* - <b>I/O Completion ports</b> on Windows NT/2000/XP, which is the most * - <b>I/O Completion ports</b> on Windows NT/2000/XP, which is the most
* efficient way to dispatch events in Windows NT based OSes, and most * efficient way to dispatch events in Windows NT based OSes, and most
* importantly, it doesn't have the limit on how many handles to monitor . * importantly, it doesn't have the limit on how many handles to monitor .
* And it works with files (not only sockets) as well. * And it works with files (not only sockets) as well.
* *
* *
* \section pj_ioqueue_concurrency_sec Concurrency Rules * \section pj_ioqueue_concurrency_sec Concurrency Rules
* *
* The items below describe rules that must be obeyed when using the I/O * The ioqueue has been fine tuned to allow multiple threads to poll the
* queue, with regard to concurrency: * handles simultaneously, to maximize scalability when the application is
* - simultaneous operations (by different threads) to different key is sa * running on multiprocessor systems. When more than one threads are pollin
fe. g
* - simultaneous operations to the same key is also safe, except * the ioqueue and there are more than one handles are signaled, more than
* <b>unregistration</b>, which is described below. * one threads will execute the callback simultaneously to serve the events
* - <b>care must be taken when unregistering a key</b> from the .
* These parallel executions are completely safe when the events happen for
* two different handles.
*
* However, with multithreading, care must be taken when multiple events
* happen on the same handle, or when event is happening on a handle (and
* the callback is being executed) and application is performing
* unregistration to the handle at the same time.
*
* The treatments of above scenario differ according to the concurrency
* setting that are applied to the handle.
*
* \subsection pj_ioq_concur_set Concurrency Settings for Handles
*
* Concurrency can be set on per handle (key) basis, by using
* #pj_ioqueue_set_concurrency() function. The default key concurrency valu
e
* for the handle is inherited from the key concurrency setting of the ioqu
eue,
* and the key concurrency setting for the ioqueue can be changed by using
* #pj_ioqueue_set_default_concurrency(). The default key concurrency setti
ng
* for ioqueue itself is controlled by compile time setting
* PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY.
*
* Note that this key concurrency setting only controls whether multiple
* threads are allowed to operate <b>on the same key</b> at the same time.
* The ioqueue itself always allows multiple threads to enter the ioqeuue a
t
* the same time, and also simultaneous callback calls to <b>differrent
* keys</b> is always allowed regardless to the key concurrency setting.
*
* \subsection pj_ioq_parallel Parallel Callback Executions for the Same Ha
ndle
*
* Note that when key concurrency is enabled (i.e. parallel callback calls
on
* the same key is allowed; this is the default setting), the ioqueue will
only
* perform simultaneous callback executions on the same key when the key ha
s
* invoked multiple pending operations. This could be done for example by
* calling #pj_ioqueue_recvfrom() more than once on the same key, each with
* the same key but different operation key (pj_ioqueue_op_key_t). With thi
s
* scenario, when multiple packets arrive on the key at the same time, more
* than one threads may execute the callback simultaneously, each with the
* same key but different operation key.
*
* When there is only one pending operation on the key (e.g. there is only
one
* #pj_ioqueue_recvfrom() invoked on the key), then events occuring to the
* same key will be queued by the ioqueue, thus no simultaneous callback ca
lls
* will be performed.
*
* \subsection pj_ioq_allow_concur Concurrency is Enabled (Default Value)
*
* The default setting for the ioqueue is to allow multiple threads to
* execute callbacks for the same handle/key. This setting is selected to
* promote good performance and scalability for application.
*
* However this setting has a major drawback with regard to synchronization
,
* and application MUST carefully follow the following guidelines to ensure
* that parallel access to the key does not cause problems:
*
* - Always note that callback may be called simultaneously for the same
* key.
* - <b>Care must be taken when unregistering a key</b> from the
* ioqueue. Application must take care that when one thread is issuing * ioqueue. Application must take care that when one thread is issuing
* an unregistration, other thread is not simultaneously invoking an * an unregistration, other thread is not simultaneously invoking the
* operation <b>to the same key</b>. * callback <b>to the same key</b>.
*\n *\n
* This happens because the ioqueue functions are working with a pointer * This happens because the ioqueue functions are working with a pointer
* to the key, and there is a possible race condition where the pointer * to the key, and there is a possible race condition where the pointer
* has been rendered invalid by other threads before the ioqueue has a * has been rendered invalid by other threads before the ioqueue has a
* chance to acquire mutex on it. * chance to acquire mutex on it.
* *
* \subsection pj_ioq_disallow_concur Concurrency is Disabled
*
* Alternatively, application may disable key concurrency to make
* synchronization easier. As noted above, there are three ways to control
* key concurrency setting:
* - by controlling on per handle/key basis, with #pj_ioqueue_set_concurre
ncy().
* - by changing default key concurrency setting on the ioqueue, with
* #pj_ioqueue_set_default_concurrency().
* - by changing the default concurrency on compile time, by declaring
* PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY macro to zero in your config_sit
e.h
*
* \section pj_ioqeuue_examples_sec Examples * \section pj_ioqeuue_examples_sec Examples
* *
* For some examples on how to use the I/O Queue, please see: * For some examples on how to use the I/O Queue, please see:
* *
* - \ref page_pjlib_ioqueue_tcp_test * - \ref page_pjlib_ioqueue_tcp_test
* - \ref page_pjlib_ioqueue_udp_test * - \ref page_pjlib_ioqueue_udp_test
* - \ref page_pjlib_ioqueue_perf_test * - \ref page_pjlib_ioqueue_perf_test
*/ */
/** /**
skipping to change at line 168 skipping to change at line 235
* @param bytes_read >= 0 to indicate the amount of data read, * @param bytes_read >= 0 to indicate the amount of data read,
* otherwise negative value containing the error * otherwise negative value containing the error
* code. To obtain the pj_status_t error code, use * code. To obtain the pj_status_t error code, use
* (pj_status_t code = -bytes_read). * (pj_status_t code = -bytes_read).
*/ */
void (*on_read_complete)(pj_ioqueue_key_t *key, void (*on_read_complete)(pj_ioqueue_key_t *key,
pj_ioqueue_op_key_t *op_key, pj_ioqueue_op_key_t *op_key,
pj_ssize_t bytes_read); pj_ssize_t bytes_read);
/** /**
* This callback is called when #pj_ioqueue_write or #pj_ioqueue_sendto * This callback is called when #pj_ioqueue_send or #pj_ioqueue_sendto
* completes. * completes.
* *
* @param key The key. * @param key The key.
* @param op_key Operation key. * @param op_key Operation key.
* @param bytes_sent >= 0 to indicate the amount of data written, * @param bytes_sent >= 0 to indicate the amount of data written,
* otherwise negative value containing the error * otherwise negative value containing the error
* code. To obtain the pj_status_t error code, use * code. To obtain the pj_status_t error code, use
* (pj_status_t code = -bytes_sent). * (pj_status_t code = -bytes_sent).
*/ */
void (*on_write_complete)(pj_ioqueue_key_t *key, void (*on_write_complete)(pj_ioqueue_key_t *key,
skipping to change at line 290 skipping to change at line 357
* @param lock The lock to be used by the ioqueue. * @param lock The lock to be used by the ioqueue.
* @param auto_delete In non-zero, the lock will be deleted by the ioqueu e. * @param auto_delete In non-zero, the lock will be deleted by the ioqueu e.
* *
* @return PJ_SUCCESS or the appropriate error code. * @return PJ_SUCCESS or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_ioqueue_set_lock( pj_ioqueue_t *ioque, PJ_DECL(pj_status_t) pj_ioqueue_set_lock( pj_ioqueue_t *ioque,
pj_lock_t *lock, pj_lock_t *lock,
pj_bool_t auto_delete ); pj_bool_t auto_delete );
/** /**
* Set default concurrency policy for this ioqueue. If this function is not
* called, the default concurrency policy for the ioqueue is controlled by
* compile time setting PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY.
*
* Note that changing the concurrency setting to the ioqueue will only affe
ct
* subsequent key registrations. To modify the concurrency setting for
* individual key, use #pj_ioqueue_set_concurrency().
*
* @param ioqueue The ioqueue instance.
* @param allow Non-zero to allow concurrent callback calls,
or
* PJ_FALSE to disallow it.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_ioqueue_set_default_concurrency(pj_ioqueue_t *ioque
ue,
pj_bool_t allow);
/**
* Register a socket to the I/O queue framework. * Register a socket to the I/O queue framework.
* When a socket is registered to the IOQueue, it may be modified to use * When a socket is registered to the IOQueue, it may be modified to use
* non-blocking IO. If it is modified, there is no guarantee that this * non-blocking IO. If it is modified, there is no guarantee that this
* modification will be restored after the socket is unregistered. * modification will be restored after the socket is unregistered.
* *
* @param pool To allocate the resource for the specified handle, * @param pool To allocate the resource for the specified handle,
* which must be valid until the handle/key is unregistered * which must be valid until the handle/key is unregistered
* from I/O Queue. * from I/O Queue.
* @param ioque The I/O Queue. * @param ioque The I/O Queue.
* @param sock The socket. * @param sock The socket.
skipping to change at line 365 skipping to change at line 450
* @param user_data User data to be associated with the descriptor. * @param user_data User data to be associated with the descriptor.
* @param old_data Optional parameter to retrieve the old user data. * @param old_data Optional parameter to retrieve the old user data.
* *
* @return PJ_SUCCESS on success or the error code. * @return PJ_SUCCESS on success or the error code.
*/ */
PJ_DECL(pj_status_t) pj_ioqueue_set_user_data( pj_ioqueue_key_t *key, PJ_DECL(pj_status_t) pj_ioqueue_set_user_data( pj_ioqueue_key_t *key,
void *user_data, void *user_data,
void **old_data); void **old_data);
/** /**
* Configure whether the ioqueue is allowed to call the key's callback
* concurrently/in parallel. The default concurrency setting for the key
* is controlled by ioqueue's default concurrency value, which can be
* changed by calling #pj_ioqueue_set_default_concurrency().
*
* If concurrency is allowed for the key, it means that if there are more
* than one pending operations complete simultaneously, more than one
* threads may call the key's callback at the same time. This generally
* would promote good scalability for application, at the expense of more
* complexity to manage the concurrent accesses in application's code.
*
* Alternatively application may disable the concurrent access by
* setting the \a allow flag to false. With concurrency disabled, only
* one thread can call the key's callback at one time.
*
* @param key The key that was previously obtained from registration.
* @param allow Set this to non-zero to allow concurrent callbac
k calls
* and zero (PJ_FALSE) to disallow it.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_ioqueue_set_concurrency(pj_ioqueue_key_t *key,
pj_bool_t allow);
/**
* Acquire the key's mutex. When the key's concurrency is disabled,
* application may call this function to synchronize its operation
* with the key's callback (i.e. this function will block until the
* key's callback returns).
*
* @param key The key that was previously obtained from registration.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_ioqueue_lock_key(pj_ioqueue_key_t *key);
/**
* Release the lock previously acquired with pj_ioqueue_lock_key().
*
* @param key The key that was previously obtained from registration.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_ioqueue_unlock_key(pj_ioqueue_key_t *key);
/**
* Initialize operation key. * Initialize operation key.
* *
* @param op_key The operation key to be initialied. * @param op_key The operation key to be initialied.
* @param size The size of the operation key. * @param size The size of the operation key.
*/ */
PJ_DECL(void) pj_ioqueue_op_key_init( pj_ioqueue_op_key_t *op_key, PJ_DECL(void) pj_ioqueue_op_key_init( pj_ioqueue_op_key_t *op_key,
pj_size_t size ); pj_size_t size );
/** /**
* Check if operation is pending on the specified operation key. * Check if operation is pending on the specified operation key.
 End of changes. 8 change blocks. 
12 lines changed or deleted 162 lines changed or added


 ip_helper.h   ip_helper.h 
/* $Id: ip_helper.h 1104 2007-03-25 18:44:51Z bennylp $ */ /* $Id: ip_helper.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 55 skipping to change at line 55
/** IP routing entry for IP version 4 routing */ /** IP routing entry for IP version 4 routing */
struct struct
{ {
pj_in_addr if_addr; /**< Local interface IP address. */ pj_in_addr if_addr; /**< Local interface IP address. */
pj_in_addr dst_addr; /**< Destination IP address. */ pj_in_addr dst_addr; /**< Destination IP address. */
pj_in_addr mask; /**< Destination mask. */ pj_in_addr mask; /**< Destination mask. */
} ipv4; } ipv4;
} pj_ip_route_entry; } pj_ip_route_entry;
/** /**
* Enumerate the local IP interface currently active in the host. * Enumerate the local IP interfaces currently active in the host.
* *
* @param af Family of the address to be retrieved. Application
* may specify pj_AF_UNSPEC() to retrieve all addresses,
* or pj_AF_INET() or pj_AF_INET6() to retrieve interfaces
* with specific address family.
* @param count On input, specify the number of entries. On outp ut, * @param count On input, specify the number of entries. On outp ut,
* it will be filled with the actual number of entries. * it will be filled with the actual number of entries.
* @param ifs Array of IP addresses. * @param ifs Array of socket addresses, which address part will
* be filled with the interface address. The address
* family part will be initialized with the address
* family of the IP address.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_enum_ip_interface(unsigned *count, PJ_DECL(pj_status_t) pj_enum_ip_interface(int af,
pj_in_addr ifs[]); unsigned *count,
pj_sockaddr ifs[]);
/** /**
* Enumerate the IP routing table for this host. * Enumerate the IP routing table for this host.
* *
* @param count On input, specify the number of routes entries. On output, * @param count On input, specify the number of routes entries. On output,
* it will be filled with the actual number of route entrie s. * it will be filled with the actual number of route entrie s.
* @param routes Array of IP routing entries. * @param routes Array of IP routing entries.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
 End of changes. 6 change blocks. 
6 lines changed or deleted 14 lines changed or added


 iscomposing.h   iscomposing.h 
/* $Id: iscomposing.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: iscomposing.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 jbuf.h   jbuf.h 
/* $Id: jbuf.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: jbuf.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 34 skipping to change at line 34
/** /**
* @file jbuf.h * @file jbuf.h
* @brief Adaptive jitter buffer implementation. * @brief Adaptive jitter buffer implementation.
*/ */
#include <pjmedia/types.h> #include <pjmedia/types.h>
/** /**
* @defgroup PJMED_JBUF Adaptive jitter buffer * @defgroup PJMED_JBUF Adaptive jitter buffer
* @ingroup PJMEDIA_FRAME_OP * @ingroup PJMEDIA_FRAME_OP
* @brief Adaptive de-jitter buffering implementation
* @{ * @{
*
* This section describes PJMEDIA's implementation of de-jitter buffer. * This section describes PJMEDIA's implementation of de-jitter buffer.
* The de-jitter buffer may be set to operate in adaptive mode or fixed * The de-jitter buffer may be set to operate in adaptive mode or fixed
* delay mode. * delay mode.
*
* The jitter buffer is also able to report the status of the current
* frame (#pjmedia_jb_frame_type). This status is used for examply by
* @ref PJMED_STRM to invoke the codec's @ref PJMED_PLC algorithm.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Types of frame returned by the jitter buffer. * Types of frame returned by the jitter buffer.
*/ */
enum pjmedia_jb_frame_type enum pjmedia_jb_frame_type
{ {
PJMEDIA_JB_MISSING_FRAME = 0, /**< No frame because it's missing */ PJMEDIA_JB_MISSING_FRAME = 0, /**< No frame because it's missing */
skipping to change at line 74 skipping to change at line 72
/** /**
* This structure describes jitter buffer current status. * This structure describes jitter buffer current status.
*/ */
struct pjmedia_jb_state struct pjmedia_jb_state
{ {
unsigned frame_size; /**< Individual frame size, in bytes. */ unsigned frame_size; /**< Individual frame size, in bytes. */
unsigned prefetch; /**< Current prefetch value, in frames */ 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. */
unsigned size; /**< Current buffer size, in frames. */ unsigned size; /**< Current buffer size, in frames. */
unsigned avg_delay; /**< Average delay, in ms.
*/
unsigned min_delay; /**< Minimum delay, in ms.
*/
unsigned max_delay; /**< Maximum delay, in ms.
*/
unsigned dev_delay; /**< Standard deviation of delay, in ms.
*/
}; };
/** /**
* @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.
skipping to change at line 189 skipping to change at line 191
* it in the appropriate position in the buffer. * it in the appropriate position in the buffer.
* *
* Application MUST manage it's own synchronization when multiple threads * Application MUST manage it's own synchronization when multiple threads
* are accessing the jitter buffer at the same time. * are accessing the jitter buffer at the same time.
* *
* @param jb The jitter buffer. * @param jb The jitter buffer.
* @param frame Pointer to frame buffer to be stored in the jitter * @param frame Pointer to frame buffer to be stored in the jitter
* buffer. * buffer.
* @param size The frame size. * @param size The frame size.
* @param frame_seq The frame sequence number. * @param frame_seq The frame sequence number.
*
* @return PJ_SUCCESS on success.
*/ */
PJ_DECL(void) pjmedia_jbuf_put_frame( pjmedia_jbuf *jb, PJ_DECL(void) pjmedia_jbuf_put_frame( pjmedia_jbuf *jb,
const void *frame, const void *frame,
pj_size_t size, pj_size_t size,
int frame_seq); int frame_seq);
/** /**
* Put a frame to the jitter buffer. If the frame can be accepted (based
* on the sequence number), the jitter buffer will copy the frame and put
* it in the appropriate position in the buffer.
*
* Application MUST manage it's own synchronization when multiple threads
* are accessing the jitter buffer at the same time.
*
* @param jb The jitter buffer.
* @param frame Pointer to frame buffer to be stored in the
jitter
* buffer.
* @param size The frame size.
* @param bit_info Bit precise info of the frame, e.g: a frame may not
* exactly start and end at the octet boundary, so this
* field may be used for specifying start & end bit off
set.
* @param frame_seq The frame sequence number.
* @param discarded Flag whether the frame is discarded by jitter buffer
.
*/
PJ_DECL(void) pjmedia_jbuf_put_frame2( pjmedia_jbuf *jb,
const void *frame,
pj_size_t size,
pj_uint32_t bit_info,
int frame_seq,
pj_bool_t *discarded);
/**
* Get a frame from the jitter buffer. The jitter buffer will return the * Get a frame from the jitter buffer. The jitter buffer will return the
* oldest frame from it's buffer, when it is available. * oldest frame from it's buffer, when it is available.
* *
* Application MUST manage it's own synchronization when multiple threads * Application MUST manage it's own synchronization when multiple threads
* are accessing the jitter buffer at the same time. * are accessing the jitter buffer at the same time.
* *
* @param jb The jitter buffer. * @param jb The jitter buffer.
* @param frame Buffer to receive the payload from the jitte r buffer. * @param frame Buffer to receive the payload from the jitte r buffer.
* Application MUST make sure that the buffer has * Application MUST make sure that the buffer has
* appropriate size (i.e. not less than the frame size, * appropriate size (i.e. not less than the frame size,
skipping to change at line 227 skipping to change at line 252
* will be set to PJMEDIA_JB_MISSING_FRAME, and no * will be set to PJMEDIA_JB_MISSING_FRAME, and no
* frame will be copied. If there is a frame, the jitte r * frame will be copied. If there is a frame, the jitte r
* buffer will copy the frame to the buffer, and frame * buffer will copy the frame to the buffer, and frame
* type will be set to PJMEDIA_JB_NORMAL_FRAME. * type will be set to PJMEDIA_JB_NORMAL_FRAME.
*/ */
PJ_DECL(void) pjmedia_jbuf_get_frame( pjmedia_jbuf *jb, PJ_DECL(void) pjmedia_jbuf_get_frame( pjmedia_jbuf *jb,
void *frame, void *frame,
char *p_frm_type); char *p_frm_type);
/** /**
* Get a frame from the jitter buffer. The jitter buffer will return the
* oldest frame from it's buffer, when it is available.
*
* @param jb The jitter buffer.
* @param frame Buffer to receive the payload from the jitte
r buffer.
* @see pjmedia_jbuf_get_frame().
* @param size Pointer to receive frame size.
* @param p_frm_type Pointer to receive frame type.
* @see pjmedia_jbuf_get_frame().
* @param bit_info Bit precise info of the frame, e.g: a frame may not
* exactly start and end at the octet boundary, so this
* field may be used for specifying start & end bit off
set.
*/
PJ_DECL(void) pjmedia_jbuf_get_frame2(pjmedia_jbuf *jb,
void *frame,
pj_size_t *size,
char *p_frm_type,
pj_uint32_t *bit_info);
/**
* Get jitter buffer current state/settings. * Get jitter buffer current state/settings.
* *
* @param jb The jitter buffer. * @param jb The jitter buffer.
* @param state Buffer to receive jitter buffer state. * @param state Buffer to receive jitter buffer state.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_jbuf_get_state( pjmedia_jbuf *jb, PJ_DECL(pj_status_t) pjmedia_jbuf_get_state( pjmedia_jbuf *jb,
pjmedia_jb_state *state ); pjmedia_jb_state *state );
 End of changes. 9 change blocks. 
8 lines changed or deleted 62 lines changed or added


 l16.h   l16.h 
/* $Id: l16.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: l16.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 27 skipping to change at line 27
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJMEDIA_CODEC_L16_H__ #ifndef __PJMEDIA_CODEC_L16_H__
#define __PJMEDIA_CODEC_L16_H__ #define __PJMEDIA_CODEC_L16_H__
#include <pjmedia-codec/types.h> #include <pjmedia-codec/types.h>
/** /**
* @defgroup PJMED_L16 L16 Codec Family * @defgroup PJMED_L16 L16 Codec Family
* @ingroup PJMEDIA_CODEC * @ingroup PJMEDIA_CODEC
* @brief 16bit linear codecs (useful for debugging) * @brief PCM/16bit/linear codecs
* @{ * @{
*
* This section describes functions to register and register L16 codec * This section describes functions to register and register L16 codec
* factory to the codec manager. After the codec factory has been registere d, * factory to the codec manager. After the codec factory has been registere d,
* application can use @ref PJMEDIA_CODEC API to manipulate the codec. * application can use @ref PJMEDIA_CODEC API to manipulate the codec.
* *
* Note that the L16 codec factory registers several (about fourteen!) * Note that the L16 codec factory registers several (about fourteen!)
* L16 codec types to codec manager (different combinations of clock * L16 codec types to codec manager (different combinations of clock
* rate and number of channels). * rate and number of channels).
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 lines changed or added


 list.h   list.h 
/* $Id: list.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: list.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 33 skipping to change at line 33
* @file list.h * @file list.h
* @brief Linked List data structure. * @brief Linked List data structure.
*/ */
#include <pj/types.h> #include <pj/types.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/* /*
* @defgroup PJ_DS Data Structure. * @defgroup PJ_DS Data Structure.
* @ingroup PJ
*/ */
/** /**
* @defgroup PJ_LIST Linked List * @defgroup PJ_LIST Linked List
* @ingroup PJ_DS * @ingroup PJ_DS
* @{ * @{
* *
* List in PJLIB is implemented as doubly-linked list, and it won't require * List in PJLIB is implemented as doubly-linked list, and it won't require
* dynamic memory allocation (just as all PJLIB data structures). The list here * dynamic memory allocation (just as all PJLIB data structures). The list here
* should be viewed more like a low level C list instead of high level C++ list * should be viewed more like a low level C list instead of high level C++ list
skipping to change at line 244 skipping to change at line 243
const pj_list_type *node) const pj_list_type *node)
); );
/** /**
* Traverse the list to get the number of elements in the list. * Traverse the list to get the number of elements in the list.
* *
* @param list The list head. * @param list The list head.
* *
* @return Number of elements. * @return Number of elements.
*/ */
PJ_IDECL(pj_size_t) pj_list_size(pj_list_type *list); PJ_IDECL(pj_size_t) pj_list_size(const pj_list_type *list);
/** /**
* @} * @}
*/ */
#if PJ_FUNCTIONS_ARE_INLINED #if PJ_FUNCTIONS_ARE_INLINED
# include "list_i.h" # include "list_i.h"
#endif #endif
PJ_END_DECL PJ_END_DECL
 End of changes. 4 change blocks. 
4 lines changed or deleted 3 lines changed or added


 list_i.h   list_i.h 
/* $Id: list_i.h 1405 2007-07-20 08:08:30Z bennylp $ */ /* $Id: list_i.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 75 skipping to change at line 75
if (!pj_list_empty(lst2)) { if (!pj_list_empty(lst2)) {
pj_link_node(((pj_list*)lst2)->prev, ((pj_list*)lst1)->next); pj_link_node(((pj_list*)lst2)->prev, ((pj_list*)lst1)->next);
pj_link_node(((pj_list*)lst1), ((pj_list*)lst2)->next); pj_link_node(((pj_list*)lst1), ((pj_list*)lst2)->next);
pj_list_init(lst2); pj_list_init(lst2);
} }
} }
PJ_IDEF(void) pj_list_erase(pj_list_type *node) PJ_IDEF(void) pj_list_erase(pj_list_type *node)
{ {
pj_link_node( ((pj_list*)node)->prev, ((pj_list*)node)->next); pj_link_node( ((pj_list*)node)->prev, ((pj_list*)node)->next);
/* It'll be safer to init the next/prev fields to itself, to
* prevent multiple erase() from corrupting the list. See
* ticket #520 for one sample bug.
*/
pj_list_init(node);
} }
PJ_IDEF(pj_list_type*) pj_list_find_node(pj_list_type *list, pj_list_type * node) PJ_IDEF(pj_list_type*) pj_list_find_node(pj_list_type *list, pj_list_type * node)
{ {
pj_list *p = (pj_list *) ((pj_list*)list)->next; pj_list *p = (pj_list *) ((pj_list*)list)->next;
while (p != list && p != node) while (p != list && p != node)
p = (pj_list *) p->next; p = (pj_list *) p->next;
return p==node ? p : NULL; return p==node ? p : NULL;
} }
skipping to change at line 96 skipping to change at line 102
PJ_IDEF(pj_list_type*) pj_list_search(pj_list_type *list, void *value, PJ_IDEF(pj_list_type*) pj_list_search(pj_list_type *list, void *value,
int (*comp)(void *value, const pj_list_type *node)) int (*comp)(void *value, const pj_list_type *node))
{ {
pj_list *p = (pj_list *) ((pj_list*)list)->next; pj_list *p = (pj_list *) ((pj_list*)list)->next;
while (p != list && (*comp)(value, p) != 0) while (p != list && (*comp)(value, p) != 0)
p = (pj_list *) p->next; p = (pj_list *) p->next;
return p==list ? NULL : p; return p==list ? NULL : p;
} }
PJ_IDEF(pj_size_t) pj_list_size(pj_list_type *list) PJ_IDEF(pj_size_t) pj_list_size(const pj_list_type *list)
{ {
pj_list *node = (pj_list*) ((pj_list*)list)->next; const pj_list *node = (const pj_list*) ((const pj_list*)list)->next;
pj_size_t count = 0; pj_size_t count = 0;
while (node != list) { while (node != list) {
++count; ++count;
node = (pj_list*)node->next; node = (pj_list*)node->next;
} }
return count; return count;
} }
 End of changes. 5 change blocks. 
4 lines changed or deleted 10 lines changed or added


 lock.h   lock.h 
/* $Id: lock.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: lock.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 log.h   log.h 
/* $Id: log.h 1405 2007-07-20 08:08:30Z bennylp $ */ /* $Id: log.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 34 skipping to change at line 34
* @brief Logging Utility. * @brief Logging Utility.
*/ */
#include <pj/types.h> #include <pj/types.h>
#include <stdarg.h> #include <stdarg.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJ_MISC Miscelaneous * @defgroup PJ_MISC Miscelaneous
* @ingroup PJ
*/ */
/** /**
* @defgroup PJ_LOG Logging Facility * @defgroup PJ_LOG Logging Facility
* @ingroup PJ_MISC * @ingroup PJ_MISC
* @{ * @{
* *
* The PJLIB logging facility is a configurable, flexible, and convenient * The PJLIB logging facility is a configurable, flexible, and convenient
* way to write logging or trace information. * way to write logging or trace information.
* *
skipping to change at line 111 skipping to change at line 110
#define PJ_LOG(level,arg) do { \ #define PJ_LOG(level,arg) do { \
if (level <= pj_log_get_level()) \ if (level <= pj_log_get_level()) \
pj_log_wrapper_##level(arg); \ pj_log_wrapper_##level(arg); \
} while (0) } while (0)
/** /**
* Signature for function to be registered to the logging subsystem to * Signature for function to be registered to the logging subsystem to
* write the actual log message to some output device. * write the actual log message to some output device.
* *
* @param level Log level. * @param level Log level.
* @param data Log message. * @param data Log message, which will be NULL terminated.
* @param len Message length. * @param len Message length.
*/ */
typedef void pj_log_func(int level, const char *data, int len); typedef void pj_log_func(int level, const char *data, int len);
/** /**
* Default logging writer function used by front end logger function. * Default logging writer function used by front end logger function.
* This function will print the log message to stdout only. * This function will print the log message to stdout only.
* Application normally should NOT need to call this function, but * Application normally should NOT need to call this function, but
* rather use the PJ_LOG macro. * rather use the PJ_LOG macro.
* *
 End of changes. 4 change blocks. 
4 lines changed or deleted 3 lines changed or added


 m_alpha.h   m_alpha.h 
/* $Id: m_alpha.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: m_alpha.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 m_armv4.h   m_armv4.h 
/* $Id: m_armv4.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: m_armv4.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 m_i386.h   m_i386.h 
/* $Id: m_i386.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: m_i386.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 m_m68k.h   m_m68k.h 
/* $Id: m_m68k.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: m_m68k.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 m_powerpc.h   m_powerpc.h 
/* $Id: m_powerpc.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: m_powerpc.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 m_sparc.h   m_sparc.h 
/* $Id: m_sparc.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: m_sparc.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 m_x86_64.h   m_x86_64.h 
/* $Id: m_x86_64.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: m_x86_64.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 malloc.h   malloc.h 
/* $Id: malloc.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: malloc.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 master_port.h   master_port.h 
/* $Id: master_port.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: master_port.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 31 skipping to change at line 31
/** /**
* @file master_port.h * @file master_port.h
* @brief Master port. * @brief Master port.
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
/** /**
* @defgroup PJMEDIA_MASTER_PORT Master Port * @defgroup PJMEDIA_MASTER_PORT Master Port
* @ingroup PJMEDIA_PORT_CLOCK * @ingroup PJMEDIA_PORT_CLOCK
* @brief Provides media clock for media ports. * @brief Thread based media clock provider
* @{ * @{
*
* A master port has two media ports connected to it, and by convention * A master port has two media ports connected to it, and by convention
* thay are called downstream and upstream ports. The media stream flowing to * thay are called downstream and upstream ports. The media stream flowing to
* the downstream port is called encoding or send direction, and media stre am * the downstream port is called encoding or send direction, and media stre am
* flowing to the upstream port is called decoding or receive direction * flowing to the upstream port is called decoding or receive direction
* (imagine the downstream as stream to remote endpoint, and upstream as * (imagine the downstream as stream to remote endpoint, and upstream as
* local media port; media flowing to remote endpoint (downstream) will nee d * local media port; media flowing to remote endpoint (downstream) will nee d
* to be encoded before it is transmitted to remote endpoint). * to be encoded before it is transmitted to remote endpoint).
* *
* A master port internally has an instance of @ref PJMEDIA_CLOCK, which * A master port internally has an instance of @ref PJMEDIA_CLOCK, which
* provides the essensial timing for the master port. The @ref PJMEDIA_CLOC K * provides the essensial timing for the master port. The @ref PJMEDIA_CLOC K
skipping to change at line 70 skipping to change at line 71
* Opaque declaration for master port. * Opaque declaration for master port.
*/ */
typedef struct pjmedia_master_port pjmedia_master_port; typedef struct pjmedia_master_port pjmedia_master_port;
/** /**
* Create a master port. * Create a master port.
* *
* @param pool Pool to allocate master port from. * @param pool Pool to allocate master port from.
* @param u_port Upstream port. * @param u_port Upstream port.
* @param d_port Downstream port. * @param d_port Downstream port.
* @param options Options flags, must be zero for now. * @param options Options flags, from bitmask combinations from
* pjmedia_clock_options.
* @param p_m Pointer to receive the master port instance. * @param p_m Pointer to receive the master port instance.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_master_port_create(pj_pool_t *pool, PJ_DECL(pj_status_t) pjmedia_master_port_create(pj_pool_t *pool,
pjmedia_port *u_port, pjmedia_port *u_port,
pjmedia_port *d_port, pjmedia_port *d_port,
unsigned options, unsigned options,
pjmedia_master_port **p_m); pjmedia_master_port **p_m);
 End of changes. 5 change blocks. 
4 lines changed or deleted 6 lines changed or added


 md5.h   md5.h 
/* $Id: md5.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: md5.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 40 skipping to change at line 40
/** /**
* @defgroup PJLIB_UTIL_MD5 MD5 * @defgroup PJLIB_UTIL_MD5 MD5
* @ingroup PJLIB_UTIL_ENCRYPTION * @ingroup PJLIB_UTIL_ENCRYPTION
* @{ * @{
*/ */
/** MD5 context. */ /** MD5 context. */
typedef struct pj_md5_context typedef struct pj_md5_context
{ {
pj_uint32_t buf[4]; pj_uint32_t buf[4]; /**< buf */
pj_uint32_t bits[2]; pj_uint32_t bits[2]; /**< bits */
pj_uint8_t in[64]; pj_uint8_t in[64]; /**< in */
} pj_md5_context; } pj_md5_context;
/** Initialize the algorithm. /** Initialize the algorithm.
* @param pms MD5 context. * @param pms MD5 context.
*/ */
PJ_DECL(void) pj_md5_init(pj_md5_context *pms); PJ_DECL(void) pj_md5_init(pj_md5_context *pms);
/** Append a string to the message. /** Append a string to the message.
* @param pms MD5 context. * @param pms MD5 context.
* @param data Data. * @param data Data.
 End of changes. 3 change blocks. 
5 lines changed or deleted 5 lines changed or added


 mem_port.h   mem_port.h 
/* $Id: mem_port.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: mem_port.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 33 skipping to change at line 33
* @file mem_port.h * @file mem_port.h
* @brief Memory based media playback/capture port * @brief Memory based media playback/capture port
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJMEDIA_MEM_PLAYER Memory/Buffer-based Playback Port * @defgroup PJMEDIA_MEM_PLAYER Memory/Buffer-based Playback Port
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief Media playback from a fixed buffer * @brief Media playback from a fixed size memory buffer
* @{ * @{
*
* A memory/buffer based playback port is used to play media from a fixed * A memory/buffer based playback port is used to play media from a fixed
* size buffer. This is useful over @ref PJMEDIA_FILE_PLAY for * size buffer. This is useful over @ref PJMEDIA_FILE_PLAY for
* situation where filesystems are not available in the target system. * situation where filesystems are not available in the target system.
*/ */
/** /**
* Memory player options.
*/
enum pjmedia_mem_player_option
{
/**
* Tell the memory player to return NULL frame when the whole
* buffer has been played instead of rewinding the buffer back
* to start position.
*/
PJMEDIA_MEM_NO_LOOP = 1
};
/**
* Create the buffer based playback to play the media from the specified * Create the buffer based playback to play the media from the specified
* buffer. * buffer.
* *
* @param pool Pool to allocate memory for the port structure. * @param pool Pool to allocate memory for the port structure.
* @param buffer The buffer to play the media from, which should * @param buffer The buffer to play the media from, which should
* be available throughout the life time of the por t. * be available throughout the life time of the por t.
* The player plays the media directly from this * The player plays the media directly from this
* buffer (i.e. no copying is done). * buffer (i.e. no copying is done).
* @param size The size of the buffer, in bytes. * @param size The size of the buffer, in bytes.
* @param clock_rate Sampling rate. * @param clock_rate Sampling rate.
* @param channel_count Number of channels. * @param channel_count Number of channels.
* @param samples_per_frame Number of samples per frame. * @param samples_per_frame Number of samples per frame.
* @param bits_per_sample Number of bits per sample. * @param bits_per_sample Number of bits per sample.
* @param options Option flags. * @param options Option flags, see #pjmedia_mem_player_option
* @param p_port Pointer to receive the port instance. * @param p_port Pointer to receive the port instance.
* *
* @return PJ_SUCCESS on success, or the appropriate * @return PJ_SUCCESS on success, or the appropriate
* error code. * error code.
*/ */
PJ_DECL(pj_status_t) pjmedia_mem_player_create(pj_pool_t *pool, PJ_DECL(pj_status_t) pjmedia_mem_player_create(pj_pool_t *pool,
const void *buffer, const void *buffer,
pj_size_t size, pj_size_t size,
unsigned clock_rate, unsigned clock_rate,
unsigned channel_count, unsigned channel_count,
skipping to change at line 98 skipping to change at line 112
pj_status_t (*cb)(pjmedia_port *port, pj_status_t (*cb)(pjmedia_port *port,
void *usr_data)); void *usr_data));
/** /**
* @} * @}
*/ */
/** /**
* @defgroup PJMEDIA_MEM_CAPTURE Memory/Buffer-based Capture Port * @defgroup PJMEDIA_MEM_CAPTURE Memory/Buffer-based Capture Port
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief Capture to fixed size buffer * @brief Media capture to fixed size memory buffer
* @{ * @{
*
* A memory based capture is used to save media streams to a fixed size * A memory based capture is used to save media streams to a fixed size
* buffer. This is useful over @ref PJMEDIA_FILE_REC for * buffer. This is useful over @ref PJMEDIA_FILE_REC for
* situation where filesystems are not available in the target system. * situation where filesystems are not available in the target system.
*/ */
/** /**
* Create media port to capture/record media into a fixed size buffer. * Create media port to capture/record media into a fixed size buffer.
* *
* @param pool Pool to allocate memory for the port structure. * @param pool Pool to allocate memory for the port structure.
* @param buffer The buffer to record the media to, which should * @param buffer The buffer to record the media to, which should
 End of changes. 8 change blocks. 
5 lines changed or deleted 20 lines changed or added


 nat_detect.h   nat_detect.h 
/* $Id: nat_detect.h 1501 2007-10-16 01:34:14Z bennylp $ */ /* $Id: nat_detect.h 1988 2008-06-06 14:47:10Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
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/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_ICE
* @{ * @{
* *
* 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. 
2 lines changed or deleted 1 lines changed or added


 null_port.h   null_port.h 
/* $Id: null_port.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: null_port.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 31 skipping to change at line 31
/** /**
* @file null_port.h * @file null_port.h
* @brief Null media port. * @brief Null media port.
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
/** /**
* @defgroup PJMEDIA_NULL_PORT Null Port * @defgroup PJMEDIA_NULL_PORT Null Port
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief Null port is the simplest type of port. * @brief The simplest type of media port which does nothing.
* @{ * @{
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Create Null port. * Create Null port.
* *
* @param pool Pool to allocate memory. * @param pool Pool to allocate memory.
* @param sampling_rate Sampling rate of the port. * @param sampling_rate Sampling rate of the port.
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 os.h   os.h 
/* $Id: os.h 1525 2007-10-26 05:25:35Z bennylp $ */ /* $Id: os.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 32 skipping to change at line 32
/** /**
* @file os.h * @file os.h
* @brief OS dependent functions * @brief OS dependent functions
*/ */
#include <pj/types.h> #include <pj/types.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJ_OS Operating System Dependent Functionality. * @defgroup PJ_OS Operating System Dependent Functionality.
* @ingroup PJ
*/ */
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJ_THREAD Threads * @defgroup PJ_THREAD Threads
* @ingroup PJ_OS * @ingroup PJ_OS
* @{ * @{
* This module provides multithreading API. * This module provides multithreading API.
* *
* \section pj_thread_examples_sec Examples * \section pj_thread_examples_sec Examples
skipping to change at line 138 skipping to change at line 137
pj_thread_t **thread); pj_thread_t **thread);
/** /**
* Check if this thread has been registered to PJLIB. * Check if this thread has been registered to PJLIB.
* *
* @return Non-zero if it is registered. * @return Non-zero if it is registered.
*/ */
PJ_DECL(pj_bool_t) pj_thread_is_registered(void); PJ_DECL(pj_bool_t) pj_thread_is_registered(void);
/** /**
* Get thread priority value for the thread.
*
* @param thread Thread handle.
*
* @return Thread priority value, or -1 on error.
*/
PJ_DECL(int) pj_thread_get_prio(pj_thread_t *thread);
/**
* Set the thread priority. The priority value must be in the priority
* value range, which can be retrieved with #pj_thread_get_prio_min() and
* #pj_thread_get_prio_max() functions.
*
* @param thread Thread handle.
* @param prio New priority to be set to the thread.
*
* @return PJ_SUCCESS on success or the error code.
*/
PJ_DECL(pj_status_t) pj_thread_set_prio(pj_thread_t *thread, int prio);
/**
* Get the lowest priority value available for this thread.
*
* @param thread Thread handle.
* @return Minimum thread priority value, or -1 on error.
*/
PJ_DECL(int) pj_thread_get_prio_min(pj_thread_t *thread);
/**
* Get the highest priority value available for this thread.
*
* @param thread Thread handle.
* @return Minimum thread priority value, or -1 on error.
*/
PJ_DECL(int) pj_thread_get_prio_max(pj_thread_t *thread);
/**
* Return native handle from pj_thread_t for manipulation using native
* OS APIs.
*
* @param thread PJLIB thread descriptor.
*
* @return Native thread handle. For example, when the
* backend thread uses pthread, this function will
* return pointer to pthread_t, and on Windows,
* this function will return HANDLE.
*/
PJ_DECL(void*) pj_thread_get_os_handle(pj_thread_t *thread);
/**
* Get thread name. * Get thread name.
* *
* @param thread The thread handle. * @param thread The thread handle.
* *
* @return Thread name as null terminated string. * @return Thread name as null terminated string.
*/ */
PJ_DECL(const char*) pj_thread_get_name(pj_thread_t *thread); PJ_DECL(const char*) pj_thread_get_name(pj_thread_t *thread);
/** /**
* Resume a suspended thread. * Resume a suspended thread.
skipping to change at line 318 skipping to change at line 367
*/ */
void *rconnection; void *rconnection;
/** /**
* Optional RHostResolver instance to be used by PJLIB. If this value * Optional RHostResolver instance to be used by PJLIB. If this value
* is NULL, a new RHostResolver instance will be created when * is NULL, a new RHostResolver instance will be created when
* pj_init() is called. * pj_init() is called.
*/ */
void *rhostresolver; void *rhostresolver;
/**
* Optional RHostResolver for IPv6 instance to be used by PJLIB.
* If this value is NULL, a new RHostResolver instance will be created
* when pj_init() is called.
*/
void *rhostresolver6;
} pj_symbianos_params; } pj_symbianos_params;
/** /**
* Specify Symbian OS parameters to be used by PJLIB. This function MUST * Specify Symbian OS parameters to be used by PJLIB. This function MUST
* be called before #pj_init() is called. * be called before #pj_init() is called.
* *
* @param prm Symbian specific parameters. * @param prm Symbian specific parameters.
* *
* @return PJ_SUCCESS if the parameters can be applied * @return PJ_SUCCESS if the parameters can be applied
* successfully. * successfully.
 End of changes. 5 change blocks. 
3 lines changed or deleted 59 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 by configure. */
/* $Id: os_auto.h.in 920 2007-02-01 00:33:12Z bennylp $ */ /* $Id: os_auto.h.in 1787 2008-02-08 15:18:20Z bennylp $ */
/* /*
* Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2006 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 50 skipping to change at line 50
#if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT) #if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
# define _WIN32_WINNT PJ_WIN32_WINNT # define _WIN32_WINNT PJ_WIN32_WINNT
#endif #endif
/* Headers availability */ /* Headers availability */
#define PJ_HAS_ARPA_INET_H 1 #define PJ_HAS_ARPA_INET_H 1
#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 1 #define PJ_HAS_ERRNO_H 1
#define PJ_HAS_FCNTL_H 1
#define PJ_HAS_LINUX_SOCKET_H 1 #define PJ_HAS_LINUX_SOCKET_H 1
#define PJ_HAS_MALLOC_H 1 #define PJ_HAS_MALLOC_H 1
#define PJ_HAS_NETDB_H 1 #define PJ_HAS_NETDB_H 1
#define PJ_HAS_NETINET_IN_H 1 #define PJ_HAS_NETINET_IN_H 1
#define PJ_HAS_NETINET_IP_H 1 #define PJ_HAS_NETINET_IP_H 1
#define PJ_HAS_NET_IF_H 1
#define PJ_HAS_IFADDRS_H 1
#define PJ_HAS_SEMAPHORE_H 1
#define PJ_HAS_SETJMP_H 1 #define PJ_HAS_SETJMP_H 1
#define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDARG_H 1
#define PJ_HAS_STDDEF_H 1 #define PJ_HAS_STDDEF_H 1
#define PJ_HAS_STDIO_H 1 #define PJ_HAS_STDIO_H 1
#define PJ_HAS_STDINT_H 1
#define PJ_HAS_STDLIB_H 1 #define PJ_HAS_STDLIB_H 1
#define PJ_HAS_STRING_H 1 #define PJ_HAS_STRING_H 1
#define PJ_HAS_SYS_IOCTL_H 1 #define PJ_HAS_SYS_IOCTL_H 1
#define PJ_HAS_SYS_SELECT_H 1 #define PJ_HAS_SYS_SELECT_H 1
#define PJ_HAS_SYS_SOCKET_H 1 #define PJ_HAS_SYS_SOCKET_H 1
#define PJ_HAS_SYS_TIME_H 1 #define PJ_HAS_SYS_TIME_H 1
#define PJ_HAS_SYS_TIMEB_H 1 #define PJ_HAS_SYS_TIMEB_H 1
#define PJ_HAS_SYS_TYPES_H 1 #define PJ_HAS_SYS_TYPES_H 1
#define PJ_HAS_TIME_H 1 #define PJ_HAS_TIME_H 1
#define PJ_HAS_UNISTD_H 1 #define PJ_HAS_UNISTD_H 1
/* #undef PJ_HAS_MSWSOCK_H */ /* #undef PJ_HAS_MSWSOCK_H */
/* #undef PJ_HAS_WINSOCK_H */ /* #undef PJ_HAS_WINSOCK_H */
/* #undef PJ_HAS_WINSOCK2_H */ /* #undef PJ_HAS_WINSOCK2_H */
#define PJ_SOCK_HAS_INET_ATON 1 #define PJ_SOCK_HAS_INET_ATON 1
#define PJ_SOCK_HAS_INET_PTON 1
#define PJ_SOCK_HAS_INET_NTOP 1
#define PJ_SOCK_HAS_GETADDRINFO 1
/* On these OSes, semaphore feature depends on semaphore.h */
#if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
# define PJ_HAS_SEMAPHORE 1
#elif defined(PJ_WIN32) && PJ_WIN32!=0
# define PJ_HAS_SEMAPHORE 1
#else
# define PJ_HAS_SEMAPHORE 0
#endif
/* Do we have pthread_mutexattr_settype()? */
/* #undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE */
/* Does pthread_mutexattr_t has "recursive" member? */
/* #undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE */
/* Set 1 if native sockaddr_in has sin_len member. /* Set 1 if native sockaddr_in has sin_len member.
* Default: 0 * Default: 0
*/ */
/* #undef PJ_SOCKADDR_HAS_LEN */ /* #undef PJ_SOCKADDR_HAS_LEN */
/* Does the OS have socklen_t? */ /* Does the OS have socklen_t? */
#define PJ_HAS_SOCKLEN_T 1 #define PJ_HAS_SOCKLEN_T 1
#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0 #if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0
 End of changes. 5 change blocks. 
1 lines changed or deleted 24 lines changed or added


 os_auto.h.in   os_auto.h.in 
/* $Id: os_auto.h.in 920 2007-02-01 00:33:12Z bennylp $ */ /* $Id: os_auto.h.in 1787 2008-02-08 15:18:20Z bennylp $ */
/* /*
* Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2006 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 49 skipping to change at line 49
#if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT) #if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
# define _WIN32_WINNT PJ_WIN32_WINNT # define _WIN32_WINNT PJ_WIN32_WINNT
#endif #endif
/* Headers availability */ /* Headers availability */
#undef PJ_HAS_ARPA_INET_H #undef PJ_HAS_ARPA_INET_H
#undef PJ_HAS_ASSERT_H #undef PJ_HAS_ASSERT_H
#undef PJ_HAS_CTYPE_H #undef PJ_HAS_CTYPE_H
#undef PJ_HAS_ERRNO_H #undef PJ_HAS_ERRNO_H
#undef PJ_HAS_FCNTL_H
#undef PJ_HAS_LINUX_SOCKET_H #undef PJ_HAS_LINUX_SOCKET_H
#undef PJ_HAS_MALLOC_H #undef PJ_HAS_MALLOC_H
#undef PJ_HAS_NETDB_H #undef PJ_HAS_NETDB_H
#undef PJ_HAS_NETINET_IN_H #undef PJ_HAS_NETINET_IN_H
#undef PJ_HAS_NETINET_IP_H #undef PJ_HAS_NETINET_IP_H
#undef PJ_HAS_NET_IF_H
#undef PJ_HAS_IFADDRS_H
#undef PJ_HAS_SEMAPHORE_H
#undef PJ_HAS_SETJMP_H #undef PJ_HAS_SETJMP_H
#undef PJ_HAS_STDARG_H #undef PJ_HAS_STDARG_H
#undef PJ_HAS_STDDEF_H #undef PJ_HAS_STDDEF_H
#undef PJ_HAS_STDIO_H #undef PJ_HAS_STDIO_H
#undef PJ_HAS_STDINT_H
#undef PJ_HAS_STDLIB_H #undef PJ_HAS_STDLIB_H
#undef PJ_HAS_STRING_H #undef PJ_HAS_STRING_H
#undef PJ_HAS_SYS_IOCTL_H #undef PJ_HAS_SYS_IOCTL_H
#undef PJ_HAS_SYS_SELECT_H #undef PJ_HAS_SYS_SELECT_H
#undef PJ_HAS_SYS_SOCKET_H #undef PJ_HAS_SYS_SOCKET_H
#undef PJ_HAS_SYS_TIME_H #undef PJ_HAS_SYS_TIME_H
#undef PJ_HAS_SYS_TIMEB_H #undef PJ_HAS_SYS_TIMEB_H
#undef PJ_HAS_SYS_TYPES_H #undef PJ_HAS_SYS_TYPES_H
#undef PJ_HAS_TIME_H #undef PJ_HAS_TIME_H
#undef PJ_HAS_UNISTD_H #undef PJ_HAS_UNISTD_H
#undef PJ_HAS_MSWSOCK_H #undef PJ_HAS_MSWSOCK_H
#undef PJ_HAS_WINSOCK_H #undef PJ_HAS_WINSOCK_H
#undef PJ_HAS_WINSOCK2_H #undef PJ_HAS_WINSOCK2_H
#undef PJ_SOCK_HAS_INET_ATON #undef PJ_SOCK_HAS_INET_ATON
#undef PJ_SOCK_HAS_INET_PTON
#undef PJ_SOCK_HAS_INET_NTOP
#undef PJ_SOCK_HAS_GETADDRINFO
/* On these OSes, semaphore feature depends on semaphore.h */
#if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
# define PJ_HAS_SEMAPHORE 1
#elif defined(PJ_WIN32) && PJ_WIN32!=0
# define PJ_HAS_SEMAPHORE 1
#else
# define PJ_HAS_SEMAPHORE 0
#endif
/* Do we have pthread_mutexattr_settype()? */
#undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE
/* Does pthread_mutexattr_t has "recursive" member? */
#undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE
/* Set 1 if native sockaddr_in has sin_len member. /* Set 1 if native sockaddr_in has sin_len member.
* Default: 0 * Default: 0
*/ */
#undef PJ_SOCKADDR_HAS_LEN #undef PJ_SOCKADDR_HAS_LEN
/* Does the OS have socklen_t? */ /* Does the OS have socklen_t? */
#undef PJ_HAS_SOCKLEN_T #undef PJ_HAS_SOCKLEN_T
#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0 #if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0
 End of changes. 5 change blocks. 
1 lines changed or deleted 24 lines changed or added


 os_darwinos.h   os_darwinos.h 
/* $Id: os_darwinos.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: os_darwinos.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 os_linux.h   os_linux.h 
/* $Id: os_linux.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: os_linux.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 os_linux_kernel.h   os_linux_kernel.h 
/* $Id: os_linux_kernel.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: os_linux_kernel.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 os_palmos.h   os_palmos.h 
/* $Id: os_palmos.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: os_palmos.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 os_rtems.h   os_rtems.h 
/* $Id: os_rtems.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: os_rtems.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 os_sunos.h   os_sunos.h 
/* $Id: os_sunos.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: os_sunos.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 os_win32.h   os_win32.h 
/* $Id: os_win32.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: os_win32.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 46 skipping to change at line 46
#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
#define PJ_HAS_NETINET_IN_H 0 #define PJ_HAS_NETINET_IN_H 0
#define PJ_HAS_SETJMP_H 1 #define PJ_HAS_SETJMP_H 1
#define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDARG_H 1
#define PJ_HAS_STDDEF_H 1 #define PJ_HAS_STDDEF_H 1
#undef PJ_HAS_STDINT_H
#define PJ_HAS_STDIO_H 1 #define PJ_HAS_STDIO_H 1
#define PJ_HAS_STDLIB_H 1 #define PJ_HAS_STDLIB_H 1
#define PJ_HAS_STRING_H 1 #define PJ_HAS_STRING_H 1
#define PJ_HAS_SYS_IOCTL_H 0 #define PJ_HAS_SYS_IOCTL_H 0
#define PJ_HAS_SYS_SELECT_H 0 #define PJ_HAS_SYS_SELECT_H 0
#define PJ_HAS_SYS_SOCKET_H 0 #define PJ_HAS_SYS_SOCKET_H 0
#define PJ_HAS_SYS_TIME_H 0 #define PJ_HAS_SYS_TIME_H 0
#define PJ_HAS_SYS_TIMEB_H 1 #define PJ_HAS_SYS_TIMEB_H 1
#define PJ_HAS_SYS_TYPES_H 1 #define PJ_HAS_SYS_TYPES_H 1
#define PJ_HAS_TIME_H 1 #define PJ_HAS_TIME_H 1
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added


 os_win32_wince.h   os_win32_wince.h 
/* $Id: os_win32_wince.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: os_win32_wince.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 pa_asio.h   pa_asio.h 
#ifndef PA_ASIO_H #ifndef PA_ASIO_H
#define PA_ASIO_H #define PA_ASIO_H
/* /*
* $Id: pa_asio.h 1083 2006-08-23 07:30:49Z rossb $ * $Id: pa_asio.h 1337 2008-02-15 07:32:09Z rossb $
* PortAudio Portable Real-Time Audio Library * PortAudio Portable Real-Time Audio Library
* ASIO specific extensions * ASIO specific extensions
* *
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files * a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction, * (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, * including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software, * publish, distribute, sublicense, and/or sell copies of the Software,
skipping to change at line 42 skipping to change at line 42
* the PortAudio community also makes the following non-binding requests: * the PortAudio community also makes the following non-binding requests:
* *
* Any person wishing to distribute modifications to the Software is * Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that * requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also * they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the * requested that these non-binding requests be included along with the
* license above. * license above.
*/ */
/** @file /** @file
@ingroup public_header
@brief ASIO-specific PortAudio API extension header file. @brief ASIO-specific PortAudio API extension header file.
*/ */
#include "portaudio.h" #include "portaudio.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif /* __cplusplus */ #endif /* __cplusplus */
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 pa_linux_alsa.h   pa_linux_alsa.h 
#ifndef PA_LINUX_ALSA_H #ifndef PA_LINUX_ALSA_H
#define PA_LINUX_ALSA_H #define PA_LINUX_ALSA_H
/* /*
* $Id: pa_linux_alsa.h 1182 2007-03-16 19:48:30Z aknudsen $ * $Id: pa_linux_alsa.h 1337 2008-02-15 07:32:09Z rossb $
* PortAudio Portable Real-Time Audio Library * PortAudio Portable Real-Time Audio Library
* ALSA-specific extensions * ALSA-specific extensions
* *
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files * a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction, * (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, * including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software, * publish, distribute, sublicense, and/or sell copies of the Software,
skipping to change at line 43 skipping to change at line 43
* the PortAudio community also makes the following non-binding requests: * the PortAudio community also makes the following non-binding requests:
* *
* Any person wishing to distribute modifications to the Software is * Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that * requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also * they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the * requested that these non-binding requests be included along with the
* license above. * license above.
*/ */
/** @file /** @file
* ALSA-specific PortAudio API extension header file. * @ingroup public_header
* @brief ALSA-specific PortAudio API extension header file.
*/ */
#include "portaudio.h" #include "portaudio.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct PaAlsaStreamInfo typedef struct PaAlsaStreamInfo
{ {
unsigned long size; unsigned long size;
PaHostApiTypeId hostApiType; PaHostApiTypeId hostApiType;
unsigned long version; unsigned long version;
const char *deviceString; const char *deviceString;
} }
PaAlsaStreamInfo; PaAlsaStreamInfo;
/** Initialize host API specific structure, call this before setting releva nt attributes. */
void PaAlsa_InitializeStreamInfo( PaAlsaStreamInfo *info ); void PaAlsa_InitializeStreamInfo( PaAlsaStreamInfo *info );
/** Instruct whether to enable real-time priority when starting the audio t
hread.
*
* If this is turned on by the stream is started, the audio callback thread
will be created
* with the FIFO scheduling policy, which is suitable for realtime operatio
n.
**/
void PaAlsa_EnableRealtimeScheduling( PaStream *s, int enable ); void PaAlsa_EnableRealtimeScheduling( PaStream *s, int enable );
#if 0 #if 0
void PaAlsa_EnableWatchdog( PaStream *s, int enable ); void PaAlsa_EnableWatchdog( PaStream *s, int enable );
#endif #endif
int PaAlsa_GetStreamInputCard( PaStream *s, int *card ); /** Get the ALSA-lib card index of this stream's input device. */
PaError PaAlsa_GetStreamInputCard( PaStream *s, int *card );
/** Get the ALSA-lib card index of this stream's output device. */
PaError PaAlsa_GetStreamOutputCard( PaStream *s, int *card );
int PaAlsa_GetStreamOutputCard( PaStream *s, int *card ); /** Set the number of periods (buffer fragments) to configure devices with.
*
* By default the number of periods is 4, this is the lowest number of peri
ods that works well on
* the author's soundcard.
* @param numPeriods The number of periods.
*/
PaError PaAlsa_SetNumPeriods( int numPeriods );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 6 change blocks. 
4 lines changed or deleted 25 lines changed or added


 pa_mac_core.h   pa_mac_core.h 
skipping to change at line 41 skipping to change at line 41
* The text above constitutes the entire PortAudio license; however, * The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests: * the PortAudio community also makes the following non-binding requests:
* *
* Any person wishing to distribute modifications to the Software is * Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that * requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also * they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the * requested that these non-binding requests be included along with the
* license above. * license above.
*/ */
/** @file
* @ingroup public_header
* @brief CoreAudio-specific PortAudio API extension header file.
*/
#include <AudioUnit/AudioUnit.h> #include <AudioUnit/AudioUnit.h>
//#include <AudioToolbox/AudioToolbox.h> //#include <AudioToolbox/AudioToolbox.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* A pointer to a paMacCoreStreamInfo may be passed as * A pointer to a paMacCoreStreamInfo may be passed as
* the hostApiSpecificStreamInfo in the PaStreamParameters struct * the hostApiSpecificStreamInfo in the PaStreamParameters struct
* when opening a stream or querying the format. Use NULL, for the * when opening a stream or querying the format. Use NULL, for the
* defaults. Note that for duplex streams, both infos should be the * defaults. Note that for duplex streams, flags for input and output
* same or behaviour is undefined. * should be the same or behaviour is undefined.
*/ */
typedef struct typedef struct
{ {
unsigned long size; /**size of whole structure including this header */ unsigned long size; /**size of whole structure including this header */
PaHostApiTypeId hostApiType; /**host API for which this data is intend ed */ PaHostApiTypeId hostApiType; /**host API for which this data is intend ed */
unsigned long version; /**structure version */ unsigned long version; /**structure version */
unsigned long flags; /* flags to modify behaviour */ unsigned long flags; /* flags to modify behaviour */
long const * channelMap; /* Channel map for HAL channel map ping , if not needed, use NULL;*/ SInt32 const * channelMap; /* Channel map for HAL channel mapping , if not needed, use NULL;*/
unsigned long channelMapSize; /* Channel map size for HAL channel mappi ng , if not needed, use 0;*/ unsigned long channelMapSize; /* Channel map size for HAL channel mappi ng , if not needed, use 0;*/
} PaMacCoreStreamInfo; } PaMacCoreStreamInfo;
/* /*
* Functions * Functions
*/ */
/* Use this function to initialize a paMacCoreStreamInfo struct /* Use this function to initialize a paMacCoreStreamInfo struct
* using the requested flags. Note that channel mapping is turned * using the requested flags. Note that channel mapping is turned
* off after a call to this function. * off after a call to this function.
* @param data The datastructure to initialize * @param data The datastructure to initialize
* @param flags The flags to initialize the datastructure with. * @param flags The flags to initialize the datastructure with.
*/ */
void PaMacCore_SetupStreamInfo( PaMacCoreStreamInfo *data, unsigned long fl ags ); void PaMacCore_SetupStreamInfo( PaMacCoreStreamInfo *data, unsigned long fl ags );
/* call this after pa_SetupMacCoreStreamInfo to use channel mapping as desc ribed in notes.txt. /* call this after pa_SetupMacCoreStreamInfo to use channel mapping as desc ribed in notes.txt.
* @param data The stream info structure to assign a channel mapping to * @param data The stream info structure to assign a channel mapping to
* @param channelMap The channel map array, as described in notes.txt. This array pointer will be used directly (ie the underlying data will not be co pied), so the caller should not free the array until after the stream has b een opened. * @param channelMap The channel map array, as described in notes.txt. This array pointer will be used directly (ie the underlying data will not be co pied), so the caller should not free the array until after the stream has b een opened.
* @param channelMapSize The size of the channel map array. * @param channelMapSize The size of the channel map array.
*/ */
void PaMacCore_SetupChannelMap( PaMacCoreStreamInfo *data, const long * con st channelMap, unsigned long channelMapSize ); void PaMacCore_SetupChannelMap( PaMacCoreStreamInfo *data, const SInt32 * c onst channelMap, unsigned long channelMapSize );
/* /*
* Retrieve the AudioDeviceID of the input device assigned to an open strea m * Retrieve the AudioDeviceID of the input device assigned to an open strea m
* *
* @param s The stream to query. * @param s The stream to query.
* *
* @return A valid AudioDeviceID, or NULL if an error occurred. * @return A valid AudioDeviceID, or NULL if an error occurred.
*/ */
AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s ); AudioDeviceID PaMacCore_GetStreamInputDevice( PaStream* s );
 End of changes. 4 change blocks. 
4 lines changed or deleted 9 lines changed or added


 pa_win_wmme.h   pa_win_wmme.h 
#ifndef PA_WIN_WMME_H #ifndef PA_WIN_WMME_H
#define PA_WIN_WMME_H #define PA_WIN_WMME_H
/* /*
* $Id: pa_win_wmme.h 1115 2006-09-06 15:39:48Z rossb $ * $Id: pa_win_wmme.h 1337 2008-02-15 07:32:09Z rossb $
* PortAudio Portable Real-Time Audio Library * PortAudio Portable Real-Time Audio Library
* MME specific extensions * MME specific extensions
* *
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files * a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction, * (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, * including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software, * publish, distribute, sublicense, and/or sell copies of the Software,
skipping to change at line 42 skipping to change at line 42
* the PortAudio community also makes the following non-binding requests: * the PortAudio community also makes the following non-binding requests:
* *
* Any person wishing to distribute modifications to the Software is * Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that * requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also * they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the * requested that these non-binding requests be included along with the
* license above. * license above.
*/ */
/** @file /** @file
@ingroup public_header
@brief WMME-specific PortAudio API extension header file. @brief WMME-specific PortAudio API extension header file.
*/ */
#include "portaudio.h" #include "portaudio.h"
#include "pa_win_waveformat.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif /* __cplusplus */ #endif /* __cplusplus */
#define paWinMmeUseLowLevelLatencyParameters (0x01) #define paWinMmeUseLowLevelLatencyParameters (0x01)
#define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */ #define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */
#define paWinMmeUseChannelMask (0x04)
/* By default, the mme implementation drops the processing thread's priorit y /* By default, the mme implementation drops the processing thread's priorit y
to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100% to THREAD_PRIORITY_NORMAL and sleeps the thread if the CPU load exceeds 100%
This flag disables any priority throttling. The processing thread will always This flag disables any priority throttling. The processing thread will always
run at THREAD_PRIORITY_TIME_CRITICAL. run at THREAD_PRIORITY_TIME_CRITICAL.
*/ */
#define paWinMmeDontThrottleOverloadedProcessingThread (0x08) #define paWinMmeDontThrottleOverloadedProcessingThread (0x08)
typedef struct PaWinMmeDeviceAndChannelCount{ typedef struct PaWinMmeDeviceAndChannelCount{
PaDeviceIndex device; PaDeviceIndex device;
skipping to change at line 104 skipping to change at line 107
If devices are specified here, the corresponding device parameter If devices are specified here, the corresponding device parameter
to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpeci fication, to Pa_OpenStream() should be set to paUseHostApiSpecificDeviceSpeci fication,
otherwise an paInvalidDevice error will result. otherwise an paInvalidDevice error will result.
The total number of channels accross all specified devices The total number of channels accross all specified devices
must agree with the corresponding channelCount parameter to must agree with the corresponding channelCount parameter to
Pa_OpenStream() otherwise a paInvalidChannelCount error will result . Pa_OpenStream() otherwise a paInvalidChannelCount error will result .
*/ */
PaWinMmeDeviceAndChannelCount *devices; PaWinMmeDeviceAndChannelCount *devices;
unsigned long deviceCount; unsigned long deviceCount;
/*
support for WAVEFORMATEXTENSIBLE channel masks. If flags contains
paWinMmeUseChannelMask this allows you to specify which speakers
to address in a multichannel stream. Constants for channelMask
are specified in pa_win_waveformat.h
*/
PaWinWaveFormatChannelMask channelMask;
}PaWinMmeStreamInfo; }PaWinMmeStreamInfo;
/** Retrieve the number of wave in handles used by a PortAudio WinMME strea m. /** Retrieve the number of wave in handles used by a PortAudio WinMME strea m.
Returns zero if the stream is output only. Returns zero if the stream is output only.
@return A non-negative value indicating the number of wave in handles @return A non-negative value indicating the number of wave in handles
or, a PaErrorCode (which are always negative) if PortAudio is not initiali zed or, a PaErrorCode (which are always negative) if PortAudio is not initiali zed
or an error is encountered. or an error is encountered.
@see PaWinMME_GetStreamInputHandle @see PaWinMME_GetStreamInputHandle
 End of changes. 5 change blocks. 
1 lines changed or deleted 13 lines changed or added


 pidf.h   pidf.h 
/* $Id: pidf.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: pidf.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 pjlib-util.h   pjlib-util.h 
/* $Id: pjlib-util.h 1490 2007-10-10 13:12:37Z bennylp $ */ /* $Id: pjlib-util.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 47 skipping to change at line 47
#include <pjlib-util/hmac_md5.h> #include <pjlib-util/hmac_md5.h>
#include <pjlib-util/hmac_sha1.h> #include <pjlib-util/hmac_sha1.h>
#include <pjlib-util/md5.h> #include <pjlib-util/md5.h>
#include <pjlib-util/sha1.h> #include <pjlib-util/sha1.h>
/* DNS and resolver */ /* DNS and resolver */
#include <pjlib-util/dns.h> #include <pjlib-util/dns.h>
#include <pjlib-util/resolver.h> #include <pjlib-util/resolver.h>
#include <pjlib-util/srv_resolver.h> #include <pjlib-util/srv_resolver.h>
/* Simple DNS server */
#include <pjlib-util/dns_server.h>
/* Text scanner */ /* Text scanner */
#include <pjlib-util/scanner.h> #include <pjlib-util/scanner.h>
/* XML */ /* XML */
#include <pjlib-util/xml.h> #include <pjlib-util/xml.h>
/* Old STUN */ /* Old STUN */
#include <pjlib-util/stun_simple.h> #include <pjlib-util/stun_simple.h>
/* PCAP */
#include <pjlib-util/pcap.h>
#endif /* __PJLIB_UTIL_H__ */ #endif /* __PJLIB_UTIL_H__ */
 End of changes. 4 change blocks. 
2 lines changed or deleted 8 lines changed or added


 pjlib.h   pjlib.h 
/* $Id: pjlib.h 1104 2007-03-25 18:44:51Z bennylp $ */ /* $Id: pjlib.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 28 skipping to change at line 28
*/ */
#ifndef __PJLIB_H__ #ifndef __PJLIB_H__
#define __PJLIB_H__ #define __PJLIB_H__
/** /**
* @file pjlib.h * @file pjlib.h
* @brief Include all PJLIB header files. * @brief Include all PJLIB header files.
*/ */
#include <pj/activesock.h>
#include <pj/addr_resolv.h> #include <pj/addr_resolv.h>
#include <pj/array.h> #include <pj/array.h>
#include <pj/assert.h> #include <pj/assert.h>
#include <pj/ctype.h> #include <pj/ctype.h>
#include <pj/errno.h> #include <pj/errno.h>
#include <pj/except.h> #include <pj/except.h>
#include <pj/fifobuf.h> #include <pj/fifobuf.h>
#include <pj/file_access.h> #include <pj/file_access.h>
#include <pj/file_io.h> #include <pj/file_io.h>
#include <pj/guid.h> #include <pj/guid.h>
#include <pj/hash.h> #include <pj/hash.h>
#include <pj/ioqueue.h> #include <pj/ioqueue.h>
#include <pj/ip_helper.h> #include <pj/ip_helper.h>
#include <pj/list.h> #include <pj/list.h>
#include <pj/lock.h> #include <pj/lock.h>
#include <pj/log.h> #include <pj/log.h>
#include <pj/math.h>
#include <pj/os.h> #include <pj/os.h>
#include <pj/pool.h> #include <pj/pool.h>
#include <pj/pool_buf.h> #include <pj/pool_buf.h>
#include <pj/rand.h> #include <pj/rand.h>
#include <pj/rbtree.h> #include <pj/rbtree.h>
#include <pj/sock.h> #include <pj/sock.h>
#include <pj/sock_select.h> #include <pj/sock_select.h>
#include <pj/string.h> #include <pj/string.h>
#include <pj/timer.h> #include <pj/timer.h>
#include <pj/unicode.h> #include <pj/unicode.h>
 End of changes. 4 change blocks. 
2 lines changed or deleted 4 lines changed or added


 pjmedia-codec.h   pjmedia-codec.h 
/* $Id: pjmedia-codec.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: pjmedia-codec.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 31 skipping to change at line 31
/** /**
* @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>
#endif /* __PJMEDIA_CODEC_PJMEDIA_CODEC_H__ */ #endif /* __PJMEDIA_CODEC_PJMEDIA_CODEC_H__ */
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added


 pjmedia.h   pjmedia.h 
/* $Id: pjmedia.h 1177 2007-04-09 07:06:08Z bennylp $ */ /* $Id: pjmedia.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 54 skipping to change at line 54
#include <pjmedia/resample.h> #include <pjmedia/resample.h>
#include <pjmedia/rtcp.h> #include <pjmedia/rtcp.h>
#include <pjmedia/rtp.h> #include <pjmedia/rtp.h>
#include <pjmedia/sdp.h> #include <pjmedia/sdp.h>
#include <pjmedia/sdp_neg.h> #include <pjmedia/sdp_neg.h>
#include <pjmedia/session.h> #include <pjmedia/session.h>
#include <pjmedia/silencedet.h> #include <pjmedia/silencedet.h>
#include <pjmedia/sound.h> #include <pjmedia/sound.h>
#include <pjmedia/sound_port.h> #include <pjmedia/sound_port.h>
#include <pjmedia/splitcomb.h> #include <pjmedia/splitcomb.h>
#include <pjmedia/stereo.h>
#include <pjmedia/tonegen.h> #include <pjmedia/tonegen.h>
#include <pjmedia/transport.h> #include <pjmedia/transport.h>
#include <pjmedia/transport_ice.h> #include <pjmedia/transport_ice.h>
#include <pjmedia/transport_srtp.h>
#include <pjmedia/transport_udp.h> #include <pjmedia/transport_udp.h>
#include <pjmedia/wav_playlist.h> #include <pjmedia/wav_playlist.h>
#include <pjmedia/wav_port.h> #include <pjmedia/wav_port.h>
#include <pjmedia/wave.h> #include <pjmedia/wave.h>
#endif /* __PJMEDIA_H__ */ #endif /* __PJMEDIA_H__ */
 End of changes. 4 change blocks. 
2 lines changed or deleted 4 lines changed or added


 pjnath.h   pjnath.h 
/* $Id: pjnath.h 1495 2007-10-12 12:14:27Z bennylp $ */ /* $Id: pjnath.h 1988 2008-06-06 14:47:10Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 29 skipping to change at line 29
#include <pjnath/config.h> #include <pjnath/config.h>
#include <pjnath/errno.h> #include <pjnath/errno.h>
#include <pjnath/ice_session.h> #include <pjnath/ice_session.h>
#include <pjnath/ice_strans.h> #include <pjnath/ice_strans.h>
#include <pjnath/nat_detect.h> #include <pjnath/nat_detect.h>
#include <pjnath/stun_auth.h> #include <pjnath/stun_auth.h>
#include <pjnath/stun_config.h> #include <pjnath/stun_config.h>
#include <pjnath/stun_msg.h> #include <pjnath/stun_msg.h>
#include <pjnath/stun_session.h> #include <pjnath/stun_session.h>
#include <pjnath/stun_sock.h>
#include <pjnath/stun_transaction.h> #include <pjnath/stun_transaction.h>
#include <pjnath/turn_session.h>
#include <pjnath/turn_sock.h>
#include <pjnath/types.h> #include <pjnath/types.h>
 End of changes. 3 change blocks. 
1 lines changed or deleted 4 lines changed or added


 pjsip.h   pjsip.h 
/* $Id: pjsip.h 1488 2007-10-10 11:37:56Z bennylp $ */ /* $Id: pjsip.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 pjsip_auth.h   pjsip_auth.h 
/* $Id: pjsip_auth.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: pjsip_auth.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 pjsip_simple.h   pjsip_simple.h 
/* $Id: pjsip_simple.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: pjsip_simple.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
/** /**
* @defgroup PJSIP_SIMPLE Event and Presence Framework * @defgroup PJSIP_SIMPLE Event and Presence Framework
* @ingroup PJSIP
*/ */
/** /**
* @file pjsip_simple.h * @file pjsip_simple.h
* @brief SIP SIMPLE Extension * @brief SIP SIMPLE Extension
*/ */
/* /*
* Include this header file to get all functionalities for SIMPLE extension * Include this header file to get all functionalities for SIMPLE extension
* (SIP for Instant Messaging and Presence Leveraging Extension). * (SIP for Instant Messaging and Presence Leveraging Extension).
 End of changes. 3 change blocks. 
3 lines changed or deleted 2 lines changed or added


 pjsip_ua.h   pjsip_ua.h 
/* $Id: pjsip_ua.h 1463 2007-09-30 16:50:27Z bennylp $ */ /* $Id: pjsip_ua.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 pjsua.h   pjsua.h 
/* $Id: pjsua.h 1561 2007-11-08 09:24:30Z bennylp $ */ /* $Id: pjsua.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 55 skipping to change at line 55
/* Include all PJLIB-UTIL headers. */ /* Include all PJLIB-UTIL headers. */
#include <pjlib-util.h> #include <pjlib-util.h>
/* Include all PJLIB headers. */ /* Include all PJLIB headers. */
#include <pjlib.h> #include <pjlib.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJSUA_LIB PJSUA API - High Level Softphone API for C/C++ and P ython * @defgroup PJSUA_LIB PJSUA API - High Level Softphone API for C/C++ and P ython
* @ingroup PJSIP
* @brief Very high level API for constructing SIP UA applications. * @brief Very high level API for constructing SIP UA applications.
* @{ * @{
* *
* @section pjsua_api_intro A SIP User Agent API for C/C++ and Python * @section pjsua_api_intro A SIP User Agent API for C/C++ and Python
* *
* PJSUA API is very high level API, available for C/C++ and Python languag e, * PJSUA API is very high level API, available for C/C++ and Python languag e,
* for constructing SIP multimedia user agent * for constructing SIP multimedia user agent
* applications. It wraps together the signaling and media functionalities * applications. It wraps together the signaling and media functionalities
* into an easy to use call API, provides account management, buddy * into an easy to use call API, provides account management, buddy
* management, presence, instant messaging, along with multimedia * management, presence, instant messaging, along with multimedia
skipping to change at line 394 skipping to change at line 393
/** Conference port identification */ /** Conference port identification */
typedef int pjsua_conf_port_id; typedef int pjsua_conf_port_id;
/** /**
* Maximum proxies in account. * Maximum proxies in account.
*/ */
#ifndef PJSUA_ACC_MAX_PROXIES #ifndef PJSUA_ACC_MAX_PROXIES
# define PJSUA_ACC_MAX_PROXIES 8 # define PJSUA_ACC_MAX_PROXIES 8
#endif #endif
#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0)
/**
* Default value of SRTP mode usage. Valid values are PJMEDIA_SRTP_DISABLED
,
* PJMEDIA_SRTP_OPTIONAL, and PJMEDIA_SRTP_MANDATORY.
*/
#ifndef PJSUA_DEFAULT_USE_SRTP
#define PJSUA_DEFAULT_USE_SRTP PJMEDIA_SRTP_DISABLED
#endif
/**
* Default value of secure signaling requirement for SRTP.
* Valid values are:
* 0: SRTP does not require secure signaling
* 1: SRTP requires secure transport such as TLS
* 2: SRTP requires secure end-to-end transport (SIPS)
*/
#ifndef PJSUA_DEFAULT_SRTP_SECURE_SIGNALING
#define PJSUA_DEFAULT_SRTP_SECURE_SIGNALING 1
#endif
#endif
/** /**
* Logging configuration, which can be (optionally) specified when calling * Logging configuration, which can be (optionally) specified when calling
* #pjsua_init(). Application must call #pjsua_logging_config_default() to * #pjsua_init(). Application must call #pjsua_logging_config_default() to
* initialize this structure with the default values. * initialize this structure with the default values.
* *
* \par Sample Python Syntax: * \par Sample Python Syntax:
* \code * \code
# Python type: py_pjsua.Logging_Config # Python type: py_pjsua.Logging_Config
log_cfg = py_pjsua.logging_config_default() log_cfg = py_pjsua.logging_config_default()
skipping to change at line 449 skipping to change at line 471
* \par Sample Python Syntax: * \par Sample Python Syntax:
* \code * \code
# level: integer # level: integer
# data: string # data: string
# len: integer # len: integer
def cb(level, data, len): def cb(level, data, len):
print data, print data,
* \endcode * \endcode
*/ */
void (*cb)(int level, const char *data, pj_size_t len); void (*cb)(int level, const char *data, int len);
} pjsua_logging_config; } pjsua_logging_config;
/** /**
* Use this function to initialize logging config. * Use this function to initialize logging config.
* *
* @param cfg The logging config to be initialized. * @param cfg The logging config to be initialized.
* *
* \par Python Syntax: * \par Python Syntax:
* The Python function instantiates and initialize the logging config: * The Python function instantiates and initialize the logging config:
skipping to change at line 567 skipping to change at line 589
* \code * \code
# call_id: integer # call_id: integer
def on_call_media_state(call_id): def on_call_media_state(call_id):
return return
* \endcode * \endcode
*/ */
void (*on_call_media_state)(pjsua_call_id call_id); void (*on_call_media_state)(pjsua_call_id call_id);
/** /**
* Notify application when media session is created and before it is
* registered to the conference bridge. Application may return differen
t
* media port if it has added media processing port to the stream. This
* media port then will be added to the conference bridge instead.
*
* @param call_id Call identification.
* @param sess Media session for the call.
* @param stream_idx Stream index in the media session.
* @param p_port On input, it specifies the media port of the
* stream. Application may modify this pointer to
* point to different media port to be registered
* to the conference bridge.
*
* \par Python:
* Not applicable.
*/
void (*on_stream_created)(pjsua_call_id call_id,
pjmedia_session *sess,
unsigned stream_idx,
pjmedia_port **p_port);
/**
* Notify application when media session has been unregistered from the
* conference bridge and about to be destroyed.
*
* @param call_id Call identification.
* @param sess Media session for the call.
* @param stream_idx Stream index in the media session.
*
* \par Python:
* Not applicable.
*/
void (*on_stream_destroyed)(pjsua_call_id call_id,
pjmedia_session *sess,
unsigned stream_idx);
/**
* Notify application upon incoming DTMF digits. * Notify application upon incoming DTMF digits.
* *
* @param call_id The call index. * @param call_id The call index.
* @param digit DTMF ASCII digit. * @param digit DTMF ASCII digit.
* *
* \par Python Syntax: * \par Python Syntax:
* \code * \code
# call_id: integer # call_id: integer
# digit: digit string # digit: digit string
def on_dtmf_digit(call_id, digit): def on_dtmf_digit(call_id, digit):
return return
* \endcode * \endcode
*/ */
void (*on_dtmf_digit)(pjsua_call_id call_id, int digit); void (*on_dtmf_digit)(pjsua_call_id call_id, int digit);
/** /**
* Notify application on call being transfered (i.e. REFER is received) . * Notify application on call being transfered (i.e. REFER is received) .
* Application can decide to accept/reject transfer request * Application can decide to accept/reject transfer request
* by setting the code (default is 200). When this callback * by setting the code (default is 202). When this callback
* is not defined, the default behavior is to accept the * is not defined, the default behavior is to accept the
* transfer. * transfer.
* *
* @param call_id The call index. * @param call_id The call index.
* @param dst The destination where the call will be * @param dst The destination where the call will be
* transfered to. * transfered to.
* @param code Status code to be returned for the call transfer * @param code Status code to be returned for the call transfer
* request. On input, it contains status code 200. * request. On input, it contains status code 200.
* *
* \par Python Syntax: * \par Python Syntax:
skipping to change at line 950 skipping to change at line 1009
* Specify the URL of outbound proxies to visit for all outgoing reques ts. * Specify the URL of outbound proxies to visit for all outgoing reques ts.
* The outbound proxies will be used for all accounts, and it will * The outbound proxies will be used for all accounts, and it will
* be used to build the route set for outgoing requests. The final * be used to build the route set for outgoing requests. The final
* route set for outgoing requests will consists of the outbound proxie s * route set for outgoing requests will consists of the outbound proxie s
* and the proxy configured in the account. * and the proxy configured in the account.
*/ */
pj_str_t outbound_proxy[4]; pj_str_t outbound_proxy[4];
/** /**
* Specify domain name to be resolved with DNS SRV resolution to get th e * Specify domain name to be resolved with DNS SRV resolution to get th e
* address of the STUN servers. Alternatively application may specify * address of the STUN server. Alternatively application may specify
* \a stun_host and \a stun_relay_host instead. * \a stun_host instead.
* *
* If DNS SRV resolution failed for this domain, then DNS A resolution * If DNS SRV resolution failed for this domain, then DNS A resolution
* will be performed only if \a stun_host is specified. * will be performed only if \a stun_host is specified.
*/ */
pj_str_t stun_domain; pj_str_t stun_domain;
/** /**
* Specify STUN server to be used, in "HOST[:PORT]" format. If port is * Specify STUN server to be used, in "HOST[:PORT]" format. If port is
* not specified, default port 3478 will be used. * not specified, default port 3478 will be used.
*/ */
pj_str_t stun_host; pj_str_t stun_host;
/** /**
* Specify STUN relay server to be used.
*/
pj_str_t stun_relay_host;
/**
* Support for adding and parsing NAT type in the SDP to assist * Support for adding and parsing NAT type in the SDP to assist
* troubleshooting. The valid values are: * troubleshooting. The valid values are:
* - 0: no information will be added in SDP, and parsing is disabled. * - 0: no information will be added in SDP, and parsing is disabled.
* - 1: only the NAT type number is added. * - 1: only the NAT type number is added.
* - 2: add both NAT type number and name. * - 2: add both NAT type number and name.
* *
* Default: 1 * Default: 1
*/ */
int nat_type_in_sdp; int nat_type_in_sdp;
skipping to change at line 1015 skipping to change at line 1069
* the library. * the library.
*/ */
pjsua_callback cb; pjsua_callback cb;
/** /**
* Optional user agent string (default empty). If it's empty, no * Optional user agent string (default empty). If it's empty, no
* User-Agent header will be sent with outgoing requests. * User-Agent header will be sent with outgoing requests.
*/ */
pj_str_t user_agent; pj_str_t user_agent;
#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0)
/**
* Specify default value of secure media transport usage.
* Valid values are PJMEDIA_SRTP_DISABLED, PJMEDIA_SRTP_OPTIONAL, and
* PJMEDIA_SRTP_MANDATORY.
*
* Note that this setting can be further customized in account
* configuration (#pjsua_acc_config).
*
* Default: #PJSUA_DEFAULT_USE_SRTP
*/
pjmedia_srtp_use use_srtp;
/**
* Specify whether SRTP requires secure signaling to be used. This opti
on
* is only used when \a use_srtp option above is non-zero.
*
* Valid values are:
* 0: SRTP does not require secure signaling
* 1: SRTP requires secure transport such as TLS
* 2: SRTP requires secure end-to-end transport (SIPS)
*
* Note that this setting can be further customized in account
* configuration (#pjsua_acc_config).
*
* Default: #PJSUA_DEFAULT_SRTP_SECURE_SIGNALING
*/
int srtp_secure_signaling;
#endif
} pjsua_config; } pjsua_config;
/** /**
* Use this function to initialize pjsua config. * Use this function to initialize pjsua config.
* *
* @param cfg pjsua config to be initialized. * @param cfg pjsua config to be initialized.
* *
* \par Python Sample Syntax: * \par Python Sample Syntax:
* The corresponding Python function creates an instance of the config and * The corresponding Python function creates an instance of the config and
* initializes it to the default settings: * initializes it to the default settings:
* \code * \code
cfg = py_pjsua.config_default() cfg = py_pjsua.config_default()
* \endcode * \endcode
*/ */
PJ_DECL(void) pjsua_config_default(pjsua_config *cfg); PJ_DECL(void) pjsua_config_default(pjsua_config *cfg);
/* The implementation has been moved to sip_auth.h */ /** The implementation has been moved to sip_auth.h */
#define pjsip_cred_dup pjsip_cred_info_dup #define pjsip_cred_dup pjsip_cred_info_dup
/** /**
* Duplicate pjsua_config. * Duplicate pjsua_config.
* *
* @param pool The pool to get memory from. * @param pool The pool to get memory from.
* @param dst Destination config. * @param dst Destination config.
* @param src Source config. * @param src Source config.
*/ */
PJ_DECL(void) pjsua_config_dup(pj_pool_t *pool, PJ_DECL(void) pjsua_config_dup(pj_pool_t *pool,
skipping to change at line 1120 skipping to change at line 1204
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
* *
* \par Python: * \par Python:
* \code * \code
status = py_pjsua.create() status = py_pjsua.create()
* \endcode * \endcode
*/ */
PJ_DECL(pj_status_t) pjsua_create(void); PJ_DECL(pj_status_t) pjsua_create(void);
/* Forward declaration */ /** Forward declaration */
typedef struct pjsua_media_config pjsua_media_config; typedef struct pjsua_media_config pjsua_media_config;
/** /**
* Initialize pjsua with the specified settings. All the settings are * Initialize pjsua with the specified settings. All the settings are
* optional, and the default values will be used when the config is not * optional, and the default values will be used when the config is not
* specified. * specified.
* *
* Note that #pjsua_create() MUST be called before calling this function. * Note that #pjsua_create() MUST be called before calling this function.
* *
* @param ua_cfg User agent configuration. * @param ua_cfg User agent configuration.
skipping to change at line 1876 skipping to change at line 1960
* application may want to have explicit control over the transport to * application may want to have explicit control over the transport to
* use, so in that case it can set this field. * use, so in that case it can set this field.
* *
* Default: -1 (PJSUA_INVALID_ID) * Default: -1 (PJSUA_INVALID_ID)
* *
* @see pjsua_acc_set_transport() * @see pjsua_acc_set_transport()
*/ */
pjsua_transport_id transport_id; pjsua_transport_id transport_id;
/** /**
* This option is useful for keeping the UDP transport address up to * This option is used to update the UDP transport address and the Cont
* date with the NAT public mapped address. When this option is act
* enabled and STUN is configured, the library will keep track of * header of REGISTER request. When this option is enabled, the librar
* the public IP address from the response of REGISTER request. Once y
* it detects that the address has changed, it will unregister current * will keep track of the public IP address from the response of REGIST
* Contact, update the UDP transport address, and register a new ER
* Contact to the registrar. * request. Once it detects that the address has changed, it will
* unregister current Contact, update the Contact with transport addres
s
* learned from Via header, and register a new Contact to the registrar
.
* This will also update the public name of UDP transport if STUN is
* configured.
* *
* Default: 1 (yes) * Default: 1 (yes)
*/ */
pj_bool_t auto_update_nat; pj_bool_t allow_contact_rewrite;
/** /**
* Set the interval for periodic keep-alive transmission for this accou nt. * Set the interval for periodic keep-alive transmission for this accou nt.
* If this value is zero, keep-alive will be disabled for this account. * If this value is zero, keep-alive will be disabled for this account.
* The keep-alive transmission will be sent to the registrar's address, * The keep-alive transmission will be sent to the registrar's address,
* after successful registration. * after successful registration.
* *
* Even if this setting is enabled, keep-alive transmission is only don
e
* when STUN is enabled in the global #pjsua_config, and the transport
* used for registration is UDP. For TCP and TLS transports, keep-alive
* is done by the transport themselves.
*
* Default: 15 (seconds) * Default: 15 (seconds)
*/ */
unsigned ka_interval; unsigned ka_interval;
/** /**
* Specify the data to be transmitted as keep-alive packets. * Specify the data to be transmitted as keep-alive packets.
* *
* Default: CR-LF * Default: CR-LF
*/ */
pj_str_t ka_data; pj_str_t ka_data;
#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0)
/**
* Specify whether secure media transport should be used for this accou
nt.
* Valid values are PJMEDIA_SRTP_DISABLED, PJMEDIA_SRTP_OPTIONAL, and
* PJMEDIA_SRTP_MANDATORY.
*
* Default: #PJSUA_DEFAULT_USE_SRTP
*/
pjmedia_srtp_use use_srtp;
/**
* Specify whether SRTP requires secure signaling to be used. This opti
on
* is only used when \a use_srtp option above is non-zero.
*
* Valid values are:
* 0: SRTP does not require secure signaling
* 1: SRTP requires secure transport such as TLS
* 2: SRTP requires secure end-to-end transport (SIPS)
*
* Default: #PJSUA_DEFAULT_SRTP_SECURE_SIGNALING
*/
int srtp_secure_signaling;
#endif
} pjsua_acc_config; } pjsua_acc_config;
/** /**
* Call this function to initialize account config with default values. * Call this function to initialize account config with default values.
* *
* @param cfg The account config to be initialized. * @param cfg The account config to be initialized.
* *
* \par Python: * \par Python:
* In Python, this function both creates and initializes the account * In Python, this function both creates and initializes the account
* config: * config:
skipping to change at line 3204 skipping to change at line 3308
* The function returns None if buddy_id is not valid. * The function returns None if buddy_id is not valid.
*/ */
PJ_DECL(pj_status_t) pjsua_buddy_get_info(pjsua_buddy_id buddy_id, PJ_DECL(pj_status_t) pjsua_buddy_get_info(pjsua_buddy_id buddy_id,
pjsua_buddy_info *info); pjsua_buddy_info *info);
/** /**
* Add new buddy to the buddy list. If presence subscription is enabled * Add new buddy to the buddy list. If presence subscription is enabled
* for this buddy, this function will also start the presence subscription * for this buddy, this function will also start the presence subscription
* session immediately. * session immediately.
* *
* @param buddy)cfg Buddy configuration. * @param buddy_cfg Buddy configuration.
* @param p_buddy_id Pointer to receive buddy ID. * @param p_buddy_id Pointer to receive buddy ID.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
* *
* \par Python: * \par Python:
* The function returns (status, buddy_id) tuple: * The function returns (status, buddy_id) tuple:
* \code * \code
status, buddy_id = py_pjsua.buddy_add(buddy_cfg) status, buddy_id = py_pjsua.buddy_add(buddy_cfg)
* \endcode * \endcode
*/ */
skipping to change at line 3415 skipping to change at line 3519
* the difference between terminations. * the difference between terminations.
* - interconnections are removed automatically when media termination * - interconnections are removed automatically when media termination
* is removed from the bridge. * is removed from the bridge.
* - sound device may be changed even when there are active media * - sound device may be changed even when there are active media
* interconnections. * interconnections.
* - correctly report call's media quality (in #pjsua_call_dump()) from * - correctly report call's media quality (in #pjsua_call_dump()) from
* RTCP packet exchange. * RTCP packet exchange.
*/ */
/** /**
* Max ports in the conference bridge. * Max ports in the conference bridge. This setting is the default value
* for pjsua_media_config.max_media_ports.
*/ */
#ifndef PJSUA_MAX_CONF_PORTS #ifndef PJSUA_MAX_CONF_PORTS
# define PJSUA_MAX_CONF_PORTS 254 # define PJSUA_MAX_CONF_PORTS 254
#endif #endif
/** /**
* The default clock rate to be used by the conference bridge. * The default clock rate to be used by the conference bridge. This setting
* is the default value for pjsua_media_config.clock_rate.
*/ */
#ifndef PJSUA_DEFAULT_CLOCK_RATE #ifndef PJSUA_DEFAULT_CLOCK_RATE
# define PJSUA_DEFAULT_CLOCK_RATE 16000 # define PJSUA_DEFAULT_CLOCK_RATE 16000
#endif #endif
/** /**
* Default codec quality settings. * Default frame length in the conference bridge. This setting
* is the default value for pjsua_media_config.audio_frame_ptime.
*/
#ifndef PJSUA_DEFAULT_AUDIO_FRAME_PTIME
# define PJSUA_DEFAULT_AUDIO_FRAME_PTIME 20
#endif
/**
* Default codec quality settings. This setting is the default value
* for pjsua_media_config.quality.
*/ */
#ifndef PJSUA_DEFAULT_CODEC_QUALITY #ifndef PJSUA_DEFAULT_CODEC_QUALITY
# define PJSUA_DEFAULT_CODEC_QUALITY 5 # define PJSUA_DEFAULT_CODEC_QUALITY 8
#endif #endif
/** /**
* Default iLBC mode. * Default iLBC mode. This setting is the default value for
* pjsua_media_config.ilbc_mode.
*/ */
#ifndef PJSUA_DEFAULT_ILBC_MODE #ifndef PJSUA_DEFAULT_ILBC_MODE
# define PJSUA_DEFAULT_ILBC_MODE 20 # define PJSUA_DEFAULT_ILBC_MODE 30
#endif #endif
/** /**
* The default echo canceller tail length. * The default echo canceller tail length. This setting
* is the default value for pjsua_media_config.ec_tail_len.
*/ */
#ifndef PJSUA_DEFAULT_EC_TAIL_LEN #ifndef PJSUA_DEFAULT_EC_TAIL_LEN
# define PJSUA_DEFAULT_EC_TAIL_LEN 200 # define PJSUA_DEFAULT_EC_TAIL_LEN 200
#endif #endif
/** /**
* The maximum file player. * The maximum file player.
*/ */
#ifndef PJSUA_MAX_PLAYERS #ifndef PJSUA_MAX_PLAYERS
# define PJSUA_MAX_PLAYERS 32 # define PJSUA_MAX_PLAYERS 32
skipping to change at line 3486 skipping to change at line 3603
struct pjsua_media_config struct pjsua_media_config
{ {
/** /**
* Clock rate to be applied to the conference bridge. * Clock rate to be applied to the conference bridge.
* If value is zero, default clock rate will be used * If value is zero, default clock rate will be used
* (PJSUA_DEFAULT_CLOCK_RATE, which by default is 16KHz). * (PJSUA_DEFAULT_CLOCK_RATE, which by default is 16KHz).
*/ */
unsigned clock_rate; unsigned clock_rate;
/** /**
* Clock rate to be applied when opening the sound device.
* If value is zero, conference bridge clock rate will be used.
*/
unsigned snd_clock_rate;
/**
* Channel count be applied when opening the sound device and
* conference bridge.
*/
unsigned channel_count;
/**
* Specify audio frame ptime. The value here will affect the * Specify audio frame ptime. The value here will affect the
* samples per frame of both the sound device and the conference * samples per frame of both the sound device and the conference
* bridge. Specifying lower ptime will normally reduce the * bridge. Specifying lower ptime will normally reduce the
* latency. * latency.
* *
* Default: 10 (miliseconds) * Default value: PJSUA_DEFAULT_AUDIO_FRAME_PTIME
*/ */
unsigned audio_frame_ptime; unsigned audio_frame_ptime;
/** /**
* Specify maximum number of media ports to be created in the * Specify maximum number of media ports to be created in the
* conference bridge. Since all media terminate in the bridge * conference bridge. Since all media terminate in the bridge
* (calls, file player, file recorder, etc), the value must be * (calls, file player, file recorder, etc), the value must be
* large enough to support all of them. However, the larger * large enough to support all of them. However, the larger
* the value, the more computations are performed. * the value, the more computations are performed.
*
* Default value: PJSUA_MAX_CONF_PORTS
*/ */
unsigned max_media_ports; unsigned max_media_ports;
/** /**
* Specify whether the media manager should manage its own * Specify whether the media manager should manage its own
* ioqueue for the RTP/RTCP sockets. If yes, ioqueue will be created * ioqueue for the RTP/RTCP sockets. If yes, ioqueue will be created
* and at least one worker thread will be created too. If no, * and at least one worker thread will be created too. If no,
* the RTP/RTCP sockets will share the same ioqueue as SIP sockets, * the RTP/RTCP sockets will share the same ioqueue as SIP sockets,
* and no worker thread is needed. * and no worker thread is needed.
* *
skipping to change at line 3551 skipping to change at line 3682
/** /**
* Disable VAD? * Disable VAD?
* *
* Default: 0 (no (meaning VAD is enabled)) * Default: 0 (no (meaning VAD is enabled))
*/ */
pj_bool_t no_vad; pj_bool_t no_vad;
/** /**
* iLBC mode (20 or 30). * iLBC mode (20 or 30).
* *
* Default: 20 (PJSUA_DEFAULT_ILBC_MODE) * Default: 30 (PJSUA_DEFAULT_ILBC_MODE)
*/ */
unsigned ilbc_mode; unsigned ilbc_mode;
/** /**
* Percentage of RTP packet to drop in TX direction * Percentage of RTP packet to drop in TX direction
* (to simulate packet lost). * (to simulate packet lost).
* *
* Default: 0 * Default: 0
*/ */
unsigned tx_drop_pct; unsigned tx_drop_pct;
skipping to change at line 3620 skipping to change at line 3751
* Default: -1 (to use default stream settings, currently 360 msec) * Default: -1 (to use default stream settings, currently 360 msec)
*/ */
int jb_max; int jb_max;
/** /**
* Enable ICE * Enable ICE
*/ */
pj_bool_t enable_ice; pj_bool_t enable_ice;
/** /**
* Enable ICE media relay. * Disable ICE host candidates.
*/
pj_bool_t ice_no_host_cands;
/**
* Enable TURN relay candidate in ICE.
*/
pj_bool_t enable_turn;
/**
* Specify TURN domain name or host name, in in "DOMAIN:PORT" or
* "HOST:PORT" format.
*/ */
pj_bool_t enable_relay; pj_str_t turn_server;
/**
* Specify the connection type to be used to the TURN server. Valid
* values are PJ_TURN_TP_UDP or PJ_TURN_TP_TCP.
*
* Default: PJ_TURN_TP_UDP
*/
pj_turn_tp_type turn_conn_type;
/**
* Specify the credential to authenticate with the TURN server.
*/
pj_stun_auth_cred turn_auth_cred;
/**
* Specify idle time of sound device before it is automatically closed,
* in seconds.
*
* Default : -1 (Disable the auto-close feature of sound device)
*/
int snd_auto_close_time;
}; };
/** /**
* Use this function to initialize media config. * Use this function to initialize media config.
* *
* @param cfg The media config to be initialized. * @param cfg The media config to be initialized.
* *
* \par Python: * \par Python:
* \code * \code
media_cfg = py_pjsua.media_config_default() media_cfg = py_pjsua.media_config_default()
skipping to change at line 3923 skipping to change at line 4086
*/ */
/** /**
* Create a file player, and automatically add this player to * Create a file player, and automatically add this player to
* the conference bridge. * the conference bridge.
* *
* @param filename The filename to be played. Currently only * @param filename The filename to be played. Currently only
* WAV files are supported, and the WAV file MUST be * WAV files are supported, and the WAV file MUST be
* formatted as 16bit PCM mono/single channel (any * formatted as 16bit PCM mono/single channel (any
* clock rate is supported). * clock rate is supported).
* @param options Options (currently zero). * @param options Optional option flag. Application may specify
* PJMEDIA_FILE_NO_LOOP to prevent playback loop.
* @param p_id Pointer to receive player ID. * @param p_id Pointer to receive player ID.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
* *
* \par Python: * \par Python:
* The function returns (status, id) tuple: * The function returns (status, id) tuple:
* \code * \code
status, id = py_pjsua.player_create(filename, options) status, id = py_pjsua.player_create(filename, options)
* \endcode * \endcode
*/ */
skipping to change at line 3987 skipping to change at line 4151
* Get the media port for the player or playlist. * Get the media port for the player or playlist.
* *
* @param id The player ID. * @param id The player ID.
* @param p_port The media port associated with the player. * @param p_port The media port associated with the player.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
* *
* \par Python: * \par Python:
* Not applicable. * Not applicable.
*/ */
PJ_DECL(pj_status_t) pjsua_player_get_port(pjsua_recorder_id id, PJ_DECL(pj_status_t) pjsua_player_get_port(pjsua_player_id id,
pjmedia_port **p_port); pjmedia_port **p_port);
/** /**
* Set playback position. This operation is not valid for playlist. * Set playback position. This operation is not valid for playlist.
* *
* @param id The file player ID. * @param id The file player ID.
* @param samples The playback position, in samples. Application can * @param samples The playback position, in samples. Application can
* specify zero to re-start the playback. * specify zero to re-start the playback.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
skipping to change at line 4198 skipping to change at line 4362
* \par Python: * \par Python:
* Not applicable (for now). * Not applicable (for now).
*/ */
PJ_DECL(pjmedia_port*) pjsua_set_no_snd_dev(void); PJ_DECL(pjmedia_port*) pjsua_set_no_snd_dev(void);
/** /**
* Configure the echo canceller tail length of the sound port. * Configure the echo canceller tail length of the sound port.
* *
* @param tail_ms The tail length, in miliseconds. Set to zero to * @param tail_ms The tail length, in miliseconds. Set to zero to
* disable AEC. * disable AEC.
* @param options Options to be passed to #pjmedia_echo_create(). * @param options Options to be passed to pjmedia_echo_create().
* Normally the value should be zero. * Normally the value should be zero.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
* *
* \par Python: * \par Python:
* \code * \code
status = py_pjsua.set_ec(tail_ms, options) status = py_pjsua.set_ec(tail_ms, options)
* \endcode * \endcode
*/ */
PJ_DECL(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options); PJ_DECL(pj_status_t) pjsua_set_ec(unsigned tail_ms, unsigned options);
 End of changes. 33 change blocks. 
43 lines changed or deleted 216 lines changed or added


 pjsua_internal.h   pjsua_internal.h 
/* $Id: pjsua_internal.h 1536 2007-10-31 13:28:08Z bennylp $ */ /* $Id: pjsua_internal.h 2079 2008-06-27 21:19:44Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 30 skipping to change at line 30
#define __PJSUA_INTERNAL_H__ #define __PJSUA_INTERNAL_H__
/** /**
* This is the private header used by pjsua library implementation. * This is the private header used by pjsua library implementation.
* Applications should not include this file. * Applications should not include this file.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Media transport state.
*/
typedef enum pjsua_med_tp_st
{
/** Not initialized */
PJSUA_MED_TP_IDLE,
/** Initialized (media_create() has been called) */
PJSUA_MED_TP_INIT,
/** Running (media_start() has been called) */
PJSUA_MED_TP_RUNNING
} pjsua_med_tp_st;
/**
* Structure to be attached to invite dialog. * Structure to be attached to invite dialog.
* Given a dialog "dlg", application can retrieve this structure * Given a dialog "dlg", application can retrieve this structure
* by accessing dlg->mod_data[pjsua.mod.id]. * by accessing dlg->mod_data[pjsua.mod.id].
*/ */
typedef struct pjsua_call typedef struct pjsua_call
{ {
unsigned index; /**< Index in pjsua array. */ unsigned index; /**< Index in pjsua array. */
pjsip_inv_session *inv; /**< The invite session. */ pjsip_inv_session *inv; /**< The invite session. */
void *user_data; /**< User/application data. */ void *user_data; /**< User/application data. */
pjsip_status_code last_code; /**< Last status code seen. */ pjsip_status_code last_code; /**< Last status code seen. */
pj_str_t last_text; /**< Last status text seen. */ pj_str_t last_text; /**< Last status text seen. */
pj_time_val start_time;/**< First INVITE sent/received. */ pj_time_val start_time;/**< First INVITE sent/received. */
pj_time_val res_time; /**< First response sent/receive d. */ pj_time_val res_time; /**< First response sent/receive d. */
pj_time_val conn_time; /**< Connected/confirmed time. */ pj_time_val conn_time; /**< Connected/confirmed time. */
pj_time_val dis_time; /**< Disconnect time. */ pj_time_val dis_time; /**< Disconnect time. */
pjsua_acc_id acc_id; /**< Account index being used. */ pjsua_acc_id acc_id; /**< Account index being used. */
int secure_level;/**< Signaling security level. */
pjsua_call_media_status media_st;/**< Media state. */ pjsua_call_media_status media_st;/**< Media state. */
pjmedia_dir media_dir; /**< Media direction. */ pjmedia_dir media_dir; /**< Media direction. */
pjmedia_session *session; /**< The media session. */ pjmedia_session *session; /**< The media session. */
int audio_idx; /**< Index of m=audio in SDP.
*/
pj_uint32_t ssrc; /**< RTP SSRC
*/
int conf_slot; /**< Slot # in conference bridge . */ int conf_slot; /**< Slot # in conference bridge . */
pjsip_evsub *xfer_sub; /**< Xfer server subscription, i f this pjsip_evsub *xfer_sub; /**< Xfer server subscription, i f this
call was triggered by xfer. */ call was triggered by xfer. */
pjmedia_transport *med_tp; /**< Media transport. pjmedia_transport *med_tp; /**< Current media transport.
*/ */
pj_status_t med_tp_ready;/**< Media transport status.
*/
pjmedia_transport *med_orig; /**< Original media transport
*/
pjsua_med_tp_st med_tp_st; /**< Media transport state
*/
pj_timer_entry refresh_tm;/**< Timer to send re-INVITE. */ pj_timer_entry refresh_tm;/**< Timer to send re-INVITE. */
pj_timer_entry hangup_tm; /**< Timer to hangup call. */ pj_timer_entry hangup_tm; /**< Timer to hangup call. */
pj_stun_nat_type rem_nat_type; /**< NAT type of remote endpoint. */ pj_stun_nat_type rem_nat_type; /**< NAT type of remote endpoint. */
pjmedia_srtp_use rem_srtp_use; /**< Remote's SRTP usage policy. */
char last_text_buf_[128]; /**< Buffer for last_text. */ char last_text_buf_[128]; /**< Buffer for last_text. */
} pjsua_call; } pjsua_call;
/** /**
* Server presence subscription list head. * Server presence subscription list head.
*/ */
typedef struct pjsua_srv_pres typedef struct pjsua_srv_pres
{ {
skipping to change at line 82 skipping to change at line 105
* Account * Account
*/ */
typedef struct pjsua_acc typedef struct pjsua_acc
{ {
pjsua_acc_config cfg; /**< Account configuration. */ pjsua_acc_config cfg; /**< Account configuration. */
pj_bool_t valid; /**< Is this account valid? */ pj_bool_t valid; /**< Is this account valid? */
int index; /**< Index in accounts array. */ int index; /**< Index in accounts array. */
pj_str_t display; /**< Display name, if any. */ pj_str_t display; /**< Display name, if any. */
pj_str_t user_part; /**< User part of local URI. */ pj_str_t user_part; /**< User part of local URI. */
pj_str_t contact; /**< Our Contact URI for REGISTER */
pj_str_t srv_domain; /**< Host part of reg server. */ pj_str_t srv_domain; /**< Host part of reg server. */
int srv_port; /**< Port number of reg server. */ int srv_port; /**< Port number of reg server. */
pjsip_regc *regc; /**< Client registration session. */ pjsip_regc *regc; /**< Client registration session. */
pj_status_t reg_last_err; /**< Last registration error. */ pj_status_t reg_last_err; /**< Last registration error. */
int reg_last_code; /**< Last status last register. */ int reg_last_code; /**< Last status last register. */
pj_timer_entry ka_timer; /**< Keep-alive timer for UDP. */ pj_timer_entry ka_timer; /**< Keep-alive timer for UDP. */
pjsip_transport *ka_transport; /**< Transport for keep-alive. */ pjsip_transport *ka_transport; /**< Transport for keep-alive. */
skipping to change at line 210 skipping to change at line 234
/* Account: */ /* Account: */
unsigned acc_cnt; /**< Number of accounts. */ unsigned acc_cnt; /**< Number of accounts. */
pjsua_acc_id default_acc; /**< Default account ID */ pjsua_acc_id default_acc; /**< Default account ID */
pjsua_acc acc[PJSUA_MAX_ACC]; /**< Account array. */ pjsua_acc acc[PJSUA_MAX_ACC]; /**< Account array. */
pjsua_acc_id acc_ids[PJSUA_MAX_ACC]; /**< Acc sorted by prio*/ pjsua_acc_id acc_ids[PJSUA_MAX_ACC]; /**< Acc sorted by prio*/
/* Calls: */ /* Calls: */
pjsua_config ua_cfg; /**< UA config. */ pjsua_config ua_cfg; /**< UA config. */
unsigned call_cnt; /**< Call counter. */ unsigned call_cnt; /**< Call counter. */
pjsua_call calls[PJSUA_MAX_CALLS];/**< Calls array. */ pjsua_call calls[PJSUA_MAX_CALLS];/**< Calls array. */
pjsua_call_id next_call_id; /**< Next call id to use*/
/* Buddy; */ /* Buddy; */
unsigned buddy_cnt; /**< Buddy count. */ unsigned buddy_cnt; /**< Buddy count. */
pjsua_buddy buddy[PJSUA_MAX_BUDDIES]; /**< Buddy array . */ pjsua_buddy buddy[PJSUA_MAX_BUDDIES]; /**< Buddy array . */
/* Presence: */ /* Presence: */
pj_timer_entry pres_timer;/**< Presence refresh timer. */ pj_timer_entry pres_timer;/**< Presence refresh timer. */
/* Media: */ /* Media: */
pjsua_media_config media_cfg; /**< Media config. */ pjsua_media_config media_cfg; /**< Media config. */
pjmedia_endpt *med_endpt; /**< Media endpoint. */ pjmedia_endpt *med_endpt; /**< Media endpoint. */
pjsua_conf_setting mconf_cfg; /**< Additionan conf. bridge. param */ pjsua_conf_setting mconf_cfg; /**< Additionan conf. bridge. param */
pjmedia_conf *mconf; /**< Conference bridge. */ pjmedia_conf *mconf; /**< Conference bridge. */
int cap_dev; /**< Capture device ID. */ int cap_dev; /**< Capture device ID. */
int play_dev; /**< Playback device ID. */ int play_dev; /**< Playback device ID. */
pj_bool_t no_snd; /**< No sound (app will manage it) */ pj_bool_t no_snd; /**< No sound (app will manage it) */
pj_pool_t *snd_pool; /**< Sound's private pool. */
pjmedia_snd_port *snd_port; /**< Sound port. */ pjmedia_snd_port *snd_port; /**< Sound port. */
pj_timer_entry snd_idle_timer;/**< Sound device idle timer. */
pjmedia_master_port *null_snd; /**< Master port for null sound. */ pjmedia_master_port *null_snd; /**< Master port for null sound. */
pjmedia_port *null_port; /**< Null port. */ pjmedia_port *null_port; /**< Null port. */
/* File players: */ /* File players: */
unsigned player_cnt;/**< Number of file players. */ unsigned player_cnt;/**< Number of file players. */
pjsua_file_data player[PJSUA_MAX_PLAYERS];/**< Array of players.*/ pjsua_file_data player[PJSUA_MAX_PLAYERS];/**< Array of players.*/
/* File recorders: */ /* File recorders: */
unsigned rec_cnt; /**< Number of file recorders. */ unsigned rec_cnt; /**< Number of file recorders. */
pjsua_file_data recorder[PJSUA_MAX_RECORDERS];/**< Array of recs.*/ pjsua_file_data recorder[PJSUA_MAX_RECORDERS];/**< Array of recs.*/
skipping to change at line 300 skipping to change at line 327
/** /**
* Handle incoming invite request. * Handle incoming invite request.
*/ */
pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata); pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata);
/* /*
* Media channel. * Media channel.
*/ */
pj_status_t pjsua_media_channel_init(pjsua_call_id call_id, pj_status_t pjsua_media_channel_init(pjsua_call_id call_id,
pjsip_role_e role); pjsip_role_e role,
int security_level,
pj_pool_t *tmp_pool,
const pjmedia_sdp_session *rem_sdp,
int *sip_err_code);
pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id, pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id,
pj_pool_t *pool, pj_pool_t *pool,
pjmedia_sdp_session **p_sdp); const pjmedia_sdp_session *rem_sd
p,
pjmedia_sdp_session **p_sdp,
int *sip_err_code);
pj_status_t pjsua_media_channel_update(pjsua_call_id call_id, pj_status_t pjsua_media_channel_update(pjsua_call_id call_id,
const pjmedia_sdp_session *local_sdp, const pjmedia_sdp_session *local_sdp,
const pjmedia_sdp_session *remote_sdp ); const pjmedia_sdp_session *remote_sdp );
pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id); pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id);
/** /**
* Init presence. * Init presence.
*/ */
pj_status_t pjsua_pres_init(); pj_status_t pjsua_pres_init();
 End of changes. 13 change blocks. 
6 lines changed or deleted 45 lines changed or added


 plc.h   plc.h 
/* $Id: plc.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: plc.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 31 skipping to change at line 31
/** /**
* @file plc.h * @file plc.h
* @brief Packet Lost Concealment (PLC) API. * @brief Packet Lost Concealment (PLC) API.
*/ */
#include <pjmedia/types.h> #include <pjmedia/types.h>
/** /**
* @defgroup PJMED_PLC Packet Lost Concealment (PLC) * @defgroup PJMED_PLC Packet Lost Concealment (PLC)
* @ingroup PJMEDIA_FRAME_OP * @ingroup PJMEDIA_FRAME_OP
* @brief Packet lost compensation algorithm
* @{ * @{
*
* This section describes PJMEDIA's implementation of Packet Lost * This section describes PJMEDIA's implementation of Packet Lost
* Concealment algorithm. This algorithm is used to implement PLC for * Concealment algorithm. This algorithm is used to implement PLC for
* codecs that do not have built-in support for one (e.g. G.711 or GSM code * codecs that do not have built-in support for one (e.g. G.711 or GSM
cs). * codecs).
* *
* The PLC algorithm (either built-in or external) is embedded in * The PLC algorithm (either built-in or external) is embedded in
* PJMEDIA codec instance, and application can conceal lost frames * PJMEDIA codec instance, and application can conceal lost frames
* by calling <b><tt>recover()</tt></b> member of the codec's member * by calling <b><tt>recover()</tt></b> member of the codec's member
* operation (#pjmedia_codec_op). * operation (#pjmedia_codec_op).
* *
* See also @ref plc_codec for more info. * See also @ref plc_codec for more info.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
 End of changes. 5 change blocks. 
4 lines changed or deleted 6 lines changed or added


 pool.h   pool.h 
/* $Id: pool.h 1417 2007-08-16 10:11:44Z bennylp $ */ /* $Id: pool.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 41 skipping to change at line 41
/** /**
* @file pool.h * @file pool.h
* @brief Memory Pool. * @brief Memory Pool.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJ_POOL_GROUP Fast Memory Pool * @defgroup PJ_POOL_GROUP Fast Memory Pool
* @ingroup PJ
* @brief * @brief
* Memory pools allow dynamic memory allocation comparable to malloc or the * Memory pools allow dynamic memory allocation comparable to malloc or the
* new in operator C++. Those implementations are not desirable for very * new in operator C++. Those implementations are not desirable for very
* high performance applications or real-time systems, because of the * high performance applications or real-time systems, because of the
* performance bottlenecks and it suffers from fragmentation issue. * performance bottlenecks and it suffers from fragmentation issue.
* *
* \section PJ_POOL_INTRO_SEC PJLIB's Memory Pool * \section PJ_POOL_INTRO_SEC PJLIB's Memory Pool
* \subsection PJ_POOL_ADVANTAGE_SUBSEC Advantages * \subsection PJ_POOL_ADVANTAGE_SUBSEC Advantages
* *
* PJLIB's pool has many advantages over traditional malloc/new operator an d * PJLIB's pool has many advantages over traditional malloc/new operator an d
skipping to change at line 606 skipping to change at line 605
pj_pool_callback *callback; pj_pool_callback *callback;
/** /**
* Option flags. * Option flags.
*/ */
unsigned flags; unsigned flags;
} pj_pool_factory_policy; } pj_pool_factory_policy;
/** /**
* \def PJ_NO_MEMORY_EXCEPTION
* This constant denotes the exception number that will be thrown by defaul t * This constant denotes the exception number that will be thrown by defaul t
* memory factory policy when memory allocation fails. * memory factory policy when memory allocation fails.
* *
* @see pj_NO_MEMORY_EXCEPTION() * @see pj_NO_MEMORY_EXCEPTION()
*/ */
PJ_DECL_DATA(int) PJ_NO_MEMORY_EXCEPTION; PJ_DECL_DATA(int) PJ_NO_MEMORY_EXCEPTION;
/** /**
* Get #PJ_NO_MEMORY_EXCEPTION constant. * Get #PJ_NO_MEMORY_EXCEPTION constant.
*/ */
 End of changes. 4 change blocks. 
3 lines changed or deleted 3 lines changed or added


 pool_alt.h   pool_alt.h 
/* $Id: pool_alt.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: pool_alt.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 pool_buf.h   pool_buf.h 
/* $Id: pool_buf.h 1242 2007-05-02 11:29:37Z bennylp $ */ /* $Id: pool_buf.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 pool_i.h   pool_i.h 
/* $Id: pool_i.h 1405 2007-07-20 08:08:30Z bennylp $ */ /* $Id: pool_i.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 port.h   port.h 
/* $Id: port.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: port.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 30 skipping to change at line 30
#define __PJMEDIA_PORT_H__ #define __PJMEDIA_PORT_H__
/** /**
* @file port.h * @file port.h
* @brief Port interface declaration * @brief Port interface declaration
*/ */
#include <pjmedia/types.h> #include <pjmedia/types.h>
#include <pj/os.h> #include <pj/os.h>
/** /**
@defgroup PJMEDIA_PORT_CONCEPT Media Ports Framework @addtogroup PJMEDIA_PORT Media Ports Framework
@ingroup PJMEDIA @{
@brief Extensible framework for media terminations
@section media_port_intro Media Port Concepts @section media_port_intro Media Port Concepts
@subsection The Media Port @subsection The Media Port
A media port (represented with pjmedia_port "class") provides a generic A media port (represented with pjmedia_port "class") provides a generic
and extensible framework for implementing media terminations. A media and extensible framework for implementing media terminations. A media
port interface basically has the following properties: port interface basically has the following properties:
- media port information (pjmedia_port_info) to describe the - media port information (pjmedia_port_info) to describe the
media port properties (sampling rate, number of channels, etc.), media port properties (sampling rate, number of channels, etc.),
- pointer to function to acquire frames from the port (<tt>get_frame() - pointer to function to acquire frames from the port (<tt>get_frame()
skipping to change at line 163 skipping to change at line 162
automate this process. automate this process.
And indeed PJMEDIA does provide such mechanism, which is described in And indeed PJMEDIA does provide such mechanism, which is described in
@ref PJMEDIA_PORT_CLOCK section. @ref PJMEDIA_PORT_CLOCK section.
@subsection media_port_autom Automating Media Flow @subsection media_port_autom Automating Media Flow
PJMEDIA provides few mechanisms to make media flows automatically PJMEDIA provides few mechanisms to make media flows automatically
among media ports. This concept is described in @ref PJMEDIA_PORT_CLOCK among media ports. This concept is described in @ref PJMEDIA_PORT_CLOCK
section. section.
*/
*/
/**
* @defgroup PJMEDIA_PORT_INTERFACE Media Port Interface
* @ingroup PJMEDIA_PORT_CONCEPT
* @brief Declares the media port interface.
*/
/**
* @defgroup PJMEDIA_PORT Ports
* @ingroup PJMEDIA_PORT_CONCEPT
* @brief Contains various types of media ports/terminations.
* @{
* This page lists all types of media ports currently implemented
* in PJMEDIA. The media port concept is explained in @ref PJMEDIA_PORT_CON
CEPT.
* @}
*/
/**
@defgroup PJMEDIA_PORT_CLOCK Clock/Timing
@ingroup PJMEDIA_PORT_CONCEPT
@brief Various types of classes that provide timing.
@{
The media clock/timing extends the media port concept that is explained
in @ref PJMEDIA_PORT_CONCEPT. When clock is present in the ports
interconnection, media will flow automatically (and with correct timing to
o!)
from one media port to another.
There are few objects in PJMEDIA that are able to provide clock/timing
to media ports interconnection:
- @ref PJMED_SND_PORT\n
The sound device makes a good candidate as the clock source, and
PJMEDIA @ref PJMED_SND is designed so that it is able to invoke
operations according to timing driven by the sound hardware clock
(this may sound complicated, but actually it just means that
the sound device abstraction provides callbacks to be called when
it has/wants media frames).\n
See @ref PJMED_SND_PORT for more details.
- @ref PJMEDIA_MASTER_PORT\n
The master port uses @ref PJMEDIA_CLOCK as the clock source. By using
@ref PJMEDIA_MASTER_PORT, it is possible to interconnect passive
media ports and let the frames flow automatically in timely manner.\n
Please see @ref PJMEDIA_MASTER_PORT for more details.
@}
*/
/**
* @addtogroup PJMEDIA_PORT_INTERFACE
* @{
* This page contains the media port interface declarations. The media port
* concept is explained in @ref PJMEDIA_PORT_CONCEPT.
*/
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Port operation setting. * Port operation setting.
*/ */
enum pjmedia_port_op typedef enum pjmedia_port_op
{ {
/** /**
* No change to the port TX or RX settings. * No change to the port TX or RX settings.
*/ */
PJMEDIA_PORT_NO_CHANGE, PJMEDIA_PORT_NO_CHANGE,
/** /**
* TX or RX is disabled from the port. It means get_frame() or * TX or RX is disabled from the port. It means get_frame() or
* put_frame() WILL NOT be called for this port. * put_frame() WILL NOT be called for this port.
*/ */
skipping to change at line 249 skipping to change at line 192
/** /**
* TX or RX is muted, which means that get_frame() or put_frame() * TX or RX is muted, which means that get_frame() or put_frame()
* will still be called, but the audio frame is discarded. * will still be called, but the audio frame is discarded.
*/ */
PJMEDIA_PORT_MUTE, PJMEDIA_PORT_MUTE,
/** /**
* Enable TX and RX to/from this port. * Enable TX and RX to/from this port.
*/ */
PJMEDIA_PORT_ENABLE PJMEDIA_PORT_ENABLE
};
/** } pjmedia_port_op;
* @see pjmedia_port_op
*/
typedef enum pjmedia_port_op pjmedia_port_op;
/** /**
* Port info. * Port info.
*/ */
typedef struct pjmedia_port_info typedef struct pjmedia_port_info
{ {
pj_str_t name; /**< Port name. */ pj_str_t name; /**< Port name. */
pj_uint32_t signature; /**< Port signature. */ pj_uint32_t signature; /**< Port signature. */
pjmedia_type type; /**< Media type. */ pjmedia_type type; /**< Media type. */
pj_bool_t has_info; /**< Has info? */ pj_bool_t has_info; /**< Has info? */
skipping to change at line 288 skipping to change at line 227
typedef enum pjmedia_frame_type typedef enum pjmedia_frame_type
{ {
PJMEDIA_FRAME_TYPE_NONE, /**< No frame. */ PJMEDIA_FRAME_TYPE_NONE, /**< No frame. */
PJMEDIA_FRAME_TYPE_AUDIO /**< Normal audio frame. */ PJMEDIA_FRAME_TYPE_AUDIO /**< Normal audio frame. */
} pjmedia_frame_type; } pjmedia_frame_type;
/** /**
* This structure describes a media frame. * This structure describes a media frame.
*/ */
struct pjmedia_frame typedef struct pjmedia_frame
{ {
pjmedia_frame_type type; /**< Frame type. */ pjmedia_frame_type type; /**< Frame type.
void *buf; /**< Pointer to buffer. */ */
pj_size_t size; /**< Frame size in bytes. */ void *buf; /**< Pointer to buffer.
pj_timestamp timestamp; /**< Frame timestamp. */ */
}; pj_size_t size; /**< Frame size in bytes.
*/
/** pj_timestamp timestamp; /**< Frame timestamp.
* @see pjmedia_frame */
*/ pj_uint32_t bit_info; /**< Bit info of the frame, samp
typedef struct pjmedia_frame pjmedia_frame; le case:
a frame may not exactly start and e
/** nd
* For future graph. at the octet boundary, so this fiel
*/ d
typedef struct pjmedia_graph pjmedia_graph; may be used for specifying start &
end bit offset.
/** */
* @see pjmedia_port } pjmedia_frame;
*/
typedef struct pjmedia_port pjmedia_port;
/** /**
* Port interface. * Port interface.
*/ */
struct pjmedia_port typedef struct pjmedia_port
{ {
pjmedia_port_info info; /**< Port information. */ pjmedia_port_info info; /**< Port information. */
/** Port data can be used by the port creator to attach arbitrary /** Port data can be used by the port creator to attach arbitrary
* value to be associated with the port. * value to be associated with the port.
*/ */
struct port_data { struct port_data {
void *pdata; /**< Pointer data. */ void *pdata; /**< Pointer data. */
long ldata; /**< Long data. */ long ldata; /**< Long data. */
} port_data; } port_data;
/** /**
* Sink interface. * Sink interface.
* This should only be called by #pjmedia_port_put_frame(). * This should only be called by #pjmedia_port_put_frame().
*/ */
pj_status_t (*put_frame)(pjmedia_port *this_port, pj_status_t (*put_frame)(struct pjmedia_port *this_port,
const pjmedia_frame *frame); const pjmedia_frame *frame);
/** /**
* Source interface. * Source interface.
* This should only be called by #pjmedia_port_get_frame(). * This should only be called by #pjmedia_port_get_frame().
*/ */
pj_status_t (*get_frame)(pjmedia_port *this_port, pj_status_t (*get_frame)(struct pjmedia_port *this_port,
pjmedia_frame *frame); pjmedia_frame *frame);
/** /**
* Called to destroy this port. * Called to destroy this port.
*/ */
pj_status_t (*on_destroy)(pjmedia_port *this_port); pj_status_t (*on_destroy)(struct pjmedia_port *this_port);
};
} pjmedia_port;
/** /**
* This is an auxiliary function to initialize port info for * This is an auxiliary function to initialize port info for
* ports which deal with PCM audio. * ports which deal with PCM audio.
* *
* @param info The port info to be initialized. * @param info The port info to be initialized.
* @param name Port name. * @param name Port name.
* @param signature Port signature. * @param signature Port signature.
* @param clock_rate Port's clock rate. * @param clock_rate Port's clock rate.
* @param channel_count Number of channels. * @param channel_count Number of channels.
 End of changes. 13 change blocks. 
96 lines changed or deleted 32 lines changed or added


 portaudio.h   portaudio.h 
#ifndef PORTAUDIO_H #ifndef PORTAUDIO_H
#define PORTAUDIO_H #define PORTAUDIO_H
/* /*
* $Id: portaudio.h 1195 2007-04-22 17:34:45Z aknudsen $ * $Id: portaudio.h 1337 2008-02-15 07:32:09Z rossb $
* PortAudio Portable Real-Time Audio Library * PortAudio Portable Real-Time Audio Library
* PortAudio API Header File * PortAudio API Header File
* Latest version available at: http://www.portaudio.com/ * Latest version available at: http://www.portaudio.com/
* *
* Copyright (c) 1999-2002 Ross Bencina and Phil Burk * Copyright (c) 1999-2002 Ross Bencina and Phil Burk
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files * a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction, * (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, * including without limitation the rights to use, copy, modify, merge,
skipping to change at line 44 skipping to change at line 43
* the PortAudio community also makes the following non-binding requests: * the PortAudio community also makes the following non-binding requests:
* *
* Any person wishing to distribute modifications to the Software is * Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that * requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also * they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the * requested that these non-binding requests be included along with the
* license above. * license above.
*/ */
/** @file /** @file
@brief The PortAudio API. @ingroup public_header
@brief The portable PortAudio API.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif /* __cplusplus */ #endif /* __cplusplus */
/** Retrieve the release number of the currently running PortAudio build, /** Retrieve the release number of the currently running PortAudio build,
eg 1900. eg 1900.
*/ */
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 presence.h   presence.h 
/* $Id: presence.h 1424 2007-08-25 13:36:15Z bennylp $ */ /* $Id: presence.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 print_util.h   print_util.h 
/* $Id: print_util.h 1500 2007-10-15 07:04:59Z bennylp $ */ /* $Id: print_util.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 publish.h   publish.h 
/* $Id: publish.h 1214 2007-04-28 04:13:11Z bennylp $ */ /* $Id: publish.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 rand.h   rand.h 
/* $Id: rand.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: rand.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 rbtree.h   rbtree.h 
/* $Id: rbtree.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: rbtree.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 resample.h   resample.h 
/* $Id: resample.h 1171 2007-04-07 16:01:41Z bennylp $ */ /* $Id: resample.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 32 skipping to change at line 32
/** /**
* @file resample.h * @file resample.h
* @brief Sample rate converter. * @brief Sample rate converter.
*/ */
#include <pjmedia/types.h> #include <pjmedia/types.h>
#include <pjmedia/port.h> #include <pjmedia/port.h>
/** /**
* @defgroup PJMEDIA_RESAMPLE Resampling Algorithm * @defgroup PJMEDIA_RESAMPLE Resampling Algorithm
* @ingroup PJMEDIA_FRAME_OP * @ingroup PJMEDIA_FRAME_OP
* @brief Functions to alter frame's clock rate. * @brief Sample rate conversion algorithm
* @{ * @{
*
* This section describes the base resampling functions. In addition to thi s, * This section describes the base resampling functions. In addition to thi s,
* application can use the @ref PJMEDIA_RESAMPLE_PORT which provides * application can use the @ref PJMEDIA_RESAMPLE_PORT which provides
* media port abstraction for the base resampling algorithm. * media port abstraction for the base resampling algorithm.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/* /*
* This file declares two types of API: * This file declares two types of API:
* *
skipping to change at line 119 skipping to change at line 120
*/ */
PJ_DECL(void) pjmedia_resample_destroy(pjmedia_resample *resample); PJ_DECL(void) pjmedia_resample_destroy(pjmedia_resample *resample);
/** /**
* @} * @}
*/ */
/** /**
* @defgroup PJMEDIA_RESAMPLE_PORT Resample Port * @defgroup PJMEDIA_RESAMPLE_PORT Resample Port
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief Media port interface to change media stream's sampling rate. * @brief Audio sample rate conversion
* @{ * @{
* This section describes media port abstractoin for @ref PJMEDIA_RESAMPLE. *
* This section describes media port abstraction for @ref PJMEDIA_RESAMPLE.
*/ */
/** /**
* Option flags that can be specified when creating resample port. * Option flags that can be specified when creating resample port.
*/ */
enum pjmedia_resample_port_options enum pjmedia_resample_port_options
{ {
/** /**
* Do not use high quality resampling algorithm, but use linear * Do not use high quality resampling algorithm, but use linear
* algorithm instead. * algorithm instead.
 End of changes. 6 change blocks. 
5 lines changed or deleted 7 lines changed or added


 resolver.h   resolver.h 
/* $Id: resolver.h 1356 2007-06-11 16:47:51Z bennylp $ */ /* $Id: resolver.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 rpid.h   rpid.h 
/* $Id: rpid.h 1424 2007-08-25 13:36:15Z bennylp $ */ /* $Id: rpid.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 rtcp.h   rtcp.h 
/* $Id: rtcp.h 1444 2007-09-20 11:30:59Z bennylp $ */ /* $Id: rtcp.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 28 skipping to change at line 28
*/ */
#ifndef __PJMEDIA_RTCP_H__ #ifndef __PJMEDIA_RTCP_H__
#define __PJMEDIA_RTCP_H__ #define __PJMEDIA_RTCP_H__
/** /**
* @file rtcp.h * @file rtcp.h
* @brief RTCP implementation. * @brief RTCP implementation.
*/ */
#include <pjmedia/types.h> #include <pjmedia/types.h>
#include <pjmedia/rtcp_xr.h>
#include <pjmedia/rtp.h> #include <pjmedia/rtp.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJMED_RTCP RTCP Session and Encapsulation (RFC 3550) * @defgroup PJMED_RTCP RTCP Session and Encapsulation (RFC 3550)
* @ingroup PJMEDIA_TRANSPORT * @ingroup PJMEDIA_SESSION
* @brief RTCP format and session management
* @{ * @{
*
* PJMEDIA implements subsets of RTCP specification (RFC 3550) to monitor * PJMEDIA implements subsets of RTCP specification (RFC 3550) to monitor
* the quality of the real-time media (audio/video) transmission. In * the quality of the real-time media (audio/video) transmission. In
* addition to the standard quality monitoring and reporting with RTCP * addition to the standard quality monitoring and reporting with RTCP
* SR and RR types, PJMEDIA's RTCP implementation is able to report * SR and RR types, PJMEDIA's RTCP implementation is able to report
* extended statistics for incoming streams, such as packet duplications, * extended statistics for incoming streams, such as packet duplications,
* reorder, discarded, and loss period (to distinguish between random * reorder, discarded, and loss period (to distinguish between random
* and burst loss). * and burst loss).
* *
* The bidirectional media quality statistic is represented with * The bidirectional media quality statistic is represented with
* #pjmedia_rtcp_stat structure. * #pjmedia_rtcp_stat structure.
skipping to change at line 175 skipping to change at line 178
{ {
pj_time_val update; /**< Time of last update. */ pj_time_val update; /**< Time of last update. */
unsigned update_cnt; /**< Number of updates (to calculate avg) */ unsigned update_cnt; /**< Number of updates (to calculate avg) */
pj_uint32_t pkt; /**< Total number of packets */ pj_uint32_t pkt; /**< Total number of packets */
pj_uint32_t bytes; /**< Total number of payload/bytes */ pj_uint32_t bytes; /**< Total number of payload/bytes */
unsigned discard; /**< Total number of discarded packets. */ unsigned discard; /**< Total number of discarded packets. */
unsigned loss; /**< Total number of packets lost */ unsigned loss; /**< Total number of packets lost */
unsigned reorder; /**< Total number of out of order packets */ unsigned reorder; /**< Total number of out of order packets */
unsigned dup; /**< Total number of duplicates packets */ unsigned dup; /**< Total number of duplicates packets */
struct { pj_math_stat loss_period;/**< Loss period statistics (in usec)
unsigned count; /**< Number of period samples(to calc avg) */
*/
unsigned min; /**< Minimum loss period (in usec)
*/
unsigned avg; /**< Average loss period (in usec)
*/
unsigned max; /**< Maximum loss period (in usec)
*/
unsigned last; /**< Last loss period (in usec)
*/
} loss_period; /**< Lost period history.
*/
struct { struct {
unsigned burst:1; /**< Burst/sequential packet lost detected */ unsigned burst:1; /**< Burst/sequential packet lost detected */
unsigned random:1; /**< Random packet lost detected. */ unsigned random:1; /**< Random packet lost detected. */
} loss_type; /**< Types of loss detected. */ } loss_type; /**< Types of loss detected. */
struct { pj_math_stat jitter; /**< Jitter statistics (in usec)
unsigned count; /**< Number of updates. */
*/
unsigned min; /**< Minimum jitter (in usec)
*/
unsigned avg; /**< Average jitter (in usec)
*/
unsigned max; /**< Maximum jitter (in usec)
*/
unsigned last; /**< Last jitter (in usec)
*/
} jitter; /**< Jitter history.
*/
}; };
/** /**
* @see pjmedia_rtcp_stream_stat * @see pjmedia_rtcp_stream_stat
*/ */
typedef struct pjmedia_rtcp_stream_stat pjmedia_rtcp_stream_stat; typedef struct pjmedia_rtcp_stream_stat pjmedia_rtcp_stream_stat;
/** /**
* Bidirectional RTP stream statistics. * Bidirectional RTP stream statistics.
*/ */
struct pjmedia_rtcp_stat struct pjmedia_rtcp_stat
{ {
pj_time_val start; /**< Time when session was creat ed */ pj_time_val start; /**< Time when session was creat ed */
pjmedia_rtcp_stream_stat tx; /**< Encoder stream statistics. */ pjmedia_rtcp_stream_stat tx; /**< Encoder stream statistics. */
pjmedia_rtcp_stream_stat rx; /**< Decoder stream statistics. */ pjmedia_rtcp_stream_stat rx; /**< Decoder stream statistics. */
struct { pj_math_stat rtt; /**< Round trip delay statistic(in usec)
unsigned min; /**< Minimum round-trip delay (in usec) */
*/
unsigned avg; /**< Average round-trip delay (in usec)
*/
unsigned max; /**< Maximum round-trip delay (in usec)
*/
unsigned last; /**< Last round-trip delay (in usec)
*/
} rtt; /**< Round trip delay history.
*/
unsigned rtt_update_cnt; /**< Nb of times rtt is updated.
*/
}; };
/** /**
* @see pjmedia_rtcp_stat * @see pjmedia_rtcp_stat
*/ */
typedef struct pjmedia_rtcp_stat pjmedia_rtcp_stat; typedef struct pjmedia_rtcp_stat pjmedia_rtcp_stat;
/** /**
* The types for keeping the average jitter value. Ideally a floating point
* number should be used, but this is not always available/desired.
*/
#if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT!=0
typedef double PJMEDIA_AVG_JITTER_TYPE;
#else
typedef pj_uint32_t PJMEDIA_AVG_JITTER_TYPE;
#endif
/**
* RTCP session is used to monitor the RTP session of one endpoint. There * RTCP session is used to monitor the RTP session of one endpoint. There
* should only be one RTCP session for a bidirectional RTP streams. * should only be one RTCP session for a bidirectional RTP streams.
*/ */
struct pjmedia_rtcp_session struct pjmedia_rtcp_session
{ {
char *name; /**< Name identification. */ char *name; /**< Name identification. */
pjmedia_rtcp_sr_pkt rtcp_sr_pkt;/**< Cached RTCP packet. */ pjmedia_rtcp_sr_pkt rtcp_sr_pkt;/**< Cached RTCP SR packet. */
pjmedia_rtcp_rr_pkt rtcp_rr_pkt;/**< Cached RTCP RR packet. */ pjmedia_rtcp_rr_pkt rtcp_rr_pkt;/**< Cached RTCP RR packet. */
pjmedia_rtp_seq_session seq_ctrl; /**< RTCP sequence number control. */ pjmedia_rtp_seq_session seq_ctrl; /**< RTCP sequence number control. */
unsigned rtp_last_ts;/**< Last timestamp in RX RTP pkt. */ unsigned rtp_last_ts;/**< Last timestamp in RX RTP pkt. */
unsigned clock_rate; /**< Clock rate of the stream */ unsigned clock_rate; /**< Clock rate of the stream */
unsigned pkt_size; /**< Avg pkt size, in samples. */ unsigned pkt_size; /**< Avg pkt size, in samples. */
pj_uint32_t received; /**< # pkt received */ pj_uint32_t received; /**< # pkt received */
pj_uint32_t exp_prior; /**< # pkt expected at last interval*/ pj_uint32_t exp_prior; /**< # pkt expected at last interval*/
pj_uint32_t rx_prior; /**< # pkt received at last interval*/ pj_uint32_t rx_prior; /**< # pkt received at last interval*/
skipping to change at line 267 skipping to change at line 241
pj_time_val tv_base; /**< Base time, in seconds. */ pj_time_val tv_base; /**< Base time, in seconds. */
pj_timestamp ts_base; /**< Base system timestamp. */ pj_timestamp ts_base; /**< Base system timestamp. */
pj_timestamp ts_freq; /**< System timestamp frequency. */ pj_timestamp ts_freq; /**< System timestamp frequency. */
pj_uint32_t rx_lsr; /**< NTP ts in last SR recei ved */ pj_uint32_t rx_lsr; /**< NTP ts in last SR recei ved */
pj_timestamp rx_lsr_time;/**< Time when last SR is received */ pj_timestamp rx_lsr_time;/**< Time when last SR is received */
pj_uint32_t peer_ssrc; /**< Peer SSRC */ pj_uint32_t peer_ssrc; /**< Peer SSRC */
pjmedia_rtcp_stat stat; /**< Bidirectional stream stat. */ pjmedia_rtcp_stat stat; /**< Bidirectional stream stat. */
/* Keep jitter calculation in floating point to prevent the values #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
* from being rounded-down to nearest integer. /**
* Specify whether RTCP XR processing is enabled on this session.
*/
pj_bool_t xr_enabled;
/**
* RTCP XR session, only valid if RTCP XR processing is enabled
* on this session.
*/ */
PJMEDIA_AVG_JITTER_TYPE avg_jitter; /**< Average RX jitter. pjmedia_rtcp_xr_session xr_session;
*/ #endif
}; };
/** /**
* @see pjmedia_rtcp_session * @see pjmedia_rtcp_session
*/ */
typedef struct pjmedia_rtcp_session pjmedia_rtcp_session; typedef struct pjmedia_rtcp_session pjmedia_rtcp_session;
/** /**
* Initialize RTCP session. * Initialize RTCP session.
* *
skipping to change at line 327 skipping to change at line 309
* @param seq The RTP packet sequence number, in host byte order. * @param seq The RTP packet sequence number, in host byte order.
* @param ts The RTP packet timestamp, in host byte order. * @param ts The RTP packet timestamp, in host byte order.
* @param payload Size of the payload. * @param payload Size of the payload.
*/ */
PJ_DECL(void) pjmedia_rtcp_rx_rtp( pjmedia_rtcp_session *session, PJ_DECL(void) pjmedia_rtcp_rx_rtp( pjmedia_rtcp_session *session,
unsigned seq, unsigned seq,
unsigned ts, unsigned ts,
unsigned payload); unsigned payload);
/** /**
* Call this function everytime an RTP packet is received to let the RTCP
* session do its internal calculations.
*
* @param session The session.
* @param seq The RTP packet sequence number, in host byte order.
* @param ts The RTP packet timestamp, in host byte order.
* @param payload Size of the payload.
* @param discarded Flag to specify whether the packet is discarded.
*/
PJ_DECL(void) pjmedia_rtcp_rx_rtp2(pjmedia_rtcp_session *session,
unsigned seq,
unsigned ts,
unsigned payload,
pj_bool_t discarded);
/**
* Call this function everytime an RTP packet is sent to let the RTCP sessi on * Call this function everytime an RTP packet is sent to let the RTCP sessi on
* do its internal calculations. * do its internal calculations.
* *
* @param session The session. * @param session The session.
* @param ptsize The payload size of the RTP packet (ie packet minus * @param ptsize The payload size of the RTP packet (ie packet minus
* RTP header) in bytes. * RTP header) in bytes.
*/ */
PJ_DECL(void) pjmedia_rtcp_tx_rtp( pjmedia_rtcp_session *session, PJ_DECL(void) pjmedia_rtcp_tx_rtp( pjmedia_rtcp_session *session,
unsigned ptsize ); unsigned ptsize );
skipping to change at line 367 skipping to change at line 365
* @param session The RTCP session. * @param session The RTCP session.
* @param rtcp_pkt Upon return, it will contain pointer to the * @param rtcp_pkt Upon return, it will contain pointer to the
* RTCP packet, which can be RTCP SR or RR. * RTCP packet, which can be RTCP SR or RR.
* @param len Upon return, it will indicate the size of * @param len Upon return, it will indicate the size of
* the RTCP packet. * the RTCP packet.
*/ */
PJ_DECL(void) pjmedia_rtcp_build_rtcp( pjmedia_rtcp_session *session, PJ_DECL(void) pjmedia_rtcp_build_rtcp( pjmedia_rtcp_session *session,
void **rtcp_pkt, int *len); void **rtcp_pkt, int *len);
/** /**
* Call this function if RTCP XR needs to be enabled/disabled in the
* RTCP session.
*
* @param session The RTCP session.
* @param enable Enable/disable RTCP XR.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_rtcp_enable_xr( pjmedia_rtcp_session *session,
pj_bool_t enable);
/**
* @} * @}
*/ */
PJ_END_DECL PJ_END_DECL
#endif /* __PJMEDIA_RTCP_H__ */ #endif /* __PJMEDIA_RTCP_H__ */
 End of changes. 14 change blocks. 
58 lines changed or deleted 52 lines changed or added


 rtp.h   rtp.h 
/* $Id: rtp.h 1114 2007-03-29 21:54:21Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * rtp.h
*
* rtp interface for srtp reference implementation
*
* David A. McGrew
* Cisco Systems, Inc.
*
* data types:
*
* rtp_msg_t an rtp message (the data that goes on the wire)
* rtp_sender_t sender side socket and rtp info
* rtp_receiver_t receiver side socket and rtp info
* *
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A
*/
#ifndef __PJMEDIA_RTP_H__
#define __PJMEDIA_RTP_H__
/**
* @file rtp.h
* @brief RTP packet and RTP session declarations.
*/ */
#include <pjmedia/types.h>
PJ_BEGIN_DECL /*
*
/** * Copyright (c) 2001-2006, Cisco Systems, Inc.
* @defgroup PJMED_RTP RTP Session and Encapsulation (RFC 3550) * All rights reserved.
* @ingroup PJMEDIA_TRANSPORT *
* @{ * Redistribution and use in source and binary forms, with or without
* * modification, are permitted provided that the following conditions
* The RTP module is designed to be dependent only to PJLIB, it does not de * are met:
pend *
* on any other parts of PJMEDIA library. The RTP module does not even depe * Redistributions of source code must retain the above copyright
nd * notice, this list of conditions and the following disclaimer.
* on any transports (sockets), to promote even more use, such as in DSP *
* development (where transport may be handled by different processor). * Redistributions in binary form must reproduce the above
* * copyright notice, this list of conditions and the following
* An RTCP implementation is available, in separate module. Please see * disclaimer in the documentation and/or other materials provided
* @ref PJMED_RTCP. * with the distribution.
* *
* The functions that are provided by this module: * Neither the name of the Cisco Systems, Inc. nor the names of its
* - creating RTP header for each outgoing packet. * contributors may be used to endorse or promote products derived
* - decoding RTP packet into RTP header and payload. * from this software without specific prior written permission.
* - provide simple RTP session management (sequence number, etc.) *
* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* The RTP module does not use any dynamic memory at all. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* \section P1 How to Use the RTP Module * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* First application must call #pjmedia_rtp_session_init() to initialize th * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
e RTP * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* session. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* When application wants to send RTP packet, it needs to call * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* #pjmedia_rtp_encode_rtp() to build the RTP header. Note that this WILL N * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OT build * OF THE POSSIBILITY OF SUCH DAMAGE.
* the complete RTP packet, but instead only the header. Application can
* then either concatenate the header with the payload, or send the two
* fragments (the header and the payload) using scatter-gather transport AP
I
* (e.g. \a sendv()).
*
* When application receives an RTP packet, first it should call
* #pjmedia_rtp_decode_rtp to decode RTP header and payload, then it should
call
* #pjmedia_rtp_session_update to check whether we can process the RTP payl
oad,
* and to let the RTP session updates its internal status. The decode funct
ion
* is guaranteed to point the payload to the correct position regardless of
* any options present in the RTP packet.
* *
*/ */
#ifdef _MSC_VER #ifndef RTP_H
# pragma warning(disable:4214) // bit field types other than int #define RTP_H
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#elif defined HAVE_WINSOCK2_H
# include <winsock2.h>
#endif #endif
/** #include "srtp.h"
* RTP packet header. Note that all RTP functions here will work with this
* header in network byte order.
*/
#pragma pack(1)
struct pjmedia_rtp_hdr
{
#if defined(PJ_IS_BIG_ENDIAN) && (PJ_IS_BIG_ENDIAN!=0)
pj_uint16_t v:2; /**< packet type/version */
pj_uint16_t p:1; /**< padding flag */
pj_uint16_t x:1; /**< extension flag */
pj_uint16_t cc:4; /**< CSRC count */
pj_uint16_t m:1; /**< marker bit */
pj_uint16_t pt:7; /**< payload type */
#else
pj_uint16_t cc:4; /**< CSRC count */
pj_uint16_t x:1; /**< header extension flag */
pj_uint16_t p:1; /**< padding flag */
pj_uint16_t v:2; /**< packet type/version */
pj_uint16_t pt:7; /**< payload type */
pj_uint16_t m:1; /**< marker bit */
#endif
pj_uint16_t seq; /**< sequence number */
pj_uint32_t ts; /**< timestamp */
pj_uint32_t ssrc; /**< synchronization source */
};
#pragma pack()
/**
* @see pjmedia_rtp_hdr
*/
typedef struct pjmedia_rtp_hdr pjmedia_rtp_hdr;
/**
* RTP extendsion header.
*/
struct pjmedia_rtp_ext_hdr
{
pj_uint16_t profile_data; /**< Profile data. */
pj_uint16_t length; /**< Length. */
};
/** typedef struct rtp_sender_ctx_t *rtp_sender_t;
* @see pjmedia_rtp_ext_hdr
*/
typedef struct pjmedia_rtp_ext_hdr pjmedia_rtp_ext_hdr;
#pragma pack(1) typedef struct rtp_receiver_ctx_t *rtp_receiver_t;
/** unsigned int
* Declaration for DTMF telephony-events (RFC2833). rtp_sendto(rtp_sender_t sender, const void* msg, int len);
*/
struct pjmedia_rtp_dtmf_event
{
pj_uint8_t event; /**< Event type ID. */
pj_uint8_t e_vol; /**< Event volume. */
pj_uint16_t duration; /**< Event duration. */
};
/** unsigned int
* @see pjmedia_rtp_dtmf_event rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len);
*/
typedef struct pjmedia_rtp_dtmf_event pjmedia_rtp_dtmf_event;
#pragma pack() int
rtp_receiver_init(rtp_receiver_t rcvr, int socket,
/** struct sockaddr_in addr, unsigned int ssrc);
* A generic sequence number management, used by both RTP and RTCP.
*/
struct pjmedia_rtp_seq_session
{
pj_uint16_t max_seq; /**< Highest sequence number hea
rd */
pj_uint32_t cycles; /**< Shifted count of seq number
cycles */
pj_uint32_t base_seq; /**< Base seq number
*/
pj_uint32_t bad_seq; /**< Last 'bad' seq number + 1
*/
pj_uint32_t probation; /**< Sequ. packets till source i
s valid */
};
/** int
* @see pjmedia_rtp_seq_session rtp_sender_init(rtp_sender_t sender, int socket,
*/ struct sockaddr_in addr, unsigned int ssrc);
typedef struct pjmedia_rtp_seq_session pjmedia_rtp_seq_session;
/** /*
* RTP session descriptor. * srtp_sender_init(...) initializes an rtp_sender_t
*/ */
struct pjmedia_rtp_session
{
pjmedia_rtp_hdr out_hdr; /**< Saved hdr for outgoing pkts.
*/
pjmedia_rtp_seq_session seq_ctrl; /**< Sequence number management.
*/
pj_uint16_t out_pt; /**< Default outgoing payloa
d type. */
pj_uint32_t out_extseq; /**< Outgoing extended seq #
. */
pj_uint32_t peer_ssrc; /**< Peer SSRC.
*/
pj_uint32_t received; /**< Number of received pack
ets. */
};
/** int
* @see pjmedia_rtp_session srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed
*/ */
typedef struct pjmedia_rtp_session pjmedia_rtp_session; struct sockaddr_in name, /* socket name *
/
sec_serv_t security_services, /* sec. servs. to be used *
/
unsigned char *input_key /* master key/salt in hex *
/
);
int
srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed
*/
struct sockaddr_in name, /* socket name
*/
sec_serv_t security_services, /* sec. servs. to be used
*/
unsigned char *input_key /* master key/salt in hex
*/
);
int
rtp_sender_init_srtp(rtp_sender_t sender, const srtp_policy_t *policy);
/** int
* This structure is used to receive additional information about the rtp_receiver_init_srtp(rtp_receiver_t sender, const srtp_policy_t *policy);
* state of incoming RTP packet.
*/
struct pjmedia_rtp_status
{
union {
struct flag {
int bad:1; /**< General flag to indicate that sequence is
bad, and application should not process
this packet. More information will be given
in other flags.
*/
int badpt:1; /**< Bad payload type.
*/
int badssrc:1; /**< Bad SSRC
*/
int dup:1; /**< Indicates duplicate packet
*/
int outorder:1; /**< Indicates out of order packet
*/
int probation:1;/**< Indicates that session is in probation
until more packets are received.
*/
int restart:1; /**< Indicates that sequence number has made
a large jump, and internal base sequence
number has been adjusted.
*/
} flag; /**< Status flags.
*/
pj_uint16_t value; /**< Status value, to conveniently address all
flags.
*/
} status; /**< Status information union.
*/
pj_uint16_t diff; /**< Sequence number difference from pre
vious
packet. Normally the value should be 1.
Value greater than one may indicate packet
loss. If packet with lower sequence is
received, the value will be set to zero.
If base sequence has been restarted, the
value will be one.
*/
};
/** rtp_sender_t
* @see pjmedia_rtp_status rtp_sender_alloc();
*/
typedef struct pjmedia_rtp_status pjmedia_rtp_status;
/** rtp_receiver_t
* This function will initialize the RTP session according to given paramet rtp_receiver_alloc();
ers.
*
* @param ses The session.
* @param default_pt Default payload type.
* @param sender_ssrc SSRC used for outgoing packets, in host byte order.
*
* @return PJ_SUCCESS if successfull.
*/
PJ_DECL(pj_status_t) pjmedia_rtp_session_init( pjmedia_rtp_session *ses,
int default_pt,
pj_uint32_t sender_ssrc );
/**
* Create the RTP header based on arguments and current state of the RTP
* session.
*
* @param ses The session.
* @param pt Payload type.
* @param m Marker flag.
* @param payload_len Payload length in bytes.
* @param ts_len Timestamp length.
* @param rtphdr Upon return will point to RTP packet header.
* @param hdrlen Upon return will indicate the size of RTP packet hea
der
*
* @return PJ_SUCCESS if successfull.
*/
PJ_DECL(pj_status_t) pjmedia_rtp_encode_rtp( pjmedia_rtp_session *ses,
int pt, int m,
int payload_len, int ts_len,
const void **rtphdr,
int *hdrlen );
/**
* This function decodes incoming packet into RTP header and payload.
* The decode function is guaranteed to point the payload to the correct
* position regardless of any options present in the RTP packet.
*
* Note that this function does not modify the returned RTP header to
* host byte order.
*
* @param ses The session.
* @param pkt The received RTP packet.
* @param pkt_len The length of the packet.
* @param hdr Upon return will point to the location of the RTP
* header inside the packet. Note that the RTP header
* will be given back as is, meaning that the fields
* will be in network byte order.
* @param payload Upon return will point to the location of the
* payload inside the packet.
* @param payloadlen Upon return will indicate the size of the payload.
*
* @return PJ_SUCCESS if successfull.
*/
PJ_DECL(pj_status_t) pjmedia_rtp_decode_rtp( pjmedia_rtp_session *ses,
const void *pkt, int pkt_len,
const pjmedia_rtp_hdr **hdr,
const void **payload,
unsigned *payloadlen);
/**
* Call this function everytime an RTP packet is received to check whether
* the packet can be received and to let the RTP session performs its inter
nal
* calculations.
*
* @param ses The session.
* @param hdr The RTP header of the incoming packet. The header must
* be given with fields in network byte order.
* @param seq_st Optional structure to receive the status of the RTP pac
ket
* processing.
*/
PJ_DECL(void) pjmedia_rtp_session_update( pjmedia_rtp_session *ses,
const pjmedia_rtp_hdr *hdr,
pjmedia_rtp_status *seq_st);
/* /*
* INTERNAL: * RTP_HEADER_LEN indicates the size of an RTP header
*/
/**
* Internal function for creating sequence number control, shared by RTCP
* implementation.
*
* @param seq_ctrl The sequence control instance.
* @param seq Sequence number to initialize.
*/ */
void pjmedia_rtp_seq_init(pjmedia_rtp_seq_session *seq_ctrl, #define RTP_HEADER_LEN 12
pj_uint16_t seq);
/** /*
* Internal function update sequence control, shared by RTCP implementation * RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementati
. on
*
* @param seq_ctrl The sequence control instance.
* @param seq Sequence number to update.
* @param seq_status Optional structure to receive additional information
* about the packet.
*/
void pjmedia_rtp_seq_update( pjmedia_rtp_seq_session *seq_ctrl,
pj_uint16_t seq,
pjmedia_rtp_status *seq_status);
/**
* @}
*/ */
#define RTP_MAX_BUF_LEN 16384
PJ_END_DECL #endif /* RTP_H */
#endif /* __PJMEDIA_RTP_H__ */
 End of changes. 24 change blocks. 
332 lines changed or deleted 103 lines changed or added


 scanner.h   scanner.h 
/* $Id: scanner.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: scanner.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 33 skipping to change at line 33
* @file scanner.h * @file scanner.h
* @brief Text Scanning. * @brief Text Scanning.
*/ */
#include <pjlib-util/types.h> #include <pjlib-util/types.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJ_SCAN Fast Text Scanning * @defgroup PJ_SCAN Fast Text Scanning
* @ingroup PJLIB_UTIL * @ingroup PJLIB_TEXT
* @brief Text scanning utility. * @brief Text scanning utility.
* *
* This module describes a fast text scanning functions. * This module describes a fast text scanning functions.
* *
* @{ * @{
*/ */
#if defined(PJ_SCANNER_USE_BITWISE) && PJ_SCANNER_USE_BITWISE != 0 #if defined(PJ_SCANNER_USE_BITWISE) && PJ_SCANNER_USE_BITWISE != 0
# include <pjlib-util/scanner_cis_bitwise.h> # include <pjlib-util/scanner_cis_bitwise.h>
#else #else
# include <pjlib-util/scanner_cis_uint.h> # include <pjlib-util/scanner_cis_uint.h>
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 scanner_cis_bitwise.h   scanner_cis_bitwise.h 
/* $Id: scanner_cis_bitwise.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: scanner_cis_bitwise.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 scanner_cis_uint.h   scanner_cis_uint.h 
/* $Id: scanner_cis_uint.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: scanner_cis_uint.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 48 skipping to change at line 48
typedef PJ_CIS_ELEM_TYPE pj_cis_elem_t; typedef PJ_CIS_ELEM_TYPE pj_cis_elem_t;
/** pj_cis_buf_t is not used when uint back-end is used. */ /** pj_cis_buf_t is not used when uint back-end is used. */
typedef int pj_cis_buf_t; typedef int pj_cis_buf_t;
/** /**
* Character input specification. * Character input specification.
*/ */
typedef struct pj_cis_t typedef struct pj_cis_t
{ {
PJ_CIS_ELEM_TYPE cis_buf[256]; PJ_CIS_ELEM_TYPE cis_buf[256]; /**< Internal buffer. */
} pj_cis_t; } pj_cis_t;
/** /**
* Set the membership of the specified character. * Set the membership of the specified character.
* Note that this is a macro, and arguments may be evaluated more than once . * Note that this is a macro, and arguments may be evaluated more than once .
* *
* @param cis Pointer to character input specification. * @param cis Pointer to character input specification.
* @param c The character. * @param c The character.
*/ */
#define PJ_CIS_SET(cis,c) ((cis)->cis_buf[(int)(c)] = 1) #define PJ_CIS_SET(cis,c) ((cis)->cis_buf[(int)(c)] = 1)
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 sdp.h   sdp.h 
/* $Id: sdp.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sdp.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 31 skipping to change at line 31
/** /**
* @file sdp.h * @file sdp.h
* @brief SDP header file. * @brief SDP header file.
*/ */
#include <pjmedia/types.h> #include <pjmedia/types.h>
/** /**
* @defgroup PJMEDIA_SDP SDP Parsing and Data Structure * @defgroup PJMEDIA_SDP SDP Parsing and Data Structure
* @ingroup PJMEDIA_SESSION * @ingroup PJMEDIA_SESSION
* @brief SDP data structure representation and parsing
* @{ * @{
* *
* The basic SDP session descriptor and elements are described in header * The basic SDP session descriptor and elements are described in header
* file <b><pjmedia/sdp.h></b>. This file contains declaration for * file <b><pjmedia/sdp.h></b>. This file contains declaration for
* SDP session descriptor and SDP media descriptor, along with their * SDP session descriptor and SDP media descriptor, along with their
* attributes. This file also declares functions to parse SDP message. * attributes. This file also declares functions to parse SDP message.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
skipping to change at line 305 skipping to change at line 306
* *
* @param attr Generic attribute to be converted to rtcp, which * @param attr Generic attribute to be converted to rtcp, which
* name must be "rtcp". * name must be "rtcp".
* @param rtcp SDP rtcp attribute to be initialized. * @param rtcp SDP rtcp attribute to be initialized.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_sdp_attr_get_rtcp(const pjmedia_sdp_attr *attr , PJ_DECL(pj_status_t) pjmedia_sdp_attr_get_rtcp(const pjmedia_sdp_attr *attr ,
pjmedia_sdp_rtcp_attr *rtcp); pjmedia_sdp_rtcp_attr *rtcp);
/**
* Create a=rtcp attribute.
*
* @param pool Pool to create the attribute.
* @param a Socket address.
*
* @return SDP RTCP attribute.
*/
PJ_DECL(pjmedia_sdp_attr*) pjmedia_sdp_attr_create_rtcp(pj_pool_t *pool,
const pj_sockaddr *a
);
/* ************************************************************************ ** /* ************************************************************************ **
* SDP CONNECTION INFO * SDP CONNECTION INFO
************************************************************************** ** ************************************************************************** **
*/ */
/** /**
* This structure describes SDP connection info ("c=" line). * This structure describes SDP connection info ("c=" line).
*/ */
struct pjmedia_sdp_conn struct pjmedia_sdp_conn
{ {
skipping to change at line 469 skipping to change at line 481
* @param option Comparison option, which should be zero for now. * @param option Comparison option, which should be zero for now.
* *
* @return PJ_SUCCESS when both SDP medias are equal, or the * @return PJ_SUCCESS when both SDP medias are equal, or the
* appropriate status code describing which part of * appropriate status code describing which part of
* the descriptors that are not equal. * the descriptors that are not equal.
*/ */
PJ_DECL(pj_status_t) pjmedia_sdp_media_cmp(const pjmedia_sdp_media *sd1, PJ_DECL(pj_status_t) pjmedia_sdp_media_cmp(const pjmedia_sdp_media *sd1,
const pjmedia_sdp_media *sd2, const pjmedia_sdp_media *sd2,
unsigned option); unsigned option);
/**
* Compare two media transports for compatibility.
*
* @param t1 The first media transport to compare.
* @param t2 The second media transport to compare.
*
* @return PJ_SUCCESS when both media transports are compatible,
* otherwise returns PJMEDIA_SDP_ETPORTNOTEQUAL.
*/
PJ_DECL(pj_status_t) pjmedia_sdp_transport_cmp(const pj_str_t *t1,
const pj_str_t *t2);
/**
* Deactivate SDP media.
*
* @param m The SDP media to deactivate.
*
* @return PJ_SUCCESS when SDP media successfully deactivated,
* otherwise appropriate status code returned.
*/
PJ_DECL(pj_status_t) pjmedia_sdp_media_deactivate(pj_pool_t *pool,
pjmedia_sdp_media *m);
/* ************************************************************************ ** /* ************************************************************************ **
* SDP SESSION DESCRIPTION * SDP SESSION DESCRIPTION
************************************************************************** ** ************************************************************************** **
*/ */
/** /**
* This structure describes SDP session description. A SDP session descript or * This structure describes SDP session description. A SDP session descript or
* contains complete information about a session, and normally is exchanged * contains complete information about a session, and normally is exchanged
* with remote media peer using signaling protocol such as SIP. * with remote media peer using signaling protocol such as SIP.
*/ */
 End of changes. 5 change blocks. 
2 lines changed or deleted 38 lines changed or added


 sdp_neg.h   sdp_neg.h 
/* $Id: sdp_neg.h 1379 2007-06-20 10:03:46Z bennylp $ */ /* $Id: sdp_neg.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 session.h   session.h 
/* $Id: session.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: session.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 34 skipping to change at line 34
* @brief Media Session. * @brief Media Session.
*/ */
#include <pjmedia/endpoint.h> #include <pjmedia/endpoint.h>
#include <pjmedia/stream.h> #include <pjmedia/stream.h>
#include <pjmedia/sdp.h> #include <pjmedia/sdp.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJMEDIA_SESSION Sessions * @defgroup PJMEDIA_SESSION Media Sessions
* @ingroup PJMEDIA * @brief Management of media sessions
*/
/**
* @defgroup PJMED_SES Media session
* @ingroup PJMEDIA_SESSION
* @{ * @{
* *
* A media session represents multimedia communication between two * A media session represents multimedia communication between two
* parties. A media session represents the multimedia session that * parties. A media session represents the multimedia session that
* is described by SDP session descriptor. A media session consists * is described by SDP session descriptor. A media session consists
* of one or more media streams (pjmedia_stream), where each stream * of one or more media streams (pjmedia_stream), where each stream
* represents one media line (m= line) in SDP. * represents one media line (m= line) in SDP.
* *
* This module provides functions to create and manage multimedia * This module provides functions to create and manage multimedia
* sessions. * sessions.
skipping to change at line 169 skipping to change at line 164
* *
* @param session The session which info is being queried. * @param session The session which info is being queried.
* @param info Pointer to receive session info. * @param info Pointer to receive session info.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_session_get_info( pjmedia_session *session, PJ_DECL(pj_status_t) pjmedia_session_get_info( pjmedia_session *session,
pjmedia_session_info *info ); pjmedia_session_info *info );
/** /**
* Get user data of the session.
*
* @param session The session being queried.
*
* @return User data of the session.
*/
PJ_DECL(void*) pjmedia_session_get_user_data( pjmedia_session *session);
/**
* Activate all streams in media session for the specified direction. * Activate all streams in media session for the specified direction.
* Application only needs to call this function if it previously paused * Application only needs to call this function if it previously paused
* the session. * the session.
* *
* @param session The media session. * @param session The media session.
* @param dir The direction to activate. * @param dir The direction to activate.
* *
* @return PJ_SUCCESS if success. * @return PJ_SUCCESS if success.
*/ */
PJ_DECL(pj_status_t) pjmedia_session_resume(pjmedia_session *session, PJ_DECL(pj_status_t) pjmedia_session_resume(pjmedia_session *session,
 End of changes. 4 change blocks. 
9 lines changed or deleted 13 lines changed or added


 setjmp.h   setjmp.h 
/* $Id: setjmp.h 1235 2007-04-30 21:03:32Z bennylp $ */ /* $Id: setjmp.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sha1.h   sha1.h 
/* $Id: sha1.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * sha1.h
* *
* This program is free software; you can redistribute it and/or modify * interface to the Secure Hash Algorithm v.1 (SHA-1), specified in
* it under the terms of the GNU General Public License as published by * FIPS 180-1
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * David A. McGrew
* but WITHOUT ANY WARRANTY; without even the implied warranty of * Cisco Systems, Inc.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
A
*/ */
#ifndef __PJLIB_UTIL_SHA1_H__
#define __PJLIB_UTIL_SHA1_H__
/** /*
* @file sha1.h *
* @brief SHA1 encryption implementation * Copyright (c) 2001-2006, Cisco Systems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/ */
#include <pj/types.h> #ifndef SHA1_H
#define SHA1_H
PJ_BEGIN_DECL #include "err.h"
#include "datatypes.h"
/** typedef struct {
* @defgroup PJLIB_UTIL_SHA1 SHA1 uint32_t H[5]; /* state vector */
* @ingroup PJLIB_UTIL_ENCRYPTION uint32_t M[16]; /* message buffer */
* @{ int octets_in_buffer; /* octets of message in buffer */
*/ uint32_t num_bits_in_msg; /* total number of bits in message */
} sha1_ctx_t;
/** SHA1 context */ /*
typedef struct pj_sha1_context * sha1(&ctx, msg, len, output) hashes the len octets starting at msg
{ * into the SHA1 context, then writes the result to the 20 octets at
pj_uint32_t state[5]; * output
pj_uint32_t count[2]; *
pj_uint8_t buffer[64]; */
} pj_sha1_context;
/** SHA1 digest size is 20 bytes */ void
#define PJ_SHA1_DIGEST_SIZE 20 sha1(const uint8_t *message, int octets_in_msg, uint32_t output[5]);
/** Initialize the algorithm. /*
* @param ctx SHA1 context. * sha1_init(&ctx) initializes the SHA1 context ctx
*
* sha1_update(&ctx, msg, len) hashes the len octets starting at msg
* into the SHA1 context
*
* sha1_final(&ctx, output) performs the final processing of the SHA1
* context and writes the result to the 20 octets at output
*
*/ */
PJ_DECL(void) pj_sha1_init(pj_sha1_context *ctx);
/** Append a stream to the message. void
* @param ctx SHA1 context. sha1_init(sha1_ctx_t *ctx);
* @param data Data.
* @param nbytes Length of data.
*/
PJ_DECL(void) pj_sha1_update(pj_sha1_context *ctx,
const pj_uint8_t *data,
const pj_size_t nbytes);
/** Finish the message and return the digest. void
* @param ctx SHA1 context. sha1_update(sha1_ctx_t *ctx, const uint8_t *M, int octets_in_msg);
* @param digest 16 byte digest.
void
sha1_final(sha1_ctx_t *ctx, uint32_t output[5]);
/*
* The sha1_core function is INTERNAL to SHA-1, but it is declared
* here because it is also used by the cipher SEAL 3.0 in its key
* setup algorithm.
*/ */
PJ_DECL(void) pj_sha1_final(pj_sha1_context *ctx,
pj_uint8_t digest[PJ_SHA1_DIGEST_SIZE]);
/** /*
* @} * sha1_core(M, H) computes the core sha1 compression function, where M is
* the next part of the message and H is the intermediate state {H0,
* H1, ...}
*
* this function does not do any of the padding required in the
* complete sha1 function
*/ */
PJ_END_DECL void
sha1_core(const uint32_t M[16], uint32_t hash_value[5]);
#endif /* __PJLIB_UTIL_SHA1_H__ */ #endif /* SHA1_H */
 End of changes. 19 change blocks. 
55 lines changed or deleted 87 lines changed or added


 silencedet.h   silencedet.h 
/* $Id: silencedet.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: silencedet.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_100rel.h   sip_100rel.h 
/* $Id: sip_100rel.h 1469 2007-10-03 18:28:49Z bennylp $ */ /* $Id: sip_100rel.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_auth.h   sip_auth.h 
/* $Id: sip_auth.h 1561 2007-11-08 09:24:30Z bennylp $ */ /* $Id: sip_auth.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 33 skipping to change at line 33
* @file pjsip_auth.h * @file pjsip_auth.h
* @brief SIP Authorization Module. * @brief SIP Authorization Module.
*/ */
#include <pjsip/sip_config.h> #include <pjsip/sip_config.h>
#include <pjsip/sip_auth_msg.h> #include <pjsip/sip_auth_msg.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @addtogroup PJSIP_AUTH Authentication Framework * @addtogroup PJSIP_AUTH
* @ingroup PJSIP_CORE * @ingroup PJSIP_CORE
* @brief Client and server side authentication framework. * @brief Client and server side authentication framework.
*/ */
/** /**
* @defgroup PJSIP_AUTH_API Authentication API's * @defgroup PJSIP_AUTH_API Authentication API's
* @ingroup PJSIP_AUTH * @ingroup PJSIP_AUTH
* @brief Structures and functions to perform authentication. * @brief Structures and functions to perform authentication.
* @{ * @{
*/ */
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 sip_auth_aka.h   sip_auth_aka.h 
/* $Id: sip_auth_aka.h 1500 2007-10-15 07:04:59Z bennylp $ */ /* $Id: sip_auth_aka.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_auth_msg.h   sip_auth_msg.h 
/* $Id: sip_auth_msg.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_auth_msg.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_auth_parser.h   sip_auth_parser.h 
/* $Id: sip_auth_parser.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_auth_parser.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJSIP_AUTH_SIP_AUTH_PARSER_H__ #ifndef __PJSIP_AUTH_SIP_AUTH_PARSER_H__
#define __PJSIP_AUTH_SIP_AUTH_PARSER_H__ #define __PJSIP_AUTH_SIP_AUTH_PARSER_H__
/** /**
* @file pjsip_auth_parser.h * @file sip_auth_parser.h
* @brief SIP Authorization Parser Module. * @brief SIP Authorization Parser Module.
*/ */
#include <pj/types.h> #include <pj/types.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Initialize and register authorization parser module. * Initialize and register authorization parser module.
* This will register parser handler for various Authorization related head ers * This will register parser handler for various Authorization related head ers
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 sip_config.h   sip_config.h 
/* $Id: sip_config.h 1575 2007-11-11 07:14:47Z bennylp $ */ /* $Id: sip_config.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJSIP_SIP_CONFIG_H__ #ifndef __PJSIP_SIP_CONFIG_H__
#define __PJSIP_SIP_CONFIG_H__ #define __PJSIP_SIP_CONFIG_H__
/** /**
* @file sip_config.h * @file sip_config.h
* @brief Compile time configuration. * @brief Compile time configuration.
*/ */
#include <pj/config.h> #include <pj/types.h>
/**
* @defgroup PJSIP PJSIP Library Collection
*/
/** /**
* @defgroup PJSIP_CORE Core SIP Library * @defgroup PJSIP_CORE Core SIP Library
* @ingroup PJSIP
* @brief The core framework from which all other SIP components depends on . * @brief The core framework from which all other SIP components depends on .
* *
* The PJSIP Core library only provides transport framework, event * The PJSIP Core library only provides transport framework, event
* dispatching/module framework, and SIP message representation and * dispatching/module framework, and SIP message representation and
* parsing. It doesn't do anything usefull in itself! * parsing. It doesn't do anything usefull in itself!
* *
* If application wants the stack to do anything usefull at all, * If application wants the stack to do anything usefull at all,
* it must registers @ref PJSIP_MOD to the core library. Examples * it must registers @ref PJSIP_MOD to the core library. Examples
* of modules are @ref PJSIP_TRANSACT and @ref PJSUA_UA. * of modules are @ref PJSIP_TRANSACT and @ref PJSUA_UA.
*/ */
/** /**
* @defgroup PJSIP_BASE Base Types * @defgroup PJSIP_BASE Base Types
* @ingroup PJSIP_CORE * @ingroup PJSIP_CORE
* @brief Basic PJSIP types and configurations. * @brief Basic PJSIP types and configurations.
*/ */
/** /**
* @defgroup PJSIP_CONFIG Compile Time Configuration * @defgroup PJSIP_CONFIG PJSIP Configurations/Settings
* @ingroup PJSIP_BASE * @ingroup PJSIP_BASE
* @brief PJSIP compile time configurations. * @brief PJSIP compile time configurations.
* @{ * @{
*/ */
/* /*
* Include sip_autoconf.h if autoconf is used (PJ_AUTOCONF is set) * Include sip_autoconf.h if autoconf is used (PJ_AUTOCONF is set)
*/ */
#if defined(PJ_AUTOCONF) #if defined(PJ_AUTOCONF)
# include <pjsip/sip_autoconf.h> # include <pjsip/sip_autoconf.h>
#endif #endif
PJ_BEGIN_DECL
/**
* This structure describes PJSIP run-time configurations/settings.
* Application may use #pjsip_cfg() function to modify the settings
* before creating the stack.
*/
typedef struct pjsip_cfg_t
{
/** Transaction layer settings. */
struct {
/** Maximum number of transactions. The value is initialized with
* PJSIP_MAX_TSX_COUNT
*/
unsigned max_count;
/* Timeout values: */
/** Transaction T1 timeout, in msec. Default value is PJSIP_T1_TIMEO
UT
*/
unsigned t1;
/** Transaction T2 timeout, in msec. Default value is PJSIP_T2_TIMEO
UT
*/
unsigned t2;
/** Transaction completed timer for non-INVITE, in msec. Default val
ue
* is PJSIP_T4_TIMEOUT
*/
unsigned t4;
/** Transaction completed timer for INVITE, in msec. Default value i
s
* PJSIP_TD_TIMEOUT.
*/
unsigned td;
} tsx;
/* Dialog layer settings .. TODO */
/** Client registration settings. */
struct {
/**
* Specify whether client registration should check for its
* registered contact in Contact header of successful REGISTER
* response to determine whether registration has been successful.
* This setting may be disabled if non-compliant registrar is unable
* to return correct Contact header.
*
* Default is PJSIP_REGISTER_CLIENT_CHECK_CONTACT
*/
pj_bool_t check_contact;
/**
* Specify whether client registration should add "x-uid" extension
* parameter in all Contact URIs that it registers to assist the
* matching of Contact URIs in the 200/OK REGISTER response, in
* case the registrar is unable to return exact Contact URI in the
* 200/OK response.
*
* Default is PJSIP_REGISTER_CLIENT_ADD_XUID_PARAM.
*/
pj_bool_t add_xuid_param;
} regc;
} pjsip_cfg_t;
#ifdef PJ_DLL
/**
* Get pjsip configuration instance. Application may modify the
* settings before creating the SIP endpoint and modules.
*
* @return Configuration instance.
*/
PJ_DECL(pjsip_cfg_t*) pjsip_cfg(void);
#else /* PJ_DLL */
extern pjsip_cfg_t pjsip_sip_cfg_var;
/**
* Get pjsip configuration instance. Application may modify the
* settings before creating the SIP endpoint and modules.
*
* @return Configuration instance.
*/
PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void)
{
return &pjsip_sip_cfg_var;
}
#endif /* PJ_DLL */
/** /**
* Specify maximum transaction count in transaction hash table. * Specify maximum transaction count in transaction hash table.
* Default value is 16*1024 * Default value is 16*1024
*/ */
#ifndef PJSIP_MAX_TSX_COUNT #ifndef PJSIP_MAX_TSX_COUNT
# define PJSIP_MAX_TSX_COUNT (16*1024) # define PJSIP_MAX_TSX_COUNT (16*1024)
#endif #endif
/** /**
* Specify maximum number of dialogs in the dialog hash table. * Specify maximum number of dialogs in the dialog hash table.
skipping to change at line 333 skipping to change at line 423
#endif #endif
/** /**
* This macro specifies whether full DNS resolution should be used. * This macro specifies whether full DNS resolution should be used.
* When enabled, #pjsip_resolve() will perform asynchronous DNS SRV and * When enabled, #pjsip_resolve() will perform asynchronous DNS SRV and
* A (or AAAA, when IPv6 is supported) resolution to resolve the SIP * A (or AAAA, when IPv6 is supported) resolution to resolve the SIP
* domain. * domain.
* *
* Note that even when this setting is enabled, asynchronous DNS resolution * Note that even when this setting is enabled, asynchronous DNS resolution
* will only be done when application calls #pjsip_endpt_create_resolver(), * will only be done when application calls #pjsip_endpt_create_resolver(),
* configure the nameservers with #pj_dns_resolver_set_ns(), and configure * configure the nameservers with pj_dns_resolver_set_ns(), and configure
* the SIP endpoint's DNS resolver with #pjsip_endpt_set_resolver(). If * the SIP endpoint's DNS resolver with #pjsip_endpt_set_resolver(). If
* these steps are not followed, the domain will be resolved with normal * these steps are not followed, the domain will be resolved with normal
* pj_gethostbyname() function. * pj_gethostbyname() function.
* *
* Turning off this setting will save the footprint by about 16KB, since * Turning off this setting will save the footprint by about 16KB, since
* it should also exclude dns.o and resolve.o from PJLIB-UTIL. * it should also exclude dns.o and resolve.o from PJLIB-UTIL.
* *
* Default: 1 (enabled) * Default: 1 (enabled)
* *
* @see PJSIP_MAX_RESOLVED_ADDRESSES * @see PJSIP_MAX_RESOLVED_ADDRESSES
skipping to change at line 384 skipping to change at line 474
* *
* Default: 5 * Default: 5
* *
* @see PJSIP_TCP_TRANSPORT_BACKLOG * @see PJSIP_TCP_TRANSPORT_BACKLOG
*/ */
#ifndef PJSIP_TLS_TRANSPORT_BACKLOG #ifndef PJSIP_TLS_TRANSPORT_BACKLOG
# define PJSIP_TLS_TRANSPORT_BACKLOG 5 # define PJSIP_TLS_TRANSPORT_BACKLOG 5
#endif #endif
/* Endpoint. */ /* Endpoint. */
#define PJSIP_MAX_TIMER_COUNT (2*PJSIP_MAX_TSX_COUNT + 2*PJSIP_MAX #define PJSIP_MAX_TIMER_COUNT (2*pjsip_cfg()->tsx.max_count + \
_DIALOG_COUNT) 2*PJSIP_MAX_DIALOG_COUNT)
/** /**
* Initial memory block for the endpoint. * Initial memory block for the endpoint.
*/ */
#ifndef PJSIP_POOL_LEN_ENDPT #ifndef PJSIP_POOL_LEN_ENDPT
# define PJSIP_POOL_LEN_ENDPT (4000) # define PJSIP_POOL_LEN_ENDPT (4000)
#endif #endif
/** /**
* Memory increment for endpoint. * Memory increment for endpoint.
skipping to change at line 601 skipping to change at line 692
* Specify support for IMS/3GPP digest AKA authentication version 1 and 2 * Specify support for IMS/3GPP digest AKA authentication version 1 and 2
* (AKAv1-MD5 and AKAv2-MD5 respectively). * (AKAv1-MD5 and AKAv2-MD5 respectively).
* *
* Default: 0 (for now) * Default: 0 (for now)
*/ */
#ifndef PJSIP_HAS_DIGEST_AKA_AUTH #ifndef PJSIP_HAS_DIGEST_AKA_AUTH
# define PJSIP_HAS_DIGEST_AKA_AUTH 0 # define PJSIP_HAS_DIGEST_AKA_AUTH 0
#endif #endif
/** /**
* Specify the number of seconds to refresh the client registration
* before the registration expires.
*
* Default: 5 seconds
*/
#ifndef PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH
# define PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH 5
#endif
/**
* Specify whether client registration should check for its registered
* contact in Contact header of successful REGISTE response to determine
* whether registration has been successful. This setting may be disabled
* if non-compliant registrar is unable to return correct Contact header.
*
* This setting can be changed in run-time by settting \a regc.check_contac
t
* field of pjsip_cfg().
*
* Default is 1
*/
#ifndef PJSIP_REGISTER_CLIENT_CHECK_CONTACT
# define PJSIP_REGISTER_CLIENT_CHECK_CONTACT 1
#endif
/**
* Specify whether client registration should add "x-uid" extension
* parameter in all Contact URIs that it registers to assist the
* matching of Contact URIs in the 200/OK REGISTER response, in
* case the registrar is unable to return exact Contact URI in the
* 200/OK response.
*
* This setting can be changed in run-time by setting
* \a regc.add_xuid_param field of pjsip_cfg().
*
* Default is 0.
*/
#ifndef PJSIP_REGISTER_CLIENT_ADD_XUID_PARAM
# define PJSIP_REGISTER_CLIENT_ADD_XUID_PARAM 0
#endif
PJ_END_DECL
/**
* @} * @}
*/ */
#include <pj/config.h> #include <pj/config.h>
#endif /* __PJSIP_SIP_CONFIG_H__ */ #endif /* __PJSIP_SIP_CONFIG_H__ */
 End of changes. 9 change blocks. 
12 lines changed or deleted 150 lines changed or added


 sip_dialog.h   sip_dialog.h 
/* $Id: sip_dialog.h 1537 2007-10-31 15:52:09Z bennylp $ */ /* $Id: sip_dialog.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJSIP_SIP_DIALOG_H__ #ifndef __PJSIP_SIP_DIALOG_H__
#define __PJSIP_SIP_DIALOG_H__ #define __PJSIP_SIP_DIALOG_H__
/** /**
* @file dialog.h * @file sip_dialog.h
* @brief SIP Dialog abstraction * @brief SIP Dialog abstraction
*/ */
#include <pjsip/sip_msg.h> #include <pjsip/sip_msg.h>
#include <pjsip/sip_auth.h> #include <pjsip/sip_auth.h>
#include <pjsip/sip_errno.h> #include <pjsip/sip_errno.h>
#include <pjsip/sip_transport.h> #include <pjsip/sip_transport.h>
#include <pj/sock.h> #include <pj/sock.h>
#include <pj/assert.h> #include <pj/assert.h>
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 sip_endpoint.h   sip_endpoint.h 
/* $Id: sip_endpoint.h 1098 2007-03-23 16:34:20Z bennylp $ */ /* $Id: sip_endpoint.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 224 skipping to change at line 224
* Return back pool to endpoint to be released back to the pool factory. * Return back pool to endpoint to be released back to the pool factory.
* This function, like all other endpoint functions, is thread safe. * This function, like all other endpoint functions, is thread safe.
* *
* @param endpt The endpoint. * @param endpt The endpoint.
* @param pool The pool to be destroyed. * @param pool The pool to be destroyed.
*/ */
PJ_DECL(void) pjsip_endpt_release_pool( pjsip_endpoint *endpt, PJ_DECL(void) pjsip_endpt_release_pool( pjsip_endpoint *endpt,
pj_pool_t *pool ); pj_pool_t *pool );
/** /**
* Create a new transaction. After creating the transaction, application MU
ST
* initialize the transaction as either UAC or UAS (by calling
* #pjsip_tsx_init_uac or #pjsip_tsx_init_uas), then must register the
* transaction to endpoint with #pjsip_endpt_register_tsx.
* This function, like all other endpoint functions, is thread safe.
*
* @param endpt The SIP endpoint.
* @param p_tsx Pointer to receive the transaction.
*
* @return PJ_SUCCESS or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_endpt_create_tsx(pjsip_endpoint *endpt,
pjsip_transaction **p_tsx);
/**
* Find transaction in endpoint's transaction table by the transaction's ke y. * Find transaction in endpoint's transaction table by the transaction's ke y.
* This function normally is only used by modules. The key for a transactio n * This function normally is only used by modules. The key for a transactio n
* can be created by calling #pjsip_tsx_create_key. * can be created by calling #pjsip_tsx_create_key.
* *
* @param endpt The endpoint instance. * @param endpt The endpoint instance.
* @param key Transaction key, as created with #pjsip_tsx_create_key. * @param key Transaction key, as created with #pjsip_tsx_create_key.
* *
* @return The transaction, or NULL if it's not found. * @return The transaction, or NULL if it's not found.
*/ */
PJ_DECL(pjsip_transaction*) pjsip_endpt_find_tsx( pjsip_endpoint *endpt, PJ_DECL(pjsip_transaction*) pjsip_endpt_find_tsx( pjsip_endpoint *endpt,
 End of changes. 3 change blocks. 
18 lines changed or deleted 2 lines changed or added


 sip_errno.h   sip_errno.h 
/* $Id: sip_errno.h 1539 2007-11-03 01:46:03Z bennylp $ */ /* $Id: sip_errno.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 426 skipping to change at line 426
/** /**
* @hideinitializer * @hideinitializer
* Session already terminated. * Session already terminated.
*/ */
#define PJSIP_ESESSIONTERMINATED (PJSIP_ERRNO_START_PJSIP+140) /* 171140 */ #define PJSIP_ESESSIONTERMINATED (PJSIP_ERRNO_START_PJSIP+140) /* 171140 */
/** /**
* @hideinitializer * @hideinitializer
* Invalid session state for the specified operation. * Invalid session state for the specified operation.
*/ */
#define PJSIP_ESESSIONSTATE (PJSIP_ERRNO_START_PJSIP+141) /* 171141 */ #define PJSIP_ESESSIONSTATE (PJSIP_ERRNO_START_PJSIP+141) /* 171141 */
/**
* @hideinitializer
* The feature being requested requires the use of secure session or
* transport.
*/
#define PJSIP_ESESSIONINSECURE (PJSIP_ERRNO_START_PJSIP+142) /* 171142 */
/************************************************************ /************************************************************
* TLS TRANSPORT ERRORS * TLS TRANSPORT ERRORS
***********************************************************/ ***********************************************************/
/** /**
* @hideinitializer * @hideinitializer
* Unknown TLS error * Unknown TLS error
*/ */
#define PJSIP_TLS_EUNKNOWN (PJSIP_ERRNO_START_PJSIP+160) /* 171160 */ #define PJSIP_TLS_EUNKNOWN (PJSIP_ERRNO_START_PJSIP+160) /* 171160 */
/** /**
 End of changes. 3 change blocks. 
2 lines changed or deleted 8 lines changed or added


 sip_event.h   sip_event.h 
/* $Id: sip_event.h 1417 2007-08-16 10:11:44Z bennylp $ */ /* $Id: sip_event.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_inv.h   sip_inv.h 
/* $Id: sip_inv.h 1477 2007-10-05 09:12:26Z bennylp $ */ /* $Id: sip_inv.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 32 skipping to change at line 32
/** /**
* @file sip_inv.h * @file sip_inv.h
* @brief INVITE sessions * @brief INVITE sessions
*/ */
#include <pjsip/sip_dialog.h> #include <pjsip/sip_dialog.h>
#include <pjmedia/sdp_neg.h> #include <pjmedia/sdp_neg.h>
/** /**
* @defgroup PJSIP_HIGH_UA User Agent Library * @defgroup PJSIP_HIGH_UA User Agent Library
* @ingroup PJSIP
* @brief Mid-level User Agent Library. * @brief Mid-level User Agent Library.
* *
* This is the high level user agent library, which consists of: * This is the high level user agent library, which consists of:
* - @ref PJSIP_INV, to encapsulate INVITE sessions and SDP * - @ref PJSIP_INV, to encapsulate INVITE sessions and SDP
* negotiation in the session, * negotiation in the session,
* - @ref PJSUA_REGC, high level client registration API, and * - @ref PJSUA_REGC, high level client registration API, and
* - @ref PJSUA_XFER. * - @ref PJSUA_XFER.
* *
* More detailed information is explained in * More detailed information is explained in
* <A HREF="/docs.htm">PJSIP Developer's Guide</A> * <A HREF="/docs.htm">PJSIP Developer's Guide</A>
skipping to change at line 189 skipping to change at line 188
* *
* This callback is optional (from the point of view of the framework), * This callback is optional (from the point of view of the framework),
* but all useful applications normally need to implement this callback . * but all useful applications normally need to implement this callback .
* *
* @param inv The invite session. * @param inv The invite session.
* @param status The negotiation status. * @param status The negotiation status.
*/ */
void (*on_media_update)(pjsip_inv_session *inv_ses, void (*on_media_update)(pjsip_inv_session *inv_ses,
pj_status_t status); pj_status_t status);
/**
* This callback is called when the framework needs to send
* ACK request after it receives incoming 2xx response for
* INVITE. It allows application to manually handle the
* transmission of ACK request, which is required by some 3PCC
* scenarios. If this callback is not implemented, the framework
* will handle the ACK transmission automatically.
*
* When this callback is overridden, application may delay the
* sending of the ACK request (for example, when it needs to
* wait for answer from the other call leg, in 3PCC scenarios).
*
* Application creates the ACK request
*
* Once it has sent the ACK request, the framework will keep
* this ACK request in the cache. Subsequent receipt of 2xx response
* will not cause this callback to be called, and instead automatic
* retransmission of this ACK request from the cache will be done
* by the framework.
*
* This callback is optional.
*/
void (*on_send_ack)(pjsip_inv_session *inv, pjsip_rx_data *rdata);
} pjsip_inv_callback; } pjsip_inv_callback;
/** /**
* This enumeration shows various options that can be applied to a session. * This enumeration shows various options that can be applied to a session.
* The bitmask combination of these options need to be specified when * The bitmask combination of these options need to be specified when
* creating a session. After the dialog is established (including early), * creating a session. After the dialog is established (including early),
* the options member of #pjsip_inv_session shows which capabilities are * the options member of #pjsip_inv_session shows which capabilities are
* common in both endpoints. * common in both endpoints.
*/ */
enum pjsip_inv_option enum pjsip_inv_option
skipping to change at line 361 skipping to change at line 384
* response message when the verification has failed. * response message when the verification has failed.
* If tdata is specified, then a non-2xx final response * If tdata is specified, then a non-2xx final response
* will be created and put in this argument upon return , * will be created and put in this argument upon return ,
* when the verification has failed. * when the verification has failed.
* *
* If a dialog has been created prior to calling this * If a dialog has been created prior to calling this
* function, then it MUST be specified in dlg argument. * function, then it MUST be specified in dlg argument.
* Otherwise application MUST specify the endpt argumen t * Otherwise application MUST specify the endpt argumen t
* (this is useful e.g. when application wants to send * (this is useful e.g. when application wants to send
* the response statelessly). * the response statelessly).
*
* @see pjsip_inv_verify_request2()
*/ */
PJ_DECL(pj_status_t) pjsip_inv_verify_request( pjsip_rx_data *rdata, PJ_DECL(pj_status_t) pjsip_inv_verify_request( pjsip_rx_data *rdata,
unsigned *options, unsigned *options,
const pjmedia_sdp_session *s dp, const pjmedia_sdp_session *s dp,
pjsip_dialog *dlg, pjsip_dialog *dlg,
pjsip_endpoint *endpt, pjsip_endpoint *endpt,
pjsip_tx_data **tdata); pjsip_tx_data **tdata);
/** /**
* Variant of #pjsip_inv_verify_request() which allows application to speci
fy
* the parsed SDP in the \a offer argument. This is useful to avoid having
to
* re-parse the SDP in the incoming request.
*
* @see pjsip_inv_verify_request()
*/
PJ_DECL(pj_status_t) pjsip_inv_verify_request2( pjsip_rx_data *rdata,
unsigned *options,
const pjmedia_sdp_session *o
ffer,
const pjmedia_sdp_session *a
nswer,
pjsip_dialog *dlg,
pjsip_endpoint *endpt,
pjsip_tx_data **tdata);
/**
* Create UAS invite session for the specified dialog in dlg. Application * Create UAS invite session for the specified dialog in dlg. Application
* SHOULD call the verification function before calling this function, * SHOULD call the verification function before calling this function,
* to ensure that it can create the session successfully. * to ensure that it can create the session successfully.
* *
* @param dlg The dialog to be used. * @param dlg The dialog to be used.
* @param rdata Application MUST specify the received INVITE request * @param rdata Application MUST specify the received INVITE request
* in rdata. The invite session needs to inspect the * in rdata. The invite session needs to inspect the
* received request to see if the request contains * received request to see if the request contains
* features that it supports. * features that it supports.
* @param local_sdp If application has determined its media capability, * @param local_sdp If application has determined its media capability,
skipping to change at line 442 skipping to change at line 482
* argument if it can be created successfully. * argument if it can be created successfully.
* *
* @return PJ_SUCCESS if the INVITE request can be created. * @return PJ_SUCCESS if the INVITE request can be created.
*/ */
PJ_DECL(pj_status_t) pjsip_inv_invite( pjsip_inv_session *inv, PJ_DECL(pj_status_t) pjsip_inv_invite( pjsip_inv_session *inv,
pjsip_tx_data **p_tdata ); pjsip_tx_data **p_tdata );
/** /**
* Create the initial response message for the incoming INVITE request in * Create the initial response message for the incoming INVITE request in
* rdata with status code st_code and optional status text st_text. Use * rdata with status code st_code and optional status text st_text. Use
* #pjsip_answer() to create subsequent response message. * #pjsip_inv_answer() to create subsequent response message.
*/ */
PJ_DECL(pj_status_t) pjsip_inv_initial_answer( pjsip_inv_session *inv, PJ_DECL(pj_status_t) pjsip_inv_initial_answer( pjsip_inv_session *inv,
pjsip_rx_data *rdata, pjsip_rx_data *rdata,
int st_code, int st_code,
const pj_str_t *st_text, const pj_str_t *st_text,
const pjmedia_sdp_session *s dp, const pjmedia_sdp_session *s dp,
pjsip_tx_data **p_tdata); pjsip_tx_data **p_tdata);
/** /**
* Create a response message to the initial INVITE request. This function * Create a response message to the initial INVITE request. This function
skipping to change at line 567 skipping to change at line 607
* @return PJ_SUCCESS if a UPDATE request with the specified * @return PJ_SUCCESS if a UPDATE request with the specified
* characteristics (e.g. to contain new offer) can be * characteristics (e.g. to contain new offer) can be
* created. * created.
*/ */
PJ_DECL(pj_status_t) pjsip_inv_update ( pjsip_inv_session *inv, PJ_DECL(pj_status_t) pjsip_inv_update ( pjsip_inv_session *inv,
const pj_str_t *new_contact, const pj_str_t *new_contact,
const pjmedia_sdp_session *offer, const pjmedia_sdp_session *offer,
pjsip_tx_data **p_tdata ); pjsip_tx_data **p_tdata );
/** /**
* Create an ACK request. Normally ACK request transmission is handled
* by the framework. Application only needs to use this function if it
* handles the ACK transmission manually, by overriding \a on_send_ack()
* callback in #pjsip_inv_callback.
*
* Note that if the invite session has a pending offer to be answered
* (for example when the last 2xx response to INVITE contains an offer),
* application MUST have set the SDP answer with #pjsip_create_sdp_body()
* prior to creating the ACK request. In this case, the ACK request
* will be added with SDP message body.
*
* @param inv The invite session.
* @param cseq Mandatory argument to specify the CSeq of the
* ACK request. This value MUST match the value
* of the INVITE transaction to be acknowledged.
* @param p_tdata Pointer to receive the ACK request message to
* be created.
*
* @return PJ_SUCCESS if ACK request has been created.
*/
PJ_DECL(pj_status_t) pjsip_inv_create_ack(pjsip_inv_session *inv,
int cseq,
pjsip_tx_data **p_tdata);
/**
* Send request or response message in tdata. * Send request or response message in tdata.
* *
* @param inv The invite session. * @param inv The invite session.
* @param tdata The message to be sent. * @param tdata The message to be sent.
* *
* @return PJ_SUCCESS if transaction can be initiated * @return PJ_SUCCESS if transaction can be initiated
* successfully to send this message. Note that the * successfully to send this message. Note that the
* actual final state of the transaction itself will * actual final state of the transaction itself will
* be reported later, in on_tsx_state_changed() * be reported later, in on_tsx_state_changed()
* callback. * callback.
 End of changes. 8 change blocks. 
4 lines changed or deleted 73 lines changed or added


 sip_module.h   sip_module.h 
/* $Id: sip_module.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_module.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_msg.h   sip_msg.h 
/* $Id: sip_msg.h 1461 2007-09-30 16:40:57Z bennylp $ */ /* $Id: sip_msg.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 1008 skipping to change at line 1008
* Generic array of string header. * Generic array of string header.
*/ */
typedef struct pjsip_generic_array_hdr typedef struct pjsip_generic_array_hdr
{ {
/** Standard header fields. */ /** Standard header fields. */
PJSIP_DECL_HDR_MEMBER(struct pjsip_generic_array_hdr); PJSIP_DECL_HDR_MEMBER(struct pjsip_generic_array_hdr);
/** Number of tags/elements. */ /** Number of tags/elements. */
unsigned count; unsigned count;
/**< Tags/elements. */ /** Tags/elements. */
pj_str_t values[PJSIP_GENERIC_ARRAY_MAX_COUNT]; pj_str_t values[PJSIP_GENERIC_ARRAY_MAX_COUNT];
} pjsip_generic_array_hdr; } pjsip_generic_array_hdr;
/** /**
* Create generic array header. * Create generic array header.
* *
* @param pool Pool to allocate memory from. * @param pool Pool to allocate memory from.
* @param hname Header name. * @param hname Header name.
* *
skipping to change at line 1603 skipping to change at line 1603
* @return The header instance, which points to the same memory * @return The header instance, which points to the same memory
* location as the mem argument. * location as the mem argument.
*/ */
PJ_DECL(pjsip_require_hdr*) pjsip_require_hdr_init( pj_pool_t *pool, PJ_DECL(pjsip_require_hdr*) pjsip_require_hdr_init( pj_pool_t *pool,
void *mem ); void *mem );
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* Retry-After header. * Retry-After header.
*/ */
typedef pjsip_generic_int_hdr pjsip_retry_after_hdr; typedef struct pjsip_retry_after_hdr
{
/** Standard header field. */
PJSIP_DECL_HDR_MEMBER(struct pjsip_retry_after_hdr);
pj_int32_t ivalue; /**< Retry-After value */
pjsip_param param; /**< Optional parameters */
pj_str_t comment; /**< Optional comments. */
} pjsip_retry_after_hdr;
/** /**
* Create new Retry-After header instance. * Create new Retry-After header instance.
* *
* @param pool The pool. * @param pool The pool.
* @param value The Retry-After value. * @param value The Retry-After value.
* *
* @return New Retry-After header instance. * @return New Retry-After header instance.
*/ */
PJ_DECL(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_create(pj_pool_t *poo l, PJ_DECL(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_create(pj_pool_t *poo l,
 End of changes. 4 change blocks. 
4 lines changed or deleted 11 lines changed or added


 sip_parser.h   sip_parser.h 
/* $Id: sip_parser.h 1417 2007-08-16 10:11:44Z bennylp $ */ /* $Id: sip_parser.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 173 skipping to change at line 173
* *
* @return zero if the registration was successfull. * @return zero if the registration was successfull.
*/ */
PJ_DECL(pj_status_t) pjsip_unregister_uri_parser( const char *scheme, PJ_DECL(pj_status_t) pjsip_unregister_uri_parser( const char *scheme,
pjsip_parse_uri_func *func ); pjsip_parse_uri_func *func );
/** /**
* Parse an URI in the input and return the correct instance of URI. * Parse an URI in the input and return the correct instance of URI.
* *
* @param pool The pool to get memory allocations. * @param pool The pool to get memory allocations.
* @param buf The input buffer, which size must be at least (size+ * @param buf The input buffer, which MUST be NULL terminated.
1)
* because the function will temporarily put NULL
* termination at the end of the buffer during parsing.
* @param size The length of the string (not counting NULL terminat or). * @param size The length of the string (not counting NULL terminat or).
* @param options If no options are given (value is zero), the object * @param options If no options are given (value is zero), the object
* returned is dependent on the syntax of the URI, * returned is dependent on the syntax of the URI,
* eg. basic SIP URL, TEL URL, or name address. * eg. basic SIP URL, TEL URL, or name address.
* If option PJSIP_PARSE_URI_AS_NAMEADDR is given, * If option PJSIP_PARSE_URI_AS_NAMEADDR is given,
* then the returned object is always name address obje ct, * then the returned object is always name address obje ct,
* with the relevant URI object contained in the name * with the relevant URI object contained in the name
* address object. * address object.
* @return The URI or NULL when failed. No exception is thrown by * @return The URI or NULL when failed. No exception is thrown by
* this function (or any public parser functions). * this function (or any public parser functions).
*/ */
PJ_DECL(pjsip_uri*) pjsip_parse_uri( pj_pool_t *pool, PJ_DECL(pjsip_uri*) pjsip_parse_uri( pj_pool_t *pool,
char *buf, pj_size_t size, char *buf, pj_size_t size,
unsigned options); unsigned options);
/** /**
* Parse SIP status line. * Parse SIP status line.
* *
* @param buf Text buffer to parse. * @param buf Text buffer to parse, which MUST be NULL terminated.
* @param size The size of the buffer. * @param size The size of the buffer, excluding the NULL character
.
* @param status_line Structure to receive the parsed elements. * @param status_line Structure to receive the parsed elements.
* *
* @return PJ_SUCCESS if a status line is parsed successfully. * @return PJ_SUCCESS if a status line is parsed successfully.
*/ */
PJ_DECL(pj_status_t) pjsip_parse_status_line(char *buf, pj_size_t size, PJ_DECL(pj_status_t) pjsip_parse_status_line(char *buf, pj_size_t size,
pjsip_status_line *status_line) ; pjsip_status_line *status_line) ;
/** /**
* Parse a packet buffer and build a full SIP message from the packet. This * Parse a packet buffer and build a full SIP message from the packet. This
* function parses all parts of the message, including request/status line, * function parses all parts of the message, including request/status line,
* all headers, and the message body. The message body however is only * all headers, and the message body. The message body however is only
* treated as a text block, ie. the function will not try to parse the cont ent * treated as a text block, ie. the function will not try to parse the cont ent
* of the body. * of the body.
* *
* @param pool The pool to allocate memory. * @param pool The pool to allocate memory.
* @param buf The input buffer, which size must be at least (size+ * @param buf The input buffer, which MUST be NULL terminated.
1)
* because the function will temporarily put NULL
* termination at the end of the buffer during parsing.
* @param size The length of the string (not counting NULL terminat or). * @param size The length of the string (not counting NULL terminat or).
* @param err_list If this parameter is not NULL, then the parser will * @param err_list If this parameter is not NULL, then the parser will
* put error messages during parsing in this list. * put error messages during parsing in this list.
* *
* @return The message or NULL when failed. No exception is thr own * @return The message or NULL when failed. No exception is thr own
* by this function (or any public parser functions). * by this function (or any public parser functions).
*/ */
PJ_DECL(pjsip_msg *) pjsip_parse_msg( pj_pool_t *pool, PJ_DECL(pjsip_msg *) pjsip_parse_msg( pj_pool_t *pool,
char *buf, pj_size_t size, char *buf, pj_size_t size,
pjsip_parser_err_report *err_list); pjsip_parser_err_report *err_list);
/** /**
* Parse a packet buffer and build a rdata. The resulting message will be * Parse a packet buffer and build a rdata. The resulting message will be
* stored in \c msg field in the \c rdata. This behaves pretty much like * stored in \c msg field in the \c rdata. This behaves pretty much like
* #pjsip_parse_msg(), except that it will also initialize the header field s * #pjsip_parse_msg(), except that it will also initialize the header field s
* in the \c rdata. * in the \c rdata.
* *
* This function is normally called by the transport layer. * This function is normally called by the transport layer.
* *
* @param buf The input buffer * @param buf The input buffer, which MUST be NULL terminated.
* @param buf The input buffer, which size must be at least (size+
1)
* because the function will temporarily put NULL
* termination at the end of the buffer during parsing.
* @param size The length of the string (not counting NULL terminat or). * @param size The length of the string (not counting NULL terminat or).
* @param rdata The receive data buffer to store the message and * @param rdata The receive data buffer to store the message and
* its elements. * its elements.
* *
* @return The message inside the rdata if successfull, or NUL L. * @return The message inside the rdata if successfull, or NUL L.
*/ */
PJ_DECL(pjsip_msg *) pjsip_parse_rdata( char *buf, pj_size_t size, PJ_DECL(pjsip_msg *) pjsip_parse_rdata( char *buf, pj_size_t size,
pjsip_rx_data *rdata ); pjsip_rx_data *rdata );
/** /**
skipping to change at line 271 skipping to change at line 264
pj_size_t *msg_size); pj_size_t *msg_size);
/** /**
* Parse the content of a header and return the header instance. * Parse the content of a header and return the header instance.
* This function parses the content of a header (ie. part after colon) acco rding * This function parses the content of a header (ie. part after colon) acco rding
* to the expected name, and will return the correct instance of header. * to the expected name, and will return the correct instance of header.
* *
* @param pool Pool to allocate memory for the header. * @param pool Pool to allocate memory for the header.
* @param hname Header name which is used to find the correc t function * @param hname Header name which is used to find the correc t function
* to parse the header. * to parse the header.
* @param line Header content, which size must be at least size+1. * @param line Header content, which must be NULL terminated.
* @param size The length of the string (not counting NULL terminat or, * @param size The length of the string (not counting NULL terminat or,
* if any). * if any).
* @param parsed_len If the value is not NULL, then upon return the funct ion * @param parsed_len If the value is not NULL, then upon return the funct ion
* will fill the pointer with the length of the string * will fill the pointer with the length of the string
* that has been parsed. This is usefull for two purpos es, * that has been parsed. This is usefull for two purpos es,
* one is when the string may contain more than one hea der * one is when the string may contain more than one hea der
* lines, and two when an error happen the value can * lines, and two when an error happen the value can
* pinpoint the location of the error in the buffer. * pinpoint the location of the error in the buffer.
* *
* @return The instance of the header if parsing was successful l, * @return The instance of the header if parsing was successful l,
skipping to change at line 295 skipping to change at line 288
char *line, pj_size_t size, char *line, pj_size_t size,
int *parsed_len); int *parsed_len);
/** /**
* Parse header line(s). Multiple headers can be parsed by this function. * Parse header line(s). Multiple headers can be parsed by this function.
* When there are multiple headers, the headers MUST be separated by either * When there are multiple headers, the headers MUST be separated by either
* a newline (as in SIP message) or ampersand mark (as in URI). This separa tor * a newline (as in SIP message) or ampersand mark (as in URI). This separa tor
* however is optional for the last header. * however is optional for the last header.
* *
* @param pool the pool. * @param pool the pool.
* @param input the input text to parse. * @param input the input text to parse, which must be NULL terminated.
* @param size the text length. * @param size the text length.
* @param hlist the header list to store the parsed headers. * @param hlist the header list to store the parsed headers.
* This list must have been initialized before calling * This list must have been initialized before calling
* this function. * this function.
* @return zero if successfull, or -1 if error is encountered. * @return zero if successfull, or -1 if error is encountered.
* Upon error, the \a hlist argument MAY contain * Upon error, the \a hlist argument MAY contain
* 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,
 End of changes. 8 change blocks. 
19 lines changed or deleted 10 lines changed or added


 sip_private.h   sip_private.h 
/* $Id: sip_private.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_private.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_regc.h   sip_regc.h 
/* $Id: sip_regc.h 1561 2007-11-08 09:24:30Z bennylp $ */ /* $Id: sip_regc.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJSIP_SIP_REG_H__ #ifndef __PJSIP_SIP_REG_H__
#define __PJSIP_SIP_REG_H__ #define __PJSIP_SIP_REG_H__
/** /**
* @file sip_reg.h * @file sip_regc.h
* @brief SIP Registration Client * @brief SIP Registration Client
*/ */
#include <pjsip/sip_types.h> #include <pjsip/sip_types.h>
#include <pjsip/sip_auth.h> #include <pjsip/sip_auth.h>
#include <pjsip/sip_transport.h> #include <pjsip/sip_transport.h>
/** /**
* @defgroup PJSUA_REGC Client Registration * @defgroup PJSUA_REGC Client Registration
* @ingroup PJSIP_HIGH_UA * @ingroup PJSIP_HIGH_UA
skipping to change at line 63 skipping to change at line 63
/** Buffer to hold all contacts. */ /** Buffer to hold all contacts. */
#define PJSIP_REGC_CONTACT_BUF_SIZE 512 #define PJSIP_REGC_CONTACT_BUF_SIZE 512
/** Structure to hold parameters when calling application's callback. /** Structure to hold parameters when calling application's callback.
* The application's callback is called when the client registration proce ss * The application's callback is called when the client registration proce ss
* has finished. * has finished.
*/ */
struct pjsip_regc_cbparam struct pjsip_regc_cbparam
{ {
pjsip_regc *regc; /**< Client registration structure. */ pjsip_regc *regc; /**< Client registration structure. */
void *token; /**< Arbitrary token. void *token; /**< Arbitrary token set by application
*/ */
pj_status_t status; /**< Error status.
*/ /** Error status. If this value is non-PJ_SUCCESS, some error has occur
ed.
* Note that even when this contains PJ_SUCCESS the registration might
* have failed; in this case the \a code field will contain non
* successful (non-2xx status class) code
*/
pj_status_t 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. */
int contact_cnt;/**<Number of contacts in respo nse. */ int contact_cnt;/**<Number of contacts in respo nse. */
pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT]; /**< Contacts. */ pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT]; /**< Contacts. */
}; };
/** Type declaration for callback to receive registration result. */ /** Type declaration for callback to receive registration result. */
typedef void pjsip_regc_cb(struct pjsip_regc_cbparam *param); typedef void pjsip_regc_cb(struct pjsip_regc_cbparam *param);
skipping to change at line 286 skipping to change at line 292
* *
* @param regc The client registration structure. * @param regc The client registration structure.
* @param p_tdata Pointer to receive the REGISTER request. * @param p_tdata Pointer to receive the REGISTER request.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjsip_regc_unregister_all(pjsip_regc *regc, PJ_DECL(pj_status_t) pjsip_regc_unregister_all(pjsip_regc *regc,
pjsip_tx_data **p_tdata); pjsip_tx_data **p_tdata);
/** /**
* Update Contact details in the client registration structure. * Update Contact details in the client registration structure. For each
* contact URI, if the uri is not found in existing contact, it will be
* added to the Contact list. If the URI matches existing contact, nothing
* will be added. This function will also mark existing contacts which
* are not specified in the new contact list as to be removed, by adding
* "expires=0" parameter to these contacts.
*
* Once the contact list has been updated, application must update the
* registration by creating a new REGISTER request and send it to the
* registrar. This request will contain both old and new contacts; the
* old contacts will have it's expires parameter set to zero to instruct
* the registrar to remove the bindings.
* *
* @param regc The client registration structure. * @param regc The client registration structure.
* @param ccnt Number of contacts. * @param ccnt Number of contacts.
* @param contact Array of contacts. * @param contact Array of contact URIs.
* @return zero if sucessfull. * @return PJ_SUCCESS if sucessfull.
*/ */
PJ_DECL(pj_status_t) pjsip_regc_update_contact( pjsip_regc *regc, PJ_DECL(pj_status_t) pjsip_regc_update_contact( pjsip_regc *regc,
int ccnt, int ccnt,
const pj_str_t contact[] ); const pj_str_t contact[] );
/** /**
* Update the expires value. * Update the expires value. The next REGISTER request will contain
* new expires value for the registration.
* *
* @param regc The client registration structure. * @param regc The client registration structure.
* @param expires The new expires value. * @param expires The new expires value.
* @return zero on successfull. * @return zero on successfull.
*/ */
PJ_DECL(pj_status_t) pjsip_regc_update_expires( pjsip_regc *regc, PJ_DECL(pj_status_t) pjsip_regc_update_expires( pjsip_regc *regc,
pj_uint32_t expires ); pj_uint32_t expires );
/** /**
* Sends outgoing REGISTER request. * Sends outgoing REGISTER request.
 End of changes. 7 change blocks. 
11 lines changed or deleted 29 lines changed or added


 sip_replaces.h   sip_replaces.h 
/* $Id: sip_replaces.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_replaces.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_resolve.h   sip_resolve.h 
/* $Id: sip_resolve.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_resolve.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 211 skipping to change at line 211
* @param addr The addresses resolved by the operation. * @param addr The addresses resolved by the operation.
*/ */
typedef void pjsip_resolver_callback(pj_status_t status, typedef void pjsip_resolver_callback(pj_status_t status,
void *token, void *token,
const struct pjsip_server_addresses *ad dr); const struct pjsip_server_addresses *ad dr);
/** /**
* Create SIP resolver engine. Note that this function is normally called * Create SIP resolver engine. Note that this function is normally called
* internally by pjsip_endpoint instance. * internally by pjsip_endpoint instance.
* *
* @param pf The Pool Factory. * @param pool Pool to allocate memory from.
* @param p_res Pointer to receive SIP resolver instance. * @param p_res Pointer to receive SIP resolver instance.
* *
* @return PJ_SUCCESS when resolver can be successfully created. * @return PJ_SUCCESS when resolver can be successfully created.
*/ */
PJ_DECL(pj_status_t) pjsip_resolver_create(pj_pool_t *pool, PJ_DECL(pj_status_t) pjsip_resolver_create(pj_pool_t *pool,
pjsip_resolver_t **p_res); pjsip_resolver_t **p_res);
/** /**
* Set the DNS resolver instance of the SIP resolver engine. Before the * Set the DNS resolver instance of the SIP resolver engine. Before the
* DNS resolver is set, the SIP resolver will use standard pj_gethostbyname () * DNS resolver is set, the SIP resolver will use standard pj_gethostbyname ()
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 sip_tel_uri.h   sip_tel_uri.h 
/* $Id: sip_tel_uri.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_tel_uri.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_transaction.h   sip_transaction.h 
/* $Id: sip_transaction.h 1463 2007-09-30 16:50:27Z bennylp $ */ /* $Id: sip_transaction.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 36 skipping to change at line 36
#include <pjsip/sip_msg.h> #include <pjsip/sip_msg.h>
#include <pjsip/sip_util.h> #include <pjsip/sip_util.h>
#include <pjsip/sip_transport.h> #include <pjsip/sip_transport.h>
#include <pj/timer.h> #include <pj/timer.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJSIP_TRANSACT Transaction Layer * @defgroup PJSIP_TRANSACT Transaction Layer
* @ingroup PJSIP
* @brief Provides statefull message processing. * @brief Provides statefull message processing.
* *
* This module provides stateful processing to incoming or outgoing SIP * This module provides stateful processing to incoming or outgoing SIP
* messages. * messages.
* Before performing any stateful operations, application must register the * Before performing any stateful operations, application must register the
* transaction layer module by calling #pjsip_tsx_layer_init_module(). * transaction layer module by calling #pjsip_tsx_layer_init_module().
* *
* Application should link with <b>pjsip-core</b> library to * Application should link with <b>pjsip-core</b> library to
* use the transaction layer. * use the transaction layer.
*/ */
skipping to change at line 160 skipping to change at line 159
PJ_DECL(pjsip_module*) pjsip_tsx_layer_instance(void); PJ_DECL(pjsip_module*) pjsip_tsx_layer_instance(void);
/** /**
* Unregister and destroy transaction layer module. * Unregister and destroy transaction layer module.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjsip_tsx_layer_destroy(void); PJ_DECL(pj_status_t) pjsip_tsx_layer_destroy(void);
/** /**
* Retrieve the current number of transactions currently registered
* in the hash table.
*
* @return Number of transactions.
*/
PJ_DECL(unsigned) pjsip_tsx_layer_get_tsx_count(void);
/**
* Find a transaction with the specified key. The transaction key normally * Find a transaction with the specified key. The transaction key normally
* is created by calling #pjsip_tsx_create_key() from an incoming message. * is created by calling #pjsip_tsx_create_key() from an incoming message.
* *
* @param key The key string to find the transaction. * @param key The key string to find the transaction.
* @param lock If non-zero, transaction will be locked before the * @param lock If non-zero, transaction will be locked before the
* function returns, to make sure that it's not deleted * function returns, to make sure that it's not deleted
* by other threads. * by other threads.
* *
* @return The matching transaction instance, or NULL if transactio n * @return The matching transaction instance, or NULL if transactio n
* can not be found. * can not be found.
skipping to change at line 346 skipping to change at line 353
/* /*
* Internal. * Internal.
*/ */
/* /*
* Dump transaction layer. * Dump transaction layer.
*/ */
PJ_DECL(void) pjsip_tsx_layer_dump(pj_bool_t detail); PJ_DECL(void) pjsip_tsx_layer_dump(pj_bool_t detail);
/* /**
* Get the string name for the state. * Get the string name for the state.
* @param state State
*/ */
PJ_DECL(const char *) pjsip_tsx_state_str(pjsip_tsx_state_e state); PJ_DECL(const char *) pjsip_tsx_state_str(pjsip_tsx_state_e state);
/* /**
* Get the role name. * Get the role name.
* @param role Role.
*/ */
PJ_DECL(const char *) pjsip_role_name(pjsip_role_e role); PJ_DECL(const char *) pjsip_role_name(pjsip_role_e role);
PJ_END_DECL PJ_END_DECL
#endif /* __PJSIP_TRANSACT_H__ */ #endif /* __PJSIP_TRANSACT_H__ */
 End of changes. 8 change blocks. 
5 lines changed or deleted 14 lines changed or added


 sip_transport.h   sip_transport.h 
/* $Id: sip_transport.h 1388 2007-06-23 07:26:54Z bennylp $ */ /* $Id: sip_transport.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 134 skipping to change at line 134
* Get the transport type for the specified flags. * Get the transport type for the specified flags.
* *
* @param flag The transport flag. * @param flag The transport flag.
* *
* @return Transport type. * @return Transport type.
*/ */
PJ_DECL(pjsip_transport_type_e) PJ_DECL(pjsip_transport_type_e)
pjsip_transport_get_type_from_flag(unsigned flag); pjsip_transport_get_type_from_flag(unsigned flag);
/** /**
* Get the socket address family of a given transport type.
*
* @param type Transport type.
*
* @return Transport type.
*/
PJ_DECL(int) pjsip_transport_type_get_af(pjsip_transport_type_e type);
/**
* Get transport flag from type. * Get transport flag from type.
* *
* @param type Transport type. * @param type Transport type.
* *
* @return Transport flags. * @return Transport flags.
*/ */
PJ_DECL(unsigned) PJ_DECL(unsigned)
pjsip_transport_get_flag_from_type( pjsip_transport_type_e type ); pjsip_transport_get_flag_from_type( pjsip_transport_type_e type );
/** /**
skipping to change at line 163 skipping to change at line 172
/** /**
* Get transport type name. * Get transport type name.
* *
* @param t Transport type. * @param t Transport type.
* *
* @return Transport name. * @return Transport name.
*/ */
PJ_DECL(const char*) pjsip_transport_get_type_name(pjsip_transport_type_e t ); PJ_DECL(const char*) pjsip_transport_get_type_name(pjsip_transport_type_e t );
/**
* Get longer description for the specified transport type.
*
* @param t Transport type.
*
* @return Transport description.
*/
PJ_DECL(const char*) pjsip_transport_get_type_desc(pjsip_transport_type_e t
);
/************************************************************************** *** /************************************************************************** ***
* *
* TRANSPORT SELECTOR. * TRANSPORT SELECTOR.
* *
************************************************************************** ***/ ************************************************************************** ***/
/** /**
* This structure describes the type of data in pjsip_tpselector. * This structure describes the type of data in pjsip_tpselector.
*/ */
typedef enum pjsip_tpselector_type typedef enum pjsip_tpselector_type
skipping to change at line 300 skipping to change at line 318
/** The length of the packet received. */ /** The length of the packet received. */
pj_ssize_t len; pj_ssize_t len;
/** The source address from which the packet was received. */ /** The source address from which the packet was received. */
pj_sockaddr src_addr; pj_sockaddr src_addr;
/** The length of the source address. */ /** The length of the source address. */
int src_addr_len; int src_addr_len;
/** The IP source address string (NULL terminated). */ /** The IP source address string (NULL terminated). */
char src_name[16]; char src_name[PJ_INET6_ADDRSTRLEN];
/** The IP source port number. */ /** The IP source port number. */
int src_port; int src_port;
} pkt_info; } pkt_info;
/** /**
* msg_info is initialized by transport mgr (tpmgr) before this buffer * msg_info is initialized by transport mgr (tpmgr) before this buffer
* is passed to endpoint. * is passed to endpoint.
*/ */
skipping to change at line 467 skipping to change at line 485
/** Ioqueue asynchronous operation key. */ /** Ioqueue asynchronous operation key. */
pjsip_tx_data_op_key op_key; pjsip_tx_data_op_key op_key;
/** Lock object. */ /** Lock object. */
pj_lock_t *lock; pj_lock_t *lock;
/** The message in this buffer. */ /** The message in this buffer. */
pjsip_msg *msg; pjsip_msg *msg;
/** Strict route header saved by #pjsip_process_route_set(), to be
* restored by #pjsip_restore_strict_route_set().
*/
pjsip_route_hdr *saved_strict_route;
/** Buffer to the printed text representation of the message. When the /** Buffer to the printed text representation of the message. When the
* content of this buffer is set, then the transport will send the con tent * content of this buffer is set, then the transport will send the con tent
* of this buffer instead of re-printing the message structure. If the * of this buffer instead of re-printing the message structure. If the
* message structure has changed, then application must invalidate thi s * message structure has changed, then application must invalidate thi s
* buffer by calling #pjsip_tx_data_invalidate_msg. * buffer by calling #pjsip_tx_data_invalidate_msg.
*/ */
pjsip_buffer buf; pjsip_buffer buf;
/** Reference counter. */ /** Reference counter. */
pj_atomic_t *ref_cnt; pj_atomic_t *ref_cnt;
skipping to change at line 495 skipping to change at line 518
void (*cb)(void*, pjsip_tx_data*, pj_ssize_t); void (*cb)(void*, pjsip_tx_data*, pj_ssize_t);
/** Transport information, only valid during on_tx_request() and /** Transport information, only valid during on_tx_request() and
* on_tx_response() callback. * on_tx_response() callback.
*/ */
struct struct
{ {
pjsip_transport *transport; /**< Transport being used. */ pjsip_transport *transport; /**< Transport being used. */
pj_sockaddr dst_addr; /**< Destination address. */ pj_sockaddr dst_addr; /**< Destination address. */
int dst_addr_len; /**< Length of address. */ int dst_addr_len; /**< Length of address. */
char dst_name[16]; /**< Destination address. */ char dst_name[PJ_INET6_ADDRSTRLEN]; /**< Destination address. */
int dst_port; /**< Destination port. */ int dst_port; /**< Destination port. */
} tp_info; } tp_info;
/** /**
* Transport selector, to specify which transport to be used. * Transport selector, to specify which transport to be used.
* The value here must be set with pjsip_tx_data_set_transport(), * The value here must be set with pjsip_tx_data_set_transport(),
* to allow reference counter to be set properly. * to allow reference counter to be set properly.
*/ */
pjsip_tpselector tp_sel; pjsip_tpselector tp_sel;
skipping to change at line 880 skipping to change at line 903
* @return PJ_SUCCESS is sucessfully unregistered. * @return PJ_SUCCESS is sucessfully unregistered.
*/ */
PJ_DECL(pj_status_t) pjsip_tpmgr_unregister_tpfactory(pjsip_tpmgr *mgr, PJ_DECL(pj_status_t) pjsip_tpmgr_unregister_tpfactory(pjsip_tpmgr *mgr,
pjsip_tpfactory *tpf); pjsip_tpfactory *tpf);
/************************************************************************** *** /************************************************************************** ***
* *
* TRANSPORT MANAGER * TRANSPORT MANAGER
* *
************************************************************************** ***/ ************************************************************************** ***/
typedef void (*pjsip_rx_callback)(pjsip_endpoint*, pj_status_t, pjsip_rx_da
ta *); /**
typedef pj_status_t (*pjsip_tx_callback)(pjsip_endpoint*, pjsip_tx_data*); * Type of callback to be called when transport manager receives incoming
* SIP message.
*
* @param ep Endpoint.
* @param status Receiption status.
* @param rd Received packet.
*/
typedef void (*pjsip_rx_callback)(pjsip_endpoint *ep, pj_status_t status,
pjsip_rx_data *rd);
/**
* Type of callback to be called before transport manager is about
* to transmit SIP message.
*
* @param ep Endpoint.
* @param td Transmit data.
*/
typedef pj_status_t (*pjsip_tx_callback)(pjsip_endpoint *ep, pjsip_tx_data*
td);
/** /**
* Create a transport manager. Normally application doesn't need to call * Create a transport manager. Normally application doesn't need to call
* this function directly, since a transport manager will be created and * this function directly, since a transport manager will be created and
* destroyed automatically by the SIP endpoint. * destroyed automatically by the SIP endpoint.
* *
* @param pool Pool. * @param pool Pool.
* @param endpt Endpoint instance. * @param endpt Endpoint instance.
* @param rx_cb Callback to receive incoming message. * @param rx_cb Callback to receive incoming message.
* @param tx_cb Callback to be called before transport manager i s sending * @param tx_cb Callback to be called before transport manager i s sending
* outgoing message. * outgoing message.
 End of changes. 8 change blocks. 
7 lines changed or deleted 50 lines changed or added


 sip_transport_loop.h   sip_transport_loop.h 
/* $Id: sip_transport_loop.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_transport_loop.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_transport_tcp.h   sip_transport_tcp.h 
/* $Id: sip_transport_tcp.h 1159 2007-04-06 10:29:20Z bennylp $ */ /* $Id: sip_transport_tcp.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_transport_tls.h   sip_transport_tls.h 
/* $Id: sip_transport_tls.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_transport_tls.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 41 skipping to change at line 41
/** /**
* @defgroup PJSIP_TRANSPORT_TLS TLS Transport * @defgroup PJSIP_TRANSPORT_TLS TLS Transport
* @ingroup PJSIP_TRANSPORT * @ingroup PJSIP_TRANSPORT
* @brief API to create and register TLS transport. * @brief API to create and register TLS transport.
* @{ * @{
* The functions below are used to create TLS transport and register * The functions below are used to create TLS transport and register
* the transport to the framework. * the transport to the framework.
*/ */
/**
* The default SSL method to be used by PJSIP.
* Default is PJSIP_TLSV1_METHOD
*/
#ifndef PJSIP_SSL_DEFAULT_METHOD
# define PJSIP_SSL_DEFAULT_METHOD PJSIP_TLSV1_METHOD
#endif
/** SSL protocol method constants. */ /** SSL protocol method constants. */
typedef enum pjsip_ssl_method typedef enum pjsip_ssl_method
{ {
PJSIP_SSL_DEFAULT_METHOD = 0, /**< Default protocol method. */ PJSIP_SSL_UNSPECIFIED_METHOD= 0, /**< Default protocol method. */
PJSIP_TLSV1_METHOD = 1, /**< Use SSLv1 method. */ PJSIP_TLSV1_METHOD = 31, /**< Use SSLv1 method. */
PJSIP_SSLV2_METHOD = 2, /**< Use SSLv2 method. */ PJSIP_SSLV2_METHOD = 20, /**< Use SSLv2 method. */
PJSIP_SSLV3_METHOD = 3, /**< Use SSLv3 method. */ PJSIP_SSLV3_METHOD = 30, /**< Use SSLv3 method. */
PJSIP_SSLV23_METHOD = 23 /**< Use SSLv23 method. */ PJSIP_SSLV23_METHOD = 23 /**< Use SSLv23 method. */
} pjsip_ssl_method; } pjsip_ssl_method;
/** /**
* TLS transport settings. * TLS transport settings.
*/ */
typedef struct pjsip_tls_setting typedef struct pjsip_tls_setting
{ {
/** /**
* Certificate of Authority (CA) list file. * Certificate of Authority (CA) list file.
skipping to change at line 80 skipping to change at line 88
*/ */
pj_str_t privkey_file; pj_str_t privkey_file;
/** /**
* Password to open private key. * Password to open private key.
*/ */
pj_str_t password; pj_str_t password;
/** /**
* TLS protocol method from #pjsip_ssl_method, which can be: * TLS protocol method from #pjsip_ssl_method, which can be:
* - PJSIP_SSL_DEFAULT_METHOD(0): default (which will use SSLv23) * - PJSIP_SSL_UNSPECIFIED_METHOD(0): default (which will use
* - PJSIP_TLSV1_METHOD(1): TLSv1 * PJSIP_SSL_DEFAULT_METHOD)
* - PJSIP_SSLV2_METHOD(2): TLSv2 * - PJSIP_TLSV1_METHOD(1): TLSv1
* - PJSIP_SSLV3_METHOD(3): TLSv3 * - PJSIP_SSLV2_METHOD(2): SSLv2
* - PJSIP_SSLV23_METHOD(23): TLSv23 * - PJSIP_SSLV3_METHOD(3): SSL3
* - PJSIP_SSLV23_METHOD(23): SSL23
* *
* Default is PJSIP_SSL_DEFAULT_METHOD (0), which will use SSLv23 * Default is PJSIP_SSL_UNSPECIFIED_METHOD (0), which in turn will
* protocol method. * use PJSIP_SSL_DEFAULT_METHOD, which default value is
* PJSIP_TLSV1_METHOD.
*/ */
int method; int method;
/** /**
* TLS cipher list string in OpenSSL format. If empty, then default * TLS cipher list string in OpenSSL format. If empty, then default
* cipher list of the backend will be used. * cipher list of the backend will be used.
*/ */
pj_str_t ciphers; pj_str_t ciphers;
/** /**
 End of changes. 6 change blocks. 
13 lines changed or deleted 23 lines changed or added


 sip_transport_udp.h   sip_transport_udp.h 
/* $Id: sip_transport_udp.h 1382 2007-06-22 11:32:49Z bennylp $ */ /* $Id: sip_transport_udp.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 84 skipping to change at line 84
* started and registered to transport manager, or * started and registered to transport manager, or
* the appropriate error code. * the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pjsip_udp_transport_start(pjsip_endpoint *endpt, PJ_DECL(pj_status_t) pjsip_udp_transport_start(pjsip_endpoint *endpt,
const pj_sockaddr_in *local, const pj_sockaddr_in *local,
const pjsip_host_port *a_name , const pjsip_host_port *a_name ,
unsigned async_cnt, unsigned async_cnt,
pjsip_transport **p_transport ); pjsip_transport **p_transport );
/** /**
* Attach UDP socket as a new transport and start the transport. * Start IPv6 UDP transport.
*/
PJ_DECL(pj_status_t) pjsip_udp_transport_start6(pjsip_endpoint *endpt,
const pj_sockaddr_in6 *local
,
const pjsip_host_port *a_nam
e,
unsigned async_cnt,
pjsip_transport **p_transpor
t);
/**
* Attach IPv4 UDP socket as a new transport and start the transport.
* *
* @param endpt The SIP endpoint. * @param endpt The SIP endpoint.
* @param sock UDP socket to use. * @param sock UDP socket to use.
* @param a_name Published address (only the host and port portion is * @param a_name Published address (only the host and port portion is
* used). * used).
* @param async_cnt Number of simultaneous async operations. * @param async_cnt Number of simultaneous async operations.
* @param p_transport Pointer to receive the transport. * @param p_transport Pointer to receive the transport.
* *
* @return PJ_SUCCESS when the transport has been successfully * @return PJ_SUCCESS when the transport has been successfully
* started and registered to transport manager, or * started and registered to transport manager, or
* the appropriate error code. * the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pjsip_udp_transport_attach(pjsip_endpoint *endpt, PJ_DECL(pj_status_t) pjsip_udp_transport_attach(pjsip_endpoint *endpt,
pj_sock_t sock, pj_sock_t sock,
const pjsip_host_port *a_nam e, const pjsip_host_port *a_nam e,
unsigned async_cnt, unsigned async_cnt,
pjsip_transport **p_transpor t); pjsip_transport **p_transpor t);
/** /**
* Attach IPv4 or IPv6 UDP socket as a new transport and start the transpor
t.
*
* @param endpt The SIP endpoint.
* @param type Transport type, which is PJSIP_TRANSPORT_UDP for IPv
4
* or PJSIP_TRANSPORT_UDP6 for IPv6 socket.
* @param sock UDP socket to use.
* @param a_name Published address (only the host and port portion is
* used).
* @param async_cnt Number of simultaneous async operations.
* @param p_transport Pointer to receive the transport.
*
* @return PJ_SUCCESS when the transport has been successfully
* started and registered to transport manager, or
* the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_udp_transport_attach2(pjsip_endpoint *endpt,
pjsip_transport_type_e type
,
pj_sock_t sock,
const pjsip_host_port *a_na
me,
unsigned async_cnt,
pjsip_transport **p_transpo
rt);
/**
* Retrieve the internal socket handle used by the UDP transport. Note * Retrieve the internal socket handle used by the UDP transport. Note
* that this socket normally is registered to ioqueue, so if application * that this socket normally is registered to ioqueue, so if application
* wants to make use of this socket, it should temporarily pause the * wants to make use of this socket, it should temporarily pause the
* transport. * transport.
* *
* @param transport The UDP transport. * @param transport The UDP transport.
* *
* @return The socket handle, or PJ_INVALID_SOCKET if no socket * @return The socket handle, or PJ_INVALID_SOCKET if no socket
* is currently being used (for example, when transport * is currently being used (for example, when transport
* is being paused). * is being paused).
 End of changes. 4 change blocks. 
3 lines changed or deleted 43 lines changed or added


 sip_types.h   sip_types.h 
/* $Id: sip_types.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_types.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 82 skipping to change at line 82
/** SCTP. */ /** SCTP. */
PJSIP_TRANSPORT_SCTP, PJSIP_TRANSPORT_SCTP,
/** Loopback (stream, reliable) */ /** Loopback (stream, reliable) */
PJSIP_TRANSPORT_LOOP, PJSIP_TRANSPORT_LOOP,
/** Loopback (datagram, unreliable) */ /** Loopback (datagram, unreliable) */
PJSIP_TRANSPORT_LOOP_DGRAM, PJSIP_TRANSPORT_LOOP_DGRAM,
/** Start of user defined transport */ /** Start of user defined transport */
PJSIP_TRANSPORT_START_OTHER PJSIP_TRANSPORT_START_OTHER,
/** Start of IPv6 transports */
PJSIP_TRANSPORT_IPV6 = 128,
/** UDP over IPv6 */
PJSIP_TRANSPORT_UDP6 = PJSIP_TRANSPORT_UDP + PJSIP_TRANSPORT_IPV6,
/** TCP over IPv6 */
PJSIP_TRANSPORT_TCP6 = PJSIP_TRANSPORT_TCP + PJSIP_TRANSPORT_IPV6
} pjsip_transport_type_e; } pjsip_transport_type_e;
/** /**
* Forward declaration for endpoint (sip_endpoint.h). * Forward declaration for endpoint (sip_endpoint.h).
*/ */
typedef struct pjsip_endpoint pjsip_endpoint; typedef struct pjsip_endpoint pjsip_endpoint;
/** /**
* Forward declaration for transactions (sip_transaction.h). * Forward declaration for transactions (sip_transaction.h).
 End of changes. 3 change blocks. 
3 lines changed or deleted 12 lines changed or added


 sip_ua_layer.h   sip_ua_layer.h 
/* $Id: sip_ua_layer.h 1417 2007-08-16 10:11:44Z bennylp $ */ /* $Id: sip_ua_layer.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 32 skipping to change at line 32
/** /**
* @file sip_ua_layer.h * @file sip_ua_layer.h
* @brief SIP User Agent Layer Module * @brief SIP User Agent Layer Module
*/ */
#include <pjsip/sip_types.h> #include <pjsip/sip_types.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJSIP_UA Base User Agent Layer/Common Dialog Layer * @defgroup PJSIP_UA Base User Agent Layer/Common Dialog Layer
* @ingroup PJSIP
* @brief Dialog management. * @brief Dialog management.
* *
* This module provides basic dialog management, which is used by higher * This module provides basic dialog management, which is used by higher
* layer dialog usages such as INVITE sessions and SIP Event Subscription * layer dialog usages such as INVITE sessions and SIP Event Subscription
* framework (RFC 3265). Application should link with <b>pjsip-core</b> * framework (RFC 3265). Application should link with <b>pjsip-core</b>
* library to use this base UA layer. The base UA layer module is initializ ed * library to use this base UA layer. The base UA layer module is initializ ed
* with #pjsip_ua_init_module(). * with #pjsip_ua_init_module().
*/ */
/** /**
skipping to change at line 82 skipping to change at line 81
const pjsip_ua_init_param *prm); const pjsip_ua_init_param *prm);
/** /**
* Get the instance of the user agent. * Get the instance of the user agent.
* *
* @return The user agent module instance. * @return The user agent module instance.
*/ */
PJ_DECL(pjsip_user_agent*) pjsip_ua_instance(void); PJ_DECL(pjsip_user_agent*) pjsip_ua_instance(void);
/** /**
* Retrieve the current number of dialog-set currently registered
* in the hash table. Note that dialog-set is different than dialog
* when the request forks. In this case, all dialogs created from
* the original request will belong to the same dialog set. When
* no forking occurs, the number of dialog sets will be equal to
* the number of dialogs.
*
* @return Number of dialog sets.
*/
PJ_DECL(pj_uint32_t) pjsip_ua_get_dlg_set_count(void);
/**
* Find a dialog with the specified Call-ID and tags properties. This * Find a dialog with the specified Call-ID and tags properties. This
* function may optionally lock the matching dialog instance before * function may optionally lock the matching dialog instance before
* returning it back to the caller. * returning it back to the caller.
* *
* @param call_id The call ID to be matched. * @param call_id The call ID to be matched.
* @param local_tag The local tag to be matched. * @param local_tag The local tag to be matched.
* @param remote_tag The remote tag to be matched. * @param remote_tag The remote tag to be matched.
* @param lock_dialog If non-zero, instruct the function to lock the * @param lock_dialog If non-zero, instruct the function to lock the
* matching dialog with #pjsip_dlg_inc_lock(). * matching dialog with #pjsip_dlg_inc_lock().
* Application is responsible to release the dialog's * Application is responsible to release the dialog's
 End of changes. 4 change blocks. 
3 lines changed or deleted 14 lines changed or added


 sip_uri.h   sip_uri.h 
/* $Id: sip_uri.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_uri.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_util.h   sip_util.h 
/* $Id: sip_util.h 1388 2007-06-23 07:26:54Z bennylp $ */ /* $Id: sip_util.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 221 skipping to change at line 221
* described in RFC 3263. * described in RFC 3263.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_SUCCESS, or the appropriate error code.
* *
* @see pjsip_get_request_addr * @see pjsip_get_request_addr
*/ */
PJ_DECL(pj_status_t) pjsip_process_route_set(pjsip_tx_data *tdata, PJ_DECL(pj_status_t) pjsip_process_route_set(pjsip_tx_data *tdata,
pjsip_host_info *dest_info ); pjsip_host_info *dest_info );
/** /**
* Swap the request URI and strict route back to the original position
* before #pjsip_process_route_set() function is called. If no strict
* route URI was found by #pjsip_process_route_set(), this function will
* do nothing.
*
* This function should only used internally by PJSIP client authentication
* module.
*
* @param tdata Transmit data containing request message.
*/
PJ_DECL(void) pjsip_restore_strict_route_set(pjsip_tx_data *tdata);
/**
* This structure holds the state of outgoing stateless request. * This structure holds the state of outgoing stateless request.
*/ */
typedef struct pjsip_send_state typedef struct pjsip_send_state
{ {
/** Application token, which was specified when the function /** Application token, which was specified when the function
* #pjsip_endpt_send_request_stateless() is called. * #pjsip_endpt_send_request_stateless() is called.
*/ */
void *token; void *token;
/** Endpoint instance. /** Endpoint instance.
skipping to change at line 258 skipping to change at line 271
pjsip_transport *cur_transport; pjsip_transport *cur_transport;
/** The application callback which was specified when the function /** The application callback which was specified when the function
* #pjsip_endpt_send_request_stateless() was called. * #pjsip_endpt_send_request_stateless() was called.
*/ */
void (*app_cb)(struct pjsip_send_state*, void (*app_cb)(struct pjsip_send_state*,
pj_ssize_t sent, pj_ssize_t sent,
pj_bool_t *cont); pj_bool_t *cont);
} pjsip_send_state; } pjsip_send_state;
typedef void (*pjsip_send_callback)(pjsip_send_state*, pj_ssize_t sent, /**
* Declaration for callback function to be specified in
* #pjsip_endpt_send_request_stateless(), #pjsip_endpt_send_response(), or
* #pjsip_endpt_send_response2().
*
* @param st Structure to keep transmission state.
* @param sent Number of bytes sent.
* @param cont When current transmission fails, specify whether
* the function should fallback to next destination.
*/
typedef void (*pjsip_send_callback)(pjsip_send_state *st, pj_ssize_t sent,
pj_bool_t *cont); pj_bool_t *cont);
/** /**
* Send outgoing request statelessly The function will take care of which * Send outgoing request statelessly The function will take care of which
* destination and transport to use based on the information in the message , * destination and transport to use based on the information in the message ,
* taking care of URI in the request line and Route header. * taking care of URI in the request line and Route header.
* *
* This function is different than #pjsip_transport_send() in that this * This function is different than #pjsip_transport_send() in that this
* function adds/modify the Via header as necessary. * function adds/modify the Via header as necessary.
* *
skipping to change at line 516 skipping to change at line 539
*/ */
PJ_DECL(pj_status_t) pjsip_endpt_respond( pjsip_endpoint *endpt, PJ_DECL(pj_status_t) pjsip_endpt_respond( pjsip_endpoint *endpt,
pjsip_module *tsx_user, pjsip_module *tsx_user,
pjsip_rx_data *rdata, pjsip_rx_data *rdata,
int st_code, int st_code,
const pj_str_t *st_text, const pj_str_t *st_text,
const pjsip_hdr *hdr_list, const pjsip_hdr *hdr_list,
const pjsip_msg_body *body, const pjsip_msg_body *body,
pjsip_transaction **p_tsx ); pjsip_transaction **p_tsx );
typedef void (*pjsip_endpt_send_callback)(void*, pjsip_event*); /**
* Type of callback to be specified in #pjsip_endpt_send_request().
*
* @param token The token that was given in #pjsip_endpt_send_re
quest()
* @param e Completion event.
*/
typedef void (*pjsip_endpt_send_callback)(void *token, pjsip_event *e);
/** /**
* Send outgoing request and initiate UAC transaction for the request. * Send outgoing request and initiate UAC transaction for the request.
* This is an auxiliary function to be used by application to send arbitrar y * This is an auxiliary function to be used by application to send arbitrar y
* requests outside a dialog. To send a request within a dialog, applicatio n * requests outside a dialog. To send a request within a dialog, applicatio n
* should use #pjsip_dlg_send_request instead. * should use #pjsip_dlg_send_request instead.
* *
* @param endpt The endpoint instance. * @param endpt The endpoint instance.
* @param tdata The transmit data to be sent. * @param tdata The transmit data to be sent.
* @param timeout Optional timeout for final response to be received, or -1 * @param timeout Optional timeout for final response to be received, or -1
* if the transaction should not have a timeout restriction . * if the transaction should not have a timeout restriction .
skipping to change at line 549 skipping to change at line 579
pj_int32_t timeout, pj_int32_t timeout,
void *token, void *token,
pjsip_endpt_send_callback cb) ; pjsip_endpt_send_callback cb) ;
/** /**
* @} * @}
*/ */
/** /**
* @defgroup PJSIP_PROXY_CORE Core Proxy Layer * @defgroup PJSIP_PROXY_CORE Core Proxy Layer
* @ingroup PJSIP
* @brief Core proxy operations * @brief Core proxy operations
* @{ * @{
*/ */
/** /**
* Create new request message to be forwarded upstream to new destination U RI * Create new request message to be forwarded upstream to new destination U RI
* in uri. The new request is a full/deep clone of the request received in * in uri. The new request is a full/deep clone of the request received in
* rdata, unless if other copy mechanism is specified in the options. * rdata, unless if other copy mechanism is specified in the options.
* The branch parameter, if not NULL, will be used as the branch-param in * The branch parameter, if not NULL, will be used as the branch-param in
* the Via header. If it is NULL, then a unique branch parameter will be us ed. * the Via header. If it is NULL, then a unique branch parameter will be us ed.
 End of changes. 6 change blocks. 
5 lines changed or deleted 35 lines changed or added


 sip_xfer.h   sip_xfer.h 
/* $Id: sip_xfer.h 1417 2007-08-16 10:11:44Z bennylp $ */ /* $Id: sip_xfer.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 size_t.h   size_t.h 
/* $Id: size_t.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: size_t.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sock.h   sock.h 
/* $Id: sock.h 1410 2007-07-28 02:44:55Z bennylp $ */ /* $Id: sock.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 61 skipping to change at line 61
* - \ref page_pjlib_select_test * - \ref page_pjlib_select_test
* - \ref page_pjlib_sock_perf_test * - \ref page_pjlib_sock_perf_test
*/ */
/** /**
* Supported address families. * Supported address families.
* APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL AF_*, BECAUSE * APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL AF_*, BECAUSE
* THE LIBRARY WILL DO TRANSLATION TO THE NATIVE VALUE. * THE LIBRARY WILL DO TRANSLATION TO THE NATIVE VALUE.
*/ */
/** Address family is unspecified. @see pj_AF_UNSPEC() */
extern const pj_uint16_t PJ_AF_UNSPEC;
/** Unix domain socket. @see pj_AF_UNIX() */ /** Unix domain socket. @see pj_AF_UNIX() */
extern const pj_uint16_t PJ_AF_UNIX; extern const pj_uint16_t PJ_AF_UNIX;
/** POSIX name for AF_UNIX */ /** POSIX name for AF_UNIX */
#define PJ_AF_LOCAL PJ_AF_UNIX; #define PJ_AF_LOCAL PJ_AF_UNIX;
/** Internet IP protocol. @see pj_AF_INET() */ /** Internet IP protocol. @see pj_AF_INET() */
extern const pj_uint16_t PJ_AF_INET; extern const pj_uint16_t PJ_AF_INET;
/** IP version 6. @see pj_AF_INET6() */ /** IP version 6. @see pj_AF_INET6() */
skipping to change at line 85 skipping to change at line 88
/** IRDA sockets. @see pj_AF_IRDA() */ /** IRDA sockets. @see pj_AF_IRDA() */
extern const pj_uint16_t PJ_AF_IRDA; extern const pj_uint16_t PJ_AF_IRDA;
/* /*
* Accessor functions for various address family constants. These * Accessor functions for various address family constants. These
* functions are provided because Symbian doesn't allow exporting * functions are provided because Symbian doesn't allow exporting
* global variables from a DLL. * global variables from a DLL.
*/ */
/** Get #PJ_AF_UNIX value. */ #if defined(PJ_DLL)
PJ_DECL(pj_uint16_t) pj_AF_UNIX(void); /** Get #PJ_AF_UNSPEC value */
/** Get #PJ_AF_INET value. */ PJ_DECL(pj_uint16_t) pj_AF_UNSPEC(void);
PJ_DECL(pj_uint16_t) pj_AF_INET(void); /** Get #PJ_AF_UNIX value. */
/** Get #PJ_AF_INET6 value. */ PJ_DECL(pj_uint16_t) pj_AF_UNIX(void);
PJ_DECL(pj_uint16_t) pj_AF_INET6(void); /** Get #PJ_AF_INET value. */
/** Get #PJ_AF_PACKET value. */ PJ_DECL(pj_uint16_t) pj_AF_INET(void);
PJ_DECL(pj_uint16_t) pj_AF_PACKET(void); /** Get #PJ_AF_INET6 value. */
/** Get #PJ_AF_IRDA value. */ PJ_DECL(pj_uint16_t) pj_AF_INET6(void);
PJ_DECL(pj_uint16_t) pj_AF_IRDA(void); /** Get #PJ_AF_PACKET value. */
PJ_DECL(pj_uint16_t) pj_AF_PACKET(void);
/** Get #PJ_AF_IRDA value. */
PJ_DECL(pj_uint16_t) pj_AF_IRDA(void);
#else
/* When pjlib is not built as DLL, these accessor functions are
* simply a macro to get their constants
*/
/** Get #PJ_AF_UNSPEC value */
# define pj_AF_UNSPEC() PJ_AF_UNSPEC
/** Get #PJ_AF_UNIX value. */
# define pj_AF_UNIX() PJ_AF_UNIX
/** Get #PJ_AF_INET value. */
# define pj_AF_INET() PJ_AF_INET
/** Get #PJ_AF_INET6 value. */
# define pj_AF_INET6() PJ_AF_INET6
/** Get #PJ_AF_PACKET value. */
# define pj_AF_PACKET() PJ_AF_PACKET
/** Get #PJ_AF_IRDA value. */
# define pj_AF_IRDA() PJ_AF_IRDA
#endif
/** /**
* Supported types of sockets. * Supported types of sockets.
* APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL SOCK_*, BECAUSE * APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL SOCK_*, BECAUSE
* THE LIBRARY WILL TRANSLATE THE VALUE TO THE NATIVE VALUE. * THE LIBRARY WILL TRANSLATE THE VALUE TO THE NATIVE VALUE.
*/ */
/** Sequenced, reliable, connection-based byte streams. /** Sequenced, reliable, connection-based byte streams.
* @see pj_SOCK_STREAM() */ * @see pj_SOCK_STREAM() */
extern const pj_uint16_t PJ_SOCK_STREAM; extern const pj_uint16_t PJ_SOCK_STREAM;
skipping to change at line 121 skipping to change at line 144
extern const pj_uint16_t PJ_SOCK_RAW; extern const pj_uint16_t PJ_SOCK_RAW;
/** Reliably-delivered messages. @see pj_SOCK_RDM() */ /** Reliably-delivered messages. @see pj_SOCK_RDM() */
extern const pj_uint16_t PJ_SOCK_RDM; extern const pj_uint16_t PJ_SOCK_RDM;
/* /*
* Accessor functions for various constants. These functions are provided * Accessor functions for various constants. These functions are provided
* because Symbian doesn't allow exporting global variables from a DLL. * because Symbian doesn't allow exporting global variables from a DLL.
*/ */
/** Get #PJ_SOCK_STREAM constant */ #if defined(PJ_DLL)
PJ_DECL(int) pj_SOCK_STREAM(void); /** Get #PJ_SOCK_STREAM constant */
/** Get #PJ_SOCK_DGRAM constant */ PJ_DECL(int) pj_SOCK_STREAM(void);
PJ_DECL(int) pj_SOCK_DGRAM(void); /** Get #PJ_SOCK_DGRAM constant */
/** Get #PJ_SOCK_RAW constant */ PJ_DECL(int) pj_SOCK_DGRAM(void);
PJ_DECL(int) pj_SOCK_RAW(void); /** Get #PJ_SOCK_RAW constant */
/** Get #PJ_SOCK_RDM constant */ PJ_DECL(int) pj_SOCK_RAW(void);
PJ_DECL(int) pj_SOCK_RDM(void); /** Get #PJ_SOCK_RDM constant */
PJ_DECL(int) pj_SOCK_RDM(void);
#else
/** Get #PJ_SOCK_STREAM constant */
# define pj_SOCK_STREAM() PJ_SOCK_STREAM
/** Get #PJ_SOCK_DGRAM constant */
# define pj_SOCK_DGRAM() PJ_SOCK_DGRAM
/** Get #PJ_SOCK_RAW constant */
# define pj_SOCK_RAW() PJ_SOCK_RAW
/** Get #PJ_SOCK_RDM constant */
# define pj_SOCK_RDM() PJ_SOCK_RDM
#endif
/** /**
* Socket level specified in #pj_sock_setsockopt() or #pj_sock_getsockopt() . * Socket level specified in #pj_sock_setsockopt() or #pj_sock_getsockopt() .
* APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL SOL_*, BECAUSE * APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL SOL_*, BECAUSE
* THE LIBRARY WILL TRANSLATE THE VALUE TO THE NATIVE VALUE. * THE LIBRARY WILL TRANSLATE THE VALUE TO THE NATIVE VALUE.
*/ */
/** Socket level. @see pj_SOL_SOCKET() */ /** Socket level. @see pj_SOL_SOCKET() */
extern const pj_uint16_t PJ_SOL_SOCKET; extern const pj_uint16_t PJ_SOL_SOCKET;
/** IP level. @see pj_SOL_IP() */ /** IP level. @see pj_SOL_IP() */
extern const pj_uint16_t PJ_SOL_IP; extern const pj_uint16_t PJ_SOL_IP;
skipping to change at line 151 skipping to change at line 185
/** UDP level. @see pj_SOL_UDP() */ /** UDP level. @see pj_SOL_UDP() */
extern const pj_uint16_t PJ_SOL_UDP; extern const pj_uint16_t PJ_SOL_UDP;
/** IP version 6. @see pj_SOL_IPV6() */ /** IP version 6. @see pj_SOL_IPV6() */
extern const pj_uint16_t PJ_SOL_IPV6; extern const pj_uint16_t PJ_SOL_IPV6;
/* /*
* Accessor functions for various constants. These functions are provided * Accessor functions for various constants. These functions are provided
* because Symbian doesn't allow exporting global variables from a DLL. * because Symbian doesn't allow exporting global variables from a DLL.
*/ */
/** Get #PJ_SOL_SOCKET constant */ #if defined(PJ_DLL)
PJ_DECL(pj_uint16_t) pj_SOL_SOCKET(void); /** Get #PJ_SOL_SOCKET constant */
/** Get #PJ_SOL_IP constant */ PJ_DECL(pj_uint16_t) pj_SOL_SOCKET(void);
PJ_DECL(pj_uint16_t) pj_SOL_IP(void); /** Get #PJ_SOL_IP constant */
/** Get #PJ_SOL_TCP constant */ PJ_DECL(pj_uint16_t) pj_SOL_IP(void);
PJ_DECL(pj_uint16_t) pj_SOL_TCP(void); /** Get #PJ_SOL_TCP constant */
/** Get #PJ_SOL_UDP constant */ PJ_DECL(pj_uint16_t) pj_SOL_TCP(void);
PJ_DECL(pj_uint16_t) pj_SOL_UDP(void); /** Get #PJ_SOL_UDP constant */
/** Get #PJ_SOL_IPV6 constant */ PJ_DECL(pj_uint16_t) pj_SOL_UDP(void);
PJ_DECL(pj_uint16_t) pj_SOL_IPV6(void); /** Get #PJ_SOL_IPV6 constant */
PJ_DECL(pj_uint16_t) pj_SOL_IPV6(void);
#else
/** Get #PJ_SOL_SOCKET constant */
# define pj_SOL_SOCKET() PJ_SOL_SOCKET
/** Get #PJ_SOL_IP constant */
# define pj_SOL_IP() PJ_SOL_IP
/** Get #PJ_SOL_TCP constant */
# define pj_SOL_TCP() PJ_SOL_TCP
/** Get #PJ_SOL_UDP constant */
# define pj_SOL_UDP() PJ_SOL_UDP
/** Get #PJ_SOL_IPV6 constant */
# define pj_SOL_IPV6() PJ_SOL_IPV6
#endif
/* IP_TOS /* IP_TOS
* *
* Note: * Note:
* TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above! * TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above!
* See http://support.microsoft.com/kb/248611 * See http://support.microsoft.com/kb/248611
*/ */
/** IP_TOS optname in setsockopt(). @see pj_IP_TOS() */ /** IP_TOS optname in setsockopt(). @see pj_IP_TOS() */
extern const pj_uint16_t PJ_IP_TOS; extern const pj_uint16_t PJ_IP_TOS;
/** Get #PJ_IP_TOS constant */
PJ_DECL(int) pj_IP_TOS(void);
/* /*
* IP TOS related constats. * IP TOS related constats.
* *
* Note: * Note:
* TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above! * TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above!
* See http://support.microsoft.com/kb/248611 * See http://support.microsoft.com/kb/248611
*/ */
/** Minimize delays. @see pj_IPTOS_LOWDELAY() */ /** Minimize delays. @see pj_IPTOS_LOWDELAY() */
extern const pj_uint16_t PJ_IPTOS_LOWDELAY; extern const pj_uint16_t PJ_IPTOS_LOWDELAY;
/** Optimize throughput. @see pj_IPTOS_THROUGHPUT() */ /** Optimize throughput. @see pj_IPTOS_THROUGHPUT() */
extern const pj_uint16_t PJ_IPTOS_THROUGHPUT; extern const pj_uint16_t PJ_IPTOS_THROUGHPUT;
/** Optimize for reliability. @see pj_IPTOS_RELIABILITY() */ /** Optimize for reliability. @see pj_IPTOS_RELIABILITY() */
extern const pj_uint16_t PJ_IPTOS_RELIABILITY; extern const pj_uint16_t PJ_IPTOS_RELIABILITY;
/** "filler data" where slow transmission does't matter. /** "filler data" where slow transmission does't matter.
* @see pj_IPTOS_MINCOST() */ * @see pj_IPTOS_MINCOST() */
extern const pj_uint16_t PJ_IPTOS_MINCOST; extern const pj_uint16_t PJ_IPTOS_MINCOST;
/** Get #PJ_IPTOS_LOWDELAY constant */ #if defined(PJ_DLL)
PJ_DECL(int) pj_IPTOS_LOWDELAY(void); /** Get #PJ_IP_TOS constant */
PJ_DECL(int) pj_IP_TOS(void);
/** Get #PJ_IPTOS_LOWDELAY constant */
PJ_DECL(int) pj_IPTOS_LOWDELAY(void);
/** Get #PJ_IPTOS_THROUGHPUT constant */ /** Get #PJ_IPTOS_THROUGHPUT constant */
PJ_DECL(int) pj_IPTOS_THROUGHPUT(void); PJ_DECL(int) pj_IPTOS_THROUGHPUT(void);
/** Get #PJ_IPTOS_RELIABILITY constant */ /** Get #PJ_IPTOS_RELIABILITY constant */
PJ_DECL(int) pj_IPTOS_RELIABILITY(void); PJ_DECL(int) pj_IPTOS_RELIABILITY(void);
/** Get #PJ_IPTOS_MINCOST constant */ /** Get #PJ_IPTOS_MINCOST constant */
PJ_DECL(int) pj_IPTOS_MINCOST(void); PJ_DECL(int) pj_IPTOS_MINCOST(void);
#else
/** Get #PJ_IP_TOS constant */
# define pj_IP_TOS() PJ_IP_TOS
/** Get #PJ_IPTOS_LOWDELAY constant */
# define pj_IPTOS_LOWDELAY() PJ_IP_TOS_LOWDELAY
/** Get #PJ_IPTOS_THROUGHPUT constant */
# define pj_IPTOS_THROUGHPUT() PJ_IP_TOS_THROUGHPUT
/** Get #PJ_IPTOS_RELIABILITY constant */
# define pj_IPTOS_RELIABILITY() PJ_IP_TOS_RELIABILITY
/** Get #PJ_IPTOS_MINCOST constant */
# define pj_IPTOS_MINCOST() PJ_IP_TOS_MINCOST
#endif
/** /**
* Values to be specified as \c optname when calling #pj_sock_setsockopt() * Values to be specified as \c optname when calling #pj_sock_setsockopt()
* or #pj_sock_getsockopt(). * or #pj_sock_getsockopt().
*/ */
/** Socket type. @see pj_SO_TYPE() */ /** Socket type. @see pj_SO_TYPE() */
extern const pj_uint16_t PJ_SO_TYPE; extern const pj_uint16_t PJ_SO_TYPE;
/** Buffer size for receive. @see pj_SO_RCVBUF() */ /** Buffer size for receive. @see pj_SO_RCVBUF() */
extern const pj_uint16_t PJ_SO_RCVBUF; extern const pj_uint16_t PJ_SO_RCVBUF;
/** Buffer size for send. @see pj_SO_SNDBUF() */ /** Buffer size for send. @see pj_SO_SNDBUF() */
extern const pj_uint16_t PJ_SO_SNDBUF; extern const pj_uint16_t PJ_SO_SNDBUF;
/** Get #PJ_SO_TYPE constant */ #if defined(PJ_DLL)
PJ_DECL(pj_uint16_t) pj_SO_TYPE(void); /** Get #PJ_SO_TYPE constant */
PJ_DECL(pj_uint16_t) pj_SO_TYPE(void);
/** Get #PJ_SO_RCVBUF constant */
PJ_DECL(pj_uint16_t) pj_SO_RCVBUF(void);
/** Get #PJ_SO_SNDBUF constant */
PJ_DECL(pj_uint16_t) pj_SO_SNDBUF(void);
#else
/** Get #PJ_SO_TYPE constant */
# define pj_SO_TYPE() PJ_SO_TYPE
/** Get #PJ_SO_RCVBUF constant */ /** Get #PJ_SO_RCVBUF constant */
PJ_DECL(pj_uint16_t) pj_SO_RCVBUF(void); # define pj_SO_RCVBUF() PJ_SO_RCVBUF
/** Get #PJ_SO_SNDBUF constant */ /** Get #PJ_SO_SNDBUF constant */
PJ_DECL(pj_uint16_t) pj_SO_SNDBUF(void); # define pj_SO_SNDBUF() PJ_SO_SNDBUF
#endif
/* /*
* Flags to be specified in #pj_sock_recv, #pj_sock_send, etc. * Flags to be specified in #pj_sock_recv, #pj_sock_send, etc.
*/ */
/** Out-of-band messages. @see pj_MSG_OOB() */ /** Out-of-band messages. @see pj_MSG_OOB() */
extern const int PJ_MSG_OOB; extern const int PJ_MSG_OOB;
/** Peek, don't remove from buffer. @see pj_MSG_PEEK() */ /** Peek, don't remove from buffer. @see pj_MSG_PEEK() */
extern const int PJ_MSG_PEEK; extern const int PJ_MSG_PEEK;
/** Don't route. @see pj_MSG_DONTROUTE() */ /** Don't route. @see pj_MSG_DONTROUTE() */
extern const int PJ_MSG_DONTROUTE; extern const int PJ_MSG_DONTROUTE;
/** Get #PJ_MSG_OOB constant */ #if defined(PJ_DLL)
PJ_DECL(int) pj_MSG_OOB(void); /** Get #PJ_MSG_OOB constant */
PJ_DECL(int) pj_MSG_OOB(void);
/** Get #PJ_MSG_PEEK constant */
PJ_DECL(int) pj_MSG_PEEK(void);
/** Get #PJ_MSG_PEEK constant */ /** Get #PJ_MSG_DONTROUTE constant */
PJ_DECL(int) pj_MSG_PEEK(void); PJ_DECL(int) pj_MSG_DONTROUTE(void);
#else
/** Get #PJ_MSG_OOB constant */
# define pj_MSG_OOB() PJ_MSG_OOB
/** Get #PJ_MSG_DONTROUTE constant */ /** Get #PJ_MSG_PEEK constant */
PJ_DECL(int) pj_MSG_DONTROUTE(void); # define pj_MSG_PEEK() PJ_MSG_PEEK
/** Get #PJ_MSG_DONTROUTE constant */
# define pj_MSG_DONTROUTE() PJ_MSG_DONTROUTE
#endif
/** /**
* Flag to be specified in #pj_sock_shutdown(). * Flag to be specified in #pj_sock_shutdown().
*/ */
typedef enum pj_socket_sd_type typedef enum pj_socket_sd_type
{ {
PJ_SD_RECEIVE = 0, /**< No more receive. */ PJ_SD_RECEIVE = 0, /**< No more receive. */
PJ_SHUT_RD = 0, /**< Alias for SD_RECEIVE. */ PJ_SHUT_RD = 0, /**< Alias for SD_RECEIVE. */
PJ_SD_SEND = 1, /**< No more sending. */ PJ_SD_SEND = 1, /**< No more sending. */
PJ_SHUT_WR = 1, /**< Alias for SD_SEND. */ PJ_SHUT_WR = 1, /**< Alias for SD_SEND. */
skipping to change at line 288 skipping to change at line 374
#if !defined(PJ_SOMAXCONN) #if !defined(PJ_SOMAXCONN)
# define PJ_SOMAXCONN 5 # define PJ_SOMAXCONN 5
#endif #endif
/** /**
* Constant for invalid socket returned by #pj_sock_socket() and * Constant for invalid socket returned by #pj_sock_socket() and
* #pj_sock_accept(). * #pj_sock_accept().
*/ */
#define PJ_INVALID_SOCKET (-1) #define PJ_INVALID_SOCKET (-1)
/* Must undefine s_addr because of pj_in_addr below */
#undef s_addr #undef s_addr
/** /**
* This structure describes Internet address. * This structure describes Internet address.
*/ */
typedef struct pj_in_addr typedef struct pj_in_addr
{ {
pj_uint32_t s_addr; /**< The 32bit IP address. */ pj_uint32_t s_addr; /**< The 32bit IP address. */
} pj_in_addr; } pj_in_addr;
/** /**
* Maximum length of text representation of an IPv4 address.
*/
#define PJ_INET_ADDRSTRLEN 16
/**
* Maximum length of text representation of an IPv6 address.
*/
#define PJ_INET6_ADDRSTRLEN 46
/**
* This structure describes Internet socket address. * This structure describes Internet socket address.
* If PJ_SOCKADDR_HAS_LEN is not zero, then sin_zero_len member is added * If PJ_SOCKADDR_HAS_LEN is not zero, then sin_zero_len member is added
* to this struct. As far the application is concerned, the value of * to this struct. As far the application is concerned, the value of
* this member will always be zero. Internally, PJLIB may modify the value * this member will always be zero. Internally, PJLIB may modify the value
* before calling OS socket API, and reset the value back to zero before * before calling OS socket API, and reset the value back to zero before
* returning the struct to application. * returning the struct to application.
*/ */
struct pj_sockaddr_in struct pj_sockaddr_in
{ {
#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0
skipping to change at line 324 skipping to change at line 421
pj_uint16_t sin_port; /**< Transport layer port number. */ pj_uint16_t sin_port; /**< Transport layer port number. */
pj_in_addr sin_addr; /**< IP address. */ pj_in_addr sin_addr; /**< IP address. */
char sin_zero[8]; /**< Padding. */ char sin_zero[8]; /**< Padding. */
}; };
#undef s6_addr #undef s6_addr
/** /**
* This structure describes IPv6 address. * This structure describes IPv6 address.
*/ */
typedef struct pj_in6_addr typedef union pj_in6_addr
{ {
/** Union of address formats. */ /* This is the main entry */
union { pj_uint8_t s6_addr[16]; /**< 8-bit array */
pj_uint8_t u6_addr8[16]; /**< u6_addr8 */
pj_uint16_t u6_addr16[8]; /**< u6_addr16 */ /* While these are used for proper alignment */
pj_uint32_t u6_addr32[4]; /**< u6_addr32 */ pj_uint32_t u6_addr32[4];
} in6_u;
/** Shortcut to access in6_u.u6_addr8. */ /* Do not use this with Winsock2, as this will align pj_sockaddr_in6
#define s6_addr in6_u.u6_addr8 * to 64-bit boundary and Winsock2 doesn't like it!
/** Shortcut to access in6_u.u6_addr16. */ */
#define s6_addr16 in6_u.u6_addr16 #if defined(PJ_HAS_INT64) && PJ_HAS_INT64!=0 && \
/** Shortcut to access in6_u.u6_addr32. */ (!defined(PJ_WIN32) || PJ_WIN32==0)
#define s6_addr32 in6_u.u6_addr32 pj_int64_t u6_addr64[2];
#endif
} pj_in6_addr; } pj_in6_addr;
/** Initializer value for pj_in6_addr. */ /** Initializer value for pj_in6_addr. */
#define PJ_IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } #define PJ_IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
/** Initializer value for pj_in6_addr. */ /** Initializer value for pj_in6_addr. */
#define PJ_IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } #define PJ_IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
/** /**
* This structure describes IPv6 socket address. * This structure describes IPv6 socket address.
* If PJ_SOCKADDR_HAS_LEN is not zero, then sin_zero_len member is added * If PJ_SOCKADDR_HAS_LEN is not zero, then sin_zero_len member is added
* to this struct. As far the application is concerned, the value of * to this struct. As far the application is concerned, the value of
* this member will always be zero. Internally, PJLIB may modify the value * this member will always be zero. Internally, PJLIB may modify the value
* before calling OS socket API, and reset the value back to zero before * before calling OS socket API, and reset the value back to zero before
* returning the struct to application. * returning the struct to application.
*/ */
typedef struct pj_sockaddr_in6 typedef struct pj_sockaddr_in6
{ {
#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 #if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0
pj_uint8_t sin_zero_len; /**< Just ignore this. */ pj_uint8_t sin6_zero_len; /**< Just ignore this. */
pj_uint8_t sin_family; /**< Address family. */ pj_uint8_t sin6_family; /**< Address family. */
#else #else
pj_uint16_t sin6_family; /**< Address family */ pj_uint16_t sin6_family; /**< Address family */
#endif #endif
pj_uint16_t sin6_port; /**< Transport layer port number . */ pj_uint16_t sin6_port; /**< Transport layer port number . */
pj_uint32_t sin6_flowinfo; /**< IPv6 flow information */ pj_uint32_t sin6_flowinfo; /**< IPv6 flow information */
pj_in6_addr sin6_addr; /**< IPv6 address. */ pj_in6_addr sin6_addr; /**< IPv6 address. */
pj_uint32_t sin6_scope_id; /**< IPv6 scope-id */ pj_uint32_t sin6_scope_id; /**< Set of interfaces for a scope */
} pj_sockaddr_in6; } pj_sockaddr_in6;
/** /**
* This structure describes common attributes found in transport addresses. * This structure describes common attributes found in transport addresses.
* If PJ_SOCKADDR_HAS_LEN is not zero, then sa_zero_len member is added * If PJ_SOCKADDR_HAS_LEN is not zero, then sa_zero_len member is added
* to this struct. As far the application is concerned, the value of * to this struct. As far the application is concerned, the value of
* this member will always be zero. Internally, PJLIB may modify the value * this member will always be zero. Internally, PJLIB may modify the value
* before calling OS socket API, and reset the value back to zero before * before calling OS socket API, and reset the value back to zero before
* returning the struct to application. * returning the struct to application.
*/ */
skipping to change at line 457 skipping to change at line 556
* that inp points to. * that inp points to.
* *
* @param cp IP address in standard numbers-and-dots notation. * @param cp IP address in standard numbers-and-dots notation.
* @param inp Structure that holds the output of the conversion. * @param inp Structure that holds the output of the conversion.
* *
* @return nonzero if the address is valid, zero if not. * @return nonzero if the address is valid, zero if not.
*/ */
PJ_DECL(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp); PJ_DECL(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp);
/** /**
* This function converts an address in its standard text presentation form
* into its numeric binary form. It supports both IPv4 and IPv6 address
* conversion.
*
* @param af Specify the family of the address. The PJ_AF_INET and
* PJ_AF_INET6 address families shall be supported.
* @param src Points to the string being passed in.
* @param dst Points to a buffer into which the function stores the
* numeric address; this shall be large enough to hold the
* numeric address (32 bits for PJ_AF_INET, 128 bits for
* PJ_AF_INET6).
*
* @return PJ_SUCCESS if conversion was successful.
*/
PJ_DECL(pj_status_t) pj_inet_pton(int af, const pj_str_t *src, void *dst);
/**
* This function converts a numeric address into a text string suitable
* for presentation. It supports both IPv4 and IPv6 address
* conversion.
* @see pj_sockaddr_print()
*
* @param af Specify the family of the address. This can be PJ_AF_INET
* or PJ_AF_INET6.
* @param src Points to a buffer holding an IPv4 address if the af argumen
t
* is PJ_AF_INET, or an IPv6 address if the af argument is
* PJ_AF_INET6; the address must be in network byte order.
* @param dst Points to a buffer where the function stores the resulting
* text string; it shall not be NULL.
* @param size Specifies the size of this buffer, which shall be large
* enough to hold the text string (PJ_INET_ADDRSTRLEN character
s
* for IPv4, PJ_INET6_ADDRSTRLEN characters for IPv6).
*
* @return PJ_SUCCESS if conversion was successful.
*/
PJ_DECL(pj_status_t) pj_inet_ntop(int af, const void *src,
char *dst, int size);
/**
* Converts numeric address into its text string representation.
* @see pj_sockaddr_print()
*
* @param af Specify the family of the address. This can be PJ_AF_INET
* or PJ_AF_INET6.
* @param src Points to a buffer holding an IPv4 address if the af argumen
t
* is PJ_AF_INET, or an IPv6 address if the af argument is
* PJ_AF_INET6; the address must be in network byte order.
* @param dst Points to a buffer where the function stores the resulting
* text string; it shall not be NULL.
* @param size Specifies the size of this buffer, which shall be large
* enough to hold the text string (PJ_INET_ADDRSTRLEN character
s
* for IPv4, PJ_INET6_ADDRSTRLEN characters for IPv6).
*
* @return The address string or NULL if failed.
*/
PJ_DECL(char*) pj_inet_ntop2(int af, const void *src,
char *dst, int size);
/**
* Print socket address.
*
* @param addr The socket address.
* @param buf Text buffer.
* @param size Size of buffer.
* @param flags Bitmask combination of these value:
* - 1: port number is included.
* - 2: square bracket is included for IPv6 address.
*
* @return The address string.
*/
PJ_DECL(char*) pj_sockaddr_print(const pj_sockaddr_t *addr,
char *buf, int size,
unsigned flags);
/**
* Convert address string with numbers and dots to binary IP address. * Convert address string with numbers and dots to binary IP address.
* *
* @param cp The IP address in numbers and dots notation. * @param cp The IP address in numbers and dots notation.
* @return If success, the IP address is returned in network * @return If success, the IP address is returned in network
* byte order. If failed, PJ_INADDR_NONE will be * byte order. If failed, PJ_INADDR_NONE will be
* returned. * returned.
* @remark * @remark
* This is an obsolete interface to #pj_inet_aton(); it is obsolete * This is an obsolete interface to #pj_inet_aton(); it is obsolete
* because -1 is a valid address (255.255.255.255), and #pj_inet_aton() * because -1 is a valid address (255.255.255.255), and #pj_inet_aton()
* provides a cleaner way to indicate error return. * provides a cleaner way to indicate error return.
skipping to change at line 485 skipping to change at line 659
* byte order. If failed, PJ_INADDR_NONE will be * byte order. If failed, PJ_INADDR_NONE will be
* returned. * returned.
* @remark * @remark
* This is an obsolete interface to #pj_inet_aton(); it is obsolete * This is an obsolete interface to #pj_inet_aton(); it is obsolete
* because -1 is a valid address (255.255.255.255), and #pj_inet_aton() * because -1 is a valid address (255.255.255.255), and #pj_inet_aton()
* provides a cleaner way to indicate error return. * provides a cleaner way to indicate error return.
*/ */
PJ_DECL(pj_in_addr) pj_inet_addr2(const char *cp); PJ_DECL(pj_in_addr) pj_inet_addr2(const char *cp);
/** /**
* Get the transport layer port number of an Internet socket address. * Initialize IPv4 socket address based on the address and port info.
* The port is returned in host byte order. * The string address may be in a standard numbers and dots notation or
* may be a hostname. If hostname is specified, then the function will
* resolve the host into the IP address.
* *
* @param addr The IP socket address. * @see pj_sockaddr_init()
* @return Port number, in host byte order. *
* @param addr The IP socket address to be set.
* @param cp The address string, which can be in a standard
* dotted numbers or a hostname to be resolved.
* @param port The port number, in host byte order.
*
* @return Zero on success.
*/ */
PJ_INLINE(pj_uint16_t) pj_sockaddr_in_get_port(const pj_sockaddr_in *addr) PJ_DECL(pj_status_t) pj_sockaddr_in_init( pj_sockaddr_in *addr,
{ const pj_str_t *cp,
return pj_ntohs(addr->sin_port); pj_uint16_t port);
}
/** /**
* Set the port number of an Internet socket address. * Initialize IP socket address based on the address and port info.
* The string address may be in a standard numbers and dots notation or
* may be a hostname. If hostname is specified, then the function will
* resolve the host into the IP address.
* *
* @param addr The IP socket address. * @see pj_sockaddr_in_init()
* @param hostport The port number, in host byte order. *
* @param af Internet address family.
* @param addr The IP socket address to be set.
* @param cp The address string, which can be in a standard
* dotted numbers or a hostname to be resolved.
* @param port The port number, in host byte order.
*
* @return Zero on success.
*/ */
PJ_INLINE(void) pj_sockaddr_in_set_port(pj_sockaddr_in *addr, PJ_DECL(pj_status_t) pj_sockaddr_init(int af,
pj_uint16_t hostport) pj_sockaddr *addr,
{ const pj_str_t *cp,
addr->sin_port = pj_htons(hostport); pj_uint16_t port);
}
/**
* Compare two socket addresses.
*
* @param addr1 First address.
* @param addr2 Second address.
*
* @return Zero on equal, -1 if addr1 is less than addr2,
* and +1 if addr1 is more than addr2.
*/
PJ_DECL(int) pj_sockaddr_cmp(const pj_sockaddr_t *addr1,
const pj_sockaddr_t *addr2);
/** /**
* Get the IP address of an Internet socket address. * Get pointer to the address part of a socket address.
*
* @param addr Socket address.
*
* @return Pointer to address part (sin_addr or sin6_addr,
* depending on address family)
*/
PJ_DECL(void*) pj_sockaddr_get_addr(const pj_sockaddr_t *addr);
/**
* Check that a socket address contains a non-zero address part.
*
* @param addr Socket address.
*
* @return Non-zero if address is set to non-zero.
*/
PJ_DECL(pj_bool_t) pj_sockaddr_has_addr(const pj_sockaddr_t *addr);
/**
* Get the address part length of a socket address, based on its address
* family. For PJ_AF_INET, the length will be sizeof(pj_in_addr), and
* for PJ_AF_INET6, the length will be sizeof(pj_in6_addr).
*
* @param addr Socket address.
*
* @return Length in bytes.
*/
PJ_DECL(unsigned) pj_sockaddr_get_addr_len(const pj_sockaddr_t *addr);
/**
* Get the socket address length, based on its address
* family. For PJ_AF_INET, the length will be sizeof(pj_sockaddr_in), and
* for PJ_AF_INET6, the length will be sizeof(pj_sockaddr_in6).
*
* @param addr Socket address.
*
* @return Length in bytes.
*/
PJ_DECL(unsigned) pj_sockaddr_get_len(const pj_sockaddr_t *addr);
/**
* Copy only the address part (sin_addr/sin6_addr) of a socket address.
*
* @param dst Destination socket address.
* @param src Source socket address.
*
* @see @pj_sockaddr_cp()
*/
PJ_DECL(void) pj_sockaddr_copy_addr(pj_sockaddr *dst,
const pj_sockaddr *src);
/**
* Copy socket address. This will copy the whole structure depending
* on the address family of the source socket address.
*
* @param dst Destination socket address.
* @param src Source socket address.
*
* @see @pj_sockaddr_copy_addr()
*/
PJ_DECL(void) pj_sockaddr_cp(pj_sockaddr_t *dst, const pj_sockaddr_t *src);
/**
* Get the IP address of an IPv4 socket address.
* The address is returned as 32bit value in host byte order. * The address is returned as 32bit value in host byte order.
* *
* @param addr The IP socket address. * @param addr The IP socket address.
* @return 32bit address, in host byte order. * @return 32bit address, in host byte order.
*/ */
PJ_INLINE(pj_in_addr) pj_sockaddr_in_get_addr(const pj_sockaddr_in *addr) PJ_DECL(pj_in_addr) pj_sockaddr_in_get_addr(const pj_sockaddr_in *addr);
{
pj_in_addr in_addr;
in_addr.s_addr = pj_ntohl(addr->sin_addr.s_addr);
return in_addr;
}
/** /**
* Set the IP address of an Internet socket address. * Set the IP address of an IPv4 socket address.
* *
* @param addr The IP socket address. * @param addr The IP socket address.
* @param hostaddr The host address, in host byte order. * @param hostaddr The host address, in host byte order.
*/ */
PJ_INLINE(void) pj_sockaddr_in_set_addr(pj_sockaddr_in *addr, PJ_DECL(void) pj_sockaddr_in_set_addr(pj_sockaddr_in *addr,
pj_uint32_t hostaddr) pj_uint32_t hostaddr);
{
addr->sin_addr.s_addr = pj_htonl(hostaddr);
}
/** /**
* Set the IP address of an IP socket address from string address, * Set the IP address of an IP socket address from string address,
* with resolving the host if necessary. The string address may be in a * with resolving the host if necessary. The string address may be in a
* standard numbers and dots notation or may be a hostname. If hostname * standard numbers and dots notation or may be a hostname. If hostname
* is specified, then the function will resolve the host into the IP * is specified, then the function will resolve the host into the IP
* address. * address.
* *
* @see pj_sockaddr_set_str_addr()
*
* @param addr The IP socket address to be set. * @param addr The IP socket address to be set.
* @param cp The address string, which can be in a standard * @param cp The address string, which can be in a standard
* dotted numbers or a hostname to be resolved. * dotted numbers or a hostname to be resolved.
* *
* @return Zero on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pj_sockaddr_in_set_str_addr( pj_sockaddr_in *addr, PJ_DECL(pj_status_t) pj_sockaddr_in_set_str_addr( pj_sockaddr_in *addr,
const pj_str_t *cp); const pj_str_t *cp);
/** /**
* Set the IP address and port of an IP socket address. * Set the IP address of an IPv4 or IPv6 socket address from string address
* The string address may be in a standard numbers and dots notation or ,
* may be a hostname. If hostname is specified, then the function will * with resolving the host if necessary. The string address may be in a
* resolve the host into the IP address. * standard IPv6 or IPv6 address or may be a hostname. If hostname
* is specified, then the function will resolve the host into the IP
* address according to the address family.
* *
* @param af Address family.
* @param addr The IP socket address to be set. * @param addr The IP socket address to be set.
* @param cp The address string, which can be in a standard * @param cp The address string, which can be in a standard
* dotted numbers or a hostname to be resolved. * IP numbers (IPv4 or IPv6) or a hostname to be resolved.
* @param port The port number, in host byte order.
* *
* @return Zero on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pj_sockaddr_in_init( pj_sockaddr_in *addr, PJ_DECL(pj_status_t) pj_sockaddr_set_str_addr(int af,
const pj_str_t *cp, pj_sockaddr *addr,
pj_uint16_t port); const pj_str_t *cp);
/**
* Get the port number of a socket address, in host byte order.
* This function can be used for both IPv4 and IPv6 socket address.
*
* @param addr Socket address.
*
* @return Port number, in host byte order.
*/
PJ_DECL(pj_uint16_t) pj_sockaddr_get_port(const pj_sockaddr_t *addr);
/**
* Get the transport layer port number of an Internet socket address.
* The port is returned in host byte order.
*
* @param addr The IP socket address.
* @return Port number, in host byte order.
*/
PJ_DECL(pj_uint16_t) pj_sockaddr_in_get_port(const pj_sockaddr_in *addr);
/**
* Set the port number of an Internet socket address.
*
* @param addr The socket address.
* @param hostport The port number, in host byte order.
*/
PJ_DECL(pj_status_t) pj_sockaddr_set_port(pj_sockaddr *addr,
pj_uint16_t hostport);
/**
* Set the port number of an IPv4 socket address.
*
* @see pj_sockaddr_set_port()
*
* @param addr The IP socket address.
* @param hostport The port number, in host byte order.
*/
PJ_DECL(void) pj_sockaddr_in_set_port(pj_sockaddr_in *addr,
pj_uint16_t hostport);
/************************************************************************** *** /************************************************************************** ***
* *
* HOST NAME AND ADDRESS. * HOST NAME AND ADDRESS.
* *
************************************************************************** *** ************************************************************************** ***
*/ */
/** /**
* Get system's host name. * Get system's host name.
 End of changes. 41 change blocks. 
109 lines changed or deleted 412 lines changed or added


 sock_select.h   sock_select.h 
/* $Id: sock_select.h 1405 2007-07-20 08:08:30Z bennylp $ */ /* $Id: sock_select.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 57 skipping to change at line 57
/** /**
* Portable structure declarations for pj_fd_set. * Portable structure declarations for pj_fd_set.
* The implementation of pj_sock_select() does not use this structure * The implementation of pj_sock_select() does not use this structure
* per-se, but instead it will use the native fd_set structure. However, * per-se, but instead it will use the native fd_set structure. However,
* we must make sure that the size of pj_fd_set_t can accomodate the * we must make sure that the size of pj_fd_set_t can accomodate the
* native fd_set structure. * native fd_set structure.
*/ */
typedef struct pj_fd_set_t typedef struct pj_fd_set_t
{ {
pj_sock_t data[FD_SETSIZE + 4]; /**< Opaque buffer for fd_set */ pj_sock_t data[PJ_IOQUEUE_MAX_HANDLES+ 4]; /**< Opaque buffer for fd_se t */
} pj_fd_set_t; } pj_fd_set_t;
/** /**
* Initialize the descriptor set pointed to by fdsetp to the null set. * Initialize the descriptor set pointed to by fdsetp to the null set.
* *
* @param fdsetp The descriptor set. * @param fdsetp The descriptor set.
*/ */
PJ_DECL(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp); PJ_DECL(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp);
/** /**
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 socket.h   socket.h 
/* $Id: socket.h 1235 2007-04-30 21:03:32Z bennylp $ */ /* $Id: socket.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 35 skipping to change at line 35
*/ */
#if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H != 0 #if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H != 0
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#if defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H != 0 #if defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H != 0
# include <winsock.h> # include <winsock.h>
#endif #endif
/*
* IPv6 for Visual Studio's
*
* = Visual Studio 6 =
*
* Visual Studio 6 does not ship with IPv6 support, so you MUST
* download and install IPv6 Tehnology Preview (IPv6Kit) from:
* http://msdn.microsoft.com/downloads/sdks/platform/tpipv6/ReadMe.asp
* Then put IPv6Kit\inc in your Visual Studio include path.
*
* In addition, by default IPv6Kit does not want to install on
* Windows 2000 SP4. Please see:
* http://msdn.microsoft.com/downloads/sdks/platform/tpipv6/faq.asp
* on how to install IPv6Kit on Win2K SP4.
*
*
* = Visual Studio 2003, 2005 (including Express) =
*
* These VS uses Microsoft Platform SDK for Windows Server 2003 SP1, and
* it has built-in IPv6 support.
*/
#if defined(_MSC_VER) && defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0
# ifndef s_addr
# define s_addr S_un.S_addr
# endif
# include <ws2tcpip.h>
# ifndef IPPROTO_IPV6
/* Need to download and install IPv6Kit for this platform.
* Please see the comments above about Visual Studio 6.
*/
# include <tpipv6.h>
# endif
# define PJ_SOCK_HAS_GETADDRINFO 1
#endif /* _MSC_VER */
#if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H != 0 #if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H != 0
# include <sys/types.h> # include <sys/types.h>
#endif #endif
#if defined(PJ_HAS_SYS_SOCKET_H) && PJ_HAS_SYS_SOCKET_H != 0 #if defined(PJ_HAS_SYS_SOCKET_H) && PJ_HAS_SYS_SOCKET_H != 0
# include <sys/socket.h> # include <sys/socket.h>
#endif #endif
#if defined(PJ_HAS_LINUX_SOCKET_H) && PJ_HAS_LINUX_SOCKET_H != 0 #if defined(PJ_HAS_LINUX_SOCKET_H) && PJ_HAS_LINUX_SOCKET_H != 0
# include <linux/socket.h> # include <linux/socket.h>
skipping to change at line 60 skipping to change at line 98
#if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H != 0 #if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H != 0
# include <netinet/in.h> # include <netinet/in.h>
#endif #endif
#if defined(PJ_HAS_NETINET_IP_H) && PJ_HAS_NETINET_IP_H != 0 #if defined(PJ_HAS_NETINET_IP_H) && PJ_HAS_NETINET_IP_H != 0
/* To pull in IPTOS_* constants */ /* To pull in IPTOS_* constants */
# include <netinet/ip.h> # include <netinet/ip.h>
#endif #endif
#if defined(PJ_HAS_NET_IF_H) && PJ_HAS_NET_IF_H != 0
/* For interface enumeration in ip_helper */
# include <net/if.h>
#endif
#if defined(PJ_HAS_IFADDRS_H) && PJ_HAS_IFADDRS_H != 0
/* Interface enum with getifaddrs() which works with IPv6 */
# include <ifaddrs.h>
#endif
#if defined(PJ_HAS_ARPA_INET_H) && PJ_HAS_ARPA_INET_H != 0 #if defined(PJ_HAS_ARPA_INET_H) && PJ_HAS_ARPA_INET_H != 0
# include <arpa/inet.h> # include <arpa/inet.h>
#endif #endif
#if defined(PJ_HAS_SYS_IOCTL_H) && PJ_HAS_SYS_IOCTL_H != 0 #if defined(PJ_HAS_SYS_IOCTL_H) && PJ_HAS_SYS_IOCTL_H != 0
# include <sys/ioctl.h> /* FBIONBIO */ # include <sys/ioctl.h> /* FBIONBIO */
#endif #endif
#if defined(PJ_HAS_ERRNO_H) && PJ_HAS_ERRNO_H != 0 #if defined(PJ_HAS_ERRNO_H) && PJ_HAS_ERRNO_H != 0
# include <errno.h> # include <errno.h>
skipping to change at line 102 skipping to change at line 150
# define OSERR_ECONNRESET -1 # define OSERR_ECONNRESET -1
# define OSERR_ENOTCONN -1 # define OSERR_ENOTCONN -1
#else #else
# define OSERR_EWOULDBLOCK EWOULDBLOCK # define OSERR_EWOULDBLOCK EWOULDBLOCK
# define OSERR_EINPROGRESS EINPROGRESS # define OSERR_EINPROGRESS EINPROGRESS
# define OSERR_ECONNRESET ECONNRESET # define OSERR_ECONNRESET ECONNRESET
# define OSERR_ENOTCONN ENOTCONN # define OSERR_ENOTCONN ENOTCONN
#endif #endif
/* /*
* And undefine this.. * And undefine these..
*/ */
#undef s_addr #undef s_addr
#undef s6_addr
/* /*
* Linux kernel specifics * Linux kernel specifics
*/ */
#if defined(PJ_LINUX_KERNEL) #if defined(PJ_LINUX_KERNEL)
# include <linux/net.h> # include <linux/net.h>
# include <asm/ioctls.h> /* FIONBIO */ # include <asm/ioctls.h> /* FIONBIO */
# include <linux/syscalls.h> /* sys_select() */ # include <linux/syscalls.h> /* sys_select() */
# include <asm/uaccess.h> /* set/get_fs() */ # include <asm/uaccess.h> /* set/get_fs() */
skipping to change at line 141 skipping to change at line 190
#endif /* PJ_LINUX_KERNEL */ #endif /* PJ_LINUX_KERNEL */
/* /*
* This will finally be obsoleted, since it should be declared in * This will finally be obsoleted, since it should be declared in
* os_auto.h * os_auto.h
*/ */
#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0 #if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0
typedef int socklen_t; typedef int socklen_t;
#endif #endif
/* Regarding sin_len member of sockaddr_in:
* BSD systems (including MacOS X requires that the sin_len member of
* sockaddr_in be set to sizeof(sockaddr_in), while other systems (Windows
* and Linux included) do not.
*
* To maintain compatibility between systems, PJLIB will automatically
* set this field before invoking native OS socket API, and it will
* always reset the field to zero before returning pj_sockaddr_in to
* application (such as in pj_getsockname() and pj_recvfrom()).
*
* Application MUST always set this field to zero.
*
* This way we can avoid hard to find problem such as when the socket
* address is used as hash table key.
*/
#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0
# define PJ_SOCKADDR_SET_LEN(addr,len) (((pj_addr_hdr*)(addr))->sa_zero_l
en=(len))
# define PJ_SOCKADDR_RESET_LEN(addr) (((pj_addr_hdr*)(addr))->sa_zero_l
en=0)
#else
# define PJ_SOCKADDR_SET_LEN(addr,len)
# define PJ_SOCKADDR_RESET_LEN(addr)
#endif
#endif /* __PJ_COMPAT_SOCKET_H__ */ #endif /* __PJ_COMPAT_SOCKET_H__ */
 End of changes. 7 change blocks. 
3 lines changed or deleted 77 lines changed or added


 sound.h   sound.h 
/* $Id: sound.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sound.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 40 skipping to change at line 40
/** /**
* @defgroup PJMED_SND Portable Sound Hardware Abstraction * @defgroup PJMED_SND Portable Sound Hardware Abstraction
* @ingroup PJMED_SND_PORT * @ingroup PJMED_SND_PORT
* @brief PJMEDIA abstraction for sound device hardware * @brief PJMEDIA abstraction for sound device hardware
* @{ * @{
* *
* This section describes lower level abstraction for sound device * This section describes lower level abstraction for sound device
* hardware. Application normally uses the higher layer @ref * hardware. Application normally uses the higher layer @ref
* PJMED_SND_PORT abstraction since it works seamlessly with * PJMED_SND_PORT abstraction since it works seamlessly with
* @ref PJMEDIA_PORT_CONCEPT. * @ref PJMEDIA_PORT.
* *
* The sound hardware abstraction basically runs <b>asychronously</b>, * The sound hardware abstraction basically runs <b>asychronously</b>,
* and application must register callbacks to be called to receive/ * and application must register callbacks to be called to receive/
* supply audio frames from/to the sound hardware. * supply audio frames from/to the sound hardware.
* *
* A full duplex sound stream (created with #pjmedia_snd_open()) * A full duplex sound stream (created with #pjmedia_snd_open())
* requires application to supply two callbacks: * requires application to supply two callbacks:
* - <b><tt>rec_cb</tt></b> callback to be called when it has finished * - <b><tt>rec_cb</tt></b> callback to be called when it has finished
* capturing one media frame, and * capturing one media frame, and
* - <b><tt>play_cb</tt></b> callback to be called when it needs media * - <b><tt>play_cb</tt></b> callback to be called when it needs media
skipping to change at line 152 skipping to change at line 152
/** /**
* Get device info. * Get device info.
* *
* @param index The index of the device, which should be in the range * @param index The index of the device, which should be in the range
* from zero to #pjmedia_snd_get_dev_count - 1. * from zero to #pjmedia_snd_get_dev_count - 1.
*/ */
PJ_DECL(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned inde x); PJ_DECL(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned inde x);
/** /**
* Set sound device latency, this function must be called before sound devi
ce
* opened, or otherwise default latency setting will be used, @see
* PJMEDIA_SND_DEFAULT_REC_LATENCY & PJMEDIA_SND_DEFAULT_PLAY_LATENCY.
*
* Choosing latency value is not straightforward, it should accomodate both
* minimum latency and stability. Lower latency tends to cause sound device
* less reliable (producing audio dropouts) on CPU load disturbance. Moreov
er,
* the best latency setting may vary based on many aspects, e.g: sound card
,
* CPU, OS, kernel, etc.
*
* @param input_latency The latency of input device, in ms, set
to 0
* for default PJMEDIA_SND_DEFAULT_REC_LATENCY.
* @param output_latency The latency of output device, in ms, set to 0
* for default PJMEDIA_SND_DEFAULT_PLAY_LATENCY.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_snd_set_latency(unsigned input_latency,
unsigned output_latency);
/**
* Create sound stream for both capturing audio and audio playback, from t he * Create sound stream for both capturing audio and audio playback, from t he
* same device. This is the recommended way to create simultaneous recorder * same device. This is the recommended way to create simultaneous recorder
* and player streams (instead of creating separate capture and playback * and player streams (instead of creating separate capture and playback
* streams), because it works on backends that does not allow * streams), because it works on backends that does not allow
* a device to be opened more than once. * a device to be opened more than once.
* *
* @param rec_id Device index for recorder/capture stream, or * @param rec_id Device index for recorder/capture stream, or
* -1 to use the first capable device. * -1 to use the first capable device.
* @param play_id Device index for playback stream, or -1 to use * @param play_id Device index for playback stream, or -1 to use
* the first capable device. * the first capable device.
 End of changes. 4 change blocks. 
3 lines changed or deleted 28 lines changed or added


 sound_port.h   sound_port.h 
/* $Id: sound_port.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sound_port.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 speex.h   speex.h 
skipping to change at line 158 skipping to change at line 158
/** Sets the max bit-rate allowed in VBR mode */ /** Sets the max bit-rate allowed in VBR mode */
#define SPEEX_SET_VBR_MAX_BITRATE 42 #define SPEEX_SET_VBR_MAX_BITRATE 42
/** Gets the max bit-rate allowed in VBR mode */ /** Gets the max bit-rate allowed in VBR mode */
#define SPEEX_GET_VBR_MAX_BITRATE 43 #define SPEEX_GET_VBR_MAX_BITRATE 43
/** Turn on/off input/output high-pass filtering */ /** Turn on/off input/output high-pass filtering */
#define SPEEX_SET_HIGHPASS 44 #define SPEEX_SET_HIGHPASS 44
/** Get status of input/output high-pass filtering */ /** Get status of input/output high-pass filtering */
#define SPEEX_GET_HIGHPASS 45 #define SPEEX_GET_HIGHPASS 45
/** Get "activity level" of the last decoded frame, i.e.
how much damage we cause if we remove the frame */
#define SPEEX_GET_ACTIVITY 47
/* Preserving compatibility:*/ /* Preserving compatibility:*/
/** Equivalent to SPEEX_SET_ENH */ /** Equivalent to SPEEX_SET_ENH */
#define SPEEX_SET_PF 0 #define SPEEX_SET_PF 0
/** Equivalent to SPEEX_GET_ENH */ /** Equivalent to SPEEX_GET_ENH */
#define SPEEX_GET_PF 1 #define SPEEX_GET_PF 1
/* Values allowed for mode queries */ /* Values allowed for mode queries */
/** Query the frame size of a mode */ /** Query the frame size of a mode */
#define SPEEX_MODE_FRAME_SIZE 0 #define SPEEX_MODE_FRAME_SIZE 0
skipping to change at line 205 skipping to change at line 209
/** modeID for the defined narrowband mode */ /** modeID for the defined narrowband mode */
#define SPEEX_MODEID_NB 0 #define SPEEX_MODEID_NB 0
/** modeID for the defined wideband mode */ /** modeID for the defined wideband mode */
#define SPEEX_MODEID_WB 1 #define SPEEX_MODEID_WB 1
/** modeID for the defined ultra-wideband mode */ /** modeID for the defined ultra-wideband mode */
#define SPEEX_MODEID_UWB 2 #define SPEEX_MODEID_UWB 2
#ifdef EPIC_48K
/** modeID for the Epic 48K mode */
#define SPEEX_MODEID_NB_48K 1000
#endif
struct SpeexMode; struct SpeexMode;
/* Prototypes for mode function pointers */ /* Prototypes for mode function pointers */
/** Encoder state initialization function */ /** Encoder state initialization function */
typedef void *(*encoder_init_func)(const struct SpeexMode *mode); typedef void *(*encoder_init_func)(const struct SpeexMode *mode);
/** Encoder state destruction function */ /** Encoder state destruction function */
typedef void (*encoder_destroy_func)(void *st); typedef void (*encoder_destroy_func)(void *st);
skipping to change at line 399 skipping to change at line 398
/** Default narrowband mode */ /** Default narrowband mode */
extern const SpeexMode speex_nb_mode; extern const SpeexMode speex_nb_mode;
/** Default wideband mode */ /** Default wideband mode */
extern const SpeexMode speex_wb_mode; extern const SpeexMode speex_wb_mode;
/** Default "ultra-wideband" mode */ /** Default "ultra-wideband" mode */
extern const SpeexMode speex_uwb_mode; extern const SpeexMode speex_uwb_mode;
#ifdef EPIC_48K
/** 4.8 kbps narrowband mode */
extern const SpeexMode speex_nb_48k_mode;
#endif
/** List of all modes available */ /** List of all modes available */
extern const SpeexMode * const speex_mode_list[SPEEX_NB_MODES]; extern const SpeexMode * const speex_mode_list[SPEEX_NB_MODES];
/** Obtain one of the modes available */ /** Obtain one of the modes available */
const SpeexMode * speex_lib_get_mode (int mode); const SpeexMode * speex_lib_get_mode (int mode);
#ifndef WIN32
/* We actually override the function in the narrowband case so that we can
avoid linking in the wideband stuff */
#define speex_lib_get_mode(mode) ((mode)==SPEEX_MODEID_NB ? &speex_nb_mode
: speex_lib_get_mode (mode))
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @}*/ /** @}*/
#endif #endif
 End of changes. 4 change blocks. 
10 lines changed or deleted 11 lines changed or added


 speex_bits.h   speex_bits.h 
skipping to change at line 67 skipping to change at line 67
int reserved1; /**< Reserved for future use */ int reserved1; /**< Reserved for future use */
void *reserved2; /**< Reserved for future use */ void *reserved2; /**< Reserved for future use */
} SpeexBits; } SpeexBits;
/** Initializes and allocates resources for a SpeexBits struct */ /** Initializes and allocates resources for a SpeexBits struct */
void speex_bits_init(SpeexBits *bits); void speex_bits_init(SpeexBits *bits);
/** Initializes SpeexBits struct using a pre-allocated buffer*/ /** Initializes SpeexBits struct using a pre-allocated buffer*/
void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size); void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size);
/** Sets the bits in a SpeexBits struct to use data from an existing buffer
(for decoding without copying data) */
void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size);
/** Frees all resources associated to a SpeexBits struct. Right now this do es nothing since no resources are allocated, but this could change in the f uture.*/ /** Frees all resources associated to a SpeexBits struct. Right now this do es nothing since no resources are allocated, but this could change in the f uture.*/
void speex_bits_destroy(SpeexBits *bits); void speex_bits_destroy(SpeexBits *bits);
/** Resets bits to initial value (just after initialization, erasing conten t)*/ /** Resets bits to initial value (just after initialization, erasing conten t)*/
void speex_bits_reset(SpeexBits *bits); void speex_bits_reset(SpeexBits *bits);
/** Rewind the bit-stream to the beginning (ready for read) without erasing the content */ /** Rewind the bit-stream to the beginning (ready for read) without erasing the content */
void speex_bits_rewind(SpeexBits *bits); void speex_bits_rewind(SpeexBits *bits);
/** Initializes the bit-stream from the data in an area of memory */ /** Initializes the bit-stream from the data in an area of memory */
 End of changes. 1 change blocks. 
0 lines changed or deleted 4 lines changed or added


 speex_callbacks.h   speex_callbacks.h 
skipping to change at line 120 skipping to change at line 120
/** Default handler for user-defined requests: in this case, just ignore */ /** Default handler for user-defined requests: in this case, just ignore */
int speex_default_user_handler(SpeexBits *bits, void *state, void *data); int speex_default_user_handler(SpeexBits *bits, void *state, void *data);
/** Standard handler for low mode request (change low mode, no questions as ked) */ /** Standard handler for low mode request (change low mode, no questions as ked) */
int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void * data); int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void * data);
/** Standard handler for VBR request (Set VBR, no questions asked) */ /** Standard handler for VBR request (Set VBR, no questions asked) */
int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data) ; int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data) ;
/** Standard handler for enhancer request (Turn ehnancer on/off, no questio ns asked) */ /** Standard handler for enhancer request (Turn enhancer on/off, no questio ns asked) */
int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data) ; int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data) ;
/** Standard handler for VBR quality request (Set VBR quality, no questions asked) */ /** Standard handler for VBR quality request (Set VBR quality, no questions asked) */
int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, voi d *data); int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, voi d *data);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} */ /** @} */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 speex_echo.h   speex_echo.h 
skipping to change at line 54 skipping to change at line 54
#endif #endif
/** Obtain frame size used by the AEC */ /** Obtain frame size used by the AEC */
#define SPEEX_ECHO_GET_FRAME_SIZE 3 #define SPEEX_ECHO_GET_FRAME_SIZE 3
/** Set sampling rate */ /** Set sampling rate */
#define SPEEX_ECHO_SET_SAMPLING_RATE 24 #define SPEEX_ECHO_SET_SAMPLING_RATE 24
/** Get sampling rate */ /** Get sampling rate */
#define SPEEX_ECHO_GET_SAMPLING_RATE 25 #define SPEEX_ECHO_GET_SAMPLING_RATE 25
/* Can't set window sizes */
/** Get size of impulse response (int32) */
#define SPEEX_ECHO_GET_IMPULSE_RESPONSE_SIZE 27
/* Can't set window content */
/** Get impulse response (int32[]) */
#define SPEEX_ECHO_GET_IMPULSE_RESPONSE 29
/** Internal echo canceller state. Should never be accessed directly. */ /** Internal echo canceller state. Should never be accessed directly. */
struct SpeexEchoState_; struct SpeexEchoState_;
/** @class SpeexEchoState /** @class SpeexEchoState
* This holds the state of the echo canceller. You need one per channel. * This holds the state of the echo canceller. You need one per channel.
*/ */
/** Internal echo canceller state. Should never be accessed directly. */ /** Internal echo canceller state. Should never be accessed directly. */
typedef struct SpeexEchoState_ SpeexEchoState; typedef struct SpeexEchoState_ SpeexEchoState;
/** Creates a new echo canceller state /** Creates a new echo canceller state
* @param frame_size Number of samples to process at one time (should corre spond to 10-20 ms) * @param frame_size Number of samples to process at one time (should corre spond to 10-20 ms)
* @param filter_length Number of samples of echo to cancel (should general ly correspond to 100-500 ms) * @param filter_length Number of samples of echo to cancel (should general ly correspond to 100-500 ms)
* @return Newly-created echo canceller state * @return Newly-created echo canceller state
*/ */
SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length); SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length);
/** Creates a new multi-channel echo canceller state
* @param frame_size Number of samples to process at one time (should corre
spond to 10-20 ms)
* @param filter_length Number of samples of echo to cancel (should general
ly correspond to 100-500 ms)
* @param nb_mic Number of microphone channels
* @param nb_speakers Number of speaker channels
* @return Newly-created echo canceller state
*/
SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_length,
int nb_mic, int nb_speakers);
/** Destroys an echo canceller state /** Destroys an echo canceller state
* @param st Echo canceller state * @param st Echo canceller state
*/ */
void speex_echo_state_destroy(SpeexEchoState *st); void speex_echo_state_destroy(SpeexEchoState *st);
/** Performs echo cancellation a frame, based on the audio sent to the spea ker (no delay is added /** Performs echo cancellation a frame, based on the audio sent to the spea ker (no delay is added
* to playback ni this form) * to playback in this form)
* *
* @param st Echo canceller state * @param st Echo canceller state
* @param rec signal from the microphone (near end + far end echo) * @param rec Signal from the microphone (near end + far end echo)
* @param play Signal played to the speaker (received from far end) * @param play Signal played to the speaker (received from far end)
* @param out Returns near-end signal with echo removed * @param out Returns near-end signal with echo removed
*/ */
void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *rec, co nst spx_int16_t *play, spx_int16_t *out); void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *rec, co nst spx_int16_t *play, spx_int16_t *out);
/** Performs echo cancellation a frame (deprecated) */ /** Performs echo cancellation a frame (deprecated) */
void speex_echo_cancel(SpeexEchoState *st, const spx_int16_t *rec, const sp x_int16_t *play, spx_int16_t *out, spx_int32_t *Yout); void speex_echo_cancel(SpeexEchoState *st, const spx_int16_t *rec, const sp x_int16_t *play, spx_int16_t *out, spx_int32_t *Yout);
/** Perform echo cancellation using internal playback buffer, which is dela yed by two frames /** Perform echo cancellation using internal playback buffer, which is dela yed by two frames
* to account for the delay introduced by most soundcards (but it could be off!) * to account for the delay introduced by most soundcards (but it could be off!)
* @param st Echo canceller state * @param st Echo canceller state
* @param rec signal from the microphone (near end + far end echo) * @param rec Signal from the microphone (near end + far end echo)
* @param out Returns near-end signal with echo removed * @param out Returns near-end signal with echo removed
*/ */
void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int 16_t *out); void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int 16_t *out);
/** Let the echo canceller know that a frame was just queued to the soundca rd /** Let the echo canceller know that a frame was just queued to the soundca rd
* @param st Echo canceller state * @param st Echo canceller state
* @param play Signal played to the speaker (received from far end) * @param play Signal played to the speaker (received from far end)
*/ */
void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play); void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play);
skipping to change at line 117 skipping to change at line 134
/** Used like the ioctl function to control the echo canceller parameters /** Used like the ioctl function to control the echo canceller parameters
* *
* @param st Echo canceller state * @param st Echo canceller state
* @param request ioctl-type request (one of the SPEEX_ECHO_* macros) * @param request ioctl-type request (one of the SPEEX_ECHO_* macros)
* @param ptr Data exchanged to-from function * @param ptr Data exchanged to-from function
* @return 0 if no error, -1 if request in unknown * @return 0 if no error, -1 if request in unknown
*/ */
int speex_echo_ctl(SpeexEchoState *st, int request, void *ptr); int speex_echo_ctl(SpeexEchoState *st, int request, void *ptr);
struct SpeexDecorrState_;
typedef struct SpeexDecorrState_ SpeexDecorrState;
/** Create a state for the channel decorrelation algorithm
This is useful for multi-channel echo cancellation only
* @param rate Sampling rate
* @param channels Number of channels (it's a bit pointless if you don't ha
ve at least 2)
* @param frame_size Size of the frame to process at ones (counting samples
*per* channel)
*/
SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame_s
ize);
/** Remove correlation between the channels by modifying the phase and poss
ibly
adding noise in a way that is not (or little) perceptible.
* @param st Decorrelator state
* @param in Input audio in interleaved format
* @param out Result of the decorrelation (out *may* alias in)
* @param strength How much alteration of the audio to apply from 0 to 100.
*/
void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_int
16_t *out, int strength);
/** Destroy a Decorrelation state
* @param st State to destroy
*/
void speex_decorrelate_destroy(SpeexDecorrState *st);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @}*/ /** @}*/
#endif #endif
 End of changes. 6 change blocks. 
3 lines changed or deleted 54 lines changed or added


 speex_header.h   speex_header.h 
skipping to change at line 85 skipping to change at line 85
/** Initializes a SpeexHeader using basic information */ /** Initializes a SpeexHeader using basic information */
void speex_init_header(SpeexHeader *header, int rate, int nb_channels, cons t struct SpeexMode *m); void speex_init_header(SpeexHeader *header, int rate, int nb_channels, cons t struct SpeexMode *m);
/** Creates the header packet from the header itself (mostly involves endia nness conversion) */ /** Creates the header packet from the header itself (mostly involves endia nness conversion) */
char *speex_header_to_packet(SpeexHeader *header, int *size); char *speex_header_to_packet(SpeexHeader *header, int *size);
/** Creates a SpeexHeader from a packet */ /** Creates a SpeexHeader from a packet */
SpeexHeader *speex_packet_to_header(char *packet, int size); SpeexHeader *speex_packet_to_header(char *packet, int size);
/** Frees the memory allocated by either speex_header_to_packet() or speex_
packet_to_header() */
void speex_header_free(void *ptr);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} */ /** @} */
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 4 lines changed or added


 speex_jitter.h   speex_jitter.h 
skipping to change at line 44 skipping to change at line 44
*/ */
#ifndef SPEEX_JITTER_H #ifndef SPEEX_JITTER_H
#define SPEEX_JITTER_H #define SPEEX_JITTER_H
/** @defgroup JitterBuffer JitterBuffer: Adaptive jitter buffer /** @defgroup JitterBuffer JitterBuffer: Adaptive jitter buffer
* This is the jitter buffer that reorders UDP/RTP packets and adjusts the buffer size * This is the jitter buffer that reorders UDP/RTP packets and adjusts the buffer size
* to maintain good quality and low latency. * to maintain good quality and low latency.
* @{ * @{
*/ */
#include "speex.h" #include "speex/speex_types.h"
#include "speex_bits.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** Generic adaptive jitter buffer state */ /** Generic adaptive jitter buffer state */
struct JitterBuffer_; struct JitterBuffer_;
/** Generic adaptive jitter buffer state */ /** Generic adaptive jitter buffer state */
typedef struct JitterBuffer_ JitterBuffer; typedef struct JitterBuffer_ JitterBuffer;
/** Definition of an incoming packet */ /** Definition of an incoming packet */
typedef struct _JitterBufferPacket JitterBufferPacket; typedef struct _JitterBufferPacket JitterBufferPacket;
/** Definition of an incoming packet */ /** Definition of an incoming packet */
struct _JitterBufferPacket { struct _JitterBufferPacket {
char *data; /**< Data bytes contained in the packet */ char *data; /**< Data bytes contained in the packet */
spx_uint32_t len; /**< Length of the packet in bytes */ spx_uint32_t len; /**< Length of the packet in bytes */
spx_uint32_t timestamp; /**< Timestamp for the packet */ spx_uint32_t timestamp; /**< Timestamp for the packet */
spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */ spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherw
ise) */
spx_uint32_t user_data; /**< Put whatever data you like here (it's igno
red by the jitter buffer) */
}; };
/** Packet has been retrieved */ /** Packet has been retrieved */
#define JITTER_BUFFER_OK 0 #define JITTER_BUFFER_OK 0
/** Packet is missing */ /** Packet is lost or is late */
#define JITTER_BUFFER_MISSING 1 #define JITTER_BUFFER_MISSING 1
/** Packet is incomplete (does not cover the entive tick */ /** A "fake" packet is meant to be inserted here to increase buffering */
#define JITTER_BUFFER_INCOMPLETE 2 #define JITTER_BUFFER_INSERTION 2
/** There was an error in the jitter buffer */ /** There was an error in the jitter buffer */
#define JITTER_BUFFER_INTERNAL_ERROR -1 #define JITTER_BUFFER_INTERNAL_ERROR -1
/** Invalid argument */ /** Invalid argument */
#define JITTER_BUFFER_BAD_ARGUMENT -2 #define JITTER_BUFFER_BAD_ARGUMENT -2
/** Set minimum amount of extra buffering required (margin) */ /** Set minimum amount of extra buffering required (margin) */
#define JITTER_BUFFER_SET_MARGIN 0 #define JITTER_BUFFER_SET_MARGIN 0
/** Get minimum amount of extra buffering required (margin) */ /** Get minimum amount of extra buffering required (margin) */
#define JITTER_BUFFER_GET_MARGIN 1 #define JITTER_BUFFER_GET_MARGIN 1
/* JITTER_BUFFER_SET_AVALIABLE_COUNT wouldn't make sense */ /* JITTER_BUFFER_SET_AVAILABLE_COUNT wouldn't make sense */
/** Get the amount of avaliable packets currently buffered */
/** Get the amount of available packets currently buffered */
#define JITTER_BUFFER_GET_AVAILABLE_COUNT 3
/** Included because of an early misspelling (will remove in next release)
*/
#define JITTER_BUFFER_GET_AVALIABLE_COUNT 3 #define JITTER_BUFFER_GET_AVALIABLE_COUNT 3
#define JITTER_BUFFER_ADJUST_INTERPOLATE -1 /** Assign a function to destroy unused packet. When setting that, the jitt
#define JITTER_BUFFER_ADJUST_OK 0 er
#define JITTER_BUFFER_ADJUST_DROP 1 buffer no longer copies packet data. */
#define JITTER_BUFFER_SET_DESTROY_CALLBACK 4
/** */
#define JITTER_BUFFER_GET_DESTROY_CALLBACK 5
/** Tell the jitter buffer to only adjust the delay in multiples of the ste
p parameter provided */
#define JITTER_BUFFER_SET_DELAY_STEP 6
/** */
#define JITTER_BUFFER_GET_DELAY_STEP 7
/** Tell the jitter buffer to only do concealment in multiples of the size
parameter provided */
#define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8
#define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9
/** Absolute max amount of loss that can be tolerated regardless of the del
ay. Typical loss
should be half of that or less. */
#define JITTER_BUFFER_SET_MAX_LATE_RATE 10
#define JITTER_BUFFER_GET_MAX_LATE_RATE 11
/** Equivalent cost of one percent late packet in timestamp units */
#define JITTER_BUFFER_SET_LATE_COST 12
#define JITTER_BUFFER_GET_LATE_COST 13
/** Initialises jitter buffer /** Initialises jitter buffer
* *
* @param tick Number of samples per "tick", i.e. the time period of the el * @param step_size Starting value for the size of concleanment packets and
ements that will be retrieved delay
adjustment steps. Can be changed at any time using JITTER_BUFFER_SET
_DELAY_STEP
and JITTER_BUFFER_GET_CONCEALMENT_SIZE.
* @return Newly created jitter buffer state * @return Newly created jitter buffer state
*/ */
JitterBuffer *jitter_buffer_init(int tick); JitterBuffer *jitter_buffer_init(int step_size);
/** Restores jitter buffer to its original state /** Restores jitter buffer to its original state
* *
* @param jitter Jitter buffer state * @param jitter Jitter buffer state
*/ */
void jitter_buffer_reset(JitterBuffer *jitter); void jitter_buffer_reset(JitterBuffer *jitter);
/** Destroys jitter buffer /** Destroys jitter buffer
* *
* @param jitter Jitter buffer state * @param jitter Jitter buffer state
skipping to change at line 121 skipping to change at line 147
* *
* @param jitter Jitter buffer state * @param jitter Jitter buffer state
* @param packet Incoming packet * @param packet Incoming packet
*/ */
void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pack et); void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pack et);
/** Get one packet from the jitter buffer /** Get one packet from the jitter buffer
* *
* @param jitter Jitter buffer state * @param jitter Jitter buffer state
* @param packet Returned packet * @param packet Returned packet
* @param desired_span Number of samples (or units) we wish to get from the buffer (no guarantee)
* @param current_timestamp Timestamp for the returned packet * @param current_timestamp Timestamp for the returned packet
*/ */
int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx
_int32_t *start_offset); _int32_t desired_span, spx_int32_t *start_offset);
/** Used right after jitter_buffer_get() to obtain another packet that woul
d have the same timestamp.
* This is mainly useful for media where a single "frame" can be split into
several packets.
*
* @param jitter Jitter buffer state
* @param packet Returned packet
*/
int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *pac
ket);
/** Get pointer timestamp of jitter buffer /** Get pointer timestamp of jitter buffer
* *
* @param jitter Jitter buffer state * @param jitter Jitter buffer state
*/ */
int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter); int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter);
/** Advance by one tick /** Advance by one tick
* *
* @param jitter Jitter buffer state * @param jitter Jitter buffer state
*/ */
void jitter_buffer_tick(JitterBuffer *jitter); void jitter_buffer_tick(JitterBuffer *jitter);
/** Telling the jitter buffer about the remaining data in the application b
uffer
* @param jitter Jitter buffer state
* @param rem Amount of data buffered by the application (timestamp units)
*/
void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem);
/** Used like the ioctl function to control the jitter buffer parameters /** Used like the ioctl function to control the jitter buffer parameters
* *
* @param jitter Jitter buffer state * @param jitter Jitter buffer state
* @param request ioctl-type request (one of the JITTER_BUFFER_* macros) * @param request ioctl-type request (one of the JITTER_BUFFER_* macros)
* @param ptr Data exchanged to-from function * @param ptr Data exchanged to-from function
* @return 0 if no error, -1 if request in unknown * @return 0 if no error, -1 if request in unknown
*/ */
int jitter_buffer_ctl(JitterBuffer *jitter, int request, void *ptr); int jitter_buffer_ctl(JitterBuffer *jitter, int request, void *ptr);
int jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket *pa cket, spx_int32_t *start_offset); int jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket *pa cket, spx_int32_t *start_offset);
/* @} */ /* @} */
/** @defgroup SpeexJitter SpeexJitter: Adaptive jitter buffer specifically
for Speex
* This is the jitter buffer that reorders UDP/RTP packets and adjusts the
buffer size
* to maintain good quality and low latency. This is a simplified version t
hat works only
* with Speex, but is much easier to use.
* @{
*/
/** Speex jitter-buffer state. Never use it directly! */
typedef struct SpeexJitter {
SpeexBits current_packet; /**< Current Speex packet */
int valid_bits; /**< True if Speex bits are valid */
JitterBuffer *packets; /**< Generic jitter buffer state */
void *dec; /**< Pointer to Speex decoder */
spx_int32_t frame_size; /**< Frame size of Speex decoder */
} SpeexJitter;
/** Initialise jitter buffer
*
* @param jitter State of the Speex jitter buffer
* @param decoder Speex decoder to call
* @param sampling_rate Sampling rate used by the decoder
*/
void speex_jitter_init(SpeexJitter *jitter, void *decoder, int sampling_rat
e);
/** Destroy jitter buffer */
void speex_jitter_destroy(SpeexJitter *jitter);
/** Put one packet into the jitter buffer */
void speex_jitter_put(SpeexJitter *jitter, char *packet, int len, int times
tamp);
/** Get one packet from the jitter buffer */
void speex_jitter_get(SpeexJitter *jitter, spx_int16_t *out, int *start_off
set);
/** Get pointer timestamp of jitter buffer */
int speex_jitter_get_pointer_timestamp(SpeexJitter *jitter);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* @} */
#endif #endif
 End of changes. 13 change blocks. 
58 lines changed or deleted 68 lines changed or added


 speex_preprocess.h   speex_preprocess.h 
skipping to change at line 110 skipping to change at line 110
/** Set preprocessor Automatic Gain Control state */ /** Set preprocessor Automatic Gain Control state */
#define SPEEX_PREPROCESS_SET_AGC 2 #define SPEEX_PREPROCESS_SET_AGC 2
/** Get preprocessor Automatic Gain Control state */ /** Get preprocessor Automatic Gain Control state */
#define SPEEX_PREPROCESS_GET_AGC 3 #define SPEEX_PREPROCESS_GET_AGC 3
/** Set preprocessor Voice Activity Detection state */ /** Set preprocessor Voice Activity Detection state */
#define SPEEX_PREPROCESS_SET_VAD 4 #define SPEEX_PREPROCESS_SET_VAD 4
/** Get preprocessor Voice Activity Detection state */ /** Get preprocessor Voice Activity Detection state */
#define SPEEX_PREPROCESS_GET_VAD 5 #define SPEEX_PREPROCESS_GET_VAD 5
/** Set preprocessor Automatic Gain Control level */ /** Set preprocessor Automatic Gain Control level (float) */
#define SPEEX_PREPROCESS_SET_AGC_LEVEL 6 #define SPEEX_PREPROCESS_SET_AGC_LEVEL 6
/** Get preprocessor Automatic Gain Control level */ /** Get preprocessor Automatic Gain Control level (float) */
#define SPEEX_PREPROCESS_GET_AGC_LEVEL 7 #define SPEEX_PREPROCESS_GET_AGC_LEVEL 7
/** Set preprocessor dereverb state */ /** Set preprocessor dereverb state */
#define SPEEX_PREPROCESS_SET_DEREVERB 8 #define SPEEX_PREPROCESS_SET_DEREVERB 8
/** Get preprocessor dereverb state */ /** Get preprocessor dereverb state */
#define SPEEX_PREPROCESS_GET_DEREVERB 9 #define SPEEX_PREPROCESS_GET_DEREVERB 9
/** Set preprocessor dereverb level */ /** Set preprocessor dereverb level */
#define SPEEX_PREPROCESS_SET_DEREVERB_LEVEL 10 #define SPEEX_PREPROCESS_SET_DEREVERB_LEVEL 10
/** Get preprocessor dereverb level */ /** Get preprocessor dereverb level */
skipping to change at line 178 skipping to change at line 178
/** Get maximal gain decrease in dB/second (int32) */ /** Get maximal gain decrease in dB/second (int32) */
#define SPEEX_PREPROCESS_GET_AGC_DECREMENT 29 #define SPEEX_PREPROCESS_GET_AGC_DECREMENT 29
/** Set maximal gain in dB (int32) */ /** Set maximal gain in dB (int32) */
#define SPEEX_PREPROCESS_SET_AGC_MAX_GAIN 30 #define SPEEX_PREPROCESS_SET_AGC_MAX_GAIN 30
/** Get maximal gain in dB (int32) */ /** Get maximal gain in dB (int32) */
#define SPEEX_PREPROCESS_GET_AGC_MAX_GAIN 31 #define SPEEX_PREPROCESS_GET_AGC_MAX_GAIN 31
/* Can't set loudness */
/** Get loudness */
#define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 33
/* Can't set gain */
/** Get current gain (int32 percent) */
#define SPEEX_PREPROCESS_GET_AGC_GAIN 35
/* Can't set spectrum size */
/** Get spectrum size for power spectrum (int32) */
#define SPEEX_PREPROCESS_GET_PSD_SIZE 37
/* Can't set power spectrum */
/** Get power spectrum (int32[] of squared values) */
#define SPEEX_PREPROCESS_GET_PSD 39
/* Can't set noise size */
/** Get spectrum size for noise estimate (int32) */
#define SPEEX_PREPROCESS_GET_NOISE_PSD_SIZE 41
/* Can't set noise estimate */
/** Get noise estimate (int32[] of squared values) */
#define SPEEX_PREPROCESS_GET_NOISE_PSD 43
/* Can't set speech probability */
/** Get speech probability in last frame (int32). */
#define SPEEX_PREPROCESS_GET_PROB 45
/** Set preprocessor Automatic Gain Control level (int32) */
#define SPEEX_PREPROCESS_SET_AGC_TARGET 46
/** Get preprocessor Automatic Gain Control level (int32) */
#define SPEEX_PREPROCESS_GET_AGC_TARGET 47
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @}*/ /** @}*/
#endif #endif
 End of changes. 3 change blocks. 
2 lines changed or deleted 35 lines changed or added


 speex_resampler.h   speex_resampler.h 
skipping to change at line 73 skipping to change at line 73
#define speex_resampler_set_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_set_ra te) #define speex_resampler_set_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_set_ra te)
#define speex_resampler_get_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_get_ra te) #define speex_resampler_get_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_get_ra te)
#define speex_resampler_set_rate_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_s et_rate_frac) #define speex_resampler_set_rate_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_s et_rate_frac)
#define speex_resampler_get_ratio CAT_PREFIX(RANDOM_PREFIX,_resampler_get_r atio) #define speex_resampler_get_ratio CAT_PREFIX(RANDOM_PREFIX,_resampler_get_r atio)
#define speex_resampler_set_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_set _quality) #define speex_resampler_set_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_set _quality)
#define speex_resampler_get_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_get _quality) #define speex_resampler_get_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_get _quality)
#define speex_resampler_set_input_stride CAT_PREFIX(RANDOM_PREFIX,_resample r_set_input_stride) #define speex_resampler_set_input_stride CAT_PREFIX(RANDOM_PREFIX,_resample r_set_input_stride)
#define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resample r_get_input_stride) #define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resample r_get_input_stride)
#define speex_resampler_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampl er_set_output_stride) #define speex_resampler_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampl er_set_output_stride)
#define speex_resampler_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampl er_get_output_stride) #define speex_resampler_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampl er_get_output_stride)
#define speex_resampler_get_input_latency CAT_PREFIX(RANDOM_PREFIX,_resampl
er_get_input_latency)
#define speex_resampler_get_output_latency CAT_PREFIX(RANDOM_PREFIX,_resamp
ler_get_output_latency)
#define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip _zeros) #define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip _zeros)
#define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset _mem) #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset _mem)
#define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerr or) #define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerr or)
#define spx_int16_t short #define spx_int16_t short
#define spx_int32_t int #define spx_int32_t int
#define spx_uint16_t unsigned short #define spx_uint16_t unsigned short
#define spx_uint32_t unsigned int #define spx_uint32_t unsigned int
#else /* OUTSIDE_SPEEX */ #else /* OUTSIDE_SPEEX */
skipping to change at line 302 skipping to change at line 304
void speex_resampler_set_output_stride(SpeexResamplerState *st, void speex_resampler_set_output_stride(SpeexResamplerState *st,
spx_uint32_t stride); spx_uint32_t stride);
/** Get the output stride. /** Get the output stride.
* @param st Resampler state copied * @param st Resampler state copied
* @param stride Output stride * @param stride Output stride
*/ */
void speex_resampler_get_output_stride(SpeexResamplerState *st, void speex_resampler_get_output_stride(SpeexResamplerState *st,
spx_uint32_t *stride); spx_uint32_t *stride);
/** Get the latency in input samples introduced by the resampler.
* @param st Resampler state
*/
int speex_resampler_get_input_latency(SpeexResamplerState *st);
/** Get the latency in output samples introduced by the resampler.
* @param st Resampler state
*/
int speex_resampler_get_output_latency(SpeexResamplerState *st);
/** Make sure that the first samples to go out of the resamplers don't have /** Make sure that the first samples to go out of the resamplers don't have
* leading zeros. This is only useful before starting to use a newly create d * leading zeros. This is only useful before starting to use a newly create d
* resampler. It is recommended to use that when resampling an audio file, as * resampler. It is recommended to use that when resampling an audio file, as
* it will generate a file with the same length. For real-time processing, * it will generate a file with the same length. For real-time processing,
* it is probably easier not to use this call (so that the output duration * it is probably easier not to use this call (so that the output duration
* is the same for the first frame). * is the same for the first frame).
* @param st Resampler state * @param st Resampler state
*/ */
int speex_resampler_skip_zeros(SpeexResamplerState *st); int speex_resampler_skip_zeros(SpeexResamplerState *st);
 End of changes. 2 change blocks. 
0 lines changed or deleted 14 lines changed or added


 speex_stereo.h   speex_stereo.h 
skipping to change at line 49 skipping to change at line 49
* @{ * @{
*/ */
#include "speex/speex_types.h" #include "speex/speex_types.h"
#include "speex/speex_bits.h" #include "speex/speex_bits.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** State used for decoding (intensity) stereo information */ /** If you access any of these fields directly, I'll personally come and bi te you */
typedef struct SpeexStereoState { typedef struct SpeexStereoState {
float balance; /**< Left/right balance info */ float balance; /**< Left/right balance info */
float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(rig ht)] */ float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(rig ht)] */
float smooth_left; /**< Smoothed left channel gain */ float smooth_left; /**< Smoothed left channel gain */
float smooth_right; /**< Smoothed right channel gain */ float smooth_right; /**< Smoothed right channel gain */
float reserved1; /**< Reserved for future use */ float reserved1; /**< Reserved for future use */
float reserved2; /**< Reserved for future use */ float reserved2; /**< Reserved for future use */
} SpeexStereoState; } SpeexStereoState;
/** Initialization value for a stereo state */ /** Deprecated. Use speex_stereo_state_init() instead. */
#define SPEEX_STEREO_STATE_INIT {1,.5,1,1,0,0} #define SPEEX_STEREO_STATE_INIT {1,.5,1,1,0,0}
/** Initialise/create a stereo stereo state */
SpeexStereoState *speex_stereo_state_init();
/** Reset/re-initialise an already allocated stereo state */
void speex_stereo_state_reset(SpeexStereoState *stereo);
/** Destroy a stereo stereo state */
void speex_stereo_state_destroy(SpeexStereoState *stereo);
/** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */ /** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */
void speex_encode_stereo(float *data, int frame_size, SpeexBits *bits); void speex_encode_stereo(float *data, int frame_size, SpeexBits *bits);
/** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */ /** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */
void speex_encode_stereo_int(spx_int16_t *data, int frame_size, SpeexBits * bits); void speex_encode_stereo_int(spx_int16_t *data, int frame_size, SpeexBits * bits);
/** Transforms a mono frame into a stereo frame using intensity stereo info */ /** Transforms a mono frame into a stereo frame using intensity stereo info */
void speex_decode_stereo(float *data, int frame_size, SpeexStereoState *ste reo); void speex_decode_stereo(float *data, int frame_size, SpeexStereoState *ste reo);
/** Transforms a mono frame into a stereo frame using intensity stereo info */ /** Transforms a mono frame into a stereo frame using intensity stereo info */
 End of changes. 3 change blocks. 
2 lines changed or deleted 11 lines changed or added


 speex_types.h   speex_types.h 
skipping to change at line 15 skipping to change at line 15
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* * * *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* by the Xiph.Org Foundation http://www.xiph.org/ * * by the Xiph.Org Foundation http://www.xiph.org/ *
* * * *
******************************************************************** ********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal. function: #ifdef jail to whip a few platforms into the UNIX ideal.
last mod: $Id: os_types.h 7524 2004-08-11 04:20:36Z conrad $ last mod: $Id: speex_types.h 2002 2008-06-10 14:09:37Z nanang $
********************************************************************/ ********************************************************************/
/** /**
@file speex_types.h @file speex_types.h
@brief Speex types @brief Speex types
*/ */
#ifndef _SPEEX_TYPES_H #ifndef _SPEEX_TYPES_H
#define _SPEEX_TYPES_H #define _SPEEX_TYPES_H
#if defined(_WIN32) #if defined(_WIN32)
skipping to change at line 59 skipping to change at line 59
# endif # endif
#elif defined(__MACOS__) #elif defined(__MACOS__)
# include <sys/types.h> # include <sys/types.h>
typedef SInt16 spx_int16_t; typedef SInt16 spx_int16_t;
typedef UInt16 spx_uint16_t; typedef UInt16 spx_uint16_t;
typedef SInt32 spx_int32_t; typedef SInt32 spx_int32_t;
typedef UInt32 spx_uint32_t; typedef UInt32 spx_uint32_t;
#elif defined(__MACOSX__) /* MacOS X Framework build */ #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h> # include <sys/types.h>
typedef int16_t spx_int16_t; typedef int16_t spx_int16_t;
typedef u_int16_t spx_uint16_t; typedef u_int16_t spx_uint16_t;
typedef int32_t spx_int32_t; typedef int32_t spx_int32_t;
typedef u_int32_t spx_uint32_t; typedef u_int32_t spx_uint32_t;
#elif defined(__BEOS__) #elif defined(__BEOS__)
/* Be */ /* Be */
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 splitcomb.h   splitcomb.h 
/* $Id: splitcomb.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: splitcomb.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 31 skipping to change at line 31
/** /**
* @file splitcomb.h * @file splitcomb.h
* @brief Media channel splitter/combiner port. * @brief Media channel splitter/combiner port.
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
/** /**
* @addtogroup PJMEDIA_SPLITCOMB Media channel splitter/combiner * @addtogroup PJMEDIA_SPLITCOMB Media channel splitter/combiner
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief Split and combine media channels in media streams * @brief Split and combine multiple mono-channel media ports into
* a single multiple-channels media port
* @{ * @{
*
* This section describes media port to split and combine media * This section describes media port to split and combine media
* channels in the stream. * channels in the stream.
* *
* A splitter/combiner splits a single stereo/multichannels audio frame int o * A splitter/combiner splits a single stereo/multichannels audio frame int o
* multiple audio frames to each channel when put_frame() is called, * multiple audio frames to each channel when put_frame() is called,
* and combines mono frames from each channel into a stereo/multichannel * and combines mono frames from each channel into a stereo/multichannel
* frame when get_frame() is called. A common application for the splitter/ * frame when get_frame() is called. A common application for the splitter/
* combiner is to split frames from stereo to mono and vise versa. * combiner is to split frames from stereo to mono and vise versa.
*/ */
 End of changes. 4 change blocks. 
3 lines changed or deleted 5 lines changed or added


 srv_resolver.h   srv_resolver.h 
/* $Id: srv_resolver.h 1357 2007-06-11 16:51:18Z bennylp $ */ /* $Id: srv_resolver.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 35 skipping to change at line 35
*/ */
#include <pjlib-util/resolver.h> #include <pjlib-util/resolver.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJ_DNS_SRV_RESOLVER DNS SRV Resolution Helper * @defgroup PJ_DNS_SRV_RESOLVER DNS SRV Resolution Helper
* @ingroup PJ_DNS * @ingroup PJ_DNS
* @{ * @{
* *
* \subsection PJ_DNS_SRV_RESOLVER_INTRO DNS SRV Resolution Helper * \section PJ_DNS_SRV_RESOLVER_INTRO DNS SRV Resolution Helper
* *
* This module provides an even higher layer of abstraction for the DNS * This module provides an even higher layer of abstraction for the DNS
* resolution framework, to resolve DNS SRV names. * resolution framework, to resolve DNS SRV names.
* *
* The #pj_dns_srv_resolve() function will asynchronously resolve the serve r * The #pj_dns_srv_resolve() function will asynchronously resolve the serve r
* name into IP address(es) with a single function call. If the SRV name * name into IP address(es) with a single function call. If the SRV name
* contains multiple names, then each will be resolved with individual * contains multiple names, then each will be resolved with individual
* DNS A resolution to get the IP addresses. Upon successful completion, * DNS A resolution to get the IP addresses. Upon successful completion,
* application callback will be called with each IP address of the * application callback will be called with each IP address of the
* target selected based on the load-balancing and fail-over criteria * target selected based on the load-balancing and fail-over criteria
skipping to change at line 78 skipping to change at line 78
* argument of the callback. * argument of the callback.
* *
* \section PJ_DNS_SRV_RESOLVER_REFERENCE Reference * \section PJ_DNS_SRV_RESOLVER_REFERENCE Reference
* *
* Reference: * Reference:
* - <A HREF="http://www.ietf.org/rfc/rfc2782.txt">RFC 2782</A>: * - <A HREF="http://www.ietf.org/rfc/rfc2782.txt">RFC 2782</A>:
* A DNS RR for specifying the location of services (DNS SRV) * A DNS RR for specifying the location of services (DNS SRV)
*/ */
/** /**
* Flags to be specified when starting the DNS SRV query.
*/
typedef enum pj_dns_srv_option
{
/**
* Specify if the resolver should fallback with DNS A
* resolution when the SRV resolution fails. This option may
* be specified together with PJ_DNS_SRV_FALLBACK_AAAA to
* make the resolver fallback to AAAA if SRV resolution fails,
* and then to DNS A resolution if the AAAA resolution fails.
*/
PJ_DNS_SRV_FALLBACK_A = 1,
/**
* Specify if the resolver should fallback with DNS AAAA
* resolution when the SRV resolution fails. This option may
* be specified together with PJ_DNS_SRV_FALLBACK_A to
* make the resolver fallback to AAAA if SRV resolution fails,
* and then to DNS A resolution if the AAAA resolution fails.
*/
PJ_DNS_SRV_FALLBACK_AAAA = 2,
/**
* Specify if the resolver should try to resolve with DNS AAAA
* resolution first of each targets in the DNS SRV record. If
* this option is not specified, the SRV resolver will query
* the DNS A record for the target instead.
*/
PJ_DNS_SRV_RESOLVE_AAAA = 4
} pj_dns_srv_option;
/**
* This structure represents DNS SRV records as the result of DNS SRV * This structure represents DNS SRV records as the result of DNS SRV
* resolution using #pj_dns_srv_resolve(). * resolution using #pj_dns_srv_resolve().
*/ */
typedef struct pj_dns_srv_record typedef struct pj_dns_srv_record
{ {
/** Number of address records. */ /** Number of address records. */
unsigned count; unsigned count;
/** Address records. */ /** Address records. */
struct struct
v { {
/** Server priority (the lower the higher the priority). */ /** Server priority (the lower the higher the priority). */
unsigned priority; unsigned priority;
/** Server weight (the higher the more load it can handle). */ /** Server weight (the higher the more load it can handle). */
unsigned weight; unsigned weight;
/** Port number. */ /** Port number. */
pj_uint16_t port; pj_uint16_t port;
/** The host address. */ /** The host address. */
skipping to change at line 126 skipping to change at line 159
* *
* @param domain_name The domain name part of the name. * @param domain_name The domain name part of the name.
* @param res_name The full service name, including the transport name * @param res_name The full service name, including the transport name
* and with all the leading underscore characters and * and with all the leading underscore characters and
* ending dot (e.g. "_sip._udp.", "_stun._udp."). * ending dot (e.g. "_sip._udp.", "_stun._udp.").
* @param def_port The port number to be assigned to the resolved addre ss * @param def_port The port number to be assigned to the resolved addre ss
* when the DNS SRV resolution fails and the name is * when the DNS SRV resolution fails and the name is
* resolved with DNS A resolution. * resolved with DNS A resolution.
* @param pool Memory pool used to allocate memory for the query. * @param pool Memory pool used to allocate memory for the query.
* @param resolver The resolver instance. * @param resolver The resolver instance.
* @param fallback_a Specify if the resolver should fallback with DNS A * @param option Option flags, which can be constructed from
* resolution when the SRV resolution fails. * #pj_dns_srv_option bitmask. Note that this argument
* was called "fallback_a" in pjsip version 0.8.0 and
* older, but the new option should be backward
* compatible with existing applications. If applicatio
n
* specifies PJ_TRUE as "fallback_a" value, it will
* correspond to PJ_DNS_SRV_FALLBACK_A option.
* @param token Arbitrary data to be associated with this qu ery when * @param token Arbitrary data to be associated with this qu ery when
* the calback is called. * the calback is called.
* @param cb Pointer to callback function to receive the * @param cb Pointer to callback function to receive the
* notification when the resolution process completes. * notification when the resolution process completes.
* @param p_query Optional pointer to receive the query object, if one * @param p_query Optional pointer to receive the query object, if one
* was started. If this pointer is specified, a NULL ma y * was started. If this pointer is specified, a NULL ma y
* be returned if response cache is available immediate ly. * be returned if response cache is available immediate ly.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
*/ */
PJ_DECL(pj_status_t) pj_dns_srv_resolve(const pj_str_t *domain_name, PJ_DECL(pj_status_t) pj_dns_srv_resolve(const pj_str_t *domain_name,
const pj_str_t *res_name, const pj_str_t *res_name,
unsigned def_port, unsigned def_port,
pj_pool_t *pool, pj_pool_t *pool,
pj_dns_resolver *resolver, pj_dns_resolver *resolver,
pj_bool_t fallback_a, unsigned option,
void *token, void *token,
pj_dns_srv_resolver_cb *cb, pj_dns_srv_resolver_cb *cb,
pj_dns_async_query **p_query); pj_dns_async_query **p_query);
/** /**
* @} * @}
*/ */
PJ_END_DECL PJ_END_DECL
 End of changes. 7 change blocks. 
7 lines changed or deleted 46 lines changed or added


 stdarg.h   stdarg.h 
/* $Id: stdarg.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: stdarg.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 stdfileio.h   stdfileio.h 
/* $Id: stdfileio.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: stdfileio.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 stream.h   stream.h 
/* $Id: stream.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: stream.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 40 skipping to change at line 40
#include <pjmedia/port.h> #include <pjmedia/port.h>
#include <pjmedia/rtcp.h> #include <pjmedia/rtcp.h>
#include <pjmedia/transport.h> #include <pjmedia/transport.h>
#include <pj/sock.h> #include <pj/sock.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJMED_STRM Streams * @defgroup PJMED_STRM Streams
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief Media port for communicating with remote peer via the network. * @brief Communicating with remote peer via the network
* @{ * @{
* *
* A media stream is a bidirectional multimedia communication between two * A media stream is a bidirectional multimedia communication between two
* endpoints. It corresponds to a media description (m= line) in SDP * endpoints. It corresponds to a media description (m= line) in SDP
* session descriptor. * session descriptor.
* *
* A media stream consists of two unidirectional channels: * A media stream consists of two unidirectional channels:
* - encoding channel, which transmits unidirectional media to remote, and * - encoding channel, which transmits unidirectional media to remote, and
* - decoding channel, which receives unidirectional media from remote. * - decoding channel, which receives unidirectional media from remote.
* *
* A media stream exports media port interface (see @ref PJMEDIA_PORT_CONCE PT) * A media stream exports media port interface (see @ref PJMEDIA_PORT)
* and application normally uses this interface to interconnect the stream * and application normally uses this interface to interconnect the stream
* to other PJMEDIA components. * to other PJMEDIA components.
* *
* A media stream internally manages the following objects: * A media stream internally manages the following objects:
* - an instance of media codec (see @ref PJMEDIA_CODEC), * - an instance of media codec (see @ref PJMEDIA_CODEC),
* - an @ref PJMED_JBUF, * - an @ref PJMED_JBUF,
* - two instances of RTP sessions (#pjmedia_rtp_session, one for each * - two instances of RTP sessions (#pjmedia_rtp_session, one for each
* direction), * direction),
* - one instance of RTCP session (#pjmedia_rtcp_session), * - one instance of RTCP session (#pjmedia_rtcp_session),
* - and a reference to media transport to send and receive packets * - and a reference to media transport to send and receive packets
* to/from the network (see @ref PJMEDIA_TRANSPORT_H). * to/from the network (see @ref PJMEDIA_TRANSPORT).
* *
* Streams are created by calling #pjmedia_stream_create(), specifying * Streams are created by calling #pjmedia_stream_create(), specifying
* #pjmedia_stream_info structure in the parameter. Application can constru ct * #pjmedia_stream_info structure in the parameter. Application can constru ct
* the #pjmedia_stream_info structure manually, or use * the #pjmedia_stream_info structure manually, or use
* #pjmedia_stream_info_from_sdp() or #pjmedia_session_info_from_sdp() * #pjmedia_stream_info_from_sdp() or #pjmedia_session_info_from_sdp()
* functions to construct the #pjmedia_stream_info from local and remote * functions to construct the #pjmedia_stream_info from local and remote
* SDP session descriptors. * SDP session descriptors.
* *
* Application can also use @ref PJMEDIA_SESSION to indirectly create the * Application can also use @ref PJMEDIA_SESSION to indirectly create the
* streams. * streams.
skipping to change at line 90 skipping to change at line 90
typedef struct pjmedia_channel pjmedia_channel; typedef struct pjmedia_channel pjmedia_channel;
/** /**
* This structure describes media stream information. Each media stream * This structure describes media stream information. Each media stream
* corresponds to one "m=" line in SDP session descriptor, and it has * corresponds to one "m=" line in SDP session descriptor, and it has
* its own RTP/RTCP socket pair. * its own RTP/RTCP socket pair.
*/ */
struct pjmedia_stream_info struct pjmedia_stream_info
{ {
pjmedia_type type; /**< Media type (audio, video) */ pjmedia_type type; /**< Media type (audio, video) */
pjmedia_tp_proto proto; /**< Transport protocol (RTP/AVP, etc.) */
pjmedia_dir dir; /**< Media direction. */ pjmedia_dir dir; /**< Media direction. */
pj_sockaddr_in rem_addr; /**< Remote RTP address pj_sockaddr rem_addr; /**< Remote RTP address
*/ */
pj_sockaddr_in rem_rtcp; /**< Optional remote RTCP address. If pj_sockaddr rem_rtcp; /**< Optional remote RTCP addres
s. If
sin_family is zero, the RTP address sin_family is zero, the RTP address
will be calculated from RTP. */ will be calculated from RTP. */
#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
pj_bool_t rtcp_xr_enabled;
/**< Specify whether RTCP XR is enabled.
*/
pj_uint32_t rtcp_xr_interval; /**< RTCP XR interval.
*/
pj_sockaddr rtcp_xr_dest;/**<Additional remote RTCP XR a
ddress.
This is useful for third-party (e.g
:
network monitor) to monitor the
stream. If sin_family is zero,
this will be ignored.
*/
#endif
pjmedia_codec_info fmt; /**< Incoming codec format info. */ pjmedia_codec_info fmt; /**< Incoming codec format info. */
pjmedia_codec_param *param; /**< Optional codec param. */ pjmedia_codec_param *param; /**< Optional codec param. */
unsigned tx_pt; /**< Outgoing codec paylaod type. */ unsigned tx_pt; /**< Outgoing codec paylaod type. */
int tx_event_pt;/**< Outgoing pt for telephone-e vents. */ int tx_event_pt;/**< Outgoing pt for telephone-e vents. */
int rx_event_pt;/**< Incoming pt for telephone-e vents. */ int rx_event_pt;/**< Incoming pt for telephone-e vents. */
pj_uint32_t ssrc; /**< RTP SSRC. */ pj_uint32_t ssrc; /**< RTP SSRC. */
int jb_init; /**< Jitter buffer init delay in msec. int jb_init; /**< Jitter buffer init delay in msec.
(-1 for default). */ (-1 for default). */
int jb_min_pre; /**< Jitter buffer minimum prefe tch int jb_min_pre; /**< Jitter buffer minimum prefe tch
delay in msec (-1 for default). */ delay in msec (-1 for default). */
skipping to change at line 199 skipping to change at line 210
* Get the stream statistics. * Get the stream statistics.
* *
* @param stream The media stream. * @param stream The media stream.
* @param stat Media stream statistics. * @param stat Media stream statistics.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_stream_get_stat( const pjmedia_stream *stream, PJ_DECL(pj_status_t) pjmedia_stream_get_stat( const pjmedia_stream *stream,
pjmedia_rtcp_stat *stat); pjmedia_rtcp_stat *stat);
#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
/**
* Get the stream extended report statistics (RTCP XR).
*
* @param stream The media stream.
* @param stat Media stream extended report statistics.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_stream_get_stat_xr( const pjmedia_stream *stre
am,
pjmedia_rtcp_xr_stat *stat)
;
#endif
/** /**
* Pause the individual channel in the stream. * Pause the individual channel in the stream.
* *
* @param stream The media channel. * @param stream The media channel.
* @param dir Which direction to pause. * @param dir Which direction to pause.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_stream_pause( pjmedia_stream *stream, PJ_DECL(pj_status_t) pjmedia_stream_pause( pjmedia_stream *stream,
pjmedia_dir dir); pjmedia_dir dir);
 End of changes. 9 change blocks. 
8 lines changed or deleted 40 lines changed or added


 string.h   string.h 
/* $Id: string.h 1397 2007-06-28 00:50:10Z bennylp $ */ /* $Id: string.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 471 skipping to change at line 471
* @param chr The character to find. * @param chr The character to find.
* *
* @return the pointer to first character found, or NULL. * @return the pointer to first character found, or NULL.
*/ */
PJ_INLINE(char*) pj_strchr( const pj_str_t *str, int chr) PJ_INLINE(char*) pj_strchr( const pj_str_t *str, int chr)
{ {
return (char*) memchr((char*)str->ptr, chr, str->slen); return (char*) memchr((char*)str->ptr, chr, str->slen);
} }
/** /**
* Find the occurence of a substring substr in string str.
*
* @param str The string to search.
* @param substr The string to search fo.
*
* @return the pointer to the position of substr in str, or NULL. Note
* that if str is not NULL terminated, the returned pointer
* is pointing to non-NULL terminated string.
*/
PJ_DECL(char*) pj_strstr(const pj_str_t *str, const pj_str_t *substr);
/**
* Performs substring lookup like pj_strstr() but ignores the case of
* both strings.
*
* @param str The string to search.
* @param substr The string to search fo.
*
* @return the pointer to the position of substr in str, or NULL. Note
* that if str is not NULL terminated, the returned pointer
* is pointing to non-NULL terminated string.
*/
PJ_DECL(char*) pj_stristr(const pj_str_t *str, const pj_str_t *substr);
/**
* Remove (trim) leading whitespaces from the string. * Remove (trim) leading whitespaces from the string.
* *
* @param str The string. * @param str The string.
* *
* @return the string. * @return the string.
*/ */
PJ_DECL(pj_str_t*) pj_strltrim( pj_str_t *str ); PJ_DECL(pj_str_t*) pj_strltrim( pj_str_t *str );
/** /**
* Remove (trim) the trailing whitespaces from the string. * Remove (trim) the trailing whitespaces from the string.
skipping to change at line 498 skipping to change at line 523
/** /**
* Remove (trim) leading and trailing whitespaces from the string. * Remove (trim) leading and trailing whitespaces from the string.
* *
* @param str The string. * @param str The string.
* *
* @return the string. * @return the string.
*/ */
PJ_IDECL(pj_str_t*) pj_strtrim( pj_str_t *str ); PJ_IDECL(pj_str_t*) pj_strtrim( pj_str_t *str );
/** /**
* Initialize the buffer with some random string. * Initialize the buffer with some random string. Note that the
* generated string is not NULL terminated.
* *
* @param str the string to store the result. * @param str the string to store the result.
* @param length the length of the random string to generate. * @param length the length of the random string to generate.
* *
* @return the string. * @return the string.
*/ */
PJ_DECL(char*) pj_create_random_string(char *str, pj_size_t length); PJ_DECL(char*) pj_create_random_string(char *str, pj_size_t length);
/** /**
* Convert string to unsigned integer. * Convert string to unsigned integer.
 End of changes. 4 change blocks. 
3 lines changed or deleted 29 lines changed or added


 string_i.h   string_i.h 
/* $Id: string_i.h 1527 2007-10-26 09:02:28Z bennylp $ */ /* $Id: string_i.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 stun_auth.h   stun_auth.h 
/* $Id: stun_auth.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: stun_auth.h 1877 2008-03-19 23:00:30Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 40 skipping to change at line 40
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @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
* @{ * @{
*/ */
/** /**
* Type of authentication.
*/
typedef enum pj_stun_auth_type
{
/**
* No authentication.
*/
PJ_STUN_AUTH_NONE = 0,
/**
* Authentication using short term credential.
*/
PJ_STUN_AUTH_SHORT_TERM = 1,
/**
* Authentication using long term credential.
*/
PJ_STUN_AUTH_LONG_TERM = 2
} pj_stun_auth_type;
/**
* Type of authentication data in the credential. * Type of authentication data in the credential.
*/ */
typedef enum pj_stun_auth_cred_type typedef enum pj_stun_auth_cred_type
{ {
/** /**
* The credential data contains a static credential to be matched * The credential data contains a static credential to be matched
* against the credential in the message. A static credential can be * against the credential in the message. A static credential can be
* used as both client side or server side authentication. * used as both client side or server side authentication.
*/ */
PJ_STUN_AUTH_CRED_STATIC, PJ_STUN_AUTH_CRED_STATIC,
skipping to change at line 62 skipping to change at line 84
* The credential data contains callbacks to be called to verify the * The credential data contains callbacks to be called to verify the
* credential in the message. A dynamic credential is suitable when * credential in the message. A dynamic credential is suitable when
* performing server side authentication where server does not know * performing server side authentication where server does not know
* in advance the identity of the user requesting authentication. * in advance the identity of the user requesting authentication.
*/ */
PJ_STUN_AUTH_CRED_DYNAMIC PJ_STUN_AUTH_CRED_DYNAMIC
} pj_stun_auth_cred_type; } pj_stun_auth_cred_type;
/** /**
* Type of encoding applied to the password stored in the credential.
*/
typedef enum pj_stun_passwd_type
{
/**
* Plain text password.
*/
PJ_STUN_PASSWD_PLAIN = 0,
/**
* Hashed password, valid for long term credential only. The hash value
* of the password is calculated as MD5(USERNAME ":" REALM ":" PASSWD)
* with all quotes removed from the username and realm values.
*/
PJ_STUN_PASSWD_HASHED = 1
} pj_stun_passwd_type;
/**
* This structure contains the descriptions needed to perform server side * This structure contains the descriptions needed to perform server side
* authentication. Depending on the \a type set in the structure, applicati on * authentication. Depending on the \a type set in the structure, applicati on
* may specify a static username/password combination, or to have callbacks * may specify a static username/password combination, or to have callbacks
* called by the function to authenticate the credential dynamically. * called by the function to authenticate the credential dynamically.
*/ */
typedef struct pj_stun_auth_cred typedef struct pj_stun_auth_cred
{ {
/** /**
* The type of authentication information in this structure. * The type of authentication information in this structure.
*/ */
skipping to change at line 89 skipping to change at line 130
/** /**
* This structure contains static data for performing authentication . * This structure contains static data for performing authentication .
* A non-empty realm indicates whether short term or long term * A non-empty realm indicates whether short term or long term
* credential is used. * credential is used.
*/ */
struct struct
{ {
/** /**
* If not-empty, it indicates that this is a long term credentia l. * If not-empty, it indicates that this is a long term credentia l.
*/ */
pj_str_t realm; pj_str_t realm;
/** /**
* The username of the credential. * The username of the credential.
*/ */
pj_str_t username; pj_str_t username;
/** /**
* Data type to indicate the type of password in the \a data fie ld. * Data type to indicate the type of password in the \a data fie ld.
* Value zero indicates that the data contains a plaintext
* password.
*/ */
int data_type; pj_stun_passwd_type data_type;
/** /**
* The data, which depends depends on the value of \a data_type * The data, which depends depends on the value of \a data_type
* field. When \a data_type is zero, this field will contain the * field. When \a data_type is zero, this field will contain the
* plaintext password. * plaintext password.
*/ */
pj_str_t data; pj_str_t data;
/** /**
* Optional NONCE. * Optional NONCE.
*/ */
pj_str_t nonce; pj_str_t nonce;
} static_cred; } static_cred;
/** /**
* This structure contains callback to be called by the framework * This structure contains callback to be called by the framework
* to authenticate the incoming message. * to authenticate the incoming message.
*/ */
struct struct
{ {
/** /**
skipping to change at line 156 skipping to change at line 195
* @return The callback should return PJ_SUCCESS, or * @return The callback should return PJ_SUCCESS, or
* otherwise response message will not be * otherwise response message will not be
* created. * created.
*/ */
pj_status_t (*get_auth)(void *user_data, pj_status_t (*get_auth)(void *user_data,
pj_pool_t *pool, pj_pool_t *pool,
pj_str_t *realm, pj_str_t *realm,
pj_str_t *nonce); pj_str_t *nonce);
/** /**
* Get the credential to be put in outgoing message. * Get the credential to be put in outgoing request.
* *
* @param msg The outgoing message where the credential is * @param msg The outgoing message where the credential is
* to be applied. * to be applied.
* @param user_data The user data as specified in the credential . * @param user_data The user data as specified in the credential .
* @param pool Pool where the callback can allocate memory * @param pool Pool where the callback can allocate memory
* to fill in the credential. * to fill in the credential.
* @param realm On return, the callback may specify the real m * @param realm On return, the callback may specify the real m
* if long term credential is desired, otherwis e * if long term credential is desired, otherwis e
* this string must be set to empty. * this string must be set to empty.
* @param username On return, the callback must fill in with th e * @param username On return, the callback must fill in with th e
skipping to change at line 186 skipping to change at line 225
* *
* @return The callback must return PJ_SUCCESS, otherwi se * @return The callback must return PJ_SUCCESS, otherwi se
* the message transmission will be cancelled. * the message transmission will be cancelled.
*/ */
pj_status_t (*get_cred)(const pj_stun_msg *msg, pj_status_t (*get_cred)(const pj_stun_msg *msg,
void *user_data, void *user_data,
pj_pool_t *pool, pj_pool_t *pool,
pj_str_t *realm, pj_str_t *realm,
pj_str_t *username, pj_str_t *username,
pj_str_t *nonce, pj_str_t *nonce,
int *data_type, pj_stun_passwd_type *data_type,
pj_str_t *data); pj_str_t *data);
/** /**
* Get the password for the specified username. This function * Get the password for the specified username. This function
* is also used to check whether the username is valid. * is also used to check whether the username is valid.
* *
* @param msg The STUN message where the password will be * @param msg The STUN message where the password will be
* applied to. * applied to.
* @param user_data The user data as specified in the credential . * @param user_data The user data as specified in the credential .
* @param realm The realm as specified in the message. * @param realm The realm as specified in the message.
skipping to change at line 217 skipping to change at line 256
* username has been successfully verified * username has been successfully verified
* and password was obtained. If non-PJ_SUCCESS * and password was obtained. If non-PJ_SUCCESS
* is returned, it is assumed that the * is returned, it is assumed that the
* username is not valid. * username is not valid.
*/ */
pj_status_t (*get_password)(const pj_stun_msg *msg, pj_status_t (*get_password)(const pj_stun_msg *msg,
void *user_data, void *user_data,
const pj_str_t *realm, const pj_str_t *realm,
const pj_str_t *username, const pj_str_t *username,
pj_pool_t *pool, pj_pool_t *pool,
int *data_type, pj_stun_passwd_type *data_type,
pj_str_t *data); pj_str_t *data);
/** /**
* This callback will be called to verify that the NONCE given * This callback will be called to verify that the NONCE given
* in the message can be accepted. If this callback returns * in the message can be accepted. If this callback returns
* PJ_FALSE, 438 (Stale Nonce) response will be created. * PJ_FALSE, 438 (Stale Nonce) response will be created.
* *
* This callback is optional. * This callback is optional.
* *
* @param msg The STUN message where the nonce was receive d. * @param msg The STUN message where the nonce was receive d.
skipping to change at line 249 skipping to change at line 288
const pj_str_t *username, const pj_str_t *username,
const pj_str_t *nonce); const pj_str_t *nonce);
} dyn_cred; } dyn_cred;
} data; } data;
} pj_stun_auth_cred; } pj_stun_auth_cred;
/** /**
* This structure contains the credential information that is found and
* used to authenticate incoming requests. Application may use this
* information when generating authentication for the outgoing response.
*/
typedef struct pj_stun_req_cred_info
{
/**
* The REALM value found in the incoming request. If short term
* credential is used, the value will be empty.
*/
pj_str_t realm;
/**
* The USERNAME value found in the incoming request.
*/
pj_str_t username;
/**
* Optional NONCE.
*/
pj_str_t nonce;
/**
* Authentication key that was used to authenticate the incoming
* request. This key is created with #pj_stun_create_key(), and
* it can be used to encode the credential of the outgoing
* response.
*/
pj_str_t auth_key;
} pj_stun_req_cred_info;
/**
* Duplicate authentication credential. * Duplicate authentication credential.
* *
* @param pool Pool to be used to allocate memory. * @param pool Pool to be used to allocate memory.
* @param dst Destination credential. * @param dst Destination credential.
* @param src Source credential. * @param src Source credential.
*/ */
PJ_DECL(void) pj_stun_auth_cred_dup(pj_pool_t *pool, PJ_DECL(void) pj_stun_auth_cred_dup(pj_pool_t *pool,
pj_stun_auth_cred *dst, pj_stun_auth_cred *dst,
const pj_stun_auth_cred *src); const pj_stun_auth_cred *src);
/** /**
* Duplicate request credential.
*
* @param pool Pool to be used to allocate memory.
* @param dst Destination credential.
* @param src Source credential.
*/
PJ_DECL(void) pj_stun_req_cred_info_dup(pj_pool_t *pool,
pj_stun_req_cred_info *dst,
const pj_stun_req_cred_info *src);
/**
* Create authentication key to be used for encoding the message with
* MESSAGE-INTEGRITY. If short term credential is used (i.e. the realm
* argument is NULL or empty), the key will be copied from the password.
* If long term credential is used, the key will be calculated from the
* MD5 hash of the realm, username, and password.
*
* @param pool Pool to allocate memory for the key.
* @param key String to receive the key.
* @param realm The realm of the credential, if long term cr
edential
* is to be used. If short term credential is wanted,
* application can put NULL or empty string here.
* @param username The username.
* @param data_type Password encoding.
* @param data The password.
*/
PJ_DECL(void) pj_stun_create_key(pj_pool_t *pool,
pj_str_t *key,
const pj_str_t *realm,
const pj_str_t *username,
pj_stun_passwd_type data_type,
const pj_str_t *data);
/**
* Verify credential in the STUN request. Note that before calling this * Verify credential in the STUN request. Note that before calling this
* function, application must have checked that the message contains * function, application must have checked that the message contains
* PJ_STUN_ATTR_MESSAGE_INTEGRITY attribute by calling pj_stun_msg_find_att r() * PJ_STUN_ATTR_MESSAGE_INTEGRITY attribute by calling pj_stun_msg_find_att r()
* function, because this function will reject the message with 401 error * function, because this function will reject the message with 401 error
* if it doesn't contain PJ_STUN_ATTR_MESSAGE_INTEGRITY attribute. * if it doesn't contain PJ_STUN_ATTR_MESSAGE_INTEGRITY attribute.
* *
* @param pkt The original packet which has been parsed into * @param pkt The original packet which has been parsed into
* the message. This packet MUST NOT have been modified * the message. This packet MUST NOT have been modified
* after the parsing. * after the parsing.
* @param pkt_len The length of the packet. * @param pkt_len The length of the packet.
* @param msg The parsed message to be verified. * @param msg The parsed message to be verified.
* @param cred Pointer to credential to be used to authenticate * @param cred Pointer to credential to be used to authenticate
* the message. * the message.
* @param pool If response is to be created, then memory will * @param pool If response is to be created, then memory will
* be allocated from this pool. * be allocated from this pool.
* @param info Optional pointer to receive authentication informati
on
* found in the request and the credential that is used
* to authenticate the request.
* @param p_response Optional pointer to receive the response message * @param p_response Optional pointer to receive the response message
* then the credential in the request fails to * then the credential in the request fails to
* authenticate. * authenticate.
* *
* @return PJ_SUCCESS if credential is verified successfully. * @return PJ_SUCCESS if credential is verified successfully.
* If the verification fails and \a p_response is not * If the verification fails and \a p_response is not
* NULL, an appropriate response will be returned in * NULL, an appropriate response will be returned in
* \a p_response. * \a p_response.
*/ */
PJ_DECL(pj_status_t) pj_stun_authenticate_request(const pj_uint8_t *pkt, PJ_DECL(pj_status_t) pj_stun_authenticate_request(const pj_uint8_t *pkt,
unsigned pkt_len, unsigned pkt_len,
const pj_stun_msg *msg, const pj_stun_msg *msg,
pj_stun_auth_cred *cred, pj_stun_auth_cred *cred,
pj_pool_t *pool, pj_pool_t *pool,
pj_stun_req_cred_info *inf o,
pj_stun_msg **p_response); pj_stun_msg **p_response);
/** /**
* Determine if STUN message can be authenticated. Some STUN error * Determine if STUN message can be authenticated. Some STUN error
* responses cannot be authenticated since they cannot contain STUN * responses cannot be authenticated since they cannot contain STUN
* MESSAGE-INTEGRITY attribute. STUN Indication messages also cannot * MESSAGE-INTEGRITY attribute. STUN Indication messages also cannot
* be authenticated. * be authenticated.
* *
* @param msg The STUN message. * @param msg The STUN message.
* *
 End of changes. 16 change blocks. 
11 lines changed or deleted 123 lines changed or added


 stun_config.h   stun_config.h 
/* $Id: stun_config.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: stun_config.h 1988 2008-06-06 14:47:10Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 28 skipping to change at line 28
*/ */
#ifndef __PJNATH_STUN_CONFIG_H__ #ifndef __PJNATH_STUN_CONFIG_H__
#define __PJNATH_STUN_CONFIG_H__ #define __PJNATH_STUN_CONFIG_H__
/** /**
* @file stun_config.h * @file stun_config.h
* @brief STUN endpoint. * @brief STUN endpoint.
*/ */
#include <pjnath/stun_msg.h> #include <pjnath/stun_msg.h>
#include <pj/assert.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
* @{ * @{
skipping to change at line 101 skipping to change at line 103
cfg->pf = factory; cfg->pf = factory;
cfg->options = options; cfg->options = options;
cfg->ioqueue = ioqueue; cfg->ioqueue = ioqueue;
cfg->timer_heap = timer_heap; cfg->timer_heap = timer_heap;
cfg->rto_msec = PJ_STUN_RTO_VALUE; cfg->rto_msec = PJ_STUN_RTO_VALUE;
cfg->res_cache_msec = PJ_STUN_RES_CACHE_DURATION; cfg->res_cache_msec = PJ_STUN_RES_CACHE_DURATION;
} }
/** /**
* Check that STUN config is valid.
*/
PJ_INLINE(pj_status_t) pj_stun_config_check_valid(const pj_stun_config *cfg
)
{
PJ_ASSERT_RETURN(cfg->ioqueue && cfg->pf && cfg->timer_heap &&
cfg->rto_msec && cfg->res_cache_msec, PJ_EINVAL);
return PJ_SUCCESS;
}
/**
* @} * @}
*/ */
PJ_END_DECL PJ_END_DECL
#endif /* __PJNATH_STUN_CONFIG_H__ */ #endif /* __PJNATH_STUN_CONFIG_H__ */
 End of changes. 3 change blocks. 
1 lines changed or deleted 14 lines changed or added


 stun_msg.h   stun_msg.h 
/* $Id: stun_msg.h 1443 2007-09-20 11:30:30Z bennylp $ */ /* $Id: stun_msg.h 2044 2008-06-21 17:51:31Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 35 skipping to change at line 35
*/ */
#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
* @brief Low-level representation and parsing of STUN messages.
* @ingroup PJNATH_STUN * @ingroup PJNATH_STUN
* @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
/** /**
* STUN method constants. * STUN method constants.
skipping to change at line 66 skipping to change at line 66
* STUN Shared Secret method as defined by RFC 3489-bis. * STUN Shared Secret method as defined by RFC 3489-bis.
*/ */
PJ_STUN_SHARED_SECRET_METHOD = 2, PJ_STUN_SHARED_SECRET_METHOD = 2,
/** /**
* STUN/TURN Allocate method as defined by draft-ietf-behave-turn * STUN/TURN Allocate method as defined by draft-ietf-behave-turn
*/ */
PJ_STUN_ALLOCATE_METHOD = 3, PJ_STUN_ALLOCATE_METHOD = 3,
/** /**
* STUN/TURN Send Indication as defined by draft-ietf-behave-turn * STUN/TURN Refresh method as defined by draft-ietf-behave-turn
*/ */
PJ_STUN_SEND_INDICATION_METHOD = 4, PJ_STUN_REFRESH_METHOD = 4,
/** /**
* STUN/TURN Data Indication as defined by draft-ietf-behave-turn * STUN/TURN Send indication as defined by draft-ietf-behave-turn
*/ */
PJ_STUN_DATA_INDICATION_METHOD = 5, PJ_STUN_SEND_METHOD = 6,
/** /**
* STUN/TURN Set Active Destination as defined by draft-ietf-behave-tur n * STUN/TURN Data indication as defined by draft-ietf-behave-turn
*/ */
PJ_STUN_SET_ACTIVE_DESTINATION_METHOD = 6, PJ_STUN_DATA_METHOD = 7,
/** /**
* STUN/TURN Connect method as defined by draft-ietf-behave-turn * STUN/TURN ChannelBind as defined by draft-ietf-behave-turn
*/ */
PJ_STUN_CONNECT_METHOD = 7, PJ_STUN_CHANNEL_BIND_METHOD = 9,
/** /**
* STUN/TURN Connect Status indication method. * All known methods.
*/ */
PJ_STUN_CONNECT_STATUS_METHOD = 8 PJ_STUN_METHOD_MAX
}; };
/** /**
* Retrieve the STUN method from the message-type field of the STUN * Retrieve the STUN method from the message-type field of the STUN
* message. * message.
*/ */
#define PJ_STUN_GET_METHOD(msg_type) ((msg_type) & 0xFEEF) #define PJ_STUN_GET_METHOD(msg_type) ((msg_type) & 0xFEEF)
/** /**
* STUN message classes constants. * STUN message classes constants.
skipping to change at line 136 skipping to change at line 136
#define PJ_STUN_IS_REQUEST(msg_type) (((msg_type) & 0x0110) == 0x0000) #define PJ_STUN_IS_REQUEST(msg_type) (((msg_type) & 0x0110) == 0x0000)
/** /**
* Determine if the message type is a successful response. * Determine if the message type is a successful response.
*/ */
#define PJ_STUN_IS_SUCCESS_RESPONSE(msg_type) (((msg_type) & 0x0110) == 0x0 100) #define PJ_STUN_IS_SUCCESS_RESPONSE(msg_type) (((msg_type) & 0x0110) == 0x0 100)
/** /**
* The response bit in the message type. * The response bit in the message type.
*/ */
#define PJ_STUN_RESPONSE_BIT (0x0100) #define PJ_STUN_SUCCESS_RESPONSE_BIT (0x0100)
/** /**
* Determine if the message type is an error response. * Determine if the message type is an error response.
*/ */
#define PJ_STUN_IS_ERROR_RESPONSE(msg_type) (((msg_type) & 0x0110) == 0x011 0) #define PJ_STUN_IS_ERROR_RESPONSE(msg_type) (((msg_type) & 0x0110) == 0x011 0)
/** /**
* The error response bit in the message type. * The error response bit in the message type.
*/ */
#define PJ_STUN_ERROR_RESPONSE_BIT (0x0110) #define PJ_STUN_ERROR_RESPONSE_BIT (0x0110)
skipping to change at line 214 skipping to change at line 214
* Successful response to STUN/TURN Allocate Request * Successful response to STUN/TURN Allocate Request
*/ */
PJ_STUN_ALLOCATE_RESPONSE = 0x0103, PJ_STUN_ALLOCATE_RESPONSE = 0x0103,
/** /**
* Failure response to STUN/TURN Allocate Request * Failure response to STUN/TURN Allocate Request
*/ */
PJ_STUN_ALLOCATE_ERROR_RESPONSE = 0x0113, PJ_STUN_ALLOCATE_ERROR_RESPONSE = 0x0113,
/** /**
* STUN/TURN Send Indication * STUN/TURN REFRESH Request
*/
PJ_STUN_SEND_INDICATION = 0x0014,
/**
* STUN/TURN Data Indication
*/ */
PJ_STUN_DATA_INDICATION = 0x0015, PJ_STUN_REFRESH_REQUEST = 0x0004,
/** /**
* STUN/TURN Set Active Destination Request * Successful response to STUN REFRESH request
*/ */
PJ_STUN_SET_ACTIVE_DESTINATION_REQUEST = 0x0006, PJ_STUN_REFRESH_RESPONSE = 0x0104,
/** /**
* STUN/TURN Set Active Destination Response * Error response to STUN REFRESH request.
*/ */
PJ_STUN_SET_ACTIVE_DESTINATION_RESPONSE = 0x0106, PJ_STUN_REFRESH_ERROR_RESPONSE = 0x0114,
/** /**
* STUN/TURN Set Active Destination Error Response * TURN Send indication
*/ */
PJ_STUN_SET_ACTIVE_DESTINATION_ERROR_RESPONSE = 0x0116, PJ_STUN_SEND_INDICATION = 0x0016,
/** /**
* STUN/TURN Connect Request * TURN Data indication
*/ */
PJ_STUN_CONNECT_REQUEST = 0x0007, PJ_STUN_DATA_INDICATION = 0x0017,
/** /**
* STUN/TURN Connect Response * STUN/TURN ChannelBind Request
*/ */
PJ_STUN_CONNECT_RESPONSE = 0x0107, PJ_STUN_CHANNEL_BIND_REQUEST = 0x0009,
/** /**
* STUN/TURN Connect Error Response * Successful response to STUN ChannelBind request
*/ */
PJ_STUN_CONNECT_ERROR_RESPONSE = 0x0117, PJ_STUN_CHANNEL_BIND_RESPONSE = 0x0109,
/** /**
* STUN/TURN Connect Status Indication * Error response to STUN ChannelBind request.
*/ */
PJ_STUN_CONNECT_STATUS_INDICATION = 0x0018 PJ_STUN_CHANNEL_BIND_ERROR_RESPONSE = 0x0119
} pj_stun_msg_type; } pj_stun_msg_type;
/** /**
* This enumeration describes STUN attribute types. * This enumeration describes STUN attribute types.
*/ */
typedef enum pj_stun_attr_type typedef enum pj_stun_attr_type
{ {
PJ_STUN_ATTR_MAPPED_ADDR = 0x0001,/**< MAPPED-ADDRESS. */ PJ_STUN_ATTR_MAPPED_ADDR = 0x0001,/**< MAPPED-ADDRESS. */
PJ_STUN_ATTR_RESPONSE_ADDR = 0x0002,/**< RESPONSE-ADDRESS (deprcatd )*/ PJ_STUN_ATTR_RESPONSE_ADDR = 0x0002,/**< RESPONSE-ADDRESS (deprcatd )*/
PJ_STUN_ATTR_CHANGE_REQUEST = 0x0003,/**< CHANGE-REQUEST (de precated)*/ PJ_STUN_ATTR_CHANGE_REQUEST = 0x0003,/**< CHANGE-REQUEST (de precated)*/
PJ_STUN_ATTR_SOURCE_ADDR = 0x0004,/**< SOURCE-ADDRESS (deprecated )*/ PJ_STUN_ATTR_SOURCE_ADDR = 0x0004,/**< SOURCE-ADDRESS (deprecated )*/
PJ_STUN_ATTR_CHANGED_ADDR = 0x0005,/**< CHANGED-ADDRESS (deprecatd )*/ PJ_STUN_ATTR_CHANGED_ADDR = 0x0005,/**< CHANGED-ADDRESS (deprecatd )*/
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_LIFETIME = 0x000D,/**< LIFETIME attribute. PJ_STUN_ATTR_CHANNEL_NUMBER = 0x000C,/**< TURN CHANNEL-NUMBE
*/ R */
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,/**< BANDWIDTH attribute PJ_STUN_ATTR_BANDWIDTH = 0x0010,/**< TURN BANDWIDTH attr.
*/ */
PJ_STUN_ATTR_REMOTE_ADDR = 0x0012,/**< REMOTE-ADDRESS attribute PJ_STUN_ATTR_PEER_ADDR = 0x0012,/**< TURN PEER-ADDRESS attr.
*/ */
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_RELAY_ADDR = 0x0016,/**< RELAY-ADDRESS attribute. */ PJ_STUN_ATTR_RELAY_ADDR = 0x0016,/**< RELAY-ADDRESS attribute. */
PJ_STUN_ATTR_REQ_ADDR_TYPE = 0x0017,/**< REQUESTED-ADDRESS-TYPE */ PJ_STUN_ATTR_REQ_ADDR_TYPE = 0x0017,/**< REQUESTED-ADDRESS-TYPE */
PJ_STUN_ATTR_REQ_PORT_PROPS = 0x0018,/**< REQUESTED-PORT-PRO PS */ PJ_STUN_ATTR_REQ_PROPS = 0x0018,/**< REQUESTED-PROPS */
PJ_STUN_ATTR_REQ_TRANSPORT = 0x0019,/**< REQUESTED-TRANSPORT */ PJ_STUN_ATTR_REQ_TRANSPORT = 0x0019,/**< REQUESTED-TRANSPORT */
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_REQ_IP = 0x0022,/**< REQUESTED-IP attri bute */ 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_XOR_INTERNAL_ADDR = 0x0026,/**< XOR-INTERNAL-ADDRESS */ PJ_STUN_ATTR_XOR_INTERNAL_ADDR = 0x0026,/**< XOR-INTERNAL-ADDRESS */
PJ_STUN_ATTR_END_MANDATORY_ATTR, PJ_STUN_ATTR_END_MANDATORY_ATTR,
PJ_STUN_ATTR_START_EXTENDED_ATTR= 0x8021, PJ_STUN_ATTR_START_EXTENDED_ATTR= 0x8021,
PJ_STUN_ATTR_SERVER = 0x8022,/**< SERVER attribute. */ PJ_STUN_ATTR_SERVER = 0x8022,/**< SERVER attribute. */
skipping to change at line 329 skipping to change at line 325
#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_NO_BINDING = 437, /**< No Binding. */ 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_UNSUPP_TRANSPORT_PROTO = 442, /**< Unsupported Transport or PJ_STUN_SC_UNSUPP_TRANSPORT_PROTO = 442, /**< Unsupported Transport or
Protocol */ Protocol (TURN) */
PJ_STUN_SC_INVALID_IP_ADDR = 443, /**< Invalid IP Address PJ_STUN_SC_INVALID_IP_ADDR = 443, /**< Invalid IP Address(TURN
*/ )*/
PJ_STUN_SC_INVALID_PORT = 444, /**< Invalid Port 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 = 507, /**< Insufficient Capacity
(TURN) */ (TURN) */
PJ_STUN_SC_INSUFFICIENT_PORT_CAPACITY=508, /**< Insufficient Port Capa
city
(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
0 1 2 3 0 1 2 3
skipping to change at line 559 skipping to change at line 557
* data. * data.
*/ */
typedef struct pj_stun_binary_attr typedef struct pj_stun_binary_attr
{ {
/** /**
* Standard STUN attribute header. * Standard STUN attribute header.
*/ */
pj_stun_attr_hdr hdr; pj_stun_attr_hdr hdr;
/** /**
* Special signature to indicate that this is a valid attribute even
* though we don't have meta-data to describe this attribute.
*/
pj_uint32_t magic;
/**
* Length of the data. * Length of the data.
*/ */
unsigned length; unsigned length;
/** /**
* The raw data. * The raw data.
*/ */
pj_uint8_t *data; pj_uint8_t *data;
} pj_stun_binary_attr; } pj_stun_binary_attr;
skipping to change at line 810 skipping to change at line 814
typedef struct pj_stun_string_attr pj_stun_username_attr; typedef struct pj_stun_string_attr pj_stun_username_attr;
/** /**
* This describes STUN PASSWORD attribute. * This describes STUN PASSWORD attribute.
* If the message type is Shared Secret Response it MUST include the * If the message type is Shared Secret Response it MUST include the
* PASSWORD attribute. * PASSWORD attribute.
*/ */
typedef struct pj_stun_string_attr pj_stun_password_attr; typedef struct pj_stun_string_attr pj_stun_password_attr;
/** /**
* This describes TURN CHANNEL-NUMBER attribute. In this library,
* this attribute is represented with 32bit integer. Application may
* use #PJ_STUN_GET_CH_NB() and #PJ_STUN_SET_CH_NB() to extract/set
* channel number value from the 32bit integral value.
*
* The CHANNEL-NUMBER attribute contains the number of the channel.
* It is a 16-bit unsigned integer, followed by a two-octet RFFU field
* which MUST be set to 0 on transmission and ignored on reception.
\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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Channel Number | RFFU |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\endverbatim
*/
typedef struct pj_stun_uint_attr pj_stun_channel_number_attr;
/**
* Get 16bit channel number from 32bit integral value.
* Note that uint32 attributes are always stored in host byte order
* after they have been parsed from the PDU, so no need to do ntohs()
* here.
*/
#define PJ_STUN_GET_CH_NB(u32) ((pj_uint16_t)(u32>>16))
/**
* Convert 16bit channel number into 32bit integral value.
* Note that uint32 attributes will be converted to network byte order
* when the attribute is written to packet, so no need to do htons()
* here.
*/
#define PJ_STUN_SET_CH_NB(chnum) (((pj_uint32_t)chnum) << 16)
/**
* This describes STUN LIFETIME attribute. * This describes STUN LIFETIME attribute.
* The lifetime attribute represents the duration for which the server * The lifetime attribute represents the duration for which the server
* will maintain an allocation in the absence of data traffic either * will maintain an allocation in the absence of data traffic either
* from or to the client. It is a 32 bit value representing the number * from or to the client. It is a 32 bit value representing the number
* of seconds remaining until expiration. * of seconds remaining until expiration.
*/ */
typedef struct pj_stun_uint_attr pj_stun_lifetime_attr; typedef struct pj_stun_uint_attr pj_stun_lifetime_attr;
/** /**
* 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 REMOTE-ADDRESS attribute. * This describes the STUN PEER-ADDRESS attribute.
* The REMOTE-ADDRESS specifies the address and port of the peer as seen * The PEER-ADDRESS specifies the address and port of the peer as seen
* from the STUN relay server. * from the TURN server. It is encoded in the same way as XOR-MAPPED-
* ADDRESS.
*/ */
typedef struct pj_stun_sockaddr_attr pj_stun_remote_addr_attr; typedef struct pj_stun_sockaddr_attr pj_stun_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 RELAY-ADDRESS attribute. * This describes the STUN RELAY-ADDRESS attribute.
* The RELAY-ADDRESS is present in Allocate responses. It specifies the * The RELAY-ADDRESS is present in Allocate responses. It specifies the
* address and port that the server allocated to the client. * address and port that the server allocated to the client. It is
* encoded in the same way as XOR-MAPPED-ADDRESS.
*/ */
typedef struct pj_stun_sockaddr_attr pj_stun_relay_addr_attr; typedef struct pj_stun_sockaddr_attr pj_stun_relay_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
skipping to change at line 868 skipping to change at line 910
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;
/** /**
* This describes the STUN REQUESTED-PORT-PROPS attribute. * This describes the TURN REQUESTED-PROPS attribute, encoded as
* STUN 32bit integer attribute. Few macros are provided to manipulate
* the values in this attribute: #PJ_STUN_GET_PROP_TYPE(), and
* #PJ_STUN_SET_PROP_TYPE().
*
* This attribute allows the client to request certain properties for * This attribute allows the client to request certain properties for
* the port that is allocated by the server. The attribute can be used * the relayed transport address that is allocated by the server. The
* with any transport protocol that has the notion of a 16 bit port * attribute is 32 bits long. Its format is:
* space (including TCP and UDP). The attribute is 32 bits long. Its
* format is:
\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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved = 0 |B| A | | Prop-type | Reserved = 0 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\endverbatim \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 values of the "Prop-type" field are:
*
* 0x00 (Reserved)
* 0x01 Even port number
* 0x02 Pair of ports
*/
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)
/**
* Convert 8bit Prop-type value to a 32bit integral value of TURN
* REQUESTED-PROPS attribute.
*/ */
typedef struct pj_stun_uint_attr pj_stun_req_port_props_attr; #define PJ_STUN_SET_PROP_TYPE(PropType) (PropType << 24)
/** /**
* This describes the STUN REQUESTED-TRANSPORT attribute. * This describes the TURN REQUESTED-TRANSPORT attribute, encoded in
* 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 is a 32 bit * protocol for the allocated transport address. It has the following
* unsigned integer. Its values are: 0x0000 for UDP and 0x0000 for TCP. * format:
\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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Protocol | RFFU |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\endverbatim
* The Protocol field specifies the desired protocol. The codepoints
* used in this field are taken from those allowed in the Protocol field
* in the IPv4 header and the NextHeader field in the IPv6 header
* [Protocol-Numbers]. This specification only allows the use of
* codepoint 17 (User Datagram Protocol).
*
* The RFFU field is set to zero on transmission and ignored on
* receiption. It is reserved for future uses.
*/ */
typedef struct pj_stun_uint_attr pj_stun_req_transport_attr; typedef struct pj_stun_uint_attr pj_stun_req_transport_attr;
/** /**
* This describes the STUN REQUESTED-IP attribute. * Get protocol value from 32bit TURN REQUESTED-TRANSPORT attribute.
* The REQUESTED-IP attribute is used by the client to request that a */
* specific IP address be allocated to it. #define PJ_STUN_GET_RT_PROTO(u32) (u32 >> 24)
/**
* Convert protocol value to be placed in 32bit TURN REQUESTED-TRANSPORT
* attribute.
*/
#define PJ_STUN_SET_RT_PROTO(proto) (((pj_uint32_t)(proto)) << 24)
/**
* This describes the TURN RESERVATION-TOKEN attribute.
* The RESERVATION-TOKEN attribute contains a token that uniquely
* identifies a relayed transport address being held in reserve by the
* server. The server includes this attribute in a success response to
* tell the client about the token, and the client includes this
* attribute in a subsequent Allocate request to request the server use
* that relayed transport address for the allocation.
*
* The attribute value is a 64-bit-long field containing the token
* value.
*/ */
typedef struct pj_stun_sockaddr_attr pj_stun_req_ip_attr; typedef struct pj_stun_uint64_attr pj_stun_res_token_attr;
/** /**
* This describes the XOR-REFLECTED-FROM attribute, as described by * This describes the XOR-REFLECTED-FROM attribute, as described by
* draft-macdonald-behave-nat-behavior-discovery-00. * draft-macdonald-behave-nat-behavior-discovery-00.
* The XOR-REFLECTED-FROM attribute is used in place of the REFLECTED- * The XOR-REFLECTED-FROM attribute is used in place of the REFLECTED-
* FROM attribute. It provides the same information, but because the * FROM attribute. It provides the same information, but because the
* NAT's public address is obfuscated through the XOR function, It can * NAT's public address is obfuscated through the XOR function, It can
* pass through a NAT that would otherwise attempt to translate it to * pass through a NAT that would otherwise attempt to translate it to
* the private network address. XOR-REFLECTED-FROM has identical syntax * the private network address. XOR-REFLECTED-FROM has identical syntax
* to XOR-MAPPED-ADDRESS. * to XOR-MAPPED-ADDRESS.
skipping to change at line 1005 skipping to change at line 1109
* message by calling pj_stun_msg_check() before starting to * message by calling pj_stun_msg_check() before starting to
* decode the packet. * decode the packet.
*/ */
PJ_STUN_CHECK_PACKET = 2, PJ_STUN_CHECK_PACKET = 2,
/** /**
* This option current is only valid for #pj_stun_session_on_rx_pkt(). * This option current is only valid for #pj_stun_session_on_rx_pkt().
* When specified, it tells the session NOT to authenticate the * When specified, it tells the session NOT to authenticate the
* message. * message.
*/ */
PJ_STUN_NO_AUTHENTICATE = 4 PJ_STUN_NO_AUTHENTICATE = 4,
/**
* Disable FINGERPRINT verification. This option can be used when calli
ng
* #pj_stun_msg_check() and #pj_stun_msg_decode() to disable the
* verification of FINGERPRINT, for example when the STUN usage says wh
en
* FINGERPRINT mechanism shall not be used.
*/
PJ_STUN_NO_FINGERPRINT_CHECK = 8
}; };
/** /**
* Get STUN message method name. * Get STUN message method name.
* *
* @param msg_type The STUN message type (in host byte order) * @param msg_type The STUN message type (in host byte order)
* *
* @return The STUN message method name string. * @return The STUN message method name string.
*/ */
PJ_DECL(const char*) pj_stun_get_method_name(unsigned msg_type); PJ_DECL(const char*) pj_stun_get_method_name(unsigned msg_type);
skipping to change at line 1053 skipping to change at line 1165
/** /**
* Internal: set the padding character for string attribute. * Internal: set the padding character for string attribute.
* The default padding character is PJ_STUN_STRING_ATTR_PAD_CHR. * The default padding character is PJ_STUN_STRING_ATTR_PAD_CHR.
* *
* @return The previous padding character. * @return The previous padding character.
*/ */
PJ_DECL(int) pj_stun_set_padding_char(int chr); PJ_DECL(int) pj_stun_set_padding_char(int chr);
/** /**
* Initialize a generic STUN message.
*
* @param msg The message structure to be initialized.
* @param msg_type The 14bit message type (see pj_stun_msg_type
* constants).
* @param magic Magic value to be put to the mesage; for req
uests,
* the value normally should be PJ_STUN_MAGIC.
* @param tsx_id Optional transaction ID, or NULL to let the
* function generates a random transaction ID.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pj_stun_msg_init(pj_stun_msg *msg,
unsigned msg_type,
pj_uint32_t magic,
const pj_uint8_t tsx_id[12]);
/**
* Create a generic STUN message. * Create a generic STUN message.
* *
* @param pool Pool to create the STUN message. * @param pool Pool to create the STUN message.
* @param msg_type The 14bit message type. * @param msg_type The 14bit message type.
* @param magic Magic value to be put to the mesage; for req uests, * @param magic Magic value to be put to the mesage; for req uests,
* the value should be PJ_STUN_MAGIC. * the value should be PJ_STUN_MAGIC.
* @param tsx_id Optional transaction ID, or NULL to let the * @param tsx_id Optional transaction ID, or NULL to let the
* function generates a random transaction ID. * function generates a random transaction ID.
* @param p_msg Pointer to receive the message. * @param p_msg Pointer to receive the message.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pj_stun_msg_create(pj_pool_t *pool, PJ_DECL(pj_status_t) pj_stun_msg_create(pj_pool_t *pool,
unsigned msg_type, unsigned msg_type,
pj_uint32_t magic, pj_uint32_t magic,
const pj_uint8_t tsx_id[12], const pj_uint8_t tsx_id[12],
pj_stun_msg **p_msg); pj_stun_msg **p_msg);
/** /**
* Clone a STUN message with all of its attributes.
*
* @param pool Pool to allocate memory for the new message.
* @param msg The message to be cloned.
*
* @return The duplicate message.
*/
PJ_DECL(pj_stun_msg*) pj_stun_msg_clone(pj_pool_t *pool,
const pj_stun_msg *msg);
/**
* Create STUN response message. * Create STUN response message.
* *
* @param pool Pool to create the mesage. * @param pool Pool to create the mesage.
* @param req_msg The request message. * @param req_msg The request message.
* @param err_code STUN error code. If this value is not zero, * @param err_code STUN error code. If this value is not zero,
* then error response will be created, otherwise * then error response will be created, otherwise
* successful response will be created. * successful response will be created.
* @param err_msg Optional error message to explain err_code. * @param err_msg Optional error message to explain err_code.
* If this value is NULL and err_code is not zero, * If this value is NULL and err_code is not zero,
* the error string will be taken from the default * the error string will be taken from the default
skipping to change at line 1112 skipping to change at line 1253
PJ_DECL(pj_status_t) pj_stun_msg_add_attr(pj_stun_msg *msg, PJ_DECL(pj_status_t) pj_stun_msg_add_attr(pj_stun_msg *msg,
pj_stun_attr_hdr *attr); pj_stun_attr_hdr *attr);
/** /**
* Print the STUN message structure to a packet buffer, ready to be * Print the STUN message structure to a packet buffer, ready to be
* sent to remote destination. This function will take care about * sent to remote destination. This function will take care about
* calculating the MESSAGE-INTEGRITY digest as well as FINGERPRINT * calculating the MESSAGE-INTEGRITY digest as well as FINGERPRINT
* value, if these attributes are present in the message. * value, if these attributes are present in the message.
* *
* If application wants to apply credential to the message, it MUST * If application wants to apply credential to the message, it MUST
* include a blank MESSAGE-INTEGRITY attribute in the message, as the * include a blank MESSAGE-INTEGRITY attribute in the message as the
* last attribute or the attribute before FINGERPRINT. This function will * last attribute or the attribute before FINGERPRINT. This function will
* calculate the HMAC digest from the message using the supplied key in * calculate the HMAC digest from the message using the supplied key in
* the parameter. The key should be set to the password if short term * the parameter. The key should be set to the password if short term
* credential is used, or calculated from the MD5 hash of the realm, * credential is used, or calculated from the MD5 hash of the realm,
* username, and password using #pj_stun_create_key() if long term * username, and password using #pj_stun_create_key() if long term
* credential is used. * credential is used.
* *
* If FINGERPRINT attribute is present, this function will calculate * If FINGERPRINT attribute is present, this function will calculate
* the FINGERPRINT CRC attribute for the message. The FINGERPRINT MUST * the FINGERPRINT CRC attribute for the message. The FINGERPRINT MUST
* be added as the last attribute of the message. * be added as the last attribute of the message.
skipping to change at line 1140 skipping to change at line 1281
* @param key Authentication key to calculate MESSAGE-INTEGRITY * @param key Authentication key to calculate MESSAGE-INTEGRITY
* value. Application can create this key by using * value. Application can create this key by using
* #pj_stun_create_key() function. * #pj_stun_create_key() function.
* @param p_msg_len Upon return, it will be filed with the size of * @param p_msg_len Upon return, it will be filed with the size of
* the packet in bytes, or negative value on error. * the packet in bytes, or negative value on error.
* *
* @return PJ_SUCCESS on success or the appropriate error code. * @return PJ_SUCCESS on success or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_stun_msg_encode(pj_stun_msg *msg, PJ_DECL(pj_status_t) pj_stun_msg_encode(pj_stun_msg *msg,
pj_uint8_t *pkt_buf, pj_uint8_t *pkt_buf,
unsigned buf_size, pj_size_t buf_size,
unsigned options, unsigned options,
const pj_str_t *key, const pj_str_t *key,
unsigned *p_msg_len); pj_size_t *p_msg_len);
/**
* Create authentication key to be used for encoding the message with
* MESSAGE-INTEGRITY. If short term credential is used (i.e. the realm
* argument is NULL or empty), the key will be copied from the password.
* If long term credential is used, the key will be calculated from the
* MD5 hash of the realm, username, and password.
*
* @param pool Pool to allocate memory for the key.
* @param key String to receive the key.
* @param realm The realm of the credential, if long term cr
edential
* is to be used. If short term credential is wanted,
* application can put NULL or empty string here.
* @param username The username.
* @param passwd The clear text password.
*/
PJ_DECL(void) pj_stun_create_key(pj_pool_t *pool,
pj_str_t *key,
const pj_str_t *realm,
const pj_str_t *username,
const pj_str_t *passwd);
/** /**
* Check that the PDU is potentially a valid STUN message. This function * Check that the PDU is potentially a valid STUN message. This function
* is useful when application needs to multiplex STUN packets with other * is useful when application needs to multiplex STUN packets with other
* application traffic. When this function returns PJ_SUCCESS, there is a * application traffic. When this function returns PJ_SUCCESS, there is a
* big chance that the packet is a STUN packet. * big chance that the packet is a STUN packet.
* *
* Note that we cannot be sure that the PDU is a really valid STUN message * Note that we cannot be sure that the PDU is a really valid STUN message
* until we actually parse the PDU. * until we actually parse the PDU.
* *
skipping to change at line 1186 skipping to change at line 1306
* @param pdu_len The length of the packet buffer. * @param pdu_len The length of the packet buffer.
* @param options Additional options to be applied in the checking, * @param options Additional options to be applied in the checking,
* which can be taken from pj_stun_decode_options. One * which can be taken from pj_stun_decode_options. One
* of the useful option is PJ_STUN_IS_DATAGRAM which * of the useful option is PJ_STUN_IS_DATAGRAM which
* means that the pdu represents a whole STUN packet. * means that the pdu represents a whole STUN packet.
* *
* @return PJ_SUCCESS if the PDU is a potentially valid STUN * @return PJ_SUCCESS if the PDU is a potentially valid STUN
* message. * message.
*/ */
PJ_DECL(pj_status_t) pj_stun_msg_check(const pj_uint8_t *pdu, PJ_DECL(pj_status_t) pj_stun_msg_check(const pj_uint8_t *pdu,
unsigned pdu_len, unsigned options); pj_size_t pdu_len, unsigned options);
/** /**
* Decode incoming packet into STUN message. * Decode incoming packet into STUN message.
* *
* @param pool Pool to allocate the message. * @param pool Pool to allocate the message.
* @param pdu The incoming packet to be parsed. * @param pdu The incoming packet to be parsed.
* @param pdu_len The length of the incoming packet. * @param pdu_len The length of the incoming packet.
* @param options Parsing flags, according to pj_stun_decode_options. * @param options Parsing flags, according to pj_stun_decode_options.
* @param p_msg Pointer to receive the parsed message. * @param p_msg Pointer to receive the parsed message.
* @param p_parsed_len Optional pointer to receive how many bytes have * @param p_parsed_len Optional pointer to receive how many bytes have
skipping to change at line 1211 skipping to change at line 1331
* message, if one can be created. If the packet being * message, if one can be created. If the packet being
* decoded is a request message, and it contains error, * decoded is a request message, and it contains error,
* and a response can be created, then the STUN * and a response can be created, then the STUN
* response message will be returned on this argument. * response message will be returned on this argument.
* *
* @return PJ_SUCCESS if a STUN message has been successfully * @return PJ_SUCCESS if a STUN message has been successfully
* decoded. * decoded.
*/ */
PJ_DECL(pj_status_t) pj_stun_msg_decode(pj_pool_t *pool, PJ_DECL(pj_status_t) pj_stun_msg_decode(pj_pool_t *pool,
const pj_uint8_t *pdu, const pj_uint8_t *pdu,
unsigned pdu_len, pj_size_t pdu_len,
unsigned options, unsigned options,
pj_stun_msg **p_msg, pj_stun_msg **p_msg,
unsigned *p_parsed_len, pj_size_t *p_parsed_len,
pj_stun_msg **p_response); pj_stun_msg **p_response);
/** /**
* Dump STUN message to a printable string output. * Dump STUN message to a printable string output.
* *
* @param msg The STUN message * @param msg The STUN message
* @param buffer Buffer where the printable string output will * @param buffer Buffer where the printable string output will
* be printed on. * be printed on.
* @param length Specify the maximum length of the buffer. * @param length Specify the maximum length of the buffer.
* @param printed_len Optional pointer, which on output will be filled * @param printed_len Optional pointer, which on output will be filled
skipping to change at line 1256 skipping to change at line 1376
* attribute. * attribute.
* *
* @return The attribute instance, or NULL if it cannot be * @return The attribute instance, or NULL if it cannot be
* found. * found.
*/ */
PJ_DECL(pj_stun_attr_hdr*) pj_stun_msg_find_attr(const pj_stun_msg *msg, PJ_DECL(pj_stun_attr_hdr*) pj_stun_msg_find_attr(const pj_stun_msg *msg,
int attr_type, int attr_type,
unsigned start_index); unsigned start_index);
/** /**
* Clone a STUN attribute.
*
* @param pool Pool to allocate memory.
* @param attr Attribute to clone.
*
* @return Duplicate attribute.
*/
PJ_DECL(pj_stun_attr_hdr*) pj_stun_attr_clone(pj_pool_t *pool,
const pj_stun_attr_hdr *attr);
/**
* Initialize generic STUN IP address attribute. The \a addr_len and
* \a addr parameters specify whether the address is IPv4 or IPv4
* address.
*
* @param attr The socket address attribute to initialize.
* @param attr_type Attribute type, from #pj_stun_attr_type.
* @param xor_ed If non-zero, the port and address will be XOR-ed
* with magic, to make the XOR-MAPPED-ADDRESS attribute
.
* @param addr A pj_sockaddr_in or pj_sockaddr_in6 structure.
* @param addr_len Length of \a addr parameter.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_stun_sockaddr_attr_init(pj_stun_sockaddr_attr *attr
,
int attr_type,
pj_bool_t xor_ed,
const pj_sockaddr_t *addr,
unsigned addr_len);
/**
* Create a generic STUN IP address attribute. The \a addr_len and * Create a generic STUN IP address attribute. The \a addr_len and
* \a addr parameters specify whether the address is IPv4 or IPv4 * \a addr parameters specify whether the address is IPv4 or IPv4
* address. * address.
* *
* @param pool The pool to allocate memory from. * @param pool The pool to allocate memory from.
* @param attr_type Attribute type, from #pj_stun_attr_type. * @param attr_type Attribute type, from #pj_stun_attr_type.
* @param xor_ed If non-zero, the port and address will be XOR-ed * @param xor_ed If non-zero, the port and address will be XOR-ed
* with magic, to make the XOR-MAPPED-ADDRESS attribute . * with magic, to make the XOR-MAPPED-ADDRESS attribute .
* @param addr A pj_sockaddr_in or pj_sockaddr_in6 structure. * @param addr A pj_sockaddr_in or pj_sockaddr_in6 structure.
* @param addr_len Length of \a addr parameter. * @param addr_len Length of \a addr parameter.
skipping to change at line 1300 skipping to change at line 1451
* @return PJ_SUCCESS on success or the appropriate error code. * @return PJ_SUCCESS on success or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_stun_msg_add_sockaddr_attr(pj_pool_t *pool, PJ_DECL(pj_status_t) pj_stun_msg_add_sockaddr_attr(pj_pool_t *pool,
pj_stun_msg *msg, pj_stun_msg *msg,
int attr_type, int attr_type,
pj_bool_t xor_ed, pj_bool_t xor_ed,
const pj_sockaddr_t *addr, const pj_sockaddr_t *addr,
unsigned addr_len); unsigned addr_len);
/** /**
* Initialize a STUN generic string attribute.
*
* @param attr The string attribute to be initialized.
* @param pool Pool to duplicate the value into the attribute,
* if value is not NULL or empty.
* @param attr_type Attribute type, from #pj_stun_attr_type.
* @param value The string value to be assigned to the attri
bute.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_stun_string_attr_init(pj_stun_string_attr *attr,
pj_pool_t *pool,
int attr_type,
const pj_str_t *value);
/**
* Create a STUN generic string attribute. * Create a STUN generic string attribute.
* *
* @param pool The pool to allocate memory from. * @param pool The pool to allocate memory from.
* @param attr_type Attribute type, from #pj_stun_attr_type. * @param attr_type Attribute type, from #pj_stun_attr_type.
* @param value The string value to be assigned to the attri bute. * @param value The string value to be assigned to the attri bute.
* @param p_attr Pointer to receive the attribute. * @param p_attr Pointer to receive the attribute.
* *
* @return PJ_SUCCESS on success or the appropriate error code. * @return PJ_SUCCESS on success or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_stun_string_attr_create(pj_pool_t *pool, PJ_DECL(pj_status_t) pj_stun_string_attr_create(pj_pool_t *pool,
skipping to change at line 1465 skipping to change at line 1632
unsigned attr_cnt, unsigned attr_cnt,
const pj_uint16_t attr[], const pj_uint16_t attr[],
pj_stun_unknown_attr **p_att r); pj_stun_unknown_attr **p_att r);
/** /**
* Create and add STUN UNKNOWN-ATTRIBUTES attribute to the message. * Create and add STUN UNKNOWN-ATTRIBUTES attribute to the message.
* *
* @param pool The pool to allocate memory from. * @param pool The pool to allocate memory from.
* @param msg The STUN message. * @param msg The STUN message.
* @param attr_cnt Number of attributes in the array (can be zero). * @param attr_cnt Number of attributes in the array (can be zero).
* @param attr Optional array of attributes. * @param attr Optional array of attribute types.
* *
* @return PJ_SUCCESS on success or the appropriate error code. * @return PJ_SUCCESS on success or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_stun_msg_add_unknown_attr(pj_pool_t *pool, PJ_DECL(pj_status_t) pj_stun_msg_add_unknown_attr(pj_pool_t *pool,
pj_stun_msg *msg, pj_stun_msg *msg,
unsigned attr_cnt, unsigned attr_cnt,
const pj_uint16_t attr[]); const pj_uint16_t attr[]);
/** /**
* Initialize STUN binary attribute.
*
* @param attr The attribute to be initialized.
* @param pool Pool to copy data, if the data and length are set.
* @param attr_type The attribute type, from #pj_stun_attr_type.
* @param data Data to be coped to the attribute, or NULL
* if no data to be copied now.
* @param length Length of data, or zero if no data is to be
* copied now.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pj_stun_binary_attr_init(pj_stun_binary_attr *attr,
pj_pool_t *pool,
int attr_type,
const pj_uint8_t *data,
unsigned length);
/**
* Create STUN binary attribute. * Create STUN binary attribute.
* *
* @param pool The pool to allocate memory from. * @param pool The pool to allocate memory from.
* @param attr_type The attribute type, from #pj_stun_attr_type. * @param attr_type The attribute type, from #pj_stun_attr_type.
* @param data Data to be coped to the attribute, or NULL * @param data Data to be coped to the attribute, or NULL
* if no data to be copied now. * if no data to be copied now.
* @param length Length of data, or zero if no data is to be * @param length Length of data, or zero if no data is to be
* copied now. * copied now.
* @param p_attr Pointer to receive the attribute. * @param p_attr Pointer to receive the attribute.
* *
 End of changes. 64 change blocks. 
101 lines changed or deleted 294 lines changed or added


 stun_session.h   stun_session.h 
/* $Id: stun_session.h 1498 2007-10-13 00:06:59Z bennylp $ */ /* $Id: stun_session.h 1988 2008-06-06 14:47:10Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 47 skipping to change at line 47
/** /**
* @defgroup PJNATH_STUN_SESSION STUN Client/Server Session * @defgroup PJNATH_STUN_SESSION STUN Client/Server Session
* @brief STUN client and server session * @brief STUN client and server session
* @ingroup PJNATH_STUN * @ingroup PJNATH_STUN
* @{ * @{
*/ */
/** 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 */
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;
/** /**
* This is the callback to be registered to pj_stun_session, to send * This is the callback to be registered to pj_stun_session, to send
* outgoing message and to receive various notifications from the STUN * outgoing message and to receive various notifications from the STUN
* session. * session.
*/ */
typedef struct pj_stun_session_cb typedef struct pj_stun_session_cb
{ {
/** /**
* Callback to be called by the STUN session to send outgoing message. * Callback to be called by the STUN session to send outgoing message.
* *
* @param sess The STUN session. * @param sess The STUN session.
* @param token The token associated with this outgoing message
* and was set by the application. This token was
* set by application in pj_stun_session_send_msg()
* for outgoing messages that are initiated by the
* application, or in pj_stun_session_on_rx_pkt()
* if this message is a response that was internall
y
* generated by the STUN session (for example, an
* 401/Unauthorized response). Application may use
* this facility for any purposes.
* @param pkt Packet to be sent. * @param pkt Packet to be sent.
* @param pkt_size Size of the packet to be sent. * @param pkt_size Size of the packet to be sent.
* @param dst_addr The destination address. * @param dst_addr The destination address.
* @param addr_len Length of destination address. * @param addr_len Length of destination address.
* *
* @return The callback should return the status of the * @return The callback should return the status of the
* packet sending. * packet sending.
*/ */
pj_status_t (*on_send_msg)(pj_stun_session *sess, pj_status_t (*on_send_msg)(pj_stun_session *sess,
void *token,
const void *pkt, const void *pkt,
pj_size_t pkt_size, pj_size_t pkt_size,
const pj_sockaddr_t *dst_addr, const pj_sockaddr_t *dst_addr,
unsigned addr_len); unsigned addr_len);
/** /**
* Callback to be called on incoming STUN request message. In the * Callback to be called on incoming STUN request message. This functio
n
* is called when application calls pj_stun_session_on_rx_pkt() and whe
n
* the STUN session has detected that the incoming STUN message is a
* STUN request message. In the
* callback processing, application MUST create a response by calling * callback processing, application MUST create a response by calling
* pj_stun_session_create_response() function and send the response * pj_stun_session_create_response() function and send the response
* with pj_stun_session_send_msg() function, before returning from * with pj_stun_session_send_msg() function, before returning from
* the callback. * the callback.
* *
* @param sess The STUN session. * @param sess The STUN session.
* @param pkt Pointer to the original STUN packet. * @param pkt Pointer to the original STUN packet.
* @param pkt_len Length of the STUN packet. * @param pkt_len Length of the STUN packet.
* @param msg The parsed STUN request. * @param rdata Data containing incoming request message.
* @param token The token that was set by the application when
* calling pj_stun_session_on_rx_pkt() function.
* @param src_addr Source address of the packet. * @param src_addr Source address of the packet.
* @param src_addr_len Length of the source address. * @param src_addr_len Length of the source address.
* *
* @return The return value of this callback will be * @return The return value of this callback will be
* returned back to pj_stun_session_on_rx_pkt() * returned back to pj_stun_session_on_rx_pkt()
* function. * function.
*/ */
pj_status_t (*on_rx_request)(pj_stun_session *sess, pj_status_t (*on_rx_request)(pj_stun_session *sess,
const pj_uint8_t *pkt, const pj_uint8_t *pkt,
unsigned pkt_len, unsigned pkt_len,
const pj_stun_msg *msg, const pj_stun_rx_data *rdata,
void *token,
const pj_sockaddr_t *src_addr, const pj_sockaddr_t *src_addr,
unsigned src_addr_len); unsigned src_addr_len);
/** /**
* Callback to be called when response is received or the transaction * Callback to be called when response is received or the transaction
* has timed out. * has timed out. This callback is called either when application calls
* pj_stun_session_on_rx_pkt() with the packet containing a STUN
* response for the client transaction, or when the internal timer of
* the STUN client transaction has timed-out before a STUN response is
* received.
* *
* @param sess The STUN session. * @param sess The STUN session.
* @param status Status of the request. If the value if not * @param status Status of the request. If the value if not
* PJ_SUCCESS, the transaction has timed-out * PJ_SUCCESS, the transaction has timed-out
* or other error has occurred, and the response * or other error has occurred, and the response
* argument may be NULL. * argument may be NULL.
* Note that when the status is not success, the * Note that when the status is not success, the
* response may contain non-NULL value if the * response may contain non-NULL value if the
* response contains STUN ERROR-CODE attribute. * response contains STUN ERROR-CODE attribute.
* @param request The original STUN request. * @param token The token that was set by the application when
* calling pj_stun_session_send_msg() function.
* Please not that this token IS NOT the token
* that was given in pj_stun_session_on_rx_pkt().
* @param tdata The original STUN request.
* @param response The response message, on successful transaction, * @param response The response message, on successful transaction,
* or otherwise MAY BE NULL if status is not succes s. * or otherwise MAY BE NULL if status is not succes s.
* Note that when the status is not success, this * Note that when the status is not success, this
* argument may contain non-NULL value if the * argument may contain non-NULL value if the
* response contains STUN ERROR-CODE attribute. * response contains STUN ERROR-CODE attribute.
* @param src_addr The source address where the response was * @param src_addr The source address where the response was
* received, or NULL if the response is NULL. * received, or NULL if the response is NULL.
* @param src_addr_len The length of the source address. * @param src_addr_len The length of the source address.
*/ */
void (*on_request_complete)(pj_stun_session *sess, void (*on_request_complete)(pj_stun_session *sess,
pj_status_t status, pj_status_t status,
void *token,
pj_stun_tx_data *tdata, pj_stun_tx_data *tdata,
const pj_stun_msg *response, const pj_stun_msg *response,
const pj_sockaddr_t *src_addr, const pj_sockaddr_t *src_addr,
unsigned src_addr_len); unsigned src_addr_len);
/** /**
* Type of callback to be called on incoming STUN indication. * Callback to be called on incoming STUN request message. This functio
n
* is called when application calls pj_stun_session_on_rx_pkt() and whe
n
* the STUN session has detected that the incoming STUN message is a
* STUN indication message.
*
* @param sess The STUN session.
* @param pkt Pointer to the original STUN packet.
* @param pkt_len Length of the STUN packet.
* @param msg The parsed STUN indication.
* @param token The token that was set by the application when
* calling pj_stun_session_on_rx_pkt() function.
* @param src_addr Source address of the packet.
* @param src_addr_len Length of the source address.
*
* @return The return value of this callback will be
* returned back to pj_stun_session_on_rx_pkt()
* function.
*/ */
pj_status_t (*on_rx_indication)(pj_stun_session *sess, pj_status_t (*on_rx_indication)(pj_stun_session *sess,
const pj_uint8_t *pkt, const pj_uint8_t *pkt,
unsigned pkt_len, unsigned pkt_len,
const pj_stun_msg *msg, const pj_stun_msg *msg,
void *token,
const pj_sockaddr_t *src_addr, const pj_sockaddr_t *src_addr,
unsigned src_addr_len); unsigned src_addr_len);
} pj_stun_session_cb; } pj_stun_session_cb;
/** /**
* This structure describes incoming request message.
*/
struct pj_stun_rx_data
{
/**
* The parsed request message.
*/
pj_stun_msg *msg;
/**
* Credential information that is found and used to authenticate
* incoming request. Application may use this information when
* generating authentication for the outgoing response.
*/
pj_stun_req_cred_info info;
};
/**
* This structure describe the outgoing STUN transmit data to carry the * This structure describe the outgoing STUN transmit data to carry the
* message to be sent. * message to be sent.
*/ */
struct pj_stun_tx_data struct pj_stun_tx_data
{ {
/** PJLIB list interface */
PJ_DECL_LIST_MEMBER(struct pj_stun_tx_data); PJ_DECL_LIST_MEMBER(struct pj_stun_tx_data);
pj_pool_t *pool; /**< Pool. */ pj_pool_t *pool; /**< Pool. */
pj_stun_session *sess; /**< The STUN session. */ pj_stun_session *sess; /**< The STUN session. */
pj_stun_msg *msg; /**< The STUN message. */ pj_stun_msg *msg; /**< The STUN message. */
void *user_data; /**< Arbitrary application data. */ void *token; /**< The token. */
pj_stun_client_tsx *client_tsx; /**< Client STUN transaction. */ pj_stun_client_tsx *client_tsx; /**< Client STUN transaction. */
pj_bool_t retransmit; /**< Retransmit request? */
pj_uint32_t msg_magic; /**< Message magic. */ pj_uint32_t msg_magic; /**< Message magic. */
pj_uint8_t msg_key[12]; /**< Message/transaction key. */ pj_uint8_t msg_key[12]; /**< Message/transaction key. */
pj_str_t auth_key; /**< Auth key. */ pj_stun_req_cred_info auth_info; /**< Credential info */
void *pkt; /**< The STUN packet. */ void *pkt; /**< The STUN packet. */
unsigned max_len; /**< Length of packet buffer. */ unsigned max_len; /**< Length of packet buffer. */
unsigned pkt_size; /**< The actual length of STUN pkt. */ unsigned pkt_size; /**< The actual length of STUN pkt. */
unsigned addr_len; /**< Length of destination address. */ unsigned addr_len; /**< Length of destination address. */
const pj_sockaddr_t *dst_addr; /**< Destination address. */ const pj_sockaddr_t *dst_addr; /**< Destination address. */
pj_timer_entry res_timer; /**< Response cache timer. */ pj_timer_entry res_timer; /**< Response cache timer. */
}; };
/** /**
* These are the flags to control the message logging in the STUN session.
*/
typedef enum pj_stun_sess_msg_log_flag
{
PJ_STUN_SESS_LOG_TX_REQ=1, /**< Log outgoing STUN requests. */
PJ_STUN_SESS_LOG_TX_RES=2, /**< Log outgoing STUN responses. */
PJ_STUN_SESS_LOG_TX_IND=4, /**< Log outgoing STUN indications. */
PJ_STUN_SESS_LOG_RX_REQ=8, /**< Log incoming STUN requests. */
PJ_STUN_SESS_LOG_RX_RES=16, /**< Log incoming STUN responses
*/
PJ_STUN_SESS_LOG_RX_IND=32 /**< Log incoming STUN indications */
} pj_stun_sess_msg_log_flag;
/**
* Create a STUN session. * Create a STUN session.
* *
* @param cfg The STUN endpoint, to be used to register timers etc . * @param cfg The STUN endpoint, to be used to register timers etc .
* @param name Optional name to be associated with this instance. T he * @param name Optional name to be associated with this instance. T he
* name will be used for example for logging purpose. * name will be used for example for logging purpose.
* @param cb Session callback. * @param cb Session callback.
* @param fingerprint Enable message fingerprint for outgoing messages. * @param fingerprint Enable message fingerprint for outgoing messages.
* @param p_sess Pointer to receive STUN session instance. * @param p_sess Pointer to receive STUN session instance.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_create(pj_stun_config *cfg, PJ_DECL(pj_status_t) pj_stun_session_create(pj_stun_config *cfg,
const char *name, const char *name,
const pj_stun_session_cb *cb, const pj_stun_session_cb *cb,
pj_bool_t fingerprint, pj_bool_t fingerprint,
pj_stun_session **p_sess); pj_stun_session **p_sess);
/** /**
* Destroy the STUN session. * Destroy the STUN session and all objects created in the context of
* this session.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
* This function will return PJ_EPENDING if the operation
* cannot be performed immediately because callbacks are
* being called; in this case the session will be destroyed
* as soon as the last callback returns.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_destroy(pj_stun_session *sess); PJ_DECL(pj_status_t) pj_stun_session_destroy(pj_stun_session *sess);
/** /**
* Associated an arbitrary data with this STUN session. The user data may * Associated an arbitrary data with this STUN session. The user data may
* be retrieved later with pj_stun_session_get_user_data() function. * be retrieved later with pj_stun_session_get_user_data() function.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param user_data The user data. * @param user_data The user data.
* *
skipping to change at line 221 skipping to change at line 305
* Retrieve the user data previously associated to this STUN session with * Retrieve the user data previously associated to this STUN session with
* pj_stun_session_set_user_data(). * pj_stun_session_set_user_data().
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* *
* @return The user data associated with this STUN session. * @return The user data associated with this STUN session.
*/ */
PJ_DECL(void*) pj_stun_session_get_user_data(pj_stun_session *sess); PJ_DECL(void*) pj_stun_session_get_user_data(pj_stun_session *sess);
/** /**
* Change the lock object used by the STUN session. By default, the STUN
* session uses a mutex to protect its internal data. If application alread
y
* protects access to STUN session with higher layer lock, it may disable
* the mutex protection in the STUN session by changing the STUN session
* lock to a NULL mutex.
*
* @param sess The STUN session instance.
* @param lock New lock instance to be used by the STUN session.
* @param auto_del Specify whether STUN session should destroy this
* lock instance when it's destroyed.
*/
PJ_DECL(pj_status_t) pj_stun_session_set_lock(pj_stun_session *sess,
pj_lock_t *lock,
pj_bool_t auto_del);
/**
* Set server name to be included in all response. * Set server name to be included in all response.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param srv_name Server name string. * @param srv_name Server name string.
* *
* @return The user data associated with this STUN session. * @return The user data associated with this STUN session.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_set_server_name(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_set_server_name(pj_stun_session *sess,
const pj_str_t *srv_nam e); const pj_str_t *srv_nam e);
/** /**
* 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.
* @param auth_type Type of authentication.
* @param cred The credential to be used by this session. If NULL * @param cred The credential to be used by this session. If NULL
* is specified, authentication will be disabled. * is specified, authentication will be disabled.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_DECL(void) pj_stun_session_set_credential(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_set_credential(pj_stun_session *sess,
const pj_stun_auth_cred *cred); pj_stun_auth_type auth_type,
const pj_stun_auth_cred *cre
d);
/**
* Configure message logging. By default all flags are enabled.
*
* @param sess The STUN session instance.
* @param flags Bitmask combination of #pj_stun_sess_msg_log_fla
g
*/
PJ_DECL(void) pj_stun_session_set_log(pj_stun_session *sess,
unsigned flags);
/** /**
* Create a STUN request message. After the message has been successfully * Create a STUN request message. After the message has been successfully
* created, application can send the message by calling * created, application can send the message by calling
* pj_stun_session_send_msg(). * pj_stun_session_send_msg().
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param msg_type The STUN request message type, from pj_stun_method_e or * @param msg_type The STUN request message type, from pj_stun_method_e or
* from pj_stun_msg_type. * from pj_stun_msg_type.
* @param magic STUN magic, use PJ_STUN_MAGIC. * @param magic STUN magic, use PJ_STUN_MAGIC.
skipping to change at line 290 skipping to change at line 400
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_create_ind(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_create_ind(pj_stun_session *sess,
int msg_type, int msg_type,
pj_stun_tx_data **p_tdata); pj_stun_tx_data **p_tdata);
/** /**
* Create a STUN response message. After the message has been * Create a STUN response message. After the message has been
* successfully created, application can send the message by calling * successfully created, application can send the message by calling
* pj_stun_session_send_msg(). * pj_stun_session_send_msg(). Alternatively application may use
* pj_stun_session_respond() to create and send response in one function
* call.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param req The STUN request where the response is to be created. * @param rdata The STUN request where the response is to be cre ated.
* @param err_code Error code to be set in the response, if error response * @param err_code Error code to be set in the response, if error response
* is to be created, according to pj_stun_status enumeratio n. * is to be created, according to pj_stun_status enumeratio n.
* This argument MUST be zero if successful response is * This argument MUST be zero if successful response is
* to be created. * to be created.
* @param err_msg Optional pointer for the error message string, when * @param err_msg Optional pointer for the error message string, when
* creating error response. If the value is NULL and the * creating error response. If the value is NULL and the
* \a err_code is non-zero, then default error message will * \a err_code is non-zero, then default error message will
* be used. * be used.
* @param p_tdata Pointer to receive the response message created. * @param p_tdata Pointer to receive the response message created.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_create_res(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_create_res(pj_stun_session *sess,
const pj_stun_msg *req, const pj_stun_rx_data *rdata ,
unsigned err_code, unsigned err_code,
const pj_str_t *err_msg, const pj_str_t *err_msg,
pj_stun_tx_data **p_tdata); pj_stun_tx_data **p_tdata);
/** /**
* Send STUN message to the specified destination. This function will encod e * Send STUN message to the specified destination. This function will encod e
* the pj_stun_msg instance to a packet buffer, and add credential or * the pj_stun_msg instance to a packet buffer, and add credential or
* fingerprint if necessary. If the message is a request, the session will * fingerprint if necessary. If the message is a request, the session will
* also create and manage a STUN client transaction to be used to manage th e * also create and manage a STUN client transaction to be used to manage th e
* retransmission of the request. After the message has been encoded and * retransmission of the request. After the message has been encoded and
* transaction is setup, the \a on_send_msg() callback of pj_stun_session_c b * transaction is setup, the \a on_send_msg() callback of pj_stun_session_c b
* (which is registered when the STUN session is created) will be called * (which is registered when the STUN session is created) will be called
* to actually send the message to the wire. * to actually send the message to the wire.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param cache_res If PJ_TRUE then response will be cached. * @param token Optional token which will be given back to appli
cation in
* \a on_send_msg() callback and \a on_request_complete()
* callback, if the message is a STUN request message.
* Internally this function will put the token in the
* \a token field of pj_stun_tx_data, hence it will
* overwrite any value that the application puts there.
* @param cache_res If the message is a response message for an incoming
* request, specify PJ_TRUE to instruct the STUN session
* to cache this response for subsequent incoming request
* retransmission. Otherwise this parameter will be ignored
* for non-response message.
* @param retransmit If the message is a request message, specify whether t
he
* request should be retransmitted. Normally application wi
ll
* specify TRUE if the underlying transport is UDP and FALS
E
* if the underlying transport is TCP or TLS.
* @param dst_addr The destination socket address. * @param dst_addr The destination socket address.
* @param addr_len Length of destination address. * @param addr_len Length of destination address.
* @param tdata The STUN transmit data containing the STUN messa ge to * @param tdata The STUN transmit data containing the STUN messa ge to
* be sent. * be sent.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
* This function will return PJNATH_ESTUNDESTROYED if
* application has destroyed the session in
* \a on_send_msg() callback.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_send_msg(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_send_msg(pj_stun_session *sess,
void *token,
pj_bool_t cache_res, pj_bool_t cache_res,
pj_bool_t retransmit,
const pj_sockaddr_t *dst_addr, const pj_sockaddr_t *dst_addr,
unsigned addr_len, unsigned addr_len,
pj_stun_tx_data *tdata); pj_stun_tx_data *tdata);
/** /**
* This is a utility function to create and send response for an incoming
* STUN request. Internally this function calls pj_stun_session_create_res(
)
* and pj_stun_session_send_msg(). It is provided here as a matter of
* convenience.
*
* @param sess The STUN session instance.
* @param rdata The STUN request message to be responded.
* @param code Error code to be set in the response, if error response
* is to be created, according to pj_stun_status enumeratio
n.
* This argument MUST be zero if successful response is
* to be created.
* @param err_msg Optional pointer for the error message string, when
* creating error response. If the value is NULL and the
* \a err_code is non-zero, then default error message will
* be used.
* @param token Optional token which will be given back to appli
cation in
* \a on_send_msg() callback and \a on_request_complete()
* callback, if the message is a STUN request message.
* Internally this function will put the token in the
* \a token field of pj_stun_tx_data, hence it will
* overwrite any value that the application puts there.
* @param cache Specify whether session should cache this respon
se for
* future request retransmission. If TRUE, subsequent reque
st
* retransmission will be handled by the session and it
* will not call request callback.
* @param dst_addr Destination address of the response (or equal to the
* source address of the original request).
* @param addr_len Address length.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
* This function will return PJNATH_ESTUNDESTROYED if
* application has destroyed the session in
* \a on_send_msg() callback.
*/
PJ_DECL(pj_status_t) pj_stun_session_respond(pj_stun_session *sess,
const pj_stun_rx_data *rdata,
unsigned code,
const char *err_msg,
void *token,
pj_bool_t cache,
const pj_sockaddr_t *dst_addr,
unsigned addr_len);
/**
* Cancel outgoing STUN transaction. This operation is only valid for outgo ing * Cancel outgoing STUN transaction. This operation is only valid for outgo ing
* STUN request, to cease retransmission of the request and destroy the * STUN request, to cease retransmission of the request and destroy the
* STUN client transaction that is used to send the request. * STUN client transaction that is used to send the request.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param tdata The request message previously sent. * @param tdata The request message previously sent.
* @param notify Specify whether \a on_request_complete() callback shoul d * @param notify Specify whether \a on_request_complete() callback shoul d
* be called. * be called.
* @param status If \a on_request_complete() callback is to be called, * @param status If \a on_request_complete() callback is to be called,
* specify the error status to be given when calling the * specify the error status to be given when calling the
* callback. This error status MUST NOT be PJ_SUCCESS. * callback. This error status MUST NOT be PJ_SUCCESS.
* *
* @return PJ_SUCCESS if transaction is successfully cancelled. * @return PJ_SUCCESS if transaction is successfully cancelled.
* This function will return PJNATH_ESTUNDESTROYED if
* application has destroyed the session in
* \a on_request_complete() callback.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_cancel_req(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_cancel_req(pj_stun_session *sess,
pj_stun_tx_data *tdata, pj_stun_tx_data *tdata,
pj_bool_t notify, pj_bool_t notify,
pj_status_t status); pj_status_t status);
/** /**
* Explicitly request retransmission of the request. Normally application * Explicitly request retransmission of the request. Normally application
* doesn't need to do this, but this functionality is needed by ICE to * doesn't need to do this, but this functionality is needed by ICE to
* speed up connectivity check completion. * speed up connectivity check completion.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param tdata The request message previously sent. * @param tdata The request message previously sent.
* *
* @return PJ_SUCCESS on success, or the appropriate error. * @return PJ_SUCCESS on success, or the appropriate error.
* This function will return PJNATH_ESTUNDESTROYED if
* application has destroyed the session in \a on_send_msg(
)
* callback.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_retransmit_req(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_retransmit_req(pj_stun_session *sess,
pj_stun_tx_data *tdata); pj_stun_tx_data *tdata);
/** /**
* Application must call this function to notify the STUN session about * Application must call this function to notify the STUN session about
* the arrival of STUN packet. The STUN packet MUST have been checked * the arrival of STUN packet. The STUN packet MUST have been checked
* first with #pj_stun_msg_check() to verify that this is indeed a valid * first with #pj_stun_msg_check() to verify that this is indeed a valid
* STUN packet. * STUN packet.
* *
skipping to change at line 391 skipping to change at line 572
* On successful message processing, application will be notified about * On successful message processing, application will be notified about
* the message via one of the pj_stun_session_cb callback. * the message via one of the pj_stun_session_cb callback.
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param packet The packet containing STUN message. * @param packet The packet containing STUN message.
* @param pkt_size Size of the packet. * @param pkt_size Size of the packet.
* @param options Options, from #pj_stun_decode_options. * @param options Options, from #pj_stun_decode_options.
* @param parsed_len Optional pointer to receive the size of the parsed * @param parsed_len Optional pointer to receive the size of the parsed
* STUN message (useful if packet is received via a * STUN message (useful if packet is received via a
* stream oriented protocol). * stream oriented protocol).
* @param src_addr The source address of the packet. * @param token Optional token which will be given back to a
pplication
* in the \a on_rx_request(), \a on_rx_indication() and
* \a on_send_msg() callbacks. The token can be used to
* associate processing or incoming request or indicati
on
* with some context.
* @param src_addr The source address of the packet, which will also
* be given back to application callbacks, along with
* source address length.
* @param src_addr_len Length of the source address. * @param src_addr_len Length of the source address.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
* This function will return PJNATH_ESTUNDESTROYED if
* application has destroyed the session in one of the
* callback.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_on_rx_pkt(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_on_rx_pkt(pj_stun_session *sess,
const void *packet, const void *packet,
pj_size_t pkt_size, pj_size_t pkt_size,
unsigned options, unsigned options,
void *token,
unsigned *parsed_len, unsigned *parsed_len,
const pj_sockaddr_t *src_addr , const pj_sockaddr_t *src_addr ,
unsigned src_addr_len); unsigned src_addr_len);
/** /**
* Destroy the transmit data. Call this function only when tdata has been * Destroy the transmit data. Call this function only when tdata has been
* created but application doesn't want to send the message (perhaps * created but application doesn't want to send the message (perhaps
* because of other error). * because of other error).
* *
* @param sess The STUN session. * @param sess The STUN session.
 End of changes. 36 change blocks. 
17 lines changed or deleted 230 lines changed or added


 stun_simple.h   stun_simple.h 
/* $Id: stun_simple.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: stun_simple.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 141 skipping to change at line 141
PJ_DECL(pj_status_t) pjstun_create_bind_req( pj_pool_t *pool, PJ_DECL(pj_status_t) pjstun_create_bind_req( pj_pool_t *pool,
void **msg, pj_size_t *len, void **msg, pj_size_t *len,
pj_uint32_t id_hi, pj_uint32_t id_hi,
pj_uint32_t id_lo); pj_uint32_t id_lo);
PJ_DECL(pj_status_t) pjstun_parse_msg( void *buf, pj_size_t len, PJ_DECL(pj_status_t) pjstun_parse_msg( void *buf, pj_size_t len,
pjstun_msg *msg); pjstun_msg *msg);
PJ_DECL(void*) pjstun_msg_find_attr( pjstun_msg *msg, pjstun_attr_type t); PJ_DECL(void*) pjstun_msg_find_attr( pjstun_msg *msg, pjstun_attr_type t);
/** /**
* @defgroup PJLIB_UTIL_STUN_CLIENT Simple STUN Helper * @defgroup PJLIB_UTIL_STUN_CLIENT Simple STUN Helper
* @ingroup PJLIB_UTIL_STUN * @ingroup PJ_PROTOCOLS
* @brief A simple and small footprint STUN resolution helper * @brief A simple and small footprint STUN resolution helper
* @{ * @{
* *
* This is the older implementation of STUN client, with only one function * This is the older implementation of STUN client, with only one function
* provided (pjstun_get_mapped_addr()) to retrieve the public IP address * provided (pjstun_get_mapped_addr()) to retrieve the public IP address
* of multiple sockets. * of multiple sockets.
*/ */
/** /**
* This is the main function to request the mapped address of local sockets * This is the main function to request the mapped address of local sockets
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 stun_transaction.h   stun_transaction.h 
/* $Id: stun_transaction.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: stun_transaction.h 1988 2008-06-06 14:47:10Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 89 skipping to change at line 89
/** /**
* This callback is called by the STUN transaction when it wants to sen d * This callback is called by the STUN transaction when it wants to sen d
* outgoing message. * outgoing message.
* *
* @param tsx The STUN transaction instance. * @param tsx The STUN transaction instance.
* @param stun_pkt The STUN packet to be sent. * @param stun_pkt The STUN packet to be sent.
* @param pkt_size Size of the STUN packet. * @param pkt_size Size of the STUN packet.
* *
* @return If return value of the callback is not PJ_SUCCES S, * @return If return value of the callback is not PJ_SUCCES S,
* the transaction will fail. * the transaction will fail. Application MUST retu
rn
* PJNATH_ESTUNDESTROYED if it has destroyed the
* transaction in this callback.
*/ */
pj_status_t (*on_send_msg)(pj_stun_client_tsx *tsx, pj_status_t (*on_send_msg)(pj_stun_client_tsx *tsx,
const void *stun_pkt, const void *stun_pkt,
pj_size_t pkt_size); pj_size_t pkt_size);
/** /**
* This callback is called after the timer that was scheduled by * This callback is called after the timer that was scheduled by
* #pj_stun_client_tsx_schedule_destroy() has elapsed. Application * #pj_stun_client_tsx_schedule_destroy() has elapsed. Application
* should call #pj_stun_client_tsx_destroy() upon receiving this * should call #pj_stun_client_tsx_destroy() upon receiving this
* callback. * callback.
skipping to change at line 158 skipping to change at line 160
PJ_DECL(pj_status_t) PJ_DECL(pj_status_t)
pj_stun_client_tsx_schedule_destroy(pj_stun_client_tsx *tsx, pj_stun_client_tsx_schedule_destroy(pj_stun_client_tsx *tsx,
const pj_time_val *delay); const pj_time_val *delay);
/** /**
* Destroy a STUN client transaction immediately. This function can be * Destroy a STUN client transaction immediately. This function can be
* called at any time to stop the transaction and destroy it. * called at any time to stop the transaction and destroy it.
* *
* @param tsx The STUN transaction. * @param tsx The STUN transaction.
* *
* @return PJ_SUCCESS on success, or the appropriate error code * @return PJ_SUCCESS on success or PJ_EINVAL if the parameter
. * is NULL.
*/ */
PJ_DECL(pj_status_t) pj_stun_client_tsx_destroy(pj_stun_client_tsx *tsx); PJ_DECL(pj_status_t) pj_stun_client_tsx_destroy(pj_stun_client_tsx *tsx);
/** /**
* Check if transaction has completed. * Check if transaction has completed.
* *
* @param tsx The STUN transaction. * @param tsx The STUN transaction.
* *
* @return Non-zero if transaction has completed. * @return Non-zero if transaction has completed.
*/ */
skipping to change at line 207 skipping to change at line 210
* this transaction. If reliable transport such as TCP or TLS is used, * this transaction. If reliable transport such as TCP or TLS is used,
* the retransmit flag should be set to PJ_FALSE because reliablity * the retransmit flag should be set to PJ_FALSE because reliablity
* will be assured by the transport layer. * will be assured by the transport layer.
* *
* @param tsx The STUN client transaction. * @param tsx The STUN client transaction.
* @param retransmit Should this message be retransmitted by the * @param retransmit Should this message be retransmitted by the
* STUN transaction. * STUN transaction.
* @param pkt The STUN packet to send. * @param pkt The STUN packet to send.
* @param pkt_len Length of STUN packet. * @param pkt_len Length of STUN packet.
* *
* @return PJ_SUCCESS on success or the appropriate error code. * @return PJ_SUCCESS on success, or PJNATH_ESTUNDESTROYED
* when the user has destroyed the transaction in
* \a on_send_msg() callback, or any other error code
* as returned by \a on_send_msg() callback.
*/ */
PJ_DECL(pj_status_t) pj_stun_client_tsx_send_msg(pj_stun_client_tsx *tsx, PJ_DECL(pj_status_t) pj_stun_client_tsx_send_msg(pj_stun_client_tsx *tsx,
pj_bool_t retransmit, pj_bool_t retransmit,
void *pkt, void *pkt,
unsigned pkt_len); unsigned pkt_len);
/** /**
* Request to retransmit the request. Normally application should not need * Request to retransmit the request. Normally application should not need
* to call this function since retransmission would be handled internally, * to call this function since retransmission would be handled internally,
* but this functionality is needed by ICE. * but this functionality is needed by ICE.
* *
* @param tsx The STUN client transaction instance. * @param tsx The STUN client transaction instance.
* *
* @return PJ_SUCCESS on success or the appropriate error code. * @return PJ_SUCCESS on success, or PJNATH_ESTUNDESTROYED
* when the user has destroyed the transaction in
* \a on_send_msg() callback, or any other error code
* as returned by \a on_send_msg() callback.
*/ */
PJ_DECL(pj_status_t) pj_stun_client_tsx_retransmit(pj_stun_client_tsx *tsx) ; PJ_DECL(pj_status_t) pj_stun_client_tsx_retransmit(pj_stun_client_tsx *tsx) ;
/** /**
* Notify the STUN transaction about the arrival of STUN response. * Notify the STUN transaction about the arrival of STUN response.
* If the STUN response contains a final error (300 and greater), the * If the STUN response contains a final error (300 and greater), the
* transaction will be terminated and callback will be called. If the * transaction will be terminated and callback will be called. If the
* STUN response contains response code 100-299, retransmission * STUN response contains response code 100-299, retransmission
* will cease, but application must still call this function again * will cease, but application must still call this function again
* with a final response later to allow the transaction to complete. * with a final response later to allow the transaction to complete.
 End of changes. 5 change blocks. 
6 lines changed or deleted 15 lines changed or added


 time.h   time.h 
/* $Id: time.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: time.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 tonegen.h   tonegen.h 
/* $Id: tonegen.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: tonegen.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 29 skipping to change at line 29
#ifndef __PJMEDIA_TONEGEN_PORT_H__ #ifndef __PJMEDIA_TONEGEN_PORT_H__
#define __PJMEDIA_TONEGEN_PORT_H__ #define __PJMEDIA_TONEGEN_PORT_H__
/** /**
* @file tonegen.h * @file tonegen.h
* @brief Tone (sine, MF, DTMF) generator media port. * @brief Tone (sine, MF, DTMF) generator media port.
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
/** /**
* @defgroup PJMEDIA_MF_DTMF_TONE_GENERATOR Tone (sine, MF, DTMF) Generator * @defgroup PJMEDIA_MF_DTMF_TONE_GENERATOR Multi-frequency tone generator
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief Tone (sine, MF, DTMF) Generator * @brief Multi-frequency tone generator
* @{ * @{
*
* This page describes tone generator media port. A tone generator can be * This page describes tone generator media port. A tone generator can be
* used to generate a single frequency sine wave or dual frequency tones * used to generate a single frequency sine wave or dual frequency tones
* such as DTMF. * such as DTMF.
* *
* The tone generator media port provides two functions to generate tones. * The tone generator media port provides two functions to generate tones.
* The function #pjmedia_tonegen_play() can be used to generate arbitrary * The function #pjmedia_tonegen_play() can be used to generate arbitrary
* single or dual frequency tone, and #pjmedia_tonegen_play_digits() is * single or dual frequency tone, and #pjmedia_tonegen_play_digits() is
* used to play digits such as DTMF. Each tone specified in the playback * used to play digits such as DTMF. Each tone specified in the playback
* function has individual on and off signal duration that must be * function has individual on and off signal duration that must be
* specified by application. * specified by application.
skipping to change at line 104 skipping to change at line 105
/** /**
* Tone generator options. * Tone generator options.
*/ */
enum enum
{ {
/** /**
* Play the tones in loop, restarting playing the first tone after * Play the tones in loop, restarting playing the first tone after
* the last tone has been played. * the last tone has been played.
*/ */
PJMEDIA_TONEGEN_LOOP = 1 PJMEDIA_TONEGEN_LOOP = 1,
/**
* Disable mutex protection to the tone generator.
*/
PJMEDIA_TONEGEN_NO_LOCK = 2
}; };
/** /**
* Create an instance of tone generator with the specified parameters. * Create an instance of tone generator with the specified parameters.
* When the tone generator is first created, it will be loaded with the * When the tone generator is first created, it will be loaded with the
* default digit map. * default digit map.
* *
* @param pool Pool to allocate memory for the port structure. * @param pool Pool to allocate memory for the port structure.
* @param clock_rate Sampling rate. * @param clock_rate Sampling rate.
* @param channel_count Number of channels. Currently only mono and stereo * @param channel_count Number of channels. Currently only mono and stereo
skipping to change at line 182 skipping to change at line 188
/** /**
* Instruct the tone generator to stop current processing. * Instruct the tone generator to stop current processing.
* *
* @param tonegen The tone generator instance. * @param tonegen The tone generator instance.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_tonegen_stop(pjmedia_port *tonegen); PJ_DECL(pj_status_t) pjmedia_tonegen_stop(pjmedia_port *tonegen);
/** /**
* Rewind the playback. This will start the playback to the first
* tone in the playback list.
*
* @param tonegen The tone generator instance.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_tonegen_rewind(pjmedia_port *tonegen);
/**
* Instruct the tone generator to play single or dual frequency tones * Instruct the tone generator to play single or dual frequency tones
* with the specified duration. The new tones will be appended to currently * with the specified duration. The new tones will be appended to currently
* playing tones, unless #pjmedia_tonegen_stop() is called before calling * playing tones, unless #pjmedia_tonegen_stop() is called before calling
* this function. The playback will begin as soon as the first get_frame() * this function. The playback will begin as soon as the first get_frame()
* is called to the generator. * is called to the generator.
* *
* @param tonegen The tone generator instance. * @param tonegen The tone generator instance.
* @param count The number of tones in the array. * @param count The number of tones in the array.
* @param tones Array of tones to be played. * @param tones Array of tones to be played.
* @param options Option flags. Application may specify * @param options Option flags. Application may specify
 End of changes. 7 change blocks. 
5 lines changed or deleted 21 lines changed or added


 transport.h   transport.h 
/* $Id: transport.h 1098 2007-03-23 16:34:20Z bennylp $ */ /* $Id: transport.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 31 skipping to change at line 31
/** /**
* @file transport.h Media Transport Interface * @file transport.h Media Transport Interface
* @brief Transport interface. * @brief Transport interface.
*/ */
#include <pjmedia/types.h> #include <pjmedia/types.h>
#include <pjmedia/errno.h> #include <pjmedia/errno.h>
/** /**
* @defgroup PJMEDIA_TRANSPORT Media Transports * @defgroup PJMEDIA_TRANSPORT Media Transport
* @ingroup PJMEDIA
* @brief Transports. * @brief Transports.
* Transport related components.
*/
/**
* @defgroup PJMEDIA_TRANSPORT_H Media Network Transport Interface
* @ingroup PJMEDIA_TRANSPORT
* @brief PJMEDIA object for sending/receiving media packets over the netwo
rk
* @{ * @{
* The media transport (#pjmedia_transport) is the object to send and * The media transport (#pjmedia_transport) is the object to send and
* receive media packets over the network. The media transport interface * receive media packets over the network. The media transport interface
* allows the library to be extended to support different types of * allows the library to be extended to support different types of
* transports to send and receive packets. Currently only the standard * transports to send and receive packets.
* UDP transport implementation is provided (see \ref PJMEDIA_TRANSPORT_UDP
),
* but application designer may extend the library to support other types
* of custom transports such as RTP/RTCP over TCP, RTP/RTCP over HTTP, etc.
* *
* The media transport is declared as #pjmedia_transport "class", which * The media transport is declared as #pjmedia_transport "class", which
* declares "interfaces" to use the class in #pjmedia_transport_op * declares "interfaces" to use the class in #pjmedia_transport_op
* structure. For the user of the media transport (normally the user of * structure. For the user of the media transport (normally the user of
* media transport is media stream, see \ref PJMED_STRM), these transport * media transport is media stream, see \ref PJMED_STRM), these transport
* "methods" are wrapped with API such as #pjmedia_transport_attach(), * "methods" are wrapped with API such as #pjmedia_transport_attach(),
* so it should not need to call the function pointer inside * so it should not need to call the function pointer inside
* #pjmedia_transport_op directly. * #pjmedia_transport_op directly.
* *
* \section PJMEDIA_TRANSPORT_H_USING Using the Media Transport * The connection between \ref PJMED_STRM and media transport is shown in
* the diagram below:
\image html media-transport.PNG
* \section PJMEDIA_TRANSPORT_H_USING Basic Media Transport Usage
* *
* The media transport's life-cycle normally follows the following stages. * The media transport's life-cycle normally follows the following stages.
* *
* \subsection PJMEDIA_TRANSPORT_H_CREATE Creating the Media Transport * \subsection PJMEDIA_TRANSPORT_H_CREATE Creating the Media Transport
* *
* Application creates the media transport when it needs to establish * Application creates the media transport when it needs to establish
* media session to remote peer. The media transport is created using * media session to remote peer. The media transport is created using
* specific function to create that particular transport; for example, * specific function to create that particular transport; for example,
* for UDP media transport, it is created with #pjmedia_transport_udp_cr eate() * for UDP media transport, it is created with #pjmedia_transport_udp_cr eate()
* or #pjmedia_transport_udp_create2() functions. Different media * or #pjmedia_transport_udp_create2() functions. Different media
skipping to change at line 137 skipping to change at line 131
* *
* \subsection PJMEDIA_TRANSPORT_H_DESTROY Destroying the Media Transport. * \subsection PJMEDIA_TRANSPORT_H_DESTROY Destroying the Media Transport.
* *
* Finally if application no longer needs the media transport, it will * Finally if application no longer needs the media transport, it will
* call #pjmedia_transport_close() function, which is thin wrapper which * call #pjmedia_transport_close() function, which is thin wrapper which
* calls "destroy()" method of the media transport's "virtual function * calls "destroy()" method of the media transport's "virtual function
* pointer" (#pjmedia_transport_op). This function releases * pointer" (#pjmedia_transport_op). This function releases
* all resources used by the transport, such as sockets and memory. * all resources used by the transport, such as sockets and memory.
* *
* *
* \section offer_answer Interaction with SDP Offer/Answer
For basic UDP transport, the \ref PJMEDIA_TRANSPORT_H_USING above is
sufficient to use the media transport. However, more complex media
transports such as \ref PJMEDIA_TRANSPORT_SRTP and \ref
PJMEDIA_TRANSPORT_ICE requires closer interactions with SDP offer and
answer negotiation.
The media transports can interact with the SDP offer/answer via
these APIs:
- #pjmedia_transport_media_create(), to initialize the media transport
for new media session,
- #pjmedia_transport_encode_sdp(), to encode SDP offer or answer,
- #pjmedia_transport_media_start(), to activate the settings that
have been negotiated by SDP offer answer, and
- #pjmedia_transport_media_stop(), to deinitialize the media transport
and reset the transport to its idle state.
The usage of these API in the context of SDP offer answer will be
described below.
\subsection media_create Initializing Transport for New Session
Application must call #pjmedia_transport_media_create() before using
the transport for a new session.
\subsection creat_oa Creating SDP Offer and Answer
The #pjmedia_transport_encode_sdp() is used to put additional informatio
n
from the transport to the local SDP, before the SDP is sent and negotiat
ed
with remote SDP.
When creating an offer, call #pjmedia_transport_encode_sdp() with
local SDP (and NULL as \a rem_sdp). The media transport will add the
relevant attributes in the local SDP. Application then gives the local
SDP to the invite session to be sent to remote agent.
When creating an answer, also call #pjmedia_transport_encode_sdp(),
but this time specify both local and remote SDP to the function. The
media transport will once again modify the local SDP and add relevant
attributes to the local SDP, if the appropriate attributes related to
the transport functionality are present in remote offer. The remote
SDP does not contain the relevant attributes, then the specific transpor
t
functionality will not be activated for the session.
The #pjmedia_transport_encode_sdp() should also be called when applicati
on
sends subsequent SDP offer or answer. The media transport will encode
the appropriate attributes based on the state of the session.
\subsection media_start Offer/Answer Completion
Once both local and remote SDP have been negotiated by the
\ref PJMEDIA_SDP_NEG (normally this is part of PJSIP invite session),
application should give both local and remote SDP to
#pjmedia_transport_media_start() so that the settings are activated
for the session. This function should be called for both initial and
subsequent SDP negotiation.
\subsection media_stop Stopping Transport
Once session is stop application must call #pjmedia_transport_media_stop
()
to deactivate the transport feature. Application may reuse the transport
for subsequent media session by repeating the #pjmedia_transport_media_c
reate(),
#pjmedia_transport_encode_sdp(), #pjmedia_transport_media_start(), and
#pjmedia_transport_media_stop() above.
* \section PJMEDIA_TRANSPORT_H_IMPL Implementing Media Transport * \section PJMEDIA_TRANSPORT_H_IMPL Implementing Media Transport
* *
* To implement a new type of media transport, one needs to "subclass" the * To implement a new type of media transport, one needs to "subclass" the
* media transport "class" (#pjmedia_transport) by providing the "methods" * media transport "class" (#pjmedia_transport) by providing the "methods"
* in the media transport "interface" (#pjmedia_transport_op), and provides * in the media transport "interface" (#pjmedia_transport_op), and provides
* a function to create this new type of transport (similar to * a function to create this new type of transport (similar to
* #pjmedia_transport_udp_create() function). * #pjmedia_transport_udp_create() function).
* *
* The media transport is expected to run indepently, that is there should * The media transport is expected to run indepently, that is there should
* be no polling like function to poll the transport for incoming RTP/RTCP * be no polling like function to poll the transport for incoming RTP/RTCP
skipping to change at line 161 skipping to change at line 221
* Alternatively, media transport may utilize thread(s) internally to wait * Alternatively, media transport may utilize thread(s) internally to wait
* for incoming packets. The thread then will call the appropriate RTP or * for incoming packets. The thread then will call the appropriate RTP or
* RTCP callback provided by its user (stream) whenever packet is received. * RTCP callback provided by its user (stream) whenever packet is received.
* If the transport's user is a stream, then the callbacks provided by the * If the transport's user is a stream, then the callbacks provided by the
* stream will be thread-safe, so the transport may call these callbacks * stream will be thread-safe, so the transport may call these callbacks
* without having to serialize the access with some mutex protection. But * without having to serialize the access with some mutex protection. But
* the media transport may still have to protect its internal data with * the media transport may still have to protect its internal data with
* mutex protection, since it may be called by application's thread (for * mutex protection, since it may be called by application's thread (for
* example, to send RTP/RTCP packets). * example, to send RTP/RTCP packets).
* *
* For an example of media transport implementation, please refer to
* <tt>transport_udp.h</tt> and <tt>transport_udp.c</tt> in PJMEDIA source
* distribution.
*/ */
#include <pjmedia/sdp.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/* /**
* Forward declaration for media transport. * Forward declaration for media transport.
*/ */
typedef struct pjmedia_transport pjmedia_transport; typedef struct pjmedia_transport pjmedia_transport;
/** /**
* Forward declaration for media transport info.
*/
typedef struct pjmedia_transport_info pjmedia_transport_info;
/**
* This enumeration specifies the general behaviour of media processing
*/
typedef enum pjmedia_tranport_media_option
{
/**
* When this flag is specified, the transport will not perform media
* transport validation, this is useful when transport is stacked with
* other transport, for example when transport UDP is stacked under
* transport SRTP, media transport validation only need to be done by
* transport SRTP.
*/
PJMEDIA_TPMED_NO_TRANSPORT_CHECKING = 1
} pjmedia_tranport_media_option;
/**
* This structure describes the operations for the stream transport. * This structure describes the operations for the stream transport.
*/ */
struct pjmedia_transport_op struct pjmedia_transport_op
{ {
/** /**
* Get media socket info from the specified transport. * Get media socket info from the specified transport.
* *
* Application should call #pjmedia_transport_get_info() instead * Application should call #pjmedia_transport_get_info() instead
*/ */
pj_status_t (*get_info)(pjmedia_transport *tp, pj_status_t (*get_info)(pjmedia_transport *tp,
pjmedia_sock_info *info); pjmedia_transport_info *info);
/** /**
* This function is called by the stream when the transport is about * This function is called by the stream when the transport is about
* to be used by the stream for the first time, and it tells the transp ort * to be used by the stream for the first time, and it tells the transp ort
* about remote RTP address to send the packet and some callbacks to be * about remote RTP address to send the packet and some callbacks to be
* called for incoming packets. * called for incoming packets.
* *
* Application should call #pjmedia_transport_attach() instead of * Application should call #pjmedia_transport_attach() instead of
* calling this function directly. * calling this function directly.
*/ */
pj_status_t (*attach)(pjmedia_transport *tp, pj_status_t (*attach)(pjmedia_transport *tp,
void *user_data, void *user_data,
const pj_sockaddr_t *rem_addr, const pj_sockaddr_t *rem_addr,
const pj_sockaddr_t *rem_rtcp, const pj_sockaddr_t *rem_rtcp,
unsigned addr_len, unsigned addr_len,
void (*rtp_cb)(void *user_data, void (*rtp_cb)(void *user_data,
const void *pkt, void *pkt,
pj_ssize_t size), pj_ssize_t size),
void (*rtcp_cb)(void *user_data, void (*rtcp_cb)(void *user_data,
const void *pkt, void *pkt,
pj_ssize_t size)); pj_ssize_t size));
/** /**
* This function is called by the stream when the stream no longer * This function is called by the stream when the stream no longer
* needs the transport (normally when the stream is about to be closed) . * needs the transport (normally when the stream is about to be closed) .
* After the transport is detached, it will ignore incoming * After the transport is detached, it will ignore incoming
* RTP/RTCP packets, and will refuse to send outgoing RTP/RTCP packets. * RTP/RTCP packets, and will refuse to send outgoing RTP/RTCP packets.
* Application may re-attach the media transport to another transport * Application may re-attach the media transport to another transport
* user (e.g. stream) after the transport has been detached. * user (e.g. stream) after the transport has been detached.
* *
skipping to change at line 244 skipping to change at line 324
* transport. * transport.
* *
* Application should call #pjmedia_transport_send_rtcp() instead of * Application should call #pjmedia_transport_send_rtcp() instead of
* calling this function directly. * calling this function directly.
*/ */
pj_status_t (*send_rtcp)(pjmedia_transport *tp, pj_status_t (*send_rtcp)(pjmedia_transport *tp,
const void *pkt, const void *pkt,
pj_size_t size); pj_size_t size);
/** /**
* This function is called by the stream to send RTCP packet using the
* transport with destination address other than default specified in
* #pjmedia_transport_attach().
*
* Application should call #pjmedia_transport_send_rtcp2() instead of
* calling this function directly.
*/
pj_status_t (*send_rtcp2)(pjmedia_transport *tp,
const pj_sockaddr_t *addr,
unsigned addr_len,
const void *pkt,
pj_size_t size);
/**
* Prepare the transport for a new media session.
*
* Application should call #pjmedia_transport_media_create() instead of
* calling this function directly.
*/
pj_status_t (*media_create)(pjmedia_transport *tp,
pj_pool_t *sdp_pool,
unsigned options,
const pjmedia_sdp_session *remote_sdp,
unsigned media_index);
/**
* This function is called by application to generate the SDP parts
* related to transport type, e.g: ICE, SRTP.
*
* Application should call #pjmedia_transport_encode_sdp() instead of
* calling this function directly.
*/
pj_status_t (*encode_sdp)(pjmedia_transport *tp,
pj_pool_t *sdp_pool,
pjmedia_sdp_session *sdp_local,
const pjmedia_sdp_session *rem_sdp,
unsigned media_index);
/**
* This function is called by application to start the transport
* based on local and remote SDP.
*
* Application should call #pjmedia_transport_media_start() instead of
* calling this function directly.
*/
pj_status_t (*media_start) (pjmedia_transport *tp,
pj_pool_t *tmp_pool,
const pjmedia_sdp_session *sdp_local,
const pjmedia_sdp_session *sdp_remote,
unsigned media_index);
/**
* This function is called by application to stop the transport.
*
* Application should call #pjmedia_transport_media_stop() instead of
* calling this function directly.
*/
pj_status_t (*media_stop) (pjmedia_transport *tp);
/**
* This function can be called to simulate packet lost.
*
* Application should call #pjmedia_transport_simulate_lost() instead o
f
* calling this function directly.
*/
pj_status_t (*simulate_lost)(pjmedia_transport *tp,
pjmedia_dir dir,
unsigned pct_lost);
/**
* This function can be called to destroy this transport. * This function can be called to destroy this transport.
* *
* Application should call #pjmedia_transport_close() instead of * Application should call #pjmedia_transport_close() instead of
* calling this function directly. * calling this function directly.
*/ */
pj_status_t (*destroy)(pjmedia_transport *tp); pj_status_t (*destroy)(pjmedia_transport *tp);
}; };
/** /**
* @see pjmedia_transport_op. * @see pjmedia_transport_op.
skipping to change at line 266 skipping to change at line 416
/** /**
* Media transport type. * Media transport type.
*/ */
typedef enum pjmedia_transport_type typedef enum pjmedia_transport_type
{ {
/** Media transport using standard UDP */ /** Media transport using standard UDP */
PJMEDIA_TRANSPORT_TYPE_UDP, PJMEDIA_TRANSPORT_TYPE_UDP,
/** Media transport using ICE */ /** Media transport using ICE */
PJMEDIA_TRANSPORT_TYPE_ICE PJMEDIA_TRANSPORT_TYPE_ICE,
/**
* Media transport SRTP, this transport is actually security adapter to
be
* stacked with other transport to enable encryption on the underlying
* transport.
*/
PJMEDIA_TRANSPORT_TYPE_SRTP
} pjmedia_transport_type; } pjmedia_transport_type;
/** /**
* This structure declares stream transport. A stream transport is called * This structure declares media transport. A media transport is called
* by the stream to transmit a packet, and will notify stream when * by the stream to transmit a packet, and will notify stream when
* incoming packet is arrived. * incoming packet is arrived.
*/ */
struct pjmedia_transport struct pjmedia_transport
{ {
/** Transport name (for logging purpose). */ /** Transport name (for logging purpose). */
char name[PJ_MAX_OBJ_NAME]; char name[PJ_MAX_OBJ_NAME];
/** Transport type. */ /** Transport type. */
pjmedia_transport_type type; pjmedia_transport_type type;
/** Transport's "virtual" function table. */ /** Transport's "virtual" function table. */
pjmedia_transport_op *op; pjmedia_transport_op *op;
}; };
/** /**
* Get media socket info from the specified transport. The socket info * This structure describes storage buffer of transport specific info.
* contains information about the local address of this transport, and * The actual transport specific info contents will be defined by transport
* would be needed for example to fill in the "c=" and "m=" line of local * implementation. Note that some transport implementations do not need to
* SDP. * provide specific info, since the general socket info is enough.
*/
typedef struct pjmedia_transport_specific_info
{
/**
* Specify media transport type.
*/
pjmedia_transport_type type;
/**
* Specify storage buffer size of transport specific info.
*/
int cbsize;
/**
* Storage buffer of transport specific info.
*/
char buffer[PJMEDIA_TRANSPORT_SPECIFIC_INFO_MAXSIZE]
;
} pjmedia_transport_specific_info;
/**
* This structure describes transport informations, including general
* socket information and specific information of single transport or
* stacked transports (e.g: SRTP stacked on top of UDP)
*/
struct pjmedia_transport_info
{
/**
* General socket info.
*/
pjmedia_sock_info sock_info;
/**
* Specifies number of transport specific info included.
*/
int specific_info_cnt;
/**
* Buffer storage of transport specific info.
*/
pjmedia_transport_specific_info spc_info[PJMEDIA_TRANSPORT_SPECIFIC_INF
O_MAXCNT];
};
/**
* Initialize transport info.
*
* @param info Transport info to be initialized.
*/
PJ_INLINE(void) pjmedia_transport_info_init(pjmedia_transport_info *info)
{
pj_bzero(&info->sock_info, sizeof(pjmedia_sock_info));
info->sock_info.rtp_sock = info->sock_info.rtcp_sock = PJ_INVALID_SOCKE
T;
info->specific_info_cnt = 0;
}
/**
* Get media transport info from the specified transport and all underlying
* transports if any. The transport also contains information about socket
info
* which describes the local address of the transport, and would be needed
* for example to fill in the "c=" and "m=" line of local SDP.
* *
* @param tp The transport. * @param tp The transport.
* @param info Media socket info to be initialized. * @param info Media socket info to be initialized.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_INLINE(pj_status_t) pjmedia_transport_get_info(pjmedia_transport *tp, PJ_INLINE(pj_status_t) pjmedia_transport_get_info(pjmedia_transport *tp,
pjmedia_sock_info *info) pjmedia_transport_info *in fo)
{ {
if (tp->op->get_info) if (tp && tp->op && tp->op->get_info)
return (*tp->op->get_info)(tp, info); return (*tp->op->get_info)(tp, info);
else else
return PJ_ENOTSUP; return PJ_ENOTSUP;
} }
/** /**
* Attach callbacks to be called on receipt of incoming RTP/RTCP packets. * Attach callbacks to be called on receipt of incoming RTP/RTCP packets.
* This is just a simple wrapper which calls <tt>attach()</tt> member of * This is just a simple wrapper which calls <tt>attach()</tt> member of
* the transport. * the transport.
* *
skipping to change at line 334 skipping to change at line 552
* the transport. * the transport.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_INLINE(pj_status_t) pjmedia_transport_attach(pjmedia_transport *tp, PJ_INLINE(pj_status_t) pjmedia_transport_attach(pjmedia_transport *tp,
void *user_data, void *user_data,
const pj_sockaddr_t *rem_add r, const pj_sockaddr_t *rem_add r,
const pj_sockaddr_t *rem_rtc p, const pj_sockaddr_t *rem_rtc p,
unsigned addr_len, unsigned addr_len,
void (*rtp_cb)(void *user_da ta, void (*rtp_cb)(void *user_da ta,
const void *p kt, void *pkt,
pj_ssize_t), pj_ssize_t),
void (*rtcp_cb)(void *usr_da ta, void (*rtcp_cb)(void *usr_da ta,
const void*p kt, void*pkt,
pj_ssize_t)) pj_ssize_t))
{ {
return tp->op->attach(tp, user_data, rem_addr, rem_rtcp, addr_len, return tp->op->attach(tp, user_data, rem_addr, rem_rtcp, addr_len,
rtp_cb, rtcp_cb); rtp_cb, rtcp_cb);
} }
/** /**
* Detach callbacks from the transport. * Detach callbacks from the transport.
* This is just a simple wrapper which calls <tt>detach()</tt> member of * This is just a simple wrapper which calls <tt>detach()</tt> member of
* the transport. After the transport is detached, it will ignore incoming * the transport. After the transport is detached, it will ignore incoming
skipping to change at line 401 skipping to change at line 619
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_INLINE(pj_status_t) pjmedia_transport_send_rtcp(pjmedia_transport *tp, PJ_INLINE(pj_status_t) pjmedia_transport_send_rtcp(pjmedia_transport *tp,
const void *pkt, const void *pkt,
pj_size_t size) pj_size_t size)
{ {
return (*tp->op->send_rtcp)(tp, pkt, size); return (*tp->op->send_rtcp)(tp, pkt, size);
} }
/** /**
* Send RTCP packet with the specified media transport. This is just a simp
le
* wrapper which calls <tt>send_rtcp2()</tt> member of the transport. The
* RTCP packet will be delivered to the destination address specified in
* param addr, if addr is NULL, RTCP packet will be delivered to destinatio
n
* address specified in #pjmedia_transport_attach() function.
*
* @param tp The media transport.
* @param addr The destination address.
* @param addr_len Length of destination address.
* @param pkt The packet to send.
* @param size Size of the packet.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_INLINE(pj_status_t) pjmedia_transport_send_rtcp2(pjmedia_transport *tp,
const pj_sockaddr_t *add
r,
unsigned addr_len,
const void *pkt,
pj_size_t size)
{
return (*tp->op->send_rtcp2)(tp, addr, addr_len, pkt, size);
}
/**
* Prepare the media transport for a new media session, Application must
* call this function before starting a new media session using this
* transport.
*
* This is just a simple wrapper which calls <tt>media_create()</tt> member
* of the transport.
*
* @param tp The media transport.
* @param sdp_pool Pool object to allocate memory related to SDP
* messaging components.
* @param options Option flags, from #pjmedia_tranport_media_option
* @param rem_sdp Remote SDP if local SDP is an answer, otherwise
* specify NULL if SDP is an offer.
* @param media_index Media index in SDP.
*
* @return PJ_SUCCESS on success, or the appropriate error code
.
*/
PJ_INLINE(pj_status_t) pjmedia_transport_media_create(pjmedia_transport *tp
,
pj_pool_t *sdp_pool,
unsigned options,
const pjmedia_sdp_session *rem_sdp,
unsigned media_index)
{
return (*tp->op->media_create)(tp, sdp_pool, options, rem_sdp,
media_index);
}
/**
* Put transport specific information into the SDP. This function can be
* called to put transport specific information in the initial or
* subsequent SDP offer or answer.
*
* This is just a simple wrapper which calls <tt>encode_sdp()</tt> member
* of the transport.
*
* @param tp The media transport.
* @param sdp_pool Pool object to allocate memory related to SDP
* messaging components.
* @param sdp The local SDP to be filled in information from the
* media transport.
* @param rem_sdp Remote SDP if local SDP is an answer, otherwise
* specify NULL if SDP is an offer.
* @param media_index Media index in SDP.
*
* @return PJ_SUCCESS on success, or the appropriate error code
.
*/
PJ_INLINE(pj_status_t) pjmedia_transport_encode_sdp(pjmedia_transport *tp,
pj_pool_t *sdp_pool,
pjmedia_sdp_session *sdp,
const pjmedia_sdp_session *rem_s
dp,
unsigned media_index)
{
return (*tp->op->encode_sdp)(tp, sdp_pool, sdp, rem_sdp, media_index);
}
/**
* Start the transport session with the settings in both local and remote
* SDP. The actual work that is done by this function depends on the
* underlying transport type. For SRTP, this will activate the encryption
* and decryption based on the keys found the SDPs. For ICE, this will
* start ICE negotiation according to the information found in the SDPs.
*
* This is just a simple wrapper which calls <tt>media_start()</tt> member
* of the transport.
*
* @param tp The media transport.
* @param tmp_pool The memory pool for allocating temporary objects.
* @param sdp_local Local SDP.
* @param sdp_remote Remote SDP.
* @param media_index Media index in the SDP.
*
* @return PJ_SUCCESS on success, or the appropriate error code
.
*/
PJ_INLINE(pj_status_t) pjmedia_transport_media_start(pjmedia_transport *tp,
pj_pool_t *tmp_pool,
const pjmedia_sdp_session *sdp_local,
const pjmedia_sdp_session *sdp_remote,
unsigned media_index)
{
return (*tp->op->media_start)(tp, tmp_pool, sdp_local, sdp_remote,
media_index);
}
/**
* This API should be called when the session is stopped, to allow the medi
a
* transport to release its resources used for the session.
*
* This is just a simple wrapper which calls <tt>media_stop()</tt> member
* of the transport.
*
* @param tp The media transport.
*
* @return PJ_SUCCESS on success, or the appropriate error code
.
*/
PJ_INLINE(pj_status_t) pjmedia_transport_media_stop(pjmedia_transport *tp)
{
return (*tp->op->media_stop)(tp);
}
/**
* Close media transport. This is just a simple wrapper which calls * Close media transport. This is just a simple wrapper which calls
* <tt>destroy()</tt> member of the transport. This function will free * <tt>destroy()</tt> member of the transport. This function will free
* all resources created by this transport (such as sockets, memory, etc.). * all resources created by this transport (such as sockets, memory, etc.).
* *
* @param tp The media transport. * @param tp The media transport.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_INLINE(pj_status_t) pjmedia_transport_close(pjmedia_transport *tp) PJ_INLINE(pj_status_t) pjmedia_transport_close(pjmedia_transport *tp)
{ {
if (tp->op->destroy) if (tp->op->destroy)
return (*tp->op->destroy)(tp); return (*tp->op->destroy)(tp);
else else
return PJ_SUCCESS; return PJ_SUCCESS;
} }
/**
* Simulate packet lost in the specified direction (for testing purposes).
* When enabled, the transport will randomly drop packets to the specified
* direction.
*
* @param tp The media transport.
* @param dir Media direction to which packets will be randomly droppe
d.
* @param pct_lost Percent lost (0-100). Set to zero to disable packet
* lost simulation.
*
* @return PJ_SUCCESS on success.
*/
PJ_INLINE(pj_status_t) pjmedia_transport_simulate_lost(pjmedia_transport *t
p,
pjmedia_dir dir,
unsigned pct_lost)
{
return (*tp->op->simulate_lost)(tp, dir, pct_lost);
}
PJ_END_DECL PJ_END_DECL
/** /**
* @} * @}
*/ */
#endif /* __PJMEDIA_TRANSPORT_H__ */ #endif /* __PJMEDIA_TRANSPORT_H__ */
 End of changes. 24 change blocks. 
35 lines changed or deleted 418 lines changed or added


 transport_ice.h   transport_ice.h 
/* $Id: transport_ice.h 1436 2007-09-15 08:55:00Z bennylp $ */ /* $Id: transport_ice.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __pjmedia_ice_H__ #ifndef __PJMEDIA_TRANSPORT_ICE_H__
#define __pjmedia_ice_H__ #define __PJMEDIA_TRANSPORT_ICE_H__
/** /**
* @file transport_ice.h * @file transport_ice.h
* @brief ICE capable media transport. * @brief ICE capable media transport.
*/ */
#include <pjmedia/stream.h> #include <pjmedia/stream.h>
#include <pjnath/ice_strans.h> #include <pjnath/ice_strans.h>
/** /**
* @defgroup PJMEDIA_TRANSPORT_ICE ICE Capable media transport * @defgroup PJMEDIA_TRANSPORT_ICE ICE Media Transport
* @ingroup PJMEDIA_TRANSPORT * @ingroup PJMEDIA_TRANSPORT
* @brief Implementation of media transport with ICE. * @brief Interactive Connectivity Establishment (ICE) transport
* @{ * @{
*
* This describes the implementation of media transport using
* Interactive Connectivity Establishment (ICE) protocol.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Structure containing callbacks to receive ICE notifications. * Structure containing callbacks to receive ICE notifications.
*/ */
typedef struct pjmedia_ice_cb typedef struct pjmedia_ice_cb
{ {
/** /**
* This callback will be called when ICE negotiation completes. * This callback will be called when ICE negotiation completes.
* *
* @param tp PJMEDIA ICE transport. * @param tp PJMEDIA ICE transport.
* @param status ICE negotiation result, PJ_SUCCESS on success. * @param op The operation
* @param status Operation status.
*/ */
void (*on_ice_complete)(pjmedia_transport *tp, void (*on_ice_complete)(pjmedia_transport *tp,
pj_ice_strans_op op,
pj_status_t status); pj_status_t status);
} pjmedia_ice_cb; } pjmedia_ice_cb;
/** /**
* Create the media transport. * Create the Interactive Connectivity Establishment (ICE) media transport
* using the specified configuration. When STUN or TURN (or both) is used,
* the creation operation will complete asynchronously, when STUN resolutio
n
* and TURN allocation completes. When the initialization completes, the
* \a on_ice_complete() complete will be called with \a op parameter equal
* to PJ_ICE_STRANS_OP_INIT.
*
* In addition, this transport will also notify the application about the
* result of ICE negotiation, also in \a on_ice_complete() callback. In thi
s
* case the callback will be called with \a op parameter equal to
* PJ_ICE_STRANS_OP_NEGOTIATION.
*
* Other than this, application should use the \ref PJMEDIA_TRANSPORT API
* to manipulate this media transport.
* *
* @param endpt The media endpoint. * @param endpt The media endpoint.
* @param name Optional name to identify this ICE media transport * @param name Optional name to identify this ICE media transport
* for logging purposes. * for logging purposes.
* @param comp_cnt Number of components to be created. * @param comp_cnt Number of components to be created.
* @param stun_cfg Pointer to STUN configuration settings. * @param cfg Pointer to configuration settings.
* @param cb Optional callbacks. * @param cb Optional structure containing ICE specific callbacks
.
* @param p_tp Pointer to receive the media transport instance. * @param p_tp Pointer to receive the media transport instance.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
*/ */
PJ_DECL(pj_status_t) pjmedia_ice_create(pjmedia_endpt *endpt, PJ_DECL(pj_status_t) pjmedia_ice_create(pjmedia_endpt *endpt,
const char *name, const char *name,
unsigned comp_cnt, unsigned comp_cnt,
pj_stun_config *stun_cfg, const pj_ice_strans_cfg *cfg,
const pjmedia_ice_cb *cb, const pjmedia_ice_cb *cb,
pjmedia_transport **p_tp); pjmedia_transport **p_tp);
/**
* Destroy the media transport.
*
* @param tp The media transport.
*
* @return PJ_SUCCESS.
*/
PJ_DECL(pj_status_t) pjmedia_ice_destroy(pjmedia_transport *tp);
/**
* Start the initialization process of this media transport. This function
* will gather the transport addresses to be registered to ICE session as
* candidates. If STUN is configured, this will start the STUN Binding or
* Allocate request to get the STUN server reflexive or relayed address.
* This function will return immediately, and application should poll the
* STUN completion status by calling #pjmedia_ice_get_init_status().
*
* @param tp The media transport.
* @param options Options, see pj_ice_strans_option in PJNATH
* documentation.
* @param start_addr Local address where socket will be bound to. This
* address will be used as follows:
* - if the value is NULL, then socket will be bound
* to any available port.
* - if the value is not NULL, then if the port number
* is not zero, it will used as the starting port
* where the socket will be bound to. If bind() to
* this port fails, this function will try to bind
* to port+2, repeatedly until it succeeded.
* If application doesn't want this function to
* retry binding the socket to other port, it can
* specify PJ_ICE_ST_OPT_NO_PORT_RETRY option.
* - if the value is not NULL, then if the address
* is not INADDR_ANY, this function will bind the
* socket to this particular interface only, and
* no other host candidates will be added for this
* socket.
* @param stun_srv Address of the STUN server, or NULL if STUN server
* reflexive mapping is not to be used.
* @param turn_srv Address of the TURN server, or NULL if TURN relay
* is not to be used.
*
* @return PJ_SUCCESS when the initialization process has start
ed
* successfully, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_ice_start_init(pjmedia_transport *tp,
unsigned options,
const pj_sockaddr_in *start_addr
,
const pj_sockaddr_in *stun_srv,
const pj_sockaddr_in *turn_srv);
/**
* Poll the initialization status of this media transport.
*
* @param tp The media transport.
*
* @return PJ_SUCCESS if all candidates have been resolved
* successfully, PJ_EPENDING if transport resolution
* is still in progress, or other status on failure.
*/
PJ_DECL(pj_status_t) pjmedia_ice_get_init_status(pjmedia_transport *tp);
/**
* Get the ICE stream transport component for the specified component ID.
*
* @param tp The media transport.
* @param comp_id The component ID.
* @param comp The structure which will be filled with the
* component.
*
* @return PJ_SUCCESS or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_ice_get_comp(pjmedia_transport *tp,
unsigned comp_id,
pj_ice_strans_comp *comp);
/**
* Initialize the ICE session.
*
* @param tp The media transport.
* @param role ICE role.
* @param local_ufrag Optional local username fragment.
* @param local_passwd Optional local password.
*
* @return PJ_SUCCESS, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_ice_init_ice(pjmedia_transport *tp,
pj_ice_sess_role role,
const pj_str_t *local_ufrag,
const pj_str_t *local_passwd);
/**
* Modify the SDP to add ICE specific SDP attributes before sending
* the SDP to remote host.
*
* @param tp The media transport.
* @param pool Pool to allocate memory for the SDP elements.
* @param sdp The SDP descriptor to be modified.
*
* @return PJ_SUCCESS, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_ice_modify_sdp(pjmedia_transport *tp,
pj_pool_t *pool,
pjmedia_sdp_session *sdp);
/**
* Start ICE connectivity checks.
*
* This function will pair the local and remote candidates to create
* check list. Once the check list is created and sorted based on the
* priority, ICE periodic checks will be started. This function will
* return immediately, and application will be notified about the
* connectivity check status in the callback.
*
* @param tp The media transport.
* @param pool Memory pool to parse the SDP.
* @param rem_sdp The SDP received from remote agent.
* @param media_index The media index (in SDP) to process.
*
* @return PJ_SUCCESS, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_ice_start_ice(pjmedia_transport *tp,
pj_pool_t *pool,
const pjmedia_sdp_session *rem_sd
p,
unsigned media_index);
/**
* Stop the ICE session (typically when the call is terminated). Applicatio
n
* may restart the ICE session again by calling #pjmedia_ice_init_ice(),
* for example to use this media transport for the next call.
*
* @param tp The media transport.
*
* @return PJ_SUCCESS, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_ice_stop_ice(pjmedia_transport *tp);
/**
* Simulate packet lost in the specified direction (for testing purposes).
* When enabled, the transport will randomly drop packets to the specified
* direction.
*
* @param tp The ICE media transport.
* @param dir Media direction to which packets will be randomly droppe
d.
* @param pct_lost Percent lost (0-100). Set to zero to disable packet
* lost simulation.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_ice_simulate_lost(pjmedia_transport *tp,
pjmedia_dir dir,
unsigned pct_lost);
PJ_END_DECL PJ_END_DECL
/** /**
* @} * @}
*/ */
#endif /* __pjmedia_ice_H__ */ #endif /* __PJMEDIA_TRANSPORT_ICE_H__ */
 End of changes. 13 change blocks. 
170 lines changed or deleted 32 lines changed or added


 transport_udp.h   transport_udp.h 
/* $Id: transport_udp.h 1112 2007-03-28 16:24:00Z bennylp $ */ /* $Id: transport_udp.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 30 skipping to change at line 30
#define __PJMEDIA_TRANSPORT_UDP_H__ #define __PJMEDIA_TRANSPORT_UDP_H__
/** /**
* @file transport_udp.h * @file transport_udp.h
* @brief Stream transport with UDP. * @brief Stream transport with UDP.
*/ */
#include <pjmedia/stream.h> #include <pjmedia/stream.h>
/** /**
* @defgroup PJMEDIA_TRANSPORT_UDP UDP Socket Transport * @defgroup PJMEDIA_TRANSPORT_UDP UDP Media Transport
* @ingroup PJMEDIA_TRANSPORT * @ingroup PJMEDIA_TRANSPORT
* @brief Implementation of media transport with UDP sockets. * @brief Implementation of media transport with UDP sockets.
* @{ * @{
*
* The UDP media transport is the standard based media transport
* as described by RFC 3550/3551. It can be used to facilitate RTP/RTCP
* unicast or multicast communication.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Options that can be specified when creating UDP transport. * Options that can be specified when creating UDP transport.
*/ */
enum pjmedia_transport_udp_options enum pjmedia_transport_udp_options
{ {
/** /**
skipping to change at line 55 skipping to change at line 59
* of incoming packets to see if it is different than the configured * of incoming packets to see if it is different than the configured
* remote address, and switch the remote address to the source address * remote address, and switch the remote address to the source address
* of the packet if they are different after several packets are * of the packet if they are different after several packets are
* received. * received.
* Specifying this option will disable this feature. * Specifying this option will disable this feature.
*/ */
PJMEDIA_UDP_NO_SRC_ADDR_CHECKING = 1 PJMEDIA_UDP_NO_SRC_ADDR_CHECKING = 1
}; };
/** /**
* UDP transport info.
*/
typedef struct pjmedia_transport_udp_info
{
/**
* Media socket info.
*/
pjmedia_sock_info skinfo;
} pjmedia_transport_udp_info;
/**
* Create an RTP and RTCP sockets and bind the sockets to the specified * Create an RTP and RTCP sockets and bind the sockets to the specified
* port to create media transport. * port to create media transport.
* *
* @param endpt The media endpoint instance. * @param endpt The media endpoint instance.
* @param name Optional name to be assigned to the transport. * @param name Optional name to be assigned to the transport.
* @param port UDP port number for the RTP socket. The RTCP port number * @param port UDP port number for the RTP socket. The RTCP port number
* will be set to one above RTP port. * will be set to one above RTP port.
* @param options Options, bitmask of #pjmedia_transport_udp_options. * @param options Options, bitmask of #pjmedia_transport_udp_options.
* @param p_tp Pointer to receive the transport instance. * @param p_tp Pointer to receive the transport instance.
* *
skipping to change at line 109 skipping to change at line 101
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_transport_udp_create2(pjmedia_endpt *endpt, PJ_DECL(pj_status_t) pjmedia_transport_udp_create2(pjmedia_endpt *endpt,
const char *name, const char *name,
const pj_str_t *addr, const pj_str_t *addr,
int port, int port,
unsigned options, unsigned options,
pjmedia_transport **p_tp) ; pjmedia_transport **p_tp) ;
/** /**
* Get media socket info from the specified UDP transport. * Another variant of #pjmedia_transport_udp_create() which allows
* the creation of IPv6 transport.
* *
* @param tp The UDP transport interface. * @param endpt The media endpoint instance.
* @param info Media socket info to be initialized. * @param af Address family, which can be pj_AF_INET() for IPv4 or
* pj_AF_INET6() for IPv6.
* @param name Optional name to be assigned to the transport.
* @param addr Optional local address to bind the sockets to. If this
* argument is NULL or empty, the sockets will be bound
* to all interface.
* @param port UDP port number for the RTP socket. The RTCP port number
* will be set to one above RTP port.
* @param options Options, bitmask of #pjmedia_transport_udp_options.
* @param p_tp Pointer to receive the transport instance.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) PJ_DECL(pj_status_t) pjmedia_transport_udp_create3(pjmedia_endpt *endpt,
pjmedia_transport_udp_get_info( pjmedia_transport *tp, int af,
pjmedia_transport_udp_info *info); const char *name,
const pj_str_t *addr,
int port,
unsigned options,
pjmedia_transport **p_tp)
;
/** /**
* Create UDP stream transport from existing sockets. Use this function whe n * Create UDP stream transport from existing sockets. Use this function whe n
* the sockets have previously been created. * the sockets have previously been created.
* *
* @param endpt The media endpoint instance. * @param endpt The media endpoint instance.
* @param name Optional name to be assigned to the transport. * @param name Optional name to be assigned to the transport.
* @param si Media socket info containing the RTP and RTCP sockets. * @param si Media socket info containing the RTP and RTCP sockets.
* @param options Options, bitmask of #pjmedia_transport_udp_options. * @param options Options, bitmask of #pjmedia_transport_udp_options.
* @param p_tp Pointer to receive the transport instance. * @param p_tp Pointer to receive the transport instance.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_transport_udp_attach(pjmedia_endpt *endpt, PJ_DECL(pj_status_t) pjmedia_transport_udp_attach(pjmedia_endpt *endpt,
const char *name, const char *name,
const pjmedia_sock_info *s i, const pjmedia_sock_info *s i,
unsigned options, unsigned options,
pjmedia_transport **p_tp); pjmedia_transport **p_tp);
/**
* Simulate packet lost in the specified direction (for testing purposes).
* When enabled, the transport will randomly drop packets to the specified
* direction.
*
* @param tp The UDP media transport.
* @param dir Media direction to which packets will be randomly droppe
d.
* @param pct_lost Percent lost (0-100). Set to zero to disable packet
* lost simulation.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_transport_udp_simulate_lost(pjmedia_transport
*tp,
pjmedia_dir dir,
unsigned pct_lost);
/**
* Close UDP transport. Application can also use the "destroy" member of
* media transport interface to close the UDP transport.
*
* @param tp The UDP media transport.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_transport_udp_close(pjmedia_transport *tp);
PJ_END_DECL PJ_END_DECL
/** /**
* @} * @}
*/ */
#endif /* __PJMEDIA_TRANSPORT_UDP_H__ */ #endif /* __PJMEDIA_TRANSPORT_UDP_H__ */
 End of changes. 9 change blocks. 
49 lines changed or deleted 28 lines changed or added


 types.h   types.h 
/* $Id: types.h 1405 2007-07-20 08:08:30Z bennylp $ */ /* $Id: types.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJ_TYPES_H__ #ifndef __PJ_TYPES_H__
#define __PJ_TYPES_H__ #define __PJ_TYPES_H__
/** /**
* @defgroup PJ PJ Library
*/
/**
* @file types.h * @file types.h
* @brief Declaration of basic types and utility. * @brief Declaration of basic types and utility.
*/ */
/** /**
* @defgroup PJ_BASIC Basic Data Types and Library Functionality. * @defgroup PJ_BASIC Basic Data Types and Library Functionality.
* @ingroup PJ_DS * @ingroup PJ_DS
* @{ * @{
*/ */
#include <pj/config.h> #include <pj/config.h>
 End of changes. 3 change blocks. 
5 lines changed or deleted 2 lines changed or added


 unicode.h   unicode.h 
/* $Id: unicode.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: unicode.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C)2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 wav_playlist.h   wav_playlist.h 
/* $Id: wav_playlist.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: wav_playlist.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 33 skipping to change at line 33
* @file wav_playlist.h * @file wav_playlist.h
* @brief WAV file playlist. * @brief WAV file playlist.
*/ */
#include <pjmedia/wav_port.h> #include <pjmedia/wav_port.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJMEDIA_WAV_PLAYLIST WAV File Play List * @defgroup PJMEDIA_WAV_PLAYLIST WAV File Play List
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief WAV File Playlist * @brief Audio playback of multiple WAV files
* @{ * @{
*
* The WAV play list port enables application to play back multiple * The WAV play list port enables application to play back multiple
* WAV files in a playlist. * WAV files in a playlist.
*/ */
/** /**
* Create a WAV playlist from the array of WAV file names. The WAV * Create a WAV playlist from the array of WAV file names. The WAV
* files must have the same clock rate, number of channels, and bits * files must have the same clock rate, number of channels, and bits
* per sample, or otherwise this function will return error. * per sample, or otherwise this function will return error.
* *
* @param pool Pool to create memory buffers for this port. * @param pool Pool to create memory buffers for this port.
 End of changes. 4 change blocks. 
3 lines changed or deleted 4 lines changed or added


 wav_port.h   wav_port.h 
/* $Id: wav_port.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: wav_port.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 33 skipping to change at line 33
* @file wav_port.h * @file wav_port.h
* @brief WAV file player and writer. * @brief WAV file player and writer.
*/ */
#include <pjmedia/port.h> #include <pjmedia/port.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJMEDIA_FILE_PLAY WAV File Player * @defgroup PJMEDIA_FILE_PLAY WAV File Player
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief WAV File Player * @brief Audio playback from WAV file
* @{ * @{
*/ */
/** /**
* WAV file player options. * WAV file player options.
*/ */
enum pjmedia_file_player_option enum pjmedia_file_player_option
{ {
/** /**
* Tell the file player to return NULL frame when the whole * Tell the file player to return NULL frame when the whole
skipping to change at line 73 skipping to change at line 73
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_wav_player_port_create( pj_pool_t *pool, PJ_DECL(pj_status_t) pjmedia_wav_player_port_create( pj_pool_t *pool,
const char *filename, const char *filename,
unsigned ptime, unsigned ptime,
unsigned flags, unsigned flags,
pj_ssize_t buff_size, pj_ssize_t buff_size,
pjmedia_port **p_port ) ; pjmedia_port **p_port ) ;
/** /**
* Get the data length, in bytes.
*
* @param port The file player port.
*
* @return The length of the data, in bytes. Upon error it will
* return negative value.
*/
PJ_DECL(pj_ssize_t) pjmedia_wav_player_get_len(pjmedia_port *port);
/**
* Set the file play position of WAV player. * Set the file play position of WAV player.
* *
* @param port The file player port. * @param port The file player port.
* @param offset Playback position in bytes, relative to the start of * @param offset Playback position in bytes, relative to the start of
* the payload. * the payload.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjmedia_wav_player_port_set_pos( pjmedia_port *port, PJ_DECL(pj_status_t) pjmedia_wav_player_port_set_pos( pjmedia_port *port,
pj_uint32_t offset ); pj_uint32_t offset );
skipping to change at line 121 skipping to change at line 131
pj_status_t (*cb)(pjmedia_port *port, pj_status_t (*cb)(pjmedia_port *port,
void *usr_data)); void *usr_data));
/** /**
* @} * @}
*/ */
/** /**
* @defgroup PJMEDIA_FILE_REC File Writer (Recorder) * @defgroup PJMEDIA_FILE_REC File Writer (Recorder)
* @ingroup PJMEDIA_PORT * @ingroup PJMEDIA_PORT
* @brief WAV File Writer (Recorder) * @brief Audio capture/recording to WAV file
* @{ * @{
*/ */
/** /**
* Create a media port to record streams to a WAV file. Note that the port * Create a media port to record streams to a WAV file. Note that the port
* must be closed properly (with #pjmedia_port_destroy()) so that the WAV * must be closed properly (with #pjmedia_port_destroy()) so that the WAV
* header can be filled with correct values (such as the file length). * header can be filled with correct values (such as the file length).
* *
* @param pool Pool to create memory buffers for this port. * @param pool Pool to create memory buffers for this port.
* @param filename File name. * @param filename File name.
 End of changes. 5 change blocks. 
4 lines changed or deleted 14 lines changed or added


 wave.h   wave.h 
/* $Id: wave.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: wave.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 29 skipping to change at line 29
#ifndef __PJMEDIA_WAVE_H__ #ifndef __PJMEDIA_WAVE_H__
#define __PJMEDIA_WAVE_H__ #define __PJMEDIA_WAVE_H__
/** /**
* @file wave.h * @file wave.h
* @brief WAVE file manipulation. * @brief WAVE file manipulation.
*/ */
#include <pjmedia/types.h> #include <pjmedia/types.h>
/** /**
* @defgroup PJMEDIA_FILE_FORMAT File Formats
* @brief Supported file formats
*/
/**
* @defgroup PJMEDIA_WAVE WAVE Header * @defgroup PJMEDIA_WAVE WAVE Header
* @ingroup PJMEDIA_MISC * @ingroup PJMEDIA_FILE_FORMAT
* @brief Representation of RIFF/WAVE file format
* @{ * @{
* *
* Supports for simple/canonical Microsoft RIFF WAVE format. * This the the low level representation of RIFF/WAVE file format. For
* higher abstraction, please see \ref PJMEDIA_FILE_PLAY and
* \ref PJMEDIA_FILE_REC.
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Standard RIFF tag to identify RIFF file format in the WAVE header. * Standard RIFF tag to identify RIFF file format in the WAVE header.
*/ */
#define PJMEDIA_RIFF_TAG ('F'<<24|'F'<<16|'I'<<8|'R') #define PJMEDIA_RIFF_TAG ('F'<<24|'F'<<16|'I'<<8|'R')
/** /**
 End of changes. 5 change blocks. 
4 lines changed or deleted 12 lines changed or added


 xml.h   xml.h 
/* $Id: xml.h 1374 2007-06-19 09:04:58Z bennylp $ */ /* $Id: xml.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 34 skipping to change at line 34
* @brief PJLIB XML Parser/Helper. * @brief PJLIB XML Parser/Helper.
*/ */
#include <pj/types.h> #include <pj/types.h>
#include <pj/list.h> #include <pj/list.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJ_TINY_XML Mini/Tiny XML Parser/Helper * @defgroup PJ_TINY_XML Mini/Tiny XML Parser/Helper
* @ingroup PJLIB_UTIL * @ingroup PJ_FILE_FMT
* @{ * @{
*/ */
/** Typedef for XML attribute. */ /** Typedef for XML attribute. */
typedef struct pj_xml_attr pj_xml_attr; typedef struct pj_xml_attr pj_xml_attr;
/** Typedef for XML nodes. */ /** Typedef for XML nodes. */
typedef struct pj_xml_node pj_xml_node; typedef struct pj_xml_node pj_xml_node;
/** This structure declares XML attribute. */ /** This structure declares XML attribute. */
skipping to change at line 96 skipping to change at line 96
* *
* @param node The XML node to print. * @param node The XML node to print.
* @param buf Buffer to hold the output message. * @param buf Buffer to hold the output message.
* @param len The length of the buffer. * @param len The length of the buffer.
* @param prolog If set to nonzero, will print XML prolog ("<?xml..") * @param prolog If set to nonzero, will print XML prolog ("<?xml..")
* *
* @return The size of the printed message, or -1 if there is not * @return The size of the printed message, or -1 if there is not
* sufficient space in the buffer to print the message. * sufficient space in the buffer to print the message.
*/ */
PJ_DECL(int) pj_xml_print( const pj_xml_node *node, char *buf, pj_size_t le n, PJ_DECL(int) pj_xml_print( const pj_xml_node *node, char *buf, pj_size_t le n,
pj_bool_t include_prolog); pj_bool_t prolog);
/** /**
* Clone XML node and all subnodes. * Clone XML node and all subnodes.
* *
* @param pool Pool to allocate memory for new nodes. * @param pool Pool to allocate memory for new nodes.
* @param rhs The node to clone. * @param rhs The node to clone.
* *
* @return Cloned XML node, or NULL on fail. * @return Cloned XML node, or NULL on fail.
*/ */
PJ_DECL(pj_xml_node*) pj_xml_clone( pj_pool_t *pool, const pj_xml_node *rhs ); PJ_DECL(pj_xml_node*) pj_xml_clone( pj_pool_t *pool, const pj_xml_node *rhs );
skipping to change at line 123 skipping to change at line 123
* *
* @return The new node. * @return The new node.
*/ */
PJ_DECL(pj_xml_node*) pj_xml_node_new(pj_pool_t *pool, const pj_str_t *name ); PJ_DECL(pj_xml_node*) pj_xml_node_new(pj_pool_t *pool, const pj_str_t *name );
/** /**
* Create new XML attribute. * Create new XML attribute.
* *
* @param pool Pool. * @param pool Pool.
* @param name Attribute name. * @param name Attribute name.
* @param attr Attribute value. * @param value Attribute value.
* *
* @return The new XML attribute. * @return The new XML attribute.
*/ */
PJ_DECL(pj_xml_attr*) pj_xml_attr_new(pj_pool_t *pool, const pj_str_t *name , PJ_DECL(pj_xml_attr*) pj_xml_attr_new(pj_pool_t *pool, const pj_str_t *name ,
const pj_str_t *value); const pj_str_t *value);
/** /**
* Add node to another node. * Add node to another node.
* *
* @param parent Parent node. * @param parent Parent node.
skipping to change at line 160 skipping to change at line 160
* @param name Node name to find. * @param name Node name to find.
* *
* @return XML node found or NULL. * @return XML node found or NULL.
*/ */
PJ_DECL(pj_xml_node*) pj_xml_find_node(pj_xml_node *parent, const pj_str_t *name); PJ_DECL(pj_xml_node*) pj_xml_find_node(pj_xml_node *parent, const pj_str_t *name);
/** /**
* Find first node with the specified name. * Find first node with the specified name.
* *
* @param parent Parent node. * @param parent Parent node.
* @param node node->next is the starting point.
* @param name Node name to find. * @param name Node name to find.
* *
* @return XML node found or NULL. * @return XML node found or NULL.
*/ */
PJ_DECL(pj_xml_node*) pj_xml_find_next_node(pj_xml_node *parent, pj_xml_nod e *node, PJ_DECL(pj_xml_node*) pj_xml_find_next_node(pj_xml_node *parent, pj_xml_nod e *node,
const pj_str_t *name); const pj_str_t *name);
/** /**
* Find first attribute within a node with the specified name and optional value. * Find first attribute within a node with the specified name and optional value.
* *
skipping to change at line 182 skipping to change at line 183
* @param value Optional value to match. * @param value Optional value to match.
* *
* @return XML attribute found, or NULL. * @return XML attribute found, or NULL.
*/ */
PJ_DECL(pj_xml_attr*) pj_xml_find_attr(pj_xml_node *node, const pj_str_t *n ame, PJ_DECL(pj_xml_attr*) pj_xml_find_attr(pj_xml_node *node, const pj_str_t *n ame,
const pj_str_t *value); const pj_str_t *value);
/** /**
* Find a direct child node with the specified name and match the function. * Find a direct child node with the specified name and match the function.
* *
* @param node Parent node. * @param parent Parent node.
* @param name Optional name. * @param name Optional name.
* @param data Data to be passed to matching function. * @param data Data to be passed to matching function.
* @param match Optional matching function. * @param match Optional matching function.
* *
* @return The first matched node, or NULL. * @return The first matched node, or NULL.
*/ */
PJ_DECL(pj_xml_node*) pj_xml_find( pj_xml_node *parent, const pj_str_t *nam e, PJ_DECL(pj_xml_node*) pj_xml_find( pj_xml_node *parent, const pj_str_t *nam e,
const void *data, const void *data,
pj_bool_t (*match)(pj_xml_node *, const v oid*)); pj_bool_t (*match)(pj_xml_node *, const v oid*));
 End of changes. 7 change blocks. 
6 lines changed or deleted 7 lines changed or added


 xpidf.h   xpidf.h 
/* $Id: xpidf.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: xpidf.h 2039 2008-06-20 22:44:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 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,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 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/