]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/libsystemd-network/lldp-internal.h
sd-ndisc: use structured initializer at one more place
[thirdparty/systemd.git] / src / libsystemd-network / lldp-internal.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
0ef6f454
LP
2#pragma once
3
07630cea 4#include "sd-event.h"
34437b4f 5#include "sd-lldp.h"
07630cea 6
34437b4f 7#include "hashmap.h"
07630cea 8#include "log.h"
ad1ad5c8
SS
9#include "prioq.h"
10
34437b4f 11struct sd_lldp {
fc6a313b
LP
12 unsigned n_ref;
13
34437b4f
LP
14 int ifindex;
15 int fd;
ad1ad5c8 16
34437b4f
LP
17 sd_event *event;
18 int64_t event_priority;
19 sd_event_source *io_event_source;
20 sd_event_source *timer_event_source;
ad1ad5c8 21
34437b4f
LP
22 Prioq *neighbor_by_expiry;
23 Hashmap *neighbor_by_id;
ad1ad5c8 24
34437b4f 25 uint64_t neighbors_max;
ad1ad5c8 26
34437b4f
LP
27 sd_lldp_callback_t callback;
28 void *userdata;
ad1ad5c8 29
34437b4f 30 uint16_t capability_mask;
b553a6b1
LP
31
32 struct ether_addr filter_address;
ad1ad5c8
SS
33};
34
34437b4f
LP
35#define log_lldp_errno(error, fmt, ...) log_internal(LOG_DEBUG, error, __FILE__, __LINE__, __func__, "LLDP: " fmt, ##__VA_ARGS__)
36#define log_lldp(fmt, ...) log_lldp_errno(0, fmt, ##__VA_ARGS__)
4f0e4d29
YW
37
38const char* lldp_event_to_string(sd_lldp_event e) _const_;
39sd_lldp_event lldp_event_from_string(const char *s) _pure_;