]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd-network/lldp-internal.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / libsystemd-network / lldp-internal.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright (C) 2014 Tom Gundersen
8 Copyright (C) 2014 Susant Sahani
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 ***/
23
24 #include "sd-event.h"
25 #include "sd-lldp.h"
26
27 #include "hashmap.h"
28 #include "log.h"
29 #include "prioq.h"
30
31 struct sd_lldp {
32 unsigned n_ref;
33
34 int ifindex;
35 int fd;
36
37 sd_event *event;
38 int64_t event_priority;
39 sd_event_source *io_event_source;
40 sd_event_source *timer_event_source;
41
42 Prioq *neighbor_by_expiry;
43 Hashmap *neighbor_by_id;
44
45 uint64_t neighbors_max;
46
47 sd_lldp_callback_t callback;
48 void *userdata;
49
50 uint16_t capability_mask;
51
52 struct ether_addr filter_address;
53 };
54
55 #define log_lldp_errno(error, fmt, ...) log_internal(LOG_DEBUG, error, __FILE__, __LINE__, __func__, "LLDP: " fmt, ##__VA_ARGS__)
56 #define log_lldp(fmt, ...) log_lldp_errno(0, fmt, ##__VA_ARGS__)