aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-memcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-memcache.c')
-rw-r--r--epan/dissectors/packet-memcache.c132
1 files changed, 66 insertions, 66 deletions
diff --git a/epan/dissectors/packet-memcache.c b/epan/dissectors/packet-memcache.c
index 9dc46d71a7..61418c62db 100644
--- a/epan/dissectors/packet-memcache.c
+++ b/epan/dissectors/packet-memcache.c
@@ -90,59 +90,59 @@ void proto_reg_handoff_memcache(void);
/* Data Types */
#define DT_RAW_BYTES 0x00
-static int proto_memcache = -1;
+static int proto_memcache;
static dissector_handle_t memcache_tcp_handle;
static dissector_handle_t memcache_udp_handle;
-static int hf_magic = -1;
-static int hf_opcode = -1;
-static int hf_extras_length = -1;
-static int hf_key_length = -1;
-static int hf_value_length = -1;
-static int hf_data_type = -1;
-static int hf_reserved = -1;
-static int hf_status = -1;
-static int hf_total_body_length = -1;
-static int hf_opaque = -1;
-static int hf_cas = -1;
-static int hf_extras = -1;
-static int hf_extras_flags = -1;
-static int hf_extras_expiration = -1;
-static int hf_extras_delta = -1;
-static int hf_extras_initial = -1;
-static int hf_extras_unknown = -1;
-static int hf_key = -1;
-static int hf_value = -1;
-static int hf_uint64_response = -1;
-
-static int hf_command = -1;
-static int hf_subcommand = -1;
-static int hf_flags = -1;
-static int hf_expiration = -1;
-static int hf_noreply = -1;
-
-static int hf_response = -1;
-
-static int hf_version = -1;
-static int hf_slabclass = -1;
-static int hf_name = -1;
-static int hf_name_value = -1;
-
-static gint ett_memcache = -1;
-static gint ett_extras = -1;
-
-static expert_field ei_value_missing = EI_INIT;
-static expert_field ei_extras_missing = EI_INIT;
-static expert_field ei_value_length = EI_INIT;
-static expert_field ei_key_missing = EI_INIT;
-static expert_field ei_key_unknown = EI_INIT;
-static expert_field ei_extras_unknown = EI_INIT;
-static expert_field ei_value_unknown = EI_INIT;
-static expert_field ei_status_response = EI_INIT;
-static expert_field ei_opcode_unknown = EI_INIT;
-static expert_field ei_reserved_value = EI_INIT;
-static expert_field ei_magic_unknown = EI_INIT;
+static int hf_magic;
+static int hf_opcode;
+static int hf_extras_length;
+static int hf_key_length;
+static int hf_value_length;
+static int hf_data_type;
+static int hf_reserved;
+static int hf_status;
+static int hf_total_body_length;
+static int hf_opaque;
+static int hf_cas;
+static int hf_extras;
+static int hf_extras_flags;
+static int hf_extras_expiration;
+static int hf_extras_delta;
+static int hf_extras_initial;
+static int hf_extras_unknown;
+static int hf_key;
+static int hf_value;
+static int hf_uint64_response;
+
+static int hf_command;
+static int hf_subcommand;
+static int hf_flags;
+static int hf_expiration;
+static int hf_noreply;
+
+static int hf_response;
+
+static int hf_version;
+static int hf_slabclass;
+static int hf_name;
+static int hf_name_value;
+
+static gint ett_memcache;
+static gint ett_extras;
+
+static expert_field ei_value_missing;
+static expert_field ei_extras_missing;
+static expert_field ei_value_length;
+static expert_field ei_key_missing;
+static expert_field ei_key_unknown;
+static expert_field ei_extras_unknown;
+static expert_field ei_value_unknown;
+static expert_field ei_status_response;
+static expert_field ei_opcode_unknown;
+static expert_field ei_reserved_value;
+static expert_field ei_magic_unknown;
static const value_string magic_vals[] = {
{ MAGIC_REQUEST, "Request" },
@@ -379,7 +379,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_ASCII|ENC_NA);
+ ti = proto_tree_add_item (tree, hf_key, tvb, offset, key_len, ENC_ASCII);
offset += key_len;
if ((opcode == OP_QUIT) || (opcode == OP_QUIT_Q) || (opcode == OP_NO_OP) || (opcode == OP_VERSION)) {
@@ -434,7 +434,7 @@ dissect_value (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
expert_add_info_format(pinfo, ti, &ei_value_length, "Illegal Value length, should be 8");
}
} else {
- ti = proto_tree_add_item (tree, hf_value, tvb, offset, value_len, ENC_ASCII|ENC_NA);
+ ti = proto_tree_add_item (tree, hf_value, tvb, offset, value_len, ENC_ASCII);
}
offset += value_len;
}
@@ -581,7 +581,7 @@ dissect_memcache (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
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_ASCII|ENC_NA);
+ proto_tree_add_item (memcache_tree, hf_value, tvb, offset, body_len, ENC_ASCII);
/*offset += body_len;*/
col_append_fstr (pinfo->cinfo, COL_INFO, " (%s)",
@@ -1052,7 +1052,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_command, tvb, offset, tokenlen, ENC_ASCII);
offset += (int) (next_token - line);
line = next_token;
occurrences = find_stat_colon (line, lineend, &first_colon, &last_colon);
@@ -1069,7 +1069,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_subcommand, tvb, offset, tokenlen, ENC_ASCII);
offset += tokenlen + 1;
/* slabclass */
@@ -1115,7 +1115,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_name, tvb, offset, tokenlen, ENC_ASCII);
offset += (int) (next_token - line);
line = next_token;
@@ -1124,7 +1124,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_name_value, tvb, offset, tokenlen, ENC_ASCII);
offset = next_offset;
}
@@ -1288,7 +1288,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_version, tvb, offset, tokenlen, ENC_ASCII);
offset += (int) (next_token - line);
line = next_token;
@@ -1327,7 +1327,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_response, tvb, offset, tokenlen, ENC_ASCII);
offset += (int) (next_token - line);
return offset;
}
@@ -1365,7 +1365,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_command, tvb, offset, tokenlen, ENC_ASCII);
offset += (int) (next_token - line);
line = next_token;
@@ -1452,7 +1452,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII);
}
offset += (int) (next_token - line);
}
@@ -1481,7 +1481,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_value, tvb, offset, tokenlen, ENC_ASCII);
offset += (int) (next_token - line);
line = next_token;
@@ -1491,7 +1491,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII);
offset += (int) (next_token - line);
line = next_token;
} else {
@@ -1527,7 +1527,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII);
} else {
/* expiration */
memcpy (response_chars, line, tokenlen);
@@ -1574,7 +1574,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_subcommand, tvb, offset, tokenlen, ENC_ASCII);
offset += (int) (next_token - line);
line = next_token;
}
@@ -1598,7 +1598,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII);
} else {
/* expiration */
memcpy (response_chars, line, tokenlen);
@@ -1620,7 +1620,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_ASCII|ENC_NA);
+ proto_tree_add_item (tree, hf_noreply, tvb, offset, tokenlen, ENC_ASCII);
offset += (int) (next_token - line);
} else {
return -1; /* expecting CRLF and if not noreply*/