]> git.proxmox.com Git - mirror_frr.git/blob - ldpd/rlfa.h
mgmtd: Add note to SETCFG_REQ and debug logging
[mirror_frr.git] / ldpd / rlfa.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Copyright (C) 2020 NetDEF, Inc.
4 * Renato Westphal
5 */
6
7 #ifndef _LDPD_RLFA_H_
8 #define _LDPD_RLFA_H_
9
10 #include "openbsd-tree.h"
11 #include "zclient.h"
12
13 struct ldp_rlfa_client {
14 RB_ENTRY(ldp_rlfa_client) entry;
15
16 /* IGP instance data. */
17 struct zapi_rlfa_igp igp;
18
19 /* Backpointer to RLFA node. */
20 struct ldp_rlfa_node *node;
21 };
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);
25
26 struct ldp_rlfa_node {
27 RB_ENTRY(ldp_rlfa_node) entry;
28
29 /* Destination prefix. */
30 struct prefix destination;
31
32 /* PQ node address. */
33 struct in_addr pq_address;
34
35 /* RLFA clients. */
36 struct ldp_rlfa_client_head clients;
37
38 /* Label allocated by the PQ node to the RLFA destination. */
39 mpls_label_t pq_label;
40 };
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);
43
44 extern struct ldp_rlfa_node_head rlfa_node_tree;
45
46 /* prototypes */
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,
61 uint32_t label);
62 void ldpe_rlfa_init(struct ldp_rlfa_client *rclient);
63 void ldpe_rlfa_exit(struct ldp_rlfa_client *rclient);
64
65 #endif /* _LDPD_RLFA_H_ */