|
|
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]
const char* effective_name ()
| effective_name |
[const pure virtual]
Get the effective name of the authentication scheme.
void reset ()
| reset |
[pure virtual]
Reset the authentication state.
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.
Returns: the number of routing entries used by the 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.
bool authenticate_inbound (const uint8_t* packet,
size_t packet_bytes,
const uint8_t*& entries_ptr,
uint32_t& n_entries,
const IPv4& src_addr,
bool new_peer)
| authenticate_inbound |
[pure virtual]
Inbound authentication method.
Parameters:
packet | pointer to first byte of RIP packet. |
packet_bytes | number of bytes in RIP packet. |
entries_ptr | output variable set to point to first entry in packet. Set to NULL if there are no entries, or on authentication failure. |
n_entries | number of entries in the packet. |
src_addr | the source address of the packet. |
new_peer | true if this is a new peer. |
Returns: true if packet passes authentication checks, false otherwise.
bool authenticate_outbound (RipPacket<IPv4>& packet,
list<RipPacket<IPv4> *>& auth_packets,
size_t& n_routes)
| authenticate_outbound |
[pure virtual]
Outbound authentication method.
Create a list of authenticated packets (one for each valid authentication key). Note that the original packet is also modified and authenticated with the first valid key.
Parameters:
packet | the RIP packet to authenticate. |
auth_packets | a return-by-reference list with the authenticated RIP packets (one for each valid authentication key). |
n_routes | the return-by-reference number of routes in the packet. |
Returns: true if packet was successfully authenticated, false when no valid keys are present.
const string& error ()
| error |
[const]
Get textual description of last error.
void reset_error ()
| reset_error |
[protected]
Reset textual description of last error.
void set_error (const string& err)
| set_error |
[protected]
Set textual description of latest error.