]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/systemd/sd-ipv4ll.h
Merge pull request #7388 from keszybz/doc-tweak
[thirdparty/systemd.git] / src / systemd / sd-ipv4ll.h
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
23 #include <net/ethernet.h>
24 #include <netinet/in.h>
25
26 #include "sd-event.h"
27
28 #include "_sd-common.h"
29
30 _SD_BEGIN_DECLARATIONS;
31
32 enum {
33 SD_IPV4LL_EVENT_STOP = 0,
34 SD_IPV4LL_EVENT_BIND = 1,
35 SD_IPV4LL_EVENT_CONFLICT = 2,
36 };
37
38 typedef struct sd_ipv4ll sd_ipv4ll;
39 typedef void (*sd_ipv4ll_callback_t)(sd_ipv4ll *ll, int event, void *userdata);
40
41 int sd_ipv4ll_detach_event(sd_ipv4ll *ll);
42 int sd_ipv4ll_attach_event(sd_ipv4ll *ll, sd_event *event, int64_t priority);
43 int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address);
44 int sd_ipv4ll_set_callback(sd_ipv4ll *ll, sd_ipv4ll_callback_t cb, void *userdata);
45 int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr);
46 int sd_ipv4ll_set_ifindex(sd_ipv4ll *ll, int interface_index);
47 int sd_ipv4ll_set_address(sd_ipv4ll *ll, const struct in_addr *address);
48 int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, uint64_t seed);
49 int sd_ipv4ll_is_running(sd_ipv4ll *ll);
50 int sd_ipv4ll_restart(sd_ipv4ll *ll);
51 int sd_ipv4ll_start(sd_ipv4ll *ll);
52 int sd_ipv4ll_stop(sd_ipv4ll *ll);
53 sd_ipv4ll *sd_ipv4ll_ref(sd_ipv4ll *ll);
54 sd_ipv4ll *sd_ipv4ll_unref(sd_ipv4ll *ll);
55 int sd_ipv4ll_new(sd_ipv4ll **ret);
56
57 _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ipv4ll, sd_ipv4ll_unref);
58
59 _SD_END_DECLARATIONS;
60
61 #endif