]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_mpls.h
zebra: Notice when an interface is turned on w/ mpls and enable mpls subsystem
[mirror_frr.git] / zebra / zebra_mpls.h
CommitLineData
54d48ea1 1/*
2 * Zebra MPLS Data structures and definitions
3 * Copyright (C) 2015 Cumulus Networks, Inc.
4 *
5 * This file is part of GNU Zebra.
6 *
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
896014f4
DL
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
54d48ea1 20 */
21
22#ifndef _ZEBRA_MPLS_H
23#define _ZEBRA_MPLS_H
24
25#include "prefix.h"
26#include "table.h"
27#include "queue.h"
28#include "hash.h"
29#include "jhash.h"
30#include "nexthop.h"
31#include "vty.h"
32#include "memory.h"
33#include "mpls.h"
34#include "zebra/zserv.h"
939fba27 35#include "zebra/zebra_vrf.h"
31f937fb 36#include "hook.h"
54d48ea1 37
51e94aa7
EDP
38#ifdef __cplusplus
39extern "C" {
40#endif
54d48ea1 41
42/* Definitions and macros. */
43
d62a17ae 44#define NHLFE_FAMILY(nhlfe) \
45 (((nhlfe)->nexthop->type == NEXTHOP_TYPE_IPV6 \
46 || (nhlfe)->nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) \
47 ? AF_INET6 \
48 : AF_INET)
54d48ea1 49
ee70f629 50/* Declare LSP nexthop list types */
ee70f629
MS
51PREDECL_DLIST(nhlfe_list);
52
54d48ea1 53/*
54 * (Outgoing) nexthop label forwarding entry
55 */
f2595bd5 56struct zebra_nhlfe {
d62a17ae 57 /* Type of entry - static etc. */
58 enum lsp_types_t type;
54d48ea1 59
d62a17ae 60 /* Nexthop information (with outgoing label) */
61 struct nexthop *nexthop;
54d48ea1 62
d62a17ae 63 /* Backpointer to base entry. */
8f74a383 64 struct zebra_lsp *lsp;
54d48ea1 65
d62a17ae 66 /* Runtime info - flags, pointers etc. */
d7c0a89a 67 uint32_t flags;
54d48ea1 68#define NHLFE_FLAG_CHANGED (1 << 0)
69#define NHLFE_FLAG_SELECTED (1 << 1)
70#define NHLFE_FLAG_MULTIPATH (1 << 2)
71#define NHLFE_FLAG_DELETED (1 << 3)
72#define NHLFE_FLAG_INSTALLED (1 << 4)
cd4bb96f 73#define NHLFE_FLAG_IS_BACKUP (1 << 5)
54d48ea1 74
d7c0a89a 75 uint8_t distance;
ee70f629
MS
76
77 /* Linkage for LSPs' lists */
78 struct nhlfe_list_item list;
54d48ea1 79};
80
81/*
82 * Incoming label entry
83 */
a7d2146a 84struct zebra_ile {
d62a17ae 85 mpls_label_t in_label;
54d48ea1 86};
87
54d48ea1 88/*
89 * Label swap entry (ile -> list of nhlfes)
90 */
8f74a383 91struct zebra_lsp {
d62a17ae 92 /* Incoming label */
a7d2146a 93 struct zebra_ile ile;
54d48ea1 94
ee70f629
MS
95 /* List of NHLFEs, pointer to best, and num equal-cost. */
96 struct nhlfe_list_head nhlfe_list;
97
f2595bd5 98 struct zebra_nhlfe *best_nhlfe;
d7c0a89a 99 uint32_t num_ecmp;
54d48ea1 100
cd4bb96f
MS
101 /* Backup nhlfes, if present. The nexthop in a primary/active nhlfe
102 * refers to its backup (if any) by index, so the order of this list
103 * is significant.
104 */
105 struct nhlfe_list_head backup_nhlfe_list;
106
d62a17ae 107 /* Flags */
d7c0a89a 108 uint32_t flags;
54d48ea1 109#define LSP_FLAG_SCHEDULED (1 << 0)
110#define LSP_FLAG_INSTALLED (1 << 1)
111#define LSP_FLAG_CHANGED (1 << 2)
f9bf1ecc 112#define LSP_FLAG_FPM (1 << 3)
54d48ea1 113
d62a17ae 114 /* Address-family of NHLFE - saved here for delete. All NHLFEs */
115 /* have to be of the same AF */
d7c0a89a 116 uint8_t addr_family;
54d48ea1 117};
118
f31e084c
DS
119/*
120 * FEC to label binding.
121 */
60e36561 122struct zebra_fec {
d62a17ae 123 /* FEC (prefix) */
124 struct route_node *rn;
f31e084c 125
d62a17ae 126 /* In-label - either statically bound or derived from label block. */
127 mpls_label_t label;
f31e084c 128
d62a17ae 129 /* Label index (into global label block), if valid */
d7c0a89a 130 uint32_t label_index;
28d58fd7 131
d62a17ae 132 /* Flags. */
d7c0a89a 133 uint32_t flags;
f31e084c 134#define FEC_FLAG_CONFIGURED (1 << 0)
5aba114a 135
d62a17ae 136 /* Clients interested in this FEC. */
137 struct list *client_list;
f31e084c 138};
54d48ea1 139
ee70f629 140/* Declare typesafe list apis/macros */
f2595bd5 141DECLARE_DLIST(nhlfe_list, struct zebra_nhlfe, list);
ee70f629 142
7758e3f3 143/* Function declarations. */
144
1b6d5c7e
VV
145/*
146 * Add/update global label block.
147 */
d7c0a89a
QY
148int zebra_mpls_label_block_add(struct zebra_vrf *zvrf, uint32_t start_label,
149 uint32_t end_label);
1b6d5c7e
VV
150
151/*
152 * Delete global label block.
153 */
d62a17ae 154int zebra_mpls_label_block_del(struct zebra_vrf *vrf);
1b6d5c7e
VV
155
156/*
157 * Display MPLS global label block configuration (VTY command handler).
158 */
d62a17ae 159int zebra_mpls_write_label_block_config(struct vty *vty, struct zebra_vrf *vrf);
1b6d5c7e 160
a64448ba
DS
161/*
162 * Install dynamic LSP entry.
163 */
d62a17ae 164int zebra_mpls_lsp_install(struct zebra_vrf *zvrf, struct route_node *rn,
165 struct route_entry *re);
a64448ba
DS
166
167/*
d62a17ae 168 * Uninstall dynamic LSP entry, if any.
a64448ba 169 */
d62a17ae 170int zebra_mpls_lsp_uninstall(struct zebra_vrf *zvrf, struct route_node *rn,
171 struct route_entry *re);
a64448ba 172
d4cb23d7 173/* Add an NHLFE to an LSP, return the newly-added object */
f2595bd5 174struct zebra_nhlfe *
8f74a383 175zebra_mpls_lsp_add_nhlfe(struct zebra_lsp *lsp, enum lsp_types_t lsp_type,
f2595bd5
DS
176 enum nexthop_types_t gtype, const union g_addr *gate,
177 ifindex_t ifindex, uint8_t num_labels,
178 const mpls_label_t *out_labels);
cd4bb96f
MS
179
180/* Add or update a backup NHLFE for an LSP; return the object */
f2595bd5 181struct zebra_nhlfe *zebra_mpls_lsp_add_backup_nhlfe(
8f74a383
DS
182 struct zebra_lsp *lsp, enum lsp_types_t lsp_type,
183 enum nexthop_types_t gtype, const union g_addr *gate, ifindex_t ifindex,
184 uint8_t num_labels, const mpls_label_t *out_labels);
cd4bb96f
MS
185
186/*
187 * Add NHLFE or backup NHLFE to an LSP based on a nexthop. These just maintain
188 * the LSP and NHLFE objects; nothing is scheduled for processing.
189 * Return: the newly-added object
190 */
8f74a383 191struct zebra_nhlfe *zebra_mpls_lsp_add_nh(struct zebra_lsp *lsp,
f2595bd5
DS
192 enum lsp_types_t lsp_type,
193 const struct nexthop *nh);
8f74a383 194struct zebra_nhlfe *zebra_mpls_lsp_add_backup_nh(struct zebra_lsp *lsp,
f2595bd5
DS
195 enum lsp_types_t lsp_type,
196 const struct nexthop *nh);
d4cb23d7
MS
197
198/* Free an allocated NHLFE */
f2595bd5 199void zebra_mpls_nhlfe_free(struct zebra_nhlfe *nhlfe);
d4cb23d7 200
d62a17ae 201int zebra_mpls_fec_register(struct zebra_vrf *zvrf, struct prefix *p,
57592a53
AD
202 uint32_t label, uint32_t label_index,
203 struct zserv *client);
5aba114a
DS
204
205/*
206 * Deregistration from a client for the label binding for a FEC. The FEC
207 * itself is deleted if no other registered clients exist and there is no
208 * label bound to the FEC.
209 */
d62a17ae 210int zebra_mpls_fec_unregister(struct zebra_vrf *zvrf, struct prefix *p,
211 struct zserv *client);
5aba114a 212
f31e084c
DS
213/*
214 * Return FEC (if any) to which this label is bound.
215 * Note: Only works for per-prefix binding and when the label is not
216 * implicit-null.
217 * TODO: Currently walks entire table, can optimize later with another
218 * hash..
219 */
60e36561
DS
220struct zebra_fec *zebra_mpls_fec_for_label(struct zebra_vrf *zvrf,
221 mpls_label_t label);
f31e084c
DS
222
223/*
224 * Inform if specified label is currently bound to a FEC or not.
225 */
d62a17ae 226int zebra_mpls_label_already_bound(struct zebra_vrf *zvrf, mpls_label_t label);
f31e084c
DS
227
228/*
5aba114a 229 * Add static FEC to label binding. If there are clients registered for this
a64448ba
DS
230 * FEC, notify them. If there are labeled routes for this FEC, install the
231 * label forwarding entry.
f31e084c 232 */
d62a17ae 233int zebra_mpls_static_fec_add(struct zebra_vrf *zvrf, struct prefix *p,
234 mpls_label_t in_label);
f31e084c
DS
235
236/*
5aba114a
DS
237 * Remove static FEC to label binding. If there are no clients registered
238 * for this FEC, delete the FEC; else notify clients.
28d58fd7
VV
239 * Note: Upon delete of static binding, if label index exists for this FEC,
240 * client may need to be updated with derived label.
f31e084c 241 */
d62a17ae 242int zebra_mpls_static_fec_del(struct zebra_vrf *zvrf, struct prefix *p);
f31e084c
DS
243
244/*
245 * Display MPLS FEC to label binding configuration (VTY command handler).
246 */
d62a17ae 247int zebra_mpls_write_fec_config(struct vty *vty, struct zebra_vrf *zvrf);
f31e084c
DS
248
249/*
250 * Display MPLS FEC to label binding (VTY command handler).
251 */
d62a17ae 252void zebra_mpls_print_fec_table(struct vty *vty, struct zebra_vrf *zvrf);
f31e084c
DS
253
254/*
255 * Display MPLS FEC to label binding for a specific FEC (VTY command handler).
256 */
d62a17ae 257void zebra_mpls_print_fec(struct vty *vty, struct zebra_vrf *zvrf,
258 struct prefix *p);
f31e084c 259
ce549947 260/*
f2e7f4eb
MS
261 * Handle zapi request to install/uninstall LSP and
262 * (optionally) FEC-To-NHLFE (FTN) bindings.
ce549947 263 */
f2e7f4eb
MS
264int mpls_zapi_labels_process(bool add_p, struct zebra_vrf *zvrf,
265 const struct zapi_labels *zl);
ce549947 266
ea6b290b
RW
267/*
268 * Uninstall all NHLFEs bound to a single FEC.
269 */
270int mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
271 struct prefix *prefix, uint8_t route_type,
272 unsigned short route_instance);
273
ce549947
RW
274/*
275 * Install/update a NHLFE for an LSP in the forwarding table. This may be
276 * a new LSP entry or a new NHLFE for an existing in-label or an update of
5065db0a 277 * the out-label(s) for an existing NHLFE (update case).
ce549947 278 */
d62a17ae 279int mpls_lsp_install(struct zebra_vrf *zvrf, enum lsp_types_t type,
5065db0a 280 mpls_label_t in_label, uint8_t num_out_labels,
cd4bb96f 281 const mpls_label_t *out_labels, enum nexthop_types_t gtype,
e4a1ec74 282 const union g_addr *gate, ifindex_t ifindex);
ce549947 283
31f937fb
SM
284/*
285 * Lookup LSP by its input label.
286 */
8f74a383 287struct zebra_lsp *mpls_lsp_find(struct zebra_vrf *zvrf, mpls_label_t in_label);
31f937fb 288
ce549947
RW
289/*
290 * Uninstall a particular NHLFE in the forwarding table. If this is
291 * the only NHLFE, the entire LSP forwarding entry has to be deleted.
292 */
d62a17ae 293int mpls_lsp_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
294 mpls_label_t in_label, enum nexthop_types_t gtype,
cc1b9746
MS
295 const union g_addr *gate, ifindex_t ifindex,
296 bool backup_p);
ce549947
RW
297
298/*
ea6b290b 299 * Uninstall all NHLFEs for a particular LSP forwarding entry.
ce549947 300 */
ea6b290b
RW
301int mpls_lsp_uninstall_all_vrf(struct zebra_vrf *zvrf, enum lsp_types_t type,
302 mpls_label_t in_label);
ce549947 303
1c1cf002 304#if defined(HAVE_CUMULUS)
7758e3f3 305/*
306 * Check that the label values used in LSP creation are consistent. The
307 * main criteria is that if there is ECMP, the label operation must still
308 * be consistent - i.e., all paths either do a swap or do PHP. This is due
309 * to current HW restrictions.
310 */
d62a17ae 311int zebra_mpls_lsp_label_consistent(struct zebra_vrf *zvrf,
312 mpls_label_t in_label,
313 mpls_label_t out_label,
314 enum nexthop_types_t gtype,
315 union g_addr *gate, ifindex_t ifindex);
1c1cf002 316#endif /* HAVE_CUMULUS */
7758e3f3 317
318/*
319 * Add static LSP entry. This may be the first entry for this incoming label
320 * or an additional nexthop; an existing entry may also have outgoing label
321 * changed.
322 * Note: The label operation (swap or PHP) is common for the LSP entry (all
323 * NHLFEs).
324 */
d62a17ae 325int zebra_mpls_static_lsp_add(struct zebra_vrf *zvrf, mpls_label_t in_label,
326 mpls_label_t out_label,
327 enum nexthop_types_t gtype, union g_addr *gate,
328 ifindex_t ifindex);
7758e3f3 329
330/*
331 * Delete static LSP entry. This may be the delete of one particular
332 * NHLFE for this incoming label or the delete of the entire entry (i.e.,
333 * all NHLFEs).
334 * NOTE: Delete of the only NHLFE will also end up deleting the entire
335 * LSP configuration.
336 */
d62a17ae 337int zebra_mpls_static_lsp_del(struct zebra_vrf *zvrf, mpls_label_t in_label,
338 enum nexthop_types_t gtype, union g_addr *gate,
339 ifindex_t ifindex);
7758e3f3 340
d37f4d6c
MS
341/*
342 * Process LSP update results from zebra dataplane.
343 */
344/* Forward ref of dplane update context type */
345struct zebra_dplane_ctx;
346
347void zebra_mpls_lsp_dplane_result(struct zebra_dplane_ctx *ctx);
348
104e3ad9
MS
349/* Process async dplane notifications. */
350void zebra_mpls_process_dplane_notify(struct zebra_dplane_ctx *ctx);
351
40c7bdb0 352/*
353 * Schedule all MPLS label forwarding entries for processing.
354 * Called upon changes that may affect one or more of them such as
355 * interface or nexthop state changes.
356 */
d62a17ae 357void zebra_mpls_lsp_schedule(struct zebra_vrf *zvrf);
40c7bdb0 358
3ab18ff2 359/*
360 * Display MPLS label forwarding table for a specific LSP
361 * (VTY command handler).
362 */
d62a17ae 363void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf,
9f049418 364 mpls_label_t label, bool use_json);
3ab18ff2 365
366/*
367 * Display MPLS label forwarding table (VTY command handler).
368 */
d62a17ae 369void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf,
9f049418 370 bool use_json);
3ab18ff2 371
7758e3f3 372/*
373 * Display MPLS LSP configuration of all static LSPs (VTY command handler).
374 */
d62a17ae 375int zebra_mpls_write_lsp_config(struct vty *vty, struct zebra_vrf *zvrf);
7758e3f3 376
84915b0a 377/*
378 * Called when VRF becomes inactive, cleans up information but keeps
379 * the table itself.
380 * NOTE: Currently supported only for default VRF.
381 */
382void zebra_mpls_cleanup_tables(struct zebra_vrf *zvrf);
383
40c7bdb0 384/*
385 * Called upon process exiting, need to delete LSP forwarding
386 * entries from the kernel.
387 * NOTE: Currently supported only for default VRF.
388 */
d62a17ae 389void zebra_mpls_close_tables(struct zebra_vrf *zvrf);
40c7bdb0 390
7758e3f3 391/*
392 * Allocate MPLS tables for this VRF.
393 * NOTE: Currently supported only for default VRF.
394 */
d62a17ae 395void zebra_mpls_init_tables(struct zebra_vrf *zvrf);
7758e3f3 396
c87f5c23
DS
397/*
398 * If mpls is turned on *after* FRR is brought
399 * up let's actually notice this and turn on
400 * the relevant bits to make it work.
401 */
402void zebra_mpls_turned_on(void);
403
7758e3f3 404/*
405 * Global MPLS initialization.
406 */
d62a17ae 407void zebra_mpls_init(void);
7758e3f3 408
fe6c7157
RW
409/*
410 * MPLS VTY.
411 */
d62a17ae 412void zebra_mpls_vty_init(void);
fe6c7157 413
06302ecb
DS
414/*
415 * When cleaning up a client connection ensure that there are no
416 * vrf labels that need cleaning up too
417 */
418void zebra_mpls_client_cleanup_vrf_label(uint8_t proto);
419
40c7bdb0 420/* Inline functions. */
421
422/*
423 * Distance (priority) definition for LSP NHLFE.
424 */
d7c0a89a 425static inline uint8_t lsp_distance(enum lsp_types_t type)
40c7bdb0 426{
0492eea0
RW
427 switch (type) {
428 case ZEBRA_LSP_STATIC:
d62a17ae 429 return (route_distance(ZEBRA_ROUTE_STATIC));
0492eea0
RW
430 case ZEBRA_LSP_LDP:
431 return (route_distance(ZEBRA_ROUTE_LDP));
432 case ZEBRA_LSP_BGP:
433 return (route_distance(ZEBRA_ROUTE_BGP));
339e36d2
DS
434 case ZEBRA_LSP_NONE:
435 case ZEBRA_LSP_SHARP:
635a039e 436 case ZEBRA_LSP_OSPF_SR:
26f6acaf 437 case ZEBRA_LSP_ISIS_SR:
31f937fb 438 case ZEBRA_LSP_SRTE:
0492eea0
RW
439 return 150;
440 }
339e36d2
DS
441
442 /*
443 * For some reason certain compilers do not believe
444 * that all the cases have been handled. And
445 * WTF does this work differently than when I removed
446 * the default case????
447 */
448 return 150;
40c7bdb0 449}
450
451/*
452 * Map RIB type to LSP type. Used when labeled-routes from BGP
453 * are converted into LSPs.
454 */
d62a17ae 455static inline enum lsp_types_t lsp_type_from_re_type(int re_type)
40c7bdb0 456{
d62a17ae 457 switch (re_type) {
458 case ZEBRA_ROUTE_STATIC:
459 return ZEBRA_LSP_STATIC;
635a039e
RW
460 case ZEBRA_ROUTE_LDP:
461 return ZEBRA_LSP_LDP;
d62a17ae 462 case ZEBRA_ROUTE_BGP:
463 return ZEBRA_LSP_BGP;
635a039e
RW
464 case ZEBRA_ROUTE_OSPF:
465 return ZEBRA_LSP_OSPF_SR;
26f6acaf
RW
466 case ZEBRA_ROUTE_ISIS:
467 return ZEBRA_LSP_ISIS_SR;
339e36d2
DS
468 case ZEBRA_ROUTE_SHARP:
469 return ZEBRA_LSP_SHARP;
31f937fb
SM
470 case ZEBRA_ROUTE_SRTE:
471 return ZEBRA_LSP_SRTE;
d62a17ae 472 default:
473 return ZEBRA_LSP_NONE;
474 }
40c7bdb0 475}
476
805444ce
RW
477/*
478 * Map LSP type to RIB type.
479 */
480static inline int re_type_from_lsp_type(enum lsp_types_t lsp_type)
481{
482 switch (lsp_type) {
483 case ZEBRA_LSP_STATIC:
484 return ZEBRA_ROUTE_STATIC;
485 case ZEBRA_LSP_LDP:
486 return ZEBRA_ROUTE_LDP;
487 case ZEBRA_LSP_BGP:
488 return ZEBRA_ROUTE_BGP;
635a039e 489 case ZEBRA_LSP_OSPF_SR:
7726c479 490 return ZEBRA_ROUTE_OSPF;
26f6acaf
RW
491 case ZEBRA_LSP_ISIS_SR:
492 return ZEBRA_ROUTE_ISIS;
805444ce 493 case ZEBRA_LSP_NONE:
805444ce 494 return ZEBRA_ROUTE_KERNEL;
339e36d2
DS
495 case ZEBRA_LSP_SHARP:
496 return ZEBRA_ROUTE_SHARP;
31f937fb
SM
497 case ZEBRA_LSP_SRTE:
498 return ZEBRA_ROUTE_SRTE;
805444ce 499 }
339e36d2
DS
500
501 /*
502 * For some reason certain compilers do not believe
503 * that all the cases have been handled. And
504 * WTF does this work differently than when I removed
505 * the default case????
506 */
507 return ZEBRA_ROUTE_KERNEL;
805444ce
RW
508}
509
3ab18ff2 510/* NHLFE type as printable string. */
d62a17ae 511static inline const char *nhlfe_type2str(enum lsp_types_t lsp_type)
3ab18ff2 512{
d62a17ae 513 switch (lsp_type) {
514 case ZEBRA_LSP_STATIC:
515 return "Static";
516 case ZEBRA_LSP_LDP:
517 return "LDP";
518 case ZEBRA_LSP_BGP:
519 return "BGP";
635a039e
RW
520 case ZEBRA_LSP_OSPF_SR:
521 return "SR (OSPF)";
26f6acaf
RW
522 case ZEBRA_LSP_ISIS_SR:
523 return "SR (IS-IS)";
339e36d2
DS
524 case ZEBRA_LSP_SHARP:
525 return "SHARP";
31f937fb
SM
526 case ZEBRA_LSP_SRTE:
527 return "SR-TE";
339e36d2 528 case ZEBRA_LSP_NONE:
d62a17ae 529 return "Unknown";
530 }
339e36d2
DS
531
532 /*
533 * For some reason certain compilers do not believe
534 * that all the cases have been handled. And
535 * WTF does this work differently than when I removed
536 * the default case????
537 */
538 return "Unknown";
3ab18ff2 539}
540
a1494c25
DS
541static inline void mpls_mark_lsps_for_processing(struct zebra_vrf *zvrf,
542 struct prefix *p)
939fba27 543{
a1494c25
DS
544 struct route_table *table;
545 struct route_node *rn;
546 rib_dest_t *dest;
547
d62a17ae 548 if (!zvrf)
549 return;
939fba27 550
a1494c25
DS
551 table = zvrf->table[family2afi(p->family)][SAFI_UNICAST];
552 if (!table)
553 return;
554
555 rn = route_node_match(table, p);
556 if (!rn)
557 return;
558
559
560 dest = rib_dest_from_rnode(rn);
561 SET_FLAG(dest->flags, RIB_DEST_UPDATE_LSPS);
939fba27 562}
563
a1494c25 564static inline void mpls_unmark_lsps_for_processing(struct route_node *rn)
939fba27 565{
a1494c25 566 rib_dest_t *dest = rib_dest_from_rnode(rn);
939fba27 567
a1494c25 568 UNSET_FLAG(dest->flags, RIB_DEST_UPDATE_LSPS);
939fba27 569}
570
a1494c25 571static inline int mpls_should_lsps_be_processed(struct route_node *rn)
939fba27 572{
a1494c25 573 rib_dest_t *dest = rib_dest_from_rnode(rn);
939fba27 574
a1494c25 575 return !!CHECK_FLAG(dest->flags, RIB_DEST_UPDATE_LSPS);
939fba27 576}
577
fe6c7157 578/* Global variables. */
c87f5c23 579extern bool mpls_enabled;
6fb35808 580extern bool mpls_pw_reach_strict; /* Strict pseudowire reachability checking */
fe6c7157 581
51e94aa7
EDP
582#ifdef __cplusplus
583}
584#endif
585
54d48ea1 586#endif /*_ZEBRA_MPLS_H */