/* Check validity of HELLO message header and message TLVs  */
static enum rfc5444_result check_msg_validity(struct rfc5444_reader_tlvblock_context *cont)
/* Check validity of HELLO message header and message TLVs  */
static enum rfc5444_result check_msg_validity(struct rfc5444_reader_tlvblock_context *cont)
{
    if (cont->has_hoplimit && cont->hoplimit != 1) {
        return RFC5444_DROP_MESSAGE;
    }
    if (cont->has_hopcount && cont->hopcount != 0) {
        return RFC5444_DROP_MESSAGE;
    }
    if (!(_nhdp_msg_tlvs[RFC5444_MSGTLV_VALIDITY_TIME].tlv)) {
        return RFC5444_DROP_MESSAGE;
    }
    else if (_nhdp_msg_tlvs[RFC5444_MSGTLV_VALIDITY_TIME].tlv->next_entry) {
        return RFC5444_DROP_MESSAGE;
    }
    if (_nhdp_msg_tlvs[RFC5444_MSGTLV_INTERVAL_TIME].tlv
        && _nhdp_msg_tlvs[RFC5444_MSGTLV_INTERVAL_TIME].tlv->next_entry) {
        return RFC5444_DROP_MESSAGE;
    }
    return RFC5444_OKAY;
}