Pass even zero-length DSI and ASP "command" messages to the AFP
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 28 Apr 2002 21:53:31 +0000 (21:53 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 28 Apr 2002 21:53:31 +0000 (21:53 +0000)
dissector, so it can show them as replies.

Put the command code into the protocol tree for replies.

Fix some additional AFP function names to match the names in the AFP
spec.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5275 f5534014-38df-0310-8fa8-9805f1628bb7

packet-afp.c
packet-dsi.c

index b0284ceafa2a77acf08dd35ef2ba96e8193179dc..eb4828ef6c6f22fb566c4f96d4b3c900fc5d16b0 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for afp packet dissection
  * Copyright 2002, Didier Gautheron <dgautheron@magic.fr>
  *
- * $Id: packet-afp.c,v 1.5 2002/04/28 21:22:20 guy Exp $
+ * $Id: packet-afp.c,v 1.6 2002/04/28 21:53:31 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -269,26 +269,26 @@ static const value_string vol_signature_vals[] = {
 
 static const value_string CommandCode_vals[] = {
   {AFP_BYTELOCK,       "FPByteRangeLock" },
-  {AFP_CLOSEVOL,       "FPVolClose" },
-  {AFP_CLOSEDIR,       "FPDirClose" },
-  {AFP_CLOSEFORK,      "FPForkClose" },
+  {AFP_CLOSEVOL,       "FPCloseVol" },
+  {AFP_CLOSEDIR,       "FPCloseDir" },
+  {AFP_CLOSEFORK,      "FPCloseFork" },
   {AFP_COPYFILE,       "FPCopyFile" },
-  {AFP_CREATEDIR,      "FPDirCreate" },
-  {AFP_CREATEFILE,     "FPFileCreate" },
+  {AFP_CREATEDIR,      "FPCreateDir" },
+  {AFP_CREATEFILE,     "FPCreateFile" },
   {AFP_DELETE,         "FPDelete" },
   {AFP_ENUMERATE,      "FPEnumerate" },
   {AFP_FLUSH,          "FPFlush" },
-  {AFP_FLUSHFORK,      "FPForkFlush" },
+  {AFP_FLUSHFORK,      "FPFlushFork" },
   {AFP_GETFORKPARAM,   "FPGetForkParms" },
-  {AFP_GETSRVINFO,     "FPGetSInfo" },
-  {AFP_GETSRVPARAM,    "FPGetSParms" },
+  {AFP_GETSRVINFO,     "FPGetSrvrInfo" },
+  {AFP_GETSRVPARAM,    "FPGetSrvrParms" },
   {AFP_GETVOLPARAM,    "FPGetVolParms" },
   {AFP_LOGIN,          "FPLogin" },
-  {AFP_LOGINCONT,      "FPContLogin" },
+  {AFP_LOGINCONT,      "FPLoginCont" },
   {AFP_LOGOUT,         "FPLogout" },
   {AFP_MAPID,          "FPMapID" },
   {AFP_MAPNAME,                "FPMapName" },
-  {AFP_MOVE,           "FPMove" },
+  {AFP_MOVE,           "FPMoveAndRename" },
   {AFP_OPENVOL,                "FPOpenVol" },
   {AFP_OPENDIR,                "FPOpenDir" },
   {AFP_OPENFORK,       "FPOpenFork" },
@@ -299,25 +299,25 @@ static const value_string CommandCode_vals[] = {
   {AFP_SETFORKPARAM,   "FPSetForkParms" },
   {AFP_SETVOLPARAM,    "FPSetVolParms" },
   {AFP_WRITE,          "FPWrite" },
-  {AFP_GETFLDRPARAM,   "FPGetFlDrParms" },
-  {AFP_SETFLDRPARAM,   "FPSetFlDrParms" },
-  {AFP_CHANGEPW,       "FPChangePw" },
+  {AFP_GETFLDRPARAM,   "FPGetFileDirParms" },
+  {AFP_SETFLDRPARAM,   "FPSetFileDirParms" },
+  {AFP_CHANGEPW,       "FPChangePassword" },
   {AFP_GETSRVRMSG,     "FPGetSrvrMsg" },
   {AFP_CREATEID,       "FPCreateID" },
   {AFP_DELETEID,       "FPDeleteID" },
   {AFP_RESOLVEID,      "FPResolveID" },
   {AFP_EXCHANGEFILE,   "FPExchangeFiles" },
   {AFP_CATSEARCH,      "FPCatSearch" },
-  {AFP_OPENDT,         "FPDTOpen" },
-  {AFP_CLOSEDT,                "FPDTClose" },
+  {AFP_OPENDT,         "FPOpenDT" },
+  {AFP_CLOSEDT,                "FPCloseDT" },
   {AFP_GETICON,                "FPGetIcon" },
-  {AFP_GTICNINFO,      "FPGtIcnInfo" },
+  {AFP_GTICNINFO,      "FPGetIconInfo" },
   {AFP_ADDAPPL,                "FPAddAPPL" },
-  {AFP_RMVAPPL,                "FPRmvAPPL" },
+  {AFP_RMVAPPL,                "FPRemoveAPPL" },
   {AFP_GETAPPL,                "FPGetAPPL" },
-  {AFP_ADDCMT,         "FPAddCmt" },
-  {AFP_RMVCMT,         "FPRmvCmt" },
-  {AFP_GETCMT,         "FPGetCmt" },
+  {AFP_ADDCMT,         "FPAddComment" },
+  {AFP_RMVCMT,         "FPRemoveComment" },
+  {AFP_GETCMT,         "FPGetComment" },
   {AFP_ADDICON,                "FPAddIcon" },
   {0,                   NULL }
 };
@@ -553,14 +553,14 @@ kFPUTF8NameBit                    (bit 13)
 #define kFPRAlreadyOpenBit                     (1 << 4)
 #define kFPWriteInhibitBit                     (1 << 5)
 #define kFPBackUpNeededBit                     (1 << 6)
-#define kFPRenameInhibitBit            (1 << 7)
-#define kFPDeleteInhibitBit            (1 << 8)
+#define kFPRenameInhibitBit                    (1 << 7)
+#define kFPDeleteInhibitBit                    (1 << 8)
 #define kFPCopyProtectBit                      (1 << 10)
 #define kFPSetClearBit                                 (1 << 15)
 
 /* dir attribute */
 #define kIsExpFolder   (1 << 1)
-#define kMounted               (1 << 3)
+#define kMounted       (1 << 3)
 #define kInExpFolder   (1 << 4)
 
 #define hash_init_count 20
@@ -1521,7 +1521,7 @@ static gint
 dissect_query_afp_login(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
 {
        int len;
-    const char *uam;
+       const char *uam;
     
        len = tvb_get_guint8(tvb, offset);
        proto_tree_add_item(tree, hf_afp_AFPVersion, tvb, offset, 1,FALSE);
@@ -2251,12 +2251,10 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        afp_command = request_val->command;
        if (check_col(pinfo->cinfo, COL_INFO)) {
-               gchar   *func_str;
-
-               if ((func_str = match_strval(afp_command, CommandCode_vals)))
-               {
-                       col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", func_str, aspinfo->reply?"reply":"");
-               }
+               col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s",
+                            val_to_str(afp_command, CommandCode_vals,
+                                       "Unknown command (0x%02x)"),
+                            aspinfo->reply ? " reply" : "");
        }
 
        if (tree)
@@ -2364,6 +2362,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                }
        }
        else {
+               proto_tree_add_uint(afp_tree, hf_afp_command, tvb, 0, 0, afp_command);
                switch(afp_command) {
                case AFP_BYTELOCK:
                        offset = dissect_reply_afp_byte_lock(tvb, pinfo, afp_tree, offset);break; 
index 6e20624abd96d879b5babf5460be4d0fe2729dd7..768c9083bae2e123a7fa29c16826fdce2c68db7f 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for dsi packet dissection
  * Copyright 2001, Randy McEoin <rmceoin@pe.com>
  *
- * $Id: packet-dsi.c,v 1.13 2002/04/28 19:21:39 guy Exp $
+ * $Id: packet-dsi.c,v 1.14 2002/04/28 21:53:31 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -183,17 +183,15 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                tvbuff_t   *new_tvb;
                int len = tvb_reported_length_remaining(tvb,DSI_BLOCKSIZ);
 
-               if (len) {
-                       aspinfo.reply = dsi_flags & 1;
-                       aspinfo.command = dsi_command;
-                       aspinfo.seq = dsi_requestid;
-                       aspinfo.code = dsi_code;
-                       pinfo->private_data = &aspinfo;
-                       proto_item_set_len(dsi_tree, DSI_BLOCKSIZ);
-
-                       new_tvb = tvb_new_subset(tvb, DSI_BLOCKSIZ,-1,len);
-                       call_dissector(afp_handle, new_tvb, pinfo, tree);
-               }
+               aspinfo.reply = dsi_flags & 1;
+               aspinfo.command = dsi_command;
+               aspinfo.seq = dsi_requestid;
+               aspinfo.code = dsi_code;
+               pinfo->private_data = &aspinfo;
+               proto_item_set_len(dsi_tree, DSI_BLOCKSIZ);
+
+               new_tvb = tvb_new_subset(tvb, DSI_BLOCKSIZ,-1,len);
+               call_dissector(afp_handle, new_tvb, pinfo, tree);
        }
        else if (tree) {        
                call_dissector(data_handle,tvb_new_subset(tvb, DSI_BLOCKSIZ,-1,tvb_reported_length_remaining(tvb,DSI_BLOCKSIZ)), pinfo, dsi_tree);