]>
Commit | Line | Data |
---|---|---|
f8c06e2c OD |
1 | /* |
2 | * IS-IS Rout(e)ing protocol - isis_te.c | |
3 | * | |
68558b13 | 4 | * This is an implementation of RFC5305, RFC 5307 and RFC 7810 |
f8c06e2c | 5 | * |
1b3f47d0 OD |
6 | * Author: Olivier Dugeon <olivier.dugeon@orange.com> |
7 | * | |
8 | * Copyright (C) 2014 - 2019 Orange Labs http://www.orange.com | |
f8c06e2c OD |
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 | * | |
896014f4 DL |
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 | |
f8c06e2c OD |
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 | * | |
1b3f47d0 OD |
54 | * NOTE: RFC5316 is not fully supported in this version |
55 | * only subTLVs decoding is provided | |
f8c06e2c OD |
56 | */ |
57 | ||
f8c06e2c OD |
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 | /* | |
1b3f47d0 OD |
77 | * Note (since release 7.2), subTLVs definition, serialization |
78 | * and de-serialization have mode to isis_tlvs.[c,h] | |
f8c06e2c | 79 | */ |
f8c06e2c OD |
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 | ||
1b3f47d0 OD |
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) | |
f8c06e2c | 91 | |
2e2a8b91 OD |
92 | /* Per area MPLS-TE parameters */ |
93 | struct mpls_te_area { | |
d62a17ae | 94 | /* Status of MPLS-TE: enable or disable */ |
95 | status_t status; | |
f8c06e2c | 96 | |
d62a17ae | 97 | /* L1, L1-L2, L2-Only */ |
d7c0a89a | 98 | uint8_t level; |
f8c06e2c | 99 | |
d62a17ae | 100 | /* RFC5316 */ |
101 | interas_mode_t inter_as; | |
102 | struct in_addr interas_areaid; | |
f8c06e2c | 103 | |
d62a17ae | 104 | /* MPLS_TE router ID */ |
105 | struct in_addr router_id; | |
f8c06e2c OD |
106 | }; |
107 | ||
f8c06e2c | 108 | /* Prototypes. */ |
d62a17ae | 109 | void isis_mpls_te_init(void); |
f8c06e2c | 110 | void isis_link_params_update(struct isis_circuit *, struct interface *); |
1b3f47d0 | 111 | int isis_mpls_te_update(struct interface *); |
f8c06e2c OD |
112 | |
113 | #endif /* _ZEBRA_ISIS_MPLS_TE_H */ |