|
xorp
|
Link State Advertisement (LSA) More...
#include <lsa.hh>
Public Types | |
| typedef ref_ptr< Lsa > | LsaRef |
| A reference counted pointer to an LSA which will be automatically deleted. | |
Public Member Functions | |
| Lsa (OspfTypes::Version version) | |
| Lsa (OspfTypes::Version version, uint8_t *buf, size_t len) | |
| Note passing in the LSA buffer does not imply that it will be decoded. | |
| OspfTypes::Version | get_version () const |
| virtual uint16_t | get_ls_type () const =0 |
| It is the responsibilty of the derived type to return this information. | |
| virtual bool | known () const |
| OSPFv3 only is this a known LSA. | |
| virtual bool | external () const |
| virtual bool | type7 () const |
| virtual size_t | min_length () const =0 |
| It is the responsibilty of the derived type to return this information. | |
| virtual LsaRef | decode (uint8_t *buf, size_t &len) const =0 throw (InvalidPacket) |
| Decode an LSA. | |
| virtual bool | encode ()=0 |
| Encode an LSA for transmission. | |
| uint8_t * | lsa (size_t &len) |
| Get a reference to the raw LSA. | |
| bool | available () const |
| Is a wire format version available? | |
| Lsa_header & | get_header () |
| const Lsa_header & | get_header () const |
| bool | valid () const |
| Is this LSA valid? | |
| void | invalidate (bool invalidate=true) |
| Unconditionally clear the timer and invalidate the LSA if required, the default is to invalidate the LSA. | |
| bool | get_self_originating () const |
| void | set_self_originating (bool orig) |
| Set the state of this LSA with respect to self originating or not. | |
| void | record_creation_time (TimeVal now) |
| Record the time of creation and initial age. | |
| void | get_creation_time (TimeVal &now) |
| Get arrival time. | |
| void | revive (const TimeVal &now) |
| Revive an LSA that is at MaxAge and MaxSequenceNumber. | |
| void | update_age_and_seqno (const TimeVal &now) |
| Update the age and sequence number of a self originated LSAs. | |
| void | update_age (TimeVal now) |
| Update the age field based on the current time. | |
| void | set_maxage () |
| Set the age to MaxAge. | |
| bool | maxage () const |
| Is the age of this LSA MaxAge. | |
| bool | max_sequence_number () const |
| Is the LS Sequence Number MaxSequenceNumber? | |
| int32_t | get_ls_sequence_number () const |
| Get the LS Sequence Number. | |
| void | set_ls_sequence_number (int32_t seqno) |
| Set the LS Sequence Number. | |
| void | increment_sequence_number () |
| Increment sequence number. | |
| void | add_nack (OspfTypes::NeighbourID nid) |
| Add a neighbour ID to the NACK list. | |
| void | remove_nack (OspfTypes::NeighbourID nid) |
| Remove a neighbour ID from the NACK list. | |
| bool | exists_nack (OspfTypes::NeighbourID nid) |
| Does this neighbour exist on the NACK list. | |
| bool | empty_nack () const |
| If the NACK list is empty return true. | |
| bool | get_transmitted () |
| void | set_transmitted (bool t) |
| Set the transmitted state of this LSA. | |
| XorpTimer & | get_timer () |
| Get a reference to the internal timer. | |
| void | set_tracing (bool trace) |
| bool | tracing () const |
| void | set_peerid (OspfTypes::PeerID peerid) |
| For OSPFv3 only LSAs with Link-local flooding scope save the ingress PeerID. | |
| OspfTypes::PeerID | get_peerid () const |
| For OSPFv3 only LSAs with Link-local flooding scope get the ingress PeerID. | |
| bool | link_local_scope () const |
| OSPFv3 only Link-local scope. | |
| bool | area_scope () const |
| OSPFv3 only area scope. | |
| bool | as_scope () const |
| OSPFv3 only AS scope. | |
| virtual const char * | name () const =0 |
| Printable name of this LSA. | |
| virtual string | str () const =0 |
| Generate a printable representation of the LSA. | |
Static Public Member Functions | |
| static void | update_age_inftransdelay (uint8_t *ptr, uint16_t inftransdelay) |
| Increment the age field of an LSA by inftransdelay. | |
Protected Attributes | |
| Lsa_header | _header |
| Add the LSA type bindings. | |
| vector< uint8_t > | _pkt |
Private Member Functions | |
| void | set_ls_age (uint16_t ls_age) |
| Set the age and update the stored packet if it exists. | |
| bool | understood () const |
| OSPFv3 only is the U-bit set, i.e. | |
Private Attributes | |
| const OspfTypes::Version | _version |
| bool | _valid |
| bool | _self_originating |
| uint16_t | _initial_age |
| TimeVal | _creation |
| XorpTimer | _timer |
| bool | _transmitted |
| bool | _trace |
| set< OspfTypes::NeighbourID > | _nack_list |
| OspfTypes::PeerID | _peerid |
| If this is an OSPFv3 LSA and the flooding scope is Link-local then the PeerID should be set to the peer that the LSA is associated with. | |
Link State Advertisement (LSA)
A generic LSA. All actual LSAs should be derived from this LSA.
| Lsa::Lsa | ( | OspfTypes::Version | version, |
| uint8_t * | buf, | ||
| size_t | len | ||
| ) | [inline] |
Note passing in the LSA buffer does not imply that it will be decoded.
The buffer is just being stored.
| bool Lsa::available | ( | ) | const [inline] |
Is a wire format version available?
For all non self orignating LSAs there should be a wire version available.
Self originating LSAs such as Router LSAs can exist that do not yet have any valid fields (no interfaces to describe). Use this field to check if this LSA is available.
| virtual LsaRef Lsa::decode | ( | uint8_t * | buf, |
| size_t & | len | ||
| ) | const throw (InvalidPacket) [pure virtual] |
Decode an LSA.
| buf | pointer to buffer. |
| len | length of the buffer on input set to the number of bytes consumed on output. |
Implemented in UnknownLsa, RouterLsa, NetworkLsa, SummaryNetworkLsa, SummaryRouterLsa, ASExternalLsa, LinkLsa, and IntraAreaPrefixLsa.
| bool Lsa::empty_nack | ( | ) | const [inline] |
| virtual bool Lsa::encode | ( | ) | [pure virtual] |
Encode an LSA for transmission.
Implemented in UnknownLsa, RouterLsa, NetworkLsa, SummaryNetworkLsa, SummaryRouterLsa, ASExternalLsa, LinkLsa, and IntraAreaPrefixLsa.
| virtual bool Lsa::external | ( | ) | const [inline, virtual] |
Reimplemented in ASExternalLsa, and Type7Lsa.
| void Lsa::get_creation_time | ( | TimeVal & | now | ) | [inline] |
| virtual uint16_t Lsa::get_ls_type | ( | ) | const [pure virtual] |
It is the responsibilty of the derived type to return this information.
Implemented in UnknownLsa, RouterLsa, NetworkLsa, SummaryNetworkLsa, SummaryRouterLsa, ASExternalLsa, Type7Lsa, LinkLsa, and IntraAreaPrefixLsa.
| bool Lsa::get_self_originating | ( | ) | const [inline] |
| bool Lsa::get_transmitted | ( | ) | [inline] |
| virtual bool Lsa::known | ( | ) | const [inline, virtual] |
| uint8_t* Lsa::lsa | ( | size_t & | len | ) | [inline] |
| virtual size_t Lsa::min_length | ( | ) | const [pure virtual] |
It is the responsibilty of the derived type to return this information.
Implemented in UnknownLsa, RouterLsa, NetworkLsa, SummaryNetworkLsa, SummaryRouterLsa, ASExternalLsa, LinkLsa, and IntraAreaPrefixLsa.
| void Lsa::record_creation_time | ( | TimeVal | now | ) | [inline] |
| void Lsa::revive | ( | const TimeVal & | now | ) |
Revive an LSA that is at MaxAge and MaxSequenceNumber.
The age is taken back to zero and sequence number InitialSequenceNumber.
| virtual bool Lsa::type7 | ( | ) | const [inline, virtual] |
Reimplemented in Type7Lsa.
| bool Lsa::understood | ( | ) | const [inline, private] |
OSPFv3 only is the U-bit set, i.e.
should this LSA be processed as if it is understood; obviously if we already know about it it is understood.
| void Lsa::update_age | ( | TimeVal | now | ) |
| void Lsa::update_age_and_seqno | ( | const TimeVal & | now | ) |
Update the age and sequence number of a self originated LSAs.
Plus encode.
| void Lsa::update_age_inftransdelay | ( | uint8_t * | ptr, |
| uint16_t | inftransdelay | ||
| ) | [static] |