jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * IS-IS Rout(e)ing protocol - isis_tlv.h |
| 3 | * IS-IS TLV related routines |
| 4 | * |
| 5 | * Copyright (C) 2001,2002 Sampo Saaristo |
| 6 | * Tampere University of Technology |
| 7 | * Institute of Communications Engineering |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify it |
| 10 | * under the terms of the GNU General Public Licenseas published by the Free |
| 11 | * Software Foundation; either version 2 of the License, or (at your option) |
| 12 | * any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful,but WITHOUT |
| 15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 17 | * more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License along |
| 20 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 22 | */ |
| 23 | |
| 24 | #ifndef _ZEBRA_ISIS_TLV_H |
| 25 | #define _ZEBRA_ISIS_TLV_H |
| 26 | |
| 27 | /* |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 28 | * The list of TLVs we (should) support. |
| 29 | * ____________________________________________________________________________ |
| 30 | * Name Value IIH LSP SNP Status |
| 31 | * LAN |
| 32 | * ____________________________________________________________________________ |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 33 | * |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 34 | * Area Addresses 1 y y n ISO10589 |
| 35 | * IIS Neighbors 2 n y n ISO10589 |
| 36 | * ES Neighbors 3 n y n ISO10589 |
| 37 | * IIS Neighbors 6 y n n ISO10589 |
| 38 | * Padding 8 y n n ISO10589 |
| 39 | * LSP Entries 9 n n y ISO10589 |
| 40 | * Authentication 10 y y y ISO10589, RFC3567 |
| 41 | * Checksum 12 y n y RFC3358 |
Olivier Dugeon | 4f59357 | 2016-04-19 19:03:05 +0200 | [diff] [blame] | 42 | * Extended IS Reachability 22 n y n RFC5305 |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 43 | * IS Alias 24 n y n RFC3786 |
| 44 | * IP Int. Reachability 128 n y n RFC1195 |
| 45 | * Protocols Supported 129 y y n RFC1195 |
| 46 | * IP Ext. Reachability 130 n y n RFC1195 |
| 47 | * IDRPI 131 n y y RFC1195 |
| 48 | * IP Interface Address 132 y y n RFC1195 |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 49 | * TE Router ID 134 n y n RFC5305 |
| 50 | * Extended IP Reachability 135 n y n RFC5305 |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 51 | * Dynamic Hostname 137 n y n RFC2763 |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 52 | * Shared Risk Link Group 138 n y y RFC5307 |
Olivier Dugeon | 4f59357 | 2016-04-19 19:03:05 +0200 | [diff] [blame] | 53 | * Inter-AS Reachability 141 n y n RFC5316 |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 54 | * Restart TLV 211 y n n RFC3847 |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 55 | * MT IS Reachability 222 n y n RFC5120 |
| 56 | * MT Supported 229 y y n RFC5120 |
| 57 | * IPv6 Interface Address 232 y y n RFC5308 |
| 58 | * MT IP Reachability 235 n y n RFC5120 |
| 59 | * IPv6 IP Reachability 236 n y n RFC5308 |
| 60 | * MT IPv6 IP Reachability 237 n y n RFC5120 |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 61 | * P2P Adjacency State 240 y n n RFC3373 |
| 62 | * IIH Sequence Number 241 y n n draft-shen-isis-iih-sequence |
Olivier Dugeon | 4f59357 | 2016-04-19 19:03:05 +0200 | [diff] [blame] | 63 | * Router Capability 242 n y n RFC4971 |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 64 | * |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 65 | * |
Olivier Dugeon | 4f59357 | 2016-04-19 19:03:05 +0200 | [diff] [blame] | 66 | * IS Reachability sub-TLVs we support (See isis_te.[c,h]) |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 67 | * ____________________________________________________________________________ |
| 68 | * Name Value Status |
| 69 | * ____________________________________________________________________________ |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 70 | * Administartive group (color) 3 RFC5305 |
| 71 | * Link Local/Remote Identifiers 4 RFC5307 |
| 72 | * IPv4 interface address 6 RFC5305 |
| 73 | * IPv4 neighbor address 8 RFC5305 |
| 74 | * Maximum link bandwidth 9 RFC5305 |
| 75 | * Reservable link bandwidth 10 RFC5305 |
| 76 | * Unreserved bandwidth 11 RFC5305 |
| 77 | * TE Default metric 18 RFC5305 |
| 78 | * Link Protection Type 20 RFC5307 |
| 79 | * Interface Switching Capability 21 RFC5307 |
Olivier Dugeon | 4f59357 | 2016-04-19 19:03:05 +0200 | [diff] [blame] | 80 | * Remote AS number 24 RFC5316 |
| 81 | * IPv4 Remote ASBR identifier 25 RFC5316 |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 82 | * |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 83 | * |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 84 | * IP Reachability sub-TLVs we (should) support. |
| 85 | * ____________________________________________________________________________ |
| 86 | * Name Value Status |
| 87 | * ____________________________________________________________________________ |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 88 | * 32bit administrative tag 1 RFC5130 |
| 89 | * 64bit administrative tag 2 RFC5130 |
| 90 | * Management prefix color 117 RFC5120 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 91 | */ |
| 92 | |
| 93 | #define AREA_ADDRESSES 1 |
| 94 | #define IS_NEIGHBOURS 2 |
| 95 | #define ES_NEIGHBOURS 3 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 96 | #define LAN_NEIGHBOURS 6 |
| 97 | #define PADDING 8 |
| 98 | #define LSP_ENTRIES 9 |
| 99 | #define AUTH_INFO 10 |
| 100 | #define CHECKSUM 12 |
| 101 | #define TE_IS_NEIGHBOURS 22 |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 102 | #define IS_ALIAS 24 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 103 | #define IPV4_INT_REACHABILITY 128 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 104 | #define PROTOCOLS_SUPPORTED 129 |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 105 | #define IPV4_EXT_REACHABILITY 130 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 106 | #define IDRP_INFO 131 |
| 107 | #define IPV4_ADDR 132 |
| 108 | #define TE_ROUTER_ID 134 |
| 109 | #define TE_IPV4_REACHABILITY 135 |
| 110 | #define DYNAMIC_HOSTNAME 137 |
hasso | 00995cf | 2004-05-19 13:43:50 +0000 | [diff] [blame] | 111 | #define GRACEFUL_RESTART 211 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 112 | #define IPV6_ADDR 232 |
hasso | 72b9c95 | 2005-09-19 06:02:34 +0000 | [diff] [blame] | 113 | #define IPV6_REACHABILITY 236 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 114 | #define WAY3_HELLO 240 |
Olivier Dugeon | 4f59357 | 2016-04-19 19:03:05 +0200 | [diff] [blame] | 115 | #define ROUTER_INFORMATION 242 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 116 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 117 | #define AUTH_INFO_HDRLEN 3 |
| 118 | |
Christian Franke | f35169e | 2015-11-12 14:09:08 +0100 | [diff] [blame] | 119 | #define MAX_TLV_LEN 255 |
| 120 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 121 | #define IS_NEIGHBOURS_LEN (ISIS_SYS_ID_LEN + 5) |
| 122 | #define LAN_NEIGHBOURS_LEN 6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 123 | #define LSP_ENTRIES_LEN (10 + ISIS_SYS_ID_LEN) /* FIXME: should be entry */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 124 | #define IPV4_REACH_LEN 12 |
| 125 | #define IPV6_REACH_LEN 22 |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 126 | #define TE_IPV4_REACH_LEN 9 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 127 | |
Olivier Dugeon | 4f59357 | 2016-04-19 19:03:05 +0200 | [diff] [blame] | 128 | #define MAX_SUBTLV_SIZE 256 |
| 129 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 130 | /* struct for neighbor */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 131 | struct is_neigh |
| 132 | { |
| 133 | struct metric metrics; |
| 134 | u_char neigh_id[ISIS_SYS_ID_LEN + 1]; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 135 | }; |
| 136 | |
Olivier Dugeon | 4f59357 | 2016-04-19 19:03:05 +0200 | [diff] [blame] | 137 | /* struct for te metric */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 138 | struct te_is_neigh |
| 139 | { |
| 140 | u_char neigh_id[ISIS_SYS_ID_LEN + 1]; |
| 141 | u_char te_metric[3]; |
| 142 | u_char sub_tlvs_length; |
Olivier Dugeon | 4f59357 | 2016-04-19 19:03:05 +0200 | [diff] [blame] | 143 | /* Theorical Maximum SubTLVs is 256 because the sub_tlvs_length is 8 bits */ |
| 144 | /* Practically, 118 bytes are necessary to store all supported TE parameters */ |
| 145 | /* FIXME: A pointer will use less memory, but need to be free */ |
| 146 | /* which is hard to fix, especially within free_tlvs() function */ |
| 147 | /* and malloc() / free() as a CPU cost compared to the memory usage */ |
| 148 | u_char sub_tlvs[MAX_SUBTLV_SIZE]; /* SUB TLVs storage */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 149 | }; |
| 150 | |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 151 | /* Decode and encode three-octet metric into host byte order integer */ |
| 152 | #define GET_TE_METRIC(t) \ |
| 153 | (((unsigned)(t)->te_metric[0]<<16) | ((t)->te_metric[1]<<8) | \ |
| 154 | (t)->te_metric[2]) |
| 155 | #define SET_TE_METRIC(t, m) \ |
| 156 | (((t)->te_metric[0] = (m) >> 16), \ |
| 157 | ((t)->te_metric[1] = (m) >> 8), \ |
| 158 | ((t)->te_metric[2] = (m))) |
| 159 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 160 | /* struct for es neighbors */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 161 | struct es_neigh |
| 162 | { |
| 163 | struct metric metrics; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 164 | /* approximate position of first, we use the |
| 165 | * length ((uchar*)metric-1) to know all */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 166 | u_char first_es_neigh[ISIS_SYS_ID_LEN]; |
| 167 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 168 | }; |
| 169 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 170 | struct partition_desig_level2_is |
| 171 | { |
| 172 | struct list *isis_system_ids; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 173 | }; |
| 174 | |
| 175 | /* struct for lan neighbors */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 176 | struct lan_neigh |
| 177 | { |
| 178 | u_char LAN_addr[6]; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 179 | }; |
| 180 | |
Paul Jakma | 238497f | 2007-08-07 18:49:18 +0000 | [diff] [blame] | 181 | #ifdef __SUNPRO_C |
| 182 | #pragma pack(1) |
| 183 | #endif |
| 184 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 185 | /* struct for LSP entry */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 186 | struct lsp_entry |
| 187 | { |
| 188 | u_int16_t rem_lifetime; |
| 189 | u_char lsp_id[ISIS_SYS_ID_LEN + 2]; |
| 190 | u_int32_t seq_num; |
| 191 | u_int16_t checksum; |
| 192 | } __attribute__ ((packed)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 193 | |
Paul Jakma | 238497f | 2007-08-07 18:49:18 +0000 | [diff] [blame] | 194 | #ifdef __SUNPRO_C |
| 195 | #pragma pack() |
| 196 | #endif |
| 197 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 198 | /* struct for checksum */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 199 | struct checksum |
| 200 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 201 | u_int16_t checksum; |
| 202 | }; |
| 203 | |
| 204 | /* ipv4 reachability */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 205 | struct ipv4_reachability |
| 206 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 207 | struct metric metrics; |
| 208 | struct in_addr prefix; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 209 | struct in_addr mask; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 210 | }; |
| 211 | |
| 212 | /* te router id */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 213 | struct te_router_id |
| 214 | { |
| 215 | struct in_addr id; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 216 | }; |
| 217 | |
| 218 | /* te ipv4 reachability */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 219 | struct te_ipv4_reachability |
| 220 | { |
| 221 | u_int32_t te_metric; |
| 222 | u_char control; |
| 223 | u_char prefix_start; /* since this is variable length by nature it only */ |
| 224 | }; /* points to an approximate location */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 225 | |
| 226 | |
| 227 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 228 | struct idrp_info |
| 229 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 230 | u_char len; |
| 231 | u_char *value; |
| 232 | }; |
| 233 | |
| 234 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 235 | struct ipv6_reachability |
| 236 | { |
| 237 | u_int32_t metric; |
| 238 | u_char control_info; |
| 239 | u_char prefix_len; |
| 240 | u_char prefix[16]; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 241 | }; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 242 | |
| 243 | /* bits in control_info */ |
| 244 | #define CTRL_INFO_DIRECTION 0x80 |
Christian Franke | acf9865 | 2015-11-12 14:24:22 +0100 | [diff] [blame] | 245 | #define DIRECTION_UP 0x00 |
| 246 | #define DIRECTION_DOWN 0x80 |
| 247 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 248 | #define CTRL_INFO_DISTRIBUTION 0x40 |
Christian Franke | acf9865 | 2015-11-12 14:24:22 +0100 | [diff] [blame] | 249 | #define DISTRIBUTION_INTERNAL 0x00 |
| 250 | #define DISTRIBUTION_EXTERNAL 0x40 |
| 251 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 252 | #define CTRL_INFO_SUBTLVS 0x20 |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 253 | #endif /* HAVE_IPV6 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 254 | |
| 255 | /* |
| 256 | * Pointer to each tlv type, filled by parse_tlvs() |
| 257 | */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 258 | struct tlvs |
| 259 | { |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 260 | struct checksum *checksum; |
| 261 | struct hostname *hostname; |
| 262 | struct nlpids *nlpids; |
| 263 | struct te_router_id *router_id; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 264 | struct list *area_addrs; |
| 265 | struct list *is_neighs; |
| 266 | struct list *te_is_neighs; |
| 267 | struct list *es_neighs; |
| 268 | struct list *lsp_entries; |
| 269 | struct list *prefix_neighs; |
| 270 | struct list *lan_neighs; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 271 | struct list *ipv4_addrs; |
| 272 | struct list *ipv4_int_reachs; |
| 273 | struct list *ipv4_ext_reachs; |
| 274 | struct list *te_ipv4_reachs; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 275 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 276 | struct list *ipv6_addrs; |
| 277 | struct list *ipv6_reachs; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 278 | #endif |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 279 | struct isis_passwd auth_info; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 280 | }; |
| 281 | |
| 282 | /* |
| 283 | * Own definitions - used to bitmask found and expected |
| 284 | */ |
| 285 | |
| 286 | #define TLVFLAG_AREA_ADDRS (1<<0) |
| 287 | #define TLVFLAG_IS_NEIGHS (1<<1) |
| 288 | #define TLVFLAG_ES_NEIGHS (1<<2) |
| 289 | #define TLVFLAG_PARTITION_DESIG_LEVEL2_IS (1<<3) |
| 290 | #define TLVFLAG_PREFIX_NEIGHS (1<<4) |
| 291 | #define TLVFLAG_LAN_NEIGHS (1<<5) |
| 292 | #define TLVFLAG_LSP_ENTRIES (1<<6) |
| 293 | #define TLVFLAG_PADDING (1<<7) |
| 294 | #define TLVFLAG_AUTH_INFO (1<<8) |
| 295 | #define TLVFLAG_IPV4_INT_REACHABILITY (1<<9) |
| 296 | #define TLVFLAG_NLPID (1<<10) |
| 297 | #define TLVFLAG_IPV4_EXT_REACHABILITY (1<<11) |
| 298 | #define TLVFLAG_IPV4_ADDR (1<<12) |
| 299 | #define TLVFLAG_DYN_HOSTNAME (1<<13) |
| 300 | #define TLVFLAG_IPV6_ADDR (1<<14) |
| 301 | #define TLVFLAG_IPV6_REACHABILITY (1<<15) |
| 302 | #define TLVFLAG_TE_IS_NEIGHS (1<<16) |
| 303 | #define TLVFLAG_TE_IPV4_REACHABILITY (1<<17) |
| 304 | #define TLVFLAG_3WAY_HELLO (1<<18) |
| 305 | #define TLVFLAG_TE_ROUTER_ID (1<<19) |
| 306 | #define TLVFLAG_CHECKSUM (1<<20) |
hasso | 00995cf | 2004-05-19 13:43:50 +0000 | [diff] [blame] | 307 | #define TLVFLAG_GRACEFUL_RESTART (1<<21) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 308 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 309 | void init_tlvs (struct tlvs *tlvs, uint32_t expected); |
| 310 | void free_tlvs (struct tlvs *tlvs); |
| 311 | int parse_tlvs (char *areatag, u_char * stream, int size, |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 312 | u_int32_t * expected, u_int32_t * found, struct tlvs *tlvs, |
| 313 | u_int32_t * auth_tlv_offset); |
| 314 | int add_tlv (u_char, u_char, u_char *, struct stream *); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 315 | void free_tlv (void *val); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 316 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 317 | int tlv_add_area_addrs (struct list *area_addrs, struct stream *stream); |
| 318 | int tlv_add_is_neighs (struct list *is_neighs, struct stream *stream); |
hasso | ea3be4c | 2005-09-26 17:11:12 +0000 | [diff] [blame] | 319 | int tlv_add_te_is_neighs (struct list *te_is_neighs, struct stream *stream); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 320 | int tlv_add_lan_neighs (struct list *lan_neighs, struct stream *stream); |
| 321 | int tlv_add_nlpid (struct nlpids *nlpids, struct stream *stream); |
| 322 | int tlv_add_checksum (struct checksum *checksum, struct stream *stream); |
Josh Bailey | 3f045a0 | 2012-03-24 08:35:20 -0700 | [diff] [blame] | 323 | int tlv_add_authinfo (u_char auth_type, u_char authlen, u_char *auth_value, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 324 | struct stream *stream); |
| 325 | int tlv_add_ip_addrs (struct list *ip_addrs, struct stream *stream); |
hasso | 81ad8f6 | 2005-09-26 17:58:24 +0000 | [diff] [blame] | 326 | int tlv_add_in_addr (struct in_addr *, struct stream *stream, u_char tag); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 327 | int tlv_add_dynamic_hostname (struct hostname *hostname, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 328 | struct stream *stream); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 329 | int tlv_add_lsp_entries (struct list *lsps, struct stream *stream); |
Christian Franke | acf9865 | 2015-11-12 14:24:22 +0100 | [diff] [blame] | 330 | int tlv_add_ipv4_int_reachs (struct list *ipv4_reachs, struct stream *stream); |
| 331 | int tlv_add_ipv4_ext_reachs (struct list *ipv4_reachs, struct stream *stream); |
hasso | ea3be4c | 2005-09-26 17:11:12 +0000 | [diff] [blame] | 332 | int tlv_add_te_ipv4_reachs (struct list *te_ipv4_reachs, struct stream *stream); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 333 | #ifdef HAVE_IPV6 |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 334 | int tlv_add_ipv6_addrs (struct list *ipv6_addrs, struct stream *stream); |
| 335 | int tlv_add_ipv6_reachs (struct list *ipv6_reachs, struct stream *stream); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 336 | #endif /* HAVE_IPV6 */ |
| 337 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 338 | int tlv_add_padding (struct stream *stream); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 339 | |
| 340 | #endif /* _ZEBRA_ISIS_TLV_H */ |