MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-kerberos.h
blob2fc9f023f188170e02f4a3efe80c3bcbe9b99127
1 /* packet-kerberos.h
3 * $Id$
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #ifndef __PACKET_KERBEROS_H
25 #define __PACKET_KERBEROS_H
27 #include "ws_symbol_export.h"
29 /* This is a list of callback functions a caller can use to specify that
30 octet strings in kerberos to be passed back to application specific
31 dissectors, outside of kerberos.
32 This is used for dissection of application specific data for PacketCable
33 KRB_SAFE user data and eventually to pass kerberos session keys
34 to future DCERPC decryption and other uses.
35 The list is terminated by {0, NULL }
37 #define KRB_CBTAG_SAFE_USER_DATA 1
38 #define KRB_CBTAG_PRIV_USER_DATA 2
39 typedef struct _kerberos_callbacks {
40 int tag;
41 int (*callback)(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tree);
42 } kerberos_callbacks;
44 /* Function prototypes */
46 gint
47 dissect_kerberos_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean do_col_info, kerberos_callbacks *cb);
49 int
50 dissect_krb5_Checksum(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
52 int
53 dissect_krb5_ctime(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
55 int dissect_krb5_cname(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
56 int dissect_krb5_realm(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_);
57 guint32 kerberos_output_keytype(void);
59 guint get_krb_pdu_len(packet_info *, tvbuff_t *tvb, int offset);
61 gint kerberos_rm_to_reclen(guint krb_rm);
63 void
64 show_krb_recordmark(proto_tree *tree, tvbuff_t *tvb, gint start, guint32 krb_rm);
66 #ifdef HAVE_KERBEROS
67 #define KRB_MAX_ORIG_LEN 256
69 #if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS)
70 typedef struct _enc_key_t {
71 struct _enc_key_t *next;
72 int keytype;
73 int keylength;
74 char *keyvalue;
75 char key_origin[KRB_MAX_ORIG_LEN+1];
76 } enc_key_t;
77 extern enc_key_t *enc_key_list;
79 guint8 *
80 decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
81 int usage,
82 tvbuff_t *crypototvb,
83 int keytype,
84 int *datalen);
86 #endif /* HAVE_HEIMDAL_KERBEROS || HAVE_MIT_KERBEROS */
88 extern gboolean krb_decrypt;
90 WS_DLL_PUBLIC
91 void read_keytab_file_from_preferences(void);
93 #endif /* HAVE_KERBEROS */
95 #endif /* __PACKET_KERBEROS_H */