class Port

RIP Port. More...

Definition#include <port.hh>
Template formPort<typename A>
InheritsPortIOUserBase [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.

inline PortAFSpecState<A>&  af_state ()

af_state

Get Address Family specific state associated with port. This is state that only has meaning within the IP address family.

inline const PortAFSpecState<A>&  af_state ()

af_state

[const]

Get Address Family specific state associated with port. This is state that only has meaning within the IP address family.

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.

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 bool  advertise_default_route ()

advertise_default_route

[const]

Include default route in RIP response messages.

Returns: true if default route is advertised.

void  set_advertise_default_route (bool en)

set_advertise_default_route

Configure whether default route is advertised in RIP response messages.

Parameters:
entrue if default route should be advertised.

inline bool  accept_default_route ()

accept_default_route

[const]

Accept default route if found in RIP response messages.

Returns: true if default route should be accepted.

void  set_accept_default_route (bool en)

set_accept_default_route

Accept default route if found in RIP response messages.

Parameters:
entrue if default route should be accepted.

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  record_bad_route (const string& why, const Addr& src, uint16_t port, Peer<A>* p)

record_bad_route

[protected]

Record bad route.

Parameters:
whyreason packet marked

void  parse_request (const Addr& src_addr, uint16_t src_port, const PacketRouteEntry<A>* entries, uint32_t n_entries)

parse_request

[protected]

Parse request message.

void  parse_response (const Addr& src_addr, uint16_t src_port, const PacketRouteEntry<A>* entries, uint32_t n_entries)

parse_response

[protected]

Parse response message.

void  block_queries ()

block_queries

[protected]

Block route queries for amount of time determined by PortTimerConstants::interquery_delay_ms().

bool  queries_blocked ()

queries_blocked

[protected const]

Determine whether queries are currently blocked and should be discarded.

void  push_packets ()

push_packets

If I/O handler is not already sending a packet, take a packet from packet queue and send it.

pair<A,uint16_t>  route_policy (const RouteEntry<A>& re)

route_policy

[const]

Check policy on route.

Returns: tuple (nexthop,cost). If route should not be advertised the cost value will be greater than RIP_INFINITY.

void  port_io_send_completion (const uint8_t* rip_packet, bool success)

port_io_send_completion

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

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

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]

PortAFSpecState<A> _af_state

_af_state

[protected]

PeerList _peers

_peers

[protected]

XorpTimer _us_timer

_us_timer

[protected]

XorpTimer _tu_timer

_tu_timer

[protected]

XorpTimer _query_blocked_timer

_query_blocked_timer

[protected]

bool _en

_en

[protected]

uint32_t _cost

_cost

[protected]

RipHorizon _horizon

_horizon

[protected]

bool _advertise

_advertise

[protected]

bool _adv_def_rt

_adv_def_rt

[protected]

bool _acc_def_rt

_acc_def_rt

[protected]

PacketQueue<A>* _packet_queue

_packet_queue

[protected]

PortTimerConstants _constants

_constants

[protected]

PortCounters _counters

_counters

[protected]


Generated by: pavlin on possum.icir.org on Thu Nov 6 23:47:08 2003, using kdoc 2.0a54+XORP.