diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2016-11-02 15:16:58 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2016-11-28 19:18:35 +0100 |
commit | 5f3d1bdf3ce8ac030831ee8c4dd6655ce5172431 (patch) | |
tree | 2034308ec570033e1dde8cd6e7a4e0376f8baf0f /zebra | |
parent | lib: convert vrf code to use red-black trees as well (diff) | |
download | frr-5f3d1bdf3ce8ac030831ee8c4dd6655ce5172431.tar.xz frr-5f3d1bdf3ce8ac030831ee8c4dd6655ce5172431.zip |
*: rename two vrf functions
Since VRFs can be searched by vrf_id or name, make this explicit in the
helper functions.
s/vrf_lookup/vrf_lookup_by_id/
s/zebra_vrf_lookup/zebra_vrf_lookup_by_id/
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/if_netlink.c | 4 | ||||
-rw-r--r-- | zebra/interface.c | 4 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 4 | ||||
-rw-r--r-- | zebra/zebra_rnh.c | 4 | ||||
-rw-r--r-- | zebra/zebra_static.c | 2 | ||||
-rw-r--r-- | zebra/zebra_vrf.c | 4 | ||||
-rw-r--r-- | zebra/zebra_vrf.h | 2 | ||||
-rw-r--r-- | zebra/zserv.c | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index c44219a49..abf1c781a 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -211,7 +211,7 @@ netlink_vrf_change (struct nlmsghdr *h, struct rtattr *tb, const char *name) /* If VRF already exists, we just return; status changes are handled * against the VRF "interface". */ - vrf = vrf_lookup ((vrf_id_t)ifi->ifi_index); + vrf = vrf_lookup_by_id ((vrf_id_t)ifi->ifi_index); if (vrf && vrf->info) return; @@ -250,7 +250,7 @@ netlink_vrf_change (struct nlmsghdr *h, struct rtattr *tb, const char *name) if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug ("RTM_DELLINK for VRF %s(%u)", name, ifi->ifi_index); - vrf = vrf_lookup ((vrf_id_t)ifi->ifi_index); + vrf = vrf_lookup_by_id ((vrf_id_t)ifi->ifi_index); if (!vrf) { diff --git a/zebra/interface.c b/zebra/interface.c index 75040a87f..d5d6ffd9f 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1038,7 +1038,7 @@ if_dump_vty (struct vty *vty, struct interface *ifp) zebra_ptm_show_status(vty, ifp); - vrf = vrf_lookup(ifp->vrf_id); + vrf = vrf_lookup_by_id (ifp->vrf_id); vty_out (vty, " vrf: %s%s", vrf->name, VTY_NEWLINE); if (ifp->desc) @@ -2833,7 +2833,7 @@ if_config_write (struct vty *vty) struct vrf *vrf; if_data = ifp->info; - vrf = vrf_lookup(ifp->vrf_id); + vrf = vrf_lookup_by_id (ifp->vrf_id); if (ifp->vrf_id == VRF_DEFAULT) vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index ec7d1e7fd..9d9b10457 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2152,7 +2152,7 @@ rib_meta_queue_add (struct meta_queue *mq, struct route_node *rn) rnode_debug (rn, rib->vrf_id, "queued rn %p into sub-queue %u", (void *)rn, qindex); - zvrf = zebra_vrf_lookup (rib->vrf_id); + zvrf = zebra_vrf_lookup_by_id (rib->vrf_id); if (zvrf) zvrf->flags |= ZEBRA_VRF_RIB_SCHEDULED; } @@ -3209,7 +3209,7 @@ vrf_id_get_next (vrf_id_t vrf_id, vrf_id_t *next_id_p) { struct vrf *vrf; - vrf = vrf_lookup (vrf_id); + vrf = vrf_lookup_by_id (vrf_id); if (vrf) { vrf = RB_NEXT (vrf_id_head, &vrfs_by_id, vrf); diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index 8df9277cb..7df759030 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -57,7 +57,7 @@ static void copy_state(struct rnh *rnh, struct rib *rib, ({ \ struct zebra_vrf *zvrf; \ struct route_table *t = NULL; \ - zvrf = zebra_vrf_lookup(v); \ + zvrf = zebra_vrf_lookup_by_id(v); \ if (zvrf) \ t = zvrf->rnh_table[family2afi(f)]; \ t; \ @@ -77,7 +77,7 @@ static inline struct route_table *get_rnh_table(vrf_id_t vrfid, int family, struct zebra_vrf *zvrf; struct route_table *t = NULL; - zvrf = zebra_vrf_lookup(vrfid); + zvrf = zebra_vrf_lookup_by_id(vrfid); if (zvrf) switch (type) { diff --git a/zebra/zebra_static.c b/zebra/zebra_static.c index 298fc4e09..32ba90ef9 100644 --- a/zebra/zebra_static.c +++ b/zebra/zebra_static.c @@ -129,7 +129,7 @@ static_install_route (afi_t afi, safi_t safi, struct prefix *p, struct static_ro rib->metric = 0; rib->mtu = 0; rib->vrf_id = si->vrf_id; - rib->table = si->vrf_id ? (zebra_vrf_lookup(si->vrf_id))->table_id : zebrad.rtm_table_default; + rib->table = si->vrf_id ? (zebra_vrf_lookup_by_id(si->vrf_id))->table_id : zebrad.rtm_table_default; rib->nexthop_num = 0; rib->tag = si->tag; diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index 4c1bbbb1a..fbb41eb5a 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -120,7 +120,7 @@ zebra_vrf_static_route_interface_fixup (struct interface *ifp) { afi_t afi; safi_t safi; - struct zebra_vrf *zvrf = zebra_vrf_lookup (ifp->vrf_id); + struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id (ifp->vrf_id); struct route_table *stable = NULL; struct route_node *rn = NULL; struct static_route *si = NULL; @@ -338,7 +338,7 @@ zebra_vrf_alloc (vrf_id_t vrf_id, const char *name) /* Lookup VRF by identifier. */ struct zebra_vrf * -zebra_vrf_lookup (vrf_id_t vrf_id) +zebra_vrf_lookup_by_id (vrf_id_t vrf_id) { return vrf_info_lookup (vrf_id); } diff --git a/zebra/zebra_vrf.h b/zebra/zebra_vrf.h index 8dffe27dc..c7814e6c9 100644 --- a/zebra/zebra_vrf.h +++ b/zebra/zebra_vrf.h @@ -92,7 +92,7 @@ zebra_vrf_table_with_table_id (afi_t afi, safi_t safi, extern void zebra_vrf_static_route_interface_fixup (struct interface *ifp); extern void zebra_vrf_update_all (struct zserv *client); -extern struct zebra_vrf *zebra_vrf_lookup (vrf_id_t vrf_id); +extern struct zebra_vrf *zebra_vrf_lookup_by_id (vrf_id_t vrf_id); extern struct zebra_vrf *zebra_vrf_list_lookup_by_name (const char *); extern struct zebra_vrf *zebra_vrf_alloc (vrf_id_t, const char *); extern struct route_table *zebra_vrf_table (afi_t, safi_t, vrf_id_t); diff --git a/zebra/zserv.c b/zebra/zserv.c index 76fdebb3a..947e7324d 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -1935,7 +1935,7 @@ zebra_client_read (struct thread *thread) client->last_read_time = quagga_monotime(); client->last_read_cmd = command; - zvrf = zebra_vrf_lookup (vrf_id); + zvrf = zebra_vrf_lookup_by_id (vrf_id); if (!zvrf) { if (IS_ZEBRA_DEBUG_PACKET && IS_ZEBRA_DEBUG_RECV) |