1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2020 NetDEF, Inc.
10 #include "openbsd-tree.h"
13 struct ldp_rlfa_client
{
14 RB_ENTRY(ldp_rlfa_client
) entry
;
16 /* IGP instance data. */
17 struct zapi_rlfa_igp igp
;
19 /* Backpointer to RLFA node. */
20 struct ldp_rlfa_node
*node
;
22 RB_HEAD(ldp_rlfa_client_head
, ldp_rlfa_client
);
23 RB_PROTOTYPE(ldp_rlfa_client_head
, ldp_rlfa_client
, entry
,
24 ldp_rlfa_client_compare
);
26 struct ldp_rlfa_node
{
27 RB_ENTRY(ldp_rlfa_node
) entry
;
29 /* Destination prefix. */
30 struct prefix destination
;
32 /* PQ node address. */
33 struct in_addr pq_address
;
36 struct ldp_rlfa_client_head clients
;
38 /* Label allocated by the PQ node to the RLFA destination. */
39 mpls_label_t pq_label
;
41 RB_HEAD(ldp_rlfa_node_head
, ldp_rlfa_node
);
42 RB_PROTOTYPE(ldp_rlfa_node_head
, ldp_rlfa_node
, entry
, ldp_rlfa_node_compare
);
44 extern struct ldp_rlfa_node_head rlfa_node_tree
;
47 struct ldp_rlfa_client
*rlfa_client_new(struct ldp_rlfa_node
*rnode
,
48 struct zapi_rlfa_igp
*igp
);
49 void rlfa_client_del(struct ldp_rlfa_client
*rclient
);
50 struct ldp_rlfa_client
*rlfa_client_find(struct ldp_rlfa_node
*rnode
,
51 struct zapi_rlfa_igp
*igp
);
52 struct ldp_rlfa_node
*rlfa_node_new(const struct prefix
*destination
,
53 struct in_addr pq_address
);
54 void rlfa_node_del(struct ldp_rlfa_node
*rnode
);
55 struct ldp_rlfa_node
*rlfa_node_find(const struct prefix
*destination
,
56 struct in_addr pq_address
);
57 void lde_rlfa_check(struct ldp_rlfa_client
*rclient
);
58 void lde_rlfa_client_send(struct ldp_rlfa_client
*rclient
);
59 void lde_rlfa_label_update(const struct fec
*fec
);
60 void lde_rlfa_update_clients(struct fec
*fec
, struct lde_nbr
*ln
,
62 void ldpe_rlfa_init(struct ldp_rlfa_client
*rclient
);
63 void ldpe_rlfa_exit(struct ldp_rlfa_client
*rclient
);
65 #endif /* _LDPD_RLFA_H_ */