diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-10-02 22:41:30 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-10-09 20:14:25 +0200 |
commit | 4b7e60662595e43aaf41046746fcaa97d17abb5d (patch) | |
tree | 0d991048b7b8e4d1a773141711f75173fee14059 /bgpd/bgp_routemap.c | |
parent | bgpd: Convert BGP_INFO_XXX to BGP_PATH_XXX (diff) | |
download | frr-4b7e60662595e43aaf41046746fcaa97d17abb5d.tar.xz frr-4b7e60662595e43aaf41046746fcaa97d17abb5d.zip |
bgpd: Convert `struct bgp_info` to `struct bgp_path_info`
Do a straight conversion of `struct bgp_info` to `struct bgp_path_info`.
This commit will setup the rename of variables as well.
This is being done because `struct bgp_info` is not descriptive
of what this data actually is. It is path information for routes
that we keep to build the actual routes nexthops plus some extra
information.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_routemap.c')
-rw-r--r-- | bgpd/bgp_routemap.c | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 0a3e4b3c8..f6eae653a 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -251,7 +251,7 @@ static route_map_result_t route_match_peer(void *rule, if (type == RMAP_BGP) { pc = rule; su = &pc->su; - peer = ((struct bgp_info *)object)->peer; + peer = ((struct bgp_path_info *)object)->peer; if (pc->interface) { if (!peer->conf_if) @@ -341,7 +341,7 @@ static route_map_result_t route_match_command(void *rule, u_int32_t locpref = 0; u_int32_t newlocpref = 0; enum lua_rm_status lrm_status; - struct bgp_info *info = (struct bgp_info *)object; + struct bgp_path_info *info = (struct bgp_path_info *)object; lua_State *L = lua_initialize("/etc/frr/lua.scr"); if (L == NULL) @@ -477,7 +477,7 @@ static route_map_result_t route_match_ip_next_hop(void *rule, void *object) { struct access_list *alist; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct prefix_ipv4 p; if (type == RMAP_BGP && prefix->family == AF_INET) { @@ -524,7 +524,7 @@ static route_map_result_t route_match_ip_route_source(void *rule, void *object) { struct access_list *alist; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct peer *peer; struct prefix_ipv4 p; @@ -610,7 +610,7 @@ route_match_ip_next_hop_prefix_list(void *rule, const struct prefix *prefix, route_map_object_t type, void *object) { struct prefix_list *plist; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct prefix_ipv4 p; if (type == RMAP_BGP && prefix->family == AF_INET) { @@ -651,10 +651,10 @@ static route_map_result_t route_match_ip_next_hop_type(void *rule, const struct prefix *prefix, route_map_object_t type, void *object) { - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP && prefix->family == AF_INET) { - bgp_info = (struct bgp_info *)object; + bgp_info = (struct bgp_path_info *)object; if (!bgp_info || !bgp_info->attr) return RMAP_DENYMATCH; @@ -692,7 +692,7 @@ route_match_ip_route_source_prefix_list(void *rule, route_map_object_t type, void *object) { struct prefix_list *plist; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct peer *peer; struct prefix_ipv4 p; @@ -810,11 +810,11 @@ static route_map_result_t route_match_vni(void *rule, route_map_object_t type, void *object) { vni_t vni = 0; - struct bgp_info *bgp_info = NULL; + struct bgp_path_info *bgp_info = NULL; if (type == RMAP_BGP) { vni = *((vni_t *)rule); - bgp_info = (struct bgp_info *)object; + bgp_info = (struct bgp_path_info *)object; if (bgp_info->extra == NULL) return RMAP_NOMATCH; @@ -914,7 +914,7 @@ static route_map_result_t route_match_local_pref(void *rule, void *object) { uint32_t *local_pref; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { local_pref = rule; @@ -974,7 +974,7 @@ static route_map_result_t route_match_metric(void *rule, void *object) { struct rmap_value *rv; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { rv = rule; @@ -999,7 +999,7 @@ static route_map_result_t route_match_aspath(void *rule, { struct as_list *as_list; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { as_list = as_list_lookup((char *)rule); @@ -1047,7 +1047,7 @@ static route_map_result_t route_match_community(void *rule, void *object) { struct community_list *list; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct rmap_community *rcom; if (type == RMAP_BGP) { @@ -1115,7 +1115,7 @@ static route_map_result_t route_match_lcommunity(void *rule, void *object) { struct community_list *list; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct rmap_community *rcom; if (type == RMAP_BGP) { @@ -1176,7 +1176,7 @@ static route_map_result_t route_match_ecommunity(void *rule, void *object) { struct community_list *list; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { bgp_info = object; @@ -1219,7 +1219,7 @@ static route_map_result_t route_match_origin(void *rule, void *object) { uint8_t *origin; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { origin = rule; @@ -1322,7 +1322,7 @@ static route_map_result_t route_match_interface(void *rule, void *object) { struct interface *ifp; - struct bgp_info *info; + struct bgp_path_info *info; if (type == RMAP_BGP) { info = object; @@ -1368,7 +1368,7 @@ static route_map_result_t route_match_tag(void *rule, route_map_object_t type, void *object) { route_tag_t *tag; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { tag = rule; @@ -1402,7 +1402,7 @@ static route_map_result_t route_set_ip_nexthop(void *rule, void *object) { struct rmap_ip_nexthop_set *rins = rule; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct peer *peer; if (type == RMAP_BGP) { @@ -1510,7 +1510,7 @@ static route_map_result_t route_set_local_pref(void *rule, void *object) { struct rmap_value *rv; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; uint32_t locpref = 0; if (type == RMAP_BGP) { @@ -1545,7 +1545,7 @@ static route_map_result_t route_set_weight(void *rule, void *object) { struct rmap_value *rv; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { /* Fetch routemap's rule information. */ @@ -1574,7 +1574,7 @@ static route_map_result_t route_set_metric(void *rule, void *object) { struct rmap_value *rv; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; uint32_t med = 0; if (type == RMAP_BGP) { @@ -1608,7 +1608,7 @@ static route_map_result_t route_set_aspath_prepend(void *rule, { struct aspath *aspath; struct aspath *new; - struct bgp_info *binfo; + struct bgp_path_info *binfo; if (type == RMAP_BGP) { binfo = object; @@ -1670,7 +1670,7 @@ static route_map_result_t route_set_aspath_exclude(void *rule, void *object) { struct aspath *new_path, *exclude_path; - struct bgp_info *binfo; + struct bgp_path_info *binfo; if (type == RMAP_BGP) { exclude_path = rule; @@ -1705,7 +1705,7 @@ static route_map_result_t route_set_community(void *rule, void *object) { struct rmap_com_set *rcs; - struct bgp_info *binfo; + struct bgp_path_info *binfo; struct attr *attr; struct community *new = NULL; struct community *old; @@ -1821,7 +1821,7 @@ static route_map_result_t route_set_lcommunity(void *rule, void *object) { struct rmap_lcom_set *rcs; - struct bgp_info *binfo; + struct bgp_path_info *binfo; struct attr *attr; struct lcommunity *new = NULL; struct lcommunity *old; @@ -1937,7 +1937,7 @@ static route_map_result_t route_set_lcommunity_delete(void *rule, struct lcommunity *merge; struct lcommunity *new; struct lcommunity *old; - struct bgp_info *binfo; + struct bgp_path_info *binfo; if (type == RMAP_BGP) { if (!rule) @@ -2022,7 +2022,7 @@ static route_map_result_t route_set_community_delete( struct community *merge; struct community *new; struct community *old; - struct bgp_info *binfo; + struct bgp_path_info *binfo; if (type == RMAP_BGP) { if (!rule) @@ -2104,7 +2104,7 @@ static route_map_result_t route_set_ecommunity(void *rule, struct ecommunity *ecom; struct ecommunity *new_ecom; struct ecommunity *old_ecom; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { ecom = rule; @@ -2190,7 +2190,7 @@ static route_map_result_t route_set_origin(void *rule, void *object) { uint8_t *origin; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { origin = rule; @@ -2239,7 +2239,7 @@ static route_map_result_t route_set_atomic_aggregate(void *rule, route_map_object_t type, void *object) { - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { bgp_info = object; @@ -2279,7 +2279,7 @@ static route_map_result_t route_set_aggregator_as(void *rule, route_map_object_t type, void *object) { - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct aggregator *aggregator; if (type == RMAP_BGP) { @@ -2327,13 +2327,13 @@ struct route_map_rule_cmd route_set_aggregator_as_cmd = { route_set_aggregator_as_compile, route_set_aggregator_as_free, }; -/* Set tag to object. object must be pointer to struct bgp_info */ +/* Set tag to object. object must be pointer to struct bgp_path_info */ static route_map_result_t route_set_tag(void *rule, const struct prefix *prefix, route_map_object_t type, void *object) { route_tag_t *tag; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { tag = rule; @@ -2352,14 +2352,14 @@ static struct route_map_rule_cmd route_set_tag_cmd = { route_map_rule_tag_free, }; -/* Set label-index to object. object must be pointer to struct bgp_info */ +/* Set label-index to object. object must be pointer to struct bgp_path_info */ static route_map_result_t route_set_label_index(void *rule, const struct prefix *prefix, route_map_object_t type, void *object) { struct rmap_value *rv; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; uint32_t label_index; if (type == RMAP_BGP) { @@ -2429,7 +2429,7 @@ static route_map_result_t route_match_ipv6_next_hop(void *rule, void *object) { struct in6_addr *addr = rule; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { bgp_info = object; @@ -2514,11 +2514,11 @@ static route_map_result_t route_match_ipv6_next_hop_type(void *rule, const struct prefix *prefix, route_map_object_t type, void *object) { - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct in6_addr *addr = rule; if (type == RMAP_BGP && prefix->family == AF_INET6) { - bgp_info = (struct bgp_info *)object; + bgp_info = (struct bgp_path_info *)object; if (!bgp_info || !bgp_info->attr) return RMAP_DENYMATCH; @@ -2564,7 +2564,7 @@ static route_map_result_t route_set_ipv6_nexthop_global(void *rule, void *object) { struct in6_addr *address; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { /* Fetch routemap's rule information. */ @@ -2622,7 +2622,7 @@ static route_map_result_t route_set_ipv6_nexthop_prefer_global(void *rule, const struct prefix *prefix, route_map_object_t type, void *object) { - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct peer *peer; if (type == RMAP_BGP) { @@ -2678,7 +2678,7 @@ static route_map_result_t route_set_ipv6_nexthop_local(void *rule, void *object) { struct in6_addr *address; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { /* Fetch routemap's rule information. */ @@ -2741,7 +2741,7 @@ static route_map_result_t route_set_ipv6_nexthop_peer(void *rule, void *object) { struct in6_addr peer_address; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; struct peer *peer; if (type == RMAP_BGP) { @@ -2820,7 +2820,7 @@ static route_map_result_t route_set_vpnv4_nexthop(void *rule, void *object) { struct in_addr *address; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { /* Fetch routemap's rule information. */ @@ -2860,7 +2860,7 @@ static route_map_result_t route_set_vpnv6_nexthop(void *rule, void *object) { struct in6_addr *address; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { /* Fetch routemap's rule information. */ @@ -2916,7 +2916,7 @@ static route_map_result_t route_set_originator_id(void *rule, void *object) { struct in_addr *address; - struct bgp_info *bgp_info; + struct bgp_path_info *bgp_info; if (type == RMAP_BGP) { address = rule; |