]>
Commit | Line | Data |
---|---|---|
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 | 36 | typedef struct sd_radv sd_radv; |
04473969 PF |
37 | typedef struct sd_radv_prefix sd_radv_prefix; |
38 | ||
204f99d2 PF |
39 | /* Router Advertisment */ |
40 | int sd_radv_new(sd_radv **ret); | |
41 | sd_radv *sd_radv_ref(sd_radv *ra); | |
42 | sd_radv *sd_radv_unref(sd_radv *ra); | |
43 | ||
44 | int sd_radv_attach_event(sd_radv *ra, sd_event *event, int64_t priority); | |
45 | int sd_radv_detach_event(sd_radv *nd); | |
46 | sd_event *sd_radv_get_event(sd_radv *ra); | |
47 | ||
48 | int sd_radv_start(sd_radv *ra); | |
49 | int sd_radv_stop(sd_radv *ra); | |
50 | ||
51 | int sd_radv_set_ifindex(sd_radv *ra, int interface_index); | |
52 | int sd_radv_set_mac(sd_radv *ra, const struct ether_addr *mac_addr); | |
53 | int sd_radv_set_mtu(sd_radv *ra, uint32_t mtu); | |
54 | int sd_radv_set_hop_limit(sd_radv *ra, uint8_t hop_limit); | |
55 | int sd_radv_set_router_lifetime(sd_radv *ra, uint32_t router_lifetime); | |
56 | int sd_radv_set_managed_information(sd_radv *ra, int managed); | |
57 | int sd_radv_set_other_information(sd_radv *ra, int other); | |
58 | int sd_radv_set_preference(sd_radv *ra, unsigned preference); | |
59 | int sd_radv_add_prefix(sd_radv *ra, sd_radv_prefix *p); | |
60 | ||
04473969 PF |
61 | /* Advertised prefixes */ |
62 | int sd_radv_prefix_new(sd_radv_prefix **ret); | |
63 | sd_radv_prefix *sd_radv_prefix_ref(sd_radv_prefix *ra); | |
64 | sd_radv_prefix *sd_radv_prefix_unref(sd_radv_prefix *ra); | |
65 | ||
66 | int sd_radv_prefix_set_prefix(sd_radv_prefix *p, struct in6_addr *in6_addr, | |
67 | unsigned char prefixlen); | |
68 | int sd_radv_prefix_set_onlink(sd_radv_prefix *p, int onlink); | |
69 | int sd_radv_prefix_set_address_autoconfiguration(sd_radv_prefix *p, | |
70 | int address_autoconfiguration); | |
71 | int sd_radv_prefix_set_valid_lifetime(sd_radv_prefix *p, | |
72 | uint32_t valid_lifetime); | |
73 | int 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 |