]>
Commit | Line | Data |
---|---|---|
064f4896 CF |
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 FreeRangeRouting (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 | * | |
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 | |
27 | ||
064f4896 CF |
28 | #define ISIS_MT_IPV4_UNICAST 0 |
29 | #define ISIS_MT_IPV4_MGMT 1 | |
30 | #define ISIS_MT_IPV6_UNICAST 2 | |
31 | #define ISIS_MT_IPV4_MULTICAST 3 | |
32 | #define ISIS_MT_IPV6_MULTICAST 4 | |
33 | #define ISIS_MT_IPV6_MGMT 5 | |
34 | ||
d62a17ae | 35 | #define ISIS_MT_NAMES \ |
36 | "<ipv4-unicast" \ | |
37 | "|ipv4-mgmt" \ | |
38 | "|ipv6-unicast" \ | |
39 | "|ipv4-multicast" \ | |
40 | "|ipv6-multicast" \ | |
41 | "|ipv6-mgmt" \ | |
42 | ">" | |
43 | ||
44 | #define ISIS_MT_DESCRIPTIONS \ | |
45 | "IPv4 unicast topology\n" \ | |
46 | "IPv4 management topology\n" \ | |
47 | "IPv6 unicast topology\n" \ | |
48 | "IPv4 multicast topology\n" \ | |
49 | "IPv6 multicast topology\n" \ | |
50 | "IPv6 management topology\n" | |
51 | ||
52 | #define ISIS_MT_INFO_FIELDS uint16_t mtid; | |
064f4896 | 53 | |
206f4aae CF |
54 | struct list; |
55 | ||
064f4896 | 56 | struct isis_area_mt_setting { |
d62a17ae | 57 | ISIS_MT_INFO_FIELDS |
58 | bool enabled; | |
59 | bool overload; | |
064f4896 CF |
60 | }; |
61 | ||
62 | struct isis_circuit_mt_setting { | |
d62a17ae | 63 | ISIS_MT_INFO_FIELDS |
64 | bool enabled; | |
064f4896 CF |
65 | }; |
66 | ||
206f4aae | 67 | struct tlv_mt_neighbors { |
d62a17ae | 68 | ISIS_MT_INFO_FIELDS |
69 | struct list *list; | |
206f4aae CF |
70 | }; |
71 | ||
c3ae3127 | 72 | struct tlv_mt_ipv4_reachs { |
d62a17ae | 73 | ISIS_MT_INFO_FIELDS |
74 | struct list *list; | |
c3ae3127 CF |
75 | }; |
76 | ||
77 | struct tlv_mt_ipv6_reachs { | |
d62a17ae | 78 | ISIS_MT_INFO_FIELDS |
79 | struct list *list; | |
c3ae3127 CF |
80 | }; |
81 | ||
064f4896 CF |
82 | const char *isis_mtid2str(uint16_t mtid); |
83 | uint16_t isis_str2mtid(const char *name); | |
84 | ||
d8fba7d9 | 85 | struct isis_adjacency; |
064f4896 CF |
86 | struct isis_area; |
87 | struct isis_circuit; | |
d8fba7d9 | 88 | struct tlvs; |
206f4aae CF |
89 | struct te_is_neigh; |
90 | ||
c3ae3127 CF |
91 | uint16_t isis_area_ipv6_topology(struct isis_area *area); |
92 | ||
d62a17ae | 93 | struct mt_router_info *tlvs_lookup_mt_router_info(struct tlvs *tlvs, |
94 | uint16_t mtid); | |
2b67862c | 95 | |
d62a17ae | 96 | struct tlv_mt_neighbors *tlvs_lookup_mt_neighbors(struct tlvs *tlvs, |
97 | uint16_t mtid); | |
98 | struct tlv_mt_neighbors *tlvs_get_mt_neighbors(struct tlvs *tlvs, | |
99 | uint16_t mtid); | |
064f4896 | 100 | |
d62a17ae | 101 | struct tlv_mt_ipv4_reachs *tlvs_lookup_mt_ipv4_reachs(struct tlvs *tlvs, |
102 | uint16_t mtid); | |
103 | struct tlv_mt_ipv4_reachs *tlvs_get_mt_ipv4_reachs(struct tlvs *tlvs, | |
104 | uint16_t mtid); | |
c3ae3127 | 105 | |
d62a17ae | 106 | struct tlv_mt_ipv6_reachs *tlvs_lookup_mt_ipv6_reachs(struct tlvs *tlvs, |
107 | uint16_t mtid); | |
108 | struct tlv_mt_ipv6_reachs *tlvs_get_mt_ipv6_reachs(struct tlvs *tlvs, | |
109 | uint16_t mtid); | |
c3ae3127 | 110 | |
d62a17ae | 111 | struct isis_area_mt_setting *area_lookup_mt_setting(struct isis_area *area, |
112 | uint16_t mtid); | |
113 | struct isis_area_mt_setting *area_new_mt_setting(struct isis_area *area, | |
114 | uint16_t mtid); | |
064f4896 | 115 | void area_add_mt_setting(struct isis_area *area, |
d62a17ae | 116 | struct isis_area_mt_setting *setting); |
064f4896 CF |
117 | |
118 | void area_mt_init(struct isis_area *area); | |
119 | void area_mt_finish(struct isis_area *area); | |
d62a17ae | 120 | struct isis_area_mt_setting *area_get_mt_setting(struct isis_area *area, |
121 | uint16_t mtid); | |
064f4896 | 122 | int area_write_mt_settings(struct isis_area *area, struct vty *vty); |
99894f9a | 123 | bool area_is_mt(struct isis_area *area); |
d62a17ae | 124 | struct isis_area_mt_setting **area_mt_settings(struct isis_area *area, |
125 | unsigned int *mt_count); | |
126 | ||
127 | struct isis_circuit_mt_setting * | |
128 | circuit_lookup_mt_setting(struct isis_circuit *circuit, uint16_t mtid); | |
129 | struct isis_circuit_mt_setting * | |
130 | circuit_new_mt_setting(struct isis_circuit *circuit, uint16_t mtid); | |
064f4896 | 131 | void circuit_add_mt_setting(struct isis_circuit *circuit, |
d62a17ae | 132 | struct isis_circuit_mt_setting *setting); |
064f4896 CF |
133 | void circuit_mt_init(struct isis_circuit *circuit); |
134 | void circuit_mt_finish(struct isis_circuit *circuit); | |
d62a17ae | 135 | struct isis_circuit_mt_setting * |
136 | circuit_get_mt_setting(struct isis_circuit *circuit, uint16_t mtid); | |
064f4896 | 137 | int circuit_write_mt_settings(struct isis_circuit *circuit, struct vty *vty); |
d62a17ae | 138 | struct isis_circuit_mt_setting ** |
139 | circuit_mt_settings(struct isis_circuit *circuit, unsigned int *mt_count); | |
d8fba7d9 | 140 | bool tlvs_to_adj_mt_set(struct tlvs *tlvs, bool v4_usable, bool v6_usable, |
d62a17ae | 141 | struct isis_adjacency *adj); |
2b67862c | 142 | bool adj_has_mt(struct isis_adjacency *adj, uint16_t mtid); |
d8fba7d9 | 143 | void adj_mt_finish(struct isis_adjacency *adj); |
206f4aae | 144 | void tlvs_add_mt_bcast(struct tlvs *tlvs, struct isis_circuit *circuit, |
d62a17ae | 145 | int level, struct te_is_neigh *neigh); |
206f4aae | 146 | void tlvs_add_mt_p2p(struct tlvs *tlvs, struct isis_circuit *circuit, |
d62a17ae | 147 | struct te_is_neigh *neigh); |
064f4896 | 148 | #endif |