forked from nesterenkodm/pjsip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
4,591 additions
and
1,753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $Id: dns.h 3553 2011-05-05 06:14:19Z nanang $ */ | ||
/* $Id: dns.h 5350 2016-06-21 06:55:10Z riza $ */ | ||
/* | ||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | ||
* Copyright (C) 2003-2008 Benny Prijono <[email protected]> | ||
|
@@ -426,6 +426,22 @@ PJ_DECL(void) pj_dns_init_a_rr(pj_dns_parsed_rr *rec, | |
unsigned ttl, | ||
const pj_in_addr *ip_addr); | ||
|
||
/** | ||
* Initialize DNS record as DNS AAAA record. | ||
* | ||
* @param rec The DNS resource record to be initialized as DNS | ||
* AAAA 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_aaaa_rr(pj_dns_parsed_rr *rec, | ||
const pj_str_t *res_name, | ||
unsigned dnsclass, | ||
unsigned ttl, | ||
const pj_in6_addr *ip_addr); | ||
|
||
/** | ||
* Dump DNS packet to standard log. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $Id: resolver.h 3553 2011-05-05 06:14:19Z nanang $ */ | ||
/* $Id: resolver.h 5349 2016-06-20 10:10:42Z nanang $ */ | ||
/* | ||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | ||
* Copyright (C) 2003-2008 Benny Prijono <[email protected]> | ||
|
@@ -225,6 +225,47 @@ typedef struct pj_dns_a_record | |
} pj_dns_a_record; | ||
|
||
|
||
/** | ||
* This structure represents DNS address record, i.e: DNS A and DNS AAAA | ||
* records, as the result of parsing DNS response packet using | ||
* #pj_dns_parse_addr_response(). | ||
*/ | ||
typedef struct pj_dns_addr_record | ||
{ | ||
/** The target name being queried. */ | ||
pj_str_t name; | ||
|
||
/** If target name corresponds to a CNAME entry, the alias contains | ||
* the value of the CNAME entry, otherwise it will be empty. | ||
*/ | ||
pj_str_t alias; | ||
|
||
/** Number of IP addresses. */ | ||
unsigned addr_count; | ||
|
||
/** IP addresses of the host found in the response */ | ||
struct { | ||
|
||
/** IP address family */ | ||
int af; | ||
|
||
/** IP address */ | ||
union { | ||
/** IPv4 address */ | ||
pj_in_addr v4; | ||
|
||
/** IPv6 address */ | ||
pj_in6_addr v6; | ||
} ip; | ||
|
||
} addr[PJ_DNS_MAX_IP_IN_A_REC]; | ||
|
||
/** Internal buffer for hostname and alias. */ | ||
char buf_[128]; | ||
|
||
} pj_dns_addr_record; | ||
|
||
|
||
/** | ||
* Set default values to the DNS settings. | ||
* | ||
|
@@ -407,6 +448,21 @@ PJ_DECL(pj_status_t) pj_dns_parse_a_response(const pj_dns_parsed_packet *pkt, | |
pj_dns_a_record *rec); | ||
|
||
|
||
/** | ||
* A utility function to parse a DNS response containing AAAA records into | ||
* DNS AAAA record. | ||
* | ||
* @param pkt The DNS response packet. | ||
* @param rec The structure to be initialized with the parsed | ||
* DNS AAAA record from the packet. | ||
* | ||
* @return PJ_SUCCESS if response can be parsed successfully. | ||
*/ | ||
PJ_DECL(pj_status_t) pj_dns_parse_addr_response( | ||
const pj_dns_parsed_packet *pkt, | ||
pj_dns_addr_record *rec); | ||
|
||
|
||
/** | ||
* Put the specified DNS packet into DNS cache. This function is mainly used | ||
* for testing the resolver, however it can also be used to inject entries | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $Id: srv_resolver.h 3553 2011-05-05 06:14:19Z nanang $ */ | ||
/* $Id: srv_resolver.h 5349 2016-06-20 10:10:42Z nanang $ */ | ||
/* | ||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | ||
* Copyright (C) 2003-2008 Benny Prijono <[email protected]> | ||
|
@@ -84,27 +84,34 @@ 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. | ||
* make the resolver fallback to both DNS A and DNS AAAA | ||
* resolutions if SRV 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. | ||
* be specified together with PJ_DNS_SRV_FALLBACK_AAAA to | ||
* make the resolver fallback to both DNS A and DNS AAAA | ||
* resolutions if SRV 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. | ||
* resolution 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, | ||
|
||
/** | ||
* Specify if the resolver should try to resolve with DNS AAAA | ||
* resolution only (i.e: without DNS A resolution) for each targets | ||
* in the DNS SRV record. | ||
*/ | ||
PJ_DNS_SRV_RESOLVE_AAAA = 4 | ||
PJ_DNS_SRV_RESOLVE_AAAA_ONLY = 8 | ||
|
||
} pj_dns_srv_option; | ||
|
||
|
@@ -131,7 +138,7 @@ typedef struct pj_dns_srv_record | |
pj_uint16_t port; | ||
|
||
/** The host address. */ | ||
pj_dns_a_record server; | ||
pj_dns_addr_record server; | ||
|
||
} entry[PJ_DNS_SRV_MAX_ADDR]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* pjlib/include/pj/compat/os_auto.h. Generated from os_auto.h.in by configure. */ | ||
/* $Id: os_auto.h.in 3841 2011-10-24 09:28:13Z ming $ */ | ||
/* $Id: os_auto.h.in 5247 2016-02-25 04:54:17Z nanang $ */ | ||
/* | ||
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) | ||
* Copyright (C) 2003-2008 Benny Prijono <[email protected]> | ||
|
@@ -28,7 +28,7 @@ | |
*/ | ||
|
||
/* Canonical OS name */ | ||
#define PJ_OS_NAME "arm-apple-darwin9" | ||
#define PJ_OS_NAME "x86_64-apple-darwin_ios" | ||
|
||
/* Legacy macros */ | ||
/* #undef PJ_WIN32 */ | ||
|
@@ -129,6 +129,9 @@ | |
*/ | ||
#define PJ_SELECT_NEEDS_NFDS 0 | ||
|
||
/* Was Linux epoll support enabled */ | ||
/* #undef PJ_HAS_LINUX_EPOLL */ | ||
|
||
/* Is errno a good way to retrieve OS errors? | ||
*/ | ||
#define PJ_HAS_ERRNO_VAR 1 | ||
|
@@ -167,7 +170,7 @@ | |
#define PJ_NATIVE_STRING_IS_UNICODE 0 | ||
|
||
/* Pool alignment in bytes */ | ||
#define PJ_POOL_ALIGNMENT 4 | ||
#define PJ_POOL_ALIGNMENT 8 | ||
|
||
/* The type of atomic variable value: */ | ||
#define PJ_ATOMIC_VALUE_TYPE long | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $Id: os_auto.h.in 3841 2011-10-24 09:28:13Z ming $ */ | ||
/* $Id: os_auto.h.in 5247 2016-02-25 04:54:17Z nanang $ */ | ||
/* | ||
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) | ||
* Copyright (C) 2003-2008 Benny Prijono <[email protected]> | ||
|
@@ -128,6 +128,9 @@ | |
*/ | ||
#undef PJ_SELECT_NEEDS_NFDS | ||
|
||
/* Was Linux epoll support enabled */ | ||
#undef PJ_HAS_LINUX_EPOLL | ||
|
||
/* Is errno a good way to retrieve OS errors? | ||
*/ | ||
#undef PJ_HAS_ERRNO_VAR | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $Id: socket.h 4537 2013-06-19 06:47:43Z riza $ */ | ||
/* $Id: socket.h 5312 2016-05-20 07:19:26Z riza $ */ | ||
/* | ||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | ||
* Copyright (C) 2003-2008 Benny Prijono <[email protected]> | ||
|
@@ -64,7 +64,7 @@ | |
# define s_addr S_un.S_addr | ||
# endif | ||
|
||
# if !defined(IPPROTO_IPV6) | ||
# if !defined(IPPROTO_IPV6) && (_WIN32_WINNT == 0x0500) | ||
/* Need to download and install IPv6Kit for this platform. | ||
* Please see the comments above about Visual Studio 6. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $Id: config.h 4913 2014-09-03 08:39:58Z nanang $ */ | ||
/* $Id: config.h 5394 2016-07-21 03:28:11Z ming $ */ | ||
/* | ||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | ||
* Copyright (C) 2003-2008 Benny Prijono <[email protected]> | ||
|
@@ -161,7 +161,8 @@ | |
|
||
|
||
#elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \ | ||
defined(__x86_64__) || defined(__x86_64) | ||
defined(__x86_64__) || defined(__x86_64) || \ | ||
defined(_M_X64) || defined(_M_AMD64) | ||
/* | ||
* AMD 64bit processor, little endian | ||
*/ | ||
|
@@ -674,12 +675,18 @@ | |
#else | ||
/* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES | ||
* is lower than FD_SETSIZE value. | ||
* | ||
* Update: Not all ioqueue backends require this (such as epoll), so | ||
* this check will be done on the ioqueue implementation itself, such as | ||
* ioqueue select. | ||
*/ | ||
/* | ||
# ifdef FD_SETSIZE | ||
# if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE | ||
# error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE" | ||
# endif | ||
# endif | ||
*/ | ||
#endif | ||
|
||
|
||
|
@@ -858,6 +865,28 @@ | |
#endif | ||
|
||
|
||
/** | ||
* Define the maximum number of ciphers supported by the secure socket. | ||
* | ||
* Default: 256 | ||
*/ | ||
#ifndef PJ_SSL_SOCK_MAX_CIPHERS | ||
# define PJ_SSL_SOCK_MAX_CIPHERS 256 | ||
#endif | ||
|
||
|
||
/** | ||
* Specify what should be set as the available list of SSL_CIPHERs. For | ||
* example, set this as "DEFAULT" to use the default cipher list (Note: | ||
* PJSIP release 2.4 and before used this "DEFAULT" setting). | ||
* | ||
* Default: "HIGH:-COMPLEMENTOFDEFAULT" | ||
*/ | ||
#ifndef PJ_SSL_SOCK_OSSL_CIPHERS | ||
# define PJ_SSL_SOCK_OSSL_CIPHERS "HIGH:-COMPLEMENTOFDEFAULT" | ||
#endif | ||
|
||
|
||
/** | ||
* Disable WSAECONNRESET error for UDP sockets on Win32 platforms. See | ||
* https://trac.pjsip.org/repos/ticket/1197. | ||
|
@@ -1188,10 +1217,10 @@ PJ_BEGIN_DECL | |
#define PJ_VERSION_NUM_MAJOR 2 | ||
|
||
/** PJLIB version minor number. */ | ||
#define PJ_VERSION_NUM_MINOR 3 | ||
#define PJ_VERSION_NUM_MINOR 5 | ||
|
||
/** PJLIB version revision number. */ | ||
#define PJ_VERSION_NUM_REV 0 | ||
#define PJ_VERSION_NUM_REV 5 | ||
|
||
/** | ||
* Extra suffix for the version (e.g. "-trunk"), or empty for | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.