asn1helpers: Add new OCTET_STRING_noalloc

This assings the buffer + size of an OCTET_STRING without allocating a new
buffer and copying the data.
This commit is contained in:
Harald Welte 2016-01-01 16:42:52 +01:00
parent 1cdb81dd98
commit 962da50e08
1 changed files with 6 additions and 0 deletions

View File

@ -18,3 +18,9 @@ uint8_t asn1str_to_u8(const OCTET_STRING_t *in);
uint32_t asn1bitstr_to_u32(const BIT_STRING_t *in);
uint32_t asn1bitstr_to_u28(const BIT_STRING_t *in);
uint32_t asn1bitstr_to_u24(const BIT_STRING_t *in);
static inline void OCTET_STRING_noalloc(OCTET_STRING_t *s, const uint8_t *str, int size)
{
s->buf = str;
s->size = size;
}