git add -f bin/default/librpc/gen_ndr/*.{c,h,ndr,pidl} bin/default/source*/librpc...
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / s3compat_security.c
1 #include "includes.h"
2 #include "ntdomain.h"
3 #include "bin/default/librpc/gen_ndr/s3compat_security.h"
4
5 struct _s3_compat_decode_security_descriptor_state {
6         struct tevent_context *ev;
7         struct dcerpc_call_handle *call;
8         struct decode_security_descriptor *r;
9 };
10
11 static struct tevent_req *_s3_compat_decode_security_descriptor_send(TALLOC_CTX *mem_ctx,
12                                         struct tevent_context *ev,
13                                         struct dcerpc_call_handle *call,
14                                         struct decode_security_descriptor *r)
15 {
16         struct tevent_req *req
17         struct _s3_compat_decode_security_descriptor_state *state;
18         struct pipes_struct *p;
19
20         req = tevent_req_create(mem_ctx, &state,
21                                 struct _s3_compat_decode_security_descriptor_state);
22         if (req == NULL) {
23                 return NULL;
24         }
25         state->ev = ev;
26         state->call = call;
27         state->r = r;
28
29         p = dcerpc_call_handle_get_pipes_struct(call);
30
31         _decode_security_descriptor(p, r);
32
33         if (p->fault_state) {
34                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
35                 tevent_req_nterror(status);
36                 return tevent_req_post(req, ev);
37         }
38
39         tevent_req_done(req);
40         return tevent_req_post(req, ev);
41 }
42
43 static NTSTATUS _s3_compat_decode_security_descriptor_recv(struct tevent_req *req)
44 {
45         return tevent_req_simple_recv_ntstatus(req);
46 }
47
48 struct _s3_compat_decode_sec_desc_buf_state {
49         struct tevent_context *ev;
50         struct dcerpc_call_handle *call;
51         struct decode_sec_desc_buf *r;
52 };
53
54 static struct tevent_req *_s3_compat_decode_sec_desc_buf_send(TALLOC_CTX *mem_ctx,
55                                         struct tevent_context *ev,
56                                         struct dcerpc_call_handle *call,
57                                         struct decode_sec_desc_buf *r)
58 {
59         struct tevent_req *req
60         struct _s3_compat_decode_sec_desc_buf_state *state;
61         struct pipes_struct *p;
62
63         req = tevent_req_create(mem_ctx, &state,
64                                 struct _s3_compat_decode_sec_desc_buf_state);
65         if (req == NULL) {
66                 return NULL;
67         }
68         state->ev = ev;
69         state->call = call;
70         state->r = r;
71
72         p = dcerpc_call_handle_get_pipes_struct(call);
73
74         _decode_sec_desc_buf(p, r);
75
76         if (p->fault_state) {
77                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
78                 tevent_req_nterror(status);
79                 return tevent_req_post(req, ev);
80         }
81
82         tevent_req_done(req);
83         return tevent_req_post(req, ev);
84 }
85
86 static NTSTATUS _s3_compat_decode_sec_desc_buf_recv(struct tevent_req *req)
87 {
88         return tevent_req_simple_recv_ntstatus(req);
89 }
90
91 struct _s3_compat_decode_security_token_state {
92         struct tevent_context *ev;
93         struct dcerpc_call_handle *call;
94         struct decode_security_token *r;
95 };
96
97 static struct tevent_req *_s3_compat_decode_security_token_send(TALLOC_CTX *mem_ctx,
98                                         struct tevent_context *ev,
99                                         struct dcerpc_call_handle *call,
100                                         struct decode_security_token *r)
101 {
102         struct tevent_req *req
103         struct _s3_compat_decode_security_token_state *state;
104         struct pipes_struct *p;
105
106         req = tevent_req_create(mem_ctx, &state,
107                                 struct _s3_compat_decode_security_token_state);
108         if (req == NULL) {
109                 return NULL;
110         }
111         state->ev = ev;
112         state->call = call;
113         state->r = r;
114
115         p = dcerpc_call_handle_get_pipes_struct(call);
116
117         _decode_security_token(p, r);
118
119         if (p->fault_state) {
120                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
121                 tevent_req_nterror(status);
122                 return tevent_req_post(req, ev);
123         }
124
125         tevent_req_done(req);
126         return tevent_req_post(req, ev);
127 }
128
129 static NTSTATUS _s3_compat_decode_security_token_recv(struct tevent_req *req)
130 {
131         return tevent_req_simple_recv_ntstatus(req);
132 }
133
134 struct _s3_compat_decode_security_unix_token_state {
135         struct tevent_context *ev;
136         struct dcerpc_call_handle *call;
137         struct decode_security_unix_token *r;
138 };
139
140 static struct tevent_req *_s3_compat_decode_security_unix_token_send(TALLOC_CTX *mem_ctx,
141                                         struct tevent_context *ev,
142                                         struct dcerpc_call_handle *call,
143                                         struct decode_security_unix_token *r)
144 {
145         struct tevent_req *req
146         struct _s3_compat_decode_security_unix_token_state *state;
147         struct pipes_struct *p;
148
149         req = tevent_req_create(mem_ctx, &state,
150                                 struct _s3_compat_decode_security_unix_token_state);
151         if (req == NULL) {
152                 return NULL;
153         }
154         state->ev = ev;
155         state->call = call;
156         state->r = r;
157
158         p = dcerpc_call_handle_get_pipes_struct(call);
159
160         _decode_security_unix_token(p, r);
161
162         if (p->fault_state) {
163                 NTSTATUS status = dcerpc_fault_to_nt_status(p->fault_state);
164                 tevent_req_nterror(status);
165                 return tevent_req_post(req, ev);
166         }
167
168         tevent_req_done(req);
169         return tevent_req_post(req, ev);
170 }
171
172 static NTSTATUS _s3_compat_decode_security_unix_token_recv(struct tevent_req *req)
173 {
174         return tevent_req_simple_recv_ntstatus(req);
175 }
176
177
178 static const struct dcerpc_call_entry_point_fns struct _s3_compat_security_fns[] = {
179         {
180                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
181                         _s3_compat_decode_security_descriptor_send,
182                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
183                         _s3_compat_decode_security_descriptor_recv,
184         },
185         {
186                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
187                         _s3_compat_decode_sec_desc_buf_send,
188                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
189                         _s3_compat_decode_sec_desc_buf_recv,
190         },
191         {
192                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
193                         _s3_compat_decode_security_token_send,
194                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
195                         _s3_compat_decode_security_token_recv,
196         },
197         {
198                 .send_fn = (dcerpc_call_entry_point_send_fn_t)
199                         _s3_compat_decode_security_unix_token_send,
200                 .recv_fn = (dcerpc_call_entry_point_recv_fn_t)
201                         _s3_compat_decode_security_unix_token_recv,
202         },
203         {
204                 .send_fn = NULL,
205                 .recv_fn = NULL,
206         },
207 };
208
209 static const struct dcerpc_call_entry_point_vector _s3_compat_security_epv[] = {
210         .name = "_s3_compat_security",
211         .table = &ndr_table_security,
212         .num_fns = 4,
213         .fns = _s3_compat_security_fns,
214 };
215
216 NTSTATUS dcerpc_server_setup_s3compat_security(struct dcerpc_server *server)
217 {
218         return NT_STATUS_NOT_IMPLEMENTED;
219 }