aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-02-27 12:04:21 -0500
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2016-02-27 17:58:19 +0000
commit599b54963f8008631f21d773457ed0e25b3c3c70 (patch)
treec4147900ce6dacd70c7bdd1f799c4212b70d5d72 /epan
parent2b5fe74c5d81c7b87819f5682aed5471af001d2b (diff)
BOOTP: Add preference to determine endianness of UUID.
Spec doesn't appear to explicitly state endian format. Bug: 11544 Change-Id: I601d94523199bc3f9ce4f573d9976e328d9c816a Reviewed-on: https://code.wireshark.org/review/14201 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-bootp.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index ceecda0276..8b9b09ccdf 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -755,6 +755,14 @@ static const value_string duidtype_vals[] =
static gboolean novell_string = FALSE;
+static guint bootp_uuid_endian = ENC_LITTLE_ENDIAN;
+
+static const enum_val_t bootp_uuid_endian_vals[] = {
+ { "Little Endian", "Little Endian", ENC_LITTLE_ENDIAN},
+ { "Big Endian", "Big Endian", ENC_BIG_ENDIAN },
+ { NULL, NULL, 0 }
+};
+
#define UDP_PORT_BOOTPS 67
#define UDP_PORT_BOOTPC 68
@@ -1978,8 +1986,8 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
tvb_arphrdaddr_to_str(tvb, optoff+1, 6, byte));
} else if (optlen == 17 && byte == 0) {
/* Identifier is a UUID */
- proto_tree_add_item(v_tree, hf_bootp_client_identifier_uuid,
- tvb, optoff + 1, 16, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(v_tree, hf_bootp_client_identifier_uuid, tvb, optoff + 1, 16, bootp_uuid_endian);
+
/* From RFC 4361 paragraph 6.1 DHCPv4 Client Behavior:
To send an RFC 3315-style binding identifier in a DHCPv4 'client
identifier' option, the type of the 'client identifier' option is set
@@ -2107,8 +2115,7 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
tvb_arphrdaddr_to_str(tvb, optoff+1, 6, byte));
} else if (optlen == 17 && byte == 0) {
/* Identifier is a UUID */
- proto_tree_add_item(v_tree, hf_bootp_client_identifier_uuid,
- tvb, optoff + 1, 16, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(v_tree, hf_bootp_client_identifier_uuid, tvb, optoff + 1, 16, bootp_uuid_endian);
} else {
/* otherwise, it's opaque data */
}
@@ -7881,6 +7888,13 @@ proto_register_bootp(void)
10,
&pkt_ccc_option);
+ prefs_register_enum_preference(bootp_module, "uuid.endian",
+ "Endianness of UUID",
+ "Endianness applied to UUID fields",
+ &bootp_uuid_endian,
+ bootp_uuid_endian_vals,
+ FALSE);
+
prefs_register_obsolete_preference(bootp_module, "displayasstring");
bootp_uat = uat_new("Custom BootP/DHCP Options (Excl. suboptions)",