From 2962b3d1e072ff2ebbe343095812dad697d6bf1d Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Wed, 24 Apr 2013 10:49:22 +0200 Subject: Use struct to hold different types of request parameters Currently the POSIX ID or the user name are passed in different parameters to some calls. The method will get cumbersome and error-prone if new parameters like, e.g. the SID, are added. This patch adds a union to hold the different kind of parameters. --- src/providers/ipa/ipa_subdomains.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/providers/ipa/ipa_subdomains.h') diff --git a/src/providers/ipa/ipa_subdomains.h b/src/providers/ipa/ipa_subdomains.h index df7f994d..c9ab82a2 100644 --- a/src/providers/ipa/ipa_subdomains.h +++ b/src/providers/ipa/ipa_subdomains.h @@ -38,4 +38,18 @@ int ipa_subdom_init(struct be_ctx *be_ctx, struct bet_ops **ops, void **pvt_data); +enum req_input_type { + REQ_INP_NAME, + REQ_INP_ID, + REQ_INP_SECID +}; + +struct req_input { + enum req_input_type type; + union { + const char *name; + uint32_t id; + const char *secid; + } inp; +}; #endif /* _IPA_SUBDOMAINS_H_ */ -- cgit