forked from keysightgems/Huawei_Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIxia_NetNgpfRip.tcl
More file actions
800 lines (673 loc) · 19.8 KB
/
Ixia_NetNgpfRip.tcl
File metadata and controls
800 lines (673 loc) · 19.8 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
# Copyright (c) Ixia technologies 2010-2011, Inc.
# Release Version 1.0
#===============================================================================
# Change made
# Version 1.0
# 1. Create
class RipSession {
inherit RouterEmulationObject
public variable hRouter
constructor { port } {
global errNumber
set tag "body OspfvSession::ctor [info script]"
Deputs "----- TAG: $tag -----"
set portObj [ GetObject $port ]
if { [ catch {
set hPort [ $portObj cget -handle ]
} ] } {
error "$errNumber(1) Port Object in rip ctor"
}
if {[ixNet getA $hPort/protocols/rip -enabled]} {
} else {
ixNet setM $hPort/protocols/rip -enabled True
ixNet commit
}
#-- add rip protocol
set handle [ ixNet add $hPort/protocols/rip router ]
ixNet setA $handle -Enabled True
ixNet commit
set handle [ ixNet remapIds $handle ]
ixNet setA $handle -name $this
set rb_interface [ ixNet getL $hPort interface ]
array set interface [ list ]
generate_interface
}
method config { args } {}
method set_route { args } {}
method unset_route { args } {}
method advertise_route {} {}
method withdraw_route {} {}
method flapping_route { args } {}
method enable {} {}
method disable {} {}
method get_session_status {} {}
method get_session_stats {} {}
method generate_interface { args } {
set tag "body RipSession::generate_interface [info script]"
Deputs "----- TAG: $tag -----"
foreach int $rb_interface {
ixNet setM $handle -interfaceId $int -enabled True
ixNet commit
}
}
}
class RipRoute {
inherit NetObject
constructor { router } {
global errNumber
set tag "body RipRoute::ctor [info script]"
Deputs "----- TAG: $tag -----"
set routerObj [ GetObject $router ]
if { [ catch {
set hRouter [ $routerObj cget -handle ]
} ] } {
error "$errNumber(1) Router Object in RipRoute ctor"
}
set hRouteRange [ixNet add $hRouter routeRange]
ixNet commit
set handle [ ixNet remapIds $hRouteRange ]
ixNet setA $handle -enalbed True
ixNet commit
set trafficObj $handle
}
method config { args } {}
}
body RipSession::config { args } {
global errorInfo
global errNumber
set version V2
set update_interval 30
set ipv4_addr 1.1.1.2
set ipv4_prefix_len 24
set ipv4_gw 1.1.1.1
set ipv6_addr 3ffe:3210::2
set ipv6_prefix_len 64
set ipv6_gw 3ffe:3210::1
set src_mac_step "00:00:00:00:00:01"
set ipv4_addr_step 0.0.0.1
set ipv6_addr_step ::1
set vlan_id1_step 1
set vlan_id2_step 1
set count 1
set ip_version ipv4
set enabled True
set tag "body RipSession::config [info script]"
Deputs "----- TAG: $tag -----"
Deputs "Args:$args "
foreach { key value } $args {
set key [string tolower $key]
switch -exact -- $key {
-router_id {
set router_id $value
}
-version {
set value [string toupper $value]
set version $value
}
-update_interval {
set update_interval $value
}
-update_jitter {
set update_jitter $value
}
-ipv4_addr {
set ipv4_addr $value
}
-ipv4_prefix_len {
set ipv4_prefix_len $value
}
-ipv4_gw {
set ipv4_gw $value
}
-ipv6_addr {
set ipv6_addr $value
}
-ipv6_prefix_len {
set ipv6_prefix_len $value
}
-ipv6_gw {
set ipv6_gw $value
}
-vlan_id1 {
set vlan_id1 $value
set flagOuterVlan 1
}
-vlan_id1_step {
set vlan_id1_step $value
set flagOuterVlan 1
}
-vlan_id2 {
set vlan_id2 $value
set flagInnerVlan 1
}
-vlan_id2_step {
set vlan_id2_step $value
set flagInnerVlan 1
}
-outer_vlan_id {
if { [ string is integer $value ] && ( $value >= 0 ) && ( $value < 4096 ) } {
set outer_vlan_id $value
set flagOuterVlan 1
} else {
error "$errNumber(1) key:$key value:$value"
}
}
-outer_vlan_step {
if { [ string is integer $value ] && ( $value >= 0 ) && ( $value < 4096 ) } {
set outer_vlan_step $value
set flagOuterVlan 1
} else {
error "$errNumber(1) key:$key value:$value"
}
}
-outer_vlan_num {
if { [ string is integer $value ] && ( $value >= 0 ) } {
set outer_vlan_num $value
set flagOuterVlan 1
} else {
error "$errNumber(1) key:$key value:$value"
}
}
-outer_vlan_priority {
if { [ string is integer $value ] && ( $value >= 0 ) && ( $value < 8 ) } {
set outer_vlan_priority $value
set flagOuterVlan 1
} else {
error "$errNumber(1) key:$key value:$value"
}
}
-inner_vlan_id {
if { [ string is integer $value ] && ( $value >= 0 ) && ( $value < 4096 ) } {
set inner_vlan_id $value
set flagInnerVlan 1
} else {
error "$errNumber(1) key:$key value:$value"
}
}
-inner_vlan_step {
if { [ string is integer $value ] && ( $value >= 0 ) && ( $value < 4096 ) } {
set inner_vlan_step $value
set flagInnerVlan 1
} else {
error "$errNumber(1) key:$key value:$value"
}
}
-inner_vlan_num {
if { [ string is integer $value ] && ( $value >= 0 ) } {
set inner_vlan_num $value
set flagInnerVlan 1
} else {
error "$errNumber(1) key:$key value:$value"
}
}
-inner_vlan_priority {
if { [ string is integer $value ] && ( $value >= 0 ) && ( $value < 8 ) } {
set inner_vlan_priority $value
set flagInnerVlan 1
} else {
error "$errNumber(1) key:$key value:$value"
}
}
-outer_vlan_cfi {
set outer_vlan_cfi $value
}
-inner_vlan_cfi {
set inner_vlan_cfi $value
}
}
}
ixNet setM $handle -enabled True
if { [ info exists router_id ] } {
ixNet setA $handle -routerId $router_id
ixNet commit
}
if { [ info exists version ] } {
switch $version {
V1 {
set version receiveVersion1
}
V2 {
set version receiveVersion2
}
NG {
set version receiveVersion1And2
}
}
ixNet setA $handle -receiveType $version
ixNet commit
}
if { [ info exists update_interval ] } {
ixNet setA $handle -updateInterval $update_interval
ixNet commit
}
if { [ info exists update_jitter ] } {
ixNet setA $handle -updateIntervalOffset $update_jitter
ixNet commit
}
if { [ info exists ipv4_addr ] } {
foreach int $rb_interface {
if { [ llength [ ixNet getList $int ipv4 ] ] == 0 } {
set ipv4Int [ ixNet add $int ipv4 ]
} else {
set ipv4Int [ lindex [ ixNet getList $int ipv4 ] 0 ]
}
ixNet setA $ipv4Int -ip $ipv4_addr
ixNet setA $ipv4Int -maskWidth $ipv4_prefix_len
ixNet setA $ipv4Int -gateway $ipv4_gw
}
ixNet commit
}
if { [ info exists ipv6_addr ] } {
foreach int $rb_interface {
if { [ llength [ ixNet getList $int ipv6 ] ] == 0 } {
set ipv6Int [ ixNet add $int ipv6 ]
} else {
set ipv6Int [ lindex [ ixNet getList $int ipv6 ] 0 ]
}
ixNet setA $ipv6Int -ip $ipv6_addr
ixNet setA $ipv6Int -prefixLength $ipv6_prefix_len
ixNet setA $ipv6Int -gateway $ipv6_gw
}
ixNet commit
}
set pfxIncr [ GetStepPrefixlen $ipv4_addr_step ]
# if {[ info exists vlan_id1 ]} {
# foreach int $rb_interface {
# for { set index 0 } { $index < $count } { incr index } {
# Deputs "int:$int"
# if { [ llength [ ixNet getL $int ipv4 ] ] == 0 } {
# ixNet add $int ipv4
# ixNet commit
#
# }
# ixNet setM $int/ipv4 \
# -ip $ipv4_addr \
# -gateway $ipv4_gw \
# -maskWidth $ipv4_prefix_len
# ixNet commit
# set ipv4_addr [ IncrementIPAddr $ipv4_addr $pfxIncr ]
# if { [ string tolower $ip_version ] != "ipv4" } {
# if { [ llength [ ixNet getL $int ipv6 ] ] == 0 } {
# ixNet add $int ipv6
# ixNet commit
# }
# Deputs "IPv6 Addr: $ipv6_addr "
# Deputs "int/ipv6: [ ixNet getL $int ipv6 ]"
# ixNet setM [ ixNet getL $int ipv6 ] \
# -ip $ipv6_addr \
# -gateway $ipv6_gw \
# -prefixLength $ipv6_prefix_len
# ixNet commit
# set ipv6_addr [ IncrementIPv6Addr $ipv6_addr 64 ]
# Deputs "ipv6 addr incr: $ipv6_addr"
# }
# if { [ info exists src_mac ] } {
# ixNet setM $int/ethernet \
# -macAddress $src_mac
# ixNet commit
# set src_mac [ IncrMacAddr $src_mac $src_mac_step ]
#
# }
# if { [ info exists vlan_id1 ] } {
# set vlanId $vlan_id1
# ixNet setM $int/vlan \
# -count 1 \
# -vlanEnable True \
# -vlanId $vlanId
# ixNet commit
# incr vlan_id1 $vlan_id1_step
#
# }
# if { [ info exists vlan_id2 ] } {
# set vlanId $vlan_id2
# set vlanId1 [ ixNet getA $int/vlan -vlanId ]
# set vlanId "${vlanId1},${vlanId}"
# ixNet setM $int/vlan \
# -count 2 \
# -vlanEnable True \
# -vlanId $vlanId
# ixNet commit
# incr vlan_id2 $vlan_id2_step
#
# }
# if { [ info exists enabled ] } {
# ixNet setA $int -enabled $enabled
# ixNet commit
#
# }
#
# }
#
# }
# }
if {[ info exists outer_vlan_id ]} {
foreach int $rb_interface {
for { set index 0 } { $index < $count } { incr index } {
Deputs "int:$int"
if { [ info exists outer_vlan_id ] } {
set vlanId $outer_vlan_id
ixNet setM $int/vlan \
-count 1 \
-vlanEnable True \
-vlanId $vlanId \
-vlanPriority $outer_vlan_priority
ixNet commit
incr outer_vlan_id $outer_vlan_step
}
if { [ info exists inner_vlan_id ] } {
set vlanId $inner_vlan_id
set innerPri $inner_vlan_priority
set vlanId1 [ ixNet getA $int/vlan -vlanId ]
set vlanId "${vlanId1},${vlanId}"
set outerPri [ ixNet getA $int/vlan -vlanPriority]
set Pri "${outerPri},${innerPri}"
ixNet setM $int/vlan \
-count 2 \
-vlanEnable True \
-vlanId $vlanId \
-vlanPriority $Pri
ixNet commit
incr inner_vlan_id $inner_vlan_step
}
if { [ info exists enabled ] } {
ixNet setA $int -enabled $enabled
ixNet commit
}
}
}
}
ixNet commit
return [GetStandardReturnHeader]
}
body RipSession::advertise_route {} {
set tag "body RipSession::advertise_topo [info script]"
Deputs "----- TAG: $tag -----"
foreach route [ ixNet getL $handle routeRange ] {
ixNet setA $route -enabled True
}
ixNet commit
return [GetStandardReturnHeader]
}
body RipSession::withdraw_route {} {
set tag "body RipSession::withdraw_topo [info script]"
Deputs "----- TAG: $tag -----"
foreach route [ ixNet getL $handle routeRange ] {
ixNet setA $route -enabled False
}
ixNet commit
return [GetStandardReturnHeader]
}
body RipSession::flapping_route { args } {
set tag "body RipSession::flapping_topo [info script]"
Deputs "----- TAG: $tag -----"
foreach { key value } $args {
set key [string tolower $key]
switch -exact -- $key {
-route_block {
set route_block $value
}
-flap_times {
set flap_times $value
}
-flap_interval {
set flap_interval $value
}
}
}
set routeBlock [ GetObject $route_block ]
Deputs "routeBlock is: $routeBlock"
set routeRange [ $routeBlock cget -handle ]
Deputs "routeRange is: $routeRange"
for { set index 0 } { $index < $flap_times } { incr index } {
ixNet setA $routeRange -enabled True
ixNet commit
after [ expr $flap_interval * 1000 ]
ixNet setA $routeRange -enabled False
ixNet commit
}
return [GetStandardReturnHeader]
}
body RipSession::get_session_status {} {
set tag "body RipSession::get_session_status [info script]"
Deputs "----- TAG: $tag -----"
set root [ixNet getRoot]
Deputs "root $root"
set view {::ixNet::OBJ-/statistics/view:"RIP Aggregated Statistics"}
Deputs "view $view"
after 5000
set captionList [ ixNet getA $view/page -columnCaptions ]
Deputs "captionList $captionList"
set name_index [ lsearch -exact $captionList {Stat Name} ]
set routers_index [ lsearch -exact $captionList {Routers Configured} ]
# set request_index [ lsearch -exact $captionList {Request Packet Tx} ]
# set regupdate_index [ lsearch -exact $captionList {Regular Update Packet Tx} ]
# set trigupdate_index [ lsearch -exact $captionList {Triggered Update Packet Tx} ]
# set rouadver_index [ lsearch -exact $captionList {Routes Advertised Tx} ]
# set rouwithd_index [ lsearch -exact $captionList {Routes Withdraws Tx} ]
set stats [ ixNet getA $view/page -rowValues ]
Deputs "stats:$stats"
set portFound 0
foreach row $stats {
eval {set row} $row
Deputs "row:$row"
Deputs "port index:$name_index"
set rowPortName [ lindex $row $name_index ]
Deputs "row port name:$name_index"
set connectionInfo [ ixNet getA $hPort -connectionInfo ]
Deputs "connectionInfo :$connectionInfo"
regexp -nocase {chassis=\"([0-9\.]+)\" card=\"([0-9\.]+)\" port=\"([0-9\.]+)\"} $connectionInfo match chassis card port
Deputs "chas:$chassis card:$card port:$port"
set portName ${chassis}/Card${card}/Port${port}
Deputs "filter name: $portName"
# 192.168.0.110/Card1/Port7
# 192.168.0.110/Card01/Port07
regexp -nocase {([0-9\.]+)/Card([0-9\.]+)/Port([0-9\.]+)} $rowPortName match rchassis rcard rport
Deputs "rchass:$rchassis rcard:$rcard rport:$rport"
if {$chassis == $rchassis && $card == $rcard && $port == $rport} {
set portFound 1
break
}
}
set status "down"
if { $portFound } {
set routers [ lindex $row $routers_index ]
# set request [ lindex $row $routers_index ]
# set regupdate [ lindex $row $regupdate_index ]
# set trigupdate [ lindex $row $trigupdate_index ]
# set rouadver [ lindex $row $rouadver_index ]
# set rouwithd [ lindex $row $rouwithd_index ]
if { $routers == "" } {
set status "none"
}
if { $routers == 0 } {
set status "closed"
}
if { $routers > 0 } {
set status "open"
}
}
set ret [ GetStandardReturnHeader ]
set ret $ret[ GetStandardReturnBody "status" $status ]
return $ret
}
body RipSession::get_session_stats {} {
set tag "body RipSession::get_session_stats [info script]"
Deputs "----- TAG: $tag -----"
set root [ixNet getRoot]
Deputs "root $root"
set view {::ixNet::OBJ-/statistics/view:"RIP Aggregated Statistics"}
after 5000
set captionList [ ixNet getA $view/page -columnCaptions ]
Deputs "captionList $captionList"
set name_index [ lsearch -exact $captionList {Stat Name} ]
# set routers_index [ lsearch -exact $captionList {Routers Configured} ]
# set request_index [ lsearch -exact $captionList {Request Packet Tx} ]
# set regupdate_index [ lsearch -exact $captionList {Regular Update Packet Tx} ]
# set trigupdate_index [ lsearch -exact $captionList {Triggered Update Packet Tx} ]
set rouadver_index [ lsearch -exact $captionList {Routes Advertised Tx} ]
set rouwithd_index [ lsearch -exact $captionList {Routes Withdraws Tx} ]
set stats [ ixNet getA $view/page -rowValues ]
Deputs "stats:$stats"
set portFound 0
foreach row $stats {
eval {set row} $row
Deputs "row:$row"
Deputs "port index:$name_index"
set rowPortName [ lindex $row $name_index ]
Deputs "row port name:$name_index"
set connectionInfo [ ixNet getA $hPort -connectionInfo ]
Deputs "connectionInfo :$connectionInfo"
regexp -nocase {chassis=\"([0-9\.]+)\" card=\"([0-9\.]+)\" port=\"([0-9\.]+)\"} $connectionInfo match chassis card port
Deputs "chas:$chassis card:$card port:$port"
set portName ${chassis}/Card${card}/Port${port}
Deputs "filter name: $portName"
# 192.168.0.110/Card1/Port7
# 192.168.0.110/Card01/Port07
regexp -nocase {([0-9\.]+)/Card([0-9\.]+)/Port([0-9\.]+)} $rowPortName match rchassis rcard rport
Deputs "rchass:$rchassis rcard:$rcard rport:$rport"
if {$chassis == $rchassis && $card == $rcard && $port == $rport} {
set portFound 1
break
}
}
set ret "Status : true\nLog : \n"
if { $portFound } {
set statsItem "rx_adv_update_count"
set statsVal N/A
Deputs "stats val:$statsVal"
set ret $ret[ GetStandardReturnBody $statsItem $statsVal ]
set statsItem "rx_withdrawn_update_count"
set statsVal N/A
Deputs "stats val:$statsVal"
set ret $ret[ GetStandardReturnBody $statsItem $statsVal ]
set statsItem "tx_adv_update_count"
set statsVal [ lindex $row $rouadver_index ]
Deputs "stats val:$statsVal"
set ret $ret[ GetStandardReturnBody $statsItem $statsVal ]
set statsItem "tx_withdrawn_update_count"
set statsVal [ lindex $row $rouwithd_index ]
Deputs "stats val:$statsVal"
set ret $ret[ GetStandardReturnBody $statsItem $statsVal ]
}
Deputs "ret:$ret"
return $ret
}
body RipSession::set_route {args} {
set tag "body RipSession::set_route [info script]"
Deputs "----- TAG: $tag -----"
set hRouter [ixNet add $handle routeRange]
Deputs "hRouter is: $hRouter"
ixNet commit
foreach { key value } $args {
set key [string tolower $key]
switch -exact -- $key {
-route_block {
set route_block $value
}
-metric {
set metric $value
}
-next_hop {
set next_hop $value
}
-route_tag {
set route_tag $value
}
}
}
if {[info exists metric]} {
ixNet setA $hRouter -metric $metric
}
if {[info exists next_hop]} {
ixNet setA $hRouter -nextHop $next_hop
}
if {[info exists route_tag]} {
ixNet setA $hRouter -routeTag $route_tag
}
if { [ info exists route_block ] } {
set routeBlock [ GetObject $route_block ]
$routeBlock configure -handle $hRouter
if { $routeBlock == ""} {
return [GetErrorReturnHeader "No valid object found...-route_block $routeBlock"]
}
set num [ $routeBlock cget -num ]
set start [ $routeBlock cget -start ]
set step [ $routeBlock cget -step ]
set prefix_len [ $routeBlock cget -prefix_len ]
ixNet setM $hRouter \
-noOfRoutes $num \
-firstRoute $start \
-step $step \
-maskWidth $prefix_len
} else {
return [GetErrorReturnHeader "Madatory parameter needed...-route_block"]
}
ixNet commit
return [GetStandardReturnHeader]
}
body RipSession::unset_route {args} {
set tag "body RipSession::unset_route [info script]"
Deputs "----- TAG: $tag -----"
foreach { key value } $args {
set key [string tolower $key]
switch -exact -- $key {
-route_block {
set route_block $value
}
}
}
set routeBlock [ GetObject $route_block ]
$routeBlock unconfig
}
body RipRoute::config { args } {
global errorInfo
global errNumber
set tag "body RipRoute::config [info script]"
Deputs "----- TAG: $tag -----"
foreach { key value } $args {
set key [string tolower $key]
switch -exact -- $key {
-route_block {
set route_block $value
}
-metric {
set metric $value
}
-next_hop {
set next_hop $value
}
-route_tag {
set route_tag $value
}
}
}
if {[info exists metric]} {
ixNet setA $handle -metric $metric
}
if {[info exists next_hop]} {
ixNet setA $handle -nextHop $next_hop
}
if {[info exists route_tag]} {
ixNet setA $handle -routeTag $route_tag
}
if { [ info exists route_block ] } {
set routeBlock [ GetObject $route_block ]
$route_block configure -handle $handle
if { $routeBlock == ""} {
return [GetErrorReturnHeader "No valid object found...-route_block $routeBlock"]
}
set num [ $routeBlock cget -num ]
set start [ $routeBlock cget -start ]
set step [ $routeBlock cget -step ]
set prefix_len [ $routeBlock cget -prefix_len ]
ixNet setM $handle \
-noOfRoutes $num \
-firstRoute $start \
-step $step \
-maskWidth $prefix_len
} else {
return [GetErrorReturnHeader "Madatory parameter needed...-route_block"]
}
ixNet commit
return [GetStandardReturnHeader]
}