Lines Matching defs:lldp
27 #include "sd-lldp.h"
31 #include "lldp-network.h"
32 #include "lldp-tlv.h"
33 #include "lldp.h"
38 #define TEST_LLDP_TYPE_SYSTEM_NAME "systemd-lldp"
39 #define TEST_LLDP_TYPE_SYSTEM_DESC "systemd-lldp-desc"
255 static void lldp_handler (sd_lldp *lldp, int event, void *userdata) {
259 static int start_lldp(sd_lldp **lldp, sd_event *e, sd_lldp_cb_t cb, void *cb_data) {
262 r = sd_lldp_new(42, "dummy", &mac_addr, lldp);
266 r = sd_lldp_attach_event(*lldp, e, 0);
270 r = sd_lldp_set_callback(*lldp, cb, cb_data);
274 r = sd_lldp_start(*lldp);
281 static int stop_lldp(sd_lldp *lldp) {
284 r = sd_lldp_stop(lldp);
288 r = sd_lldp_detach_event(lldp);
292 sd_lldp_unref(lldp);
299 sd_lldp *lldp;
323 assert_se(start_lldp(&lldp, e, lldp_handler, NULL) == 0);
328 assert_se(sd_lldp_get_packets(lldp, &packets) == 1);
361 assert_se(stop_lldp(lldp) == 0);
365 sd_lldp *lldp;
381 assert_se(start_lldp(&lldp, e, lldp_handler, NULL) == 0);
386 assert_se(sd_lldp_get_packets(lldp, &packets) == 0);
388 assert_se(stop_lldp(lldp) == 0);
392 sd_lldp *lldp;
424 assert_se(start_lldp(&lldp, e, lldp_handler, NULL) == 0);
429 assert_se(sd_lldp_get_packets(lldp, &packets) == 1);
453 assert_se(stop_lldp(lldp) == 0);