2 * Routines for EIGRP dissection
3 * Copyright 2000, Paul Ionescu <paul@acorp.ro>
5 * $Id: packet-eigrp.c,v 1.10 2001/01/03 06:55:27 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@zing.org>
9 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #ifdef HAVE_SYS_TYPES_H
32 # include <sys/types.h>
35 #ifdef HAVE_NETINET_IN_H
36 # include <netinet/in.h>
43 #include "packet-atalk.h"
44 #include "packet-ip.h"
45 #include "packet-ipx.h"
47 #define EIGRP_UPDATE 0x01
48 #define EIGRP_REQUEST 0x02
49 #define EIGRP_QUERY 0x03
50 #define EIGRP_REPLY 0x04
51 #define EIGRP_HELLO 0x05
52 #define EIGRP_SAP 0x06
53 #define EIGRP_HI 0x20 /* This value is for my own need to make a difference between Hello and Ack */
54 #define EIGRP_ACK 0x40 /* This value is for my own need to make a difference between Hello and Ack */
56 #define TLV_PAR 0x0001
57 #define TLV_SEQ 0x0003
59 #define TLV_NMS 0x0005
60 #define TLV_IP_INT 0x0102
61 #define TLV_IP_EXT 0x0103
62 #define TLV_AT_INT 0x0202
63 #define TLV_AT_EXT 0x0203
64 #define TLV_AT_CBL 0x0204
65 #define TLV_IPX_INT 0x0302
66 #define TLV_IPX_EXT 0x0303
68 #define EIGRP_HEADER_LENGTH 20
70 static gint proto_eigrp = -1;
72 static gint hf_eigrp_opcode = -1;
73 static gint hf_eigrp_as = -1;
74 static gint hf_eigrp_tlv = -1;
76 static gint ett_eigrp = -1;
77 static gint ett_tlv = -1;
79 static const value_string eigrp_opcode_vals[] = {
80 { EIGRP_HELLO, "Hello/Ack" },
81 { EIGRP_UPDATE, "Update" },
82 { EIGRP_REPLY, "Reply" },
83 { EIGRP_QUERY, "Query" },
84 { EIGRP_REQUEST, "Request" },
85 { EIGRP_SAP, "IPX/SAP Update" },
86 { EIGRP_HI, "Hello" },
87 { EIGRP_ACK, "Acknowledge" },
91 static const value_string eigrp_tlv_vals[] = {
92 { TLV_PAR, "EIGRP Parameters"},
93 { TLV_SEQ , "Sequence"},
94 { TLV_SV, "Software Version"},
95 { TLV_NMS , "Next multicast sequence"},
96 { TLV_IP_INT, "IP internal route"},
97 { TLV_IP_EXT, "IP external route"},
98 { TLV_AT_INT, "AppleTalk internal route"},
99 { TLV_AT_EXT, "AppleTalk external route"},
100 { TLV_AT_CBL, "AppleTalk cable configuration"},
101 { TLV_IPX_INT, "IPX internal route"},
102 { TLV_IPX_EXT, "IPX external route"},
106 static const value_string eigrp_pid_vals[] = {
109 { 3, "Static Route"},
117 { 11, "Connected link"},
122 static void dissect_eigrp_par (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
123 static void dissect_eigrp_seq (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
124 static void dissect_eigrp_sv (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
125 static void dissect_eigrp_nms (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
127 static void dissect_eigrp_ip_int (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
128 static void dissect_eigrp_ip_ext (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
130 static void dissect_eigrp_ipx_int (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
131 static void dissect_eigrp_ipx_ext (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
133 static void dissect_eigrp_at_cbl (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
134 static void dissect_eigrp_at_int (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
135 static void dissect_eigrp_at_ext (tvbuff_t *tvb, proto_tree *tree, proto_item *ti);
138 dissect_eigrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
140 proto_tree *eigrp_tree,*tlv_tree;
144 guint opcode,opcode_tmp;
145 guint16 tlv,size, offset = EIGRP_HEADER_LENGTH;
148 CHECK_DISPLAY_AS_DATA(proto_eigrp, tvb, pinfo, tree);
150 pinfo->current_proto = "EIGRP";
152 opcode_tmp=opcode=tvb_get_guint8(tvb,1);
153 ack = tvb_get_ntohl(tvb,12);
154 if (opcode==EIGRP_HELLO) { if (ack == 0) opcode_tmp=EIGRP_HI; else opcode_tmp=EIGRP_ACK; }
156 if (check_col(pinfo->fd, COL_PROTOCOL))
157 col_set_str(pinfo->fd, COL_PROTOCOL, "EIGRP");
158 if (check_col(pinfo->fd, COL_INFO))
159 col_add_str(pinfo->fd, COL_INFO,
160 val_to_str(opcode_tmp , eigrp_opcode_vals, "Unknown (0x%04x)"));
167 ti = proto_tree_add_protocol_format(tree, proto_eigrp, tvb, 0,
168 tvb_length(tvb), "Cisco EIGRP ");
170 eigrp_tree = proto_item_add_subtree(ti, ett_eigrp);
172 proto_tree_add_text (eigrp_tree, tvb, 0,1,"Version = %u",tvb_get_guint8(tvb,0)) ;
173 proto_tree_add_uint_format (eigrp_tree, hf_eigrp_opcode, tvb, 1,1,opcode,"Opcode = %u (%s)",opcode,val_to_str(opcode_tmp,eigrp_opcode_vals, "Unknown")) ;
174 proto_tree_add_text (eigrp_tree, tvb, 2,2,"Checksum = 0x%04x",tvb_get_ntohs(tvb,2)) ;
175 proto_tree_add_text (eigrp_tree, tvb, 4,4,"Flags = 0x%08x",tvb_get_ntohl(tvb,4)) ;
176 proto_tree_add_text (eigrp_tree, tvb, 8,4,"Sequence = %u",tvb_get_ntohl(tvb,8)) ;
177 proto_tree_add_text (eigrp_tree, tvb, 12,4,"Acknowledge = %u",tvb_get_ntohl(tvb,12)) ;
178 proto_tree_add_uint (eigrp_tree, hf_eigrp_as, tvb, 16,4,tvb_get_ntohl(tvb,16)) ;
180 while ( tvb_length_remaining(tvb,offset)>0 ) {
182 tlv = tvb_get_ntohs(tvb,offset);
183 size = tvb_get_ntohs(tvb,offset+2);
185 ti = proto_tree_add_notext (eigrp_tree, tvb, offset,size);
187 tlv_tree = proto_item_add_subtree (ti, ett_tlv);
188 proto_tree_add_uint_format (tlv_tree,hf_eigrp_tlv, tvb,offset,2,tlv,"Type = 0x%04x (%s)",tlv,val_to_str(tlv,eigrp_tlv_vals, "Unknown")) ;
189 proto_tree_add_text (tlv_tree,tvb,offset+2,2,"Size = %u bytes",size) ;
191 next_tvb = tvb_new_subset(tvb, offset+4, size-4, -1);
195 dissect_eigrp_par(next_tvb, tlv_tree, ti);
198 dissect_eigrp_seq(next_tvb, tlv_tree, ti);
201 dissect_eigrp_sv(next_tvb, tlv_tree, ti);
204 dissect_eigrp_nms(next_tvb, tlv_tree, ti);
208 dissect_eigrp_ip_int(next_tvb, tlv_tree, ti);
211 dissect_eigrp_ip_ext(next_tvb, tlv_tree, ti);
215 dissect_eigrp_ipx_int(next_tvb, tlv_tree, ti);
218 dissect_eigrp_ipx_ext(next_tvb, tlv_tree, ti);
222 dissect_eigrp_at_cbl(next_tvb, tlv_tree, ti);
225 dissect_eigrp_at_int(next_tvb, tlv_tree, ti);
228 dissect_eigrp_at_ext(next_tvb, tlv_tree, ti);
232 proto_item_set_text(ti,"Unknown TLV (0x%04x)",tlv) ;
243 static void dissect_eigrp_par (tvbuff_t *tvb, proto_tree *tree, proto_item *ti) {
244 proto_tree_add_text (tree,tvb,0,1,"K1 = %u",tvb_get_guint8(tvb,0));
245 proto_tree_add_text (tree,tvb,1,1,"K2 = %u",tvb_get_guint8(tvb,1));
246 proto_tree_add_text (tree,tvb,2,1,"K3 = %u",tvb_get_guint8(tvb,2));
247 proto_tree_add_text (tree,tvb,3,1,"K4 = %u",tvb_get_guint8(tvb,3));
248 proto_tree_add_text (tree,tvb,4,1,"K5 = %u",tvb_get_guint8(tvb,4));
249 proto_tree_add_text (tree,tvb,5,1,"Rezerved");
250 proto_tree_add_text (tree,tvb,6,2,"Hold Time = %u",tvb_get_ntohs(tvb,6));
251 proto_item_set_text (ti,"%s",match_strval(TLV_PAR,eigrp_tlv_vals));
255 static void dissect_eigrp_seq (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
257 addr_len=tvb_get_guint8(tvb,0);
258 proto_tree_add_text (tree,tvb,0,1,"Address length = %u",addr_len);
261 proto_tree_add_text (tree,tvb,1,addr_len,"IP Address = %u.%u.%u.%u",tvb_get_guint8(tvb,1),tvb_get_guint8(tvb,2),tvb_get_guint8(tvb,3),tvb_get_guint8(tvb,4));
264 proto_tree_add_text (tree,tvb,1,addr_len,"IPX Address = %08x.%04x.%04x.%04x",tvb_get_ntohl(tvb,1),tvb_get_ntohs(tvb,5),tvb_get_ntohs(tvb,7),tvb_get_ntohs(tvb,9));
270 proto_item_set_text (ti,"%s",match_strval(TLV_SEQ,eigrp_tlv_vals));
274 static void dissect_eigrp_sv (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
276 proto_tree_add_text (tree,tvb,0,2," IOS release version = %u.%u",tvb_get_guint8(tvb,0),tvb_get_guint8(tvb,1));
277 proto_tree_add_text (tree,tvb,2,2,"EIGRP release version = %u.%u",tvb_get_guint8(tvb,2),tvb_get_guint8(tvb,3));
278 proto_item_set_text (ti,"%s : IOS=%u.%u, EIGRP=%u.%u ",match_strval(TLV_SV,eigrp_tlv_vals),tvb_get_guint8(tvb,0),tvb_get_guint8(tvb,1),tvb_get_guint8(tvb,2),tvb_get_guint8(tvb,3));
282 static void dissect_eigrp_nms (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
284 proto_tree_add_text (tree,tvb,0,4,"Next Multicast Sequence = %u",tvb_get_ntohl(tvb,0));
285 proto_item_set_text (ti,"%s : %u",match_strval(TLV_NMS,eigrp_tlv_vals),tvb_get_ntohl(tvb,0));
290 static void dissect_eigrp_ip_int (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
292 guint8 ip_addr[4],length,addr_len;
293 tvb_memcpy(tvb,ip_addr,0,4);
294 proto_tree_add_text (tree,tvb,0,4, "Next Hop = %s",ip_to_str(ip_addr));
295 proto_tree_add_text (tree,tvb,4,4, "Delay = %u",tvb_get_ntohl(tvb,4));
296 proto_tree_add_text (tree,tvb,8,4, "Bandwidth = %u",tvb_get_ntohl(tvb,8));
297 proto_tree_add_text (tree,tvb,12,3,"MTU = %u",tvb_get_ntoh24(tvb,12));
298 proto_tree_add_text (tree,tvb,15,1,"Hop Count = %u",tvb_get_guint8(tvb,15));
299 proto_tree_add_text (tree,tvb,16,1,"Reliability = %u",tvb_get_guint8(tvb,16));
300 proto_tree_add_text (tree,tvb,17,1,"Load = %u",tvb_get_guint8(tvb,17));
301 proto_tree_add_text (tree,tvb,18,2,"Rezerved ");
302 length=tvb_get_guint8(tvb,20);
303 proto_tree_add_text (tree,tvb,20,1,"Prefix Length = %u",length);
304 if (length % 8 == 0) addr_len=length/8 ; else addr_len=length/8+1;
305 ip_addr[0]=ip_addr[1]=ip_addr[2]=ip_addr[3]=0;
306 tvb_memcpy(tvb,ip_addr,21,addr_len);
307 proto_tree_add_text (tree,tvb,21,addr_len,"Destination = %s",ip_to_str(ip_addr));
308 proto_item_set_text (ti,"%s = %s/%u%s",match_strval(TLV_IP_INT,eigrp_tlv_vals),ip_to_str(ip_addr),length,((tvb_get_ntohl(tvb,4)==0xffffffff)?" - Destination unreachable":""));
311 static void dissect_eigrp_ip_ext (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
313 guint8 ip_addr[4],length,addr_len;
314 tvb_memcpy(tvb,ip_addr,0,4);
315 proto_tree_add_text (tree,tvb,0,4,"Next Hop = %s",ip_to_str(ip_addr));
316 tvb_memcpy(tvb,ip_addr,4,4);
317 proto_tree_add_text (tree,tvb,4,4,"Originating router = %s",ip_to_str(ip_addr));
318 proto_tree_add_text (tree,tvb,8,4,"Originating A.S. = %u",tvb_get_ntohl(tvb,8));
319 proto_tree_add_text (tree,tvb,12,4,"Arbitrary tag = %u",tvb_get_ntohl(tvb,12));
320 proto_tree_add_text (tree,tvb,16,4,"External protocol metric = %u",tvb_get_ntohl(tvb,16));
321 proto_tree_add_text (tree,tvb,20,2,"Rezerved");
322 proto_tree_add_text (tree,tvb,22,1,"External protocol ID = %u (%s)",tvb_get_guint8(tvb,22),val_to_str(tvb_get_guint8(tvb,22),eigrp_pid_vals, "Unknown"));
323 proto_tree_add_text (tree,tvb,23,1,"Flags = 0x%0x",tvb_get_guint8(tvb,23));
325 proto_tree_add_text (tree,tvb,24,4,"Delay = %u",tvb_get_ntohl(tvb,24));
326 proto_tree_add_text (tree,tvb,28,4,"Bandwidth = %u",tvb_get_ntohl(tvb,28));
327 proto_tree_add_text (tree,tvb,32,3,"MTU = %u",tvb_get_ntoh24(tvb,32));
328 proto_tree_add_text (tree,tvb,35,1,"Hop Count = %u",tvb_get_guint8(tvb,35));
329 proto_tree_add_text (tree,tvb,36,1,"Reliability = %u",tvb_get_guint8(tvb,36));
330 proto_tree_add_text (tree,tvb,37,1,"Load = %u",tvb_get_guint8(tvb,37));
331 proto_tree_add_text (tree,tvb,38,2,"Rezerved ");
332 length=tvb_get_guint8(tvb,40);
333 proto_tree_add_text (tree,tvb,40,1,"Prefix Length = %u",length);
334 if (length % 8 == 0) addr_len=length/8 ; else addr_len=length/8+1;
335 ip_addr[0]=ip_addr[1]=ip_addr[2]=ip_addr[3]=0;
336 tvb_memcpy(tvb,ip_addr,41,addr_len);
337 proto_tree_add_text (tree,tvb,41,addr_len,"Destination = %s",ip_to_str(ip_addr));
338 proto_item_set_text (ti,"%s = %s/%u%s",match_strval(TLV_IP_EXT,eigrp_tlv_vals),ip_to_str(ip_addr),length,((tvb_get_ntohl(tvb,24)==0xffffffff)?" - Destination unreachable":""));
343 static void dissect_eigrp_ipx_int (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
345 proto_tree_add_text (tree,tvb,0,4,"Next Hop Address = %08x",tvb_get_ntohl(tvb,4));
346 proto_tree_add_text (tree,tvb,4,6,"Next Hop ID = %04x:%04x:%04x",tvb_get_ntohs(tvb,4),tvb_get_ntohs(tvb,6),tvb_get_ntohs(tvb,8));
347 proto_tree_add_text (tree,tvb,10,4,"Delay = %u",tvb_get_ntohl(tvb,10));
348 proto_tree_add_text (tree,tvb,14,4,"Bandwidth = %u",tvb_get_ntohl(tvb,14));
349 proto_tree_add_text (tree,tvb,18,3,"MTU = %u",tvb_get_ntoh24(tvb,18));
350 proto_tree_add_text (tree,tvb,21,1,"Hop Count = %u",tvb_get_guint8(tvb,21));
351 proto_tree_add_text (tree,tvb,22,1,"Reliability = %u",tvb_get_guint8(tvb,22));
352 proto_tree_add_text (tree,tvb,23,1,"Load = %u",tvb_get_guint8(tvb,23));
353 proto_tree_add_text (tree,tvb,24,2,"Rezerved ");
354 proto_tree_add_text (tree,tvb,26,4,"Destination Address = %08x",tvb_get_ntohl(tvb,26));
355 proto_item_set_text (ti,"%s = %08x%s",match_strval(TLV_IPX_INT,eigrp_tlv_vals),tvb_get_ntohl(tvb,26),((tvb_get_ntohl(tvb,10)==0xffffffff)?" - Destination unreachable":""));
358 static void dissect_eigrp_ipx_ext (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
360 proto_tree_add_text (tree,tvb,0,4,"Next Hop Address = %08x",tvb_get_ntohl(tvb,4));
361 proto_tree_add_text (tree,tvb,4,6,"Next Hop ID = %04x:%04x:%04x",tvb_get_ntohs(tvb,4),tvb_get_ntohs(tvb,6),tvb_get_ntohs(tvb,8));
363 proto_tree_add_text (tree,tvb,10,6,"Originating router ID = %04x:%04x:%04x",tvb_get_ntohs(tvb,10),tvb_get_ntohs(tvb,12),tvb_get_ntohs(tvb,14));
364 proto_tree_add_text (tree,tvb,16,4,"Originating A.S. = %u",tvb_get_ntohl(tvb,16));
365 proto_tree_add_text (tree,tvb,20,4,"Arbitrary tag = %u",tvb_get_ntohl(tvb,20));
366 proto_tree_add_text (tree,tvb,24,1,"External protocol = %u",tvb_get_guint8(tvb,24));
367 proto_tree_add_text (tree,tvb,25,1,"Rezerved");
368 proto_tree_add_text (tree,tvb,26,2,"External metric = %u ",tvb_get_ntohs(tvb,26));
369 proto_tree_add_text (tree,tvb,28,2,"External delay = %u ",tvb_get_ntohs(tvb,28));
371 proto_tree_add_text (tree,tvb,30,4,"Delay = %u",tvb_get_ntohl(tvb,30));
372 proto_tree_add_text (tree,tvb,34,4,"Bandwidth = %u",tvb_get_ntohl(tvb,34));
373 proto_tree_add_text (tree,tvb,38,3,"MTU = %u",tvb_get_ntoh24(tvb,38));
374 proto_tree_add_text (tree,tvb,41,1,"Hop Count = %u",tvb_get_guint8(tvb,41));
375 proto_tree_add_text (tree,tvb,42,1,"Reliability = %u",tvb_get_guint8(tvb,42));
376 proto_tree_add_text (tree,tvb,43,1,"Load = %u",tvb_get_guint8(tvb,43));
377 proto_tree_add_text (tree,tvb,44,2,"Rezerved ");
378 proto_tree_add_text (tree,tvb,46,4,"Destination Address = %08x",tvb_get_ntohl(tvb,46));
379 proto_item_set_text (ti,"%s = %08x%s",match_strval(TLV_IPX_EXT,eigrp_tlv_vals),tvb_get_ntohl(tvb,46),((tvb_get_ntohl(tvb,30)==0xffffffff)?" - Destination unreachable":""));
385 static void dissect_eigrp_at_cbl (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
387 proto_tree_add_text (tree,tvb,0,4,"AppleTalk Cable Range = %u-%u",tvb_get_ntohs(tvb,0),tvb_get_ntohs(tvb,2));
388 proto_tree_add_text (tree,tvb,4,4,"AppleTalk Router ID = %u",tvb_get_ntohl(tvb,4));
389 proto_item_set_text (ti,"%s : Cable range= %u-%u, Router ID= %u",match_strval(TLV_AT_CBL,eigrp_tlv_vals),tvb_get_ntohs(tvb,0),tvb_get_ntohs(tvb,2),tvb_get_ntohl(tvb,4));
393 static void dissect_eigrp_at_int (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
395 proto_tree_add_text (tree,tvb,0,4,"Next Hop Address = %u.%u",tvb_get_ntohs(tvb,0),tvb_get_ntohs(tvb,2));
397 proto_tree_add_text (tree,tvb,4,4,"Delay = %u",tvb_get_ntohl(tvb,4));
398 proto_tree_add_text (tree,tvb,8,4,"Bandwidth = %u",tvb_get_ntohl(tvb,8));
399 proto_tree_add_text (tree,tvb,12,3,"MTU = %u",tvb_get_ntoh24(tvb,12));
400 proto_tree_add_text (tree,tvb,15,1,"Hop Count = %u",tvb_get_guint8(tvb,15));
401 proto_tree_add_text (tree,tvb,16,1,"Reliability = %u",tvb_get_guint8(tvb,16));
402 proto_tree_add_text (tree,tvb,17,1,"Load = %u",tvb_get_guint8(tvb,17));
403 proto_tree_add_text (tree,tvb,18,2,"Rezerved ");
404 proto_tree_add_text (tree,tvb,20,4,"Cable range = %u-%u",tvb_get_ntohs(tvb,20),tvb_get_ntohs(tvb,22));
406 proto_item_set_text (ti,"%s : %u-%u",match_strval(TLV_AT_INT,eigrp_tlv_vals),tvb_get_ntohs(tvb,20),tvb_get_ntohs(tvb,22));
410 static void dissect_eigrp_at_ext (tvbuff_t *tvb, proto_tree *tree, proto_item *ti)
412 proto_tree_add_text (tree,tvb,0,4,"Next Hop Address = %u.%u",tvb_get_ntohs(tvb,0),tvb_get_ntohs(tvb,2));
413 proto_tree_add_text (tree,tvb,4,4,"Originating router ID = %u",tvb_get_ntohl(tvb,4));
414 proto_tree_add_text (tree,tvb,8,4,"Originating A.S. = %u",tvb_get_ntohl(tvb,8));
415 proto_tree_add_text (tree,tvb,12,4,"Arbitrary tag = %u",tvb_get_ntohl(tvb,12));
416 proto_tree_add_text (tree,tvb,16,1,"External protocol ID = %u ",tvb_get_guint8(tvb,16));
417 proto_tree_add_text (tree,tvb,17,1,"Flags = 0x%0x",tvb_get_guint8(tvb,17));
418 proto_tree_add_text (tree,tvb,18,2,"External protocol metric = %u",tvb_get_ntohs(tvb,18));
420 proto_tree_add_text (tree,tvb,20,4,"Delay = %u",tvb_get_ntohl(tvb,20));
421 proto_tree_add_text (tree,tvb,24,4,"Bandwidth = %u",tvb_get_ntohl(tvb,24));
422 proto_tree_add_text (tree,tvb,28,3,"MTU = %u",tvb_get_ntoh24(tvb,28));
423 proto_tree_add_text (tree,tvb,31,1,"Hop Count = %u",tvb_get_guint8(tvb,31));
424 proto_tree_add_text (tree,tvb,32,1,"Reliability = %u",tvb_get_guint8(tvb,32));
425 proto_tree_add_text (tree,tvb,33,1,"Load = %u",tvb_get_guint8(tvb,33));
426 proto_tree_add_text (tree,tvb,34,2,"Rezerved ");
427 proto_tree_add_text (tree,tvb,36,4,"Cable range = %u-%u",tvb_get_ntohs(tvb,36),tvb_get_ntohs(tvb,38));
429 proto_item_set_text (ti,"%s : %u-%u",match_strval(TLV_AT_EXT,eigrp_tlv_vals),tvb_get_ntohs(tvb,36),tvb_get_ntohs(tvb,38));
436 proto_register_eigrp(void)
438 static hf_register_info hf[] = {
440 { "Opcode", "eigrp.opcode",
441 FT_UINT8, BASE_DEC, NULL, 0x0 ,
445 { "Autonomous System ", "eigrp.as",
446 FT_UINT16, BASE_DEC, NULL, 0x0 ,
447 "Autonomous System number" }
450 { "Entry ", "eigrp.tlv",
451 FT_UINT16, BASE_DEC, NULL, 0x0 ,
452 "Type/Length/Value" }
456 static gint *ett[] = {
460 proto_eigrp = proto_register_protocol("Enhanced Interior Gateway Routing Protocol",
462 proto_register_field_array(proto_eigrp, hf, array_length(hf));
463 proto_register_subtree_array(ett, array_length(ett));
467 proto_reg_handoff_eigrp(void)
469 dissector_add("ip.proto", IP_PROTO_EIGRP, dissect_eigrp);
470 dissector_add("ddp.type", DDP_EIGRP, dissect_eigrp);
471 dissector_add("ipx.socket", IPX_SOCKET_EIGRP, dissect_eigrp);