mpls_range: mpls_range_start mpls_range_opt_list mpls_range_end;
--mpls_range_start: LABEL RANGE symbol
--{
-- if (($3->class == SYM_KEYWORD) && ($3->keyword->value == STATIC))
++mpls_range_start: LABEL RANGE STATIC {
this_mpls_range = this_mpls_domain->static_range;
-- else if (($3->class == SYM_KEYWORD) && ($3->keyword->value == DYNAMIC))
++};
++
++mpls_range_start: LABEL RANGE DYNAMIC {
this_mpls_range = this_mpls_domain->dynamic_range;
-- else
++};
++
++mpls_range_start: LABEL RANGE symbol {
this_mpls_range = mpls_range_config_new(this_mpls_domain, $3);
};
}
static void
-mpls_announce_fec(struct mpls_fec_map *m, struct mpls_fec *fec, const rta *src)
+mpls_announce_fec(struct mpls_fec_map *m, struct mpls_fec *fec, ea_list *src)
{
- rta *a = allocz(RTA_MAX_SIZE);
-
- a->source = m->mpls_rts;
- a->scope = m->mpls_scope;
-
- if (!src->hostentry)
- {
- /* Just copy the nexthop */
- a->dest = src->dest;
- nexthop_link(a, &src->nh);
- }
- else
- {
- const u32 *labels = &src->nh.label[src->nh.labels - src->nh.labels_orig];
- mpls_label_stack ms;
++ rte e = {
++ .src = m->channel->proto->main_source,
++ };
+
- /* Reconstruct the original labelstack */
- ms.len = src->nh.labels_orig;
- memcpy(ms.stack, labels, src->nh.labels_orig * sizeof(u32));
++ ea_set_attr_u32(&e.attrs, &ea_gen_source, 0, m->mpls_rts);
+
+ /* Check existence of hostentry */
+ const struct eattr *heea = ea_find_by_class(src, &ea_gen_hostentry);
+ if (heea) {
/* The same hostentry, but different dependent table */
- struct hostentry *s = src->hostentry;
- rta_set_recursive_next_hop(m->channel->table, a, s->owner, s->addr, s->link, &ms);
+ struct hostentry_adata *head = SKIP_BACK(struct hostentry_adata, ad, heea->u.ad);
+ struct hostentry *he = head->he;
- ea_set_hostentry(&src, m->channel->table, he->owner, he->addr, he->link,
++ ea_set_hostentry(&e.attrs, m->channel->table, he->owner, he->addr, he->link,
+ HOSTENTRY_LABEL_COUNT(head), head->labels);
}
net_addr_mpls n = NET_ADDR_MPLS(fec->label);
- rte e = {
- .src = m->channel->proto->main_source,
- .attrs = src,
- };
- rte *e = rte_get_temp(rta_lookup(a), m->channel->proto->main_source);
- e->pflags = 0;
--
fec->state = MPLS_FEC_CLEAN;
- rte_update2(m->channel, (net_addr *) &n, e, m->channel->proto->main_source);
+ rte_update(m->channel, (net_addr *) &n, &e, m->channel->proto->main_source);
}
static void
p->rd = cf->rd;
p->import_target = cf->import_target;
p->export_target = cf->export_target;
+ p->export_target_data = NULL;
- l3vpn_prepare_targets(p);
+ l3vpn_prepare_import_targets(p);
+ l3vpn_prepare_export_targets(p);
- proto_setup_mpls_map(P, RTS_L3VPN, 1);
+ proto_setup_mpls_map(P, RTS_L3VPN);
- if (P->vrf_set)
- P->mpls_map->vrf_iface = P->vrf;
+ P->mpls_map->vrf_iface = P->vrf;
return PS_UP;
}
!proto_configure_channel(P, &P->mpls_channel, proto_cf_find_channel(CF, NET_MPLS)))
return 0;
- if ((p->rd != cf->rd) ||
- !same_tree(p->import_target, cf->import_target) ||
- !same_tree(p->export_target, cf->export_target))
+ if (p->rd != cf->rd)
return 0;
- /*
- if (!same_tree(p->import_target, cf->import_target))
+ int import_changed = !same_tree(p->import_target, cf->import_target);
+ int export_changed = !same_tree(p->export_target, cf->export_target);
+
+ /* Update pointers to config structures */
+ p->import_target = cf->import_target;
+ p->export_target = cf->export_target;
+
- proto_setup_mpls_map(P, RTS_L3VPN, 1);
++ proto_setup_mpls_map(P, RTS_L3VPN);
+
+ if (import_changed)
{
+ TRACE(D_EVENTS, "Import target changed");
+
+ l3vpn_prepare_import_targets(p);
+
if (p->vpn4_channel && (p->vpn4_channel->channel_state == CS_UP))
-- channel_request_feeding(p->vpn4_channel);
++ channel_request_feeding_dynamic(p->vpn4_channel, CFRT_AUXILIARY);
if (p->vpn6_channel && (p->vpn6_channel->channel_state == CS_UP))
-- channel_request_feeding(p->vpn6_channel);
++ channel_request_feeding_dynamic(p->vpn6_channel, CFRT_AUXILIARY);
}
- if (!same_tree(p->export_target, cf->export_target))
+ if (export_changed)
{
+ TRACE(D_EVENTS, "Export target changed");
+
+ l3vpn_prepare_export_targets(p);
+
if (p->ip4_channel && (p->ip4_channel->channel_state == CS_UP))
-- channel_request_feeding(p->ip4_channel);
++ channel_request_feeding_dynamic(p->ip4_channel, CFRT_AUXILIARY);
if (p->ip6_channel && (p->ip6_channel->channel_state == CS_UP))
-- channel_request_feeding(p->ip6_channel);
++ channel_request_feeding_dynamic(p->ip6_channel, CFRT_AUXILIARY);
}
- */
-
- /* Update pointers to config structures */
- p->import_target = cf->import_target;
- p->export_target = cf->export_target;
-
- proto_setup_mpls_map(P, RTS_L3VPN);
return 1;
}