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