static void test_parser(void) { _cleanup_(sd_lldp_packet_unrefp) tlv_packet *tlv = NULL; /* form a packet */ lldp_build_tlv_packet(&tlv); /* parse the packet */ tlv_packet_parse_pdu(tlv, tlv->length); /* verify */ lldp_parse_tlv_packet(tlv, tlv->length); }
int main(int argc, char *argv[]) { _cleanup_tlv_packet_free_ tlv_packet *tlv = NULL; /* form a packet */ lldp_build_tlv_packet(&tlv); /* parse the packet */ tlv_packet_parse_pdu(tlv, tlv->length); /* verify */ lldp_parse_tlv_packet(tlv, tlv->length); return 0; }