]>
Commit | Line | Data |
---|---|---|
064f4896 CF |
1 | /* |
2 | * IS-IS Rout(e)ing protocol - Multi Topology Support | |
3 | * | |
4 | * Copyright (C) 2017 Christian Franke | |
5 | * | |
8678d638 | 6 | * This file is part of FRRouting (FRR) |
064f4896 CF |
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 | * | |
896014f4 DL |
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 | |
064f4896 CF |
21 | */ |
22 | #ifndef ISIS_MT_H | |
23 | #define ISIS_MT_H | |
24 | ||
99894f9a CF |
25 | #define ISIS_MT_MASK 0x0fff |
26 | #define ISIS_MT_OL_MASK 0x8000 | |
7ef5fefc | 27 | #define ISIS_MT_AT_MASK 0x4000 |
99894f9a | 28 | |
064f4896 | 29 | #define ISIS_MT_IPV4_UNICAST 0 |
6d07d1af | 30 | #define ISIS_MT_STANDARD ISIS_MT_IPV4_UNICAST |
064f4896 CF |
31 | #define ISIS_MT_IPV4_MGMT 1 |
32 | #define ISIS_MT_IPV6_UNICAST 2 | |
33 | #define ISIS_MT_IPV4_MULTICAST 3 | |
34 | #define ISIS_MT_IPV6_MULTICAST 4 | |
35 | #define ISIS_MT_IPV6_MGMT 5 | |
d43d2df5 | 36 | #define ISIS_MT_IPV6_DSTSRC 3996 /* FIXME: IANA */ |
173f8887 OD |
37 | /* Use first Reserved Flag to indicate that there is no MT Topology active */ |
38 | #define ISIS_MT_DISABLE 4096 | |
064f4896 | 39 | |
d62a17ae | 40 | #define ISIS_MT_NAMES \ |
a15014f3 | 41 | "<standard" \ |
d62a17ae | 42 | "|ipv4-mgmt" \ |
43 | "|ipv6-unicast" \ | |
44 | "|ipv4-multicast" \ | |
45 | "|ipv6-multicast" \ | |
46 | "|ipv6-mgmt" \ | |
d43d2df5 | 47 | "|ipv6-dstsrc" \ |
d62a17ae | 48 | ">" |
49 | ||
50 | #define ISIS_MT_DESCRIPTIONS \ | |
51 | "IPv4 unicast topology\n" \ | |
52 | "IPv4 management topology\n" \ | |
53 | "IPv6 unicast topology\n" \ | |
54 | "IPv4 multicast topology\n" \ | |
55 | "IPv6 multicast topology\n" \ | |
d43d2df5 CF |
56 | "IPv6 management topology\n" \ |
57 | "IPv6 dst-src topology\n" \ | |
58 | "" | |
d62a17ae | 59 | |
60 | #define ISIS_MT_INFO_FIELDS uint16_t mtid; | |
064f4896 | 61 | |
206f4aae CF |
62 | struct list; |
63 | ||
064f4896 | 64 | struct isis_area_mt_setting { |
d62a17ae | 65 | ISIS_MT_INFO_FIELDS |
66 | bool enabled; | |
67 | bool overload; | |
064f4896 CF |
68 | }; |
69 | ||
70 | struct isis_circuit_mt_setting { | |
d62a17ae | 71 | ISIS_MT_INFO_FIELDS |
72 | bool enabled; | |
064f4896 CF |
73 | }; |
74 | ||
75 | const char *isis_mtid2str(uint16_t mtid); | |
76 | uint16_t isis_str2mtid(const char *name); | |
77 | ||
d8fba7d9 | 78 | struct isis_adjacency; |
064f4896 CF |
79 | struct isis_area; |
80 | struct isis_circuit; | |
d8fba7d9 | 81 | struct tlvs; |
206f4aae | 82 | struct te_is_neigh; |
0c1bd758 | 83 | struct isis_tlvs; |
206f4aae | 84 | |
d43d2df5 CF |
85 | bool isis_area_ipv6_dstsrc_enabled(struct isis_area *area); |
86 | ||
c3ae3127 CF |
87 | uint16_t isis_area_ipv6_topology(struct isis_area *area); |
88 | ||
d62a17ae | 89 | struct isis_area_mt_setting *area_lookup_mt_setting(struct isis_area *area, |
90 | uint16_t mtid); | |
91 | struct isis_area_mt_setting *area_new_mt_setting(struct isis_area *area, | |
92 | uint16_t mtid); | |
064f4896 | 93 | void area_add_mt_setting(struct isis_area *area, |
d62a17ae | 94 | struct isis_area_mt_setting *setting); |
064f4896 CF |
95 | |
96 | void area_mt_init(struct isis_area *area); | |
97 | void area_mt_finish(struct isis_area *area); | |
d62a17ae | 98 | struct isis_area_mt_setting *area_get_mt_setting(struct isis_area *area, |
99 | uint16_t mtid); | |
064f4896 | 100 | int area_write_mt_settings(struct isis_area *area, struct vty *vty); |
99894f9a | 101 | bool area_is_mt(struct isis_area *area); |
d62a17ae | 102 | struct isis_area_mt_setting **area_mt_settings(struct isis_area *area, |
103 | unsigned int *mt_count); | |
104 | ||
105 | struct isis_circuit_mt_setting * | |
106 | circuit_lookup_mt_setting(struct isis_circuit *circuit, uint16_t mtid); | |
107 | struct isis_circuit_mt_setting * | |
108 | circuit_new_mt_setting(struct isis_circuit *circuit, uint16_t mtid); | |
064f4896 | 109 | void circuit_add_mt_setting(struct isis_circuit *circuit, |
d62a17ae | 110 | struct isis_circuit_mt_setting *setting); |
064f4896 CF |
111 | void circuit_mt_init(struct isis_circuit *circuit); |
112 | void circuit_mt_finish(struct isis_circuit *circuit); | |
d62a17ae | 113 | struct isis_circuit_mt_setting * |
114 | circuit_get_mt_setting(struct isis_circuit *circuit, uint16_t mtid); | |
d62a17ae | 115 | struct isis_circuit_mt_setting ** |
116 | circuit_mt_settings(struct isis_circuit *circuit, unsigned int *mt_count); | |
0c1bd758 | 117 | bool tlvs_to_adj_mt_set(struct isis_tlvs *tlvs, bool v4_usable, bool v6_usable, |
d62a17ae | 118 | struct isis_adjacency *adj); |
2b67862c | 119 | bool adj_has_mt(struct isis_adjacency *adj, uint16_t mtid); |
d8fba7d9 | 120 | void adj_mt_finish(struct isis_adjacency *adj); |
af8ac8f9 | 121 | void tlvs_add_mt_bcast(struct isis_tlvs *tlvs, struct isis_circuit *circuit, |
1b3f47d0 | 122 | int level, uint8_t *id, uint32_t metric); |
af8ac8f9 | 123 | void tlvs_add_mt_p2p(struct isis_tlvs *tlvs, struct isis_circuit *circuit, |
1b3f47d0 | 124 | uint8_t *id, uint32_t metric); |
d56afe53 | 125 | void mt_init(void); |
064f4896 | 126 | #endif |