BGP/NLRI.pm

filter: Statementstmt 93.2% 138 / 148 Branchbran 68.7% 66 / 96 Conditioncond 83.3% 5 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 87.1% 27 / 31 Podpod 0.0% 0 / 14 totaltotal 79.6% 238 / 299 SCAR 42.2
CC
55
Cov
84%
asstring
20.0
_same_field
11.3
new
11.1
CRAP 68.3
« BGP/ASPath.pm ↑ Summary BGP/ASPath/AS.pm »
1 #!/usr/bin/perl
2  
3 package Net::BGP::NLRI;
4  
5 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 use vars qw(
8 $VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS @ORIGIN
9 @BGP_PATH_ATTR_COUNTS
10 5 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 ## Inheritance and Versioning ##
13  
14 5 @ISA = qw( Exporter );
15 5 $VERSION = '0.16';
16  
17 ## Module Imports ##
18  
19 5 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 5 ▶use IO::Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 use overload
22 '<=>' => \&_compare,
23 '<' => \&_lessthen,
24 '>' => \&_greaterthen,
25 '==' => \&_equal,
26 '!=' => \&_notequal,
27 'eq' => \&_same,
28 3 ▶ 'ne' => sub { return ! &_same(@_) },
Subroutine __ANON__: called CC=1 SCAR=0.0
29 5 ▶ '""' => sub { return shift; }; # Do nothing! Use asstring instead!
Subroutine BEGIN: called CC=1 SCAR=0.2
Subroutine __ANON__: not called CC=1 SCAR=0.2
30 5 ▶use Net::BGP::ASPath;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 ## BGP Path Attribute Count Vector ##
33  
34 5 @BGP_PATH_ATTR_COUNTS = ( 0, 0, 0, 0, 0, 0, 0, 0, 0 );
35  
36 ## BGP ORIGIN Path Attribute Type Enumerations ##
37  
38 21 ▶sub IGP { 0 }
Subroutine IGP: called CC=1 SCAR=0.0
Pod undocumented
39 1 ▶sub EGP { 1 }
Subroutine EGP: called CC=1 SCAR=0.0
Pod undocumented
40 0 ▶sub INCOMPLETE { 2 }
Subroutine INCOMPLETE: not called CC=1 SCAR=6.9
Pod undocumented
41  
42 5 my @ORIGINSTR = (
43 'i', # IGP
44 'e', # EGP
45 '?' # INCOMPLETE
46 );
47  
48 ## Export Tag Definitions ##
49  
50 5 @ORIGIN = qw( IGP EGP INCOMPLETE );
51 5 @EXPORT = ();
52 5 @EXPORT_OK = ( @ORIGIN );
53 5 %EXPORT_TAGS = (
54 origin => [ @ORIGIN ],
55 ALL => [ @EXPORT, @EXPORT_OK ]
56 );
57  
58 ## Public Class Methods ##
59  
60 sub new
61 {
62 21 ▶ my $class = shift();
Subroutine new: called CC=11 SCAR=24.0
Pod undocumented
63 21 my ($arg, $value);
64  
65 21 my $this = {
66 _as_path => Net::BGP::ASPath->new,
67 _origin => IGP,
68 _next_hop => undef,
69 _med => undef,
70 _local_pref => undef,
71 _atomic_agg => undef,
72 _aggregator => [],
73 _as4_aggregator => [],
74 _communities => [],
75 _attr_mask => [ @BGP_PATH_ATTR_COUNTS ]
76 };
77  
78 21 bless($this, $class);
79  
80 21 ▶ while ( defined($arg = shift()) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($arg = shift())) 10 21 31
81 10 $value = shift();
82  
83 10 ▶ if ( $arg =~ /aspath/i ) {
Branch: 8 branches
BranchTrueFalseTotal
if ($arg =~ /aspath/i) { } 3 7 10
elsif ($arg =~ /origin/i) { } 1 6 7
elsif ($arg =~ /nexthop/i) { } 1 5 6
elsif ($arg =~ /med/i) { } 1 4 5
elsif ($arg =~ /localpref/i) { } 1 3 4
elsif ($arg =~ /atomicaggregate/i) { } 1 2 3
elsif ($arg =~ /aggregator/i) { } 1 1 2
elsif ($arg =~ /communities/i) { } 1 0 1
84 3 ▶ $this->{_as_path} = ref $value eq 'Net::BGP::ASPath' ? $value : Net::BGP::ASPath->new($value);
Branch: 1 branch
BranchTrueFalseTotal
ref $value eq 'Net::BGP::ASPath' ? : 0 3 3
85 }
86 elsif ( $arg =~ /origin/i ) {
87 1 $this->{_origin} = $value;
88 }
89 elsif ( $arg =~ /nexthop/i ) {
90 1 $this->{_next_hop} = $value;
91 }
92 elsif ( $arg =~ /med/i ) {
93 1 $this->{_med} = $value;
94 }
95 elsif ( $arg =~ /localpref/i ) {
96 1 $this->{_local_pref} = $value;
97 }
98 elsif ( $arg =~ /atomicaggregate/i ) {
99 1 $this->{_atomic_agg} = $value;
100 }
101 elsif ( $arg =~ /aggregator/i ) {
102 1 $this->{_aggregator} = $value;
103 }
104 elsif ( $arg =~ /communities/i ) {
105 1 $this->{_communities} = $value;
106 }
107 else {
108 0 croak("unrecognized argument $arg\n");
109 }
110 }
111  
112 21 return ( $this );
113 }
114  
115 sub clone
116 {
117 9 ▶ my $proto = shift;
Subroutine clone: called CC=6 SCAR=18.0
Pod undocumented
118 9 ▶ my $class = ref $proto || $proto;
Condition66%2/3
ref $proto || $proto
l!l&&r!l&&!r
270
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table66%2/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
119 9 ▶ $proto = shift unless ref $proto;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $proto 7 2 9
120  
121 9 my $clone = {};
122  
123 9 foreach my $key (qw(_origin _next_hop _med _local_pref _atomic_agg ))
124 {
125 45 $clone->{$key} = $proto->{$key};
126 }
127  
128 9 foreach my $key (qw(_aggregator _communities _attr_mask _as4_aggregator))
129 {
130 36 $clone->{$key} = [ @{$proto->{$key}}];
131 }
132  
133 9 ▶ $clone->{_as_path} = defined $proto->{_as_path} ? $proto->{_as_path}->clone : undef;
Branch: 1 branch
BranchTrueFalseTotal
defined $proto->{'_as_path'} ? : 9 0 9
134  
135 9 return ( bless($clone, $class) );
136 }
137  
138 ## Public Object Methods ##
139  
140 sub aggregator
141 {
142 4 ▶ my $this = shift();
Subroutine aggregator: called CC=2 SCAR=6.9
Pod undocumented
143  
144 4 ▶ $this->{_aggregator} = @_ ? shift() : $this->{_aggregator};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 1 3 4
145 4 return ( $this->{_aggregator} );
146 }
147  
148 sub as_path
149 {
150 18 ▶ my $this = shift();
Subroutine as_path: called CC=3 SCAR=11.1
Pod undocumented
151  
152 18 ▶ $this->{_as_path} = @_ ? (ref $_[0] eq 'Net::BGP::ASPath' ? shift : Net::BGP::ASPath->new(shift)) : $this->{_as_path};
Branch: 2 branches
BranchTrueFalseTotal
@_ ? : 2 16 18
ref $_[0] eq 'Net::BGP::ASPath' ? : 0 2 2
153 18 return $this->{_as_path};
154 }
155  
156 sub atomic_aggregate
157 {
158 3 ▶ my $this = shift();
Subroutine atomic_aggregate: called CC=2 SCAR=6.9
Pod undocumented
159  
160 3 ▶ $this->{_atomic_agg} = @_ ? shift() : $this->{_atomic_agg};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 1 2 3
161 3 return ( $this->{_atomic_agg} );
162 }
163  
164 sub communities
165 {
166 5 ▶ my $this = shift();
Subroutine communities: called CC=2 SCAR=6.9
Pod undocumented
167  
168 5 ▶ $this->{_communities} = @_ ? shift() : $this->{_communities};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 1 4 5
169 5 return ( $this->{_communities} );
170 }
171  
172 sub local_pref
173 {
174 3 ▶ my $this = shift();
Subroutine local_pref: called CC=2 SCAR=6.9
Pod undocumented
175  
176 3 ▶ $this->{_local_pref} = @_ ? shift() : $this->{_local_pref};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 1 2 3
177 3 return ( $this->{_local_pref} );
178 }
179  
180 sub med
181 {
182 3 ▶ my $this = shift();
Subroutine med: called CC=2 SCAR=6.9
Pod undocumented
183  
184 3 ▶ $this->{_med} = @_ ? shift() : $this->{_med};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 1 2 3
185 3 return ( $this->{_med} );
186 }
187  
188 sub next_hop
189 {
190 3 ▶ my $this = shift();
Subroutine next_hop: called CC=2 SCAR=6.9
Pod undocumented
191  
192 3 ▶ $this->{_next_hop} = @_ ? shift() : $this->{_next_hop};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 1 2 3
193 3 return ( $this->{_next_hop} );
194 }
195  
196 sub origin
197 {
198 0 ▶ my $this = shift();
Subroutine origin: not called CC=2 SCAR=17.9
Pod undocumented
199  
200 0 ▶ $this->{_origin} = @_ ? shift() : $this->{_origin};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
201 0 return ( $this->{_origin} );
202 }
203  
204 sub asstring
205 {
206 0 ▶ my $this = shift();
Subroutine asstring: not called CC=4 SCAR=30.0
Pod undocumented
207 0 ▶ return join("\t", map { defined $_ ? $_ : 'n/a'; }
Branch: 3 branches
BranchTrueFalseTotal
defined $_ ? : 0 0 0
defined $this->as_path ? : 0 0 0
defined $this->origin ? : 0 0 0
208 $this->next_hop, $this->med, $this->local_pref,
209 ((defined $this->as_path) ? $this->as_path : '') .
210 ' ' .
211 ((defined $this->origin) ? $ORIGINSTR[$this->origin] : 'n/a')
212 );
213 }
214  
215 ## Private Object Methods ##
216  
217 sub _same
218 {
219 6 ▶ my ($this,$other) = @_;
Subroutine _same: called CC=5 SCAR=16.2
220  
221 6 ▶ return 0 unless defined $other;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $other 0 6 6
222 6 ▶ return 0 unless $other->isa('Net::BGP::NLRI');
Branch: 1 branch
BranchTrueFalseTotal
unless $other->isa("Net::BGP::NLRI") 0 6 6
223  
224 6 my %union;
225 6 @{\%union}{keys %{$this}} = 1;
226 6 @{\%union}{keys %{$other}} = 1;
227 6 foreach my $key (keys %union)
228 {
229 54 ▶ return 0 unless $this->_same_field($other,$key);
Branch: 1 branch
BranchTrueFalseTotal
unless $this->_same_field($other, $key) 3 51 54
230 };
231  
232 3 return 1;
233 }
234  
235 sub _same_field
236 {
237 54 ▶ my ($this,$other,$key) = @_;
Subroutine _same_field: called CC=11 SCAR=24.2
238 54 my $x = $this->{$key};
239 54 my $y = $other->{$key};
240 54 ▶ return 0 if defined $x != defined $y;
Branch: 1 branch
BranchTrueFalseTotal
if defined $x != defined $y 0 54 54
241 54 ▶ return 0 if ref $x ne ref $y;
Branch: 1 branch
BranchTrueFalseTotal
if ref $x ne ref $y 0 54 54
242 54 ▶ return 1 unless defined $x; # Both undefined - Equal!
Branch: 1 branch
BranchTrueFalseTotal
unless defined $x 15 39 54
243 39 ▶ if ((! ref $x)
Branch: 2 branches
BranchTrueFalseTotal
if (not ref $x or ref $x eq 'Net::BGP::ASPath') { } 14 25 39
elsif (ref $x eq 'ARRAY') { } 25 0 25
Condition100%3/3
not ref $x or ref $x eq "Net::BGP::ASPath"
l!l&&r!l&&!r
9525
MC/DC100%2/2
not ref $x or ref $x eq "Net::BGP::ASPath"
not ref $x ref $x eq "Net::BGP::ASPath"
Truth table100%3/3
not(A) or B
A= not ref $xB= ref $x eq "Net::BGP::ASPath"
ABresult
1X1
011
000
244 || (ref $x eq 'Net::BGP::ASPath'))
245 {
246 14 ▶ return 0 unless $x eq $y;
Branch: 1 branch
BranchTrueFalseTotal
unless $x eq $y 2 12 14
247 }
248 elsif (ref $x eq 'ARRAY')
249 {
250 25 ▶ return 0 unless scalar @{$x} == scalar @{$y};
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @{$x;} == scalar @{$y;} 1 24 25
251 24 my @x = sort @{$x};
252 24 my @y = sort @{$y};
253 24 foreach my $i (0 .. (scalar @{$x} - 1))
254 {
255 58 ▶ return 0 unless $x[$i] eq $y[$i];
Branch: 1 branch
BranchTrueFalseTotal
unless $x[$i] eq $y[$i] 0 58 58
256 }
257 }
258 else
259 {
260 0 croak 'Object contains unknown value type (' . (ref $x) . ") in áttribute ($key) in comparison";
261 };
262 36 return 1;
263 }
264  
265 sub _equal
266 {
267 1 ▶ my ($this,$other) = @_;
Subroutine _equal: called CC=3 SCAR=11.7
268 1 ▶ return 0 unless defined($other);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $other 0 1 1
269 1 ▶ return ($this->_compare($other) == 0) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$this->_compare($other) == 0 ? : 1 0 1
270 }
271  
272 sub _notequal
273 {
274 1 ▶ my ($this,$other) = @_;
Subroutine _notequal: called CC=3 SCAR=11.7
275 1 ▶ return 1 unless defined($other);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $other 0 1 1
276 1 ▶ return ($this->_compare($other) == 0) ? 0 : 1;
Branch: 1 branch
BranchTrueFalseTotal
$this->_compare($other) == 0 ? : 0 1 1
277 }
278  
279 sub _lessthen
280 {
281 1 ▶ my ($this,$other) = @_;
Subroutine _lessthen: called CC=2 SCAR=7.2
282 1 ▶ return ($this->_compare($other) == -1) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$this->_compare($other) == -1 ? : 1 0 1
283 }
284  
285 sub _greaterthen
286 {
287 1 ▶ my ($this,$other) = @_;
Subroutine _greaterthen: called CC=2 SCAR=7.2
288 1 ▶ return ($this->_compare($other) == 1) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$this->_compare($other) == 1 ? : 1 0 1
289 }
290  
291 sub _ifundef
292 {
293 10 ▶ my ($this,$field,$default) = @_;
Subroutine _ifundef: called CC=2 SCAR=7.2
294 10 ▶ return defined($this->{$field}) ? $this->{$field} : $default;
Branch: 1 branch
BranchTrueFalseTotal
defined $this->{$field} ? : 10 0 10
295 }
296  
297 sub _compare
298 {
299 4 ▶ my ($this,$other) = @_;
Subroutine _compare: called CC=7 SCAR=20.0
300 4 my $res;
301  
302 4 ▶ confess "compare with undef not possible" unless defined($other);
Branch: 1 branch
BranchTrueFalseTotal
unless defined $other 0 4 4
303 4 ▶ confess "compare with invalidt object type" unless $other->isa('Net::BGP::NLRI');
Branch: 1 branch
BranchTrueFalseTotal
unless $other->isa("Net::BGP::NLRI") 0 4 4
304  
305 # If the path specifies a next hop that is inaccessible, drop the update.
306 # - NOT IMPLEMENTED
307  
308 # Prefer the path with the largest weight.
309 # - LOCAL ATTRIBUTE - Not part of BGP - PRODUCT SPECIFIC
310 # $res = $this->{'_weight'} <=> $other->{'_weight'};
311 # return $res unless $res == 0;
312  
313 # Prefer the path with the largest local preference.
314 4 $res = $other->_ifundef('_local_pref',100) <=> $this->_ifundef('_local_pref',100);
315 4 ▶ return $res unless $res == 0;
Branch: 1 branch
BranchTrueFalseTotal
unless $res == 0 3 1 4
316  
317 # Prefer the path that was originated by BGP running on this router.
318 # - NOT IMPLEMENTED
319  
320 # Prefer the route that has the shortest AS_path.
321 1 $res = $this->{_as_path} <=> $other->{_as_path};
322 1 ▶ return $res unless $res == 0;
Branch: 1 branch
BranchTrueFalseTotal
unless $res == 0 0 1 1
323  
324 # Prefer the path with the lowest origin type (where IGP is lower than EGP,
325 # and EGP is lower than Incomplete).
326 1 $res = $this->{'_origin'} <=> $other->{'_origin'};
327 1 ▶ return $res unless $res == 0;
Branch: 1 branch
BranchTrueFalseTotal
unless $res == 0 0 1 1
328  
329 # Prefer the path with the lowest MED attribute.
330 1 $res = $this->_ifundef('_med',0) <=> $other->_ifundef('_med',0);
331 1 ▶ return $res unless $res == 0;
Branch: 1 branch
BranchTrueFalseTotal
unless $res == 0 0 1 1
332  
333 # Prefer the external path over the internal path.
334 # - NOT IMPLEMENTED
335  
336 # If the paths are still the same, prefer the path through the closest IGP
337 # neighbor.
338 # - NOT IMPLEMENTED
339  
340 1 return 0;
341 }
342  
343  
344 ## POD ##
345  
346 =pod
347  
348 =head1 NAME
349  
350 Net::BGP::NLRI - Class encapsulating BGP-4 NLRI information
351  
352 =head1 SYNOPSIS
353  
354 use Net::BGP::NLRI qw( :origin );
355  
356 # Constructor
357 $nlri = Net::BGP::NLRI->new(
358 Aggregator => [ 64512, '10.0.0.1' ],
359 AtomicAggregate => 1,
360 AsPath => Net::BGP::ASPath->new("64512 64513 64514"),
361 Communities => [ qw( 64512:10000 64512:10001 ) ],
362 LocalPref => 100,
363 MED => 200,
364 NextHop => '10.0.0.1',
365 Origin => INCOMPLETE,
366 );
367  
368 # Object Copy
369 $clone = $nlri->clone();
370  
371 # Accessor Methods
372 $aggregator_ref = $nlri->aggregator($aggregator_ref);
373 $atomic_aggregate = $nlri->atomic_aggregate($atomic_aggregate);
374 $as_path = $nlri->as_path($as_path);
375 $communities_ref = $nlri->communities($communities_ref);
376 $local_pref = $nlri->local_pref($local_pref);
377 $med = $nlri->med($med);
378 $next_hop = $nlri->next_hop($next_hop);
379 $origin = $nlri->origin($origin);
380 $string = $nlri->asstring;
381  
382 # Preference comparisons
383 if ($nlri1 < $nlri2) { ... };
384 if ($nlri1 > $nlri2) { ... };
385 if ($nlri1 == $nlri2) { ... };
386 if ($nlri1 != $nlri2) { ... };
387 @sorted = sort { $a <=> $b } ($nlri1, $nlri2, $nlri3, ... );
388  
389 # Comparison
390 if ($nlri1 eq $nlri2) { ... };
391 if ($nlri1 ne $nlri2) { ... };
392  
393 =head1 DESCRIPTION
394  
395 This module encapsulates the data used by BGP-4 to represent network
396 reachability information. It provides a constructor, and accessor
397 methods for each of the well-known path attributes. An BGP-4 UPDATE
398 message includes this information along with a list of networks for
399 which the information should be used (and a list of network no longer
400 accessible). See B<Net::BGP::Update> for more infomration.
401  
402 =head1 CONSTRUCTOR
403  
404 I<new()> - create a new Net::BGP::NLRI object
405  
406 $nlri = Net::BGP::NLRI->new(
407 Aggregator => [ 64512, '10.0.0.1' ],
408 AsPath => Net::BGP::ASPath->new("64512 64513 64514"),
409 AtomicAggregate => 1,
410 Communities => [ qw( 64512:10000 64512:10001 ) ],
411 LocalPref => 100,
412 MED => 200,
413 NextHop => '10.0.0.1',
414 Origin => INCOMPLETE,
415 );
416  
417 This is the constructor for Net::BGP::NLRI objects. It returns a
418 reference to the newly created object. The following named parameters may
419 be passed to the constructor. See RFC 1771 for the semantics of each
420 path attribute.
421  
422 =head2 Aggregator
423  
424 This parameter corresponds to the AGGREGATOR path attribute. It is expressed
425 as an array reference, the first element of which is the AS number (in the
426 range of an 16-bit unsigned integer) of the route aggregator, and the second
427 element is the aggregator's IP address expressed in dotted-decimal notation
428 as a string. It may be omitted, in which case no AGGREGATOR path attribute
429 will be attached to the UPDATE message.
430  
431 =head2 AsPath
432  
433 This parameter corresponds to the AS_PATH path attribute. The AS_PATH is
434 expressed as an B<Net::BGP::ASPath> object. If expressed otherwise, a
435 Net::BGP::ASPath object is tried constructed using the argument.
436  
437 =head2 AtomicAggregate
438  
439 This parameter corresponds to the ATOMIC_AGGREGATE path attribute. It is
440 a boolean value so any value which perl interprets as true/false may be
441 used. It may be omitted, in which case no ATOMIC_AGGREGATE path attribute
442 will be attached to the UPDATE message.
443  
444 =head2 Communities
445  
446 This parameter corresponds to the COMMUNITIES attribute defined in RFC 1997.
447 It is expressed as an array reference of communities which apply to the
448 route(s). The communities are encoded in a special format: AAAA:CCCC, where
449 AAAA corresponds to the 16-bit unsigned integer AS number, and CCCC is
450 a 16-bit unsigned integer of arbitrary value. But see RFC 1997 for the
451 semantics of several reserved community values. This attribute may be
452 omitted, in which case no COMMUNITIES attribute will be attached to the
453 UPDATE message.
454  
455 =head2 LocalPref
456  
457 This parameter corresponds to the LOCAL_PREF path attribute. It is expressed
458 as a 32-bit unsigned integer scalar value. It may be omitted, in which case
459 no LOCAL_PREF path attribute will be attached to the UPDATE message.
460  
461 =head2 MED
462  
463 This parameter corresponds to the MULTI_EXIT_DISC path attribute. It is expressed
464 as a 32-bit unsigned integer scalar value. It may be omitted, in which case
465 no MULTI_EXIT_DISC path attribute will be attached to the UPDATE message.
466  
467 =head2 NextHop
468  
469 This parameter corresponds to the NEXT_HOP path attribute. It is expressed as a
470 dotted-decimal IP address as a perl string. This path attribute is mandatory and
471 the parameter must always be provided to the constructor.
472  
473 =head2 Origin
474  
475 This parameter corresponds to the ORIGIN path attribute. It is expressed as an
476 integer scalar value, which can take the following enumerated values: IGP, EGP,
477 or INCOMPLETE. The preceding symbols can be imported into the program namespace
478 individually or by the :origin export tag. This path attribute is mandatory and
479 the parameter must always be provided to the constructor.
480  
481 =head1 OBJECT COPY
482  
483 I<clone()> - clone a Net::BGP::NLRI object
484  
485 $clone = $nlri->clone();
486  
487 This method creates an exact copy of the Net::BGP::NLRI object with Path
488 Attributes fields matching those of the original object.
489  
490 =head1 ACCESSOR METHODS
491  
492 I<aggregator()>
493  
494 I<as_path()>
495  
496 I<atomic_aggregate()>
497  
498 I<communities()>
499  
500 I<local_pref()>
501  
502 I<med()>
503  
504 I<next_hop()>
505  
506 I<origin()>
507  
508 These accessor methods return the value(s) of the associated path attribute fields
509 if called with no arguments. If called with arguments, they set
510 the associated field. The representation of parameters and return values is the
511 same as described for the corresponding named constructor parameters above.
512  
513 I<asstring()>
514  
515 This accessor method returns a print-friendly string with some, but not all,
516 of the information containted in the object.
517  
518 =head1 EXPORTS
519  
520 The module exports the following symbols according to the rules and
521 conventions of the B<Exporter> module.
522  
523 :origin
524 IGP, EGP, INCOMPLETE
525  
526 =head1 SEE ALSO
527  
528 B<RFC 1771>, B<RFC 1997>, B<Net::BGP>, B<Net::BGP::Process>, B<Net::BGP::Peer>,
529 B<Net::BGP::Notification>, B<Net::BGP::ASPath>, B<Net::BGP::Update>
530  
531 =head1 AUTHOR
532  
533 Stephen J. Scheck <code@neurosphere.com>
534  
535 =cut
536  
537 ## End Package Net::BGP::NLRI ##
538  
539 5 1;
« BGP/ASPath.pm ↑ Summary BGP/ASPath/AS.pm »