[PATCH] peer-as/remote-as directives should refer to a number, not ASnnn

Faidon Liambotis paravoid at debian.org
Sun Jul 5 21:26:14 UTC 2009


This serves as a temporary fix for #34; Nick has expressed some concern
over the way things are being handled right now in the library and that
it should be fixed there, rather than being workarounded in rtconfig.

However, there's no harm done in having something working sooner than
later, even if in a hackish way.
---
 src/rtconfig/f_cisco.cc |    8 ++++----
 src/rtconfig/f_junos.cc |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/rtconfig/f_cisco.cc b/src/rtconfig/f_cisco.cc
index bb3864e..1b5b80a 100644
--- a/src/rtconfig/f_cisco.cc
+++ b/src/rtconfig/f_cisco.cc
@@ -1718,12 +1718,12 @@ void CiscoConfig::importGroup(ASt asno, char * pset) {
        if (typeid(*itr()->peering->peerRtrs) == typeid(FilterRouter)  
             && typeid(*itr()->peering->peerASes) == typeid(FilterASNO))
          cout << " neighbor " << *itr()->peering->peerRtrs  
-              << " remote-as " << *itr()->peering->peerASes << endl;
+              << " remote-as " << ((FilterASNO *)itr()->peering->peerASes)->asno << endl;
      for (AttrIterator<AttrPeering> itr(prngSet, "mp-peering"); itr; itr++)
        if (typeid(*itr()->peering->peerRtrs) == typeid(FilterRouter)  
             && typeid(*itr()->peering->peerASes) == typeid(FilterASNO))
          cout << " neighbor " << *itr()->peering->peerRtrs  
-              << " remote-as " << *itr()->peering->peerASes << endl;
+              << " remote-as " << ((FilterASNO *)itr()->peering->peerASes)->asno << endl;
 
      for (Item *afi = afi_list->head(); afi; afi = afi_list->next(afi)) {
        bool afi_activate = false;
@@ -1814,12 +1814,12 @@ void CiscoConfig::exportGroup(ASt asno, char * pset) {
        if (typeid(*itr()->peering->peerRtrs) == typeid(FilterRouter)  
             && typeid(*itr()->peering->peerASes) == typeid(FilterASNO))
          cout << " neighbor " << *itr()->peering->peerRtrs  
-              << " remote-as " << *itr()->peering->peerASes << endl;
+              << " remote-as " << ((FilterASNO *)itr()->peering->peerASes)->asno << endl;
      for (AttrIterator<AttrPeering> itr(prngSet, "mp-peering"); itr; itr++)
        if (typeid(*itr()->peering->peerRtrs) == typeid(FilterRouter)  
             && typeid(*itr()->peering->peerASes) == typeid(FilterASNO))
          cout << " neighbor " << *itr()->peering->peerRtrs  
-              << " remote-as " << *itr()->peering->peerASes << endl;
+              << " remote-as " << ((FilterASNO *)itr()->peering->peerASes)->asno << endl;
 
      for (Item *afi = afi_list->head(); afi; afi = afi_list->next(afi)) {
        bool afi_activate = false;
diff --git a/src/rtconfig/f_junos.cc b/src/rtconfig/f_junos.cc
index 83fb40e..00db22b 100644
--- a/src/rtconfig/f_junos.cc
+++ b/src/rtconfig/f_junos.cc
@@ -1231,7 +1231,7 @@ void JunosConfig::exportGroup(ASt asno, char * pset) {
       if (typeid(*itr()->peering->peerRtrs) == typeid(FilterRouter)
 	  && typeid(*itr()->peering->peerASes) == typeid(FilterASNO)) {
 	 cout << "         neighbor " << *itr()->peering->peerRtrs << " {\n"
-	      << "            peer-as " << *itr()->peering->peerASes <<";\n"
+	      << "            peer-as " << ((FilterASNO *)itr()->peering->peerASes)->asno <<";\n"
 	      << "         }\n";
       }
    }   
@@ -1239,7 +1239,7 @@ void JunosConfig::exportGroup(ASt asno, char * pset) {
       if (typeid(*itr()->peering->peerRtrs) == typeid(FilterRouter)
 	  && typeid(*itr()->peering->peerASes) == typeid(FilterASNO)) {
 	 cout << "         neighbor " << *itr()->peering->peerRtrs << " {\n"
-	      << "            peer-as " << *itr()->peering->peerASes <<";\n"
+	      << "            peer-as " << ((FilterASNO *)itr()->peering->peerASes)->asno <<";\n"
 	      << "         }\n";
       }
    }   
@@ -1333,7 +1333,7 @@ void JunosConfig::importGroup(ASt asno, char * pset) {
       if (typeid(*itr()->peering->peerRtrs) == typeid(FilterRouter)
 	  && typeid(*itr()->peering->peerASes) == typeid(FilterASNO)) {
 	 cout << "         neighbor " << *itr()->peering->peerRtrs << " {\n"
-	      << "            peer-as " << *itr()->peering->peerASes <<";\n"
+	      << "            peer-as " << ((FilterASNO *)itr()->peering->peerASes)->asno <<";\n"
 	      << "         }\n";
       }
    }   
@@ -1341,7 +1341,7 @@ void JunosConfig::importGroup(ASt asno, char * pset) {
       if (typeid(*itr()->peering->peerRtrs) == typeid(FilterRouter)
 	  && typeid(*itr()->peering->peerASes) == typeid(FilterASNO)) {
 	 cout << "         neighbor " << *itr()->peering->peerRtrs << " {\n"
-	      << "            peer-as " << *itr()->peering->peerASes <<";\n"
+	      << "            peer-as " << ((FilterASNO *)itr()->peering->peerASes)->asno <<";\n"
 	      << "         }\n";
       }
    }   
-- 
1.5.6.5




More information about the irrtoolset mailing list