FIX: gcc8.1 warnings

This commit is contained in:
iceman1001
2019-01-09 16:25:49 +01:00
parent 96361abd97
commit e276bf1ce3
5 changed files with 59 additions and 36 deletions

View File

@@ -6,8 +6,13 @@
#include <stddef.h>
//structure buffer definitions
#define TAG_LENGTH 2
#define VALUE_LENGTH 1024
#ifndef TAG_LENGTH
# define TAG_LENGTH 4
#endif
#ifndef VALUE_LENGTH
# define VALUE_LENGTH 1024
#endif
//masks
//if TLV_TAG_NUMBER_MASK bits are set, refer to the next byte for the tag number
@@ -19,13 +24,13 @@
#define TLV_TAG_MASK 0x80
#define TLV_LENGTH_MASK 0x80
//tlv tag structure, tag can be max of 2 bytes, length up to 65535 and value 1024 bytes long
//tlv tag structure, tag can be max of 4 bytes, length up to 0xFFFFFFFF and value 1024 bytes long
typedef struct {
uint8_t tag[TAG_LENGTH];
uint16_t fieldlength;
uint16_t valuelength;
uint8_t value[VALUE_LENGTH];
}tlvtag;
} tlvtag;
//decode a BER TLV
extern int decode_ber_tlv_item(uint8_t* data, tlvtag* returnedtag);