xorp

ResponsePacketAssembler< A > Class Template Reference

Class for RIP Response Packet Assemblers. More...

#include <packet_assembly.hh>

List of all members.

Public Types

typedef A Addr
typedef IPNet< A > Net
typedef
PacketAssemblerSpecState< A > 
SpState

Public Member Functions

 ResponsePacketAssembler (Port< A > &port)
 Constructor.
 ResponsePacketAssembler (SpState &sp)
 Constructor.
 ~ResponsePacketAssembler ()
 Destructor.
void packet_start (RipPacket< A > *pkt)
 Start assembling RIP response packet.
bool packet_add_route (const Net &net, const Addr &nexthop, uint16_t cost, uint16_t tag)
 Add a route to RIP response packet.
bool packet_full () const
 Ready-to-go accessor.
bool packet_finish (list< RipPacket< A > * > &auth_packets)
 Finish packet.
template<>
 ResponsePacketAssembler (Port< IPv4 > &port)
template<>
 ResponsePacketAssembler (SpState &sp)
template<>
void packet_start (RipPacket< IPv4 > *pkt)
template<>
bool packet_full () const
template<>
bool packet_add_route (const Net &net, const Addr &nexthop, uint16_t cost, uint16_t tag)
template<>
bool packet_finish (list< RipPacket< IPv4 > * > &auth_packets)
template<>
 ResponsePacketAssembler (Port< IPv6 > &port)
template<>
 ResponsePacketAssembler (SpState &sp)
template<>
void packet_start (RipPacket< IPv6 > *pkt)
template<>
bool packet_full () const
template<>
bool packet_add_route (const Net &net, const Addr &nexthop, uint16_t cost, uint16_t tag)
template<>
bool packet_finish (list< RipPacket< IPv6 > * > &auth_packets)

Protected Attributes

RipPacket< A > * _pkt
uint32_t _pos
SpState _sp_state

Private Member Functions

 ResponsePacketAssembler (const ResponsePacketAssembler &)
 Copy Constructor (Disabled).
ResponsePacketAssembleroperator= (const ResponsePacketAssembler &)
 Assignment Operator (Disabled).

Detailed Description

template<typename A>
class ResponsePacketAssembler< A >

Class for RIP Response Packet Assemblers.

Both RIPv2 and RIPng have some oddities in packing and this interface provides a consistent interface for that packing.

This class has specialized IPv4 and IPv6 implementations.


Constructor & Destructor Documentation

template<typename A >
ResponsePacketAssembler< A >::ResponsePacketAssembler ( Port< A > &  port)

Constructor.

Parameters:
portPort to take configuration information from.
template<typename A >
ResponsePacketAssembler< A >::ResponsePacketAssembler ( SpState sp)

Constructor.

Parameters:
spSpecialized state.

Member Function Documentation

template<typename A >
bool ResponsePacketAssembler< A >::packet_add_route ( const Net net,
const Addr &  nexthop,
uint16_t  cost,
uint16_t  tag 
)

Add a route to RIP response packet.

Returns:
true if route was added, false if packet is full and would have indicated this if only packet_full was called.
template<typename A >
bool ResponsePacketAssembler< A >::packet_finish ( list< RipPacket< A > * > &  auth_packets)

Finish packet.

Some packet types require final stage processing and this method gives that processing a chance to happen. Common usage is RIPv2 authentication.

Parameters:
auth_packetsa return-by-reference list with the authenticated RIP packets (one copy for each valid authentication key).
Returns:
true on success, false if a failure is detected.
template<typename A >
bool ResponsePacketAssembler< A >::packet_full ( ) const

Ready-to-go accessor.

Returns:
true if packet has no more space for route entries.

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