]>
Commit | Line | Data |
---|---|---|
077d336a RW |
1 | /* |
2 | * Copyright (C) 2020 NetDEF, Inc. | |
3 | * Renato Westphal | |
4 | * | |
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) | |
8 | * any later version. | |
9 | * | |
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 | |
13 | * more details. | |
14 | * | |
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 | |
18 | */ | |
19 | ||
20 | #ifndef _LDPD_RLFA_H_ | |
21 | #define _LDPD_RLFA_H_ | |
22 | ||
23 | #include "openbsd-tree.h" | |
24 | #include "zclient.h" | |
25 | ||
26 | struct ldp_rlfa_client { | |
27 | RB_ENTRY(ldp_rlfa_client) entry; | |
28 | ||
29 | /* IGP instance data. */ | |
30 | struct zapi_rlfa_igp igp; | |
31 | ||
32 | /* Backpointer to RLFA node. */ | |
33 | struct ldp_rlfa_node *node; | |
34 | }; | |
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); | |
38 | ||
39 | struct ldp_rlfa_node { | |
40 | RB_ENTRY(ldp_rlfa_node) entry; | |
41 | ||
42 | /* Destination prefix. */ | |
43 | struct prefix destination; | |
44 | ||
45 | /* PQ node address. */ | |
46 | struct in_addr pq_address; | |
47 | ||
48 | /* RLFA clients. */ | |
49 | struct ldp_rlfa_client_head clients; | |
50 | ||
51 | /* Label allocated by the PQ node to the RLFA destination. */ | |
52 | mpls_label_t pq_label; | |
53 | }; | |
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); | |
56 | ||
57 | extern struct ldp_rlfa_node_head rlfa_node_tree; | |
58 | ||
59 | /* prototypes */ | |
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, | |
74 | uint32_t label); | |
75 | void ldpe_rlfa_init(struct ldp_rlfa_client *rclient); | |
76 | void ldpe_rlfa_exit(struct ldp_rlfa_client *rclient); | |
77 | ||
78 | #endif /* _LDPD_RLFA_H_ */ |