xorp

MD5AuthHandler::MD5Key Class Reference

Class to hold MD5 key information. More...

#include <auth.hh>

List of all members.

Public Member Functions

 MD5Key (uint8_t key_id, const string &key, const TimeVal &start_timeval, const TimeVal &end_timeval, const TimeVal &max_time_drift, XorpTimer start_timer, XorpTimer end_timer)
 Construct an MD5 Key.
uint8_t id () const
 Get the ID associated with the key.
const char * key_data () const
 Get pointer to key data.
uint32_t key_data_bytes () const
 Get the size of the key data in bytes.
string key () const
 Get key data as a string.
const TimeValstart_timeval () const
 Get the start time of the key.
const TimeValend_timeval () const
 Get the end time of the key.
const TimeValmax_time_drift () const
 Get the maximum time drift among all routers.
bool is_persistent () const
 Get indication of whether key is persistent.
void set_persistent (bool v)
 Set the flag whether the key is persistent.
bool id_matches (uint8_t o) const
 Get whether ID matches a particular value (convenient for STL algorithms).
bool valid_at (const TimeVal &when) const
 Get key validity status of key at a particular time.
void reset ()
 Reset the key for all sources.
void reset (const IPv4 &src_addr)
 Reset the key for a particular source.
bool packets_received (const IPv4 &src_addr) const
 Indicate whether valid packets have been received from a source with this key ID.
uint32_t last_seqno_recv (const IPv4 &src_addr) const
 Get last received sequence number from a source.
void set_last_seqno_recv (const IPv4 &src_addr, uint32_t seqno)
 Set last sequence number received from a source.
uint32_t next_seqno_out ()
 Get next sequence number for outbound packets.
 MD5Key (uint8_t key_id, const string &key, const TimeVal &start_timeval, const TimeVal &end_timeval, XorpTimer start_timer, XorpTimer end_timer)
 Construct an MD5 Key.
uint8_t id () const
 Get the ID associated with the key.
const char * key_data () const
 Get pointer to key data.
uint32_t key_data_bytes () const
 Get the size of the key data in bytes.
string key () const
 Get key data as a string.
const TimeValstart_timeval () const
 Get the start time of the key.
const TimeValend_timeval () const
 Get the end time of the key.
bool is_persistent () const
 Get indication of whether key is persistent.
void set_persistent (bool v)
 Set the flag whether the key is persistent.
bool id_matches (uint8_t o) const
 Get whether ID matches a particular value (convenient for STL algorithms).
bool valid_at (const TimeVal &when) const
 Get key validity status of key at a particular time.
void reset ()
 Reset the key for all sources.
void reset (const IPv4 &src_addr)
 Reset the key for a particular source.
bool packets_received (const IPv4 &src_addr) const
 Indicate whether valid packets have been received from a source with this key ID.
uint32_t last_seqno_recv (const IPv4 &src_addr) const
 Get last received sequence number from a source.
void set_last_seqno_recv (const IPv4 &src_addr, uint32_t seqno)
 Set last sequence number received from a source.
uint32_t next_seqno_out ()
 Get next sequence number for outbound packets.

Protected Attributes

uint8_t _id
char _key_data [KEY_BYTES]
TimeVal _start_timeval
TimeVal _end_timeval
TimeVal _max_time_drift
bool _is_persistent
map< IPv4, bool > _pkts_recv
map< IPv4, uint32_t > _lr_seqno
uint32_t _o_seqno
XorpTimer _start_timer
XorpTimer _stop_timer

Static Protected Attributes

static const uint32_t KEY_BYTES = 16

Friends

class MD5AuthHandler

Detailed Description

Class to hold MD5 key information.


Constructor & Destructor Documentation

MD5AuthHandler::MD5Key::MD5Key ( uint8_t  key_id,
const string &  key,
const TimeVal start_timeval,
const TimeVal end_timeval,
const TimeVal max_time_drift,
XorpTimer  start_timer,
XorpTimer  end_timer 
)

Construct an MD5 Key.

Parameters:
key_idunique ID associated with key.
keyphrase used for MD5 digest computation.
start_timevalstart time when key becomes valid.
end_timevalend time when key becomes invalid.
max_time_driftthe maximum time drift among all routers.
start_timerthe timer to mark when the key becomes valid.
end_timerthe timer to mark when the key becomes invalid.

Member Function Documentation

const char* MD5AuthHandler::MD5Key::key_data ( ) const [inline]

Get pointer to key data.

The data is of size KEY_BYTES.

const char* MD5AuthHandler::MD5Key::key_data ( ) const [inline]

Get pointer to key data.

The data is of size KEY_BYTES.

uint32_t MD5AuthHandler::MD5Key::last_seqno_recv ( const IPv4 src_addr) const

Get last received sequence number from a source.

Parameters:
src_addrthe source address.
Returns:
last sequence number seen from the source. Value may be garbage if no packets have been received (check first with packets_received()).
uint32_t MD5AuthHandler::MD5Key::last_seqno_recv ( const IPv4 src_addr) const

Get last received sequence number from a source.

Parameters:
src_addrthe source address.
Returns:
last sequence number seen from the source. Value may be garbage if no packets have been received (check first with packets_received()).
uint32_t MD5AuthHandler::MD5Key::next_seqno_out ( ) [inline]

Get next sequence number for outbound packets.

The counter is automatically updated with each call of this method.

uint32_t MD5AuthHandler::MD5Key::next_seqno_out ( ) [inline]

Get next sequence number for outbound packets.

The counter is automatically updated with each call of this method.

bool MD5AuthHandler::MD5Key::packets_received ( const IPv4 src_addr) const

Indicate whether valid packets have been received from a source with this key ID.

Parameters:
src_addrthe source address.
Returns:
true if a packet has been received from the source, otherwise false.
bool MD5AuthHandler::MD5Key::packets_received ( const IPv4 src_addr) const

Indicate whether valid packets have been received from a source with this key ID.

Parameters:
src_addrthe source address.
Returns:
true if a packet has been received from the source, otherwise false.
void MD5AuthHandler::MD5Key::reset ( const IPv4 src_addr)

Reset the key for a particular source.

Parameters:
src_addrthe source address.
void MD5AuthHandler::MD5Key::reset ( const IPv4 src_addr)

Reset the key for a particular source.

Parameters:
src_addrthe source address.
void MD5AuthHandler::MD5Key::set_last_seqno_recv ( const IPv4 src_addr,
uint32_t  seqno 
)

Set last sequence number received from a source.

This method implicitly set packets received to true.

Parameters:
src_addrthe source address.
seqnothe last sequence number received from the source.
void MD5AuthHandler::MD5Key::set_last_seqno_recv ( const IPv4 src_addr,
uint32_t  seqno 
)

Set last sequence number received from a source.

This method implicitly set packets received to true.

Parameters:
src_addrthe source address.
seqnothe last sequence number received from the source.
void MD5AuthHandler::MD5Key::set_persistent ( bool  v) [inline]

Set the flag whether the key is persistent.

Parameters:
vif true the key is persistent.
void MD5AuthHandler::MD5Key::set_persistent ( bool  v) [inline]

Set the flag whether the key is persistent.

Parameters:
vif true the key is persistent.
bool MD5AuthHandler::MD5Key::valid_at ( const TimeVal when) const

Get key validity status of key at a particular time.

Parameters:
whenthe time to test whether the key is valid.
bool MD5AuthHandler::MD5Key::valid_at ( const TimeVal when) const

Get key validity status of key at a particular time.

Parameters:
whenthe time to test whether the key is valid.

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