]> git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_tlvs.h
*: un-split strings across lines
[mirror_frr.git] / isisd / isis_tlvs.h
1 /*
2 * IS-IS TLV Serializer/Deserializer
3 *
4 * Copyright (C) 2015,2017 Christian Franke
5
6 * Copyright (C) 2019 Olivier Dugeon - Orange Labs (for TE and SR)
7 *
8 * This file is part of FRR.
9 *
10 * FRR is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2, or (at your option) any
13 * later version.
14 *
15 * FRR is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with FRR; see the file COPYING. If not, write to the Free
22 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 * 02111-1307, USA.
24 */
25 #ifndef ISIS_TLVS_H
26 #define ISIS_TLVS_H
27
28 #include "openbsd-tree.h"
29 #include "prefix.h"
30
31 DECLARE_MTYPE(ISIS_SUBTLV)
32
33 struct lspdb_head;
34 struct isis_subtlvs;
35 struct sr_prefix_cfg;
36
37 struct isis_area_address;
38 struct isis_area_address {
39 struct isis_area_address *next;
40
41 uint8_t addr[20];
42 uint8_t len;
43 };
44
45 struct isis_oldstyle_reach;
46 struct isis_oldstyle_reach {
47 struct isis_oldstyle_reach *next;
48
49 uint8_t id[7];
50 uint8_t metric;
51 };
52
53 struct isis_oldstyle_ip_reach;
54 struct isis_oldstyle_ip_reach {
55 struct isis_oldstyle_ip_reach *next;
56
57 uint8_t metric;
58 struct prefix_ipv4 prefix;
59 };
60
61 struct isis_lsp_entry;
62 struct isis_lsp_entry {
63 struct isis_lsp_entry *next;
64
65 uint16_t rem_lifetime;
66 uint8_t id[8];
67 uint16_t checksum;
68 uint32_t seqno;
69
70 struct isis_lsp *lsp;
71 };
72
73 struct isis_extended_reach;
74 struct isis_ext_subtlvs;
75 struct isis_extended_reach {
76 struct isis_extended_reach *next;
77
78 uint8_t id[7];
79 uint32_t metric;
80
81 struct isis_ext_subtlvs *subtlvs;
82 };
83
84 struct isis_extended_ip_reach;
85 struct isis_extended_ip_reach {
86 struct isis_extended_ip_reach *next;
87
88 uint32_t metric;
89 bool down;
90 struct prefix_ipv4 prefix;
91
92 struct isis_subtlvs *subtlvs;
93 };
94
95 struct isis_ipv6_reach;
96 struct isis_ipv6_reach {
97 struct isis_ipv6_reach *next;
98
99 uint32_t metric;
100 bool down;
101 bool external;
102
103 struct prefix_ipv6 prefix;
104
105 struct isis_subtlvs *subtlvs;
106 };
107
108 struct isis_protocols_supported {
109 uint8_t count;
110 uint8_t *protocols;
111 };
112
113 #define ISIS_TIER_UNDEFINED 15
114
115 struct isis_spine_leaf {
116 uint8_t tier;
117
118 bool has_tier;
119 bool is_leaf;
120 bool is_spine;
121 bool is_backup;
122 };
123
124 enum isis_threeway_state {
125 ISIS_THREEWAY_DOWN = 2,
126 ISIS_THREEWAY_INITIALIZING = 1,
127 ISIS_THREEWAY_UP = 0
128 };
129
130 struct isis_threeway_adj {
131 enum isis_threeway_state state;
132 uint32_t local_circuit_id;
133 bool neighbor_set;
134 uint8_t neighbor_id[6];
135 uint32_t neighbor_circuit_id;
136 };
137
138 /* Segment Routing subTLV's as per RFC8667 */
139 #define ISIS_SUBTLV_SRGB_FLAG_I 0x80
140 #define ISIS_SUBTLV_SRGB_FLAG_V 0x40
141 #define IS_SR_IPV4(srgb) (srgb.flags & ISIS_SUBTLV_SRGB_FLAG_I)
142 #define IS_SR_IPV6(srgb) (srgb.flags & ISIS_SUBTLV_SRGB_FLAG_V)
143 #define SUBTLV_SR_BLOCK_SIZE 6
144 #define SUBTLV_RANGE_INDEX_SIZE 10
145 #define SUBTLV_RANGE_LABEL_SIZE 9
146
147 /* Structure aggregating SR Global (SRGB) or Local (SRLB) Block info */
148 struct isis_sr_block {
149 uint8_t flags;
150 uint32_t range_size;
151 uint32_t lower_bound;
152 };
153
154 /* Prefix-SID sub-TLVs flags */
155 #define ISIS_PREFIX_SID_READVERTISED 0x80
156 #define ISIS_PREFIX_SID_NODE 0x40
157 #define ISIS_PREFIX_SID_NO_PHP 0x20
158 #define ISIS_PREFIX_SID_EXPLICIT_NULL 0x10
159 #define ISIS_PREFIX_SID_VALUE 0x08
160 #define ISIS_PREFIX_SID_LOCAL 0x04
161
162 struct isis_prefix_sid;
163 struct isis_prefix_sid {
164 struct isis_prefix_sid *next;
165
166 uint8_t flags;
167 uint8_t algorithm;
168 uint32_t value;
169 };
170
171 /* Adj-SID and LAN-Ajd-SID sub-TLVs flags */
172 #define EXT_SUBTLV_LINK_ADJ_SID_FFLG 0x80
173 #define EXT_SUBTLV_LINK_ADJ_SID_BFLG 0x40
174 #define EXT_SUBTLV_LINK_ADJ_SID_VFLG 0x20
175 #define EXT_SUBTLV_LINK_ADJ_SID_LFLG 0x10
176 #define EXT_SUBTLV_LINK_ADJ_SID_SFLG 0x08
177 #define EXT_SUBTLV_LINK_ADJ_SID_PFLG 0x04
178
179 struct isis_adj_sid;
180 struct isis_adj_sid {
181 struct isis_adj_sid *next;
182
183 uint8_t family;
184 uint8_t flags;
185 uint8_t weight;
186 uint32_t sid;
187 };
188
189 struct isis_lan_adj_sid;
190 struct isis_lan_adj_sid {
191 struct isis_lan_adj_sid *next;
192
193 uint8_t family;
194 uint8_t flags;
195 uint8_t weight;
196 uint8_t neighbor_id[ISIS_SYS_ID_LEN];
197 uint32_t sid;
198 };
199
200 /* RFC 4971 & RFC 7981 */
201 #define ISIS_ROUTER_CAP_FLAG_S 0x01
202 #define ISIS_ROUTER_CAP_FLAG_D 0x02
203 #define ISIS_ROUTER_CAP_SIZE 5
204
205 /* Number of supported algorithm for Segment Routing.
206 * Right now only 2 have been standardized:
207 * - 0: SPF
208 * - 1: Strict SPF
209 */
210 #define SR_ALGORITHM_COUNT 2
211 #define SR_ALGORITHM_SPF 0
212 #define SR_ALGORITHM_STRICT_SPF 1
213 #define SR_ALGORITHM_UNSET 255
214
215 #define MSD_TYPE_BASE_MPLS_IMPOSITION 0x01
216 #define MSD_TLV_SIZE 2
217
218 struct isis_router_cap {
219 struct in_addr router_id;
220 uint8_t flags;
221
222 /* RFC 8667 section #3 */
223 struct isis_sr_block srgb;
224 struct isis_sr_block srlb;
225 uint8_t algo[SR_ALGORITHM_COUNT];
226 /* RFC 8491 */
227 uint8_t msd;
228 };
229
230 struct isis_item;
231 struct isis_item {
232 struct isis_item *next;
233 };
234
235 struct isis_lan_neighbor;
236 struct isis_lan_neighbor {
237 struct isis_lan_neighbor *next;
238
239 uint8_t mac[6];
240 };
241
242 struct isis_ipv4_address;
243 struct isis_ipv4_address {
244 struct isis_ipv4_address *next;
245
246 struct in_addr addr;
247 };
248
249 struct isis_ipv6_address;
250 struct isis_ipv6_address {
251 struct isis_ipv6_address *next;
252
253 struct in6_addr addr;
254 };
255
256 struct isis_mt_router_info;
257 struct isis_mt_router_info {
258 struct isis_mt_router_info *next;
259
260 bool overload;
261 bool attached;
262 uint16_t mtid;
263 };
264
265 struct isis_auth;
266 struct isis_auth {
267 struct isis_auth *next;
268
269 uint8_t type;
270 uint8_t length;
271 uint8_t value[256];
272
273 uint8_t plength;
274 uint8_t passwd[256];
275
276 size_t offset; /* Only valid after packing */
277 };
278
279 struct isis_item_list;
280 struct isis_item_list {
281 struct isis_item *head;
282 struct isis_item **tail;
283
284 RB_ENTRY(isis_item_list) mt_tree;
285 uint16_t mtid;
286 unsigned int count;
287 };
288
289 struct isis_purge_originator {
290 bool sender_set;
291
292 uint8_t generator[6];
293 uint8_t sender[6];
294 };
295
296 enum isis_auth_result {
297 ISIS_AUTH_OK = 0,
298 ISIS_AUTH_TYPE_FAILURE,
299 ISIS_AUTH_FAILURE,
300 ISIS_AUTH_NO_VALIDATOR,
301 };
302
303 RB_HEAD(isis_mt_item_list, isis_item_list);
304
305 struct isis_item_list *isis_get_mt_items(struct isis_mt_item_list *m,
306 uint16_t mtid);
307 struct isis_item_list *isis_lookup_mt_items(struct isis_mt_item_list *m,
308 uint16_t mtid);
309
310 struct isis_tlvs {
311 struct isis_item_list isis_auth;
312 struct isis_purge_originator *purge_originator;
313 struct isis_item_list area_addresses;
314 struct isis_item_list oldstyle_reach;
315 struct isis_item_list lan_neighbor;
316 struct isis_item_list lsp_entries;
317 struct isis_item_list extended_reach;
318 struct isis_mt_item_list mt_reach;
319 struct isis_item_list oldstyle_ip_reach;
320 struct isis_protocols_supported protocols_supported;
321 struct isis_item_list oldstyle_ip_reach_ext;
322 struct isis_item_list ipv4_address;
323 struct isis_item_list ipv6_address;
324 struct isis_item_list mt_router_info;
325 bool mt_router_info_empty;
326 struct in_addr *te_router_id;
327 struct isis_item_list extended_ip_reach;
328 struct isis_mt_item_list mt_ip_reach;
329 char *hostname;
330 struct isis_item_list ipv6_reach;
331 struct isis_mt_item_list mt_ipv6_reach;
332 struct isis_threeway_adj *threeway_adj;
333 struct isis_router_cap *router_cap;
334 struct isis_spine_leaf *spine_leaf;
335 };
336
337 enum isis_tlv_context {
338 ISIS_CONTEXT_LSP,
339 ISIS_CONTEXT_SUBTLV_NE_REACH,
340 ISIS_CONTEXT_SUBTLV_IP_REACH,
341 ISIS_CONTEXT_SUBTLV_IPV6_REACH,
342 ISIS_CONTEXT_MAX
343 };
344
345 struct isis_subtlvs {
346 enum isis_tlv_context context;
347
348 /* draft-baker-ipv6-isis-dst-src-routing-06 */
349 struct prefix_ipv6 *source_prefix;
350 /* RFC 8667 section #2.4 */
351 struct isis_item_list prefix_sids;
352 };
353
354 enum isis_tlv_type {
355 /* TLVs code point */
356 ISIS_TLV_AREA_ADDRESSES = 1,
357 ISIS_TLV_OLDSTYLE_REACH = 2,
358 ISIS_TLV_LAN_NEIGHBORS = 6,
359 ISIS_TLV_PADDING = 8,
360 ISIS_TLV_LSP_ENTRY = 9,
361 ISIS_TLV_AUTH = 10,
362 ISIS_TLV_PURGE_ORIGINATOR = 13,
363 ISIS_TLV_EXTENDED_REACH = 22,
364
365 ISIS_TLV_OLDSTYLE_IP_REACH = 128,
366 ISIS_TLV_PROTOCOLS_SUPPORTED = 129,
367 ISIS_TLV_OLDSTYLE_IP_REACH_EXT = 130,
368 ISIS_TLV_IPV4_ADDRESS = 132,
369 ISIS_TLV_TE_ROUTER_ID = 134,
370 ISIS_TLV_EXTENDED_IP_REACH = 135,
371 ISIS_TLV_DYNAMIC_HOSTNAME = 137,
372 ISIS_TLV_SPINE_LEAF_EXT = 150,
373 ISIS_TLV_MT_REACH = 222,
374 ISIS_TLV_MT_ROUTER_INFO = 229,
375 ISIS_TLV_IPV6_ADDRESS = 232,
376 ISIS_TLV_MT_IP_REACH = 235,
377 ISIS_TLV_IPV6_REACH = 236,
378 ISIS_TLV_MT_IPV6_REACH = 237,
379 ISIS_TLV_THREE_WAY_ADJ = 240,
380 ISIS_TLV_ROUTER_CAPABILITY = 242,
381 ISIS_TLV_MAX = 256,
382
383 /* subTLVs code point */
384 ISIS_SUBTLV_IPV6_SOURCE_PREFIX = 22,
385
386 /* RFC 5305 & RFC 6119 */
387 ISIS_SUBTLV_ADMIN_GRP = 3,
388 ISIS_SUBTLV_LOCAL_IPADDR = 6,
389 ISIS_SUBTLV_RMT_IPADDR = 8,
390 ISIS_SUBTLV_MAX_BW = 9,
391 ISIS_SUBTLV_MAX_RSV_BW = 10,
392 ISIS_SUBTLV_UNRSV_BW = 11,
393 ISIS_SUBTLV_LOCAL_IPADDR6 = 12,
394 ISIS_SUBTLV_RMT_IPADDR6 = 13,
395 ISIS_SUBTLV_TE_METRIC = 18,
396
397 /* RFC 5307 */
398 ISIS_SUBTLV_LLRI = 4,
399
400 /* RFC 8491 */
401 ISIS_SUBTLV_NODE_MSD = 23,
402
403 /* RFC 5316 */
404 ISIS_SUBTLV_RAS = 24,
405 ISIS_SUBTLV_RIP = 25,
406
407 /* RFC 8667 section #4 IANA allocation */
408 ISIS_SUBTLV_SID_LABEL = 1,
409 ISIS_SUBTLV_SID_LABEL_RANGE = 2,
410 ISIS_SUBTLV_ALGORITHM = 19,
411 ISIS_SUBTLV_SRLB = 22,
412 ISIS_SUBTLV_PREFIX_SID = 3,
413 ISIS_SUBTLV_ADJ_SID = 31,
414 ISIS_SUBTLV_LAN_ADJ_SID = 32,
415
416 /* RFC 7810 */
417 ISIS_SUBTLV_AV_DELAY = 33,
418 ISIS_SUBTLV_MM_DELAY = 34,
419 ISIS_SUBTLV_DELAY_VAR = 35,
420 ISIS_SUBTLV_PKT_LOSS = 36,
421 ISIS_SUBTLV_RES_BW = 37,
422 ISIS_SUBTLV_AVA_BW = 38,
423 ISIS_SUBTLV_USE_BW = 39,
424
425 ISIS_SUBTLV_MAX = 40
426 };
427
428 /* subTLVs size for TE and SR */
429 enum ext_subtlv_size {
430 /* RFC 5307 */
431 ISIS_SUBTLV_LLRI_SIZE = 8,
432
433 /* RFC 5305 & RFC 6119 */
434 ISIS_SUBTLV_UNRSV_BW_SIZE = 32,
435 ISIS_SUBTLV_TE_METRIC_SIZE = 3,
436 ISIS_SUBTLV_IPV6_ADDR_SIZE = 16,
437
438 /* RFC 8491 */
439 ISIS_SUBTLV_NODE_MSD_SIZE = 2,
440
441 /* RFC 8667 sections #2 & #3 */
442 ISIS_SUBTLV_SID_LABEL_SIZE = 3,
443 ISIS_SUBTLV_SID_LABEL_RANGE_SIZE = 9,
444 ISIS_SUBTLV_ALGORITHM_SIZE = 4,
445 ISIS_SUBTLV_ADJ_SID_SIZE = 5,
446 ISIS_SUBTLV_LAN_ADJ_SID_SIZE = 11,
447 ISIS_SUBTLV_PREFIX_SID_SIZE = 5,
448
449 /* RFC 7810 */
450 ISIS_SUBTLV_MM_DELAY_SIZE = 8,
451
452 ISIS_SUBTLV_HDR_SIZE = 2,
453 ISIS_SUBTLV_DEF_SIZE = 4,
454
455 ISIS_SUBTLV_MAX_SIZE = 180
456 };
457
458 /* Macros to manage the optional presence of EXT subTLVs */
459 #define SET_SUBTLV(s, t) ((s->status) |= (t))
460 #define UNSET_SUBTLV(s, t) ((s->status) &= ~(t))
461 #define IS_SUBTLV(s, t) (s->status & t)
462
463 #define EXT_DISABLE 0x000000
464 #define EXT_ADM_GRP 0x000001
465 #define EXT_LLRI 0x000002
466 #define EXT_LOCAL_ADDR 0x000004
467 #define EXT_NEIGH_ADDR 0x000008
468 #define EXT_LOCAL_ADDR6 0x000010
469 #define EXT_NEIGH_ADDR6 0x000020
470 #define EXT_MAX_BW 0x000040
471 #define EXT_MAX_RSV_BW 0x000080
472 #define EXT_UNRSV_BW 0x000100
473 #define EXT_TE_METRIC 0x000200
474 #define EXT_RMT_AS 0x000400
475 #define EXT_RMT_IP 0x000800
476 #define EXT_ADJ_SID 0x001000
477 #define EXT_LAN_ADJ_SID 0x002000
478 #define EXT_DELAY 0x004000
479 #define EXT_MM_DELAY 0x008000
480 #define EXT_DELAY_VAR 0x010000
481 #define EXT_PKT_LOSS 0x020000
482 #define EXT_RES_BW 0x040000
483 #define EXT_AVA_BW 0x080000
484 #define EXT_USE_BW 0x100000
485
486 /*
487 * This structure groups all Extended IS Reachability subTLVs.
488 *
489 * Each bit of the status field indicates if a subTLVs is valid or not.
490 * SubTLVs values use following units:
491 * - Bandwidth in bytes/sec following IEEE format,
492 * - Delay in micro-seconds with only 24 bits significant
493 * - Packet Loss in percentage of total traffic with only 24 bits (2^24 - 2)
494 *
495 * For Delay and packet Loss, upper bit (A) indicates if the value is
496 * normal (0) or anomalous (1).
497 */
498 #define IS_ANORMAL(v) (v & 0x80000000)
499
500 struct isis_ext_subtlvs {
501
502 uint32_t status;
503
504 uint32_t adm_group; /* Resource Class/Color - RFC 5305 */
505 /* Link Local/Remote Identifiers - RFC 5307 */
506 uint32_t local_llri;
507 uint32_t remote_llri;
508 struct in_addr local_addr; /* Local IP Address - RFC 5305 */
509 struct in_addr neigh_addr; /* Neighbor IP Address - RFC 5305 */
510 struct in6_addr local_addr6; /* Local IPv6 Address - RFC 6119 */
511 struct in6_addr neigh_addr6; /* Neighbor IPv6 Address - RFC 6119 */
512 float max_bw; /* Maximum Bandwidth - RFC 5305 */
513 float max_rsv_bw; /* Maximum Reservable Bandwidth - RFC 5305 */
514 float unrsv_bw[8]; /* Unreserved Bandwidth - RFC 5305 */
515 uint32_t te_metric; /* Traffic Engineering Metric - RFC 5305 */
516 uint32_t remote_as; /* Remote AS Number sub-TLV - RFC5316 */
517 struct in_addr remote_ip; /* IPv4 Remote ASBR ID Sub-TLV - RFC5316 */
518
519 uint32_t delay; /* Average Link Delay - RFC 8570 */
520 uint32_t min_delay; /* Low Link Delay - RFC 8570 */
521 uint32_t max_delay; /* High Link Delay - RFC 8570 */
522 uint32_t delay_var; /* Link Delay Variation i.e. Jitter - RFC 8570 */
523 uint32_t pkt_loss; /* Unidirectional Link Packet Loss - RFC 8570 */
524 float res_bw; /* Unidirectional Residual Bandwidth - RFC 8570 */
525 float ava_bw; /* Unidirectional Available Bandwidth - RFC 8570 */
526 float use_bw; /* Unidirectional Utilized Bandwidth - RFC 8570 */
527
528 /* Segment Routing Adjacency & LAN Adjacency Segment ID */
529 struct isis_item_list adj_sid;
530 struct isis_item_list lan_sid;
531 };
532
533 #define IS_COMPAT_MT_TLV(tlv_type) \
534 ((tlv_type == ISIS_TLV_MT_REACH) || (tlv_type == ISIS_TLV_MT_IP_REACH) \
535 || (tlv_type == ISIS_TLV_MT_IPV6_REACH))
536
537 struct stream;
538 int isis_pack_tlvs(struct isis_tlvs *tlvs, struct stream *stream,
539 size_t len_pointer, bool pad, bool is_lsp);
540 void isis_free_tlvs(struct isis_tlvs *tlvs);
541 struct isis_tlvs *isis_alloc_tlvs(void);
542 int isis_unpack_tlvs(size_t avail_len, struct stream *stream,
543 struct isis_tlvs **dest, const char **error_log);
544 const char *isis_format_tlvs(struct isis_tlvs *tlvs);
545 struct isis_tlvs *isis_copy_tlvs(struct isis_tlvs *tlvs);
546 struct list *isis_fragment_tlvs(struct isis_tlvs *tlvs, size_t size);
547
548 #define ISIS_EXTENDED_IP_REACH_DOWN 0x80
549 #define ISIS_EXTENDED_IP_REACH_SUBTLV 0x40
550
551 #define ISIS_IPV6_REACH_DOWN 0x80
552 #define ISIS_IPV6_REACH_EXTERNAL 0x40
553 #define ISIS_IPV6_REACH_SUBTLV 0x20
554
555 #ifndef ISIS_MT_MASK
556 #define ISIS_MT_MASK 0x0fff
557 #define ISIS_MT_OL_MASK 0x8000
558 #define ISIS_MT_AT_MASK 0x4000
559 #endif
560
561 void isis_tlvs_add_auth(struct isis_tlvs *tlvs, struct isis_passwd *passwd);
562 void isis_tlvs_add_area_addresses(struct isis_tlvs *tlvs,
563 struct list *addresses);
564 void isis_tlvs_add_lan_neighbors(struct isis_tlvs *tlvs,
565 struct list *neighbors);
566 void isis_tlvs_set_protocols_supported(struct isis_tlvs *tlvs,
567 struct nlpids *nlpids);
568 void isis_tlvs_add_mt_router_info(struct isis_tlvs *tlvs, uint16_t mtid,
569 bool overload, bool attached);
570 void isis_tlvs_add_ipv4_address(struct isis_tlvs *tlvs, struct in_addr *addr);
571 void isis_tlvs_add_ipv4_addresses(struct isis_tlvs *tlvs,
572 struct list *addresses);
573 void isis_tlvs_add_ipv6_addresses(struct isis_tlvs *tlvs,
574 struct list *addresses);
575 int isis_tlvs_auth_is_valid(struct isis_tlvs *tlvs, struct isis_passwd *passwd,
576 struct stream *stream, bool is_lsp);
577 bool isis_tlvs_area_addresses_match(struct isis_tlvs *tlvs,
578 struct list *addresses);
579 struct isis_adjacency;
580 void isis_tlvs_to_adj(struct isis_tlvs *tlvs, struct isis_adjacency *adj,
581 bool *changed);
582 bool isis_tlvs_own_snpa_found(struct isis_tlvs *tlvs, uint8_t *snpa);
583 void isis_tlvs_add_lsp_entry(struct isis_tlvs *tlvs, struct isis_lsp *lsp);
584 void isis_tlvs_add_csnp_entries(struct isis_tlvs *tlvs, uint8_t *start_id,
585 uint8_t *stop_id, uint16_t num_lsps,
586 struct lspdb_head *lspdb,
587 struct isis_lsp **last_lsp);
588 void isis_tlvs_set_dynamic_hostname(struct isis_tlvs *tlvs,
589 const char *hostname);
590 void isis_tlvs_set_router_capability(struct isis_tlvs *tlvs,
591 const struct isis_router_cap *cap);
592 void isis_tlvs_set_te_router_id(struct isis_tlvs *tlvs,
593 const struct in_addr *id);
594 void isis_tlvs_add_oldstyle_ip_reach(struct isis_tlvs *tlvs,
595 struct prefix_ipv4 *dest, uint8_t metric);
596 void isis_tlvs_add_extended_ip_reach(struct isis_tlvs *tlvs,
597 struct prefix_ipv4 *dest, uint32_t metric,
598 bool external, struct sr_prefix_cfg *pcfg);
599 void isis_tlvs_add_ipv6_reach(struct isis_tlvs *tlvs, uint16_t mtid,
600 struct prefix_ipv6 *dest, uint32_t metric,
601 bool external, struct sr_prefix_cfg *pcfg);
602 void isis_tlvs_add_ipv6_dstsrc_reach(struct isis_tlvs *tlvs, uint16_t mtid,
603 struct prefix_ipv6 *dest,
604 struct prefix_ipv6 *src,
605 uint32_t metric);
606 struct isis_ext_subtlvs *isis_alloc_ext_subtlvs(void);
607 void isis_tlvs_add_adj_sid(struct isis_ext_subtlvs *exts,
608 struct isis_adj_sid *adj);
609 void isis_tlvs_del_adj_sid(struct isis_ext_subtlvs *exts,
610 struct isis_adj_sid *adj);
611 void isis_tlvs_add_lan_adj_sid(struct isis_ext_subtlvs *exts,
612 struct isis_lan_adj_sid *lan);
613 void isis_tlvs_del_lan_adj_sid(struct isis_ext_subtlvs *exts,
614 struct isis_lan_adj_sid *lan);
615
616 void isis_tlvs_add_oldstyle_reach(struct isis_tlvs *tlvs, uint8_t *id,
617 uint8_t metric);
618 void isis_tlvs_add_extended_reach(struct isis_tlvs *tlvs, uint16_t mtid,
619 uint8_t *id, uint32_t metric,
620 struct isis_ext_subtlvs *subtlvs);
621
622 const char *isis_threeway_state_name(enum isis_threeway_state state);
623
624 void isis_tlvs_add_threeway_adj(struct isis_tlvs *tlvs,
625 enum isis_threeway_state state,
626 uint32_t local_circuit_id,
627 const uint8_t *neighbor_id,
628 uint32_t neighbor_circuit_id);
629
630 void isis_tlvs_add_spine_leaf(struct isis_tlvs *tlvs, uint8_t tier,
631 bool has_tier, bool is_leaf, bool is_spine,
632 bool is_backup);
633
634 struct isis_mt_router_info *
635 isis_tlvs_lookup_mt_router_info(struct isis_tlvs *tlvs, uint16_t mtid);
636
637 void isis_tlvs_set_purge_originator(struct isis_tlvs *tlvs,
638 const uint8_t *generator,
639 const uint8_t *sender);
640 #endif