responder.h revision 4967fe0bc52580f7e96974e30d3cf2f33fadaabe
/*
SSSD
SSS Client Responder, header file
Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SSS_RESPONDER_H__
#define __SSS_RESPONDER_H__
#include <stdint.h>
#include <pcre.h>
#include "config.h"
#include "talloc.h"
#include "tevent.h"
#include "ldb.h"
#include "dhash.h"
#include "sbus/sssd_dbus.h"
#include "sss_client/sss_cli.h"
extern hash_table_t *dp_requests;
/* if there is a provider other than the special local */
#define NEED_CHECK_PROVIDER(provider) \
/* needed until nsssrv.h is updated */
struct cli_request {
/* original request from the wire */
struct sss_packet *in;
/* reply data */
struct sss_packet *out;
};
struct cli_protocol_version {
const char *date;
const char *description;
};
struct be_conn {
const char *cli_name;
struct sss_domain_info *domain;
char *sbus_address;
struct sbus_interface *intf;
struct sbus_connection *conn;
};
struct resp_ctx {
struct tevent_context *ev;
int lfd;
int priv_lfd;
struct confdb_ctx *cdb;
const char *sock_name;
const char *priv_sock_name;
struct sbus_connection *mon_conn;
struct sss_domain_info *domains;
struct sysdb_ctx_list *db_list;
struct sss_cmd_table *sss_cmds;
const char *sss_pipe_name;
const char *confdb_service_path;
struct sss_names_ctx *names;
void *pvt_ctx;
};
/* Needed for the NSS responder */
struct getent_ref_tracker {
void *pvt;
};
struct cli_ctx {
struct tevent_context *ev;
int cfd;
struct sockaddr_un addr;
struct cli_request *creq;
struct cli_protocol_version *cli_protocol_version;
int priv;
int pwent_dom_idx;
int pwent_cur;
int grent_dom_idx;
int grent_cur;
char *netgr_name;
int netgrent_cur;
};
struct sss_cmd_table {
enum sss_cli_command cmd;
};
/* responder_common.c */
struct tevent_context *ev,
struct confdb_ctx *cdb,
struct sss_cmd_table sss_cmds[],
const char *sss_pipe_name,
const char *sss_priv_pipe_name,
const char *confdb_service_path,
const char *svc_name,
struct sbus_interface *monitor_intf,
const char *cli_name,
struct sbus_interface *dp_intf,
struct resp_ctx **responder_ctx);
struct sss_names_ctx *snctx,
/* responder_cmd.c */
struct cli_protocol_version *register_cli_protocol_version(void);
#define SSS_DP_USER 1
#define SSS_DP_GROUP 2
#define SSS_DP_INITGROUPS 3
#define SSS_DP_NETGR 4
void handle_requests_after_reconnect(void);
bool fast_reply, int type,
#endif /* __SSS_RESPONDER_H__ */