]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/sd-ipv4ll.h
libsystemd-network: sd-ipv4ll: Wrapper to restart address aquisition after conflict
[thirdparty/systemd.git] / src / systemd / sd-ipv4ll.h
CommitLineData
5c1d3fc9
UTL
1#ifndef foosdipv4llfoo
2#define foosdipv4llfoo
3
4/***
5 This file is part of systemd.
6
7 Copyright (C) 2014 Axis Communications AB. 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
5c1d3fc9 23#include <net/ethernet.h>
71d35b6b 24#include <netinet/in.h>
5c1d3fc9
UTL
25
26#include "sd-event.h"
71d35b6b 27
04c01369
LP
28#include "_sd-common.h"
29
30_SD_BEGIN_DECLARATIONS;
5c1d3fc9
UTL
31
32enum {
be19c5b5
DH
33 SD_IPV4LL_EVENT_STOP = 0,
34 SD_IPV4LL_EVENT_BIND = 1,
35 SD_IPV4LL_EVENT_CONFLICT = 2,
5c1d3fc9
UTL
36};
37
38typedef struct sd_ipv4ll sd_ipv4ll;
ccf86354 39typedef void (*sd_ipv4ll_callback_t)(sd_ipv4ll *ll, int event, void *userdata);
5c1d3fc9
UTL
40
41int sd_ipv4ll_detach_event(sd_ipv4ll *ll);
32d20645 42int sd_ipv4ll_attach_event(sd_ipv4ll *ll, sd_event *event, int64_t priority);
5c1d3fc9 43int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address);
ccf86354 44int sd_ipv4ll_set_callback(sd_ipv4ll *ll, sd_ipv4ll_callback_t cb, void *userdata);
5c1d3fc9 45int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr);
2f8e7633 46int sd_ipv4ll_set_ifindex(sd_ipv4ll *ll, int interface_index);
129dc1b4 47int sd_ipv4ll_set_address(sd_ipv4ll *ll, const struct in_addr *address);
38958cd6 48int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, uint64_t seed);
04c01369 49int sd_ipv4ll_is_running(sd_ipv4ll *ll);
5e25a13a 50int sd_ipv4ll_restart(sd_ipv4ll *ll);
aba496a5
UTL
51int sd_ipv4ll_start(sd_ipv4ll *ll);
52int sd_ipv4ll_stop(sd_ipv4ll *ll);
56cd007a
PF
53sd_ipv4ll *sd_ipv4ll_ref(sd_ipv4ll *ll);
54sd_ipv4ll *sd_ipv4ll_unref(sd_ipv4ll *ll);
73e94c0d 55int sd_ipv4ll_new(sd_ipv4ll **ret);
5c1d3fc9 56
4afd3348
LP
57_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ipv4ll, sd_ipv4ll_unref);
58
04c01369
LP
59_SD_END_DECLARATIONS;
60
5c1d3fc9 61#endif