]> git.proxmox.com Git - systemd.git/blame - src/systemd/sd-ipv4acd.h
New upstream version 249~rc1
[systemd.git] / src / systemd / sd-ipv4acd.h
CommitLineData
a032b68d 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
6300502b
MP
2#ifndef foosdipv4acdfoo
3#define foosdipv4acdfoo
4
5/***
b012e921 6 Copyright © 2014 Axis Communications AB. All rights reserved.
6300502b
MP
7 systemd is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version.
11
12 systemd is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with systemd; If not, see <http://www.gnu.org/licenses/>.
19***/
20
6300502b 21#include <net/ethernet.h>
4c89c718 22#include <netinet/in.h>
763f54ad 23#include <stdbool.h>
6300502b
MP
24
25#include "sd-event.h"
4c89c718 26
db2df898
MP
27#include "_sd-common.h"
28
29_SD_BEGIN_DECLARATIONS;
6300502b
MP
30
31enum {
32 SD_IPV4ACD_EVENT_STOP = 0,
33 SD_IPV4ACD_EVENT_BIND = 1,
34 SD_IPV4ACD_EVENT_CONFLICT = 2,
35};
36
37typedef struct sd_ipv4acd sd_ipv4acd;
5a920b42
MP
38typedef void (*sd_ipv4acd_callback_t)(sd_ipv4acd *acd, int event, void *userdata);
39
40int sd_ipv4acd_detach_event(sd_ipv4acd *acd);
41int sd_ipv4acd_attach_event(sd_ipv4acd *acd, sd_event *event, int64_t priority);
42int sd_ipv4acd_get_address(sd_ipv4acd *acd, struct in_addr *address);
43int sd_ipv4acd_set_callback(sd_ipv4acd *acd, sd_ipv4acd_callback_t cb, void *userdata);
44int sd_ipv4acd_set_mac(sd_ipv4acd *acd, const struct ether_addr *addr);
45int sd_ipv4acd_set_ifindex(sd_ipv4acd *acd, int interface_index);
3a6ce677 46int sd_ipv4acd_get_ifindex(sd_ipv4acd *acd);
8b3d4ff0 47int sd_ipv4acd_set_ifname(sd_ipv4acd *acd, const char *interface_name);
3a6ce677 48const char *sd_ipv4acd_get_ifname(sd_ipv4acd *acd);
5a920b42
MP
49int sd_ipv4acd_set_address(sd_ipv4acd *acd, const struct in_addr *address);
50int sd_ipv4acd_is_running(sd_ipv4acd *acd);
763f54ad 51int sd_ipv4acd_start(sd_ipv4acd *acd, bool reset_conflicts);
5a920b42
MP
52int sd_ipv4acd_stop(sd_ipv4acd *acd);
53sd_ipv4acd *sd_ipv4acd_ref(sd_ipv4acd *acd);
54sd_ipv4acd *sd_ipv4acd_unref(sd_ipv4acd *acd);
4c89c718
MP
55int sd_ipv4acd_new(sd_ipv4acd **ret);
56
57_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ipv4acd, sd_ipv4acd_unref);
6300502b 58
db2df898
MP
59_SD_END_DECLARATIONS;
60
6300502b 61#endif