]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: replace AFI_ETHER reference with AFI_L2VPN ref
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 3 Feb 2017 07:02:14 +0000 (08:02 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 14 Feb 2017 12:59:00 +0000 (13:59 +0100)
The introduction of AFI_L2VPN prefix makes usage of AFI_ETHER deprecated
and is of no usage currently. The former replaces the latter one.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_monitor.c
bgpd/rfapi/rfapi_private.h
bgpd/rfapi/rfapi_rib.c
bgpd/rfapi/rfapi_vty.c

index 351d4b6d5ac56fb775170f64b096cfed7e2d9641..01a033049e0df0d089721dc4e0362c3c2f51abfd 100644 (file)
@@ -1451,7 +1451,7 @@ rfapi_open_inner (
 #define RFD_RTINIT(rh, ary) do {\
     RFD_RTINIT_AFI(rh, ary, AFI_IP);\
     RFD_RTINIT_AFI(rh, ary, AFI_IP6);\
-    RFD_RTINIT_AFI(rh, ary, AFI_ETHER);\
+    RFD_RTINIT_AFI(rh, ary, AFI_L2VPN);\
 } while(0)
 
   RFD_RTINIT(rfd, rfd->rib);
@@ -3835,7 +3835,7 @@ DEFUN (debug_rfapi_show_import,
                           &cursor))
         {
 
-          if (it->imported_vpn[AFI_ETHER])
+          if (it->imported_vpn[AFI_L2VPN])
             {
               lni = lni_as_ptr;
               if (first_l2)
@@ -3845,7 +3845,7 @@ DEFUN (debug_rfapi_show_import,
                   first_l2 = 0;
                 }
               snprintf (buf, BUFSIZ, "L2VPN LNI=%u", lni);
-              rfapiShowImportTable (vty, buf, it->imported_vpn[AFI_ETHER], 1);
+              rfapiShowImportTable (vty, buf, it->imported_vpn[AFI_L2VPN], 1);
             }
         }
     }
