Add endpoint talkers support for FDDI to ethereal and tethereal
[obnox/wireshark/wip.git] / packet-dcerpc.h
index 7419dbe585afcbbca13e34d7caa621b752dc2e0f..2ecc7b35a2c783ef6ae0a443427e53f54fe0e12c 100644 (file)
@@ -1,7 +1,8 @@
 /* packet-dcerpc.h
  * Copyright 2001, Todd Sabin <tas@webspan.net>
+ * Copyright 2003, Tim Potter <tpot@samba.org>
  *
- * $Id: packet-dcerpc.h,v 1.25 2002/11/02 22:14:21 sahlberg Exp $
+ * $Id: packet-dcerpc.h,v 1.34 2003/08/04 02:48:58 tpot Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -159,16 +160,24 @@ int dissect_ndr_ctx_hnd (tvbuff_t *tvb, gint offset, packet_info *pinfo,
                          proto_tree *tree, char *drep,
                          int hfindex, e_ctx_hnd *pdata);
 
-
 typedef int (dcerpc_dissect_fnct_t)(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep);
 
+typedef void (dcerpc_callback_fnct_t)(packet_info *pinfo, proto_tree *tree, proto_item *item, tvbuff_t *tvb, int start_offset, int end_offset, void *callback_args);
+
 #define NDR_POINTER_REF                1
 #define NDR_POINTER_UNIQUE     2
 #define NDR_POINTER_PTR                3
 
-int dissect_ndr_pointer (tvbuff_t *tvb, gint offset, packet_info *pinfo,
-                        proto_tree *tree, char *drep,
-                        dcerpc_dissect_fnct_t *fnct, int type, char *text, int hf_index, int levels);
+int dissect_ndr_pointer_cb(tvbuff_t *tvb, gint offset, packet_info *pinfo,
+                          proto_tree *tree, char *drep,
+                          dcerpc_dissect_fnct_t *fnct, int type, char *text, 
+                          int hf_index, dcerpc_callback_fnct_t *callback,
+                          void *callback_args);
+
+int dissect_ndr_pointer(tvbuff_t *tvb, gint offset, packet_info *pinfo,
+                       proto_tree *tree, char *drep,
+                       dcerpc_dissect_fnct_t *fnct, int type, char *text, 
+                       int hf_index);
 
 /* dissect a NDR unidimensional conformant array */
 int dissect_ndr_ucarray(tvbuff_t *tvb, gint offset, packet_info *pinfo,
@@ -180,7 +189,17 @@ int dissect_ndr_ucvarray(tvbuff_t *tvb, gint offset, packet_info *pinfo,
                         proto_tree *tree, char *drep,
                         dcerpc_dissect_fnct_t *fnct);
 
+int dissect_ndr_byte_array(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+                           proto_tree *tree, char *drep);
 
+int dissect_ndr_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+                        proto_tree *tree, char *drep, int size_is,
+                        int hfinfo, gboolean add_subtree,
+                        char **data);
+int dissect_ndr_char_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+                           proto_tree *tree, char *drep);
+int dissect_ndr_wchar_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo, 
+                            proto_tree *tree, char *drep);
 
 typedef struct _dcerpc_sub_dissector {
     guint16 num;
@@ -194,6 +213,9 @@ void dcerpc_init_uuid (int proto, int ett, e_uuid_t *uuid, guint16 ver, dcerpc_s
 char *dcerpc_get_proto_name(e_uuid_t *uuid, guint16 ver);
 dcerpc_sub_dissector *dcerpc_get_proto_sub_dissector(e_uuid_t *uuid, guint16 ver);
 
+/* Create a opnum, name value_string from a subdissector list */
+
+value_string *value_string_from_subdissectors(dcerpc_sub_dissector *sd);
 
 /* Private data structure to pass to DCERPC dissector. This is used to
    pass transport specific information down to the dissector from the
@@ -237,7 +259,6 @@ typedef struct _dcerpc_info {
        guint32 array_actual_count;
        guint32 array_actual_count_offset;
        int hf_index;
-       int levels;                    /* number of levels upwards in the tree to append text*/
        dcerpc_call_value *call_data;
        void *private_data;
 } dcerpc_info;
@@ -259,5 +280,41 @@ typedef struct _dcerpc_uuid_value {
     int opnum_hf;
 } dcerpc_uuid_value;
 
+/* Authenticated pipe registration functions and miscellanea */
+
+typedef struct _decrpc_auth_subdissector_fns {
+       dcerpc_dissect_fnct_t *bind_fn;
+       dcerpc_dissect_fnct_t *bind_ack_fn;
+       dcerpc_dissect_fnct_t *auth3_fn;
+       dcerpc_dissect_fnct_t *req_verf_fn;
+       dcerpc_dissect_fnct_t *resp_verf_fn;
+       dcerpc_dissect_fnct_t *req_data_fn;
+       dcerpc_dissect_fnct_t *resp_data_fn;
+} dcerpc_auth_subdissector_fns;
+
+void register_dcerpc_auth_subdissector(guint8 auth_level, guint8 auth_type,
+                                      dcerpc_auth_subdissector_fns *fns);
+
+/* Authentication services */
+
+#define DCE_C_RPC_AUTHN_PROTOCOL_NONE          0
+#define DCE_C_RPC_AUTHN_PROTOCOL_KRB5          1
+#define DCE_C_RPC_AUTHN_PROTOCOL_SPNEGO         9
+#define DCE_C_RPC_AUTHN_PROTOCOL_NTLMSSP       10
+#define DCE_C_RPC_AUTHN_PROTOCOL_SEC_CHAN       68
+
+/* Protection levels */
+
+#define DCE_C_AUTHN_LEVEL_NONE         1
+#define DCE_C_AUTHN_LEVEL_CONNECT      2
+#define DCE_C_AUTHN_LEVEL_CALL         3
+#define DCE_C_AUTHN_LEVEL_PKT          4
+#define DCE_C_AUTHN_LEVEL_PKT_INTEGRITY        5
+#define DCE_C_AUTHN_LEVEL_PKT_PRIVACY  6
+
+typedef struct _decrypted_info_t {
+       tvbuff_t *decr_tvb;
+       proto_tree *decr_tree;
+} decrypted_info_t;
 
 #endif /* packet-dcerpc.h */