42 #define GENERICTLV_HDRSZ (sizeof(guint16)+sizeof(guint16))
66 const guint8 * tlvp = tlv_vp;
76 guint8 * tlvp = tlv_vp;
85 const guint8* tlvbytes = tlv_vp;
95 guint8* tlvbytes = tlv_vp;
106 gconstpointer pktend)
108 guint8* tlvbytes = tlv_vp;
109 g_return_if_fail((gpointer)(tlvbytes+srcsize) <= pktend);
117 gconstpointer pktend)
122 if (NULL == tlv_vp || ((
const guint8*)tlv_vp+
GENERICTLV_HDRSZ) > (
const guint8*)pktend) {
123 fprintf(stderr,
"TLV Invalid because packet is too short\n");
134 if (tlv_vp >= pktend) {
141 if (next > (
const guint8*) pktend) {
142 fprintf(stderr,
"TLV Invalid because TLV entry extends past end\n");
149 fprintf(stderr,
"TLV Invalid because END item isn't at end of packet\n");
153 if (j <
DIMOF(reqtypes) && ttype != reqtypes[j]) {
154 fprintf(stderr,
"TLV Invalid because required TLV types aren't present in right order\n");
160 fprintf(stderr,
"TLV Invalid because final type wasn't FRAMETYPE_END (it was %d)\n"
169 gconstpointer pktend)
171 const guint8* inittlv = packet;
183 gconstpointer pktend)
185 const guint8* nexttlv;
186 const guint8* nextend;
197 return nextend > (
const guint8*)pktend ? NULL : nexttlv;
204 gconstpointer pktend)
206 while (NULL != tlv_vp && ((
const guint8*)tlv_vp+
GENERICTLV_HDRSZ) <= (
const guint8*)pktend) {