1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
7 This file is part of systemd.
9 Copyright (C) 2014 Axis Communications AB. All rights reserved.
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
26 #include <netinet/in.h>
27 #include <net/ethernet.h>
32 IPV4LL_EVENT_STOP = 0,
33 IPV4LL_EVENT_BIND = 1,
34 IPV4LL_EVENT_CONFLICT = 2,
37 typedef struct sd_ipv4ll sd_ipv4ll;
38 typedef void (*sd_ipv4ll_cb_t)(sd_ipv4ll *ll, int event, void *userdata);
40 int sd_ipv4ll_detach_event(sd_ipv4ll *ll);
41 int sd_ipv4ll_attach_event(sd_ipv4ll *ll, sd_event *event, int priority);
42 int sd_ipv4ll_get_address(sd_ipv4ll *ll, struct in_addr *address);
43 int sd_ipv4ll_set_callback(sd_ipv4ll *ll, sd_ipv4ll_cb_t cb, void *userdata);
44 int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr);
45 int sd_ipv4ll_set_index(sd_ipv4ll *ll, int interface_index);
46 int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, uint8_t seed[8]);
47 bool sd_ipv4ll_is_running(sd_ipv4ll *ll);
48 int sd_ipv4ll_start(sd_ipv4ll *ll);
49 int sd_ipv4ll_stop(sd_ipv4ll *ll);
50 sd_ipv4ll *sd_ipv4ll_ref(sd_ipv4ll *ll);
51 sd_ipv4ll *sd_ipv4ll_unref(sd_ipv4ll *ll);
52 int sd_ipv4ll_new (sd_ipv4ll **ret);