| 1 |
|
| #include "pack.h" |
| 2 |
|
| #include "util.h" |
| 3 |
|
| |
| 4 |
|
| void |
| 5 |
3 |
| pack_result_response_nowrap(SV *dest, I32 result, |
| 6 |
|
| SV *matched_dn, SV *message, SV *referrals) { |
| 7 |
3 |
| pack_enum(dest, result); |
| 8 |
3 |
| pack_string_utf8(dest, matched_dn); |
| 9 |
3 |
| pack_string_utf8(dest, message); |
| 10 |
3 |
▶ | if (referrals && SvOK(referrals)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if (referrals && SvOK(referrals)) { |
2 |
1 |
3 |
| if (referrals && SvOK(referrals)) { |
2 |
0 |
2 |
|
| 11 |
2 |
| STRLEN offset = start_constructed(dest, ASN1_CONTEXT_SPECIFIC|ASN1_CONSTRUCTED, 3); |
| 12 |
2 |
| pack_array_of_string_utf8(dest, referrals); |
| 13 |
2 |
| end_constructed(dest, offset); |
| 14 |
|
| } |
| 15 |
3 |
| } |
| 16 |
|
| |
| 17 |
|
| void |
| 18 |
1 |
| pack_result_response_args(SV *dest, U32 op, I32 result, |
| 19 |
|
| SV *matched_dn, SV *message, SV *referrals) { |
| 20 |
1 |
| STRLEN offset = start_constructed(dest, ASN1_APPLICATION|ASN1_CONSTRUCTED, op); |
| 21 |
1 |
| pack_result_response_nowrap(dest, result, matched_dn, message, referrals); |
| 22 |
1 |
| end_constructed(dest, offset); |
| 23 |
1 |
| } |
| 24 |
|
| |
| 25 |
|
| void |
| 26 |
1 |
| pack_result_response_ref(SV *dest, U32 op, HV *hv) { |
| 27 |
|
| SV *referrals; |
| 28 |
2 |
| pack_result_response_args(dest, op, |
| 29 |
1 |
| SvIV(hv_fetchs_def_undef(hv, "result")), |
| 30 |
|
| hv_fetchs_def_null(hv, "matched_dn"), |
| 31 |
|
| hv_fetchs_def_null(hv, "message"), |
| 32 |
|
| hv_fetchs_def_null(hv, "referrals")); |
| 33 |
1 |
| } |