d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina/*
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina Authors:
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina Pavel Březina <pbrezina@redhat.com>
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina Copyright (C) 2016 Red Hat
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina This program is free software; you can redistribute it and/or modify
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina it under the terms of the GNU General Public License as published by
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina the Free Software Foundation; either version 3 of the License, or
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina (at your option) any later version.
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina This program is distributed in the hope that it will be useful,
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina but WITHOUT ANY WARRANTY; without even the implied warranty of
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina GNU General Public License for more details.
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina You should have received a copy of the GNU General Public License
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina along with this program. If not, see <http://www.gnu.org/licenses/>.
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina*/
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina#include <dbus/dbus.h>
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina#include "sbus/sssd_dbus.h"
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina#include "providers/data_provider/dp_iface_generated.h"
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina#include "providers/data_provider/dp_iface.h"
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina#include "providers/data_provider/dp_private.h"
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina#include "providers/data_provider/dp.h"
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březinastruct iface_dp iface_dp = {
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina {&iface_dp_meta, 0},
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina .pamHandler = dp_pam_handler,
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina .sudoHandler = dp_sudo_handler,
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina .autofsHandler = dp_autofs_handler,
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina .hostHandler = dp_host_handler,
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina .getDomains = dp_subdomains_handler,
c0f9f5a0f6d71a1596ee3cef549b4b02295313c3Jakub Hrozek .getAccountInfo = dp_get_account_info_handler,
c0f9f5a0f6d71a1596ee3cef549b4b02295313c3Jakub Hrozek .getAccountDomain = dp_get_account_domain_handler,
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina};
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina
586fa3571753ab4a607d40fc31503fc0e8effd70Pavel Březinastruct iface_dp_backend iface_dp_backend = {
586fa3571753ab4a607d40fc31503fc0e8effd70Pavel Březina {&iface_dp_backend_meta, 0},
586fa3571753ab4a607d40fc31503fc0e8effd70Pavel Březina .IsOnline = dp_backend_is_online
586fa3571753ab4a607d40fc31503fc0e8effd70Pavel Březina};
586fa3571753ab4a607d40fc31503fc0e8effd70Pavel Březina
bf83a0faacf16196ab9bd37dcf6190b4209ccaf7Pavel Březinastruct iface_dp_failover iface_dp_failover = {
bd4c2ed5aec7f57ea04500f0e43f151eedfdde45Pavel Březina { &iface_dp_failover_meta, 0 },
bd4c2ed5aec7f57ea04500f0e43f151eedfdde45Pavel Březina .ListServices = dp_failover_list_services,
bd4c2ed5aec7f57ea04500f0e43f151eedfdde45Pavel Březina .ActiveServer = dp_failover_active_server,
bd4c2ed5aec7f57ea04500f0e43f151eedfdde45Pavel Březina .ListServers = dp_failover_list_servers
bf83a0faacf16196ab9bd37dcf6190b4209ccaf7Pavel Březina};
bf83a0faacf16196ab9bd37dcf6190b4209ccaf7Pavel Březina
e737cdfa225e0d455c0e574bcb82c2cc16a17d9dPavel Březinastruct iface_dp_access_control iface_dp_access_control = {
e737cdfa225e0d455c0e574bcb82c2cc16a17d9dPavel Březina { &iface_dp_access_control_meta, 0 },
e737cdfa225e0d455c0e574bcb82c2cc16a17d9dPavel Březina .RefreshRules = dp_access_control_refresh_rules_handler
e737cdfa225e0d455c0e574bcb82c2cc16a17d9dPavel Březina};
e737cdfa225e0d455c0e574bcb82c2cc16a17d9dPavel Březina
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březinastatic struct sbus_iface_map dp_map[] = {
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina { DP_PATH, &iface_dp.vtable },
586fa3571753ab4a607d40fc31503fc0e8effd70Pavel Březina { DP_PATH, &iface_dp_backend.vtable },
bf83a0faacf16196ab9bd37dcf6190b4209ccaf7Pavel Březina { DP_PATH, &iface_dp_failover.vtable },
e737cdfa225e0d455c0e574bcb82c2cc16a17d9dPavel Březina { DP_PATH, &iface_dp_access_control.vtable },
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina { NULL, NULL }
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina};
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březinaerrno_t
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březinadp_register_sbus_interface(struct sbus_connection *conn,
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina struct dp_client *pvt)
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina{
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina return sbus_conn_register_iface_map(conn, dp_map, pvt);
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina}