]> git.proxmox.com Git - mirror_frr.git/blame - isisd/isis_mt.h
doc: update workflow.rst
[mirror_frr.git] / isisd / isis_mt.h
CommitLineData
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
7ef5fefc 27#define ISIS_MT_AT_MASK 0x4000
99894f9a 28
064f4896
CF
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
d62a17ae 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 uint16_t mtid;
064f4896 54
206f4aae
CF
55struct list;
56
064f4896 57struct isis_area_mt_setting {
d62a17ae 58 ISIS_MT_INFO_FIELDS
59 bool enabled;
60 bool overload;
064f4896
CF
61};
62
63struct isis_circuit_mt_setting {
d62a17ae 64 ISIS_MT_INFO_FIELDS
65 bool enabled;
064f4896
CF
66};
67
68const char *isis_mtid2str(uint16_t mtid);
69uint16_t isis_str2mtid(const char *name);
70
d8fba7d9 71struct isis_adjacency;
064f4896
CF
72struct isis_area;
73struct isis_circuit;
d8fba7d9 74struct tlvs;
206f4aae 75struct te_is_neigh;
0c1bd758 76struct isis_tlvs;
206f4aae 77
c3ae3127
CF
78uint16_t isis_area_ipv6_topology(struct isis_area *area);
79
d62a17ae 80struct isis_area_mt_setting *area_lookup_mt_setting(struct isis_area *area,
81 uint16_t mtid);
82struct isis_area_mt_setting *area_new_mt_setting(struct isis_area *area,
83 uint16_t mtid);
064f4896 84void area_add_mt_setting(struct isis_area *area,
d62a17ae 85 struct isis_area_mt_setting *setting);
064f4896
CF
86
87void area_mt_init(struct isis_area *area);
88void area_mt_finish(struct isis_area *area);
d62a17ae 89struct isis_area_mt_setting *area_get_mt_setting(struct isis_area *area,
90 uint16_t mtid);
064f4896 91int area_write_mt_settings(struct isis_area *area, struct vty *vty);
99894f9a 92bool area_is_mt(struct isis_area *area);
d62a17ae 93struct isis_area_mt_setting **area_mt_settings(struct isis_area *area,
94 unsigned int *mt_count);
95
96struct isis_circuit_mt_setting *
97circuit_lookup_mt_setting(struct isis_circuit *circuit, uint16_t mtid);
98struct isis_circuit_mt_setting *
99circuit_new_mt_setting(struct isis_circuit *circuit, uint16_t mtid);
064f4896 100void circuit_add_mt_setting(struct isis_circuit *circuit,
d62a17ae 101 struct isis_circuit_mt_setting *setting);
064f4896
CF
102void circuit_mt_init(struct isis_circuit *circuit);
103void circuit_mt_finish(struct isis_circuit *circuit);
d62a17ae 104struct isis_circuit_mt_setting *
105circuit_get_mt_setting(struct isis_circuit *circuit, uint16_t mtid);
064f4896 106int circuit_write_mt_settings(struct isis_circuit *circuit, struct vty *vty);
d62a17ae 107struct isis_circuit_mt_setting **
108circuit_mt_settings(struct isis_circuit *circuit, unsigned int *mt_count);
0c1bd758 109bool tlvs_to_adj_mt_set(struct isis_tlvs *tlvs, bool v4_usable, bool v6_usable,
d62a17ae 110 struct isis_adjacency *adj);
2b67862c 111bool adj_has_mt(struct isis_adjacency *adj, uint16_t mtid);
d8fba7d9 112void adj_mt_finish(struct isis_adjacency *adj);
af8ac8f9
CF
113void tlvs_add_mt_bcast(struct isis_tlvs *tlvs, struct isis_circuit *circuit,
114 int level, uint8_t *id, uint32_t metric,
115 uint8_t *subtlvs, uint8_t subtlv_len);
116void tlvs_add_mt_p2p(struct isis_tlvs *tlvs, struct isis_circuit *circuit,
117 uint8_t *id, uint32_t metric, uint8_t *subtlvs,
118 uint8_t subtlv_len);
064f4896 119#endif