diff --git a/tests/blist.pl b/tests/blist.pl index 807fdbbd7..a5f1ad1ab 100755 --- a/tests/blist.pl +++ b/tests/blist.pl @@ -13,21 +13,21 @@ my $len = length(pack($format, (0) x 100)); open(my $fh, "<", "/proc/rtpengine/$t/blist") or die; my $buf; while (sysread($fh, $buf, $len)) { - my @b = unpack($format, $buf); + my @buf = unpack($format, $buf); for (2,6,10) { - if ($b[$_] == AF_INET) { - $b[$_ + 1] = inet_ntoa($b[$_ + 1]); + if ($buf[$_] == AF_INET) { + $buf[$_ + 1] = inet_ntoa($buf[$_ + 1]); } - elsif ($b[$_] == AF_INET6) { - $b[$_ + 1] = inet_ntop(AF_INET6, $b[$_ + 1]); + elsif ($buf[$_] == AF_INET6) { + $buf[$_ + 1] = inet_ntop(AF_INET6, $buf[$_ + 1]); } - elsif ($b[$_] == 0) { - $b[$_ + 1] = '---'; + elsif ($buf[$_] == 0) { + $buf[$_ + 1] = '---'; } } for (18, 20, 22) { - $b[$_] += $b[$_ + 1] * 2**32; + $buf[$_] += $buf[$_ + 1] * 2**32; } - printf("%5u %15s:%-5u -> %15s:%-5u (-> %15s:%-5u) [%u] [%llu %llu %llu]\n", @b[0,3,4,7,8,11,12,14,18,20,22]); + printf("%5u %15s:%-5u -> %15s:%-5u (-> %15s:%-5u) [%u] [%llu %llu %llu]\n", @buf[0,3,4,7,8,11,12,14,18,20,22]); } close($fh); diff --git a/tests/simulator-ng.pl b/tests/simulator-ng.pl index 244193173..2eab8515e 100755 --- a/tests/simulator-ng.pl +++ b/tests/simulator-ng.pl @@ -334,24 +334,24 @@ sub rtp_savp { sub savp_crypto { my ($sdp, $ctx, $ctx_o) = @_; - my @a = $sdp =~ /[\r\n]a=crypto:(\d+) (\w+) inline:([\w\/+=]{40,})(?:\|(?:2\^(\d+)|(\d+)))?(?:\|(\d+):(\d+))?(?: (.*?))?[\r\n]/sig; - @a or die; + my @aa = $sdp =~ /[\r\n]a=crypto:(\d+) (\w+) inline:([\w\/+=]{40,})(?:\|(?:2\^(\d+)|(\d+)))?(?:\|(\d+):(\d+))?(?: (.*?))?[\r\n]/sig; + @aa or die; my $i = 0; - while (@a >= 8) { - $$ctx[$i]{in}{crypto_suite} = $NGCP::Rtpclient::SRTP::crypto_suites{$a[1]} or die; - $$ctx[$i]{in}{crypto_tag} = $a[0]; + while (@aa >= 8) { + $$ctx[$i]{in}{crypto_suite} = $NGCP::Rtpclient::SRTP::crypto_suites{$aa[1]} or die; + $$ctx[$i]{in}{crypto_tag} = $aa[0]; ($$ctx[$i]{in}{rtp_master_key}, $$ctx[$i]{in}{rtp_master_salt}) - = NGCP::Rtpclient::SRTP::decode_inline_base64($a[2], $$ctx[$i]{in}{crypto_suite}); - $$ctx[$i]{in}{rtp_mki} = $a[5]; - $$ctx[$i]{in}{rtp_mki_len} = $a[6]; + = NGCP::Rtpclient::SRTP::decode_inline_base64($aa[2], $$ctx[$i]{in}{crypto_suite}); + $$ctx[$i]{in}{rtp_mki} = $aa[5]; + $$ctx[$i]{in}{rtp_mki_len} = $aa[6]; undef($$ctx[$i]{in}{rtp_session_key}); undef($$ctx[$i]{in}{rtcp_session_key}); - ($a[7] || '') =~ /UNENCRYPTED_SRTP/ and $$ctx[$i]{in}{unenc_srtp} = 1; - ($a[7] || '') =~ /UNENCRYPTED_SRTCP/ and $$ctx[$i]{in}{unenc_srtcp} = 1; - ($a[7] || '') =~ /UNAUTHENTICATED_SRTP/ and $$ctx[$i]{in}{unauth_srtp} = 1; + ($aa[7] || '') =~ /UNENCRYPTED_SRTP/ and $$ctx[$i]{in}{unenc_srtp} = 1; + ($aa[7] || '') =~ /UNENCRYPTED_SRTCP/ and $$ctx[$i]{in}{unenc_srtcp} = 1; + ($aa[7] || '') =~ /UNAUTHENTICATED_SRTP/ and $$ctx[$i]{in}{unauth_srtp} = 1; $i++; - @a = @a[8 .. $#a]; + @aa = @aa[8 .. $#aa]; } }