|
|
The AuthHandlerBase class defines the interfaces for RIPv2 authentication handlers. Handlers are responsible for authenticating inbound datagrams and adding authentication data to outbound datagrams.
Error during authentication set an error buffer that clients may query using the error() method.
~AuthHandlerBase ()
| ~AuthHandlerBase |
[virtual]
bool authenticate (const uint8_t* packet,
size_t packet_bytes,
const PacketRouteEntry<IPv4>*& entries,
uint32_t& n_entries)
| authenticate |
[pure virtual]
Inbound authentication method.
Parameters:
packet | pointer to first byte of RIP packet. |
packet_bytes | number of bytes in RIP packet. |
entries_start | output variable set to point to first entry in packet. Set to 0 if there are no entries, or on authentication failure. |
n_entries | number of entries in the packet. |
Returns: true if packet passes authentication checks, false otherwise.
uint32_t authenticate (const uint8_t* packet,
size_t packet_bytes,
PacketRouteEntry<IPv4>* first_entry,
vector<uint8_t>& trailer_data)
| authenticate |
[pure virtual]
Outbound authentication method.
Parameters:
packet | pointer to first byte of RIP packet. |
packet_bytes | number of bytes in RIP packet. |
first_entry | pointer to first entry in RIP packet. |
trailer_data | vector of data authentication scheme use for authenication scheme data to appear at end of packet sent. |
Returns: number of packet entries on success, 0 when no valid keys are present.
uint32_t head_entries ()
| head_entries |
[const pure virtual]
Get number of routing entries used by authentication scheme at the head of the RIP packet. 0 for unauthenticated packets, 1 otherwise.
uint32_t max_routing_entries ()
| max_routing_entries |
[const pure virtual]
Get maximum number of non-authentication scheme use routing entries in a RIP packet.
const char* name ()
| name |
[const pure virtual]
Get name of authentication scheme.
const string& error ()
| error |
[const]
Get textual description of last error.
inline void reset_error ()
| reset_error |
[protected]
Reset textual description of last error.
inline void set_error (const string& err)
| set_error |
[protected]
Set textual description of latest error.