]> git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_te.h
zebra: Fix label manager memory leak (#5680)
[mirror_frr.git] / isisd / isis_te.h
1 /*
2 * IS-IS Rout(e)ing protocol - isis_te.c
3 *
4 * This is an implementation of RFC5305, RFC 5307 and RFC 7810
5 *
6 * Author: Olivier Dugeon <olivier.dugeon@orange.com>
7 *
8 * Copyright (C) 2014 - 2019 Orange Labs http://www.orange.com
9 *
10 * This file is part of GNU Zebra.
11 *
12 * GNU Zebra is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2, or (at your option) any
15 * later version.
16 *
17 * GNU Zebra is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; see the file COPYING; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26
27 #ifndef _ZEBRA_ISIS_MPLS_TE_H
28 #define _ZEBRA_ISIS_MPLS_TE_H
29
30 /*
31 * Traffic Engineering information are transport through LSP:
32 * - Extended IS Reachability TLV = 22
33 * - Traffic Engineering Router ID TLV = 134
34 * - Extended IP Reachability TLV = 135
35 * - Inter-AS Reachability Information TLV = 141
36 *
37 * and support following sub-TLV:
38 *
39 * Name Value Status
40 * _________________________________________________
41 * Administartive group (color) 3 RFC5305
42 * Link Local/Remote Identifiers 4 RFC5307
43 * IPv4 interface address 6 RFC5305
44 * IPv4 neighbor address 8 RFC5305
45 * Maximum link bandwidth 9 RFC5305
46 * Reservable link bandwidth 10 RFC5305
47 * Unreserved bandwidth 11 RFC5305
48 * TE Default metric 18 RFC5305
49 * Link Protection Type 20 RFC5307
50 * Interface Switching Capability 21 RFC5307
51 * Remote AS number 24 RFC5316
52 * IPv4 Remote ASBR identifier 25 RFC5316
53 *
54 * NOTE: RFC5316 is not fully supported in this version
55 * only subTLVs decoding is provided
56 */
57
58 /* Following define the type of TE link regarding the various RFC */
59 #define STD_TE 0x01
60 #define GMPLS 0x02
61 #define INTER_AS 0x04
62 #define FLOOD_L1 0x10
63 #define FLOOD_L2 0x20
64 #define FLOOD_AS 0x40
65 #define EMULATED 0x80
66
67 #define IS_STD_TE(x) (x & STD_TE)
68 #define IS_INTER_AS(x) (x & INTER_AS)
69 #define IS_EMULATED(x) (x & EMULATED)
70 #define IS_FLOOD_L1(x) (x & FLOOD_L1)
71 #define IS_FLOOD_L2(x) (x & FLOOD_L2)
72 #define IS_FLOOD_AS(x) (x & FLOOD_AS)
73 #define IS_INTER_AS_EMU(x) (x & INTER_AS & EMULATED)
74 #define IS_INTER_AS_AS(x) (x & INTER_AS & FLOOD_AS)
75
76 /*
77 * Note (since release 7.2), subTLVs definition, serialization
78 * and de-serialization have mode to isis_tlvs.[c,h]
79 */
80
81 /* Following declaration concerns the MPLS-TE and LINk-TE management */
82 typedef enum _status_t { disable, enable, learn } status_t;
83
84 /* Mode for Inter-AS LSP */ /* TODO: Check how if LSP is flooded in RFC5316 */
85 typedef enum _interas_mode_t { off, region, as, emulate } interas_mode_t;
86
87 #define IS_EXT_TE(e) (e && e->status != 0 \
88 && e->status != EXT_ADJ_SID \
89 && e->status != EXT_LAN_ADJ_SID)
90 #define IS_MPLS_TE(a) (a && a->status == enable)
91
92 /* Per area MPLS-TE parameters */
93 struct mpls_te_area {
94 /* Status of MPLS-TE: enable or disable */
95 status_t status;
96
97 /* L1, L1-L2, L2-Only */
98 uint8_t level;
99
100 /* RFC5316 */
101 interas_mode_t inter_as;
102 struct in_addr interas_areaid;
103
104 /* MPLS_TE router ID */
105 struct in_addr router_id;
106 };
107
108 /* Prototypes. */
109 void isis_mpls_te_init(void);
110 void isis_link_params_update(struct isis_circuit *, struct interface *);
111 int isis_mpls_te_update(struct interface *);
112
113 #endif /* _ZEBRA_ISIS_MPLS_TE_H */