From ace4c8d50949f97614a07cf79ac67a6099c33f3a Mon Sep 17 00:00:00 2001 From: Razvan Crainea Date: Mon, 13 Feb 2017 10:35:55 +0200 Subject: [PATCH 01/27] set the proper number of statistics to 10 Initially there were 5 statistics, but the number changed after these commits: 4b099c87 - introduced 4 new stats 9c843e79 - introduced 1 new stat --- src/rtpp_command_query.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtpp_command_query.h b/src/rtpp_command_query.h index f88b45f4a..7e2866a29 100644 --- a/src/rtpp_command_query.h +++ b/src/rtpp_command_query.h @@ -25,7 +25,7 @@ * */ -#define RTPP_QUERY_NSTATS 5 +#define RTPP_QUERY_NSTATS 10 struct rtpp_pipe; From 402c2fc17899c131a88e279f5650b2fdc74e79b5 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:21:44 -0800 Subject: [PATCH 02/27] Try to update openssl module. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 526e85ac6..93cb5b137 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,8 @@ sudo: required before_install: - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update + - sudo brew update + - sudo brew install openssl + - sudo brew install python --with-brewed-openssl script: sh -x ./scripts/do-test.sh From b2b459abbac6974eafc8c986ab9d100441c310fd Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:25:12 -0800 Subject: [PATCH 03/27] No, that fid did not work. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 93cb5b137..e560fcbbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ sudo: required before_install: - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - - sudo brew update - - sudo brew install openssl - - sudo brew install python --with-brewed-openssl +# - sudo brew update +# - sudo brew install openssl +# - sudo brew install python --with-brewed-openssl script: sh -x ./scripts/do-test.sh From 797ac2b086ae1da73ba7e5b88274cb0b1903b9a3 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:27:10 -0800 Subject: [PATCH 04/27] Try to run apt-get update before and after pip. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e560fcbbb..f87661762 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ python: - "2.7" sudo: required before_install: + - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update # - sudo brew update From 3dee5611ae560b7ab2e0292d4ba6821586a8ef1f Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:39:01 -0800 Subject: [PATCH 05/27] Try to install only twisted core. --- .travis.yml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f87661762..3f5454b86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ python: - "2.7" sudo: required before_install: - - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update +# - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update # - sudo brew update diff --git a/requirements.txt b/requirements.txt index 39ca22133..775144037 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -Twisted +twisted-core service_identity From 1a8b8834217e704e89705be89cccdb3f485bd95d Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 14:13:26 -0800 Subject: [PATCH 06/27] GC some unused include statements. --- src/rtpp_command_stats.c | 2 -- src/rtpp_pipe.c | 1 - 2 files changed, 3 deletions(-) diff --git a/src/rtpp_command_stats.c b/src/rtpp_command_stats.c index 556251e16..c37aa7d09 100644 --- a/src/rtpp_command_stats.c +++ b/src/rtpp_command_stats.c @@ -31,8 +31,6 @@ #include #include "rtpp_log.h" -#include "rtpp_defines.h" -#include "rtpp_cfg_stable.h" #include "rtpp_command.h" #include "rtpp_command_private.h" #include "rtpp_types.h" diff --git a/src/rtpp_pipe.c b/src/rtpp_pipe.c index a92357437..2fe744e10 100644 --- a/src/rtpp_pipe.c +++ b/src/rtpp_pipe.c @@ -46,7 +46,6 @@ #include "rtpp_pcnt_strm.h" #include "rtpp_stats.h" #include "rtpp_monotime.h" -#include "rtpp_netaddr.h" struct rtpp_pipe_priv { From 8bedce4b3b74f3a6bae34d678f0aa6cfa9ddabb0 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 14:14:07 -0800 Subject: [PATCH 07/27] GC unused includes. --- src/rtpp_proc_servers.c | 1 - src/rtpp_session.c | 1 - 2 files changed, 2 deletions(-) diff --git a/src/rtpp_proc_servers.c b/src/rtpp_proc_servers.c index e803db4e9..f849474a8 100644 --- a/src/rtpp_proc_servers.c +++ b/src/rtpp_proc_servers.c @@ -42,7 +42,6 @@ #include "rtpp_proc_servers.h" #include "rtpp_server.h" #include "rtpp_stream.h" -#include "rtpp_netaddr.h" struct foreach_args { double dtime; diff --git a/src/rtpp_session.c b/src/rtpp_session.c index f02e7ffe6..f083ed840 100644 --- a/src/rtpp_session.c +++ b/src/rtpp_session.c @@ -47,7 +47,6 @@ #include "rtpp_mallocs.h" #include "rtpp_module_if.h" #include "rtpp_pipe.h" -#include "rtpp_socket.h" #include "rtpp_stream.h" #include "rtpp_session.h" #include "rtpp_sessinfo.h" From 484455e0bbcae57810c3047da6b28e2bc320c137 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 14:17:12 -0800 Subject: [PATCH 08/27] GC unused includes. --- src/rtpp_proc.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/rtpp_proc.c b/src/rtpp_proc.c index eb9fa46af..b6a82b08d 100644 --- a/src/rtpp_proc.c +++ b/src/rtpp_proc.c @@ -37,26 +37,17 @@ #include "rtp.h" #include "rtp_packet.h" #include "rtp_resizer.h" -#include "rtpp_log.h" -#include "rtpp_log_obj.h" #include "rtpp_cfg_stable.h" #include "rtpp_defines.h" -#include "rtpp_network.h" #include "rtpp_proc.h" #include "rtpp_record.h" #include "rtpp_refcnt.h" #include "rtpp_sessinfo.h" -#include "rtpp_socket.h" #include "rtpp_stream.h" #include "rtpp_pcount.h" -#include "rtpp_pcnt_strm.h" #include "rtpp_session.h" -#include "rtpp_ssrc.h" -#include "rtp_analyze.h" -#include "rtpp_analyzer.h" #include "rtpp_ttl.h" #include "rtpp_pipe.h" -#include "rtpp_netaddr.h" struct rtpp_proc_ready_lst { struct rtpp_session *sp; From 1ec8702010866f4e4b07411b4c09711ee3dfc3a0 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 21 Feb 2017 13:58:09 -0800 Subject: [PATCH 09/27] Move protocol revision query command logic into its own file. --- src/Makefile.am | 2 +- src/main.c | 33 +++++++++++------ src/rtpp_command.c | 65 ++++------------------------------ src/rtpp_command.h | 8 +---- src/rtpp_command_ver.c | 80 ++++++++++++++++++++++++++++++++++++++++++ src/rtpp_command_ver.h | 9 +++++ 6 files changed, 120 insertions(+), 77 deletions(-) create mode 100644 src/rtpp_command_ver.c create mode 100644 src/rtpp_command_ver.h diff --git a/src/Makefile.am b/src/Makefile.am index a341b5dda..48fa20779 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,7 +32,7 @@ BASE_SOURCES=main.c rtp.h rtpp_server.c rtpp_server.h \ rtpp_command_record.h rtpp_port_table.c rtpp_port_table.h rtpp_acct.c \ rtpp_acct.h rtpp_stats.h rtpp_bindaddrs.c rtpp_bindaddrs.h rtpp_ssrc.h \ rtpp_netaddr.c rtpp_netaddr.h rtpp_acct_pipe.h rtpp_command_play.c \ - rtpp_command_play.h + rtpp_command_play.h rtpp_command_ver.h rtpp_command_ver.c rtpproxy_LDADD=-lm -lpthread $(top_srcdir)/libelperiodic/libelperiodic.a rtpproxy_debug_LDADD=${rtpproxy_LDADD} $(top_srcdir)/libexecinfo/libexecinfo.a \ diff --git a/src/main.c b/src/main.c index 6de3a94e6..f56f641d5 100644 --- a/src/main.c +++ b/src/main.c @@ -73,7 +73,7 @@ #include "rtpp_controlfd.h" #include "rtpp_genuid_singlet.h" #include "rtpp_hash_table.h" -#include "rtpp_command.h" +#include "rtpp_command_ver.h" #include "rtpp_command_async.h" #include "rtpp_port_table.h" #include "rtpp_proc_async.h" @@ -209,6 +209,17 @@ const static struct option longopts[] = { { NULL, 0, NULL, 0 } }; +static void +init_config_bail(struct rtpp_cfg_stable *cfsp, int rval) +{ + + CALL_METHOD(cfsp->rtpp_tnset_cf, dtor); + free(cfsp->nofile_limit); + free(cfsp->ctrl_socks); + free(cfsp); + rtpp_exit(rval); +} + static void init_config(struct cfg *cf, int argc, char **argv) { @@ -220,6 +231,7 @@ init_config(struct cfg *cf, int argc, char **argv) double x, y; struct rtpp_ctrl_sock *ctrl_sock; int option_index, brsym; + struct proto_cap *pcp; bh[0] = bh[1] = bh6[0] = bh6[1] = NULL; @@ -388,11 +400,10 @@ init_config(struct cfg *cf, int argc, char **argv) case 'v': printf("Basic version: %d\n", CPROTOVER); - for (i = 1; proto_caps[i].pc_id != NULL; ++i) { - printf("Extension %s: %s\n", proto_caps[i].pc_id, - proto_caps[i].pc_description); + for (pcp = iterate_proto_caps(NULL); pcp != NULL; pcp = iterate_proto_caps(pcp)) { + printf("Extension %s: %s\n", pcp->pc_id, pcp->pc_description); } - rtpp_exit(1); + init_config_bail(cf->stable, 1); break; case 'r': @@ -510,7 +521,7 @@ init_config(struct cfg *cf, int argc, char **argv) case 'V': printf("%s\n", RTPP_SW_VERSION); - rtpp_exit(1); + init_config_bail(cf->stable, 1); break; case 'W': @@ -522,13 +533,13 @@ init_config(struct cfg *cf, int argc, char **argv) break; case 'D': - cf->stable->no_chdir = 1; - break; + cf->stable->no_chdir = 1; + break; case 'C': - printf("%s\n", get_mclock_name()); - rtpp_exit(0); - break; + printf("%s\n", get_mclock_name()); + init_config_bail(cf->stable, 0); + break; case '?': default: diff --git a/src/rtpp_command.c b/src/rtpp_command.c index 47f92ddc0..aaa6bc638 100644 --- a/src/rtpp_command.c +++ b/src/rtpp_command.c @@ -59,11 +59,11 @@ #include "rtpp_command_query.h" #include "rtpp_command_stats.h" #include "rtpp_command_ul.h" +#include "rtpp_command_ver.h" #include "rtpp_hash_table.h" #include "rtpp_mallocs.h" #include "rtpp_netio_async.h" #include "rtpp_network.h" -#include "rtpp_tnotify_set.h" #include "rtpp_pipe.h" #include "rtpp_port_table.h" #include "rtpp_stream.h" @@ -73,29 +73,6 @@ #include "rtpp_stats.h" #include "rtpp_weakref.h" -struct proto_cap proto_caps[] = { - /* - * The first entry must be basic protocol version and isn't shown - * as extension on -v. - */ - { "20040107", "Basic RTP proxy functionality" }, - { "20050322", "Support for multiple RTP streams and MOH" }, - { "20060704", "Support for extra parameter in the V command" }, - { "20071116", "Support for RTP re-packetization" }, - { "20071218", "Support for forking (copying) RTP stream" }, - { "20080403", "Support for RTP statistics querying" }, - { "20081102", "Support for setting codecs in the update/lookup command" }, - { "20081224", "Support for session timeout notifications" }, - { "20090810", "Support for automatic bridging" }, - { "20140323", "Support for tracking/reporting load" }, - { "20140617", "Support for anchoring session connect time" }, - { "20141004", "Support for extendable performance counters" }, - { "20150330", "Support for allocating a new port (\"Un\"/\"Ln\" commands)" }, - { "20150420", "Support for SEQ tracking and new rtpa_ counters; Q command extended" }, - { "20150617", "Support for the wildcard %%CC_SELF%% as a disconnect notify target" }, - { NULL, NULL } -}; - struct rtpp_command_priv { struct rtpp_command pub; struct rtpp_cfg_stable *cfs; @@ -112,9 +89,7 @@ struct rtpp_command_priv { struct d_opts; static int create_twinlistener(uint16_t, void *); -static void handle_info(struct cfg *, struct rtpp_command *, - const char *); -static void handle_ver_feature(struct cfg *cf, struct rtpp_command *cmd); +static void handle_info(struct cfg *, struct rtpp_command *); struct create_twinlistener_args { struct rtpp_cfg_stable *cfs; @@ -231,7 +206,7 @@ rtpc_doreply(struct rtpp_command *cmd, char *buf, int len, int errd) } } -static void +void reply_number(struct rtpp_command *cmd, int number) { int len; @@ -419,7 +394,7 @@ handle_command(struct cfg *cf, struct rtpp_command *cmd) return 0; case INFO: - handle_info(cf, cmd, &cmd->argv[0][1]); + handle_info(cf, cmd); return 0; case PLAY: @@ -593,8 +568,7 @@ handle_command(struct cfg *cf, struct rtpp_command *cmd) } static void -handle_info(struct cfg *cf, struct rtpp_command *cmd, - const char *opts) +handle_info(struct cfg *cf, struct rtpp_command *cmd) { #if 0 struct rtpp_session *spa, *spb; @@ -606,7 +580,9 @@ handle_info(struct cfg *cf, struct rtpp_command *cmd, unsigned long long packets_in, packets_out; unsigned long long sessions_created; int sessions_active, rtp_streams_active; + const char *opts; + opts = &cmd->argv[0][1]; #if 0 brief = 0; #endif @@ -695,30 +671,3 @@ XXX this needs work to fix it after rtp/rtcp split rtpc_doreply(cmd, buf, len, 0); } } - -static void -handle_ver_feature(struct cfg *cf, struct rtpp_command *cmd) -{ - int i, known; - - /* - * Wait for protocol version datestamp and check whether we - * know it. - */ - /* - * Only list 20081224 protocol mod as supported if - * user actually enabled notification with -n - */ - if (strcmp(cmd->argv[1], "20081224") == 0 && - !CALL_METHOD(cf->stable->rtpp_tnset_cf, isenabled)) { - reply_number(cmd, 0); - return; - } - for (known = i = 0; proto_caps[i].pc_id != NULL; ++i) { - if (!strcmp(cmd->argv[1], proto_caps[i].pc_id)) { - known = 1; - break; - } - } - reply_number(cmd, known); -} diff --git a/src/rtpp_command.h b/src/rtpp_command.h index c3ce1dd6e..1995473d5 100644 --- a/src/rtpp_command.h +++ b/src/rtpp_command.h @@ -29,11 +29,6 @@ #ifndef _RTPP_COMMAND_H_ #define _RTPP_COMMAND_H_ -struct proto_cap { - const char *pc_id; - const char *pc_description; -}; - struct rtpp_command; struct rtpp_command_stats; struct cfg; @@ -42,8 +37,6 @@ struct sockaddr; struct rtpp_cmd_rcache; struct rtpp_socket; -extern struct proto_cap proto_caps[]; - int handle_command(struct cfg *, struct rtpp_command *); void free_command(struct rtpp_command *); struct rtpp_command *get_command(struct cfg *, int, int *, double, @@ -52,6 +45,7 @@ void reply_error(struct rtpp_command *cmd, int ecode); void reply_ok(struct rtpp_command *cmd); void reply_port(struct rtpp_command *cmd, int lport, struct sockaddr **lia); +void reply_number(struct rtpp_command *cmd, int number); int rtpp_create_listener(struct cfg *, struct sockaddr *, int *, struct rtpp_socket **); struct rtpp_command *rtpp_command_ctor(struct cfg *, int, double, int *, diff --git a/src/rtpp_command_ver.c b/src/rtpp_command_ver.c new file mode 100644 index 000000000..15567cea3 --- /dev/null +++ b/src/rtpp_command_ver.c @@ -0,0 +1,80 @@ +#include +#include +#include +#include + +#include "rtpp_defines.h" +#include "rtpp_cfg_stable.h" +#include "rtpp_types.h" +#include "rtpp_command.h" +#include "rtpp_command_private.h" +#include "rtpp_command_ver.h" +#include "rtpp_tnotify_set.h" + +static struct proto_cap proto_caps[] = { + /* + * The first entry must be basic protocol version and isn't shown + * as extension on -v. + */ + { "20040107", "Basic RTP proxy functionality" }, + { "20050322", "Support for multiple RTP streams and MOH" }, + { "20060704", "Support for extra parameter in the V command" }, + { "20071116", "Support for RTP re-packetization" }, + { "20071218", "Support for forking (copying) RTP stream" }, + { "20080403", "Support for RTP statistics querying" }, + { "20081102", "Support for setting codecs in the update/lookup command" }, + { "20081224", "Support for session timeout notifications" }, + { "20090810", "Support for automatic bridging" }, + { "20140323", "Support for tracking/reporting load" }, + { "20140617", "Support for anchoring session connect time" }, + { "20141004", "Support for extendable performance counters" }, + { "20150330", "Support for allocating a new port (\"Un\"/\"Ln\" commands)" }, + { "20150420", "Support for SEQ tracking and new rtpa_ counters; Q command extended" }, + { "20150617", "Support for the wildcard %%CC_SELF%% as a disconnect notify target" }, + { NULL, NULL } +}; + +void +handle_ver_feature(struct cfg *cf, struct rtpp_command *cmd) +{ + int i, known; + + /* + * Wait for protocol version datestamp and check whether we + * know it. + */ + /* + * Only list 20081224 protocol mod as supported if + * user actually enabled notification with -n + */ + if (strcmp(cmd->argv[1], "20081224") == 0 && + !CALL_METHOD(cf->stable->rtpp_tnset_cf, isenabled)) { + reply_number(cmd, 0); + return; + } + for (known = i = 0; proto_caps[i].pc_id != NULL; ++i) { + if (!strcmp(cmd->argv[1], proto_caps[i].pc_id)) { + known = 1; + break; + } + } + reply_number(cmd, known); +} + +struct proto_cap * +iterate_proto_caps(struct proto_cap *prevp) +{ + int i; + + if (prevp == NULL) { + return (&proto_caps[0]); + } + for (i = 0; proto_caps[i].pc_id != NULL; i++) { + if (&proto_caps[i] == prevp) { + if (proto_caps[i + 1].pc_id != NULL) + return (&proto_caps[i + 1]); + return (NULL); + } + } + abort(); +} diff --git a/src/rtpp_command_ver.h b/src/rtpp_command_ver.h new file mode 100644 index 000000000..d74928ff0 --- /dev/null +++ b/src/rtpp_command_ver.h @@ -0,0 +1,9 @@ +struct proto_cap { + const char *pc_id; + const char *pc_description; +}; + +struct rtpp_command; + +void handle_ver_feature(struct cfg *cf, struct rtpp_command *cmd); +struct proto_cap *iterate_proto_caps(struct proto_cap *prevp); From cb0c1d808cd755a0c49cbd25ce9891577c21e091 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 21 Feb 2017 13:58:27 -0800 Subject: [PATCH 10/27] Re-gen. --- src/Makefile.in | 60 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 962fb27fd..64209906c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -145,11 +145,12 @@ am__rtpproxy_SOURCES_DIST = main.c rtp.h rtpp_server.c rtpp_server.h \ rtpp_command_record.h rtpp_port_table.c rtpp_port_table.h \ rtpp_acct.c rtpp_acct.h rtpp_bindaddrs.c rtpp_bindaddrs.h \ rtpp_ssrc.h rtpp_netaddr.c rtpp_netaddr.h rtpp_acct_pipe.h \ - rtpp_command_play.c rtpp_command_play.h rtpp_module_if.c \ - rtpp_module_if.h rtpp_module.h rtpp_timed_fin.c \ - rtpp_timed_fin.h rtpp_stream_fin.c rtpp_stream_fin.h \ - rtpp_server_fin.c rtpp_server_fin.h rtpp_refcnt_fin.c \ - rtpp_refcnt_fin.h rtpp_log_obj_fin.c rtpp_log_obj_fin.h \ + rtpp_command_play.c rtpp_command_play.h rtpp_command_ver.h \ + rtpp_command_ver.c rtpp_module_if.c rtpp_module_if.h \ + rtpp_module.h rtpp_timed_fin.c rtpp_timed_fin.h \ + rtpp_stream_fin.c rtpp_stream_fin.h rtpp_server_fin.c \ + rtpp_server_fin.h rtpp_refcnt_fin.c rtpp_refcnt_fin.h \ + rtpp_log_obj_fin.c rtpp_log_obj_fin.h \ rtpp_command_rcache_fin.c rtpp_command_rcache_fin.h \ rtpp_socket_fin.c rtpp_socket_fin.h rtpp_record_fin.c \ rtpp_record_fin.h rtpp_ttl_fin.c rtpp_ttl_fin.h \ @@ -207,7 +208,8 @@ am__objects_2 = rtpproxy-main.$(OBJEXT) rtpproxy-rtpp_server.$(OBJEXT) \ rtpproxy-rtpp_port_table.$(OBJEXT) \ rtpproxy-rtpp_acct.$(OBJEXT) rtpproxy-rtpp_bindaddrs.$(OBJEXT) \ rtpproxy-rtpp_netaddr.$(OBJEXT) \ - rtpproxy-rtpp_command_play.$(OBJEXT) $(am__objects_1) + rtpproxy-rtpp_command_play.$(OBJEXT) \ + rtpproxy-rtpp_command_ver.$(OBJEXT) $(am__objects_1) am__objects_3 = rtpproxy-rtpp_timed_fin.$(OBJEXT) \ rtpproxy-rtpp_stream_fin.$(OBJEXT) \ rtpproxy-rtpp_server_fin.$(OBJEXT) \ @@ -277,11 +279,12 @@ am__rtpproxy_debug_SOURCES_DIST = main.c rtp.h rtpp_server.c \ rtpp_command_record.h rtpp_port_table.c rtpp_port_table.h \ rtpp_acct.c rtpp_acct.h rtpp_bindaddrs.c rtpp_bindaddrs.h \ rtpp_ssrc.h rtpp_netaddr.c rtpp_netaddr.h rtpp_acct_pipe.h \ - rtpp_command_play.c rtpp_command_play.h rtpp_module_if.c \ - rtpp_module_if.h rtpp_module.h rtpp_timed_fin.c \ - rtpp_timed_fin.h rtpp_stream_fin.c rtpp_stream_fin.h \ - rtpp_server_fin.c rtpp_server_fin.h rtpp_refcnt_fin.c \ - rtpp_refcnt_fin.h rtpp_log_obj_fin.c rtpp_log_obj_fin.h \ + rtpp_command_play.c rtpp_command_play.h rtpp_command_ver.h \ + rtpp_command_ver.c rtpp_module_if.c rtpp_module_if.h \ + rtpp_module.h rtpp_timed_fin.c rtpp_timed_fin.h \ + rtpp_stream_fin.c rtpp_stream_fin.h rtpp_server_fin.c \ + rtpp_server_fin.h rtpp_refcnt_fin.c rtpp_refcnt_fin.h \ + rtpp_log_obj_fin.c rtpp_log_obj_fin.h \ rtpp_command_rcache_fin.c rtpp_command_rcache_fin.h \ rtpp_socket_fin.c rtpp_socket_fin.h rtpp_record_fin.c \ rtpp_record_fin.h rtpp_ttl_fin.c rtpp_ttl_fin.h \ @@ -355,7 +358,8 @@ am__objects_5 = rtpproxy_debug-main.$(OBJEXT) \ rtpproxy_debug-rtpp_acct.$(OBJEXT) \ rtpproxy_debug-rtpp_bindaddrs.$(OBJEXT) \ rtpproxy_debug-rtpp_netaddr.$(OBJEXT) \ - rtpproxy_debug-rtpp_command_play.$(OBJEXT) $(am__objects_4) + rtpproxy_debug-rtpp_command_play.$(OBJEXT) \ + rtpproxy_debug-rtpp_command_ver.$(OBJEXT) $(am__objects_4) am__objects_6 = rtpproxy_debug-rtpp_timed_fin.$(OBJEXT) \ rtpproxy_debug-rtpp_stream_fin.$(OBJEXT) \ rtpproxy_debug-rtpp_server_fin.$(OBJEXT) \ @@ -616,7 +620,7 @@ BASE_SOURCES = main.c rtp.h rtpp_server.c rtpp_server.h rtpp_defines.h \ rtpp_acct.c rtpp_acct.h rtpp_stats.h rtpp_bindaddrs.c \ rtpp_bindaddrs.h rtpp_ssrc.h rtpp_netaddr.c rtpp_netaddr.h \ rtpp_acct_pipe.h rtpp_command_play.c rtpp_command_play.h \ - $(am__append_1) + rtpp_command_ver.h rtpp_command_ver.c $(am__append_1) rtpproxy_LDADD = -lm -lpthread \ $(top_srcdir)/libelperiodic/libelperiodic.a $(am__append_2) rtpproxy_debug_LDADD = ${rtpproxy_LDADD} $(top_srcdir)/libexecinfo/libexecinfo.a \ @@ -787,6 +791,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy-rtpp_command_stats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy-rtpp_command_stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy-rtpp_command_ul.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy-rtpp_command_ver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy-rtpp_controlfd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy-rtpp_genuid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy-rtpp_genuid_singlet.Po@am__quote@ @@ -867,6 +872,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_command_stats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_command_stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_command_ul.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_command_ver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_controlfd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_genuid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtpproxy_debug-rtpp_genuid_singlet.Po@am__quote@ @@ -1805,6 +1811,20 @@ rtpproxy-rtpp_command_play.obj: rtpp_command_play.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_CFLAGS) $(CFLAGS) -c -o rtpproxy-rtpp_command_play.obj `if test -f 'rtpp_command_play.c'; then $(CYGPATH_W) 'rtpp_command_play.c'; else $(CYGPATH_W) '$(srcdir)/rtpp_command_play.c'; fi` +rtpproxy-rtpp_command_ver.o: rtpp_command_ver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_CFLAGS) $(CFLAGS) -MT rtpproxy-rtpp_command_ver.o -MD -MP -MF $(DEPDIR)/rtpproxy-rtpp_command_ver.Tpo -c -o rtpproxy-rtpp_command_ver.o `test -f 'rtpp_command_ver.c' || echo '$(srcdir)/'`rtpp_command_ver.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtpproxy-rtpp_command_ver.Tpo $(DEPDIR)/rtpproxy-rtpp_command_ver.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtpp_command_ver.c' object='rtpproxy-rtpp_command_ver.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_CFLAGS) $(CFLAGS) -c -o rtpproxy-rtpp_command_ver.o `test -f 'rtpp_command_ver.c' || echo '$(srcdir)/'`rtpp_command_ver.c + +rtpproxy-rtpp_command_ver.obj: rtpp_command_ver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_CFLAGS) $(CFLAGS) -MT rtpproxy-rtpp_command_ver.obj -MD -MP -MF $(DEPDIR)/rtpproxy-rtpp_command_ver.Tpo -c -o rtpproxy-rtpp_command_ver.obj `if test -f 'rtpp_command_ver.c'; then $(CYGPATH_W) 'rtpp_command_ver.c'; else $(CYGPATH_W) '$(srcdir)/rtpp_command_ver.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtpproxy-rtpp_command_ver.Tpo $(DEPDIR)/rtpproxy-rtpp_command_ver.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtpp_command_ver.c' object='rtpproxy-rtpp_command_ver.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_CFLAGS) $(CFLAGS) -c -o rtpproxy-rtpp_command_ver.obj `if test -f 'rtpp_command_ver.c'; then $(CYGPATH_W) 'rtpp_command_ver.c'; else $(CYGPATH_W) '$(srcdir)/rtpp_command_ver.c'; fi` + rtpproxy-rtpp_module_if.o: rtpp_module_if.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_CFLAGS) $(CFLAGS) -MT rtpproxy-rtpp_module_if.o -MD -MP -MF $(DEPDIR)/rtpproxy-rtpp_module_if.Tpo -c -o rtpproxy-rtpp_module_if.o `test -f 'rtpp_module_if.c' || echo '$(srcdir)/'`rtpp_module_if.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtpproxy-rtpp_module_if.Tpo $(DEPDIR)/rtpproxy-rtpp_module_if.Po @@ -2925,6 +2945,20 @@ rtpproxy_debug-rtpp_command_play.obj: rtpp_command_play.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -c -o rtpproxy_debug-rtpp_command_play.obj `if test -f 'rtpp_command_play.c'; then $(CYGPATH_W) 'rtpp_command_play.c'; else $(CYGPATH_W) '$(srcdir)/rtpp_command_play.c'; fi` +rtpproxy_debug-rtpp_command_ver.o: rtpp_command_ver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -MT rtpproxy_debug-rtpp_command_ver.o -MD -MP -MF $(DEPDIR)/rtpproxy_debug-rtpp_command_ver.Tpo -c -o rtpproxy_debug-rtpp_command_ver.o `test -f 'rtpp_command_ver.c' || echo '$(srcdir)/'`rtpp_command_ver.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtpproxy_debug-rtpp_command_ver.Tpo $(DEPDIR)/rtpproxy_debug-rtpp_command_ver.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtpp_command_ver.c' object='rtpproxy_debug-rtpp_command_ver.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -c -o rtpproxy_debug-rtpp_command_ver.o `test -f 'rtpp_command_ver.c' || echo '$(srcdir)/'`rtpp_command_ver.c + +rtpproxy_debug-rtpp_command_ver.obj: rtpp_command_ver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -MT rtpproxy_debug-rtpp_command_ver.obj -MD -MP -MF $(DEPDIR)/rtpproxy_debug-rtpp_command_ver.Tpo -c -o rtpproxy_debug-rtpp_command_ver.obj `if test -f 'rtpp_command_ver.c'; then $(CYGPATH_W) 'rtpp_command_ver.c'; else $(CYGPATH_W) '$(srcdir)/rtpp_command_ver.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtpproxy_debug-rtpp_command_ver.Tpo $(DEPDIR)/rtpproxy_debug-rtpp_command_ver.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtpp_command_ver.c' object='rtpproxy_debug-rtpp_command_ver.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -c -o rtpproxy_debug-rtpp_command_ver.obj `if test -f 'rtpp_command_ver.c'; then $(CYGPATH_W) 'rtpp_command_ver.c'; else $(CYGPATH_W) '$(srcdir)/rtpp_command_ver.c'; fi` + rtpproxy_debug-rtpp_module_if.o: rtpp_module_if.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(rtpproxy_debug_CPPFLAGS) $(CPPFLAGS) $(rtpproxy_debug_CFLAGS) $(CFLAGS) -MT rtpproxy_debug-rtpp_module_if.o -MD -MP -MF $(DEPDIR)/rtpproxy_debug-rtpp_module_if.Tpo -c -o rtpproxy_debug-rtpp_module_if.o `test -f 'rtpp_module_if.c' || echo '$(srcdir)/'`rtpp_module_if.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rtpproxy_debug-rtpp_module_if.Tpo $(DEPDIR)/rtpproxy_debug-rtpp_module_if.Po From c47b8c323c9f11380b0a4bade5cef1ebe807c6e5 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 21 Feb 2017 14:03:51 -0800 Subject: [PATCH 11/27] Add (c), add missed #include. --- src/rtpp_command_ver.c | 29 +++++++++++++++++++++++++++++ src/rtpp_command_ver.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/src/rtpp_command_ver.c b/src/rtpp_command_ver.c index 15567cea3..4bee002c0 100644 --- a/src/rtpp_command_ver.c +++ b/src/rtpp_command_ver.c @@ -1,5 +1,34 @@ +/* + * Copyright (c) 2004-2006 Maxim Sobolev + * Copyright (c) 2006-2016 Sippy Software, Inc., http://www.sippysoft.com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + #include #include +#include #include #include diff --git a/src/rtpp_command_ver.h b/src/rtpp_command_ver.h index d74928ff0..606df3948 100644 --- a/src/rtpp_command_ver.h +++ b/src/rtpp_command_ver.h @@ -1,3 +1,31 @@ +/* + * Copyright (c) 2004-2006 Maxim Sobolev + * Copyright (c) 2006-2016 Sippy Software, Inc., http://www.sippysoft.com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + struct proto_cap { const char *pc_id; const char *pc_description; From 1be347d85119b1ded898c4c34ead72c74936c343 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 21 Feb 2017 14:27:06 -0800 Subject: [PATCH 12/27] Add -y after apt-get install. --- scripts/do-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/do-test.sh b/scripts/do-test.sh index 101402032..1a42c4046 100755 --- a/scripts/do-test.sh +++ b/scripts/do-test.sh @@ -19,7 +19,7 @@ make make clean #sudo pip install -r requirements.txt #sudo DEBIAN_FRONTEND=noninteractive apt-get update -sudo DEBIAN_FRONTEND=noninteractive apt-get install libgsm1-dev \ +sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libgsm1-dev \ libsndfile1-dev tcpdump curl wireshark-common libsrtp0-dev tcpdump --version || true mkdir deps From c8bd8a23cdfbff99895f3f1ab1835032b3afdc86 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 21 Feb 2017 14:30:41 -0800 Subject: [PATCH 13/27] Add some obscure "Dpkg::Options" into apt-get install to get rid of the travis build stucking trying to upgrade tcpdump package. --- scripts/do-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/do-test.sh b/scripts/do-test.sh index 1a42c4046..cabb5b316 100755 --- a/scripts/do-test.sh +++ b/scripts/do-test.sh @@ -19,8 +19,8 @@ make make clean #sudo pip install -r requirements.txt #sudo DEBIAN_FRONTEND=noninteractive apt-get update -sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libgsm1-dev \ - libsndfile1-dev tcpdump curl wireshark-common libsrtp0-dev +sudo DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confnew" \ + install -y libgsm1-dev libsndfile1-dev tcpdump curl wireshark-common libsrtp0-dev tcpdump --version || true mkdir deps cd deps From 16aed8a844076bb44f66ffbf919975ea667abe1d Mon Sep 17 00:00:00 2001 From: Razvan Crainea Date: Wed, 15 Feb 2017 11:39:33 +0200 Subject: [PATCH 14/27] Revert "set the proper number of statistics to 10" This reverts commit ace4c8d50949f97614a07cf79ac67a6099c33f3a. --- src/rtpp_command_query.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtpp_command_query.h b/src/rtpp_command_query.h index 7e2866a29..f88b45f4a 100644 --- a/src/rtpp_command_query.h +++ b/src/rtpp_command_query.h @@ -25,7 +25,7 @@ * */ -#define RTPP_QUERY_NSTATS 10 +#define RTPP_QUERY_NSTATS 5 struct rtpp_pipe; From 95aad9ef79b366168c7fac367c8e484b869c55e3 Mon Sep 17 00:00:00 2001 From: Razvan Crainea Date: Mon, 13 Mar 2017 16:35:21 +0200 Subject: [PATCH 15/27] rtp: add modifiers for TTL in the U/L commands This allows the Media Signalling server to tune the RTP TTL in for each stream. --- src/rtpp_command_ul.c | 39 +++++++++++++++++++++++++++++++++++++-- src/rtpp_command_ver.c | 1 + 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/rtpp_command_ul.c b/src/rtpp_command_ul.c index f0ea80053..8ab610bca 100644 --- a/src/rtpp_command_ul.c +++ b/src/rtpp_command_ul.c @@ -73,6 +73,8 @@ struct ul_opts { int asymmetric; int weak; int requested_ptime; + int requested_sttl; + int requested_pttl; char *codecs; char *addr; char *port; @@ -119,6 +121,8 @@ ul_opts_init(struct cfg *cf, struct ul_opts *ulop) { ulop->asymmetric = (cf->stable->aforce != 0) ? 1 : 0; + ulop->requested_sttl = 0; + ulop->requested_pttl = 0; ulop->requested_ptime = -1; ulop->lia[0] = ulop->lia[1] = ulop->reply.ia = cf->stable->bindaddr[0]; ulop->lidx = 1; @@ -318,6 +322,22 @@ rtpp_command_ul_opts_parse(struct cfg *cf, struct rtpp_command *cmd) ulop->new_port = 1; break; + case 't': + case 'T': + c = *cp; + n = strtol(cp + 1, &cp, 10); + if (n <= 0) { + RTPP_LOG(cmd->glog, RTPP_LOG_ERR, "command syntax error"); + reply_error(cmd, ECODE_PARSE_13); + goto err_undo_1; + } + if (c == 't') + ulop->requested_sttl = n; + else + ulop->requested_pttl = n; + cp--; + break; + default: RTPP_LOG(cmd->glog, RTPP_LOG_ERR, "unknown command modifier `%c'", *cp); @@ -450,8 +470,18 @@ rtpp_command_ul_handle(struct cfg *cf, struct rtpp_command *cmd, int sidx) ulop->weak ? ( sidx ? "weak[1]" : "weak[0]" ) : "strong", spa->strong, spa->rtp->stream[0]->weak, spa->rtp->stream[1]->weak); } - CALL_METHOD(spa->rtp->stream[0]->ttl, reset); - CALL_METHOD(spa->rtp->stream[1]->ttl, reset); + if (ulop->requested_sttl) + CALL_METHOD(spa->rtp->stream[sidx]->ttl, reset_with, + ulop->requested_sttl); + else + CALL_METHOD(spa->rtp->stream[sidx]->ttl, reset_with, + cf->stable->max_ttl); + if (ulop->requested_pttl) + CALL_METHOD(spa->rtp->stream[pidx]->ttl, reset_with, + ulop->requested_pttl); + else + CALL_METHOD(spa->rtp->stream[pidx]->ttl, reset_with, + cf->stable->max_ttl); RTPP_LOG(spa->log, RTPP_LOG_INFO, "lookup on ports %d/%d, session timer restarted", spa->rtp->stream[0]->port, spa->rtp->stream[1]->port); @@ -529,6 +559,11 @@ rtpp_command_ul_handle(struct cfg *cf, struct rtpp_command *cmd, int sidx) /* Save ref, it will be decref'd by the command disposal code */ RTPP_DBG_ASSERT(cmd->sp == NULL); cmd->sp = spa; + + if (ulop->requested_sttl) + CALL_METHOD(spa->rtp->stream[0]->ttl, reset_with, ulop->requested_sttl); + if (ulop->requested_pttl) + CALL_METHOD(spa->rtp->stream[1]->ttl, reset_with, ulop->requested_pttl); } if (cmd->cca.op == UPDATE) { diff --git a/src/rtpp_command_ver.c b/src/rtpp_command_ver.c index 4bee002c0..864768c3d 100644 --- a/src/rtpp_command_ver.c +++ b/src/rtpp_command_ver.c @@ -60,6 +60,7 @@ static struct proto_cap proto_caps[] = { { "20150330", "Support for allocating a new port (\"Un\"/\"Ln\" commands)" }, { "20150420", "Support for SEQ tracking and new rtpa_ counters; Q command extended" }, { "20150617", "Support for the wildcard %%CC_SELF%% as a disconnect notify target" }, + { "20170313", "Support for changing session's ttl" }, { NULL, NULL } }; From 7304c9afae10ff50d39e8dc1afbd5c3bca13abc9 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:21:44 -0800 Subject: [PATCH 16/27] Try to update openssl module. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f5454b86..42605971f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ before_install: # - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update -# - sudo brew update -# - sudo brew install openssl -# - sudo brew install python --with-brewed-openssl + - sudo brew update + - sudo brew install openssl + - sudo brew install python --with-brewed-openssl script: sh -x ./scripts/do-test.sh From 8add3e657d0368ce66e8d3a6a5790b71a42665fe Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:25:12 -0800 Subject: [PATCH 17/27] No, that fid did not work. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 42605971f..3f5454b86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ before_install: # - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - - sudo brew update - - sudo brew install openssl - - sudo brew install python --with-brewed-openssl +# - sudo brew update +# - sudo brew install openssl +# - sudo brew install python --with-brewed-openssl script: sh -x ./scripts/do-test.sh From 97024c1859cf17995a93087d40ecdf854bae72b5 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:27:10 -0800 Subject: [PATCH 18/27] Try to run apt-get update before and after pip. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3f5454b86..f87661762 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ python: - "2.7" sudo: required before_install: -# - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update + - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update # - sudo brew update From bbffb2a0b4bb89829a08cc02fc27d4b24dbf3139 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:39:01 -0800 Subject: [PATCH 19/27] Try to install only twisted core. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f87661762..3f5454b86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ python: - "2.7" sudo: required before_install: - - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update +# - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update # - sudo brew update From d5108134b85a03ed6a6608ba129e5246767240ef Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 21 Feb 2017 13:58:09 -0800 Subject: [PATCH 20/27] Move protocol revision query command logic into its own file. --- src/rtpp_command_ver.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/rtpp_command_ver.c b/src/rtpp_command_ver.c index 864768c3d..abe63b3d2 100644 --- a/src/rtpp_command_ver.c +++ b/src/rtpp_command_ver.c @@ -1,34 +1,5 @@ -/* - * Copyright (c) 2004-2006 Maxim Sobolev - * Copyright (c) 2006-2016 Sippy Software, Inc., http://www.sippysoft.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - #include #include -#include #include #include From 7a9d488614db4c231752714f044c6c5fb96bfb7b Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 21 Feb 2017 14:03:51 -0800 Subject: [PATCH 21/27] Add (c), add missed #include. --- src/rtpp_command_ver.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/rtpp_command_ver.c b/src/rtpp_command_ver.c index abe63b3d2..864768c3d 100644 --- a/src/rtpp_command_ver.c +++ b/src/rtpp_command_ver.c @@ -1,5 +1,34 @@ +/* + * Copyright (c) 2004-2006 Maxim Sobolev + * Copyright (c) 2006-2016 Sippy Software, Inc., http://www.sippysoft.com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + #include #include +#include #include #include From cba4b0031ea7aec8dfb4862d14b186a8d5ed6fc1 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 21 Feb 2017 14:27:06 -0800 Subject: [PATCH 22/27] Add -y after apt-get install. --- scripts/do-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/do-test.sh b/scripts/do-test.sh index cabb5b316..1a42c4046 100755 --- a/scripts/do-test.sh +++ b/scripts/do-test.sh @@ -19,8 +19,8 @@ make make clean #sudo pip install -r requirements.txt #sudo DEBIAN_FRONTEND=noninteractive apt-get update -sudo DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confnew" \ - install -y libgsm1-dev libsndfile1-dev tcpdump curl wireshark-common libsrtp0-dev +sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libgsm1-dev \ + libsndfile1-dev tcpdump curl wireshark-common libsrtp0-dev tcpdump --version || true mkdir deps cd deps From 1f4018dbcd94a9ed30cd50874579c83b2efef82c Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:21:44 -0800 Subject: [PATCH 23/27] Try to update openssl module. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f5454b86..42605971f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ before_install: # - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update -# - sudo brew update -# - sudo brew install openssl -# - sudo brew install python --with-brewed-openssl + - sudo brew update + - sudo brew install openssl + - sudo brew install python --with-brewed-openssl script: sh -x ./scripts/do-test.sh From cd7eea8c19672f500bbf25cfa8b7bb790c54b1e9 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:25:12 -0800 Subject: [PATCH 24/27] No, that fid did not work. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 42605971f..3f5454b86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,8 @@ before_install: # - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - - sudo brew update - - sudo brew install openssl - - sudo brew install python --with-brewed-openssl +# - sudo brew update +# - sudo brew install openssl +# - sudo brew install python --with-brewed-openssl script: sh -x ./scripts/do-test.sh From 32de58de7f42ed99b7bdc58c8249f7617ba3701a Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:27:10 -0800 Subject: [PATCH 25/27] Try to run apt-get update before and after pip. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3f5454b86..f87661762 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ python: - "2.7" sudo: required before_install: -# - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update + - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update # - sudo brew update From 37c026f79a7b039e8047fa629cd9865c2fa06674 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 14 Feb 2017 13:39:01 -0800 Subject: [PATCH 26/27] Try to install only twisted core. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f87661762..3f5454b86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ python: - "2.7" sudo: required before_install: - - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update +# - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update - sudo -H PATH="${PATH}:/usr/local/clang-3.4/bin" pip install -r requirements.txt - sudo -H DEBIAN_FRONTEND=noninteractive apt-get update # - sudo brew update From 76afe5ed4ae35e0e542aa659986f880772b994f4 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 21 Feb 2017 14:30:41 -0800 Subject: [PATCH 27/27] Add some obscure "Dpkg::Options" into apt-get install to get rid of the travis build stucking trying to upgrade tcpdump package. --- scripts/do-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/do-test.sh b/scripts/do-test.sh index 1a42c4046..cabb5b316 100755 --- a/scripts/do-test.sh +++ b/scripts/do-test.sh @@ -19,8 +19,8 @@ make make clean #sudo pip install -r requirements.txt #sudo DEBIAN_FRONTEND=noninteractive apt-get update -sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libgsm1-dev \ - libsndfile1-dev tcpdump curl wireshark-common libsrtp0-dev +sudo DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confnew" \ + install -y libgsm1-dev libsndfile1-dev tcpdump curl wireshark-common libsrtp0-dev tcpdump --version || true mkdir deps cd deps