1 /* packet-dvmrp.c 2001 Ronnie Sahlberg <See AUTHORS for email>
2 * Routines for IGMP/DVMRP packet disassembly
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
37 * V3 has len>=8 and byte[6]==0xff and byte[7]==0x03
40 DVMRP is defined in the following RFCs
42 draft-ietf-idmr-dvmrp-v3-10.txt Version 3
44 V1 and V3 can be distinguished by looking at bytes 6 and 7 in the
46 If header[6]==0xff and header[7]==0x03 we have version 3.
49 RFC1075 has typos in 3.12.2 and 3.12.4, see if you can spot them.
56 #include <epan/packet.h>
57 #include <epan/ipproto.h>
58 #include <epan/prefs.h>
59 #include "packet-igmp.h"
60 #include "packet-dvmrp.h"
62 void proto_register_dvmrp(void);
64 static int proto_dvmrp = -1;
65 static int hf_version = -1;
66 static int hf_type = -1;
67 static int hf_code_v1 = -1;
68 static int hf_checksum = -1;
69 static int hf_checksum_bad = -1;
70 static int hf_commands = -1;
71 static int hf_command = -1;
72 static int hf_count = -1;
73 static int hf_afi = -1;
74 static int hf_netmask = -1;
75 static int hf_metric = -1;
76 static int hf_dest_unr = -1;
77 static int hf_split_horiz = -1;
78 static int hf_infinity = -1;
79 static int hf_daddr = -1;
80 static int hf_maddr = -1;
81 static int hf_hold = -1;
82 static int hf_code_v3 = -1;
83 static int hf_capabilities = -1;
84 static int hf_cap_leaf = -1;
85 static int hf_cap_prune = -1;
86 static int hf_cap_genid = -1;
87 static int hf_cap_mtrace = -1;
88 static int hf_cap_snmp = -1;
89 static int hf_cap_netmask = -1;
90 static int hf_min_ver = -1;
91 static int hf_maj_ver = -1;
92 static int hf_genid = -1;
93 static int hf_route = -1;
94 static int hf_saddr = -1;
95 static int hf_life = -1;
96 static int hf_local = -1;
97 static int hf_threshold = -1;
98 static int hf_flags = -1;
99 static int hf_flag_tunnel = -1;
100 static int hf_flag_srcroute = -1;
101 static int hf_flag_down = -1;
102 static int hf_flag_disabled = -1;
103 static int hf_flag_querier = -1;
104 static int hf_flag_leaf = -1;
105 static int hf_ncount = -1;
106 static int hf_neighbor = -1;
108 static int ett_dvmrp = -1;
109 static int ett_commands = -1;
110 static int ett_capabilities = -1;
111 static int ett_flags = -1;
112 static int ett_route = -1;
114 static int strict_v3 = FALSE;
116 #define DVMRP_TYPE 0x13
117 static const value_string dvmrp_type[] = {
118 {DVMRP_TYPE, "DVMRP" },
122 #define DVMRP_V1_RESPONSE 1
123 #define DVMRP_V1_REQUEST 2
124 #define DVMRP_V1_NON_MEMBERSHIP_REPORT 3
125 #define DVMRP_V1_NON_MEMBERSHIP_CANCELLATION 4
126 static const value_string code_v1[] = {
127 {DVMRP_V1_RESPONSE, "Response" },
128 {DVMRP_V1_REQUEST, "Request" },
129 {DVMRP_V1_NON_MEMBERSHIP_REPORT, "Non-membership report" },
130 {DVMRP_V1_NON_MEMBERSHIP_CANCELLATION, "Non-membership cancellation" },
134 #define DVMRP_V3_PROBE 0x1
135 #define DVMRP_V3_REPORT 0x2
136 #define DVMRP_V3_ASK_NEIGHBORS 0x3
137 #define DVMRP_V3_NEIGHBORS 0x4
138 #define DVMRP_V3_ASK_NEIGHBORS_2 0x5
139 #define DVMRP_V3_NEIGHBORS_2 0x6
140 #define DVMRP_V3_PRUNE 0x7
141 #define DVMRP_V3_GRAFT 0x8
142 #define DVMRP_V3_GRAFT_ACK 0x9
143 static const value_string code_v3[] = {
144 {DVMRP_V3_PROBE, "Probe"},
145 {DVMRP_V3_REPORT, "Report"},
146 {DVMRP_V3_ASK_NEIGHBORS, "Ask Neighbors"},
147 {DVMRP_V3_NEIGHBORS, "Neighbors"},
148 {DVMRP_V3_ASK_NEIGHBORS_2, "Ask Neighbors 2"},
149 {DVMRP_V3_NEIGHBORS_2, "Neighbors 2"},
150 {DVMRP_V3_PRUNE, "Prune"},
151 {DVMRP_V3_GRAFT, "Graft"},
152 {DVMRP_V3_GRAFT_ACK, "Graft ACK"},
156 #define DVMRP_V3_CAP_LEAF 0x01
157 #define DVMRP_V3_CAP_PRUNE 0x02
158 #define DVMRP_V3_CAP_GENID 0x04
159 #define DVMRP_V3_CAP_MTRACE 0x08
160 #define DVMRP_V3_CAP_SNMP 0x10
161 #define DVMRP_V3_CAP_NETMASK 0x20
163 #define DVMRP_V3_FLAG_TUNNEL 0x01
164 #define DVMRP_V3_FLAG_SRCROUTE 0x02
165 #define DVMRP_V3_FLAG_DOWN 0x10
166 #define DVMRP_V3_FLAG_DISABLED 0x20
167 #define DVMRP_V3_FLAG_QUERIER 0x40
168 #define DVMRP_V3_FLAG_LEAF 0x80
171 #define V1_COMMAND_NULL 0
172 #define V1_COMMAND_AFI 2
173 #define V1_COMMAND_SUBNETMASK 3
174 #define V1_COMMAND_METRIC 4
175 #define V1_COMMAND_FLAGS0 5
176 #define V1_COMMAND_INFINITY 6
177 #define V1_COMMAND_DA 7
178 #define V1_COMMAND_RDA 8
179 #define V1_COMMAND_NMR 9
180 #define V1_COMMAND_NMR_CANCEL 10
181 static const value_string command[] = {
182 {V1_COMMAND_NULL, "NULL" },
183 {V1_COMMAND_AFI, "Address Family Indicator"},
184 {V1_COMMAND_SUBNETMASK, "Subnetmask"},
185 {V1_COMMAND_METRIC, "Metric"},
186 {V1_COMMAND_FLAGS0, "Flags0"},
187 {V1_COMMAND_INFINITY, "Infinity"},
188 {V1_COMMAND_DA, "Destination Address"},
189 {V1_COMMAND_RDA, "Requested Destination Address"},
190 {V1_COMMAND_NMR, "Non-Membership Report"},
191 {V1_COMMAND_NMR_CANCEL, "Non-Membership Report Cancel"},
196 static const value_string afi[] = {
197 {V1_AFI_IP, "IP v4 Family"},
201 static const true_false_string tfs_dest_unreach = {
202 "Destination Unreachable",
203 "NOT Destination Unreachable"
206 static const true_false_string tfs_split_horiz = {
207 "Split Horizon concealed route",
208 "NOT Split Horizon concealed route"
211 static const true_false_string tfs_cap_leaf = {
215 static const true_false_string tfs_cap_prune = {
219 static const true_false_string tfs_cap_genid = {
223 static const true_false_string tfs_cap_mtrace = {
224 "Multicast Traceroute capable",
225 "NOT Multicast Traceroute capable"
227 static const true_false_string tfs_cap_snmp = {
231 static const true_false_string tfs_cap_netmask = {
233 "NOT Netmask capable"
237 dissect_v3_report(tvbuff_t *tvb, proto_tree *parent_tree, int offset)
244 while (tvb_reported_length_remaining(tvb, offset) > 0) {
247 int old_offset_a = offset;
249 item = proto_tree_add_item(parent_tree, hf_route,
250 tvb, offset, -1, ENC_NA);
251 tree = proto_item_add_subtree(item, ett_route);
255 m1 = tvb_get_guint8(tvb, offset);
256 m2 = tvb_get_guint8(tvb, offset+1);
257 m3 = tvb_get_guint8(tvb, offset+2);
263 proto_tree_add_ipv4(tree, hf_netmask, tvb, offset, 3, ip);
267 /* read every srcnet, metric pairs */
269 int old_offset_b = offset;
276 s0 = tvb_get_guint8(tvb, offset);
279 s1 = tvb_get_guint8(tvb, offset);
283 s2 = tvb_get_guint8(tvb, offset);
287 s3 = tvb_get_guint8(tvb, offset);
291 /* handle special case for default route V3/3.4.3 */
292 if ((!m1)&&(!m2)&&(!m3)&&(!s0)) {
300 proto_tree_add_ipv4_format(tree, hf_saddr, tvb,
301 old_offset_b, offset-old_offset_b, ip,
302 "%s %d.%d.%d.%d (netmask %d.%d.%d.%d)",
303 m0?"Source Network":"Default Route",
304 s0,s1,s2,s3,m0,m1,m2,m3);
306 metric = tvb_get_guint8(tvb, offset);
307 proto_tree_add_uint(tree, hf_metric, tvb,
308 offset, 1, metric&0x7f);
312 } while (!(metric&0x80));
314 proto_item_set_len(item, offset-old_offset_a);
321 dissect_dvmrp_v3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
326 proto_tree_add_uint(parent_tree, hf_version, tvb, 0, 0, 3);
328 /* type of command */
329 proto_tree_add_uint(parent_tree, hf_type, tvb, offset, 1, 0x13);
333 code = tvb_get_guint8(tvb, offset);
334 proto_tree_add_uint(parent_tree, hf_code_v3, tvb, offset, 1, code);
336 col_add_fstr(pinfo->cinfo, COL_INFO,
337 "V%d %s",3 ,val_to_str(code, code_v3,
338 "Unknown Type:0x%02x"));
341 igmp_checksum(parent_tree, tvb, hf_checksum, hf_checksum_bad, pinfo, 0);
344 /* skip unused byte */
347 /* PROBE and NEIGHBORS 2 packets have capabilities flags, unused
349 if (code==DVMRP_V3_PROBE || code==DVMRP_V3_NEIGHBORS_2) {
353 item = proto_tree_add_item(parent_tree, hf_capabilities,
354 tvb, offset, 1, ENC_NA);
355 tree = proto_item_add_subtree(item, ett_capabilities);
357 count = tvb_get_guint8(tvb, offset);
358 proto_tree_add_boolean(tree, hf_cap_netmask, tvb, offset, 1, count);
359 proto_tree_add_boolean(tree, hf_cap_snmp, tvb, offset, 1, count);
360 proto_tree_add_boolean(tree, hf_cap_mtrace, tvb, offset, 1, count);
361 proto_tree_add_boolean(tree, hf_cap_genid, tvb, offset, 1, count);
362 proto_tree_add_boolean(tree, hf_cap_prune, tvb, offset, 1, count);
363 proto_tree_add_boolean(tree, hf_cap_leaf, tvb, offset, 1, count);
368 proto_tree_add_item(parent_tree, hf_min_ver, tvb, offset, 1, ENC_BIG_ENDIAN);
372 proto_tree_add_item(parent_tree, hf_maj_ver, tvb, offset, 1, ENC_BIG_ENDIAN);
378 proto_tree_add_item(parent_tree, hf_genid, tvb,
379 offset, 4, ENC_BIG_ENDIAN);
381 while (tvb_reported_length_remaining(tvb, offset)>=4) {
382 proto_tree_add_item(parent_tree, hf_neighbor,
383 tvb, offset, 4, ENC_BIG_ENDIAN);
387 case DVMRP_V3_REPORT:
388 offset = dissect_v3_report(tvb, parent_tree, offset);
392 proto_tree_add_item(parent_tree, hf_saddr,
393 tvb, offset, 4, ENC_BIG_ENDIAN);
396 proto_tree_add_item(parent_tree, hf_maddr,
397 tvb, offset, 4, ENC_BIG_ENDIAN);
400 proto_tree_add_item(parent_tree, hf_life,
401 tvb, offset, 4, ENC_BIG_ENDIAN);
404 if (tvb_reported_length_remaining(tvb, offset)>=4) {
405 proto_tree_add_item(parent_tree, hf_netmask,
406 tvb, offset, 4, ENC_BIG_ENDIAN);
412 proto_tree_add_item(parent_tree, hf_saddr,
413 tvb, offset, 4, ENC_BIG_ENDIAN);
416 proto_tree_add_item(parent_tree, hf_maddr,
417 tvb, offset, 4, ENC_BIG_ENDIAN);
420 if (tvb_reported_length_remaining(tvb, offset)>=4) {
421 proto_tree_add_item(parent_tree, hf_netmask,
422 tvb, offset, 4, ENC_BIG_ENDIAN);
426 case DVMRP_V3_GRAFT_ACK:
428 proto_tree_add_item(parent_tree, hf_saddr,
429 tvb, offset, 4, ENC_BIG_ENDIAN);
432 proto_tree_add_item(parent_tree, hf_maddr,
433 tvb, offset, 4, ENC_BIG_ENDIAN);
436 if (tvb_reported_length_remaining(tvb, offset)>=4) {
437 proto_tree_add_item(parent_tree, hf_netmask,
438 tvb, offset, 4, ENC_BIG_ENDIAN);
442 case DVMRP_V3_ASK_NEIGHBORS:
443 case DVMRP_V3_NEIGHBORS:
444 /* XXX - obsolete, and the draft doesn't describe them */
446 case DVMRP_V3_ASK_NEIGHBORS_2:
449 case DVMRP_V3_NEIGHBORS_2:
450 while (tvb_reported_length_remaining(tvb, offset)>=12) {
451 guint8 neighbor_count;
454 proto_tree_add_item(parent_tree, hf_local,
455 tvb, offset, 4, ENC_BIG_ENDIAN);
458 proto_tree_add_item(parent_tree, hf_metric,
459 tvb, offset, 1, ENC_BIG_ENDIAN);
462 proto_tree_add_item(parent_tree, hf_threshold,
463 tvb, offset, 1, ENC_BIG_ENDIAN);
470 item = proto_tree_add_item(parent_tree, hf_flags,
471 tvb, offset, 1, ENC_NA);
472 tree = proto_item_add_subtree(item, ett_flags);
474 proto_tree_add_item(tree, hf_flag_tunnel, tvb,
475 offset, 1, ENC_BIG_ENDIAN);
476 proto_tree_add_item(tree, hf_flag_srcroute, tvb,
477 offset, 1, ENC_BIG_ENDIAN);
478 proto_tree_add_item(tree, hf_flag_down, tvb,
479 offset, 1, ENC_BIG_ENDIAN);
480 proto_tree_add_item(tree, hf_flag_disabled, tvb,
481 offset, 1, ENC_BIG_ENDIAN);
482 proto_tree_add_item(tree, hf_flag_querier, tvb,
483 offset, 1, ENC_BIG_ENDIAN);
484 proto_tree_add_item(tree, hf_flag_leaf, tvb,
485 offset, 1, ENC_BIG_ENDIAN);
489 neighbor_count = tvb_get_guint8(tvb, offset);
490 proto_tree_add_item(parent_tree, hf_ncount,
491 tvb, offset, 1, ENC_BIG_ENDIAN);
494 while ((tvb_reported_length_remaining(tvb, offset)>=4)
495 && (neighbor_count>0)) {
496 proto_tree_add_item(parent_tree, hf_neighbor,
497 tvb, offset, 4, ENC_BIG_ENDIAN);
510 dissect_dvmrp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
513 guint8 af=2; /* default */
516 proto_tree_add_uint(parent_tree, hf_version, tvb, 0, 0, 1);
518 /* type of command */
519 proto_tree_add_uint(parent_tree, hf_type, tvb, offset, 1, 0x13);
523 code = tvb_get_guint8(tvb, offset);
524 proto_tree_add_uint(parent_tree, hf_code_v1, tvb, offset, 1, code);
526 col_add_fstr(pinfo->cinfo, COL_INFO,
527 "V%d %s",1 ,val_to_str(code, code_v1,
528 "Unknown Type:0x%02x"));
531 igmp_checksum(parent_tree, tvb, hf_checksum, hf_checksum_bad, pinfo, 0);
534 /* decode all the v1 commands */
535 while (tvb_reported_length_remaining(tvb, offset) > 0) {
539 int old_offset = offset;
541 item = proto_tree_add_item(parent_tree, hf_commands,
542 tvb, offset, -1, ENC_NA);
543 tree = proto_item_add_subtree(item, ett_commands);
545 cmd = tvb_get_guint8(tvb, offset);
546 proto_tree_add_uint(tree, hf_command, tvb,
551 case V1_COMMAND_NULL:
552 offset += 1; /* skip ignored/pad byte*/
554 proto_item_set_text(item, "Command: NULL");
558 af = tvb_get_guint8(tvb, offset);
559 proto_tree_add_uint(tree, hf_afi, tvb,
563 proto_item_set_text(item, "%s: %s",
564 val_to_str(cmd, command, "Unknown Command:0x%02x"),
565 val_to_str(af, afi, "Unknown Family:0x%02x")
569 case V1_COMMAND_SUBNETMASK:
570 count = tvb_get_guint8(tvb, offset);
571 proto_tree_add_uint(tree, hf_count, tvb,
574 if (count) { /* must be 0 or 1 */
575 proto_tree_add_item(tree, hf_netmask,
576 tvb, offset, 4, ENC_BIG_ENDIAN);
578 proto_item_set_text(item, "%s: %d.%d.%d.%d",
579 val_to_str(cmd, command, "Unknown Command:0x%02x"),
580 tvb_get_guint8(tvb, offset),
581 tvb_get_guint8(tvb, offset+1),
582 tvb_get_guint8(tvb, offset+2),
583 tvb_get_guint8(tvb, offset+3));
588 proto_item_set_text(item, "%s: <no mask supplied>",
589 val_to_str(cmd, command, "Unknown Command:0x%02x"));
593 case V1_COMMAND_METRIC:
594 proto_tree_add_item(tree, hf_metric, tvb,
595 offset, 1, ENC_BIG_ENDIAN);
597 proto_item_set_text(item, "%s: %d",
598 val_to_str(cmd, command, "Unknown Command:0x%02x"),
599 tvb_get_guint8(tvb, offset));
603 case V1_COMMAND_FLAGS0:
604 count = tvb_get_guint8(tvb, offset);
605 proto_tree_add_boolean(tree, hf_dest_unr, tvb, offset, 1, count);
606 proto_tree_add_boolean(tree, hf_split_horiz, tvb, offset, 1, count);
608 proto_item_set_text(item, "%s: 0x%02x",
609 val_to_str(cmd, command, "Unknown Command:0x%02x"), count);
613 case V1_COMMAND_INFINITY:
614 proto_tree_add_item(tree, hf_infinity, tvb,
615 offset, 1, ENC_BIG_ENDIAN);
617 proto_item_set_text(item, "%s: %d",
618 val_to_str(cmd, command, "Unknown Command:0x%02x"), tvb_get_guint8(tvb, offset));
623 case V1_COMMAND_RDA: /* same as DA */
624 count = tvb_get_guint8(tvb, offset);
625 proto_tree_add_uint(tree, hf_count, tvb,
629 proto_tree_add_item(tree, hf_daddr,
630 tvb, offset, 4, ENC_BIG_ENDIAN);
634 proto_item_set_text(item, "%s",
635 val_to_str(cmd, command, "Unknown Command:0x%02x"));
639 count = tvb_get_guint8(tvb, offset);
640 proto_tree_add_uint(tree, hf_count, tvb,
644 proto_tree_add_item(tree, hf_maddr,
645 tvb, offset, 4, ENC_BIG_ENDIAN);
647 proto_tree_add_item(tree, hf_hold, tvb,
648 offset, 4, ENC_BIG_ENDIAN);
652 proto_item_set_text(item, "%s",
653 val_to_str(cmd, command, "Unknown Command:0x%02x"));
656 case V1_COMMAND_NMR_CANCEL:
657 count = tvb_get_guint8(tvb, offset);
658 proto_tree_add_uint(tree, hf_count, tvb,
662 proto_tree_add_item(tree, hf_maddr,
663 tvb, offset, 4, ENC_BIG_ENDIAN);
667 proto_item_set_text(item, "%s",
668 val_to_str(cmd, command, "Unknown Command:0x%02x"));
673 proto_item_set_len(item, offset-old_offset);
679 /* This function is only called from the IGMP dissector */
681 dissect_dvmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset)
686 if (!proto_is_protocol_enabled(find_protocol_by_id(proto_dvmrp))) {
687 /* we are not enabled, skip entire packet to be nice
688 to the igmp layer. (so clicking on IGMP will display the data)
690 return offset+tvb_length_remaining(tvb, offset);
693 item = proto_tree_add_item(parent_tree, proto_dvmrp, tvb, offset, -1, ENC_NA);
694 tree = proto_item_add_subtree(item, ett_dvmrp);
697 col_set_str(pinfo->cinfo, COL_PROTOCOL, "DVMRP");
698 col_clear(pinfo->cinfo, COL_INFO);
701 if ((tvb_length_remaining(tvb, offset)>=8)
702 && (((tvb_get_guint8(tvb, 6)==0xff)
703 && (tvb_get_guint8(tvb, 7)==0x03))
705 offset = dissect_dvmrp_v3(tvb, pinfo, tree, offset);
707 offset = dissect_dvmrp_v1(tvb, pinfo, tree, offset);
710 proto_item_set_len(item, offset);
715 proto_register_dvmrp(void)
717 static hf_register_info hf[] = {
719 { "DVMRP Version", "dvmrp.version", FT_UINT8, BASE_DEC,
720 NULL, 0, NULL, HFILL }},
723 { "Type", "dvmrp.type", FT_UINT8, BASE_HEX,
724 VALS(dvmrp_type), 0, "DVMRP Packet Type", HFILL }},
727 { "Code", "dvmrp.v1.code", FT_UINT8, BASE_HEX,
728 VALS(code_v1), 0, "DVMRP Packet Code", HFILL }},
731 { "Checksum", "dvmrp.checksum", FT_UINT16, BASE_HEX,
732 NULL, 0, "DVMRP Checksum", HFILL }},
735 { "Bad Checksum", "dvmrp.checksum_bad", FT_BOOLEAN, BASE_NONE,
736 NULL, 0x0, "Bad DVMRP Checksum", HFILL }},
739 { "Commands", "dvmrp.commands", FT_NONE, BASE_NONE,
740 NULL, 0, "DVMRP V1 Commands", HFILL }},
743 { "Command", "dvmrp.command", FT_UINT8, BASE_HEX,
744 VALS(command), 0, "DVMRP V1 Command", HFILL }},
747 { "Address Family", "dvmrp.afi", FT_UINT8, BASE_HEX,
748 VALS(afi), 0, "DVMRP Address Family Indicator", HFILL }},
751 { "Count", "dvmrp.count", FT_UINT8, BASE_HEX,
752 NULL, 0, NULL, HFILL }},
755 { "Netmask", "dvmrp.netmask", FT_IPv4, BASE_NONE,
756 NULL, 0, "DVMRP Netmask", HFILL }},
759 { "Metric", "dvmrp.metric", FT_UINT8, BASE_DEC,
760 NULL, 0, "DVMRP Metric", HFILL }},
763 { "Destination Unreachable", "dvmrp.dest_unreach", FT_BOOLEAN, 8,
764 TFS(&tfs_dest_unreach), 0x01, NULL, HFILL }},
767 { "Split Horizon", "dvmrp.split_horiz", FT_BOOLEAN, 8,
768 TFS(&tfs_split_horiz), 0x02, "Split Horizon concealed route", HFILL }},
771 { "Infinity", "dvmrp.infinity", FT_UINT8, BASE_DEC,
772 NULL, 0, "DVMRP Infinity", HFILL }},
775 { "Dest Addr", "dvmrp.daddr", FT_IPv4, BASE_NONE,
776 NULL, 0, "DVMRP Destination Address", HFILL }},
779 { "Multicast Addr", "dvmrp.maddr", FT_IPv4, BASE_NONE,
780 NULL, 0, "DVMRP Multicast Address", HFILL }},
783 { "Hold Time", "dvmrp.hold", FT_UINT32, BASE_DEC,
784 NULL, 0, "DVMRP Hold Time in seconds", HFILL }},
787 { "Code", "dvmrp.v3.code", FT_UINT8, BASE_HEX,
788 VALS(code_v3), 0, "DVMRP Packet Code", HFILL }},
791 { "Capabilities", "dvmrp.capabilities", FT_NONE, BASE_NONE,
792 NULL, 0, "DVMRP V3 Capabilities", HFILL }},
795 { "Leaf", "dvmrp.cap.leaf", FT_BOOLEAN, 8,
796 TFS(&tfs_cap_leaf), DVMRP_V3_CAP_LEAF, NULL, HFILL }},
799 { "Prune", "dvmrp.cap.prune", FT_BOOLEAN, 8,
800 TFS(&tfs_cap_prune), DVMRP_V3_CAP_PRUNE, "Prune capability", HFILL }},
803 { "Genid", "dvmrp.cap.genid", FT_BOOLEAN, 8,
804 TFS(&tfs_cap_genid), DVMRP_V3_CAP_GENID, "Genid capability", HFILL }},
807 { "Mtrace", "dvmrp.cap.mtrace", FT_BOOLEAN, 8,
808 TFS(&tfs_cap_mtrace), DVMRP_V3_CAP_MTRACE, "Mtrace capability", HFILL }},
811 { "SNMP", "dvmrp.cap.snmp", FT_BOOLEAN, 8,
812 TFS(&tfs_cap_snmp), DVMRP_V3_CAP_SNMP, "SNMP capability", HFILL }},
815 { "Netmask", "dvmrp.cap.netmask", FT_BOOLEAN, 8,
816 TFS(&tfs_cap_netmask), DVMRP_V3_CAP_NETMASK, "Netmask capability", HFILL }},
819 { "Minor Version", "dvmrp.min_ver", FT_UINT8, BASE_HEX,
820 NULL, 0, "DVMRP Minor Version", HFILL }},
823 { "Major Version", "dvmrp.maj_ver", FT_UINT8, BASE_HEX,
824 NULL, 0, "DVMRP Major Version", HFILL }},
827 { "Generation ID", "dvmrp.genid", FT_UINT32, BASE_DEC,
828 NULL, 0, "DVMRP Generation ID", HFILL }},
831 { "Route", "dvmrp.route", FT_NONE, BASE_NONE,
832 NULL, 0, "DVMRP V3 Route Report", HFILL }},
835 { "Source Addr", "dvmrp.saddr", FT_IPv4, BASE_NONE,
836 NULL, 0, "DVMRP Source Address", HFILL }},
839 { "Prune lifetime", "dvmrp.lifetime", FT_UINT32, BASE_DEC,
840 NULL, 0, "DVMRP Prune Lifetime", HFILL }},
843 { "Local Addr", "dvmrp.local", FT_IPv4, BASE_NONE,
844 NULL, 0, "DVMRP Local Address", HFILL }},
847 { "Threshold", "dvmrp.threshold", FT_UINT8, BASE_DEC,
848 NULL, 0, "DVMRP Interface Threshold", HFILL }},
851 { "Flags", "dvmrp.flags", FT_NONE, BASE_NONE,
852 NULL, 0, "DVMRP Interface Flags", HFILL }},
855 { "Tunnel", "dvmrp.flag.tunnel", FT_BOOLEAN, 8,
856 NULL, DVMRP_V3_FLAG_TUNNEL, "Neighbor reached via tunnel", HFILL }},
859 { "Source Route", "dvmrp.flag.srcroute", FT_BOOLEAN, 8,
860 NULL, DVMRP_V3_FLAG_SRCROUTE, "Tunnel uses IP source routing", HFILL }},
863 { "Down", "dvmrp.flag.down", FT_BOOLEAN, 8,
864 NULL, DVMRP_V3_FLAG_DOWN, "Operational status down", HFILL }},
867 { "Disabled", "dvmrp.flag.disabled", FT_BOOLEAN, 8,
868 NULL, DVMRP_V3_FLAG_DISABLED, "Administrative status down", HFILL }},
871 { "Querier", "dvmrp.flag.querier", FT_BOOLEAN, 8,
872 NULL, DVMRP_V3_FLAG_QUERIER, "Querier for interface", HFILL }},
875 { "Leaf", "dvmrp.flag.leaf", FT_BOOLEAN, 8,
876 NULL, DVMRP_V3_FLAG_LEAF, "No downstream neighbors on interface", HFILL }},
879 { "Neighbor Count", "dvmrp.ncount", FT_UINT8, BASE_DEC,
880 NULL, 0, "DVMRP Neighbor Count", HFILL }},
883 { "Neighbor Addr", "dvmrp.neighbor", FT_IPv4, BASE_NONE,
884 NULL, 0, "DVMRP Neighbor Address", HFILL }}
886 static gint *ett[] = {
893 module_t *module_dvmrp;
895 proto_dvmrp = proto_register_protocol("Distance Vector Multicast Routing Protocol",
897 proto_register_field_array(proto_dvmrp, hf, array_length(hf));
898 proto_register_subtree_array(ett, array_length(ett));
900 module_dvmrp = prefs_register_protocol(proto_dvmrp, NULL);
902 prefs_register_bool_preference(module_dvmrp, "strict_v3", "Allow strict DVMRP V3 only",
903 "Allow only packets with Major=0x03//Minor=0xFF as DVMRP V3 packets",