ns3-bgp  0.2
BGP module for ns-3.
Public Member Functions | Static Public Member Functions | List of all members
ns3::BgpRouting Class Reference

The Ipv4RoutingProtocol for Bgp module. More...

#include <bgp-routing.h>

Inheritance diagram for ns3::BgpRouting:
Inheritance graph
[legend]
Collaboration diagram for ns3::BgpRouting:
Collaboration graph
[legend]

Public Member Functions

Ptr< Ipv4Route > RouteOutput (Ptr< Packet > p, const Ipv4Header &header, Ptr< NetDevice > oif, Socket::SocketErrno &sockerr)
 
bool RouteInput (Ptr< const Packet > p, const Ipv4Header &header, Ptr< const NetDevice > idev, UnicastForwardCallback ucb, MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)
 
void NotifyInterfaceUp (uint32_t interface)
 
void NotifyInterfaceDown (uint32_t interface)
 
void NotifyAddAddress (uint32_t interface, Ipv4InterfaceAddress address)
 
void NotifyRemoveAddress (uint32_t interface, Ipv4InterfaceAddress address)
 
void PrintRoutingTable (Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S) const
 
void SetIpv4 (Ptr< Ipv4 > ipv4)
 
void SetRib (const libbgp::BgpRib4 *rib)
 Set the libbgp Routing Information Base to use. More...
 
Ptr< NetDevice > GetDeviceByNexthop (const Ipv4Address &nexthop) const
 Look for device to output/forward packet by nexthop. More...
 
Ipv4InterfaceAddress GetAddressByNexthop (const Ipv4Address &nexthop) const
 Look for the interface address that can reach a given nexthop. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 

Detailed Description

The Ipv4RoutingProtocol for Bgp module.

Definition at line 23 of file bgp-routing.h.

Member Function Documentation

◆ GetAddressByNexthop()

Ipv4InterfaceAddress ns3::BgpRouting::GetAddressByNexthop ( const Ipv4Address &  nexthop) const

Look for the interface address that can reach a given nexthop.

Return address if found. If not found, a 0.0.0.0 address will be returned and a warning will be logger.

Parameters
nexthopNexthop.
Returns
Ipv4InterfaceAddress Interface address.

Definition at line 164 of file bgp-routing.cc.

◆ GetDeviceByNexthop()

Ptr< NetDevice > ns3::BgpRouting::GetDeviceByNexthop ( const Ipv4Address &  nexthop) const

Look for device to output/forward packet by nexthop.

Parameters
nexthopNexthop.
Returns
Ptr<NetDevice> Output device.
Return values
nullptrDevice not found.
!=nullptrOutput device.

Definition at line 136 of file bgp-routing.cc.

◆ SetRib()

void ns3::BgpRouting::SetRib ( const libbgp::BgpRib4 rib)

Set the libbgp Routing Information Base to use.

Parameters
ribThe libbgp RIB.

Definition at line 186 of file bgp-routing.cc.

References BgpRibEntry< BgpRib4Entry >::attribs, libbgp::BgpRib4::get(), libbgp::Prefix4::getLength(), libbgp::Prefix4::getPrefix(), libbgp::BgpRib4Entry::route, and BgpRibEntry< BgpRib4Entry >::src_router_id.


The documentation for this class was generated from the following files: