]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/libsystemd-network/ndisc-internal.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / libsystemd-network / ndisc-internal.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
1e7a0e21
LP
2#pragma once
3
4/***
5 This file is part of systemd.
6
7 Copyright (C) 2014 Intel Corporation. All rights reserved.
8
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
13
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
21***/
22
23#include "log.h"
24
25#include "sd-ndisc.h"
26
1bd6f895
PF
27#define NDISC_ROUTER_SOLICITATION_INTERVAL (4U * USEC_PER_SEC)
28#define NDISC_MAX_ROUTER_SOLICITATION_INTERVAL (3600U * USEC_PER_SEC)
29#define NDISC_MAX_ROUTER_SOLICITATIONS 3U
30
1e7a0e21
LP
31struct sd_ndisc {
32 unsigned n_ref;
33
34 int ifindex;
35 int fd;
36
37 sd_event *event;
38 int event_priority;
39
40 struct ether_addr mac_addr;
41 uint8_t hop_limit;
42 uint32_t mtu;
43
44 sd_event_source *recv_event_source;
45 sd_event_source *timeout_event_source;
1bd6f895 46 sd_event_source *timeout_no_ra;
1e7a0e21 47
1bd6f895 48 usec_t retransmit_time;
1e7a0e21
LP
49
50 sd_ndisc_callback_t callback;
51 void *userdata;
52};
53
54#define log_ndisc_errno(error, fmt, ...) log_internal(LOG_DEBUG, error, __FILE__, __LINE__, __func__, "NDISC: " fmt, ##__VA_ARGS__)
55#define log_ndisc(fmt, ...) log_ndisc_errno(0, fmt, ##__VA_ARGS__)