index 3601e06d54cb06cda105d2c481936e5e37d9808e..d26d48a559a0d6855ddc81afa9b984fb0f04dee5 100644 (file)
@@ -2077,7 +2077,7 @@ rfapiEthRouteTable2NextHopList (
 
 
   it = rfapiMacImportTableGet (bgp, logical_net_id);
-  rt = it->imported_vpn[AFI_ETHER];
+  rt = it->imported_vpn[AFI_L2VPN];
 
   for (rn = route_top (rt); rn; rn = route_next (rn))
     {
@@ -3607,7 +3607,7 @@ rfapiBgpInfoFilteredImportVPN (
   struct peer                  *peer,
   void                         *rfd,           /* set for looped back routes */
   struct prefix                        *p,
-  struct prefix                        *aux_prefix,    /* AFI_ETHER: optional IP */
+  struct prefix                        *aux_prefix,    /* AFI_L2VPN: optional IP */
   afi_t                                afi,
   struct prefix_rd             *prd,
   struct attr                  *attr,          /* part of bgp_info */
@@ -3702,7 +3702,7 @@ rfapiBgpInfoFilteredImportVPN (
     {
     case AFI_IP:
     case AFI_IP6:
-    case AFI_ETHER:
+    case AFI_L2VPN:
       rt = import_table->imported_vpn[afi];
       break;
 
@@ -3909,7 +3909,7 @@ rfapiBgpInfoFilteredImportVPN (
    * For ethernet routes, if there is an accompanying IP address,
    * save it in the bi
    */
-  if ((AFI_ETHER == afi) && aux_prefix)
+  if ((AFI_L2VPN == afi) && aux_prefix)
     {
 
       vnc_zlog_debug_verbose ("%s: setting BI's aux_prefix", __func__);
@@ -4178,7 +4178,7 @@ rfapiProcessUpdate (
            rfd,
            &pfx_mac_buf,       /* prefix */
            p,                  /* aux prefix: IP addr */
-           AFI_ETHER,
+           AFI_L2VPN,
            prd,
            attr,
            type,
@@ -4291,7 +4291,7 @@ rfapiProcessWithdraw (
 
 #if DEBUG_L2_EXTRA
           vnc_zlog_debug_verbose
-            ("%s: calling rfapiBgpInfoFilteredImportVPN(it=%p, afi=AFI_ETHER)",
+            ("%s: calling rfapiBgpInfoFilteredImportVPN(it=%p, afi=AFI_L2VPN)",
              __func__, it);
 #endif
 
@@ -4302,7 +4302,7 @@ rfapiProcessWithdraw (
            rfd,
            &pfx_mac_buf,       /* prefix */
            p,                  /* aux_prefix: IP */
-           AFI_ETHER,
+           AFI_L2VPN,
            prd,
            attr,
            type,
@@ -4808,7 +4808,7 @@ rfapiDeleteRemotePrefixesIt (
             vnc_zlog_debug_verbose ("%s: rn pfx=%s", __func__, buf_pfx);
           }
 
-          /* TBD is this valid for afi == AFI_ETHER? */
+          /* TBD is this valid for afi == AFI_L2VPN? */
           RFAPI_CHECK_REFCOUNT (rn, SAFI_MPLS_VPN, 1);
 
           for (bi = rn->info; bi; bi = next)
@@ -5166,10 +5166,10 @@ rfapiCountAllItRoutes (int *pALRcount,  /* active local routes */
            rc = skiplist_next (h->import_mac, NULL, (void **) &it, &cursor))
         {
 
-          total_active_local += it->local_count[AFI_ETHER];
-          total_active_remote += it->remote_count[AFI_ETHER];
-          total_holddown += it->holddown_count[AFI_ETHER];
-          total_imported += it->imported_count[AFI_ETHER];
+          total_active_local += it->local_count[AFI_L2VPN];
+          total_active_remote += it->remote_count[AFI_L2VPN];
+          total_holddown += it->holddown_count[AFI_L2VPN];
+          total_imported += it->imported_count[AFI_L2VPN];
 
         }
     }
index c051b9b3e044eef8955039ffbdb69bbbd72c72ce..a9e6e4f934f386d4048d82305758b21d345710f8 100644 (file)
@@ -941,7 +941,7 @@ rfapiMonitorItNodeChanged (
               __func__, import_table, it_node, buf_prefix);
 #endif
 
-  if (AFI_ETHER == afi)
+  if (AFI_L2VPN == afi)
     {
       struct rfapi_monitor_eth *m;
       struct skiplist *sl;
@@ -1044,7 +1044,7 @@ rfapiMonitorItNodeChanged (
   /*
    * All-routes L2 monitors
    */
-  if (AFI_ETHER == afi)
+  if (AFI_L2VPN == afi)
     {
       struct rfapi_monitor_eth *e;
 
@@ -1305,7 +1305,7 @@ rfapiMonitorEthAttachImportHd (struct bgp *bgp, struct rfapi_descriptor *rfd)
       pfx_mac_buf.prefixlen = 48;
       pfx_mac_buf.u.prefix_eth = mon->macaddr;
 
-      rn = route_node_get (it->imported_vpn[AFI_ETHER], &pfx_mac_buf);
+      rn = route_node_get (it->imported_vpn[AFI_L2VPN], &pfx_mac_buf);
       assert (rn);
 
       (void) rfapiMonitorEthAttachImport (it, rn, mon);
@@ -1361,7 +1361,7 @@ rfapiMonitorEthDetachImport (
   pfx_mac_buf.prefixlen = 48;
   pfx_mac_buf.u.prefix_eth = mon->macaddr;
 
-  rn = route_node_get (it->imported_vpn[AFI_ETHER], &pfx_mac_buf);
+  rn = route_node_get (it->imported_vpn[AFI_L2VPN], &pfx_mac_buf);
   assert (rn);
 
 #if DEBUG_L2_EXTRA
@@ -1423,7 +1423,7 @@ rfapiMonitorEthAdd (
 
   if (!RFAPI_0_ETHERADDR (macaddr))
     {
-      rn = route_node_get (it->imported_vpn[AFI_ETHER], &pfx_mac_buf);
+      rn = route_node_get (it->imported_vpn[AFI_L2VPN], &pfx_mac_buf);
       assert (rn);
     }
 
@@ -1635,7 +1635,7 @@ rfapiMonitorCallbacksOff (struct bgp *bgp)
       /*
        * The actual route table
        */
-      rt = it->imported_vpn[AFI_ETHER];
+      rt = it->imported_vpn[AFI_L2VPN];
 
       /* 
        * Find non-0 monitors (i.e., actual addresses, not FTD monitors)
index 8ac2966bfeccee2de75e010193b1d6625573789c..a5e39705495ef3fc9005caca51991e35d42a0ed3 100644 (file)
@@ -133,7 +133,7 @@ struct rfapi_descriptor
   uint32_t                     flags;
 #define RFAPI_HD_FLAG_CALLBACK_SCHEDULED_AFI_IP                0x00000001
 #define RFAPI_HD_FLAG_CALLBACK_SCHEDULED_AFI_IP6       0x00000002
-#define RFAPI_HD_FLAG_CALLBACK_SCHEDULED_AFI_ETHER     0x00000004
+#define RFAPI_HD_FLAG_CALLBACK_SCHEDULED_AFI_L2VPN     0x00000004
 #define RFAPI_HD_FLAG_PROVISIONAL                      0x00000008
 #define RFAPI_HD_FLAG_CLOSING_ADMINISTRATIVELY         0x00000010
 #define RFAPI_HD_FLAG_IS_VRF                           0x00000012
@@ -142,7 +142,7 @@ struct rfapi_descriptor
 #define RFAPI_QUEUED_FLAG(afi) (                                       \
     ((afi) == AFI_IP)? RFAPI_HD_FLAG_CALLBACK_SCHEDULED_AFI_IP:        \
     (((afi) == AFI_IP6)? RFAPI_HD_FLAG_CALLBACK_SCHEDULED_AFI_IP6:     \
-    (((afi) == AFI_ETHER)? RFAPI_HD_FLAG_CALLBACK_SCHEDULED_AFI_ETHER: \
+    (((afi) == AFI_L2VPN)? RFAPI_HD_FLAG_CALLBACK_SCHEDULED_AFI_L2VPN: \
     (assert(0), 0) )))
 
 
index 8e5d47415f00ceb4709de4bc66fd5b2dcde0f7b4..d633023dcf86e26cc60270569ef68a8a16b3d745 100644 (file)
@@ -916,7 +916,7 @@ process_pending_node (
   vnc_zlog_debug_verbose ("%s: afi=%d, %s pn->info=%p",
               __func__, afi, buf_prefix, pn->info);
 
-  if (AFI_ETHER != afi)
+  if (AFI_L2VPN != afi)
     {
       rfapiQprefix2Rprefix (&pn->p, &hp);
     }
@@ -1246,7 +1246,7 @@ callback:
           else
             {
               new->prefix = hp;
-              if (AFI_ETHER == afi)
+              if (AFI_L2VPN == afi)
                 {
                   /* hp is 0; need to set length to match AF of vn */
                   new->prefix.length =
@@ -1334,7 +1334,7 @@ callback:
               else
                 {
                   new->prefix = hp;
-                  if (AFI_ETHER == afi)
+                  if (AFI_L2VPN == afi)
                     {
                       /* hp is 0; need to set length to match AF of vn */
                       new->prefix.length =
@@ -1976,7 +1976,7 @@ rfapiRibPreload (
               continue;
             }
 
-          afi = AFI_ETHER;
+          afi = AFI_L2VPN;
           rfapiL2o2Qprefix (pL2o, &pfx);
         }
       else
@@ -2181,7 +2181,7 @@ rfapiRibPendingDeleteRoute (
   vnc_zlog_debug_verbose ("%s: entry, it=%p, afi=%d, it_node=%p, pfx=%s",
               __func__, it, afi, it_node, buf);
 
-  if (AFI_ETHER == afi)
+  if (AFI_L2VPN == afi)
     {
       /*
        * ethernet import tables are per-LNI and each ethernet monitor 
index 997f1d3c3423d664dfff9c23ce19a41f08f20011..be7fbc63a25737688c7f9e54ee257f4e73df8766 100644 (file)
@@ -1329,7 +1329,7 @@ rfapiShowRemoteRegistrationsIt (
   int                          show_local,
   int                          show_remote,
   int                          show_imported,  /* either/or */
-  uint32_t                     *pLni)          /* AFI_ETHER only */
+  uint32_t                     *pLni)          /* AFI_L2VPN only */
 {
   afi_t afi;
   int printed_rtlist_hdr = 0;