2 * Copyright (C) 2020 NetDEF, Inc.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include "openbsd-tree.h"
26 struct ldp_rlfa_client
{
27 RB_ENTRY(ldp_rlfa_client
) entry
;
29 /* IGP instance data. */
30 struct zapi_rlfa_igp igp
;
32 /* Backpointer to RLFA node. */
33 struct ldp_rlfa_node
*node
;
35 RB_HEAD(ldp_rlfa_client_head
, ldp_rlfa_client
);
36 RB_PROTOTYPE(ldp_rlfa_client_head
, ldp_rlfa_client
, entry
,
37 ldp_rlfa_client_compare
);
39 struct ldp_rlfa_node
{
40 RB_ENTRY(ldp_rlfa_node
) entry
;
42 /* Destination prefix. */
43 struct prefix destination
;
45 /* PQ node address. */
46 struct in_addr pq_address
;
49 struct ldp_rlfa_client_head clients
;
51 /* Label allocated by the PQ node to the RLFA destination. */
52 mpls_label_t pq_label
;
54 RB_HEAD(ldp_rlfa_node_head
, ldp_rlfa_node
);
55 RB_PROTOTYPE(ldp_rlfa_node_head
, ldp_rlfa_node
, entry
, ldp_rlfa_node_compare
);
57 extern struct ldp_rlfa_node_head rlfa_node_tree
;
60 struct ldp_rlfa_client
*rlfa_client_new(struct ldp_rlfa_node
*rnode
,
61 struct zapi_rlfa_igp
*igp
);
62 void rlfa_client_del(struct ldp_rlfa_client
*rclient
);
63 struct ldp_rlfa_client
*rlfa_client_find(struct ldp_rlfa_node
*rnode
,
64 struct zapi_rlfa_igp
*igp
);
65 struct ldp_rlfa_node
*rlfa_node_new(const struct prefix
*destination
,
66 struct in_addr pq_address
);
67 void rlfa_node_del(struct ldp_rlfa_node
*rnode
);
68 struct ldp_rlfa_node
*rlfa_node_find(const struct prefix
*destination
,
69 struct in_addr pq_address
);
70 void lde_rlfa_check(struct ldp_rlfa_client
*rclient
);
71 void lde_rlfa_client_send(struct ldp_rlfa_client
*rclient
);
72 void lde_rlfa_label_update(const struct fec
*fec
);
73 void lde_rlfa_update_clients(struct fec
*fec
, struct lde_nbr
*ln
,
75 void ldpe_rlfa_init(struct ldp_rlfa_client
*rclient
);
76 void ldpe_rlfa_exit(struct ldp_rlfa_client
*rclient
);
78 #endif /* _LDPD_RLFA_H_ */