class Port

RIP Port. More...

Definition#include <port.hh>
Template formPort<typename A>
InheritsAuthManager [public ], PortIOUserBase [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Protected Methods

Protected Members


Detailed Description

A RIP Port is an origin and sink of RIP packets. It is uniquely identified by the tuplet of <interface, virtual interface, address>. The Port sends and receives RIP packets via an attached Port IO object (PortIOBase<A>). The Port contains a list of Peers (Peer<A>) that it has received communication on and is responsible for updating information sent by peers in the RIP route database (RouteDB<A>).

typedef A Addr

Addr

typedef list<Peer<A>*> PeerList

PeerList

 Port (PortManagerBase<A>& manager)

Port

 ~Port ()

~Port

inline PortTimerConstants&  constants ()

constants

Get timer constants in use for routes received on this port.

inline const PortTimerConstants&  constants ()

constants

[const]

Get timer constants in use for routes received on this port.

void  set_enabled (bool en)

set_enabled

Set enabled state.

inline bool  enabled ()

enabled

[const]

Get enabled state.

inline uint32_t  cost ()

cost

[const]

Get cost metric associated with Port.

inline void  set_cost (uint32_t cost)

set_cost

Set cost metric associated with Port.

inline const RipHorizon&  horizon ()

horizon

[const]

Get horizon type associated with Port.

inline void  set_horizon (const RipHorizon& h)

set_horizon

Set horizon type associated with Port.

Parameters:
hhorizon type.

inline bool  advertise ()

advertise

[const]

Determine whether Port address should be advertised.

Returns: true if port should be advertised to other hosts, false otherwise.

inline void  set_advertise (bool en)

set_advertise

Set Port advertisement status.

Parameters:
entrue if port should be advertised, false otherwise.

inline const PeerList&  peers ()

peers

[const]

Get Peers associated with this Port.

inline PeerList&  peers ()

peers

Get Peers associated with this Port.

NB This method is a backdoor for testing purposes and should not be relied upon to exist in future.

inline const PortCounters&  counters ()

counters

[const]

Get counters associated with Port.

const Peer<A>*  peer (const Addr& addr)

peer

[const]

Get Peer identified by address.

Returns: pointer to Peer on success, 0 otherwise.

void  set_max_packet_buffer_bytes (uint32_t max_bytes)

set_max_packet_buffer_bytes

Set the maximum packet buffer size.

uint32_t  set_max_packet_buffer_bytes ()

set_max_packet_buffer_bytes

[const]

Get the maximum packet buffer size.

uint32_t  packet_buffer_bytes ()

packet_buffer_bytes

[const]

Get the current number of bytes buffered in RIP packets.

inline PortCounters&  counters ()

counters

[protected]

Get counters associated with Port.

Peer<A>*  peer (const Addr& addr)

peer

[protected]

Get Peer identified by address.

Returns: pointer to Peer on success, 0 otherwise.

Peer<A>*  create_peer (const Addr& addr)

create_peer

[protected]

Create Peer.

Returns: pointer to Peer if created, 0 on failure or peer already exists.

void  record_packet (Peer<A>* p)

record_packet

[protected]

Record packet arrival. Updates port and peer counters.

void  record_bad_packet (const string& why, const Addr& addr, uint16_t port, Peer<A>* p)

record_bad_packet

[protected]

Record bad packet.

Parameters:
whyreason packet marked

void  parse_request (const Addr& src_addr, uint16_t src_port, const uint8_t* rip_request, size_t rip_request_bytes)

parse_request

[protected]

Parse request message.

Parameters:
rip_request

void  port_io_send_completion (const uint8_t* rip_packet, bool success)

port_io_send_completion

[protected]

Send completion notification. Called by PortIO instance when a send request is completed.

Parameters:
rip_packetpointer to RIP packet data requested to be sent.
successindication of whether send completed successfully.

Reimplemented from PortIOUserBase.

void  port_io_receive (const Addr& src_addr, uint16_t src_port, const uint8_t* rip_packet, const size_t rip_packet_bytes)

port_io_receive

[protected]

Receive RIP packet. Called by PortIO instance when a RIP packet arrives.

Parameters:
addrsource address of packet.
portsource port of packet.
rip_packetpointer to RIP packet data.
rip_packet_bytessize of RIP packet data.

Reimplemented from PortIOUserBase.

void  port_io_enabled_change (bool en)

port_io_enabled_change

[protected]

Notification that PortIO enabled state has changed. Called by PortIO when it's enabled status changes.

Parameters:
enthe enabled status of the I/O system.

Reimplemented from PortIOUserBase.

PortManagerBase<A>& _pm

_pm

[protected]

PeerList _peers

_peers

[protected]

XorpTimer _us_timer

_us_timer

[protected]

XorpTimer _tu_timer

_tu_timer

[protected]

bool _en

_en

[protected]

uint32_t _cost

_cost

[protected]

RipHorizon _horizon

_horizon

[protected]

bool _advertise

_advertise

[protected]

PortPacketQueue<A>* _packet_queue

_packet_queue

[protected]

PortTimerConstants _constants

_constants

[protected]

PortCounters _counters

_counters

[protected]


Generated by: pavlin on possum.icir.org on Mon Jun 9 13:24:02 2003, using kdoc 2.0a54+XORP.