struct mpls_fec {
u32 label; /* Label for FEC */
u32 hash; /* Hash for primary key (net / rta) */
- union { /* Extension part of key */
- u32 path_id; /* Source path_id */
- };
-
- u32 uc; /* Number of LSPs for FEC */
u8 state; /* FEC state (MPLS_FEC_*) */
u8 policy; /* Label policy (MPLS_POLICY_*) */
struct mpls_fec *next_k; /* Next in mpls_fec.net_hash/rta_hash */
struct mpls_fec *next_l; /* Next in mpls_fec.label_hash */
+
+ union { /* Extension part of key */
+ u64 path_id; /* Source path_id */
+ u32 class_id; /* Aaggregation class */
+ };
union { /* Primary key */
- struct rta *rta;
+ struct ea_storage *rta;
struct iface *iface;
net_addr net[0];
};
void mpls_fec_map_free(struct mpls_fec_map *m);
struct mpls_fec *mpls_find_fec_by_label(struct mpls_fec_map *x, u32 label);
struct mpls_fec *mpls_get_fec_by_label(struct mpls_fec_map *m, u32 label);
- struct mpls_fec *mpls_get_fec_by_net(struct mpls_fec_map *m, const net_addr *net, u32 path_id);
+ struct mpls_fec *mpls_get_fec_by_net(struct mpls_fec_map *m, const net_addr *net, u64 path_id);
-struct mpls_fec *mpls_get_fec_by_rta(struct mpls_fec_map *m, const rta *src, u32 class_id);
-void mpls_free_fec(struct mpls_fec_map *x, struct mpls_fec *fec);
-int mpls_handle_rte(struct mpls_fec_map *m, const net_addr *n, rte *r, linpool *lp, struct mpls_fec **locked_fec);
-void mpls_handle_rte_cleanup(struct mpls_fec_map *m, struct mpls_fec **locked_fec);
-void mpls_rte_insert(net *n UNUSED, rte *r);
-void mpls_rte_remove(net *n UNUSED, rte *r);
+struct mpls_fec *mpls_get_fec_by_destination(struct mpls_fec_map *m, ea_list *dest);
+
+void mpls_lock_fec(struct mpls_fec *fec);
+void mpls_unlock_fec(struct mpls_fec *fec);
+
+int mpls_handle_rte(struct channel *c, const net_addr *n, rte *r, struct mpls_fec **fecp);
+void mpls_rte_preimport(rte *new, const rte *old);
struct mpls_show_ranges_cmd {
ASSERT(p->export_target_length == len);
}
- /* Convert 64-bit RD to 32bit source ID, unfortunately it has collisions */
- static inline struct rte_src * l3vpn_get_source(struct l3vpn_proto *p, u64 rd)
- { return rt_get_source(&p->p, (u32)(rd >> 32) ^ u32_hash(rd)); }
- //{ return p->p.main_source; }
-
static void
-l3vpn_rt_notify(struct proto *P, struct channel *c0, net *net, rte *new, rte *old UNUSED)
+l3vpn_rt_notify(struct proto *P, struct channel *c0, const net_addr *n0, rte *new, const rte *old UNUSED)
{
struct l3vpn_proto *p = (void *) P;
struct rte_src *src = NULL;