]> git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_mt.h
isisd: Add support for RFC6119 (IPv6 TE in IS-IS)
[mirror_frr.git] / isisd / isis_mt.h
1 /*
2 * IS-IS Rout(e)ing protocol - Multi Topology Support
3 *
4 * Copyright (C) 2017 Christian Franke
5 *
6 * This file is part of FRRouting (FRR)
7 *
8 * FRR is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * FRR is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22 #ifndef ISIS_MT_H
23 #define ISIS_MT_H
24
25 #define ISIS_MT_MASK 0x0fff
26 #define ISIS_MT_OL_MASK 0x8000
27 #define ISIS_MT_AT_MASK 0x4000
28
29 #define ISIS_MT_IPV4_UNICAST 0
30 #define ISIS_MT_IPV4_MGMT 1
31 #define ISIS_MT_IPV6_UNICAST 2
32 #define ISIS_MT_IPV4_MULTICAST 3
33 #define ISIS_MT_IPV6_MULTICAST 4
34 #define ISIS_MT_IPV6_MGMT 5
35 #define ISIS_MT_IPV6_DSTSRC 3996 /* FIXME: IANA */
36 /* Use first Reserved Flag to indicate that there is no MT Topology active */
37 #define ISIS_MT_DISABLE 4096
38
39 #define ISIS_MT_NAMES \
40 "<ipv4-unicast" \
41 "|ipv4-mgmt" \
42 "|ipv6-unicast" \
43 "|ipv4-multicast" \
44 "|ipv6-multicast" \
45 "|ipv6-mgmt" \
46 "|ipv6-dstsrc" \
47 ">"
48
49 #define ISIS_MT_DESCRIPTIONS \
50 "IPv4 unicast topology\n" \
51 "IPv4 management topology\n" \
52 "IPv6 unicast topology\n" \
53 "IPv4 multicast topology\n" \
54 "IPv6 multicast topology\n" \
55 "IPv6 management topology\n" \
56 "IPv6 dst-src topology\n" \
57 ""
58
59 #define ISIS_MT_INFO_FIELDS uint16_t mtid;
60
61 struct list;
62
63 struct isis_area_mt_setting {
64 ISIS_MT_INFO_FIELDS
65 bool enabled;
66 bool overload;
67 };
68
69 struct isis_circuit_mt_setting {
70 ISIS_MT_INFO_FIELDS
71 bool enabled;
72 };
73
74 const char *isis_mtid2str(uint16_t mtid);
75 uint16_t isis_str2mtid(const char *name);
76
77 struct isis_adjacency;
78 struct isis_area;
79 struct isis_circuit;
80 struct tlvs;
81 struct te_is_neigh;
82 struct isis_tlvs;
83
84 bool isis_area_ipv6_dstsrc_enabled(struct isis_area *area);
85
86 uint16_t isis_area_ipv6_topology(struct isis_area *area);
87
88 struct isis_area_mt_setting *area_lookup_mt_setting(struct isis_area *area,
89 uint16_t mtid);
90 struct isis_area_mt_setting *area_new_mt_setting(struct isis_area *area,
91 uint16_t mtid);
92 void area_add_mt_setting(struct isis_area *area,
93 struct isis_area_mt_setting *setting);
94
95 void area_mt_init(struct isis_area *area);
96 void area_mt_finish(struct isis_area *area);
97 struct isis_area_mt_setting *area_get_mt_setting(struct isis_area *area,
98 uint16_t mtid);
99 int area_write_mt_settings(struct isis_area *area, struct vty *vty);
100 bool area_is_mt(struct isis_area *area);
101 struct isis_area_mt_setting **area_mt_settings(struct isis_area *area,
102 unsigned int *mt_count);
103
104 struct isis_circuit_mt_setting *
105 circuit_lookup_mt_setting(struct isis_circuit *circuit, uint16_t mtid);
106 struct isis_circuit_mt_setting *
107 circuit_new_mt_setting(struct isis_circuit *circuit, uint16_t mtid);
108 void circuit_add_mt_setting(struct isis_circuit *circuit,
109 struct isis_circuit_mt_setting *setting);
110 void circuit_mt_init(struct isis_circuit *circuit);
111 void circuit_mt_finish(struct isis_circuit *circuit);
112 struct isis_circuit_mt_setting *
113 circuit_get_mt_setting(struct isis_circuit *circuit, uint16_t mtid);
114 struct isis_circuit_mt_setting **
115 circuit_mt_settings(struct isis_circuit *circuit, unsigned int *mt_count);
116 bool tlvs_to_adj_mt_set(struct isis_tlvs *tlvs, bool v4_usable, bool v6_usable,
117 struct isis_adjacency *adj);
118 bool adj_has_mt(struct isis_adjacency *adj, uint16_t mtid);
119 void adj_mt_finish(struct isis_adjacency *adj);
120 void tlvs_add_mt_bcast(struct isis_tlvs *tlvs, struct isis_circuit *circuit,
121 int level, uint8_t *id, uint32_t metric);
122 void tlvs_add_mt_p2p(struct isis_tlvs *tlvs, struct isis_circuit *circuit,
123 uint8_t *id, uint32_t metric);
124 void mt_init(void);
125 #endif