36 if(constraints) ct = &constraints->
value;
40 if(ct && ct->flags & APC_EXTENSIBLE) {
46 if(ct && ct->range_bits >= 0) {
49 ASN_DEBUG(
"CHOICE %s got index %d in range %d",
50 td->
name, value, ct->range_bits);
51 if(value > ct->upper_bound)
65 ASN_DEBUG(
"CHOICE presence from wire %d", value);
67 ASN_DEBUG(
"CHOICE presence index effective %d", value);
76 memb_ptr2 = (
void **)((
char *)st + elm->memb_offset);
79 memb_ptr2 = &memb_ptr;
81 ASN_DEBUG(
"Discovered CHOICE %s encodes %s", td->
name, elm->name);
83 if(ct && ct->range_bits >= 0) {
84 rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
85 elm->encoding_constraints.per_constraints,
89 elm->encoding_constraints.per_constraints,
94 ASN_DEBUG(
"Failed to decode %s in %s (CHOICE) %d",
95 elm->name, td->
name, rv.code);
106 const void *memb_ptr;
112 ASN_DEBUG(
"Encoding %s as CHOICE", td->
name);
114 if(constraints) ct = &constraints->
value;
130 ASN_DEBUG(
"Encoding %s CHOICE element %d", td->
name, present);
136 present_enc = present;
138 if(ct && ct->range_bits >= 0) {
139 if(present_enc < ct->lower_bound
140 || present_enc > ct->upper_bound) {
141 if(ct->flags & APC_EXTENSIBLE) {
144 present, present_enc, ct->lower_bound, ct->upper_bound);
153 if(ct && ct->flags & APC_EXTENSIBLE) {
155 present, present_enc, ct->lower_bound, ct->upper_bound);
162 ASN_DEBUG(
"CHOICE member \"%s\" %d (as %d)", elm->name, present,
167 *(
const void *
const *)((
const char *)sptr + elm->memb_offset);
170 memb_ptr = (
const char *)sptr + elm->memb_offset;
173 if(ct && ct->range_bits >= 0) {
177 return elm->type->op->uper_encoder(
178 elm->type, elm->encoding_constraints.per_constraints, memb_ptr, po);
185 elm->encoding_constraints.per_constraints,