diff options
author | Bill Meier <wmeier@newsguy.com> | 2011-10-15 18:46:26 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2011-10-15 18:46:26 +0000 |
commit | 126aa8539380e6b0b465b48d30f349b76afdc489 (patch) | |
tree | 16b43738b14751d74a8ca8e4de803ba0b6c87196 /epan/dissectors/packet-memcache.c | |
parent | 4c9bb81ad7b0f609fa236c808a1ab9ef6cab5a79 (diff) |
Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
then use ENC_ASCII.
2. For all but FT_UINT_STRING, always use ENC_NA
(replacing any existing True/1/FALSE/0
/ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).
svn path=/trunk/; revision=39426
Diffstat (limited to 'epan/dissectors/packet-memcache.c')
-rw-r--r-- | epan/dissectors/packet-memcache.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c index 778c3a82a4..173db03793 100644 --- a/epan/dissectors/packet-memcache.c +++ b/epan/dissectors/packet-memcache.c @@ -389,7 +389,7 @@ dissect_key (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean missing = FALSE; /* Set when key is missing */ if (key_len) { - ti = proto_tree_add_item (tree, hf_key, tvb, offset, key_len, ENC_BIG_ENDIAN); + ti = proto_tree_add_item (tree, hf_key, tvb, offset, key_len, ENC_ASCII|ENC_NA); offset += key_len; } @@ -449,7 +449,7 @@ dissect_value (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, expert_add_info_format (pinfo, ti, PI_UNDECODED, PI_WARN, "Illegal Value length, should be 8"); } } else { - ti = proto_tree_add_item (tree, hf_value, tvb, offset, value_len, ENC_BIG_ENDIAN); + ti = proto_tree_add_item (tree, hf_value, tvb, offset, value_len, ENC_ASCII|ENC_NA); } offset += value_len; } @@ -597,7 +597,7 @@ dissect_memcache (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dissect_value (tvb, pinfo, memcache_tree, offset, value_len, opcode, request); offset += value_len; } else if (body_len) { - proto_tree_add_item (memcache_tree, hf_value, tvb, offset, body_len, ENC_BIG_ENDIAN); + proto_tree_add_item (memcache_tree, hf_value, tvb, offset, body_len, ENC_ASCII|ENC_NA); offset += body_len; col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)", @@ -1076,7 +1076,7 @@ stat_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) tokenlen = get_token_len (line, lineend, &next_token); if ((tokenlen == 4) && strncmp (line, "STAT", tokenlen) == 0) { - proto_tree_add_item (tree, hf_command, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_command, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; occurrences = find_stat_colon (line, lineend, &first_colon, &last_colon); @@ -1093,7 +1093,7 @@ stat_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) case 2: /* stats items: 2 colons */ /* subcommand 'items' */ tokenlen = (int) (first_colon - line); - proto_tree_add_item (tree, hf_subcommand, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_subcommand, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += tokenlen + 1; /* slabclass */ @@ -1139,7 +1139,7 @@ stat_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) return -1; /* invalid token */ } - proto_tree_add_item (tree, hf_name, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_name, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; @@ -1148,7 +1148,7 @@ stat_dissector (tvbuff_t *tvb, proto_tree *tree, int offset) if (tokenlen == 0) { return -1; /* invalid token */ } - proto_tree_add_item (tree, hf_name_value, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_name_value, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; @@ -1319,7 +1319,7 @@ memcache_response_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree return -1; } - proto_tree_add_item (tree, hf_version, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_version, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; @@ -1358,7 +1358,7 @@ memcache_response_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree (tokenlen == 2 && strncmp (line, "OK", tokenlen) == 0) || (tokenlen == 3 && strncmp (line, "END", tokenlen) == 0)) { - proto_tree_add_item (tree, hf_response, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_response, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; return offset; @@ -1397,7 +1397,7 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (tokenlen == 0) { return -1; } - proto_tree_add_item (tree, hf_command, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_command, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; @@ -1484,7 +1484,7 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tokenlen = get_token_len (line, lineend, &next_token); if (tokenlen != 0) { if (tokenlen == 7 && strncmp (line, "noreply", 7) == 0) { - proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); } offset += (int) (next_token - line); line = next_token; @@ -1514,7 +1514,7 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (tokenlen == 0) { return -1; } - proto_tree_add_item (tree, hf_value, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_value, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; @@ -1524,7 +1524,7 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return offset; /* reached CRLF */ } if (tokenlen == 7 && strncmp (line, "noreply", 7) == 0) { - proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; } else { @@ -1560,7 +1560,7 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (tokenlen <= 10) { if (tokenlen == 7 && strncmp (line, "noreply", 7) == 0) { /* noreply */ - proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); } else { /* expiration */ memcpy (response_chars, line, tokenlen); @@ -1607,7 +1607,7 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (tokenlen == 0) { /* just the 'stats' command;*/ return offset; } else { /* there is a sub command; record it*/ - proto_tree_add_item (tree, hf_subcommand, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_subcommand, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; } @@ -1631,7 +1631,7 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (tokenlen <= 10) { if (tokenlen == 7 && strncmp (line, "noreply", 7) == 0) { /* noreply */ - proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); } else { /* expiration */ memcpy (response_chars, line, tokenlen); @@ -1653,7 +1653,7 @@ memcache_request_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } if (tokenlen == 7 && strncmp (line, "noreply", 7) == 0) { /* noreply */ - proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_BIG_ENDIAN); + proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII|ENC_NA); offset += (int) (next_token - line); line = next_token; } else { |