/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2016 Red Hat
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 _NSS_PROTOCOL_H_
#define _NSS_PROTOCOL_H_
#include <stdint.h>
#include "responder/common/responder.h"
#include "responder/common/responder_packet.h"
#include "responder/common/cache_req/cache_req.h"
#include "responder/nss/nss_private.h"
#include "sss_client/idmap/sss_nss_idmap.h"
struct nss_cmd_ctx;
/**
* Fill SSSD response packet.
*
* @return EOK If packet is successfully created and should be sent to client.
* @return Other errno code on error, an error reply will be sent to client.
*/
typedef errno_t
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx {
/* For initgroups- */
const char *rawname;
/* For enumeration. */
bool enumeration;
/* For services. */
const char *svc_protocol;
/* For SID lookups. */
};
/**
* If error is EOK, send existing reply packet to the client.
* If error is ENOENT, create and send empty response.
* On other error code, create and send an error.
*/
/**
* Create and send SSSD response packet to the client.
*/
struct nss_cmd_ctx *cmd_ctx,
struct cache_req_result *result,
/* Parse input packet. */
const char **_name,
const char **_protocol);
const char **_protocol);
const char **_derb64);
const char **_sid);
/* Create response packet. */
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result **results);
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result);
#endif /* _NSS_PROTOCOL_H_ */