]> The Tcpdump Group git mirrors - tcpdump/blob - print-eigrp.c
gre: add support for MikroTik Ethernet-over-IP hack.
[tcpdump] / print-eigrp.c
1 /*
2 * Copyright (c) 1998-2004 Hannes Gredler <hannes@gredler.at>
3 * The TCPDUMP project
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code
7 * distributions retain the above copyright notice and this paragraph
8 * in its entirety, and (2) distributions including binary code include
9 * the above copyright notice and this paragraph in its entirety in
10 * the documentation or other materials provided with the distribution.
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
12 * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
13 * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 * FOR A PARTICULAR PURPOSE.
15 */
16
17 /* \summary: Enhanced Interior Gateway Routing Protocol (EIGRP) printer */
18
19 /*
20 * specification:
21 *
22 * https://web.archive.org/web/20190722221712/https://www.rhyshaden.com/eigrp.htm
23 * RFC 7868
24 */
25
26 #ifdef HAVE_CONFIG_H
27 #include <config.h>
28 #endif
29
30 #include "netdissect-stdinc.h"
31
32 #include <string.h>
33
34 #define ND_LONGJMP_FROM_TCHECK
35 #include "netdissect.h"
36 #include "extract.h"
37 #include "addrtoname.h"
38
39
40 struct eigrp_common_header {
41 nd_uint8_t version;
42 nd_uint8_t opcode;
43 nd_uint16_t checksum;
44 nd_uint32_t flags;
45 nd_uint32_t seq;
46 nd_uint32_t ack;
47 nd_uint16_t vrid;
48 nd_uint16_t asn;
49 };
50
51 #define EIGRP_VERSION 2
52
53 #define EIGRP_OPCODE_UPDATE 1
54 #define EIGRP_OPCODE_QUERY 3
55 #define EIGRP_OPCODE_REPLY 4
56 #define EIGRP_OPCODE_HELLO 5
57 #define EIGRP_OPCODE_IPXSAP 6
58 #define EIGRP_OPCODE_PROBE 7
59
60 static const struct tok eigrp_opcode_values[] = {
61 { EIGRP_OPCODE_UPDATE, "Update" },
62 { EIGRP_OPCODE_QUERY, "Query" },
63 { EIGRP_OPCODE_REPLY, "Reply" },
64 { EIGRP_OPCODE_HELLO, "Hello" },
65 { EIGRP_OPCODE_IPXSAP, "IPX SAP" },
66 { EIGRP_OPCODE_PROBE, "Probe" },
67 { 0, NULL}
68 };
69
70 static const struct tok eigrp_common_header_flag_values[] = {
71 { 0x01, "Init" },
72 { 0x02, "Conditionally Received" },
73 { 0x04, "Restart" },
74 { 0x08, "End-of-Table" },
75 { 0, NULL}
76 };
77
78 struct eigrp_tlv_header {
79 nd_uint16_t type;
80 nd_uint16_t length;
81 };
82
83 #define EIGRP_TLV_GENERAL_PARM 0x0001
84 #define EIGRP_TLV_AUTH 0x0002
85 #define EIGRP_TLV_SEQ 0x0003
86 #define EIGRP_TLV_SW_VERSION 0x0004
87 #define EIGRP_TLV_MCAST_SEQ 0x0005
88 #define EIGRP_TLV_IP_INT 0x0102
89 #define EIGRP_TLV_IP_EXT 0x0103
90 #define EIGRP_TLV_AT_INT 0x0202
91 #define EIGRP_TLV_AT_EXT 0x0203
92 #define EIGRP_TLV_AT_CABLE_SETUP 0x0204
93 #define EIGRP_TLV_IPX_INT 0x0302
94 #define EIGRP_TLV_IPX_EXT 0x0303
95
96 static const struct tok eigrp_tlv_values[] = {
97 { EIGRP_TLV_GENERAL_PARM, "General Parameters"},
98 { EIGRP_TLV_AUTH, "Authentication"},
99 { EIGRP_TLV_SEQ, "Sequence"},
100 { EIGRP_TLV_SW_VERSION, "Software Version"},
101 { EIGRP_TLV_MCAST_SEQ, "Next Multicast Sequence"},
102 { EIGRP_TLV_IP_INT, "IP Internal routes"},
103 { EIGRP_TLV_IP_EXT, "IP External routes"},
104 { EIGRP_TLV_AT_INT, "AppleTalk Internal routes"},
105 { EIGRP_TLV_AT_EXT, "AppleTalk External routes"},
106 { EIGRP_TLV_AT_CABLE_SETUP, "AppleTalk Cable setup"},
107 { EIGRP_TLV_IPX_INT, "IPX Internal routes"},
108 { EIGRP_TLV_IPX_EXT, "IPX External routes"},
109 { 0, NULL}
110 };
111
112 struct eigrp_tlv_general_parm_t {
113 nd_uint8_t k1;
114 nd_uint8_t k2;
115 nd_uint8_t k3;
116 nd_uint8_t k4;
117 nd_uint8_t k5;
118 nd_uint8_t res;
119 nd_uint16_t holdtime;
120 };
121
122 struct eigrp_tlv_sw_version_t {
123 nd_uint8_t ios_major;
124 nd_uint8_t ios_minor;
125 nd_uint8_t eigrp_major;
126 nd_uint8_t eigrp_minor;
127 };
128
129 struct eigrp_tlv_ip_int_t {
130 nd_ipv4 nexthop;
131 nd_uint32_t delay;
132 nd_uint32_t bandwidth;
133 nd_uint24_t mtu;
134 nd_uint8_t hopcount;
135 nd_uint8_t reliability;
136 nd_uint8_t load;
137 nd_byte reserved[2];
138 nd_uint8_t plen;
139 nd_uint8_t destination; /* variable length [1-4] bytes encoding */
140 };
141
142 struct eigrp_tlv_ip_ext_t {
143 nd_ipv4 nexthop;
144 nd_ipv4 origin_router;
145 nd_uint32_t origin_as;
146 nd_uint32_t tag;
147 nd_uint32_t metric;
148 nd_byte reserved[2];
149 nd_uint8_t proto_id;
150 nd_uint8_t flags;
151 nd_uint32_t delay;
152 nd_uint32_t bandwidth;
153 nd_uint24_t mtu;
154 nd_uint8_t hopcount;
155 nd_uint8_t reliability;
156 nd_uint8_t load;
157 nd_byte reserved2[2];
158 nd_uint8_t plen;
159 nd_uint8_t destination; /* variable length [1-4] bytes encoding */
160 };
161
162 struct eigrp_tlv_at_cable_setup_t {
163 nd_uint16_t cable_start;
164 nd_uint16_t cable_end;
165 nd_uint32_t router_id;
166 };
167
168 struct eigrp_tlv_at_int_t {
169 nd_byte nexthop[4];
170 nd_uint32_t delay;
171 nd_uint32_t bandwidth;
172 nd_uint24_t mtu;
173 nd_uint8_t hopcount;
174 nd_uint8_t reliability;
175 nd_uint8_t load;
176 nd_byte reserved[2];
177 nd_uint16_t cable_start;
178 nd_uint16_t cable_end;
179 };
180
181 struct eigrp_tlv_at_ext_t {
182 nd_byte nexthop[4];
183 nd_uint32_t origin_router;
184 nd_uint32_t origin_as;
185 nd_uint32_t tag;
186 nd_uint8_t proto_id;
187 nd_uint8_t flags;
188 nd_uint16_t metric;
189 nd_uint32_t delay;
190 nd_uint32_t bandwidth;
191 nd_uint24_t mtu;
192 nd_uint8_t hopcount;
193 nd_uint8_t reliability;
194 nd_uint8_t load;
195 nd_byte reserved2[2];
196 nd_uint16_t cable_start;
197 nd_uint16_t cable_end;
198 };
199
200 static const struct tok eigrp_ext_proto_id_values[] = {
201 { 0x01, "IGRP" },
202 { 0x02, "EIGRP" },
203 { 0x03, "Static" },
204 { 0x04, "RIP" },
205 { 0x05, "Hello" },
206 { 0x06, "OSPF" },
207 { 0x07, "IS-IS" },
208 { 0x08, "EGP" },
209 { 0x09, "BGP" },
210 { 0x0a, "IDRP" },
211 { 0x0b, "Connected" },
212 { 0, NULL}
213 };
214
215 void
216 eigrp_print(netdissect_options *ndo, const u_char *pptr, u_int len)
217 {
218 const struct eigrp_common_header *eigrp_com_header;
219 const struct eigrp_tlv_header *eigrp_tlv_header;
220 const u_char *tptr,*tlv_tptr;
221 u_int tlen,eigrp_tlv_len,eigrp_tlv_type,tlv_tlen, byte_length, bit_length;
222 uint8_t prefix[4];
223
224 union {
225 const struct eigrp_tlv_general_parm_t *eigrp_tlv_general_parm;
226 const struct eigrp_tlv_sw_version_t *eigrp_tlv_sw_version;
227 const struct eigrp_tlv_ip_int_t *eigrp_tlv_ip_int;
228 const struct eigrp_tlv_ip_ext_t *eigrp_tlv_ip_ext;
229 const struct eigrp_tlv_at_cable_setup_t *eigrp_tlv_at_cable_setup;
230 const struct eigrp_tlv_at_int_t *eigrp_tlv_at_int;
231 const struct eigrp_tlv_at_ext_t *eigrp_tlv_at_ext;
232 } tlv_ptr;
233
234 ndo->ndo_protocol = "eigrp";
235 tptr=pptr;
236 tlen = len;
237 eigrp_com_header = (const struct eigrp_common_header *)pptr;
238
239 /*
240 * Sanity checking of the header.
241 */
242 if (len < sizeof(struct eigrp_common_header)) {
243 ND_PRINT("EIGRP %s, length: %u (too short, < %zu)",
244 tok2str(eigrp_opcode_values, "unknown (%u)",GET_U_1(eigrp_com_header->opcode)),
245 len, sizeof(struct eigrp_common_header));
246 goto check_remainder;
247 }
248 if (GET_U_1(eigrp_com_header->version) != EIGRP_VERSION) {
249 ND_PRINT("EIGRP version %u packet not supported",
250 GET_U_1(eigrp_com_header->version));
251 goto check_remainder;
252 }
253
254 /* in non-verbose mode just lets print the basic Message Type*/
255 if (ndo->ndo_vflag < 1) {
256 ND_PRINT("EIGRP %s, length: %u",
257 tok2str(eigrp_opcode_values, "unknown (%u)",GET_U_1(eigrp_com_header->opcode)),
258 len);
259 goto check_remainder;
260 }
261
262 /* ok they seem to want to know everything - lets fully decode it */
263 tlen -= sizeof(struct eigrp_common_header);
264
265 ND_PRINT("\n\tEIGRP v%u, opcode: %s (%u), chksum: 0x%04x, Flags: [%s]"
266 "\n\tseq: 0x%08x, ack: 0x%08x, VRID: %u, AS: %u, length: %u",
267 GET_U_1(eigrp_com_header->version),
268 tok2str(eigrp_opcode_values, "unknown, type: %u",GET_U_1(eigrp_com_header->opcode)),
269 GET_U_1(eigrp_com_header->opcode),
270 GET_BE_U_2(eigrp_com_header->checksum),
271 bittok2str(eigrp_common_header_flag_values,
272 "none",
273 GET_BE_U_4(eigrp_com_header->flags)),
274 GET_BE_U_4(eigrp_com_header->seq),
275 GET_BE_U_4(eigrp_com_header->ack),
276 GET_BE_U_2(eigrp_com_header->vrid),
277 GET_BE_U_2(eigrp_com_header->asn),
278 tlen);
279
280 tptr+=sizeof(struct eigrp_common_header);
281
282 while(tlen>0) {
283 if (tlen < sizeof(struct eigrp_tlv_header)) {
284 ND_PRINT("\n\t (only %u bytes of data)", tlen);
285 goto invalid;
286 }
287 eigrp_tlv_header = (const struct eigrp_tlv_header *)tptr;
288 eigrp_tlv_len=GET_BE_U_2(eigrp_tlv_header->length);
289 eigrp_tlv_type=GET_BE_U_2(eigrp_tlv_header->type);
290
291 ND_PRINT("\n\t %s TLV (0x%04x), length: %u",
292 tok2str(eigrp_tlv_values,
293 "Unknown",
294 eigrp_tlv_type),
295 eigrp_tlv_type,
296 eigrp_tlv_len);
297
298 if (eigrp_tlv_len < sizeof(struct eigrp_tlv_header) ||
299 eigrp_tlv_len > tlen) {
300 goto invalid;
301 }
302 tlv_tptr=tptr+sizeof(struct eigrp_tlv_header);
303 tlv_tlen=eigrp_tlv_len-sizeof(struct eigrp_tlv_header);
304
305 /* did we capture enough for fully decoding the object ? */
306 ND_TCHECK_LEN(tptr, eigrp_tlv_len);
307
308 switch(eigrp_tlv_type) {
309
310 case EIGRP_TLV_GENERAL_PARM:
311 tlv_ptr.eigrp_tlv_general_parm = (const struct eigrp_tlv_general_parm_t *)tlv_tptr;
312 if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_general_parm)) {
313 ND_PRINT(" (too short, < %zu)",
314 sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_general_parm));
315 break;
316 }
317
318 ND_PRINT("\n\t holdtime: %us, k1 %u, k2 %u, k3 %u, k4 %u, k5 %u",
319 GET_BE_U_2(tlv_ptr.eigrp_tlv_general_parm->holdtime),
320 GET_U_1(tlv_ptr.eigrp_tlv_general_parm->k1),
321 GET_U_1(tlv_ptr.eigrp_tlv_general_parm->k2),
322 GET_U_1(tlv_ptr.eigrp_tlv_general_parm->k3),
323 GET_U_1(tlv_ptr.eigrp_tlv_general_parm->k4),
324 GET_U_1(tlv_ptr.eigrp_tlv_general_parm->k5));
325 break;
326
327 case EIGRP_TLV_SW_VERSION:
328 tlv_ptr.eigrp_tlv_sw_version = (const struct eigrp_tlv_sw_version_t *)tlv_tptr;
329 if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_sw_version)) {
330 ND_PRINT(" (too short, < %zu)",
331 sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_sw_version));
332 break;
333 }
334
335 ND_PRINT("\n\t IOS version: %u.%u, EIGRP version %u.%u",
336 GET_U_1(tlv_ptr.eigrp_tlv_sw_version->ios_major),
337 GET_U_1(tlv_ptr.eigrp_tlv_sw_version->ios_minor),
338 GET_U_1(tlv_ptr.eigrp_tlv_sw_version->eigrp_major),
339 GET_U_1(tlv_ptr.eigrp_tlv_sw_version->eigrp_minor));
340 break;
341
342 case EIGRP_TLV_IP_INT:
343 tlv_ptr.eigrp_tlv_ip_int = (const struct eigrp_tlv_ip_int_t *)tlv_tptr;
344 if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_ip_int)) {
345 ND_PRINT(" (too short, < %zu)",
346 sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_ip_int));
347 break;
348 }
349
350 bit_length = GET_U_1(tlv_ptr.eigrp_tlv_ip_int->plen);
351 if (bit_length > 32) {
352 ND_PRINT("\n\t illegal prefix length %u",bit_length);
353 break;
354 }
355 byte_length = (bit_length + 7) / 8; /* variable length encoding */
356 memset(prefix, 0, 4);
357 GET_CPY_BYTES(prefix, tlv_ptr.eigrp_tlv_ip_int->destination, byte_length);
358
359 ND_PRINT("\n\t IPv4 prefix: %15s/%u, nexthop: ",
360 ipaddr_string(ndo, prefix), /* local buffer, not packet data; don't use GET_IPADDR_STRING() */
361 bit_length);
362 if (GET_BE_U_4(tlv_ptr.eigrp_tlv_ip_int->nexthop) == 0)
363 ND_PRINT("self");
364 else
365 ND_PRINT("%s",
366 GET_IPADDR_STRING(tlv_ptr.eigrp_tlv_ip_int->nexthop));
367
368 ND_PRINT("\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u",
369 (GET_BE_U_4(tlv_ptr.eigrp_tlv_ip_int->delay)/100),
370 GET_BE_U_4(tlv_ptr.eigrp_tlv_ip_int->bandwidth),
371 GET_BE_U_3(tlv_ptr.eigrp_tlv_ip_int->mtu),
372 GET_U_1(tlv_ptr.eigrp_tlv_ip_int->hopcount),
373 GET_U_1(tlv_ptr.eigrp_tlv_ip_int->reliability),
374 GET_U_1(tlv_ptr.eigrp_tlv_ip_int->load));
375 break;
376
377 case EIGRP_TLV_IP_EXT:
378 tlv_ptr.eigrp_tlv_ip_ext = (const struct eigrp_tlv_ip_ext_t *)tlv_tptr;
379 if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_ip_ext)) {
380 ND_PRINT(" (too short, < %zu)",
381 sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_ip_ext));
382 break;
383 }
384
385 bit_length = GET_U_1(tlv_ptr.eigrp_tlv_ip_ext->plen);
386 if (bit_length > 32) {
387 ND_PRINT("\n\t illegal prefix length %u",bit_length);
388 break;
389 }
390 byte_length = (bit_length + 7) / 8; /* variable length encoding */
391 memset(prefix, 0, 4);
392 GET_CPY_BYTES(prefix, tlv_ptr.eigrp_tlv_ip_ext->destination, byte_length);
393
394 ND_PRINT("\n\t IPv4 prefix: %15s/%u, nexthop: ",
395 ipaddr_string(ndo, prefix), /* local buffer, not packet data; don't use GET_IPADDR_STRING() */
396 bit_length);
397 if (GET_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->nexthop) == 0)
398 ND_PRINT("self");
399 else
400 ND_PRINT("%s",
401 GET_IPADDR_STRING(tlv_ptr.eigrp_tlv_ip_ext->nexthop));
402
403 ND_PRINT("\n\t origin-router %s, origin-as %u, origin-proto %s, flags [0x%02x], tag 0x%08x, metric %u",
404 GET_IPADDR_STRING(tlv_ptr.eigrp_tlv_ip_ext->origin_router),
405 GET_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->origin_as),
406 tok2str(eigrp_ext_proto_id_values,"unknown",GET_U_1(tlv_ptr.eigrp_tlv_ip_ext->proto_id)),
407 GET_U_1(tlv_ptr.eigrp_tlv_ip_ext->flags),
408 GET_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->tag),
409 GET_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->metric));
410
411 ND_PRINT("\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u",
412 (GET_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->delay)/100),
413 GET_BE_U_4(tlv_ptr.eigrp_tlv_ip_ext->bandwidth),
414 GET_BE_U_3(tlv_ptr.eigrp_tlv_ip_ext->mtu),
415 GET_U_1(tlv_ptr.eigrp_tlv_ip_ext->hopcount),
416 GET_U_1(tlv_ptr.eigrp_tlv_ip_ext->reliability),
417 GET_U_1(tlv_ptr.eigrp_tlv_ip_ext->load));
418 break;
419
420 case EIGRP_TLV_AT_CABLE_SETUP:
421 tlv_ptr.eigrp_tlv_at_cable_setup = (const struct eigrp_tlv_at_cable_setup_t *)tlv_tptr;
422 if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_at_cable_setup)) {
423 ND_PRINT(" (too short, < %zu)",
424 sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_at_cable_setup));
425 break;
426 }
427
428 ND_PRINT("\n\t Cable-range: %u-%u, Router-ID %u",
429 GET_BE_U_2(tlv_ptr.eigrp_tlv_at_cable_setup->cable_start),
430 GET_BE_U_2(tlv_ptr.eigrp_tlv_at_cable_setup->cable_end),
431 GET_BE_U_4(tlv_ptr.eigrp_tlv_at_cable_setup->router_id));
432 break;
433
434 case EIGRP_TLV_AT_INT:
435 tlv_ptr.eigrp_tlv_at_int = (const struct eigrp_tlv_at_int_t *)tlv_tptr;
436 if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_at_int)) {
437 ND_PRINT(" (too short, < %zu)",
438 sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_at_int));
439 break;
440 }
441
442 ND_PRINT("\n\t Cable-Range: %u-%u, nexthop: ",
443 GET_BE_U_2(tlv_ptr.eigrp_tlv_at_int->cable_start),
444 GET_BE_U_2(tlv_ptr.eigrp_tlv_at_int->cable_end));
445
446 if (GET_BE_U_4(tlv_ptr.eigrp_tlv_at_int->nexthop) == 0)
447 ND_PRINT("self");
448 else
449 ND_PRINT("%u.%u",
450 GET_BE_U_2(&tlv_ptr.eigrp_tlv_at_int->nexthop[0]),
451 GET_BE_U_2(&tlv_ptr.eigrp_tlv_at_int->nexthop[2]));
452
453 ND_PRINT("\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u",
454 (GET_BE_U_4(tlv_ptr.eigrp_tlv_at_int->delay)/100),
455 GET_BE_U_4(tlv_ptr.eigrp_tlv_at_int->bandwidth),
456 GET_BE_U_3(tlv_ptr.eigrp_tlv_at_int->mtu),
457 GET_U_1(tlv_ptr.eigrp_tlv_at_int->hopcount),
458 GET_U_1(tlv_ptr.eigrp_tlv_at_int->reliability),
459 GET_U_1(tlv_ptr.eigrp_tlv_at_int->load));
460 break;
461
462 case EIGRP_TLV_AT_EXT:
463 tlv_ptr.eigrp_tlv_at_ext = (const struct eigrp_tlv_at_ext_t *)tlv_tptr;
464 if (tlv_tlen < sizeof(*tlv_ptr.eigrp_tlv_at_ext)) {
465 ND_PRINT(" (too short, < %zu)",
466 sizeof(struct eigrp_tlv_header) + sizeof(*tlv_ptr.eigrp_tlv_at_ext));
467 break;
468 }
469
470 ND_PRINT("\n\t Cable-Range: %u-%u, nexthop: ",
471 GET_BE_U_2(tlv_ptr.eigrp_tlv_at_ext->cable_start),
472 GET_BE_U_2(tlv_ptr.eigrp_tlv_at_ext->cable_end));
473
474 if (GET_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->nexthop) == 0)
475 ND_PRINT("self");
476 else
477 ND_PRINT("%u.%u",
478 GET_BE_U_2(&tlv_ptr.eigrp_tlv_at_ext->nexthop[0]),
479 GET_BE_U_2(&tlv_ptr.eigrp_tlv_at_ext->nexthop[2]));
480
481 ND_PRINT("\n\t origin-router %u, origin-as %u, origin-proto %s, flags [0x%02x], tag 0x%08x, metric %u",
482 GET_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->origin_router),
483 GET_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->origin_as),
484 tok2str(eigrp_ext_proto_id_values,"unknown",GET_U_1(tlv_ptr.eigrp_tlv_at_ext->proto_id)),
485 GET_U_1(tlv_ptr.eigrp_tlv_at_ext->flags),
486 GET_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->tag),
487 GET_BE_U_2(tlv_ptr.eigrp_tlv_at_ext->metric));
488
489 ND_PRINT("\n\t delay %u ms, bandwidth %u Kbps, mtu %u, hop %u, reliability %u, load %u",
490 (GET_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->delay)/100),
491 GET_BE_U_4(tlv_ptr.eigrp_tlv_at_ext->bandwidth),
492 GET_BE_U_3(tlv_ptr.eigrp_tlv_at_ext->mtu),
493 GET_U_1(tlv_ptr.eigrp_tlv_at_ext->hopcount),
494 GET_U_1(tlv_ptr.eigrp_tlv_at_ext->reliability),
495 GET_U_1(tlv_ptr.eigrp_tlv_at_ext->load));
496 break;
497
498 /*
499 * FIXME those are the defined TLVs that lack a decoder
500 * you are welcome to contribute code ;-)
501 */
502
503 case EIGRP_TLV_AUTH:
504 case EIGRP_TLV_SEQ:
505 case EIGRP_TLV_MCAST_SEQ:
506 case EIGRP_TLV_IPX_INT:
507 case EIGRP_TLV_IPX_EXT:
508
509 default:
510 if (ndo->ndo_vflag <= 1)
511 print_unknown_data(ndo,tlv_tptr,"\n\t ",tlv_tlen);
512 break;
513 }
514 /* do we want to see an additionally hexdump ? */
515 if (ndo->ndo_vflag > 1)
516 print_unknown_data(ndo,tptr+sizeof(struct eigrp_tlv_header),"\n\t ",
517 eigrp_tlv_len-sizeof(struct eigrp_tlv_header));
518
519 tptr+=eigrp_tlv_len;
520 tlen-=eigrp_tlv_len;
521 }
522 return;
523 invalid:
524 nd_print_invalid(ndo);
525 check_remainder:
526 ND_TCHECK_LEN(tptr, tlen);
527 }