]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/systemd/sd-ndisc.h
Merge pull request #31000 from flatcar-hub/krnowak/mutable-overlays
[thirdparty/systemd.git] / src / systemd / sd-ndisc.h
CommitLineData
db9ecf05 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
3ad0c5d8
TG
2#ifndef foosdndiscfoo
3#define foosdndiscfoo
e3169126
PF
4
5/***
810adae9 6 Copyright © 2014 Intel Corporation. All rights reserved.
e3169126
PF
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
85fce6f4 19 along with systemd; If not, see <https://www.gnu.org/licenses/>.
e3169126
PF
20***/
21
2d93c20e 22#include <errno.h>
04c01369 23#include <inttypes.h>
e3169126 24#include <net/ethernet.h>
1e7a0e21
LP
25#include <netinet/in.h>
26#include <sys/types.h>
e3169126
PF
27
28#include "sd-event.h"
ca34b434
YW
29#include "sd-ndisc-protocol.h"
30#include "sd-ndisc-router.h"
71d35b6b 31
04c01369
LP
32#include "_sd-common.h"
33
34_SD_BEGIN_DECLARATIONS;
e3169126 35
4d7b83da 36typedef struct sd_ndisc sd_ndisc;
e3169126 37
5476cb98 38__extension__ typedef enum sd_ndisc_event_t {
a2dcda32
YW
39 SD_NDISC_EVENT_TIMEOUT,
40 SD_NDISC_EVENT_ROUTER,
41 _SD_NDISC_EVENT_MAX,
2d93c20e 42 _SD_NDISC_EVENT_INVALID = -EINVAL,
5476cb98 43 _SD_ENUM_FORCE_S64(NDISC_EVENT)
2324fd3a 44} sd_ndisc_event_t;
e3169126 45
28eef158 46typedef void (*sd_ndisc_callback_t)(sd_ndisc *nd, sd_ndisc_event_t event, void *message, void *userdata);
e3169126 47
1e7a0e21 48int sd_ndisc_new(sd_ndisc **ret);
4d7b83da
TG
49sd_ndisc *sd_ndisc_ref(sd_ndisc *nd);
50sd_ndisc *sd_ndisc_unref(sd_ndisc *nd);
ca34b434 51_SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ndisc, sd_ndisc_unref);
d14b5bc6 52
1e7a0e21 53int sd_ndisc_start(sd_ndisc *nd);
4d7b83da 54int sd_ndisc_stop(sd_ndisc *nd);
787e71e4 55int sd_ndisc_is_running(sd_ndisc *nd);
e3169126 56
1e7a0e21
LP
57int sd_ndisc_attach_event(sd_ndisc *nd, sd_event *event, int64_t priority);
58int sd_ndisc_detach_event(sd_ndisc *nd);
59sd_event *sd_ndisc_get_event(sd_ndisc *nd);
60
61int sd_ndisc_set_callback(sd_ndisc *nd, sd_ndisc_callback_t cb, void *userdata);
62int sd_ndisc_set_ifindex(sd_ndisc *nd, int interface_index);
61a9fa8f 63int sd_ndisc_set_ifname(sd_ndisc *nd, const char *interface_name);
5977b71f 64int sd_ndisc_get_ifname(sd_ndisc *nd, const char **ret);
1e7a0e21 65int sd_ndisc_set_mac(sd_ndisc *nd, const struct ether_addr *mac_addr);
d77bde34 66
04c01369
LP
67_SD_END_DECLARATIONS;
68
e3169126 69#endif