mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 10:54:47 +00:00
commit
bac7b7b935
@ -1480,8 +1480,7 @@ bgp_attr_as4_path (struct bgp_attr_parser_args *args, struct aspath **as4_path)
|
||||
}
|
||||
|
||||
/* Set aspath attribute flag. */
|
||||
if (as4_path)
|
||||
attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_AS4_PATH);
|
||||
attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_AS4_PATH);
|
||||
|
||||
return BGP_ATTR_PARSE_PROCEED;
|
||||
}
|
||||
|
@ -1158,16 +1158,13 @@ extcommunity_list_set (struct community_list_handler *ch,
|
||||
}
|
||||
}
|
||||
|
||||
if (str)
|
||||
{
|
||||
if (style == EXTCOMMUNITY_LIST_STANDARD)
|
||||
ecom = ecommunity_str2com (str, 0, 1);
|
||||
else
|
||||
regex = bgp_regcomp (str);
|
||||
if (style == EXTCOMMUNITY_LIST_STANDARD)
|
||||
ecom = ecommunity_str2com (str, 0, 1);
|
||||
else
|
||||
regex = bgp_regcomp (str);
|
||||
|
||||
if (! ecom && ! regex)
|
||||
return COMMUNITY_LIST_ERR_MALFORMED_VAL;
|
||||
}
|
||||
if (! ecom && ! regex)
|
||||
return COMMUNITY_LIST_ERR_MALFORMED_VAL;
|
||||
|
||||
if (ecom)
|
||||
ecom->str = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_DISPLAY, 0);
|
||||
@ -1180,8 +1177,7 @@ extcommunity_list_set (struct community_list_handler *ch,
|
||||
entry->config = ecommunity_ecom2str (ecom, ECOMMUNITY_FORMAT_COMMUNITY_LIST, 0);
|
||||
else if (regex)
|
||||
entry->config = XSTRDUP (MTYPE_COMMUNITY_LIST_CONFIG, str);
|
||||
else
|
||||
entry->config = NULL;
|
||||
|
||||
entry->u.ecom = ecom;
|
||||
entry->reg = regex;
|
||||
|
||||
|
@ -626,7 +626,7 @@ bgp_dump_parse_time (const char *str)
|
||||
return 0;
|
||||
total += time * 60;
|
||||
time = 0;
|
||||
seen_h = 1;
|
||||
seen_m = 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
@ -327,22 +327,15 @@ bgp_vrf_disable (struct vrf *vrf)
|
||||
static void
|
||||
bgp_vrf_init (void)
|
||||
{
|
||||
vrf_add_hook (VRF_NEW_HOOK, bgp_vrf_new);
|
||||
vrf_add_hook (VRF_ENABLE_HOOK, bgp_vrf_enable);
|
||||
vrf_add_hook (VRF_DISABLE_HOOK, bgp_vrf_disable);
|
||||
vrf_add_hook (VRF_DELETE_HOOK, bgp_vrf_delete);
|
||||
|
||||
vrf_init ();
|
||||
vrf_init (bgp_vrf_new,
|
||||
bgp_vrf_enable,
|
||||
bgp_vrf_disable,
|
||||
bgp_vrf_delete);
|
||||
}
|
||||
|
||||
static void
|
||||
bgp_vrf_terminate (void)
|
||||
{
|
||||
vrf_add_hook (VRF_NEW_HOOK, NULL);
|
||||
vrf_add_hook (VRF_ENABLE_HOOK, NULL);
|
||||
vrf_add_hook (VRF_DISABLE_HOOK, NULL);
|
||||
vrf_add_hook (VRF_DELETE_HOOK, NULL);
|
||||
|
||||
vrf_terminate ();
|
||||
}
|
||||
|
||||
|
@ -8887,6 +8887,7 @@ bgp_show_community (struct vty *vty, struct bgp *bgp, int argc,
|
||||
int i;
|
||||
char *str;
|
||||
int first = 0;
|
||||
int ret = 0;
|
||||
|
||||
b = buffer_new (1024);
|
||||
for (i = 0; i < argc; i++)
|
||||
@ -8915,9 +8916,12 @@ bgp_show_community (struct vty *vty, struct bgp *bgp, int argc,
|
||||
return CMD_WARNING;
|
||||
}
|
||||
|
||||
return bgp_show (vty, bgp, afi, safi,
|
||||
(exact ? bgp_show_type_community_exact :
|
||||
bgp_show_type_community), com, 0);
|
||||
ret = bgp_show (vty, bgp, afi, safi,
|
||||
(exact ? bgp_show_type_community_exact :
|
||||
bgp_show_type_community), com, 0);
|
||||
community_free (com);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
|
19
bgpd/bgpd.c
19
bgpd/bgpd.c
@ -94,7 +94,6 @@ struct community_list_handler *bgp_clist;
|
||||
|
||||
unsigned int multipath_num = MULTIPATH_NUM;
|
||||
|
||||
static void bgp_if_init (struct bgp *bgp);
|
||||
static void bgp_if_finish (struct bgp *bgp);
|
||||
|
||||
extern struct zclient *zclient;
|
||||
@ -3115,10 +3114,7 @@ bgp_get (struct bgp **bgp_val, as_t *as, const char *name,
|
||||
|
||||
vrf = bgp_vrf_lookup_by_instance_type (bgp);
|
||||
if (vrf)
|
||||
{
|
||||
bgp_vrf_link (bgp, vrf);
|
||||
bgp_if_init (bgp);
|
||||
}
|
||||
bgp_vrf_link (bgp, vrf);
|
||||
}
|
||||
|
||||
/* Register with Zebra, if needed */
|
||||
@ -7654,19 +7650,6 @@ bgp_master_init (struct thread_master *master)
|
||||
QOBJ_REG (bm, bgp_master);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize interface list for instance, if needed. Invoked upon
|
||||
* instance create.
|
||||
*/
|
||||
static void
|
||||
bgp_if_init (struct bgp *bgp)
|
||||
{
|
||||
if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
|
||||
return;
|
||||
|
||||
vrf_iflist_create (bgp->vrf_id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free up connected routes and interfaces for a BGP instance. Invoked upon
|
||||
* instance delete (non-default only) or BGP exit.
|
||||
|
@ -309,10 +309,16 @@ show_ip_eigrp_topology_header (struct vty *vty, struct eigrp *eigrp)
|
||||
void
|
||||
show_ip_eigrp_prefix_entry (struct vty *vty, struct eigrp_prefix_entry *tn)
|
||||
{
|
||||
struct list *successors = eigrp_topology_get_successor(tn);
|
||||
|
||||
vty_out (vty, "%-3c",(tn->state > 0) ? 'A' : 'P');
|
||||
vty_out (vty, "%s/%u, ",inet_ntoa (tn->destination_ipv4->prefix),tn->destination_ipv4->prefixlen);
|
||||
vty_out (vty, "%u successors, ",eigrp_topology_get_successor(tn)->count);
|
||||
vty_out (vty, "FD is %u, serno: %" PRIu64 " %s",tn->fdistance, tn->serno, VTY_NEWLINE);
|
||||
|
||||
vty_out (vty, "%s/%u, ",
|
||||
inet_ntoa (tn->destination_ipv4->prefix), tn->destination_ipv4->prefixlen);
|
||||
vty_out (vty, "%u successors, ", successors->count);
|
||||
vty_out (vty, "FD is %u, serno: %" PRIu64 " %s", tn->fdistance, tn->serno, VTY_NEWLINE);
|
||||
|
||||
list_delete(successors);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -82,7 +82,6 @@ eigrp_distribute_update (struct distribute *dist)
|
||||
if (dist->list[DISTRIBUTE_V4_IN])
|
||||
{
|
||||
alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_IN]);
|
||||
zlog_info("<DEBUG DISTRIBUTE ACL IN FOUND: %s",alist->name);
|
||||
if (alist)
|
||||
e->list[EIGRP_FILTER_IN] = alist;
|
||||
else
|
||||
@ -96,7 +95,6 @@ eigrp_distribute_update (struct distribute *dist)
|
||||
/* access list OUT for whole process */
|
||||
if (dist->list[DISTRIBUTE_V4_OUT])
|
||||
{
|
||||
zlog_info("<DEBUG DISTRIBUTE ACL OUT FOUND: %s",dist->list[DISTRIBUTE_V4_OUT]);
|
||||
alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_OUT]);
|
||||
if (alist)
|
||||
e->list[EIGRP_FILTER_OUT] = alist;
|
||||
@ -111,7 +109,6 @@ eigrp_distribute_update (struct distribute *dist)
|
||||
/* PREFIX_LIST IN for process */
|
||||
if (dist->prefix[DISTRIBUTE_V4_IN])
|
||||
{
|
||||
zlog_info("<DEBUG DISTRIBUTE PREFIX IN FOUND: %s",dist->prefix[DISTRIBUTE_V4_IN]);
|
||||
plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_V4_IN]);
|
||||
if (plist)
|
||||
{
|
||||
@ -125,7 +122,6 @@ eigrp_distribute_update (struct distribute *dist)
|
||||
/* PREFIX_LIST OUT for process */
|
||||
if (dist->prefix[DISTRIBUTE_V4_OUT])
|
||||
{
|
||||
zlog_info("<DEBUG DISTRIBUTE PREFIX OUT FOUND: %s",dist->prefix[DISTRIBUTE_V4_OUT]);
|
||||
plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_V4_OUT]);
|
||||
if (plist)
|
||||
{
|
||||
@ -191,8 +187,6 @@ eigrp_distribute_update (struct distribute *dist)
|
||||
if (ifp == NULL)
|
||||
return;
|
||||
|
||||
zlog_info("<DEBUG ACL 2");
|
||||
|
||||
/*struct eigrp_if_info * info = ifp->info;
|
||||
ei = info->eigrp_interface;*/
|
||||
struct listnode *node, *nnode;
|
||||
@ -206,15 +200,9 @@ eigrp_distribute_update (struct distribute *dist)
|
||||
}
|
||||
}
|
||||
|
||||
if(ei == NULL)
|
||||
{
|
||||
zlog_info("Not Found eigrp interface %s",ifp->name);
|
||||
}
|
||||
|
||||
/* Access-list for interface in */
|
||||
if (dist->list[DISTRIBUTE_V4_IN])
|
||||
{
|
||||
zlog_info("<DEBUG ACL in");
|
||||
alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_IN]);
|
||||
if (alist){
|
||||
ei->list[EIGRP_FILTER_IN] = alist;
|
||||
@ -238,10 +226,7 @@ eigrp_distribute_update (struct distribute *dist)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ei->list[EIGRP_FILTER_OUT] = NULL;
|
||||
zlog_info("<DEBUG ACL out else");
|
||||
}
|
||||
ei->list[EIGRP_FILTER_OUT] = NULL;
|
||||
|
||||
/* Prefix-list for interface in */
|
||||
if (dist->prefix[DISTRIBUTE_V4_IN])
|
||||
|
@ -251,7 +251,8 @@ eigrp_peer_termination_decode (struct eigrp_neighbor *nbr,
|
||||
if(my_ip == received_ip)
|
||||
{
|
||||
zlog_info ("Neighbor %s (%s) is down: Peer Termination received",
|
||||
inet_ntoa (nbr->src),ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT));
|
||||
inet_ntoa (nbr->src),
|
||||
ifindex2ifname (nbr->ei->ifp->ifindex, VRF_DEFAULT));
|
||||
/* set neighbor to DOWN */
|
||||
nbr->state = EIGRP_NEIGHBOR_DOWN;
|
||||
/* delete neighbor */
|
||||
@ -363,14 +364,15 @@ eigrp_hello_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
||||
case EIGRP_TLV_SW_VERSION:
|
||||
eigrp_sw_version_decode(nbr, tlv_header);
|
||||
break;
|
||||
case EIGRP_TLV_NEXT_MCAST_SEQ:
|
||||
break;
|
||||
case EIGRP_TLV_NEXT_MCAST_SEQ:
|
||||
break;
|
||||
case EIGRP_TLV_PEER_TERMINATION:
|
||||
eigrp_peer_termination_decode(nbr, tlv_header);
|
||||
return;
|
||||
break;
|
||||
case EIGRP_TLV_PEER_MTRLIST:
|
||||
case EIGRP_TLV_PEER_TIDLIST:
|
||||
break;
|
||||
case EIGRP_TLV_PEER_TIDLIST:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -387,7 +389,8 @@ eigrp_hello_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
||||
{
|
||||
/* increment statistics. */
|
||||
ei->hello_in++;
|
||||
eigrp_nbr_state_update(nbr);
|
||||
if (nbr)
|
||||
eigrp_nbr_state_update(nbr);
|
||||
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,9 @@ eigrp_if_up (struct eigrp_interface *ei)
|
||||
{
|
||||
pe = eigrp_prefix_entry_new ();
|
||||
pe->serno = eigrp->serno;
|
||||
pe->destination_ipv4 = dest_addr;
|
||||
pe->destination_ipv4 = prefix_ipv4_new ();
|
||||
prefix_copy ((struct prefix *)pe->destination_ipv4,
|
||||
(struct prefix *)&dest_addr);
|
||||
pe->af = AF_INET;
|
||||
pe->nt = EIGRP_TOPOLOGY_TYPE_CONNECTED;
|
||||
|
||||
|
@ -181,7 +181,7 @@ main (int argc, char **argv, char **envp)
|
||||
eigrp_om->master = frr_init();
|
||||
master = eigrp_om->master;
|
||||
|
||||
vrf_init ();
|
||||
vrf_init (NULL, NULL, NULL, NULL);
|
||||
|
||||
/*EIGRPd init*/
|
||||
eigrp_if_init ();
|
||||
|
@ -113,7 +113,10 @@ eigrp_make_md5_digest (struct eigrp_interface *ei, struct stream *s, u_char flag
|
||||
if(keychain)
|
||||
key = key_lookup_for_send(keychain);
|
||||
else
|
||||
return EIGRP_AUTH_TYPE_NONE;
|
||||
{
|
||||
eigrp_authTLV_MD5_free(auth_TLV);
|
||||
return EIGRP_AUTH_TYPE_NONE;
|
||||
}
|
||||
|
||||
memset(&ctx, 0, sizeof(ctx));
|
||||
MD5Init(&ctx);
|
||||
@ -234,8 +237,7 @@ eigrp_check_md5_digest (struct stream *s,
|
||||
}
|
||||
|
||||
/* save neighbor's crypt_seqnum */
|
||||
if (nbr)
|
||||
nbr->crypt_seqnum = authTLV->key_sequence;
|
||||
nbr->crypt_seqnum = authTLV->key_sequence;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -627,7 +629,7 @@ eigrp_read (struct thread *thread)
|
||||
struct eigrp_packet *ep;
|
||||
|
||||
ep = eigrp_fifo_tail(nbr->retrans_queue);
|
||||
if (ep != NULL)
|
||||
if (ep)
|
||||
{
|
||||
if (ntohl(eigrph->ack) == ep->sequence_number)
|
||||
{
|
||||
@ -641,7 +643,7 @@ eigrp_read (struct thread *thread)
|
||||
eigrp_update_send_EOT(nbr);
|
||||
}
|
||||
ep = eigrp_fifo_pop_tail(nbr->retrans_queue);
|
||||
/*eigrp_packet_free(ep);*/
|
||||
eigrp_packet_free(ep);
|
||||
if (nbr->retrans_queue->count > 0)
|
||||
{
|
||||
eigrp_send_packet_reliably(nbr);
|
||||
@ -649,7 +651,7 @@ eigrp_read (struct thread *thread)
|
||||
}
|
||||
}
|
||||
ep = eigrp_fifo_tail(nbr->multicast_queue);
|
||||
if (ep != NULL)
|
||||
if (ep)
|
||||
{
|
||||
if (ntohl(eigrph->ack) == ep->sequence_number)
|
||||
{
|
||||
|
@ -113,16 +113,17 @@ eigrp_query_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
||||
type = stream_getw(s);
|
||||
if (type == EIGRP_TLV_IPv4_INT)
|
||||
{
|
||||
struct prefix_ipv4 dest_addr;
|
||||
|
||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||
|
||||
tlv = eigrp_read_ipv4_tlv(s);
|
||||
|
||||
struct prefix_ipv4 *dest_addr;
|
||||
dest_addr = prefix_ipv4_new();
|
||||
dest_addr->prefix = tlv->destination;
|
||||
dest_addr->prefixlen = tlv->prefix_length;
|
||||
dest_addr.family = AFI_IP;
|
||||
dest_addr.prefix = tlv->destination;
|
||||
dest_addr.prefixlen = tlv->prefix_length;
|
||||
struct eigrp_prefix_entry *dest =
|
||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
|
||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, &dest_addr);
|
||||
|
||||
/* If the destination exists (it should, but one never know)*/
|
||||
if (dest != NULL)
|
||||
|
@ -145,6 +145,8 @@ eigrp_send_reply (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
|
||||
{
|
||||
eigrp_send_packet_reliably(nbr);
|
||||
}
|
||||
|
||||
XFREE(MTYPE_EIGRP_PREFIX_ENTRY, pe2);
|
||||
}
|
||||
|
||||
/*EIGRP REPLY read function*/
|
||||
@ -179,16 +181,17 @@ eigrp_reply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
||||
type = stream_getw(s);
|
||||
if (type == EIGRP_TLV_IPv4_INT)
|
||||
{
|
||||
struct prefix_ipv4 dest_addr;
|
||||
|
||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||
|
||||
tlv = eigrp_read_ipv4_tlv(s);
|
||||
|
||||
struct prefix_ipv4 *dest_addr;
|
||||
dest_addr = prefix_ipv4_new();
|
||||
dest_addr->prefix = tlv->destination;
|
||||
dest_addr->prefixlen = tlv->prefix_length;
|
||||
dest_addr.family = AFI_IP;
|
||||
dest_addr.prefix = tlv->destination;
|
||||
dest_addr.prefixlen = tlv->prefix_length;
|
||||
struct eigrp_prefix_entry *dest =
|
||||
eigrp_topology_table_lookup_ipv4 (eigrp->topology_table, dest_addr);
|
||||
eigrp_topology_table_lookup_ipv4 (eigrp->topology_table, &dest_addr);
|
||||
/*
|
||||
* Destination must exists
|
||||
*/
|
||||
@ -211,24 +214,18 @@ eigrp_reply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *e
|
||||
plist = e->prefix[EIGRP_FILTER_IN];
|
||||
alist_i = ei->list[EIGRP_FILTER_IN];
|
||||
plist_i = ei->prefix[EIGRP_FILTER_IN];
|
||||
zlog_info("REPLY Receive: Filtering");
|
||||
zlog_info("REPLY RECEIVE Prefix: %s", inet_ntoa(dest_addr->prefix));
|
||||
/* Check if any list fits */
|
||||
if ((alist && access_list_apply (alist,
|
||||
(struct prefix *) dest_addr) == FILTER_DENY)||
|
||||
(plist && prefix_list_apply (plist,
|
||||
(struct prefix *) dest_addr) == PREFIX_DENY)||
|
||||
(alist_i && access_list_apply (alist_i,
|
||||
(struct prefix *) dest_addr) == FILTER_DENY)||
|
||||
(plist_i && prefix_list_apply (plist_i,
|
||||
(struct prefix *) dest_addr) == PREFIX_DENY))
|
||||
if ((alist &&
|
||||
access_list_apply (alist, (struct prefix *)&dest_addr) == FILTER_DENY) ||
|
||||
(plist &&
|
||||
prefix_list_apply (plist, (struct prefix *)&dest_addr) == PREFIX_DENY) ||
|
||||
(alist_i &&
|
||||
access_list_apply (alist_i, (struct prefix *)&dest_addr) == FILTER_DENY) ||
|
||||
(plist_i &&
|
||||
prefix_list_apply (plist_i, (struct prefix *)&dest_addr) == PREFIX_DENY))
|
||||
{
|
||||
zlog_info("REPLY RECEIVE: Setting metric to max");
|
||||
tlv->metric.delay = EIGRP_MAX_METRIC;
|
||||
zlog_info("REPLY RECEIVE Prefix: %s", inet_ntoa(dest_addr->prefix));
|
||||
} else {
|
||||
zlog_info("REPLY RECEIVE: Not setting metric");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* End of filtering
|
||||
*/
|
||||
|
@ -80,16 +80,17 @@ eigrp_siaquery_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header
|
||||
type = stream_getw(s);
|
||||
if (type == EIGRP_TLV_IPv4_INT)
|
||||
{
|
||||
struct prefix_ipv4 dest_addr;
|
||||
|
||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||
|
||||
tlv = eigrp_read_ipv4_tlv(s);
|
||||
|
||||
struct prefix_ipv4 *dest_addr;
|
||||
dest_addr = prefix_ipv4_new();
|
||||
dest_addr->prefix = tlv->destination;
|
||||
dest_addr->prefixlen = tlv->prefix_length;
|
||||
dest_addr.family = AFI_IP;
|
||||
dest_addr.prefix = tlv->destination;
|
||||
dest_addr.prefixlen = tlv->prefix_length;
|
||||
struct eigrp_prefix_entry *dest =
|
||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
|
||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, &dest_addr);
|
||||
|
||||
/* If the destination exists (it should, but one never know)*/
|
||||
if (dest != NULL)
|
||||
@ -161,4 +162,6 @@ eigrp_send_siaquery (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
|
||||
eigrp_send_packet_reliably(nbr);
|
||||
}
|
||||
}
|
||||
else
|
||||
eigrp_packet_free(ep);
|
||||
}
|
||||
|
@ -79,16 +79,17 @@ eigrp_siareply_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header
|
||||
type = stream_getw(s);
|
||||
if (type == EIGRP_TLV_IPv4_INT)
|
||||
{
|
||||
struct prefix_ipv4 dest_addr;
|
||||
|
||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||
|
||||
tlv = eigrp_read_ipv4_tlv(s);
|
||||
|
||||
struct prefix_ipv4 *dest_addr;
|
||||
dest_addr = prefix_ipv4_new();
|
||||
dest_addr->prefix = tlv->destination;
|
||||
dest_addr->prefixlen = tlv->prefix_length;
|
||||
dest_addr.family = AFI_IP;
|
||||
dest_addr.prefix = tlv->destination;
|
||||
dest_addr.prefixlen = tlv->prefix_length;
|
||||
struct eigrp_prefix_entry *dest =
|
||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
|
||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, &dest_addr);
|
||||
|
||||
/* If the destination exists (it should, but one never know)*/
|
||||
if (dest != NULL)
|
||||
@ -160,6 +161,8 @@ eigrp_send_siareply (struct eigrp_neighbor *nbr, struct eigrp_prefix_entry *pe)
|
||||
eigrp_send_packet_reliably(nbr);
|
||||
}
|
||||
}
|
||||
else
|
||||
eigrp_packet_free(ep);
|
||||
}
|
||||
|
||||
|
||||
|
@ -290,17 +290,18 @@ eigrp_update_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *
|
||||
type = stream_getw(s);
|
||||
if (type == EIGRP_TLV_IPv4_INT)
|
||||
{
|
||||
struct prefix_ipv4 dest_addr;
|
||||
|
||||
stream_set_getp(s, s->getp - sizeof(u_int16_t));
|
||||
|
||||
tlv = eigrp_read_ipv4_tlv(s);
|
||||
|
||||
/*searching if destination exists */
|
||||
struct prefix_ipv4 *dest_addr;
|
||||
dest_addr = prefix_ipv4_new();
|
||||
dest_addr->prefix = tlv->destination;
|
||||
dest_addr->prefixlen = tlv->prefix_length;
|
||||
dest_addr.family = AFI_IP;
|
||||
dest_addr.prefix = tlv->destination;
|
||||
dest_addr.prefixlen = tlv->prefix_length;
|
||||
struct eigrp_prefix_entry *dest =
|
||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, dest_addr);
|
||||
eigrp_topology_table_lookup_ipv4(eigrp->topology_table, &dest_addr);
|
||||
|
||||
/*if exists it comes to DUAL*/
|
||||
if (dest != NULL)
|
||||
@ -330,7 +331,9 @@ eigrp_update_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *
|
||||
/*Here comes topology information save*/
|
||||
pe = eigrp_prefix_entry_new();
|
||||
pe->serno = eigrp->serno;
|
||||
pe->destination_ipv4 = dest_addr;
|
||||
pe->destination_ipv4 = prefix_ipv4_new();
|
||||
prefix_copy((struct prefix *)pe->destination_ipv4,
|
||||
(struct prefix *)&dest_addr);
|
||||
pe->af = AF_INET;
|
||||
pe->state = EIGRP_FSM_STATE_PASSIVE;
|
||||
pe->nt = EIGRP_TOPOLOGY_TYPE_REMOTE;
|
||||
@ -352,93 +355,52 @@ eigrp_update_receive (struct eigrp *eigrp, struct ip *iph, struct eigrp_header *
|
||||
*/
|
||||
alist = ei->list[EIGRP_FILTER_IN];
|
||||
|
||||
if (alist) {
|
||||
zlog_info ("ALIST PROC IN: %s", alist->name);
|
||||
} else {
|
||||
zlog_info("ALIST je prazdny");
|
||||
}
|
||||
|
||||
/* Check if access-list fits */
|
||||
if (alist && access_list_apply (alist,
|
||||
(struct prefix *) dest_addr) == FILTER_DENY)
|
||||
if (alist &&
|
||||
access_list_apply (alist, (struct prefix *)&dest_addr) == FILTER_DENY)
|
||||
{
|
||||
/* If yes, set reported metric to Max */
|
||||
zlog_info("PROC IN: Nastavujem metriku na MAX");
|
||||
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
||||
zlog_info("PROC IN Prefix: %s", inet_ntoa(dest_addr->prefix));
|
||||
} else {
|
||||
zlog_info("PROC IN: NENastavujem metriku ");
|
||||
ne->distance = eigrp_calculate_total_metrics(eigrp, ne);
|
||||
}
|
||||
|
||||
plist = e->prefix[EIGRP_FILTER_IN];
|
||||
|
||||
if (plist) {
|
||||
zlog_info ("PLIST PROC IN: %s", plist->name);
|
||||
} else {
|
||||
zlog_info("PLIST PROC IN je prazdny");
|
||||
}
|
||||
|
||||
/* Check if prefix-list fits */
|
||||
if (plist && prefix_list_apply (plist,
|
||||
(struct prefix *) dest_addr) == PREFIX_DENY)
|
||||
if (plist &&
|
||||
prefix_list_apply (plist, (struct prefix *)&dest_addr) == PREFIX_DENY)
|
||||
{
|
||||
/* If yes, set reported metric to Max */
|
||||
zlog_info("PLIST PROC IN: Nastavujem metriku na MAX");
|
||||
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
||||
zlog_info("PLIST PROC IN Prefix: %s", inet_ntoa(dest_addr->prefix));
|
||||
} else {
|
||||
zlog_info("PLIST PROC IN: NENastavujem metriku ");
|
||||
}
|
||||
}
|
||||
|
||||
/*Get access-list from current interface */
|
||||
zlog_info("Checking access_list on interface: %s",ei->ifp->name);
|
||||
alist = ei->list[EIGRP_FILTER_IN];
|
||||
if (alist) {
|
||||
zlog_info ("ALIST INT IN: %s", alist->name);
|
||||
} else {
|
||||
zlog_info("ALIST INT IN je prazdny");
|
||||
}
|
||||
|
||||
/* Check if access-list fits */
|
||||
if (alist && access_list_apply (alist, (struct prefix *) dest_addr) == FILTER_DENY)
|
||||
if (alist &&
|
||||
access_list_apply (alist, (struct prefix *)&dest_addr) == FILTER_DENY)
|
||||
{
|
||||
/* If yes, set reported metric to Max */
|
||||
zlog_info("INT IN: Nastavujem metriku na MAX");
|
||||
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
||||
zlog_info("INT IN Prefix: %s", inet_ntoa(dest_addr->prefix));
|
||||
} else {
|
||||
zlog_info("INT IN: NENastavujem metriku ");
|
||||
}
|
||||
}
|
||||
|
||||
plist = ei->prefix[EIGRP_FILTER_IN];
|
||||
|
||||
if (plist) {
|
||||
zlog_info ("PLIST INT IN: %s", plist->name);
|
||||
} else {
|
||||
zlog_info("PLIST INT IN je prazdny");
|
||||
}
|
||||
|
||||
/* Check if prefix-list fits */
|
||||
if (plist && prefix_list_apply (plist,
|
||||
(struct prefix *) dest_addr) == PREFIX_DENY)
|
||||
if (plist &&
|
||||
prefix_list_apply (plist, (struct prefix *)&dest_addr) == PREFIX_DENY)
|
||||
{
|
||||
/* If yes, set reported metric to Max */
|
||||
zlog_info("PLIST INT IN: Nastavujem metriku na MAX");
|
||||
ne->reported_metric.delay = EIGRP_MAX_METRIC;
|
||||
zlog_info("PLIST INT IN Prefix: %s", inet_ntoa(dest_addr->prefix));
|
||||
} else {
|
||||
zlog_info("PLIST INT IN: NENastavujem metriku ");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* End of filtering
|
||||
*/
|
||||
|
||||
ne->distance = eigrp_calculate_total_metrics(eigrp, ne);
|
||||
|
||||
zlog_info("<DEBUG PROC IN Distance: %x", ne->distance);
|
||||
zlog_info("<DEBUG PROC IN Delay: %x", ne->total_metric.delay);
|
||||
|
||||
pe->fdistance = pe->distance = pe->rdistance =
|
||||
ne->distance;
|
||||
ne->prefix = pe;
|
||||
@ -648,6 +610,7 @@ eigrp_update_send (struct eigrp_interface *ei)
|
||||
struct prefix_list *plist_i;
|
||||
struct eigrp *e;
|
||||
struct prefix_ipv4 *dest_addr;
|
||||
bool packet_sent = false;
|
||||
|
||||
u_int16_t length = EIGRP_HEADER_LEN;
|
||||
|
||||
@ -719,7 +682,8 @@ eigrp_update_send (struct eigrp_interface *ei)
|
||||
return;
|
||||
}
|
||||
|
||||
if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
|
||||
if((IF_DEF_PARAMS (ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5)
|
||||
&& (IF_DEF_PARAMS (ei->ifp)->auth_keychain != NULL))
|
||||
{
|
||||
eigrp_make_md5_digest(ei,ep->s, EIGRP_AUTH_UPDATE_FLAG);
|
||||
}
|
||||
@ -741,6 +705,7 @@ eigrp_update_send (struct eigrp_interface *ei)
|
||||
{
|
||||
if (nbr->state == EIGRP_NEIGHBOR_UP)
|
||||
{
|
||||
packet_sent = true;
|
||||
/*Put packet to retransmission queue*/
|
||||
eigrp_fifo_push_head(nbr->retrans_queue, ep);
|
||||
|
||||
@ -750,6 +715,9 @@ eigrp_update_send (struct eigrp_interface *ei)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!packet_sent)
|
||||
eigrp_packet_free(ep);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -206,7 +206,7 @@ main (int argc, char **argv, char **envp)
|
||||
* initializations
|
||||
*/
|
||||
access_list_init();
|
||||
vrf_init ();
|
||||
vrf_init (NULL, NULL, NULL, NULL);
|
||||
prefix_list_init();
|
||||
isis_init ();
|
||||
isis_circuit_init ();
|
||||
|
@ -329,7 +329,7 @@ main(int argc, char *argv[])
|
||||
cmd_init(1);
|
||||
vty_config_lockless();
|
||||
vty_init(master);
|
||||
vrf_init();
|
||||
vrf_init(NULL, NULL, NULL, NULL);
|
||||
access_list_init();
|
||||
ldp_vty_init();
|
||||
ldp_zebra_init(master);
|
||||
|
@ -80,6 +80,7 @@ pkginclude_HEADERS = \
|
||||
libfrr.h \
|
||||
sha256.h \
|
||||
frr_pthread.h \
|
||||
vrf_int.h \
|
||||
# end
|
||||
|
||||
noinst_HEADERS = \
|
||||
|
56
lib/vrf.c
56
lib/vrf.c
@ -23,6 +23,7 @@
|
||||
|
||||
#include "if.h"
|
||||
#include "vrf.h"
|
||||
#include "vrf_int.h"
|
||||
#include "prefix.h"
|
||||
#include "table.h"
|
||||
#include "log.h"
|
||||
@ -236,33 +237,6 @@ vrf_disable (struct vrf *vrf)
|
||||
(*vrf_master.vrf_disable_hook) (vrf);
|
||||
}
|
||||
|
||||
|
||||
/* Add a VRF hook. Please add hooks before calling vrf_init(). */
|
||||
void
|
||||
vrf_add_hook (int type, int (*func)(struct vrf *))
|
||||
{
|
||||
if (debug_vrf)
|
||||
zlog_debug ("%s: Add Hook %d to function %p", __PRETTY_FUNCTION__,
|
||||
type, func);
|
||||
|
||||
switch (type) {
|
||||
case VRF_NEW_HOOK:
|
||||
vrf_master.vrf_new_hook = func;
|
||||
break;
|
||||
case VRF_DELETE_HOOK:
|
||||
vrf_master.vrf_delete_hook = func;
|
||||
break;
|
||||
case VRF_ENABLE_HOOK:
|
||||
vrf_master.vrf_enable_hook = func;
|
||||
break;
|
||||
case VRF_DISABLE_HOOK:
|
||||
vrf_master.vrf_disable_hook = func;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vrf_id_t
|
||||
vrf_name_to_id (const char *name)
|
||||
{
|
||||
@ -308,24 +282,6 @@ vrf_iflist_get (vrf_id_t vrf_id)
|
||||
return vrf->iflist;
|
||||
}
|
||||
|
||||
/* Create the interface list for the specified VRF, if needed. */
|
||||
void
|
||||
vrf_iflist_create (vrf_id_t vrf_id)
|
||||
{
|
||||
struct vrf * vrf = vrf_lookup_by_id (vrf_id);
|
||||
if (vrf && !vrf->iflist)
|
||||
if_init (&vrf->iflist);
|
||||
}
|
||||
|
||||
/* Free the interface list of the specified VRF. */
|
||||
void
|
||||
vrf_iflist_terminate (vrf_id_t vrf_id)
|
||||
{
|
||||
struct vrf * vrf = vrf_lookup_by_id (vrf_id);
|
||||
if (vrf && vrf->iflist)
|
||||
if_terminate (&vrf->iflist);
|
||||
}
|
||||
|
||||
/*
|
||||
* VRF bit-map
|
||||
*/
|
||||
@ -423,13 +379,21 @@ vrf_bitmap_check (vrf_bitmap_t bmap, vrf_id_t vrf_id)
|
||||
|
||||
/* Initialize VRF module. */
|
||||
void
|
||||
vrf_init (void)
|
||||
vrf_init (int (*create)(struct vrf *),
|
||||
int (*enable)(struct vrf *),
|
||||
int (*disable)(struct vrf *),
|
||||
int (*delete)(struct vrf *))
|
||||
{
|
||||
struct vrf *default_vrf;
|
||||
|
||||
if (debug_vrf)
|
||||
zlog_debug ("%s: Initializing VRF subsystem", __PRETTY_FUNCTION__);
|
||||
|
||||
vrf_master.vrf_new_hook = create;
|
||||
vrf_master.vrf_enable_hook = enable;
|
||||
vrf_master.vrf_disable_hook = disable;
|
||||
vrf_master.vrf_delete_hook = delete;
|
||||
|
||||
/* The default VRF always exists. */
|
||||
default_vrf = vrf_get (VRF_DEFAULT, VRF_DEFAULT_NAME);
|
||||
if (!default_vrf)
|
||||
|
51
lib/vrf.h
51
lib/vrf.h
@ -56,15 +56,6 @@ enum {
|
||||
#define VRF_CMD_HELP_STR "Specify the VRF\nThe VRF name\n"
|
||||
#define VRF_ALL_CMD_HELP_STR "Specify the VRF\nAll VRFs\n"
|
||||
|
||||
/*
|
||||
* VRF hooks
|
||||
*/
|
||||
|
||||
#define VRF_NEW_HOOK 0 /* a new VRF is just created */
|
||||
#define VRF_DELETE_HOOK 1 /* a VRF is to be deleted */
|
||||
#define VRF_ENABLE_HOOK 2 /* a VRF is ready to use */
|
||||
#define VRF_DISABLE_HOOK 3 /* a VRF is to be unusable */
|
||||
|
||||
struct vrf
|
||||
{
|
||||
RB_ENTRY(vrf) id_entry, name_entry;
|
||||
@ -97,21 +88,9 @@ DECLARE_QOBJ_TYPE(vrf)
|
||||
extern struct vrf_id_head vrfs_by_id;
|
||||
extern struct vrf_name_head vrfs_by_name;
|
||||
|
||||
/*
|
||||
* Add a specific hook to VRF module.
|
||||
* @param1: hook type
|
||||
* @param2: the callback function
|
||||
* - param 1: the VRF ID
|
||||
* - param 2: the address of the user data pointer (the user data
|
||||
* can be stored in or freed from there)
|
||||
*/
|
||||
extern void vrf_add_hook (int, int (*)(struct vrf *));
|
||||
|
||||
extern struct vrf *vrf_lookup_by_id (vrf_id_t);
|
||||
extern struct vrf *vrf_lookup_by_name (const char *);
|
||||
extern struct vrf *vrf_get (vrf_id_t, const char *);
|
||||
extern void vrf_delete (struct vrf *);
|
||||
extern int vrf_enable (struct vrf *);
|
||||
extern vrf_id_t vrf_name_to_id (const char *);
|
||||
|
||||
#define VRF_GET_ID(V,NAME) \
|
||||
@ -147,10 +126,6 @@ extern void *vrf_info_lookup (vrf_id_t);
|
||||
extern struct list *vrf_iflist (vrf_id_t);
|
||||
/* Get the interface list of the specified VRF. Create one if not find. */
|
||||
extern struct list *vrf_iflist_get (vrf_id_t);
|
||||
/* Create the interface list for the specified VRF, if needed. */
|
||||
extern void vrf_iflist_create (vrf_id_t vrf_id);
|
||||
/* Free the interface list of the specified VRF. */
|
||||
extern void vrf_iflist_terminate (vrf_id_t vrf_id);
|
||||
|
||||
/*
|
||||
* VRF bit-map: maintaining flags, one bit per VRF ID
|
||||
@ -167,9 +142,31 @@ extern int vrf_bitmap_check (vrf_bitmap_t, vrf_id_t);
|
||||
|
||||
/*
|
||||
* VRF initializer/destructor
|
||||
*
|
||||
* create -> Called back when a new VRF is created. This
|
||||
* can be either through these 3 options:
|
||||
* 1) CLI mentions a vrf before OS knows about it
|
||||
* 2) OS calls zebra and we create the vrf from OS
|
||||
* callback
|
||||
* 3) zebra calls individual protocols to notify
|
||||
* about the new vrf
|
||||
*
|
||||
* enable -> Called back when a VRF is actually usable from
|
||||
* an OS perspective ( 2 and 3 above )
|
||||
*
|
||||
* disable -> Called back when a VRF is being deleted from
|
||||
* the system ( 2 and 3 ) above
|
||||
*
|
||||
* delete -> Called back when a vrf is being deleted from
|
||||
* the system ( 2 and 3 ) above.
|
||||
*/
|
||||
extern void vrf_init (int (*create)(struct vrf *),
|
||||
int (*enable)(struct vrf *),
|
||||
int (*disable)(struct vrf *),
|
||||
int (*delete)(struct vrf *));
|
||||
/*
|
||||
* Call vrf_terminate when the protocol is being shutdown
|
||||
*/
|
||||
/* Please add hooks before calling vrf_init(). */
|
||||
extern void vrf_init (void);
|
||||
extern void vrf_terminate (void);
|
||||
|
||||
extern void vrf_cmd_init (int (*writefunc)(struct vty *vty));
|
||||
|
56
lib/vrf_int.h
Normal file
56
lib/vrf_int.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* VRF Internal Header
|
||||
* Copyright (C) 2017 Cumulus Networks, Inc.
|
||||
* Donald Sharp
|
||||
*
|
||||
* This file is part of FRR.
|
||||
*
|
||||
* FRR is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* FRR is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with FRR; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __LIB_VRF_PRIVATE_H__
|
||||
#define __LIB_VRF_PRIVATE_H__
|
||||
|
||||
#include "vrf.h"
|
||||
|
||||
/*
|
||||
* These functions should only be called by:
|
||||
* zebra/if_netlink.c -> The interface from OS into Zebra
|
||||
* lib/zclient.c -> The interface from Zebra to each daemon
|
||||
*
|
||||
* Why you ask? Well because these are the turn on/off
|
||||
* functions and the only place we can really turn a
|
||||
* vrf on properly is in the call up from the os -> zebra
|
||||
* and the pass through of this informatoin from zebra -> protocols
|
||||
*/
|
||||
|
||||
/*
|
||||
* vrf_enable
|
||||
*
|
||||
* Given a newly running vrf enable it to be used
|
||||
* by interested routing protocols
|
||||
*/
|
||||
extern int vrf_enable (struct vrf *);
|
||||
|
||||
/*
|
||||
* vrf_delete
|
||||
*
|
||||
* Given a vrf that is being deleted, delete it
|
||||
* from interested parties
|
||||
*/
|
||||
extern void vrf_delete (struct vrf *);
|
||||
|
||||
#endif
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include "stream.h"
|
||||
#include "buffer.h"
|
||||
#include "network.h"
|
||||
#include "vrf.h"
|
||||
#include "vrf_int.h"
|
||||
#include "if.h"
|
||||
#include "log.h"
|
||||
#include "thread.h"
|
||||
|
@ -129,7 +129,7 @@ int main(int argc, char **argv)
|
||||
/* Library inits. */
|
||||
master = frr_init();
|
||||
nhrp_interface_init();
|
||||
vrf_init();
|
||||
vrf_init(NULL, NULL, NULL, NULL);
|
||||
resolver_init();
|
||||
|
||||
/* Run with elevated capabilities, as for all netlink activity
|
||||
|
@ -221,7 +221,7 @@ main (int argc, char *argv[], char *envp[])
|
||||
/* thread master */
|
||||
master = frr_init ();
|
||||
|
||||
vrf_init ();
|
||||
vrf_init (NULL, NULL, NULL, NULL);
|
||||
access_list_init ();
|
||||
prefix_list_init ();
|
||||
|
||||
|
@ -206,7 +206,7 @@ main (int argc, char **argv)
|
||||
|
||||
/* Library inits. */
|
||||
debug_init ();
|
||||
vrf_init ();
|
||||
vrf_init (NULL, NULL, NULL, NULL);
|
||||
|
||||
access_list_init ();
|
||||
prefix_list_init ();
|
||||
|
@ -60,7 +60,6 @@ pim_if_init (void)
|
||||
for (i = 0; i < MAXVIFS; i++)
|
||||
pim_iface_vif_index[i] = 0;
|
||||
|
||||
vrf_iflist_create(VRF_DEFAULT);
|
||||
pim_ifchannel_list = list_new();
|
||||
pim_ifchannel_list->cmp = (int (*)(void *, void *))pim_ifchannel_compare;
|
||||
}
|
||||
|
15
pimd/pimd.c
15
pimd/pimd.c
@ -140,22 +140,15 @@ pim_vrf_disable (struct vrf *vrf)
|
||||
void
|
||||
pim_vrf_init (void)
|
||||
{
|
||||
vrf_add_hook (VRF_NEW_HOOK, pim_vrf_new);
|
||||
vrf_add_hook (VRF_ENABLE_HOOK, pim_vrf_enable);
|
||||
vrf_add_hook (VRF_DISABLE_HOOK, pim_vrf_disable);
|
||||
vrf_add_hook (VRF_DELETE_HOOK, pim_vrf_delete);
|
||||
|
||||
vrf_init ();
|
||||
vrf_init (pim_vrf_new,
|
||||
pim_vrf_enable,
|
||||
pim_vrf_disable,
|
||||
pim_vrf_delete);
|
||||
}
|
||||
|
||||
static void
|
||||
pim_vrf_terminate (void)
|
||||
{
|
||||
vrf_add_hook (VRF_NEW_HOOK, NULL);
|
||||
vrf_add_hook (VRF_ENABLE_HOOK, NULL);
|
||||
vrf_add_hook (VRF_DISABLE_HOOK, NULL);
|
||||
vrf_add_hook (VRF_DELETE_HOOK, NULL);
|
||||
|
||||
vrf_terminate ();
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ main (int argc, char **argv)
|
||||
|
||||
/* Library initialization. */
|
||||
keychain_init ();
|
||||
vrf_init ();
|
||||
vrf_init (NULL, NULL, NULL, NULL);
|
||||
|
||||
/* RIP related initialization. */
|
||||
rip_init ();
|
||||
|
@ -177,7 +177,7 @@ main (int argc, char **argv)
|
||||
master = frr_init ();
|
||||
|
||||
/* Library inits. */
|
||||
vrf_init ();
|
||||
vrf_init (NULL, NULL, NULL, NULL);
|
||||
|
||||
/* RIPngd inits. */
|
||||
ripng_init ();
|
||||
|
@ -650,7 +650,7 @@ main (void)
|
||||
qobj_init ();
|
||||
master = thread_master_create ();
|
||||
bgp_master_init (master);
|
||||
vrf_init ();
|
||||
vrf_init (NULL, NULL, NULL, NULL);
|
||||
bgp_option_set (BGP_OPT_NO_LISTEN);
|
||||
|
||||
if (fileno (stdout) >= 0)
|
||||
|
@ -750,7 +750,7 @@ main (void)
|
||||
qobj_init ();
|
||||
master = thread_master_create ();
|
||||
bgp_master_init (master);
|
||||
vrf_init ();
|
||||
vrf_init (NULL, NULL, NULL, NULL);
|
||||
bgp_option_set (BGP_OPT_NO_LISTEN);
|
||||
bgp_attr_init ();
|
||||
|
||||
|
@ -379,7 +379,7 @@ global_test_init (void)
|
||||
master = thread_master_create ();
|
||||
zclient = zclient_new(master);
|
||||
bgp_master_init (master);
|
||||
vrf_init ();
|
||||
vrf_init (NULL, NULL, NULL, NULL);
|
||||
bgp_option_set (BGP_OPT_NO_LISTEN);
|
||||
|
||||
if (fileno (stdout) >= 0)
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "privs.h"
|
||||
#include "nexthop.h"
|
||||
#include "vrf.h"
|
||||
#include "vrf_int.h"
|
||||
#include "mpls.h"
|
||||
|
||||
#include "vty.h"
|
||||
|
@ -535,11 +535,10 @@ vrf_config_write (struct vty *vty)
|
||||
void
|
||||
zebra_vrf_init (void)
|
||||
{
|
||||
vrf_add_hook (VRF_NEW_HOOK, zebra_vrf_new);
|
||||
vrf_add_hook (VRF_ENABLE_HOOK, zebra_vrf_enable);
|
||||
vrf_add_hook (VRF_DISABLE_HOOK, zebra_vrf_disable);
|
||||
vrf_add_hook (VRF_DELETE_HOOK, zebra_vrf_delete);
|
||||
vrf_init (zebra_vrf_new,
|
||||
zebra_vrf_enable,
|
||||
zebra_vrf_disable,
|
||||
zebra_vrf_delete);
|
||||
|
||||
vrf_init ();
|
||||
vrf_cmd_init (vrf_config_write);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user