2b9ce6a3f2419684774e8886366baf1db5aabc28
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / packet-dcerpc-krb5pac.c
1 /* DO NOT EDIT
2         This filter was automatically generated
3         from /home/metze/devel/samba/4.0/master4-franky/librpc/idl/krb5pac.idl and /home/metze/devel/samba/4.0/master4-franky/librpc/idl/krb5pac.cnf.
4         
5         Pidl is a perl based IDL compiler for DCE/RPC idl files.
6         It is maintained by the Samba team, not the Wireshark team.
7         Instructions on how to download and install Pidl can be
8         found at http://wiki.wireshark.org/Pidl
9
10         $Id$
11 */
12
13
14 #include "config.h"
15 #ifdef _MSC_VER
16 #pragma warning(disable:4005)
17 #pragma warning(disable:4013)
18 #pragma warning(disable:4018)
19 #pragma warning(disable:4101)
20 #endif
21
22 #include <glib.h>
23 #include <string.h>
24 #include <epan/packet.h>
25
26 #include "packet-dcerpc.h"
27 #include "packet-dcerpc-nt.h"
28 #include "packet-windows-common.h"
29 #include "packet-dcerpc-krb5pac.h"
30
31 /* Ett declarations */
32 static gint ett_dcerpc_krb5pac = -1;
33 static gint ett_krb5pac_PAC_LOGON_NAME = -1;
34 static gint ett_krb5pac_PAC_SIGNATURE_DATA = -1;
35 static gint ett_krb5pac_PAC_LOGON_INFO = -1;
36 static gint ett_krb5pac_PAC_CONSTRAINED_DELEGATION = -1;
37 static gint ett_krb5pac_PAC_UNKNOWN_12 = -1;
38 static gint ett_krb5pac_PAC_LOGON_INFO_CTR = -1;
39 static gint ett_krb5pac_PAC_CONSTRAINED_DELEGATION_CTR = -1;
40 static gint ett_krb5pac_DATA_BLOB_REM = -1;
41 static gint ett_krb5pac_PAC_INFO = -1;
42 static gint ett_krb5pac_PAC_BUFFER = -1;
43 static gint ett_krb5pac_PAC_DATA = -1;
44 static gint ett_krb5pac_PAC_BUFFER_RAW = -1;
45 static gint ett_krb5pac_PAC_DATA_RAW = -1;
46 static gint ett_krb5pac_PAC_Validate = -1;
47 static gint ett_krb5pac_netsamlogoncache_entry = -1;
48
49
50 /* Header field declarations */
51 static gint hf_krb5pac_PAC_LOGON_INFO_res_group_dom_sid = -1;
52 static gint hf_krb5pac_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation_ = -1;
53 static gint hf_krb5pac_PAC_LOGON_INFO_info3 = -1;
54 static gint hf_krb5pac_PAC_Validate_MessageType = -1;
55 static gint hf_krb5pac_PAC_UNKNOWN_12_upn_name = -1;
56 static gint hf_krb5pac_PAC_INFO_valPAC_TYPE_KDC_CHECKSUM_kdc_cksum = -1;
57 static gint hf_krb5pac_PAC_UNKNOWN_12_domain_size = -1;
58 static gint hf_krb5pac_PAC_BUFFER__pad = -1;
59 static gint hf_krb5pac_PAC_UNKNOWN_12_domain_name = -1;
60 static gint hf_krb5pac_PAC_UNKNOWN_12_domain_offset = -1;
61 static gint hf_krb5pac_PAC_SIGNATURE_DATA_signature = -1;
62 static gint hf_krb5pac_PAC_UNKNOWN_12_upn_size = -1;
63 static gint hf_krb5pac_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation = -1;
64 static gint hf_krb5pac_opnum = -1;
65 static gint hf_krb5pac_PAC_LOGON_NAME_size = -1;
66 static gint hf_krb5pac_decode_login_info_logon_info = -1;
67 static gint hf_krb5pac_decode_pac_validate_pac_validate = -1;
68 static gint hf_krb5pac_PAC_DATA_buffers = -1;
69 static gint hf_krb5pac_PAC_BUFFER_info_ = -1;
70 static gint hf_krb5pac_PAC_DATA_RAW_version = -1;
71 static gint hf_krb5pac_PAC_BUFFER_RAW_ndr_size = -1;
72 static gint hf_krb5pac_PAC_CONSTRAINED_DELEGATION_num_transited_services = -1;
73 static gint hf_krb5pac_PAC_CONSTRAINED_DELEGATION_transited_services = -1;
74 static gint hf_krb5pac_PAC_BUFFER_type = -1;
75 static gint hf_krb5pac_PAC_CONSTRAINED_DELEGATION_proxy_target = -1;
76 static gint hf_krb5pac_PAC_UNKNOWN_12_unknown6 = -1;
77 static gint hf_krb5pac_PAC_UNKNOWN_12_unknown5 = -1;
78 static gint hf_krb5pac_PAC_INFO_valdefault_unknown_ = -1;
79 static gint hf_krb5pac_PAC_LOGON_NAME_logon_time = -1;
80 static gint hf_krb5pac_decode_pac_raw_pac = -1;
81 static gint hf_krb5pac_PAC_BUFFER__ndr_size = -1;
82 static gint hf_krb5pac_PAC_LOGON_INFO_res_groups = -1;
83 static gint hf_krb5pac_PAC_UNKNOWN_12_unknown3 = -1;
84 static gint hf_krb5pac_PAC_UNKNOWN_12_upn_offset = -1;
85 static gint hf_krb5pac_PAC_Validate_ChecksumAndSignature = -1;
86 static gint hf_krb5pac_decode_login_info_ctr_logon_info_ctr = -1;
87 static gint hf_krb5pac_PAC_INFO_valdefault_unknown = -1;
88 static gint hf_krb5pac_PAC_CONSTRAINED_DELEGATION_CTR_info = -1;
89 static gint hf_krb5pac_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info_ = -1;
90 static gint hf_krb5pac_PAC_BUFFER_info = -1;
91 static gint hf_krb5pac_netsamlogoncache_entry_info3 = -1;
92 static gint hf_krb5pac_PAC_Validate_SignatureType = -1;
93 static gint hf_krb5pac_PAC_DATA_num_buffers = -1;
94 static gint hf_krb5pac_PAC_BUFFER_RAW__pad = -1;
95 static gint hf_krb5pac_PAC_BUFFER_RAW_info = -1;
96 static gint hf_krb5pac_PAC_INFO_valPAC_TYPE_SRV_CHECKSUM_srv_cksum = -1;
97 static gint hf_krb5pac_PAC_INFO_valPAC_TYPE_LOGON_NAME_logon_name = -1;
98 static gint hf_krb5pac_PAC_LOGON_NAME_account_name = -1;
99 static gint hf_krb5pac_PAC_Validate_ChecksumLength = -1;
100 static gint hf_krb5pac_PAC_UNKNOWN_12_unknown4 = -1;
101 static gint hf_krb5pac_netsamlogoncache_entry_timestamp = -1;
102 static gint hf_krb5pac_PAC_DATA_RAW_buffers = -1;
103 static gint hf_krb5pac_PAC_SIGNATURE_DATA_type = -1;
104 static gint hf_krb5pac_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info = -1;
105 static gint hf_krb5pac_decode_pac_pac = -1;
106 static gint hf_krb5pac_PAC_Validate_SignatureLength = -1;
107 static gint hf_krb5pac_PAC_DATA_RAW_num_buffers = -1;
108 static gint hf_krb5pac_PAC_BUFFER_RAW_info_ = -1;
109 static gint hf_krb5pac_PAC_BUFFER_RAW_type = -1;
110 static gint hf_krb5pac_PAC_LOGON_INFO_CTR_info = -1;
111 static gint hf_krb5pac_PAC_DATA_version = -1;
112 static gint hf_krb5pac_DATA_BLOB_REM_remaining = -1;
113
114 static gint proto_dcerpc_krb5pac = -1;
115 /* Version information */
116
117
118 static e_uuid_t uuid_dcerpc_krb5pac = {
119         0x12345778, 0x1234, 0xabcd,
120         { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x", 0x }
121 };
122 static guint16 ver_dcerpc_krb5pac = 0;
123
124 static int krb5pac_dissect_element_PAC_LOGON_NAME_logon_time(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
125 static int krb5pac_dissect_element_PAC_LOGON_NAME_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
126 static int krb5pac_dissect_element_PAC_LOGON_NAME_account_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
127 static int krb5pac_dissect_element_PAC_LOGON_NAME_account_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
128 static int krb5pac_dissect_element_PAC_SIGNATURE_DATA_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
129 static int krb5pac_dissect_element_PAC_SIGNATURE_DATA_signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
130 static int krb5pac_dissect_element_PAC_LOGON_INFO_info3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
131 static int krb5pac_dissect_element_PAC_LOGON_INFO_res_group_dom_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
132 static int krb5pac_dissect_element_PAC_LOGON_INFO_res_group_dom_sid_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
133 static int krb5pac_dissect_element_PAC_LOGON_INFO_res_groups(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
134 static int krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_proxy_target(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
135 static int krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_num_transited_services(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
136 static int krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_transited_services(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
137 static int krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_transited_services_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
138 static int krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_transited_services__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
139 static int krb5pac_dissect_element_PAC_UNKNOWN_12_upn_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
140 static int krb5pac_dissect_element_PAC_UNKNOWN_12_upn_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
141 static int krb5pac_dissect_element_PAC_UNKNOWN_12_domain_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
142 static int krb5pac_dissect_element_PAC_UNKNOWN_12_domain_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
143 static int krb5pac_dissect_element_PAC_UNKNOWN_12_unknown3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
144 static int krb5pac_dissect_element_PAC_UNKNOWN_12_unknown4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
145 static int krb5pac_dissect_element_PAC_UNKNOWN_12_unknown5(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
146 static int krb5pac_dissect_element_PAC_UNKNOWN_12_upn_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
147 static int krb5pac_dissect_element_PAC_UNKNOWN_12_upn_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
148 static int krb5pac_dissect_element_PAC_UNKNOWN_12_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
149 static int krb5pac_dissect_element_PAC_UNKNOWN_12_domain_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
150 static int krb5pac_dissect_element_PAC_UNKNOWN_12_unknown6(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
151 static int krb5pac_dissect_element_PAC_LOGON_INFO_CTR_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
152 static int krb5pac_dissect_element_PAC_LOGON_INFO_CTR_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
153 static int krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_CTR_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
154 static int krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_CTR_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
155 const value_string krb5pac_PAC_TYPE_vals[] = {
156         { PAC_TYPE_LOGON_INFO, "PAC_TYPE_LOGON_INFO" },
157         { PAC_TYPE_SRV_CHECKSUM, "PAC_TYPE_SRV_CHECKSUM" },
158         { PAC_TYPE_KDC_CHECKSUM, "PAC_TYPE_KDC_CHECKSUM" },
159         { PAC_TYPE_LOGON_NAME, "PAC_TYPE_LOGON_NAME" },
160         { PAC_TYPE_CONSTRAINED_DELEGATION, "PAC_TYPE_CONSTRAINED_DELEGATION" },
161         { PAC_TYPE_UNKNOWN_12, "PAC_TYPE_UNKNOWN_12" },
162 { 0, NULL }
163 };
164 static int krb5pac_dissect_element_DATA_BLOB_REM_remaining(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
165 static int krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
166 static int krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
167 static int krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_SRV_CHECKSUM_srv_cksum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
168 static int krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_KDC_CHECKSUM_kdc_cksum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
169 static int krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_LOGON_NAME_logon_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
170 static int krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
171 static int krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
172 static int krb5pac_dissect_element_PAC_INFO_valdefault_unknown(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
173 static int krb5pac_dissect_element_PAC_INFO_valdefault_unknown_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
174 static int krb5pac_dissect_element_PAC_BUFFER_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *type);
175 static int krb5pac_dissect_element_PAC_BUFFER__ndr_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
176 static int krb5pac_dissect_element_PAC_BUFFER_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *type);
177 static int krb5pac_dissect_element_PAC_BUFFER_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *type);
178 static int krb5pac_dissect_element_PAC_BUFFER_info__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *type);
179 static int krb5pac_dissect_element_PAC_BUFFER__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
180 static int krb5pac_dissect_element_PAC_DATA_num_buffers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
181 static int krb5pac_dissect_element_PAC_DATA_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
182 static int krb5pac_dissect_element_PAC_DATA_buffers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
183 static int krb5pac_dissect_element_PAC_DATA_buffers_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
184 static int krb5pac_dissect_element_PAC_BUFFER_RAW_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
185 static int krb5pac_dissect_element_PAC_BUFFER_RAW_ndr_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
186 static int krb5pac_dissect_element_PAC_BUFFER_RAW_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
187 static int krb5pac_dissect_element_PAC_BUFFER_RAW_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
188 static int krb5pac_dissect_element_PAC_BUFFER_RAW_info__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
189 static int krb5pac_dissect_element_PAC_BUFFER_RAW__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
190 static int krb5pac_dissect_element_PAC_DATA_RAW_num_buffers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
191 static int krb5pac_dissect_element_PAC_DATA_RAW_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
192 static int krb5pac_dissect_element_PAC_DATA_RAW_buffers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
193 static int krb5pac_dissect_element_PAC_DATA_RAW_buffers_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
194 static int krb5pac_dissect_element_PAC_Validate_MessageType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
195 static int krb5pac_dissect_element_PAC_Validate_ChecksumLength(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
196 static int krb5pac_dissect_element_PAC_Validate_SignatureType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
197 static int krb5pac_dissect_element_PAC_Validate_SignatureLength(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
198 static int krb5pac_dissect_element_PAC_Validate_ChecksumAndSignature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
199 static int krb5pac_dissect_element_netsamlogoncache_entry_timestamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
200 static int krb5pac_dissect_element_netsamlogoncache_entry_info3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
201 static int krb5pac_dissect_element_decode_pac_pac(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
202 static int krb5pac_dissect_element_decode_pac_raw_pac(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
203 static int krb5pac_dissect_element_decode_login_info_logon_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
204 static int krb5pac_dissect_element_decode_login_info_ctr_logon_info_ctr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
205 static int krb5pac_dissect_element_decode_pac_validate_pac_validate(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
206
207
208 /* IDL: struct { */
209 /* IDL:         NTTIME logon_time; */
210 /* IDL:         [value(2*strlen_m(account_name))] uint16 size; */
211 /* IDL:         [charset(UTF16)] uint8 account_name[size]; */
212 /* IDL: } */
213
214 static int
215 krb5pac_dissect_element_PAC_LOGON_NAME_logon_time(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
216 {
217         offset = dissect_ndr_nt_NTTIME(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_LOGON_NAME_logon_time);
218
219         return offset;
220 }
221
222 static int
223 krb5pac_dissect_element_PAC_LOGON_NAME_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
224 {
225         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_LOGON_NAME_size, 0);
226
227         return offset;
228 }
229
230 static int
231 krb5pac_dissect_element_PAC_LOGON_NAME_account_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
232 {
233
234         return offset;
235 }
236
237 static int
238 krb5pac_dissect_element_PAC_LOGON_NAME_account_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
239 {
240         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_LOGON_NAME_account_name, 0);
241
242         return offset;
243 }
244
245 int
246 krb5pac_dissect_struct_PAC_LOGON_NAME(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
247 {
248         proto_item *item = NULL;
249         proto_tree *tree = NULL;
250         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
251         int old_offset;
252
253         ALIGN_TO_4_BYTES;
254
255         old_offset = offset;
256
257         if (parent_tree) {
258                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
259                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_LOGON_NAME);
260         }
261         
262         offset = krb5pac_dissect_element_PAC_LOGON_NAME_logon_time(tvb, offset, pinfo, tree, drep);
263
264         offset = krb5pac_dissect_element_PAC_LOGON_NAME_size(tvb, offset, pinfo, tree, drep);
265
266         offset = krb5pac_dissect_element_PAC_LOGON_NAME_account_name(tvb, offset, pinfo, tree, drep);
267
268
269         proto_item_set_len(item, offset-old_offset);
270
271
272         if (di->call_data->flags & DCERPC_IS_NDR64) {
273                 ALIGN_TO_4_BYTES;
274         }
275
276         return offset;
277 }
278
279
280 /* IDL: struct { */
281 /* IDL:         uint32 type; */
282 /* IDL:         [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB signature; */
283 /* IDL: } */
284
285 static int
286 krb5pac_dissect_element_PAC_SIGNATURE_DATA_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
287 {
288         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_SIGNATURE_DATA_type, 0);
289
290         return offset;
291 }
292
293 static int
294 krb5pac_dissect_element_PAC_SIGNATURE_DATA_signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
295 {
296         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_SIGNATURE_DATA_signature, 1);
297
298         return offset;
299 }
300
301 int
302 krb5pac_dissect_struct_PAC_SIGNATURE_DATA(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
303 {
304         proto_item *item = NULL;
305         proto_tree *tree = NULL;
306         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
307         int old_offset;
308
309         ALIGN_TO_4_BYTES;
310
311         old_offset = offset;
312
313         if (parent_tree) {
314                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
315                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_SIGNATURE_DATA);
316         }
317         
318         offset = krb5pac_dissect_element_PAC_SIGNATURE_DATA_type(tvb, offset, pinfo, tree, drep);
319
320         offset = krb5pac_dissect_element_PAC_SIGNATURE_DATA_signature(tvb, offset, pinfo, tree, drep);
321
322
323         proto_item_set_len(item, offset-old_offset);
324
325
326         if (di->call_data->flags & DCERPC_IS_NDR64) {
327                 ALIGN_TO_4_BYTES;
328         }
329
330         return offset;
331 }
332
333
334 /* IDL: struct { */
335 /* IDL:         netr_SamInfo3 info3; */
336 /* IDL:         [unique(1)] dom_sid2 *res_group_dom_sid; */
337 /* IDL:         samr_RidWithAttributeArray res_groups; */
338 /* IDL: } */
339
340 static int
341 krb5pac_dissect_element_PAC_LOGON_INFO_info3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
342 {
343         offset = krb5pac_dissect_struct_netr_SamInfo3(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_LOGON_INFO_info3,0);
344
345         return offset;
346 }
347
348 static int
349 krb5pac_dissect_element_PAC_LOGON_INFO_res_group_dom_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
350 {
351         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, krb5pac_dissect_element_PAC_LOGON_INFO_res_group_dom_sid_, NDR_POINTER_UNIQUE, "Pointer to Res Group Dom Sid (dom_sid2)",hf_krb5pac_PAC_LOGON_INFO_res_group_dom_sid);
352
353         return offset;
354 }
355
356 static int
357 krb5pac_dissect_element_PAC_LOGON_INFO_res_group_dom_sid_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
358 {
359         offset = krb5pac_dissect_struct_dom_sid2(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_LOGON_INFO_res_group_dom_sid,0);
360
361         return offset;
362 }
363
364 static int
365 krb5pac_dissect_element_PAC_LOGON_INFO_res_groups(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
366 {
367         offset = krb5pac_dissect_struct_samr_RidWithAttributeArray(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_LOGON_INFO_res_groups,0);
368
369         return offset;
370 }
371
372 int
373 krb5pac_dissect_struct_PAC_LOGON_INFO(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
374 {
375         proto_item *item = NULL;
376         proto_tree *tree = NULL;
377         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
378         int old_offset;
379
380         ALIGN_TO_5_BYTES;
381
382         old_offset = offset;
383
384         if (parent_tree) {
385                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
386                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_LOGON_INFO);
387         }
388         
389         offset = krb5pac_dissect_element_PAC_LOGON_INFO_info3(tvb, offset, pinfo, tree, drep);
390
391         offset = krb5pac_dissect_element_PAC_LOGON_INFO_res_group_dom_sid(tvb, offset, pinfo, tree, drep);
392
393         offset = krb5pac_dissect_element_PAC_LOGON_INFO_res_groups(tvb, offset, pinfo, tree, drep);
394
395
396         proto_item_set_len(item, offset-old_offset);
397
398
399         if (di->call_data->flags & DCERPC_IS_NDR64) {
400                 ALIGN_TO_5_BYTES;
401         }
402
403         return offset;
404 }
405
406
407 /* IDL: struct { */
408 /* IDL:         lsa_String proxy_target; */
409 /* IDL:         uint32 num_transited_services; */
410 /* IDL:         [unique(1)] [size_is(num_transited_services)] lsa_String *transited_services; */
411 /* IDL: } */
412
413 static int
414 krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_proxy_target(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
415 {
416         offset = krb5pac_dissect_struct_lsa_String(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_CONSTRAINED_DELEGATION_proxy_target,0);
417
418         return offset;
419 }
420
421 static int
422 krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_num_transited_services(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
423 {
424         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_CONSTRAINED_DELEGATION_num_transited_services, 0);
425
426         return offset;
427 }
428
429 static int
430 krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_transited_services(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
431 {
432         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_transited_services_, NDR_POINTER_UNIQUE, "Pointer to Transited Services (lsa_String)",hf_krb5pac_PAC_CONSTRAINED_DELEGATION_transited_services);
433
434         return offset;
435 }
436
437 static int
438 krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_transited_services_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
439 {
440         offset = dissect_ndr_ucarray(tvb, offset, pinfo, tree, drep, krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_transited_services__);
441
442         return offset;
443 }
444
445 static int
446 krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_transited_services__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
447 {
448         offset = krb5pac_dissect_struct_lsa_String(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_CONSTRAINED_DELEGATION_transited_services,0);
449
450         return offset;
451 }
452
453 int
454 krb5pac_dissect_struct_PAC_CONSTRAINED_DELEGATION(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
455 {
456         proto_item *item = NULL;
457         proto_tree *tree = NULL;
458         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
459         int old_offset;
460
461         ALIGN_TO_5_BYTES;
462
463         old_offset = offset;
464
465         if (parent_tree) {
466                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
467                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_CONSTRAINED_DELEGATION);
468         }
469         
470         offset = krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_proxy_target(tvb, offset, pinfo, tree, drep);
471
472         offset = krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_num_transited_services(tvb, offset, pinfo, tree, drep);
473
474         offset = krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_transited_services(tvb, offset, pinfo, tree, drep);
475
476
477         proto_item_set_len(item, offset-old_offset);
478
479
480         if (di->call_data->flags & DCERPC_IS_NDR64) {
481                 ALIGN_TO_5_BYTES;
482         }
483
484         return offset;
485 }
486
487
488 /* IDL: struct { */
489 /* IDL:         [value(2*strlen_m(upn_name))] uint16 upn_size; */
490 /* IDL:         uint16 upn_offset; */
491 /* IDL:         [value(2*strlen_m(domain_name))] uint16 domain_size; */
492 /* IDL:         uint16 domain_offset; */
493 /* IDL:         uint16 unknown3; */
494 /* IDL:         uint16 unknown4; */
495 /* IDL:         uint32 unknown5; */
496 /* IDL:         [charset(UTF16)] uint8 upn_name[upn_size+2]; */
497 /* IDL:         [charset(UTF16)] uint8 domain_name[domain_size+2]; */
498 /* IDL:         uint32 unknown6; */
499 /* IDL: } */
500
501 static int
502 krb5pac_dissect_element_PAC_UNKNOWN_12_upn_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
503 {
504         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_upn_size, 0);
505
506         return offset;
507 }
508
509 static int
510 krb5pac_dissect_element_PAC_UNKNOWN_12_upn_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
511 {
512         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_upn_offset, 0);
513
514         return offset;
515 }
516
517 static int
518 krb5pac_dissect_element_PAC_UNKNOWN_12_domain_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
519 {
520         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_domain_size, 0);
521
522         return offset;
523 }
524
525 static int
526 krb5pac_dissect_element_PAC_UNKNOWN_12_domain_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
527 {
528         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_domain_offset, 0);
529
530         return offset;
531 }
532
533 static int
534 krb5pac_dissect_element_PAC_UNKNOWN_12_unknown3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
535 {
536         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_unknown3, 0);
537
538         return offset;
539 }
540
541 static int
542 krb5pac_dissect_element_PAC_UNKNOWN_12_unknown4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
543 {
544         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_unknown4, 0);
545
546         return offset;
547 }
548
549 static int
550 krb5pac_dissect_element_PAC_UNKNOWN_12_unknown5(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
551 {
552         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_unknown5, 0);
553
554         return offset;
555 }
556
557 static int
558 krb5pac_dissect_element_PAC_UNKNOWN_12_upn_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
559 {
560
561         return offset;
562 }
563
564 static int
565 krb5pac_dissect_element_PAC_UNKNOWN_12_upn_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
566 {
567         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_upn_name, 0);
568
569         return offset;
570 }
571
572 static int
573 krb5pac_dissect_element_PAC_UNKNOWN_12_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
574 {
575
576         return offset;
577 }
578
579 static int
580 krb5pac_dissect_element_PAC_UNKNOWN_12_domain_name_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
581 {
582         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_domain_name, 0);
583
584         return offset;
585 }
586
587 static int
588 krb5pac_dissect_element_PAC_UNKNOWN_12_unknown6(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
589 {
590         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_UNKNOWN_12_unknown6, 0);
591
592         return offset;
593 }
594
595 int
596 krb5pac_dissect_struct_PAC_UNKNOWN_12(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
597 {
598         proto_item *item = NULL;
599         proto_tree *tree = NULL;
600         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
601         int old_offset;
602
603         ALIGN_TO_4_BYTES;
604
605         old_offset = offset;
606
607         if (parent_tree) {
608                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
609                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_UNKNOWN_12);
610         }
611         
612         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_upn_size(tvb, offset, pinfo, tree, drep);
613
614         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_upn_offset(tvb, offset, pinfo, tree, drep);
615
616         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_domain_size(tvb, offset, pinfo, tree, drep);
617
618         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_domain_offset(tvb, offset, pinfo, tree, drep);
619
620         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_unknown3(tvb, offset, pinfo, tree, drep);
621
622         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_unknown4(tvb, offset, pinfo, tree, drep);
623
624         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_unknown5(tvb, offset, pinfo, tree, drep);
625
626         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_upn_name(tvb, offset, pinfo, tree, drep);
627
628         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_domain_name(tvb, offset, pinfo, tree, drep);
629
630         offset = krb5pac_dissect_element_PAC_UNKNOWN_12_unknown6(tvb, offset, pinfo, tree, drep);
631
632
633         proto_item_set_len(item, offset-old_offset);
634
635
636         if (di->call_data->flags & DCERPC_IS_NDR64) {
637                 ALIGN_TO_4_BYTES;
638         }
639
640         return offset;
641 }
642
643
644 /* IDL: struct { */
645 /* IDL:         [unique(1)] PAC_LOGON_INFO *info; */
646 /* IDL: } */
647
648 static int
649 krb5pac_dissect_element_PAC_LOGON_INFO_CTR_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
650 {
651         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, krb5pac_dissect_element_PAC_LOGON_INFO_CTR_info_, NDR_POINTER_UNIQUE, "Pointer to Info (PAC_LOGON_INFO)",hf_krb5pac_PAC_LOGON_INFO_CTR_info);
652
653         return offset;
654 }
655
656 static int
657 krb5pac_dissect_element_PAC_LOGON_INFO_CTR_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
658 {
659         offset = krb5pac_dissect_struct_PAC_LOGON_INFO(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_LOGON_INFO_CTR_info,0);
660
661         return offset;
662 }
663
664 int
665 krb5pac_dissect_struct_PAC_LOGON_INFO_CTR(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
666 {
667         proto_item *item = NULL;
668         proto_tree *tree = NULL;
669         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
670         int old_offset;
671
672         ALIGN_TO_5_BYTES;
673
674         old_offset = offset;
675
676         if (parent_tree) {
677                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
678                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_LOGON_INFO_CTR);
679         }
680         
681         offset = krb5pac_dissect_element_PAC_LOGON_INFO_CTR_info(tvb, offset, pinfo, tree, drep);
682
683
684         proto_item_set_len(item, offset-old_offset);
685
686
687         if (di->call_data->flags & DCERPC_IS_NDR64) {
688                 ALIGN_TO_5_BYTES;
689         }
690
691         return offset;
692 }
693
694
695 /* IDL: struct { */
696 /* IDL:         [unique(1)] PAC_CONSTRAINED_DELEGATION *info; */
697 /* IDL: } */
698
699 static int
700 krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_CTR_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
701 {
702         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_CTR_info_, NDR_POINTER_UNIQUE, "Pointer to Info (PAC_CONSTRAINED_DELEGATION)",hf_krb5pac_PAC_CONSTRAINED_DELEGATION_CTR_info);
703
704         return offset;
705 }
706
707 static int
708 krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_CTR_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
709 {
710         offset = krb5pac_dissect_struct_PAC_CONSTRAINED_DELEGATION(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_CONSTRAINED_DELEGATION_CTR_info,0);
711
712         return offset;
713 }
714
715 int
716 krb5pac_dissect_struct_PAC_CONSTRAINED_DELEGATION_CTR(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
717 {
718         proto_item *item = NULL;
719         proto_tree *tree = NULL;
720         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
721         int old_offset;
722
723         ALIGN_TO_5_BYTES;
724
725         old_offset = offset;
726
727         if (parent_tree) {
728                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
729                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_CONSTRAINED_DELEGATION_CTR);
730         }
731         
732         offset = krb5pac_dissect_element_PAC_CONSTRAINED_DELEGATION_CTR_info(tvb, offset, pinfo, tree, drep);
733
734
735         proto_item_set_len(item, offset-old_offset);
736
737
738         if (di->call_data->flags & DCERPC_IS_NDR64) {
739                 ALIGN_TO_5_BYTES;
740         }
741
742         return offset;
743 }
744
745
746 /* IDL: enum { */
747 /* IDL:         PAC_TYPE_LOGON_INFO=1, */
748 /* IDL:         PAC_TYPE_SRV_CHECKSUM=6, */
749 /* IDL:         PAC_TYPE_KDC_CHECKSUM=7, */
750 /* IDL:         PAC_TYPE_LOGON_NAME=10, */
751 /* IDL:         PAC_TYPE_CONSTRAINED_DELEGATION=11, */
752 /* IDL:         PAC_TYPE_UNKNOWN_12=12, */
753 /* IDL: } */
754
755 int
756 krb5pac_dissect_enum_PAC_TYPE(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
757 {
758         guint32 parameter=0;
759         if(param){
760                 parameter=(guint32)*param;
761         }
762         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
763         if(param){
764                 *param=(guint32)parameter;
765         }
766         return offset;
767 }
768
769
770 /* IDL: struct { */
771 /* IDL:         [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB remaining; */
772 /* IDL: } */
773
774 static int
775 krb5pac_dissect_element_DATA_BLOB_REM_remaining(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
776 {
777         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_krb5pac_DATA_BLOB_REM_remaining, 1);
778
779         return offset;
780 }
781
782 int
783 krb5pac_dissect_struct_DATA_BLOB_REM(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
784 {
785         proto_item *item = NULL;
786         proto_tree *tree = NULL;
787         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
788         int old_offset;
789
790         ALIGN_TO_4_BYTES;
791
792         old_offset = offset;
793
794         if (parent_tree) {
795                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
796                 tree = proto_item_add_subtree(item, ett_krb5pac_DATA_BLOB_REM);
797         }
798         
799         offset = krb5pac_dissect_element_DATA_BLOB_REM_remaining(tvb, offset, pinfo, tree, drep);
800
801
802         proto_item_set_len(item, offset-old_offset);
803
804
805         if (di->call_data->flags & DCERPC_IS_NDR64) {
806                 ALIGN_TO_4_BYTES;
807         }
808
809         return offset;
810 }
811
812
813 /* IDL: [gensize(1)] [nodiscriminant(1)] [public(1)] union { */
814 /* IDL: [case(PAC_TYPE_LOGON_INFO)] [subcontext(0xFFFFFC01)] [case(PAC_TYPE_LOGON_INFO)] PAC_LOGON_INFO_CTR logon_info; */
815 /* IDL: [case(PAC_TYPE_SRV_CHECKSUM)] [case(PAC_TYPE_SRV_CHECKSUM)] PAC_SIGNATURE_DATA srv_cksum; */
816 /* IDL: [case(PAC_TYPE_KDC_CHECKSUM)] [case(PAC_TYPE_KDC_CHECKSUM)] PAC_SIGNATURE_DATA kdc_cksum; */
817 /* IDL: [case(PAC_TYPE_LOGON_NAME)] [case(PAC_TYPE_LOGON_NAME)] PAC_LOGON_NAME logon_name; */
818 /* IDL: [case(PAC_TYPE_CONSTRAINED_DELEGATION)] [subcontext(0xFFFFFC01)] [case(PAC_TYPE_CONSTRAINED_DELEGATION)] PAC_CONSTRAINED_DELEGATION_CTR constrained_delegation; */
819 /* IDL: [default] ; */
820 /* IDL: } */
821
822 static int
823 krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
824 {
825         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
826         guint0 size;
827         int conformant = di->conformant_run;
828         tvbuff_t *subtvb;
829
830         if (!conformant) {
831                 guint32 saved_flags = di->call_data->flags;
832                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info_, &size);
833                 di->call_data->flags &= ~DCERPC_IS_NDR64;
834                 subtvb = tvb_new_subset(tvb, offset, size, -1);
835                 krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info_(subtvb, 0, pinfo, tree, drep);
836                 offset += size;
837                 di->call_data->flags = saved_flags;
838         }
839
840         return offset;
841 }
842
843 static int
844 krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
845 {
846         offset = krb5pac_dissect_struct_PAC_LOGON_INFO_CTR(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info,0);
847
848         return offset;
849 }
850
851 static int
852 krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_SRV_CHECKSUM_srv_cksum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
853 {
854         offset = krb5pac_dissect_struct_PAC_SIGNATURE_DATA(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_INFO_valPAC_TYPE_SRV_CHECKSUM_srv_cksum,0);
855
856         return offset;
857 }
858
859 static int
860 krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_KDC_CHECKSUM_kdc_cksum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
861 {
862         offset = krb5pac_dissect_struct_PAC_SIGNATURE_DATA(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_INFO_valPAC_TYPE_KDC_CHECKSUM_kdc_cksum,0);
863
864         return offset;
865 }
866
867 static int
868 krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_LOGON_NAME_logon_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
869 {
870         offset = krb5pac_dissect_struct_PAC_LOGON_NAME(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_INFO_valPAC_TYPE_LOGON_NAME_logon_name,0);
871
872         return offset;
873 }
874
875 static int
876 krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
877 {
878         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
879         guint0 size;
880         int conformant = di->conformant_run;
881         tvbuff_t *subtvb;
882
883         if (!conformant) {
884                 guint32 saved_flags = di->call_data->flags;
885                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation_, &size);
886                 di->call_data->flags &= ~DCERPC_IS_NDR64;
887                 subtvb = tvb_new_subset(tvb, offset, size, -1);
888                 krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation_(subtvb, 0, pinfo, tree, drep);
889                 offset += size;
890                 di->call_data->flags = saved_flags;
891         }
892
893         return offset;
894 }
895
896 static int
897 krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
898 {
899         offset = krb5pac_dissect_struct_PAC_CONSTRAINED_DELEGATION_CTR(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation,0);
900
901         return offset;
902 }
903
904 static int
905 krb5pac_dissect_element_PAC_INFO_valdefault_unknown(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
906 {
907         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
908         guint0 size;
909         int conformant = di->conformant_run;
910         tvbuff_t *subtvb;
911
912         if (!conformant) {
913                 guint32 saved_flags = di->call_data->flags;
914                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_INFO_valdefault_unknown_, &size);
915                 di->call_data->flags &= ~DCERPC_IS_NDR64;
916                 subtvb = tvb_new_subset(tvb, offset, size, -1);
917                 krb5pac_dissect_element_PAC_INFO_valdefault_unknown_(subtvb, 0, pinfo, tree, drep);
918                 offset += size;
919                 di->call_data->flags = saved_flags;
920         }
921
922         return offset;
923 }
924
925 static int
926 krb5pac_dissect_element_PAC_INFO_valdefault_unknown_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
927 {
928         offset = krb5pac_dissect_struct_DATA_BLOB_REM(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_INFO_valdefault_unknown,0);
929
930         return offset;
931 }
932
933 static int
934 krb5pac_dissect_PAC_INFO(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
935 {
936         proto_item *item = NULL;
937         proto_tree *tree = NULL;
938         int old_offset;
939         guint32 level = param;
940
941         old_offset = offset;
942         if (parent_tree) {
943                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "PAC_INFO");
944                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_INFO);
945         }
946
947         switch(level) {
948                 case PAC_TYPE_LOGON_INFO:
949                         offset = krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info(tvb, offset, pinfo, tree, drep);
950                 break;
951
952                 case PAC_TYPE_SRV_CHECKSUM:
953                         offset = krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_SRV_CHECKSUM_srv_cksum(tvb, offset, pinfo, tree, drep);
954                 break;
955
956                 case PAC_TYPE_KDC_CHECKSUM:
957                         offset = krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_KDC_CHECKSUM_kdc_cksum(tvb, offset, pinfo, tree, drep);
958                 break;
959
960                 case PAC_TYPE_LOGON_NAME:
961                         offset = krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_LOGON_NAME_logon_name(tvb, offset, pinfo, tree, drep);
962                 break;
963
964                 case PAC_TYPE_CONSTRAINED_DELEGATION:
965                         offset = krb5pac_dissect_element_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation(tvb, offset, pinfo, tree, drep);
966                 break;
967
968                 default:
969                         offset = krb5pac_dissect_element_PAC_INFO_valdefault_unknown(tvb, offset, pinfo, tree, drep);
970                 break;
971         }
972         proto_item_set_len(item, offset-old_offset);
973
974
975         return offset;
976 }
977
978 /* IDL: struct { */
979 /* IDL:         PAC_TYPE type; */
980 /* IDL:         [value(_ndr_size_PAC_INFO(info,type,0))] uint32 _ndr_size; */
981 /* IDL:         [relative(1)] [subcontext_size(_subcontext_size_PAC_INFO(r,ndr->flags))] [subcontext(0)] [switch_is(type)] [flag(LIBNDR_FLAG_ALIGN8)] PAC_INFO *info; */
982 /* IDL:         [value(0)] uint32 _pad; */
983 /* IDL: } */
984
985 static int
986 krb5pac_dissect_element_PAC_BUFFER_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *type)
987 {
988         offset = krb5pac_dissect_enum_PAC_TYPE(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_BUFFER_type, type);
989
990         return offset;
991 }
992
993 static int
994 krb5pac_dissect_element_PAC_BUFFER__ndr_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
995 {
996         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_BUFFER__ndr_size, 0);
997
998         return offset;
999 }
1000
1001 static int
1002 krb5pac_dissect_element_PAC_BUFFER_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *type)
1003 {
1004         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, krb5pac_dissect_element_PAC_BUFFER_info_, , "Pointer to Info (PAC_INFO)",hf_krb5pac_PAC_BUFFER_info);
1005
1006         return offset;
1007 }
1008
1009 static int
1010 krb5pac_dissect_element_PAC_BUFFER_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *type)
1011 {
1012         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1013         guint0 size;
1014         int conformant = di->conformant_run;
1015         tvbuff_t *subtvb;
1016
1017         if (!conformant) {
1018                 guint32 saved_flags = di->call_data->flags;
1019                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_BUFFER_info_, &size);
1020                 di->call_data->flags &= ~DCERPC_IS_NDR64;
1021                 subtvb = tvb_new_subset(tvb, offset, size, -1);
1022                 krb5pac_dissect_element_PAC_BUFFER_info__(subtvb, 0, pinfo, tree, drep, type);
1023                 offset += size;
1024                 di->call_data->flags = saved_flags;
1025         }
1026
1027         return offset;
1028 }
1029
1030 static int
1031 krb5pac_dissect_element_PAC_BUFFER_info__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *type)
1032 {
1033         offset = krb5pac_dissect_PAC_INFO(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_BUFFER_info, *type);
1034
1035         return offset;
1036 }
1037
1038 static int
1039 krb5pac_dissect_element_PAC_BUFFER__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1040 {
1041         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_BUFFER__pad, 0);
1042
1043         return offset;
1044 }
1045
1046 int
1047 krb5pac_dissect_struct_PAC_BUFFER(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1048 {
1049         guint32 type;
1050         proto_item *item = NULL;
1051         proto_tree *tree = NULL;
1052         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1053         int old_offset;
1054
1055         ALIGN_TO_5_BYTES;
1056
1057         old_offset = offset;
1058
1059         if (parent_tree) {
1060                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1061                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_BUFFER);
1062         }
1063         
1064         offset = krb5pac_dissect_element_PAC_BUFFER_type(tvb, offset, pinfo, tree, drep, &type);
1065
1066         offset = krb5pac_dissect_element_PAC_BUFFER__ndr_size(tvb, offset, pinfo, tree, drep);
1067
1068         offset = krb5pac_dissect_element_PAC_BUFFER_info(tvb, offset, pinfo, tree, drep, &type);
1069
1070         offset = krb5pac_dissect_element_PAC_BUFFER__pad(tvb, offset, pinfo, tree, drep);
1071
1072
1073         proto_item_set_len(item, offset-old_offset);
1074
1075
1076         if (di->call_data->flags & DCERPC_IS_NDR64) {
1077                 ALIGN_TO_5_BYTES;
1078         }
1079
1080         return offset;
1081 }
1082
1083
1084 /* IDL: struct { */
1085 /* IDL:         uint32 num_buffers; */
1086 /* IDL:         uint32 version; */
1087 /* IDL:         PAC_BUFFER buffers[num_buffers]; */
1088 /* IDL: } */
1089
1090 static int
1091 krb5pac_dissect_element_PAC_DATA_num_buffers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1092 {
1093         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_DATA_num_buffers, 0);
1094
1095         return offset;
1096 }
1097
1098 static int
1099 krb5pac_dissect_element_PAC_DATA_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1100 {
1101         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_DATA_version, 0);
1102
1103         return offset;
1104 }
1105
1106 static int
1107 krb5pac_dissect_element_PAC_DATA_buffers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1108 {
1109
1110         return offset;
1111 }
1112
1113 static int
1114 krb5pac_dissect_element_PAC_DATA_buffers_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1115 {
1116         offset = krb5pac_dissect_struct_PAC_BUFFER(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_DATA_buffers,0);
1117
1118         return offset;
1119 }
1120
1121 int
1122 krb5pac_dissect_struct_PAC_DATA(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1123 {
1124         proto_item *item = NULL;
1125         proto_tree *tree = NULL;
1126         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1127         int old_offset;
1128
1129         ALIGN_TO_5_BYTES;
1130
1131         old_offset = offset;
1132
1133         if (parent_tree) {
1134                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1135                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_DATA);
1136         }
1137         
1138         offset = krb5pac_dissect_element_PAC_DATA_num_buffers(tvb, offset, pinfo, tree, drep);
1139
1140         offset = krb5pac_dissect_element_PAC_DATA_version(tvb, offset, pinfo, tree, drep);
1141
1142         offset = krb5pac_dissect_element_PAC_DATA_buffers(tvb, offset, pinfo, tree, drep);
1143
1144
1145         proto_item_set_len(item, offset-old_offset);
1146
1147
1148         if (di->call_data->flags & DCERPC_IS_NDR64) {
1149                 ALIGN_TO_5_BYTES;
1150         }
1151
1152         return offset;
1153 }
1154
1155
1156 /* IDL: struct { */
1157 /* IDL:         PAC_TYPE type; */
1158 /* IDL:         uint32 ndr_size; */
1159 /* IDL:         [relative(1)] [subcontext_size(NDR_ROUND(ndr_size,8))] [subcontext(0)] [flag(LIBNDR_FLAG_ALIGN8)] DATA_BLOB_REM *info; */
1160 /* IDL:         [value(0)] uint32 _pad; */
1161 /* IDL: } */
1162
1163 static int
1164 krb5pac_dissect_element_PAC_BUFFER_RAW_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1165 {
1166         offset = krb5pac_dissect_enum_PAC_TYPE(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_BUFFER_RAW_type, 0);
1167
1168         return offset;
1169 }
1170
1171 static int
1172 krb5pac_dissect_element_PAC_BUFFER_RAW_ndr_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1173 {
1174         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_BUFFER_RAW_ndr_size, 0);
1175
1176         return offset;
1177 }
1178
1179 static int
1180 krb5pac_dissect_element_PAC_BUFFER_RAW_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1181 {
1182         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, krb5pac_dissect_element_PAC_BUFFER_RAW_info_, , "Pointer to Info (DATA_BLOB_REM)",hf_krb5pac_PAC_BUFFER_RAW_info);
1183
1184         return offset;
1185 }
1186
1187 static int
1188 krb5pac_dissect_element_PAC_BUFFER_RAW_info_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1189 {
1190         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1191         guint0 size;
1192         int conformant = di->conformant_run;
1193         tvbuff_t *subtvb;
1194
1195         if (!conformant) {
1196                 guint32 saved_flags = di->call_data->flags;
1197                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_BUFFER_RAW_info_, &size);
1198                 di->call_data->flags &= ~DCERPC_IS_NDR64;
1199                 subtvb = tvb_new_subset(tvb, offset, size, -1);
1200                 krb5pac_dissect_element_PAC_BUFFER_RAW_info__(subtvb, 0, pinfo, tree, drep);
1201                 offset += size;
1202                 di->call_data->flags = saved_flags;
1203         }
1204
1205         return offset;
1206 }
1207
1208 static int
1209 krb5pac_dissect_element_PAC_BUFFER_RAW_info__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1210 {
1211         offset = krb5pac_dissect_struct_DATA_BLOB_REM(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_BUFFER_RAW_info,0);
1212
1213         return offset;
1214 }
1215
1216 static int
1217 krb5pac_dissect_element_PAC_BUFFER_RAW__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1218 {
1219         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_BUFFER_RAW__pad, 0);
1220
1221         return offset;
1222 }
1223
1224 int
1225 krb5pac_dissect_struct_PAC_BUFFER_RAW(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1226 {
1227         proto_item *item = NULL;
1228         proto_tree *tree = NULL;
1229         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1230         int old_offset;
1231
1232         ALIGN_TO_5_BYTES;
1233
1234         old_offset = offset;
1235
1236         if (parent_tree) {
1237                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1238                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_BUFFER_RAW);
1239         }
1240         
1241         offset = krb5pac_dissect_element_PAC_BUFFER_RAW_type(tvb, offset, pinfo, tree, drep);
1242
1243         offset = krb5pac_dissect_element_PAC_BUFFER_RAW_ndr_size(tvb, offset, pinfo, tree, drep);
1244
1245         offset = krb5pac_dissect_element_PAC_BUFFER_RAW_info(tvb, offset, pinfo, tree, drep);
1246
1247         offset = krb5pac_dissect_element_PAC_BUFFER_RAW__pad(tvb, offset, pinfo, tree, drep);
1248
1249
1250         proto_item_set_len(item, offset-old_offset);
1251
1252
1253         if (di->call_data->flags & DCERPC_IS_NDR64) {
1254                 ALIGN_TO_5_BYTES;
1255         }
1256
1257         return offset;
1258 }
1259
1260
1261 /* IDL: struct { */
1262 /* IDL:         uint32 num_buffers; */
1263 /* IDL:         uint32 version; */
1264 /* IDL:         PAC_BUFFER_RAW buffers[num_buffers]; */
1265 /* IDL: } */
1266
1267 static int
1268 krb5pac_dissect_element_PAC_DATA_RAW_num_buffers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1269 {
1270         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_DATA_RAW_num_buffers, 0);
1271
1272         return offset;
1273 }
1274
1275 static int
1276 krb5pac_dissect_element_PAC_DATA_RAW_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1277 {
1278         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_DATA_RAW_version, 0);
1279
1280         return offset;
1281 }
1282
1283 static int
1284 krb5pac_dissect_element_PAC_DATA_RAW_buffers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1285 {
1286
1287         return offset;
1288 }
1289
1290 static int
1291 krb5pac_dissect_element_PAC_DATA_RAW_buffers_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1292 {
1293         offset = krb5pac_dissect_struct_PAC_BUFFER_RAW(tvb,offset,pinfo,tree,drep,hf_krb5pac_PAC_DATA_RAW_buffers,0);
1294
1295         return offset;
1296 }
1297
1298 int
1299 krb5pac_dissect_struct_PAC_DATA_RAW(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1300 {
1301         proto_item *item = NULL;
1302         proto_tree *tree = NULL;
1303         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1304         int old_offset;
1305
1306         ALIGN_TO_5_BYTES;
1307
1308         old_offset = offset;
1309
1310         if (parent_tree) {
1311                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1312                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_DATA_RAW);
1313         }
1314         
1315         offset = krb5pac_dissect_element_PAC_DATA_RAW_num_buffers(tvb, offset, pinfo, tree, drep);
1316
1317         offset = krb5pac_dissect_element_PAC_DATA_RAW_version(tvb, offset, pinfo, tree, drep);
1318
1319         offset = krb5pac_dissect_element_PAC_DATA_RAW_buffers(tvb, offset, pinfo, tree, drep);
1320
1321
1322         proto_item_set_len(item, offset-old_offset);
1323
1324
1325         if (di->call_data->flags & DCERPC_IS_NDR64) {
1326                 ALIGN_TO_5_BYTES;
1327         }
1328
1329         return offset;
1330 }
1331
1332
1333 /* IDL: struct { */
1334 /* IDL:         [value(NETLOGON_GENERIC_KRB5_PAC_VALIDATE)] uint32 MessageType; */
1335 /* IDL:         uint32 ChecksumLength; */
1336 /* IDL:         int32 SignatureType; */
1337 /* IDL:         uint32 SignatureLength; */
1338 /* IDL:         [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB ChecksumAndSignature; */
1339 /* IDL: } */
1340
1341 static int
1342 krb5pac_dissect_element_PAC_Validate_MessageType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1343 {
1344         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_Validate_MessageType, 0);
1345
1346         return offset;
1347 }
1348
1349 static int
1350 krb5pac_dissect_element_PAC_Validate_ChecksumLength(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1351 {
1352         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_Validate_ChecksumLength, 0);
1353
1354         return offset;
1355 }
1356
1357 static int
1358 krb5pac_dissect_element_PAC_Validate_SignatureType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1359 {
1360         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_Validate_SignatureType, 0);
1361
1362         return offset;
1363 }
1364
1365 static int
1366 krb5pac_dissect_element_PAC_Validate_SignatureLength(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1367 {
1368         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_Validate_SignatureLength, 0);
1369
1370         return offset;
1371 }
1372
1373 static int
1374 krb5pac_dissect_element_PAC_Validate_ChecksumAndSignature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1375 {
1376         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_krb5pac_PAC_Validate_ChecksumAndSignature, 1);
1377
1378         return offset;
1379 }
1380
1381 int
1382 krb5pac_dissect_struct_PAC_Validate(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1383 {
1384         proto_item *item = NULL;
1385         proto_tree *tree = NULL;
1386         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1387         int old_offset;
1388
1389         ALIGN_TO_4_BYTES;
1390
1391         old_offset = offset;
1392
1393         if (parent_tree) {
1394                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1395                 tree = proto_item_add_subtree(item, ett_krb5pac_PAC_Validate);
1396         }
1397         
1398         offset = krb5pac_dissect_element_PAC_Validate_MessageType(tvb, offset, pinfo, tree, drep);
1399
1400         offset = krb5pac_dissect_element_PAC_Validate_ChecksumLength(tvb, offset, pinfo, tree, drep);
1401
1402         offset = krb5pac_dissect_element_PAC_Validate_SignatureType(tvb, offset, pinfo, tree, drep);
1403
1404         offset = krb5pac_dissect_element_PAC_Validate_SignatureLength(tvb, offset, pinfo, tree, drep);
1405
1406         offset = krb5pac_dissect_element_PAC_Validate_ChecksumAndSignature(tvb, offset, pinfo, tree, drep);
1407
1408
1409         proto_item_set_len(item, offset-old_offset);
1410
1411
1412         if (di->call_data->flags & DCERPC_IS_NDR64) {
1413                 ALIGN_TO_4_BYTES;
1414         }
1415
1416         return offset;
1417 }
1418
1419
1420 /* IDL: struct { */
1421 /* IDL:         time_t timestamp; */
1422 /* IDL:         netr_SamInfo3 info3; */
1423 /* IDL: } */
1424
1425 static int
1426 krb5pac_dissect_element_netsamlogoncache_entry_timestamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1427 {
1428         offset = dissect_ndr_time_t(tvb, offset, pinfo,tree, drep, hf_krb5pac_netsamlogoncache_entry_timestamp, NULL);
1429
1430         return offset;
1431 }
1432
1433 static int
1434 krb5pac_dissect_element_netsamlogoncache_entry_info3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1435 {
1436         offset = krb5pac_dissect_struct_netr_SamInfo3(tvb,offset,pinfo,tree,drep,hf_krb5pac_netsamlogoncache_entry_info3,0);
1437
1438         return offset;
1439 }
1440
1441 int
1442 krb5pac_dissect_struct_netsamlogoncache_entry(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1443 {
1444         proto_item *item = NULL;
1445         proto_tree *tree = NULL;
1446         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1447         int old_offset;
1448
1449         ALIGN_TO_5_BYTES;
1450
1451         old_offset = offset;
1452
1453         if (parent_tree) {
1454                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1455                 tree = proto_item_add_subtree(item, ett_krb5pac_netsamlogoncache_entry);
1456         }
1457         
1458         offset = krb5pac_dissect_element_netsamlogoncache_entry_timestamp(tvb, offset, pinfo, tree, drep);
1459
1460         offset = krb5pac_dissect_element_netsamlogoncache_entry_info3(tvb, offset, pinfo, tree, drep);
1461
1462
1463         proto_item_set_len(item, offset-old_offset);
1464
1465
1466         if (di->call_data->flags & DCERPC_IS_NDR64) {
1467                 ALIGN_TO_5_BYTES;
1468         }
1469
1470         return offset;
1471 }
1472
1473 static int
1474 krb5pac_dissect_element_decode_pac_pac(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1475 {
1476         offset = krb5pac_dissect_struct_PAC_DATA(tvb,offset,pinfo,tree,drep,hf_krb5pac_decode_pac_pac,0);
1477
1478         return offset;
1479 }
1480
1481 /* IDL: void decode_pac( */
1482 /* IDL: [in] PAC_DATA pac */
1483 /* IDL: ); */
1484
1485 static int
1486 krb5pac_dissect_decode_pac_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1487 {
1488         pinfo->dcerpc_procedure_name="decode_pac";
1489         return offset;
1490 }
1491
1492 static int
1493 krb5pac_dissect_decode_pac_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1494 {
1495         pinfo->dcerpc_procedure_name="decode_pac";
1496         offset = krb5pac_dissect_element_decode_pac_pac(tvb, offset, pinfo, tree, drep);
1497         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1498         return offset;
1499 }
1500
1501 static int
1502 krb5pac_dissect_element_decode_pac_raw_pac(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1503 {
1504         offset = krb5pac_dissect_struct_PAC_DATA_RAW(tvb,offset,pinfo,tree,drep,hf_krb5pac_decode_pac_raw_pac,0);
1505
1506         return offset;
1507 }
1508
1509 /* IDL: void decode_pac_raw( */
1510 /* IDL: [in] PAC_DATA_RAW pac */
1511 /* IDL: ); */
1512
1513 static int
1514 krb5pac_dissect_decode_pac_raw_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1515 {
1516         pinfo->dcerpc_procedure_name="decode_pac_raw";
1517         return offset;
1518 }
1519
1520 static int
1521 krb5pac_dissect_decode_pac_raw_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1522 {
1523         pinfo->dcerpc_procedure_name="decode_pac_raw";
1524         offset = krb5pac_dissect_element_decode_pac_raw_pac(tvb, offset, pinfo, tree, drep);
1525         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1526         return offset;
1527 }
1528
1529 static int
1530 krb5pac_dissect_element_decode_login_info_logon_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1531 {
1532         offset = krb5pac_dissect_struct_PAC_LOGON_INFO(tvb,offset,pinfo,tree,drep,hf_krb5pac_decode_login_info_logon_info,0);
1533
1534         return offset;
1535 }
1536
1537 /* IDL: void decode_login_info( */
1538 /* IDL: [in] PAC_LOGON_INFO logon_info */
1539 /* IDL: ); */
1540
1541 static int
1542 krb5pac_dissect_decode_login_info_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1543 {
1544         pinfo->dcerpc_procedure_name="decode_login_info";
1545         return offset;
1546 }
1547
1548 static int
1549 krb5pac_dissect_decode_login_info_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1550 {
1551         pinfo->dcerpc_procedure_name="decode_login_info";
1552         offset = krb5pac_dissect_element_decode_login_info_logon_info(tvb, offset, pinfo, tree, drep);
1553         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1554         return offset;
1555 }
1556
1557 static int
1558 krb5pac_dissect_element_decode_login_info_ctr_logon_info_ctr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1559 {
1560         offset = krb5pac_dissect_struct_PAC_LOGON_INFO_CTR(tvb,offset,pinfo,tree,drep,hf_krb5pac_decode_login_info_ctr_logon_info_ctr,0);
1561
1562         return offset;
1563 }
1564
1565 /* IDL: void decode_login_info_ctr( */
1566 /* IDL: [in] PAC_LOGON_INFO_CTR logon_info_ctr */
1567 /* IDL: ); */
1568
1569 static int
1570 krb5pac_dissect_decode_login_info_ctr_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1571 {
1572         pinfo->dcerpc_procedure_name="decode_login_info_ctr";
1573         return offset;
1574 }
1575
1576 static int
1577 krb5pac_dissect_decode_login_info_ctr_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1578 {
1579         pinfo->dcerpc_procedure_name="decode_login_info_ctr";
1580         offset = krb5pac_dissect_element_decode_login_info_ctr_logon_info_ctr(tvb, offset, pinfo, tree, drep);
1581         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1582         return offset;
1583 }
1584
1585 static int
1586 krb5pac_dissect_element_decode_pac_validate_pac_validate(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1587 {
1588         offset = krb5pac_dissect_struct_PAC_Validate(tvb,offset,pinfo,tree,drep,hf_krb5pac_decode_pac_validate_pac_validate,0);
1589
1590         return offset;
1591 }
1592
1593 /* IDL: void decode_pac_validate( */
1594 /* IDL: [in] PAC_Validate pac_validate */
1595 /* IDL: ); */
1596
1597 static int
1598 krb5pac_dissect_decode_pac_validate_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1599 {
1600         pinfo->dcerpc_procedure_name="decode_pac_validate";
1601         return offset;
1602 }
1603
1604 static int
1605 krb5pac_dissect_decode_pac_validate_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1606 {
1607         pinfo->dcerpc_procedure_name="decode_pac_validate";
1608         offset = krb5pac_dissect_element_decode_pac_validate_pac_validate(tvb, offset, pinfo, tree, drep);
1609         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
1610         return offset;
1611 }
1612
1613
1614 static dcerpc_sub_dissector krb5pac_dissectors[] = {
1615         { 0, "decode_pac",
1616            krb5pac_dissect_decode_pac_request, krb5pac_dissect_decode_pac_response},
1617         { 1, "decode_pac_raw",
1618            krb5pac_dissect_decode_pac_raw_request, krb5pac_dissect_decode_pac_raw_response},
1619         { 2, "decode_login_info",
1620            krb5pac_dissect_decode_login_info_request, krb5pac_dissect_decode_login_info_response},
1621         { 3, "decode_login_info_ctr",
1622            krb5pac_dissect_decode_login_info_ctr_request, krb5pac_dissect_decode_login_info_ctr_response},
1623         { 4, "decode_pac_validate",
1624            krb5pac_dissect_decode_pac_validate_request, krb5pac_dissect_decode_pac_validate_response},
1625         { 0, NULL, NULL, NULL }
1626 };
1627
1628 void proto_register_dcerpc_krb5pac(void)
1629 {
1630         static hf_register_info hf[] = {
1631         { &hf_krb5pac_PAC_LOGON_INFO_res_group_dom_sid,
1632           { "Res Group Dom Sid", "krb5pac.PAC_LOGON_INFO.res_group_dom_sid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1633         { &hf_krb5pac_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation_,
1634           { "Subcontext length", "krb5pac.PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1635         { &hf_krb5pac_PAC_LOGON_INFO_info3,
1636           { "Info3", "krb5pac.PAC_LOGON_INFO.info3", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1637         { &hf_krb5pac_PAC_Validate_MessageType,
1638           { "Messagetype", "krb5pac.PAC_Validate.MessageType", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1639         { &hf_krb5pac_PAC_UNKNOWN_12_upn_name,
1640           { "Upn Name", "krb5pac.PAC_UNKNOWN_12.upn_name", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1641         { &hf_krb5pac_PAC_INFO_valPAC_TYPE_KDC_CHECKSUM_kdc_cksum,
1642           { "Kdc Cksum", "krb5pac.PAC_INFO_valPAC_TYPE_KDC_CHECKSUM.kdc_cksum", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1643         { &hf_krb5pac_PAC_UNKNOWN_12_domain_size,
1644           { "Domain Size", "krb5pac.PAC_UNKNOWN_12.domain_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1645         { &hf_krb5pac_PAC_BUFFER__pad,
1646           { " Pad", "krb5pac.PAC_BUFFER._pad", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1647         { &hf_krb5pac_PAC_UNKNOWN_12_domain_name,
1648           { "Domain Name", "krb5pac.PAC_UNKNOWN_12.domain_name", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1649         { &hf_krb5pac_PAC_UNKNOWN_12_domain_offset,
1650           { "Domain Offset", "krb5pac.PAC_UNKNOWN_12.domain_offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1651         { &hf_krb5pac_PAC_SIGNATURE_DATA_signature,
1652           { "Signature", "krb5pac.PAC_SIGNATURE_DATA.signature", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1653         { &hf_krb5pac_PAC_UNKNOWN_12_upn_size,
1654           { "Upn Size", "krb5pac.PAC_UNKNOWN_12.upn_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1655         { &hf_krb5pac_PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION_constrained_delegation,
1656           { "Constrained Delegation", "krb5pac.PAC_INFO_valPAC_TYPE_CONSTRAINED_DELEGATION.constrained_delegation", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1657         { &hf_krb5pac_opnum,
1658           { "Operation", "krb5pac.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1659         { &hf_krb5pac_PAC_LOGON_NAME_size,
1660           { "Size", "krb5pac.PAC_LOGON_NAME.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1661         { &hf_krb5pac_decode_login_info_logon_info,
1662           { "Logon Info", "krb5pac.decode_login_info.logon_info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1663         { &hf_krb5pac_decode_pac_validate_pac_validate,
1664           { "Pac Validate", "krb5pac.decode_pac_validate.pac_validate", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1665         { &hf_krb5pac_PAC_DATA_buffers,
1666           { "Buffers", "krb5pac.PAC_DATA.buffers", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1667         { &hf_krb5pac_PAC_BUFFER_info_,
1668           { "Subcontext length", "krb5pac.PAC_BUFFER.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1669         { &hf_krb5pac_PAC_DATA_RAW_version,
1670           { "Version", "krb5pac.PAC_DATA_RAW.version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1671         { &hf_krb5pac_PAC_BUFFER_RAW_ndr_size,
1672           { "Ndr Size", "krb5pac.PAC_BUFFER_RAW.ndr_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1673         { &hf_krb5pac_PAC_CONSTRAINED_DELEGATION_num_transited_services,
1674           { "Num Transited Services", "krb5pac.PAC_CONSTRAINED_DELEGATION.num_transited_services", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1675         { &hf_krb5pac_PAC_CONSTRAINED_DELEGATION_transited_services,
1676           { "Transited Services", "krb5pac.PAC_CONSTRAINED_DELEGATION.transited_services", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1677         { &hf_krb5pac_PAC_BUFFER_type,
1678           { "Type", "krb5pac.PAC_BUFFER.type", FT_UINT32, BASE_DEC, VALS(krb5pac_PAC_TYPE_vals), 0, NULL, HFILL }},
1679         { &hf_krb5pac_PAC_CONSTRAINED_DELEGATION_proxy_target,
1680           { "Proxy Target", "krb5pac.PAC_CONSTRAINED_DELEGATION.proxy_target", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1681         { &hf_krb5pac_PAC_UNKNOWN_12_unknown6,
1682           { "Unknown6", "krb5pac.PAC_UNKNOWN_12.unknown6", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1683         { &hf_krb5pac_PAC_UNKNOWN_12_unknown5,
1684           { "Unknown5", "krb5pac.PAC_UNKNOWN_12.unknown5", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1685         { &hf_krb5pac_PAC_INFO_valdefault_unknown_,
1686           { "Subcontext length", "krb5pac.PAC_INFO_valdefault.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1687         { &hf_krb5pac_PAC_LOGON_NAME_logon_time,
1688           { "Logon Time", "krb5pac.PAC_LOGON_NAME.logon_time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }},
1689         { &hf_krb5pac_decode_pac_raw_pac,
1690           { "Pac", "krb5pac.decode_pac_raw.pac", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1691         { &hf_krb5pac_PAC_BUFFER__ndr_size,
1692           { " Ndr Size", "krb5pac.PAC_BUFFER._ndr_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1693         { &hf_krb5pac_PAC_LOGON_INFO_res_groups,
1694           { "Res Groups", "krb5pac.PAC_LOGON_INFO.res_groups", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1695         { &hf_krb5pac_PAC_UNKNOWN_12_unknown3,
1696           { "Unknown3", "krb5pac.PAC_UNKNOWN_12.unknown3", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1697         { &hf_krb5pac_PAC_UNKNOWN_12_upn_offset,
1698           { "Upn Offset", "krb5pac.PAC_UNKNOWN_12.upn_offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1699         { &hf_krb5pac_PAC_Validate_ChecksumAndSignature,
1700           { "Checksumandsignature", "krb5pac.PAC_Validate.ChecksumAndSignature", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1701         { &hf_krb5pac_decode_login_info_ctr_logon_info_ctr,
1702           { "Logon Info Ctr", "krb5pac.decode_login_info_ctr.logon_info_ctr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1703         { &hf_krb5pac_PAC_INFO_valdefault_unknown,
1704           { "Unknown", "krb5pac.PAC_INFO_valdefault.unknown", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1705         { &hf_krb5pac_PAC_CONSTRAINED_DELEGATION_CTR_info,
1706           { "Info", "krb5pac.PAC_CONSTRAINED_DELEGATION_CTR.info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1707         { &hf_krb5pac_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info_,
1708           { "Subcontext length", "krb5pac.PAC_INFO_valPAC_TYPE_LOGON_INFO.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1709         { &hf_krb5pac_PAC_BUFFER_info,
1710           { "Info", "krb5pac.PAC_BUFFER.info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1711         { &hf_krb5pac_netsamlogoncache_entry_info3,
1712           { "Info3", "krb5pac.netsamlogoncache_entry.info3", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1713         { &hf_krb5pac_PAC_Validate_SignatureType,
1714           { "Signaturetype", "krb5pac.PAC_Validate.SignatureType", FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1715         { &hf_krb5pac_PAC_DATA_num_buffers,
1716           { "Num Buffers", "krb5pac.PAC_DATA.num_buffers", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1717         { &hf_krb5pac_PAC_BUFFER_RAW__pad,
1718           { " Pad", "krb5pac.PAC_BUFFER_RAW._pad", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1719         { &hf_krb5pac_PAC_BUFFER_RAW_info,
1720           { "Info", "krb5pac.PAC_BUFFER_RAW.info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1721         { &hf_krb5pac_PAC_INFO_valPAC_TYPE_SRV_CHECKSUM_srv_cksum,
1722           { "Srv Cksum", "krb5pac.PAC_INFO_valPAC_TYPE_SRV_CHECKSUM.srv_cksum", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1723         { &hf_krb5pac_PAC_INFO_valPAC_TYPE_LOGON_NAME_logon_name,
1724           { "Logon Name", "krb5pac.PAC_INFO_valPAC_TYPE_LOGON_NAME.logon_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1725         { &hf_krb5pac_PAC_LOGON_NAME_account_name,
1726           { "Account Name", "krb5pac.PAC_LOGON_NAME.account_name", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1727         { &hf_krb5pac_PAC_Validate_ChecksumLength,
1728           { "Checksumlength", "krb5pac.PAC_Validate.ChecksumLength", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1729         { &hf_krb5pac_PAC_UNKNOWN_12_unknown4,
1730           { "Unknown4", "krb5pac.PAC_UNKNOWN_12.unknown4", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1731         { &hf_krb5pac_netsamlogoncache_entry_timestamp,
1732           { "Timestamp", "krb5pac.netsamlogoncache_entry.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }},
1733         { &hf_krb5pac_PAC_DATA_RAW_buffers,
1734           { "Buffers", "krb5pac.PAC_DATA_RAW.buffers", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1735         { &hf_krb5pac_PAC_SIGNATURE_DATA_type,
1736           { "Type", "krb5pac.PAC_SIGNATURE_DATA.type", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1737         { &hf_krb5pac_PAC_INFO_valPAC_TYPE_LOGON_INFO_logon_info,
1738           { "Logon Info", "krb5pac.PAC_INFO_valPAC_TYPE_LOGON_INFO.logon_info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1739         { &hf_krb5pac_decode_pac_pac,
1740           { "Pac", "krb5pac.decode_pac.pac", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1741         { &hf_krb5pac_PAC_Validate_SignatureLength,
1742           { "Signaturelength", "krb5pac.PAC_Validate.SignatureLength", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1743         { &hf_krb5pac_PAC_DATA_RAW_num_buffers,
1744           { "Num Buffers", "krb5pac.PAC_DATA_RAW.num_buffers", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1745         { &hf_krb5pac_PAC_BUFFER_RAW_info_,
1746           { "Subcontext length", "krb5pac.PAC_BUFFER_RAW.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
1747         { &hf_krb5pac_PAC_BUFFER_RAW_type,
1748           { "Type", "krb5pac.PAC_BUFFER_RAW.type", FT_UINT32, BASE_DEC, VALS(krb5pac_PAC_TYPE_vals), 0, NULL, HFILL }},
1749         { &hf_krb5pac_PAC_LOGON_INFO_CTR_info,
1750           { "Info", "krb5pac.PAC_LOGON_INFO_CTR.info", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1751         { &hf_krb5pac_PAC_DATA_version,
1752           { "Version", "krb5pac.PAC_DATA.version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
1753         { &hf_krb5pac_DATA_BLOB_REM_remaining,
1754           { "Remaining", "krb5pac.DATA_BLOB_REM.remaining", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
1755         };
1756
1757
1758         static gint *ett[] = {
1759                 &ett_dcerpc_krb5pac,
1760                 &ett_krb5pac_PAC_LOGON_NAME,
1761                 &ett_krb5pac_PAC_SIGNATURE_DATA,
1762                 &ett_krb5pac_PAC_LOGON_INFO,
1763                 &ett_krb5pac_PAC_CONSTRAINED_DELEGATION,
1764                 &ett_krb5pac_PAC_UNKNOWN_12,
1765                 &ett_krb5pac_PAC_LOGON_INFO_CTR,
1766                 &ett_krb5pac_PAC_CONSTRAINED_DELEGATION_CTR,
1767                 &ett_krb5pac_DATA_BLOB_REM,
1768                 &ett_krb5pac_PAC_INFO,
1769                 &ett_krb5pac_PAC_BUFFER,
1770                 &ett_krb5pac_PAC_DATA,
1771                 &ett_krb5pac_PAC_BUFFER_RAW,
1772                 &ett_krb5pac_PAC_DATA_RAW,
1773                 &ett_krb5pac_PAC_Validate,
1774                 &ett_krb5pac_netsamlogoncache_entry,
1775         };
1776
1777         proto_dcerpc_krb5pac = proto_register_protocol("Active Directory KRB5 PAC", "KRB5PAC", "krb5pac");
1778         proto_register_field_array(proto_dcerpc_krb5pac, hf, array_length (hf));
1779         proto_register_subtree_array(ett, array_length(ett));
1780 }
1781
1782 void proto_reg_handoff_dcerpc_krb5pac(void)
1783 {
1784         dcerpc_init_uuid(proto_dcerpc_krb5pac, ett_dcerpc_krb5pac,
1785                 &uuid_dcerpc_krb5pac, ver_dcerpc_krb5pac,
1786                 krb5pac_dissectors, hf_krb5pac_opnum);
1787 }