1 /*#############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2023 IPFire Network Development Team #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 #############################################################################*/
21 #include <systemd/sd-bus.h>
27 static int nw_daemon_bus_reload(sd_bus_message
* m
, void* data
, sd_bus_error
* error
) {
28 struct nw_daemon
* daemon
= (struct nw_daemon
*)data
;
31 nw_daemon_reload(daemon
);
33 // Respond with an empty message
34 return sd_bus_reply_method_return(m
, NULL
);
37 static const sd_bus_vtable daemon_vtable
[] = {
38 SD_BUS_VTABLE_START(0),
39 SD_BUS_METHOD("Reload", SD_BUS_NO_ARGS
, SD_BUS_NO_RESULT
,
40 nw_daemon_bus_reload
, SD_BUS_VTABLE_UNPRIVILEGED
),
44 const struct nw_bus_implementation daemon_bus_impl
= {
45 .path
= "/org/ipfire/network1",
46 .interface
= "org.ipfire.network1",
47 .vtables
= BUS_VTABLES(daemon_vtable
),
48 .children
= BUS_IMPLEMENTATIONS(&zone_bus_impl
),