-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathEndpoint.pm
More file actions
2155 lines (1845 loc) · 59.6 KB
/
Endpoint.pm
File metadata and controls
2155 lines (1845 loc) · 59.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/perl
package LANforge::Endpoint;
use strict;
##################################################
## the object constructor ##
## To use: $ep = LANforge::Endpoint->new(); ##
## or: $ep2 = $ep->new(); ##
##################################################
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
$self->{name} = undef;
bless( $self, $class );
initDataMembers();
return $self;
}
sub initDataMembers {
my $self = shift;
$self->{payload} = undef;
$self->{shelf_id} = undef;
$self->{card_id} = undef;
$self->{port_id} = undef;
$self->{endp_id} = undef;
$self->{endp_type} = undef;
$self->{pattern} = undef;
$self->{ip_port} = undef;
$self->{ip_tos} = undef;
$self->{ip_addr} = undef;
$self->{dst_ip_port} = undef;
$self->{dst_ip_addr} = undef;
$self->{dst_mac} = undef;
$self->{src_addr} = undef;
$self->{role} = undef;
$self->{ep_flags} = undef;
$self->{min_pkt_size} = undef;
$self->{max_pkt_size} = undef;
$self->{min_tx_rate} = undef;
$self->{max_tx_rate} = undef;
$self->{report_timer} = undef;
$self->{start_time} = undef;
$self->{stop_time} = undef;
$self->{cx_detected_dropped_rx} = undef;
$self->{last_rpt} = undef;
$self->{rx_pkts} = undef;
$self->{tx_pkts} = undef;
$self->{tx_failed_pkts} = undef;
$self->{tx_failed_bytes} = undef;
$self->{rx_bytes} = undef;
$self->{tx_bytes} = undef;
$self->{rx_dropped_pkts} = undef; # figure out by looking at gaps in pkt ids
$self->{rx_dup_pkts} = undef;
$self->{rx_ooo_pkts} = undef;
$self->{rx_wrong_dev} = undef;
$self->{rx_crc_failed} = undef;
$self->{connection_dropped} = undef;
$self->{real_tx_rate} = undef;
$self->{real_rx_rate} = undef;
$self->{counters} = undef;
$self->{avg_latency} = undef;
$self->{ttl} = undef;
$self->{filename} = undef;
$self->{send_bad_crc} = undef;
$self->{rx_drop_cx} = undef;
$self->{rx_drop_seq} = undef;
$self->{rx_bit_errors} = undef;
$self->{conn_estab} = undef;
$self->{tcp_retrans} = undef;
# WanLink (LANforge ICE) fields.
$self->{cfg_latency} = undef;
$self->{max_jitter} = undef;
$self->{drop_freq} = undef;
$self->{dup_freq} = undef;
$self->{jitter_freq} = undef;
$self->{reord_freq} = undef;
$self->{max_buf} = undef;
$self->{extra_buf} = undef;
$self->{wan_paths} = undef;
$self->{record_q} = undef;
$self->{dump_file} = undef;
$self->{min_drop_amt} = undef;
$self->{max_drop_amt} = undef;
# VOIP fields.
$self->{proxy_ip} = undef;
$self->{phone_num} = undef;
$self->{peer_phone_num} = undef;
$self->{min_rtp_port} = undef;
$self->{max_rtp_port} = undef;
$self->{reg_expire_timer} = undef;
$self->{sound_dev} = undef;
$self->{tx_sound_file} = undef;
$self->{rx_sound_file} = undef;
$self->{fc_delay} = undef;
$self->{min_ic_gap} = undef;
$self->{max_ic_gap} = undef;
$self->{loop_calls} = undef;
$self->{loop_wav_files} = undef;
$self->{call_setup_dist} = undef;
$self->{last_call_setup_time} = undef;
$self->{state_change_in} = undef;
$self->{min_call_duration} = undef;
$self->{max_call_duration} = undef;
$self->{register_state} = undef;
$self->{call_state} = undef;
$self->{msg_proto} = undef;
$self->{rtp_encoding} = undef;
$self->{latency} = undef;
$self->{rt_latency} = undef;
$self->{jitter} = undef;
$self->{calls_attempted} = undef;
$self->{calls_completed} = undef;
$self->{calls_answered} = undef;
$self->{calls_connected} = undef;
$self->{calls_RHUP} = undef;
$self->{calls_failed} = undef;
$self->{calls_failed_404} = undef;
$self->{calls_failed_no_answer} = undef;
$self->{calls_failed_busy} = undef;
$self->{ringing_timer} = undef;
$self->{rcvd_487_cancel} = undef;
# Armageddon fields - Added by Adam
$self->{udp_src_min} = undef;
$self->{udp_src_max} = undef;
$self->{udp_dst_min} = undef;
$self->{udp_dst_max} = undef;
$self->{pps} = undef;
$self->{pkts_to_send} = undef;
$self->{arm_flags} = undef;
$self->{src_mac_cnt} = undef;
$self->{dst_mac_cnt} = undef;
$self->{multi_pkt} = undef;
$self->{min_src_ip} = undef;
$self->{max_src_ip} = undef;
$self->{min_dst_ip} = undef;
$self->{max_dst_ip} = undef;
} #initDataMembers
# VOIP endpoints look like this:
#VoipEndp [voip1-B] (RUNNING, UDP_TRANSPORT, SAVE_RX_PCM, PLAY_AUDIO, RCV_CALL_ONLY)
# Shelf: 1, Card: 2 Port: 0 Endpoint: 27 Type: VOIP
# ProxyIP: 192.168.1.24 PhoneNum: 2102 PeerPhone: 2103
# MinRtpPort: 10000 MaxRtpPort: 10002 RegExpireTimer: 300
# SoundDev: /dev/dsp TxSoundFile: /tmp/fvoice.wav RxSoundFile: /tmp/pcm_rx.wav
# FC-Delay: 5 MinInterCallGap: 5 MaxInterCallGap: 5
# LoopCalls: FOREVER LoopWaveFiles: 1 MinCallDuration: 30 Max: 30
# RegisterState: REGISTERED CallState: CALL_IN_PROGRESS Protocol: SIP/G711U
# RingingTimer: 10000ms LastCallSetup: 12ms StateChangeIn: 4s
# RptTimer: 5000ms RunningFor: 150446s StopIn: 206276387s
# LastRpt: 0.000 secs ago RealWriteRate: 62044bps RealReadRate: 62044bps
# Latency: -32 -:-24:- -10 [ 9 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] (5)
# RT-Latency: 0 -:73:- 1760 [ 5 0 1 0 0 0 0 2 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] (5)
# Jitter: -20 -:-1:- 2010 [ 891 1 1968 95 0 0 1 0 5 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] (5)
# CallSetup: 0 -:13:- 37 [ 0 0 49 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] (5)
# CallsAttempted: Total: 0 Time: 300000ms Current: 0
# CallsCompleted: Total: 501 Time: 300000ms Current: 1
# CallsAnswered Total: 502 Time: 300000ms Current: 1
# CallsConnected Total: 0 Time: 300000ms Current: 0
# CallsRemoteHUP Total: 501 Time: 300000ms Current: 1
# CallsFailed: Total: 0 Time: 300000ms Current: 0
# RTP Pkts Tx: Total: 7292502 Time: 300000ms Current: 14361
# RTP Pkts Rx: Total: 7292442 Time: 300000ms Current: 14361
# RTP Bytes Tx: Total: 1166800320 Time: 300000ms Current: 2297760
# RTP Bytes Rx: Total: 1166790720 Time: 300000ms Current: 2297760
# RTP Pkts Dropped: Total: 0 Time: 300000ms Current: 0
# RTP Pkts Dup: Total: 0 Time: 300000ms Current: 0
# RTP Pkts OOO: Total: 0 Time: 300000ms Current: 0
# CallsFailed-404 Total: 0 Time: 300000ms Current: 0
# CF 408 (No-Answer) Total: 3 Time: 300000ms Current: 3
# CallsFailed-busy Total: 0 Time: 300000ms Current: 0
# Rcvd 487 (Cancel) Total: 4 Time: 300000ms Current: 4
# A WanLink (LANforge ICE) endpoint's output from the CLI looks something like this
#WanLink [wl1-B] (NOT_RUNNING)
# Shelf: 1, Card: 1 Port: 2 Endpoint: 10 Type: WAN_LINK
# MaxTxRate: 56000bps Latency: 0ms MaxJitter: 0ms
# DropFreq: 0 DupFreq: 0 ReorderFreq: 0 ExtraBuf: 64KB
# RptTimer: 5000ms RunningFor: 0s StopIn: 0s MaxBuf: 67050B
# Cur Backlog: 0 Real Tx Rate: 0bps WanPaths: 1
# Rx Pkts: Total: 0 Time: 300000ms Current: 0
# Rx Bytes: Total: 0 Time: 300000ms Current: 0
# Tx OOO Pkts: Total: 0 Time: 300000ms Current: 0
# Rx Dropped Pkts: Total: 0 Time: 300000ms Current: 0
# Rx Dropped Bytes: Total: 0 Time: 300000ms Current: 0
# Tx Duplicate Pkts: Total: 0 Time: 300000ms Current: 0
# Tx Pkts: Total: 0 Time: 300000ms Current: 0
# Tx Bytes: Total: 0 Time: 300000ms Current: 0
# Tx Failed Pkts: Total: 0 Time: 300000ms Current: 0
# Tx Failed Bytes: Total: 0 Time: 300000ms Current: 0
#
# Name RxPkts RxBytes Dropped MaxRate(bps) Latency Backlog TxPkts TxBytes
# wp1 0 0 0 56000 6 0 0 0
# A Data-Generating (LANforge FIRE) endpoint's output from the CLI looks something like this
#Endpoint [endp-399-RX] (NOT_RUNNING, FIXED_PLD_SIZE, PHANTOM, RATE_CONSTANT, IP_PORT_AUTO)
# Shelf: 1, Card: 1 Port: 409 Endpoint: 400 Type: LANFORGE_TCP Pattern: INCREASING
# MinTxRate: 9600bps MaxTxRate: 9600bps MinPktSize: 1472B MaxPktSize: 1472B
# DestMAC: 00 00 00 00 00 00 DestIpAddr: 0.0.0.0 DestIpPort: 0 Quiesce: 3
# SrcMAC: 00 00 00 00 00 00 SrcIp: 0.0.0.0 IpPort: 0 IpTOS: DONT-SET Priority: 0
# Role: ACCEPT RptTimer: 1000ms RunningFor: 0s StopIn: 0s
# Latency: 0 -:0:- 0 [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] (1)
# Last Rpt: 0.000 secs ago RealTxRate: 0bps RealRxRate: 0bps TTL: 0
# FileName: SendBadCrc: 0 RcvBuf: 0 SndBuf: 0 CWND: 0
# RxDrop%-SEQ: 0.0000 RxDrop%-CX: 0.0000 Conn-Timer: -1ms
# Rx Pkts: Total: 0 Time: 60s Cur: 0 0/s
# Rx Bytes: Total: 0 Time: 60s Cur: 0 0/s
# Rx OOO Pkts: Total: 0 Time: 60s Cur: 0 0/s
# RX Wrong Dev: Total: 0 Time: 60s Cur: 0 0/s
# RX CRC Failed: Total: 0 Time: 60s Cur: 0 0/s
# RX Bit Errors: Total: 0 Time: 3s Cur: 0 0/s
# Rx Dropped Pkts: Total: 0 Time: 3s Cur: 0 0/s
# Cx Detected: 0
# Rx Duplicate Pkts: Total: 0 Time: 60s Cur: 0 0/s
# Tx Pkts: Total: 0 Time: 60s Cur: 0 0/s
# Tx Bytes: Total: 0 Time: 60s Cur: 0 0/s
# Tx Failed Pkts: Total: 0 Time: 60s Cur: 0 0/s
# Tx Failed Bytes: Total: 0 Time: 60s Cur: 0 0/s
# Conn Established: Total: 0 Time: 30s Cur: 0 0/s
# TCP Retransmits: Total: 0 Time: 3s Cur: 0 0/s
sub decode {
my $self = shift;
my $txt = shift;
my @ta = split( /\n/, $txt );
my $i = -1;
my $got_endp = 0;
my $got_wl = 0;
my $got_voip = 0;
my $got_arm = 0;
print "Endpoint::decode, txt -:$txt:-\n";
foreach my $ln (@ta) {
$i++;
next if ($ln =~ /^\s*$/);
next if ($ln =~ /^\s*>>RSLT:/);
next if ($ln =~ /(admin|default)\@btbits>>/i);
#print "Line: -:$ln:-\n";
#Endpoint [endp-34-TX] (NOT_RUNNING, RND_PLD_SIZE, RATE_BURSTY)
#print STDERR "NAME:".$self->{name}."\n";
if ( !defined( $self->{name} ) ) {
if ( $ln =~ /Endpoint\s+\[(.*)\]\s+\((.*)\)/ ) {
print "line has Endpoint\n";
$self->name($1); # set our name
$self->ep_flags($2);
$got_endp = 1;
next;
}
elsif ( $ln =~ /WanLink\s+\[(.*)\]\s+\((.*)\)/ ) {
print "line has Wanlink\n";
$self->name($1); # set our name
$self->ep_flags($2);
$got_wl = 1;
next;
}
elsif ( $ln =~ /VoipEndp\s+\[(.*)\]\s+\((.*)\)/ ) {
print "line has Voip\n";
$self->name($1); # set our name
$self->ep_flags($2);
$got_voip = 1;
next;
}
elsif ( $ln =~ /ArmEndp\s+\[(.*)\]\s+\((.*)\)/ ) {
# added by Adam 8-17-04
print "line has Armg\n";
$self->name($1); # set our name
$self->ep_flags($2);
$got_arm = 1;
next;
}
else {
warn "$0: Don't know about this endpoint: $ln\n";
}
}
elsif (($got_endp + $got_wl + $got_arm) == 0) {
my $nm = $self->{name};
if ( $ln =~ /Endpoint\s+\[$nm\]\s+\((.*)\)/ ) {
$self->ep_flags($1);
#print "Set flags -:" . $self->ep_flags() . ":- orig -:$1:-\n";
$got_endp = 1;
next;
}
elsif ( $ln =~ /WanLink\s+\[$nm\]\s+\((.*)\)/ ) {
$self->ep_flags($1);
#print "Set flags -:" . $self->ep_flags() . ":- orig -:$1:-\n";
$got_wl = 1;
next;
}
elsif ( $ln =~ /ArmEndp\s+\[(.*)\]\s+\((.*)\)/ ) {
$self->ep_flags($2);
#print "Set flags -:" . $self->ep_flags() . ":- orig -:$2:-\n";
$got_arm = 1;
next;
}
else {
warn "$0: Don't know about this endpoint, nm: $nm, ln: $ln\n";
}
next;
}
# Shelf: 1, Card: 1 Port: 3 Endpoint: 15 Type: CUSTOM_TCP Pattern: CUSTOM
if ($got_endp) {
if ( $ln =~
/Shelf:\s+(\d+)\,*\s+Card:\s+(\d+)\s+Port:\s+(\d+)\s+Endpoint:\s+(\d+)\s+Type:\s+(\S+)\s+Pattern:\s+(\S+)/
)
{
$self->shelf_id($1);
$self->card_id($2);
$self->port_id($3);
$self->ep_id($4);
$self->ep_type($5);
$self->pattern($6);
next;
}
# MinTxRate: 512000bps MaxTxRate: 1024000bps MinPktSize: 128B MaxPktSize: 128B
if ( $ln =~
/MinTxRate:\s+(\d+)bps\s+MaxTxRate:\s+(\d+)bps\s+MinPktSize:\s+(\d+)B\s+MaxPktSize:\s+(\d+)B/
)
{
$self->min_tx_rate($1);
$self->max_tx_rate($2);
$self->min_pkt_size($3);
$self->max_pkt_size($4);
next;
}
# DestMAC: 00 90 27 a2 9e 54 DestIpAddr: 172.1.2.201 DestIpPort: 33011
if ( $ln =~
/DestMAC:\s+(([0-9a-fA-F]{2}[: ]){5}([0-9a-fA-F]{2}))\s+DestIpAddr:\s+(\S+)\s+DestIpPort:\s+(\d+)/
)
{
$self->dest_mac($1);
$self->dest_ip_addr($2);
$self->dest_ip_port($3);
next;
}
# SrcMAC: 00 c0 95 e2 4c 0c SrcIp: 172.1.2.200 IpPort: 33011 IpTOS: 0x8
if ( $ln =~
/SrcMAC:\s+(([0-9a-fA-F]{2}[: ]){5}([0-9a-fA-F]{2}))\s+SrcIp:\s+(\S+)\s+IpPort:\s+(\d+(-\d+)?)\s+IpTOS:\s+(\S+)/
)
{
$self->src_mac($1);
$self->ip_addr($2);
$self->ip_port($3);
$self->ip_tos($4);
next;
}
# Role: CONNECT RptTimer: 3000ms RunningFor: 1271256573s StopIn: 0s
if ( $ln =~
/Role:\s+(\S+)\s+RptTimer:\s+(\d+)ms\s+RunningFor:\s+(\d+)s\s+StopIn:\s+(\d+)s/
)
{
$self->role($1);
$self->report_timer($2);
$self->running_for($3);
$self->stop_in($4);
next;
}
if ( $ln =~ /PktsToSend:\s+(\d+)/) {
$self->pkts_to_send($4);
next;
}
# Latency: 0 -:0:- 0 [ 0 0 0 0 0 0 0 0 ] (0)
if ( $ln =~ /Latency:\s+(\S+) -:(\S+):- (\S+)\s+\[ (.*) \]\s+\((\S+)\)/ ) {
$self->min_lat($1);
$self->avg_latency($2);
$self->max_lat($3);
$self->lat_buckets($4);
$self->lat_bucket_size($5);
next;
}
# Last Rpt: 0.000 secs ago RealTxRate: 0bps RealRxRate: 5bps TTL: 0
if ( $ln =~
/Last[- ]Rpt:\s+(\S+) secs ago\s+RealTxRate:\s+(\d+)bps\s+RealRxRate:\s+(\d+)bps\s+TTL:\s+(\S+)/
)
{
$self->last_rpt($1);
$self->real_tx_rate($2);
$self->real_rx_rate($3);
$self->ttl($4);
next;
}
# FileName:
if ( $ln =~ /FileName:\s+(\S+)\s+SendBadCrc:\s+(\S+)/ ) {
$self->filename($1);
$self->send_bad_crc($2);
next;
}
elsif ( $ln =~ /FileName:\s+SendBadCrc:\s+(\S+)/ ) {
$self->filename("");
$self->send_bad_crc($1);
next;
}
# RxDrop%-SEQ: 0.0000 RxDrop%-CX: 12.1819
if ($ln =~ /RxDrop\%-SEQ:\s+(\S+)\s+RxDrop\%-CX:\s+(\S+)/ ) {
$self->rx_drop_seq($1);
$self->rx_drop_cx($2);
next;
}
# Multi-Conn: 0 Active-Connections: 0
# Rx Pkts: Total: 0 Time: 300000ms Current: 0
if ($ln =~ /Rx Pkts:\s+Total:\s+(\d+)/ ) {
$self->rx_pkts($1);
next;
}
# Rx Bytes: Total: 2455112960 Time: 300000ms Current: 0
if ($ln =~ /Rx Bytes:\s+Total:\s+(\d+)/ ) {
$self->rx_bytes($1);
next;
}
# Rx OOO Pkts: Total: 0 Time: 300000ms Current: 0
if ($ln =~ /Rx OOO Pkts:\s+Total:\s+(\d+)/ ) {
$self->rx_ooo_pkts($1);
next;
}
# RX Wrong Dev: Total: 0 Time: 300000ms Current: 0
# RX CRC Failed: Total: 0 Time: 300000ms Current: 0
# RX Bit Errors: Total: 0 Time: 3s Cur: 0 0/s
if ( $ln =~ /RX Bit Errors:\s+Total:\s+(\d+)/ ) {
$self->rx_bit_errors($1);
next;
}
# Rx Dropped Pkts: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Rx Dropped Pkts:\s+Total:\s+(\d+)/ ) {
$self->rx_dropped_pkts($1);
next;
}
# Tx Pkts: Total: 30288945 Time: 300000ms Current: 0
if ( $ln =~ /Tx Pkts:\s+Total:\s+(\d+)/ ) {
$self->tx_pkts($1);
next;
}
# Tx Bytes: Total: 3876984960 Time: 300000ms Current: 0
if ( $ln =~ /Tx Bytes:\s+Total:\s+(\d+)/ ) {
$self->tx_bytes($1);
next;
}
# Conn Established: Total: 0 Time: 30s Cur: 0 0/s
if ( $ln =~ /Conn Established:\s+Total:\s+(\d+)/ ) {
$self->conn_estab($1);
next;
}
# TCP Retransmits: Total: 0 Time: 3s Cur: 0 0/s
if ( $ln =~ /TCP Retransmits:\s+Total:\s+(\d+)/ ) {
$self->tcp_retrans($1);
next;
}
next if ($ln =~ /RX Wrong Dev:/ );
next if ($ln =~ /RX CRC Failed:/);
next if ($ln =~ /Multi-Conn:/ );
next if ($ln =~ /Cx Detected:/);
next if ($ln =~ /Rx Duplicate Pkts:/);
next if ($ln =~ /Tx Failed Pkts:/);
next if ($ln =~ /Tx Failed Bytes:/);
next if ( $ln =~ /Pkt-Gaps:/ );
next if ( $ln =~ /First-Rx:/);
next if ( $ln =~ /RunningInGroup:/);
next if ( $ln =~ /[RT]x Pkts .On Wire./);
next if ( $ln =~ /[RT]x Bytes .On Wire./);
next if ( $ln =~ /Conn Timeouts:/);
warn( "Could not parse line -:$ln:-\n ".__PACKAGE__.".".__FILE__.".".__LINE__."\n" );
return;
}
# If we were a LANforge-FIRE endpoint.
elsif ($got_wl) {
print "PARSING WANLINK: $ln\n";
if ( $ln =~
/Shelf:\s+(\d+)\,\s+Card:\s+(\d+)\s+Port:\s+(\d+)\s+Endpoint:\s+(\d+)\s+Type:\s+(\S+)/
)
{
# Shelf: 1, Card: 1 Port: 3 Endpoint: 4 Type: WAN_LINK
$self->shelf_id($1);
$self->card_id($2);
$self->port_id($3);
$self->ep_id($4);
$self->ep_type($5);
next;
}
# Description:
$i++;
$ln = $ta[$i];
if ( $ln =~ /Description:/ ) { # ignore
next;
}
# MaxTxRate: 4000000bps Latency: 10ms MaxJitter: 0ms
if ( $ln =~
/MaxTxRate:\s+(\d+)bps\s+Latency:\s+(\d+)ms\s+MaxJitter:\s+(\d+)ms/
)
{
$self->max_tx_rate($1);
$self->cfg_latency($2);
$self->max_jitter($3);
next;
}
# Case where MaxTxRate < 0. It shouldn't happen, but i added it
# so the regression script wouldn't die - Adam.
elsif ( $ln =~
/MaxTxRate:\s+-(\d+)bps\s+Latency:\s+(\d+)ms\s+MaxJitter:\s+(\d+)ms/
)
{
my $tmp = "-" . $1;
$self->max_tx_rate($tmp);
$self->cfg_latency($2);
$self->max_jitter($3);
next;
}
# DropFreq: 0 DupFreq: 0 ReorderFreq: 0 ExtraBuf: 100KB
if ( $ln =~
/DropFreq:\s+(\d+)\s+DupFreq:\s+(\d+)\s+ReorderFreq:\s+(\d+)\s+ExtraBuf:\s+(\d+)KB/
)
{
$self->drop_freq($1);
$self->dup_freq($2);
$self->reord_freq($3);
$self->extra_buf($4);
next;
}
# RptTimer: 5000ms RunningFor: 277602940s StopIn: 0s MaxBuf: 103914B
if ( $ln =~
/RptTimer:\s+(\d+)ms\s+RunningFor:\s+(\d+)s\s+StopIn:\s+(\d+)s\s+MaxBuf:\s+(\d+)B/
)
{
$self->report_timer($1);
$self->running_for($2);
$self->stop_in($3);
$self->max_buf($4);
next;
}
# Cur Backlog: 0 Real Tx Rate: 0bps WanPaths: 1
$i++;
$ln = $ta[$i];
if ( $ln =~
/Cur Backlog:\s+(\d+)\s+Real Tx Rate:\s+(\d+)bps\s+WanPaths:\s+(\d+)/
)
{
$self->cur_backlog($1);
$self->real_tx_rate($2);
$self->wan_paths($3);
next;
}
# JitterFreq: 1000 RecordQ: 0 Dump File:
if ( $ln =~
/JitterFreq:\s+(\d+)\s+RecordQ:\s+(\d+)\s+Dump File:\s+(\S*)/ )
{
$self->jitter_freq($1);
$self->record_q($2);
$self->dump_file($3);
next;
}
# MinDropAmt: 0 MaxDropAmt: 0
$ln = $ta[ ++$i ];
if ( $ln =~ /MinDropAmt:\s+(\d+)\s+MaxDropAmt:\s+(\d+)/ ) {
$self->min_drop_amt($1);
$self->max_drop_amt($2);
next;
}
if ( $ln =~ /\s+QueueDiscipline:/ ) { # ignore
next;
}
# Rx Pkts: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /\s+Rx Pkts:\s+Total:\s+(\d+)/ ) {
$self->rx_pkts($1);
next;
}
# Adam - I am just matching the fields in these sections for now because I am
# not using this data. Will complete when the data is needed
# Rx Bytes: Total: 2455112960 Time: 300000ms Current: 0
if ( $ln =~ /Rx Bytes:\s+Total:\s+(\d+)/ ) {
$self->rx_bytes($1);
next;
}
# Tx OOO Pkts: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Tx OOO Pkts:\s+Total:\s+(\d+)/ ) {
#$self->tx_ooo_pkts($1);
next;
}
# Rx Dropped Pkts: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Rx Dropped Pkts:\s+Total:\s+(\d+)/ ) {
$self->rx_dropped_pkts($1);
next;
}
# Rx Dropped Bytes: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Rx Dropped Bytes:\s+Total:\s+(\d+)/ ) {
# $self->rx_dropped_bytes($1);
next;
}
# Tx Duplicate Pkts: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Tx Duplicate Pkts:\s+Total:\s+(\d+)/ ) {
#$self->tx_duplicate_pkts($1);
next;
}
# Tx Pkts: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Tx Pkts:\s+Total:\s+(\d+)/ ) {
#$self->tx_pkts_pkts($1);
next;
}
# Tx Bytes: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Tx Bytes:\s+Total:\s+(\d+)/ ) {
$self->tx_bytes($1);
next;
}
# Tx Failed Pkts: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Tx Failed Pkts:\s+Total:\s+(\d+)/ ) {
#$self->tx_failed_pkts($1);
next;
}
# Tx Failed Late Pkts: Total: 5 Time: 60s Cur: 5 0/s
if ( $ln =~ /Tx Failed Late Pkts:\s+Total:\s+(\d+)/ ) { # ignore
next;
}
# Tx Failed Bytes: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Tx Failed Bytes:\s+Total:\s+(\d+)/ ) {
next;
#$self->tx_bytes($1);
}
# Tx Failed Late Pkts: Total: 5 Time: 60s Cur: 5 0/s
if ( $ln =~ /Tx Failed Late Bytes:\s+Total:\s+(\d+)/ ) { # ignore
next;
}
# Recorded Pkts: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Recorded Pkts:/ ) {
next;
}
# Recorded Bytes: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Recorded Bytes:/ ) {
next;
}
# Rcrd Dropped Pkts: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Rcrd Dropped Pkts:/ ) {
next;
}
# Rcrd Dropped Bytes: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /Rcrd Dropped Bytes:/ ) {
next;
}
else {
warn( "LAST LINE? Could not parse line -:$ln:-\n ".__PACKAGE__.".".__FILE__.".".__LINE__."\n" );
}
return;
# return for now, the rest of wanlink stuff not completely implemented - Adam
# TODO: Adam - redo the rest of this wanpath stuff
# WanPaths
# my $j = 0;
# my $wpaths = "";
# for ( $j = 0 ; $j < $self->wan_paths() ; $j++ ) {
#
# # Name RxPkts RxBytes Dropped MaxRate(bps) Latency Backlog TxPkts TxBytes
# # wp1 0 0 0 56000 6 0 0 0
# $i++;
# $ln = $ta[$i];
# if ( $ln =~
#/\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d)\s+(\d+)\s+(\d+)/
# )
# {
# $wpaths .= $ln;
# }
# else {
# warn( "Could not parse line -:$ln:-\n ".__PACKAGE__.".".__FILE__.".".__LINE__."\n" );
# }
# $self->wan_path_rpts($wpaths);
# }
# return;
} # If we were a LANforge-ICE endpoint.
elsif ($got_voip) {
# Skip first line, we ignore VOIP flags for now.
if ( $ln =~
/Shelf:\s+(\d+)\,\s+Card:\s+(\d+)\s+Port:\s+(\d+)\s+Endpoint:\s+(\d+)\s+Type:\s+(\S+)/
)
{
# Shelf: 1, Card: 1 Port: 3 Endpoint: 4 Type: VOIP
$self->shelf_id($1);
$self->card_id($2);
$self->port_id($3);
$self->ep_id($4);
$self->ep_type($5);
next;
}
# ProxyIP: 192.168.1.24 PhoneNum: 2102 PeerPhone: 2103
if ( $ln =~
/ProxyIP:\s+(\S+)\s+SipPort:\s+\S+\s+PhoneNum:\s+(\S+)\s+PeerPhone:\s+(\S+)/
)
{
$self->proxy_ip($1);
$self->phone_num($2);
$self->peer_phone_num($3);
next;
}
# MinRtpPort: 10000 MaxRtpPort: 10002 RegExpireTimer: 300
if ( $ln =~
/MinRtpPort:\s+(\S+)\s+MaxRtpPort:\s+(\S+)\s+RegExpireTimer:\s+(\S+)/
)
{
$self->min_rtp_port($1);
$self->max_rtp_port($2);
$self->reg_expire_timer($3);
next;
}
# SoundDev: /dev/dsp TxSoundFile: /tmp/graceland.wav RxSoundFile: /tmp/pcm_rx.wav
if ( $ln =~ /SoundDev:\s+(\S+)\s+TxSoundFile:\s+(.*\S)\s+JB-Bufs/ ) {
$self->sound_dev($1);
$self->tx_sound_file($2);
next;
}
if ( $ln =~ /RxSoundFile:\s+(.*) PESQ-Server/ ) {
$self->rx_sound_file($3);
next;
}
# FC-Delay: 5 MinInterCallGap: 5 MaxInterCallGap: 5
if ( $ln =~
/FC-Delay:\s+(\S+)\s+MinInterCallGap:\s+(\S+)\s+MaxInterCallGap:\s+(\S+)/
)
{
$self->fc_delay($1);
$self->min_ic_gap($2);
$self->max_ic_gap($3);
next;
}
# LoopCalls: FOREVER LoopWaveFiles: 1 MinCallDuration: 0
if ( $ln =~
/LoopCalls:\s+(\S+)\s+LoopWaveFiles:\s+(\S+)\s+MinCallDuration:\s+(\S+)\s+Max:\s+(\S+)/
)
{
$self->loop_calls($1);
$self->loop_wav_files($2);
$self->min_call_duration($3);
$self->max_call_duration($4);
next;
}
# RegisterState: REGISTERED CallState: CALL_IN_PROGRESS Protocol: SIP/G711U
if ( $ln =~
/RegisterState:\s+(\S+)\s+CallState:\s+(\S+)\s+Protocol:\s+(\S+)\/(\S+)/
)
{
$self->register_state($1);
$self->call_state($2);
$self->msg_proto($3);
$self->rtp_encoding($4);
next;
}
# RingingTimer: 10000ms LastCallSetup: 12ms StateChangeIn: 4s
if ( $ln =~
/RingingTimer:\s+(\S+)\s+LastCallSetup:\s+(\S+)ms\s+StateChangeIn:\s+(\S+)s/
)
{
$self->ringing_timer($1);
$self->last_call_setup_time($2);
$self->state_change_in($3);
next;
}
# RptTimer: 5000ms RunningFor: 150446s StopIn: 206276387s
if ( $ln =~
/RptTimer:\s+(\d+)ms\s+RunningFor:\s+(\d+)s\s+StopIn:\s+(\d+)s/ )
{
$self->report_timer($1);
$self->running_for($2);
$self->stop_in($3);
next;
}
# LastRpt: 0.000 secs ago RealWriteRate: 62044bps RealReadRate: 62044bps
if ( $ln =~
/LastRpt:\s+(\S+) secs ago\s+RealWriteRate:\s+(\d+)bps\s+RealReadRate:\s+(\d+)bps/
)
{
$self->last_rpt($1);
$self->real_tx_rate($2);
$self->real_rx_rate($3);
next;
}
# Skip VAD settings
# Latency: -32 -:-24:- -10 [ 9 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] (5)
if ($ln =~ /\s+Latency:/) {
$self->latency($ln);
next;
}
# RT-Latency: 0 -:73:- 1760 [ 5 0 1 0 0 0 0 2 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] (5)
if ($ln =~ /RT-Latency:/) {
$self->rt_latency($ln);
next;
}
# Jitter: -20 -:-1:- 2010 [ 891 1 1968 95 0 0 1 0 5 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] (5)
if ($ln =~ /Jitter:/) {
$self->jitter($ln);
next;
}
# CallSetup: 0 -:13:- 37 [ 0 0 49 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] (5)
if ($ln =~ /CallSetup:/) {
$self->call_setup_dist($ln);
next;
}
# CallsAttempted: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /CallsAttempted:\s+Total:\s+(\d+)/ ) {
$self->calls_attempted($1);
next;
}
# CallsCompleted: Total: 501 Time: 300000ms Current: 1
if ( $ln =~ /CallsCompleted:\s+Total:\s+(\d+)/ ) {
$self->calls_completed($1);
next;
}
# CallsAnswered Total: 502 Time: 300000ms Current: 1
if ( $ln =~ /CallsAnswered.*\s+Total:\s+(\d+)/ ) {
$self->calls_answered($1);
next;
}
# CallsConnected Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /CallsConnected.*\s+Total:\s+(\d+)/ ) {
$self->calls_connected($1);
next;
}
# CallsRemoteHUP Total: 501 Time: 300000ms Current: 1
if ( $ln =~ /CallsRemoteHUP.*\s+Total:\s+(\d+)/ ) {
$self->calls_RHUP($1);
next;
}
# CallsFailed: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /CallsFailed:\s+Total:\s+(\d+)/ ) {
$self->calls_failed($1);
next;
}
# RTP Pkts Tx: Total: 7292502 Time: 300000ms Current: 14361
if ( $ln =~ /RTP Pkts Tx:\s+Total:\s+(\d+)/ ) {
$self->tx_pkts($1);
next;
}
if ($ln =~ /VAD:/) {
next;
}
# RTP Pkts Rx: Total: 7292442 Time: 300000ms Current: 14361
if ( $ln =~ /RTP Pkts Rx:\s+Total:\s+(\d+)/ ) {
$self->rx_pkts($1);
next;
}
# RTP Bytes Tx: Total: 1166800320 Time: 300000ms Current: 2297760
if ( $ln =~ /RTP Bytes Tx:\s+Total:\s+(\d+)/ ) {
$self->tx_bytes($1);
next;
}
# RTP Bytes Rx: Total: 1166790720 Time: 300000ms Current: 2297760
if ( $ln =~ /RTP Bytes Rx:\s+Total:\s+(\d+)/ ) {
$self->rx_bytes($1);
next;
}
# RTP Pkts Dropped: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /RTP Pkts Dropped:\s+Total:\s+(\d+)/ ) {
$self->rx_dropped_pkts($1);
next;
}
# RTP Pkts Dup: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /RTP Pkts Dup:\s+Total:\s+(\d+)/ ) {
$self->rx_dup_pkts($1);
next;
}
# RTP Pkts Dropped: Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /RTP Pkts OOO:\s+Total:\s+(\d+)/ ) {
$self->rx_ooo_pkts($1);
next;
}
# Skip JB silence played, overruns, underruns
#$i += 3;
# CallsFailed-404 Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /CallsFailed-404\s+Total:\s+(\d+)/ ) {
$self->calls_failed_404($1);
next;
}
# CF 408 (No-Answer) Total: 3 Time: 300000ms Current: 3
if ( $ln =~ /CF 408 \(No-Answer\)\s+Total:\s+(\d+)/ ) {
$self->calls_failed_no_answer($1);
next;
}
else {
warn( "Could not parse line -:$ln:-\n ".__PACKAGE__.".".__FILE__.".".__LINE__."\n" );
}
# CallsFailed-busy Total: 0 Time: 300000ms Current: 0
if ( $ln =~ /CallsFailed-busy\s+Total:\s+(\d+)/ ) {
$self->calls_failed_busy($1);
next;
}
# Rcvd 487 (Cancel) Total: 4 Time: 300000ms Current: 4
if ( $ln =~ /Rcvd 487 \(Cancel\)\s+Total:\s+(\d+)/ ) {
$self->rcvd_487_cancel($1);
next;
}
warn( "Could not parse line -:$ln:-\n ".__PACKAGE__.".".__FILE__.".".__LINE__."\n" );
return;
}
elsif ($got_arm) {
if ( $ln =~
/Shelf:\s+(\d+)\,\s+Card:\s+(\d+)\s+Port:\s+(\d+)\s+Endpoint:\s+(\d+)\s+Type:\s+(\S+)/
)
{ #Shelf: 1, Card: 1 Port: 1 Endpoint: 125 Type: ARM_UDP
$self->shelf_id($1);
$self->card_id($2);
$self->port_id($3);
$self->ep_id($4);
$self->ep_type($5);
next;
}
if ( $ln =~