]> git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_mt.h
Merge remote-tracking branch 'origin/stable/3.0'
[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 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 *
18 * You should have received a copy of the GNU General Public License
19 * along with FRR; see the file COPYING. If not, write to the Free
20 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 * 02111-1307, USA.
22 */
23 #ifndef ISIS_MT_H
24 #define ISIS_MT_H
25
26 #define ISIS_MT_MASK 0x0fff
27 #define ISIS_MT_OL_MASK 0x8000
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
36 #define ISIS_MT_NAMES \
37 "<ipv4-unicast" \
38 "|ipv4-mgmt" \
39 "|ipv6-unicast" \
40 "|ipv4-multicast" \
41 "|ipv6-multicast" \
42 "|ipv6-mgmt" \
43 ">"
44
45 #define ISIS_MT_DESCRIPTIONS \
46 "IPv4 unicast topology\n" \
47 "IPv4 management topology\n" \
48 "IPv6 unicast topology\n" \
49 "IPv4 multicast topology\n" \
50 "IPv6 multicast topology\n" \
51 "IPv6 management topology\n"
52
53 #define ISIS_MT_INFO_FIELDS \
54 uint16_t mtid;
55
56 struct list;
57
58 struct isis_area_mt_setting {
59 ISIS_MT_INFO_FIELDS
60 bool enabled;
61 bool overload;
62 };
63
64 struct isis_circuit_mt_setting {
65 ISIS_MT_INFO_FIELDS
66 bool enabled;
67 };
68
69 struct tlv_mt_neighbors {
70 ISIS_MT_INFO_FIELDS
71 struct list *list;
72 };
73
74 struct tlv_mt_ipv4_reachs {
75 ISIS_MT_INFO_FIELDS
76 struct list *list;
77 };
78
79 struct tlv_mt_ipv6_reachs {
80 ISIS_MT_INFO_FIELDS
81 struct list *list;
82 };
83
84 const char *isis_mtid2str(uint16_t mtid);
85 uint16_t isis_str2mtid(const char *name);
86
87 struct isis_adjacency;
88 struct isis_area;
89 struct isis_circuit;
90 struct tlvs;
91 struct te_is_neigh;
92
93 uint16_t isis_area_ipv6_topology(struct isis_area *area);
94
95 struct mt_router_info* tlvs_lookup_mt_router_info(struct tlvs *tlvs, uint16_t mtid);
96
97 struct tlv_mt_neighbors* tlvs_lookup_mt_neighbors(struct tlvs *tlvs, uint16_t mtid);
98 struct tlv_mt_neighbors* tlvs_get_mt_neighbors(struct tlvs *tlvs, uint16_t mtid);
99
100 struct tlv_mt_ipv4_reachs* tlvs_lookup_mt_ipv4_reachs(struct tlvs *tlvs, uint16_t mtid);
101 struct tlv_mt_ipv4_reachs* tlvs_get_mt_ipv4_reachs(struct tlvs *tlvs, uint16_t mtid);
102
103 struct tlv_mt_ipv6_reachs* tlvs_lookup_mt_ipv6_reachs(struct tlvs *tlvs, uint16_t mtid);
104 struct tlv_mt_ipv6_reachs* tlvs_get_mt_ipv6_reachs(struct tlvs *tlvs, uint16_t mtid);
105
106 struct isis_area_mt_setting* area_lookup_mt_setting(struct isis_area *area,
107 uint16_t mtid);
108 struct isis_area_mt_setting* area_new_mt_setting(struct isis_area *area,
109 uint16_t mtid);
110 void area_add_mt_setting(struct isis_area *area,
111 struct isis_area_mt_setting *setting);
112
113 void area_mt_init(struct isis_area *area);
114 void area_mt_finish(struct isis_area *area);
115 struct isis_area_mt_setting* area_get_mt_setting(struct isis_area *area,
116 uint16_t mtid);
117 int area_write_mt_settings(struct isis_area *area, struct vty *vty);
118 bool area_is_mt(struct isis_area *area);
119 struct isis_area_mt_setting** area_mt_settings(struct isis_area *area,
120 unsigned int *mt_count);
121
122 struct isis_circuit_mt_setting* circuit_lookup_mt_setting(
123 struct isis_circuit *circuit,
124 uint16_t mtid);
125 struct isis_circuit_mt_setting* circuit_new_mt_setting(
126 struct isis_circuit *circuit,
127 uint16_t mtid);
128 void circuit_add_mt_setting(struct isis_circuit *circuit,
129 struct isis_circuit_mt_setting *setting);
130 void circuit_mt_init(struct isis_circuit *circuit);
131 void circuit_mt_finish(struct isis_circuit *circuit);
132 struct isis_circuit_mt_setting* circuit_get_mt_setting(
133 struct isis_circuit *circuit,
134 uint16_t mtid);
135 int circuit_write_mt_settings(struct isis_circuit *circuit, struct vty *vty);
136 struct isis_circuit_mt_setting** circuit_mt_settings(struct isis_circuit *circuit,
137 unsigned int *mt_count);
138 bool tlvs_to_adj_mt_set(struct tlvs *tlvs, bool v4_usable, bool v6_usable,
139 struct isis_adjacency *adj);
140 bool adj_has_mt(struct isis_adjacency *adj, uint16_t mtid);
141 void adj_mt_finish(struct isis_adjacency *adj);
142 void tlvs_add_mt_bcast(struct tlvs *tlvs, struct isis_circuit *circuit,
143 int level, struct te_is_neigh *neigh);
144 void tlvs_add_mt_p2p(struct tlvs *tlvs, struct isis_circuit *circuit,
145 struct te_is_neigh *neigh);
146 #endif