Add dissection of one more bit in Quota FS Flags bitmask
[obnox/wireshark/wip.git] / smb.h
diff --git a/smb.h b/smb.h
index 1c6d8aeb8789d398f479195c5a52125e1a6850d6..aed148eeeba28e311e0998348e8e2ea728c9de9d 100644 (file)
--- a/smb.h
+++ b/smb.h
@@ -2,7 +2,7 @@
  * Defines for smb packet dissection
  * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
  *
- * $Id: smb.h,v 1.28 2001/12/05 00:49:32 guy Exp $
+ * $Id: smb.h,v 1.36 2002/03/16 04:39:29 sahlberg Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #define SMBE_unsup 50              /* Request unsupported, returned by Win 95, RJS 20Jun98 */
 #define SMBE_nosuchshare 67        /* Share does not exits */
 #define SMBE_filexists 80          /* File in operation already exists */
+#define SMBE_invalidparam 87      /* Invalid parameter */
 #define SMBE_cannotopen 110        /* Cannot open the file specified */
-#define SMBE_unknownlevel 124
+#define SMBE_insufficientbuffer 122/* Insufficient buffer size */
+#define SMBE_invalidname 123       /* Invalid name */
+#define SMBE_unknownlevel 124      /* Unknown info level */
 #define SMBE_alreadyexists 183     /* File already exists */
 #define SMBE_badpipe 230           /* Named pipe invalid */
 #define SMBE_pipebusy 231          /* All instances of pipe are busy */
 #define SMBE_unknownipc 2142
 #define SMBE_noipc 66              /* don't support ipc */
 
+/* These errors seem to be only returned by the NT printer driver system */
+
+#define SMBE_unknownprinterdriver 1797 /* Unknown printer driver */
+#define SMBE_invalidprintername 1801   /* Invalid printer name */
+#define SMBE_printeralreadyexists 1802 /* Printer already exists */
+#define SMBE_invaliddatatype 1804      /* Invalid datatype */
+#define SMBE_invalidenvironment 1805   /* Invalid environment */
+#define SMBE_invalidformsize    1903   /* Invalid form size */
+#define SMBE_printerdriverinuse 3001   /* Printer driver in use */
+
 /* Error codes for the ERRSRV class */
 
 #define SMBE_error 1               /* Non specific error code */
  * The information we need to save about a request in order to show the
  * frame number of the request in the dissection of the reply.
  */
+#define SMB_SIF_TID_IS_IPC     0x0001
 typedef struct {
        guint32 frame_req, frame_res;
+       guint16 flags;
+       int cmd;
        void *extra_info;
 } smb_saved_info_t;
 
@@ -242,14 +258,32 @@ typedef struct {
 #define TRANSACTION_PIPE       0
 #define TRANSACTION_MAILSLOT   1
 
+/* these are defines used to represent different types of TIDs.
+   dont use the value 0 for any of these */
+#define TID_NORMAL     1
+#define TID_IPC                2
+
+/* this is the structure which is associated with each conversation */
+typedef struct conv_tables {
+       /* these two tables are used to match requests with responses */
+       GHashTable *unmatched;
+       GHashTable *matched;
+       /* this tables is used by DCERPC over SMB reassembly*/
+       GHashTable *dcerpc_fid_to_frame;
+       /* This table is used to track TID->services for a conversation */
+       GHashTable *tid_service;
+} conv_tables_t;
+
 typedef struct smb_info {
-  int cmd, mid;
+  int cmd;
+  int tid, pid, uid, mid;
   gboolean unicode;            /* Are strings in this SMB Unicode? */
   gboolean request;            /* Is this a request? */
   gboolean unidir;
   int info_level;
   int info_count;
   smb_saved_info_t *sip;       /* smb_saved_info_t, if any, for this */
+  conv_tables_t *ct;
 } smb_info_t;
 
 /*
@@ -270,4 +304,14 @@ extern void add_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 extern int dissect_ipc_state(tvbuff_t *tvb, packet_info *pinfo,
     proto_tree *parent_tree, int offset, gboolean setstate);
 
+extern gboolean smb_dcerpc_reassembly;
+extern GHashTable *dcerpc_fragment_table;
+
+/*
+ * NT and DOS error codes used by other dissectors.
+ */
+extern const value_string NT_errors[];
+extern const value_string DOS_errors[];
+extern const value_string ms_country_codes[];
+
 #endif