xorp

PlaintextAuthHandler Class Reference

OSPFv2 Authentication handler for plaintext scheme. More...

#include <auth.hh>

Inheritance diagram for PlaintextAuthHandler:
AuthHandlerBase AuthHandlerBase

List of all members.

Public Member Functions

const char * effective_name () const
 Get the effective name of the authentication scheme.
void reset ()
 Reset the authentication state.
uint32_t additional_payload () const
 Additional bytes that will be added to the payload.
bool authenticate_inbound (const vector< uint8_t > &packet, const IPv4 &src_addr, bool new_peer)
 Inbound authentication method.
bool authenticate_outbound (vector< uint8_t > &packet)
 Outbound authentication method.
const string & key () const
 Get the authentication key.
void set_key (const string &plaintext_key)
 Set the authentication key.
const char * effective_name () const
 Get the effective name of the authentication scheme.
void reset ()
 Reset the authentication state.
uint32_t head_entries () const
 Get number of routing entries used by authentication scheme at the head of the RIP packet.
uint32_t max_routing_entries () const
 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)
 Inbound authentication method.
bool authenticate_outbound (RipPacket< IPv4 > &packet, list< RipPacket< IPv4 > * > &auth_packets, size_t &n_routes)
 Outbound authentication method.
const string & key () const
 Get the authentication key.
void set_key (const string &plaintext_key)
 Set the authentication key.

Static Public Member Functions

static const char * auth_type_name ()
 Get the method-specific name of the authentication scheme.
static const char * auth_type_name ()
 Get the method-specific name of the authentication scheme.

Static Public Attributes

static const OspfTypes::AuType AUTH_TYPE = OspfTypes::SIMPLE_PASSWORD

Private Attributes

string _key
uint8_t _key_data [Packet::AUTH_PAYLOAD_SIZE]

Detailed Description

OSPFv2 Authentication handler for plaintext scheme.

RIPv2 Authentication handler for plaintext scheme.


Member Function Documentation

uint32_t PlaintextAuthHandler::additional_payload ( ) const [virtual]

Additional bytes that will be added to the payload.

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

Implements AuthHandlerBase.

const char * PlaintextAuthHandler::auth_type_name ( ) [static]

Get the method-specific name of the authentication scheme.

Returns:
the method-specific name of the authentication scheme.
static const char* PlaintextAuthHandler::auth_type_name ( ) [static]

Get the method-specific name of the authentication scheme.

Returns:
the method-specific name of the authentication scheme.
bool PlaintextAuthHandler::authenticate_inbound ( const vector< uint8_t > &  packet,
const IPv4 src_addr,
bool  new_peer 
) [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.

Implements AuthHandlerBase.

bool PlaintextAuthHandler::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 
) [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.

Implements AuthHandlerBase.

bool PlaintextAuthHandler::authenticate_outbound ( RipPacket< IPv4 > &  packet,
list< RipPacket< IPv4 > * > &  auth_packets,
size_t &  n_routes 
) [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.

Implements AuthHandlerBase.

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

Outbound authentication method.

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

Implements AuthHandlerBase.

const char * PlaintextAuthHandler::effective_name ( ) const [virtual]

Get the effective name of the authentication scheme.

Returns:
the name of the authentication scheme.

Implements AuthHandlerBase.

uint32_t PlaintextAuthHandler::head_entries ( ) const [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.

Implements AuthHandlerBase.

const string& PlaintextAuthHandler::key ( ) const

Get the authentication key.

Returns:
the authentication key.
const string & PlaintextAuthHandler::key ( ) const

Get the authentication key.

Returns:
the authentication key.
void PlaintextAuthHandler::set_key ( const string &  plaintext_key)

Set the authentication key.

Parameters:
plaintext_keythe plain-text key.
void PlaintextAuthHandler::set_key ( const string &  plaintext_key)

Set the authentication key.

Parameters:
plaintext_keythe plain-text key.

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