xorp

LsaDecoder Class Reference

LSA byte streams are decoded through this class. More...

#include <lsa.hh>

List of all members.

Public Member Functions

 LsaDecoder (OspfTypes::Version version)
void register_decoder (Lsa *lsa)
 Register the LSA decoders, called multiple times with each LSA.
void register_unknown_decoder (Lsa *lsa)
 Register the unknown LSA decoder, called once.
Lsa::LsaRef decode (uint8_t *ptr, size_t &len) const throw (InvalidPacket)
 Decode an LSA.
size_t min_length () const
bool validate (uint16_t type) const
 Validate type field.
bool external (uint16_t type)
 Is an LSA of this type an AS-external-LSA?
const char * name (uint16_t type) const
 Return the name of this LSA.
OspfTypes::Version get_version () const

Private Attributes

const OspfTypes::Version _version
size_t _min_lsa_length
map< uint16_t, Lsa * > _lsa_decoders
Lsa_unknown_lsa_decoder

Detailed Description

LSA byte streams are decoded through this class.


Member Function Documentation

Lsa::LsaRef LsaDecoder::decode ( uint8_t *  ptr,
size_t &  len 
) const throw (InvalidPacket)

Decode an LSA.

Parameters:
bufpointer to buffer.
lenlength of the buffer on input set to the number of bytes consumed on output.
Returns:
A reference to an LSA that manages its own memory.
bool LsaDecoder::external ( uint16_t  type) [inline]

Is an LSA of this type an AS-external-LSA?

Returns:
true if this type is an AS-external-LSA
size_t LsaDecoder::min_length ( ) const [inline]
Returns:
The length of the smallest LSA that can be decoded.
void LsaDecoder::register_decoder ( Lsa lsa)

Register the LSA decoders, called multiple times with each LSA.

Parameters:
LSAdecoder
void LsaDecoder::register_unknown_decoder ( Lsa lsa)

Register the unknown LSA decoder, called once.

Parameters:
LSAdecoder
bool LsaDecoder::validate ( uint16_t  type) const [inline]

Validate type field.

If we know how to decode an LSA of this type we must know how to process it.

Returns:
true if we know about this type of LSA.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations