|
| ||||||||||||||||
Class to hold MD5 key information.
| 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)
| MD5Key |
Construct an MD5 Key.
Parameters:
| key_id | unique ID associated with key. |
| key | phrase used for MD5 digest computation. |
| start_timeval | start time when key becomes valid. |
| end_timeval | end time when key becomes invalid. |
| max_time_drift | the maximum time drift among all routers. |
| start_timer | the timer to mark when the key becomes valid. |
| end_timer | the timer to mark when the key becomes invalid. |
| uint8_t id ()
| id |
[const]
Get the ID associated with the key.
| const char* key_data ()
| key_data |
[const]
Get pointer to key data. The data is of size KEY_BYTES.
| uint32_t key_data_bytes ()
| key_data_bytes |
[const]
Get the size of the key data in bytes.
| string key ()
| key |
[const]
| const TimeVal& start_timeval ()
| start_timeval |
[const]
Get the start time of the key.
| const TimeVal& end_timeval ()
| end_timeval |
[const]
| const TimeVal& max_time_drift ()
| max_time_drift |
[const]
Get the maximum time drift among all routers.
| bool is_persistent ()
| is_persistent |
[const]
Get indication of whether key is persistent.
| void set_persistent (bool v)
| set_persistent |
Set the flag whether the key is persistent.
Parameters:
| v | if true the key is persistent. |
| bool id_matches (uint8_t o)
| id_matches |
[const]
Get whether ID matches a particular value (convenient for STL algorithms).
| bool valid_at (const TimeVal& when)
| valid_at |
[const]
Get key validity status of key at a particular time.
Parameters:
| when | the time to test whether the key is valid. |
| void reset ()
| reset |
Reset the key for all sources.
| void reset (const IPv4& src_addr)
| reset |
Reset the key for a particular source.
Parameters:
| src_addr | the source address. |
| bool packets_received (const IPv4& src_addr)
| packets_received |
[const]
Indicate whether valid packets have been received from a source with this key ID.
Parameters:
| src_addr | the source address. |
Returns: true if a packet has been received from the source, otherwise false.
| uint32_t last_seqno_recv (const IPv4& src_addr)
| last_seqno_recv |
[const]
Get last received sequence number from a source.
Parameters:
| src_addr | the 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()).
| void set_last_seqno_recv (const IPv4& src_addr,
uint32_t seqno)
| set_last_seqno_recv |
Set last sequence number received from a source. This method implicitly set packets received to true.
Parameters:
| src_addr | the source address. |
| seqno | the last sequence number received from the source. |
| uint32_t next_seqno_out ()
| next_seqno_out |
Get next sequence number for outbound packets. The counter is automatically updated with each call of this method.
| static const uint32_t KEY_BYTES | KEY_BYTES |
[protected]
| uint8_t _id | _id |
[protected]
| char _key_data[KEY_BYTES] | _key_data[KEY_BYTES] |
[protected]
| TimeVal _start_timeval | _start_timeval |
[protected]
| TimeVal _end_timeval | _end_timeval |
[protected]
| TimeVal _max_time_drift | _max_time_drift |
[protected]
| bool _is_persistent | _is_persistent |
[protected]
| map<IPv4, bool> _pkts_recv | _pkts_recv |
[protected]
| map<IPv4, uint32_t> _lr_seqno | _lr_seqno |
[protected]
| uint32_t _o_seqno | _o_seqno |
[protected]
| XorpTimer _start_timer | _start_timer |
[protected]
| XorpTimer _stop_timer | _stop_timer |
[protected]
| friend class MD5AuthHandler | MD5AuthHandler |
[protected]