]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/systemd/sd-ipv4ll.h
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / systemd / sd-ipv4ll.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #ifndef foosdipv4llfoo
3 #define foosdipv4llfoo
4
5 /***
6 This file is part of systemd.
7
8 Copyright (C) 2014 Axis Communications AB. All rights reserved.
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 ***/
23
24 #include <net/ethernet.h>
25 #include <netinet/in.h>
26
27 #include "sd-event.h"
28
29 #include "_sd-common.h"
30
31 _SD_BEGIN_DECLARATIONS;
32
33 enum {
34 SD_IPV4LL_EVENT_STOP = 0,
35 SD_IPV4LL_EVENT_BIND = 1,
36 SD_IPV4LL_EVENT_CONFLICT = 2,
37 };
38
39 typedef struct sd_ipv4ll sd_ipv4ll;
40 typedef void (*sd_ipv4ll_callback_t)(sd_ipv4ll *ll, int event, void *userdata);
41
42 int sd_ipv4ll_detach_event(sd_ipv4ll *ll);
43 int sd_ipv4ll_attach_event(sd_ipv4ll *ll, sd_event *event, int64_t priority);
44 int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address);
45 int sd_ipv4ll_set_callback(sd_ipv4ll *ll, sd_ipv4ll_callback_t cb, void *userdata);
46 int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr);
47 int sd_ipv4ll_set_ifindex(sd_ipv4ll *ll, int interface_index);
48 int sd_ipv4ll_set_address(sd_ipv4ll *ll, const struct in_addr *address);
49 int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, uint64_t seed);
50 int sd_ipv4ll_is_running(sd_ipv4ll *ll);
51 int sd_ipv4ll_restart(sd_ipv4ll *ll);
52 int sd_ipv4ll_start(sd_ipv4ll *ll);
53 int sd_ipv4ll_stop(sd_ipv4ll *ll);
54 sd_ipv4ll *sd_ipv4ll_ref(sd_ipv4ll *ll);
55 sd_ipv4ll *sd_ipv4ll_unref(sd_ipv4ll *ll);
56 int sd_ipv4ll_new(sd_ipv4ll **ret);
57
58 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ipv4ll, sd_ipv4ll_unref);
59
60 _SD_END_DECLARATIONS;
61
62 #endif