ns3-bgp
0.2
BGP module for ns-3.
|
The Ipv4RoutingProtocol for Bgp module. More...
#include <bgp-routing.h>
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) |
The Ipv4RoutingProtocol for Bgp module.
Definition at line 23 of file bgp-routing.h.
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.
nexthop | Nexthop. |
Definition at line 164 of file bgp-routing.cc.
Ptr< NetDevice > ns3::BgpRouting::GetDeviceByNexthop | ( | const Ipv4Address & | nexthop | ) | const |
Look for device to output/forward packet by nexthop.
nexthop | Nexthop. |
nullptr | Device not found. |
!=nullptr | Output device. |
Definition at line 136 of file bgp-routing.cc.
void ns3::BgpRouting::SetRib | ( | const libbgp::BgpRib4 * | rib | ) |
Set the libbgp Routing Information Base to use.
rib | The 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.