/*
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 _DP_H_
#define _DP_H_
#include <stdint.h>
#include "sbus/sssd_dbus.h"
#include "providers/data_provider/dp_request.h"
#include "providers/data_provider/dp_custom_data.h"
#include "providers/data_provider/dp_flags.h"
struct data_provider;
struct dp_method;
/**
* Module constructor.
*
* It is possible to create a module data that is passed into all
* target initialization functions.
*/
struct data_provider *provider,
const char *module_name,
void **_module_data);
/**
* Target initialization function.
*
* Pointer to dp_method is unique for all targets. Make sure that
* dp_set_method is called in all targets even if you are reusing
* some existing context or initialization function.
*/
void *module_data,
struct dp_method *dp_methods);
enum dp_targets {
};
enum dp_methods {
};
/* Method handler. */
struct dp_req_params {
};
typedef struct tevent_req *
struct dp_req_params *params);
typedef errno_t
/* Data provider initialization. */
const char *module_name,
...);
enum dp_targets target);
enum dp_methods method,
void *method_data,
const char *method_dtype,
const char *request_dtype,
const char *output_dtype,
/* We check function headers on compile time and data types on run time. This
* check requires that both method and request private data are talloc-created
* with talloc name set to data type name (which is done by talloc unless
* you use _size variations of talloc functions.
*
* This way we ensure that we always pass correct data and we can access them
* directly in request handler without the need to cast them explicitly
* from void pointer. */
do { \
/* Check _send function parameter types. */ \
\
/* Check _recv function parameter types. */ \
output_dtype *) = (recv_fn); \
#method_dtype, #req_dtype, \
#output_dtype, sizeof(output_dtype)); \
} while (0)
enum dp_targets target,
enum dp_methods method);
const char *domain);
struct sss_domain_info *dom);
struct sss_domain_info *dom);
struct sss_domain_info *dom);
struct sss_domain_info *dom);
/*
* A dummy handler for DPM_ACCT_DOMAIN_HANDLER.
*
* Its purpose is to always return ERR_GET_ACCT_DOM_NOT_SUPPORTED
* which the responder should evaluate as "this back end does not
* support locating entries' domain" and never call
* DPM_ACCT_DOMAIN_HANDLER again
*
* This request cannot fail, except for critical errors like OOM.
*/
struct tevent_req *
void *unused_ctx,
struct dp_get_acct_domain_data *data,
struct dp_req_params *params);
struct tevent_req *req,
struct dp_reply_std *data);
#endif /* _DP_H_ */