|
|
Class to check inbound MD5 authenticated packets and add authentication data to outbound RIP packets. The RIP MD5 authentication scheme is described in RFC 2082.
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_secs | time in seconds since midnight 1 Jan 1970. |
MD5AuthHandler (EventLoop& e)
| MD5AuthHandler |
Constructor
Parameters:
e | the EventLoop instance to used for time reference. |
bool authenticate_inbound (const uint8_t* packet,
size_t packet_bytes,
const PacketRouteEntry<IPv4>*& entries_start,
uint32_t& n_entries,
const IPv4& src_addr,
bool new_peer)
| authenticate_inbound |
Reimplemented from AuthHandlerBase.
bool authenticate_outbound (RipPacket<IPv4>& packet,
list<RipPacket<IPv4> *>& auth_packets,
size_t& n_routes)
| authenticate_outbound |
Reimplemented from AuthHandlerBase.
uint32_t head_entries ()
| head_entries |
[const]
Reimplemented from AuthHandlerBase.
uint32_t max_routing_entries ()
| max_routing_entries |
[const]
Reimplemented from AuthHandlerBase.
const char* name ()
| name |
[const]
Reimplemented from AuthHandlerBase.
const char* auth_type_name ()
| auth_type_name |
[static]
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_id | unique ID associated with key. |
key | phrase used for MD5 digest computation. |
start_secs | start time in seconds since midnight 1 Jan 1970. |
end_secs | start 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_id | unique 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_id | unique 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_secs | time in seconds since midnight 1 Jan 1970. |
EventLoop& _e | _e |
[protected]
KeyChain _key_chain | _key_chain |
[protected]