]> git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_mt.h
Merge pull request #537 from donaldsharp/vrf_stuff
[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 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
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
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 \
53 uint16_t mtid;
54
55 struct list;
56
57 struct isis_area_mt_setting {
58 ISIS_MT_INFO_FIELDS
59 bool enabled;
60 bool overload;
61 };
62
63 struct isis_circuit_mt_setting {
64 ISIS_MT_INFO_FIELDS
65 bool enabled;
66 };
67
68 struct tlv_mt_neighbors {
69 ISIS_MT_INFO_FIELDS
70 struct list *list;
71 };
72
73 struct tlv_mt_ipv4_reachs {
74 ISIS_MT_INFO_FIELDS
75 struct list *list;
76 };
77
78 struct tlv_mt_ipv6_reachs {
79 ISIS_MT_INFO_FIELDS
80 struct list *list;
81 };
82
83 const char *isis_mtid2str(uint16_t mtid);
84 uint16_t isis_str2mtid(const char *name);
85
86 struct isis_adjacency;
87 struct isis_area;
88 struct isis_circuit;
89 struct tlvs;
90 struct te_is_neigh;
91
92 uint16_t isis_area_ipv6_topology(struct isis_area *area);
93
94 struct mt_router_info* tlvs_lookup_mt_router_info(struct tlvs *tlvs, uint16_t mtid);
95
96 struct tlv_mt_neighbors* tlvs_lookup_mt_neighbors(struct tlvs *tlvs, uint16_t mtid);
97 struct tlv_mt_neighbors* tlvs_get_mt_neighbors(struct tlvs *tlvs, uint16_t mtid);
98
99 struct tlv_mt_ipv4_reachs* tlvs_lookup_mt_ipv4_reachs(struct tlvs *tlvs, uint16_t mtid);
100 struct tlv_mt_ipv4_reachs* tlvs_get_mt_ipv4_reachs(struct tlvs *tlvs, uint16_t mtid);
101
102 struct tlv_mt_ipv6_reachs* tlvs_lookup_mt_ipv6_reachs(struct tlvs *tlvs, uint16_t mtid);
103 struct tlv_mt_ipv6_reachs* tlvs_get_mt_ipv6_reachs(struct tlvs *tlvs, uint16_t mtid);
104
105 struct isis_area_mt_setting* area_lookup_mt_setting(struct isis_area *area,
106 uint16_t mtid);
107 struct isis_area_mt_setting* area_new_mt_setting(struct isis_area *area,
108 uint16_t mtid);
109 void area_add_mt_setting(struct isis_area *area,
110 struct isis_area_mt_setting *setting);
111
112 void area_mt_init(struct isis_area *area);
113 void area_mt_finish(struct isis_area *area);
114 struct isis_area_mt_setting* area_get_mt_setting(struct isis_area *area,
115 uint16_t mtid);
116 int area_write_mt_settings(struct isis_area *area, struct vty *vty);
117 bool area_is_mt(struct isis_area *area);
118 struct isis_area_mt_setting** area_mt_settings(struct isis_area *area,
119 unsigned int *mt_count);
120
121 struct isis_circuit_mt_setting* circuit_lookup_mt_setting(
122 struct isis_circuit *circuit,
123 uint16_t mtid);
124 struct isis_circuit_mt_setting* circuit_new_mt_setting(
125 struct isis_circuit *circuit,
126 uint16_t mtid);
127 void circuit_add_mt_setting(struct isis_circuit *circuit,
128 struct isis_circuit_mt_setting *setting);
129 void circuit_mt_init(struct isis_circuit *circuit);
130 void circuit_mt_finish(struct isis_circuit *circuit);
131 struct isis_circuit_mt_setting* circuit_get_mt_setting(
132 struct isis_circuit *circuit,
133 uint16_t mtid);
134 int circuit_write_mt_settings(struct isis_circuit *circuit, struct vty *vty);
135 struct isis_circuit_mt_setting** circuit_mt_settings(struct isis_circuit *circuit,
136 unsigned int *mt_count);
137 bool tlvs_to_adj_mt_set(struct tlvs *tlvs, bool v4_usable, bool v6_usable,
138 struct isis_adjacency *adj);
139 bool adj_has_mt(struct isis_adjacency *adj, uint16_t mtid);
140 void adj_mt_finish(struct isis_adjacency *adj);
141 void tlvs_add_mt_bcast(struct tlvs *tlvs, struct isis_circuit *circuit,
142 int level, struct te_is_neigh *neigh);
143 void tlvs_add_mt_p2p(struct tlvs *tlvs, struct isis_circuit *circuit,
144 struct te_is_neigh *neigh);
145 #endif