Use tvb_get_ephemeral_string() instead of tvb_get_string()
svn path=/trunk/; revision=30000
This commit is contained in:
parent
6ec8e0ced3
commit
47bdc0fda3
|
@ -52,7 +52,7 @@ typedef enum {
|
||||||
XFER_RESUME = 0x33,
|
XFER_RESUME = 0x33,
|
||||||
XFER_CANCEL = 0x34
|
XFER_CANCEL = 0x34
|
||||||
} auth_cmd_e;
|
} auth_cmd_e;
|
||||||
|
|
||||||
static const value_string cmd_vs[] = {
|
static const value_string cmd_vs[] = {
|
||||||
{ AUTH_LOGON_CHALLENGE, "Authentication Logon Challenge" },
|
{ AUTH_LOGON_CHALLENGE, "Authentication Logon Challenge" },
|
||||||
{ AUTH_LOGON_PROOF, "Authentication Logon Proof" },
|
{ AUTH_LOGON_PROOF, "Authentication Logon Proof" },
|
||||||
|
@ -216,7 +216,7 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||||
val_to_str_const(cmd, cmd_vs,
|
val_to_str_const(cmd, cmd_vs,
|
||||||
"Unrecognized packet type"));
|
"Unrecognized packet type"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tree) {
|
if(tree) {
|
||||||
ti = proto_tree_add_item(tree, proto_wow, tvb, 0, -1, TRUE);
|
ti = proto_tree_add_item(tree, proto_wow, tvb, 0, -1, TRUE);
|
||||||
wow_tree = proto_item_add_subtree(ti, ett_wow);
|
wow_tree = proto_item_add_subtree(ti, ett_wow);
|
||||||
|
@ -233,51 +233,47 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||||
proto_tree_add_item(wow_tree, hf_wow_error, tvb,
|
proto_tree_add_item(wow_tree, hf_wow_error, tvb,
|
||||||
offset, 1, TRUE);
|
offset, 1, TRUE);
|
||||||
offset += 1;
|
offset += 1;
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree, hf_wow_pkt_size,
|
proto_tree_add_item(wow_tree, hf_wow_pkt_size,
|
||||||
tvb, offset, 2, TRUE);
|
tvb, offset, 2, TRUE);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
|
|
||||||
string = g_strreverse(tvb_get_string(tvb, offset, 4));
|
string = g_strreverse(tvb_get_ephemeral_string(tvb, offset, 4));
|
||||||
proto_tree_add_string(wow_tree, hf_wow_gamename,
|
proto_tree_add_string(wow_tree, hf_wow_gamename,
|
||||||
tvb, offset, 4, string);
|
tvb, offset, 4, string);
|
||||||
g_free(string);
|
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree, hf_wow_version1,
|
proto_tree_add_item(wow_tree, hf_wow_version1,
|
||||||
tvb, offset, 1, TRUE);
|
tvb, offset, 1, TRUE);
|
||||||
offset += 1;
|
offset += 1;
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree, hf_wow_version2,
|
proto_tree_add_item(wow_tree, hf_wow_version2,
|
||||||
tvb, offset, 1, TRUE);
|
tvb, offset, 1, TRUE);
|
||||||
offset += 1;
|
offset += 1;
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree, hf_wow_version3,
|
proto_tree_add_item(wow_tree, hf_wow_version3,
|
||||||
tvb, offset, 1, TRUE);
|
tvb, offset, 1, TRUE);
|
||||||
offset += 1;
|
offset += 1;
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree, hf_wow_build, tvb,
|
proto_tree_add_item(wow_tree, hf_wow_build, tvb,
|
||||||
offset, 2, TRUE);
|
offset, 2, TRUE);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
|
|
||||||
string = g_strreverse(tvb_get_string(tvb, offset, 4));
|
string = g_strreverse(tvb_get_ephemeral_string(tvb, offset, 4));
|
||||||
proto_tree_add_string(wow_tree, hf_wow_platform,
|
proto_tree_add_string(wow_tree, hf_wow_platform,
|
||||||
tvb, offset, 4, string);
|
tvb, offset, 4, string);
|
||||||
g_free(string);
|
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
|
||||||
string = g_strreverse(tvb_get_string(tvb, offset, 4));
|
string = g_strreverse(tvb_get_ephemeral_string(tvb, offset, 4));
|
||||||
proto_tree_add_string(wow_tree, hf_wow_os, tvb,
|
proto_tree_add_string(wow_tree, hf_wow_os, tvb,
|
||||||
offset, 4, string);
|
offset, 4, string);
|
||||||
g_free(string);
|
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
|
||||||
string = g_strreverse(tvb_get_string(tvb, offset, 4));
|
string = g_strreverse(tvb_get_ephemeral_string(tvb, offset, 4));
|
||||||
proto_tree_add_string(wow_tree, hf_wow_country,
|
proto_tree_add_string(wow_tree, hf_wow_country,
|
||||||
tvb, offset, 4, string);
|
tvb, offset, 4, string);
|
||||||
g_free(string);
|
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree,
|
proto_tree_add_item(wow_tree,
|
||||||
hf_wow_timezone_bias,
|
hf_wow_timezone_bias,
|
||||||
tvb, offset, 4, TRUE);
|
tvb, offset, 4, TRUE);
|
||||||
|
@ -286,7 +282,7 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||||
proto_tree_add_item(wow_tree, hf_wow_ip, tvb,
|
proto_tree_add_item(wow_tree, hf_wow_ip, tvb,
|
||||||
offset, 4, FALSE);
|
offset, 4, FALSE);
|
||||||
offset += 4;
|
offset += 4;
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree,
|
proto_tree_add_item(wow_tree,
|
||||||
hf_wow_srp_i_len,
|
hf_wow_srp_i_len,
|
||||||
tvb, offset, 1, TRUE);
|
tvb, offset, 1, TRUE);
|
||||||
|
@ -304,7 +300,7 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||||
proto_tree_add_item(wow_tree, hf_wow_error, tvb,
|
proto_tree_add_item(wow_tree, hf_wow_error, tvb,
|
||||||
offset, 1, TRUE);
|
offset, 1, TRUE);
|
||||||
offset += 1;
|
offset += 1;
|
||||||
|
|
||||||
offset += 1; /* Unknown field */
|
offset += 1; /* Unknown field */
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree, hf_wow_srp_b, tvb,
|
proto_tree_add_item(wow_tree, hf_wow_srp_b, tvb,
|
||||||
|
@ -335,7 +331,7 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||||
|
|
||||||
offset += 16; /* Unknown field */
|
offset += 16; /* Unknown field */
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AUTH_LOGON_PROOF :
|
case AUTH_LOGON_PROOF :
|
||||||
|
@ -375,19 +371,19 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REALM_LIST :
|
case REALM_LIST :
|
||||||
|
|
||||||
if(WOW_CLIENT_TO_SERVER) {
|
if(WOW_CLIENT_TO_SERVER) {
|
||||||
|
|
||||||
|
|
||||||
} else if(WOW_SERVER_TO_CLIENT) {
|
} else if(WOW_SERVER_TO_CLIENT) {
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree, hf_wow_pkt_size,
|
proto_tree_add_item(wow_tree, hf_wow_pkt_size,
|
||||||
tvb, offset, 2, TRUE);
|
tvb, offset, 2, TRUE);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
|
|
||||||
offset += 4; /* Unknown field; always 0 */
|
offset += 4; /* Unknown field; always 0 */
|
||||||
|
|
||||||
proto_tree_add_item(wow_tree, hf_wow_num_realms,
|
proto_tree_add_item(wow_tree, hf_wow_num_realms,
|
||||||
tvb, offset, 2, TRUE);
|
tvb, offset, 2, TRUE);
|
||||||
num_realms = tvb_get_letohs(tvb, offset);
|
num_realms = tvb_get_letohs(tvb, offset);
|
||||||
|
@ -402,7 +398,7 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||||
offset, 0,
|
offset, 0,
|
||||||
"%s",
|
"%s",
|
||||||
realm_name);
|
realm_name);
|
||||||
|
|
||||||
wow_realms_tree = proto_item_add_subtree(ti, ett_wow_realms);
|
wow_realms_tree = proto_item_add_subtree(ti, ett_wow_realms);
|
||||||
proto_tree_add_item(wow_realms_tree, hf_wow_realm_type, tvb, offset, 1, TRUE);
|
proto_tree_add_item(wow_realms_tree, hf_wow_realm_type, tvb, offset, 1, TRUE);
|
||||||
offset += 1;
|
offset += 1;
|
||||||
|
@ -453,7 +449,7 @@ proto_register_wow(void)
|
||||||
FT_UINT8, BASE_HEX, VALS(cmd_vs), 0,
|
FT_UINT8, BASE_HEX, VALS(cmd_vs), 0,
|
||||||
"Type of packet", HFILL }
|
"Type of packet", HFILL }
|
||||||
},
|
},
|
||||||
|
|
||||||
{ &hf_wow_error,
|
{ &hf_wow_error,
|
||||||
{ "Error", "wow.error",
|
{ "Error", "wow.error",
|
||||||
FT_UINT8, BASE_DEC, 0, 0,
|
FT_UINT8, BASE_DEC, 0, 0,
|
||||||
|
|
Loading…
Reference in New Issue