Gateway.xs

filter: Statementstmt 60.8% 191 / 314 Branchbran 37.9% 41 / 108 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 54.9% 232 / 422 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« pack_search_reference_response.c ↑ Summary scan_search_request.c »
1 /* -*- Mode: C -*- */
2  
3 #include "common.h"
4  
5 #include "enums.h"
6 #include "asn1.h"
7 #include "scan.h"
8 #include "pack.h"
9 #include "ldap.h"
10 #include "enum2sv.h"
11  
12 typedef AV AV_opt;
13 typedef HV HV_opt;
14  
15 #define RESERVE_HEAD 20
16  
17 static SV *
18 19 new_message_sv(void) {
19 19 SV *sv = sv_2mortal(newSV(2048));
20 19 SvPOK_on(sv);
21 19 return sv;
22 }
23  
24 static STRLEN
25 19 start_ldap_message(SV *dest, U32 msgid) {
26 19 start_sequence(dest);
27 19 pack_int(dest, msgid);
28 19 }
29  
30 static void
31 19 end_ldap_message(SV *dest) {
32 19 end_sequence(dest, 1);
33 19 }
34  
35 static void
36 19 ldap_pack_message_ref(SV *dest, U32 op, HV *data, SV *controls) {
37 19 switch (op) {
38 1 case LDAP_OP_BIND_REQUEST:
39 1 pack_bind_request_ref(dest, data);
40 1 break;
41 1 case LDAP_OP_BIND_RESPONSE:
42 1 pack_bind_response_ref(dest, data);
43 1 break;
44 1 case LDAP_OP_UNBIND_REQUEST:
45 1 pack_unbind_request_ref(dest, data);
46 1 break;
47 3 case LDAP_OP_SEARCH_REQUEST:
48 3 pack_search_request_ref(dest, data);
49 3 break;
50 1 case LDAP_OP_ADD_REQUEST:
51 1 pack_add_request_ref(dest, data);
52 1 break;
53 1 case LDAP_OP_SEARCH_ENTRY_RESPONSE:
54 1 pack_search_entry_response_ref(dest, data);
55 1 break;
56 1 case LDAP_OP_SEARCH_REFERENCE_RESPONSE:
57 1 pack_search_reference_response_ref(dest, data);
58 1 break;
59 2 case LDAP_OP_MODIFY_REQUEST:
60 2 pack_modify_request_ref(dest, data);
61 2 break;
62 1 case LDAP_OP_DELETE_REQUEST:
63 1 pack_delete_request_ref(dest, data);
64 1 break;
65 1 case LDAP_OP_MODIFY_DN_REQUEST:
66 1 pack_modify_dn_request_ref(dest, data);
67 1 break;
68 1 case LDAP_OP_COMPARE_REQUEST:
69 1 pack_compare_request_ref(dest, data);
70 1 break;
71 2 case LDAP_OP_ABANDON_REQUEST:
72 2 pack_abandon_request_ref(dest, data);
73 2 break;
74 1 case LDAP_OP_EXTENDED_REQUEST:
75 1 pack_extended_request_ref(dest, data);
76 1 break;
77 1 case LDAP_OP_EXTENDED_RESPONSE:
78 1 pack_extended_response_ref(dest, data);
79 1 break;
80 0 case LDAP_OP_INTERMEDIATE_RESPONSE:
81 0 pack_intermediate_response_ref(dest, data);
82 0 break;
83 1 case LDAP_OP_SEARCH_DONE_RESPONSE:
84 case LDAP_OP_MODIFY_RESPONSE:
85 case LDAP_OP_ADD_RESPONSE:
86 case LDAP_OP_DELETE_RESPONSE:
87 case LDAP_OP_MODIFY_DN_RESPONSE:
88 1 pack_result_response_ref(dest, op, data);
89 1 break;
90 0 default:
91 0 croak("unsupported operation %u", (unsigned int)op);
92 break;
93 }
94 19 pack_controls(dest, controls);
95 19 }
96  
97 MODULE = Net::LDAP::Gateway PACKAGE = Net::LDAP::Gateway
98  
99 BOOT:
100 2 init_constants();
101  
102 SV *
103 ldap_dn_normalize(dn)
104 SV * dn
105 CODE:
106 0 RETVAL = dn_normalize(dn);
107 OUTPUT:
108 RETVAL
109  
110 SV *
111 ldap_peek_message(buffer)
112 SV *buffer
113 PPCODE:
114 {
115 19 int n = 0;
116 STRLEN bytes, request_len, src_len;
117 const char *start, *src, *max;
118 19 sv_utf8_downgrade(buffer, 0);
119 19 start = src = SvPV(buffer, src_len);
120 19 max = start + src_len;
121 19 ▶ if (peek_sequence(&src, max, &request_len)) {
Branch: 4 branches
BranchTrueFalseTotal
if (peek_sequence(&src, max, &request_len)) { 19 0 19
if (peek_sequence(&src, max, &request_len)) { 0 19 19
if (peek_sequence(&src, max, &request_len)) { 19 0 19
if (peek_sequence(&src, max, &request_len)) { 19 0 19
122 19 ▶ mXPUSHu((src - start) + request_len);
Branch: 1 branch
BranchTrueFalseTotal
mXPUSHu((src - start) + request_len); 0 19 19
123 19 n++;
124 19 ▶ if (GIMME_V == G_ARRAY) {
Branch: 1 branch
BranchTrueFalseTotal
if (GIMME_V == G_ARRAY) { 19 0 19
125 U32 msgid;
126 19 ▶ if (peek_unsigned_numeric(&src, max, &msgid)) {
Branch: 1 branch
BranchTrueFalseTotal
if (peek_unsigned_numeric(&src, max, &msgid)) { 19 0 19
127 U8 type;
128 U32 op;
129 STRLEN len;
130 19 ▶ mXPUSHu(msgid);
Branch: 1 branch
BranchTrueFalseTotal
mXPUSHu(msgid); 0 19 19
131 19 n++;
132 19 ▶ if (peek_tag(&src, max, &type, &op)) {
Branch: 1 branch
BranchTrueFalseTotal
if (peek_tag(&src, max, &type, &op)) { 19 0 19
133 19 ▶ XPUSHs(ldap_op2sv_noinc(op));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(ldap_op2sv_noinc(op)); 0 19 19
134 19 n++;
135 19 ▶ if (type & ASN1_CONSTRUCTED) {
Branch: 1 branch
BranchTrueFalseTotal
if (type & ASN1_CONSTRUCTED) { 15 4 19
136 15 ▶ if (peek_length(&src, max, &len)) {
Branch: 1 branch
BranchTrueFalseTotal
if (peek_length(&src, max, &len)) { 15 0 15
137 15 ▶ if (max - src > len)
Branch: 1 branch
BranchTrueFalseTotal
if (max - src > len) 13 2 15
138 13 max = src + len;
139 15 switch(op) {
140 1 case LDAP_OP_BIND_REQUEST:
141 {
142 I32 v;
143 /* skip version, return binding dn */
144 1 ▶ if (!peek_int(&src, max, &v))
Branch: 1 branch
BranchTrueFalseTotal
if (!peek_int(&src, max, &v)) 0 1 1
145 0 break;
146 /* else fall through */
147 }
148 case LDAP_OP_SEARCH_REQUEST:
149 case LDAP_OP_MODIFY_REQUEST:
150 case LDAP_OP_ADD_REQUEST:
151 case LDAP_OP_MODIFY_DN_REQUEST:
152 case LDAP_OP_COMPARE_REQUEST:
153 case LDAP_OP_SEARCH_ENTRY_RESPONSE:
154 {
155 /* extract dn */
156 10 SV *dn = sv_newmortal();
157 10 ▶ if (peek_string_utf8(&src, max, dn)) {
Branch: 1 branch
BranchTrueFalseTotal
if (peek_string_utf8(&src, max, dn)) { 10 0 10
158 10 ▶ XPUSHs(dn);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dn); 0 10 10
159 10 n++;
160 }
161 10 break;
162 }
163 3 case LDAP_OP_BIND_RESPONSE:
164 case LDAP_OP_SEARCH_DONE_RESPONSE:
165 case LDAP_OP_MODIFY_RESPONSE:
166 case LDAP_OP_ADD_RESPONSE:
167 case LDAP_OP_DELETE_RESPONSE:
168 case LDAP_OP_MODIFY_DN_RESPONSE:
169 case LDAP_OP_COMPARE_RESPONSE:
170 case LDAP_OP_EXTENDED_RESPONSE:
171 {
172 /* extract result code */
173 I32 r;
174 3 ▶ if (peek_enum(&src, max, &r)) {
Branch: 1 branch
BranchTrueFalseTotal
if (peek_enum(&src, max, &r)) { 3 0 3
175 3 ▶ XPUSHs(ldap_error2sv_noinc(r));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(ldap_error2sv_noinc(r)); 0 3 3
176 3 n++;
177 }
178 3 break;
179 }
180 2 case LDAP_OP_EXTENDED_REQUEST:
181 case LDAP_OP_SEARCH_REFERENCE_RESPONSE:
182 default:
183 /* no extra info available */
184 2 break;
185 }
186 }
187 }
188 else {
189 4 switch(op) {
190 1 case LDAP_OP_DELETE_REQUEST:
191 {
192 1 SV *dn = sv_newmortal();
193 1 ▶ if (peek_raw_utf8_notag(&src, max, dn)) {
Branch: 1 branch
BranchTrueFalseTotal
if (peek_raw_utf8_notag(&src, max, dn)) { 1 0 1
194 1 ▶ XPUSHs(dn);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dn); 0 1 1
195 1 n++;
196 }
197 1 break;
198 }
199 2 case LDAP_OP_ABANDON_REQUEST:
200 {
201 U32 target;
202 2 ▶ if (peek_numeric_notag(&src, max, &target)) {
Branch: 1 branch
BranchTrueFalseTotal
if (peek_numeric_notag(&src, max, &target)) { 2 0 2
203 2 ▶ mXPUSHu(target);
Branch: 1 branch
BranchTrueFalseTotal
mXPUSHu(target); 0 2 2
204 2 n++;
205 }
206 2 break;
207 }
208 1 case LDAP_OP_UNBIND_REQUEST:
209 1 break;
210 0 default:
211 0 croak("bad packet");
212 break;
213 }
214 }
215 }
216 }
217 }
218 }
219 19 XSRETURN(n);
220 }
221  
222 void
223 ldap_shift_message(SV *buffer)
224 PPCODE:
225 {
226 STRLEN src_len, message_len;
227 38 const char *start = SvPV(buffer, src_len);
228 38 const char *src = start;
229 38 const char *max = start + src_len;
230 38 const char *save_max = max;
231 U32 msgid, op;
232 38 HV *out = newHV();
233 38 SV *out_ref = sv_2mortal(newRV_noinc((SV*)out));
234 AV *controls;
235 38 SV *controls_ref = 0;
236 U8 type;
237 38 scan_message_head(&src, max, &msgid, &op, &type, &message_len);
238 38 max = src + message_len;
239 38 ▶ if (type & ASN1_CONSTRUCTED) {
Branch: 1 branch
BranchTrueFalseTotal
if (type & ASN1_CONSTRUCTED) { 30 8 38
240 STRLEN body_len;
241 const char *body_max;
242 30 scan_length(&src, max, &body_len);
243 30 body_max = src + body_len;
244 30 switch(op) {
245 2 case LDAP_OP_BIND_REQUEST:
246 2 scan_bind_request(&src, body_max, out);
247 2 break;
248 0 case LDAP_OP_UNBIND_REQUEST:
249 0 scan_unbind_request(&src, body_max, out);
250 0 break;
251 6 case LDAP_OP_SEARCH_REQUEST:
252 6 scan_search_request(&src, body_max, out);
253 6 break;
254 2 case LDAP_OP_ADD_REQUEST:
255 2 scan_add_request(&src, body_max, out);
256 2 break;
257 4 case LDAP_OP_MODIFY_REQUEST:
258 4 scan_modify_request(&src, body_max, out);
259 4 break;
260 2 case LDAP_OP_MODIFY_DN_REQUEST:
261 2 scan_modify_dn_request(&src, body_max, out);
262 2 break;
263 2 case LDAP_OP_COMPARE_REQUEST:
264 2 scan_compare_request(&src, body_max, out);
265 2 break;
266 2 case LDAP_OP_EXTENDED_REQUEST:
267 2 scan_extended_request(&src, body_max, out);
268 2 break;
269 2 case LDAP_OP_SEARCH_DONE_RESPONSE:
270 case LDAP_OP_MODIFY_RESPONSE:
271 case LDAP_OP_ADD_RESPONSE:
272 case LDAP_OP_DELETE_RESPONSE:
273 case LDAP_OP_MODIFY_DN_RESPONSE:
274 case LDAP_OP_COMPARE_RESPONSE:
275 2 scan_result_response(&src, body_max, out);
276 2 break;
277 2 case LDAP_OP_BIND_RESPONSE:
278 2 scan_bind_response(&src, body_max, out);
279 2 break;
280 2 case LDAP_OP_SEARCH_ENTRY_RESPONSE:
281 2 scan_search_entry_response(&src, body_max, out);
282 2 break;
283 2 case LDAP_OP_SEARCH_REFERENCE_RESPONSE:
284 2 scan_search_reference_response(&src, body_max, out);
285 2 break;
286 2 case LDAP_OP_EXTENDED_RESPONSE:
287 2 scan_extended_response(&src, body_max, out);
288 2 break;
289 0 case LDAP_OP_INTERMEDIATE_RESPONSE:
290 0 scan_intermediate_response(&src, body_max, out);
291 0 break;
292 0 default:
293 0 croak("ldap_shift_request: unimplemented operation %u", (unsigned int)op);
294 break;
295 }
296 30 ▶ if (src < body_max)
Branch: 1 branch
BranchTrueFalseTotal
if (src < body_max) 0 30 30
297 0 croak("unexpected data in packet");
298 }
299 else {
300 8 switch(op) {
301 2 case LDAP_OP_DELETE_REQUEST:
302 2 scan_delete_request(&src, max, out);
303 2 break;
304 4 case LDAP_OP_ABANDON_REQUEST:
305 4 scan_abandon_request(&src, max, out);
306 4 break;
307 2 case LDAP_OP_UNBIND_REQUEST:
308 2 scan_unbind_request(&src, max, out);
309 2 break;
310 0 default:
311 0 croak("ldap_shift_request: unimplemented operation %u", (unsigned int)op);
312 break;
313 }
314 }
315 38 ▶ if (src < max) {
Branch: 1 branch
BranchTrueFalseTotal
if (src < max) { 32 6 38
316 32 controls = newAV();
317 32 controls_ref = sv_2mortal(newRV_noinc((SV*)controls));
318 32 scan_controls(&src, max, controls);
319 }
320 38 ▶ if (src != max || src > save_max)
Branch: 2 branches
BranchTrueFalseTotal
if (src != max || src > save_max) 38 0 38
if (src != max || src > save_max) 0 38 38
321 0 croak("ldap_shift_request: internal error, scaning functions overread");
322 38 ▶ if (src < save_max) {
Branch: 1 branch
BranchTrueFalseTotal
if (src < save_max) { 15 23 38
323 15 sv_chop(buffer, max);
324 15 ▶ SvSETMAGIC(buffer);
Branch: 1 branch
BranchTrueFalseTotal
SvSETMAGIC(buffer); 0 15 15
325 }
326 else
327 23 sv_setpvn_mg(buffer, "", 0);
328 38 ▶ XPUSHs(sv_2mortal(newSViv(msgid)));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(sv_2mortal(newSViv(msgid))); 0 38 38
329 38 ▶ XPUSHs(ldap_op2sv_noinc(op));
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(ldap_op2sv_noinc(op)); 0 38 38
330 38 ▶ XPUSHs(out_ref);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(out_ref); 0 38 38
331 38 ▶ if (controls_ref) {
Branch: 1 branch
BranchTrueFalseTotal
if (controls_ref) { 32 6 38
332 32 ▶ XPUSHs(controls_ref);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(controls_ref); 0 32 32
333 32 XSRETURN(4);
334 }
335 else
336 6 XSRETURN(3);
337 }
338  
339 void
340 ldap_pack_message_ref(msgid, op, data, controls = 0)
341 U32 msgid
342 U32 op
343 HV *data
344 SV *controls
345 PPCODE:
346 {
347 19 SV *dest = new_message_sv();
348 19 start_ldap_message(dest, msgid);
349 19 ldap_pack_message_ref(dest, op, data, controls);
350 19 end_ldap_message(dest);
351 19 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 19 19
352 19 XSRETURN(1);
353 }
354  
355 void
356 _ldap_pack_message_ref(msgid, data, controls = 0)
357 U32 msgid
358 HV *data
359 SV *controls
360 ALIAS:
361 ldap_pack_bind_request_ref = LDAP_OP_BIND_REQUEST
362 ldap_pack_bind_response_ref = LDAP_OP_BIND_RESPONSE
363 ldap_pack_unbind_request_ref = LDAP_OP_UNBIND_REQUEST
364 ldap_pack_search_request_ref = LDAP_OP_SEARCH_REQUEST
365 ldap_pack_search_entry_response_ref = LDAP_OP_SEARCH_ENTRY_RESPONSE
366 ldap_pack_search_reference_response_ref = LDAP_OP_SEARCH_REFERENCE_RESPONSE
367 ldap_pack_search_done_response_ref = LDAP_OP_SEARCH_DONE_RESPONSE
368 ldap_pack_modify_request_ref = LDAP_OP_MODIFY_REQUEST
369 ldap_pack_modify_response_ref = LDAP_OP_MODIFY_RESPONSE
370 ldap_pack_add_request_ref = LDAP_OP_ADD_REQUEST
371 ldap_pack_add_response_ref = LDAP_OP_ADD_RESPONSE
372 ldap_pack_delete_request_ref = LDAP_OP_DELETE_REQUEST
373 ldap_pack_delete_response_ref = LDAP_OP_DELETE_RESPONSE
374 ldap_pack_modify_dn_request_ref = LDAP_OP_MODIFY_DN_REQUEST
375 ldap_pack_modify_dn_response_ref = LDAP_OP_MODIFY_DN_RESPONSE
376 ldap_pack_compare_request_ref = LDAP_OP_COMPARE_REQUEST
377 ldap_pack_compare_response_ref = LDAP_OP_COMPARE_RESPONSE
378 ldap_pack_abandon_request_ref = LDAP_OP_ABANDON_REQUEST
379 ldap_pack_extended_request_ref = LDAP_OP_EXTENDED_REQUEST
380 ldap_pack_extended_response_ref = LDAP_OP_EXTENDED_RESPONSE
381 ldap_pack_intermediate_response_ref = LDAP_OP_INTERMEDIATE_RESPONSE
382 PPCODE:
383 {
384 0 SV *dest = new_message_sv();
385 0 start_ldap_message(dest, msgid);
386 0 ldap_pack_message_ref(dest, ix, data, controls);
387 0 end_ldap_message(dest);
388 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
389 0 XSRETURN(1);
390 }
391  
392 void
393 ldap_pack_bind_request(msgid, version = 3, dn = 0, method = LDAP_AUTH_SIMPLE, arg1 = 0, arg2 = 0)
394 U32 msgid
395 U32 version
396 SV *dn
397 U32 method
398 SV *arg1
399 SV *arg2
400 PPCODE:
401 {
402 0 SV *dest = new_message_sv();
403 0 ▶ if (version > 3)
Branch: 1 branch
BranchTrueFalseTotal
if (version > 3) 0 0 0
404 0 croak("bad LDAP protocol version %u", (unsigned int)version);
405 0 start_ldap_message(dest, msgid);
406 0 pack_bind_request_args(dest, version, dn, method, arg1, arg2);
407 0 end_ldap_message(dest);
408 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
409 0 XSRETURN(1);
410 }
411  
412 void
413 ldap_pack_unbind_request(msgid)
414 U32 msgid
415 PPCODE:
416 {
417 0 SV *dest = new_message_sv();
418 0 start_ldap_message(dest, msgid);
419 0 pack_unbind_request_args(dest);
420 0 end_ldap_message(dest);
421 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
422 0 XSRETURN(1);
423 }
424  
425 void
426 ldap_pack_search_request(msgid, base_dn = 0, scope = LDAP_SCOPE_BASE_OBJECT, \
427 deref = LDAP_DEREF_ALIASES_NEVER, \
428 size_limit = 0, time_limit = 0, types_only = 0, \
429 filter = 0, \
430 attributes = 0)
431 U32 msgid
432 SV *base_dn
433 U32 scope
434 U32 deref
435 U32 size_limit
436 U32 time_limit
437 U32 types_only
438 AV_opt *filter
439 SV *attributes
440 PPCODE:
441 {
442 0 SV *dest = new_message_sv();
443 0 start_ldap_message(dest, msgid);
444 0 pack_search_request_args(dest,
445 base_dn, scope, deref,
446 size_limit, time_limit, types_only,
447 filter, attributes);
448 0 end_ldap_message(dest);
449 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
450 0 XSRETURN(1);
451 }
452  
453 void
454 ldap_pack_search_entry_response(msgid, dn, ...)
455 U32 msgid
456 SV *dn
457 PPCODE:
458 {
459 0 SV *dest = new_message_sv();
460 0 ▶ if (items & 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items & 1) 0 0 0
461 0 croak("Usage: Net::LDAP::Gateway::search_entry_response("
462 "$msgid, $dn, attr => \\@values, attr => \\@values, ...)");
463 0 start_ldap_message(dest, msgid);
464 0 pack_search_entry_response_args(dest, dn, &(ST(2)), items - 2);
465 0 end_ldap_message(dest);
466 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
467 0 XSRETURN(1);
468 }
469  
470 void
471 ldap_pack_search_reference_response(msgid, ...)
472 U32 msgid
473 PPCODE:
474 {
475 0 SV *dest = new_message_sv();
476 0 start_ldap_message(dest, msgid);
477 0 pack_search_reference_response_args(dest, &(ST(1)), items - 1);
478 0 end_ldap_message(dest);
479 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
480 0 XSRETURN(1);
481 }
482  
483 void
484 ldap_pack_modify_request(msgid, dn, ...)
485 U32 msgid
486 SV *dn
487 PPCODE:
488 {
489 0 SV *dest = new_message_sv();
490 0 start_ldap_message(dest, msgid);
491 0 pack_modify_request_args(dest, dn, &(ST(2)), items - 2);
492 0 end_ldap_message(dest);
493 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
494 0 XSRETURN(1);
495 }
496  
497 void
498 ldap_pack_add_request(msgid, dn, ...)
499 U32 msgid
500 SV *dn
501 PPCODE:
502 {
503 0 SV *dest = new_message_sv();
504 0 ▶ if (items & 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items & 1) 0 0 0
505 0 croak("Usage: Net::LDAP::Gateway::add_request("
506 "$msgid, $dn, attr => \\@values, attr => \\@values, ...)");
507 0 start_ldap_message(dest, msgid);
508 0 pack_add_request_args(dest, dn, &(ST(2)), items - 2);
509 0 end_ldap_message(dest);
510 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
511 0 XSRETURN(1);
512 }
513  
514 void
515 ldap_pack_delete_request(msgid, dn)
516 U32 msgid
517 SV *dn
518 PPCODE:
519 {
520 0 SV *dest = new_message_sv();
521 0 start_ldap_message(dest, msgid);
522 0 pack_delete_request_args(dest, dn);
523 0 end_ldap_message(dest);
524 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
525 0 XSRETURN(1);
526 }
527  
528 void
529 ldap_pack_modify_dn_request(msgid, dn, new_rdn, delete_old_rdn = 0, new_superior = 0)
530 U32 msgid
531 SV *dn
532 SV *new_rdn
533 I32 delete_old_rdn
534 SV *new_superior
535 PPCODE:
536 {
537 0 SV *dest = new_message_sv();
538 0 start_ldap_message(dest, msgid);
539 0 pack_modify_dn_request_args(dest, dn, new_rdn, delete_old_rdn, new_superior);
540 0 end_ldap_message(dest);
541 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
542 0 XSRETURN(1);
543 }
544  
545 void
546 ldap_pack_compare_request(msgid, dn, attribute, value)
547 U32 msgid
548 SV *dn
549 SV *attribute
550 SV *value
551 PPCODE:
552 {
553 0 SV *dest = new_message_sv();
554 0 start_ldap_message(dest, msgid);
555 0 pack_compare_request_args(dest, dn, attribute, value);
556 0 end_ldap_message(dest);
557 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
558 0 XSRETURN(1);
559 }
560  
561 void
562 ldap_pack_abandon_request(msgid, target_msgid)
563 U32 msgid
564 U32 target_msgid
565 PPCODE:
566 {
567 0 SV *dest = new_message_sv();
568 0 start_ldap_message(dest, msgid);
569 0 pack_abandon_request_args(dest, target_msgid);
570 0 end_ldap_message(dest);
571 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
572 0 XSRETURN(1);
573 }
574  
575 void
576 _ldap_pack_extended_request(msgid, oid, value = 0)
577 U32 msgid
578 SV *oid
579 SV *value
580 PPCODE:
581 {
582 0 SV *dest = new_message_sv();
583 0 start_ldap_message(dest, msgid);
584 0 pack_extended_request_args(dest, oid, value);
585 0 end_ldap_message(dest);
586 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
587 0 XSRETURN(1);
588 }
589  
590 void
591 ldap_pack_extended_response(msgid, result = 0, matched_dn = 0, \
592 message = 0, referrals = 0, \
593 name = 0, value = 0)
594 U32 msgid
595 I32 result
596 SV *matched_dn
597 SV *message
598 SV *referrals
599 SV *name
600 SV *value
601 PPCODE:
602 {
603 0 SV *dest = new_message_sv();
604 0 start_ldap_message(dest, msgid);
605 0 pack_extended_response_args(dest, result, matched_dn, message,
606 referrals, name, value);
607 0 end_ldap_message(dest);
608 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
609 0 XSRETURN(1);
610 }
611  
612 void
613 ldap_pack_intermediate_response(msgid, oid = 0, value = 0)
614 U32 msgid
615 SV *oid
616 SV *value
617 PPCODE:
618 {
619 0 SV *dest = new_message_sv();
620 0 start_ldap_message(dest, msgid);
621 0 pack_intermediate_response_args(dest, oid, value);
622 0 end_ldap_message(dest);
623 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
624 0 XSRETURN(1);
625 }
626  
627 void
628 _ldap_pack_result_response(msgid, result = LDAP_SUCCESS, matched_dn = 0, message = 0, referrals = 0)
629 U32 msgid
630 I32 result
631 SV *matched_dn
632 SV *message
633 SV *referrals
634 ALIAS:
635 ldap_pack_bind_response = LDAP_OP_BIND_RESPONSE
636 ldap_pack_search_done_response = LDAP_OP_SEARCH_DONE_RESPONSE
637 ldap_pack_modify_response = LDAP_OP_MODIFY_RESPONSE
638 ldap_pack_add_response = LDAP_OP_ADD_RESPONSE
639 ldap_pack_delete_response = LDAP_OP_DELETE_RESPONSE
640 ldap_pack_modify_dn_response = LDAP_OP_MODIFY_DN_RESPONSE
641 ldap_pack_compare_response = LDAP_OP_COMPARE_RESPONSE
642 PPCODE:
643 {
644 0 SV *dest = new_message_sv();
645 0 start_ldap_message(dest, msgid);
646 0 pack_result_response_args(dest, ix, result, matched_dn, message, referrals);
647 0 end_ldap_message(dest);
648 0 ▶ XPUSHs(dest);
Branch: 1 branch
BranchTrueFalseTotal
XPUSHs(dest); 0 0 0
649 0 XSRETURN(1);
650 }
651  
« pack_search_reference_response.c ↑ Summary scan_search_request.c »