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