1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #ifndef TLV_HEADER
- #define TLV_HEADER
- #include <stdio.h>
- #include "../tools/types.h"
- #include "../tools/endian.h"
- #include "../tools/memory.h"
- #define TLVSPAN(node) (sizeof(*(node))-sizeof((node)->data)+LE32TOH((node)->size))
- #define TLVDUMP(node) hexdump(&(node)->data,0,(node)->size,stderr)
- #ifndef __GNUC__
- #pragma pack (push,1)
- #endif
- typedef struct __packed TLVNode
- {
- uint32_t type;
- uint32_t size;
- uint32_t data;
- }
- TLVNode;
- #ifndef __GNUC__
- #pragma pack (pop)
- #endif
- #endif
|