173 size_t len = talloc_array_length(digits) - 1;
174 size_t outlen = (len / 2) + (len & 0x01);
178 if (len == 0)
return -1;
184 if (len & 0x01) nai |= 0xf0;
188 case SCCP_TITLE_IND_NONE:
189 *
out = p = talloc_array(ctx,
uint8_t, outlen);
192 case SCCP_TITLE_IND_NATURE_ONLY:
193 *
out = p = talloc_array(ctx,
uint8_t, (outlen + 1));
197 case SCCP_TITLE_IND_TRANSLATION_ONLY:
198 *
out = p = talloc_array(ctx,
uint8_t, (outlen + 1));
202 case SCCP_TITLE_IND_TRANS_NUM_ENC:
203 *
out = p = talloc_array(ctx,
uint8_t, (outlen + 3));
205 (*p++) = ((np & 0x0f) << 4) | (es & 0x0f);
208 case SCCP_TITLE_IND_TRANS_NUM_ENC_NATURE:
209 *
out = p = talloc_array(ctx,
uint8_t, (outlen + 4));
211 (*p++) = ((np & 0x0f) << 4) | (es & 0x0f);
223 for (i = 0; i < (len - 1); i += 2) {