class MD5AuthHandler

OSPFv2 Authentication handler for MD5 scheme. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods

Public Static Methods

Public Members

Protected Methods

Protected Members


Detailed Description

Class to check inbound MD5 authenticated packets and add authentication data to outbound OSPF packets. The OSPFv2 MD5 authentication scheme is described in Section D.3 of RFC 2328.

static const OspfTypes::AuType AUTH_TYPE

AUTH_TYPE

MD5Key (struct)

MD5Key

Structure to hold MD5 key information.

typedef list<MD5Key> KeyChain

KeyChain

KeyChain::const_iterator  key_at (uint32_t when_secs)

key_at

[const]

Get iterator pointing at first key valid at a particular time.

Parameters:

when_secstime in seconds since midnight 1 Jan 1970.
 MD5AuthHandler (EventLoop& eventloop)

MD5AuthHandler

Constructor

Parameters:

eventloopthe EventLoop instance to used for time reference.
bool  authenticate_inbound (const vector<uint8_t>& packet, const IPv4& src_addr, bool new_peer)

authenticate_inbound

Inbound authentication method.

Parameters:

packetthe packet to verify.
src_addrthe source address of the packet.
new_peertrue if this is a new peer.

Returns: true if packet passes authentication checks, false otherwise.

Reimplemented from AuthHandlerBase.

bool  authenticate_outbound (vector<uint8_t>& packet)

authenticate_outbound

Outbound authentication method.

Parameters:

packetthe packet to authenticate.

Returns: true if packet was successfully authenticated, false when no valid keys are present.

Reimplemented from AuthHandlerBase.

const char*  name ()

name

[const]

Get the name of the authentication scheme.

Returns: the name of the authentication scheme.

Reimplemented from AuthHandlerBase.

const char*  auth_type_name ()

auth_type_name

[static]

Get the method-specific name of the authentication scheme.

Returns: the method-specific name of the authentication scheme.

void  reset ()

reset

Reset the authentication state.

Reimplemented from AuthHandlerBase.

uint32_t  additional_payload ()

additional_payload

[const]

Additional bytes that will be added to the payload.

Returns: the number of additional bytes that need to be added to the payload.

Reimplemented from AuthHandlerBase.

bool  add_key (uint8_t key_id, const string& key, uint32_t start_secs, uint32_t end_secs)

add_key

Add key to MD5 key chain. If key already exists, it is updated with new settings. If the start and end times are the same the key is treated as persistant and will not expire.

Parameters:

key_idunique ID associated with key.
keyphrase used for MD5 digest computation.
start_secsstart time in seconds since midnight 1 Jan 1970.
end_secsstart time in seconds since midnight 1 Jan 1970.

Returns: true on success, false if end time is less than start time or key has already expired.

bool  remove_key (uint8_t key_id)

remove_key

Remove key from MD5 key chain.

Parameters:

key_idunique ID of key to be removed.

Returns: true if the key was found and removed, otherwise false.

void  remove_key_cb (uint8_t key_id)

remove_key_cb

A callback to remove key from MD5 key chain.

Parameters:

key_idunique ID of key to be removed.
uint16_t  currently_active_key ()

currently_active_key

[const]

Get currently active key.

Returns: key ID in range 0-255 if key exists, value outside valid range otherwise 256-65535.

void  reset_keys ()

reset_keys

Reset the keys for all sources.

inline const KeyChain&  key_chain ()

key_chain

[const]

Get all keys managed by MD5AuthHandler.

Returns: list of keys.

KeyChain::iterator  key_at (uint32_t when_secs)

key_at

[protected]

Get iterator pointing at first key valid at a particular time.

Parameters:

when_secstime in seconds since midnight 1 Jan 1970.
EventLoop& _eventloop

_eventloop

[protected]

KeyChain _key_chain

_key_chain

[protected]


Generated by: pavlin on possum.icir.org on Thu Mar 9 04:43:44 2006, using kdoc $.