Printer FriendlyEmail Article Link

Spirent TestCenter-JTAPI:How to create IPv6 Raw stream with router alert option set?

Environment/Versions
  • Spirent TestCenter
  • Automation - JTAPI
  • Linux OS
  • IPv6
Answer
  • Below is the code:
 
my $s1 = {len_mode=>"AUTO",sig_field_flag=>0, pps=>10,
mldv2_report_header=>$mldv2ReportHeader,len => "512",
bw => "5",
burst_count => "10",
burst_len => "5",
ipv6_next => " ",
hop_by_hop_type => "padN", hop_by_hop_length => "4", hop_by_hop_value =>
"{11 22 44 55}",};
my @tmap1 = ({name =>"ipv6",
src =>$port1,
src_ipv6 => "aaaa:1::2",
dest_ipv6 => ["bbbb:1::2"],
stream => $s1});
$rt->setup_unicast_flows(map=>\@tmap1);
### Invoking native code to set Router alert option
my @criteria1 = ({attr=>"name", value=>"ipv6"});
my @streamblock1 = $rt->get_handle(type=>"streamblock", criteria=>\@criteria1);
my $ipv6hopbyhopheader = $rt->invoke("stc::get $streamblock1[0] -children-ipv6:ipv6hopbyhopheader");
my $option = $rt->invoke("stc::get $ipv6hopbyhopheader -children");
my $ipv6hopbyhopoption= $rt->invoke("stc::get $option -children");
my $option_exisisting = $rt->invoke("stc::get $ipv6hopbyhopoption -children");
my @options = split(/ /,$option_exisisting);
foreach my $p (@options){
$rt->invoke("stc::delete $p");
}
my $routeralert = $rt->invoke("stc::create routerAlert -under $ipv6hopbyhopoption");
$rt->apply();

 


Product : Spirent TestCenter,Automation,API,Spirent TestCenter,IPv6,PGA