]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/sd-radv.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / systemd / sd-radv.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
04473969
PF
2#ifndef foosdradvfoo
3#define foosdradvfoo
4
5/***
810adae9 6 Copyright © 2017 Intel Corporation. All rights reserved.
04473969
PF
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
22#include <inttypes.h>
23#include <net/ethernet.h>
24#include <netinet/in.h>
25#include <sys/types.h>
26
04473969 27#include "_sd-common.h"
a3a98776
LP
28#include "sd-event.h"
29#include "sd-ndisc.h"
04473969
PF
30
31_SD_BEGIN_DECLARATIONS;
32
c555a358
PF
33#define SD_RADV_DEFAULT_MIN_TIMEOUT_USEC (200*USEC_PER_SEC)
34#define SD_RADV_DEFAULT_MAX_TIMEOUT_USEC (600*USEC_PER_SEC)
35
36#define SD_RADV_DEFAULT_DNS_LIFETIME_USEC (3*SD_RADV_DEFAULT_MAX_TIMEOUT_USEC)
37
204f99d2 38typedef struct sd_radv sd_radv;
04473969
PF
39typedef struct sd_radv_prefix sd_radv_prefix;
40
3fe91079 41/* Router Advertisement */
204f99d2
PF
42int sd_radv_new(sd_radv **ret);
43sd_radv *sd_radv_ref(sd_radv *ra);
44sd_radv *sd_radv_unref(sd_radv *ra);
45
46int sd_radv_attach_event(sd_radv *ra, sd_event *event, int64_t priority);
47int sd_radv_detach_event(sd_radv *nd);
48sd_event *sd_radv_get_event(sd_radv *ra);
49
50int sd_radv_start(sd_radv *ra);
51int sd_radv_stop(sd_radv *ra);
52
53int sd_radv_set_ifindex(sd_radv *ra, int interface_index);
54int sd_radv_set_mac(sd_radv *ra, const struct ether_addr *mac_addr);
55int sd_radv_set_mtu(sd_radv *ra, uint32_t mtu);
56int sd_radv_set_hop_limit(sd_radv *ra, uint8_t hop_limit);
57int sd_radv_set_router_lifetime(sd_radv *ra, uint32_t router_lifetime);
58int sd_radv_set_managed_information(sd_radv *ra, int managed);
59int sd_radv_set_other_information(sd_radv *ra, int other);
60int sd_radv_set_preference(sd_radv *ra, unsigned preference);
a3a98776 61int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p, int dynamic);
f5a5706a
LP
62sd_radv_prefix *sd_radv_remove_prefix(sd_radv *ra, const struct in6_addr *prefix,
63 unsigned char prefixlen);
e9c6da38
PF
64int sd_radv_set_rdnss(sd_radv *ra, uint32_t lifetime,
65 const struct in6_addr *dns, size_t n_dns);
e965d6ab 66int sd_radv_set_dnssl(sd_radv *ra, uint32_t lifetime, char **search_list);
204f99d2 67
04473969
PF
68/* Advertised prefixes */
69int sd_radv_prefix_new(sd_radv_prefix **ret);
70sd_radv_prefix *sd_radv_prefix_ref(sd_radv_prefix *ra);
71sd_radv_prefix *sd_radv_prefix_unref(sd_radv_prefix *ra);
72
f5a5706a 73int sd_radv_prefix_set_prefix(sd_radv_prefix *p, const struct in6_addr *in6_addr,
04473969
PF
74 unsigned char prefixlen);
75int sd_radv_prefix_set_onlink(sd_radv_prefix *p, int onlink);
76int sd_radv_prefix_set_address_autoconfiguration(sd_radv_prefix *p,
77 int address_autoconfiguration);
78int sd_radv_prefix_set_valid_lifetime(sd_radv_prefix *p,
79 uint32_t valid_lifetime);
80int sd_radv_prefix_set_preferred_lifetime(sd_radv_prefix *p,
81 uint32_t preferred_lifetime);
82
83_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_radv, sd_radv_unref);
84_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_radv_prefix, sd_radv_prefix_unref);
85
86_SD_END_DECLARATIONS;
87
88#endif