├── NEWS ├── stamp-h1 ├── test ├── .deps │ ├── check_account-account.Po │ ├── check_account-protocol.Po │ ├── check_account-tls_peer.Po │ ├── check_account-util_sys.Po │ ├── check_turn-check_turn.Po │ ├── check_turn-protocol.Po │ ├── check_turn-tls_peer.Po │ ├── check_turn-util_crypto.Po │ ├── check_turn-util_sys.Po │ ├── check_account-check_account.Po │ ├── check_account-util_crypto.Po │ ├── check_allocation-allocation.Po │ └── check_allocation-check_allocation.Po ├── Makefile.am └── check_account.c ├── src ├── turnusers.txt ├── Makefile.am ├── turnserver.conf ├── .deps │ ├── dbg.Po │ ├── util_sys.Po │ ├── util_crypto.Po │ ├── allocation.Po │ ├── conf.Po │ ├── account.Po │ ├── protocol.Po │ ├── test_turn_client.Po │ └── tls_peer.Po ├── mod_tmpuser.h ├── turnserver.h ├── test_echo_server.c ├── account.h ├── dbg.c ├── util_crypto.h ├── account.c ├── list.h ├── dbg.h └── mod_tmpuser.c ├── doc ├── Makefile.am ├── doxygen-main.h └── coding_style.txt ├── extra ├── turnusers.txt.template ├── Makefile.am ├── turnserver.debian.initd ├── turnserver.spec ├── turnserver.conf.template └── turnserver.fedora.initd ├── .gitignore ├── AUTHORS ├── Makefile.am ├── man ├── Makefile.am ├── turnserver.tmpl └── turnserver.conf.tmpl ├── LICENSE ├── configure.in ├── test-driver ├── ChangeLog ├── aminclude.am ├── LICENSE.OpenSSL ├── README.md ├── compile ├── autom4te.cache └── requests └── config.h.in /NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stamp-h1: -------------------------------------------------------------------------------- 1 | timestamp for config.h 2 | -------------------------------------------------------------------------------- /test/.deps/check_account-account.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_account-protocol.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_account-tls_peer.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_account-util_sys.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_turn-check_turn.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_turn-protocol.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_turn-tls_peer.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_turn-util_crypto.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_turn-util_sys.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_account-check_account.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_account-util_crypto.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /test/.deps/check_allocation-allocation.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /src/turnusers.txt: -------------------------------------------------------------------------------- 1 | pnz:123456:domain.org:authorized 2 | -------------------------------------------------------------------------------- /test/.deps/check_allocation-check_allocation.Po: -------------------------------------------------------------------------------- 1 | # dummy 2 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = coding_style.txt doxygen-main.h 2 | -------------------------------------------------------------------------------- /extra/turnusers.txt.template: -------------------------------------------------------------------------------- 1 | toto:password:domain.org:authorized 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.swp 3 | *.man 4 | src/test_echo_server 5 | src/test_turn_client 6 | src/turnservr 7 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Sebastien Vincent 2 | Daniel Pocock 3 | 4 | -------------------------------------------------------------------------------- /extra/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = packet-stun2-turn.diff 3 | EXTRA_DIST += turnserver.conf.template 4 | EXTRA_DIST += turnserver.debian.initd 5 | EXTRA_DIST += turnserver.fedora.initd 6 | EXTRA_DIST += turnserver.spec 7 | EXTRA_DIST += turnusers.txt.template 8 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # Adding doxygen support 2 | include aminclude.am 3 | 4 | SUBDIRS = src man test doc 5 | SUBDIRS += extra 6 | 7 | EXTRA_DIST = Doxyfile aminclude.am acinclude.m4 8 | EXTRA_DIST += LICENSE 9 | EXTRA_DIST += LICENSE.OpenSSL 10 | 11 | # valgrind 12 | valgrind-run: 13 | @echo 'Running with valgrind' 14 | valgrind --leak-check=full --show-reachable=yes $(top_builddir)/src/turnserver -c $(top_builddir)/extra/turnserver.conf 15 | 16 | -------------------------------------------------------------------------------- /man/Makefile.am: -------------------------------------------------------------------------------- 1 | dist_man1_MANS = turnserver.man 2 | dist_man5_MANS = turnserver.conf.man 3 | BUILT_SOURCES = $(dist_man1_MANS) $(dist_man5_MANS) 4 | CLEANFILES = $(dist_man1_MANS) $(dist_man5_MANS) 5 | EXTRA_DIST=turnserver.tmpl turnserver.conf.tmpl 6 | 7 | turnserver.man: turnserver.tmpl 8 | $(SED) -e 's#%DATE%#@PACKAGE_DATE@#' \ 9 | -e 's#%VERSION%#@PACKAGE_VERSION@#' \ 10 | -e 's#%etc%#@sysconfdir@#' $< > $@ 11 | 12 | turnserver.conf.man: turnserver.conf.tmpl 13 | $(SED) -e 's#%DATE%#@PACKAGE_DATE@#' \ 14 | -e 's#%VERSION%#@PACKAGE_VERSION@#' \ 15 | -e 's#%etc%#@sysconfdir@#' $< > $@ 16 | 17 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = -std=c99 -Wall -Wextra -Werror -Wstrict-prototypes -Wredundant-decls -Wshadow -pedantic -fno-strict-aliasing -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -O2 -D_SVID_SOURCE 2 | 3 | if ENABLE_DEBUG_BUILD 4 | AM_CFLAGS += -g 5 | else 6 | AM_CFLAGS += -DNDEBUG 7 | endif 8 | 9 | INCLUDE = -I. 10 | sbin_PROGRAMS = turnserver 11 | bin_PROGRAMS = test_turn_client test_echo_server 12 | noinst_HEADERS = turnserver.h \ 13 | turn.h \ 14 | protocol.h \ 15 | dbg.h \ 16 | util_sys.h \ 17 | util_crypto.h \ 18 | list.h \ 19 | tls_peer.h \ 20 | allocation.h \ 21 | account.h \ 22 | conf.h \ 23 | mod_tmpuser.h 24 | 25 | turnserver_SOURCES = turnserver.c \ 26 | protocol.c \ 27 | dbg.c \ 28 | util_sys.c \ 29 | util_crypto.c \ 30 | tls_peer.c \ 31 | allocation.c \ 32 | account.c \ 33 | conf.c \ 34 | mod_tmpuser.c 35 | 36 | test_turn_client_SOURCES = test_turn_client.c \ 37 | protocol.c \ 38 | util_crypto.c \ 39 | tls_peer.c \ 40 | util_sys.c 41 | 42 | test_echo_server_SOURCES = test_echo_server.c \ 43 | tls_peer.c 44 | 45 | valgrind-run: 46 | @echo 'Running with valgrind' 47 | valgrind --leak-check=full --show-reachable=yes $(top_builddir)/src/turnserver -c $(top_builddir)/extra/turnserver.conf 48 | 49 | -------------------------------------------------------------------------------- /test/Makefile.am: -------------------------------------------------------------------------------- 1 | TESTS = check_turn check_allocation check_account 2 | check_PROGRAMS = check_turn check_allocation check_account 3 | 4 | # TURN messages and attributes unit tests 5 | check_turn_SOURCES = check_turn.c \ 6 | $(top_builddir)/src/turn.h \ 7 | $(top_builddir)/src/protocol.c \ 8 | $(top_builddir)/src/protocol.h \ 9 | $(top_builddir)/src/util_sys.h \ 10 | $(top_builddir)/src/util_sys.c \ 11 | $(top_builddir)/src/util_crypto.h \ 12 | $(top_builddir)/src/util_crypto.c \ 13 | $(top_builddir)/src/tls_peer.h \ 14 | $(top_builddir)/src/tls_peer.c 15 | 16 | check_turn_CFLAGS = @CHECK_CFLAGS@ 17 | check_turn_LDADD = @CHECK_LIBS@ 18 | 19 | # allocation unit tests 20 | check_allocation_SOURCES = check_allocation.c \ 21 | $(top_builddir)/src/allocation.h \ 22 | $(top_builddir)/src/allocation.c 23 | check_allocation_CFLAGS = @CHECK_CFLAGS@ 24 | check_allocation_LDADD = @CHECK_LIBS@ 25 | 26 | # account unit tests 27 | check_account_SOURCES = check_account.c \ 28 | $(top_builddir)/src/account.h \ 29 | $(top_builddir)/src/account.c \ 30 | $(top_builddir)/src/protocol.h \ 31 | $(top_builddir)/src/protocol.c \ 32 | $(top_builddir)/src/util_sys.h \ 33 | $(top_builddir)/src/util_sys.c \ 34 | $(top_builddir)/src/util_crypto.h \ 35 | $(top_builddir)/src/util_crypto.c \ 36 | $(top_builddir)/src/tls_peer.h \ 37 | $(top_builddir)/src/tls_peer.c 38 | check_account_CFLAGS = @CHECK_CFLAGS@ 39 | check_account_LDADD = @CHECK_LIBS@ 40 | 41 | -------------------------------------------------------------------------------- /extra/turnserver.debian.initd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ### BEGIN INIT INFO 3 | # Provides: turnserver 4 | # Required-Start: 5 | # Required-Stop: 6 | # Default-Start: 2 3 4 5 7 | # Default-Stop: 0 1 6 8 | # Short-Description: Start turnserver at boot time 9 | # Description: Enable service provided by turnserver. 10 | ### END INIT INFO 11 | 12 | set -e 13 | 14 | DAEMON=/usr/local/sbin/turnserver 15 | NAME=turnserver 16 | CONFIG=/usr/local/etc/turnserver.conf 17 | 18 | test -x $DAEMON || exit 0 19 | 20 | . /lib/lsb/init-functions 21 | 22 | case "$1" in 23 | start) 24 | echo "Starting $NAME" 25 | [ -d /var/run/turnserver ] || mkdir -p /var/run/turnserver 26 | start-stop-daemon --start --background -m --pidfile /var/run/turnserver/turnserver.pid --exec $DAEMON -- -c $CONFIG 27 | echo "." 28 | ;; 29 | stop) 30 | echo "Stopping $NAME" 31 | start-stop-daemon --stop --pidfile /var/run/turnserver/turnserver.pid --oknodo --exec $DAEMON -- 32 | rm -f /var/run/turnserver/turnserver.pid 33 | echo "." 34 | ;; 35 | restart) 36 | echo "Restarting $NAME" 37 | start-stop-daemon --stop --pidfile /var/run/turnserver/turnserver.pid --oknodo --exec $DAEMON -- 38 | rm -f /var/run/turnserver/turnserver.pid 39 | sleep 2 40 | start-stop-daemon --start --background -m --pidfile /var/run/turnserver/turnserver.pid --exec $DAEMON -- -c $CONFIG 41 | echo "." 42 | ;; 43 | status) 44 | status_of_proc -p "$PIDFILE" "$DAEMON" turnserver && exit 0 || exit $? 45 | ;; 46 | *) 47 | echo "Usage: /etc/init.d/$NAME {start|stop|restart|status}" 48 | exit 1 49 | ;; 50 | esac 51 | 52 | exit 0 53 | 54 | -------------------------------------------------------------------------------- /extra/turnserver.spec: -------------------------------------------------------------------------------- 1 | %{!?name:%define name turnserver} 2 | %{!?version:%define version 0.5} 3 | %{!?release:%define release 2} 4 | 5 | Summary: The TURN server 6 | Name: turnserver 7 | Version: %{version} 8 | Release: %{release} 9 | License: GPLv3+ 10 | Group: Networking/Other 11 | URL: http://turnserver.sourceforge.net/ 12 | Source0: %{name}-%{version}.tar.gz 13 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root 14 | 15 | %description 16 | One good TURN deserves another! 17 | 18 | %prep 19 | %setup -q 20 | 21 | %build 22 | autoreconf -i 23 | ./configure --prefix=$RPM_BUILD_ROOT/usr --enable-fdsetsize=4096 24 | make 25 | 26 | %install 27 | rm -rf $RPM_BUILD_ROOT 28 | make install 29 | 30 | # init script 31 | mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d 32 | cp -p extra/turnserver.fedora.initd $RPM_BUILD_ROOT/etc/rc.d/init.d/turnserver 33 | 34 | # conf 35 | cp -p extra/turnserver.conf.template $RPM_BUILD_ROOT/etc/ 36 | 37 | %clean 38 | rm -rf $RPM_BUILD_ROOT 39 | 40 | %files 41 | %defattr(-,root,root,-) 42 | %_initddir 43 | %doc /usr/share/man/man1/turnserver.1.gz 44 | %doc /usr/share/man/man5/turnserver.conf.5.gz 45 | /etc/turnserver.conf.template 46 | /usr/bin/turnserver 47 | /usr/bin/test_echo_server 48 | /usr/bin/test_turn_client 49 | 50 | %preun 51 | # $1 is the number of instances of this package present _after_ the action. 52 | if [ $1 = 0 ]; then 53 | /sbin/service turnserver stop || : 54 | else 55 | /sbin/service turnserver condrestart || : 56 | fi 57 | 58 | %changelog 59 | * Thu Oct 27 2011 - 0.5-2 60 | - condrestart the service after an upgrade; stop it after an uninstall 61 | 62 | * Wed Oct 26 2011 - 0.5-1 63 | - First RPM version. 64 | -------------------------------------------------------------------------------- /man/turnserver.tmpl: -------------------------------------------------------------------------------- 1 | .TH turnserver 1 "May 16, 2011" "TurnServer" 2 | 3 | .SH NAME 4 | turnserver \- TURN server implementation 5 | 6 | .SH SYNOPSIS 7 | .B turnserver 8 | .RI [options] 9 | 10 | .SH DESCRIPTION 11 | TurnServer is an implementation of RFC5766 "Traversal Using Relays around 12 | NAT (TURN)". The TURN protocol allows a client to obtain IP addresses and ports 13 | from such a relay. It is most useful for elements behind symmetric NATs or 14 | firewalls that wish to be on the receiving end of a connection to a single peer. 15 | 16 | TURN clients can connect to TurnServer with the following protocols: UDP, TCP 17 | and TLS over TCP. Experimental DTLS support is also provided. Relaying data can 18 | be done with UDP or TCP protocol. 19 | 20 | TurnServer supports also RFC5389 (STUN Binding request), RFC6062 (relay data 21 | with TCP protocol) and RFC6156 (relay IPv6-IPv6, IPv4-IPv6 and IPv6-IPv4). 22 | 23 | .br 24 | .br 25 | 26 | .SH OPTIONS 27 | TurnServer accepts following options: 28 | .TP 29 | .B -c 30 | Read configuration from configuration_file. If not specified, default path 31 | (/etc/turnserver.conf) is used. 32 | 33 | .TP 34 | .B -h 35 | Show summary of options. 36 | 37 | .TP 38 | .B -v 39 | Show version information and exit. 40 | 41 | .SH FILES 42 | .I %etc%/turnserver.conf 43 | .RS 44 | TurnServer configuration see 45 | .BR turnserver.conf (5) 46 | for more details. 47 | .RE 48 | 49 | .SH AUTHOR 50 | Sebastien Vincent 51 | 52 | .SH "SEE ALSO" 53 | .BR turnserver.conf (5) 54 | .PP 55 | RFC5766: Traversal Using Relays around NAT (TURN): Relay Extensions to Session 56 | Traversal Utilities for NAT (STUN) 57 | .PP 58 | RFC5389: Session Traversal Utilities for NAT (STUN) 59 | .PP 60 | RFC6062: Traversal Using Relays around NAT (TURN) Extensions for TCP Allocations 61 | .PP 62 | RFC6156: Traversal Using Relays around NAT (TURN) Extension for IPv6 63 | .PP 64 | 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2012 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | Certain source files in this program permit linking with the OpenSSL 33 | library (http://www.openssl.org), which otherwise wouldn't be allowed 34 | under the GPL. For purposes of identifying OpenSSL, most source files 35 | giving this permission limit it to versions of OpenSSL having a license 36 | identical to that listed in this file (LICENSE.OpenSSL). It is not 37 | necessary for the copyright years to match between this file and the 38 | OpenSSL version in question. However, note that because this file is 39 | an extension of the license statements of these source files, this file 40 | may not be changed except with permission from all copyright holders 41 | of source files in this program which reference this file. 42 | 43 | -------------------------------------------------------------------------------- /src/turnserver.conf: -------------------------------------------------------------------------------- 1 | ## 2 | # TurnServer configuration file. 3 | # 4 | 5 | ## Public IPv4 address of any relayed address (if not set, no relay for IPv4). 6 | ## To have multiple address, separate addresses with a comma 7 | ## (i.e. listen_address = { "172.16.0.1", "172.17.0.1" }). 8 | listen_address = { "192.168.1.115" } 9 | 10 | ## Public IPv6 address of any relayed address (if not set, no relay for IPv6). 11 | ## To have multiple address, separate address with a comma 12 | ## (i.e. listen_addressv6 = { "2001:db8:1::1", "2001:db8:2::1" }). 13 | #listen_addressv6 = { "2001:db8::1" } 14 | 15 | ## UDP listening port. 16 | udp_port = 3478 17 | 18 | ## TCP listening port. 19 | tcp_port = 3478 20 | 21 | ## TLS listening port. 22 | tls_port = 5349 23 | 24 | ## TLS support. 25 | tls = false 26 | 27 | ## DTLS support. It is an experimental feature and is not defined in TURN 28 | ## standard. 29 | dtls = false 30 | 31 | ## Maximum allocation port number. 32 | max_port = 65535 33 | 34 | ## Minimum allocation port number. 35 | min_port = 49152 36 | 37 | ## TURN-TCP support. 38 | turn_tcp = false 39 | 40 | ## TURN-TCP buffering mode: 41 | ## - true, use userspace buffering; 42 | ## - false, use kernel buffering. 43 | tcp_buffer_userspace = true 44 | 45 | ## TURN-TCP maximum buffer size. 46 | tcp_buffer_size = 32768 47 | 48 | ## Daemon mode. 49 | daemon = false 50 | 51 | ## Unprivileged user. 52 | ## If you want to use this feature create a system user. 53 | ## On Linux: adduser --system --group turnserver 54 | #unpriv_user = turnserver 55 | 56 | ## Realm value. 57 | realm = "domain.org" 58 | 59 | ## Nonce key. 60 | nonce_key = "hieKedq" 61 | 62 | ## Max relay per username. 63 | max_relay_per_username = 5 64 | 65 | ## Allocation lifetime. 66 | allocation_lifetime = 1800 67 | 68 | ## Allocation bandwidth limitation (in KBytes/s). 69 | ## 0 value means bandwidth quota disabled. 70 | bandwidth_per_allocation = 150 71 | 72 | ## Restricted user bandwidth (in KBytes/s). 73 | ## 0 value means bandwidth limitation disabled. 74 | restricted_bandwidth = 10 75 | 76 | ## Denied addresses. 77 | 78 | # disallow relaying to localhost 79 | denied_address { 80 | address = "127.0.0.1" 81 | mask = "8" 82 | port = 0 83 | } 84 | 85 | # disallow relaying to ip6-localhost 86 | denied_address { 87 | address = "::1" 88 | mask = "128" 89 | port = 0 90 | } 91 | 92 | #denied_address { 93 | # address = "10.1.4.0" 94 | # mask = 24 95 | # port = 0 96 | #} 97 | 98 | ## Certification Authority file. 99 | ca_file = "./ca.crt" 100 | 101 | ## Server certificate file. 102 | cert_file = "./server.crt" 103 | 104 | ## Private key file. 105 | private_key_file = "./server.key" 106 | 107 | ## Account method. 108 | account_method = "file" 109 | 110 | ## Account file (if account_method = file). 111 | account_file = "./turnusers.txt" 112 | 113 | ## mod_tmpuser. 114 | mod_tmpuser = false 115 | 116 | -------------------------------------------------------------------------------- /extra/turnserver.conf.template: -------------------------------------------------------------------------------- 1 | ## 2 | # TurnServer configuration file. 3 | # 4 | 5 | ## Public IPv4 address of any relayed address (if not set, no relay for IPv4). 6 | ## To have multiple address, separate addresses with a comma 7 | ## (i.e. listen_address = { "172.16.0.1", "172.17.0.1" }). 8 | listen_address = { "192.168.0.1" } 9 | 10 | ## Public IPv6 address of any relayed address (if not set, no relay for IPv6). 11 | ## To have multiple address, separate address with a comma 12 | ## (i.e. listen_addressv6 = { "2001:db8:1::1", "2001:db8:2::1" }). 13 | #listen_addressv6 = { "2001:db8::1" } 14 | 15 | ## UDP listening port. 16 | udp_port = 3478 17 | 18 | ## TCP listening port. 19 | tcp_port = 3478 20 | 21 | ## TLS listening port. 22 | tls_port = 5349 23 | 24 | ## TLS support. 25 | tls = false 26 | 27 | ## DTLS support. It is an experimental feature and is not defined in TURN 28 | ## standard. 29 | dtls = false 30 | 31 | ## Maximum allocation port number. 32 | max_port = 65535 33 | 34 | ## Minimum allocation port number. 35 | min_port = 49152 36 | 37 | ## TURN-TCP support. 38 | turn_tcp = false 39 | 40 | ## TURN-TCP buffering mode: 41 | ## - true, use userspace buffering; 42 | ## - false, use kernel buffering. 43 | tcp_buffer_userspace = true 44 | 45 | ## TURN-TCP maximum buffer size. 46 | tcp_buffer_size = 32768 47 | 48 | ## Daemon mode. 49 | daemon = false 50 | 51 | ## Unprivileged user. 52 | ## If you want to use this feature create a system user. 53 | ## On Linux: adduser --system --group turnserver 54 | #unpriv_user = turnserver 55 | 56 | ## Realm value. 57 | realm = "domain.org" 58 | 59 | ## Nonce key. 60 | nonce_key = "hieKedq" 61 | 62 | ## Max relay per username. 63 | max_relay_per_username = 5 64 | 65 | ## Allocation lifetime. 66 | allocation_lifetime = 1800 67 | 68 | ## Allocation bandwidth limitation (in KBytes/s). 69 | ## 0 value means bandwidth quota disabled. 70 | bandwidth_per_allocation = 150 71 | 72 | ## Restricted user bandwidth (in KBytes/s). 73 | ## 0 value means bandwidth limitation disabled. 74 | restricted_bandwidth = 10 75 | 76 | ## Denied addresses. 77 | 78 | # disallow relaying to localhost 79 | denied_address { 80 | address = "127.0.0.1" 81 | mask = "8" 82 | port = 0 83 | } 84 | 85 | # disallow relaying to ip6-localhost 86 | denied_address { 87 | address = "::1" 88 | mask = "128" 89 | port = 0 90 | } 91 | 92 | #denied_address { 93 | # address = "10.1.4.0" 94 | # mask = 24 95 | # port = 0 96 | #} 97 | 98 | ## Certification Authority file. 99 | ca_file = "./ca.crt" 100 | 101 | ## Server certificate file. 102 | cert_file = "./server.crt" 103 | 104 | ## Private key file. 105 | private_key_file = "./server.key" 106 | 107 | ## Account method. 108 | account_method = "file" 109 | 110 | ## Account file (if account_method = file). 111 | account_file = "/usr/local/etc/turnusers.txt" 112 | 113 | ## mod_tmpuser. 114 | mod_tmpuser = false 115 | 116 | -------------------------------------------------------------------------------- /src/.deps/dbg.Po: -------------------------------------------------------------------------------- 1 | dbg.o: dbg.c ../config.h /usr/include/stdio.h /usr/include/features.h \ 2 | /usr/include/x86_64-linux-gnu/bits/predefs.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/types.h \ 9 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ 10 | /usr/include/_G_config.h /usr/include/wchar.h \ 11 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ 12 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 13 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ 14 | /usr/include/x86_64-linux-gnu/bits/stdio.h /usr/include/stdlib.h \ 15 | /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 16 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 17 | /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ 18 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ 19 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ 20 | /usr/include/x86_64-linux-gnu/bits/wchar.h \ 21 | /usr/include/x86_64-linux-gnu/sys/time.h \ 22 | /usr/include/x86_64-linux-gnu/bits/time.h \ 23 | /usr/include/x86_64-linux-gnu/sys/select.h \ 24 | /usr/include/x86_64-linux-gnu/bits/select.h \ 25 | /usr/include/x86_64-linux-gnu/bits/sigset.h dbg.h 26 | 27 | ../config.h: 28 | 29 | /usr/include/stdio.h: 30 | 31 | /usr/include/features.h: 32 | 33 | /usr/include/x86_64-linux-gnu/bits/predefs.h: 34 | 35 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 36 | 37 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 38 | 39 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 40 | 41 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 42 | 43 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: 44 | 45 | /usr/include/x86_64-linux-gnu/bits/types.h: 46 | 47 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 48 | 49 | /usr/include/libio.h: 50 | 51 | /usr/include/_G_config.h: 52 | 53 | /usr/include/wchar.h: 54 | 55 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: 56 | 57 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h: 58 | 59 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h: 60 | 61 | /usr/include/x86_64-linux-gnu/bits/stdio.h: 62 | 63 | /usr/include/stdlib.h: 64 | 65 | /usr/include/x86_64-linux-gnu/bits/waitflags.h: 66 | 67 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h: 68 | 69 | /usr/include/x86_64-linux-gnu/sys/types.h: 70 | 71 | /usr/include/time.h: 72 | 73 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: 74 | 75 | /usr/include/alloca.h: 76 | 77 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: 78 | 79 | /usr/include/stdint.h: 80 | 81 | /usr/include/x86_64-linux-gnu/bits/wchar.h: 82 | 83 | /usr/include/x86_64-linux-gnu/sys/time.h: 84 | 85 | /usr/include/x86_64-linux-gnu/bits/time.h: 86 | 87 | /usr/include/x86_64-linux-gnu/sys/select.h: 88 | 89 | /usr/include/x86_64-linux-gnu/bits/select.h: 90 | 91 | /usr/include/x86_64-linux-gnu/bits/sigset.h: 92 | 93 | dbg.h: 94 | -------------------------------------------------------------------------------- /doc/doxygen-main.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file doxygen-main.h 3 | * \brief Documentation main page. 4 | * \author Sebastien Vincent 5 | * \date 2008-2010 6 | */ 7 | 8 | /** 9 | * \mainpage TurnServer Documentation 10 | * 11 | * \section section-intro Introduction 12 | * 13 | * This is the API documentation of TurnServer, an open-source implementation of 14 | * RFC5766 "Traversal Using Relay NAT (TURN)". 15 | * 16 | * The TURN protocol allows a client to obtain IP addresses and ports from such 17 | * a relay. It is most useful for elements behind symmetric NATs or firewalls 18 | * that wish to be on the receiving end of a connection to a single peer. 19 | * 20 | * TURN clients can connect to TurnServer with the following protocols: UDP, TCP 21 | * and TLS over TCP. Experimental DTLS support is also provided. Relaying data 22 | * can be done with UDP or TCP protocol. 23 | * 24 | * TurnServer supports also RFC5389 (STUN Binding request), RFC6062 (relay data 25 | * with TCP protocol) and RFC6156 (relay IPv6-IPv6, IPv4-IPv6 and IPv6-IPv4). 26 | * 27 | * \section section-modules Modules 28 | * 29 | * The API is decomposed in several modules: 30 | * - STUN/TURN headers and attributes (turn.h); 31 | * - Header/attribute generation (protocol.c, protocol.h); 32 | * - Allocation management (allocation.c, allocation.h); 33 | * - Account management (account.c, account.h); 34 | * - Server configuration parsing (conf.c, conf.h); 35 | * - Asynchronous Transport Layer Security (TLS) (tls_peer.c, tls_peer.h); 36 | * - Some utils functions (dbg.c, dbg.h, util_sys.c, util_sys.h, util_crypto.c, 37 | * util_crypto.h, list.h). 38 | * 39 | * There are basics unit tests in test directory of source tree. Note that you 40 | * have to install check framework 41 | * in order to use it. 42 | * 43 | * We provide also a "test" client application (test_turn_client) that can 44 | * generate a suite of TURN packets (Allocate request, wait for an answer, 45 | * Refresh requests, ...) using the modules above. It can connect to TURN server 46 | * with UDP, TCP, TLS over TCP or DTLS. 47 | * 48 | * Note that TurnServer uses OpenSSL 49 | * (for cryptographics and TLS stuff) and 50 | * Confuse (for parsing 51 | * configuration file), so you need to have these libraries on your system. 52 | * 53 | * \section section-standard Standards 54 | * 55 | * TurnServer is written in C language which respects the following standards: 56 | * - ISO/IEC 9899 (C99); 57 | * - IEEE 1003.1 (POSIX). 58 | * 59 | * It also uses some realtime capabilities of POSIX.1b. Thus systems have to 60 | * support these standards and capabilities to compile and use TurnServer. 61 | * 62 | * TurnServer is known to run on the following systems: 63 | * - GNU/Linux 2.6; 64 | * - FreeBSD 7.x, 8. 65 | * 66 | * \section section-license License 67 | * 68 | * TurnServer is licensed under the 69 | * GPL version 3 (with an 70 | * exception for OpenSSL). 71 | * 72 | */ 73 | 74 | -------------------------------------------------------------------------------- /doc/coding_style.txt: -------------------------------------------------------------------------------- 1 | TurnServer coding style 2 | ======================== 3 | 4 | I) Code layout 5 | --------------- 6 | 7 | The code has to follow ANSI coding standard layout. Use 2 space indentation instead 8 | of tabs. 9 | 10 | void foo(int barc, char** barv) 11 | { 12 | unsigned int test = 0; 13 | size_t i = 0; 14 | int run = 0; 15 | 16 | if(test) 17 | { 18 | /* do something */ 19 | } 20 | else 21 | { 22 | /* do other thing */ 23 | } 24 | 25 | while(run) 26 | { 27 | /* do loop */ 28 | } 29 | 30 | for(i = 0 ; i < 2 ; i++) 31 | { 32 | /* do other loop */ 33 | } 34 | 35 | do 36 | { 37 | /* do another loop */ 38 | }while(run); 39 | } 40 | 41 | It is recommended to use only the C-style comments: 42 | 43 | /* my short comment */ 44 | 45 | /* a longer comment 46 | * on multiple lines 47 | * ... 48 | */ 49 | 50 | II) Code organization 51 | ---------------------- 52 | 53 | The code has to follow these recommendations: 54 | - 80 columns line limit; 55 | - Always initialize your variables; 56 | - Put "static" keyword if functions / global variables are not used outside C file (not in header file); 57 | - Try to avoid static variables in functions (try to make reentrant things); 58 | - Prefer using size_t/ssize_t instead of int/unsigned int when possible; 59 | - Use "const" keyword for pointers if they should not been modified in function; 60 | - Put a space before and after operator +/-* i.e. a + b - (c * 5) / 3); 61 | - Put an empty line at the end of each file. 62 | Naming has to follow these recommendations: 63 | - File name has to be in lower case, words are separated by "_"; 64 | - Structure and function name has to be in lower case, words are separated by a "_" character (my_structure, my_function); 65 | - Each global variable must be prefixed with "g_" (g_run). 66 | 67 | Each file, function, structure and global variable MUST be documented using doxygen. 68 | Here is a complete example: 69 | 70 | /** 71 | * \file my_file.h 72 | * \brief Short description. 73 | * \author Name 74 | * \date 2008 75 | */ 76 | 77 | #ifndef MY_FILE_H 78 | #define MY_FILE_H 79 | 80 | /** 81 | * \def PROGRAM_NAME 82 | * \brief The program name. 83 | */ 84 | #define PROGRAM_NAME "MyProgram" 85 | 86 | /** 87 | * \struct my_struct 88 | * \brief Short description. 89 | */ 90 | struct my_struct 91 | { 92 | int a; /**< Description of a */ 93 | char b; /**< Description of b */ 94 | }; 95 | 96 | /** 97 | * \var g_my_var 98 | * \brief Description of this global variable. 99 | */ 100 | struct my_struct* g_my_var = NULL; 101 | 102 | /** 103 | * \brief Doing something. 104 | * \param a number to use 105 | * \param b char to use 106 | * \return 0 if success, -1 otherwise 107 | */ 108 | int foo(int a, char b); 109 | 110 | #endif /* MY_FILE_H */ 111 | 112 | III) Standards 113 | --------------- 114 | 115 | In order to compile and run on many operating systems the code has to be portable. Thus 116 | it is strongly recommended to write code which respects C99 and POSIX standards. 117 | 118 | -------------------------------------------------------------------------------- /src/mod_tmpuser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2010 BlueJimp 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /** 33 | * \file mod_tmpuser.h 34 | * \brief Module that can add/delete temporary user. 35 | * 36 | * It consists of a socket that will listen for incoming messages and process 37 | * them. Message format is as follow: 38 | * - To create a user, create user:password:domain 39 | * - To delete a user, delete user 40 | * 41 | * \author Sebastien Vincent 42 | * \date 2011 43 | */ 44 | 45 | #ifndef MOD_TMPUSER_H 46 | #define MOD_TMPUSER_H 47 | 48 | #include "account.h" 49 | 50 | struct socket_desc; 51 | 52 | /** 53 | * \brief Initialize the module. 54 | * \param account_list list of account. 55 | * \return 0 if success, -1 otherwise 56 | */ 57 | int tmpuser_init(struct list_head* account_list); 58 | 59 | /** 60 | * \brief Get the listen socket. 61 | * \return listen socket descriptor 62 | */ 63 | int tmpuser_get_socket(void); 64 | 65 | /** 66 | * \brief Get the TCP client list. 67 | * \return TCP client list 68 | */ 69 | struct list_head* tmpuser_get_tcp_clients(void); 70 | 71 | /** 72 | * \brief Add the specified socket descriptor. 73 | * \param desc socket descriptor to add 74 | */ 75 | void tmpuser_add_tcp_client(struct socket_desc* desc); 76 | 77 | /** 78 | * \brief Remove the specified socket descriptor. 79 | * \param desc socket descriptor to remove 80 | */ 81 | void tmpuser_remove_tcp_client(struct socket_desc* desc); 82 | 83 | /** 84 | * \brief Process a message coming from the network. 85 | * \param buf buffer message 86 | * \param len length of buffer message 87 | * \return 0 if processing is successful, -1 otherwise 88 | */ 89 | int tmpuser_process_msg(const char* buf, ssize_t len); 90 | 91 | /** 92 | * \brief Destroy any extra data/memory used by this module. 93 | */ 94 | void tmpuser_destroy(void); 95 | 96 | #endif /* MOD_TMPUSER_H */ 97 | 98 | -------------------------------------------------------------------------------- /src/turnserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2009 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /** 33 | * \file turnserver.h 34 | * \brief Some structures and pre-processor definitions related to TurnServer. 35 | * \author Sebastien Vincent 36 | * \date 2008-2009 37 | */ 38 | 39 | #ifndef TURNSERVER_H 40 | #define TURNSERVER_H 41 | 42 | #include 43 | #include 44 | #include 45 | 46 | #include "list.h" 47 | 48 | #ifndef _POSIX_REALTIME_SIGNALS 49 | #error "POSIX realtime signals not supported!" 50 | #endif 51 | 52 | /** 53 | * \def SIGRT_EXPIRE_ALLOCATION 54 | * \brief Signal value when an allocation expires. 55 | */ 56 | #define SIGRT_EXPIRE_ALLOCATION (SIGRTMIN) 57 | 58 | /** 59 | * \def SIGRT_EXPIRE_PERMISSION 60 | * \brief Signal value when a permission expires. 61 | */ 62 | #define SIGRT_EXPIRE_PERMISSION (SIGRTMIN + 1) 63 | 64 | /** 65 | * \def SIGRT_EXPIRE_CHANNEL 66 | * \brief Signal value when channel expires. 67 | */ 68 | #define SIGRT_EXPIRE_CHANNEL (SIGRTMIN + 2) 69 | 70 | /** 71 | * \def SIGRT_EXPIRE_TOKEN 72 | * \brief Signal value when token expires. 73 | */ 74 | #define SIGRT_EXPIRE_TOKEN (SIGRTMIN + 3) 75 | 76 | /** 77 | * \def SIGRT_EXPIRE_TCP_RELAY 78 | * \brief Signal value when TCP relay expires (no ConnectionBind received). 79 | */ 80 | #define SIGRT_EXPIRE_TCP_RELAY (SIGRTMIN + 4) 81 | 82 | /** 83 | * \struct denied_address 84 | * \brief Describes an address. 85 | */ 86 | struct denied_address 87 | { 88 | int family; /**< AF family (AF_INET or AF_INET6) */ 89 | uint8_t addr[16]; /**< IPv4 or IPv6 address */ 90 | uint8_t mask; /**< Network mask of the address */ 91 | uint16_t port; /**< Port */ 92 | struct list_head list; /**< For list management */ 93 | }; 94 | 95 | /** 96 | * \struct socket_desc 97 | * \brief Descriptor for TCP client connected. 98 | * 99 | * It contains a buffer for TCP segment reconstruction. 100 | */ 101 | struct socket_desc 102 | { 103 | int sock; /**< Socket descriptor */ 104 | char buf[1500]; /**< Internal buffer for TCP stream reconstruction */ 105 | size_t buf_pos; /**< Position in the internal buffer */ 106 | size_t msg_len; /**< Message length that is not complete */ 107 | int tls; /**< If socket uses TLS */ 108 | struct list_head list; /**< For list management */ 109 | }; 110 | 111 | #endif /* TURNSERVER_H */ 112 | 113 | -------------------------------------------------------------------------------- /configure.in: -------------------------------------------------------------------------------- 1 | # -*- Autoconf -*- 2 | # Process this file with autoconf to produce a configure script. 3 | 4 | AC_PREREQ(2.61) 5 | AC_INIT([turnserver],[0.7.3],[http://www.turnserver.org/]) 6 | AC_CONFIG_SRCDIR([src/turn.h]) 7 | AC_CONFIG_HEADER([config.h]) 8 | 9 | # Unit tests with Check framework 10 | PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],,[AC_MSG_RESULT([testing is disabled])]) 11 | 12 | # Checks for programs. 13 | AC_PROG_CC 14 | AM_PROG_CC_C_O 15 | AC_CHECK_PROG(SED, sed, sed) 16 | 17 | # Checks for libraries. 18 | AC_CHECK_LIB(rt, timer_create,,[echo -e "\tPlease install librt";exit]) 19 | AC_CHECK_LIB(ssl, SSL_new,,[echo -e "\tPlease install libssl-dev";exit]) 20 | AC_CHECK_LIB(crypto, ERR_reason_error_string,,[echo -e "\tPlease install libssl-dev";exit]) 21 | AC_CHECK_LIB(confuse, cfg_init,,[echo -e "\tPlease install libconfuse-dev (version >= 2.6)";exit]) 22 | 23 | # Checks for header files. 24 | AC_HEADER_STDC 25 | AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h]) 26 | 27 | # Checks for typedefs, structures, and compiler characteristics. 28 | AC_C_CONST 29 | AC_TYPE_UID_T 30 | AC_C_INLINE 31 | AC_TYPE_INT16_T 32 | AC_TYPE_INT32_T 33 | AC_TYPE_INT64_T 34 | AC_TYPE_INT8_T 35 | AC_TYPE_MODE_T 36 | AC_TYPE_PID_T 37 | AC_TYPE_SIZE_T 38 | AC_TYPE_SSIZE_T 39 | AC_HEADER_TIME 40 | AC_STRUCT_TM 41 | AC_TYPE_UINT16_T 42 | AC_TYPE_UINT32_T 43 | AC_TYPE_UINT64_T 44 | AC_TYPE_UINT8_T 45 | AC_C_VOLATILE 46 | 47 | # Doxygen 48 | DX_HTML_FEATURE(ON) 49 | DX_CHM_FEATURE(OFF) 50 | DX_CHI_FEATURE(OFF) 51 | DX_MAN_FEATURE(ON) 52 | DX_RTF_FEATURE(OFF) 53 | DX_XML_FEATURE(OFF) 54 | DX_PDF_FEATURE(OFF) 55 | DX_PS_FEATURE(OFF) 56 | DX_INIT_DOXYGEN(turnserver, Doxyfile) 57 | 58 | AM_INIT_AUTOMAKE(turnserver, $PACKAGE_VERSION) 59 | 60 | # Checks for library functions. 61 | AC_FUNC_FORK 62 | AC_FUNC_MALLOC 63 | AC_FUNC_MEMCMP 64 | AC_FUNC_SELECT_ARGTYPES 65 | AC_TYPE_SIGNAL 66 | AC_FUNC_STRERROR_R 67 | AC_FUNC_VPRINTF 68 | AC_CHECK_FUNCS([dup2 gettimeofday memset select pselect socket strchr strdup strerror sigaction signal]) 69 | 70 | # Enable compilation in debug mode. 71 | AC_ARG_ENABLE(debug-build, [ --enable-debug-build allow to compile with debug informations [default=no]], enable_debug_build=$enableval, enable_debug_build=no) 72 | if test "$enable_debug_build" = "yes"; then 73 | AC_DEFINE([DEBUG_BUILD], [1], [Enable debug build]) 74 | fi 75 | AM_CONDITIONAL(ENABLE_DEBUG_BUILD, test "$enable_debug_build" = "yes") 76 | 77 | # Enable setting FD_SETSIZE. 78 | AC_ARG_ENABLE(fdsetsize, [ --enable-fdsetsize allow to preconfigure FD_SETSIZE macro (must be a number >=32) [default=no]], enable_fdsetsize=$enableval, enable_fdsetsize=0) 79 | if test "$enable_fdsetsize" -ge "32"; then 80 | AC_DEFINE_UNQUOTED([SFD_SETSIZE], $enable_fdsetsize, [Enable user-defined FD_SETSIZE]) 81 | else 82 | enable_fdsetsize="no" 83 | fi 84 | 85 | # Enable setting XOR_PEER_ADDRESS_MAX. 86 | AC_ARG_ENABLE(xor_peer_address_max, [ --enable-xor-peer-address-max allow to preconfigure XOR_PEER_ADDRESS_MAX macro (must be a number > 0) [default=5]], enable_xor_peer_address_max=$enableval, enable_xor_peer_address_max=5) 87 | if test "$enable_xor_peer_address_max" -ge "1"; then 88 | AC_DEFINE_UNQUOTED([XOR_PEER_ADDRESS_MAX], $enable_xor_peer_address_max, [Enable user-defined XOR_PEER_ADDRESS_MAX]) 89 | else 90 | enable_xor_peer_address_max=5 91 | fi 92 | 93 | AC_CONFIG_FILES([Makefile 94 | Doxyfile 95 | src/Makefile 96 | man/Makefile 97 | doc/Makefile 98 | extra/Makefile 99 | test/Makefile]) 100 | AC_OUTPUT 101 | 102 | AC_MSG_NOTICE([Configuration 103 | 104 | AC_PACKAGE_NAME version AC_PACKAGE_VERSION 105 | Enable debug build: .............. $enable_debug_build 106 | User-defined FD_SETSIZE: ......... $enable_fdsetsize 107 | User-defined XOR_PEER_ADDRESS_MAX: $enable_xor_peer_address_max 108 | ]) 109 | 110 | -------------------------------------------------------------------------------- /test-driver: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # test-driver - basic testsuite driver script. 3 | 4 | scriptversion=2012-06-27.10; # UTC 5 | 6 | # Copyright (C) 2011-2013 Free Software Foundation, Inc. 7 | # 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2, or (at your option) 11 | # any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program. If not, see . 20 | 21 | # As a special exception to the GNU General Public License, if you 22 | # distribute this file as part of a program that contains a 23 | # configuration script generated by Autoconf, you may include it under 24 | # the same distribution terms that you use for the rest of that program. 25 | 26 | # This file is maintained in Automake, please report 27 | # bugs to or send patches to 28 | # . 29 | 30 | # Make unconditional expansion of undefined variables an error. This 31 | # helps a lot in preventing typo-related bugs. 32 | set -u 33 | 34 | usage_error () 35 | { 36 | echo "$0: $*" >&2 37 | print_usage >&2 38 | exit 2 39 | } 40 | 41 | print_usage () 42 | { 43 | cat <$log_file 2>&1 96 | estatus=$? 97 | if test $enable_hard_errors = no && test $estatus -eq 99; then 98 | estatus=1 99 | fi 100 | 101 | case $estatus:$expect_failure in 102 | 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 103 | 0:*) col=$grn res=PASS recheck=no gcopy=no;; 104 | 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 105 | 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; 106 | *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; 107 | *:*) col=$red res=FAIL recheck=yes gcopy=yes;; 108 | esac 109 | 110 | # Report outcome to console. 111 | echo "${col}${res}${std}: $test_name" 112 | 113 | # Register the test result, and other relevant metadata. 114 | echo ":test-result: $res" > $trs_file 115 | echo ":global-test-result: $res" >> $trs_file 116 | echo ":recheck: $recheck" >> $trs_file 117 | echo ":copy-in-global-log: $gcopy" >> $trs_file 118 | 119 | # Local Variables: 120 | # mode: shell-script 121 | # sh-indentation: 2 122 | # eval: (add-hook 'write-file-hooks 'time-stamp) 123 | # time-stamp-start: "scriptversion=" 124 | # time-stamp-format: "%:y-%02m-%02d.%02H" 125 | # time-stamp-time-zone: "UTC" 126 | # time-stamp-end: "; # UTC" 127 | # End: 128 | -------------------------------------------------------------------------------- /extra/turnserver.fedora.initd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # turnserver Starts the turnserver daemon 4 | # 5 | # chkconfig: 345 84 16 6 | # description: TURN server 7 | 8 | # The template for this file was taken from 9 | # http://fedoraproject.org/wiki/Packaging:SysVInitScript#Fedora_SysV_Initscripts 10 | # 11 | # See also a description of the exit codes at 12 | # http://fedoraproject.org/wiki/Packaging:SysVInitScript#Exit_Codes_for_the_Status_Action 13 | 14 | # Source function library. 15 | . /etc/rc.d/init.d/functions 16 | 17 | exec="/usr/bin/turnserver" 18 | prog="turnserver" 19 | config="/etc/turnserver.conf" 20 | 21 | # If running multiple instances, use port number suffix on config and pid files. 22 | [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog 23 | if [ -n "$PORTS" ]; then 24 | files_use_portnum=yes 25 | else 26 | PORTS=3478 27 | files_use_portnum= 28 | fi 29 | 30 | lockfile=/var/lock/subsys/$prog 31 | 32 | # Note the LSB exit codes for the status action: 33 | # 0=running, 1=dead but pid file exists, 3=stopped 34 | rh_status() { 35 | status "$@" 36 | } 37 | 38 | # quiet version 39 | rh_status_q() { 40 | rh_status "$@" >/dev/null 2>&1 41 | } 42 | 43 | start_instance() 44 | { 45 | local port=$1; shift 46 | 47 | # raise open file limit 48 | ulimit -n 16384 49 | 50 | # start it up (if not running) 51 | echo -n "Starting $instname: " 52 | status=$(rh_status -p $pidfile $prog) 53 | local rc=$? 54 | [ $rc -ne 3 ] && echo "$status" 55 | if [ ! -f $config ]; then 56 | echo "Config file not found: $config" 57 | rc=6 58 | elif [ $rc -ne 0 ]; then 59 | $exec -c $config -p $pidfile 60 | [ $? -eq 0 ] && rc=0 || rc=1 61 | fi 62 | [ $rc -eq 0 ] && success || failure 63 | echo 64 | return $rc 65 | } 66 | 67 | stop_instance() 68 | { 69 | local port=$1; shift 70 | 71 | # stop it (if running) 72 | echo -n "Stopping $instname: " 73 | status=$(rh_status -p $pidfile $prog) 74 | local rc=$? 75 | if [ $rc -ne 0 ]; then 76 | echo "$status" 77 | rc=0 78 | else 79 | delay=3 80 | killproc -p $pidfile -d $delay $prog 81 | rc=$? 82 | fi 83 | [ $rc -eq 0 ] && success || failure 84 | echo 85 | return $rc 86 | } 87 | 88 | status_instance() 89 | { 90 | local port=$1; shift 91 | 92 | # use $instname not $prog here to make for a more readable status message 93 | rh_status -p $pidfile $instname 94 | local rc=$? 95 | return $rc 96 | } 97 | 98 | reload_instance() 99 | { 100 | local port=$1; shift 101 | 102 | echo -n "Reloading $instname: " 103 | status=$(rh_status -p $pidfile $prog) 104 | local rc=$? 105 | if [ $rc -ne 0 ]; then 106 | echo "$status" 107 | rc=7 108 | else 109 | local pid 110 | pid=$(cat $pidfile) 111 | kill -HUP $pid 112 | [ $? -eq 0 ] && rc=0 || rc=1 113 | fi 114 | [ $rc -eq 0 ] && success || failure 115 | echo 116 | return $rc 117 | } 118 | 119 | foreach_instance() 120 | { 121 | local func=$1; shift 122 | 123 | local rc=0 instance_rc=0 124 | for port in $PORTS; do 125 | [ -n "$files_use_portnum" ] && portsuffix=$port || portsuffix= 126 | pidfile=/var/run/$prog$portsuffix.pid 127 | config=/etc/$prog$portsuffix.conf 128 | instname=$prog$portsuffix 129 | $func $port 130 | instance_rc=$? 131 | [ $instance_rc -gt $rc ] && rc=$instance_rc 132 | done 133 | 134 | return $rc 135 | } 136 | 137 | start() 138 | { 139 | foreach_instance start_instance 140 | retval=$? 141 | [ $retval -eq 0 ] && touch $lockfile 142 | } 143 | 144 | stop() 145 | { 146 | foreach_instance stop_instance 147 | retval=$? 148 | #[ $retval -eq 0 ] && 149 | rm -f $lockfile 150 | } 151 | 152 | restart() 153 | { 154 | stop 155 | start 156 | } 157 | 158 | ### main 159 | 160 | # parse command line 161 | while getopts "i:" option; do 162 | case "$option" in 163 | i) PORTS="$OPTARG";; 164 | *) exit 1;; 165 | esac 166 | done 167 | shift $((OPTIND-1)) 168 | case $# in 169 | 1) ;; 170 | *) echo "Usage: $0 [-i port] action"; exit 1;; 171 | esac 172 | 173 | # perform action 174 | retval=0 175 | case "$1" in 176 | start) 177 | start 178 | ;; 179 | stop) 180 | stop 181 | ;; 182 | restart|force-reload) 183 | restart 184 | ;; 185 | reload) 186 | foreach_instance reload_instance 187 | ;; 188 | status) 189 | foreach_instance status_instance 190 | ;; 191 | condrestart|try-restart) 192 | [ -f $lockfile ] || exit 0 193 | restart 194 | ;; 195 | *) 196 | echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" 197 | exit 2 198 | esac 199 | exit $? 200 | -------------------------------------------------------------------------------- /src/.deps/util_sys.Po: -------------------------------------------------------------------------------- 1 | util_sys.o: util_sys.c ../config.h /usr/include/stdlib.h \ 2 | /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 9 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 10 | /usr/include/x86_64-linux-gnu/sys/types.h \ 11 | /usr/include/x86_64-linux-gnu/bits/types.h \ 12 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ 13 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ 14 | /usr/include/fcntl.h /usr/include/x86_64-linux-gnu/bits/fcntl.h \ 15 | /usr/include/x86_64-linux-gnu/bits/stat.h \ 16 | /usr/include/x86_64-linux-gnu/sys/stat.h /usr/include/unistd.h \ 17 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ 18 | /usr/include/x86_64-linux-gnu/bits/environments.h \ 19 | /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ 20 | /usr/include/x86_64-linux-gnu/sys/select.h \ 21 | /usr/include/x86_64-linux-gnu/bits/select.h \ 22 | /usr/include/x86_64-linux-gnu/bits/sigset.h \ 23 | /usr/include/x86_64-linux-gnu/bits/time.h \ 24 | /usr/include/x86_64-linux-gnu/sys/time.h \ 25 | /usr/include/x86_64-linux-gnu/sys/resource.h \ 26 | /usr/include/x86_64-linux-gnu/bits/resource.h /usr/include/pwd.h \ 27 | /usr/include/stdio.h util_sys.h /usr/include/libio.h \ 28 | /usr/include/_G_config.h /usr/include/wchar.h \ 29 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ 30 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 31 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ 32 | /usr/include/x86_64-linux-gnu/bits/stdio.h /usr/include/string.h \ 33 | /usr/include/x86_64-linux-gnu/bits/string.h \ 34 | /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ 35 | /usr/include/x86_64-linux-gnu/bits/endian.h \ 36 | /usr/include/x86_64-linux-gnu/sys/uio.h \ 37 | /usr/include/x86_64-linux-gnu/bits/uio.h \ 38 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ 39 | /usr/include/x86_64-linux-gnu/bits/wchar.h 40 | 41 | ../config.h: 42 | 43 | /usr/include/stdlib.h: 44 | 45 | /usr/include/features.h: 46 | 47 | /usr/include/x86_64-linux-gnu/bits/predefs.h: 48 | 49 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 50 | 51 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 52 | 53 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 54 | 55 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 56 | 57 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: 58 | 59 | /usr/include/x86_64-linux-gnu/bits/waitflags.h: 60 | 61 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h: 62 | 63 | /usr/include/x86_64-linux-gnu/sys/types.h: 64 | 65 | /usr/include/x86_64-linux-gnu/bits/types.h: 66 | 67 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 68 | 69 | /usr/include/time.h: 70 | 71 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: 72 | 73 | /usr/include/alloca.h: 74 | 75 | /usr/include/fcntl.h: 76 | 77 | /usr/include/x86_64-linux-gnu/bits/fcntl.h: 78 | 79 | /usr/include/x86_64-linux-gnu/bits/stat.h: 80 | 81 | /usr/include/x86_64-linux-gnu/sys/stat.h: 82 | 83 | /usr/include/unistd.h: 84 | 85 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h: 86 | 87 | /usr/include/x86_64-linux-gnu/bits/environments.h: 88 | 89 | /usr/include/x86_64-linux-gnu/bits/confname.h: 90 | 91 | /usr/include/getopt.h: 92 | 93 | /usr/include/x86_64-linux-gnu/sys/select.h: 94 | 95 | /usr/include/x86_64-linux-gnu/bits/select.h: 96 | 97 | /usr/include/x86_64-linux-gnu/bits/sigset.h: 98 | 99 | /usr/include/x86_64-linux-gnu/bits/time.h: 100 | 101 | /usr/include/x86_64-linux-gnu/sys/time.h: 102 | 103 | /usr/include/x86_64-linux-gnu/sys/resource.h: 104 | 105 | /usr/include/x86_64-linux-gnu/bits/resource.h: 106 | 107 | /usr/include/pwd.h: 108 | 109 | /usr/include/stdio.h: 110 | 111 | util_sys.h: 112 | 113 | /usr/include/libio.h: 114 | 115 | /usr/include/_G_config.h: 116 | 117 | /usr/include/wchar.h: 118 | 119 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: 120 | 121 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h: 122 | 123 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h: 124 | 125 | /usr/include/x86_64-linux-gnu/bits/stdio.h: 126 | 127 | /usr/include/string.h: 128 | 129 | /usr/include/x86_64-linux-gnu/bits/string.h: 130 | 131 | /usr/include/x86_64-linux-gnu/bits/string2.h: 132 | 133 | /usr/include/endian.h: 134 | 135 | /usr/include/x86_64-linux-gnu/bits/endian.h: 136 | 137 | /usr/include/x86_64-linux-gnu/sys/uio.h: 138 | 139 | /usr/include/x86_64-linux-gnu/bits/uio.h: 140 | 141 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: 142 | 143 | /usr/include/stdint.h: 144 | 145 | /usr/include/x86_64-linux-gnu/bits/wchar.h: 146 | -------------------------------------------------------------------------------- /src/test_echo_server.c: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2009 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /** 33 | * \file test_echo_server.c 34 | * \brief Simple UDP echo server. 35 | * \author Sebastien Vincent 36 | * \date 2008-2009 37 | */ 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | #include "tls_peer.h" 49 | 50 | /** 51 | * \var g_run 52 | * \brief Running state of the program. 53 | */ 54 | static volatile sig_atomic_t g_run = 0; 55 | 56 | /** 57 | * \brief Signal management. 58 | * \param code signal code 59 | */ 60 | static void signal_handler(int code) 61 | { 62 | switch(code) 63 | { 64 | case SIGUSR1: 65 | case SIGUSR2: 66 | case SIGPIPE: 67 | break; 68 | case SIGINT: 69 | case SIGTERM: 70 | /* stop the program */ 71 | g_run = 0; 72 | break; 73 | default: 74 | break; 75 | } 76 | } 77 | 78 | /** 79 | * \brief Entry point of the program. 80 | * \param argc number of argument 81 | * \param argv array of arguments 82 | * \return EXIT_SUCCESS or EXIT_FAILURE 83 | */ 84 | int main(int argc, char** argv) 85 | { 86 | int sock = -1; 87 | struct sockaddr_storage addr; 88 | socklen_t addr_size = sizeof(struct sockaddr_storage); 89 | char buf[2500]; 90 | ssize_t nb = -1; 91 | uint16_t port = 0; 92 | 93 | (void)argc; /* avoid compilation warning */ 94 | 95 | signal(SIGUSR1, signal_handler); 96 | signal(SIGUSR2, signal_handler); 97 | signal(SIGPIPE, signal_handler); 98 | signal(SIGINT, signal_handler); 99 | signal(SIGTERM, signal_handler); 100 | 101 | port = argv[1] ? atol(argv[1]) : 4588; 102 | 103 | /* incorrect value */ 104 | if(port == 0) 105 | { 106 | port = 4588; 107 | } 108 | 109 | /* try to bind on all addresses (IPv6+IPv4 mode) */ 110 | sock = socket_create(IPPROTO_UDP, "::", port, 0, 0); 111 | 112 | if(sock == -1) 113 | { 114 | perror("socket"); 115 | fprintf(stderr, "Maybe IPv6 is not available, try IPv4 only mode\n"); 116 | sock = socket_create(IPPROTO_UDP, "0.0.0.0", port, 0, 1); 117 | } 118 | 119 | if(sock == -1) 120 | { 121 | perror("socket"); 122 | exit(EXIT_FAILURE); 123 | } 124 | 125 | memset(&addr, 0x00, sizeof(struct sockaddr)); 126 | memset(buf, 0x00, sizeof(buf)); 127 | 128 | g_run = 1; 129 | 130 | fprintf(stdout, "UDP Echo server started on port %u\n", port); 131 | 132 | while(g_run) 133 | { 134 | fd_set fdsr; 135 | int nsock = sock; 136 | 137 | FD_ZERO(&fdsr); 138 | FD_SET(sock, &fdsr); 139 | 140 | nsock++; 141 | 142 | if(select(nsock, &fdsr, NULL, NULL, NULL) > 0) 143 | { 144 | if(FD_ISSET(sock, &fdsr)) 145 | { 146 | nb = recvfrom(sock, buf, sizeof(buf), 0, (struct sockaddr*)&addr, 147 | &addr_size); 148 | } 149 | } 150 | else 151 | { 152 | perror("select"); 153 | continue; 154 | } 155 | 156 | if(nb) 157 | { 158 | /* echo data received */ 159 | if(sendto(sock, buf, nb, 0, (struct sockaddr*)&addr, addr_size) == -1) 160 | { 161 | perror("sendto"); 162 | } 163 | } 164 | else 165 | { 166 | perror("recvfrom"); 167 | } 168 | } 169 | 170 | close(sock); 171 | 172 | fprintf(stdout, "Exiting\n"); 173 | 174 | return EXIT_SUCCESS; 175 | } 176 | 177 | -------------------------------------------------------------------------------- /src/.deps/util_crypto.Po: -------------------------------------------------------------------------------- 1 | util_crypto.o: util_crypto.c /usr/include/stdio.h /usr/include/features.h \ 2 | /usr/include/x86_64-linux-gnu/bits/predefs.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/types.h \ 9 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ 10 | /usr/include/_G_config.h /usr/include/wchar.h \ 11 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ 12 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 13 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ 14 | /usr/include/x86_64-linux-gnu/bits/stdio.h /usr/include/stdlib.h \ 15 | /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 16 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 17 | /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ 18 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ 19 | /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ 20 | /usr/include/x86_64-linux-gnu/bits/environments.h \ 21 | /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ 22 | /usr/include/x86_64-linux-gnu/bits/time.h /usr/include/errno.h \ 23 | /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ 24 | /usr/include/x86_64-linux-gnu/asm/errno.h \ 25 | /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ 26 | /usr/include/openssl/rand.h /usr/include/openssl/ossl_typ.h \ 27 | /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ 28 | /usr/include/openssl/sha.h /usr/include/openssl/md5.h \ 29 | /usr/include/openssl/hmac.h /usr/include/openssl/evp.h \ 30 | /usr/include/openssl/symhacks.h /usr/include/openssl/bio.h \ 31 | /usr/include/openssl/crypto.h /usr/include/openssl/stack.h \ 32 | /usr/include/openssl/safestack.h /usr/include/openssl/opensslv.h \ 33 | /usr/include/openssl/objects.h /usr/include/openssl/obj_mac.h \ 34 | /usr/include/openssl/asn1.h /usr/include/openssl/bn.h util_crypto.h \ 35 | ../config.h /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h \ 36 | /usr/include/stdint.h /usr/include/x86_64-linux-gnu/bits/wchar.h 37 | 38 | /usr/include/stdio.h: 39 | 40 | /usr/include/features.h: 41 | 42 | /usr/include/x86_64-linux-gnu/bits/predefs.h: 43 | 44 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 45 | 46 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 47 | 48 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 49 | 50 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 51 | 52 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: 53 | 54 | /usr/include/x86_64-linux-gnu/bits/types.h: 55 | 56 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 57 | 58 | /usr/include/libio.h: 59 | 60 | /usr/include/_G_config.h: 61 | 62 | /usr/include/wchar.h: 63 | 64 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: 65 | 66 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h: 67 | 68 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h: 69 | 70 | /usr/include/x86_64-linux-gnu/bits/stdio.h: 71 | 72 | /usr/include/stdlib.h: 73 | 74 | /usr/include/x86_64-linux-gnu/bits/waitflags.h: 75 | 76 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h: 77 | 78 | /usr/include/x86_64-linux-gnu/sys/types.h: 79 | 80 | /usr/include/time.h: 81 | 82 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: 83 | 84 | /usr/include/alloca.h: 85 | 86 | /usr/include/unistd.h: 87 | 88 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h: 89 | 90 | /usr/include/x86_64-linux-gnu/bits/environments.h: 91 | 92 | /usr/include/x86_64-linux-gnu/bits/confname.h: 93 | 94 | /usr/include/getopt.h: 95 | 96 | /usr/include/x86_64-linux-gnu/bits/time.h: 97 | 98 | /usr/include/errno.h: 99 | 100 | /usr/include/x86_64-linux-gnu/bits/errno.h: 101 | 102 | /usr/include/linux/errno.h: 103 | 104 | /usr/include/x86_64-linux-gnu/asm/errno.h: 105 | 106 | /usr/include/asm-generic/errno.h: 107 | 108 | /usr/include/asm-generic/errno-base.h: 109 | 110 | /usr/include/openssl/rand.h: 111 | 112 | /usr/include/openssl/ossl_typ.h: 113 | 114 | /usr/include/openssl/e_os2.h: 115 | 116 | /usr/include/openssl/opensslconf.h: 117 | 118 | /usr/include/openssl/sha.h: 119 | 120 | /usr/include/openssl/md5.h: 121 | 122 | /usr/include/openssl/hmac.h: 123 | 124 | /usr/include/openssl/evp.h: 125 | 126 | /usr/include/openssl/symhacks.h: 127 | 128 | /usr/include/openssl/bio.h: 129 | 130 | /usr/include/openssl/crypto.h: 131 | 132 | /usr/include/openssl/stack.h: 133 | 134 | /usr/include/openssl/safestack.h: 135 | 136 | /usr/include/openssl/opensslv.h: 137 | 138 | /usr/include/openssl/objects.h: 139 | 140 | /usr/include/openssl/obj_mac.h: 141 | 142 | /usr/include/openssl/asn1.h: 143 | 144 | /usr/include/openssl/bn.h: 145 | 146 | util_crypto.h: 147 | 148 | ../config.h: 149 | 150 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: 151 | 152 | /usr/include/stdint.h: 153 | 154 | /usr/include/x86_64-linux-gnu/bits/wchar.h: 155 | -------------------------------------------------------------------------------- /src/account.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2009 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /** 33 | * \file account.h 34 | * \brief Account on TURN server. 35 | * \author Sebastien Vincent 36 | * \date 2008-2009 37 | */ 38 | 39 | #ifndef ACCOUNT_H 40 | #define ACCOUNT_H 41 | 42 | #ifdef HAVE_CONFIG_H 43 | #include 44 | #endif 45 | 46 | #include "list.h" 47 | 48 | /** 49 | * \enum account_state 50 | * \brief Account access state. 51 | */ 52 | enum account_state 53 | { 54 | AUTHORIZED, /**< Client is authorized to access service */ 55 | RESTRICTED, /**< Client has limited access to service (bandwidth, ...) */ 56 | REFUSED, /**< Client is always refused to access service (i.e. blacklist) */ 57 | }; 58 | 59 | /** 60 | * \struct account_desc 61 | * \brief Account descriptor. 62 | */ 63 | struct account_desc 64 | { 65 | char username[514]; /**< Username */ 66 | char realm[256]; /**< Realm */ 67 | unsigned char key[16]; /**< MD5 hash */ 68 | enum account_state state; /**< Access state */ 69 | size_t allocations; /**< Number of allocations used */ 70 | int is_tmp; /**< If account is a temporary account */ 71 | struct list_head list; /**< For list management */ 72 | }; 73 | 74 | /** 75 | * \brief Create a new account. 76 | * 77 | * The account will be in the state AUTHORIZED when created. 78 | * \param username NULL-terminated username 79 | * \param password NULL-terminated password 80 | * \param realm NULL-terminated realm 81 | * \param state account state 82 | * \return pointer on account_desc or NULL if problem 83 | */ 84 | struct account_desc* account_desc_new(const char* username, 85 | const char* password, const char* realm, enum account_state state); 86 | 87 | /** 88 | * \brief Free an account. 89 | * \param desc pointer on pointer allocated by account_desc_new 90 | */ 91 | void account_desc_free(struct account_desc** desc); 92 | 93 | /** 94 | * \brief Set the state for an account. 95 | * \param desc account descriptor 96 | * \param state state to set 97 | */ 98 | void account_desc_set_state(struct account_desc* desc, enum account_state state); 99 | 100 | /** 101 | * \brief Find a account with specified username and realm from a list. 102 | * \param list list of accounts 103 | * \param username 104 | * \param realm realm 105 | * \return pointer on account_desc or NULL if not found 106 | */ 107 | struct account_desc* account_list_find(struct list_head* list, 108 | const char* username, const char* realm); 109 | 110 | /** 111 | * \brief Free a list of accounts. 112 | * \param list list of accounts 113 | */ 114 | void account_list_free(struct list_head* list); 115 | 116 | /** 117 | * \brief Add an account to a list. 118 | * \param list list of accounts 119 | * \param desc account descriptor to add 120 | */ 121 | void account_list_add(struct list_head* list, struct account_desc* desc); 122 | 123 | /** 124 | * \brief Remove and free an account from a list. 125 | * \param list list of accounts 126 | * \param desc account to remove 127 | */ 128 | void account_list_remove(struct list_head* list, struct account_desc* desc); 129 | 130 | /** 131 | * \brief Parse account file and fill up a list. 132 | * 133 | * Each lines of file MUST be: login:password:domain.org:state 134 | * In other words, the value is separated with a ':' 135 | * \param list list of accounts 136 | * \param file account file 137 | * \return 0 if success, -1 if error 138 | */ 139 | int account_parse_file(struct list_head* list, const char* file); 140 | 141 | #endif /* ACCOUNT_H */ 142 | 143 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2013-06-14 Sebastien Vincent 2 | 3 | * Version 0.7.3 - Minor fix to be able to compile with recent glibc. 4 | 5 | 2012-11-19 Daniel Pocock 6 | 7 | * Version 0.7.2 - Further tweaks to autotools 8 | 9 | 2012-10-17 Sebastien Vincent 10 | 11 | * Version 0.7.1 - Minor modifications to ease Debian package integration. 12 | 13 | 2012-10-01 Sebastien Vincent 14 | 15 | * Version 0.7 - Fixes compilation warnings with clang; 16 | - Send indications do not need to have realm, user, ...; 17 | - Fixes typos. 18 | 19 | 2012-02-22 Sebastien Vincent 20 | 21 | * Version 0.6 - Add spec file to build an RPM package (by Ken Cox); 22 | - Better syslog logging separated by level (by Ken Cox): 23 | - Bug fixes provided by Ryo Sato and Ken Cox; 24 | - Fixes TURN-TCP bugs reported by Nigel Pattinson. 25 | 26 | 2011-06-10 Sebastien Vincent 27 | 28 | * Version 0.5 - Add restricted users feature; 29 | - Add RFC6062 (TURN-TCP) document; 30 | - Add RFC6156 (TURN-IPV6) document; 31 | - Add mod_tmpuser to create/delete temporary users; 32 | - Fix endianess. 33 | 34 | 2010-05-02 Sebastien Vincent 35 | 36 | * Version 0.4 - Add RFC5766 (TURN) document; 37 | - Add turn-ipv6-09 and turn-tcp-06 drafts support; 38 | - Add multiprotocol client example (UDP/TCP/TLS/DTLS); 39 | - Add allocation port number range configuration; 40 | - Some files can compiled with MS Windows as well as 41 | multiprotocol client example. 42 | 43 | 2010-01-03 Sebastien Vincent 44 | 45 | * Version 0.3 - Add turn-ipv6-08 draft support; 46 | - Add credentials reload support; 47 | - Fix a "stack smashing"; 48 | - Experimental DTLS support (not in TURN standard). 49 | 50 | 2009-08-26 Sebastien Vincent 51 | 52 | * Version 0.2.3 - Add turn-ipv6-06 draft support; 53 | - Add turn-16 draft support; 54 | - Fix lifetime bug. 55 | 56 | 2009-03-09 Sebastien Vincent 57 | 58 | * Version 0.2.2 - Load sharing with multiple uplink addresses; 59 | - Increase nonce lifetime to one hour; 60 | - Fix ChannelBind refresh; 61 | - Add turn-13 draft; 62 | - Add 403 error message. 63 | 64 | 2008-12-17 Sebastien Vincent 65 | 66 | * Version 0.2.1 - Fix CRC32 generation; 67 | - Drop privileges if run as root/setuid root. 68 | 69 | 2008-12-15 Sebastien Vincent 70 | 71 | * Version 0.2 - Add attributes from turn-12 draft; 72 | - Add authentication on all TURN responses when possible; 73 | - Pre-calculate account MD5 hash; 74 | - Re-organize some code (message-integrity calculation, ...); 75 | - Alternate behavior for DF flag; 76 | - Separate TCP and TLS sockets; 77 | - Correctly relayed data from peer to client in TLS; 78 | - Multiple XOR-PEER-ADDRESS support in CreatePermission; 79 | - Update wireshark parser (packet-stun2.c); 80 | - Additionnal configuration parameters; 81 | - Allocation number and bandwidth quota; 82 | - Address/port restrictions; 83 | - Reconstruct fragmented TCP messages support; 84 | - Prevent allocation hijacking support; 85 | - Add logs support via syslog. 86 | 87 | 2008-11-22 Sebastien Vincent 88 | 89 | * Version 0.1.3 - Backport code refactoring from 0.2-draft-11 branch; 90 | - Additionnal configuration parameters. 91 | 92 | 2008-10-21 Sebastien Vincent 93 | 94 | * Version 0.1.2.2 - Fix nonce validation for 64-bit platform. 95 | 96 | 2008-09-24 Sebastien Vincent 97 | 98 | * Version 0.1.2.1 - Fix bug in go_daemon(). 99 | 100 | 2008-09-02 Sebastien Vincent 101 | 102 | * Version 0.1.2 - Fix bug (infinite loop) when receiving unknown 103 | comprehension-required attribute. 104 | 105 | 2008-08-16 Sebastien Vincent 106 | 107 | * Version 0.1.1 - Fix IPv6 problem; 108 | - Add missing XOR for FINGERPRINT mechanism; 109 | - Fix minors bugs. 110 | 111 | 2008-07-26 Sebastien Vincent 112 | 113 | * Initial version. 114 | 115 | -------------------------------------------------------------------------------- /test/check_account.c: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2009 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /** 33 | * \file check_account.c 34 | * \brief Unit tests for account management. 35 | * \author Sebastien Vincent 36 | * \date 2008-2009 37 | */ 38 | 39 | #include 40 | #include 41 | 42 | #include 43 | 44 | #include "../src/account.h" 45 | 46 | START_TEST(test_account_create) 47 | { 48 | struct account_desc* ret = NULL; 49 | 50 | /* create a valid account descriptor */ 51 | ret = account_desc_new("login", "password", "domain.org", AUTHORIZED); 52 | fail_unless(ret != NULL, "Invalid parameter or memory problem"); 53 | 54 | /* free it */ 55 | account_desc_free(&ret); 56 | fail_unless(ret == NULL, "account_desc_free does not set to NULL!"); 57 | 58 | /* create a invalid account descriptor */ 59 | ret = account_desc_new("login", NULL, "domain.org", AUTHORIZED); 60 | fail_unless(ret == NULL, "Invalid parameter (NULL in parameter)"); 61 | 62 | /* create a invalid account descriptor */ 63 | ret = account_desc_new(NULL, "password", "domain.org", AUTHORIZED); 64 | fail_unless(ret == NULL, "Invalid parameter (NULL in parameter)"); 65 | 66 | /* create a invalid account descriptor */ 67 | ret = account_desc_new("login", "password", NULL, AUTHORIZED); 68 | fail_unless(ret == NULL, "Invalid parameter (NULL in parameter)"); 69 | } 70 | END_TEST 71 | 72 | START_TEST(test_account_list) 73 | { 74 | struct list_head account_list; 75 | struct account_desc* ret = NULL; 76 | struct account_desc* ret2 = NULL; 77 | struct account_desc* ret3 = NULL; 78 | 79 | INIT_LIST(account_list); 80 | 81 | /* create a valid account descriptor */ 82 | ret = account_desc_new("login", "password", "domain.org", AUTHORIZED); 83 | fail_unless(ret != NULL, "Invalid parameter or memory problem"); 84 | 85 | ret2 = account_desc_new("login2", "password2", "domain.org", AUTHORIZED); 86 | fail_unless(ret2 != NULL, "Invalid parameter or memory problem"); 87 | 88 | account_list_add(&account_list, ret); 89 | account_list_add(&account_list, ret2); 90 | 91 | /* find an account in the list */ 92 | ret3 = account_list_find(&account_list, "login", "domain.org"); 93 | fail_unless(ret3 != NULL, "The list has not a match"); 94 | 95 | /* find an unknown account in the list */ 96 | ret3 = account_list_find(&account_list, "login44", "domain.org"); 97 | fail_unless(ret3 == NULL, "The list has a match"); 98 | 99 | /* find an valid name but unknown realm */ 100 | ret3 = account_list_find(&account_list, "login", "domain2.org"); 101 | fail_unless(ret3 == NULL, "The list has a match"); 102 | 103 | /* find an valid name but no realm specified */ 104 | ret3 = account_list_find(&account_list, "login", NULL); 105 | fail_unless(ret3 != NULL, "The list has not a match"); 106 | 107 | /* free the list and the account */ 108 | account_list_free(&account_list); 109 | ret = NULL; 110 | ret2 = NULL; 111 | ret3 = NULL; 112 | } 113 | END_TEST 114 | 115 | Suite* turn_msg_suite(void) 116 | { 117 | Suite* s = suite_create("Account management tests"); 118 | 119 | /* Core test case */ 120 | TCase* tc_core = tcase_create("Core"); 121 | tcase_add_test(tc_core, test_account_create); 122 | tcase_add_test(tc_core, test_account_list); 123 | suite_add_tcase(s, tc_core); 124 | 125 | return s; 126 | } 127 | 128 | int main(int argc, char** argv) 129 | { 130 | unsigned int number_failed = 0; 131 | 132 | Suite* s = turn_msg_suite(); 133 | SRunner* sr = srunner_create(s); 134 | 135 | srunner_run_all(sr, CK_NORMAL); 136 | number_failed = srunner_ntests_failed(sr); 137 | srunner_free(sr); 138 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 139 | } 140 | 141 | -------------------------------------------------------------------------------- /src/.deps/allocation.Po: -------------------------------------------------------------------------------- 1 | allocation.o: allocation.c ../config.h /usr/include/stdlib.h \ 2 | /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 9 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 10 | /usr/include/x86_64-linux-gnu/sys/types.h \ 11 | /usr/include/x86_64-linux-gnu/bits/types.h \ 12 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ 13 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ 14 | /usr/include/string.h /usr/include/x86_64-linux-gnu/bits/string.h \ 15 | /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ 16 | /usr/include/x86_64-linux-gnu/bits/endian.h /usr/include/unistd.h \ 17 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ 18 | /usr/include/x86_64-linux-gnu/bits/environments.h \ 19 | /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ 20 | /usr/include/x86_64-linux-gnu/bits/time.h /usr/include/netinet/in.h \ 21 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ 22 | /usr/include/x86_64-linux-gnu/bits/wchar.h \ 23 | /usr/include/x86_64-linux-gnu/sys/socket.h \ 24 | /usr/include/x86_64-linux-gnu/sys/uio.h \ 25 | /usr/include/x86_64-linux-gnu/bits/uio.h \ 26 | /usr/include/x86_64-linux-gnu/bits/socket.h \ 27 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ 28 | /usr/include/x86_64-linux-gnu/asm/socket.h \ 29 | /usr/include/asm-generic/socket.h \ 30 | /usr/include/x86_64-linux-gnu/asm/sockios.h \ 31 | /usr/include/asm-generic/sockios.h \ 32 | /usr/include/x86_64-linux-gnu/bits/in.h \ 33 | /usr/include/x86_64-linux-gnu/bits/byteswap.h allocation.h \ 34 | /usr/include/x86_64-linux-gnu/sys/time.h \ 35 | /usr/include/x86_64-linux-gnu/sys/select.h \ 36 | /usr/include/x86_64-linux-gnu/bits/select.h \ 37 | /usr/include/x86_64-linux-gnu/bits/sigset.h list.h turnserver.h \ 38 | /usr/include/signal.h /usr/include/x86_64-linux-gnu/bits/signum.h \ 39 | /usr/include/x86_64-linux-gnu/bits/siginfo.h \ 40 | /usr/include/x86_64-linux-gnu/bits/sigaction.h \ 41 | /usr/include/x86_64-linux-gnu/bits/sigstack.h \ 42 | /usr/include/x86_64-linux-gnu/sys/ucontext.h \ 43 | /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ 44 | /usr/include/x86_64-linux-gnu/bits/sigthread.h 45 | 46 | ../config.h: 47 | 48 | /usr/include/stdlib.h: 49 | 50 | /usr/include/features.h: 51 | 52 | /usr/include/x86_64-linux-gnu/bits/predefs.h: 53 | 54 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 55 | 56 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 57 | 58 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 59 | 60 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 61 | 62 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: 63 | 64 | /usr/include/x86_64-linux-gnu/bits/waitflags.h: 65 | 66 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h: 67 | 68 | /usr/include/x86_64-linux-gnu/sys/types.h: 69 | 70 | /usr/include/x86_64-linux-gnu/bits/types.h: 71 | 72 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 73 | 74 | /usr/include/time.h: 75 | 76 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: 77 | 78 | /usr/include/alloca.h: 79 | 80 | /usr/include/string.h: 81 | 82 | /usr/include/x86_64-linux-gnu/bits/string.h: 83 | 84 | /usr/include/x86_64-linux-gnu/bits/string2.h: 85 | 86 | /usr/include/endian.h: 87 | 88 | /usr/include/x86_64-linux-gnu/bits/endian.h: 89 | 90 | /usr/include/unistd.h: 91 | 92 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h: 93 | 94 | /usr/include/x86_64-linux-gnu/bits/environments.h: 95 | 96 | /usr/include/x86_64-linux-gnu/bits/confname.h: 97 | 98 | /usr/include/getopt.h: 99 | 100 | /usr/include/x86_64-linux-gnu/bits/time.h: 101 | 102 | /usr/include/netinet/in.h: 103 | 104 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: 105 | 106 | /usr/include/stdint.h: 107 | 108 | /usr/include/x86_64-linux-gnu/bits/wchar.h: 109 | 110 | /usr/include/x86_64-linux-gnu/sys/socket.h: 111 | 112 | /usr/include/x86_64-linux-gnu/sys/uio.h: 113 | 114 | /usr/include/x86_64-linux-gnu/bits/uio.h: 115 | 116 | /usr/include/x86_64-linux-gnu/bits/socket.h: 117 | 118 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h: 119 | 120 | /usr/include/x86_64-linux-gnu/asm/socket.h: 121 | 122 | /usr/include/asm-generic/socket.h: 123 | 124 | /usr/include/x86_64-linux-gnu/asm/sockios.h: 125 | 126 | /usr/include/asm-generic/sockios.h: 127 | 128 | /usr/include/x86_64-linux-gnu/bits/in.h: 129 | 130 | /usr/include/x86_64-linux-gnu/bits/byteswap.h: 131 | 132 | allocation.h: 133 | 134 | /usr/include/x86_64-linux-gnu/sys/time.h: 135 | 136 | /usr/include/x86_64-linux-gnu/sys/select.h: 137 | 138 | /usr/include/x86_64-linux-gnu/bits/select.h: 139 | 140 | /usr/include/x86_64-linux-gnu/bits/sigset.h: 141 | 142 | list.h: 143 | 144 | turnserver.h: 145 | 146 | /usr/include/signal.h: 147 | 148 | /usr/include/x86_64-linux-gnu/bits/signum.h: 149 | 150 | /usr/include/x86_64-linux-gnu/bits/siginfo.h: 151 | 152 | /usr/include/x86_64-linux-gnu/bits/sigaction.h: 153 | 154 | /usr/include/x86_64-linux-gnu/bits/sigstack.h: 155 | 156 | /usr/include/x86_64-linux-gnu/sys/ucontext.h: 157 | 158 | /usr/include/x86_64-linux-gnu/bits/sigcontext.h: 159 | 160 | /usr/include/x86_64-linux-gnu/bits/sigthread.h: 161 | -------------------------------------------------------------------------------- /src/dbg.c: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2011 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /* 33 | * Copyright (C) 2006-2011 Sebastien Vincent. 34 | * 35 | * Permission to use, copy, modify, and distribute this software for any 36 | * purpose with or without fee is hereby granted, provided that the above 37 | * copyright notice and this permission notice appear in all copies. 38 | * 39 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 40 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 41 | * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 42 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 43 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 44 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 45 | * PERFORMANCE OF THIS SOFTWARE. 46 | */ 47 | 48 | /** 49 | * \file dbg.c 50 | * \brief Some routines to print debug message. 51 | * \author Sebastien Vincent 52 | * \date 2006-2011 53 | */ 54 | 55 | #ifdef HAVE_CONFIG_H 56 | #include 57 | #endif 58 | 59 | #include 60 | #include 61 | #include 62 | 63 | #ifdef _MSC_VER 64 | #include 65 | /* replacement for stdint.h */ 66 | typedef __int8 int8_t; 67 | typedef unsigned __int8 uint8_t; 68 | typedef __int16 int16_t; 69 | typedef unsigned __int16 uint16_t; 70 | typedef __int32 int32_t; 71 | typedef unsigned __int32 uint32_t; 72 | typedef __int64 int64_t; 73 | typedef unsigned __int64 uint64_t; 74 | #else 75 | #include 76 | #include 77 | #endif 78 | 79 | #include 80 | 81 | #include "dbg.h" 82 | 83 | #ifdef __cplusplus 84 | extern "C" 85 | { /* } */ 86 | #endif 87 | 88 | void dbg_print(const char* f, int line, const char* format, ...) 89 | { 90 | va_list args; 91 | 92 | #ifdef _MSC_VER 93 | SYSTEMTIME tlt; 94 | GetLocalTime (&tlt); 95 | fprintf(stderr, "%02d:%02d:%02d.%03u|[%s:%d]", tlt.wHour, tlt.wMinute, 96 | tlt.wSecond, tlt.wMilliseconds, f, line); 97 | #else 98 | struct timeval lt; 99 | struct tm* tlt = NULL; 100 | gettimeofday(<, NULL); 101 | tlt = localtime((time_t*)<.tv_sec); 102 | fprintf(stderr, "%02d:%02d:%02d.%06u [%s:%d]\t", tlt->tm_hour, tlt->tm_min, 103 | tlt->tm_sec, (uint32_t)lt.tv_usec, f, line); 104 | #endif 105 | 106 | va_start(args, format); 107 | vfprintf(stderr, format, args); 108 | va_end(args); 109 | 110 | /* 111 | fprintf(stderr, "%02d:%02d:%02d.%06u [%s:%d] %s", tlt->tm_hour, 112 | tlt->tm_min, tlt->tm_sec, (uint32_t)lt.tv_usec, file, line, msg); 113 | */ 114 | } 115 | 116 | void dbg_print_null(const char* f, int line, const char* format, ...) 117 | { 118 | /* to avoid compilation warnings */ 119 | (void)f; 120 | (void)line; 121 | (void)format; 122 | } 123 | 124 | void dbg_print_hexa(const char* f, int line, const char* buf, size_t len, 125 | const char* format, ...) 126 | { 127 | size_t i = 0; 128 | va_list args; 129 | 130 | #ifdef _MSC_VER 131 | SYSTEMTIME tlt; 132 | GetLocalTime (&tlt); 133 | fprintf(stderr, "%02d:%02d:%02d.%03u [%s:%d]\t", tlt.wHour, tlt.wMinute, 134 | tlt.wSecond, tlt.wMilliseconds, f, line); 135 | #else 136 | struct timeval lt; 137 | struct tm* tlt = NULL; 138 | gettimeofday(<, NULL); 139 | tlt = localtime((time_t*)<.tv_sec); 140 | fprintf(stderr, "%02d:%02d:%02d.%06u [%s:%d]\t", tlt->tm_hour, tlt->tm_min, 141 | tlt->tm_sec, (uint32_t)lt.tv_usec, f, line); 142 | #endif 143 | 144 | va_start(args, format); 145 | vfprintf(stderr, format, args); 146 | va_end(args); 147 | 148 | for(i = 0 ; i < len ; i++) 149 | { 150 | fprintf(stderr, "%02x ", (unsigned char)buf[i]); 151 | } 152 | 153 | fprintf(stderr, "\n"); 154 | } 155 | 156 | #ifdef __cplusplus 157 | } 158 | #endif 159 | 160 | -------------------------------------------------------------------------------- /aminclude.am: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2004 Oren Ben-Kiki 2 | # This file is distributed under the same terms as the Automake macro files. 3 | 4 | # Generate automatic documentation using Doxygen. Goals and variables values 5 | # are controlled by the various DX_COND_??? conditionals set by autoconf. 6 | # 7 | # The provided goals are: 8 | # doxygen-doc: Generate all doxygen documentation. 9 | # doxygen-run: Run doxygen, which will generate some of the documentation 10 | # (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post 11 | # processing required for the rest of it (PS, PDF, and some MAN). 12 | # doxygen-man: Rename some doxygen generated man pages. 13 | # doxygen-ps: Generate doxygen PostScript documentation. 14 | # doxygen-pdf: Generate doxygen PDF documentation. 15 | # 16 | # Note that by default these are not integrated into the automake goals. If 17 | # doxygen is used to generate man pages, you can achieve this integration by 18 | # setting man3_MANS to the list of man pages generated and then adding the 19 | # dependency: 20 | # 21 | # $(man3_MANS): doxygen-doc 22 | # 23 | # This will cause make to run doxygen and generate all the documentation. 24 | # 25 | # The following variable is intended for use in Makefile.am: 26 | # 27 | # DX_CLEANFILES = everything to clean. 28 | # 29 | # This is usually added to MOSTLYCLEANFILES. 30 | 31 | ## --------------------------------- ## 32 | ## Format-independent Doxygen rules. ## 33 | ## --------------------------------- ## 34 | 35 | if DX_COND_doc 36 | 37 | ## ------------------------------- ## 38 | ## Rules specific for HTML output. ## 39 | ## ------------------------------- ## 40 | 41 | if DX_COND_html 42 | 43 | DX_CLEAN_HTML = @DX_DOCDIR@/html 44 | 45 | endif DX_COND_html 46 | 47 | ## ------------------------------ ## 48 | ## Rules specific for CHM output. ## 49 | ## ------------------------------ ## 50 | 51 | if DX_COND_chm 52 | 53 | DX_CLEAN_CHM = @DX_DOCDIR@/chm 54 | 55 | if DX_COND_chi 56 | 57 | DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi 58 | 59 | endif DX_COND_chi 60 | 61 | endif DX_COND_chm 62 | 63 | ## ------------------------------ ## 64 | ## Rules specific for MAN output. ## 65 | ## ------------------------------ ## 66 | 67 | if DX_COND_man 68 | 69 | DX_CLEAN_MAN = @DX_DOCDIR@/man 70 | 71 | endif DX_COND_man 72 | 73 | ## ------------------------------ ## 74 | ## Rules specific for RTF output. ## 75 | ## ------------------------------ ## 76 | 77 | if DX_COND_rtf 78 | 79 | DX_CLEAN_RTF = @DX_DOCDIR@/rtf 80 | 81 | endif DX_COND_rtf 82 | 83 | ## ------------------------------ ## 84 | ## Rules specific for XML output. ## 85 | ## ------------------------------ ## 86 | 87 | if DX_COND_xml 88 | 89 | DX_CLEAN_XML = @DX_DOCDIR@/xml 90 | 91 | endif DX_COND_xml 92 | 93 | ## ----------------------------- ## 94 | ## Rules specific for PS output. ## 95 | ## ----------------------------- ## 96 | 97 | if DX_COND_ps 98 | 99 | DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps 100 | 101 | DX_PS_GOAL = doxygen-ps 102 | 103 | doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps 104 | 105 | @DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag 106 | cd @DX_DOCDIR@/latex; \ 107 | rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ 108 | $(DX_LATEX) refman.tex; \ 109 | $(MAKEINDEX_PATH) refman.idx; \ 110 | $(DX_LATEX) refman.tex; \ 111 | countdown=5; \ 112 | while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ 113 | refman.log > /dev/null 2>&1 \ 114 | && test $$countdown -gt 0; do \ 115 | $(DX_LATEX) refman.tex; \ 116 | countdown=`expr $$countdown - 1`; \ 117 | done; \ 118 | $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi 119 | 120 | endif DX_COND_ps 121 | 122 | ## ------------------------------ ## 123 | ## Rules specific for PDF output. ## 124 | ## ------------------------------ ## 125 | 126 | if DX_COND_pdf 127 | 128 | DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf 129 | 130 | DX_PDF_GOAL = doxygen-pdf 131 | 132 | doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf 133 | 134 | @DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag 135 | cd @DX_DOCDIR@/latex; \ 136 | rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ 137 | $(DX_PDFLATEX) refman.tex; \ 138 | $(DX_MAKEINDEX) refman.idx; \ 139 | $(DX_PDFLATEX) refman.tex; \ 140 | countdown=5; \ 141 | while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ 142 | refman.log > /dev/null 2>&1 \ 143 | && test $$countdown -gt 0; do \ 144 | $(DX_PDFLATEX) refman.tex; \ 145 | countdown=`expr $$countdown - 1`; \ 146 | done; \ 147 | mv refman.pdf ../@PACKAGE@.pdf 148 | 149 | endif DX_COND_pdf 150 | 151 | ## ------------------------------------------------- ## 152 | ## Rules specific for LaTeX (shared for PS and PDF). ## 153 | ## ------------------------------------------------- ## 154 | 155 | if DX_COND_latex 156 | 157 | DX_CLEAN_LATEX = @DX_DOCDIR@/latex 158 | 159 | endif DX_COND_latex 160 | 161 | .PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) 162 | 163 | .INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) 164 | 165 | doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag 166 | 167 | doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) 168 | 169 | @DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS) 170 | rm -rf @DX_DOCDIR@ 171 | $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) 172 | 173 | DX_CLEANFILES = \ 174 | @DX_DOCDIR@/@PACKAGE@.tag \ 175 | -r \ 176 | $(DX_CLEAN_HTML) \ 177 | $(DX_CLEAN_CHM) \ 178 | $(DX_CLEAN_CHI) \ 179 | $(DX_CLEAN_MAN) \ 180 | $(DX_CLEAN_RTF) \ 181 | $(DX_CLEAN_XML) \ 182 | $(DX_CLEAN_PS) \ 183 | $(DX_CLEAN_PDF) \ 184 | $(DX_CLEAN_LATEX) 185 | 186 | endif DX_COND_doc 187 | -------------------------------------------------------------------------------- /src/.deps/conf.Po: -------------------------------------------------------------------------------- 1 | conf.o: conf.c ../config.h /usr/include/stdlib.h /usr/include/features.h \ 2 | /usr/include/x86_64-linux-gnu/bits/predefs.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 9 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 10 | /usr/include/x86_64-linux-gnu/sys/types.h \ 11 | /usr/include/x86_64-linux-gnu/bits/types.h \ 12 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ 13 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ 14 | /usr/include/string.h /usr/include/x86_64-linux-gnu/bits/string.h \ 15 | /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ 16 | /usr/include/x86_64-linux-gnu/bits/endian.h \ 17 | /usr/include/x86_64-linux-gnu/sys/socket.h \ 18 | /usr/include/x86_64-linux-gnu/sys/uio.h \ 19 | /usr/include/x86_64-linux-gnu/bits/uio.h \ 20 | /usr/include/x86_64-linux-gnu/bits/socket.h \ 21 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ 22 | /usr/include/x86_64-linux-gnu/asm/socket.h \ 23 | /usr/include/asm-generic/socket.h \ 24 | /usr/include/x86_64-linux-gnu/asm/sockios.h \ 25 | /usr/include/asm-generic/sockios.h /usr/include/arpa/inet.h \ 26 | /usr/include/netinet/in.h \ 27 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ 28 | /usr/include/x86_64-linux-gnu/bits/wchar.h \ 29 | /usr/include/x86_64-linux-gnu/bits/in.h \ 30 | /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/confuse.h \ 31 | /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ 32 | /usr/include/wchar.h /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ 33 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 34 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ 35 | /usr/include/x86_64-linux-gnu/bits/stdio.h conf.h list.h turnserver.h \ 36 | /usr/include/unistd.h /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ 37 | /usr/include/x86_64-linux-gnu/bits/environments.h \ 38 | /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ 39 | /usr/include/signal.h /usr/include/x86_64-linux-gnu/bits/sigset.h \ 40 | /usr/include/x86_64-linux-gnu/bits/signum.h \ 41 | /usr/include/x86_64-linux-gnu/bits/siginfo.h \ 42 | /usr/include/x86_64-linux-gnu/bits/sigaction.h \ 43 | /usr/include/x86_64-linux-gnu/bits/sigstack.h \ 44 | /usr/include/x86_64-linux-gnu/sys/ucontext.h \ 45 | /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ 46 | /usr/include/x86_64-linux-gnu/bits/sigthread.h 47 | 48 | ../config.h: 49 | 50 | /usr/include/stdlib.h: 51 | 52 | /usr/include/features.h: 53 | 54 | /usr/include/x86_64-linux-gnu/bits/predefs.h: 55 | 56 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 57 | 58 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 59 | 60 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 61 | 62 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 63 | 64 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: 65 | 66 | /usr/include/x86_64-linux-gnu/bits/waitflags.h: 67 | 68 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h: 69 | 70 | /usr/include/x86_64-linux-gnu/sys/types.h: 71 | 72 | /usr/include/x86_64-linux-gnu/bits/types.h: 73 | 74 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 75 | 76 | /usr/include/time.h: 77 | 78 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: 79 | 80 | /usr/include/alloca.h: 81 | 82 | /usr/include/string.h: 83 | 84 | /usr/include/x86_64-linux-gnu/bits/string.h: 85 | 86 | /usr/include/x86_64-linux-gnu/bits/string2.h: 87 | 88 | /usr/include/endian.h: 89 | 90 | /usr/include/x86_64-linux-gnu/bits/endian.h: 91 | 92 | /usr/include/x86_64-linux-gnu/sys/socket.h: 93 | 94 | /usr/include/x86_64-linux-gnu/sys/uio.h: 95 | 96 | /usr/include/x86_64-linux-gnu/bits/uio.h: 97 | 98 | /usr/include/x86_64-linux-gnu/bits/socket.h: 99 | 100 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h: 101 | 102 | /usr/include/x86_64-linux-gnu/asm/socket.h: 103 | 104 | /usr/include/asm-generic/socket.h: 105 | 106 | /usr/include/x86_64-linux-gnu/asm/sockios.h: 107 | 108 | /usr/include/asm-generic/sockios.h: 109 | 110 | /usr/include/arpa/inet.h: 111 | 112 | /usr/include/netinet/in.h: 113 | 114 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: 115 | 116 | /usr/include/stdint.h: 117 | 118 | /usr/include/x86_64-linux-gnu/bits/wchar.h: 119 | 120 | /usr/include/x86_64-linux-gnu/bits/in.h: 121 | 122 | /usr/include/x86_64-linux-gnu/bits/byteswap.h: 123 | 124 | /usr/include/confuse.h: 125 | 126 | /usr/include/stdio.h: 127 | 128 | /usr/include/libio.h: 129 | 130 | /usr/include/_G_config.h: 131 | 132 | /usr/include/wchar.h: 133 | 134 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: 135 | 136 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h: 137 | 138 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h: 139 | 140 | /usr/include/x86_64-linux-gnu/bits/stdio.h: 141 | 142 | conf.h: 143 | 144 | list.h: 145 | 146 | turnserver.h: 147 | 148 | /usr/include/unistd.h: 149 | 150 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h: 151 | 152 | /usr/include/x86_64-linux-gnu/bits/environments.h: 153 | 154 | /usr/include/x86_64-linux-gnu/bits/confname.h: 155 | 156 | /usr/include/getopt.h: 157 | 158 | /usr/include/signal.h: 159 | 160 | /usr/include/x86_64-linux-gnu/bits/sigset.h: 161 | 162 | /usr/include/x86_64-linux-gnu/bits/signum.h: 163 | 164 | /usr/include/x86_64-linux-gnu/bits/siginfo.h: 165 | 166 | /usr/include/x86_64-linux-gnu/bits/sigaction.h: 167 | 168 | /usr/include/x86_64-linux-gnu/bits/sigstack.h: 169 | 170 | /usr/include/x86_64-linux-gnu/sys/ucontext.h: 171 | 172 | /usr/include/x86_64-linux-gnu/bits/sigcontext.h: 173 | 174 | /usr/include/x86_64-linux-gnu/bits/sigthread.h: 175 | -------------------------------------------------------------------------------- /src/util_crypto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2009 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /* 33 | * Copyright (C) 2008-2009 Sebastien Vincent. 34 | * 35 | * Permission to use, copy, modify, and distribute this software for any 36 | * purpose with or without fee is hereby granted, provided that the above 37 | * copyright notice and this permission notice appear in all copies. 38 | * 39 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 40 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 41 | * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 42 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 43 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 44 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 45 | * PERFORMANCE OF THIS SOFTWARE. 46 | * 47 | * This product includes software developed by the OpenSSL Project 48 | * for use in the OpenSSL Toolkit (http://www.openssl.org/). 49 | */ 50 | 51 | /** 52 | * \file util_crypto.h 53 | * \brief Some helper cryptographic functions. 54 | * \author Sebastien Vincent 55 | * \date 2008-2009 56 | */ 57 | 58 | #ifndef UTIL_CRYPTO_H 59 | #define UTIL_CRYPTO_H 60 | 61 | #ifdef HAVE_CONFIG_H 62 | #include 63 | #endif 64 | 65 | #ifndef _MSC_VER 66 | /* Microsoft compiler does not have stdint.h */ 67 | #include 68 | #else 69 | /* replacement for stdint.h */ 70 | typedef __int8 int8_t; 71 | typedef unsigned __int8 uint8_t; 72 | typedef __int16 int16_t; 73 | typedef unsigned __int16 uint16_t; 74 | typedef __int32 int32_t; 75 | typedef unsigned __int32 uint32_t; 76 | typedef __int64 int64_t; 77 | typedef unsigned __int64 uint64_t; 78 | #endif 79 | 80 | #ifdef __cplusplus 81 | extern "C" 82 | { /* } */ 83 | #endif 84 | 85 | /** 86 | * \brief Initialize the PRNG. 87 | * \return 0 if successfull, -1 if seed is cryptographically weak 88 | */ 89 | int seed_prng_init(void); 90 | 91 | /** 92 | * \brief Cleanup the PRNG. 93 | * \return 0 if successfull, -1 if seed is cryptographically weak 94 | */ 95 | void seed_prng_cleanup(void); 96 | 97 | /** 98 | * \brief Generate random bytes. 99 | * \param id buffer that will be filled with random value 100 | * \param len length of id 101 | * \return 0 if successfull, -1 if the random number is cryptographically weak 102 | */ 103 | int random_bytes_generate(uint8_t* id, size_t len); 104 | 105 | /** 106 | * \brief Generate a SHA1 hash. 107 | * \param hash buffer with at least 20 bytes length 108 | * \param text text to hash 109 | * \param len text length 110 | * \return 0 if success, -1 otherwise 111 | */ 112 | int sha1_generate(unsigned char* hash, const unsigned char* text, size_t len); 113 | 114 | /** 115 | * \brief Generate a MD5 hash. 116 | * \param hash buffer with at least 16 bytes length 117 | * \param text text to hash 118 | * \param len text length 119 | * \return 0 if success, -1 otherwise 120 | */ 121 | int md5_generate(unsigned char* hash, const unsigned char* text, size_t len); 122 | 123 | /** 124 | * \brief Generate a HMAC-SHA1 hash. 125 | * \param hash buffer with at least 20 bytes length 126 | * \param text text to hash 127 | * \param text_len text length 128 | * \param key key used for HMAC 129 | * \param key_len key length 130 | * \return 0 if success, -1 otherwise 131 | */ 132 | int hmac_sha1_generate(unsigned char* hash, const unsigned char* text, 133 | size_t text_len, const unsigned char* key, size_t key_len); 134 | 135 | /** 136 | * \brief Generate a HMAC-MD5 hash. 137 | * \param hash buffer with at least 16 bytes length 138 | * \param text text to hash 139 | * \param text_len text length 140 | * \param key key used for HMAC 141 | * \param key_len key length 142 | * \return 0 if success, -1 otherwise 143 | */ 144 | int hmac_md5_generate(unsigned char* hash, const unsigned char* text, 145 | size_t text_len, const unsigned char* key, size_t key_len); 146 | 147 | /** 148 | * \brief Generate a CRC-32 (ISO 3309, ITU-T V.42 8.1.1.6.2, RFC 1952). 149 | * \param data data 150 | * \param len length of data 151 | * \param prev previous value 152 | * \return CRC-32 of data 153 | */ 154 | uint32_t crc32_generate(const uint8_t* data, size_t len, uint32_t prev); 155 | 156 | /** 157 | * \brief Print a digest. 158 | * \param buf buffer 159 | * \param len length of buffer 160 | */ 161 | void digest_print(const unsigned char* buf, size_t len); 162 | 163 | #ifdef __cplusplus 164 | } 165 | #endif 166 | 167 | #endif /* UTIL_CRYPTO_H */ 168 | 169 | -------------------------------------------------------------------------------- /man/turnserver.conf.tmpl: -------------------------------------------------------------------------------- 1 | .TH turnserver.conf 5 "May 16, 2011" "TurnServer Configuration" 2 | 3 | .SH NAME 4 | turnserver.conf \- TurnServer configuration file 5 | 6 | .SH SYNOPSIS 7 | .B %etc%/turnserver.conf 8 | .sp 9 | 10 | .SH DESCRIPTION 11 | This is the TurnServer configuration file. 12 | .br 13 | Here are the configuration options supported. 14 | 15 | .SH OPTIONS 16 | 17 | The file contains the following definitions: 18 | 19 | .TP 20 | .BR "listen_address " "= { IPv4 address, ... }" 21 | The public IPv4 address of any relayed address (if not set, no relay for IPv4). 22 | You can set more than one address, example: 23 | .BR 24 | listen_address = { "172.16.2.1", "173.17.2.1" } 25 | 26 | The main advantage to have multiple public IPv4 addresses is to do load sharing. 27 | 28 | .TP 29 | .BR "listen_addressv6 " "= { IPv6 address, ...}" 30 | The public IPv6 address of any relayed address (if not set, no relay for IPv6). 31 | You can set more than one address, example: 32 | .BR 33 | listen_addressv6 = { "2001:db8:1::1", "2001:db8:2::1" } 34 | 35 | The main advantage to have multiple public IPv6 addresses is to do load sharing. 36 | 37 | .TP 38 | .BR "udp_port " "= number" 39 | The UDP port of the server to listen for incoming connections. 40 | 41 | .TP 42 | .BR "tcp_port " "= number" 43 | The TCP port of the server to listen for incoming connections. 44 | 45 | .TP 46 | .BR "tls_port " "= number" 47 | The TLS port of the server to listen for incoming connections. 48 | 49 | .TP 50 | .BR "tls " "= boolean" 51 | Enable or not TLS over TCP connections. 52 | 53 | .TP 54 | .BR "dtls " "= boolean" 55 | Enable or not TLS over UDP connections. It is an experimental feature of 56 | TurnServer and it is not defined by TURN standard. 57 | 58 | .TP 59 | .BR "max_port " "= number" 60 | Maximum allocation port number. 61 | 62 | .TP 63 | .BR "min_port " "= number" 64 | Minimum allocation port number. 65 | 66 | .TP 67 | .BR "turn_tcp " "= boolean" 68 | Enable or not TURN-TCP extension. This extension is documented in RFC6062. 69 | 70 | .TP 71 | .BR "tcp_buffer_userspace " "= boolean" 72 | Enable or not userspace buffering for TURN-TCP extension. If false server will 73 | use OS buffering. 74 | 75 | .TP 76 | .BR "tcp_buffer_size " "= number" 77 | TURN-TCP internal buffer size. It is used to bufferize data coming from TCP peer 78 | when client does not have sent ConnectionBind. 79 | 80 | .TP 81 | .BR "daemon " "= boolean" 82 | Run the program as daemon. 83 | 84 | .TP 85 | .BR "unpriv_user " "= string" 86 | If the program is run as root or setuid root, the program will drop its 87 | privileges to the unpriv_user privileges. 88 | 89 | To use this feature, create a special user with the adduser command: 90 | adduser \-\-system \-\-group turnserver 91 | 92 | .TP 93 | .BR "realm " "= string" 94 | Realm value (i.e. domain.org). 95 | 96 | .TP 97 | .BR "nonce_key " "= string" 98 | Key used to hash nonce. 99 | 100 | .TP 101 | .BR "max_relay_per_username " "= number" 102 | Maximum number of allocation per username. 103 | 104 | .TP 105 | .BR "allocation_lifetime " "= number" 106 | Lifetime of an allocation in second. 107 | 108 | .TP 109 | .BR "bandwidth_per_allocation " "= number" 110 | Bandwidth limit for an allocation in KBytes/s. 111 | 0 value means disable bandwidth quota. 112 | 113 | .TP 114 | .BR "restricted_bandwidth " "= number" 115 | Bandwidth limit for restricted userse in KBytes/s. 116 | 0 value means disable bandwidth limitation. 117 | 118 | .TP 119 | .nf 120 | .BR "denied_address {" 121 | .BR " address " "= IPv4 | IPv6 address" 122 | .BR " mask " "= bitmask number" 123 | .BR " port " "= number (1 - 65535)" 124 | .B } 125 | .fi 126 | 127 | Defines an entry for the denied access list. This can appear multiple time. 128 | Format is defined as follow: 129 | .br 130 | .B address 131 | is a string representing an IPv4 or IPv6 address. 132 | .br 133 | .B mask 134 | is a number representing the bitmask (i.e. 24 is similar as 255.255.255.0, ...). 135 | .br 136 | .B port 137 | is a number representing the network port. The 0 value means all ports. 138 | 139 | It is strongly recommended to restrict addresses 127.0.0.1 and ::1 if there are 140 | private services running on the TURN server. 141 | 142 | .TP 143 | .BR "ca_file " "= string" 144 | The pathname of the Certification Authority certificate (required when 145 | tls=true). 146 | 147 | .TP 148 | .BR "cert_file " "= string" 149 | The pathname of the server certificate (required when tls=true). 150 | 151 | .TP 152 | .BR "private_key_file " "= string" 153 | The pathname of the server private key (required when tls=true). 154 | 155 | .TP 156 | .BR "account_method " "= [file | db | ldap ...]" 157 | The method to retrieve account data. 158 | Note that only the "file" method is implemented. 159 | 160 | .TP 161 | .BR "account_file " "= string" 162 | The pathname of the account file (required when account_method=file). 163 | 164 | .TP 165 | .BR "mod_tmpuser " "= boolean" 166 | Enable or not mod_tmpuser which consist of a socket that listen on localhost 167 | and external program can create or delete temporary user. 168 | 169 | .SH EXAMPLE 170 | 171 | listen_address = { "172.16.0.1" } 172 | 173 | listen_addressv6 = { "2001:db8::1" } 174 | 175 | udp_port = 3478 176 | 177 | tcp_port = 3478 178 | 179 | tls_port = 5349 180 | 181 | tls = true 182 | 183 | dtls = false 184 | 185 | max_port = 65535 186 | 187 | min_port = 49152 188 | 189 | turn_tcp = false 190 | 191 | tcp_buffer_userspace = true 192 | 193 | tcp_buffer_size = 32768 194 | 195 | daemon = false 196 | 197 | unpriv_user = turnserver 198 | 199 | realm = "domain.org" 200 | 201 | nonce_key = "hieKedq" 202 | 203 | max_relay_per_username = 10 204 | 205 | allocation_lifetime = 1800 206 | 207 | bandwidth_per_allocation = 150 208 | 209 | restricted_bandwidth = 10 210 | 211 | denied_address { 212 | address = "172.1.0.3" 213 | mask = 24 214 | port = 0 215 | 216 | } 217 | 218 | denied_address { 219 | address = "127.0.0.1" 220 | mask = 8 221 | port = 0 222 | 223 | } 224 | 225 | denied_address { 226 | address = "::1" 227 | mask = 128 228 | port = 0 229 | 230 | } 231 | 232 | ca_file = "/etc/ca.crt" 233 | 234 | cert_file = "/etc/server.crt" 235 | 236 | private_key_file = "/etc/server.key" 237 | 238 | account_method = "file" 239 | 240 | account_file = "/etc/turnusers.txt 241 | 242 | .SH AUTHOR 243 | 244 | Sebastien Vincent 245 | 246 | .SH "SEE ALSO" 247 | .BR turnserver (1) 248 | 249 | -------------------------------------------------------------------------------- /LICENSE.OpenSSL: -------------------------------------------------------------------------------- 1 | 2 | LICENSE ISSUES 3 | ============== 4 | 5 | The OpenSSL toolkit stays under a dual license, i.e. both the conditions of 6 | the OpenSSL License and the original SSLeay license apply to the toolkit. 7 | See below for the actual license texts. Actually both licenses are BSD-style 8 | Open Source licenses. In case of any license issues related to OpenSSL 9 | please contact openssl-core@openssl.org. 10 | 11 | OpenSSL License 12 | --------------- 13 | 14 | /* ==================================================================== 15 | * Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved. 16 | * 17 | * Redistribution and use in source and binary forms, with or without 18 | * modification, are permitted provided that the following conditions 19 | * are met: 20 | * 21 | * 1. Redistributions of source code must retain the above copyright 22 | * notice, this list of conditions and the following disclaimer. 23 | * 24 | * 2. Redistributions in binary form must reproduce the above copyright 25 | * notice, this list of conditions and the following disclaimer in 26 | * the documentation and/or other materials provided with the 27 | * distribution. 28 | * 29 | * 3. All advertising materials mentioning features or use of this 30 | * software must display the following acknowledgment: 31 | * "This product includes software developed by the OpenSSL Project 32 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 33 | * 34 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 35 | * endorse or promote products derived from this software without 36 | * prior written permission. For written permission, please contact 37 | * openssl-core@openssl.org. 38 | * 39 | * 5. Products derived from this software may not be called "OpenSSL" 40 | * nor may "OpenSSL" appear in their names without prior written 41 | * permission of the OpenSSL Project. 42 | * 43 | * 6. Redistributions of any form whatsoever must retain the following 44 | * acknowledgment: 45 | * "This product includes software developed by the OpenSSL Project 46 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" 47 | * 48 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 49 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 50 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 51 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 52 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 53 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 54 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 55 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 57 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 58 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 59 | * OF THE POSSIBILITY OF SUCH DAMAGE. 60 | * ==================================================================== 61 | * 62 | * This product includes cryptographic software written by Eric Young 63 | * (eay@cryptsoft.com). This product includes software written by Tim 64 | * Hudson (tjh@cryptsoft.com). 65 | * 66 | */ 67 | 68 | Original SSLeay License 69 | ----------------------- 70 | 71 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 72 | * All rights reserved. 73 | * 74 | * This package is an SSL implementation written 75 | * by Eric Young (eay@cryptsoft.com). 76 | * The implementation was written so as to conform with Netscapes SSL. 77 | * 78 | * This library is free for commercial and non-commercial use as long as 79 | * the following conditions are aheared to. The following conditions 80 | * apply to all code found in this distribution, be it the RC4, RSA, 81 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation 82 | * included with this distribution is covered by the same copyright terms 83 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). 84 | * 85 | * Copyright remains Eric Young's, and as such any Copyright notices in 86 | * the code are not to be removed. 87 | * If this package is used in a product, Eric Young should be given attribution 88 | * as the author of the parts of the library used. 89 | * This can be in the form of a textual message at program startup or 90 | * in documentation (online or textual) provided with the package. 91 | * 92 | * Redistribution and use in source and binary forms, with or without 93 | * modification, are permitted provided that the following conditions 94 | * are met: 95 | * 1. Redistributions of source code must retain the copyright 96 | * notice, this list of conditions and the following disclaimer. 97 | * 2. Redistributions in binary form must reproduce the above copyright 98 | * notice, this list of conditions and the following disclaimer in the 99 | * documentation and/or other materials provided with the distribution. 100 | * 3. All advertising materials mentioning features or use of this software 101 | * must display the following acknowledgement: 102 | * "This product includes cryptographic software written by 103 | * Eric Young (eay@cryptsoft.com)" 104 | * The word 'cryptographic' can be left out if the rouines from the library 105 | * being used are not cryptographic related :-). 106 | * 4. If you include any Windows specific code (or a derivative thereof) from 107 | * the apps directory (application code) you must include an acknowledgement: 108 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 109 | * 110 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 111 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 112 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 113 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 114 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 115 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 116 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 117 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 118 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 119 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 120 | * SUCH DAMAGE. 121 | * 122 | * The licence and distribution terms for any publically available version or 123 | * derivative of this code cannot be changed. i.e. this code cannot simply be 124 | * copied and put under another distribution licence 125 | * [including the GNU Public Licence.] 126 | */ 127 | 128 | -------------------------------------------------------------------------------- /src/account.c: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2009 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /** 33 | * \file account.c 34 | * \brief Account on TURN server. 35 | * \author Sebastien Vincent 36 | * \date 2008-2009 37 | */ 38 | 39 | #ifndef HAVE_CONFIG_H 40 | #include 41 | #endif 42 | 43 | #include 44 | #include 45 | #include 46 | 47 | #include "account.h" 48 | #include "protocol.h" 49 | 50 | struct account_desc* account_desc_new(const char* username, 51 | const char* password, const char* realm, enum account_state state) 52 | { 53 | struct account_desc* ret = NULL; 54 | 55 | if(!username || !password || !realm) 56 | { 57 | return NULL; 58 | } 59 | 60 | if(!(ret = malloc(sizeof(struct account_desc)))) 61 | { 62 | return NULL; 63 | } 64 | 65 | /* copy username and realm */ 66 | strncpy(ret->username, username, sizeof(ret->username) -1); 67 | ret->username[sizeof(ret->username)-1] = 0x00; 68 | strncpy(ret->realm, realm, sizeof(ret->realm) -1); 69 | ret->realm[sizeof(ret->realm)-1] = 0x00; 70 | 71 | /* set state */ 72 | ret->state = state; 73 | ret->allocations = 0; 74 | ret->is_tmp = 0; 75 | 76 | turn_calculate_authentication_key(username, realm, password, ret->key, 77 | sizeof(ret->key)); 78 | 79 | return ret; 80 | } 81 | 82 | void account_desc_free(struct account_desc** desc) 83 | { 84 | free(*desc); 85 | *desc = NULL; 86 | } 87 | 88 | void account_desc_set_state(struct account_desc* desc, enum account_state state) 89 | { 90 | desc->state = state; 91 | } 92 | 93 | struct account_desc* account_list_find(struct list_head* list, 94 | const char* username, const char* realm) 95 | { 96 | struct list_head* get = NULL; 97 | struct list_head* n = NULL; 98 | 99 | list_iterate_safe(get, n, list) 100 | { 101 | struct account_desc* tmp = list_get(get, struct account_desc, list); 102 | 103 | if(!strncmp(tmp->username, username, sizeof(tmp->username) - 1)) 104 | { 105 | /* if realm is specified, try a match otherwise the peer is found */ 106 | if(!realm || !strncmp(tmp->realm, realm, sizeof(tmp->realm) - 1)) 107 | { 108 | return tmp; 109 | } 110 | } 111 | } 112 | 113 | /* not found */ 114 | return NULL; 115 | } 116 | 117 | void account_list_free(struct list_head* list) 118 | { 119 | struct list_head* get = NULL; 120 | struct list_head* n = NULL; 121 | 122 | list_iterate_safe(get, n, list) 123 | { 124 | struct account_desc* tmp = list_get(get, struct account_desc, list); 125 | LIST_DEL(&tmp->list); 126 | account_desc_free(&tmp); 127 | } 128 | } 129 | 130 | void account_list_add(struct list_head* list, struct account_desc* desc) 131 | { 132 | LIST_ADD(&desc->list, list); 133 | } 134 | 135 | void account_list_remove(struct list_head* list, struct account_desc* desc) 136 | { 137 | /* to avoid compilation warning */ 138 | (void)list; 139 | 140 | LIST_DEL(&desc->list); 141 | } 142 | 143 | int account_parse_file(struct list_head* list, const char* file) 144 | { 145 | char line[512]; 146 | char* save_ptr = NULL; 147 | const char* delim = ":"; 148 | char* token = NULL; 149 | char* login = NULL; 150 | char* password = NULL; 151 | char* realm = NULL; 152 | FILE* account_file = NULL; 153 | struct account_desc* desc = NULL; 154 | 155 | account_file = fopen(file, "r"); 156 | 157 | if(!account_file) 158 | { 159 | return -1; 160 | } 161 | 162 | while(!feof(account_file)) 163 | { 164 | enum account_state state = AUTHORIZED; 165 | 166 | if(!fgets(line, sizeof(line) - 1, account_file)) 167 | { 168 | continue; 169 | } 170 | 171 | /* replace end of line by NULL character */ 172 | save_ptr = strchr(line, '\n'); 173 | if(save_ptr) 174 | { 175 | *save_ptr = 0x00; 176 | } 177 | save_ptr = NULL; 178 | 179 | token = strtok_r(line, delim, &save_ptr); 180 | if(!token) 181 | { 182 | continue; 183 | } 184 | login = strdup(token); 185 | 186 | token = strtok_r(NULL, delim, &save_ptr); 187 | if(!token) 188 | { 189 | free(login); 190 | continue; 191 | } 192 | password = strdup(token); 193 | 194 | token = strtok_r(NULL, delim, &save_ptr); 195 | if(!token) 196 | { 197 | free(login); 198 | free(password); 199 | continue; 200 | } 201 | realm = strdup(token); 202 | 203 | token = strtok_r(NULL, delim, &save_ptr); 204 | 205 | if(token) 206 | { 207 | if(!strcmp(token, "authorized")) 208 | { 209 | state = AUTHORIZED; 210 | } 211 | else if(!strcmp(token, "restricted")) 212 | { 213 | state = RESTRICTED; 214 | } 215 | else if(!strcmp(token, "refused")) 216 | { 217 | state = REFUSED; 218 | } 219 | } 220 | 221 | /* add it to the list (only for non-refused account) */ 222 | if(state != REFUSED) 223 | { 224 | desc = account_desc_new(login, password, realm, state); 225 | if(desc) 226 | { 227 | account_list_add(list, desc); 228 | } 229 | } 230 | 231 | /* cleanup */ 232 | desc = NULL; 233 | free(login); 234 | free(password); 235 | free(realm); 236 | } 237 | 238 | fclose(account_file); 239 | 240 | return 0; 241 | } 242 | 243 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | TurnServer 2 | ========== 3 | 4 | A fork from [http://turnserver.sourceforge.net](http://turnserver.sourceforge.net/index.php?n=Main.HomePage) 5 | 6 | TurnServer is an open-source implementation of Traversal Using Relays around NAT 7 | (TURN) protocol. It aims to be compliant with RFC5766 (TURN) and RFC5389 (STUN). 8 | 9 | The TURN protocol allows a client to obtain IP addresses and ports from such a 10 | relay. It is most useful for elements behind symmetric NATs or firewalls that 11 | wish to be on the receiving end of a connection to a single peer. 12 | 13 | TURN clients can connect to TurnServer with the following protocols: UDP, TCP 14 | and TLS over TCP. Experimental DTLS support is also provided. Relaying data can 15 | be done with UDP or TCP protocol. 16 | 17 | TurnServer supports also RFC5389 (STUN Binding request), RFC6062 (relay data 18 | with TCP protocol) and RFC6156 (relay IPv6-IPv6, IPv4-IPv6 and IPv6-IPv4). 19 | 20 | TurnServer is known to work on the following systems: 21 | - GNU/Linux 2.6; 22 | - FreeBSD 7.x, 8.x. 23 | 24 | # Build / install 25 | 26 | TurnServer requires following libraries: 27 | 28 | - libconfuse development files (version >= 2.6); 29 | - libssl development files; 30 | - librt (normally included in Linux and *BSD distribution*). 31 | 32 | TurnServer is written in pure C according to the C99 and POSIX + XSI standards. 33 | Thus it should be compiled on all POSIX systems which have realtime signals 34 | support. 35 | 36 | Note for *BSD* users, install the required libconfuse ports in /usr/ prefix, 37 | otherwise you have to set the `PKG_CONFIG_PATH` variable or make symlinks before 38 | running ./configure script: 39 | 40 | ln -sf /usr/local/lib/libconfuse.so /usr/lib/ && \ 41 | ln -sf /usr/local/include/confuse.h /usr/include/ 42 | 43 | To build TurnServer, run following commands: 44 | 45 | $ autoreconf -i 46 | $ ./configure 47 | $ make 48 | $ make install 49 | 50 | ./configure can take options: 51 | 52 | --enable-debug-build : allow to compile with debug informations 53 | default=no 54 | --enable-fdsetsize=number : allow to preconfigure FD_SETSIZE macro 55 | (must be a number >=32) default=no 56 | --enable-xor-peer-address-max=number : allow to preconfigure 57 | XOR_PEER_ADDRESS_MAX macro (must be a 58 | number > 0) default=5 59 | 60 | Copy the template configuration file (extra/turnserver.conf.template) and 61 | template accounts database file (extra/turnusers.txt) to a directory of your 62 | choice (i.e. /etc/ or /usr/local/etc/). 63 | Do not forget, the accounts database file pathname has to be populated in 64 | configuration file (`attribute account_file`). See next sections to know how to 65 | setup configuration and accounts files. 66 | 67 | To generate the API documentation: 68 | 69 | $ make doxygen-run 70 | 71 | The HTML generated documentation is located in doc/html/ directory of TurnServer sources. 72 | 73 | Launch the server: 74 | 75 | $ turnserver -c /path/to/config/file 76 | 77 | # Configuration file 78 | 79 | In extra/ directory you will find a configuration template file 80 | (turnserver.conf.template). Change settings according to your environment. 81 | 82 | Here are important parameters, 83 | 84 | - listen_address : public IPv4 address; 85 | - listen_addressv6 : public IPv6 address; 86 | - realm : realm (i.e. domain.org) of the server; 87 | - account_file : specify the location of the accounts database file; 88 | - tcp_port and udp_port : bind the service on the specified port; 89 | - tls : enable TLS support; 90 | - tls_port : bind the secure service on the specified port. 91 | - ca_file : Certification Authority (must set if tls = true) 92 | - cert_file : server certificate (must set if tls = true) 93 | - private_key_file : server private key (must set if tls = true) 94 | - turn_tcp : enable TURN-TCP extension 95 | - tcp_buffer_userspace : enable userspace buffering for TURN-TCP extension, if 96 | false OS buffering will be used 97 | - tcp_buffer_size : maximum amount of bytes that can be buffered for 98 | TURN-TCP (RFC6062) extension 99 | 100 | Other parameters such as allocations number quota or experimental features are 101 | documented in manpages: 102 | 103 | $ man turnserver.conf 104 | 105 | # Accounts database file 106 | 107 | TurnServer uses (for the moment) a basic text file which contains accounts 108 | information. 109 | 110 | The format of each line is: 111 | 112 | login:password:realm:state 113 | 114 | The state can be "authorized", "refused" or "restricted". The "restricted" state 115 | means the account has bandwidth restrictions. 116 | 117 | Note: realm have to match realm parameter defined in TurnServer configuration 118 | file. The ":" character is also forbidden in login, password or realm fields. 119 | 120 | # Security 121 | 122 | If TurnServer is launched as root or set-uid root, it is possible to drop 123 | privileges. 124 | 125 | One possibility is to create a special user (which have less privileges). To 126 | create such a user named turnserver: 127 | 128 | adduser --system --group turnserver 129 | 130 | Then you have to tell configuration file to choose this user: 131 | 132 | unpriv_user = turnserver 133 | 134 | If TurnServer is set-uid root and unpriv_user is not set, TurnServer will drop 135 | privileges to the user who launched the binary. 136 | 137 | **Note**: if turnserver is launched as root and unpriv_user not set, the program 138 | will not loose its root privileges. 139 | 140 | # How-to test simply turnserver 141 | 142 | TurnServer is shipped with two test tools: test_turn_client and 143 | test_echo_server. The first one is a minimal TURN client and test_echo_server 144 | is a simple UDP echo server. 145 | 146 | To test TurnServer simply: 147 | 148 | - configure turnserver.conf; 149 | - configure turnusers.txt ; 150 | - launch "turnserver -c /path/to/turnserver.conf"; 151 | - launch "test_echo_server 8086"; 152 | - launch "test_turn_client -t udp -s turnserver_address -p turnserver_address -w 8086 -u user -g password -d domain.org". 153 | 154 | The turnserver_address parameter should be the address configured in 155 | turnserver.conf's listen_address or listen_addressv6. if you want to use 156 | localhost here, you should configure listen_address to 127.0.0.1 _and_ 157 | listen_addressv6 to ::1. The user, password and domain.org parameters are the 158 | ones from turnusers.txt. 159 | 160 | It is not necessary to run the server and the test tools on different computers 161 | but it is recommended just to be sure everything work as in real use-case. 162 | 163 | -------------------------------------------------------------------------------- /src/list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2010 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /* 33 | * Copyright (C) 2006-2010 Sebastien Vincent. 34 | * 35 | * Permission to use, copy, modify, and distribute this software for any 36 | * purpose with or without fee is hereby granted, provided that the above 37 | * copyright notice and this permission notice appear in all copies. 38 | * 39 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 40 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 41 | * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 42 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 43 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 44 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 45 | * PERFORMANCE OF THIS SOFTWARE. 46 | */ 47 | 48 | /** 49 | * \file list.h 50 | * \brief Doubly linked list management. 51 | * \author Sebastien Vincent 52 | * \date 2006-2010 53 | */ 54 | 55 | #ifndef LIST_H 56 | #define LIST_H 57 | 58 | #ifdef HAVE_CONFIG_H 59 | #include 60 | #endif 61 | 62 | #if defined(_MSC_VER) && !defined(__cplusplus) 63 | /* Microsoft compiler does not know inline 64 | * keyword in a pure C program 65 | */ 66 | #define inline __inline 67 | #endif 68 | 69 | #include /* for offsetof */ 70 | 71 | /** 72 | * \struct list_head 73 | * \brief Doubly linked list implementation. 74 | * 75 | * Simple doubly linked list implementation inspired by include/linux/list.h. 76 | * \note To use it: LIST_HEAD(name_variable) to declare the variable 77 | * then always do INIT_LIST(name_variable). 78 | */ 79 | typedef struct list_head 80 | { 81 | struct list_head *next; /**< Next element in the list */ 82 | struct list_head *prev; /**< Previous element in the list */ 83 | }list_head; 84 | 85 | /** 86 | * \def INIT_LIST 87 | * \brief Initialize a list. 88 | * \param name the list to initialize 89 | */ 90 | #define INIT_LIST(name) do { \ 91 | (name).prev = &(name); \ 92 | (name).next = &(name); \ 93 | }while(0); 94 | 95 | /** 96 | * \def LIST_HEAD 97 | * \brief Used to declare a doubly linked list. 98 | * \param name name of list_head struct 99 | */ 100 | #define LIST_HEAD(name) struct list_head name 101 | 102 | /** 103 | * \def LIST_ADD 104 | * \brief Add a new entry after the specified head. 105 | * \param new_entry new entry to be added 106 | * \param head list head to add it after 107 | */ 108 | #define LIST_ADD(new_entry, head) do { \ 109 | struct list_head* next = (head)->next; \ 110 | next->prev = (new_entry); \ 111 | (new_entry)->next = next; \ 112 | (new_entry)->prev = (head); \ 113 | (head)->next = (new_entry); \ 114 | }while(0); 115 | 116 | /** 117 | * \def LIST_ADD_TAIL 118 | * \brief Add a new entry before the specified head. 119 | * \param new_entry new entry to be added 120 | * \param head list head to add it before 121 | */ 122 | #define LIST_ADD_TAIL(new_entry, head) do { \ 123 | struct list_head* prev = (head)->prev; \ 124 | (head)->prev = (new_entry); \ 125 | (new_entry)->next = (head); \ 126 | (new_entry)->prev = prev; \ 127 | prev->next = (new_entry); \ 128 | }while(0); 129 | 130 | /** 131 | * \def LIST_DEL 132 | * \brief Delete entry from list. 133 | * \param rem pointer of the element to delete from the list 134 | * \note list_empty on entry does not return true after this, the entry is 135 | * in an undefined state. 136 | */ 137 | #define LIST_DEL(rem) do { \ 138 | (rem)->next->prev = (rem)->prev; \ 139 | (rem)->prev->next = (rem)->next; \ 140 | (rem)->next = (rem); \ 141 | (rem)->prev = (rem); \ 142 | }while(0); 143 | 144 | /** 145 | * \def LIST_EMPTY 146 | * \brief Return whether or not the list is empty. 147 | * \param head pointer on the list to test 148 | * \return 1 if empty, 0 otherwise 149 | */ 150 | #define LIST_EMPTY(head) \ 151 | ((head)->next == (head)) 152 | 153 | /** 154 | * \def list_get 155 | * \brief Get the element. 156 | * \param ptr the list_head pointer 157 | * \param type the type of the struct this is embedded in 158 | * \param member the name of the list_struct within the struct 159 | * \return pointer on the structure for this entry 160 | */ 161 | #define list_get(ptr, type, member) \ 162 | (type *)((char *)(ptr) - offsetof(type, member)) 163 | 164 | /** 165 | * \def list_iterate 166 | * \brief Iterate over a list. 167 | * \param pos the &struct list_head to use as a loop counter 168 | * \param head the head for your list 169 | */ 170 | #define list_iterate(pos, head) \ 171 | for((pos) = (head)->next ; (pos) != (head) ; (pos) = (pos)->next) 172 | 173 | /** 174 | * \def list_iterate_safe 175 | * \brief Thread safe version to iterate over a list. 176 | * \param pos pointer on a list_head struct 177 | * \param n temporary variable 178 | * \param head the list. 179 | */ 180 | #define list_iterate_safe(pos, n, head) \ 181 | for((pos) = (head)->next, (n) = (pos)->next ; (pos) != (head) ; \ 182 | (pos) = (n), (n) = (pos)->next) 183 | 184 | /** 185 | * \brief Get the number of element in the list. 186 | * \param head the list 187 | * \return size of the list 188 | */ 189 | static inline unsigned int list_size(struct list_head* head) 190 | { 191 | struct list_head* lp = NULL; 192 | unsigned int size = 0; 193 | 194 | list_iterate(lp, head) 195 | { 196 | size++; 197 | } 198 | return size; 199 | } 200 | 201 | #endif /* LIST_H */ 202 | 203 | -------------------------------------------------------------------------------- /src/dbg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2008-2011 Sebastien Vincent 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /* 33 | * Copyright (C) 2006-2011 Sebastien Vincent. 34 | * 35 | * Permission to use, copy, modify, and distribute this software for any 36 | * purpose with or without fee is hereby granted, provided that the above 37 | * copyright notice and this permission notice appear in all copies. 38 | * 39 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 40 | * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 41 | * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 42 | * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 43 | * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 44 | * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 45 | * PERFORMANCE OF THIS SOFTWARE. 46 | */ 47 | 48 | /** 49 | * \file dbg.h 50 | * \brief Some routines to print debug message. 51 | * \author Sebastien Vincent 52 | * \date 2006-2011 53 | */ 54 | 55 | #ifndef DBG_H 56 | #define DBG_H 57 | 58 | #ifdef HAVE_CONFIG_H 59 | #include 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | extern "C" 64 | { /* } */ 65 | #endif 66 | 67 | #include 68 | 69 | /** 70 | * \def DBG_ATTR 71 | * \brief Current file and line seperated with a comma. 72 | */ 73 | #define DBG_ATTR __FILE__, __LINE__ 74 | 75 | /** 76 | * \brief Print a debug message on stderr. 77 | * \param f filename 78 | * \param line line number 79 | * \param format format of the output (similary to printf param) 80 | * \param ... list of arguments 81 | * \author Sebastien Vincent 82 | */ 83 | void dbg_print(const char* f, int line, const char* format, ...); 84 | 85 | /** 86 | * \brief Print nothing! 87 | * \param f filename 88 | * \param line line number 89 | * \param format format of the output (similary to printf param) 90 | * \param ... list of arguments 91 | * \author Sebastien Vincent 92 | */ 93 | void dbg_print_null(const char* f, int line, const char* format, ...); 94 | 95 | /** 96 | * \brief Print the content of a buffer in hexadecimal. 97 | * \param f filename 98 | * \param line line number 99 | * \param buf buffer to print 100 | * \param len size of the buffer 101 | * \param format format of the output (similary to printf param) 102 | * \param ... list of arguments 103 | * \author Sebastien Vincent 104 | * \warning Remember to pass pointer when you cast an integer for buf param. 105 | */ 106 | void dbg_print_hexa(const char* f, int line, const char* buf, size_t len, 107 | const char* format, ...); 108 | 109 | /** 110 | * \def debug 111 | * \brief Print a debug message. 112 | * 113 | * Use similary like a variadic macro: debug(DBG_ATTR, format, ...). 114 | * \warning Respect the use: debug(DBG_ATTR, format, ...). 115 | */ 116 | #ifndef NDEBUG 117 | #define debug dbg_print 118 | #else 119 | #define debug(...) 120 | #endif 121 | 122 | /** 123 | * \def debug_hexa 124 | * \brief Print the content of a buffer in hexadecimal. 125 | * 126 | * Use similary like a variadic macro: 127 | * debug_print_hexa(DBG_ATTR, buf, buflen, format, ...). 128 | * \warning Respect the use: debug_hexa(DBG_ATTR, buf, buflen, ...). 129 | */ 130 | #define debug_hexa dbg_print_hexa 131 | 132 | /** 133 | * If you want to have debug message on stderr when some pthread functions are 134 | * used, define DBG_THREAD_LOCK. It could be useful when debugging deadlocks or 135 | * other thread synchronization stuff. 136 | */ 137 | #ifdef DBG_THREAD_LOCK 138 | 139 | /** 140 | * \def pthread_mutex_lock 141 | * \brief Print a debug message when pthread_mutex_lock function is used. 142 | * \param x thread id (pthread_t type) 143 | * \return 0 if success, a non nul value otherwise 144 | */ 145 | #define pthread_mutex_lock(x) \ 146 | do \ 147 | { \ 148 | dbg_print(DBG_ATTR, "MUTEX LOCK: [%x]\n", pthread_self()); \ 149 | pthread_mutex_lock((x)); \ 150 | }while(0) 151 | 152 | /** 153 | * \def pthread_mutex_unlock 154 | * \brief Print a debug message when pthread_mutex_unlock function is used. 155 | * \param x thread id (pthread_t type) 156 | * \return 0 if success, a non nul value otherwise 157 | */ 158 | #define pthread_mutex_unlock(x) \ 159 | do \ 160 | { \ 161 | dbg_print(DBG_ATTR, "MUTEX UNLOCK: [%x]\n", pthread_self()); \ 162 | pthread_mutex_unlock((x)); \ 163 | }while(0) 164 | 165 | /** 166 | * \def pthread_join 167 | * \brief Print a debug message when pthread_join function is used. 168 | * \param x thread id (pthread_t type) 169 | * \param r return value of thread is stored in r (void** type) 170 | * \return 0 if success, a non nul value otherwise 171 | */ 172 | #define pthread_join(x, r) \ 173 | do \ 174 | { 175 | dbg_print(DBG_ATTR, "[%x] wait to JOIN Thread [%x]\n", pthread_self(), x); \ 176 | pthread_join((x), (r)); \ 177 | dbg_print(DBG_ATTR, "[%x] JOIN Thread [%x]\n", pthread_self(), x); \ 178 | }while(0) 179 | 180 | /** 181 | * \def pthread_exit 182 | * \brief Print a debug message when pthread_exit function is used. 183 | * \param x thread id (pthread_t type) 184 | */ 185 | #define pthread_exit(x) \ 186 | do \ 187 | { \ 188 | dbg_print(DBG_ATTR, "EXIT Thread [%x]\n", pthread_self()); \ 189 | pthread_exit((x)); \ 190 | }while(0) 191 | 192 | /** 193 | * \def pthread_cancel 194 | * \brief Print a debug message when pthread_exit function is used. 195 | * \param x thread id (pthread_t type) 196 | * \return 0 if success, a non nul value otherwise 197 | */ 198 | #define pthread_cancel(x) \ 199 | do \ 200 | { \ 201 | dbg_print(DBG_ATTR, "Cancel Thread [%x] by [%x]\n", x, pthread_self()); \ 202 | }while(0) 203 | 204 | #endif 205 | 206 | #ifdef __cplusplus 207 | } 208 | #endif 209 | 210 | #endif /* DBG_H */ 211 | 212 | -------------------------------------------------------------------------------- /src/mod_tmpuser.c: -------------------------------------------------------------------------------- 1 | /* 2 | * TurnServer - TURN server implementation. 3 | * Copyright (C) 2010 BlueJimp 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | * In addition, as a special exception, the copyright holders give 19 | * permission to link the code of portions of this program with the 20 | * OpenSSL library under certain conditions as described in each 21 | * individual source file, and distribute linked combinations 22 | * including the two. 23 | * You must obey the GNU General Public License in all respects 24 | * for all of the code used other than OpenSSL. If you modify 25 | * file(s) with this exception, you may extend this exception to your 26 | * version of the file(s), but you are not obligated to do so. If you 27 | * do not wish to do so, delete this exception statement from your 28 | * version. If you delete this exception statement from all source 29 | * files in the program, then also delete it here. 30 | */ 31 | 32 | /** 33 | * \file mod_tmpuser.c 34 | * \brief Module that can add/delete temporary user. 35 | * 36 | * It consists of a socket that will listen for incoming messages and process 37 | * them. Message format is as follow: 38 | * - To create a user, create user:password:domain 39 | * - To delete a user, delete user 40 | * 41 | * \author Sebastien Vincent 42 | * \date 2011 43 | */ 44 | 45 | #include 46 | #include 47 | #include 48 | 49 | #include "turnserver.h" 50 | #include "list.h" 51 | #include "tls_peer.h" 52 | #include "mod_tmpuser.h" 53 | 54 | /** 55 | * \struct tmpuser 56 | * \brief Structure for the tmpuser module. 57 | */ 58 | struct tmpuser 59 | { 60 | int initialized; /**< initialized flag */ 61 | int sock; /**< Localhost socket */ 62 | struct list_head* account_list; /**< account list */ 63 | struct list_head client_list; /**< TCP client socket list */ 64 | }; 65 | 66 | /** 67 | * \var g_tmpuser 68 | * \brief Global reference for the tmpuser module. 69 | */ 70 | static struct tmpuser g_tmpuser; 71 | 72 | /** 73 | * \brief Create a temporary user. 74 | * \param user user name 75 | * \param password user password 76 | * \param domain domain name 77 | * \return 0 if success, -1 otherwise 78 | */ 79 | static int tmpuser_create(const char* user, const char* password, 80 | const char* domain) 81 | { 82 | struct account_desc* desc = NULL; 83 | 84 | if(!g_tmpuser.account_list) 85 | { 86 | return -1; 87 | } 88 | 89 | desc = account_list_find(g_tmpuser.account_list, user, NULL); 90 | 91 | /* user already exist */ 92 | if(desc) 93 | { 94 | return -1; 95 | } 96 | 97 | desc = account_desc_new(user, password, domain, AUTHORIZED); 98 | if(!desc) 99 | { 100 | return -1; 101 | } 102 | 103 | desc->is_tmp = 1; 104 | 105 | account_list_add(g_tmpuser.account_list, desc); 106 | return 0; 107 | } 108 | 109 | /** 110 | * \brief Delete a temporary user. 111 | * \param user user name 112 | * \return 0 if success, -1 otherwise 113 | */ 114 | static int tmpuser_delete(const char* user) 115 | { 116 | struct account_desc* desc = NULL; 117 | 118 | if(!g_tmpuser.account_list) 119 | { 120 | return -1; 121 | } 122 | 123 | desc = account_list_find(g_tmpuser.account_list, user, NULL); 124 | 125 | /* only delete temporary user! */ 126 | if(desc && desc->is_tmp) 127 | { 128 | account_list_remove(g_tmpuser.account_list, desc); 129 | } 130 | else 131 | { 132 | return -1; 133 | } 134 | 135 | return 0; 136 | } 137 | 138 | int tmpuser_init(struct list_head* account_list) 139 | { 140 | INIT_LIST(g_tmpuser.client_list); 141 | 142 | g_tmpuser.account_list = NULL; 143 | g_tmpuser.sock = socket_create(TCP, "localhost", 8086, 0, 1); 144 | 145 | if(g_tmpuser.sock == -1) 146 | { 147 | return -1; 148 | } 149 | 150 | if(listen(g_tmpuser.sock, 5) == -1) 151 | { 152 | close(g_tmpuser.sock); 153 | g_tmpuser.sock = -1; 154 | return -1; 155 | } 156 | 157 | g_tmpuser.account_list = account_list; 158 | g_tmpuser.initialized = 1; 159 | return 0; 160 | } 161 | 162 | int tmpuser_get_socket() 163 | { 164 | return g_tmpuser.sock; 165 | } 166 | 167 | struct list_head* tmpuser_get_tcp_clients(void) 168 | { 169 | return &g_tmpuser.client_list; 170 | } 171 | 172 | void tmpuser_add_tcp_client(struct socket_desc* desc) 173 | { 174 | struct list_head* l = (struct list_head*)&desc->list; 175 | LIST_ADD(l, &g_tmpuser.client_list); 176 | } 177 | 178 | void tmpuser_remove_tcp_client(struct socket_desc* desc) 179 | { 180 | struct list_head* l = (struct list_head*)&desc->list; 181 | LIST_DEL(l); 182 | } 183 | 184 | int tmpuser_process_msg(const char* buf, ssize_t len) 185 | { 186 | int create = 0; 187 | int delete = 0; 188 | char* save_ptr = NULL; 189 | const char* delim = ":"; 190 | char* token = NULL; 191 | char* login = NULL; 192 | char* password = NULL; 193 | char* realm = NULL; 194 | char* buf2 = (char*)buf; 195 | 196 | buf2[len - 1] = 0x00; 197 | 198 | if(len < 1 || !buf) 199 | { 200 | return -1; 201 | } 202 | 203 | token = strtok_r(buf2, delim, &save_ptr); 204 | if(!token) 205 | { 206 | return -1; 207 | } 208 | 209 | if(!strncmp(token, "create ", 7)) 210 | { 211 | create = 1; 212 | login = strdup(token + 7); 213 | } 214 | else if(!strncmp(token, "delete ", 7)) 215 | { 216 | char* bn = NULL; 217 | 218 | delete = 1; 219 | login = strdup(token + 7); 220 | 221 | bn = strchr(login, '\n'); 222 | if(bn) 223 | { 224 | *bn = 0x00; 225 | } 226 | 227 | bn = strchr(login, '\r'); 228 | if(bn) 229 | { 230 | *bn = 0x00; 231 | } 232 | } 233 | else 234 | { 235 | return -1; 236 | } 237 | 238 | if(create) 239 | { 240 | token = strtok_r(NULL, delim, &save_ptr); 241 | if(!token) 242 | { 243 | free(login); 244 | return -1; 245 | } 246 | password = strdup(token); 247 | 248 | token = strtok_r(NULL, delim, &save_ptr); 249 | if(!token) 250 | { 251 | free(login); 252 | free(password); 253 | return -1; 254 | } 255 | realm = strdup(token); 256 | 257 | token = strtok_r(NULL, delim, &save_ptr); 258 | } 259 | 260 | if(create) 261 | { 262 | int r = tmpuser_create(login, password, realm); 263 | free(login); 264 | free(password); 265 | free(realm); 266 | return r; 267 | } 268 | else if(delete) 269 | { 270 | int r = tmpuser_delete(login); 271 | free(login); 272 | return r; 273 | } 274 | 275 | return -1; 276 | } 277 | 278 | void tmpuser_destroy(void) 279 | { 280 | struct list_head* get = NULL; 281 | struct list_head* n = NULL; 282 | 283 | if(!g_tmpuser.initialized) 284 | { 285 | return; 286 | } 287 | 288 | if(g_tmpuser.sock > 0) 289 | { 290 | close(g_tmpuser.sock); 291 | } 292 | 293 | list_iterate_safe(get, n, &g_tmpuser.client_list) 294 | { 295 | struct socket_desc* tmp = list_get(get, struct socket_desc, list); 296 | 297 | if(tmp->sock) 298 | { 299 | close(tmp->sock); 300 | } 301 | free(tmp); 302 | } 303 | 304 | g_tmpuser.sock = -1; 305 | 306 | /* let temporary accounts be deleted in the list cleanup in 307 | * turnserver.c's main() function with the other account 308 | */ 309 | g_tmpuser.account_list = NULL; 310 | 311 | INIT_LIST(g_tmpuser.client_list); 312 | } 313 | 314 | -------------------------------------------------------------------------------- /src/.deps/account.Po: -------------------------------------------------------------------------------- 1 | account.o: account.c /usr/include/stdio.h /usr/include/features.h \ 2 | /usr/include/x86_64-linux-gnu/bits/predefs.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/types.h \ 9 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ 10 | /usr/include/_G_config.h /usr/include/wchar.h \ 11 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ 12 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 13 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ 14 | /usr/include/x86_64-linux-gnu/bits/stdio.h /usr/include/stdlib.h \ 15 | /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 16 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 17 | /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ 18 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ 19 | /usr/include/string.h /usr/include/x86_64-linux-gnu/bits/string.h \ 20 | /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ 21 | /usr/include/x86_64-linux-gnu/bits/endian.h account.h ../config.h list.h \ 22 | protocol.h /usr/include/x86_64-linux-gnu/sys/socket.h \ 23 | /usr/include/x86_64-linux-gnu/sys/uio.h \ 24 | /usr/include/x86_64-linux-gnu/bits/uio.h \ 25 | /usr/include/x86_64-linux-gnu/bits/socket.h \ 26 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ 27 | /usr/include/x86_64-linux-gnu/asm/socket.h \ 28 | /usr/include/asm-generic/socket.h \ 29 | /usr/include/x86_64-linux-gnu/asm/sockios.h \ 30 | /usr/include/asm-generic/sockios.h /usr/include/arpa/inet.h \ 31 | /usr/include/netinet/in.h \ 32 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ 33 | /usr/include/x86_64-linux-gnu/bits/wchar.h \ 34 | /usr/include/x86_64-linux-gnu/bits/in.h \ 35 | /usr/include/x86_64-linux-gnu/bits/byteswap.h turn.h tls_peer.h \ 36 | /usr/include/openssl/ssl.h /usr/include/openssl/e_os2.h \ 37 | /usr/include/openssl/opensslconf.h /usr/include/openssl/comp.h \ 38 | /usr/include/openssl/crypto.h /usr/include/openssl/stack.h \ 39 | /usr/include/openssl/safestack.h /usr/include/openssl/opensslv.h \ 40 | /usr/include/openssl/ossl_typ.h /usr/include/openssl/symhacks.h \ 41 | /usr/include/openssl/bio.h /usr/include/openssl/x509.h \ 42 | /usr/include/openssl/buffer.h /usr/include/openssl/evp.h \ 43 | /usr/include/openssl/objects.h /usr/include/openssl/obj_mac.h \ 44 | /usr/include/openssl/asn1.h /usr/include/x86_64-linux-gnu/bits/time.h \ 45 | /usr/include/openssl/bn.h /usr/include/openssl/ec.h \ 46 | /usr/include/openssl/ecdsa.h /usr/include/openssl/ecdh.h \ 47 | /usr/include/openssl/rsa.h /usr/include/openssl/dsa.h \ 48 | /usr/include/openssl/dh.h /usr/include/openssl/sha.h \ 49 | /usr/include/openssl/x509_vfy.h /usr/include/openssl/lhash.h \ 50 | /usr/include/openssl/pkcs7.h /usr/include/openssl/pem.h \ 51 | /usr/include/openssl/pem2.h /usr/include/openssl/hmac.h \ 52 | /usr/include/openssl/kssl.h /usr/include/openssl/ssl2.h \ 53 | /usr/include/openssl/ssl3.h /usr/include/openssl/tls1.h \ 54 | /usr/include/openssl/dtls1.h /usr/include/openssl/pqueue.h \ 55 | /usr/include/x86_64-linux-gnu/sys/time.h \ 56 | /usr/include/x86_64-linux-gnu/sys/select.h \ 57 | /usr/include/x86_64-linux-gnu/bits/select.h \ 58 | /usr/include/x86_64-linux-gnu/bits/sigset.h /usr/include/openssl/ssl23.h \ 59 | /usr/include/openssl/srtp.h /usr/include/openssl/err.h \ 60 | /usr/include/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h \ 61 | /usr/include/linux/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h \ 62 | /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h 63 | 64 | /usr/include/stdio.h: 65 | 66 | /usr/include/features.h: 67 | 68 | /usr/include/x86_64-linux-gnu/bits/predefs.h: 69 | 70 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 71 | 72 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 73 | 74 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 75 | 76 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 77 | 78 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: 79 | 80 | /usr/include/x86_64-linux-gnu/bits/types.h: 81 | 82 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 83 | 84 | /usr/include/libio.h: 85 | 86 | /usr/include/_G_config.h: 87 | 88 | /usr/include/wchar.h: 89 | 90 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: 91 | 92 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h: 93 | 94 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h: 95 | 96 | /usr/include/x86_64-linux-gnu/bits/stdio.h: 97 | 98 | /usr/include/stdlib.h: 99 | 100 | /usr/include/x86_64-linux-gnu/bits/waitflags.h: 101 | 102 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h: 103 | 104 | /usr/include/x86_64-linux-gnu/sys/types.h: 105 | 106 | /usr/include/time.h: 107 | 108 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: 109 | 110 | /usr/include/alloca.h: 111 | 112 | /usr/include/string.h: 113 | 114 | /usr/include/x86_64-linux-gnu/bits/string.h: 115 | 116 | /usr/include/x86_64-linux-gnu/bits/string2.h: 117 | 118 | /usr/include/endian.h: 119 | 120 | /usr/include/x86_64-linux-gnu/bits/endian.h: 121 | 122 | account.h: 123 | 124 | ../config.h: 125 | 126 | list.h: 127 | 128 | protocol.h: 129 | 130 | /usr/include/x86_64-linux-gnu/sys/socket.h: 131 | 132 | /usr/include/x86_64-linux-gnu/sys/uio.h: 133 | 134 | /usr/include/x86_64-linux-gnu/bits/uio.h: 135 | 136 | /usr/include/x86_64-linux-gnu/bits/socket.h: 137 | 138 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h: 139 | 140 | /usr/include/x86_64-linux-gnu/asm/socket.h: 141 | 142 | /usr/include/asm-generic/socket.h: 143 | 144 | /usr/include/x86_64-linux-gnu/asm/sockios.h: 145 | 146 | /usr/include/asm-generic/sockios.h: 147 | 148 | /usr/include/arpa/inet.h: 149 | 150 | /usr/include/netinet/in.h: 151 | 152 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: 153 | 154 | /usr/include/stdint.h: 155 | 156 | /usr/include/x86_64-linux-gnu/bits/wchar.h: 157 | 158 | /usr/include/x86_64-linux-gnu/bits/in.h: 159 | 160 | /usr/include/x86_64-linux-gnu/bits/byteswap.h: 161 | 162 | turn.h: 163 | 164 | tls_peer.h: 165 | 166 | /usr/include/openssl/ssl.h: 167 | 168 | /usr/include/openssl/e_os2.h: 169 | 170 | /usr/include/openssl/opensslconf.h: 171 | 172 | /usr/include/openssl/comp.h: 173 | 174 | /usr/include/openssl/crypto.h: 175 | 176 | /usr/include/openssl/stack.h: 177 | 178 | /usr/include/openssl/safestack.h: 179 | 180 | /usr/include/openssl/opensslv.h: 181 | 182 | /usr/include/openssl/ossl_typ.h: 183 | 184 | /usr/include/openssl/symhacks.h: 185 | 186 | /usr/include/openssl/bio.h: 187 | 188 | /usr/include/openssl/x509.h: 189 | 190 | /usr/include/openssl/buffer.h: 191 | 192 | /usr/include/openssl/evp.h: 193 | 194 | /usr/include/openssl/objects.h: 195 | 196 | /usr/include/openssl/obj_mac.h: 197 | 198 | /usr/include/openssl/asn1.h: 199 | 200 | /usr/include/x86_64-linux-gnu/bits/time.h: 201 | 202 | /usr/include/openssl/bn.h: 203 | 204 | /usr/include/openssl/ec.h: 205 | 206 | /usr/include/openssl/ecdsa.h: 207 | 208 | /usr/include/openssl/ecdh.h: 209 | 210 | /usr/include/openssl/rsa.h: 211 | 212 | /usr/include/openssl/dsa.h: 213 | 214 | /usr/include/openssl/dh.h: 215 | 216 | /usr/include/openssl/sha.h: 217 | 218 | /usr/include/openssl/x509_vfy.h: 219 | 220 | /usr/include/openssl/lhash.h: 221 | 222 | /usr/include/openssl/pkcs7.h: 223 | 224 | /usr/include/openssl/pem.h: 225 | 226 | /usr/include/openssl/pem2.h: 227 | 228 | /usr/include/openssl/hmac.h: 229 | 230 | /usr/include/openssl/kssl.h: 231 | 232 | /usr/include/openssl/ssl2.h: 233 | 234 | /usr/include/openssl/ssl3.h: 235 | 236 | /usr/include/openssl/tls1.h: 237 | 238 | /usr/include/openssl/dtls1.h: 239 | 240 | /usr/include/openssl/pqueue.h: 241 | 242 | /usr/include/x86_64-linux-gnu/sys/time.h: 243 | 244 | /usr/include/x86_64-linux-gnu/sys/select.h: 245 | 246 | /usr/include/x86_64-linux-gnu/bits/select.h: 247 | 248 | /usr/include/x86_64-linux-gnu/bits/sigset.h: 249 | 250 | /usr/include/openssl/ssl23.h: 251 | 252 | /usr/include/openssl/srtp.h: 253 | 254 | /usr/include/openssl/err.h: 255 | 256 | /usr/include/errno.h: 257 | 258 | /usr/include/x86_64-linux-gnu/bits/errno.h: 259 | 260 | /usr/include/linux/errno.h: 261 | 262 | /usr/include/x86_64-linux-gnu/asm/errno.h: 263 | 264 | /usr/include/asm-generic/errno.h: 265 | 266 | /usr/include/asm-generic/errno-base.h: 267 | -------------------------------------------------------------------------------- /src/.deps/protocol.Po: -------------------------------------------------------------------------------- 1 | protocol.o: protocol.c ../config.h /usr/include/stdlib.h \ 2 | /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 9 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 10 | /usr/include/x86_64-linux-gnu/sys/types.h \ 11 | /usr/include/x86_64-linux-gnu/bits/types.h \ 12 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/time.h \ 13 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ 14 | /usr/include/string.h /usr/include/x86_64-linux-gnu/bits/string.h \ 15 | /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ 16 | /usr/include/x86_64-linux-gnu/bits/endian.h /usr/include/openssl/sha.h \ 17 | /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ 18 | /usr/include/openssl/md5.h /usr/include/openssl/hmac.h \ 19 | /usr/include/openssl/evp.h /usr/include/openssl/ossl_typ.h \ 20 | /usr/include/openssl/symhacks.h /usr/include/openssl/bio.h \ 21 | /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ 22 | /usr/include/wchar.h /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ 23 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 24 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ 25 | /usr/include/x86_64-linux-gnu/bits/stdio.h /usr/include/openssl/crypto.h \ 26 | /usr/include/openssl/stack.h /usr/include/openssl/safestack.h \ 27 | /usr/include/openssl/opensslv.h /usr/include/openssl/objects.h \ 28 | /usr/include/openssl/obj_mac.h /usr/include/openssl/asn1.h \ 29 | /usr/include/x86_64-linux-gnu/bits/time.h /usr/include/openssl/bn.h \ 30 | util_sys.h /usr/include/x86_64-linux-gnu/sys/uio.h \ 31 | /usr/include/x86_64-linux-gnu/bits/uio.h \ 32 | /usr/include/x86_64-linux-gnu/sys/select.h \ 33 | /usr/include/x86_64-linux-gnu/bits/select.h \ 34 | /usr/include/x86_64-linux-gnu/bits/sigset.h \ 35 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ 36 | /usr/include/x86_64-linux-gnu/bits/wchar.h util_crypto.h protocol.h \ 37 | /usr/include/x86_64-linux-gnu/sys/socket.h \ 38 | /usr/include/x86_64-linux-gnu/bits/socket.h \ 39 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ 40 | /usr/include/x86_64-linux-gnu/asm/socket.h \ 41 | /usr/include/asm-generic/socket.h \ 42 | /usr/include/x86_64-linux-gnu/asm/sockios.h \ 43 | /usr/include/asm-generic/sockios.h /usr/include/arpa/inet.h \ 44 | /usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/bits/in.h \ 45 | /usr/include/x86_64-linux-gnu/bits/byteswap.h turn.h tls_peer.h \ 46 | /usr/include/openssl/ssl.h /usr/include/openssl/comp.h \ 47 | /usr/include/openssl/x509.h /usr/include/openssl/buffer.h \ 48 | /usr/include/openssl/ec.h /usr/include/openssl/ecdsa.h \ 49 | /usr/include/openssl/ecdh.h /usr/include/openssl/rsa.h \ 50 | /usr/include/openssl/dsa.h /usr/include/openssl/dh.h \ 51 | /usr/include/openssl/x509_vfy.h /usr/include/openssl/lhash.h \ 52 | /usr/include/openssl/pkcs7.h /usr/include/openssl/pem.h \ 53 | /usr/include/openssl/pem2.h /usr/include/openssl/kssl.h \ 54 | /usr/include/openssl/ssl2.h /usr/include/openssl/ssl3.h \ 55 | /usr/include/openssl/tls1.h /usr/include/openssl/dtls1.h \ 56 | /usr/include/openssl/pqueue.h /usr/include/x86_64-linux-gnu/sys/time.h \ 57 | /usr/include/openssl/ssl23.h /usr/include/openssl/srtp.h \ 58 | /usr/include/openssl/err.h /usr/include/errno.h \ 59 | /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ 60 | /usr/include/x86_64-linux-gnu/asm/errno.h \ 61 | /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ 62 | list.h 63 | 64 | ../config.h: 65 | 66 | /usr/include/stdlib.h: 67 | 68 | /usr/include/features.h: 69 | 70 | /usr/include/x86_64-linux-gnu/bits/predefs.h: 71 | 72 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 73 | 74 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 75 | 76 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 77 | 78 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 79 | 80 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: 81 | 82 | /usr/include/x86_64-linux-gnu/bits/waitflags.h: 83 | 84 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h: 85 | 86 | /usr/include/x86_64-linux-gnu/sys/types.h: 87 | 88 | /usr/include/x86_64-linux-gnu/bits/types.h: 89 | 90 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 91 | 92 | /usr/include/time.h: 93 | 94 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: 95 | 96 | /usr/include/alloca.h: 97 | 98 | /usr/include/string.h: 99 | 100 | /usr/include/x86_64-linux-gnu/bits/string.h: 101 | 102 | /usr/include/x86_64-linux-gnu/bits/string2.h: 103 | 104 | /usr/include/endian.h: 105 | 106 | /usr/include/x86_64-linux-gnu/bits/endian.h: 107 | 108 | /usr/include/openssl/sha.h: 109 | 110 | /usr/include/openssl/e_os2.h: 111 | 112 | /usr/include/openssl/opensslconf.h: 113 | 114 | /usr/include/openssl/md5.h: 115 | 116 | /usr/include/openssl/hmac.h: 117 | 118 | /usr/include/openssl/evp.h: 119 | 120 | /usr/include/openssl/ossl_typ.h: 121 | 122 | /usr/include/openssl/symhacks.h: 123 | 124 | /usr/include/openssl/bio.h: 125 | 126 | /usr/include/stdio.h: 127 | 128 | /usr/include/libio.h: 129 | 130 | /usr/include/_G_config.h: 131 | 132 | /usr/include/wchar.h: 133 | 134 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: 135 | 136 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h: 137 | 138 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h: 139 | 140 | /usr/include/x86_64-linux-gnu/bits/stdio.h: 141 | 142 | /usr/include/openssl/crypto.h: 143 | 144 | /usr/include/openssl/stack.h: 145 | 146 | /usr/include/openssl/safestack.h: 147 | 148 | /usr/include/openssl/opensslv.h: 149 | 150 | /usr/include/openssl/objects.h: 151 | 152 | /usr/include/openssl/obj_mac.h: 153 | 154 | /usr/include/openssl/asn1.h: 155 | 156 | /usr/include/x86_64-linux-gnu/bits/time.h: 157 | 158 | /usr/include/openssl/bn.h: 159 | 160 | util_sys.h: 161 | 162 | /usr/include/x86_64-linux-gnu/sys/uio.h: 163 | 164 | /usr/include/x86_64-linux-gnu/bits/uio.h: 165 | 166 | /usr/include/x86_64-linux-gnu/sys/select.h: 167 | 168 | /usr/include/x86_64-linux-gnu/bits/select.h: 169 | 170 | /usr/include/x86_64-linux-gnu/bits/sigset.h: 171 | 172 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: 173 | 174 | /usr/include/stdint.h: 175 | 176 | /usr/include/x86_64-linux-gnu/bits/wchar.h: 177 | 178 | util_crypto.h: 179 | 180 | protocol.h: 181 | 182 | /usr/include/x86_64-linux-gnu/sys/socket.h: 183 | 184 | /usr/include/x86_64-linux-gnu/bits/socket.h: 185 | 186 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h: 187 | 188 | /usr/include/x86_64-linux-gnu/asm/socket.h: 189 | 190 | /usr/include/asm-generic/socket.h: 191 | 192 | /usr/include/x86_64-linux-gnu/asm/sockios.h: 193 | 194 | /usr/include/asm-generic/sockios.h: 195 | 196 | /usr/include/arpa/inet.h: 197 | 198 | /usr/include/netinet/in.h: 199 | 200 | /usr/include/x86_64-linux-gnu/bits/in.h: 201 | 202 | /usr/include/x86_64-linux-gnu/bits/byteswap.h: 203 | 204 | turn.h: 205 | 206 | tls_peer.h: 207 | 208 | /usr/include/openssl/ssl.h: 209 | 210 | /usr/include/openssl/comp.h: 211 | 212 | /usr/include/openssl/x509.h: 213 | 214 | /usr/include/openssl/buffer.h: 215 | 216 | /usr/include/openssl/ec.h: 217 | 218 | /usr/include/openssl/ecdsa.h: 219 | 220 | /usr/include/openssl/ecdh.h: 221 | 222 | /usr/include/openssl/rsa.h: 223 | 224 | /usr/include/openssl/dsa.h: 225 | 226 | /usr/include/openssl/dh.h: 227 | 228 | /usr/include/openssl/x509_vfy.h: 229 | 230 | /usr/include/openssl/lhash.h: 231 | 232 | /usr/include/openssl/pkcs7.h: 233 | 234 | /usr/include/openssl/pem.h: 235 | 236 | /usr/include/openssl/pem2.h: 237 | 238 | /usr/include/openssl/kssl.h: 239 | 240 | /usr/include/openssl/ssl2.h: 241 | 242 | /usr/include/openssl/ssl3.h: 243 | 244 | /usr/include/openssl/tls1.h: 245 | 246 | /usr/include/openssl/dtls1.h: 247 | 248 | /usr/include/openssl/pqueue.h: 249 | 250 | /usr/include/x86_64-linux-gnu/sys/time.h: 251 | 252 | /usr/include/openssl/ssl23.h: 253 | 254 | /usr/include/openssl/srtp.h: 255 | 256 | /usr/include/openssl/err.h: 257 | 258 | /usr/include/errno.h: 259 | 260 | /usr/include/x86_64-linux-gnu/bits/errno.h: 261 | 262 | /usr/include/linux/errno.h: 263 | 264 | /usr/include/x86_64-linux-gnu/asm/errno.h: 265 | 266 | /usr/include/asm-generic/errno.h: 267 | 268 | /usr/include/asm-generic/errno-base.h: 269 | 270 | list.h: 271 | -------------------------------------------------------------------------------- /compile: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Wrapper for compilers which do not understand '-c -o'. 3 | 4 | scriptversion=2012-03-05.13; # UTC 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free 7 | # Software Foundation, Inc. 8 | # Written by Tom Tromey . 9 | # 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program. If not, see . 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | # This file is maintained in Automake, please report 29 | # bugs to or send patches to 30 | # . 31 | 32 | nl=' 33 | ' 34 | 35 | # We need space, tab and new line, in precisely that order. Quoting is 36 | # there to prevent tools from complaining about whitespace usage. 37 | IFS=" "" $nl" 38 | 39 | file_conv= 40 | 41 | # func_file_conv build_file lazy 42 | # Convert a $build file to $host form and store it in $file 43 | # Currently only supports Windows hosts. If the determined conversion 44 | # type is listed in (the comma separated) LAZY, no conversion will 45 | # take place. 46 | func_file_conv () 47 | { 48 | file=$1 49 | case $file in 50 | / | /[!/]*) # absolute file, and not a UNC file 51 | if test -z "$file_conv"; then 52 | # lazily determine how to convert abs files 53 | case `uname -s` in 54 | MINGW*) 55 | file_conv=mingw 56 | ;; 57 | CYGWIN*) 58 | file_conv=cygwin 59 | ;; 60 | *) 61 | file_conv=wine 62 | ;; 63 | esac 64 | fi 65 | case $file_conv/,$2, in 66 | *,$file_conv,*) 67 | ;; 68 | mingw/*) 69 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` 70 | ;; 71 | cygwin/*) 72 | file=`cygpath -m "$file" || echo "$file"` 73 | ;; 74 | wine/*) 75 | file=`winepath -w "$file" || echo "$file"` 76 | ;; 77 | esac 78 | ;; 79 | esac 80 | } 81 | 82 | # func_cl_dashL linkdir 83 | # Make cl look for libraries in LINKDIR 84 | func_cl_dashL () 85 | { 86 | func_file_conv "$1" 87 | if test -z "$lib_path"; then 88 | lib_path=$file 89 | else 90 | lib_path="$lib_path;$file" 91 | fi 92 | linker_opts="$linker_opts -LIBPATH:$file" 93 | } 94 | 95 | # func_cl_dashl library 96 | # Do a library search-path lookup for cl 97 | func_cl_dashl () 98 | { 99 | lib=$1 100 | found=no 101 | save_IFS=$IFS 102 | IFS=';' 103 | for dir in $lib_path $LIB 104 | do 105 | IFS=$save_IFS 106 | if $shared && test -f "$dir/$lib.dll.lib"; then 107 | found=yes 108 | lib=$dir/$lib.dll.lib 109 | break 110 | fi 111 | if test -f "$dir/$lib.lib"; then 112 | found=yes 113 | lib=$dir/$lib.lib 114 | break 115 | fi 116 | done 117 | IFS=$save_IFS 118 | 119 | if test "$found" != yes; then 120 | lib=$lib.lib 121 | fi 122 | } 123 | 124 | # func_cl_wrapper cl arg... 125 | # Adjust compile command to suit cl 126 | func_cl_wrapper () 127 | { 128 | # Assume a capable shell 129 | lib_path= 130 | shared=: 131 | linker_opts= 132 | for arg 133 | do 134 | if test -n "$eat"; then 135 | eat= 136 | else 137 | case $1 in 138 | -o) 139 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 140 | eat=1 141 | case $2 in 142 | *.o | *.[oO][bB][jJ]) 143 | func_file_conv "$2" 144 | set x "$@" -Fo"$file" 145 | shift 146 | ;; 147 | *) 148 | func_file_conv "$2" 149 | set x "$@" -Fe"$file" 150 | shift 151 | ;; 152 | esac 153 | ;; 154 | -I) 155 | eat=1 156 | func_file_conv "$2" mingw 157 | set x "$@" -I"$file" 158 | shift 159 | ;; 160 | -I*) 161 | func_file_conv "${1#-I}" mingw 162 | set x "$@" -I"$file" 163 | shift 164 | ;; 165 | -l) 166 | eat=1 167 | func_cl_dashl "$2" 168 | set x "$@" "$lib" 169 | shift 170 | ;; 171 | -l*) 172 | func_cl_dashl "${1#-l}" 173 | set x "$@" "$lib" 174 | shift 175 | ;; 176 | -L) 177 | eat=1 178 | func_cl_dashL "$2" 179 | ;; 180 | -L*) 181 | func_cl_dashL "${1#-L}" 182 | ;; 183 | -static) 184 | shared=false 185 | ;; 186 | -Wl,*) 187 | arg=${1#-Wl,} 188 | save_ifs="$IFS"; IFS=',' 189 | for flag in $arg; do 190 | IFS="$save_ifs" 191 | linker_opts="$linker_opts $flag" 192 | done 193 | IFS="$save_ifs" 194 | ;; 195 | -Xlinker) 196 | eat=1 197 | linker_opts="$linker_opts $2" 198 | ;; 199 | -*) 200 | set x "$@" "$1" 201 | shift 202 | ;; 203 | *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) 204 | func_file_conv "$1" 205 | set x "$@" -Tp"$file" 206 | shift 207 | ;; 208 | *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) 209 | func_file_conv "$1" mingw 210 | set x "$@" "$file" 211 | shift 212 | ;; 213 | *) 214 | set x "$@" "$1" 215 | shift 216 | ;; 217 | esac 218 | fi 219 | shift 220 | done 221 | if test -n "$linker_opts"; then 222 | linker_opts="-link$linker_opts" 223 | fi 224 | exec "$@" $linker_opts 225 | exit 1 226 | } 227 | 228 | eat= 229 | 230 | case $1 in 231 | '') 232 | echo "$0: No command. Try '$0 --help' for more information." 1>&2 233 | exit 1; 234 | ;; 235 | -h | --h*) 236 | cat <<\EOF 237 | Usage: compile [--help] [--version] PROGRAM [ARGS] 238 | 239 | Wrapper for compilers which do not understand '-c -o'. 240 | Remove '-o dest.o' from ARGS, run PROGRAM with the remaining 241 | arguments, and rename the output as expected. 242 | 243 | If you are trying to build a whole package this is not the 244 | right script to run: please start by reading the file 'INSTALL'. 245 | 246 | Report bugs to . 247 | EOF 248 | exit $? 249 | ;; 250 | -v | --v*) 251 | echo "compile $scriptversion" 252 | exit $? 253 | ;; 254 | cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) 255 | func_cl_wrapper "$@" # Doesn't return... 256 | ;; 257 | esac 258 | 259 | ofile= 260 | cfile= 261 | 262 | for arg 263 | do 264 | if test -n "$eat"; then 265 | eat= 266 | else 267 | case $1 in 268 | -o) 269 | # configure might choose to run compile as 'compile cc -o foo foo.c'. 270 | # So we strip '-o arg' only if arg is an object. 271 | eat=1 272 | case $2 in 273 | *.o | *.obj) 274 | ofile=$2 275 | ;; 276 | *) 277 | set x "$@" -o "$2" 278 | shift 279 | ;; 280 | esac 281 | ;; 282 | *.c) 283 | cfile=$1 284 | set x "$@" "$1" 285 | shift 286 | ;; 287 | *) 288 | set x "$@" "$1" 289 | shift 290 | ;; 291 | esac 292 | fi 293 | shift 294 | done 295 | 296 | if test -z "$ofile" || test -z "$cfile"; then 297 | # If no '-o' option was seen then we might have been invoked from a 298 | # pattern rule where we don't need one. That is ok -- this is a 299 | # normal compilation that the losing compiler can handle. If no 300 | # '.c' file was seen then we are probably linking. That is also 301 | # ok. 302 | exec "$@" 303 | fi 304 | 305 | # Name of file we expect compiler to create. 306 | cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` 307 | 308 | # Create the lock directory. 309 | # Note: use '[/\\:.-]' here to ensure that we don't use the same name 310 | # that we are using for the .o file. Also, base the name on the expected 311 | # object file name, since that is what matters with a parallel build. 312 | lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d 313 | while true; do 314 | if mkdir "$lockdir" >/dev/null 2>&1; then 315 | break 316 | fi 317 | sleep 1 318 | done 319 | # FIXME: race condition here if user kills between mkdir and trap. 320 | trap "rmdir '$lockdir'; exit 1" 1 2 15 321 | 322 | # Run the compile. 323 | "$@" 324 | ret=$? 325 | 326 | if test -f "$cofile"; then 327 | test "$cofile" = "$ofile" || mv "$cofile" "$ofile" 328 | elif test -f "${cofile}bj"; then 329 | test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" 330 | fi 331 | 332 | rmdir "$lockdir" 333 | exit $ret 334 | 335 | # Local Variables: 336 | # mode: shell-script 337 | # sh-indentation: 2 338 | # eval: (add-hook 'write-file-hooks 'time-stamp) 339 | # time-stamp-start: "scriptversion=" 340 | # time-stamp-format: "%:y-%02m-%02d.%02H" 341 | # time-stamp-time-zone: "UTC" 342 | # time-stamp-end: "; # UTC" 343 | # End: 344 | -------------------------------------------------------------------------------- /src/.deps/test_turn_client.Po: -------------------------------------------------------------------------------- 1 | test_turn_client.o: test_turn_client.c ../config.h /usr/include/stdio.h \ 2 | /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/types.h \ 9 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ 10 | /usr/include/_G_config.h /usr/include/wchar.h \ 11 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ 12 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 13 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ 14 | /usr/include/x86_64-linux-gnu/bits/stdio.h /usr/include/stdlib.h \ 15 | /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 16 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 17 | /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ 18 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ 19 | /usr/include/string.h /usr/include/x86_64-linux-gnu/bits/string.h \ 20 | /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ 21 | /usr/include/x86_64-linux-gnu/bits/endian.h /usr/include/getopt.h \ 22 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ 23 | /usr/include/x86_64-linux-gnu/bits/wchar.h /usr/include/unistd.h \ 24 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ 25 | /usr/include/x86_64-linux-gnu/bits/environments.h \ 26 | /usr/include/x86_64-linux-gnu/bits/confname.h \ 27 | /usr/include/x86_64-linux-gnu/sys/socket.h \ 28 | /usr/include/x86_64-linux-gnu/sys/uio.h \ 29 | /usr/include/x86_64-linux-gnu/bits/uio.h \ 30 | /usr/include/x86_64-linux-gnu/bits/socket.h \ 31 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ 32 | /usr/include/x86_64-linux-gnu/asm/socket.h \ 33 | /usr/include/asm-generic/socket.h \ 34 | /usr/include/x86_64-linux-gnu/asm/sockios.h \ 35 | /usr/include/asm-generic/sockios.h \ 36 | /usr/include/x86_64-linux-gnu/sys/select.h \ 37 | /usr/include/x86_64-linux-gnu/bits/select.h \ 38 | /usr/include/x86_64-linux-gnu/bits/sigset.h \ 39 | /usr/include/x86_64-linux-gnu/bits/time.h /usr/include/netinet/in.h \ 40 | /usr/include/x86_64-linux-gnu/bits/in.h \ 41 | /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/arpa/inet.h \ 42 | /usr/include/netdb.h /usr/include/rpc/netdb.h \ 43 | /usr/include/x86_64-linux-gnu/bits/netdb.h util_sys.h util_crypto.h \ 44 | protocol.h turn.h tls_peer.h /usr/include/openssl/ssl.h \ 45 | /usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \ 46 | /usr/include/openssl/comp.h /usr/include/openssl/crypto.h \ 47 | /usr/include/openssl/stack.h /usr/include/openssl/safestack.h \ 48 | /usr/include/openssl/opensslv.h /usr/include/openssl/ossl_typ.h \ 49 | /usr/include/openssl/symhacks.h /usr/include/openssl/bio.h \ 50 | /usr/include/openssl/x509.h /usr/include/openssl/buffer.h \ 51 | /usr/include/openssl/evp.h /usr/include/openssl/objects.h \ 52 | /usr/include/openssl/obj_mac.h /usr/include/openssl/asn1.h \ 53 | /usr/include/openssl/bn.h /usr/include/openssl/ec.h \ 54 | /usr/include/openssl/ecdsa.h /usr/include/openssl/ecdh.h \ 55 | /usr/include/openssl/rsa.h /usr/include/openssl/dsa.h \ 56 | /usr/include/openssl/dh.h /usr/include/openssl/sha.h \ 57 | /usr/include/openssl/x509_vfy.h /usr/include/openssl/lhash.h \ 58 | /usr/include/openssl/pkcs7.h /usr/include/openssl/pem.h \ 59 | /usr/include/openssl/pem2.h /usr/include/openssl/hmac.h \ 60 | /usr/include/openssl/kssl.h /usr/include/openssl/ssl2.h \ 61 | /usr/include/openssl/ssl3.h /usr/include/openssl/tls1.h \ 62 | /usr/include/openssl/dtls1.h /usr/include/openssl/pqueue.h \ 63 | /usr/include/x86_64-linux-gnu/sys/time.h /usr/include/openssl/ssl23.h \ 64 | /usr/include/openssl/srtp.h /usr/include/openssl/err.h \ 65 | /usr/include/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h \ 66 | /usr/include/linux/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h \ 67 | /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ 68 | list.h 69 | 70 | ../config.h: 71 | 72 | /usr/include/stdio.h: 73 | 74 | /usr/include/features.h: 75 | 76 | /usr/include/x86_64-linux-gnu/bits/predefs.h: 77 | 78 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 79 | 80 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 81 | 82 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 83 | 84 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 85 | 86 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: 87 | 88 | /usr/include/x86_64-linux-gnu/bits/types.h: 89 | 90 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 91 | 92 | /usr/include/libio.h: 93 | 94 | /usr/include/_G_config.h: 95 | 96 | /usr/include/wchar.h: 97 | 98 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: 99 | 100 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h: 101 | 102 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h: 103 | 104 | /usr/include/x86_64-linux-gnu/bits/stdio.h: 105 | 106 | /usr/include/stdlib.h: 107 | 108 | /usr/include/x86_64-linux-gnu/bits/waitflags.h: 109 | 110 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h: 111 | 112 | /usr/include/x86_64-linux-gnu/sys/types.h: 113 | 114 | /usr/include/time.h: 115 | 116 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: 117 | 118 | /usr/include/alloca.h: 119 | 120 | /usr/include/string.h: 121 | 122 | /usr/include/x86_64-linux-gnu/bits/string.h: 123 | 124 | /usr/include/x86_64-linux-gnu/bits/string2.h: 125 | 126 | /usr/include/endian.h: 127 | 128 | /usr/include/x86_64-linux-gnu/bits/endian.h: 129 | 130 | /usr/include/getopt.h: 131 | 132 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: 133 | 134 | /usr/include/stdint.h: 135 | 136 | /usr/include/x86_64-linux-gnu/bits/wchar.h: 137 | 138 | /usr/include/unistd.h: 139 | 140 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h: 141 | 142 | /usr/include/x86_64-linux-gnu/bits/environments.h: 143 | 144 | /usr/include/x86_64-linux-gnu/bits/confname.h: 145 | 146 | /usr/include/x86_64-linux-gnu/sys/socket.h: 147 | 148 | /usr/include/x86_64-linux-gnu/sys/uio.h: 149 | 150 | /usr/include/x86_64-linux-gnu/bits/uio.h: 151 | 152 | /usr/include/x86_64-linux-gnu/bits/socket.h: 153 | 154 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h: 155 | 156 | /usr/include/x86_64-linux-gnu/asm/socket.h: 157 | 158 | /usr/include/asm-generic/socket.h: 159 | 160 | /usr/include/x86_64-linux-gnu/asm/sockios.h: 161 | 162 | /usr/include/asm-generic/sockios.h: 163 | 164 | /usr/include/x86_64-linux-gnu/sys/select.h: 165 | 166 | /usr/include/x86_64-linux-gnu/bits/select.h: 167 | 168 | /usr/include/x86_64-linux-gnu/bits/sigset.h: 169 | 170 | /usr/include/x86_64-linux-gnu/bits/time.h: 171 | 172 | /usr/include/netinet/in.h: 173 | 174 | /usr/include/x86_64-linux-gnu/bits/in.h: 175 | 176 | /usr/include/x86_64-linux-gnu/bits/byteswap.h: 177 | 178 | /usr/include/arpa/inet.h: 179 | 180 | /usr/include/netdb.h: 181 | 182 | /usr/include/rpc/netdb.h: 183 | 184 | /usr/include/x86_64-linux-gnu/bits/netdb.h: 185 | 186 | util_sys.h: 187 | 188 | util_crypto.h: 189 | 190 | protocol.h: 191 | 192 | turn.h: 193 | 194 | tls_peer.h: 195 | 196 | /usr/include/openssl/ssl.h: 197 | 198 | /usr/include/openssl/e_os2.h: 199 | 200 | /usr/include/openssl/opensslconf.h: 201 | 202 | /usr/include/openssl/comp.h: 203 | 204 | /usr/include/openssl/crypto.h: 205 | 206 | /usr/include/openssl/stack.h: 207 | 208 | /usr/include/openssl/safestack.h: 209 | 210 | /usr/include/openssl/opensslv.h: 211 | 212 | /usr/include/openssl/ossl_typ.h: 213 | 214 | /usr/include/openssl/symhacks.h: 215 | 216 | /usr/include/openssl/bio.h: 217 | 218 | /usr/include/openssl/x509.h: 219 | 220 | /usr/include/openssl/buffer.h: 221 | 222 | /usr/include/openssl/evp.h: 223 | 224 | /usr/include/openssl/objects.h: 225 | 226 | /usr/include/openssl/obj_mac.h: 227 | 228 | /usr/include/openssl/asn1.h: 229 | 230 | /usr/include/openssl/bn.h: 231 | 232 | /usr/include/openssl/ec.h: 233 | 234 | /usr/include/openssl/ecdsa.h: 235 | 236 | /usr/include/openssl/ecdh.h: 237 | 238 | /usr/include/openssl/rsa.h: 239 | 240 | /usr/include/openssl/dsa.h: 241 | 242 | /usr/include/openssl/dh.h: 243 | 244 | /usr/include/openssl/sha.h: 245 | 246 | /usr/include/openssl/x509_vfy.h: 247 | 248 | /usr/include/openssl/lhash.h: 249 | 250 | /usr/include/openssl/pkcs7.h: 251 | 252 | /usr/include/openssl/pem.h: 253 | 254 | /usr/include/openssl/pem2.h: 255 | 256 | /usr/include/openssl/hmac.h: 257 | 258 | /usr/include/openssl/kssl.h: 259 | 260 | /usr/include/openssl/ssl2.h: 261 | 262 | /usr/include/openssl/ssl3.h: 263 | 264 | /usr/include/openssl/tls1.h: 265 | 266 | /usr/include/openssl/dtls1.h: 267 | 268 | /usr/include/openssl/pqueue.h: 269 | 270 | /usr/include/x86_64-linux-gnu/sys/time.h: 271 | 272 | /usr/include/openssl/ssl23.h: 273 | 274 | /usr/include/openssl/srtp.h: 275 | 276 | /usr/include/openssl/err.h: 277 | 278 | /usr/include/errno.h: 279 | 280 | /usr/include/x86_64-linux-gnu/bits/errno.h: 281 | 282 | /usr/include/linux/errno.h: 283 | 284 | /usr/include/x86_64-linux-gnu/asm/errno.h: 285 | 286 | /usr/include/asm-generic/errno.h: 287 | 288 | /usr/include/asm-generic/errno-base.h: 289 | 290 | list.h: 291 | -------------------------------------------------------------------------------- /src/.deps/tls_peer.Po: -------------------------------------------------------------------------------- 1 | tls_peer.o: tls_peer.c ../config.h /usr/include/stdio.h \ 2 | /usr/include/features.h /usr/include/x86_64-linux-gnu/bits/predefs.h \ 3 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 4 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 5 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 6 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 7 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h \ 8 | /usr/include/x86_64-linux-gnu/bits/types.h \ 9 | /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ 10 | /usr/include/_G_config.h /usr/include/wchar.h \ 11 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h \ 12 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 13 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ 14 | /usr/include/x86_64-linux-gnu/bits/stdio.h /usr/include/stdlib.h \ 15 | /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 16 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 17 | /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ 18 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ 19 | /usr/include/string.h /usr/include/x86_64-linux-gnu/bits/string.h \ 20 | /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ 21 | /usr/include/x86_64-linux-gnu/bits/endian.h /usr/include/unistd.h \ 22 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ 23 | /usr/include/x86_64-linux-gnu/bits/environments.h \ 24 | /usr/include/x86_64-linux-gnu/bits/confname.h /usr/include/getopt.h \ 25 | /usr/include/x86_64-linux-gnu/sys/socket.h \ 26 | /usr/include/x86_64-linux-gnu/sys/uio.h \ 27 | /usr/include/x86_64-linux-gnu/bits/uio.h \ 28 | /usr/include/x86_64-linux-gnu/bits/socket.h \ 29 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ 30 | /usr/include/x86_64-linux-gnu/asm/socket.h \ 31 | /usr/include/asm-generic/socket.h \ 32 | /usr/include/x86_64-linux-gnu/asm/sockios.h \ 33 | /usr/include/asm-generic/sockios.h \ 34 | /usr/include/x86_64-linux-gnu/sys/select.h \ 35 | /usr/include/x86_64-linux-gnu/bits/select.h \ 36 | /usr/include/x86_64-linux-gnu/bits/sigset.h \ 37 | /usr/include/x86_64-linux-gnu/bits/time.h /usr/include/netinet/tcp.h \ 38 | /usr/include/arpa/inet.h /usr/include/netinet/in.h \ 39 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h /usr/include/stdint.h \ 40 | /usr/include/x86_64-linux-gnu/bits/wchar.h \ 41 | /usr/include/x86_64-linux-gnu/bits/in.h \ 42 | /usr/include/x86_64-linux-gnu/bits/byteswap.h /usr/include/netdb.h \ 43 | /usr/include/rpc/netdb.h /usr/include/x86_64-linux-gnu/bits/netdb.h \ 44 | /usr/include/openssl/evp.h /usr/include/openssl/opensslconf.h \ 45 | /usr/include/openssl/ossl_typ.h /usr/include/openssl/e_os2.h \ 46 | /usr/include/openssl/symhacks.h /usr/include/openssl/bio.h \ 47 | /usr/include/openssl/crypto.h /usr/include/openssl/stack.h \ 48 | /usr/include/openssl/safestack.h /usr/include/openssl/opensslv.h \ 49 | /usr/include/openssl/objects.h /usr/include/openssl/obj_mac.h \ 50 | /usr/include/openssl/asn1.h /usr/include/openssl/bn.h \ 51 | /usr/include/openssl/pem.h /usr/include/openssl/x509.h \ 52 | /usr/include/openssl/buffer.h /usr/include/openssl/ec.h \ 53 | /usr/include/openssl/ecdsa.h /usr/include/openssl/ecdh.h \ 54 | /usr/include/openssl/rsa.h /usr/include/openssl/dsa.h \ 55 | /usr/include/openssl/dh.h /usr/include/openssl/sha.h \ 56 | /usr/include/openssl/x509_vfy.h /usr/include/openssl/lhash.h \ 57 | /usr/include/openssl/pkcs7.h /usr/include/openssl/pem2.h \ 58 | /usr/include/openssl/x509v3.h /usr/include/openssl/conf.h tls_peer.h \ 59 | /usr/include/openssl/ssl.h /usr/include/openssl/comp.h \ 60 | /usr/include/openssl/hmac.h /usr/include/openssl/kssl.h \ 61 | /usr/include/openssl/ssl2.h /usr/include/openssl/ssl3.h \ 62 | /usr/include/openssl/tls1.h /usr/include/openssl/dtls1.h \ 63 | /usr/include/openssl/pqueue.h /usr/include/x86_64-linux-gnu/sys/time.h \ 64 | /usr/include/openssl/ssl23.h /usr/include/openssl/srtp.h \ 65 | /usr/include/openssl/err.h /usr/include/errno.h \ 66 | /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ 67 | /usr/include/x86_64-linux-gnu/asm/errno.h \ 68 | /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ 69 | list.h 70 | 71 | ../config.h: 72 | 73 | /usr/include/stdio.h: 74 | 75 | /usr/include/features.h: 76 | 77 | /usr/include/x86_64-linux-gnu/bits/predefs.h: 78 | 79 | /usr/include/x86_64-linux-gnu/sys/cdefs.h: 80 | 81 | /usr/include/x86_64-linux-gnu/bits/wordsize.h: 82 | 83 | /usr/include/x86_64-linux-gnu/gnu/stubs.h: 84 | 85 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h: 86 | 87 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h: 88 | 89 | /usr/include/x86_64-linux-gnu/bits/types.h: 90 | 91 | /usr/include/x86_64-linux-gnu/bits/typesizes.h: 92 | 93 | /usr/include/libio.h: 94 | 95 | /usr/include/_G_config.h: 96 | 97 | /usr/include/wchar.h: 98 | 99 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdarg.h: 100 | 101 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h: 102 | 103 | /usr/include/x86_64-linux-gnu/bits/sys_errlist.h: 104 | 105 | /usr/include/x86_64-linux-gnu/bits/stdio.h: 106 | 107 | /usr/include/stdlib.h: 108 | 109 | /usr/include/x86_64-linux-gnu/bits/waitflags.h: 110 | 111 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h: 112 | 113 | /usr/include/x86_64-linux-gnu/sys/types.h: 114 | 115 | /usr/include/time.h: 116 | 117 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: 118 | 119 | /usr/include/alloca.h: 120 | 121 | /usr/include/string.h: 122 | 123 | /usr/include/x86_64-linux-gnu/bits/string.h: 124 | 125 | /usr/include/x86_64-linux-gnu/bits/string2.h: 126 | 127 | /usr/include/endian.h: 128 | 129 | /usr/include/x86_64-linux-gnu/bits/endian.h: 130 | 131 | /usr/include/unistd.h: 132 | 133 | /usr/include/x86_64-linux-gnu/bits/posix_opt.h: 134 | 135 | /usr/include/x86_64-linux-gnu/bits/environments.h: 136 | 137 | /usr/include/x86_64-linux-gnu/bits/confname.h: 138 | 139 | /usr/include/getopt.h: 140 | 141 | /usr/include/x86_64-linux-gnu/sys/socket.h: 142 | 143 | /usr/include/x86_64-linux-gnu/sys/uio.h: 144 | 145 | /usr/include/x86_64-linux-gnu/bits/uio.h: 146 | 147 | /usr/include/x86_64-linux-gnu/bits/socket.h: 148 | 149 | /usr/include/x86_64-linux-gnu/bits/sockaddr.h: 150 | 151 | /usr/include/x86_64-linux-gnu/asm/socket.h: 152 | 153 | /usr/include/asm-generic/socket.h: 154 | 155 | /usr/include/x86_64-linux-gnu/asm/sockios.h: 156 | 157 | /usr/include/asm-generic/sockios.h: 158 | 159 | /usr/include/x86_64-linux-gnu/sys/select.h: 160 | 161 | /usr/include/x86_64-linux-gnu/bits/select.h: 162 | 163 | /usr/include/x86_64-linux-gnu/bits/sigset.h: 164 | 165 | /usr/include/x86_64-linux-gnu/bits/time.h: 166 | 167 | /usr/include/netinet/tcp.h: 168 | 169 | /usr/include/arpa/inet.h: 170 | 171 | /usr/include/netinet/in.h: 172 | 173 | /usr/lib/gcc/x86_64-linux-gnu/4.7/include/stdint.h: 174 | 175 | /usr/include/stdint.h: 176 | 177 | /usr/include/x86_64-linux-gnu/bits/wchar.h: 178 | 179 | /usr/include/x86_64-linux-gnu/bits/in.h: 180 | 181 | /usr/include/x86_64-linux-gnu/bits/byteswap.h: 182 | 183 | /usr/include/netdb.h: 184 | 185 | /usr/include/rpc/netdb.h: 186 | 187 | /usr/include/x86_64-linux-gnu/bits/netdb.h: 188 | 189 | /usr/include/openssl/evp.h: 190 | 191 | /usr/include/openssl/opensslconf.h: 192 | 193 | /usr/include/openssl/ossl_typ.h: 194 | 195 | /usr/include/openssl/e_os2.h: 196 | 197 | /usr/include/openssl/symhacks.h: 198 | 199 | /usr/include/openssl/bio.h: 200 | 201 | /usr/include/openssl/crypto.h: 202 | 203 | /usr/include/openssl/stack.h: 204 | 205 | /usr/include/openssl/safestack.h: 206 | 207 | /usr/include/openssl/opensslv.h: 208 | 209 | /usr/include/openssl/objects.h: 210 | 211 | /usr/include/openssl/obj_mac.h: 212 | 213 | /usr/include/openssl/asn1.h: 214 | 215 | /usr/include/openssl/bn.h: 216 | 217 | /usr/include/openssl/pem.h: 218 | 219 | /usr/include/openssl/x509.h: 220 | 221 | /usr/include/openssl/buffer.h: 222 | 223 | /usr/include/openssl/ec.h: 224 | 225 | /usr/include/openssl/ecdsa.h: 226 | 227 | /usr/include/openssl/ecdh.h: 228 | 229 | /usr/include/openssl/rsa.h: 230 | 231 | /usr/include/openssl/dsa.h: 232 | 233 | /usr/include/openssl/dh.h: 234 | 235 | /usr/include/openssl/sha.h: 236 | 237 | /usr/include/openssl/x509_vfy.h: 238 | 239 | /usr/include/openssl/lhash.h: 240 | 241 | /usr/include/openssl/pkcs7.h: 242 | 243 | /usr/include/openssl/pem2.h: 244 | 245 | /usr/include/openssl/x509v3.h: 246 | 247 | /usr/include/openssl/conf.h: 248 | 249 | tls_peer.h: 250 | 251 | /usr/include/openssl/ssl.h: 252 | 253 | /usr/include/openssl/comp.h: 254 | 255 | /usr/include/openssl/hmac.h: 256 | 257 | /usr/include/openssl/kssl.h: 258 | 259 | /usr/include/openssl/ssl2.h: 260 | 261 | /usr/include/openssl/ssl3.h: 262 | 263 | /usr/include/openssl/tls1.h: 264 | 265 | /usr/include/openssl/dtls1.h: 266 | 267 | /usr/include/openssl/pqueue.h: 268 | 269 | /usr/include/x86_64-linux-gnu/sys/time.h: 270 | 271 | /usr/include/openssl/ssl23.h: 272 | 273 | /usr/include/openssl/srtp.h: 274 | 275 | /usr/include/openssl/err.h: 276 | 277 | /usr/include/errno.h: 278 | 279 | /usr/include/x86_64-linux-gnu/bits/errno.h: 280 | 281 | /usr/include/linux/errno.h: 282 | 283 | /usr/include/x86_64-linux-gnu/asm/errno.h: 284 | 285 | /usr/include/asm-generic/errno.h: 286 | 287 | /usr/include/asm-generic/errno-base.h: 288 | 289 | list.h: 290 | -------------------------------------------------------------------------------- /autom4te.cache/requests: -------------------------------------------------------------------------------- 1 | # This file was generated by Autom4te Sun Apr 29 21:48:16 UTC 2012. 2 | # It contains the lists of macros which have been traced. 3 | # It can be safely removed. 4 | 5 | @request = ( 6 | bless( [ 7 | '0', 8 | 1, 9 | [ 10 | '/usr/share/autoconf' 11 | ], 12 | [ 13 | '/usr/share/autoconf/autoconf/autoconf.m4f', 14 | '/usr/share/aclocal/pkg.m4', 15 | '/usr/share/aclocal-1.11/amversion.m4', 16 | '/usr/share/aclocal-1.11/auxdir.m4', 17 | '/usr/share/aclocal-1.11/cond.m4', 18 | '/usr/share/aclocal-1.11/depend.m4', 19 | '/usr/share/aclocal-1.11/depout.m4', 20 | '/usr/share/aclocal-1.11/init.m4', 21 | '/usr/share/aclocal-1.11/install-sh.m4', 22 | '/usr/share/aclocal-1.11/lead-dot.m4', 23 | '/usr/share/aclocal-1.11/make.m4', 24 | '/usr/share/aclocal-1.11/minuso.m4', 25 | '/usr/share/aclocal-1.11/missing.m4', 26 | '/usr/share/aclocal-1.11/mkdirp.m4', 27 | '/usr/share/aclocal-1.11/options.m4', 28 | '/usr/share/aclocal-1.11/runlog.m4', 29 | '/usr/share/aclocal-1.11/sanity.m4', 30 | '/usr/share/aclocal-1.11/silent.m4', 31 | '/usr/share/aclocal-1.11/strip.m4', 32 | '/usr/share/aclocal-1.11/substnot.m4', 33 | '/usr/share/aclocal-1.11/tar.m4', 34 | 'acinclude.m4', 35 | 'configure.in' 36 | ], 37 | { 38 | 'DX_RTF_FEATURE' => 1, 39 | 'm4_pattern_forbid' => 1, 40 | 'AC_DEFUN' => 1, 41 | 'AM_PROG_MKDIR_P' => 1, 42 | 'DX_FEATURE_chi' => 1, 43 | 'DX_IF_FEATURE' => 1, 44 | 'DX_CHM_FEATURE' => 1, 45 | 'AM_AUTOMAKE_VERSION' => 1, 46 | 'DX_FEATURE_doc' => 1, 47 | 'DX_PDF_FEATURE' => 1, 48 | 'AM_MISSING_HAS_RUN' => 1, 49 | 'AM_SUBST_NOTMAKE' => 1, 50 | 'AM_MISSING_PROG' => 1, 51 | 'AM_PROG_INSTALL_STRIP' => 1, 52 | '_PKG_SHORT_ERRORS_SUPPORTED' => 1, 53 | '_m4_warn' => 1, 54 | 'AM_SANITY_CHECK' => 1, 55 | 'PKG_CHECK_EXISTS' => 1, 56 | 'DX_CHI_FEATURE' => 1, 57 | '_AM_PROG_TAR' => 1, 58 | 'DX_CURRENT_FEATURE' => 1, 59 | 'DX_CLEAR_DEPEND' => 1, 60 | 'AM_DEP_TRACK' => 1, 61 | 'DX_HTML_FEATURE' => 1, 62 | '_AM_IF_OPTION' => 1, 63 | '_AM_SUBST_NOTMAKE' => 1, 64 | 'm4_pattern_allow' => 1, 65 | '_AM_AUTOCONF_VERSION' => 1, 66 | 'AM_SET_LEADING_DOT' => 1, 67 | 'DX_DIRNAME_EXPR' => 1, 68 | '_AM_DEPENDENCIES' => 1, 69 | 'DX_FEATURE_man' => 1, 70 | 'DX_DOXYGEN_FEATURE' => 1, 71 | 'PKG_CHECK_MODULES' => 1, 72 | 'DX_PS_FEATURE' => 1, 73 | 'AU_DEFUN' => 1, 74 | 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, 75 | 'DX_MAN_FEATURE' => 1, 76 | '_AM_SET_OPTION' => 1, 77 | 'DX_FEATURE_chm' => 1, 78 | 'AM_INIT_AUTOMAKE' => 1, 79 | 'DX_FEATURE_rtf' => 1, 80 | 'DX_INIT_DOXYGEN' => 1, 81 | 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 82 | 'AC_DEFUN_ONCE' => 1, 83 | 'DX_XML_FEATURE' => 1, 84 | 'DX_TEST_FEATURE' => 1, 85 | 'DX_ENV_APPEND' => 1, 86 | 'AM_SILENT_RULES' => 1, 87 | 'DX_CHECK_DEPEND' => 1, 88 | 'DX_FEATURE_pdf' => 1, 89 | 'include' => 1, 90 | 'DX_REQUIRE_PROG' => 1, 91 | 'DX_ARG_ABLE' => 1, 92 | 'AM_AUX_DIR_EXPAND' => 1, 93 | 'DX_FEATURE_html' => 1, 94 | 'DX_CURRENT_DESCRIPTION' => 1, 95 | '_AM_SET_OPTIONS' => 1, 96 | '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 97 | 'AM_RUN_LOG' => 1, 98 | 'AM_PROG_CC_C_O' => 1, 99 | '_AM_MANGLE_OPTION' => 1, 100 | 'AM_CONDITIONAL' => 1, 101 | 'DX_FEATURE_xml' => 1, 102 | 'AM_SET_DEPDIR' => 1, 103 | 'DX_FEATURE_dot' => 1, 104 | 'PKG_PROG_PKG_CONFIG' => 1, 105 | 'AM_PROG_INSTALL_SH' => 1, 106 | 'm4_include' => 1, 107 | 'DX_FEATURE_ps' => 1, 108 | '_AC_AM_CONFIG_HEADER_HOOK' => 1, 109 | 'AM_MAKE_INCLUDE' => 1 110 | } 111 | ], 'Autom4te::Request' ), 112 | bless( [ 113 | '1', 114 | 1, 115 | [ 116 | '/usr/share/autoconf' 117 | ], 118 | [ 119 | '/usr/share/autoconf/autoconf/autoconf.m4f', 120 | 'aclocal.m4', 121 | 'configure.in' 122 | ], 123 | { 124 | '_LT_AC_TAGCONFIG' => 1, 125 | 'AM_PROG_F77_C_O' => 1, 126 | 'm4_pattern_forbid' => 1, 127 | 'AC_INIT' => 1, 128 | '_AM_COND_IF' => 1, 129 | 'AC_CANONICAL_TARGET' => 1, 130 | 'AC_SUBST' => 1, 131 | 'AC_CONFIG_LIBOBJ_DIR' => 1, 132 | 'AC_FC_SRCEXT' => 1, 133 | 'AC_CANONICAL_HOST' => 1, 134 | 'AC_PROG_LIBTOOL' => 1, 135 | 'AM_INIT_AUTOMAKE' => 1, 136 | 'AM_PATH_GUILE' => 1, 137 | 'AC_CONFIG_SUBDIRS' => 1, 138 | 'AM_AUTOMAKE_VERSION' => 1, 139 | 'LT_CONFIG_LTDL_DIR' => 1, 140 | 'AC_REQUIRE_AUX_FILE' => 1, 141 | 'AC_CONFIG_LINKS' => 1, 142 | 'm4_sinclude' => 1, 143 | 'LT_SUPPORTED_TAG' => 1, 144 | 'AM_MAINTAINER_MODE' => 1, 145 | 'AM_NLS' => 1, 146 | 'AC_FC_PP_DEFINE' => 1, 147 | 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, 148 | 'AM_MAKEFILE_INCLUDE' => 1, 149 | '_m4_warn' => 1, 150 | 'AM_PROG_CXX_C_O' => 1, 151 | '_AM_COND_ENDIF' => 1, 152 | '_AM_MAKEFILE_INCLUDE' => 1, 153 | 'AM_ENABLE_MULTILIB' => 1, 154 | 'AM_SILENT_RULES' => 1, 155 | 'AM_PROG_MOC' => 1, 156 | 'AC_CONFIG_FILES' => 1, 157 | 'LT_INIT' => 1, 158 | 'include' => 1, 159 | 'AM_PROG_AR' => 1, 160 | 'AM_GNU_GETTEXT' => 1, 161 | 'AC_LIBSOURCE' => 1, 162 | 'AM_PROG_FC_C_O' => 1, 163 | 'AC_CANONICAL_BUILD' => 1, 164 | 'AC_FC_FREEFORM' => 1, 165 | 'AH_OUTPUT' => 1, 166 | 'AC_FC_PP_SRCEXT' => 1, 167 | '_AM_SUBST_NOTMAKE' => 1, 168 | 'AC_CONFIG_AUX_DIR' => 1, 169 | 'sinclude' => 1, 170 | 'AM_PROG_CC_C_O' => 1, 171 | 'm4_pattern_allow' => 1, 172 | 'AM_XGETTEXT_OPTION' => 1, 173 | 'AC_CANONICAL_SYSTEM' => 1, 174 | 'AM_CONDITIONAL' => 1, 175 | 'AC_CONFIG_HEADERS' => 1, 176 | 'AC_DEFINE_TRACE_LITERAL' => 1, 177 | 'AM_POT_TOOLS' => 1, 178 | 'm4_include' => 1, 179 | '_AM_COND_ELSE' => 1, 180 | 'AC_SUBST_TRACE' => 1 181 | } 182 | ], 'Autom4te::Request' ) 183 | ); 184 | 185 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.in by autoheader. */ 2 | 3 | /* Enable debug build */ 4 | #undef DEBUG_BUILD 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_ARPA_INET_H 8 | 9 | /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you 10 | don't. */ 11 | #undef HAVE_DECL_STRERROR_R 12 | 13 | /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ 14 | #undef HAVE_DOPRNT 15 | 16 | /* Define to 1 if you have the `dup2' function. */ 17 | #undef HAVE_DUP2 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #undef HAVE_FCNTL_H 21 | 22 | /* Define to 1 if you have the `fork' function. */ 23 | #undef HAVE_FORK 24 | 25 | /* Define to 1 if you have the `gettimeofday' function. */ 26 | #undef HAVE_GETTIMEOFDAY 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #undef HAVE_INTTYPES_H 30 | 31 | /* Define to 1 if you have the `confuse' library (-lconfuse). */ 32 | #undef HAVE_LIBCONFUSE 33 | 34 | /* Define to 1 if you have the `crypto' library (-lcrypto). */ 35 | #undef HAVE_LIBCRYPTO 36 | 37 | /* Define to 1 if you have the `rt' library (-lrt). */ 38 | #undef HAVE_LIBRT 39 | 40 | /* Define to 1 if you have the `ssl' library (-lssl). */ 41 | #undef HAVE_LIBSSL 42 | 43 | /* Define to 1 if you have the header file. */ 44 | #undef HAVE_LIMITS_H 45 | 46 | /* Define to 1 if your system has a GNU libc compatible `malloc' function, and 47 | to 0 otherwise. */ 48 | #undef HAVE_MALLOC 49 | 50 | /* Define to 1 if you have the header file. */ 51 | #undef HAVE_MEMORY_H 52 | 53 | /* Define to 1 if you have the `memset' function. */ 54 | #undef HAVE_MEMSET 55 | 56 | /* Define to 1 if you have the header file. */ 57 | #undef HAVE_NETDB_H 58 | 59 | /* Define to 1 if you have the header file. */ 60 | #undef HAVE_NETINET_IN_H 61 | 62 | /* Define to 1 if you have the `pselect' function. */ 63 | #undef HAVE_PSELECT 64 | 65 | /* Define to 1 if you have the `select' function. */ 66 | #undef HAVE_SELECT 67 | 68 | /* Define to 1 if you have the `sigaction' function. */ 69 | #undef HAVE_SIGACTION 70 | 71 | /* Define to 1 if you have the `signal' function. */ 72 | #undef HAVE_SIGNAL 73 | 74 | /* Define to 1 if you have the `socket' function. */ 75 | #undef HAVE_SOCKET 76 | 77 | /* Define to 1 if you have the header file. */ 78 | #undef HAVE_STDDEF_H 79 | 80 | /* Define to 1 if you have the header file. */ 81 | #undef HAVE_STDINT_H 82 | 83 | /* Define to 1 if you have the header file. */ 84 | #undef HAVE_STDLIB_H 85 | 86 | /* Define to 1 if you have the `strchr' function. */ 87 | #undef HAVE_STRCHR 88 | 89 | /* Define to 1 if you have the `strdup' function. */ 90 | #undef HAVE_STRDUP 91 | 92 | /* Define to 1 if you have the `strerror' function. */ 93 | #undef HAVE_STRERROR 94 | 95 | /* Define to 1 if you have the `strerror_r' function. */ 96 | #undef HAVE_STRERROR_R 97 | 98 | /* Define to 1 if you have the header file. */ 99 | #undef HAVE_STRINGS_H 100 | 101 | /* Define to 1 if you have the header file. */ 102 | #undef HAVE_STRING_H 103 | 104 | /* Define to 1 if you have the header file. */ 105 | #undef HAVE_SYSLOG_H 106 | 107 | /* Define to 1 if you have the header file. */ 108 | #undef HAVE_SYS_SELECT_H 109 | 110 | /* Define to 1 if you have the header file. */ 111 | #undef HAVE_SYS_SOCKET_H 112 | 113 | /* Define to 1 if you have the header file. */ 114 | #undef HAVE_SYS_STAT_H 115 | 116 | /* Define to 1 if you have the header file. */ 117 | #undef HAVE_SYS_TIME_H 118 | 119 | /* Define to 1 if you have the header file. */ 120 | #undef HAVE_SYS_TYPES_H 121 | 122 | /* Define to 1 if you have the header file. */ 123 | #undef HAVE_UNISTD_H 124 | 125 | /* Define to 1 if you have the `vfork' function. */ 126 | #undef HAVE_VFORK 127 | 128 | /* Define to 1 if you have the header file. */ 129 | #undef HAVE_VFORK_H 130 | 131 | /* Define to 1 if you have the `vprintf' function. */ 132 | #undef HAVE_VPRINTF 133 | 134 | /* Define to 1 if `fork' works. */ 135 | #undef HAVE_WORKING_FORK 136 | 137 | /* Define to 1 if `vfork' works. */ 138 | #undef HAVE_WORKING_VFORK 139 | 140 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */ 141 | #undef NO_MINUS_C_MINUS_O 142 | 143 | /* Name of package */ 144 | #undef PACKAGE 145 | 146 | /* Define to the address where bug reports for this package should be sent. */ 147 | #undef PACKAGE_BUGREPORT 148 | 149 | /* Define to the full name of this package. */ 150 | #undef PACKAGE_NAME 151 | 152 | /* Define to the full name and version of this package. */ 153 | #undef PACKAGE_STRING 154 | 155 | /* Define to the one symbol short name of this package. */ 156 | #undef PACKAGE_TARNAME 157 | 158 | /* Define to the home page for this package. */ 159 | #undef PACKAGE_URL 160 | 161 | /* Define to the version of this package. */ 162 | #undef PACKAGE_VERSION 163 | 164 | /* Define as the return type of signal handlers (`int' or `void'). */ 165 | #undef RETSIGTYPE 166 | 167 | /* Define to the type of arg 1 for `select'. */ 168 | #undef SELECT_TYPE_ARG1 169 | 170 | /* Define to the type of args 2, 3 and 4 for `select'. */ 171 | #undef SELECT_TYPE_ARG234 172 | 173 | /* Define to the type of arg 5 for `select'. */ 174 | #undef SELECT_TYPE_ARG5 175 | 176 | /* Enable user-defined FD_SETSIZE */ 177 | #undef SFD_SETSIZE 178 | 179 | /* Define to 1 if you have the ANSI C header files. */ 180 | #undef STDC_HEADERS 181 | 182 | /* Define to 1 if strerror_r returns char *. */ 183 | #undef STRERROR_R_CHAR_P 184 | 185 | /* Define to 1 if you can safely include both and . */ 186 | #undef TIME_WITH_SYS_TIME 187 | 188 | /* Define to 1 if your declares `struct tm'. */ 189 | #undef TM_IN_SYS_TIME 190 | 191 | /* Version number of package */ 192 | #undef VERSION 193 | 194 | /* Enable user-defined XOR_PEER_ADDRESS_MAX */ 195 | #undef XOR_PEER_ADDRESS_MAX 196 | 197 | /* Define for Solaris 2.5.1 so the uint32_t typedef from , 198 | , or is not used. If the typedef were allowed, the 199 | #define below would cause a syntax error. */ 200 | #undef _UINT32_T 201 | 202 | /* Define for Solaris 2.5.1 so the uint64_t typedef from , 203 | , or is not used. If the typedef were allowed, the 204 | #define below would cause a syntax error. */ 205 | #undef _UINT64_T 206 | 207 | /* Define for Solaris 2.5.1 so the uint8_t typedef from , 208 | , or is not used. If the typedef were allowed, the 209 | #define below would cause a syntax error. */ 210 | #undef _UINT8_T 211 | 212 | /* Define to empty if `const' does not conform to ANSI C. */ 213 | #undef const 214 | 215 | /* Define to `int' if doesn't define. */ 216 | #undef gid_t 217 | 218 | /* Define to `__inline__' or `__inline' if that's what the C compiler 219 | calls it, or to nothing if 'inline' is not supported under any name. */ 220 | #ifndef __cplusplus 221 | #undef inline 222 | #endif 223 | 224 | /* Define to the type of a signed integer type of width exactly 16 bits if 225 | such a type exists and the standard includes do not define it. */ 226 | #undef int16_t 227 | 228 | /* Define to the type of a signed integer type of width exactly 32 bits if 229 | such a type exists and the standard includes do not define it. */ 230 | #undef int32_t 231 | 232 | /* Define to the type of a signed integer type of width exactly 64 bits if 233 | such a type exists and the standard includes do not define it. */ 234 | #undef int64_t 235 | 236 | /* Define to the type of a signed integer type of width exactly 8 bits if such 237 | a type exists and the standard includes do not define it. */ 238 | #undef int8_t 239 | 240 | /* Define to rpl_malloc if the replacement function should be used. */ 241 | #undef malloc 242 | 243 | /* Define to `int' if does not define. */ 244 | #undef mode_t 245 | 246 | /* Define to `int' if does not define. */ 247 | #undef pid_t 248 | 249 | /* Define to `unsigned int' if does not define. */ 250 | #undef size_t 251 | 252 | /* Define to `int' if does not define. */ 253 | #undef ssize_t 254 | 255 | /* Define to `int' if doesn't define. */ 256 | #undef uid_t 257 | 258 | /* Define to the type of an unsigned integer type of width exactly 16 bits if 259 | such a type exists and the standard includes do not define it. */ 260 | #undef uint16_t 261 | 262 | /* Define to the type of an unsigned integer type of width exactly 32 bits if 263 | such a type exists and the standard includes do not define it. */ 264 | #undef uint32_t 265 | 266 | /* Define to the type of an unsigned integer type of width exactly 64 bits if 267 | such a type exists and the standard includes do not define it. */ 268 | #undef uint64_t 269 | 270 | /* Define to the type of an unsigned integer type of width exactly 8 bits if 271 | such a type exists and the standard includes do not define it. */ 272 | #undef uint8_t 273 | 274 | /* Define as `fork' if `vfork' does not work. */ 275 | #undef vfork 276 | 277 | /* Define to empty if the keyword `volatile' does not work. Warning: valid 278 | code using `volatile' can become incorrect without. Disable with care. */ 279 | #undef volatile 280 | --------------------------------------------------------------------------------