From Clemens Auer:
[obnox/wireshark/wip.git] / asn1 / ldap / packet-ldap-template.h
1 /* packet-ldap.h
2  * Routines for ros packet dissection
3  * Copyright 2005, Anders Broman <anders.broman@ericsson.com>
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifndef __PACKET_LDAP_H__
27 #define __PACKET_LDAP_H__
28
29 # include <epan/packet.h>  /* for dissector_*_t types */
30
31 /*
32  * These are all APPLICATION types; the value is the type tag.
33  */
34 #define LDAP_REQ_BIND               0
35 #define LDAP_REQ_UNBIND             2
36 #define LDAP_REQ_SEARCH             3
37 #define LDAP_REQ_MODIFY             6
38 #define LDAP_REQ_ADD                8
39 #define LDAP_REQ_DELETE             10
40 #define LDAP_REQ_MODRDN             12
41 #define LDAP_REQ_COMPARE            14
42 #define LDAP_REQ_ABANDON            16
43 #define LDAP_REQ_EXTENDED           23  /* LDAP V3 only */
44
45 #define LDAP_RES_BIND               1
46 #define LDAP_RES_SEARCH_ENTRY       4
47 #define LDAP_RES_SEARCH_REF         19  /* LDAP V3 only */
48 #define LDAP_RES_SEARCH_RESULT      5
49 #define LDAP_RES_MODIFY             7
50 #define LDAP_RES_ADD                9
51 #define LDAP_RES_DELETE             11
52 #define LDAP_RES_MODRDN             13
53 #define LDAP_RES_COMPARE            15
54 #define LDAP_RES_EXTENDED           24  /* LDAP V3 only */
55 #define LDAP_RES_INTERMEDIATE       25  /* LDAP V3 only */
56
57 /*
58  * These are all CONTEXT types; the value is the type tag.
59  */
60
61 /* authentication type tags */
62 #define LDAP_AUTH_SIMPLE        0
63 #define LDAP_AUTH_KRBV4LDAP     1       /* LDAP V2 only */
64 #define LDAP_AUTH_KRBV4DSA      2       /* LDAP V2 only */
65 #define LDAP_AUTH_SASL          3       /* LDAP V3 only */
66
67 /* filter type tags */
68 #define LDAP_FILTER_AND         0
69 #define LDAP_FILTER_OR          1
70 #define LDAP_FILTER_NOT         2
71 #define LDAP_FILTER_EQUALITY    3
72 #define LDAP_FILTER_SUBSTRINGS  4
73 #define LDAP_FILTER_GE          5
74 #define LDAP_FILTER_LE          6
75 #define LDAP_FILTER_PRESENT     7
76 #define LDAP_FILTER_APPROX      8
77 #define LDAP_FILTER_EXTENSIBLE  9       /* LDAP V3 only */
78
79 #define LDAP_MOD_ADD            0
80 #define LDAP_MOD_DELETE         1
81 #define LDAP_MOD_REPLACE        2
82
83 #define LDAP_SASL_MAX_BUF       1024*1024
84
85 #define NETLOGON_NT_VERSION_1                                   1
86 #define NETLOGON_NT_VERSION_5                                   2
87 #define NETLOGON_NT_VERSION_5EX                                 4
88 #define NETLOGON_NT_VERSION_5EX_WITH_IP                 8
89 #define NETLOGON_NT_VERSION_WITH_CLOSEST_SITE   16
90
91 #define LOGON_SAM_LOGON_RESPONSE        19
92 #define LOGON_SAM_LOGON_RESPONSE_EX     23
93
94 typedef struct ldap_call_response {
95   gboolean is_request;
96   guint32 req_frame;
97   nstime_t req_time;
98   guint32 rep_frame;
99   guint messageId;
100   guint protocolOpTag;
101 } ldap_call_response_t;
102
103 void register_ldap_name_dissector_handle(const char *attr_type, dissector_handle_t dissector);
104 void register_ldap_name_dissector(const char *attr_type, dissector_t dissector, int proto);
105
106 int dissect_mscldap_string(tvbuff_t *tvb, int offset, char *str, int maxlen, gboolean prepend_dot);
107
108 /*#include "packet-ldap-exp.h" */
109
110 #endif  /* PACKET_LDAP_H */
111
112