Commit 966d63d1 authored by paalmm's avatar paalmm

changes in -pcap offline. Empty files gets initialized with 0 value

parent 43bffb13
......@@ -43,7 +43,7 @@ my ($rtmp,$period,$last,$debug,$swfurl,$pageurl,$flash_version,$reconnect);
require "newgetopt.pl";
@opts=('list', 'man','fullformat', 'net', 'rtp', 'mpeg', 'pcap', 'crude', 'bins=s', 'log', 'nperiod=s', 'period=s', 'last=s', 'packets=s', 'src=s', 'flow_key=s', 'flow_no=s', 'flow_min=s', 'nohead', 'dump=s', 'format=s', 'id=s', 'sum=s', 'ttl', 'rtt=s', 'codec=s', 'log', 'verbose', 'v', 'h', 'debug', 'av','xml=s', 'rtmp','tcp', 'port=s','swfurl=s','pageurl=s','flashversion=s','new','q','exclude=s','report=s', 'filename');
@opts=('list', 'man','fullformat', 'net', 'rtp', 'mpeg', 'pcap', 'crude', 'bins=s', 'log', 'nperiod=s', 'period=s', 'last=s', 'packets=s', 'src=s', 'flow_key=s', 'flow_no=s', 'flow_min=s', 'nohead', 'dump=s', 'format=s', 'id=s', 'sum=s', 'ttl', 'rtt=s', 'codec=s', 'log', 'verbose', 'v', 'h', 'debug', 'av','xml=s', 'rtmp','tcp', 'port=s','swfurl=s','pageurl=s','flashversion=s','new','q','exclude=s','report=s', 'filename','test');
&NGetOpt(@opts) || die pod2usage(1);
die pod2usage(1) if $opt_h;
......@@ -78,6 +78,7 @@ my $xml;
my $xml_printed= 0;
my $last_stream;
my $file_flag;
my $offline;
#TCP STUFF
my $thr;
......@@ -149,6 +150,7 @@ $SIG{INT} = sub { $uninterrupted=0; # return if $nint++ < 1;
&display_stats();
&end_xml() if $opt_xml;
&handle_threads() if ($opt_tcp and $opt_rtmp);
die "End after interrupt.\n";exit(0) };
$SIG{KILL} = sub { $uninterrupted=0; # return if $nkill++ < 1;
&display_stats(); die "End after kill.\n";exit(0) };
......@@ -166,16 +168,17 @@ $SIG{ALRM} = sub {
if ($opt_dump){
open DUMP, ">$opt_dump";
}
&unit_test if $opt_test;
if ($opt_pcap || ($opt_tcp && !$opt_rtmp)){ # listen in parallell
alarm($opt_last) if $opt_last;
$uninterrupted=1;
$endstream=0;
eat_pcap_streams(@streams);
eat_pcap_streams(@streams);
&display_stats() if !$opt_xml;
} else { # listen serially
my $stream_count;
my $ln = @streams;
my $ln = @streams;
foreach $id (@streams) {
alarm($opt_last) if $opt_last;
++$stream_count;
......@@ -186,12 +189,13 @@ if ($opt_pcap || ($opt_tcp && !$opt_rtmp)){ # listen in parallell
init_file($id);
eat_stream($id) if (!($opt_tcp || $opt_rtmp));
&rtmp_eat_stream($id,$opt_period, $opt_last,0,$opt_debug,$opt_swfurl,$opt_pageurl,$opt_flashversion) if $opt_rtmp;
&eat_tcp($id,$opt_port) if $opt_tcp && !$opt_rtmp;
#&eat_tcp($id,$opt_port) if $opt_tcp && !$opt_rtmp;
if (! ( $opt_list || $opt_sum)){
&display_stats() if !$endstream;
}
last if ! $uninterrupted;
}
}
&list_flows if $opt_list;
&display_stats() if $opt_sum;
......@@ -199,6 +203,80 @@ if ($opt_pcap || ($opt_tcp && !$opt_rtmp)){ # listen in parallell
&end_xml() if $opt_xml;
exit(0);
#
sub unit_test {
my $test_data = shift;
#streams = "rtp_158.38.130.110_6711_1.pcap";
@streams = "testing/testdata_mpeg.pcap" if $opt_mpeg;
@streams = "testing/testdata_rtp.pcap" if $opt_rtp;
#@streams = "testing/testdata_tcp.pcap";
$opt_xml = "tmp_testdata.xml";
$opt_q = 1;
$opt_v = 1;
}
sub unit_test_2{
#my ($orgnial_test) = &feed_data("file",rtp_file.xml);
my $test_data;
$test_data = "mpeg_testdata.xml" if $opt_mpeg;
$test_data = "rtp_testdata.xml" if $opt_rtp;
#$test_data = "udp_testdata" if $opt_net;
$test_data = "tcp_testdata_" if $opt_tcp;
my ($orginal_test) = &xml_parser($test_data);
my ($new_test) = &xml_parser("tmp_testdata.xml");
print Dumper($orginal_test), "\n", Dumper($new_test)if $opt_debug;
my $ignore_pattern = "jitter"; #PCR jitter is based on delta local time.
for my $k1(keys %$orginal_test){
if ($orginal_test->{ $k1} != $new_test->{ $k1} and $orginal_test->{ $k1} !~ m/HASH/) {
print "fail @ $k1, value: $orginal_test->{$k1} unlike value: $new_test->{$k1}\n";
}
for my $k2 ( keys %{$orginal_test->{ $k1}} ) {
if ( ($orginal_test->{ $k1}{$k2} != $new_test->{ $k1}{$k2}) and ($k2 !~ m/$ignore_pattern/)){
print "fail @ $k1-> $k2, value: $orginal_test->{ $k1}{$k2} unlike value: $new_test->{ $k1}{$k2} \n";
}
}
}
}
sub xml_parser {
my $file = shift;
my $parser = new XML::DOM::Parser;
my $doc = $parser->parsefile ($file);
my $root = $doc->getFirstChild();
my $nodelist = $root->getChildNodes();
my $node = $nodelist->item(1);
my $dup;
my $flow_childs = $node->getChildNodes();
my @test_array = ();
my %test_hash = ();
foreach my $child ($node->getChildNodes()) {
if ($child->getNodeType == ELEMENT_NODE) {
if ($child->getChildNodes()){
my @children = $child->getChildNodes();
my $l = @children;
if ($l > 1){
#print "=== " ,$child->getNodeName(), " === \n";
if (exists $test_hash{$child->getNodeName()}){
$dup +=1;
}
foreach my $grandchild ($child->getChildNodes()){
if ($grandchild->getNodeType == ELEMENT_NODE){
#print $grandchild->getNodeName(), "\n";
eval {
$test_hash{$child->getNodeName().$dup}{$grandchild->getNodeName()}= $grandchild->getFirstChild()->getData();
};
if ($@){
};
}
}
}
else {
$test_hash{'flow'}{$child->getNodeName()} = $child->getFirstChild()->getData();
}
}
}
}
return (\%test_hash)
}
sub http_stream_client {
my $f = shift;
......@@ -256,17 +334,20 @@ sub end_xml{
$doc->dispose;
close (MYFILE);
$xml_printed = 1;
&unit_test_2($filename) if $opt_test;
}
sub tcp_packet_stats {
my ($pkt) = @_;
my $f = shift;
my ($pkt) = shift;
my $us = shift;
my $ip_obj = NetPacket::IP->decode(eth_strip($pkt));
my $tcp_obj = NetPacket::TCP->decode(ip_strip(eth_strip($pkt)));
my $us = 0;
my $f = $ip_obj->{src_ip}.":".$tcp_obj->{src_port};
#my $f = $ip_obj->{src_ip}.":".$tcp_obj->{src_port} if !$offline;
my $seq_num = $tcp_obj->{seqnum};
my $options = $tcp_obj->{options}; #12 bytes
if (!exists $tcp_packet_stats{$f}){
&init_stats($f);
$tcp_packet_stats{$f} = &share( {} );
$seq_stats{$f} = &share( {} );
$seq_stats_n{$f} = &share( {} );
......@@ -275,23 +356,24 @@ sub tcp_packet_stats {
$tcp_packet_stats{$f}{'pkt_dup'} = 0;
}
++$tcp_packet_stats{'num_packets'};
print $tcp_packet_stats{$f}{'num_packets'}, "\n";
++$tcp_packet_stats{$f}{'num_packets'};
$tc=[gettimeofday]; # current flow time
if( $t0){
$elapsed=tv_interval ( $t0, $tc);
} else {
$t0 = $tc;
$elapsed=0.0;
&init_stats($cur_id);
}
$us=$elapsed*10**6;
#$tc=[gettimeofday]; # current flow time
# if( $t0){
# $elapsed=tv_interval ( $t0, $tc);
# } else {
# $t0 = $tc;
# $elapsed=0.0;
# &init_stats($cur_id);
# }
# $us=$elapsed*10**6;
&tcp_jitter_stats($f,$options);
#Bandwidth messurements
&pkt_stats($f, $tcp_obj->{data}, $elapsed * 10**6, $ip_obj->{'len'});
&pkt_stats($f, $tcp_obj->{data}, $us, $ip_obj->{'len'});
$tcp_packet_stats{$f}{'num_bytes'} += $ip_obj->{'len'}; #counts the bytes
#Check for duplicated,out-of-order, late and lost packets.
$seq_stats{$f}{'seq_diff'} = $seq_num - $seq_stats{$f}{'p_seq_num'}- $seq_stats{$f}{'p_packet_len'};
print $seq_stats{$f}{'seq_diff'}, "\n", if $opt_debug;
if ($seq_stats_n{$f}{'seq_num_p'} == $seq_num && $seq_stats{$f}{'p_seq_num'} != 0) {
++$tcp_packet_stats{$f}{'pkt_dup'};
}
......@@ -507,7 +589,6 @@ sub eat_stream {
}
while ($uninterrupted && !($opt_packets && $n_packets > $opt_packets)) {
my $packet;
last if ! $uninterrupted || $endstream;
if ($select->can_read($timeout) && ($packet = $rtp->recv())){
......@@ -530,7 +611,6 @@ sub eat_stream {
&init_stats($cur_id);
}
$us=$elapsed*10**6;
$tjoined{$cur_id} = $tjoined if !$tjoined{$cur_id};
# No stats for that SSRC yet?
&pkt_stats($cur_id, $packet->encode, $elapsed * 10**6, $packet->size());
......@@ -666,6 +746,7 @@ sub eat_stream {
until ( ! $uninterrupted || $endstream || ($opt_packets && $n_packets > $opt_packets)
|| ! (my $pkt=Net::Pcap::next($pcap, \%hdr) ) ) {
#$file_flag =1;
$offline =1;
eat_pcap($f, $pcap, $pkt);
$n_packets++;
}
......@@ -726,7 +807,6 @@ sub eat_pcap_streams{ # open groups and listen on pcap
}
sub eat_pcap { # process pcap packets
my ($f, $pcap, $pkt)=@_;
my $ip=null;
......@@ -740,13 +820,15 @@ sub eat_pcap { # process pcap packets
} else {
die "Invalid link layer type : ".Net::Pcap::datalink($pcap);
}
&tcp_packet_stats($pkt) if $ip->{proto} == IP_PROTO_TCP;
$tc= [$hdr{tv_sec}, $hdr{tv_usec}];
$us = tv_interval ( $t0, $tc) * 10**6 ; # us relative packet
&tcp_packet_stats($f,$pkt,$us) if $ip->{proto} == IP_PROTO_TCP;
$opt_tcp = 1 if $ip->{proto} == IP_PROTO_TCP;
next if $ip->{proto} != IP_PROTO_UDP;
my $udp = NetPacket::UDP->decode($ip->{data});
#my $tcp = NetPacket::TCP->decode($ip->{data});
my $dlen = $ip->{len} - $ip->{hlen}*4;
my $flow_key;
if ($opt_sum){
$flow_key=$opt_sum;
}
......@@ -768,6 +850,7 @@ sub eat_pcap { # process pcap packets
if ($pttl{$flow_key} && ($opt_log || ($pttl{$flow_key} != $ip->{ttl}))){ # change in ttl
printf "%s\n", $ttl_log;
$nttl{$flow_key}=0;
print "TTL \n";
}
$pttl{$flow_key}= $ip->{ttl};
$nttl{$flow_key}++;
......@@ -777,7 +860,6 @@ sub eat_pcap { # process pcap packets
$ip->{src_ip}, $ip->{dest_ip}, $tx_time_seconds{$flow_key},
$tx_time_useconds{$flow_key}, $hdr{tv_sec}, $hdr{tv_usec}, $pttl{$flow_key};
$ttl_log.= sprintf(" No=%08d\n", $nttl{$flow_key},) if !$opt_log;
}
next if $opt_list; # just count packets per flow
next if $opt_flow_key && $flow_key !~ $wanted_flow;
......@@ -787,22 +869,14 @@ sub eat_pcap { # process pcap packets
&init_stats($flow_key);
push (@myflows, $flow_key);
}
$tc= [$hdr{tv_sec}, $hdr{tv_usec}];
if (! defined($t0)) {
$t0=$tc;
}
$tjoined{$f}=$tc if !$tjoined{$f};
$tjoined{$flow_key} = $tjoined{$f} if !exists($tjoined{$flow_key});
$us = tv_interval ( $t0, $tc) * 10**6 ; # us relative packet time
# fixate on first flow to appear
# if ( $first_port) {
# next if $udp->{dest_port} != $first_port;
# } else {
# $first_port = $udp->{dest_port};
# }
&pkt_stats($flow_key, $udp->{data}, $us, $dlen);
}
......@@ -849,7 +923,7 @@ sub init_stats {
sub format_numbers{
my $value = shift;
if ($value =~ /^[a-zA-z][\D]*$/ || $value !~ /^\d+\.\d+$/) {
return $value;
return sprintf("%1.0f",$value);
}
else {
return sprintf("%0.5f",$value);
......@@ -869,13 +943,15 @@ sub xml_dump_rtmp_tcp {
$qstream->setAttribute('version',$xml_version);
$doc->appendChild($qstream);
}
($address,$app,$play) = rtmp_prepare_url($f) if $rtmp;
($address, $port) = prepare_ip($f) if $opt_tcp && !$opt_rtmp;
$port = 1935 unless $opt_port;
my $id=$address.":".$port;
my ($date,$time) = &get_date_time();
my $span=&tv_interval($tstart{$id}, $tend{$id}); # second
#($address, $port) = prepare_ip($f) if $opt_tcp && !$opt_rtmp;
#$port = 1935 unless $opt_port;
#my $id=$address.":".$port;
my $id = $f;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($tstart{$f}->[0]);
my $time=sprintf "%02d:%02d:%02d", $hour, $min, $sec;
my $date=sprintf "%4d-%02d-%02d", $year+1900, $mon+1, $mday;
my $span=&tv_interval($tstart{$f}, $tend{$f}); # second
&do_math($id,$span);
my $flow = $doc->createElement('flow');
my $flow_id = $doc->createElement('flow_id');
......@@ -932,7 +1008,7 @@ sub xml_dump_rtmp_tcp {
$bw_stats->appendChild($max_bw);
$bw_stats->appendChild($max_bw_100ms);
$bw_stats->appendChild($sdv_bw);
$avg_bw->addText(&format_numbers( avg( $bw_stats{$f}{'sumbyte'}*8, $opt_period )));
$avg_bw->addText(&format_numbers( avg( $bw_stats{$f}{'sumbyte'}*8, $span )));
$max_bw->addText(&format_numbers($bw_stats{$f}{'maxbps'}));
$max_bw_100ms->addText(&format_numbers($bw_stats{$f}{'max100ms'}));
$sdv_bw->addText(&format_numbers(sdv($bw_stats{$f}{'n100ms'},
......@@ -1037,11 +1113,10 @@ sub xml_dump {
$flow->appendChild($dateXML);
$flow->appendChild($timeXML);
$flow->appendChild($spanXML);
my $media="file";
$media = "host:port" if $opt_net;
my $id=$f;
next if $npkt{$f} <= $opt_flow_min;
next if $npkt{$f} < $opt_flow_min;
my $source=$f;
$source=$source{$f} if ! $opt_v && $source{$f} ne "";
$source=$opt_id if $opt_id;
......@@ -1057,9 +1132,7 @@ sub xml_dump {
my $date=sprintf "%4d-%02d-%02d", $year+1900, $mon+1, $mday;
my $span=&tv_interval($tstart{$f}, $tend{$f}); # second
&do_math($f,$span);
&burst($f); # in case a second is interrupted
#source and destination ip.
$flow_id->addText($f);
#datetime
......@@ -1148,11 +1221,11 @@ sub xml_dump {
$packet_stats->appendChild($packets_lostXML);
$packet_stats->appendChild($packets_sizeXML);
$packets_dupXML->addText($dup{$f});
$packets_lateXML->addText($late{$f});
$packets_dupXML->addText(&format_numbers($dup{$f}));
$packets_lateXML->addText(&format_numbers($late{$f}));
$packets_lostXML->addText(&format_numbers($nloss{$f}));
my $n=$npkt{$f}; $n=1 if $npkt{$f} <1; # divide by zero protection
$packets_sizeXML->addText($sumbyte{$f}/$n);
$packets_sizeXML->addText(&format_numbers($sumbyte{$f}/$n));
#adds values
$MOS_XML->addText(&format_numbers(&mos_r($codec, $rtt, avg( $sumgap{$f}, $ngap{$f}) / 1000,
......@@ -1174,7 +1247,7 @@ sub xml_dump {
}
#packet stats
$packets_numbXML->addText($npkt{$f});
$packets_numbXML->addText(&format_numbers($npkt{$f}));
#$packets_sizeXML->addText();
#bandwidth
......@@ -1339,22 +1412,21 @@ sub pkt_stats {
my $us = shift;
my $dlen = shift;
my $rtp = new Net::RTP::Packet();
if (! exists($tstart{$f})){
$tstart{$f} = $tc;
$first_us{$f}=$prev1s_us{$f}=$prevt100ms_us{$f}=$us;
if (! exists($setuptime{$f}) ){
if ( $pinterval){
$setuptime{$f}=0;
} else {
$setuptime{$f}=tv_interval ( $tjoined{$f}, $tstart{$f}) * 10**3;
}
printf "setup $f : %.3f\n", $setuptime{$f} if $opt_debug;
}
#print "$tc \n";
$tstart{$f} = $tc;
$first_us{$f}=$prev1s_us{$f}=$prevt100ms_us{$f}=$us;
if (! exists($setuptime{$f}) ){
if ( $pinterval){
$setuptime{$f}=0;
} else {
$setuptime{$f}=tv_interval ( $tjoined{$f}, $tstart{$f}) * 10**3;
}
printf "setup $f : %.3f\n", $setuptime{$f} if $opt_debug;
}
}
$tend{$f} = $tc;
$last_us{$f}=$us;
# next if $dlen < 20; # typically small background noice packets added
$npkt{$f}++;
$sumbyte{$f}+=$dlen; $sum1s{$f}+=$dlen; $sum100ms{$f}+=$dlen;
......@@ -1428,9 +1500,7 @@ sub pkt_stats {
&seq_stat($f, $seq_num{$f}, $mtime{$f});
}
#&burst($f);
&burst($f) if !$opt_tcp;
&burst_2($f) if $opt_tcp;
&burst($f);
}
if ($opt_period){
$interval=int($us/10**6 / $opt_period);
......@@ -1472,12 +1542,13 @@ sub do_math{
}
}
if($opt_tcp){
$tcp_packet_stats{$f}{'span'} = $span;
$tcp_packet_stats{$f}{'avg_bandwidth'} = (($tcp_packet_stats{$f}{'num_bytes'}*8)/$span);
$tcp_packet_stats{$f}{'jitter_avg'} = avg($tcp_packet_stats{$f}{'jitter_sum'},$tcp_packet_stats{$f}{'num_packets'});
$tcp_packet_stats{$f}{'jitter_sdv'} = sdv($tcp_packet_stats{$f}{'num_packets'}, $tcp_packet_stats{$f}{'jitter_sum'}, $tcp_packet_stats{$f}{'jitter_square'});
$tcp_packet_stats{$f}{'gap_avg'} = (10**3)*avg($tcp_packet_stats{$f}{'gap_sum'},$tcp_packet_stats{$f}{'num_packets'});
$tcp_packet_stats{$f}{'gap_sdv'} = (10**3)*sdv($tcp_packet_stats{$f}{'num_packets'}, $tcp_packet_stats{$f}{'gap_sum'}, $tcp_packet_stats{$f}{'gap_square'});
#$tcp_packet_stats{$f}{'span'} = 10;
#$span = 10;
#$tcp_packet_stats{$f}{'avg_bandwidth'} = (($tcp_packet_stats{$f}{'num_bytes'}*8)/$span);
#$tcp_packet_stats{$f}{'jitter_avg'} = avg($tcp_packet_stats{$f}{'jitter_sum'},$tcp_packet_stats{$f}{'num_packets'});
#$tcp_packet_stats{$f}{'jitter_sdv'} = sdv($tcp_packet_stats{$f}{'num_packets'}, $tcp_packet_stats{$f}{'jitter_sum'}, $tcp_packet_stats{$f}{'jitter_square'});
#$tcp_packet_stats{$f}{'gap_avg'} = (10**3)*avg($tcp_packet_stats{$f}{'gap_sum'},$tcp_packet_stats{$f}{'num_packets'});
#$tcp_packet_stats{$f}{'gap_sdv'} = (10**3)*sdv($tcp_packet_stats{$f}{'num_packets'}, $tcp_packet_stats{$f}{'gap_sum'}, $tcp_packet_stats{$f}{'gap_square'});
}
}
......@@ -1498,6 +1569,11 @@ sub burst {
$per1s{$f} = $per1s;
$prev_1s{$f} = $last_us{$f};
$sum1s{$f}=0;
if ($opt_tcp) {
$bw_stats{$f}{'maxbps'} = $bps if $bps > $bw_stats{$f}{'maxbps'};
$bw_stats{$f}{'per1s'}= $per1s;
$bw_stats{$f}{'per1s'}= $last_us{$f};
}
}
}
if ( $per100ms > $per100ms{$f} ){ # period expired
......@@ -1511,50 +1587,13 @@ sub burst {
$per100ms{$f} = $per100ms;
$prev_100ms{$f} = $last_us{$f};
$sum100ms{$f}=0;
}
}
}
sub burst_2 {
my $f=shift;
#my %bw_stats = ();
my $span=$last_us{$f}-$first_us{$f};
my $per1s=int($span/10**6);
#printf "per1s: %f\n", $per1s;
my $per100ms=int($span/10**5);
#printf "per1s_f%f\n", $per1s{$f};
#$bw_stats{$f}{'maxbps'} = "destat";
if ( $per1s > $per1s{$f} ){ # period expired
my $per=($last_us{$f}-$prev_1s{$f})/10**6;
# printf "per: %f\n", $per;
if ($per>0){
my $bps = $sum1s{$f} * 8 / $per;
$maxbps{$f} = $bps if $bps > $maxbps{$f};
$bw_stats{$f}{'maxbps'} = $bps if $bps > $bw_stats{$f}{'maxbps'};
$per1s{$f} = $per1s;
$bw_stats{$f}{'per1s'}= $per1s;
$prev_1s{$f} = $last_us{$f};
$bw_stats{$f}{'per1s'}= $last_us{$f};
$sum1s{$f}=0;
}
}
if ( $per100ms > $per100ms{$f} ){ # period expired
my $per=($last_us{$f}-$prev_100ms{$f})/10**6;
if ($per>0){
my $bps = $sum100ms{$f} * 8 / $per;
$max100ms{$f} = $bps if $bps > $max100ms{$f};
if($opt_tcp){
$bw_stats{$f}{'max100ms'} = $bps if $bps > $bw_stats{$f}{'max100ms'} ;
#print "$bw_stats{$f}{$f}{'max100ms'} \n";
$n100ms{$f}++;
$bw_stats{$f}{'n100ms'}++;
$ss100bps+= $bps**2;
$bw_stats{$f}{'ss100bps'} +=$bps**2;
$akk100ms{$f}+=$bps;
$bw_stats{$f}{'akk100ms'} +=$bps;
$per100ms{$f} = $per100ms;
$bw_stats{$f}{'per100ms'} = $per100ms;
$prev_100ms{$f} = $last_us{$f};
$sum100ms{$f}=0;
}
}
}
}
......@@ -1594,14 +1633,18 @@ sub get_date_time{
}
my $date=sprintf "%4d-%02d-%02d", $year+1900, $mon+1, $mday;
return ($date,$time);
}
sub display_stats{
@myflows=@streams if ($#myflows < 0); # no response
foreach $f (sort @myflows) {
my ($ip,$port) = prepare_ip($f) if $opt_tcp;
$f = $ip.":".$port if $opt_tcp;
#my ($ip,$port) = prepare_ip($f) if $opt_tcp;
#$f = $ip.":".$port if $opt_tcp;
if (!exists $npkt{$f}){
#print "no packets \n";
$ngap{$f} = 0;
}
$period_num++;
if ($opt_xml){
if($opt_tcp || $opt_rtmp){
......@@ -1631,7 +1674,7 @@ sub print_out {
$media = "host:port" if $opt_net;
my $id=$f;
my $source=$f;
next if $npkt{$f} <= $opt_flow_min;
next if $npkt{$f} < $opt_flow_min;
$source=$source{$f} if ! $opt_v && $source{$f} ne "" && !$file_flag;
$source=$opt_id if $opt_id;
my $jitter_stat= $opt_rtp || $opt_crude;
......@@ -3906,7 +3949,8 @@ TCP window size. The number of bytes allowed without ACK from client.
=item B<RTMP message>
read more. http://wiki.gnashdev.org/RTMP
An RTMP message is a series of AMF objects, used to transfer data. All messages start with the standard RTMP header, which for results is always the 12 byte header version.
The AMF objects used are primarily properties of an object, so they all have a name, followed by a value.
=item B<RTMP jitter>
......@@ -3918,4 +3962,4 @@ RTMP jitter is based on the timestamp RTMP message header and gap in millisecond
=head1 TCP
Listen to a TCP while running -RTMP option.
Listen to a TCP while running -RTMP option.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment