]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/lldp-internal.h
e175563b9aebd83232cb6c4ff3b7c5ed34589a46
[thirdparty/systemd.git] / src / libsystemd-network / lldp-internal.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 Copyright (C) 2014 Tom Gundersen
6 Copyright (C) 2014 Susant Sahani
7 ***/
8
9 #include "sd-event.h"
10 #include "sd-lldp.h"
11
12 #include "hashmap.h"
13 #include "log.h"
14 #include "prioq.h"
15
16 struct sd_lldp {
17 unsigned n_ref;
18
19 int ifindex;
20 int fd;
21
22 sd_event *event;
23 int64_t event_priority;
24 sd_event_source *io_event_source;
25 sd_event_source *timer_event_source;
26
27 Prioq *neighbor_by_expiry;
28 Hashmap *neighbor_by_id;
29
30 uint64_t neighbors_max;
31
32 sd_lldp_callback_t callback;
33 void *userdata;
34
35 uint16_t capability_mask;
36
37 struct ether_addr filter_address;
38 };
39
40 #define log_lldp_errno(error, fmt, ...) log_internal(LOG_DEBUG, error, __FILE__, __LINE__, __func__, "LLDP: " fmt, ##__VA_ARGS__)
41 #define log_lldp(fmt, ...) log_lldp_errno(0, fmt, ##__VA_ARGS__)