Don't do fcn calls in arg of g_?to??(); Macro may very well eval args multiple times.
[obnox/wireshark/wip.git] / epan / dissectors / packet-dcerpc-nt.h
index ab10093448593fedf3e419668e589f844c314b16..9e977070ef6ad4b3521828d887460d1546200a43 100644 (file)
@@ -4,8 +4,8 @@
  *
  * $Id$
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  *
  * This program is free software; you can redistribute it and/or
 #ifndef __PACKET_DCERPC_NT_H
 #define __PACKET_DCERPC_NT_H
 
-/*
- * ett_ value for Unicode strings.
- */
-extern gint ett_nt_unicode_string;
-
 /*
  * Platform ID values, used by several dissectors.
  */
@@ -40,7 +35,7 @@ extern const value_string platform_id_vals[];
 
 #define ALIGN_TO_8_BYTES \
        { dcerpc_info *xzdi; \
-         xzdi=pinfo->private_data; \
+         xzdi=(dcerpc_info *)pinfo->private_data; \
          if(!xzdi->conformant_run) { \
                if(offset&0x07) { \
                        offset=(offset&0xfffffff8)+8; \
@@ -49,7 +44,7 @@ extern const value_string platform_id_vals[];
        }
 #define ALIGN_TO_4_BYTES \
        { dcerpc_info *xzdi; \
-         xzdi=pinfo->private_data; \
+         xzdi=(dcerpc_info *)pinfo->private_data; \
          if(!xzdi->conformant_run) { \
                if(offset&0x03) { \
                        offset=(offset&0xfffffffc)+4; \
@@ -58,7 +53,7 @@ extern const value_string platform_id_vals[];
        }
 #define ALIGN_TO_2_BYTES \
        { dcerpc_info *xzdi; \
-         xzdi=pinfo->private_data; \
+         xzdi=(dcerpc_info *)pinfo->private_data; \
          if(!xzdi->conformant_run) { \
                if(offset&0x01) { \
                        offset=(offset&0xfffffffe)+2; \
@@ -66,6 +61,44 @@ extern const value_string platform_id_vals[];
          } \
        }
 
+#define ALIGN_TO_5_BYTES ALIGN_TO_4_OR_8_BYTES
+
+#define ALIGN_TO_4_OR_8_BYTES \
+       { dcerpc_info *xzdi2; \
+         xzdi2=(dcerpc_info *)pinfo->private_data; \
+         if (xzdi2->call_data->flags & DCERPC_IS_NDR64) { \
+           ALIGN_TO_8_BYTES; \
+         } else { \
+           ALIGN_TO_4_BYTES; \
+         } \
+       }
+
+#define ALIGN_TO_3_BYTES ALIGN_TO_2_OR_4_BYTES
+
+#define ALIGN_TO_2_OR_4_BYTES \
+       { dcerpc_info *xzdi2; \
+         xzdi2=(dcerpc_info *)pinfo->private_data; \
+         if (xzdi2->call_data->flags & DCERPC_IS_NDR64) { \
+           ALIGN_TO_4_BYTES; \
+         } else { \
+           ALIGN_TO_2_BYTES; \
+         } \
+       }
+int
+dissect_ndr_datablob(tvbuff_t *tvb, int offset, packet_info *pinfo,
+                       proto_tree *tree, guint8 *drep, int hf_index,
+                       int use_remaining_space);
+
+int 
+dissect_null_term_string(tvbuff_t *tvb, int offset, packet_info *pinfo,
+                                                       proto_tree *tree, guint8 *drep, int hf_index,
+                                                       int levels);
+
+int 
+dissect_null_term_wstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
+                                                       proto_tree *tree, guint8 *drep, int hf_index,
+                                                       int levels);
+
 int
 dissect_ndr_counted_ascii_string_cb(tvbuff_t *tvb, int offset,
                                  packet_info *pinfo, proto_tree *tree,
@@ -115,6 +148,11 @@ dissect_nt_GUID(tvbuff_t *tvb, int offset,
                        packet_info *pinfo, proto_tree *tree,
                        guint8 *drep);
 
+int
+dissect_ndr_lsa_String(tvbuff_t *tvb, int offset, packet_info *pinfo,
+                      proto_tree *parent_tree, guint8 *drep,
+                      guint32 param, int hfindex);
+
 int
 dissect_ndr_nt_NTTIME (tvbuff_t *tvb, int offset,
                        packet_info *pinfo, proto_tree *tree,
@@ -162,13 +200,13 @@ dcerpc_smb_store_pol_pkts(e_ctx_hnd *policy_hnd, packet_info *pinfo,
 /* Store a name with a policy handle */
 
 void
-dcerpc_smb_store_pol_name(e_ctx_hnd *policy_hnd, packet_info *pinfo,
-                         char *name);
+dcerpc_store_polhnd_name(e_ctx_hnd *policy_hnd, packet_info *pinfo,
+                         const char *name);
 
 /* Fetch details stored with a policy handle */
 
 gboolean
-dcerpc_smb_fetch_pol(e_ctx_hnd *policy_hnd, char **name,
+dcerpc_fetch_polhnd_data(e_ctx_hnd *policy_hnd, char **name, guint32 *type,
                     guint32 *open_frame, guint32 *close_frame,
                     guint32 cur_frame);
 
@@ -190,6 +228,17 @@ dissect_nt_policy_hnd(tvbuff_t *tvb, gint offset, packet_info *pinfo,
                      e_ctx_hnd *pdata, proto_item **pitem,
                      gboolean is_open, gboolean is_close);
 
+int
+PIDL_dissect_policy_hnd(tvbuff_t *tvb, gint offset, packet_info *pinfo,
+                     proto_tree *tree, guint8 *drep, int hfindex,
+                     guint32 param);
+
+int
+dissect_nt_guid_hnd(tvbuff_t *tvb, gint offset, packet_info *pinfo,
+                     proto_tree *tree, guint8 *drep, int hfindex,
+                     e_ctx_hnd *pdata, proto_item **pitem,
+                     gboolean is_open, gboolean is_close);
+
 int
 dissect_nt_LUID(tvbuff_t *tvb, int offset,
                        packet_info *pinfo, proto_tree *tree,
@@ -216,7 +265,7 @@ int dissect_ndr_uint16s(tvbuff_t *tvb, gint offset, packet_info *pinfo,
 
 int dissect_ndr_str_pointer_item(tvbuff_t *tvb, gint offset, 
                                 packet_info *pinfo, proto_tree *tree, 
-                                guint8 *drep, int type, char *text, 
+                                guint8 *drep, int type, const char *text, 
                                 int hf_index, int levels);
 
 /*
@@ -225,8 +274,8 @@ int dissect_ndr_str_pointer_item(tvbuff_t *tvb, gint offset,
 
 /* Number of levels to go up appending string to pointer item */
 #define CB_STR_ITEM_LEVELS(x)  ((x) & 0xFFFF)
-#define CB_STR_COL_INFO 0x10000        /* Append string to COL_INFO */
-#define CB_STR_SAVE     0x20000        /* Save string to dcv->private_data */
+#define CB_STR_SAVE     0x20000000     /* Save string to dcv->private_data */
+#define CB_STR_COL_INFO 0x10000000     /* Append string to COL_INFO */
 
 void cb_wstr_postprocess(packet_info *pinfo, proto_tree *tree _U_,
                        proto_item *item, tvbuff_t *tvb, 
@@ -241,4 +290,8 @@ void cb_str_postprocess(packet_info *pinfo, proto_tree *tree _U_,
 
 void dcerpc_smb_init(int proto_dcerpc);
 
+/* Used into packet-dcerpc-netlogon.c*/
+extern int hf_nt_cs_len;
+extern int hf_nt_cs_size;
+
 #endif /* packet-dcerpc-nt.h */