04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina/* The following definitions are auto-generated from nss_iface.xml */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina
054900ab42a8b865a2257f94c66484e0a022a90cLukas Slebodnik#include <stddef.h>
054900ab42a8b865a2257f94c66484e0a022a90cLukas Slebodnik
054900ab42a8b865a2257f94c66484e0a022a90cLukas Slebodnik#include "dbus/dbus-protocol.h"
054900ab42a8b865a2257f94c66484e0a022a90cLukas Slebodnik#include "util/util_errors.h"
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina#include "sbus/sssd_dbus.h"
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina#include "sbus/sssd_dbus_meta.h"
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina#include "sbus/sssd_dbus_invokers.h"
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina#include "nss_iface_generated.h"
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina/* invokes a handler with a 'ssau' DBus signature */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinastatic int invoke_ssau_method(struct sbus_request *dbus_req, void *function_ptr);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio/* invokes a handler with a 'u' DBus signature */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidênciostatic int invoke_u_method(struct sbus_request *dbus_req, void *function_ptr);
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina/* arguments for org.freedesktop.sssd.nss.MemoryCache.UpdateInitgroups */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinaconst struct sbus_arg_meta iface_nss_memorycache_UpdateInitgroups__in[] = {
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina { "user", "s" },
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina { "domain", "s" },
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina { "groups", "au" },
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina { NULL, }
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina};
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinaint iface_nss_memorycache_UpdateInitgroups_finish(struct sbus_request *req)
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina{
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina return sbus_request_return_and_finish(req,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina DBUS_TYPE_INVALID);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina}
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozekint iface_nss_memorycache_InvalidateAllUsers_finish(struct sbus_request *req)
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek{
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek return sbus_request_return_and_finish(req,
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek DBUS_TYPE_INVALID);
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek}
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozekint iface_nss_memorycache_InvalidateAllGroups_finish(struct sbus_request *req)
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek{
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek return sbus_request_return_and_finish(req,
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek DBUS_TYPE_INVALID);
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek}
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek
f2047f6c5b56d6759bd8e6d504f572a593476c65Pavel Březinaint iface_nss_memorycache_InvalidateAllInitgroups_finish(struct sbus_request *req)
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek{
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek return sbus_request_return_and_finish(req,
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek DBUS_TYPE_INVALID);
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek}
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio/* arguments for org.freedesktop.sssd.nss.MemoryCache.InvalidateGroupById */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncioconst struct sbus_arg_meta iface_nss_memorycache_InvalidateGroupById__in[] = {
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio { "gid", "u" },
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio { NULL, }
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio};
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncioint iface_nss_memorycache_InvalidateGroupById_finish(struct sbus_request *req)
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio{
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio return sbus_request_return_and_finish(req,
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio DBUS_TYPE_INVALID);
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio}
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina/* methods for org.freedesktop.sssd.nss.MemoryCache */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinaconst struct sbus_method_meta iface_nss_memorycache__methods[] = {
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina {
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina "UpdateInitgroups", /* name */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina iface_nss_memorycache_UpdateInitgroups__in,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina NULL, /* no out_args */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina offsetof(struct iface_nss_memorycache, UpdateInitgroups),
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina invoke_ssau_method,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina },
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek {
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek "InvalidateAllUsers", /* name */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek NULL, /* no in_args */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek NULL, /* no out_args */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek offsetof(struct iface_nss_memorycache, InvalidateAllUsers),
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek NULL, /* no invoker */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek },
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek {
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek "InvalidateAllGroups", /* name */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek NULL, /* no in_args */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek NULL, /* no out_args */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek offsetof(struct iface_nss_memorycache, InvalidateAllGroups),
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek NULL, /* no invoker */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek },
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek {
f2047f6c5b56d6759bd8e6d504f572a593476c65Pavel Březina "InvalidateAllInitgroups", /* name */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek NULL, /* no in_args */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek NULL, /* no out_args */
f2047f6c5b56d6759bd8e6d504f572a593476c65Pavel Březina offsetof(struct iface_nss_memorycache, InvalidateAllInitgroups),
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek NULL, /* no invoker */
c3a225d4d735d3a01883125592dda7a030a64e00Jakub Hrozek },
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio {
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio "InvalidateGroupById", /* name */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio iface_nss_memorycache_InvalidateGroupById__in,
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio NULL, /* no out_args */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio offsetof(struct iface_nss_memorycache, InvalidateGroupById),
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio invoke_u_method,
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio },
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina { NULL, }
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina};
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina/* interface info for org.freedesktop.sssd.nss.MemoryCache */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinaconst struct sbus_interface_meta iface_nss_memorycache_meta = {
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina "org.freedesktop.sssd.nss.MemoryCache", /* name */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina iface_nss_memorycache__methods,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina NULL, /* no signals */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina NULL, /* no properties */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina sbus_invoke_get_all, /* GetAll invoker */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina};
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio/* invokes a handler with a 'u' DBus signature */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidênciostatic int invoke_u_method(struct sbus_request *dbus_req, void *function_ptr)
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio{
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio uint32_t arg_0;
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio int (*handler)(struct sbus_request *, void *, uint32_t) = function_ptr;
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio if (!sbus_request_parse_or_finish(dbus_req,
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio DBUS_TYPE_UINT32, &arg_0,
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio DBUS_TYPE_INVALID)) {
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio return EOK; /* request handled */
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio }
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio return (handler)(dbus_req, dbus_req->intf->handler_data,
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio arg_0);
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio}
851d31264c826d7e1bca38bb6d49e66b446707e7Fabiano Fidêncio
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina/* invokes a handler with a 'ssau' DBus signature */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinastatic int invoke_ssau_method(struct sbus_request *dbus_req, void *function_ptr)
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina{
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina const char * arg_0;
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina const char * arg_1;
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina uint32_t *arg_2;
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina int len_2;
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina int (*handler)(struct sbus_request *, void *, const char *, const char *, uint32_t[], int) = function_ptr;
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina if (!sbus_request_parse_or_finish(dbus_req,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina DBUS_TYPE_STRING, &arg_0,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina DBUS_TYPE_STRING, &arg_1,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, &arg_2, &len_2,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina DBUS_TYPE_INVALID)) {
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina return EOK; /* request handled */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina }
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina return (handler)(dbus_req, dbus_req->intf->handler_data,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina arg_0,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina arg_1,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina arg_2,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina len_2);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina}