]>
git.zerfleddert.de Git - proxmark3-svn/blob - armsrc/tlv.h
9 //structure buffer definitions
11 #define VALUE_LENGTH 1024
14 //if TLV_TAG_NUMBER_MASK bits are set, refer to the next byte for the tag number
15 //otherwise its located in bits 1-5
16 #define TLV_TAG_NUMBER_MASK 0x1f
17 //if TLV_DATA_MASK set then its a 'constructed data object'
18 //otherwise a 'primitive data object'
19 #define TLV_DATA_MASK 0x20
20 #define TLV_TAG_MASK 0x80
21 #define TLV_LENGTH_MASK 0x80
23 //tlv tag structure, tag can be max of 2 bytes, length up to 65535 and value 1024 bytes long
25 uint8_t tag
[TAG_LENGTH
];
28 uint8_t value
[VALUE_LENGTH
];
32 extern int decode_ber_tlv_item(uint8_t* data
, tlvtag
* returnedtag
);
33 extern int encode_ber_tlv_item(uint8_t* tag
, uint8_t taglen
, uint8_t*data
, uint32_t datalen
, uint8_t* outputtag
, uint32_t* outputtaglen
);