From 0aa400078bef87ac006a7b456a0e1e826afd83c0 Mon Sep 17 00:00:00 2001 From: Jonathan Lennox Date: Wed, 26 Jul 2017 12:01:25 -0400 Subject: [PATCH 1/2] Add -w option to rtpw to specify words file. --- test/rtpw.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/rtpw.c b/test/rtpw.c index 3b7ac6700b20..c1386528dc3d 100644 --- a/test/rtpw.c +++ b/test/rtpw.c @@ -8,7 +8,7 @@ * * This app is a simple RTP application intended only for testing * libsrtp. It reads one word at a time from words.txt (or - * whatever file is specified as DICT_FILE), and sends one word out + * whatever file is specified as DICT_FILE or with -w), and sends one word out * each USEC_RATE microseconds. Secure RTP protections can be * applied. See the usage() function for more details. * @@ -198,7 +198,7 @@ main (int argc, char *argv[]) { /* check args */ while (1) { - c = getopt_s(argc, argv, "b:k:rsgt:ae:ld:"); + c = getopt_s(argc, argv, "b:k:rsgt:ae:ld:w:"); if (c == -1) { break; } @@ -247,6 +247,9 @@ main (int argc, char *argv[]) { case 'l': do_list_mods = 1; break; + case 'w': + dictfile = optarg_s; + break; default: usage(argv[0]); } @@ -640,8 +643,9 @@ usage(char *string) { " -s act as rtp sender\n" " -r act as rtp receiver\n" " -l list debug modules\n" - " -d turn on debugging for module \n", - string, string); + " -d turn on debugging for module \n" + " -w use for input, rather than %s\n", + string, string, DICT_FILE); exit(1); } From 9c3a00c4ccee3cf1992bc4cfb1c6933dc854476d Mon Sep 17 00:00:00 2001 From: Jonathan Lennox Date: Wed, 26 Jul 2017 12:01:50 -0400 Subject: [PATCH 2/2] Pass location of words.txt to rtpw invocations. Fixes builds with srcdir != objdir. --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index f6ee38c13166..63021c20aaac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -30,9 +30,9 @@ runtest: test test/roc_driver$(EXE) -v >/dev/null test/replay_driver$(EXE) -v >/dev/null test/dtls_srtp_driver$(EXE) >/dev/null - cd test; $(abspath $(srcdir))/test/rtpw_test.sh >/dev/null + cd test; $(abspath $(srcdir))/test/rtpw_test.sh -w $(abspath $(srcdir))/test/words.txt >/dev/null ifeq (1, $(USE_OPENSSL)) - cd test; $(abspath $(srcdir))/test/rtpw_test_gcm.sh >/dev/null + cd test; $(abspath $(srcdir))/test/rtpw_test_gcm.sh -w $(abspath $(srcdir))/test/words.txt >/dev/null endif @echo "libsrtp2 test applications passed." $(MAKE) -C crypto runtest