summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2010-11-08 21:59:39 +0000
committerBill Meier <wmeier@newsguy.com>2010-11-08 21:59:39 +0000
commitc17c9fff8796965b84af7c55efc1c5b6ce7674a7 (patch)
tree8e40e636f10aa1079c5dca2731f3231151c3fb32
parent1c01cbfa6006479649f59945cb61202e4fc49939 (diff)
downloadwireshark-c17c9fff8796965b84af7c55efc1c5b6ce7674a7.tar.gz
Use value_string_ext fcns to access certain value_string arrays;
Sort a few value_string arrays to be in ascending order by value; Do minor reformatting and whitespace cleanup. svn path=/trunk/; revision=34813
-rw-r--r--epan/dissectors/packet-afp.c674
-rw-r--r--epan/dissectors/packet-afp.h10
-rw-r--r--epan/dissectors/packet-atalk.c151
-rw-r--r--epan/dissectors/packet-dnp.c65
-rw-r--r--epan/dissectors/packet-dsi.c657
-rw-r--r--epan/libwireshark.def2
-rw-r--r--gtk/afp_stat.c2
-rw-r--r--tap-afpstat.c2
8 files changed, 790 insertions, 773 deletions
diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c
index f99193c0fc..c8b9cd0e8b 100644
--- a/epan/dissectors/packet-afp.c
+++ b/epan/dissectors/packet-afp.c
@@ -138,40 +138,41 @@ http://developer.apple.com/mac/library/documentation/Networking/Conceptual/AFP/I
#define AFP_ADDCMT 56
#define AFP_RMVCMT 57
#define AFP_GETCMT 58
+
#define AFP_ZZZ 122
#define AFP_ADDICON 192
/* AFP 3.0 new calls */
#define AFP_BYTELOCK_EXT 59
-#define AFP_CATSEARCH_EXT 67
-#define AFP_ENUMERATE_EXT 66
#define AFP_READ_EXT 60
#define AFP_WRITE_EXT 61
#define AFP_LOGIN_EXT 63
#define AFP_GETSESSTOKEN 64
#define AFP_DISCTOLDSESS 65
+#define AFP_ENUMERATE_EXT 66
+#define AFP_CATSEARCH_EXT 67
/* AFP 3.1 new calls */
-#define AFP_ENUMERATE_EXT2 68
+#define AFP_ENUMERATE_EXT2 68
/* AFP 3.2 new calls */
-#define AFP_GETEXTATTR 69
-#define AFP_SETEXTATTR 70
-#define AFP_REMOVEATTR 71
-#define AFP_LISTEXTATTR 72
-#define AFP_GETACL 73
-#define AFP_SETACL 74
-#define AFP_ACCESS 75
+#define AFP_GETEXTATTR 69
+#define AFP_SETEXTATTR 70
+#define AFP_REMOVEATTR 71
+#define AFP_LISTEXTATTR 72
+#define AFP_GETACL 73
+#define AFP_SETACL 74
+#define AFP_ACCESS 75
/* AFP 3.2 calls added in 10.5 */
-#define AFP_SPOTLIGHTRPC 76
-#define AFP_SYNCDIR 78
-#define AFP_SYNCFORK 79
+#define AFP_SPOTLIGHTRPC 76
+#define AFP_SYNCDIR 78
+#define AFP_SYNCFORK 79
/* FPSpotlightRPC subcommand codes */
#define SPOTLIGHT_CMD_GET_VOLPATH 1
-#define SPOTLIGHT_CMD_GET_VOLID 2
-#define SPOTLIGHT_CMD_GET_THREE 3
+#define SPOTLIGHT_CMD_GET_VOLID 2
+#define SPOTLIGHT_CMD_GET_THREE 3
/* ----------------------------- */
static int proto_afp = -1;
@@ -366,7 +367,7 @@ static const value_string vol_signature_vals[] = {
{0, NULL }
};
-const value_string CommandCode_vals[] = {
+static const value_string CommandCode_vals[] = {
{AFP_BYTELOCK, "FPByteRangeLock" },
{AFP_CLOSEVOL, "FPCloseVol" },
{AFP_CLOSEDIR, "FPCloseDir" },
@@ -419,16 +420,14 @@ const value_string CommandCode_vals[] = {
{AFP_RMVCMT, "FPRemoveComment" },
{AFP_GETCMT, "FPGetComment" },
{AFP_BYTELOCK_EXT, "FPByteRangeLockExt" },
- {AFP_CATSEARCH_EXT, "FPCatSearchExt" },
- {AFP_ENUMERATE_EXT, "FPEnumerateExt" },
- {AFP_ENUMERATE_EXT2, "FPEnumerateExt2" },
{AFP_READ_EXT, "FPReadExt" },
{AFP_WRITE_EXT, "FPWriteExt" },
{AFP_LOGIN_EXT, "FPLoginExt" },
{AFP_GETSESSTOKEN, "FPGetSessionToken" },
{AFP_DISCTOLDSESS, "FPDisconnectOldSession" },
- {AFP_ZZZ, "FPZzzzz" },
- {AFP_ADDICON, "FPAddIcon" },
+ {AFP_ENUMERATE_EXT, "FPEnumerateExt" },
+ {AFP_CATSEARCH_EXT, "FPCatSearchExt" },
+ {AFP_ENUMERATE_EXT2, "FPEnumerateExt2" },
{AFP_GETEXTATTR, "FPGetExtAttr" },
{AFP_SETEXTATTR, "FPSetExtAttr" },
{AFP_REMOVEATTR, "FPRemoveExtAttr" },
@@ -437,10 +436,13 @@ const value_string CommandCode_vals[] = {
{AFP_SETACL, "FPSetACL" },
{AFP_ACCESS, "FPAccess" },
{AFP_SPOTLIGHTRPC, "FPSpotlightRPC" },
- {AFP_SYNCFORK, "FPSyncFork" },
{AFP_SYNCDIR, "FPSyncDir" },
+ {AFP_SYNCFORK, "FPSyncFork" },
+ {AFP_ZZZ, "FPZzzzz" },
+ {AFP_ADDICON, "FPAddIcon" },
{0, NULL }
};
+value_string_ext CommandCode_vals_ext = VALUE_STRING_EXT_INIT(CommandCode_vals);
static const value_string unicode_hint_vals[] = {
{ 0, "MacRoman" },
@@ -546,6 +548,7 @@ static const value_string unicode_hint_vals[] = {
{ 1570, "JIS_X0208_90" },
{ 0, NULL }
};
+static value_string_ext unicode_hint_vals_ext = VALUE_STRING_EXT_INIT(unicode_hint_vals);
/* volume bitmap
from Apple AFP3.0.pdf
@@ -707,6 +710,7 @@ static const value_string map_name_type_vals[] = {
{5, "Unicode user name to a user UUID" },
{6, "Unicode group name to a group UUID" },
{0, NULL } };
+static value_string_ext map_name_type_vals_ext = VALUE_STRING_EXT_INIT(map_name_type_vals);
static const value_string map_id_type_vals[] = {
{1, "User ID to a Macintosh roman user name" },
@@ -716,6 +720,7 @@ static const value_string map_id_type_vals[] = {
{5, "User UUID to a unicode user name" },
{6, "Group UUID to a unicode group name" },
{0, NULL } };
+static value_string_ext map_id_type_vals_ext = VALUE_STRING_EXT_INIT(map_id_type_vals);
/* map_id subfunctions 5,6: reply type */
static const value_string map_id_reply_type_vals[] = {
@@ -773,24 +778,24 @@ static const value_string map_id_reply_type_vals[] = {
table 1-7 p. 28
*/
-#define AR_O_SEARCH (1 << 0) /* owner has search access */
-#define AR_O_READ (1 << 1) /* owner has read access */
-#define AR_O_WRITE (1 << 2) /* owner has write access */
+#define AR_O_SEARCH (1 << 0) /* owner has search access */
+#define AR_O_READ (1 << 1) /* owner has read access */
+#define AR_O_WRITE (1 << 2) /* owner has write access */
-#define AR_G_SEARCH (1 << 8) /* group has search access */
-#define AR_G_READ (1 << 9) /* group has read access */
-#define AR_G_WRITE (1 << 10) /* group has write access */
+#define AR_G_SEARCH (1 << 8) /* group has search access */
+#define AR_G_READ (1 << 9) /* group has read access */
+#define AR_G_WRITE (1 << 10) /* group has write access */
-#define AR_E_SEARCH (1 << 16) /* everyone has search access */
-#define AR_E_READ (1 << 17) /* everyone has read access */
-#define AR_E_WRITE (1 << 18) /* everyone has write access */
+#define AR_E_SEARCH (1 << 16) /* everyone has search access */
+#define AR_E_READ (1 << 17) /* everyone has read access */
+#define AR_E_WRITE (1 << 18) /* everyone has write access */
-#define AR_U_SEARCH (1 << 24) /* user has search access */
-#define AR_U_READ (1 << 25) /* user has read access */
-#define AR_U_WRITE (1 << 26) /* user has write access */
+#define AR_U_SEARCH (1 << 24) /* user has search access */
+#define AR_U_READ (1 << 25) /* user has read access */
+#define AR_U_WRITE (1 << 26) /* user has write access */
-#define AR_BLANK (1 << 28) /* Blank Access Privileges (use parent dir privileges) */
-#define AR_U_OWN (1UL << 31) /* user is the owner */
+#define AR_BLANK (1 << 28) /* Blank Access Privileges (use parent dir privileges) */
+#define AR_U_OWN (1UL << 31) /* user is the owner */
static int hf_afp_dir_ar = -1;
static int hf_afp_dir_ar_o_search = -1;
@@ -821,9 +826,9 @@ static int hf_afp_user_bitmap_UUID = -1;
static gint ett_afp_user_bitmap = -1;
static const value_string user_flag_vals[] = {
- {0, "Use user ID" },
- {1, "Default user" },
- {0, NULL } };
+ {0, "Use user ID" },
+ {1, "Default user" },
+ {0, NULL } };
static int hf_afp_message = -1;
static int hf_afp_message_type = -1;
@@ -898,7 +903,7 @@ kFPUTF8NameBit (bit 13)
#define kGetKerberosSessionKey 8
static const value_string token_type_vals[] = {
- {kLoginWithoutID, "LoginWithoutID"},
+ {kLoginWithoutID, "LoginWithoutID"},
{kLoginWithID, "LoginWithID"},
{kReconnWithID, "ReconnWithID"},
{kLoginWithTimeAndID, "LoginWithTimeAndID"},
@@ -909,6 +914,7 @@ static const value_string token_type_vals[] = {
{kGetKerberosSessionKey, "GetKerberosSessionKey"},
{0, NULL } };
+static value_string_ext token_type_vals_ext = VALUE_STRING_EXT_INIT(token_type_vals);
/* AFP 3.2 ACL bitmap */
#define kFileSec_UUID (1 << 0)
@@ -1026,10 +1032,10 @@ static gint spotlight_endianess;
static guint64
spotlight_ntoh64(tvbuff_t *tvb, gint offset)
{
- if (spotlight_endianess == SPOTLIGHT_LITTLE_ENDIAN)
- return tvb_get_letoh64(tvb, offset);
- else
- return tvb_get_ntoh64(tvb, offset);
+ if (spotlight_endianess == SPOTLIGHT_LITTLE_ENDIAN)
+ return tvb_get_letoh64(tvb, offset);
+ else
+ return tvb_get_ntoh64(tvb, offset);
}
/* Hash Functions */
@@ -3956,199 +3962,199 @@ dissect_query_afp_with_did(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
static gint
dissect_spotlight(tvbuff_t *tvb, proto_tree *tree, gint offset)
{
- gint i;
- gint mdlen;
- gint query_offset;
- gint query_offset_next;
- gint querylen;
- gint toc_offset;
- gint num_queries;
- gint query_data_len;
- guint64 query_data64;
- guint64 toc_entry;
- guint8 *mds;
-
- proto_item *item_queries_data;
- proto_tree *sub_tree_queries;
- proto_item *item_toc;
- proto_tree *sub_tree_toc;
- proto_item *item_query;
- proto_tree *sub_tree_query;
- proto_item *item_data;
- proto_tree *sub_tree_data;
-
- if (strncmp(tvb_get_ephemeral_string(tvb, offset, 8), "md031234", 8) == 0)
- spotlight_endianess = SPOTLIGHT_BIG_ENDIAN;
- else
- spotlight_endianess = SPOTLIGHT_LITTLE_ENDIAN;
- proto_tree_add_text(tree,
- tvb,
- offset,
- 8,
- "Endianess: %s",
- spotlight_endianess == SPOTLIGHT_BIG_ENDIAN ?
- "Big Endian" : "Litte Endian");
- offset += 8;
-
- toc_offset = (spotlight_ntoh64(tvb, offset) >> 32) * 8 - 8;
- querylen = (spotlight_ntoh64(tvb, offset) & 0xffffffff) * 8 - 8;
- proto_tree_add_text(tree,
- tvb,
- offset,
- 8,
- "ToC Offset: %u Bytes, Query length: %u Bytes",
- toc_offset,
- querylen);
- offset += 8;
-
- num_queries = (gint)(spotlight_ntoh64(tvb, offset + toc_offset) & 0xffff) - 1;
-
- item_queries_data = proto_tree_add_text(tree,
- tvb,
- offset,
- toc_offset,
- "Query data (%u queries)",
- num_queries);
-
- sub_tree_queries = proto_item_add_subtree(item_queries_data, ett_afp_spotlight_queries);
- /* Queries */
- query_offset_next = (spotlight_ntoh64(tvb, offset + toc_offset + 8) & 0xff) * 8 - 16;
- for (i = 0; i < num_queries; i++) {
- query_offset = query_offset_next;
- if (i == num_queries - 1)
- /* last */
- query_offset_next = toc_offset;
- else
- /* peek at next offset */
- query_offset_next = (spotlight_ntoh64(tvb, offset + toc_offset + 8 + (i+1)*8) & 0xff) * 8 - 16;
-
- /* this is obviously the length of one query */
- query_data_len = query_offset_next - query_offset;
-
- if (query_data_len > 8)
- item_query = proto_tree_add_text(sub_tree_queries,
- tvb,
- offset + query_offset,
- query_data_len,
- "Query %u",
- i + 1);
- else
- item_query = proto_tree_add_text(sub_tree_queries,
- tvb,
- offset + query_offset,
- query_data_len,
- "Query %u (empty?)",
- i + 1);
-
- /* tree per query */
- sub_tree_query = proto_item_add_subtree(item_query, ett_afp_spotlight_query_line);
- query_data64 = spotlight_ntoh64(tvb, offset + query_offset);
-
- /* print the query line */
- proto_tree_add_text(sub_tree_query,
- tvb,
- offset + query_offset,
- 8,
- "Index: %" G_GINT64_MODIFIER "u, ?: 0x%08" G_GINT64_MODIFIER "x",
- query_data64 >> 32,
- query_data64 & 0xffffffff);
-
- /* really any data in the query */
- if (query_data_len > 8) {
- /* populate the query tree */
- query_data64 = spotlight_ntoh64(tvb, offset + query_offset + 8);
- mdlen = ((query_data64 & 0xffff) - 1) * 8;
- proto_tree_add_text(sub_tree_query,
- tvb,
- offset + query_offset + 8,
- 8,
- "?(reappears in ToC): 0x%08" G_GINT64_MODIFIER "x, ?: 0x%04" G_GINT64_MODIFIER "x, strlen: ((%u-1)*8 = ) %u",
- query_data64 >> 32,
- (query_data64 & 0xffff0000) >> 16,
- mdlen/8+1,
- mdlen);
-
- mds = tvb_get_ephemeral_string(tvb, offset + query_offset + 16, mdlen);
- proto_item_append_text(item_query, ": \"%s\"", mds);
-
- proto_tree_add_text(sub_tree_query,
- tvb,
- offset + query_offset + 16,
- mdlen,
- "mdstring: \"%s\" (%u bytes)",
- mds,
- mdlen);
-
- item_data = proto_tree_add_text(sub_tree_query,
- tvb,
- offset + query_offset + 16 + mdlen,
- query_data_len - 16 - mdlen,
- "data: %u bytes",
- query_data_len - 16 - mdlen);
-
- /* If there are more then 8 bytes theres at least x*8+8 bytes */
- if ((query_data_len - 16 - mdlen) >= 16) {
- sub_tree_data = proto_item_add_subtree(item_data, ett_afp_spotlight_data);
- query_data64 = spotlight_ntoh64(tvb, offset + query_offset + 16 + mdlen);
-
- proto_tree_add_text(sub_tree_data,
- tvb,
- offset + query_offset + 16 + mdlen,
- 8,
- "data: %" G_GINT64_MODIFIER "u * 8 (= %" G_GINT64_MODIFIER "u) bytes, ?: 0x%04" G_GINT64_MODIFIER "x",
- (query_data64 & G_GINT64_CONSTANT(0xffffffff00000000)) >> 32,
- ((query_data64 & G_GINT64_CONSTANT(0xffffffff00000000)) >> 32) * 8,
- query_data64 & 0xffffffff);
- proto_tree_add_text(sub_tree_data,
- tvb,
- offset + query_offset + 16 + mdlen + 8,
- query_data_len - 16 - mdlen - 8,
- "data: %u bytes",
- query_data_len - 16 - mdlen - 8);
- }
-
- }
- }
- offset += toc_offset;
-
- /* ToC */
- item_toc = proto_tree_add_text(tree,
- tvb,
- offset,
- querylen - toc_offset,
- "ToC (%u entries)",
- num_queries);
- sub_tree_toc = proto_item_add_subtree(item_toc, ett_afp_spotlight_toc);
- proto_tree_add_text(sub_tree_toc,
- tvb,
- offset,
- 8,
- "Number of entries (%u)",
- num_queries);
- for (i = 0; i < num_queries; i++) {
- toc_entry = spotlight_ntoh64(tvb, offset + 8 + i*8);
- proto_tree_add_text(sub_tree_toc,
- tvb,
- offset + 8 + i*8,
- 8,
- "Index: %u, ?(reappears in queries): 0x%08" G_GINT64_MODIFIER "x, ?: 0x%04" G_GINT64_MODIFIER "x, Offset: %" G_GINT64_MODIFIER "u",
- i+1,
- toc_entry >> 32,
- (toc_entry & 0xffff0000) >> 16,
- (toc_entry & 0xffff) * 8);
- }
-
- offset += querylen - toc_offset;
- return offset;
+ gint i;
+ gint mdlen;
+ gint query_offset;
+ gint query_offset_next;
+ gint querylen;
+ gint toc_offset;
+ gint num_queries;
+ gint query_data_len;
+ guint64 query_data64;
+ guint64 toc_entry;
+ guint8 *mds;
+
+ proto_item *item_queries_data;
+ proto_tree *sub_tree_queries;
+ proto_item *item_toc;
+ proto_tree *sub_tree_toc;
+ proto_item *item_query;
+ proto_tree *sub_tree_query;
+ proto_item *item_data;
+ proto_tree *sub_tree_data;
+
+ if (strncmp(tvb_get_ephemeral_string(tvb, offset, 8), "md031234", 8) == 0)
+ spotlight_endianess = SPOTLIGHT_BIG_ENDIAN;
+ else
+ spotlight_endianess = SPOTLIGHT_LITTLE_ENDIAN;
+ proto_tree_add_text(tree,
+ tvb,
+ offset,
+ 8,
+ "Endianess: %s",
+ spotlight_endianess == SPOTLIGHT_BIG_ENDIAN ?
+ "Big Endian" : "Litte Endian");
+ offset += 8;
+
+ toc_offset = (spotlight_ntoh64(tvb, offset) >> 32) * 8 - 8;
+ querylen = (spotlight_ntoh64(tvb, offset) & 0xffffffff) * 8 - 8;
+ proto_tree_add_text(tree,
+ tvb,
+ offset,
+ 8,
+ "ToC Offset: %u Bytes, Query length: %u Bytes",
+ toc_offset,
+ querylen);
+ offset += 8;
+
+ num_queries = (gint)(spotlight_ntoh64(tvb, offset + toc_offset) & 0xffff) - 1;
+
+ item_queries_data = proto_tree_add_text(tree,
+ tvb,
+ offset,
+ toc_offset,
+ "Query data (%u queries)",
+ num_queries);
+
+ sub_tree_queries = proto_item_add_subtree(item_queries_data, ett_afp_spotlight_queries);
+ /* Queries */
+ query_offset_next = (spotlight_ntoh64(tvb, offset + toc_offset + 8) & 0xff) * 8 - 16;
+ for (i = 0; i < num_queries; i++) {
+ query_offset = query_offset_next;
+ if (i == num_queries - 1)
+ /* last */
+ query_offset_next = toc_offset;
+ else
+ /* peek at next offset */
+ query_offset_next = (spotlight_ntoh64(tvb, offset + toc_offset + 8 + (i+1)*8) & 0xff) * 8 - 16;
+
+ /* this is obviously the length of one query */
+ query_data_len = query_offset_next - query_offset;
+
+ if (query_data_len > 8)
+ item_query = proto_tree_add_text(sub_tree_queries,
+ tvb,
+ offset + query_offset,
+ query_data_len,
+ "Query %u",
+ i + 1);
+ else
+ item_query = proto_tree_add_text(sub_tree_queries,
+ tvb,
+ offset + query_offset,
+ query_data_len,
+ "Query %u (empty?)",
+ i + 1);
+
+ /* tree per query */
+ sub_tree_query = proto_item_add_subtree(item_query, ett_afp_spotlight_query_line);
+ query_data64 = spotlight_ntoh64(tvb, offset + query_offset);
+
+ /* print the query line */
+ proto_tree_add_text(sub_tree_query,
+ tvb,
+ offset + query_offset,
+ 8,
+ "Index: %" G_GINT64_MODIFIER "u, ?: 0x%08" G_GINT64_MODIFIER "x",
+ query_data64 >> 32,
+ query_data64 & 0xffffffff);
+
+ /* really any data in the query */
+ if (query_data_len > 8) {
+ /* populate the query tree */
+ query_data64 = spotlight_ntoh64(tvb, offset + query_offset + 8);
+ mdlen = ((query_data64 & 0xffff) - 1) * 8;
+ proto_tree_add_text(sub_tree_query,
+ tvb,
+ offset + query_offset + 8,
+ 8,
+ "?(reappears in ToC): 0x%08" G_GINT64_MODIFIER "x, ?: 0x%04" G_GINT64_MODIFIER "x, strlen: ((%u-1)*8 = ) %u",
+ query_data64 >> 32,
+ (query_data64 & 0xffff0000) >> 16,
+ mdlen/8+1,
+ mdlen);
+
+ mds = tvb_get_ephemeral_string(tvb, offset + query_offset + 16, mdlen);
+ proto_item_append_text(item_query, ": \"%s\"", mds);
+
+ proto_tree_add_text(sub_tree_query,
+ tvb,
+ offset + query_offset + 16,
+ mdlen,
+ "mdstring: \"%s\" (%u bytes)",
+ mds,
+ mdlen);
+
+ item_data = proto_tree_add_text(sub_tree_query,
+ tvb,
+ offset + query_offset + 16 + mdlen,
+ query_data_len - 16 - mdlen,
+ "data: %u bytes",
+ query_data_len - 16 - mdlen);
+
+ /* If there are more then 8 bytes theres at least x*8+8 bytes */
+ if ((query_data_len - 16 - mdlen) >= 16) {
+ sub_tree_data = proto_item_add_subtree(item_data, ett_afp_spotlight_data);
+ query_data64 = spotlight_ntoh64(tvb, offset + query_offset + 16 + mdlen);
+
+ proto_tree_add_text(sub_tree_data,
+ tvb,
+ offset + query_offset + 16 + mdlen,
+ 8,
+ "data: %" G_GINT64_MODIFIER "u * 8 (= %" G_GINT64_MODIFIER "u) bytes, ?: 0x%04" G_GINT64_MODIFIER "x",
+ (query_data64 & G_GINT64_CONSTANT(0xffffffff00000000)) >> 32,
+ ((query_data64 & G_GINT64_CONSTANT(0xffffffff00000000)) >> 32) * 8,
+ query_data64 & 0xffffffff);
+ proto_tree_add_text(sub_tree_data,
+ tvb,
+ offset + query_offset + 16 + mdlen + 8,
+ query_data_len - 16 - mdlen - 8,
+ "data: %u bytes",
+ query_data_len - 16 - mdlen - 8);
+ }
+
+ }
+ }
+ offset += toc_offset;
+
+ /* ToC */
+ item_toc = proto_tree_add_text(tree,
+ tvb,
+ offset,
+ querylen - toc_offset,
+ "ToC (%u entries)",
+ num_queries);
+ sub_tree_toc = proto_item_add_subtree(item_toc, ett_afp_spotlight_toc);
+ proto_tree_add_text(sub_tree_toc,
+ tvb,
+ offset,
+ 8,
+ "Number of entries (%u)",
+ num_queries);
+ for (i = 0; i < num_queries; i++) {
+ toc_entry = spotlight_ntoh64(tvb, offset + 8 + i*8);
+ proto_tree_add_text(sub_tree_toc,
+ tvb,
+ offset + 8 + i*8,
+ 8,
+ "Index: %u, ?(reappears in queries): 0x%08" G_GINT64_MODIFIER "x, ?: 0x%04" G_GINT64_MODIFIER "x, Offset: %" G_GINT64_MODIFIER "u",
+ i+1,
+ toc_entry >> 32,
+ (toc_entry & 0xffff0000) >> 16,
+ (toc_entry & 0xffff) * 8);
+ }
+
+ offset += querylen - toc_offset;
+ return offset;
}
static gint
dissect_query_afp_spotlight(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, afp_request_val *request_val)
{
- gint len;
+ gint len;
- PAD(1);
- offset = decode_vol(tree, tvb, offset);
+ PAD(1);
+ offset = decode_vol(tree, tvb, offset);
proto_tree_add_item(tree, hf_afp_spotlight_request_flags, tvb, offset, 4, FALSE);
offset += 4;
@@ -4159,30 +4165,30 @@ dissect_query_afp_spotlight(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
proto_tree_add_item(tree, hf_afp_spotlight_request_reserved, tvb, offset, 4, FALSE);
offset += 4;
- switch (request_val->spotlight_req_command) {
+ switch (request_val->spotlight_req_command) {
- case SPOTLIGHT_CMD_GET_VOLPATH:
- tvb_get_ephemeral_stringz(tvb, offset, &len);
- proto_tree_add_item(tree, hf_afp_spotlight_volpath_client, tvb, offset, len, FALSE);
- offset += len;
- break;
+ case SPOTLIGHT_CMD_GET_VOLPATH:
+ tvb_get_ephemeral_stringz(tvb, offset, &len);
+ proto_tree_add_item(tree, hf_afp_spotlight_volpath_client, tvb, offset, len, FALSE);
+ offset += len;
+ break;
- case SPOTLIGHT_CMD_GET_VOLID:
- /* empty */
- break;
+ case SPOTLIGHT_CMD_GET_VOLID:
+ /* empty */
+ break;
- case SPOTLIGHT_CMD_GET_THREE:
- proto_tree_add_item(tree, hf_afp_spotlight_volflags, tvb, offset, 4,FALSE);
- offset += 4;
+ case SPOTLIGHT_CMD_GET_THREE:
+ proto_tree_add_item(tree, hf_afp_spotlight_volflags, tvb, offset, 4,FALSE);
+ offset += 4;
- proto_tree_add_item(tree, hf_afp_spotlight_reqlen, tvb, offset, 4,FALSE);
- offset += 4;
+ proto_tree_add_item(tree, hf_afp_spotlight_reqlen, tvb, offset, 4,FALSE);
+ offset += 4;
- offset = dissect_spotlight(tvb, tree, offset);
+ offset = dissect_spotlight(tvb, tree, offset);
- break;
- }
- return offset;
+ break;
+ }
+ return offset;
}
/* ************************** */
@@ -4361,32 +4367,32 @@ dissect_reply_afp_get_acl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
static gint
dissect_reply_afp_spotlight(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset, afp_request_val *request_val)
{
- gint len;
+ gint len;
- switch (request_val->spotlight_req_command) {
+ switch (request_val->spotlight_req_command) {
- case SPOTLIGHT_CMD_GET_VOLPATH:
- proto_tree_add_item(tree, hf_afp_spotlight_returncode, tvb, offset, 4,FALSE);
- offset += 4;
+ case SPOTLIGHT_CMD_GET_VOLPATH:
+ proto_tree_add_item(tree, hf_afp_spotlight_returncode, tvb, offset, 4,FALSE);
+ offset += 4;
- tvb_get_ephemeral_stringz(tvb, offset, &len);;
+ tvb_get_ephemeral_stringz(tvb, offset, &len);;
proto_tree_add_item(tree, hf_afp_spotlight_volpath_server, tvb, offset, len, FALSE);
- offset += len;
- break;
+ offset += len;
+ break;
- case SPOTLIGHT_CMD_GET_VOLID:
- proto_tree_add_item(tree, hf_afp_spotlight_volflags, tvb, offset, 4,FALSE);
- offset += 4;
- break;
+ case SPOTLIGHT_CMD_GET_VOLID:
+ proto_tree_add_item(tree, hf_afp_spotlight_volflags, tvb, offset, 4,FALSE);
+ offset += 4;
+ break;
- case SPOTLIGHT_CMD_GET_THREE:
- proto_tree_add_item(tree, hf_afp_spotlight_returncode, tvb, offset, 4,FALSE);
- offset += 4;
+ case SPOTLIGHT_CMD_GET_THREE:
+ proto_tree_add_item(tree, hf_afp_spotlight_returncode, tvb, offset, 4,FALSE);
+ offset += 4;
- offset = dissect_spotlight(tvb, tree, offset);
- break;
- }
- return offset;
+ offset = dissect_spotlight(tvb, tree, offset);
+ break;
+ }
+ return offset;
}
@@ -4425,10 +4431,10 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
request_val = se_alloc(sizeof(afp_request_val));
request_val->command = afp_command;
- if (afp_command == AFP_SPOTLIGHTRPC)
- request_val->spotlight_req_command = tvb_get_ntohl(tvb, offset + 2 + 2 + 4);
- else
- request_val->spotlight_req_command = -1;
+ if (afp_command == AFP_SPOTLIGHTRPC)
+ request_val->spotlight_req_command = tvb_get_ntohl(tvb, offset + 2 + 2 + 4);
+ else
+ request_val->spotlight_req_command = -1;
request_val->frame_req = pinfo->fd->num;
request_val->frame_res = 0;
@@ -4445,12 +4451,12 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
afp_command = request_val->command;
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
- val_to_str(afp_command, CommandCode_vals,
+ val_to_str_ext(afp_command, &CommandCode_vals_ext,
"Unknown command (%u)"),
aspinfo->reply ? "reply" : "request");
if (aspinfo->reply && aspinfo->code != 0) {
col_append_fstr(pinfo->cinfo, COL_INFO, ": %s (%d)",
- val_to_str(aspinfo->code, asp_error_vals,
+ val_to_str_ext(aspinfo->code, &asp_error_vals_ext,
"Unknown error (%u)"), aspinfo->code);
}
@@ -4624,7 +4630,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_query_afp_with_did(tvb, pinfo, afp_tree, offset);break;
case AFP_SPOTLIGHTRPC:
offset = dissect_query_afp_spotlight(tvb, pinfo, afp_tree, offset, request_val);
- break;
+ break;
}
}
else {
@@ -4750,7 +4756,7 @@ proto_register_afp(void)
static hf_register_info hf[] = {
{ &hf_afp_command,
{ "Command", "afp.command",
- FT_UINT8, BASE_DEC, VALS(CommandCode_vals), 0x0,
+ FT_UINT8, BASE_DEC|BASE_EXT_STRING, &CommandCode_vals_ext, 0x0,
"AFP function", HFILL }},
{ &hf_afp_pad,
@@ -5580,7 +5586,7 @@ proto_register_afp(void)
{ &hf_afp_path_unicode_hint,
{ "Unicode hint", "afp.path_unicode_hint",
- FT_UINT32, BASE_HEX, VALS(unicode_hint_vals), 0x0,
+ FT_UINT32, BASE_HEX|BASE_EXT_STRING, &unicode_hint_vals_ext, 0x0,
NULL, HFILL }},
{ &hf_afp_path_name,
@@ -5790,12 +5796,12 @@ proto_register_afp(void)
{ &hf_afp_map_name_type,
{ "Type", "afp.map_name_type",
- FT_UINT8, BASE_DEC, VALS(map_name_type_vals), 0x0,
+ FT_UINT8, BASE_DEC|BASE_EXT_STRING, &map_name_type_vals_ext, 0x0,
"Map name type", HFILL }},
{ &hf_afp_map_id_type,
{ "Type", "afp.map_id_type",
- FT_UINT8, BASE_DEC, VALS(map_id_type_vals), 0x0,
+ FT_UINT8, BASE_DEC|BASE_EXT_STRING, &map_id_type_vals_ext, 0x0,
"Map ID type", HFILL }},
{ &hf_afp_map_id,
@@ -5851,7 +5857,7 @@ proto_register_afp(void)
{ &hf_afp_session_token_type,
{ "Type", "afp.session_token_type",
- FT_UINT16, BASE_HEX, VALS(token_type_vals), 0x0,
+ FT_UINT16, BASE_HEX|BASE_EXT_STRING, &token_type_vals_ext, 0x0,
"Session token type", HFILL }},
/* FIXME FT_UINT32 in specs */
@@ -6196,55 +6202,55 @@ proto_register_afp(void)
FT_BOOLEAN, 32, NULL, ACE_ONLY_INHERIT,
NULL, HFILL }},
- { &hf_afp_spotlight_request_flags,
- { "Flags", "afp.spotlight.flags",
- FT_UINT32, BASE_HEX, NULL, 0x0,
- "Spotlight RPC Flags", HFILL }},
-
- { &hf_afp_spotlight_request_command,
- { "Command", "afp.spotlight.command",
- FT_UINT32, BASE_HEX, NULL, 0x0,
- "Spotlight RPC Command", HFILL }},
-
- { &hf_afp_spotlight_request_reserved,
- { "Padding", "afp.spotlight.reserved",
- FT_UINT32, BASE_HEX, NULL, 0x0,
- "Spotlight RPC Padding", HFILL }},
-
- { &hf_afp_spotlight_volpath_client,
- { "Client's volume path", "afp.spotlight.volpath_client",
- FT_STRING, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_afp_spotlight_volpath_server,
- { "Server's volume path", "afp.spotlight.volpath_server",
- FT_STRING, BASE_NONE, NULL, 0x0,
- "Servers's volume path", HFILL }},
-
- { &hf_afp_spotlight_returncode,
- { "Return code", "afp.spotlight.return",
- FT_INT32, BASE_DEC, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_afp_spotlight_volflags,
- { "Volume flags", "afp.spotlight.volflags",
- FT_UINT32, BASE_HEX, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_afp_spotlight_reqlen,
- { "Length", "afp.spotlight.reqlen",
- FT_UINT32, BASE_DEC, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_afp_spotlight_toc_query_end,
- { "End marker", "afp.spotlight.query_end",
- FT_UINT32, BASE_HEX, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_afp_spotlight_mdstring,
- { "mdquery string", "afp.spotlight.mds",
- FT_STRINGZ, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
+ { &hf_afp_spotlight_request_flags,
+ { "Flags", "afp.spotlight.flags",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ "Spotlight RPC Flags", HFILL }},
+
+ { &hf_afp_spotlight_request_command,
+ { "Command", "afp.spotlight.command",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ "Spotlight RPC Command", HFILL }},
+
+ { &hf_afp_spotlight_request_reserved,
+ { "Padding", "afp.spotlight.reserved",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ "Spotlight RPC Padding", HFILL }},
+
+ { &hf_afp_spotlight_volpath_client,
+ { "Client's volume path", "afp.spotlight.volpath_client",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_afp_spotlight_volpath_server,
+ { "Server's volume path", "afp.spotlight.volpath_server",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ "Servers's volume path", HFILL }},
+
+ { &hf_afp_spotlight_returncode,
+ { "Return code", "afp.spotlight.return",
+ FT_INT32, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_afp_spotlight_volflags,
+ { "Volume flags", "afp.spotlight.volflags",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_afp_spotlight_reqlen,
+ { "Length", "afp.spotlight.reqlen",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_afp_spotlight_toc_query_end,
+ { "End marker", "afp.spotlight.query_end",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_afp_spotlight_mdstring,
+ { "mdquery string", "afp.spotlight.mds",
+ FT_STRINGZ, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
{ &hf_afp_unknown,
{ "Unknown parameter", "afp.unknown",
@@ -6283,11 +6289,11 @@ proto_register_afp(void)
&ett_afp_ace_entries,
&ett_afp_ace_entry,
&ett_afp_ace_flags,
- &ett_afp_spotlight_queries,
- &ett_afp_spotlight_query_line,
- &ett_afp_spotlight_query,
- &ett_afp_spotlight_data,
- &ett_afp_spotlight_toc
+ &ett_afp_spotlight_queries,
+ &ett_afp_spotlight_query_line,
+ &ett_afp_spotlight_query,
+ &ett_afp_spotlight_data,
+ &ett_afp_spotlight_toc
};
proto_afp = proto_register_protocol("Apple Filing Protocol", "AFP", "afp");
diff --git a/epan/dissectors/packet-afp.h b/epan/dissectors/packet-afp.h
index 818f014b50..d59b4a1ef4 100644
--- a/epan/dissectors/packet-afp.h
+++ b/epan/dissectors/packet-afp.h
@@ -77,8 +77,8 @@
#define AFPERR_USRLOGIN (-5047) /* user already logged on */
/* also disk quota exceeded? */
-extern const value_string asp_error_vals[];
-extern const value_string afp_server_addr_type_vals[];
+extern value_string_ext asp_error_vals_ext;
+extern value_string_ext afp_server_addr_type_vals_ext;
/* server flags */
#define AFPSRVRINFO_COPY (1<<0) /* supports copyfile */
@@ -91,8 +91,8 @@ extern const value_string afp_server_addr_type_vals[];
#define AFPSRVRINFO_SRVRECONNECT (1<<7) /* supports reconnect */
#define AFPSRVRINFO_SRVDIRECTORY (1<<8) /* supports directory services */
#define AFPSRVRINFO_SRVUTF8 (1<<9) /* supports UTF8 names AFP 3.1 */
-#define AFPSRVRINFO_UUID (1<<10) /* supports UUIDs AFP 3.2 */
-#define AFPSRVRINFO_EXT_SLEEP (1<<11) /* supports extended sleep, AFP 3.3 */
+#define AFPSRVRINFO_UUID (1<<10) /* supports UUIDs AFP 3.2 */
+#define AFPSRVRINFO_EXT_SLEEP (1<<11) /* supports extended sleep, AFP 3.3 */
#define AFPSRVRINFO_FASTBOZO (1<<15) /* fast copying */
@@ -125,7 +125,7 @@ struct aspinfo {
/*
* value_string table for AFP command codes.
*/
-WS_VAR_IMPORT const value_string CommandCode_vals[];
+WS_VAR_IMPORT value_string_ext CommandCode_vals_ext;
/*
* Value from table matching requests and responses; also passed to AFP
diff --git a/epan/dissectors/packet-atalk.c b/epan/dissectors/packet-atalk.c
index aeff7cff52..146c41a7dc 100644
--- a/epan/dissectors/packet-atalk.c
+++ b/epan/dissectors/packet-atalk.c
@@ -172,6 +172,7 @@ static const value_string zip_function_vals[] = {
{8, "Extended reply"},
{0, NULL}
};
+static value_string_ext zip_function_vals_ext = VALUE_STRING_EXT_INIT(zip_function_vals);
static const value_string zip_atp_function_vals[] = {
{7, "GetMyZone"},
@@ -392,6 +393,7 @@ static const value_string pap_function_vals[] = {
{0, NULL}
};
+static value_string_ext pap_function_vals_ext = VALUE_STRING_EXT_INIT(pap_function_vals);
/* -------------------------------- */
@@ -423,15 +425,16 @@ typedef struct _e_ddp {
static const value_string op_vals[] = {
{DDP_RTMPDATA, "AppleTalk Routing Table response or data" },
- {DDP_NBP, "AppleTalk Name Binding Protocol packet"},
- {DDP_ATP, "AppleTalk Transaction Protocol packet"},
- {DDP_AEP, "AppleTalk Echo Protocol packet"},
- {DDP_RTMPREQ, "AppleTalk Routing Table request"},
- {DDP_ZIP, "AppleTalk Zone Information Protocol packet"},
- {DDP_ADSP, "AppleTalk Data Stream Protocol"},
- {DDP_EIGRP, "Cisco EIGRP for AppleTalk"},
+ {DDP_NBP, "AppleTalk Name Binding Protocol packet"},
+ {DDP_ATP, "AppleTalk Transaction Protocol packet"},
+ {DDP_AEP, "AppleTalk Echo Protocol packet"},
+ {DDP_RTMPREQ, "AppleTalk Routing Table request"},
+ {DDP_ZIP, "AppleTalk Zone Information Protocol packet"},
+ {DDP_ADSP, "AppleTalk Data Stream Protocol"},
+ {DDP_EIGRP, "Cisco EIGRP for AppleTalk"},
{0, NULL}
};
+static value_string_ext op_vals_ext = VALUE_STRING_EXT_INIT(op_vals);
static const value_string rtmp_function_vals[] = {
{1, "Request"},
@@ -481,60 +484,63 @@ static const value_string asp_func_vals[] = {
{ASPFUNC_WRTCONT, "Write Cont" },
{ASPFUNC_ATTN, "Attention" },
{0, NULL } };
+static value_string_ext asp_func_vals_ext = VALUE_STRING_EXT_INIT(asp_func_vals);
-const value_string asp_error_vals[] = {
+/* XXX: Array sorted in ascending order (unsigned) to allow value_string_ext binary search */
+static const value_string asp_error_vals[] = {
{AFP_OK , "success"},
- {ASPERR_NOSESS , "no more sessions available"},
- {ASPERR_SESSCLOS , "session closed (ASP)" },
- {AFPERR_ACCESS , "permission denied" },
- {AFPERR_AUTHCONT , "logincont" },
- {AFPERR_BADUAM , "uam doesn't exist" },
- {AFPERR_BADVERS , "bad afp version number" },
- {AFPERR_BITMAP , "invalid bitmap" },
- {AFPERR_CANTMOVE , "can't move file" },
- {AFPERR_DENYCONF , "file synchronization locks conflict" },
- {AFPERR_DIRNEMPT , "directory not empty" },
- {AFPERR_DFULL , "disk full" },
- {AFPERR_EOF , "end of file" },
- {AFPERR_BUSY , "FileBusy" },
- {AFPERR_FLATVOL , "volume doesn't support directories" },
- {AFPERR_NOITEM , "ItemNotFound" },
- {AFPERR_LOCK , "LockErr" },
- {AFPERR_MISC , "misc. err" },
- {AFPERR_NLOCK , "no more locks" },
- {AFPERR_NOSRVR , "no response by server at that address" },
- {AFPERR_EXIST , "object already exists" },
- {AFPERR_NOOBJ , "object not found" },
- {AFPERR_PARAM , "parameter error" },
- {AFPERR_NORANGE , "no range lock" },
- {AFPERR_RANGEOVR , "range overlap" },
- {AFPERR_SESSCLOS , "session closed" },
- {AFPERR_NOTAUTH , "user not authenticated" },
- {AFPERR_NOOP , "command not supported" },
- {AFPERR_BADTYPE , "object is the wrong type" },
- {AFPERR_NFILE , "too many files open" },
- {AFPERR_SHUTDOWN , "server is going down" },
- {AFPERR_NORENAME , "can't rename" },
- {AFPERR_NODIR , "couldn't find directory" },
- {AFPERR_ITYPE , "wrong icon type" },
- {AFPERR_VLOCK , "volume locked" },
- {AFPERR_OLOCK , "object locked" },
- {AFPERR_CTNSHRD , "share point contains a share point" },
- {AFPERR_NOID , "file thread not found" },
- {AFPERR_EXISTID , "file already has an id" },
- {AFPERR_DIFFVOL , "different volume" },
- {AFPERR_CATCHNG , "catalog has changed" },
- {AFPERR_SAMEOBJ , "source file == destination file" },
- {AFPERR_BADID , "non-existent file id" },
- {AFPERR_PWDSAME , "same password/can't change password" },
- {AFPERR_PWDSHORT , "password too short" },
- {AFPERR_PWDEXPR , "password expired" },
- {AFPERR_INSHRD , "folder being shared is inside a shared folder." },
- {AFPERR_INTRASH , "shared folder in trash." },
- {AFPERR_PWDCHNG , "password needs to be changed" },
- {AFPERR_PWDPOLCY , "password fails policy check" },
{AFPERR_USRLOGIN , "user already logged on" },
+ {AFPERR_PWDPOLCY , "password fails policy check" },
+ {AFPERR_PWDCHNG , "password needs to be changed" },
+ {AFPERR_INTRASH , "shared folder in trash." },
+ {AFPERR_INSHRD , "folder being shared is inside a shared folder." },
+ {AFPERR_PWDEXPR , "password expired" },
+ {AFPERR_PWDSHORT , "password too short" },
+ {AFPERR_PWDSAME , "same password/can't change password" },
+ {AFPERR_BADID , "non-existent file id" },
+ {AFPERR_SAMEOBJ , "source file == destination file" },
+ {AFPERR_CATCHNG , "catalog has changed" },
+ {AFPERR_DIFFVOL , "different volume" },
+ {AFPERR_EXISTID , "file already has an id" },
+ {AFPERR_NOID , "file thread not found" },
+ {AFPERR_CTNSHRD , "share point contains a share point" },
+ {AFPERR_OLOCK , "object locked" },
+ {AFPERR_VLOCK , "volume locked" },
+ {AFPERR_ITYPE , "wrong icon type" },
+ {AFPERR_NODIR , "couldn't find directory" },
+ {AFPERR_NORENAME , "can't rename" },
+ {AFPERR_SHUTDOWN , "server is going down" },
+ {AFPERR_NFILE , "too many files open" },
+ {AFPERR_BADTYPE , "object is the wrong type" },
+ {AFPERR_NOOP , "command not supported" },
+ {AFPERR_NOTAUTH , "user not authenticated" },
+ {AFPERR_SESSCLOS , "session closed" },
+ {AFPERR_RANGEOVR , "range overlap" },
+ {AFPERR_NORANGE , "no range lock" },
+ {AFPERR_PARAM , "parameter error" },
+ {AFPERR_NOOBJ , "object not found" },
+ {AFPERR_EXIST , "object already exists" },
+ {AFPERR_NOSRVR , "no response by server at that address" },
+ {AFPERR_NLOCK , "no more locks" },
+ {AFPERR_MISC , "misc. err" },
+ {AFPERR_LOCK , "LockErr" },
+ {AFPERR_NOITEM , "ItemNotFound" },
+ {AFPERR_FLATVOL , "volume doesn't support directories" },
+ {AFPERR_BUSY , "FileBusy" },
+ {AFPERR_EOF , "end of file" },
+ {AFPERR_DFULL , "disk full" },
+ {AFPERR_DIRNEMPT , "directory not empty" },
+ {AFPERR_DENYCONF , "file synchronization locks conflict" },
+ {AFPERR_CANTMOVE , "can't move file" },
+ {AFPERR_BITMAP , "invalid bitmap" },
+ {AFPERR_BADVERS , "bad afp version number" },
+ {AFPERR_BADUAM , "uam doesn't exist" },
+ {AFPERR_AUTHCONT , "logincont" },
+ {AFPERR_ACCESS , "permission denied" },
+ {ASPERR_SESSCLOS , "session closed (ASP)" },
+ {ASPERR_NOSESS , "no more sessions available"},
{0, NULL } };
+value_string_ext asp_error_vals_ext = VALUE_STRING_EXT_INIT(asp_error_vals);
/*
* XXX - do this with an FT_UINT_STRING?
@@ -1205,7 +1211,7 @@ dissect_pap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ID: %d",
- val_to_str(fn, pap_function_vals, "Unknown (0x%01x)"), connID);
+ val_to_str_ext(fn, &pap_function_vals_ext, "Unknown (0x%01x)"), connID);
}
switch(fn) {
case PAPOpenConn:
@@ -1333,7 +1339,7 @@ dissect_asp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr(pinfo->cinfo, COL_INFO, "Reply tid %u",aspinfo->seq);
else
col_add_fstr(pinfo->cinfo, COL_INFO, "Function: %s tid %u",
- val_to_str(fn, asp_func_vals, "Unknown (0x%01x)"), aspinfo->seq);
+ val_to_str_ext(fn, &asp_func_vals_ext, "Unknown (0x%01x)"), aspinfo->seq);
}
if (tree) {
@@ -1550,7 +1556,7 @@ dissect_ddp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
fn = tvb_get_guint8(tvb, 0);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(fn, zip_function_vals, "Unknown ZIP function (%02x)"));
+ val_to_str_ext(fn, &zip_function_vals_ext, "Unknown ZIP function (%02x)"));
}
if (!tree)
@@ -1704,7 +1710,7 @@ dissect_ddp_short(tvbuff_t *tvb, packet_info *pinfo, guint8 dnode,
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(type, op_vals, "Unknown DDP protocol (%02x)"));
+ val_to_str_ext(type, &op_vals_ext, "Unknown DDP protocol (%02x)"));
}
if (tree) {
hidden_item = proto_tree_add_string(ddp_tree, hf_ddp_src, tvb,
@@ -1755,7 +1761,7 @@ dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (check_col(pinfo->cinfo, COL_INFO))
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(ddp.type, op_vals, "Unknown DDP protocol (%02x)"));
+ val_to_str_ext(ddp.type, &op_vals_ext, "Unknown DDP protocol (%02x)"));
if (tree) {
ti = proto_tree_add_item(tree, proto_ddp, tvb, 0, DDP_HEADER_SIZE,
@@ -1807,6 +1813,7 @@ static const value_string llap_type_vals[] = {
{0x85, "CTS"},
{0, NULL}
};
+static value_string_ext llap_type_vals_ext = VALUE_STRING_EXT_INIT(llap_type_vals);
void
capture_llap(packet_counts *ld)
@@ -1841,7 +1848,7 @@ dissect_llap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
type = tvb_get_guint8(tvb, 2);
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(type, llap_type_vals, "Unknown LLAP type (%02x)"));
+ val_to_str_ext(type, &llap_type_vals_ext, "Unknown LLAP type (%02x)"));
}
if (tree)
proto_tree_add_uint(llap_tree, hf_llap_type, tvb, 2, 1, type);
@@ -1902,7 +1909,7 @@ proto_register_atalk(void)
NULL, HFILL }},
{ &hf_llap_type,
- { "Type", "llap.type", FT_UINT8, BASE_HEX, VALS(llap_type_vals), 0x0,
+ { "Type", "llap.type", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &llap_type_vals_ext, 0x0,
NULL, HFILL }},
};
@@ -1952,7 +1959,7 @@ proto_register_atalk(void)
NULL, HFILL }},
{ &hf_ddp_type,
- { "Protocol type", "ddp.type", FT_UINT8, BASE_DEC, VALS(op_vals), 0x0,
+ { "Protocol type", "ddp.type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &op_vals_ext, 0x0,
NULL, HFILL }},
};
@@ -2097,12 +2104,12 @@ proto_register_atalk(void)
static hf_register_info hf_asp[] = {
{ &hf_asp_func,
- { "asp function", "asp.function", FT_UINT8, BASE_DEC,
- VALS(asp_func_vals), 0, NULL, HFILL }},
+ { "asp function", "asp.function", FT_UINT8, BASE_DEC|BASE_EXT_STRING,
+ &asp_func_vals_ext, 0, NULL, HFILL }},
{ &hf_asp_error,
- { "asp error", "asp.error", FT_INT32, BASE_DEC,
- VALS(asp_error_vals), 0, "return error code", HFILL }},
+ { "asp error", "asp.error", FT_INT32, BASE_DEC|BASE_EXT_STRING,
+ &asp_error_vals_ext, 0, "return error code", HFILL }},
{ &hf_asp_version,
{ "Version", "asp.version", FT_UINT16, BASE_HEX,
@@ -2229,7 +2236,7 @@ proto_register_atalk(void)
{ &hf_asp_server_addr_type,
{ "Type", "asp.server_addr.type",
- FT_UINT8, BASE_DEC, VALS(afp_server_addr_type_vals), 0x0,
+ FT_UINT8, BASE_DEC|BASE_EXT_STRING, &afp_server_addr_type_vals_ext, 0x0,
"Address type.", HFILL }},
{ &hf_asp_server_addr_value,
@@ -2250,7 +2257,7 @@ proto_register_atalk(void)
static hf_register_info hf_zip[] = {
{ &hf_zip_function,
- { "Function", "zip.function", FT_UINT8, BASE_DEC, VALS(zip_function_vals), 0x0,
+ { "Function", "zip.function", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &zip_function_vals_ext, 0x0,
"ZIP function", HFILL }},
{ &hf_zip_zero_value,
@@ -2326,7 +2333,7 @@ proto_register_atalk(void)
"PAP connection ID", HFILL }},
{ &hf_pap_function,
- { "Function", "pap.function", FT_UINT8, BASE_DEC, VALS(pap_function_vals), 0x0,
+ { "Function", "pap.function", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &pap_function_vals_ext, 0x0,
"PAP function", HFILL }},
{ &hf_pap_socket,
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c
index a644818319..03c37840ab 100644
--- a/epan/dissectors/packet-dnp.c
+++ b/epan/dissectors/packet-dnp.c
@@ -32,11 +32,9 @@
# include "config.h"
#endif
-#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <glib.h>
-#include <time.h>
#include <epan/packet.h>
#include <epan/prefs.h>
@@ -95,9 +93,9 @@
#define DNP3_CTL_DFC 0x10
#define DNP3_CTL_FUNC 0x0f
-#define DNP3_TR_FIR 0x40
-#define DNP3_TR_FIN 0x80
-#define DNP3_TR_SEQ 0x3f
+#define DNP3_TR_FIR 0x40
+#define DNP3_TR_FIN 0x80
+#define DNP3_TR_SEQ 0x3f
#define AL_MAX_CHUNK_SIZE 16
@@ -198,18 +196,18 @@
/* Application Layer Data Object Qualifier */
/***************************************************************************/
/* Bit-Masks */
-#define AL_OBJQ_INDEX 0x70 /* x111xxxx Masks Index from Qualifier */
-#define AL_OBJQ_CODE 0x0F /* xxxx1111 Masks Code from Qualifier */
+#define AL_OBJQ_INDEX 0x70 /* x111xxxx Masks Index from Qualifier */
+#define AL_OBJQ_CODE 0x0F /* xxxx1111 Masks Code from Qualifier */
/* Index Size (3-bits x111xxxx) */
/* When Qualifier Code != 11 */
-#define AL_OBJQL_IDX_NI 0x00 /* Objects are Packed with no index */
-#define AL_OBJQL_IDX_1O 0x01 /* Objects are prefixed w/ 1-octet index */
-#define AL_OBJQL_IDX_2O 0x02 /* Objects are prefixed w/ 2-octet index */
-#define AL_OBJQL_IDX_4O 0x03 /* Objects are prefixed w/ 4-octet index */
-#define AL_OBJQL_IDX_1OS 0x04 /* Objects are prefixed w/ 1-octet object size */
-#define AL_OBJQL_IDX_2OS 0x05 /* Objects are prefixed w/ 2-octet object size */
-#define AL_OBJQL_IDX_4OS 0x06 /* Objects are prefixed w/ 4-octet object size */
+#define AL_OBJQL_IDX_NI 0x00 /* Objects are Packed with no index */
+#define AL_OBJQL_IDX_1O 0x01 /* Objects are prefixed w/ 1-octet index */
+#define AL_OBJQL_IDX_2O 0x02 /* Objects are prefixed w/ 2-octet index */
+#define AL_OBJQL_IDX_4O 0x03 /* Objects are prefixed w/ 4-octet index */
+#define AL_OBJQL_IDX_1OS 0x04 /* Objects are prefixed w/ 1-octet object size */
+#define AL_OBJQL_IDX_2OS 0x05 /* Objects are prefixed w/ 2-octet object size */
+#define AL_OBJQL_IDX_4OS 0x06 /* Objects are prefixed w/ 4-octet object size */
/* When Qualifier Code == 11 */
#define AL_OBJQL_IDX11_1OIS 0x01 /* 1 octet identifier size */
@@ -677,6 +675,7 @@ static const value_string dnp3_al_func_vals[] = {
{ AL_FUNC_AUTHRESP, "Authentication Response" },
{ 0, NULL }
};
+static value_string_ext dnp3_al_func_vals_ext = VALUE_STRING_EXT_INIT(dnp3_al_func_vals);
/* Application Layer Internal Indication (IIN) bit Values */
static const value_string dnp3_al_iin_vals[] _U_ = {
@@ -707,6 +706,7 @@ static const value_string dnp3_al_objq_index_vals[] = {
{ AL_OBJQL_IDX_4OS, "4-Octet Object Size" },
{ 0, NULL }
};
+static value_string_ext dnp3_al_objq_index_vals_ext = VALUE_STRING_EXT_INIT(dnp3_al_objq_index_vals);
/* Application Layer Object Qualifier Code Values */
static const value_string dnp3_al_objq_code_vals[] = {
@@ -723,6 +723,7 @@ static const value_string dnp3_al_objq_code_vals[] = {
{ AL_OBJQL_CODE_FF, "Free-format Qualifier" },
{ 0, NULL }
};
+static value_string_ext dnp3_al_objq_code_vals_ext = VALUE_STRING_EXT_INIT(dnp3_al_objq_code_vals);
/* Application Layer Data Object Values */
static const value_string dnp3_al_obj_vals[] = {
@@ -828,6 +829,7 @@ static const value_string dnp3_al_obj_vals[] = {
{ AL_OBJ_OCT, "Octet String (Obj:110)" },
{ 0, NULL }
};
+static value_string_ext dnp3_al_obj_vals_ext = VALUE_STRING_EXT_INIT(dnp3_al_obj_vals);
/* Application Layer Control Code 'Code' Values */
static const value_string dnp3_al_ctlc_code_vals[] = {
@@ -869,6 +871,7 @@ static const value_string dnp3_al_ctl_status_vals[] = {
{ AL_OBJCTL_STAT10, "Req. Not Accepted; Local automation proc active" },
{ 0, NULL }
};
+static value_string_ext dnp3_al_ctl_status_vals_ext = VALUE_STRING_EXT_INIT(dnp3_al_ctl_status_vals);
/* Application Layer Binary Input Quality Flag Values */
static const value_string dnp3_al_biflag_vals[] _U_ = {
@@ -1326,7 +1329,9 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
/* Create Data Objects Detail Tree */
object_item = proto_tree_add_uint_format(robj_tree, hf_dnp3_al_obj, tvb, offset, 2, al_obj,
- "Object(s): %s (0x%04x)", val_to_str(al_obj, dnp3_al_obj_vals, "Unknown Object - Abort Decoding..."), al_obj);
+ "Object(s): %s (0x%04x)",
+ val_to_str_ext_const(al_obj, &dnp3_al_obj_vals_ext, "Unknown Object - Abort Decoding..."),
+ al_obj);
object_tree = proto_item_add_subtree(object_item, ett_dnp3_al_obj);
offset += 2;
@@ -1338,8 +1343,8 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
al_objq_code = al_objq & AL_OBJQ_CODE;
qualifier_item = proto_tree_add_text(object_tree, tvb, offset, 1, "Qualifier Field, Prefix: %s, Code: %s",
- val_to_str(al_objq_index, dnp3_al_objq_index_vals, "Unknown Index Type"),
- val_to_str(al_objq_code, dnp3_al_objq_code_vals, "Unknown Code Type"));
+ val_to_str_ext_const(al_objq_index, &dnp3_al_objq_index_vals_ext, "Unknown Index Type"),
+ val_to_str_ext_const(al_objq_code, &dnp3_al_objq_code_vals_ext, "Unknown Code Type"));
qualifier_tree = proto_item_add_subtree(qualifier_item, ett_dnp3_al_obj_qualifier);
proto_tree_add_item(qualifier_tree, hf_dnp3_al_objq_index, tvb, offset, 1, FALSE);
proto_tree_add_item(qualifier_tree, hf_dnp3_al_objq_code, tvb, offset, 1, FALSE);
@@ -1628,11 +1633,11 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
/* Bit-Mask xx11xxxx for Control Code Misc Values */
al_ctlobj_code_m = al_ctlobj_code & AL_OBJCTLC_MISC;
- ctl_misc_str = val_to_str(al_ctlobj_code_m, dnp3_al_ctlc_misc_vals, "");
+ ctl_misc_str = val_to_str_const(al_ctlobj_code_m, dnp3_al_ctlc_misc_vals, "");
/* Bit-Mask 11xxxxxx for Control Code 'Trip/Close' */
al_ctlobj_code_tc = al_ctlobj_code & AL_OBJCTLC_TC;
- ctl_tc_str = val_to_str(al_ctlobj_code_tc, dnp3_al_ctlc_tc_vals, "");
+ ctl_tc_str = val_to_str_const(al_ctlobj_code_tc, dnp3_al_ctlc_tc_vals, "");
/* Get "Count" Field */
al_ctlobj_count = tvb_get_guint8(tvb, data_pos);
@@ -1648,7 +1653,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
al_ctlobj_stat = tvb_get_guint8(tvb, data_pos);
proto_tree_add_item(point_item, hf_dnp3_al_ctrlstatus, tvb, data_pos, 1, TRUE);
- ctl_status_str = val_to_str(al_ctlobj_stat, dnp3_al_ctl_status_vals, "Invalid Status (0x%02x)");
+ ctl_status_str = val_to_str_ext(al_ctlobj_stat, &dnp3_al_ctl_status_vals_ext, "Invalid Status (0x%02x)");
data_pos += 1;
proto_item_append_text(point_item, ", Control Code: [%s,%s,%s (0x%02x)]",
@@ -1698,7 +1703,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
/* Get control status */
al_ctlobj_stat = tvb_get_guint8(tvb, data_pos);
- ctl_status_str = val_to_str(al_ctlobj_stat, dnp3_al_ctl_status_vals, "Invalid Status (0x%02x)");
+ ctl_status_str = val_to_str_ext(al_ctlobj_stat, &dnp3_al_ctl_status_vals_ext, "Invalid Status (0x%02x)");
proto_item_append_text(point_item, " [Status: %s (0x%02x)]", ctl_status_str, al_ctlobj_stat);
proto_tree_add_item(point_tree, hf_dnp3_al_ctrlstatus, tvb, data_pos, 1, TRUE);
data_pos += 1;
@@ -2103,7 +2108,7 @@ dissect_dnp3_al(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
al_con = al_ctl & DNP3_AL_CON;
al_uns = al_ctl & DNP3_AL_UNS;
al_func = tvb_get_guint8(tvb, (offset+1));
- func_code_str = val_to_str(al_func, dnp3_al_func_vals, "Unknown function (0x%02x)");
+ func_code_str = val_to_str_ext(al_func, &dnp3_al_func_vals_ext, "Unknown function (0x%02x)");
if (check_col(pinfo->cinfo, COL_INFO))
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%s", func_code_str);
@@ -2733,8 +2738,8 @@ proto_register_dnp3(void)
{ "Sequence", "dnp3.al.seq", FT_UINT8, BASE_DEC, NULL, DNP3_AL_SEQ, "Frame Sequence Number", HFILL }},
{ &hf_dnp3_al_func,
- { "Application Layer Function Code", "dnp3.al.func", FT_UINT8, BASE_DEC,
- VALS(dnp3_al_func_vals), DNP3_AL_FUNC, "Application Function Code", HFILL }},
+ { "Application Layer Function Code", "dnp3.al.func", FT_UINT8, BASE_DEC|BASE_EXT_STRING,
+ &dnp3_al_func_vals_ext, DNP3_AL_FUNC, "Application Function Code", HFILL }},
{ &hf_dnp3_al_iin,
{ "Application Layer IIN bits", "dnp3.al.iin", FT_UINT16, BASE_DEC, NULL, 0x0, "Application Layer IIN", HFILL }},
@@ -2779,13 +2784,13 @@ proto_register_dnp3(void)
{ "Configuration Corrupt", "dnp3.al.iin.cc", FT_BOOLEAN, 16, TFS(&tfs_set_notset), AL_IIN_CC, NULL, HFILL }},
{ &hf_dnp3_al_obj,
- { "Object", "dnp3.al.obj", FT_UINT16, BASE_HEX, VALS(dnp3_al_obj_vals), 0x0, "Application Layer Object", HFILL }},
+ { "Object", "dnp3.al.obj", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &dnp3_al_obj_vals_ext, 0x0, "Application Layer Object", HFILL }},
{ &hf_dnp3_al_objq_index,
- { "Index Prefix", "dnp3.al.objq.index", FT_UINT8, BASE_DEC, VALS(dnp3_al_objq_index_vals), AL_OBJQ_INDEX, "Object Index Prefixing", HFILL }},
+ { "Index Prefix", "dnp3.al.objq.index", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &dnp3_al_objq_index_vals_ext, AL_OBJQ_INDEX, "Object Index Prefixing", HFILL }},
{ &hf_dnp3_al_objq_code,
- { "Qualifier Code", "dnp3.al.objq.code", FT_UINT8, BASE_DEC, VALS(dnp3_al_objq_code_vals), AL_OBJQ_CODE, "Object Qualifier Code", HFILL }},
+ { "Qualifier Code", "dnp3.al.objq.code", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &dnp3_al_objq_code_vals_ext, AL_OBJQ_CODE, "Object Qualifier Code", HFILL }},
{ &hf_dnp3_al_range_start8,
{ "Start (8 bit)", "dnp3.al.range.start", FT_UINT8, BASE_DEC, NULL, 0x0, "Object Start Index", HFILL }},
@@ -2872,7 +2877,7 @@ proto_register_dnp3(void)
{ "Counter (32 bit)", "dnp3.al.cnt", FT_UINT32, BASE_DEC, NULL, 0x0, "Counter Value (32 bit)", HFILL }},
{ &hf_dnp3_al_ctrlstatus,
- { "Control Status", "dnp3.al.ctrlstatus", FT_UINT8, BASE_DEC, dnp3_al_ctl_status_vals, 0xff, NULL, HFILL }},
+ { "Control Status", "dnp3.al.ctrlstatus", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &dnp3_al_ctl_status_vals_ext, 0xff, NULL, HFILL }},
{ &hf_dnp3_al_biq_b0,
{ "Online", "dnp3.al.biq.b0", FT_BOOLEAN, 8, TFS(&tfs_set_notset), AL_OBJ_BI_FLAG0, NULL, HFILL }},
@@ -3075,10 +3080,6 @@ proto_register_dnp3(void)
}
-/* If this dissector uses sub-dissector registration add a registration routine.
- This format is required because a script is used to find these routines and
- create the code that calls these routines.
-*/
void
proto_reg_handoff_dnp3(void)
{
diff --git a/epan/dissectors/packet-dsi.c b/epan/dissectors/packet-dsi.c
index d2fe4a03c6..c7335b682f 100644
--- a/epan/dissectors/packet-dsi.c
+++ b/epan/dissectors/packet-dsi.c
@@ -48,8 +48,8 @@ http://developer.apple.com/DOCUMENTATION/macos8/pdf/ASAppleTalkFiling2.1_2.2.pdf
http://developer.apple.com/documentation/Networking/Conceptual/AFPClient/AFPClient-6.html
(no longer available, apparently)
-
- Also, AFP 3.3 documents parts of DSI at:
+
+ Also, AFP 3.3 documents parts of DSI at:
http://developer.apple.com/mac/library/documentation/Networking/Conceptual/AFP/Introduction/Introduction.html
* What a Data Stream Interface packet looks like:
@@ -64,7 +64,7 @@ http://developer.apple.com/DOCUMENTATION/macos8/pdf/ASAppleTalkFiling2.1_2.2.pdf
* |reserved field |
* |-------------------------------|
*/
-#define INET6_ADDRLEN 16
+#define INET6_ADDRLEN 16
static int proto_dsi = -1;
static int hf_dsi_flags = -1;
@@ -77,41 +77,42 @@ static int hf_dsi_reserved = -1;
static gint ett_dsi = -1;
-static int hf_dsi_open_type = -1;
-static int hf_dsi_open_len = -1;
-static int hf_dsi_open_quantum = -1;
+static int hf_dsi_open_type = -1;
+static int hf_dsi_open_len = -1;
+static int hf_dsi_open_quantum = -1;
static int hf_dsi_replay_cache_size = -1;
-static int hf_dsi_open_option = -1;
+static int hf_dsi_open_option = -1;
-static int hf_dsi_attn_flag = -1;
-static int hf_dsi_attn_flag_shutdown = -1;
-static int hf_dsi_attn_flag_crash = -1;
-static int hf_dsi_attn_flag_msg = -1;
-static int hf_dsi_attn_flag_reconnect = -1;
-static int hf_dsi_attn_flag_time = -1;
-static int hf_dsi_attn_flag_bitmap = -1;
+static int hf_dsi_attn_flag = -1;
+static int hf_dsi_attn_flag_shutdown = -1;
+static int hf_dsi_attn_flag_crash = -1;
+static int hf_dsi_attn_flag_msg = -1;
+static int hf_dsi_attn_flag_reconnect = -1;
+static int hf_dsi_attn_flag_time = -1;
+static int hf_dsi_attn_flag_bitmap = -1;
-static gint ett_dsi_open = -1;
-static gint ett_dsi_attn = -1;
-static gint ett_dsi_attn_flag = -1;
+static gint ett_dsi_open = -1;
+static gint ett_dsi_attn = -1;
+static gint ett_dsi_attn_flag = -1;
static const value_string dsi_attn_flag_vals[] = {
- {0x0, "Reserved" }, /* 0000 */
- {0x1, "Reserved" }, /* 0001 */
- {0x2, "Server message" }, /* 0010 */
- {0x3, "Server notification, cf. extended bitmap" }, /* 0011 */
- {0x4, "Server is shutting down, internal error" }, /* 0100 */
- {0x8, "Server is shutting down" }, /* 1000 */
- {0x9, "Server disconnects user" }, /* 1001 */
- {0x10,"Server is shutting down, message" }, /* 1010 */
- {0x11,"Server is shutting down, message,no reconnect"}, /* 1011 */
- {0, NULL } };
+ {0x0, "Reserved" }, /* 0000 */
+ {0x1, "Reserved" }, /* 0001 */
+ {0x2, "Server message" }, /* 0010 */
+ {0x3, "Server notification, cf. extended bitmap" }, /* 0011 */
+ {0x4, "Server is shutting down, internal error" }, /* 0100 */
+ {0x8, "Server is shutting down" }, /* 1000 */
+ {0x9, "Server disconnects user" }, /* 1001 */
+ {0x10,"Server is shutting down, message" }, /* 1010 */
+ {0x11,"Server is shutting down, message,no reconnect"}, /* 1011 */
+ {0, NULL } };
+static value_string_ext dsi_attn_flag_vals_ext = VALUE_STRING_EXT_INIT(dsi_attn_flag_vals);
static const value_string dsi_open_type_vals[] = {
- {0, "Server quantum" },
- {1, "Attention quantum" },
- {2, "Replay cache size" },
- {0, NULL } };
+ {0, "Server quantum" },
+ {1, "Attention quantum" },
+ {2, "Replay cache size" },
+ {0, NULL } };
/* status stuff same for asp and afp */
static int hf_dsi_server_name = -1;
@@ -127,21 +128,21 @@ static int hf_dsi_server_flag = -1;
static int hf_dsi_server_flag_copyfile = -1;
static int hf_dsi_server_flag_passwd = -1;
static int hf_dsi_server_flag_no_save_passwd = -1;
-static int hf_dsi_server_flag_srv_msg = -1;
-static int hf_dsi_server_flag_srv_sig = -1;
-static int hf_dsi_server_flag_tcpip = -1;
-static int hf_dsi_server_flag_notify = -1;
-static int hf_dsi_server_flag_reconnect = -1;
-static int hf_dsi_server_flag_directory = -1;
+static int hf_dsi_server_flag_srv_msg = -1;
+static int hf_dsi_server_flag_srv_sig = -1;
+static int hf_dsi_server_flag_tcpip = -1;
+static int hf_dsi_server_flag_notify = -1;
+static int hf_dsi_server_flag_reconnect = -1;
+static int hf_dsi_server_flag_directory = -1;
static int hf_dsi_server_flag_utf8_name = -1;
static int hf_dsi_server_flag_uuid = -1;
static int hf_dsi_server_flag_ext_sleep = -1;
static int hf_dsi_server_flag_fast_copy = -1;
-static int hf_dsi_server_signature = -1;
+static int hf_dsi_server_signature = -1;
-static int hf_dsi_server_addr_len = -1;
-static int hf_dsi_server_addr_type = -1;
-static int hf_dsi_server_addr_value = -1;
+static int hf_dsi_server_addr_len = -1;
+static int hf_dsi_server_addr_type = -1;
+static int hf_dsi_server_addr_value = -1;
static gint ett_dsi_status = -1;
static gint ett_dsi_uams = -1;
@@ -152,15 +153,16 @@ static gint ett_dsi_directory = -1;
static gint ett_dsi_utf8_name = -1;
static gint ett_dsi_status_server_flag = -1;
-const value_string afp_server_addr_type_vals[] = {
- {1, "IP address" },
- {2, "IP+port address" },
- {3, "DDP address" },
- {4, "DNS name" },
- {5, "IP+port ssh tunnel" },
- {6, "IP6 address" },
- {7, "IP6+port address" },
- {0, NULL } };
+static const value_string afp_server_addr_type_vals[] = {
+ {1, "IP address" },
+ {2, "IP+port address" },
+ {3, "DDP address" },
+ {4, "DNS name" },
+ {5, "IP+port ssh tunnel" },
+ {6, "IP6 address" },
+ {7, "IP6+port address" },
+ {0, NULL } };
+value_string_ext afp_server_addr_type_vals_ext = VALUE_STRING_EXT_INIT(afp_server_addr_type_vals);
/* end status stuff */
@@ -170,9 +172,9 @@ static gboolean dsi_desegment = TRUE;
static dissector_handle_t data_handle;
static dissector_handle_t afp_handle;
-#define TCP_PORT_DSI 548
+#define TCP_PORT_DSI 548
-#define DSI_BLOCKSIZ 16
+#define DSI_BLOCKSIZ 16
/* DSI flags */
#define DSIFL_REQUEST 0x00
@@ -190,33 +192,34 @@ static dissector_handle_t afp_handle;
#define DSIFUNC_MAX 8 /* largest command */
static const value_string flag_vals[] = {
- {DSIFL_REQUEST, "Request" },
- {DSIFL_REPLY, "Reply" },
- {0, NULL } };
+ {DSIFL_REQUEST, "Request" },
+ {DSIFL_REPLY, "Reply" },
+ {0, NULL } };
static const value_string func_vals[] = {
- {DSIFUNC_CLOSE, "CloseSession" },
- {DSIFUNC_CMD, "Command" },
- {DSIFUNC_STAT, "GetStatus" },
- {DSIFUNC_OPEN, "OpenSession" },
- {DSIFUNC_TICKLE, "Tickle" },
- {DSIFUNC_WRITE, "Write" },
- {DSIFUNC_ATTN, "Attention" },
- {0, NULL } };
+ {DSIFUNC_CLOSE, "CloseSession" },
+ {DSIFUNC_CMD, "Command" },
+ {DSIFUNC_STAT, "GetStatus" },
+ {DSIFUNC_OPEN, "OpenSession" },
+ {DSIFUNC_TICKLE, "Tickle" },
+ {DSIFUNC_WRITE, "Write" },
+ {DSIFUNC_ATTN, "Attention" },
+ {0, NULL } };
+static value_string_ext func_vals_ext = VALUE_STRING_EXT_INIT(func_vals);
static gint
dissect_dsi_open_session(tvbuff_t *tvb, proto_tree *dsi_tree, gint offset, gint dsi_length)
{
- proto_tree *tree;
+ proto_tree *tree;
proto_item *ti;
guint8 type;
guint8 len;
ti = proto_tree_add_text(dsi_tree, tvb, offset, -1, "Open Session");
tree = proto_item_add_subtree(ti, ett_dsi_open);
-
+
while( dsi_length >2 ) {
-
+
type = tvb_get_guint8(tvb, offset);
proto_tree_add_item(tree, hf_dsi_open_type, tvb, offset, 1, FALSE);
offset++;
@@ -226,19 +229,19 @@ dissect_dsi_open_session(tvbuff_t *tvb, proto_tree *dsi_tree, gint offset, gint
switch (type) {
case 0:
proto_tree_add_item(tree, hf_dsi_open_quantum, tvb, offset, 4, FALSE);
- break;
+ break;
case 1:
proto_tree_add_item(tree, hf_dsi_open_quantum, tvb, offset, 4, FALSE);
- break;
+ break;
case 2:
proto_tree_add_item(tree, hf_dsi_replay_cache_size, tvb, offset, 4, FALSE);
break;
default:
proto_tree_add_item(tree, hf_dsi_open_option, tvb, offset, len, FALSE);
}
-
+
dsi_length -= len + 2;
-
+
offset += len;
}
return offset;
@@ -247,7 +250,7 @@ dissect_dsi_open_session(tvbuff_t *tvb, proto_tree *dsi_tree, gint offset, gint
static gint
dissect_dsi_attention(tvbuff_t *tvb, proto_tree *dsi_tree, gint offset)
{
- proto_tree *tree;
+ proto_tree *tree;
proto_item *ti;
guint16 flag;
@@ -279,7 +282,7 @@ dissect_dsi_attention(tvbuff_t *tvb, proto_tree *dsi_tree, gint offset)
static gint
dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset)
{
- proto_tree *sub_tree;
+ proto_tree *sub_tree;
proto_item *ti;
guint16 ofs;
@@ -399,12 +402,12 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset)
}
if (adr_ofs) {
- proto_tree *adr_tree;
+ proto_tree *adr_tree;
unsigned char *tmp;
- const guint8 *ip;
+ const guint8 *ip;
guint16 net;
guint8 node;
- guint16 port;
+ guint16 port;
ofs = adr_ofs;
nbe = tvb_get_guint8(tvb, ofs);
@@ -437,7 +440,7 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset)
case 5: /* SSH tunnel */
if (len > 2) {
tmp = tvb_get_ephemeral_string(tvb, ofs +2, len -2);
- ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "%s: %s",
+ ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "%s: %s",
(type==4)?"dns":"ssh tunnel", tmp);
break;
}
@@ -447,7 +450,7 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset)
break;
case 6: /* IP6 */
ip = tvb_get_ptr(tvb, ofs+2, INET6_ADDRLEN);
- ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip6: %s",
+ ti = proto_tree_add_text(adr_tree, tvb, ofs, len, "ip6: %s",
ip6_to_str((const struct e_in6_addr *)ip));
break;
case 7: /* IP6 + 2bytes port */
@@ -504,7 +507,7 @@ dissect_dsi_reply_get_status(tvbuff_t *tvb, proto_tree *tree, gint offset)
static void
dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- proto_tree *dsi_tree;
+ proto_tree *dsi_tree;
proto_item *ti;
guint8 dsi_flags,dsi_command;
guint16 dsi_requestid;
@@ -513,7 +516,7 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint32 dsi_reserved;
struct aspinfo aspinfo;
gint col_info;
-
+
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DSI");
col_info = check_col(pinfo->cinfo, COL_INFO);
@@ -531,7 +534,7 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s (%u)",
val_to_str(dsi_flags, flag_vals,
"Unknown flag (0x%02x)"),
- val_to_str(dsi_command, func_vals,
+ val_to_str_ext(dsi_command, &func_vals_ext,
"Unknown function (0x%02x)"),
dsi_requestid);
}
@@ -586,7 +589,7 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case DSIFUNC_CMD:
case DSIFUNC_WRITE:
{
- tvbuff_t *new_tvb;
+ tvbuff_t *new_tvb;
void* pd_save;
int len = tvb_reported_length_remaining(tvb,DSI_BLOCKSIZ);
@@ -603,11 +606,11 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->private_data = pd_save;
}
break;
- default:
+ default:
if (tree) {
- call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, DSI_BLOCKSIZ),
- pinfo, dsi_tree);
+ call_dissector(data_handle,
+ tvb_new_subset_remaining(tvb, DSI_BLOCKSIZ),
+ pinfo, dsi_tree);
}
break;
}
@@ -621,7 +624,7 @@ get_dsi_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
dsi_flags = tvb_get_guint8(tvb, offset);
dsi_command = tvb_get_guint8(tvb, offset+ 1);
- if ( dsi_flags > DSIFL_MAX || !dsi_command || dsi_command > DSIFUNC_MAX)
+ if ( dsi_flags > DSIFL_MAX || !dsi_command || dsi_command > DSIFUNC_MAX)
{
/* it's not a known dsi pdu start sequence */
return tvb_length_remaining(tvb, offset);
@@ -650,252 +653,252 @@ void
proto_register_dsi(void)
{
- static hf_register_info hf[] = {
- { &hf_dsi_flags,
- { "Flags", "dsi.flags",
- FT_UINT8, BASE_HEX, VALS(flag_vals), 0x0,
- "Indicates request or reply.", HFILL }},
-
- { &hf_dsi_command,
- { "Command", "dsi.command",
- FT_UINT8, BASE_DEC, VALS(func_vals), 0x0,
- "Represents a DSI command.", HFILL }},
-
- { &hf_dsi_requestid,
- { "Request ID", "dsi.requestid",
- FT_UINT16, BASE_DEC, NULL, 0x0,
- "Keeps track of which request this is. Replies must match a Request. IDs must be generated in sequential order.", HFILL }},
-
- { &hf_dsi_offset,
- { "Data offset", "dsi.data_offset",
- FT_INT32, BASE_DEC, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_dsi_error,
- { "Error code", "dsi.error_code",
- FT_INT32, BASE_DEC, VALS(asp_error_vals), 0x0,
- NULL, HFILL }},
-
- { &hf_dsi_length,
- { "Length", "dsi.length",
- FT_UINT32, BASE_DEC, NULL, 0x0,
- "Total length of the data that follows the DSI header.", HFILL }},
-
- { &hf_dsi_reserved,
- { "Reserved", "dsi.reserved",
- FT_UINT32, BASE_HEX, NULL, 0x0,
- "Reserved for future use. Should be set to zero.", HFILL }},
- /* asp , afp */
- { &hf_dsi_utf8_server_name_len,
- { "Length", "dsi.utf8_server_name_len",
- FT_UINT16, BASE_DEC, NULL, 0x0,
- "UTF8 server name length.", HFILL }},
- { &hf_dsi_utf8_server_name,
- { "UTF8 Server name", "dsi.utf8_server_name",
- FT_STRING, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_dsi_server_name,
- { "Server name", "dsi.server_name",
- FT_UINT_STRING, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_dsi_server_type,
- { "Server type", "dsi.server_type",
- FT_UINT_STRING, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_dsi_server_vers,
- { "AFP version", "dsi.server_vers",
- FT_UINT_STRING, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_dsi_server_uams,
- { "UAM", "dsi.server_uams",
- FT_UINT_STRING, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_dsi_server_icon,
- { "Icon bitmap", "dsi.server_icon",
- FT_BYTES, BASE_NONE, NULL, 0x0,
- "Server icon bitmap", HFILL }},
-
- { &hf_dsi_server_directory,
- { "Directory service", "dsi.server_directory",
- FT_UINT_STRING, BASE_NONE, NULL, 0x0,
- "Server directory service", HFILL }},
-
- { &hf_dsi_server_signature,
- { "Server signature", "dsi.server_signature",
- FT_BYTES, BASE_NONE, NULL, 0x0,
- NULL, HFILL }},
-
- { &hf_dsi_server_flag,
- { "Flag", "dsi.server_flag",
- FT_UINT16, BASE_HEX, NULL, 0x0,
- "Server capabilities flag", HFILL }},
- { &hf_dsi_server_flag_copyfile,
- { "Support copyfile", "dsi.server_flag.copyfile",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_COPY,
- "Server support copyfile", HFILL }},
- { &hf_dsi_server_flag_passwd,
- { "Support change password", "dsi.server_flag.passwd",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_PASSWD,
- "Server support change password", HFILL }},
- { &hf_dsi_server_flag_no_save_passwd,
- { "Don't allow save password", "dsi.server_flag.no_save_passwd",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_NOSAVEPASSWD,
- NULL, HFILL }},
- { &hf_dsi_server_flag_srv_msg,
- { "Support server message", "dsi.server_flag.srv_msg",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVMSGS,
- NULL, HFILL }},
- { &hf_dsi_server_flag_srv_sig,
- { "Support server signature", "dsi.server_flag.srv_sig",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVSIGNATURE,
- NULL, HFILL }},
- { &hf_dsi_server_flag_tcpip,
- { "Support TCP/IP", "dsi.server_flag.tcpip",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_TCPIP,
- "Server support TCP/IP", HFILL }},
- { &hf_dsi_server_flag_notify,
- { "Support server notifications", "dsi.server_flag.notify",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVNOTIFY,
- "Server support notifications", HFILL }},
- { &hf_dsi_server_flag_reconnect,
- { "Support server reconnect", "dsi.server_flag.reconnect",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVRECONNECT,
- "Server support reconnect", HFILL }},
- { &hf_dsi_server_flag_directory,
- { "Support directory services", "dsi.server_flag.directory",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVDIRECTORY,
- "Server support directory services", HFILL }},
- { &hf_dsi_server_flag_utf8_name,
- { "Support UTF8 server name", "dsi.server_flag.utf8_name",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVUTF8,
- "Server support UTF8 server name", HFILL }},
- { &hf_dsi_server_flag_uuid,
- { "Support UUIDs", "dsi.server_flag.uuids",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_UUID,
- "Server supports UUIDs", HFILL }},
- { &hf_dsi_server_flag_ext_sleep,
- { "Support extended sleep", "dsi.server_flag.ext_sleep",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_EXT_SLEEP,
- "Server supports extended sleep", HFILL }},
- { &hf_dsi_server_flag_fast_copy,
- { "Support fast copy", "dsi.server_flag.fast_copy",
- FT_BOOLEAN, 16, NULL, AFPSRVRINFO_FASTBOZO,
- "Server support fast copy", HFILL }},
-
-
- { &hf_dsi_server_addr_len,
- { "Length", "dsi.server_addr.len",
- FT_UINT8, BASE_DEC, NULL, 0x0,
- "Address length.", HFILL }},
-
- { &hf_dsi_server_addr_type,
- { "Type", "dsi.server_addr.type",
- FT_UINT8, BASE_DEC, VALS(afp_server_addr_type_vals), 0x0,
- "Address type.", HFILL }},
-
- { &hf_dsi_server_addr_value,
- { "Value", "dsi.server_addr.value",
- FT_BYTES, BASE_NONE, NULL, 0x0,
- "Address value", HFILL }},
-
- { &hf_dsi_open_type,
- { "Option", "dsi.open_type",
- FT_UINT8, BASE_DEC, VALS(dsi_open_type_vals), 0x0,
- "Open session option type.", HFILL }},
-
- { &hf_dsi_open_len,
- { "Length", "dsi.open_len",
- FT_UINT8, BASE_DEC, NULL, 0x0,
- "Open session option len", HFILL }},
-
- { &hf_dsi_open_quantum,
- { "Quantum", "dsi.open_quantum",
- FT_UINT32, BASE_DEC, NULL, 0x0,
- "Server/Attention quantum", HFILL }},
-
- { &hf_dsi_replay_cache_size,
- { "Replay", "dsi.replay_cache",
- FT_UINT32, BASE_DEC, NULL, 0x0,
- "Replay cache size", HFILL }},
-
- { &hf_dsi_open_option,
- { "Option", "dsi.open_option",
- FT_BYTES, BASE_NONE, NULL, 0x0,
- "Open session options (undecoded)", HFILL }},
-
- { &hf_dsi_attn_flag,
- { "Flags", "dsi.attn_flag",
- FT_UINT16, BASE_HEX, VALS(dsi_attn_flag_vals), 0xf000,
- "Server attention flag", HFILL }},
- { &hf_dsi_attn_flag_shutdown,
- { "Shutdown", "dsi.attn_flag.shutdown",
- FT_BOOLEAN, 16, NULL, 1<<15,
- "Attention flag, server is shutting down", HFILL }},
- { &hf_dsi_attn_flag_crash,
- { "Crash", "dsi.attn_flag.crash",
- FT_BOOLEAN, 16, NULL, 1<<14,
- "Attention flag, server crash bit", HFILL }},
- { &hf_dsi_attn_flag_msg,
- { "Message", "dsi.attn_flag.msg",
- FT_BOOLEAN, 16, NULL, 1<<13,
- "Attention flag, server message bit", HFILL }},
- { &hf_dsi_attn_flag_reconnect,
- { "Don't reconnect", "dsi.attn_flag.reconnect",
- FT_BOOLEAN, 16, NULL, 1<<12,
- "Attention flag, don't reconnect bit", HFILL }},
- { &hf_dsi_attn_flag_time,
- { "Minutes", "dsi.attn_flag.time",
- FT_UINT16, BASE_DEC, NULL, 0xfff,
- "Number of minutes", HFILL }},
- { &hf_dsi_attn_flag_bitmap,
- { "Bitmap", "dsi.attn_flag.time",
- FT_UINT16, BASE_HEX, NULL, 0xfff,
- "Attention extended bitmap", HFILL }},
-
- };
-
- static gint *ett[] = {
- &ett_dsi,
- &ett_dsi_open,
- &ett_dsi_attn,
- &ett_dsi_attn_flag,
- /* asp afp */
- &ett_dsi_status,
- &ett_dsi_status_server_flag,
- &ett_dsi_vers,
- &ett_dsi_uams,
- &ett_dsi_addr,
- &ett_dsi_addr_line,
- &ett_dsi_directory,
- &ett_dsi_utf8_name,
- };
- module_t *dsi_module;
-
- proto_dsi = proto_register_protocol("Data Stream Interface", "DSI", "dsi");
- proto_register_field_array(proto_dsi, hf, array_length(hf));
- proto_register_subtree_array(ett, array_length(ett));
-
- dsi_module = prefs_register_protocol(proto_dsi, NULL);
- prefs_register_bool_preference(dsi_module, "desegment",
- "Reassemble DSI messages spanning multiple TCP segments",
- "Whether the DSI dissector should reassemble messages spanning multiple TCP segments."
- " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
- &dsi_desegment);
+ static hf_register_info hf[] = {
+ { &hf_dsi_flags,
+ { "Flags", "dsi.flags",
+ FT_UINT8, BASE_HEX, VALS(flag_vals), 0x0,
+ "Indicates request or reply.", HFILL }},
+
+ { &hf_dsi_command,
+ { "Command", "dsi.command",
+ FT_UINT8, BASE_DEC|BASE_EXT_STRING, &func_vals_ext, 0x0,
+ "Represents a DSI command.", HFILL }},
+
+ { &hf_dsi_requestid,
+ { "Request ID", "dsi.requestid",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "Keeps track of which request this is. Replies must match a Request. IDs must be generated in sequential order.", HFILL }},
+
+ { &hf_dsi_offset,
+ { "Data offset", "dsi.data_offset",
+ FT_INT32, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_dsi_error,
+ { "Error code", "dsi.error_code",
+ FT_INT32, BASE_DEC|BASE_EXT_STRING, &asp_error_vals_ext, 0x0,
+ NULL, HFILL }},
+
+ { &hf_dsi_length,
+ { "Length", "dsi.length",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Total length of the data that follows the DSI header.", HFILL }},
+
+ { &hf_dsi_reserved,
+ { "Reserved", "dsi.reserved",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ "Reserved for future use. Should be set to zero.", HFILL }},
+ /* asp , afp */
+ { &hf_dsi_utf8_server_name_len,
+ { "Length", "dsi.utf8_server_name_len",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "UTF8 server name length.", HFILL }},
+ { &hf_dsi_utf8_server_name,
+ { "UTF8 Server name", "dsi.utf8_server_name",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_dsi_server_name,
+ { "Server name", "dsi.server_name",
+ FT_UINT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_dsi_server_type,
+ { "Server type", "dsi.server_type",
+ FT_UINT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_dsi_server_vers,
+ { "AFP version", "dsi.server_vers",
+ FT_UINT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_dsi_server_uams,
+ { "UAM", "dsi.server_uams",
+ FT_UINT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_dsi_server_icon,
+ { "Icon bitmap", "dsi.server_icon",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ "Server icon bitmap", HFILL }},
+
+ { &hf_dsi_server_directory,
+ { "Directory service", "dsi.server_directory",
+ FT_UINT_STRING, BASE_NONE, NULL, 0x0,
+ "Server directory service", HFILL }},
+
+ { &hf_dsi_server_signature,
+ { "Server signature", "dsi.server_signature",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_dsi_server_flag,
+ { "Flag", "dsi.server_flag",
+ FT_UINT16, BASE_HEX, NULL, 0x0,
+ "Server capabilities flag", HFILL }},
+ { &hf_dsi_server_flag_copyfile,
+ { "Support copyfile", "dsi.server_flag.copyfile",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_COPY,
+ "Server support copyfile", HFILL }},
+ { &hf_dsi_server_flag_passwd,
+ { "Support change password", "dsi.server_flag.passwd",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_PASSWD,
+ "Server support change password", HFILL }},
+ { &hf_dsi_server_flag_no_save_passwd,
+ { "Don't allow save password", "dsi.server_flag.no_save_passwd",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_NOSAVEPASSWD,
+ NULL, HFILL }},
+ { &hf_dsi_server_flag_srv_msg,
+ { "Support server message", "dsi.server_flag.srv_msg",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVMSGS,
+ NULL, HFILL }},
+ { &hf_dsi_server_flag_srv_sig,
+ { "Support server signature", "dsi.server_flag.srv_sig",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVSIGNATURE,
+ NULL, HFILL }},
+ { &hf_dsi_server_flag_tcpip,
+ { "Support TCP/IP", "dsi.server_flag.tcpip",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_TCPIP,
+ "Server support TCP/IP", HFILL }},
+ { &hf_dsi_server_flag_notify,
+ { "Support server notifications", "dsi.server_flag.notify",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVNOTIFY,
+ "Server support notifications", HFILL }},
+ { &hf_dsi_server_flag_reconnect,
+ { "Support server reconnect", "dsi.server_flag.reconnect",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVRECONNECT,
+ "Server support reconnect", HFILL }},
+ { &hf_dsi_server_flag_directory,
+ { "Support directory services", "dsi.server_flag.directory",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVDIRECTORY,
+ "Server support directory services", HFILL }},
+ { &hf_dsi_server_flag_utf8_name,
+ { "Support UTF8 server name", "dsi.server_flag.utf8_name",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_SRVUTF8,
+ "Server support UTF8 server name", HFILL }},
+ { &hf_dsi_server_flag_uuid,
+ { "Support UUIDs", "dsi.server_flag.uuids",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_UUID,
+ "Server supports UUIDs", HFILL }},
+ { &hf_dsi_server_flag_ext_sleep,
+ { "Support extended sleep", "dsi.server_flag.ext_sleep",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_EXT_SLEEP,
+ "Server supports extended sleep", HFILL }},
+ { &hf_dsi_server_flag_fast_copy,
+ { "Support fast copy", "dsi.server_flag.fast_copy",
+ FT_BOOLEAN, 16, NULL, AFPSRVRINFO_FASTBOZO,
+ "Server support fast copy", HFILL }},
+
+
+ { &hf_dsi_server_addr_len,
+ { "Length", "dsi.server_addr.len",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "Address length.", HFILL }},
+
+ { &hf_dsi_server_addr_type,
+ { "Type", "dsi.server_addr.type",
+ FT_UINT8, BASE_DEC|BASE_EXT_STRING, &afp_server_addr_type_vals_ext, 0x0,
+ "Address type.", HFILL }},
+
+ { &hf_dsi_server_addr_value,
+ { "Value", "dsi.server_addr.value",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ "Address value", HFILL }},
+
+ { &hf_dsi_open_type,
+ { "Option", "dsi.open_type",
+ FT_UINT8, BASE_DEC, VALS(dsi_open_type_vals), 0x0,
+ "Open session option type.", HFILL }},
+
+ { &hf_dsi_open_len,
+ { "Length", "dsi.open_len",
+ FT_UINT8, BASE_DEC, NULL, 0x0,
+ "Open session option len", HFILL }},
+
+ { &hf_dsi_open_quantum,
+ { "Quantum", "dsi.open_quantum",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Server/Attention quantum", HFILL }},
+
+ { &hf_dsi_replay_cache_size,
+ { "Replay", "dsi.replay_cache",
+ FT_UINT32, BASE_DEC, NULL, 0x0,
+ "Replay cache size", HFILL }},
+
+ { &hf_dsi_open_option,
+ { "Option", "dsi.open_option",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ "Open session options (undecoded)", HFILL }},
+
+ { &hf_dsi_attn_flag,
+ { "Flags", "dsi.attn_flag",
+ FT_UINT16, BASE_HEX|BASE_EXT_STRING, &dsi_attn_flag_vals_ext, 0xf000,
+ "Server attention flag", HFILL }},
+ { &hf_dsi_attn_flag_shutdown,
+ { "Shutdown", "dsi.attn_flag.shutdown",
+ FT_BOOLEAN, 16, NULL, 1<<15,
+ "Attention flag, server is shutting down", HFILL }},
+ { &hf_dsi_attn_flag_crash,
+ { "Crash", "dsi.attn_flag.crash",
+ FT_BOOLEAN, 16, NULL, 1<<14,
+ "Attention flag, server crash bit", HFILL }},
+ { &hf_dsi_attn_flag_msg,
+ { "Message", "dsi.attn_flag.msg",
+ FT_BOOLEAN, 16, NULL, 1<<13,
+ "Attention flag, server message bit", HFILL }},
+ { &hf_dsi_attn_flag_reconnect,
+ { "Don't reconnect", "dsi.attn_flag.reconnect",
+ FT_BOOLEAN, 16, NULL, 1<<12,
+ "Attention flag, don't reconnect bit", HFILL }},
+ { &hf_dsi_attn_flag_time,
+ { "Minutes", "dsi.attn_flag.time",
+ FT_UINT16, BASE_DEC, NULL, 0xfff,
+ "Number of minutes", HFILL }},
+ { &hf_dsi_attn_flag_bitmap,
+ { "Bitmap", "dsi.attn_flag.time",
+ FT_UINT16, BASE_HEX, NULL, 0xfff,
+ "Attention extended bitmap", HFILL }},
+
+ };
+
+ static gint *ett[] = {
+ &ett_dsi,
+ &ett_dsi_open,
+ &ett_dsi_attn,
+ &ett_dsi_attn_flag,
+ /* asp afp */
+ &ett_dsi_status,
+ &ett_dsi_status_server_flag,
+ &ett_dsi_vers,
+ &ett_dsi_uams,
+ &ett_dsi_addr,
+ &ett_dsi_addr_line,
+ &ett_dsi_directory,
+ &ett_dsi_utf8_name,
+ };
+ module_t *dsi_module;
+
+ proto_dsi = proto_register_protocol("Data Stream Interface", "DSI", "dsi");
+ proto_register_field_array(proto_dsi, hf, array_length(hf));
+ proto_register_subtree_array(ett, array_length(ett));
+
+ dsi_module = prefs_register_protocol(proto_dsi, NULL);
+ prefs_register_bool_preference(dsi_module, "desegment",
+ "Reassemble DSI messages spanning multiple TCP segments",
+ "Whether the DSI dissector should reassemble messages spanning multiple TCP segments."
+ " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
+ &dsi_desegment);
}
void
proto_reg_handoff_dsi(void)
{
- dissector_handle_t dsi_handle;
+ dissector_handle_t dsi_handle;
- dsi_handle = create_dissector_handle(dissect_dsi, proto_dsi);
- dissector_add("tcp.port", TCP_PORT_DSI, dsi_handle);
+ dsi_handle = create_dissector_handle(dissect_dsi, proto_dsi);
+ dissector_add("tcp.port", TCP_PORT_DSI, dsi_handle);
- data_handle = find_dissector("data");
- afp_handle = find_dissector("afp");
+ data_handle = find_dissector("data");
+ afp_handle = find_dissector("afp");
}
diff --git a/epan/libwireshark.def b/epan/libwireshark.def
index c547836e20..24b19da032 100644
--- a/epan/libwireshark.def
+++ b/epan/libwireshark.def
@@ -98,7 +98,7 @@ col_set_str
col_set_time
col_set_writable
col_setup
-CommandCode_vals DATA
+CommandCode_vals_ext DATA
conversation_add_proto_data
conversation_delete_proto_data
conversation_get_proto_data
diff --git a/gtk/afp_stat.c b/gtk/afp_stat.c
index b5ee545927..db828d3f26 100644
--- a/gtk/afp_stat.c
+++ b/gtk/afp_stat.c
@@ -168,7 +168,7 @@ gtk_afpstat_init(const char *optarg, void *userdata _U_)
init_srt_table(&ss->afp_srt_table, 256, vbox, "afp.command");
for(i=0;i<256;i++){
- init_srt_table_row(&ss->afp_srt_table, i, val_to_str(i, CommandCode_vals, "Unknown(%u)"));
+ init_srt_table_row(&ss->afp_srt_table, i, val_to_str_ext(i, &CommandCode_vals_ext, "Unknown(%u)"));
}
diff --git a/tap-afpstat.c b/tap-afpstat.c
index 5505e11fd6..0465decc6d 100644
--- a/tap-afpstat.c
+++ b/tap-afpstat.c
@@ -100,7 +100,7 @@ afpstat_draw(void *pss)
}
printf("%-25s %6d %3d.%05d %3d.%05d %3" G_GINT64_MODIFIER "u.%05" G_GINT64_MODIFIER "u\n",
- val_to_str(i, CommandCode_vals, "Unknown (%u)"),
+ val_to_str_ext(i, &CommandCode_vals_ext, "Unknown (%u)"),
ss->proc[i].num,
(int)ss->proc[i].min.secs,ss->proc[i].min.nsecs/10000,
(int)ss->proc[i].max.secs,ss->proc[i].max.nsecs/10000,