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