]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/sd-radv.h
networkd: Parse DNS IPv6 information for Router Advertisement
[thirdparty/systemd.git] / src / systemd / sd-radv.h
CommitLineData
04473969
PF
1#ifndef foosdradvfoo
2#define foosdradvfoo
3
4/***
5 This file is part of systemd.
6
7 Copyright (C) 2017 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 <inttypes.h>
24#include <net/ethernet.h>
25#include <netinet/in.h>
26#include <sys/types.h>
27
204f99d2
PF
28#include "sd-ndisc.h"
29
04473969
PF
30#include "sd-event.h"
31
32#include "_sd-common.h"
33
34_SD_BEGIN_DECLARATIONS;
35
204f99d2 36typedef struct sd_radv sd_radv;
04473969
PF
37typedef struct sd_radv_prefix sd_radv_prefix;
38
204f99d2
PF
39/* Router Advertisment */
40int sd_radv_new(sd_radv **ret);
41sd_radv *sd_radv_ref(sd_radv *ra);
42sd_radv *sd_radv_unref(sd_radv *ra);
43
44int sd_radv_attach_event(sd_radv *ra, sd_event *event, int64_t priority);
45int sd_radv_detach_event(sd_radv *nd);
46sd_event *sd_radv_get_event(sd_radv *ra);
47
48int sd_radv_start(sd_radv *ra);
49int sd_radv_stop(sd_radv *ra);
50
51int sd_radv_set_ifindex(sd_radv *ra, int interface_index);
52int sd_radv_set_mac(sd_radv *ra, const struct ether_addr *mac_addr);
53int sd_radv_set_mtu(sd_radv *ra, uint32_t mtu);
54int sd_radv_set_hop_limit(sd_radv *ra, uint8_t hop_limit);
55int sd_radv_set_router_lifetime(sd_radv *ra, uint32_t router_lifetime);
56int sd_radv_set_managed_information(sd_radv *ra, int managed);
57int sd_radv_set_other_information(sd_radv *ra, int other);
58int sd_radv_set_preference(sd_radv *ra, unsigned preference);
59int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p);
60
04473969
PF
61/* Advertised prefixes */
62int sd_radv_prefix_new(sd_radv_prefix **ret);
63sd_radv_prefix *sd_radv_prefix_ref(sd_radv_prefix *ra);
64sd_radv_prefix *sd_radv_prefix_unref(sd_radv_prefix *ra);
65
66int sd_radv_prefix_set_prefix(sd_radv_prefix *p, struct in6_addr *in6_addr,
67 unsigned char prefixlen);
68int sd_radv_prefix_set_onlink(sd_radv_prefix *p, int onlink);
69int sd_radv_prefix_set_address_autoconfiguration(sd_radv_prefix *p,
70 int address_autoconfiguration);
71int sd_radv_prefix_set_valid_lifetime(sd_radv_prefix *p,
72 uint32_t valid_lifetime);
73int sd_radv_prefix_set_preferred_lifetime(sd_radv_prefix *p,
74 uint32_t preferred_lifetime);
75
76_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_radv, sd_radv_unref);
77_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_radv_prefix, sd_radv_prefix_unref);
78
79_SD_END_DECLARATIONS;
80
81#endif