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 * SPDX-License-Identifier: GPL-2.0-or-later
25 * V3 has len>=8 and byte[6]==0xff and byte[7]==0x03
28 DVMRP is defined in the following RFCs
30 draft-ietf-idmr-dvmrp-v3-10.txt Version 3
32 V1 and V3 can be distinguished by looking at bytes 6 and 7 in the
34 If header[6]==0xff and header[7]==0x03 we have version 3.
37 RFC1075 has typos in 3.12.2 and 3.12.4, see if you can spot them.
42 #include <epan/packet.h>
43 #include <epan/prefs.h>
44 #include <epan/expert.h>
46 #include "packet-igmp.h"
48 void proto_register_dvmrp(void);
49 void proto_reg_handoff_dvmrp(void);
51 static dissector_handle_t dvmrp_handle
;
53 static int proto_dvmrp
;
54 static int hf_version
;
56 static int hf_code_v1
;
57 static int hf_checksum
;
58 static int hf_checksum_status
;
59 static int hf_reserved
;
60 static int hf_commands
;
61 static int hf_command
;
64 static int hf_netmask
;
66 static int hf_dest_unr
;
67 static int hf_split_horiz
;
68 static int hf_infinity
;
72 static int hf_code_v3
;
73 static int hf_capabilities
;
74 static int hf_cap_leaf
;
75 static int hf_cap_prune
;
76 static int hf_cap_genid
;
77 static int hf_cap_mtrace
;
78 static int hf_cap_snmp
;
79 static int hf_cap_netmask
;
80 static int hf_min_ver
;
81 static int hf_maj_ver
;
87 static int hf_threshold
;
89 static int hf_flag_tunnel
;
90 static int hf_flag_srcroute
;
91 static int hf_flag_down
;
92 static int hf_flag_disabled
;
93 static int hf_flag_querier
;
94 static int hf_flag_leaf
;
96 static int hf_neighbor
;
99 static int ett_commands
;
100 static int ett_capabilities
;
101 static int ett_flags
;
102 static int ett_route
;
104 static expert_field ei_checksum
;
106 static bool strict_v3
;
108 #define DVMRP_TYPE 0x13
109 static const value_string dvmrp_type
[] = {
110 {DVMRP_TYPE
, "DVMRP" },
114 #define DVMRP_V1_RESPONSE 1
115 #define DVMRP_V1_REQUEST 2
116 #define DVMRP_V1_NON_MEMBERSHIP_REPORT 3
117 #define DVMRP_V1_NON_MEMBERSHIP_CANCELLATION 4
118 static const value_string code_v1
[] = {
119 {DVMRP_V1_RESPONSE
, "Response" },
120 {DVMRP_V1_REQUEST
, "Request" },
121 {DVMRP_V1_NON_MEMBERSHIP_REPORT
, "Non-membership report" },
122 {DVMRP_V1_NON_MEMBERSHIP_CANCELLATION
, "Non-membership cancellation" },
126 #define DVMRP_V3_PROBE 0x1
127 #define DVMRP_V3_REPORT 0x2
128 #define DVMRP_V3_ASK_NEIGHBORS 0x3
129 #define DVMRP_V3_NEIGHBORS 0x4
130 #define DVMRP_V3_ASK_NEIGHBORS_2 0x5
131 #define DVMRP_V3_NEIGHBORS_2 0x6
132 #define DVMRP_V3_PRUNE 0x7
133 #define DVMRP_V3_GRAFT 0x8
134 #define DVMRP_V3_GRAFT_ACK 0x9
135 static const value_string code_v3
[] = {
136 {DVMRP_V3_PROBE
, "Probe"},
137 {DVMRP_V3_REPORT
, "Report"},
138 {DVMRP_V3_ASK_NEIGHBORS
, "Ask Neighbors"},
139 {DVMRP_V3_NEIGHBORS
, "Neighbors"},
140 {DVMRP_V3_ASK_NEIGHBORS_2
, "Ask Neighbors 2"},
141 {DVMRP_V3_NEIGHBORS_2
, "Neighbors 2"},
142 {DVMRP_V3_PRUNE
, "Prune"},
143 {DVMRP_V3_GRAFT
, "Graft"},
144 {DVMRP_V3_GRAFT_ACK
, "Graft ACK"},
148 #define DVMRP_V3_CAP_LEAF 0x01
149 #define DVMRP_V3_CAP_PRUNE 0x02
150 #define DVMRP_V3_CAP_GENID 0x04
151 #define DVMRP_V3_CAP_MTRACE 0x08
152 #define DVMRP_V3_CAP_SNMP 0x10
153 #define DVMRP_V3_CAP_NETMASK 0x20
155 #define DVMRP_V3_FLAG_TUNNEL 0x01
156 #define DVMRP_V3_FLAG_SRCROUTE 0x02
157 #define DVMRP_V3_FLAG_DOWN 0x10
158 #define DVMRP_V3_FLAG_DISABLED 0x20
159 #define DVMRP_V3_FLAG_QUERIER 0x40
160 #define DVMRP_V3_FLAG_LEAF 0x80
163 #define V1_COMMAND_NULL 0
164 #define V1_COMMAND_AFI 2
165 #define V1_COMMAND_SUBNETMASK 3
166 #define V1_COMMAND_METRIC 4
167 #define V1_COMMAND_FLAGS0 5
168 #define V1_COMMAND_INFINITY 6
169 #define V1_COMMAND_DA 7
170 #define V1_COMMAND_RDA 8
171 #define V1_COMMAND_NMR 9
172 #define V1_COMMAND_NMR_CANCEL 10
173 static const value_string command
[] = {
174 {V1_COMMAND_NULL
, "NULL" },
175 {V1_COMMAND_AFI
, "Address Family Indicator"},
176 {V1_COMMAND_SUBNETMASK
, "Subnetmask"},
177 {V1_COMMAND_METRIC
, "Metric"},
178 {V1_COMMAND_FLAGS0
, "Flags0"},
179 {V1_COMMAND_INFINITY
, "Infinity"},
180 {V1_COMMAND_DA
, "Destination Address"},
181 {V1_COMMAND_RDA
, "Requested Destination Address"},
182 {V1_COMMAND_NMR
, "Non-Membership Report"},
183 {V1_COMMAND_NMR_CANCEL
, "Non-Membership Report Cancel"},
188 static const value_string afi
[] = {
189 {V1_AFI_IP
, "IP v4 Family"},
193 static const true_false_string tfs_dest_unreach
= {
194 "Destination Unreachable",
195 "NOT Destination Unreachable"
198 static const true_false_string tfs_split_horiz
= {
199 "Split Horizon concealed route",
200 "NOT Split Horizon concealed route"
203 static const true_false_string tfs_cap_leaf
= {
207 static const true_false_string tfs_cap_prune
= {
211 static const true_false_string tfs_cap_genid
= {
215 static const true_false_string tfs_cap_mtrace
= {
216 "Multicast Traceroute capable",
217 "NOT Multicast Traceroute capable"
219 static const true_false_string tfs_cap_snmp
= {
223 static const true_false_string tfs_cap_netmask
= {
225 "NOT Netmask capable"
229 dissect_v3_report(tvbuff_t
*tvb
, proto_tree
*parent_tree
, int offset
)
236 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
239 int old_offset_a
= offset
;
241 item
= proto_tree_add_item(parent_tree
, hf_route
,
242 tvb
, offset
, -1, ENC_NA
);
243 tree
= proto_item_add_subtree(item
, ett_route
);
247 m1
= tvb_get_uint8(tvb
, offset
);
248 m2
= tvb_get_uint8(tvb
, offset
+1);
249 m3
= tvb_get_uint8(tvb
, offset
+2);
255 proto_tree_add_ipv4(tree
, hf_netmask
, tvb
, offset
, 3, ip
);
259 /* read every srcnet, metric pairs */
261 int old_offset_b
= offset
;
268 s0
= tvb_get_uint8(tvb
, offset
);
271 s1
= tvb_get_uint8(tvb
, offset
);
275 s2
= tvb_get_uint8(tvb
, offset
);
279 s3
= tvb_get_uint8(tvb
, offset
);
283 /* handle special case for default route V3/3.4.3 */
284 if ((!m1
)&&(!m2
)&&(!m3
)&&(!s0
)) {
292 proto_tree_add_ipv4_format(tree
, hf_saddr
, tvb
,
293 old_offset_b
, offset
-old_offset_b
, ip
,
294 "%s %d.%d.%d.%d (netmask %d.%d.%d.%d)",
295 m0
?"Source Network":"Default Route",
296 s0
,s1
,s2
,s3
,m0
,m1
,m2
,m3
);
298 metric
= tvb_get_uint8(tvb
, offset
);
299 proto_tree_add_uint(tree
, hf_metric
, tvb
,
300 offset
, 1, metric
&0x7f);
304 } while (!(metric
&0x80));
306 proto_item_set_len(item
, offset
-old_offset_a
);
313 dissect_dvmrp_v3(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*parent_tree
, int offset
)
318 proto_tree_add_uint(parent_tree
, hf_version
, tvb
, 0, 0, 3);
320 /* type of command */
321 proto_tree_add_uint(parent_tree
, hf_type
, tvb
, offset
, 1, 0x13);
325 code
= tvb_get_uint8(tvb
, offset
);
326 proto_tree_add_uint(parent_tree
, hf_code_v3
, tvb
, offset
, 1, code
);
328 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
329 "V%d %s",3 ,val_to_str(code
, code_v3
,
330 "Unknown Type:0x%02x"));
333 igmp_checksum(parent_tree
, tvb
, hf_checksum
, hf_checksum_status
, &ei_checksum
, pinfo
, 0);
336 /* skip unused byte */
337 proto_tree_add_item(parent_tree
, hf_reserved
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
340 /* PROBE and NEIGHBORS 2 packets have capabilities flags, unused
342 if (code
==DVMRP_V3_PROBE
|| code
==DVMRP_V3_NEIGHBORS_2
) {
343 static int * const capabilities
[] = {
353 proto_tree_add_bitmask(parent_tree
, tvb
, offset
, hf_capabilities
,
354 ett_capabilities
, capabilities
, ENC_NA
);
359 proto_tree_add_item(parent_tree
, hf_min_ver
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
363 proto_tree_add_item(parent_tree
, hf_maj_ver
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
369 proto_tree_add_item(parent_tree
, hf_genid
, tvb
,
370 offset
, 4, ENC_BIG_ENDIAN
);
372 while (tvb_reported_length_remaining(tvb
, offset
)>=4) {
373 proto_tree_add_item(parent_tree
, hf_neighbor
,
374 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
378 case DVMRP_V3_REPORT
:
379 offset
= dissect_v3_report(tvb
, parent_tree
, offset
);
383 proto_tree_add_item(parent_tree
, hf_saddr
,
384 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
387 proto_tree_add_item(parent_tree
, hf_maddr
,
388 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
391 proto_tree_add_item(parent_tree
, hf_life
,
392 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
395 if (tvb_reported_length_remaining(tvb
, offset
)>=4) {
396 proto_tree_add_item(parent_tree
, hf_netmask
,
397 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
403 proto_tree_add_item(parent_tree
, hf_saddr
,
404 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
407 proto_tree_add_item(parent_tree
, hf_maddr
,
408 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
411 if (tvb_reported_length_remaining(tvb
, offset
)>=4) {
412 proto_tree_add_item(parent_tree
, hf_netmask
,
413 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
417 case DVMRP_V3_GRAFT_ACK
:
419 proto_tree_add_item(parent_tree
, hf_saddr
,
420 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
423 proto_tree_add_item(parent_tree
, hf_maddr
,
424 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
427 if (tvb_reported_length_remaining(tvb
, offset
)>=4) {
428 proto_tree_add_item(parent_tree
, hf_netmask
,
429 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
433 case DVMRP_V3_ASK_NEIGHBORS
:
434 case DVMRP_V3_NEIGHBORS
:
435 /* XXX - obsolete, and the draft doesn't describe them */
437 case DVMRP_V3_ASK_NEIGHBORS_2
:
440 case DVMRP_V3_NEIGHBORS_2
:
441 while (tvb_reported_length_remaining(tvb
, offset
)>=12) {
442 uint8_t neighbor_count
;
445 proto_tree_add_item(parent_tree
, hf_local
,
446 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
449 proto_tree_add_item(parent_tree
, hf_metric
,
450 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
453 proto_tree_add_item(parent_tree
, hf_threshold
,
454 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
461 item
= proto_tree_add_item(parent_tree
, hf_flags
,
462 tvb
, offset
, 1, ENC_NA
);
463 tree
= proto_item_add_subtree(item
, ett_flags
);
465 proto_tree_add_item(tree
, hf_flag_tunnel
, tvb
,
466 offset
, 1, ENC_BIG_ENDIAN
);
467 proto_tree_add_item(tree
, hf_flag_srcroute
, tvb
,
468 offset
, 1, ENC_BIG_ENDIAN
);
469 proto_tree_add_item(tree
, hf_flag_down
, tvb
,
470 offset
, 1, ENC_BIG_ENDIAN
);
471 proto_tree_add_item(tree
, hf_flag_disabled
, tvb
,
472 offset
, 1, ENC_BIG_ENDIAN
);
473 proto_tree_add_item(tree
, hf_flag_querier
, tvb
,
474 offset
, 1, ENC_BIG_ENDIAN
);
475 proto_tree_add_item(tree
, hf_flag_leaf
, tvb
,
476 offset
, 1, ENC_BIG_ENDIAN
);
480 neighbor_count
= tvb_get_uint8(tvb
, offset
);
481 proto_tree_add_item(parent_tree
, hf_ncount
,
482 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
485 while ((tvb_reported_length_remaining(tvb
, offset
)>=4)
486 && (neighbor_count
>0)) {
487 proto_tree_add_item(parent_tree
, hf_neighbor
,
488 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
501 dissect_dvmrp_v1(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*parent_tree
, int offset
)
504 uint8_t af
=2; /* default */
507 proto_tree_add_uint(parent_tree
, hf_version
, tvb
, 0, 0, 1);
509 /* type of command */
510 proto_tree_add_uint(parent_tree
, hf_type
, tvb
, offset
, 1, 0x13);
514 code
= tvb_get_uint8(tvb
, offset
);
515 proto_tree_add_uint(parent_tree
, hf_code_v1
, tvb
, offset
, 1, code
);
517 col_add_fstr(pinfo
->cinfo
, COL_INFO
,
518 "V%d %s",1 ,val_to_str(code
, code_v1
,
519 "Unknown Type:0x%02x"));
522 igmp_checksum(parent_tree
, tvb
, hf_checksum
, hf_checksum_status
, &ei_checksum
, pinfo
, 0);
525 /* decode all the v1 commands */
526 while (tvb_reported_length_remaining(tvb
, offset
) > 0) {
530 int old_offset
= offset
;
532 item
= proto_tree_add_item(parent_tree
, hf_commands
,
533 tvb
, offset
, -1, ENC_NA
);
534 tree
= proto_item_add_subtree(item
, ett_commands
);
536 cmd
= tvb_get_uint8(tvb
, offset
);
537 proto_tree_add_uint(tree
, hf_command
, tvb
,
542 case V1_COMMAND_NULL
:
543 offset
+= 1; /* skip ignored/pad byte*/
545 proto_item_set_text(item
, "Command: NULL");
549 af
= tvb_get_uint8(tvb
, offset
);
550 proto_tree_add_uint(tree
, hf_afi
, tvb
,
554 proto_item_set_text(item
, "%s: %s",
555 val_to_str(cmd
, command
, "Unknown Command:0x%02x"),
556 val_to_str(af
, afi
, "Unknown Family:0x%02x")
560 case V1_COMMAND_SUBNETMASK
:
561 count
= tvb_get_uint8(tvb
, offset
);
562 proto_tree_add_uint(tree
, hf_count
, tvb
,
565 if (count
) { /* must be 0 or 1 */
566 proto_tree_add_item(tree
, hf_netmask
,
567 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
569 proto_item_set_text(item
, "%s: %d.%d.%d.%d",
570 val_to_str(cmd
, command
, "Unknown Command:0x%02x"),
571 tvb_get_uint8(tvb
, offset
),
572 tvb_get_uint8(tvb
, offset
+1),
573 tvb_get_uint8(tvb
, offset
+2),
574 tvb_get_uint8(tvb
, offset
+3));
579 proto_item_set_text(item
, "%s: <no mask supplied>",
580 val_to_str(cmd
, command
, "Unknown Command:0x%02x"));
584 case V1_COMMAND_METRIC
:
585 proto_tree_add_item(tree
, hf_metric
, tvb
,
586 offset
, 1, ENC_BIG_ENDIAN
);
588 proto_item_set_text(item
, "%s: %d",
589 val_to_str(cmd
, command
, "Unknown Command:0x%02x"),
590 tvb_get_uint8(tvb
, offset
));
594 case V1_COMMAND_FLAGS0
:
595 count
= tvb_get_uint8(tvb
, offset
);
596 proto_tree_add_boolean(tree
, hf_dest_unr
, tvb
, offset
, 1, count
);
597 proto_tree_add_boolean(tree
, hf_split_horiz
, tvb
, offset
, 1, count
);
599 proto_item_set_text(item
, "%s: 0x%02x",
600 val_to_str(cmd
, command
, "Unknown Command:0x%02x"), count
);
604 case V1_COMMAND_INFINITY
:
605 proto_tree_add_item(tree
, hf_infinity
, tvb
,
606 offset
, 1, ENC_BIG_ENDIAN
);
608 proto_item_set_text(item
, "%s: %d",
609 val_to_str(cmd
, command
, "Unknown Command:0x%02x"), tvb_get_uint8(tvb
, offset
));
614 case V1_COMMAND_RDA
: /* same as DA */
615 count
= tvb_get_uint8(tvb
, offset
);
616 proto_tree_add_uint(tree
, hf_count
, tvb
,
620 proto_tree_add_item(tree
, hf_daddr
,
621 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
625 proto_item_set_text(item
, "%s",
626 val_to_str(cmd
, command
, "Unknown Command:0x%02x"));
630 count
= tvb_get_uint8(tvb
, offset
);
631 proto_tree_add_uint(tree
, hf_count
, tvb
,
635 proto_tree_add_item(tree
, hf_maddr
,
636 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
638 proto_tree_add_item(tree
, hf_hold
, tvb
,
639 offset
, 4, ENC_BIG_ENDIAN
);
643 proto_item_set_text(item
, "%s",
644 val_to_str(cmd
, command
, "Unknown Command:0x%02x"));
647 case V1_COMMAND_NMR_CANCEL
:
648 count
= tvb_get_uint8(tvb
, offset
);
649 proto_tree_add_uint(tree
, hf_count
, tvb
,
653 proto_tree_add_item(tree
, hf_maddr
,
654 tvb
, offset
, 4, ENC_BIG_ENDIAN
);
658 proto_item_set_text(item
, "%s",
659 val_to_str(cmd
, command
, "Unknown Command:0x%02x"));
664 proto_item_set_len(item
, offset
-old_offset
);
670 /* This function is only called from the IGMP dissector */
672 dissect_dvmrp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*parent_tree
, void* data _U_
)
678 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "DVMRP");
679 col_clear(pinfo
->cinfo
, COL_INFO
);
681 item
= proto_tree_add_item(parent_tree
, proto_dvmrp
, tvb
, offset
, -1, ENC_NA
);
682 tree
= proto_item_add_subtree(item
, ett_dvmrp
);
684 if ((tvb_captured_length_remaining(tvb
, offset
)>=8)
685 && (((tvb_get_uint8(tvb
, 6)==0xff)
686 && (tvb_get_uint8(tvb
, 7)==0x03))
688 offset
= dissect_dvmrp_v3(tvb
, pinfo
, tree
, offset
);
690 offset
= dissect_dvmrp_v1(tvb
, pinfo
, tree
, offset
);
693 proto_item_set_len(item
, offset
);
698 proto_register_dvmrp(void)
700 static hf_register_info hf
[] = {
702 { "DVMRP Version", "dvmrp.version", FT_UINT8
, BASE_DEC
,
703 NULL
, 0, NULL
, HFILL
}},
706 { "Type", "dvmrp.type", FT_UINT8
, BASE_HEX
,
707 VALS(dvmrp_type
), 0, "DVMRP Packet Type", HFILL
}},
710 { "Code", "dvmrp.v1.code", FT_UINT8
, BASE_HEX
,
711 VALS(code_v1
), 0, "DVMRP Packet Code", HFILL
}},
714 { "Checksum", "dvmrp.checksum", FT_UINT16
, BASE_HEX
,
715 NULL
, 0, "DVMRP Checksum", HFILL
}},
717 { &hf_checksum_status
,
718 { "Checksum Status", "dvmrp.checksum.status", FT_UINT8
, BASE_NONE
,
719 VALS(proto_checksum_vals
), 0x0, NULL
, HFILL
}},
722 { "Reserved", "dvmrp.reserved", FT_UINT16
, BASE_HEX
,
723 NULL
, 0, "DVMRP v3 Reserved", HFILL
}},
726 { "Commands", "dvmrp.commands", FT_NONE
, BASE_NONE
,
727 NULL
, 0, "DVMRP V1 Commands", HFILL
}},
730 { "Command", "dvmrp.command", FT_UINT8
, BASE_HEX
,
731 VALS(command
), 0, "DVMRP V1 Command", HFILL
}},
734 { "Address Family", "dvmrp.afi", FT_UINT8
, BASE_HEX
,
735 VALS(afi
), 0, "DVMRP Address Family Indicator", HFILL
}},
738 { "Count", "dvmrp.count", FT_UINT8
, BASE_HEX
,
739 NULL
, 0, NULL
, HFILL
}},
742 { "Netmask", "dvmrp.netmask", FT_IPv4
, BASE_NETMASK
,
743 NULL
, 0, "DVMRP Netmask", HFILL
}},
746 { "Metric", "dvmrp.metric", FT_UINT8
, BASE_DEC
,
747 NULL
, 0, "DVMRP Metric", HFILL
}},
750 { "Destination Unreachable", "dvmrp.dest_unreach", FT_BOOLEAN
, 8,
751 TFS(&tfs_dest_unreach
), 0x01, NULL
, HFILL
}},
754 { "Split Horizon", "dvmrp.split_horiz", FT_BOOLEAN
, 8,
755 TFS(&tfs_split_horiz
), 0x02, "Split Horizon concealed route", HFILL
}},
758 { "Infinity", "dvmrp.infinity", FT_UINT8
, BASE_DEC
,
759 NULL
, 0, "DVMRP Infinity", HFILL
}},
762 { "Dest Addr", "dvmrp.daddr", FT_IPv4
, BASE_NONE
,
763 NULL
, 0, "DVMRP Destination Address", HFILL
}},
766 { "Multicast Addr", "dvmrp.maddr", FT_IPv4
, BASE_NONE
,
767 NULL
, 0, "DVMRP Multicast Address", HFILL
}},
770 { "Hold Time", "dvmrp.hold", FT_UINT32
, BASE_DEC
,
771 NULL
, 0, "DVMRP Hold Time in seconds", HFILL
}},
774 { "Code", "dvmrp.v3.code", FT_UINT8
, BASE_HEX
,
775 VALS(code_v3
), 0, "DVMRP Packet Code", HFILL
}},
778 { "Capabilities", "dvmrp.capabilities", FT_UINT8
, BASE_HEX
,
779 NULL
, 0, "DVMRP V3 Capabilities", HFILL
}},
782 { "Leaf", "dvmrp.cap.leaf", FT_BOOLEAN
, 8,
783 TFS(&tfs_cap_leaf
), DVMRP_V3_CAP_LEAF
, NULL
, HFILL
}},
786 { "Prune", "dvmrp.cap.prune", FT_BOOLEAN
, 8,
787 TFS(&tfs_cap_prune
), DVMRP_V3_CAP_PRUNE
, "Prune capability", HFILL
}},
790 { "Genid", "dvmrp.cap.genid", FT_BOOLEAN
, 8,
791 TFS(&tfs_cap_genid
), DVMRP_V3_CAP_GENID
, "Genid capability", HFILL
}},
794 { "Mtrace", "dvmrp.cap.mtrace", FT_BOOLEAN
, 8,
795 TFS(&tfs_cap_mtrace
), DVMRP_V3_CAP_MTRACE
, "Mtrace capability", HFILL
}},
798 { "SNMP", "dvmrp.cap.snmp", FT_BOOLEAN
, 8,
799 TFS(&tfs_cap_snmp
), DVMRP_V3_CAP_SNMP
, "SNMP capability", HFILL
}},
802 { "Netmask", "dvmrp.cap.netmask", FT_BOOLEAN
, 8,
803 TFS(&tfs_cap_netmask
), DVMRP_V3_CAP_NETMASK
, "Netmask capability", HFILL
}},
806 { "Minor Version", "dvmrp.min_ver", FT_UINT8
, BASE_HEX
,
807 NULL
, 0, "DVMRP Minor Version", HFILL
}},
810 { "Major Version", "dvmrp.maj_ver", FT_UINT8
, BASE_HEX
,
811 NULL
, 0, "DVMRP Major Version", HFILL
}},
814 { "Generation ID", "dvmrp.genid", FT_UINT32
, BASE_DEC
,
815 NULL
, 0, "DVMRP Generation ID", HFILL
}},
818 { "Route", "dvmrp.route", FT_NONE
, BASE_NONE
,
819 NULL
, 0, "DVMRP V3 Route Report", HFILL
}},
822 { "Source Addr", "dvmrp.saddr", FT_IPv4
, BASE_NONE
,
823 NULL
, 0, "DVMRP Source Address", HFILL
}},
826 { "Prune lifetime", "dvmrp.lifetime", FT_UINT32
, BASE_DEC
,
827 NULL
, 0, "DVMRP Prune Lifetime", HFILL
}},
830 { "Local Addr", "dvmrp.local", FT_IPv4
, BASE_NONE
,
831 NULL
, 0, "DVMRP Local Address", HFILL
}},
834 { "Threshold", "dvmrp.threshold", FT_UINT8
, BASE_DEC
,
835 NULL
, 0, "DVMRP Interface Threshold", HFILL
}},
838 { "Flags", "dvmrp.flags", FT_NONE
, BASE_NONE
,
839 NULL
, 0, "DVMRP Interface Flags", HFILL
}},
842 { "Tunnel", "dvmrp.flag.tunnel", FT_BOOLEAN
, 8,
843 NULL
, DVMRP_V3_FLAG_TUNNEL
, "Neighbor reached via tunnel", HFILL
}},
846 { "Source Route", "dvmrp.flag.srcroute", FT_BOOLEAN
, 8,
847 NULL
, DVMRP_V3_FLAG_SRCROUTE
, "Tunnel uses IP source routing", HFILL
}},
850 { "Down", "dvmrp.flag.down", FT_BOOLEAN
, 8,
851 NULL
, DVMRP_V3_FLAG_DOWN
, "Operational status down", HFILL
}},
854 { "Disabled", "dvmrp.flag.disabled", FT_BOOLEAN
, 8,
855 NULL
, DVMRP_V3_FLAG_DISABLED
, "Administrative status down", HFILL
}},
858 { "Querier", "dvmrp.flag.querier", FT_BOOLEAN
, 8,
859 NULL
, DVMRP_V3_FLAG_QUERIER
, "Querier for interface", HFILL
}},
862 { "Leaf", "dvmrp.flag.leaf", FT_BOOLEAN
, 8,
863 NULL
, DVMRP_V3_FLAG_LEAF
, "No downstream neighbors on interface", HFILL
}},
866 { "Neighbor Count", "dvmrp.ncount", FT_UINT8
, BASE_DEC
,
867 NULL
, 0, "DVMRP Neighbor Count", HFILL
}},
870 { "Neighbor Addr", "dvmrp.neighbor", FT_IPv4
, BASE_NONE
,
871 NULL
, 0, "DVMRP Neighbor Address", HFILL
}}
873 static int *ett
[] = {
881 static ei_register_info ei
[] = {
882 { &ei_checksum
, { "dvmrp.bad_checksum", PI_CHECKSUM
, PI_ERROR
, "Bad checksum", EXPFILL
}},
885 expert_module_t
* expert_dvmrp
;
887 module_t
*module_dvmrp
;
889 proto_dvmrp
= proto_register_protocol("Distance Vector Multicast Routing Protocol", "DVMRP", "dvmrp");
890 proto_register_field_array(proto_dvmrp
, hf
, array_length(hf
));
891 proto_register_subtree_array(ett
, array_length(ett
));
892 expert_dvmrp
= expert_register_protocol(proto_dvmrp
);
893 expert_register_field_array(expert_dvmrp
, ei
, array_length(ei
));
895 module_dvmrp
= prefs_register_protocol(proto_dvmrp
, NULL
);
897 prefs_register_bool_preference(module_dvmrp
, "strict_v3", "Allow strict DVMRP V3 only",
898 "Allow only packets with Major=0x03//Minor=0xFF as DVMRP V3 packets",
901 dvmrp_handle
= register_dissector("dvmrp", dissect_dvmrp
, proto_dvmrp
);
905 proto_reg_handoff_dvmrp(void)
907 dissector_add_uint("igmp.type", IGMP_DVMRP
, dvmrp_handle
);
912 * Editor modelines - https://www.wireshark.org/tools/modelines.html
917 * indent-tabs-mode: t
920 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
921 * :indentSize=8:tabSize=8:noTabs=false: