]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd rfapi: add NVE/VRF name to show vnc registrations
authorLou Berger <lberger@labn.net>
Sat, 14 Jan 2017 17:09:12 +0000 (12:09 -0500)
committerLou Berger <lberger@labn.net>
Mon, 23 Jan 2017 01:55:08 +0000 (20:55 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/rfapi/bgp_rfapi_cfg.c
bgpd/rfapi/rfapi_backend.h
bgpd/rfapi/rfapi_import.c
bgpd/rfapi/rfapi_import.h
bgpd/rfapi/rfapi_vty.c

index a2b0be3cc6cebdc95f2e593b6526b24893a8e2f5..10b365c1c87f2b8dbed6a4a2f12c7ef9436933df 100644 (file)
@@ -2463,7 +2463,7 @@ DEFUN (vnc_nve_group,
           rfg->rt_import_list =
             ecommunity_dup (bgp->rfapi_cfg->default_rt_import_list);
           rfg->rfapi_import_table =
-            rfapiImportTableRefAdd (bgp, rfg->rt_import_list);
+            rfapiImportTableRefAdd (bgp, rfg->rt_import_list, rfg);
         }
 
       /*
@@ -2903,7 +2903,7 @@ DEFUN (vnc_nve_group_rt_import,
    */
   if (rfg->rfapi_import_table)
     rfapiImportTableRefDelByIt (bgp, rfg->rfapi_import_table);
-  rfg->rfapi_import_table = rfapiImportTableRefAdd (bgp, rfg->rt_import_list);
+  rfg->rfapi_import_table = rfapiImportTableRefAdd (bgp, rfg->rt_import_list, rfg);
 
   if (is_export_bgp)
     vnc_direct_bgp_add_group (bgp, rfg);
@@ -3010,7 +3010,7 @@ DEFUN (vnc_nve_group_rt_both,
    */
   if (rfg->rfapi_import_table)
     rfapiImportTableRefDelByIt (bgp, rfg->rfapi_import_table);
-  rfg->rfapi_import_table = rfapiImportTableRefAdd (bgp, rfg->rt_import_list);
+  rfg->rfapi_import_table = rfapiImportTableRefAdd (bgp, rfg->rt_import_list, rfg);
 
   if (is_export_bgp)
     vnc_direct_bgp_add_group (bgp, rfg);
@@ -3494,7 +3494,7 @@ DEFUN (vnc_vrf_policy_rt_import,
    */
   if (rfg->rfapi_import_table)
     rfapiImportTableRefDelByIt (bgp, rfg->rfapi_import_table);
-  rfg->rfapi_import_table = rfapiImportTableRefAdd (bgp, rfg->rt_import_list);
+  rfg->rfapi_import_table = rfapiImportTableRefAdd (bgp, rfg->rt_import_list, rfg);
 
   if (is_export_bgp)
     vnc_direct_bgp_add_group (bgp, rfg);
@@ -3613,7 +3613,7 @@ DEFUN (vnc_vrf_policy_rt_both,
    */
   if (rfg->rfapi_import_table)
     rfapiImportTableRefDelByIt (bgp, rfg->rfapi_import_table);
-  rfg->rfapi_import_table = rfapiImportTableRefAdd (bgp, rfg->rt_import_list);
+  rfg->rfapi_import_table = rfapiImportTableRefAdd (bgp, rfg->rt_import_list, rfg);
 
   if (is_export_bgp)
     vnc_direct_bgp_add_group (bgp, rfg);
index 788ec73751d3dd5c1730379208daf3bb9af4cde8..9e5b0dc5cb51aeceaa6d788b20ac3a97cfd93bcb 100644 (file)
@@ -36,15 +36,6 @@ extern void rfapi_delete (struct bgp *);
 struct rfapi *bgp_rfapi_new (struct bgp *bgp);
 void bgp_rfapi_destroy (struct bgp *bgp, struct rfapi *h);
 
-struct rfapi_import_table *rfapiImportTableRefAdd (struct bgp *bgp,
-                                                   struct ecommunity
-                                                   *rt_import_list);
-
-void
-rfapiImportTableRefDelByIt (struct bgp *bgp,
-                            struct rfapi_import_table *it_target);
-
-
 extern void
 rfapiProcessUpdate (struct peer *peer,
                     void *rfd,
index 5ba98e55d078a34928f12beb3db5a456d0080188..235992d5bf55f7f82d5e928f0f294a8d7be43681 100644 (file)
@@ -4644,7 +4644,8 @@ bgp_rfapi_destroy (struct bgp *bgp, struct rfapi *h)
 }
 
 struct rfapi_import_table *
-rfapiImportTableRefAdd (struct bgp *bgp, struct ecommunity *rt_import_list)
+rfapiImportTableRefAdd (struct bgp *bgp, struct ecommunity *rt_import_list,
+                        struct rfapi_nve_group_cfg *rfg)
 {
   struct rfapi *h;
   struct rfapi_import_table *it;
@@ -4670,6 +4671,7 @@ rfapiImportTableRefAdd (struct bgp *bgp, struct ecommunity *rt_import_list)
       h->imports = it;
 
       it->rt_import_list = ecommunity_dup (rt_import_list);
+      it->rfg = rfg;
       it->monitor_exterior_orphans =
         skiplist_new (0, NULL, (void (*)(void *)) prefix_free);
 
index 51afa0002f5a8f905c696c29a124a35515960cb2..3ba76539dddb9eb746d986ec0048a24507e7ae5d 100644 (file)
@@ -38,6 +38,7 @@
 struct rfapi_import_table
 {
   struct rfapi_import_table *next;
+  struct rfapi_nve_group_cfg *rfg;
   struct ecommunity *rt_import_list;    /* copied from nve grp */
   int refcount;                 /* nve grps and nves */
   uint32_t l2_logical_net_id;   /* L2 only: EVPN Eth Seg Id */
@@ -90,6 +91,11 @@ rfapiShowImportTable (
   struct route_table   *rt,
   int                  isvpn);
 
+extern struct rfapi_import_table *
+rfapiImportTableRefAdd (
+  struct bgp *bgp,
+  struct ecommunity *rt_import_list,
+  struct rfapi_nve_group_cfg *rfg);
 
 extern void
 rfapiImportTableRefDelByIt (
index f8142ed299c0e199d805a93163f804cce79957f9..7fbfae2951ae5d39051c488281f13c9e800f76a8 100644 (file)
@@ -1446,17 +1446,24 @@ rfapiShowRemoteRegistrationsIt (
 
                   if (pLni)
                     {
-                      fp (out, "%s[%s] L2VPN Network 0x%x (%u) RT={%s}%s",
-                          HVTY_NEWLINE, type, *pLni, (*pLni & 0xfff), s,
-                          HVTY_NEWLINE);
+                      fp (out, "%s[%s] L2VPN Network 0x%x (%u) RT={%s}",
+                          HVTY_NEWLINE, type, *pLni, (*pLni & 0xfff), s);
                     }
                   else
                     {
-                      fp (out, "%s[%s] Prefix RT={%s}%s",
-                          HVTY_NEWLINE, type, s, HVTY_NEWLINE);
+                      fp (out, "%s[%s] Prefix RT={%s}",
+                          HVTY_NEWLINE, type, s);
                     }
                   XFREE (MTYPE_ECOMMUNITY_STR, s);
 
+                  if (it->rfg && it->rfg->name)
+                    {
+                      fp (out, " %s \"%s\"",
+                          (it->rfg->type == RFAPI_GROUP_CFG_VRF ? 
+                           "VRF" : "NVE group"),
+                          it->rfg->name);
+                    }
+                  fp (out, "%s", HVTY_NEWLINE);
                   if (show_expiring)
                     {
 #if RFAPI_REGISTRATIONS_REPORT_AGE