AS-List

NAME

Net::BGP::AS-List - AS-List Handling Functionality

SYNOPSIS

use Net::BGP::AS-List;
my $aslist = IP::BGP::AS-List( :raw($raw), :asn32 );

ATTRIBUTES

asn32

If True, parse the AS-List using 4 byte ASNs. Otherwise, use 2 byte ASNs.

raw

A buf8 containing the raw packed AS-Set or AS-Sequence.

METHODS

method check(-->Bool:D) { if $.raw !~~ 1..2 { die("AS type must be 1 or 2" } if $.raw.bytes ≠ 2 + self.asn-size * self.asn-count { die("Path segment wrong length"); } return True; }

method ordered(-->Bool:D) { return ($.raw[0] == 2) } method asn-size(-->Int:D) { return $!asn32 ?? 4 !! 2 } method asn-count(-->Int:D) { return $.raw[1] }

method asns(-->Array[Int:D]) {

check

Returns true if raw processes correctly, otherwise throws an exception.

asn-size

Returns 4 if asn32 is set to True, 2 otherwise.

asn-count

Returns the number of ASNs present in the packed raw structure.

path-length

Returns the number of ASNs present in the list, using RFC4271 semmantics. That is, the path length is 1 if this is an AS-SET (rather than an AS-SEQUENCE).

asns

Returns a list of the ASNs in this AS list. Takes an optional paraemter, :elems, which is the number of ASNs to return. If this is not supplied, returns all ASNs in the list.

Str

Returns a string representation of the ASNs.

as-lists

Returns the AS-Sequence and AS-Sets in the packed binary buffer, as would be representated in an AS-Path BGP attribute.

from-str

Takes an AS Path string and converts it to an array of AS-List objects.

AUTHOR

Joelle Maslak <[email protected]>

COPYRIGHT AND LICENSE

Copyright © 2018-2019 Joelle Maslak

This library is free software; you can redistribute it and/or modify it under the Artisitc License 2.0.

Net::BGP v0.9.0

BGP Server Support

Authors

  • Joelle Maslak

License

Artistic-2.0

Dependencies

ifDateTime::MonotonicDigestNativeHelpers::BlobOO::MonitorsStrictClassSys::DomainnameSys::HostAddrTCP::LowLevelTerminal::ANSIColor

Test Dependencies

Provides

  • Net::BGP
  • Net::BGP::AFI
  • Net::BGP::AFI-SAFI
  • Net::BGP::AS-List
  • Net::BGP::CIDR
  • Net::BGP::Capability
  • Net::BGP::Capability::ASN32
  • Net::BGP::Capability::Deprecated-Dynamic-Capability
  • Net::BGP::Capability::FQDN
  • Net::BGP::Capability::Generic
  • Net::BGP::Capability::Graceful-Restart
  • Net::BGP::Capability::Graceful-Restart::Per-AF
  • Net::BGP::Capability::MPBGP
  • Net::BGP::Capability::Route-Refresh
  • Net::BGP::Capability::Route-Refresh-Cisco
  • Net::BGP::Command
  • Net::BGP::Command::BGP-Message
  • Net::BGP::Command::Dead-Child
  • Net::BGP::Command::Stop
  • Net::BGP::Connection
  • Net::BGP::Connection-List
  • Net::BGP::Connection-Role
  • Net::BGP::Controller
  • Net::BGP::Controller-Handle-BGP
  • Net::BGP::Conversions
  • Net::BGP::Conversions-Post201812
  • Net::BGP::Conversions-Pre201812
  • Net::BGP::Error
  • Net::BGP::Error::Bad-Option-Length
  • Net::BGP::Error::Bad-Parameter-Length
  • Net::BGP::Error::Hold-Time-Too-Short
  • Net::BGP::Error::Length-Too-Long
  • Net::BGP::Error::Length-Too-Short
  • Net::BGP::Error::Marker-Format
  • Net::BGP::Error::Unknown-Version
  • Net::BGP::Event
  • Net::BGP::Event::BGP-Message
  • Net::BGP::Event::Closed-Connection
  • Net::BGP::Event::New-Connection
  • Net::BGP::IP
  • Net::BGP::Message
  • Net::BGP::Message::Generic
  • Net::BGP::Message::Keep-Alive
  • Net::BGP::Message::Notify
  • Net::BGP::Message::Notify::Cease
  • Net::BGP::Message::Notify::Cease::Administrative-Reset
  • Net::BGP::Message::Notify::Cease::Administrative-Shutdown
  • Net::BGP::Message::Notify::Cease::Connection-Rejected
  • Net::BGP::Message::Notify::Cease::Generic
  • Net::BGP::Message::Notify::Cease::Peer-Deconfigured
  • Net::BGP::Message::Notify::Generic
  • Net::BGP::Message::Notify::Header
  • Net::BGP::Message::Notify::Header::Connection-Not-Syncronized
  • Net::BGP::Message::Notify::Header::Generic
  • Net::BGP::Message::Notify::Hold-Timer-Expired
  • Net::BGP::Message::Notify::Open
  • Net::BGP::Message::Notify::Open::Bad-Peer-AS
  • Net::BGP::Message::Notify::Open::Generic
  • Net::BGP::Message::Notify::Open::Unsupported-Optional-Parameter
  • Net::BGP::Message::Notify::Open::Unsupported-Version
  • Net::BGP::Message::Open
  • Net::BGP::Message::Update
  • Net::BGP::Parameter
  • Net::BGP::Parameter::Capabilities
  • Net::BGP::Parameter::Generic
  • Net::BGP::Path-Attribute
  • Net::BGP::Path-Attribute::AS-Path
  • Net::BGP::Path-Attribute::AS4-Aggregator
  • Net::BGP::Path-Attribute::AS4-Path
  • Net::BGP::Path-Attribute::Aggregator
  • Net::BGP::Path-Attribute::Atomic-Aggregate
  • Net::BGP::Path-Attribute::Cluster-List
  • Net::BGP::Path-Attribute::Community
  • Net::BGP::Path-Attribute::Extended-Community
  • Net::BGP::Path-Attribute::Generic
  • Net::BGP::Path-Attribute::Local-Pref
  • Net::BGP::Path-Attribute::Long-Community
  • Net::BGP::Path-Attribute::MED
  • Net::BGP::Path-Attribute::MP-NLRI
  • Net::BGP::Path-Attribute::MP-Unreachable
  • Net::BGP::Path-Attribute::Next-Hop
  • Net::BGP::Path-Attribute::Origin
  • Net::BGP::Path-Attribute::Originator-ID
  • Net::BGP::Peer
  • Net::BGP::Peer-List
  • Net::BGP::SAFI
  • Net::BGP::Speaker
  • Net::BGP::Speaker::Display
  • Net::BGP::Time
  • Net::BGP::Validation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.