chiark / gitweb /
libsystemd: add sd-hwdb library
[elogind.git] / src / systemd / sd-icmp6-nd.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef foosdicmp6ndfoo
4 #define foosdicmp6ndfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright (C) 2014 Intel Corporation. All rights reserved.
10
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.
15
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.
20
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/>.
23 ***/
24
25 #include <net/ethernet.h>
26
27 #include "sd-event.h"
28
29 enum {
30         ICMP6_EVENT_ROUTER_ADVERTISMENT_NONE    = 0,
31         ICMP6_EVENT_ROUTER_ADVERTISMENT_TIMEOUT = 1,
32         ICMP6_EVENT_ROUTER_ADVERTISMENT_OTHER   = 2,
33         ICMP6_EVENT_ROUTER_ADVERTISMENT_MANAGED = 3,
34 };
35
36 typedef struct sd_icmp6_nd sd_icmp6_nd;
37
38 typedef void(*sd_icmp6_nd_callback_t)(sd_icmp6_nd *nd, int event,
39                                       void *userdata);
40
41 int sd_icmp6_nd_set_callback(sd_icmp6_nd *nd, sd_icmp6_nd_callback_t cb,
42                              void *userdata);
43 int sd_icmp6_nd_set_index(sd_icmp6_nd *nd, int interface_index);
44 int sd_icmp6_nd_set_mac(sd_icmp6_nd *nd, const struct ether_addr *mac_addr);
45
46 int sd_icmp6_nd_attach_event(sd_icmp6_nd *nd, sd_event *event, int priority);
47 int sd_icmp6_nd_detach_event(sd_icmp6_nd *nd);
48 sd_event *sd_icmp6_nd_get_event(sd_icmp6_nd *nd);
49
50 sd_icmp6_nd *sd_icmp6_nd_ref(sd_icmp6_nd *nd);
51 sd_icmp6_nd *sd_icmp6_nd_unref(sd_icmp6_nd *nd);
52 int sd_icmp6_nd_new(sd_icmp6_nd **ret);
53
54 int sd_icmp6_nd_stop(sd_icmp6_nd *nd);
55 int sd_icmp6_router_solicitation_start(sd_icmp6_nd *nd);
56
57 #endif