summaryrefslogtreecommitdiff
path: root/src/systemd/sd-icmp6-nd.h
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2014-06-19 15:38:55 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2014-06-19 15:44:43 +0300
commite3169126793f43be3d840874ffb3935a51097001 (patch)
tree561a32f301cdb77cc09e82fade829857b2bf02ab /src/systemd/sd-icmp6-nd.h
parent139b011ab81ccea1d51f09e0261a1c390115c6ff (diff)
sd-icmp6-nd: Add Router Solicitation and Advertisement support
Provide functions to bind the ICMPv6 socket to the approriate interface and set multicast sending and receiving according to RFC 3493, section 5.2. and RFC 3542, sections 3. and 3.3. Filter out all ICMPv6 messages except Router Advertisements for the socket in question according to RFC 3542, section 3.2. Send Router Solicitations to the all routers multicast group as described in RFC 4861, section 6. and act on the received Router Advertisments according to section 6.3.7. Implement a similar API for ICMPv6 handling as is done for DHCPv4 and DHCPv6.
Diffstat (limited to 'src/systemd/sd-icmp6-nd.h')
-rw-r--r--src/systemd/sd-icmp6-nd.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/systemd/sd-icmp6-nd.h b/src/systemd/sd-icmp6-nd.h
new file mode 100644
index 000000000..5e9dc0aa2
--- /dev/null
+++ b/src/systemd/sd-icmp6-nd.h
@@ -0,0 +1,56 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#ifndef foosdicmp6ndfoo
+#define foosdicmp6ndfoo
+
+/***
+ This file is part of systemd.
+
+ Copyright (C) 2014 Intel Corporation. All rights reserved.
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <net/ethernet.h>
+
+#include "sd-event.h"
+
+enum {
+ ICMP6_EVENT_ROUTER_ADVERTISMENT_NONE = 0,
+ ICMP6_EVENT_ROUTER_ADVERTISMENT_TIMEOUT = 1,
+ ICMP6_EVENT_ROUTER_ADVERTISMENT_OTHER = 2,
+ ICMP6_EVENT_ROUTER_ADVERTISMENT_MANAGED = 3,
+};
+
+typedef struct sd_icmp6_nd sd_icmp6_nd;
+
+typedef void(*sd_icmp6_nd_callback_t)(sd_icmp6_nd *nd, int event,
+ void *userdata);
+
+int sd_icmp6_nd_set_callback(sd_icmp6_nd *nd, sd_icmp6_nd_callback_t cb,
+ void *userdata);
+int sd_icmp6_nd_set_index(sd_icmp6_nd *nd, int interface_index);
+int sd_icmp6_nd_set_mac(sd_icmp6_nd *nd, const struct ether_addr *mac_addr);
+
+int sd_icmp6_nd_attach_event(sd_icmp6_nd *nd, sd_event *event, int priority);
+int sd_icmp6_nd_detach_event(sd_icmp6_nd *nd);
+sd_event *sd_icmp6_nd_get_event(sd_icmp6_nd *nd);
+
+sd_icmp6_nd *sd_icmp6_nd_ref(sd_icmp6_nd *nd);
+sd_icmp6_nd *sd_icmp6_nd_unref(sd_icmp6_nd *nd);
+int sd_icmp6_nd_new(sd_icmp6_nd **ret);
+
+int sd_icmp6_router_solicitation_start(sd_icmp6_nd *nd);
+
+#endif