Classes |
| struct | Candidate |
| | Possible DR or BDR candidates. More...
|
| struct | expect |
Public Types |
| enum | PeerState { YES_ITS_ME,
NO_ITS_NOT_ME,
PLEASE_DELETE_ME
} |
| enum | InterfaceState {
Down,
Loopback,
Waiting,
Point2Point,
DR_other,
Backup,
DR
} |
| | Interface as defined by OSPF not XORP.
|
|
typedef A | Addr |
|
typedef Port< A > | RipPort |
|
typedef RouteEntry< A > | Route |
Public Member Functions |
|
| Peer (EventLoop *eventloop, XrlStdRouter *xrlrouter, const string &peer_name, const uint32_t genid, const string &target_hostname, const string &target_port) |
|
| Peer (const Peer &rhs) |
|
Peer & | operator= (const Peer &rhs) |
|
void | copy (const Peer &rhs) |
|
PeerState | is_this_you (const string &peer_name) const |
|
PeerState | is_this_you (const string &peer_name, const uint32_t genid) const |
|
void | shutdown () |
|
bool | up () const |
|
void | status (string &status) |
|
bool | pending () |
|
void | listen (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | connect (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | disconnect (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | establish (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | send (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | send_packet (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | send_dump (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | trie (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | expect (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | assertX (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | dump (const string &line, const vector< string > &words) throw (InvalidString) |
|
void | check_expect (BGPPacket *rec) |
|
void | xrl_callback (const XrlError &error, const char *comment) |
|
void | xrl_callback_connected (const XrlError &error, const char *comment) |
|
void | datain (const bool &status, const TimeVal &tv, const vector< uint8_t > &data) |
|
void | datain_error (const string &reason) |
|
void | datain_closed () |
|
PathAttribute * | path_attribute (const char *) const throw (InvalidString) |
|
const BGPPacket * | packet (const string &line, const vector< string > &words, int index) const throw (InvalidString) |
|
| Peer (Ospf< A > &ospf, PeerOut< A > &peerout, OspfTypes::AreaID area_id, OspfTypes::AreaType area_type) |
|
bool | init () |
| | Should be invoked just once.
|
| bool | shutdown () |
| | Will only execute if go() has been called.
|
| bool | go () |
| | Called once the peer is configured and enabled.
|
|
bool | initV3 () |
| | OSPFv3 specific initialisation.
|
|
bool | goV3 () |
| | OSPFv3 specific go.
|
|
bool | shutdownV3 () |
| | OSPFv3 specific shutdown.
|
|
void | populate_link_lsa () |
|
bool | match (IPv6 source) const |
| | If the source address matches a global address return true.
|
|
string | get_if_name () const |
| | For debugging only printable rendition of this interface/vif.
|
|
OspfTypes::PeerID | get_peerid () const |
| | Get Peer ID.
|
| A | get_interface_address () const |
| | Address of this interface/vif.
|
| uint16_t | get_interface_prefix_length () const |
| uint16_t | get_interface_mtu () const |
| uint16_t | get_frame_size () const |
| | The maximum size of an OSPF frame, the MTU minus the IP header.
|
| uint16_t | get_inftransdelay () const |
|
bool | transmit (typename Transmit< A >::TransmitRef tr) |
| | Used by external and internal entities to transmit packets.
|
|
bool | add_neighbour (A neighbour_address, OspfTypes::RouterID rid) |
| | Add neighbour.
|
|
bool | remove_neighbour (A neighbour_address, OspfTypes::RouterID rid) |
| | Remove neighbour.
|
|
bool | belongs (A addr) const |
| | Address belongs to this router used for destination address validation.
|
|
bool | receive (A dst, A src, Packet *packet) |
| | Packets for this peer are received here.
|
| bool | accept_lsa (Lsa::LsaRef lsar) const |
| | Used to test if an lsa should be accepted for this peer/neighbour.
|
| bool | send_lsa (const OspfTypes::NeighbourID nid, Lsa::LsaRef lsar) const |
| | Send this LSA directly to the neighbour.
|
| bool | queue_lsa (OspfTypes::PeerID peerid, OspfTypes::NeighbourID nid, Lsa::LsaRef lsar, bool &multicast_on_peer) const |
| | Queue an LSA for transmission.
|
|
bool | push_lsas (const char *message) |
| | Send (push) any queued LSAs.
|
|
bool | do_dr_or_bdr () const |
| bool | is_DR () const |
| bool | is_BDR () const |
| bool | is_DR_or_BDR () const |
| bool | neighbours_exchange_or_loading () const |
| | Are any of the neighbours of this peer in the state exchange or loading.
|
| bool | neighbour_at_least_two_way (OspfTypes::RouterID rid, bool &twoway) |
| | Get the state of the neighbour with the specified router ID.
|
| bool | get_neighbour_address (OspfTypes::RouterID rid, uint32_t interface_id, A &neighbour_address) |
| | Neighbour's source address.
|
| bool | on_link_state_request_list (const OspfTypes::NeighbourID nid, Lsa::LsaRef lsar) const |
| | Is this LSA on this neighbours link state request list.
|
| bool | event_bad_link_state_request (const OspfTypes::NeighbourID nid) const |
| | Generate a BadLSReq event.
|
| bool | virtual_link_endpoint () const |
| | Are any of neighbours of this peer a virtual link endpoint.
|
| void | send_direct_acks (OspfTypes::NeighbourID nid, list< Lsa_header > &ack) |
| | Send direct ACKs.
|
| void | send_delayed_acks (OspfTypes::NeighbourID nid, list< Lsa_header > &ack) |
| | Send delayed ACKs.
|
|
Neighbour< A > * | find_neighbour (A src, OspfTypes::RouterID rid) |
| bool | is_neighbour_DR_or_BDR (OspfTypes::NeighbourID nid) const |
|
bool | process_hello_packet (A dst, A src, HelloPacket *hello) |
| | Process a hello packet.
|
|
bool | process_data_description_packet (A dst, A src, DataDescriptionPacket *dd) |
| | Process a data description packet.
|
|
bool | process_link_state_request_packet (A dst, A src, LinkStateRequestPacket *lsrp) |
| | Process a link state request packet.
|
|
bool | process_link_state_update_packet (A dst, A src, LinkStateUpdatePacket *lsup) |
| | Process a link state update packet.
|
|
bool | process_link_state_acknowledgement_packet (A dst, A src, LinkStateAcknowledgementPacket *lsap) |
| | Process a link state acknowledgement packet.
|
|
void | start () |
| | Start the protocol machinery running.
|
|
void | stop () |
| | Stop the protocol machinery running.
|
|
void | change_area_router_type (OspfTypes::AreaType area_type) |
| | Change the type of this area.
|
|
void | event_interface_up () |
| | Event: InterfaceUP.
|
|
void | event_wait_timer () |
| | Event: WaitTimer.
|
|
void | event_backup_seen () |
| | Event: BackupSeen.
|
|
void | event_neighbour_change () |
| | Event: NeighborChange.
|
|
void | event_loop_ind () |
| | Event: LoopInd.
|
|
void | event_unloop_ind () |
| | Event: UnLoopInd.
|
|
void | event_interface_down () |
| | Event: InterfaceDown.
|
|
void | schedule_event (const char *) |
| | Schedule an event, used by the neighbours to schedule an interface event.
|
|
void | process_scheduled_events () |
| | Run all the deferred events, callback method.
|
|
AreaRouter< A > * | get_area_router () |
| | Get the area router.
|
| OspfTypes::RouterID | get_candidate_id (A=A::ZERO()) const |
|
InterfaceState | get_state () const |
| OspfTypes::LinkType | get_linktype () const |
|
Auth & | get_auth_handler () |
| | Return the authentication handler.
|
|
void | populate_common_header (Packet &packet) |
| | Fill in the common header parts of the packet.
|
| OspfTypes::AreaID | get_area_id () const |
| OspfTypes::AreaType | get_area_type () const |
| void | set_area_type (OspfTypes::AreaType area_type) |
|
void | router_id_changing () |
| | The router ID is about to change.
|
|
bool | set_network_mask (uint32_t network_mask) |
| | Set the network mask OSPFv2 only.
|
|
uint32_t | get_network_mask () const |
| | Set the network mask OSPFv2 only.
|
|
bool | set_interface_id (uint32_t interface_id) |
| | Set the interface ID OSPFv3 only.
|
|
uint32_t | get_interface_id () const |
| | Get the interface ID OSPFv3 only.
|
|
bool | add_advertise_net (A addr, uint32_t prefix) |
| | Set a network to advertise OSPFv3 only.
|
|
bool | remove_all_nets () |
| | Remove all the networks that are being advertised OSPFv3 only.
|
|
bool | update_nets () |
| | Calls to add_advertise_net() and remove_all_nets() must be followed by a call to update nets to force a new Link-LSA to be sent out OSPFv3 only.
|
|
bool | set_hello_interval (uint16_t hello_interval) |
| | Set the hello interval in seconds.
|
|
bool | set_options (uint32_t options) |
| | Set options.
|
|
uint32_t | get_options () const |
| | Get options.
|
|
bool | set_router_priority (uint8_t priority) |
| | Set router priority.
|
|
bool | set_router_dead_interval (uint32_t router_dead_interval) |
| | Set the router dead interval in seconds.
|
|
uint32_t | get_router_dead_interval () const |
| | Get the router dead interval in seconds.
|
| bool | set_simple_authentication_key (const string &password, string &error_msg) |
| | Set a simple password authentication key.
|
| bool | delete_simple_authentication_key (string &error_msg) |
| | Delete a simple password authentication key.
|
| bool | set_md5_authentication_key (uint8_t key_id, const string &password, const TimeVal &start_timeval, const TimeVal &end_timeval, const TimeVal &max_time_drift, string &error_msg) |
| | Set an MD5 authentication key.
|
| bool | delete_md5_authentication_key (uint8_t key_id, string &error_msg) |
| | Delete an MD5 authentication key.
|
|
bool | set_passive (bool passive, bool host) |
| | Toggle the passive status of an interface.
|
|
bool | get_passive () const |
| | If all peers are in state passive then return passive.
|
|
bool | set_rxmt_interval (uint32_t rxmt_interval) |
| | Set RxmtInterval.
|
|
uint32_t | get_rxmt_interval () |
| | Get RxmtInterval.
|
|
OspfTypes::RouterID | get_designated_router () const |
| | Get the designated router.
|
|
OspfTypes::RouterID | get_backup_designated_router () const |
| | Get the backup designated router.
|
| uint32_t | get_designated_router_interface_id (A=A::ZERO()) const |
| | Get the interface ID of the designated router.
|
| void | update_router_links () |
| | Compute the current router link.
|
| void | adjacency_change (bool up) |
| | Used to notify the peer that a neighbour has become fully adjacent or a neighbour is no longer fully adjacent.
|
|
bool | get_neighbour_list (list< OspfTypes::NeighbourID > &neighbours) const |
| | Get a list of all the neighbours.
|
| bool | get_neighbour_info (OspfTypes::NeighbourID nid, NeighbourInfo &ninfo) const |
| | Get state information about this neighbour.
|
|
set< AddressInfo< A > > & | get_address_info () |
| | Get this list of addresses that should be advertised OSPFv3 only.
|
|
bool | get_attached_routers (list< RouterInfo > &routers) |
| | Return a list of the fully adjacent routers.
|
|
| Peer (RipPort &p, const Addr &addr) |
|
const Addr & | address () const |
| | Get address of Peer.
|
|
PeerCounters & | counters () |
| | Get counters associated with Peer.
|
|
const PeerCounters & | counters () const |
| | Get counters associated with Peer.
|
|
RipPort & | port () |
| | Get port associated with Peer.
|
|
const RipPort & | port () const |
| | Get port associated with Peer.
|
|
void | set_last_active (const TimeVal &t) |
| | Set last active time.
|
|
const TimeVal & | last_active () const |
| | Get last active time.
|
| bool | update_route (const IPNet< A > &net, const A &nexthop, uint32_t cost, uint32_t tag, const PolicyTags &policytags) |
| | Update Route Entry in database for specified route.
|
| void | push_routes () |
| | Push routes through the system.
|
| uint32_t | expiry_secs () const |
| | Retrieve number of seconds before routes associated with this RouteEntryOrigin should be marked as expired.
|
|
uint32_t | deletion_secs () const |
| | Retrieve number of seconds before route should be deleted after expiry.
|
|
template<> |
| void | populate_link_lsa () |
|
template<> |
| bool | belongs (IPv6 addr) const |
|
template<> |
| OspfTypes::RouterID | get_candidate_id (IPv6, OspfTypes::RouterID router_id) |
|
template<> |
| OspfTypes::RouterID | get_candidate_id (IPv6) const |
|
template<> |
| uint32_t | get_designated_router_interface_id (IPv6) const |
|
template<> |
| bool | add_advertise_net (IPv6 addr, uint32_t prefix_length) |
|
template<> |
| bool | remove_all_nets () |
|
template<> |
| bool | update_nets () |
Static Public Member Functions |
| static OspfTypes::RouterID | get_candidate_id (A, OspfTypes::RouterID) |
|
static string | pp_interface_state (InterfaceState is) |
| | Pretty print the interface state.
|
Protected Types |
typedef XorpCallback1< void,
const XrlError & >::RefPtr | SMCB |
Protected Member Functions |
|
void | send_message (const uint8_t *buf, const size_t len, SMCB cb) |
|
void | send_dump_callback (const XrlError &error, FILE *fp, const size_t packet_number, const size_t packets_to_send, const char *comment) |
|
void | send_open () |
|
void | send_keepalive () |
|
void | set_expiry_timer (Route *route) |
|
void | expire_route (Route *route) |
Protected Attributes |
|
SMCB | _smcb |
|
RipPort & | _port |
|
Addr | _addr |
|
PeerCounters | _counters |
|
TimeVal | _last_active |
|
PeerRoutes< A > | _peer_routes |
Private Types |
typedef XorpCallback3< void,
const uint8_t *, size_t,
TimeVal >::RefPtr | Dumper |
Private Member Functions |
|
void | change_state (InterfaceState state) |
| | Change state, use this not set_state when changing states.
|
|
void | set_state (InterfaceState state) |
| | Set the state of this peer.
|
|
bool | set_designated_router (OspfTypes::RouterID dr) |
| | Set the designated router.
|
|
bool | set_backup_designated_router (OspfTypes::RouterID dr) |
| | Set the backup designated router.
|
| void | designated_router_changed (bool yes) |
| | Called when this peer becomes the designated router or this peer was the designated router.
|
|
void | start_hello_timer () |
| | Unconditionally start the hello timer running.
|
|
void | stop_hello_timer () |
| | Unconditionally stop the hello timer running.
|
| void | restart_hello_timer () |
| | If the hello timer is already running, then stop and start the timer.
|
|
void | start_wait_timer () |
|
void | stop_wait_timer () |
|
bool | send_hello_packet () |
|
OspfTypes::RouterID | backup_designated_router (list< Candidate > &candidates) const |
|
OspfTypes::RouterID | designated_router (list< Candidate > &candidates, OspfTypes::RouterID backup_designated_router) const |
|
void | compute_designated_router_and_backup_designated_router () |
| void | update_router_linksV2 (list< RouterLink > &router_links) |
| | Compute the current router link for OSPFv2.
|
| void | update_router_linksV3 (list< RouterLink > &router_links) |
| | Compute the current router link for OSPFv3.
|
|
void | remove_neighbour_state () |
| | Remove neighbour state.
|
|
void | tear_down_state () |
| | Stop all timers.
|
|
template<> |
| void | update_router_linksV2 (list< RouterLink > &) |
|
template<> |
| void | update_router_linksV3 (list< RouterLink > &router_links) |
Private Attributes |
|
EventLoop * | _eventloop |
|
XrlStdRouter * | _xrlrouter |
|
LocalData * | _localdata |
|
BGPPeerData * | _peerdata |
|
string | _peername |
|
uint32_t | _genid |
|
string | _target_hostname |
|
string | _target_port |
|
bool | _up |
|
TimeVal | _shutdown_time |
|
uint32_t | _busy |
|
bool | _connected |
|
bool | _session |
|
bool | _passive |
|
bool | _established |
|
bool | _keepalive |
|
AsNum | _as |
|
int | _holdtime |
|
IPv4 | _id |
|
bool | _ipv6 |
|
Trie | _trie_recv |
|
Trie | _trie_sent |
|
uint32_t | _last_recv |
|
uint32_t | _last_sent |
|
Dumper | _traffic_recv |
|
Dumper | _traffic_sent |
|
struct Peer::expect | _expect |
|
Ospf< A > & | _ospf |
|
PeerOut< A > & | _peerout |
|
const OspfTypes::AreaID | _area_id |
|
OspfTypes::AreaType | _area_type |
|
bool | _go_called |
|
bool | _enabled |
|
bool | _passive_host |
|
Auth | _auth_handler |
|
XorpTimer | _hello_timer |
|
XorpTimer | _wait_timer |
|
XorpTimer | _event_timer |
|
uint32_t | _rxmt_interval |
|
InterfaceState | _interface_state |
|
list< Neighbour< A > * > | _neighbours |
|
HelloPacket | _hello_packet |
|
Lsa::LsaRef | _link_lsa |
|
list< RouterLink > | _router_links |
|
list< string > | _scheduled_events |
|
set< AddressInfo< A > > | _address_info |