diff options
Diffstat (limited to 'src/monitor')
-rw-r--r-- | src/monitor/monitor.c | 12 | ||||
-rw-r--r-- | src/monitor/monitor_iface.xml | 41 | ||||
-rw-r--r-- | src/monitor/monitor_iface_generated.c | 92 | ||||
-rw-r--r-- | src/monitor/monitor_iface_generated.h | 56 | ||||
-rw-r--r-- | src/monitor/monitor_interfaces.h | 2 |
5 files changed, 196 insertions, 7 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 8a0844bbc..c2e5a5af6 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -523,17 +523,15 @@ static int add_services_startup_timeout(struct mt_ctx *ctx) return EOK; } -struct sbus_method monitor_methods[] = { - { MON_SRV_METHOD_VERSION, get_monitor_version }, - { MON_SRV_METHOD_REGISTER, client_registration }, - { NULL, NULL } +struct mon_srv_iface monitor_methods = { + { &mon_srv_iface_meta, 0 }, + .getVersion = get_monitor_version, + .RegisterService = client_registration, }; struct sbus_interface monitor_server_interface = { - MON_SRV_INTERFACE, MON_SRV_PATH, - SBUS_DEFAULT_VTABLE, - monitor_methods, + &monitor_methods.vtable, NULL }; diff --git a/src/monitor/monitor_iface.xml b/src/monitor/monitor_iface.xml new file mode 100644 index 000000000..506b749c8 --- /dev/null +++ b/src/monitor/monitor_iface.xml @@ -0,0 +1,41 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node> + <interface name="org.freedesktop.sssd.monitor"> + <annotation value="mon_srv_iface" name="org.freedesktop.DBus.GLib.CSymbol"/> + <method name="getVersion"> + <!-- manual argument parsing --> + </method> + <method name="RegisterService"> + <!-- manual argument parsing --> + </method> + </interface> + + <interface name="org.freedesktop.sssd.service"> + <annotation value="mon_cli_iface" name="org.freedesktop.DBus.GLib.CSymbol"/> + <method name="ping"> + <!-- no arguments --> + </method> + <method name="resInit"> + <!-- no arguments --> + </method> + <method name="shutDown"> + <!-- no arguments --> + </method> + <method name="goOffline"> + <!-- no arguments --> + </method> + <method name="resetOffline"> + <!-- no arguments --> + </method> + <method name="rotateLogs"> + <!-- no arguments --> + </method> + <method name="clearMemcache"> + <!-- no arguments --> + </method> + <method name="clearEnumCache"> + <!-- no arguments --> + </method> + </interface> +</node> diff --git a/src/monitor/monitor_iface_generated.c b/src/monitor/monitor_iface_generated.c new file mode 100644 index 000000000..81a7c247a --- /dev/null +++ b/src/monitor/monitor_iface_generated.c @@ -0,0 +1,92 @@ +/* The following definitions are auto-generated from monitor_iface.xml */ + +#include "util/util.h" +#include "sbus/sssd_dbus.h" +#include "sbus/sssd_dbus_meta.h" +#include "monitor_iface_generated.h" + +/* methods for org.freedesktop.sssd.monitor */ +const struct sbus_method_meta mon_srv_iface__methods[] = { + { + "getVersion", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_srv_iface, getVersion), + }, + { + "RegisterService", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_srv_iface, RegisterService), + }, + { NULL, } +}; + +/* interface info for org.freedesktop.sssd.monitor */ +const struct sbus_interface_meta mon_srv_iface_meta = { + "org.freedesktop.sssd.monitor", /* name */ + mon_srv_iface__methods, + NULL, /* no signals */ + NULL, /* no propetries */ +}; + +/* methods for org.freedesktop.sssd.service */ +const struct sbus_method_meta mon_cli_iface__methods[] = { + { + "ping", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_cli_iface, ping), + }, + { + "resInit", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_cli_iface, resInit), + }, + { + "shutDown", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_cli_iface, shutDown), + }, + { + "goOffline", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_cli_iface, goOffline), + }, + { + "resetOffline", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_cli_iface, resetOffline), + }, + { + "rotateLogs", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_cli_iface, rotateLogs), + }, + { + "clearMemcache", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_cli_iface, clearMemcache), + }, + { + "clearEnumCache", /* name */ + NULL, /* no in_args */ + NULL, /* no out_args */ + offsetof(struct mon_cli_iface, clearEnumCache), + }, + { NULL, } +}; + +/* interface info for org.freedesktop.sssd.service */ +const struct sbus_interface_meta mon_cli_iface_meta = { + "org.freedesktop.sssd.service", /* name */ + mon_cli_iface__methods, + NULL, /* no signals */ + NULL, /* no propetries */ +}; diff --git a/src/monitor/monitor_iface_generated.h b/src/monitor/monitor_iface_generated.h new file mode 100644 index 000000000..cde774985 --- /dev/null +++ b/src/monitor/monitor_iface_generated.h @@ -0,0 +1,56 @@ +/* The following declarations are auto-generated from monitor_iface.xml */ + +#ifndef __MONITOR_IFACE_XML__ +#define __MONITOR_IFACE_XML__ + +#include "sbus/sssd_dbus.h" + +/* ------------------------------------------------------------------------ + * DBus Vtable handler structures + * + * These structures are filled in by implementors of the different + * dbus interfaces to handle method calls. + * + * Handler functions of type sbus_msg_handler_fn accept raw messages, + * other handlers will be typed appropriately. If a handler that is + * set to NULL is invoked it will result in a + * org.freedesktop.DBus.Error.NotSupported error for the caller. + */ + +/* vtable for org.freedesktop.sssd.monitor */ +struct mon_srv_iface { + struct sbus_vtable vtable; /* derive from sbus_vtable */ + sbus_msg_handler_fn getVersion; + sbus_msg_handler_fn RegisterService; +}; + +/* vtable for org.freedesktop.sssd.service */ +struct mon_cli_iface { + struct sbus_vtable vtable; /* derive from sbus_vtable */ + sbus_msg_handler_fn ping; + sbus_msg_handler_fn resInit; + sbus_msg_handler_fn shutDown; + sbus_msg_handler_fn goOffline; + sbus_msg_handler_fn resetOffline; + sbus_msg_handler_fn rotateLogs; + sbus_msg_handler_fn clearMemcache; + sbus_msg_handler_fn clearEnumCache; +}; + +/* ------------------------------------------------------------------------ + * DBus Interface Metadata + * + * These structure definitions are filled in with the information about + * the interfaces, methods, properties and so on. + * + * The actual definitions are found in the accompanying C file next + * to this header. + */ + +/* interface info for org.freedesktop.sssd.monitor */ +extern const struct sbus_interface_meta mon_srv_iface_meta; + +/* interface info for org.freedesktop.sssd.service */ +extern const struct sbus_interface_meta mon_cli_iface_meta; + +#endif /* __MONITOR_IFACE_XML__ */ diff --git a/src/monitor/monitor_interfaces.h b/src/monitor/monitor_interfaces.h index f27c7d00c..308642f78 100644 --- a/src/monitor/monitor_interfaces.h +++ b/src/monitor/monitor_interfaces.h @@ -21,6 +21,8 @@ #include "sbus/sssd_dbus.h" +#include "monitor/monitor_iface_generated.h" + /*** Monitor ***/ #define MONITOR_VERSION 0x0001 |