/**
 * @file       tlv.h
 * @brief      Simple TLV iterator
 * @author     Oleksandr Fadieiev (o.fadieiev@samsung.com)
 * @version    1.0
 * @date       Created April 12, 2017
 * @copyright  In Samsung Ukraine R&D Center (SURC) under a contract between
 * @par        LLC "Samsung Electronics Ukraine Company" (Kiev, Ukraine) and
 * @par        "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
 * @par        Copyright: (c) Samsung Electronics Co, Ltd 2017. All rights reserved.
 */
#ifndef _SOURCES_TLV_H_
#define _SOURCES_TLV_H_

#include <stdint.h>

typedef struct __attribute__((packed)) {
  uint8_t tag;
  uint8_t length[2];
  uint8_t value[];
} TlvHeader;

TlvHeader *TlvNext(const TlvHeader *current, const void *end);
uint16_t TlvLength(const TlvHeader *tlv);

#endif // _SOURCES_TLV_H_
