diff options
author | Sumit Bose <sbose@redhat.com> | 2009-02-24 19:28:40 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-02-24 21:00:56 -0500 |
commit | 98531e56318b65eb1bb6883fdfe12e771d8a1efe (patch) | |
tree | a339a5948604ff62cfafd62a9682130f30df689e /server/responder/common/responder_cmd.h | |
parent | 4c6c0f77a505b6b0790cfa8eedd3133abebd4edb (diff) | |
download | sssd-98531e56318b65eb1bb6883fdfe12e771d8a1efe.tar.gz sssd-98531e56318b65eb1bb6883fdfe12e771d8a1efe.tar.bz2 sssd-98531e56318b65eb1bb6883fdfe12e771d8a1efe.zip |
Add PAM responder
Also move responders under server/responder with shared code
in server/responder/common
Signed-off-by: Simo Sorce <ssorce@redhat.com>
Diffstat (limited to 'server/responder/common/responder_cmd.h')
-rw-r--r-- | server/responder/common/responder_cmd.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/server/responder/common/responder_cmd.h b/server/responder/common/responder_cmd.h new file mode 100644 index 00000000..ee094ad3 --- /dev/null +++ b/server/responder/common/responder_cmd.h @@ -0,0 +1,71 @@ +/* + SSSD + + SSS Client Responder, header file + + Copyright (C) Simo Sorce <ssorce@redhat.com> 2008 + + This program is free software; you can redistribute it and/or modify + 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 __SSSSRV_CMD_H__ +#define __SSSSRV_CMD_H__ + +#include <stdint.h> +#include <sys/un.h> +#include "talloc.h" +#include "tevent.h" +#include "ldb.h" +#include "../sss_client/sss_cli.h" + +/* needed until nsssrv.h is updated */ +#ifndef __NSSSRV_H__ +struct cli_request { + + /* original request from the wire */ + struct sss_packet *in; + + /* reply data */ + struct sss_packet *out; +}; + +struct cli_ctx { + struct event_context *ev; + struct nss_ctx *nctx; + int cfd; + struct fd_event *cfde; + struct sockaddr_un addr; + struct cli_request *creq; + struct getent_ctx *gctx; +}; +#endif + +struct sss_cmd_ctx { + struct cli_ctx *cctx; + const char *domain; + const char *name; + uid_t id; + bool check_expiration; +}; + +struct sss_cmd_table { + enum sss_cli_command cmd; + int (*fn)(struct cli_ctx *cctx); +}; + +int sss_cmd_execute(struct cli_ctx *cctx, struct sss_cmd_table *sss_cmds); +void sss_cmd_done(struct sss_cmd_ctx *nctx); +int sss_cmd_get_version(struct cli_ctx *cctx); + +#endif /* __SSSSRV_CMD_H__ */ |