Modif valid tlv

This commit is contained in:
n07070 2020-03-24 18:27:31 +01:00
parent ac657e4bbd
commit 882b75433a

View File

@ -10,6 +10,11 @@
#include "tlv.h" #include "tlv.h"
#include "node.h" #include "node.h"
// We need to make sure the TLV announces a length that will no go onto
// another tlv, as we might end up reading bullshit.
tlv_list validate_tlvs(packet packet_to_validate){
}
// For every packet recivied, // For every packet recivied,
// then we make sure it's conform // then we make sure it's conform
@ -97,7 +102,11 @@ void listen_for_packets(){
continue; continue;
} }
struct tlv_list received_tlvs = validate_tlvs(formated_rec_datagram); struct tlv_list received_tlvs;
if (validate_tlvs(formated_rec_datagram) < 0) {
/* code */
}
} }
} }
@ -116,11 +125,7 @@ void work_with_tlvs(){
}; };
// We need to make sure the TLV announces a length that will no go onto
// another tlv, as we might end up reading bullshit.
tlv_list validate_tlvs(packet packet_to_validate){
}
void work_with_tlvs(struct tlvs_list receivied_tlvs){ void work_with_tlvs(struct tlvs_list receivied_tlvs){