--- libelwix/inc/elwix/avar.h 2022/01/24 17:08:21 1.13 +++ libelwix/inc/elwix/avar.h 2022/02/01 20:46:57 1.14 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: avar.h,v 1.13 2022/01/24 17:08:21 misho Exp $ +* $Id: avar.h,v 1.14 2022/02/01 20:46:57 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -390,6 +390,15 @@ int ait_vars2buffer(unsigned char * __restrict buf, in */ array_t *ait_buffer2vars(unsigned char * __restrict buf, int buflen, int vnum, int zcpy); /* + * ait_var2tlv() - Marshaling data from variable to TLV buffer + * + * @buf = Buffer, If =NULL then we return only needed buffer size + * @buflen = Size of buffer + * @var = Variable + * return: -1 error, 0 nothing done or >0 size of marshaled data + */ +int ait_var2tlv(u_char * __restrict buf, int buflen, ait_val_t * __restrict v); +/* * ait_vars2tlv() - Marshaling data from array with variables to TLV buffer * * @buf = Buffer, If =NULL then we return only needed buffer size @@ -398,6 +407,15 @@ array_t *ait_buffer2vars(unsigned char * __restrict bu * return: -1 error, 0 nothing done or >0 size of marshaled data */ int ait_vars2tlv(u_char * __restrict buf, int buflen, array_t * __restrict vars); +/* + * ait_tlv2var() - De-marshaling data from TLV buffer to variable + * + * @buf = Buffer + * @buflen = Size of buffer + * @next_tlv = Next TLV position, if it is !=NULL + * return: =NULL error, !=NULL allocated variable array, after use must free with ait_freeVar() + */ +ait_val_t *ait_tlv2var(u_char * __restrict buf, int buflen, off_t *next_tlv); /* * ait_tlv2vars() - De-marshaling data from TLV buffer to array with variables *