Exemple #1
0
void
AsciiBGPVisitor::visit(NLRIUnReachable& n, boost::any param)
{
  InfoPtr info = boost::any_cast<InfoPtr>(param);

  std::cout << info->mrt_type << "|" << info->timestamp << "|"
            << "W"
            << "|" << FORMAT_IP_ADDRESS(info->peer_addr, info->peer_afi) << "|" << info->peer_as
            << "|" << FORMAT_IP_ADDRESS(n.getPrefix(), info->afi) << "/" << (int)n.getLength()
            << "\n";
}
Exemple #2
0
void
AsciiBGPVisitor::visit(NLRIReachable& n, boost::any param)
{
  InfoPtr info = boost::any_cast<InfoPtr>(param);

  std::cout << info->mrt_type << "|" << info->timestamp << "|" << info->dump_type << "|" // A or I
            << FORMAT_IP_ADDRESS(info->peer_addr, info->peer_afi) << "|" << info->peer_as << "|"
            << FORMAT_IP_ADDRESS(n.getPrefix(), info->afi) << "/" << (int)n.getLength() << "|"
            << info->as_path << "|" << info->origin << "|" << info->next_hop << "|" << info->lpref
            << "|" << info->med << "|" << info->communities << "|" << info->atomic_agg << "|"
            << info->agg << "|"
            << "\n";
  info->parseNLRI = true;
}
Exemple #3
0
void
AsciiVisitor::visit(MRTBgp4MPStateChange& n)
{
  std::cout << "BGP4MP"
            << "|" << (int)n.getTimestamp() << "|"
            << "STATE"
            << "|" << FORMAT_IP_ADDRESS(n.getPeerIP(), n.getAddressFamily()) << "|" << n.getPeerAS()
            << "|" << (int)n.getOldState() << "|" << (int)n.getNewState() << "\n";
}
Exemple #4
0
void
AsciiBGPVisitor::visit(AttributeTypeMPReachNLRI& n, boost::any param)
{
  InfoPtr info = boost::any_cast<InfoPtr>(param);

  if (n.getAFI() == 0) {
    info->next_hop = FORMAT_IP_ADDRESS(n.getNextHopAddress(), info->afi);
    return;
  }

  info->afi = n.getAFI(); // should be set everywhere except TABLE_DUMP_V2
  info->next_hop = FORMAT_IP_ADDRESS(n.getNextHopAddress(), info->afi);

  BOOST_FOREACH (const NLRIReachablePtr& route, n.getNLRI()) {
    route->accept(*this, param);
  }

  BOOST_FOREACH (const NLRIReachablePtr& route, n.getSNPA()) {
    route->accept(*this, param);
  }
}
Exemple #5
0
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////// NEXT HOP ////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
void AsciiBGPVisitor::visit( AttributeTypeNextHop &n, boost::any param )
{
	boost::any_cast<InfoPtr>(param)->next_hop=FORMAT_IP_ADDRESS( n.getNextHopIPAddress(), n.getNextHopAFI() );
}