772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina/*
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina Authors:
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina Pavel Březina <pbrezina@redhat.com>
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina Copyright (C) 2015 Red Hat
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina This program is free software; you can redistribute it and/or modify
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina it under the terms of the GNU General Public License as published by
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina the Free Software Foundation; either version 3 of the License, or
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina (at your option) any later version.
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina This program is distributed in the hope that it will be useful,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina but WITHOUT ANY WARRANTY; without even the implied warranty of
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina GNU General Public License for more details.
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina You should have received a copy of the GNU General Public License
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina along with this program. If not, see <http://www.gnu.org/licenses/>.
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina*/
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#include <dbus/dbus.h>
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#include "sbus/sssd_dbus.h"
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#include "responder/ifp/ifp_iface_generated.h"
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#include "responder/ifp/ifp_domains.h"
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina#include "responder/ifp/ifp_components.h"
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina#include "responder/ifp/ifp_users.h"
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina#include "responder/ifp/ifp_groups.h"
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
beeef7f627a5ed9264de25ee4c76eb9620c1c984Pavel Březinastruct iface_ifp iface_ifp = {
beeef7f627a5ed9264de25ee4c76eb9620c1c984Pavel Březina { &iface_ifp_meta, 0 },
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .Ping = ifp_ping,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina /* components */
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .ListComponents = ifp_list_components,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .ListResponders = ifp_list_responders,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .ListBackends = ifp_list_backends,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .FindMonitor = ifp_find_monitor,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .FindResponderByName = ifp_find_responder_by_name,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .FindBackendByName = ifp_find_backend_by_name,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .GetUserAttr = ifp_user_get_attr,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .GetUserGroups = ifp_user_get_groups,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .ListDomains = ifp_list_domains,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina .FindDomainByName = ifp_find_domain_by_name,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina};
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
beeef7f627a5ed9264de25ee4c76eb9620c1c984Pavel Březinastruct iface_ifp_components iface_ifp_components = {
beeef7f627a5ed9264de25ee4c76eb9620c1c984Pavel Březina { &iface_ifp_components_meta, 0 },
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_name = ifp_component_get_name,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_debug_level = ifp_component_get_debug_level,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_enabled = ifp_component_get_enabled,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_type = ifp_component_get_type,
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina /* FIXME: This should be part of Components.Backends interface, onece
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina * SSSD supports multiple interfaces per object path. */
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_providers = ifp_backend_get_providers
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina};
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
beeef7f627a5ed9264de25ee4c76eb9620c1c984Pavel Březinastruct iface_ifp_domains iface_ifp_domains = {
beeef7f627a5ed9264de25ee4c76eb9620c1c984Pavel Březina { &iface_ifp_domains_meta, 0 },
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_name = ifp_dom_get_name,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_provider = ifp_dom_get_provider,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_primary_servers = ifp_dom_get_primary_servers,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_backup_servers = ifp_dom_get_backup_servers,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_min_id = ifp_dom_get_min_id,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_max_id = ifp_dom_get_max_id,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_realm = ifp_dom_get_realm,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_forest = ifp_dom_get_forest,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_login_format = ifp_dom_get_login_format,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_fully_qualified_name_format = ifp_dom_get_fqdn_format,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_enumerable = ifp_dom_get_enumerable,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_use_fully_qualified_names = ifp_dom_get_use_fqdn,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_subdomain = ifp_dom_get_subdomain,
4e5d19f659d8c545c4ed3c307c95cfe4f2ca33cbPavel Březina .get_parent_domain = ifp_dom_get_parent_domain
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina};
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
9e9ad4cb181c6c0ec70caacfb31319753f889e98Pavel Březinastruct iface_ifp_domains_domain iface_ifp_domains_domain = {
9e9ad4cb181c6c0ec70caacfb31319753f889e98Pavel Březina { &iface_ifp_domains_domain_meta, 0 },
9e9ad4cb181c6c0ec70caacfb31319753f889e98Pavel Březina .IsOnline = ifp_domains_domain_is_online,
bd4c2ed5aec7f57ea04500f0e43f151eedfdde45Pavel Březina .ListServices = ifp_domains_domain_list_services,
bd4c2ed5aec7f57ea04500f0e43f151eedfdde45Pavel Březina .ActiveServer = ifp_domains_domain_active_server,
c6cf752337f5977ce3753b7113dc1a2342c86319Pavel Březina .ListServers = ifp_domains_domain_list_servers,
c6cf752337f5977ce3753b7113dc1a2342c86319Pavel Březina .RefreshAccessRules = ifp_domains_domain_refresh_access_rules
9e9ad4cb181c6c0ec70caacfb31319753f889e98Pavel Březina};
9e9ad4cb181c6c0ec70caacfb31319753f889e98Pavel Březina
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březinastruct iface_ifp_users iface_ifp_users = {
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina { &iface_ifp_users_meta, 0 },
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina .FindByName = ifp_users_find_by_name,
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina .FindByID = ifp_users_find_by_id,
827a016a07d5f911cc4195be89896a376fd71f59Sumit Bose .FindByCertificate = ifp_users_find_by_cert,
861dbe0794739a1c93a5bed00913c7442a2bdac9Sumit Bose .ListByCertificate = ifp_users_list_by_cert,
ef55b0e470a8fbcf6e6d0a55883145e02a907842Sumit Bose .FindByNameAndCertificate = ifp_users_find_by_name_and_cert,
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina .ListByName = ifp_users_list_by_name,
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina .ListByDomainAndName = ifp_users_list_by_domain_and_name
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina};
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březinastruct iface_ifp_users_user iface_ifp_users_user = {
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina { &iface_ifp_users_user_meta, 0 },
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina .UpdateGroupsList = ifp_users_user_update_groups_list,
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina .get_name = ifp_users_user_get_name,
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina .get_uidNumber = ifp_users_user_get_uid_number,
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina .get_gidNumber = ifp_users_user_get_gid_number,
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina .get_gecos = ifp_users_user_get_gecos,
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina .get_homeDirectory = ifp_users_user_get_home_directory,
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina .get_loginShell = ifp_users_user_get_login_shell,
e9a2e7afbd09c23dd8748246e09831ed7b17d7c5Thomas Equeter .get_uniqueID = ifp_users_user_get_unique_id,
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina .get_groups = ifp_users_user_get_groups,
37d2194cc9ea4d0254c88a3419e2376572562babPavel Březina .get_domain = ifp_users_user_get_domain,
37d2194cc9ea4d0254c88a3419e2376572562babPavel Březina .get_domainname = ifp_users_user_get_domainname,
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina .get_extraAttributes = ifp_users_user_get_extra_attributes
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina};
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březinastruct iface_ifp_groups iface_ifp_groups = {
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina { &iface_ifp_groups_meta, 0 },
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina .FindByName = ifp_groups_find_by_name,
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina .FindByID = ifp_groups_find_by_id,
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina .ListByName = ifp_groups_list_by_name,
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina .ListByDomainAndName = ifp_groups_list_by_domain_and_name
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina};
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březinastruct iface_ifp_groups_group iface_ifp_groups_group = {
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březina { &iface_ifp_groups_group_meta, 0 },
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březina .UpdateMemberList = ifp_groups_group_update_member_list,
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březina .get_name = ifp_groups_group_get_name,
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březina .get_gidNumber = ifp_groups_group_get_gid_number,
e9a2e7afbd09c23dd8748246e09831ed7b17d7c5Thomas Equeter .get_uniqueID = ifp_groups_group_get_unique_id,
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březina .get_users = ifp_groups_group_get_users,
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březina .get_groups = ifp_groups_group_get_groups
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březina};
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březina
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březinastruct iface_ifp_cache iface_ifp_cache_user = {
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina { &iface_ifp_cache_meta, 0 },
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina .List = ifp_cache_list_user,
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina .ListByDomain = ifp_cache_list_by_domain_user
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina};
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březinastruct iface_ifp_cache_object iface_ifp_cache_object_user = {
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina { &iface_ifp_cache_object_meta, 0 },
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina .Store = ifp_cache_object_store_user,
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina .Remove = ifp_cache_object_remove_user
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina};
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březinastruct iface_ifp_cache iface_ifp_cache_group = {
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina { &iface_ifp_cache_meta, 0 },
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina .List = ifp_cache_list_group,
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina .ListByDomain = ifp_cache_list_by_domain_group
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina};
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březinastruct iface_ifp_cache_object iface_ifp_cache_object_group = {
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina { &iface_ifp_cache_object_meta, 0 },
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina .Store = ifp_cache_object_store_group,
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina .Remove = ifp_cache_object_remove_group
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina};
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina
397bc52dd09a8c032abc7ea47a6d81dba5957464Pavel Březinastatic struct sbus_iface_map iface_map[] = {
62ebed8582285bd24efba92b9a06366511507946Pavel Březina { IFP_PATH, &iface_ifp.vtable },
b420aae3becdbf501deb2637e2a06636bd6ce1fePavel Březina { IFP_PATH_DOMAINS, &iface_ifp_domains.vtable },
62ebed8582285bd24efba92b9a06366511507946Pavel Březina { IFP_PATH_DOMAINS_TREE, &iface_ifp_domains.vtable },
9e9ad4cb181c6c0ec70caacfb31319753f889e98Pavel Březina { IFP_PATH_DOMAINS_TREE, &iface_ifp_domains_domain.vtable },
62ebed8582285bd24efba92b9a06366511507946Pavel Březina { IFP_PATH_COMPONENTS_TREE, &iface_ifp_components.vtable },
c747b0c875785ce693f70b50bdda0237c4b04e35Pavel Březina { IFP_PATH_USERS, &iface_ifp_users.vtable },
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina { IFP_PATH_USERS, &iface_ifp_cache_user.vtable },
a1e4113a5388e34c08459c5b69679c82ac2bddc9Pavel Březina { IFP_PATH_USERS_TREE, &iface_ifp_users_user.vtable },
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina { IFP_PATH_USERS_TREE, &iface_ifp_cache_object_user.vtable },
132e477d69e07e02fe6e4d668c0bb6226206474aPavel Březina { IFP_PATH_GROUPS, &iface_ifp_groups.vtable },
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina { IFP_PATH_GROUPS, &iface_ifp_cache_group.vtable },
8fe171bf5a7a570591418e6548105f1d5a0097b3Pavel Březina { IFP_PATH_GROUPS_TREE, &iface_ifp_groups_group.vtable },
d3c82d0170d6d7407549afdadd08aa7e11aeb9a2Pavel Březina { IFP_PATH_GROUPS_TREE, &iface_ifp_cache_object_group.vtable },
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina { NULL, NULL },
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina};
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březinaerrno_t ifp_register_sbus_interface(struct sbus_connection *conn, void *pvt)
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina{
397bc52dd09a8c032abc7ea47a6d81dba5957464Pavel Březina return sbus_conn_register_iface_map(conn, iface_map, pvt);
772199031f0ec687fa1fefd939206858c440e5a1Pavel Březina}