Added a value_string for the countreis which have their MS contry code listed
[obnox/wireshark/wip.git] / packet-dcerpc-nt.h
1 /* packet-dcerpc-nt.h
2  * Routines for DCERPC over SMB packet disassembly
3  * Copyright 2001, Tim Potter <tpot@samba.org>
4  *
5  * $Id: packet-dcerpc-nt.h,v 1.12 2002/03/14 10:04:02 sahlberg Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
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_DCERPC_NT_H
27 #define __PACKET_DCEPRC_NT_H
28
29 /* Routines for parsing simple types */
30
31 int prs_align(int offset, int n);
32
33 int prs_uint8(tvbuff_t *tvb, int offset, packet_info *pinfo,
34               proto_tree *tree, guint8 *data, char *name);
35
36 int prs_uint8s(tvbuff_t *tvb, int offset, packet_info *pinfo,
37                proto_tree *tree, int count, guint8 **data, char *name);
38
39 int prs_uint16(tvbuff_t *tvb, int offset, packet_info *pinfo,
40                proto_tree *tree, guint16 *data, char *name);
41
42 int prs_uint16s(tvbuff_t *tvb, int offset, packet_info *pinfo,
43                 proto_tree *tree, int count, guint16 **data, char *name);
44
45 int prs_uint32(tvbuff_t *tvb, int offset, packet_info *pinfo,
46                proto_tree *tree, guint32 *data, char *name);
47
48 int prs_uint32s(tvbuff_t *tvb, int offset, packet_info *pinfo,
49                 proto_tree *tree, int count, guint32 **data, char *name);
50
51 /* Parse NT status code */
52
53 int prs_ntstatus(tvbuff_t *tvb, int offset, packet_info *pinfo,
54                  proto_tree *tree);
55
56 /* Parse some common RPC structures */
57
58 char *fake_unicode(guint16 *data, int len);
59
60 int prs_UNISTR2(tvbuff_t *tvb, int offset, packet_info *pinfo,
61                 proto_tree *tree, int flags, char **data, char *name);
62
63 int prs_policy_hnd(tvbuff_t *tvb, int offset, packet_info *pinfo, 
64                    proto_tree *tree, const guint8 **data);
65
66 /* Routines for handling deferral of referants in NDR */
67
68 #define PARSE_SCALARS 1
69 #define PARSE_BUFFERS 2
70
71 int prs_push_ptr(tvbuff_t *tvb, int offset, packet_info *pinfo,
72                  proto_tree *tree, GList **ptr_list, char *name);
73
74 guint32 prs_pop_ptr(GList **ptr_list, char *name);
75
76
77
78 extern const value_string ms_country_codes[];
79
80 #define ALIGN_TO_4_BYTES        {if(offset&0x03)offset=(offset&0xfffffffc)+4;}
81
82 int
83 dissect_ndr_nt_UNICODE_STRING_str(tvbuff_t *tvb, int offset, 
84                         packet_info *pinfo, proto_tree *tree, 
85                         char *drep);
86 int
87 dissect_ndr_nt_UNICODE_STRING(tvbuff_t *tvb, int offset, 
88                         packet_info *pinfo, proto_tree *parent_tree, 
89                         char *drep, int hf_index, int levels);
90 int
91 dissect_ndr_nt_STRING_string (tvbuff_t *tvb, int offset, 
92                              packet_info *pinfo, proto_tree *tree, 
93                              char *drep);
94 int
95 dissect_ndr_nt_STRING (tvbuff_t *tvb, int offset, 
96                         packet_info *pinfo, proto_tree *parent_tree, 
97                         char *drep, int hf_index, int levels);
98 int 
99 dissect_ndr_nt_acct_ctrl(tvbuff_t *tvb, int offset, packet_info *pinfo, 
100                         proto_tree *parent_tree, char *drep);
101 int
102 dissect_ndr_nt_NTTIME (tvbuff_t *tvb, int offset, 
103                         packet_info *pinfo, proto_tree *tree, 
104                         char *drep, int hf_index);
105 int
106 dissect_ndr_nt_LOGON_HOURS(tvbuff_t *tvb, int offset, 
107                         packet_info *pinfo, proto_tree *parent_tree,
108                         char *drep);
109 int
110 dissect_ndr_nt_SID(tvbuff_t *tvb, int offset, 
111                         packet_info *pinfo, proto_tree *tree, 
112                         char *drep);
113 int
114 dissect_ndr_nt_PSID(tvbuff_t *tvb, int offset, 
115                              packet_info *pinfo, proto_tree *parent_tree,
116                              char *drep);
117 int
118 dissect_ndr_nt_PSID_ARRAY(tvbuff_t *tvb, int offset, 
119                         packet_info *pinfo, proto_tree *parent_tree,
120                         char *drep);
121
122 int
123 dissect_ndr_nt_SID_AND_ATTRIBUTES_ARRAY(tvbuff_t *tvb, int offset, 
124                         packet_info *pinfo, proto_tree *parent_tree,
125                         char *drep);
126 int
127 dissect_ndr_nt_SID_AND_ATTRIBUTES(tvbuff_t *tvb, int offset, 
128                         packet_info *pinfo, proto_tree *parent_tree,
129                         char *drep);
130
131
132
133 #endif /* packet-dcerpc-nt.h */