diff -Nru libre-0.5.0/debian/changelog libre-0.5.3/debian/changelog --- libre-0.5.0/debian/changelog 2017-02-13 16:13:07.000000000 +0000 +++ libre-0.5.3/debian/changelog 2017-06-22 19:57:14.000000000 +0000 @@ -1,8 +1,56 @@ -libre (0.5.0-3ubuntu1) zesty; urgency=medium +libre (0.5.3-2ubuntu1) artful; urgency=medium - * Regenerate the symbols file and fix FTBFS. + * Refresh symbols to fix FTBFS caused by building against a different + openssl than Debian (LP: #1699430). - -- Bhavani Shankar Mon, 13 Feb 2017 21:35:54 +0530 + -- Simon Quigley Thu, 22 Jun 2017 14:57:14 -0500 + +libre (0.5.3-2) unstable; urgency=medium + + * Declare compliance with Debian Policy 4.0.0. + * Update symbols: 16 added/updated. + + -- Jonas Smedegaard Mon, 19 Jun 2017 20:11:53 +0200 + +libre (0.5.3-1) experimental; urgency=medium + + [ upstream ] + * New release(s): + + Handle Debian/kFreeBSD and Hurd. + + Make enum ice_role type public. + + Fix build for Solaris 11. + + Use unsigned for srtcp encrypted bit. + + Add tls_openssl_context() accessor function. + + Upgrade Windows project to VS2015. + + Makefile improvements. + + Remove session object "struct ice". + + Make sampling rate for telephone events configurable. + + [ Jonas Smedegaard ] + * Add myself as uploader. Sort uploaders in control file. + * Update copyright info: + + Update alternate git source URL. + + Add Github issue tracker as preferred upstream contact. + + Tidy and sort copyright holders. + + Use License sections, wrapped at 72 chars. + + Extend coverage for main upstream author. + * Have git-buildpackage filter any .git* file. + * Add copyright-check maintainer script to source. + * Drop patch 1001 adopted upstream. + * Tidy patch 0001 to use DEP3 header. + * Git-ignore quilt .pc dir. + * Relax symbols check when targeting experimental. + * Remove Ramakrishnan Muthukrishnan as uploader. + Thanks for your contributions, Ramakrishnan! + Closes: Bug#859283. Thanks to Mattia Rizzolo. + + -- Jonas Smedegaard Sun, 21 May 2017 15:23:08 +0200 + +libre (0.5.1-1) experimental; urgency=medium + + * New upstream version 0.5.1 + + -- Vasudev Kamath Sun, 12 Mar 2017 17:25:55 +0530 libre (0.5.0-3) unstable; urgency=medium diff -Nru libre-0.5.0/debian/control libre-0.5.3/debian/control --- libre-0.5.0/debian/control 2017-02-13 16:15:57.000000000 +0000 +++ libre-0.5.3/debian/control 2017-06-22 19:57:14.000000000 +0000 @@ -3,8 +3,10 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian VoIP Team -Uploaders: Simon Josefsson , Vasudev Kamath , Ramakrishnan Muthukrishnan -Standards-Version: 3.9.8 +Uploaders: Jonas Smedegaard , + Simon Josefsson , + Vasudev Kamath +Standards-Version: 4.0.0 Build-Depends: debhelper (>= 9), libssl-dev, pkg-kde-tools Homepage: http://www.creytiv.com/re Vcs-Git: https://anonscm.debian.org/git/pkg-voip/libre.git diff -Nru libre-0.5.0/debian/copyright libre-0.5.3/debian/copyright --- libre-0.5.0/debian/copyright 2016-12-28 08:13:02.000000000 +0000 +++ libre-0.5.3/debian/copyright 2017-05-21 13:33:09.000000000 +0000 @@ -1,70 +1,69 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: libre +Upstream-Contact: https://github.com/creytiv/re/issues Source: http://www.creytiv.com/re.html - https://github.com/alfredh/re + git://github.com/creytiv/re Files: * -Copyright: Copyright (c) 2010 - 2015, Alfred E. Heggestad - Copyright (c) 2010 - 2015, Richard Aas - Copyright (c) 2010 - 2015, Creytiv.com +Copyright: + 2010-2017, Alfred E. Heggestad + 2010-2017, Creytiv.com + 2010-2017, Richard Aas License: BSD-3-clause - Quoting docs/COPYING: - . - All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - . - 2. 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. - . - 3. Neither the name of the Creytiv.com 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 AUTHOR ``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 AUTHOR 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. Files: src/crc32/crc32.c -Copyright: COPYRIGHT (C) 1986 Gary S. Brown +Copyright: 1986, Gary S. Brown License: crc32-license - Quoting the file: - . - * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or - * code or tables extracted from it, as desired without restriction. Files: src/md5/md5.* -Copyright: Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. +Copyright: 1999-2000,2002, Aladdin Enterprises License: md5-license - Quoting the file: + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: . - Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. 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. + 3. Neither the name of the Creytiv.com 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 AUTHOR ``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 AUTHOR 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. + +License: crc32-license + You may use this program, or code or tables extracted from it, as + desired without restriction. + +License: md5-license This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - . - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. . - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + . + 1. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + 3. This notice may not be removed or altered from any source + distribution. diff -Nru libre-0.5.0/debian/copyright-check libre-0.5.3/debian/copyright-check --- libre-0.5.0/debian/copyright-check 1970-01-01 00:00:00.000000000 +0000 +++ libre-0.5.3/debian/copyright-check 2017-05-21 13:33:09.000000000 +0000 @@ -0,0 +1,28 @@ +#!/bin/sh +# Copyright © 2016-2017 Jonas Smedegaard +# Description: helper script to update copyright_hints +# +# 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 3, 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, see . + +set -eu + +# extract metadata from binary media files, except non-metadata formats +#export DEB_COPYRIGHT_EXTRACT_EXTS="gif jpeg jpg png" +#export DEB_COPYRIGHT_CHECK_IGNORE_EXTS=ico + +make -f /usr/share/cdbs/1/rules/utils.mk pre-build || true +make -f /usr/share/cdbs/1/rules/utils.mk clean DEB_COPYRIGHT_CHECK_STRICT=1 + +# unconditionally merge changes - safe to do with git-tracked package +[ ! -f debian/copyright_newhints ] || mv -f debian/copyright_newhints debian/copyright_hints diff -Nru libre-0.5.0/debian/copyright_hints libre-0.5.3/debian/copyright_hints --- libre-0.5.0/debian/copyright_hints 1970-01-01 00:00:00.000000000 +0000 +++ libre-0.5.3/debian/copyright_hints 2017-05-21 13:33:09.000000000 +0000 @@ -0,0 +1,380 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: FIXME +Upstream-Contact: FIXME +Source: FIXME +Disclaimer: Autogenerated by CDBS + +Files: Makefile + README.md + include/re.h + include/re_aes.h + include/re_base64.h + include/re_bfcp.h + include/re_bitv.h + include/re_conf.h + include/re_crc32.h + include/re_dbg.h + include/re_fmt.h + include/re_hash.h + include/re_hmac.h + include/re_http.h + include/re_httpauth.h + include/re_ice.h + include/re_jbuf.h + include/re_json.h + include/re_list.h + include/re_lock.h + include/re_main.h + include/re_mbuf.h + include/re_md5.h + include/re_mem.h + include/re_mod.h + include/re_mqueue.h + include/re_msg.h + include/re_natbd.h + include/re_net.h + include/re_odict.h + include/re_rtp.h + include/re_sa.h + include/re_sdp.h + include/re_sip.h + include/re_sipevent.h + include/re_sipreg.h + include/re_sipsess.h + include/re_srtp.h + include/re_stun.h + include/re_sys.h + include/re_tcp.h + include/re_telev.h + include/re_tls.h + include/re_tmr.h + include/re_turn.h + include/re_types.h + include/re_udp.h + include/re_uri.h + include/re_websock.h + mk/re.mk + src/aes/apple/aes.c + src/aes/mod.mk + src/aes/openssl/aes.c + src/aes/stub.c + src/base64/b64.c + src/base64/mod.mk + src/bfcp/attr.c + src/bfcp/bfcp.h + src/bfcp/conn.c + src/bfcp/mod.mk + src/bfcp/msg.c + src/bfcp/reply.c + src/bfcp/request.c + src/conf/conf.c + src/conf/mod.mk + src/crc32/mod.mk + src/dbg/dbg.c + src/dbg/mod.mk + src/dns/client.c + src/dns/cstr.c + src/dns/darwin/srv.c + src/dns/dname.c + src/dns/dns.h + src/dns/hdr.c + src/dns/mod.mk + src/dns/ns.c + src/dns/res.c + src/dns/rr.c + src/dns/rrlist.c + src/dns/win32/srv.c + src/fmt/ch.c + src/fmt/hexdump.c + src/fmt/mod.mk + src/fmt/pl.c + src/fmt/print.c + src/fmt/prm.c + src/fmt/regex.c + src/fmt/str.c + src/fmt/str_error.c + src/fmt/time.c + src/fmt/unicode.c + src/hash/func.c + src/hash/hash.c + src/hash/mod.mk + src/hmac/apple/hmac.c + src/hmac/hmac.c + src/hmac/hmac_sha1.c + src/hmac/mod.mk + src/hmac/openssl/hmac.c + src/http/auth.c + src/http/client.c + src/http/mod.mk + src/http/msg.c + src/http/server.c + src/httpauth/basic.c + src/httpauth/digest.c + src/httpauth/mod.mk + src/ice/cand.c + src/ice/candpair.c + src/ice/chklist.c + src/ice/comp.c + src/ice/connchk.c + src/ice/gather.c + src/ice/ice.h + src/ice/icem.c + src/ice/icesdp.c + src/ice/icestr.c + src/ice/mod.mk + src/ice/stunsrv.c + src/ice/util.c + src/jbuf/jbuf.c + src/jbuf/mod.mk + src/json/decode.c + src/json/decode_odict.c + src/json/encode.c + src/json/mod.mk + src/list/list.c + src/list/mod.mk + src/lock/lock.c + src/lock/mod.mk + src/lock/rwlock.c + src/lock/win32/lock.c + src/main/epoll.c + src/main/init.c + src/main/main.c + src/main/main.h + src/main/method.c + src/main/mod.mk + src/main/openssl.c + src/mbuf/mbuf.c + src/mbuf/mod.mk + src/md5/mod.mk + src/md5/wrap.c + src/mem/mem.c + src/mem/mod.mk + src/mod/dl.c + src/mod/mod.c + src/mod/mod.mk + src/mod/mod_internal.h + src/mod/win32/dll.c + src/mqueue/mod.mk + src/mqueue/mqueue.c + src/mqueue/mqueue.h + src/mqueue/win32/pipe.c + src/msg/ctype.c + src/msg/mod.mk + src/msg/param.c + src/natbd/filtering.c + src/natbd/genalg.c + src/natbd/hairpinning.c + src/natbd/lifetime.c + src/natbd/mapping.c + src/natbd/mod.mk + src/natbd/natstr.c + src/net/bsd/brt.c + src/net/if.c + src/net/ifaddrs.c + src/net/linux/rt.c + src/net/mod.mk + src/net/net.c + src/net/netstr.c + src/net/posix/pif.c + src/net/rt.c + src/net/sock.c + src/net/sockopt.c + src/net/win32/wif.c + src/odict/entry.c + src/odict/mod.mk + src/odict/odict.c + src/odict/type.c + src/rtp/fb.c + src/rtp/member.c + src/rtp/mod.mk + src/rtp/ntp.c + src/rtp/pkt.c + src/rtp/rr.c + src/rtp/rtcp.c + src/rtp/rtcp.h + src/rtp/rtp.c + src/rtp/sdes.c + src/rtp/sess.c + src/rtp/source.c + src/sa/mod.mk + src/sa/ntop.c + src/sa/printaddr.c + src/sa/pton.c + src/sa/sa.c + src/sa/sa.h + src/sdp/attr.c + src/sdp/format.c + src/sdp/media.c + src/sdp/mod.mk + src/sdp/msg.c + src/sdp/sdp.h + src/sdp/session.c + src/sdp/str.c + src/sdp/util.c + src/sha/mod.mk + src/sip/addr.c + src/sip/auth.c + src/sip/contact.c + src/sip/cseq.c + src/sip/ctrans.c + src/sip/dialog.c + src/sip/keepalive.c + src/sip/keepalive_udp.c + src/sip/mod.mk + src/sip/msg.c + src/sip/reply.c + src/sip/request.c + src/sip/sip.c + src/sip/sip.h + src/sip/strans.c + src/sip/transp.c + src/sip/via.c + src/sipevent/listen.c + src/sipevent/mod.mk + src/sipevent/msg.c + src/sipevent/notify.c + src/sipevent/sipevent.h + src/sipevent/subscribe.c + src/sipreg/mod.mk + src/sipreg/reg.c + src/sipsess/accept.c + src/sipsess/ack.c + src/sipsess/close.c + src/sipsess/connect.c + src/sipsess/info.c + src/sipsess/listen.c + src/sipsess/mod.mk + src/sipsess/modify.c + src/sipsess/reply.c + src/sipsess/request.c + src/sipsess/sess.c + src/sipsess/sipsess.h + src/srtp/misc.c + src/srtp/mod.mk + src/srtp/replay.c + src/srtp/srtcp.c + src/srtp/srtp.c + src/srtp/srtp.h + src/srtp/stream.c + src/stun/addr.c + src/stun/attr.c + src/stun/ctrans.c + src/stun/dnsdisc.c + src/stun/hdr.c + src/stun/ind.c + src/stun/keepalive.c + src/stun/mod.mk + src/stun/msg.c + src/stun/rep.c + src/stun/req.c + src/stun/stun.c + src/stun/stun.h + src/stun/stunstr.c + src/sys/daemon.c + src/sys/endian.c + src/sys/fs.c + src/sys/mod.mk + src/sys/rand.c + src/sys/sleep.c + src/sys/sys.c + src/tcp/mod.mk + src/tcp/tcp.c + src/tcp/tcp_high.c + src/telev/mod.mk + src/telev/telev.c + src/tls/mod.mk + src/tls/openssl/tls.c + src/tls/openssl/tls.h + src/tls/openssl/tls_tcp.c + src/tls/openssl/tls_udp.c + src/tmr/mod.mk + src/tmr/tmr.c + src/turn/chan.c + src/turn/mod.mk + src/turn/perm.c + src/turn/turnc.c + src/turn/turnc.h + src/udp/mcast.c + src/udp/mod.mk + src/udp/udp.c + src/uri/mod.mk + src/uri/ucmp.c + src/uri/uri.c + src/uri/uric.c + src/websock/mod.mk + src/websock/websock.c +Copyright: 2010, Creytiv.com + 2010-2015, Creytiv.com + 2010-2017, Creytiv.com + 2011, Creytiv.com +License: UNKNOWN + FIXME + +Files: debian/compat + debian/control + debian/docs + debian/gbp.conf + debian/libre-dev.install + debian/libre0.install + debian/libre0.symbols + debian/patches/0001-get-correct-multiarch-triplet.patch + debian/patches/series + debian/rules + debian/source/format + debian/watch + docs/ChangeLog + docs/TODO + docs/main.dox + docs/symbols.txt + mk/CMakeLists.txt + mk/Doxyfile + mk/exclude + mk/win32/re.vcxproj + mk/win32/re.vcxproj.filters + src/ice/ice.c + src/sha/sha1.c + src/srtp/README +Copyright: NONE +License: UNKNOWN + FIXME + +Files: src/md5/md5.c + src/md5/md5.h +Copyright: 1999, 2002, Aladdin Enterprises. + 1999-2000, 2002, Aladdin Enterprises. + ed. +License: Zlib + FIXME + +Files: docs/COPYING +Copyright: 2010-2017, Alfred E. Heggestad + 2010-2017, Creytiv.com + 2010-2017, Richard Aas +License: BSD-3-clause + FIXME + +Files: rpm/re.spec +Copyright: NONE +License: BSD~unspecified + FIXME + +Files: debian/copyright-check +Copyright: 2016-2017, Jonas Smedegaard +License: GPL-3+ + FIXME + +Files: include/re_dns.h +Copyright: 2010, Creytiv.com +License: MPL-4 + FIXME + +Files: src/crc32/crc32.c +Copyright: 1986, Gary S. Brown. You may use this program, or +License: UNKNOWN + FIXME + +Files: include/re_sha.h +Copyright: 2010, Creytiv.com +License: public-domain + FIXME + diff -Nru libre-0.5.0/debian/gbp.conf libre-0.5.3/debian/gbp.conf --- libre-0.5.0/debian/gbp.conf 2016-08-27 10:01:54.000000000 +0000 +++ libre-0.5.3/debian/gbp.conf 2017-05-21 13:33:09.000000000 +0000 @@ -3,4 +3,4 @@ sign-tags = True [import-orig] -filter = ['debian'] +filter = ['*/.git*', 'debian'] diff -Nru libre-0.5.0/debian/libre0.symbols libre-0.5.3/debian/libre0.symbols --- libre-0.5.0/debian/libre0.symbols 2017-02-13 16:01:21.000000000 +0000 +++ libre-0.5.3/debian/libre0.symbols 2017-06-22 19:57:14.000000000 +0000 @@ -1,4 +1,4 @@ -# SymbolsHelper-Confirmed: 0.5.0-3 amd64 +# SymbolsHelper-Confirmed: 0.5.3 alpha amd64 arm64 armel armhf hppa hurd-i386 i386 kfreebsd-amd64 kfreebsd-i386 m68k mips mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390x sh4 x32 libre.so.0 libre0 #MINVER# _mod_close@Base 0.4.14 _mod_open@Base 0.4.14 @@ -47,7 +47,6 @@ conf_get_bool@Base 0.4.14 conf_get_str@Base 0.4.14 conf_get_u32@Base 0.4.14 -#MISSING: 0.5.0-3# crc32@Base 0.5.0 dbg_close@Base 0.4.14 dbg_handler_set@Base 0.4.14 dbg_info@Base 0.4.14 @@ -158,7 +157,7 @@ httpauth_digest_response_auth@Base 0.4.14 httpauth_digest_response_decode@Base 0.4.14 https_listen@Base 0.4.14 - ice_alloc@Base 0.4.14 + (arch=alpha ppc64)ice_alloc@Base 0.5.3 ice_attr_cand@Base 0.4.14 ice_attr_lite@Base 0.4.14 ice_attr_mismatch@Base 0.4.14 @@ -172,23 +171,24 @@ ice_cand_encode@Base 0.4.14 ice_cand_name2type@Base 0.4.14 ice_cand_type2name@Base 0.4.14 + (arch=!alpha !ppc64)ice_candpair_set_states@Base 0.5.3 ice_candpair_state2name@Base 0.4.14 ice_checkl_state2name@Base 0.4.14 - ice_conf@Base 0.4.14 - ice_conncheck_start@Base 0.4.14 - ice_debug@Base 0.4.14 + (arch=alpha ppc64)ice_conf@Base 0.5.3 + (arch=alpha ppc64)ice_conncheck_start@Base 0.5.3 + (arch=alpha ppc64)ice_debug@Base 0.5.3 ice_list_unique@Base 0.4.14 - ice_medialist@Base 0.4.14 + (arch=alpha ppc64)ice_medialist@Base 0.5.3 ice_mode2name@Base 0.4.14 - ice_pwd@Base 0.4.14 + (arch=alpha ppc64)ice_pwd@Base 0.5.3 ice_remotecands_avail@Base 0.4.14 ice_remotecands_encode@Base 0.4.14 ice_role2name@Base 0.4.14 ice_sdp_decode@Base 0.4.14 - ice_set_conf@Base 0.4.14 - ice_set_offerer@Base 0.4.14 + (arch=alpha ppc64)ice_set_conf@Base 0.5.3 + (arch=alpha ppc64)ice_set_offerer@Base 0.5.3 ice_switch_local_role@Base 0.4.14 - ice_ufrag@Base 0.4.14 + (arch=alpha ppc64)ice_ufrag@Base 0.5.3 icecomp_debug@Base 0.4.14 icecomp_printf@Base 0.4.14 icem_add_chan@Base 0.4.14 @@ -226,6 +226,7 @@ icem_comp_set_default_cand@Base 0.4.14 icem_comp_set_default_rcand@Base 0.4.14 icem_comp_set_selected@Base 0.4.14 + (arch=!alpha !ppc64)icem_conf@Base 0.5.3 icem_conncheck_continue@Base 0.4.14 icem_conncheck_schedule_check@Base 0.4.14 icem_conncheck_send@Base 0.4.14 @@ -239,6 +240,7 @@ icem_lcand_find_checklist@Base 0.4.14 icem_lcandl@Base 0.4.14 icem_lite_set_default_candidates@Base 0.4.14 + (arch=!alpha !ppc64)icem_local_role@Base 0.5.3 icem_mismatch@Base 0.4.14 icem_printf@Base 0.4.14 icem_rcand_add@Base 0.4.14 @@ -246,7 +248,9 @@ icem_rcandl@Base 0.4.14 icem_sdp_decode@Base 0.4.14 icem_selected_laddr@Base 0.4.14 + (arch=!alpha !ppc64)icem_set_conf@Base 0.5.3 icem_set_name@Base 0.4.14 + (arch=!alpha !ppc64)icem_set_role@Base 0.5.3 icem_stund_recv@Base 0.4.14 icem_update@Base 0.4.14 icem_validl@Base 0.4.14 @@ -827,13 +831,13 @@ telev_recv@Base 0.4.14 telev_rtpfmt@Base 0.4.14 telev_send@Base 0.4.14 + (arch=!alpha !ppc64)telev_set_srate@Base 0.5.3 tls_add_ca@Base 0.4.14 tls_alloc@Base 0.4.14 tls_cipher_name@Base 0.4.16 tls_fingerprint@Base 0.4.14 tls_flush_error@Base 0.5.0 -#MISSING: 0.5.0-3# tls_method_tcp@Base 0.5.0 -#MISSING: 0.5.0-3# tls_method_udp@Base 0.5.0 + (arch=!alpha !ppc64)tls_openssl_context@Base 0.5.3 tls_peer_common_name@Base 0.4.14 tls_peer_fingerprint@Base 0.4.14 tls_peer_verify@Base 0.4.14 diff -Nru libre-0.5.0/debian/patches/0001-get-correct-multiarch-triplet.patch libre-0.5.3/debian/patches/0001-get-correct-multiarch-triplet.patch --- libre-0.5.0/debian/patches/0001-get-correct-multiarch-triplet.patch 2016-08-27 10:01:54.000000000 +0000 +++ libre-0.5.3/debian/patches/0001-get-correct-multiarch-triplet.patch 2017-05-21 13:33:09.000000000 +0000 @@ -1,22 +1,14 @@ Description: get the correct multi-arch triplet -On certain architectures, epoll is not correctly picked -up because of incorrect multi-arch triplet. This patch -fixes it. -. + On certain architectures, epoll is not correctly picked up because of + incorrect multi-arch triplet. Author: Vasudev Kamath - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - Forwarded: no Reviewed-By: Ramakrishnan Muthukrishnan Last-Update: 2016-01-20 ---- libre-0.4.14.orig/mk/re.mk -+++ libre-0.4.14/mk/re.mk -@@ -197,7 +197,7 @@ endif +--- a/mk/re.mk ++++ b/mk/re.mk +@@ -197,7 +197,7 @@ # OS section # diff -Nru libre-0.5.0/debian/patches/1001_support_hurd_kfreebsd.patch libre-0.5.3/debian/patches/1001_support_hurd_kfreebsd.patch --- libre-0.5.0/debian/patches/1001_support_hurd_kfreebsd.patch 2016-12-28 15:34:09.000000000 +0000 +++ libre-0.5.3/debian/patches/1001_support_hurd_kfreebsd.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -Description: Add build support for GNU/Hurd and GNU/kFreeBSD -Author: Vasudev Kamath - Last-Update: 2016-12-28 - ---- a/mk/re.mk -+++ b/mk/re.mk -@@ -239,6 +239,16 @@ - AR := ar - AFLAGS := cru - endif -+ifeq ($(OS),gnu) -+ CFLAGS += -fPIC -DGNU -+ LIBS += -ldl -+ LFLAGS += -fPIC -+ SH_LFLAGS += -shared -+ MOD_LFLAGS += -+ APP_LFLAGS += -rdynamic -+ AR := ar -+ AFLAGS := cru -+endif - ifeq ($(OS),darwin) - CFLAGS += -fPIC -dynamic -DDARWIN - ifneq (,$(findstring Apple, $(CC_LONGVER))) -@@ -277,6 +287,16 @@ - LFLAGS += -fPIC - SH_LFLAGS += -shared - MOD_LFLAGS += -+ APP_LFLAGS += -rdynamic -+ AR := ar -+ AFLAGS := cru -+ HAVE_KQUEUE := 1 -+endif -+ifeq ($(OS),gnu/kfreebsd) -+ CFLAGS += -fPIC -DKFREEBSD -D_GNU_SOURCE -+ LFLAGS += -fPIC -+ SH_LFLAGS += -shared -+ MOD_LFLAGS += - APP_LFLAGS += -rdynamic - AR := ar - AFLAGS := cru diff -Nru libre-0.5.0/debian/patches/series libre-0.5.3/debian/patches/series --- libre-0.5.0/debian/patches/series 2016-12-28 12:00:44.000000000 +0000 +++ libre-0.5.3/debian/patches/series 2017-05-21 13:33:09.000000000 +0000 @@ -1,2 +1 @@ 0001-get-correct-multiarch-triplet.patch -1001_support_hurd_kfreebsd.patch diff -Nru libre-0.5.0/debian/rules libre-0.5.3/debian/rules --- libre-0.5.0/debian/rules 2016-08-27 10:01:54.000000000 +0000 +++ libre-0.5.3/debian/rules 2017-05-21 13:33:09.000000000 +0000 @@ -10,6 +10,11 @@ EXTRA_LFLAGS:="$(shell dpkg-buildflags --get LDFLAGS) -Wl,-soname,libre.so.0" EXTRA_CFLAGS:="$(shell dpkg-buildflags --get CPPFLAGS)" +# relax symbols check when targeting experimental +EXP_RELEASE = $(filter experimental% UNRELEASED,\ + $(shell dpkg-parsechangelog | grep -Po '^Distribution: \K.*')) +export DPKG_GENSYMBOLS_CHECK_LEVEL=$(if $(EXP_RELEASE),0,1) + override_dh_auto_configure: sed -e 's,@\$$(CC),\$$(CC),' \ -e 's,@\$$(LD),\$$(LD),' \ diff -Nru libre-0.5.0/docs/ChangeLog libre-0.5.3/docs/ChangeLog --- libre-0.5.0/docs/ChangeLog 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/docs/ChangeLog 2017-05-11 08:19:57.000000000 +0000 @@ -1,3 +1,48 @@ +2017-05-13 Alfred E. Heggestad + + * Version 0.5.3 + + * Project URL: https://github.com/creytiv/re + + * build: upgrade windows project to VS2015 (thanks Mikhail Barg) + makefile improvements (thanks Lennart Grahl) + + * ice: remove session object "struct ice" + + * telev: add telev_set_srate (thanks Jan Hoffmann) + + +2017-04-08 Alfred E. Heggestad + + * Version 0.5.2 + + * Project URL: https://github.com/creytiv/re + + * build: add Debian/kFreeBSD+Hurd (thanks Vasudev Kamath) + + * ice: make enum ice_role type public + + * main: fix build for Solaris 11 + + * srtcp: use unsigned for encrypted bit + + * tls: add tls_openssl_context() accessor function + + +2017-02-04 Alfred E. Heggestad + + * Version 0.5.1 + + * Project URL: https://github.com/creytiv/re + + * fmt: print directly to stream using handler (#38) + + * http: HTTP client improvements (#36) + - http client connection reuse + - retry failed requests using fresh connections + - Handle Connection: close response header + + 2016-11-25 Alfred E. Heggestad * Version 0.5.0 diff -Nru libre-0.5.0/docs/COPYING libre-0.5.3/docs/COPYING --- libre-0.5.0/docs/COPYING 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/docs/COPYING 2017-05-11 08:19:57.000000000 +0000 @@ -1,6 +1,6 @@ -Copyright (c) 2010 - 2016, Alfred E. Heggestad -Copyright (c) 2010 - 2016, Richard Aas -Copyright (c) 2010 - 2016, Creytiv.com +Copyright (c) 2010 - 2017, Alfred E. Heggestad +Copyright (c) 2010 - 2017, Richard Aas +Copyright (c) 2010 - 2017, Creytiv.com All rights reserved. diff -Nru libre-0.5.0/include/re_ice.h libre-0.5.3/include/re_ice.h --- libre-0.5.0/include/re_ice.h 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/include/re_ice.h 2017-05-11 08:19:57.000000000 +0000 @@ -11,6 +11,13 @@ ICE_MODE_LITE }; +/** ICE Role */ +enum ice_role { + ICE_ROLE_UNKNOWN = 0, + ICE_ROLE_CONTROLLING, + ICE_ROLE_CONTROLLED +}; + /** ICE Component ID */ enum ice_compid { ICE_COMPID_RTP = 1, @@ -38,6 +45,15 @@ ICE_TCP_SO /**< Simultaneous-open TCP client/server */ }; +/** Candidate pair states */ +enum ice_candpair_state { + ICE_CANDPAIR_FROZEN = 0, /**< Frozen state (default) */ + ICE_CANDPAIR_WAITING, /**< Waiting to become highest on list */ + ICE_CANDPAIR_INPROGRESS, /**< In-Progress state;transac. in progress */ + ICE_CANDPAIR_SUCCEEDED, /**< Succeeded state; successful result */ + ICE_CANDPAIR_FAILED /**< Failed state; check failed */ +}; + struct ice; struct icem; @@ -54,22 +70,15 @@ typedef void (ice_connchk_h)(int err, bool update, void *arg); -/* ICE Session */ -int ice_alloc(struct ice **icep, enum ice_mode mode, bool offerer); -struct ice_conf *ice_conf(struct ice *ice); -void ice_set_conf(struct ice *ice, const struct ice_conf *conf); -void ice_set_offerer(struct ice *ice, bool offerer); -int ice_sdp_decode(struct ice *ice, const char *name, const char *value); -int ice_conncheck_start(struct ice *ice); -int ice_debug(struct re_printf *pf, const struct ice *ice); -struct list *ice_medialist(const struct ice *ice); -const char *ice_ufrag(const struct ice *ice); -const char *ice_pwd(const struct ice *ice); - - /* ICE Media */ -int icem_alloc(struct icem **icemp, struct ice *ice, int proto, int layer, +int icem_alloc(struct icem **icemp, enum ice_mode mode, + enum ice_role role, int proto, int layer, + uint64_t tiebrk, const char *lufrag, const char *lpwd, ice_gather_h *gh, ice_connchk_h *chkh, void *arg); +struct ice_conf *icem_conf(struct icem *icem); +enum ice_role icem_local_role(const struct icem *icem); +void icem_set_conf(struct icem *icem, const struct ice_conf *conf); +void icem_set_role(struct icem *icem, enum ice_role role); void icem_set_name(struct icem *icem, const char *name); int icem_comp_add(struct icem *icem, unsigned compid, void *sock); int icem_cand_add(struct icem *icem, unsigned compid, uint16_t lprio, @@ -85,6 +94,7 @@ int icem_add_chan(struct icem *icem, unsigned compid, const struct sa *raddr); bool icem_mismatch(const struct icem *icem); void icem_update(struct icem *icem); +int ice_sdp_decode(struct icem *ice, const char *name, const char *value); int icem_sdp_decode(struct icem *icem, const char *name, const char *value); int icem_debug(struct re_printf *pf, const struct icem *icem); struct list *icem_lcandl(const struct icem *icem); @@ -93,6 +103,7 @@ struct list *icem_validl(const struct icem *icem); const struct sa *icem_cand_default(struct icem *icem, unsigned compid); const struct sa *icem_selected_laddr(const struct icem *icem, unsigned compid); +void ice_candpair_set_states(struct icem *icem); struct ice_cand; @@ -111,6 +122,8 @@ const char *ice_cand_type2name(enum ice_cand_type type); enum ice_cand_type ice_cand_name2type(const char *name); +const char *ice_role2name(enum ice_role role); +const char *ice_candpair_state2name(enum ice_candpair_state st); uint32_t ice_cand_calc_prio(enum ice_cand_type type, uint16_t local, diff -Nru libre-0.5.0/include/re_telev.h libre-0.5.3/include/re_telev.h --- libre-0.5.0/include/re_telev.h 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/include/re_telev.h 2017-05-11 08:19:57.000000000 +0000 @@ -14,6 +14,7 @@ extern const char telev_rtpfmt[]; int telev_alloc(struct telev **tp, uint32_t ptime); +int telev_set_srate(struct telev *tel, uint32_t srate); int telev_send(struct telev *tel, int event, bool end); int telev_recv(struct telev *tel, struct mbuf *mb, int *event, bool *end); int telev_poll(struct telev *tel, bool *marker, struct mbuf *mb); diff -Nru libre-0.5.0/include/re_tls.h libre-0.5.3/include/re_tls.h --- libre-0.5.0/include/re_tls.h 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/include/re_tls.h 2017-05-11 08:19:57.000000000 +0000 @@ -90,3 +90,10 @@ dtls_recv_h *recvh, dtls_close_h *closeh, void *arg); const struct sa *dtls_peer(const struct tls_conn *tc); void dtls_set_peer(struct tls_conn *tc, const struct sa *peer); + + +#ifdef USE_OPENSSL +struct ssl_ctx_st; + +struct ssl_ctx_st *tls_openssl_context(const struct tls *tls); +#endif diff -Nru libre-0.5.0/Makefile libre-0.5.3/Makefile --- libre-0.5.0/Makefile 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/Makefile 2017-05-11 08:19:57.000000000 +0000 @@ -7,10 +7,10 @@ # Master version number VER_MAJOR := 0 VER_MINOR := 5 -VER_PATCH := 0 +VER_PATCH := 3 PROJECT := re -VERSION := 0.5.0 +VERSION := 0.5.3 MK := mk/re.mk @@ -35,9 +35,9 @@ INSTALL := install ifeq ($(DESTDIR),) -PREFIX := /usr/local +PREFIX ?= /usr/local else -PREFIX := /usr +PREFIX ?= /usr endif ifeq ($(LIBDIR),) LIBDIR := $(PREFIX)/lib @@ -85,6 +85,7 @@ @echo 'Version: '$(VERSION) >> libre.pc @echo 'URL: http://creytiv.com/re.html' >> libre.pc @echo 'Libs: -L$${libdir} -lre' >> libre.pc + @echo 'Libs.private: -L$${libdir} -lre ${LIBS}' >> libre.pc @echo 'Cflags: -I$${includedir}' >> libre.pc $(BUILD)/%.o: src/%.c $(BUILD) Makefile $(MK) $(MODMKS) diff -Nru libre-0.5.0/mk/re.mk libre-0.5.3/mk/re.mk --- libre-0.5.0/mk/re.mk 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/mk/re.mk 2017-05-11 08:19:57.000000000 +0000 @@ -239,6 +239,16 @@ AR := ar AFLAGS := cru endif +ifeq ($(OS),gnu) + CFLAGS += -fPIC -DGNU + LIBS += -ldl + LFLAGS += -fPIC + SH_LFLAGS += -shared + MOD_LFLAGS += + APP_LFLAGS += -rdynamic + AR := ar + AFLAGS := cru +endif ifeq ($(OS),darwin) CFLAGS += -fPIC -dynamic -DDARWIN ifneq (,$(findstring Apple, $(CC_LONGVER))) @@ -277,6 +287,16 @@ LFLAGS += -fPIC SH_LFLAGS += -shared MOD_LFLAGS += + APP_LFLAGS += -rdynamic + AR := ar + AFLAGS := cru + HAVE_KQUEUE := 1 +endif +ifeq ($(OS),gnu/kfreebsd) + CFLAGS += -fPIC -DKFREEBSD -D_GNU_SOURCE + LFLAGS += -fPIC + SH_LFLAGS += -shared + MOD_LFLAGS += APP_LFLAGS += -rdynamic AR := ar AFLAGS := cru diff -Nru libre-0.5.0/mk/win32/re.vcproj libre-0.5.3/mk/win32/re.vcproj --- libre-0.5.0/mk/win32/re.vcproj 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/mk/win32/re.vcproj 1970-01-01 00:00:00.000000000 +0000 @@ -1,855 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru libre-0.5.0/mk/win32/re.vcxproj libre-0.5.3/mk/win32/re.vcxproj --- libre-0.5.0/mk/win32/re.vcxproj 1970-01-01 00:00:00.000000000 +0000 +++ libre-0.5.3/mk/win32/re.vcxproj 2017-05-11 08:19:57.000000000 +0000 @@ -0,0 +1,333 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + re-win32 + {40B28DF6-4B4A-411A-9EB7-8D80C2A29B9D} + Win32Proj + 8.1 + + + + StaticLibrary + v140 + MultiByte + + + StaticLibrary + v140 + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>14.0.25123.0 + + + ..\..\$(Platform)\$(Configuration)\bin\ + ..\..\$(Platform)\$(Configuration)\tmp\mk\win32\ + + + ..\..\$(Platform)\$(Configuration)\bin\ + ..\..\$(Platform)\$(Configuration)\tmp\mk\win32\ + + + + Disabled + Default + ..\..\include;..\..\..\misc;%(AdditionalIncludeDirectories) + WIN32;_CONSOLE;HAVE_INET_PTON;HAVE_INET_NTOP;FD_SETSIZE=1024;HAVE_SELECT;HAVE_IO_H;_CRT_SECURE_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;_DEBUG;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + Level3 + EditAndContinue + 4142;%(DisableSpecificWarnings) + $(IntDir)%(RelativeDir)%(Filename).obj + + + Iphlpapi.lib %(AdditionalOptions) + ws2_32.lib;%(AdditionalDependencies) + + + + + ..\..\include;..\..\..\misc;%(AdditionalIncludeDirectories) + WIN32;_CONSOLE;HAVE_INET_PTON;HAVE_INET_NTOP;FD_SETSIZE=1024;HAVE_SELECT;HAVE_IO_H;_CRT_SECURE_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NDEBUG;%(PreprocessorDefinitions) + MultiThreadedDLL + + Level3 + ProgramDatabase + 4142;%(DisableSpecificWarnings) + $(IntDir)%(RelativeDir)%(Filename).obj + + + ws2_32.lib;%(AdditionalDependencies) + + + + + + \ No newline at end of file diff -Nru libre-0.5.0/mk/win32/re.vcxproj.filters libre-0.5.3/mk/win32/re.vcxproj.filters --- libre-0.5.0/mk/win32/re.vcxproj.filters 1970-01-01 00:00:00.000000000 +0000 +++ libre-0.5.3/mk/win32/re.vcxproj.filters 2017-05-11 08:19:57.000000000 +0000 @@ -0,0 +1,878 @@ + + + + + {24ec5e26-1680-4fb0-8766-02a6834e676d} + + + {f97cb0a3-607e-4302-a41d-cbac8aad6bd7} + + + {57a0561c-ea6e-45d0-a034-72d1fabd97ca} + + + {974b5b66-04cf-4237-9e6c-f706acb078bd} + + + {0115caca-c0eb-469d-9f51-1a8a53a4cf36} + + + {e46ff0a0-f978-4356-8103-804f228ce65d} + + + {7f1f0174-24be-4049-bccd-c03c00e5bacc} + + + {b277177e-4cd2-4028-8e24-b12237bd4122} + + + {d1a8c49e-d20f-4bca-ab49-7dd50593c09a} + + + {469bd25d-3ebd-474b-b13c-6914bfa44f2e} + + + {793d3b1b-a4a5-49a7-aeb4-fc3be5944d3b} + + + {da8a92af-e8a6-45c6-9708-aa18e3adb084} + + + {5d4ea0d3-afee-4f12-8a79-ac4c8447777a} + + + {ed8fd6a9-58aa-47c4-b1f7-34e1ac182b87} + + + {e29353b1-55db-453e-91c6-f7f37748147c} + + + {f3ce68eb-55bb-46b2-8d3f-1b1048fad972} + + + {c6620f98-9fd7-45ea-9b58-cc2c4a3b6f2d} + + + {60bd6b3a-4f71-48fb-a161-10ce29910d93} + + + {8643b7af-6ec5-43b4-b0fe-399a79d445cc} + + + {f7c75b83-f284-430c-b18c-b2633914a750} + + + {779e44ed-0935-450c-a3dd-7bdef53a1179} + + + {1bff8dd5-d220-4f10-8c26-64c82522d824} + + + {9ea33625-0411-4065-a16b-ce3f49d3ca15} + + + {955109b7-ec66-49d3-b4cf-0ba816e095e4} + + + {31d6e0d5-7c9d-4ca7-a911-4be6b45291b0} + + + {249dc72a-9cb9-45fa-bdd1-742fafb1d831} + + + {e6d208f2-2ef2-49bc-a13a-d66885a1dd61} + + + {fc6552c5-e5cd-4f77-9daa-77361089d71f} + + + {eb84b7a5-764a-43c4-98b1-90c989cbe8e7} + + + {09180e07-9646-454c-ae1a-7bfdc9ec96cc} + + + {4d08218c-9027-430b-bec4-5b435620ca77} + + + {3489e5fe-f25d-4410-a351-8c485609a49a} + + + {c33fec0f-9764-431d-9fe3-46704e850f6b} + + + {fb912922-9084-4a6a-b36f-cf7039fbdf59} + + + {bf38bff6-d13b-40e9-908f-73aa6bd29dc2} + + + {8723551b-d33a-464f-b15e-d477b65d8d34} + + + {c9915c2b-1f49-45bc-9552-8679bd697f23} + + + {c8b66d98-2787-4b05-be8c-d4acd28dbf9e} + + + {ac3c7db7-cb2d-4191-9c45-f499de912f51} + + + {9a795fdf-efaf-4ea1-b7c7-671616e84f0a} + + + {2af593ee-1fa6-44c1-b6ca-01d437c39397} + + + {37c6bc4f-8fd1-40cf-b04c-77ae5d7f80c6} + + + {6aae1e31-0191-4c51-a470-c43be58ae837} + + + {f029350a-d256-4dda-889b-430f65615047} + + + {c1c4b382-5196-45dc-9185-1b321a34caa2} + + + {7590d26c-f92a-4da7-89be-857b74649099} + + + {394be8ad-8a7d-4ed8-93a5-cf4a1c9f5c37} + + + {26df0238-b37e-4c97-97d4-549f23a4fb1b} + + + {3f9bcd72-2513-4e1e-826e-6df1e9c3fa3e} + + + {7a203acf-4223-4b71-8705-995eac29db75} + + + {5bb58e89-4183-4380-993a-d01d1bc3d9d9} + + + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + src\turn + + + src\stun + + + src\srtp + + + src\sipsess + + + src\sipevent + + + src\sip + + + src\sdp + + + src\sa + + + src\rtp + + + src\mqueue + + + src\mod + + + src\md5 + + + src\main + + + src\ice + + + src\dns + + + src\bfcp + + + + + src\uri + + + src\uri + + + src\uri + + + src\udp + + + src\udp + + + src\turn + + + src\turn + + + src\turn + + + src\tmr + + + src\telev + + + src\tcp + + + src\tcp + + + src\sys + + + src\sys + + + src\sys + + + src\sys + + + src\sys + + + src\sys + + + src\stun + + + src\stun + + + src\stun + + + src\stun + + + src\stun + + + src\stun + + + src\stun + + + src\stun + + + src\stun + + + src\stun + + + src\stun + + + src\stun + + + src\srtp + + + src\srtp + + + src\srtp + + + src\srtp + + + src\srtp + + + src\sipsess + + + src\sipsess + + + src\sipsess + + + src\sipsess + + + src\sipsess + + + src\sipsess + + + src\sipsess + + + src\sipsess + + + src\sipsess + + + src\sipsess + + + src\sipreg + + + src\sipevent + + + src\sipevent + + + src\sipevent + + + src\sipevent + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sip + + + src\sdp + + + src\sdp + + + src\sdp + + + src\sdp + + + src\sdp + + + src\sdp + + + src\sdp + + + src\sa + + + src\sa + + + src\sa + + + src\sa + + + src\rtp + + + src\rtp + + + src\rtp + + + src\rtp + + + src\rtp + + + src\rtp + + + src\rtp + + + src\rtp + + + src\rtp + + + src\rtp + + + src\odict + + + src\odict + + + src\odict + + + src\net + + + src\net + + + src\net + + + src\net + + + src\net + + + src\net + + + src\net\win32 + + + src\natbd + + + src\natbd + + + src\natbd + + + src\natbd + + + src\natbd + + + src\natbd + + + src\msg + + + src\msg + + + src\mqueue + + + src\mqueue\win32 + + + src\mod + + + src\mod\win32 + + + src\mem + + + src\md5 + + + src\md5 + + + src\mbuf + + + src\main + + + src\main + + + src\main + + + src\lock\win32 + + + src\list + + + src\json + + + src\json + + + src\json + + + src\jbuf + + + src\ice + + + src\ice + + + src\ice + + + src\ice + + + src\ice + + + src\ice + + + src\ice + + + src\ice + + + src\ice + + + src\ice + + + src\ice + + + src\ice + + + src\httpauth + + + src\httpauth + + + src\http + + + src\http + + + src\http + + + src\http + + + src\hmac + + + src\hmac + + + src\hash + + + src\hash + + + src\fmt + + + src\fmt + + + src\fmt + + + src\fmt + + + src\fmt + + + src\fmt + + + src\fmt + + + src\fmt + + + src\fmt + + + src\fmt + + + src\dns + + + src\dns + + + src\dns + + + src\dns + + + src\dns + + + src\dns + + + src\dns + + + src\dns\win32 + + + src\dbg + + + src\crc32 + + + src\conf + + + src\bfcp + + + src\bfcp + + + src\bfcp + + + src\bfcp + + + src\bfcp + + + src\aes + + + src\base64 + + + src\sha + + + + + src\srtp + + + \ No newline at end of file diff -Nru libre-0.5.0/README.md libre-0.5.3/README.md --- libre-0.5.0/README.md 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/README.md 2017-05-11 08:19:57.000000000 +0000 @@ -3,7 +3,7 @@ libre is a Generic library for real-time communications with async IO support. -Copyright (C) 2010 - 2016 Creytiv.com +Copyright (C) 2010 - 2017 Creytiv.com [![Build Status](https://travis-ci.org/creytiv/re.svg?branch=master)](https://travis-ci.org/creytiv/re) @@ -28,7 +28,7 @@ ## Building -libre is using GNU makefiles, and OpenSSL development headers must be +libre is using GNU makefiles. Make and OpenSSL development headers must be installed before building. @@ -206,7 +206,7 @@ * FreeBSD * OpenBSD * NetBSD -* Solaris +* Solaris 11 * Windows * Apple Mac OS X and iOS * Android diff -Nru libre-0.5.0/rpm/re.spec libre-0.5.3/rpm/re.spec --- libre-0.5.0/rpm/re.spec 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/rpm/re.spec 2017-05-11 08:19:57.000000000 +0000 @@ -1,5 +1,5 @@ %define name re -%define ver 0.5.0 +%define ver 0.5.3 %define rel 1 Summary: Generic library for real-time communications with async IO support diff -Nru libre-0.5.0/src/fmt/print.c libre-0.5.3/src/fmt/print.c --- libre-0.5.0/src/fmt/print.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/fmt/print.c 2017-05-11 08:19:57.000000000 +0000 @@ -11,9 +11,13 @@ #include #ifdef _MSC_VER #include +#ifndef isinf #define isinf(d) (!_finite(d)) +#endif +#ifndef isnan #define isnan(d) _isnan(d) #endif +#endif #ifdef SOLARIS #include #undef isinf @@ -550,6 +554,24 @@ } +struct strm_print { + FILE *f; + size_t n; +}; + +static int print_handler_stream(const char *p, size_t size, void *arg) +{ + struct strm_print *sp = arg; + + if (1 != fwrite(p, size, 1, sp->f)) + return ENOMEM; + + sp->n += size; + + return 0; +} + + /** * Print a formatted string to a file stream, using va_list * @@ -561,25 +583,18 @@ */ int re_vfprintf(FILE *stream, const char *fmt, va_list ap) { - char buf[4096]; /* TODO: avoid static, use print_handler_dyn ? */ - struct pl pl; - size_t n; + struct strm_print sp; if (!stream) return -1; - pl.p = buf; - pl.l = sizeof(buf); - - if (0 != re_vhprintf(fmt, ap, print_handler, &pl)) - return -1; - - n = sizeof(buf) - pl.l; + sp.f = stream; + sp.n = 0; - if (1 != fwrite(buf, n, 1, stream)) + if (0 != re_vhprintf(fmt, ap, print_handler_stream, &sp)) return -1; - return (int)n; + return (int)sp.n; } diff -Nru libre-0.5.0/src/http/client.c libre-0.5.3/src/http/client.c --- libre-0.5.0/src/http/client.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/http/client.c 2017-05-11 08:19:57.000000000 +0000 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -22,43 +23,75 @@ enum { CONN_TIMEOUT = 30000, - RECV_TIMEOUT = 30000, + RECV_TIMEOUT = 60000, + IDLE_TIMEOUT = 900000, BUFSIZE_MAX = 524288, + CONN_BSIZE = 256, }; struct http_cli { + struct list reql; + struct hash *ht_conn; struct dnsc *dnsc; struct tls *tls; }; +struct conn; + struct http_req { struct sa srvv[16]; - struct tmr tmr; + struct le le; struct http_req **reqp; + struct http_cli *cli; struct dns_query *dq; - struct tls_conn *sc; - struct tcp_conn *tc; + struct conn *conn; struct mbuf *mbreq; struct mbuf *mb; - struct tls *tls; char *host; http_resp_h *resph; http_data_h *datah; void *arg; + size_t rx_bytes; + size_t rx_len; unsigned srvc; uint16_t port; bool secure; + bool close; bool data; }; +struct conn { + struct tmr tmr; + struct sa addr; + struct le he; + struct http_req *req; + struct tls_conn *sc; + struct tcp_conn *tc; + uint64_t usec; +}; + + +static void req_close(struct http_req *req, int err, + const struct http_msg *msg); static int req_connect(struct http_req *req); +static void timeout_handler(void *arg); static void cli_destructor(void *arg) { struct http_cli *cli = arg; + struct le *le = cli->reql.head; + while (le) { + struct http_req *req = le->data; + + le = le->next; + req_close(req, ECONNABORTED, NULL); + } + + hash_flush(cli->ht_conn); + mem_deref(cli->ht_conn); mem_deref(cli->dnsc); mem_deref(cli->tls); } @@ -68,26 +101,49 @@ { struct http_req *req = arg; - tmr_cancel(&req->tmr); + list_unlink(&req->le); mem_deref(req->dq); - mem_deref(req->sc); - mem_deref(req->tc); + mem_deref(req->conn); mem_deref(req->mbreq); mem_deref(req->mb); - mem_deref(req->tls); mem_deref(req->host); } +static void conn_destructor(void *arg) +{ + struct conn *conn = arg; + + tmr_cancel(&conn->tmr); + hash_unlink(&conn->he); + mem_deref(conn->sc); + mem_deref(conn->tc); +} + + +static void conn_idle(struct conn *conn) +{ + tmr_start(&conn->tmr, IDLE_TIMEOUT, timeout_handler, conn); + conn->req = NULL; +} + + static void req_close(struct http_req *req, int err, const struct http_msg *msg) { - tmr_cancel(&req->tmr); + list_unlink(&req->le); req->dq = mem_deref(req->dq); - req->sc = mem_deref(req->sc); - req->tc = mem_deref(req->tc); req->datah = NULL; + if (req->conn) { + if (err || req->close) + mem_deref(req->conn); + else + conn_idle(req->conn); + + req->conn = NULL; + } + if (req->reqp) { *req->reqp = NULL; req->reqp = NULL; @@ -97,15 +153,27 @@ req->resph(err, msg, req->arg); req->resph = NULL; } + + mem_deref(req); } -static void timeout_handler(void *arg) +static void try_next(struct conn *conn, int err) { - struct http_req *req = arg; - int err = ETIMEDOUT; + struct http_req *req = conn->req; + bool retry = conn->usec > 1; + + mem_deref(conn); + + if (!req) + return; + + req->conn = NULL; - if (req->srvc > 0) { + if (retry) + ++req->srvc; + + if (req->srvc > 0 && !req->data) { err = req_connect(req); if (!err) @@ -113,36 +181,74 @@ } req_close(req, err, NULL); +} + + +static void req_recv(struct http_req *req, struct mbuf *mb) +{ + uint32_t nrefs; + + req->rx_bytes += mbuf_get_left(mb); + + mem_ref(req); + + if (req->datah) + req->datah(mb, req->arg); + + nrefs = mem_nrefs(req); mem_deref(req); + + if (nrefs == 1) + return; + + if (req->rx_bytes < req->rx_len) + return; + + req_close(req, 0, NULL); +} + + +static void timeout_handler(void *arg) +{ + struct conn *conn = arg; + + try_next(conn, ETIMEDOUT); } static void estab_handler(void *arg) { - struct http_req *req = arg; + struct conn *conn = arg; + struct http_req *req = conn->req; int err; - err = tcp_send(req->tc, req->mbreq); + if (!req) + return; + + err = tcp_send(conn->tc, req->mbreq); if (err) { - req_close(req, err, NULL); - mem_deref(req); + try_next(conn, err); return; } - tmr_start(&req->tmr, RECV_TIMEOUT, timeout_handler, req); + tmr_start(&conn->tmr, RECV_TIMEOUT, timeout_handler, conn); } static void recv_handler(struct mbuf *mb, void *arg) { struct http_msg *msg = NULL; - struct http_req *req = arg; + const struct http_hdr *hdr; + struct conn *conn = arg; + struct http_req *req = conn->req; size_t pos; int err; + if (!req) + return; + if (req->data) { - if (req->datah) - req->datah(mb, req->arg); + req_recv(req, mb); return; } @@ -179,12 +285,36 @@ goto out; } + hdr = http_msg_hdr(msg, HTTP_HDR_CONNECTION); + + if (hdr && !pl_strcasecmp(&hdr->val, "close")) + req->close = true; + if (req->datah) { - tmr_cancel(&req->tmr); + + uint32_t nrefs; + + if (http_msg_hdr(msg, HTTP_HDR_CONTENT_LENGTH)) + req->rx_len = msg->clen; + else + req->rx_len = -1; + + tmr_cancel(&conn->tmr); req->data = true; + + mem_ref(req); + if (req->resph) req->resph(0, msg, req->arg); + + nrefs = mem_nrefs(req); + mem_deref(req); + mem_deref(msg); + + if (nrefs > 1 && mbuf_get_left(req->mb)) + req_recv(req, req->mb); + return; } @@ -198,24 +328,91 @@ out: req_close(req, err, msg); - mem_deref(req); mem_deref(msg); } static void close_handler(int err, void *arg) { - struct http_req *req = arg; + struct conn *conn = arg; - if (req->srvc > 0 && !req->data) { + try_next(conn, err ? err : ECONNRESET); +} - err = req_connect(req); - if (!err) - return; + +static bool conn_cmp(struct le *le, void *arg) +{ + const struct conn *conn = le->data; + const struct http_req *req = arg; + + if (!sa_cmp(&req->srvv[req->srvc], &conn->addr, SA_ALL)) + return false; + + if (req->secure != !!conn->sc) + return false; + + return conn->req == NULL; +} + + +static int conn_connect(struct http_req *req) +{ + const struct sa *addr = &req->srvv[req->srvc]; + struct conn *conn; + int err; + + conn = list_ledata(hash_lookup(req->cli->ht_conn, + sa_hash(addr, SA_ALL), conn_cmp, req)); + if (conn) { + err = tcp_send(conn->tc, req->mbreq); + if (!err) { + tmr_start(&conn->tmr, RECV_TIMEOUT, + timeout_handler, conn); + + req->conn = conn; + conn->req = req; + + ++conn->usec; + + return 0; + } + + mem_deref(conn); } - req_close(req, err ? err : ECONNRESET, NULL); - mem_deref(req); + conn = mem_zalloc(sizeof(*conn), conn_destructor); + if (!conn) + return ENOMEM; + + hash_append(req->cli->ht_conn, sa_hash(addr, SA_ALL), &conn->he, conn); + + conn->addr = *addr; + conn->usec = 1; + + err = tcp_connect(&conn->tc, addr, estab_handler, recv_handler, + close_handler, conn); + if (err) + goto out; + +#ifdef USE_TLS + if (req->secure) { + + err = tls_start_tcp(&conn->sc, req->cli->tls, conn->tc, 0); + if (err) + goto out; + } +#endif + + tmr_start(&conn->tmr, CONN_TIMEOUT, timeout_handler, conn); + + req->conn = conn; + conn->req = req; + + out: + if (err) + mem_deref(conn); + + return err; } @@ -227,29 +424,11 @@ --req->srvc; - tmr_cancel(&req->tmr); - req->sc = mem_deref(req->sc); - req->tc = mem_deref(req->tc); req->mb = mem_deref(req->mb); - err = tcp_connect(&req->tc, &req->srvv[req->srvc], - estab_handler, recv_handler, close_handler, - req); - if (err) - continue; - -#ifdef USE_TLS - if (req->secure) { - - err = tls_start_tcp(&req->sc, req->tls, req->tc, 0); - if (err) { - req->tc = mem_deref(req->tc); - continue; - } - } -#endif - tmr_start(&req->tmr, CONN_TIMEOUT, timeout_handler, req); - break; + err = conn_connect(req); + if (!err) + break; } return err; @@ -303,7 +482,6 @@ fail: req_close(req, err, NULL); - mem_deref(req); } @@ -332,7 +510,7 @@ va_list ap; int err; - if (!reqp || !cli || !met || !uri) + if (!cli || !met || !uri) return EINVAL; if (re_regex(uri, strlen(uri), "[a-z]+://[^:/]+[:]*[0-9]*[^]+", @@ -358,7 +536,9 @@ if (!req) return ENOMEM; - req->tls = mem_ref(cli->tls); + list_append(&cli->reql, &req->le, req); + + req->cli = cli; req->secure = secure; req->port = pl_isset(&port) ? pl_u32(&port) : defport; req->resph = resph; @@ -411,7 +591,7 @@ out: if (err) mem_deref(req); - else { + else if (reqp) { req->reqp = reqp; *reqp = req; } @@ -440,6 +620,10 @@ if (!cli) return ENOMEM; + err = hash_alloc(&cli->ht_conn, CONN_BSIZE); + if (err) + goto out; + #ifdef USE_TLS err = tls_alloc(&cli->tls, TLS_METHOD_SSLV23, NULL, NULL); #else @@ -462,11 +646,17 @@ struct tcp_conn *http_req_tcp(struct http_req *req) { - return req ? req->tc : NULL; + if (!req || !req->conn) + return NULL; + + return req->conn->tc; } struct tls_conn *http_req_tls(struct http_req *req) { - return req ? req->sc : NULL; + if (!req || !req->conn) + return NULL; + + return req->conn->sc; } diff -Nru libre-0.5.0/src/ice/candpair.c libre-0.5.3/src/ice/candpair.c --- libre-0.5.0/src/ice/candpair.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/candpair.c 2017-05-11 08:19:57.000000000 +0000 @@ -45,7 +45,7 @@ { uint32_t g, d; - if (ROLE_CONTROLLING == cp->icem->ice->lrole) { + if (ICE_ROLE_CONTROLLING == cp->icem->lrole) { g = cp->lcand->prio; d = cp->rcand->prio; } diff -Nru libre-0.5.0/src/ice/chklist.c libre-0.5.3/src/ice/chklist.c --- libre-0.5.0/src/ice/chklist.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/chklist.c 2017-05-11 08:19:57.000000000 +0000 @@ -110,7 +110,7 @@ /** * Computing States */ -static void candpair_set_states(struct icem *icem) +void ice_candpair_set_states(struct icem *icem) { struct le *le, *le2; @@ -161,7 +161,7 @@ if (!icem) return EINVAL; - if (ICE_MODE_LITE == icem->ice->lmode) { + if (ICE_MODE_LITE == icem->lmode) { DEBUG_WARNING("%s: Checklist: only valid for full-mode\n", icem->name); return EINVAL; @@ -182,10 +182,6 @@ /* 4. prune the pairs */ candpair_prune(icem); - /* 5. set the pair states -- first media stream only */ - if (icem->ice->ml.head->data == icem) - candpair_set_states(icem); - return err; } @@ -230,7 +226,7 @@ icem_comp_set_selected(comp, cp); - if (comp->icem->ice->conf.nom == ICE_NOMINATION_REGULAR) { + if (comp->icem->conf.nom == ICE_NOMINATION_REGULAR) { /* send STUN request with USE_CAND flag via triggered qeueue */ (void)icem_conncheck_send(cp, true, true); @@ -282,7 +278,7 @@ icem->state = err ? ICE_CHECKLIST_FAILED : ICE_CHECKLIST_COMPLETED; if (icem->chkh) { - icem->chkh(err, icem->ice->lrole == ROLE_CONTROLLING, + icem->chkh(err, icem->lrole == ICE_ROLE_CONTROLLING, icem->arg); } } diff -Nru libre-0.5.0/src/ice/comp.c libre-0.5.3/src/ice/comp.c --- libre-0.5.0/src/ice/comp.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/comp.c 2017-05-11 08:19:57.000000000 +0000 @@ -52,7 +52,7 @@ break; default: - (void)stun_ctrans_recv(icem->ice->stun, msg, &ua); + (void)stun_ctrans_recv(icem->stun, msg, &ua); break; } } @@ -266,7 +266,7 @@ { va_list ap; - if (!comp || !comp->icem->ice->conf.debug) + if (!comp || !comp->icem->conf.debug) return; va_start(ap, fmt); diff -Nru libre-0.5.0/src/ice/connchk.c libre-0.5.3/src/ice/connchk.c --- libre-0.5.0/src/ice/connchk.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/connchk.c 2017-05-11 08:19:57.000000000 +0000 @@ -187,7 +187,7 @@ break; case 487: /* Role Conflict */ - ice_switch_local_role(icem->ice); + ice_switch_local_role(icem); (void)icem_conncheck_send(cp, false, true); break; @@ -207,7 +207,6 @@ { struct ice_cand *lcand = cp->lcand; struct icem *icem = cp->icem; - struct ice *ice = icem->ice; char username_buf[64]; size_t presz = 0; uint32_t prio_prflx; @@ -217,21 +216,21 @@ icem_candpair_set_state(cp, ICE_CANDPAIR_INPROGRESS); (void)re_snprintf(username_buf, sizeof(username_buf), - "%s:%s", icem->rufrag, ice->lufrag); + "%s:%s", icem->rufrag, icem->lufrag); /* PRIORITY and USE-CANDIDATE */ prio_prflx = ice_cand_calc_prio(ICE_CAND_TYPE_PRFLX, 0, lcand->compid); - switch (ice->lrole) { + switch (icem->lrole) { - case ROLE_CONTROLLING: + case ICE_ROLE_CONTROLLING: ctrl_attr = STUN_ATTR_CONTROLLING; - if (ice->conf.nom == ICE_NOMINATION_AGGRESSIVE) + if (icem->conf.nom == ICE_NOMINATION_AGGRESSIVE) use_cand = true; break; - case ROLE_CONTROLLED: + case ICE_ROLE_CONTROLLED: ctrl_attr = STUN_ATTR_CONTROLLED; break; @@ -279,7 +278,7 @@ case ICE_CAND_TYPE_SRFLX: case ICE_CAND_TYPE_PRFLX: cp->ct_conn = mem_deref(cp->ct_conn); - err = stun_request(&cp->ct_conn, ice->stun, icem->proto, + err = stun_request(&cp->ct_conn, icem->stun, icem->proto, cp->comp->sock, &cp->rcand->addr, presz, STUN_METHOD_BINDING, (uint8_t *)icem->rpwd, str_len(icem->rpwd), @@ -287,7 +286,7 @@ 4, STUN_ATTR_USERNAME, username_buf, STUN_ATTR_PRIORITY, &prio_prflx, - ctrl_attr, &ice->tiebrk, + ctrl_attr, &icem->tiebrk, STUN_ATTR_USE_CAND, use_cand ? &use_cand : 0); break; @@ -308,7 +307,7 @@ tmr_cancel(&icem->tmr_pace); if (icem->chkh) { - icem->chkh(err, icem->ice->lrole == ROLE_CONTROLLING, + icem->chkh(err, icem->lrole == ICE_ROLE_CONTROLLING, icem->arg); } @@ -391,7 +390,7 @@ if (!icem) return EINVAL; - if (ICE_MODE_FULL != icem->ice->lmode) + if (ICE_MODE_FULL != icem->lmode) return EINVAL; err = icem_checklist_form(icem); diff -Nru libre-0.5.0/src/ice/gather.c libre-0.5.3/src/ice/gather.c --- libre-0.5.0/src/ice/gather.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/gather.c 2017-05-11 08:19:57.000000000 +0000 @@ -97,7 +97,7 @@ if (comp->ct_gath) return EALREADY; - err = stun_request(&comp->ct_gath, icem->ice->stun, icem->proto, + err = stun_request(&comp->ct_gath, icem->stun, icem->proto, comp->sock, &icem->stun_srv, 0, STUN_METHOD_BINDING, NULL, false, 0, @@ -174,7 +174,7 @@ if (comp->turnc) return EALREADY; - err = turnc_alloc(&comp->turnc, stun_conf(icem->ice->stun), + err = turnc_alloc(&comp->turnc, stun_conf(icem->stun), icem->proto, comp->sock, layer, &icem->stun_srv, username, password, 60, turnc_handler, comp); @@ -193,7 +193,7 @@ struct le *le; int err = 0; - if (icem->ice->lmode != ICE_MODE_FULL) + if (icem->lmode != ICE_MODE_FULL) return EINVAL; if (list_isempty(&icem->compl)) { diff -Nru libre-0.5.0/src/ice/ice.c libre-0.5.3/src/ice/ice.c --- libre-0.5.0/src/ice/ice.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/ice.c 2017-05-11 08:19:57.000000000 +0000 @@ -1,244 +1 @@ -/** - * @file ice.c Interactive Connectivity Establishment (ICE) - * - * Copyright (C) 2010 Creytiv.com - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ice.h" - -/* - * ICE Implementation as of RFC 5245 - */ - - -static const struct ice_conf conf_default = { - ICE_NOMINATION_REGULAR, - ICE_DEFAULT_RTO_RTP, - ICE_DEFAULT_RC, - false -}; - - -/** Determining Role */ -static void ice_determine_role(struct ice *ice, bool offerer) -{ - if (!ice) - return; - - if (ice->lmode == ice->rmode) - ice->lrole = offerer ? ROLE_CONTROLLING : ROLE_CONTROLLED; - else if (ice->lmode == ICE_MODE_FULL) - ice->lrole = ROLE_CONTROLLING; - else - ice->lrole = ROLE_CONTROLLED; -} - - -static void ice_destructor(void *arg) -{ - struct ice *ice = arg; - - list_flush(&ice->ml); - mem_deref(ice->stun); -} - - -/** - * Allocate a new ICE Session - * - * @param icep Pointer to allocated ICE Session object - * @param mode ICE Mode; Full-mode or Lite-mode - * @param offerer True if we are SDP offerer, otherwise false - * - * @return 0 if success, otherwise errorcode - */ -int ice_alloc(struct ice **icep, enum ice_mode mode, bool offerer) -{ - struct ice *ice; - int err = 0; - - if (!icep) - return EINVAL; - - ice = mem_zalloc(sizeof(*ice), ice_destructor); - if (!ice) - return ENOMEM; - - list_init(&ice->ml); - - ice->conf = conf_default; - ice->lmode = mode; - ice->tiebrk = rand_u64(); - - rand_str(ice->lufrag, sizeof(ice->lufrag)); - rand_str(ice->lpwd, sizeof(ice->lpwd)); - - ice_determine_role(ice, offerer); - - if (ICE_MODE_FULL == ice->lmode) { - - err = stun_alloc(&ice->stun, NULL, NULL, NULL); - if (err) - goto out; - - /* Update STUN Transport */ - stun_conf(ice->stun)->rto = ice->conf.rto; - stun_conf(ice->stun)->rc = ice->conf.rc; - } - - out: - if (err) - mem_deref(ice); - else - *icep = ice; - - return err; -} - - -/** - * Get the ICE Configuration - * - * @param ice ICE Session - * - * @return ICE Configuration - */ -struct ice_conf *ice_conf(struct ice *ice) -{ - return ice ? &ice->conf : NULL; -} - - -void ice_set_conf(struct ice *ice, const struct ice_conf *conf) -{ - if (!ice || !conf) - return; - - ice->conf = *conf; - - if (ice->stun) { - - /* Update STUN Transport */ - stun_conf(ice->stun)->rto = ice->conf.rto; - stun_conf(ice->stun)->rc = ice->conf.rc; - } -} - - -/** - * Set the offerer flag on the ICE Session - * - * @param ice ICE Session - * @param offerer True if offerer, otherwise false - */ -void ice_set_offerer(struct ice *ice, bool offerer) -{ - if (!ice) - return; - - ice_determine_role(ice, offerer); -} - - -/** - * Start the Connectivity checks on the ICE Session - * - * @param ice ICE Session - * - * @return 0 if success, otherwise errorcode - */ -int ice_conncheck_start(struct ice *ice) -{ - struct le *le; - int err = 0; - - if (!ice) - return EINVAL; - - for (le = ice->ml.head; le; le = le->next) - err |= icem_conncheck_start(le->data); - - return err; -} - - -/** - * Print debug information for the ICE Session - * - * @param pf Print function for debug output - * @param ice ICE Session - * - * @return 0 if success, otherwise errorcode - */ -int ice_debug(struct re_printf *pf, const struct ice *ice) -{ - struct le *le; - int err = 0; - - if (!ice) - return 0; - - err |= re_hprintf(pf, " local_mode=%s, remote_mode=%s", - ice_mode2name(ice->lmode), - ice_mode2name(ice->rmode)); - err |= re_hprintf(pf, ", local_role=%s\n", ice_role2name(ice->lrole)); - err |= re_hprintf(pf, " local_ufrag=\"%s\" local_pwd=\"%s\"\n", - ice->lufrag, ice->lpwd); - - for (le = ice->ml.head; le; le = le->next) - err |= icem_debug(pf, le->data); - - err |= stun_debug(pf, ice->stun); - - return err; -} - - -/** - * Get the list of ICE Media objects (struct icem) for the ICE Session - * - * @param ice ICE Session - * - * @return List of ICE Media objects - */ -struct list *ice_medialist(const struct ice *ice) -{ - return ice ? (struct list *)&ice->ml : NULL; -} - - -/** - * Get the local Username fragment for the ICE Session - * - * @param ice ICE Session - * - * @return Local Username-fragment - */ -const char *ice_ufrag(const struct ice *ice) -{ - return ice ? ice->lufrag : NULL; -} - - -/** - * Get the local password for the ICE Session - * - * @param ice ICE Session - * - * @return Local password - */ -const char *ice_pwd(const struct ice *ice) -{ - return ice ? ice->lpwd : NULL; -} diff -Nru libre-0.5.0/src/ice/ice.h libre-0.5.3/src/ice/ice.h --- libre-0.5.0/src/ice/ice.h 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/ice.h 2017-05-11 08:19:57.000000000 +0000 @@ -10,12 +10,6 @@ #endif -enum role { - ROLE_UNKNOWN = 0, - ROLE_CONTROLLING, - ROLE_CONTROLLED -}; - enum ice_checkl_state { ICE_CHECKLIST_NULL = -1, ICE_CHECKLIST_RUNNING, @@ -23,15 +17,6 @@ ICE_CHECKLIST_FAILED }; -/** Candidate pair states */ -enum ice_candpair_state { - ICE_CANDPAIR_FROZEN = 0, /**< Frozen state (default) */ - ICE_CANDPAIR_WAITING, /**< Waiting to become highest on list */ - ICE_CANDPAIR_INPROGRESS, /**< In-Progress state;transac. in progress */ - ICE_CANDPAIR_SUCCEEDED, /**< Succeeded state; successful result */ - ICE_CANDPAIR_FAILED /**< Failed state; check failed */ -}; - enum ice_transp { ICE_TRANSP_NONE = -1, ICE_TRANSP_UDP = IPPROTO_UDP @@ -48,19 +33,6 @@ }; -/** Defines an ICE session */ -struct ice { - enum ice_mode lmode; /**< Local mode */ - enum ice_mode rmode; /**< Remote mode */ - enum role lrole; /**< Local role */ - char lufrag[5]; /**< Local Username fragment */ - char lpwd[23]; /**< Local Password */ - struct list ml; /**< Media list (struct icem) */ - uint64_t tiebrk; /**< Tie-break value for roleconflict */ - struct ice_conf conf; /**< ICE Configuration */ - struct stun *stun; /**< STUN Transport */ -}; - /** Defines a media-stream component */ struct icem_comp { struct le le; /**< Linked-list element */ @@ -80,20 +52,26 @@ /** Defines an ICE media-stream */ struct icem { - struct le le; /**< Linked-list element */ - struct ice *ice; /**< Pointer to parent ICE-session */ + struct ice_conf conf; /**< ICE Configuration */ + struct stun *stun; /**< STUN Transport */ struct sa stun_srv; /**< STUN Server IP address and port */ int nstun; /**< Number of pending STUN candidates */ struct list lcandl; /**< List of local candidates */ struct list rcandl; /**< List of remote candidates */ struct list checkl; /**< Check List of cand pairs (sorted) */ struct list validl; /**< Valid List of cand pairs (sorted) */ + uint64_t tiebrk; /**< Tie-break value for roleconflict */ bool mismatch; /**< ICE mismatch flag */ + enum ice_mode lmode; /**< Local mode */ + enum ice_mode rmode; /**< Remote mode */ + enum ice_role lrole; /**< Local role */ struct tmr tmr_pace; /**< Timer for pacing STUN requests */ int proto; /**< Transport protocol */ int layer; /**< Protocol layer */ enum ice_checkl_state state; /**< State of the checklist */ struct list compl; /**< ICE media components */ + char *lufrag; /**< Local Username fragment */ + char *lpwd; /**< Local Password */ char *rufrag; /**< Remote Username fragment */ char *rpwd; /**< Remote Password */ ice_gather_h *gh; /**< Gather handler */ @@ -225,8 +203,6 @@ /* icestr */ const char *ice_mode2name(enum ice_mode mode); -const char *ice_role2name(enum role role); -const char *ice_candpair_state2name(enum ice_candpair_state st); const char *ice_checkl_state2name(enum ice_checkl_state cst); @@ -234,5 +210,5 @@ typedef void * (list_unique_h)(struct le *le1, struct le *le2); uint64_t ice_calc_pair_prio(uint32_t g, uint32_t d); -void ice_switch_local_role(struct ice *ice); +void ice_switch_local_role(struct icem *icem); uint32_t ice_list_unique(struct list *list, list_unique_h *uh); diff -Nru libre-0.5.0/src/ice/icem.c libre-0.5.3/src/ice/icem.c --- libre-0.5.0/src/ice/icem.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/icem.c 2017-05-11 08:19:57.000000000 +0000 @@ -21,44 +21,86 @@ #include +/* + * ICE Implementation as of RFC 5245 + */ + + +static const struct ice_conf conf_default = { + ICE_NOMINATION_REGULAR, + ICE_DEFAULT_RTO_RTP, + ICE_DEFAULT_RC, + false +}; + + +/** Determining Role */ +static void ice_determine_role(struct icem *icem, enum ice_role role) +{ + if (!icem) + return; + + if (icem->lmode == icem->rmode) + icem->lrole = role; + else if (icem->lmode == ICE_MODE_FULL) + icem->lrole = ICE_ROLE_CONTROLLING; + else + icem->lrole = ICE_ROLE_CONTROLLED; +} + + static void icem_destructor(void *data) { struct icem *icem = data; - list_unlink(&icem->le); tmr_cancel(&icem->tmr_pace); list_flush(&icem->compl); list_flush(&icem->validl); list_flush(&icem->checkl); list_flush(&icem->lcandl); list_flush(&icem->rcandl); + mem_deref(icem->lufrag); + mem_deref(icem->lpwd); mem_deref(icem->rufrag); mem_deref(icem->rpwd); + mem_deref(icem->stun); } /** * Add a new ICE Media object to the ICE Session * - * @param icemp Pointer to allocated ICE Media object - * @param ice ICE Session - * @param proto Transport protocol - * @param layer Protocol stack layer - * @param gh Gather handler - * @param chkh Connectivity check handler - * @param arg Handler argument + * @param icemp Pointer to allocated ICE Media object + * @param mode ICE mode + * @param role Local ICE role + * @param proto Transport protocol + * @param layer Protocol stack layer + * @param tiebrk Tie-breaker value, must be same for all media streams + * @param lufrag Local username fragment + * @param lpwd Local password + * @param gh Gather handler + * @param chkh Connectivity check handler + * @param arg Handler argument * * @return 0 if success, otherwise errorcode */ -int icem_alloc(struct icem **icemp, struct ice *ice, int proto, int layer, - ice_gather_h *gh, ice_connchk_h *chkh, void *arg) +int icem_alloc(struct icem **icemp, + enum ice_mode mode, enum ice_role role, + int proto, int layer, + uint64_t tiebrk, const char *lufrag, const char *lpwd, + ice_gather_h *gh, ice_connchk_h *chkh, void *arg) { struct icem *icem; int err = 0; - if (!ice) + if (!icemp || !tiebrk || !lufrag || !lpwd) return EINVAL; + if (str_len(lufrag) < 4 || str_len(lpwd) < 22) { + DEBUG_WARNING("alloc: lufrag/lpwd is too short\n"); + return EINVAL; + } + if (proto != IPPROTO_UDP) return EPROTONOSUPPORT; @@ -66,13 +108,14 @@ if (!icem) return ENOMEM; + icem->conf = conf_default; + tmr_init(&icem->tmr_pace); list_init(&icem->lcandl); list_init(&icem->rcandl); list_init(&icem->checkl); list_init(&icem->validl); - icem->ice = ice; icem->layer = layer; icem->proto = proto; icem->state = ICE_CHECKLIST_NULL; @@ -84,7 +127,26 @@ if (err) goto out; - list_append(&ice->ml, &icem->le, icem); + icem->lmode = mode; + icem->tiebrk = tiebrk; + + err |= str_dup(&icem->lufrag, lufrag); + err |= str_dup(&icem->lpwd, lpwd); + if (err) + goto out; + + ice_determine_role(icem, role); + + if (ICE_MODE_FULL == icem->lmode) { + + err = stun_alloc(&icem->stun, NULL, NULL, NULL); + if (err) + goto out; + + /* Update STUN Transport */ + stun_conf(icem->stun)->rto = icem->conf.rto; + stun_conf(icem->stun)->rc = icem->conf.rc; + } out: if (err) @@ -97,6 +159,56 @@ /** + * Get the ICE Configuration + * + * @param icem ICE Media object + * + * @return ICE Configuration + */ +struct ice_conf *icem_conf(struct icem *icem) +{ + return icem ? &icem->conf : NULL; +} + + +enum ice_role icem_local_role(const struct icem *icem) +{ + return icem ? icem->lrole : ICE_ROLE_UNKNOWN; +} + + +void icem_set_conf(struct icem *icem, const struct ice_conf *conf) +{ + if (!icem || !conf) + return; + + icem->conf = *conf; + + if (icem->stun) { + + /* Update STUN Transport */ + stun_conf(icem->stun)->rto = icem->conf.rto; + stun_conf(icem->stun)->rc = icem->conf.rc; + } +} + + +/** + * Set the local role on the ICE Session + * + * @param icem ICE Media object + * @param role Local ICE role + */ +void icem_set_role(struct icem *icem, enum ice_role role) +{ + if (!icem) + return; + + ice_determine_role(icem, role); +} + + +/** * Set the name of the ICE Media object, used for debugging * * @param icem ICE Media object @@ -345,6 +457,13 @@ err |= re_hprintf(pf, "----- ICE Media <%s> -----\n", icem->name); + err |= re_hprintf(pf, " local_mode=%s, remote_mode=%s", + ice_mode2name(icem->lmode), + ice_mode2name(icem->rmode)); + err |= re_hprintf(pf, ", local_role=%s\n", ice_role2name(icem->lrole)); + err |= re_hprintf(pf, " local_ufrag=\"%s\" local_pwd=\"%s\"\n", + icem->lufrag, icem->lpwd); + err |= re_hprintf(pf, " Components: (%u)\n", list_count(&icem->compl)); for (le = icem->compl.head; le; le = le->next) { struct icem_comp *comp = le->data; @@ -362,6 +481,8 @@ err |= re_hprintf(pf, " Valid list: %H", icem_candpairs_debug, &icem->validl); + err |= stun_debug(pf, icem->stun); + return err; } @@ -430,7 +551,7 @@ struct le *le; int err = 0; - if (icem->ice->lmode != ICE_MODE_LITE) + if (icem->lmode != ICE_MODE_LITE) return EINVAL; for (le = icem->compl.head; le; le = le->next) { @@ -448,7 +569,7 @@ { va_list ap; - if (!icem || !icem->ice->conf.debug) + if (!icem || !icem->conf.debug) return; va_start(ap, fmt); diff -Nru libre-0.5.0/src/ice/icesdp.c libre-0.5.3/src/ice/icesdp.c --- libre-0.5.0/src/ice/icesdp.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/icesdp.c 2017-05-11 08:19:57.000000000 +0000 @@ -96,7 +96,7 @@ if (!icem) return false; - return icem->ice->lrole == ROLE_CONTROLLING && + return icem->lrole == ICE_ROLE_CONTROLLING && icem->state == ICE_CHECKLIST_COMPLETED; } @@ -134,23 +134,17 @@ /* Decode SDP Attributes */ -static int ufrag_decode(struct ice *ice, const char *value) +static int ufrag_decode(struct icem *icem, const char *value) { char *ufrag = NULL; - struct le *le; int err; err = str_dup(&ufrag, value); if (err) return err; - for (le = ice->ml.head; le; le = le->next) { - - struct icem *icem = le->data; - - mem_deref(icem->rufrag); - icem->rufrag = mem_ref(ufrag); - } + mem_deref(icem->rufrag); + icem->rufrag = mem_ref(ufrag); mem_deref(ufrag); @@ -158,23 +152,17 @@ } -static int pwd_decode(struct ice *ice, const char *value) +static int pwd_decode(struct icem *icem, const char *value) { char *pwd = NULL; - struct le *le; int err; err = str_dup(&pwd, value); if (err) return err; - for (le = ice->ml.head; le; le = le->next) { - - struct icem *icem = le->data; - - mem_deref(icem->rpwd); - icem->rpwd = mem_ref(pwd); - } + mem_deref(icem->rpwd); + icem->rpwd = mem_ref(pwd); mem_deref(pwd); @@ -265,29 +253,29 @@ /** * Decode SDP session attributes * - * @param ice ICE Session + * @param icem ICE Media object * @param name Name of the SDP attribute * @param value Value of the SDP attribute (optional) * * @return 0 if success, otherwise errorcode */ -int ice_sdp_decode(struct ice *ice, const char *name, const char *value) +int ice_sdp_decode(struct icem *icem, const char *name, const char *value) { - if (!ice) + if (!icem) return EINVAL; if (0 == str_casecmp(name, ice_attr_lite)) { - if (ICE_MODE_LITE == ice->lmode) { + if (ICE_MODE_LITE == icem->lmode) { DEBUG_WARNING("we are lite, peer is also lite!\n"); return EPROTO; } - ice->rmode = ICE_MODE_LITE; - ice->lrole = ROLE_CONTROLLING; + icem->rmode = ICE_MODE_LITE; + icem->lrole = ICE_ROLE_CONTROLLING; } else if (0 == str_casecmp(name, ice_attr_ufrag)) - return ufrag_decode(ice, value); + return ufrag_decode(icem, value); else if (0 == str_casecmp(name, ice_attr_pwd)) - return pwd_decode(ice, value); + return pwd_decode(icem, value); return 0; } diff -Nru libre-0.5.0/src/ice/icestr.c libre-0.5.3/src/ice/icestr.c --- libre-0.5.0/src/ice/icestr.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/icestr.c 2017-05-11 08:19:57.000000000 +0000 @@ -49,13 +49,13 @@ } -const char *ice_role2name(enum role role) +const char *ice_role2name(enum ice_role role) { switch (role) { - case ROLE_UNKNOWN: return "Unknown"; - case ROLE_CONTROLLING: return "Controlling"; - case ROLE_CONTROLLED: return "Controlled"; + case ICE_ROLE_UNKNOWN: return "Unknown"; + case ICE_ROLE_CONTROLLING: return "Controlling"; + case ICE_ROLE_CONTROLLED: return "Controlled"; default: return "???"; } } diff -Nru libre-0.5.0/src/ice/mod.mk libre-0.5.3/src/ice/mod.mk --- libre-0.5.0/src/ice/mod.mk 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/mod.mk 2017-05-11 08:19:57.000000000 +0000 @@ -10,7 +10,6 @@ SRCS += ice/comp.c SRCS += ice/connchk.c SRCS += ice/gather.c -SRCS += ice/ice.c SRCS += ice/icem.c SRCS += ice/icesdp.c SRCS += ice/icestr.c diff -Nru libre-0.5.0/src/ice/stunsrv.c libre-0.5.3/src/ice/stunsrv.c --- libre-0.5.0/src/ice/stunsrv.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/stunsrv.c 2017-05-11 08:19:57.000000000 +0000 @@ -92,7 +92,7 @@ /* * 7.2.1. Additional Procedures for Full Implementations */ -static int handle_stun_full(struct ice *ice, struct icem *icem, +static int handle_stun_full(struct icem *icem, struct icem_comp *comp, const struct sa *src, uint32_t prio, bool use_cand, bool tunnel) { @@ -145,7 +145,7 @@ /* 7.2.1.5. Updating the Nominated Flag */ if (use_cand) { - if (ice->lrole == ROLE_CONTROLLED && + if (icem->lrole == ICE_ROLE_CONTROLLED && cp->state == ICE_CANDPAIR_SUCCEEDED) { if (!cp->nominated) { @@ -160,7 +160,7 @@ /* Cancel conncheck. Choose Selected Pair */ icem_candpair_make_valid(cp); - if (ice->conf.nom == ICE_NOMINATION_REGULAR) { + if (icem->conf.nom == ICE_NOMINATION_REGULAR) { icem_candpair_cancel(cp); icem_comp_set_selected(comp, cp); } @@ -219,11 +219,10 @@ uint16_t scode, const char *reason) { struct icem *icem = comp->icem; - struct ice *ice = icem->ice; return stun_ereply(icem->proto, comp->sock, src, presz, req, scode, reason, - (uint8_t *)ice->lpwd, strlen(ice->lpwd), true, 1, + (uint8_t *)icem->lpwd, strlen(icem->lpwd), true, 1, STUN_ATTR_SOFTWARE, sw); } @@ -232,10 +231,9 @@ struct stun_msg *req, size_t presz) { struct icem *icem = comp->icem; - struct ice *ice = icem->ice; struct stun_attr *attr; struct pl lu, ru; - enum role rrole = ROLE_UNKNOWN; + enum ice_role rrole = ICE_ROLE_UNKNOWN; uint64_t tiebrk = 0; uint32_t prio_prflx; bool use_cand = false; @@ -246,7 +244,7 @@ if (err) return err; - err = stun_msg_chk_mi(req, (uint8_t *)ice->lpwd, strlen(ice->lpwd)); + err = stun_msg_chk_mi(req, (uint8_t *)icem->lpwd, strlen(icem->lpwd)); if (err) { if (err == EBADMSG) goto unauth; @@ -265,26 +263,26 @@ attr->v.username); goto unauth; } - if (pl_strcmp(&lu, ice->lufrag)) + if (pl_strcmp(&lu, icem->lufrag)) goto unauth; if (str_isset(icem->rufrag) && pl_strcmp(&ru, icem->rufrag)) goto unauth; attr = stun_msg_attr(req, STUN_ATTR_CONTROLLED); if (attr) { - rrole = ROLE_CONTROLLED; + rrole = ICE_ROLE_CONTROLLED; tiebrk = attr->v.uint64; } attr = stun_msg_attr(req, STUN_ATTR_CONTROLLING); if (attr) { - rrole = ROLE_CONTROLLING; + rrole = ICE_ROLE_CONTROLLING; tiebrk = attr->v.uint64; } - if (rrole == ice->lrole) { - if (ice->tiebrk >= tiebrk) - ice_switch_local_role(ice); + if (rrole == icem->lrole) { + if (icem->tiebrk >= tiebrk) + ice_switch_local_role(icem); else goto conflict; } @@ -299,8 +297,8 @@ if (attr) use_cand = true; - if (ice->lmode == ICE_MODE_FULL) { - err = handle_stun_full(ice, icem, comp, src, prio_prflx, + if (icem->lmode == ICE_MODE_FULL) { + err = handle_stun_full(icem, comp, src, prio_prflx, use_cand, presz > 0); } else { @@ -311,7 +309,7 @@ goto badmsg; return stun_reply(icem->proto, comp->sock, src, presz, req, - (uint8_t *)ice->lpwd, strlen(ice->lpwd), true, 2, + (uint8_t *)icem->lpwd, strlen(icem->lpwd), true, 2, STUN_ATTR_XOR_MAPPED_ADDR, src, STUN_ATTR_SOFTWARE, sw); diff -Nru libre-0.5.0/src/ice/util.c libre-0.5.3/src/ice/util.c --- libre-0.5.0/src/ice/util.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/ice/util.c 2017-05-11 08:19:57.000000000 +0000 @@ -72,26 +72,27 @@ } -void ice_switch_local_role(struct ice *ice) +void ice_switch_local_role(struct icem *icem) { - enum role new_role; - struct le *le; + enum ice_role new_role; - if (ROLE_CONTROLLING == ice->lrole) - new_role = ROLE_CONTROLLED; + if (ICE_ROLE_CONTROLLING == icem->lrole) + new_role = ICE_ROLE_CONTROLLED; else - new_role = ROLE_CONTROLLING; + new_role = ICE_ROLE_CONTROLLING; DEBUG_NOTICE("Switch local role from %s to %s\n", - ice_role2name(ice->lrole), ice_role2name(new_role)); + ice_role2name(icem->lrole), ice_role2name(new_role)); - ice->lrole = new_role; + icem->lrole = new_role; +#if 0 /* recompute pair priorities for all media streams */ - for (le = ice->ml.head; le; le = le->next) { - struct icem *icem = le->data; + for (le = icem->le.list->head; le; le = le->next) { + icem = le->data; icem_candpair_prio_order(&icem->checkl); } +#endif } diff -Nru libre-0.5.0/src/main/main.c libre-0.5.3/src/main/main.c --- libre-0.5.0/src/main/main.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/main/main.c 2017-05-11 08:19:57.000000000 +0000 @@ -155,11 +155,7 @@ static void poll_close(struct re *re); -#ifdef SOLARIS -static pthread_once_t pt_once = {PTHREAD_ONCE_INIT}; -#else static pthread_once_t pt_once = PTHREAD_ONCE_INIT; -#endif static pthread_key_t pt_key; diff -Nru libre-0.5.0/src/srtp/srtcp.c libre-0.5.3/src/srtp/srtcp.c --- libre-0.5.0/src/srtp/srtcp.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/srtp/srtcp.c 2017-05-11 08:19:57.000000000 +0000 @@ -34,7 +34,7 @@ struct comp *rtcp; uint32_t ssrc; size_t start; - int ep = 0; + uint32_t ep = 0; int err; if (!srtp || !mb) diff -Nru libre-0.5.0/src/sys/fs.c libre-0.5.3/src/sys/fs.c --- libre-0.5.0/src/sys/fs.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/sys/fs.c 2017-05-11 08:19:57.000000000 +0000 @@ -15,12 +15,10 @@ #include #endif #ifdef WIN32 -#define WIN32_LEAN_AND_MEAN #include #include #include #include -#undef WIN32_LEAN_AND_MEAN #endif #include #include diff -Nru libre-0.5.0/src/telev/telev.c libre-0.5.3/src/telev/telev.c --- libre-0.5.0/src/telev/telev.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/telev/telev.c 2017-05-11 08:19:57.000000000 +0000 @@ -73,6 +73,7 @@ /* tx */ struct mbuf *mb; uint32_t ptime; + uint16_t pdur; enum state state; int event; uint16_t dur; @@ -164,6 +165,7 @@ t->state = IDLE; t->ptime = ptime; + t->pdur = ptime * 8; t->rx_event = -1; out: @@ -177,6 +179,25 @@ /** + * Sets the sampling rate + * + * @param tel Telephony Event state + * @param srate Sampling rate in [Hz] + * + * @return 0 if success, otherwise errorcode + */ +int telev_set_srate(struct telev *tel, uint32_t srate) +{ + if (!tel || !srate) + return EINVAL; + + tel->pdur = tel->ptime * srate / 1000; + + return 0; +} + + +/** * Send a Telephony Event * * @param tel Telephony Event state @@ -275,7 +296,7 @@ mrk = true; tel->event = mbuf_read_u8(tel->mb); - tel->dur = tel->ptime * 8; + tel->dur = tel->pdur; tel->state = SENDING; tel->txc = 1; @@ -283,7 +304,7 @@ break; case SENDING: - tel->dur += tel->ptime * 8; + tel->dur += tel->pdur; err = payload_encode(mb, tel->event, false, tel->dur); diff -Nru libre-0.5.0/src/tls/openssl/tls.c libre-0.5.3/src/tls/openssl/tls.c --- libre-0.5.0/src/tls/openssl/tls.c 2016-11-25 18:39:06.000000000 +0000 +++ libre-0.5.3/src/tls/openssl/tls.c 2017-05-11 08:19:57.000000000 +0000 @@ -889,3 +889,16 @@ { ERR_print_errors_cb(print_error, NULL); } + + +/** + * Get the backend-specific (OpenSSL) context + * + * @param tls Generic TLS Context + * + * @return OpenSSL context + */ +struct ssl_ctx_st *tls_openssl_context(const struct tls *tls) +{ + return tls ? tls->ctx : NULL; +}