xorp

AuthHandlerBase Class Reference

Base clase for OSPFv2 authentication mechanisms. More...

#include <auth.hh>

Inheritance diagram for AuthHandlerBase:
MD5AuthHandler MD5AuthHandler NullAuthHandler NullAuthHandler PlaintextAuthHandler PlaintextAuthHandler

List of all members.

Public Member Functions

virtual const char * effective_name () const =0
 Get the effective name of the authentication scheme.
virtual void reset ()=0
 Reset the authentication state.
virtual uint32_t additional_payload () const =0
 Additional bytes that will be added to the payload.
virtual bool authenticate_inbound (const vector< uint8_t > &packet, const IPv4 &src_addr, bool new_peer)=0
 Inbound authentication method.
virtual bool authenticate_outbound (vector< uint8_t > &packet)=0
 Outbound authentication method.
const string & error () const
 Get textual description of last error.
virtual ~AuthHandlerBase ()
 Virtual destructor.
virtual const char * effective_name () const =0
 Get the effective name of the authentication scheme.
virtual void reset ()=0
 Reset the authentication state.
virtual uint32_t head_entries () const =0
 Get number of routing entries used by authentication scheme at the head of the RIP packet.
virtual uint32_t max_routing_entries () const =0
 Get maximum number of non-authentication scheme use routing entries in a RIP packet.
virtual 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)=0
 Inbound authentication method.
virtual bool authenticate_outbound (RipPacket< IPv4 > &packet, list< RipPacket< IPv4 > * > &auth_packets, size_t &n_routes)=0
 Outbound authentication method.
const string & error () const
 Get textual description of last error.

Protected Member Functions

void reset_error ()
 Reset textual description of last error.
void set_error (const string &error_msg)
 Set textual description of latest error.
void reset_error ()
 Reset textual description of last error.
void set_error (const string &err)
 Set textual description of latest error.

Private Attributes

string _error
string _err

Detailed Description

Base clase for OSPFv2 authentication mechanisms.

Base clase for RIPv2 authentication mechanisms.

The AuthHandlerBase class defines the interfaces for OSPFv2 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.

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.


Member Function Documentation

virtual uint32_t AuthHandlerBase::additional_payload ( ) const [pure virtual]

Additional bytes that will be added to the payload.

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

Implemented in NullAuthHandler, PlaintextAuthHandler, and MD5AuthHandler.

virtual bool AuthHandlerBase::authenticate_inbound ( const vector< uint8_t > &  packet,
const IPv4 src_addr,
bool  new_peer 
) [pure virtual]

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.

Implemented in NullAuthHandler, PlaintextAuthHandler, and MD5AuthHandler.

virtual bool AuthHandlerBase::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 
) [pure virtual]

Inbound authentication method.

Parameters:
packetpointer to first byte of RIP packet.
packet_bytesnumber of bytes in RIP packet.
entries_ptroutput variable set to point to first entry in packet. Set to NULL if there are no entries, or on authentication failure.
n_entriesnumber of entries in the packet.
src_addrthe source address of the packet.
new_peertrue if this is a new peer.
Returns:
true if packet passes authentication checks, false otherwise.

Implemented in NullAuthHandler, PlaintextAuthHandler, and MD5AuthHandler.

virtual bool AuthHandlerBase::authenticate_outbound ( vector< uint8_t > &  packet) [pure virtual]

Outbound authentication method.

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

Implemented in NullAuthHandler, PlaintextAuthHandler, and MD5AuthHandler.

virtual bool AuthHandlerBase::authenticate_outbound ( RipPacket< IPv4 > &  packet,
list< RipPacket< IPv4 > * > &  auth_packets,
size_t &  n_routes 
) [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:
packetthe RIP packet to authenticate.
auth_packetsa return-by-reference list with the authenticated RIP packets (one for each valid authentication key).
n_routesthe return-by-reference number of routes in the packet.
Returns:
true if packet was successfully authenticated, false when no valid keys are present.

Implemented in NullAuthHandler, PlaintextAuthHandler, and MD5AuthHandler.

virtual const char* AuthHandlerBase::effective_name ( ) const [pure virtual]

Get the effective name of the authentication scheme.

Returns:
the name of the authentication scheme.

Implemented in NullAuthHandler, PlaintextAuthHandler, MD5AuthHandler, NullAuthHandler, PlaintextAuthHandler, and MD5AuthHandler.

virtual uint32_t AuthHandlerBase::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.

Implemented in NullAuthHandler, PlaintextAuthHandler, and MD5AuthHandler.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations