s3-rpc_client: Added dcerpc_lsa_lookup_sids and dcerpc_lsa_lookup_sids3.
[vlendec/samba-autobuild/.git] / source3 / rpc_client / cli_lsarpc.h
1 /* The following definitions come from rpc_client/cli_lsarpc.c  */
2
3 /**
4  * @brief Open a LSA policy.
5  *
6  * @param[in]  h        The dcerpc binding hanlde to use.
7  *
8  * @param[in]  mem_ctx  The memory context to use.
9  *
10  * @param[in]  sec_qos  Enable security quality of services.
11  *
12  * @param[in]  des_access The disired access rights to be granted.
13  *
14  * @param[out]  pol     A pointer to a rpc policy handle.
15  *
16  * @param[out]  result  A pointer for the NDR NTSTATUS error code.
17  *
18  * @return              A corresponding NTSTATUS error code for the connection.
19  */
20 NTSTATUS dcerpc_lsa_open_policy(struct dcerpc_binding_handle *h,
21                                 TALLOC_CTX *mem_ctx,
22                                 bool sec_qos,
23                                 uint32_t des_access,
24                                 struct policy_handle *pol,
25                                 NTSTATUS *result);
26 NTSTATUS rpccli_lsa_open_policy(struct rpc_pipe_client *cli,
27                                 TALLOC_CTX *mem_ctx,
28                                 bool sec_qos, uint32 des_access,
29                                 struct policy_handle *pol);
30
31 /**
32  * @brief Open a LSA policy.
33  *
34  * @param[in]  h        The dcerpc binding hanlde to use.
35  *
36  * @param[in]  mem_ctx  The memory context to use.
37  *
38  * @param[in]  sec_qos  Enable security quality of services.
39  *
40  * @param[in]  des_access The disired access rights to be granted.
41  *
42  * @param[out]  pol     A pointer to a rpc policy handle.
43  *
44  * @param[out]  result  A pointer for the NDR NTSTATUS error code.
45  *
46  * @return              A corresponding NTSTATUS error code for the connection.
47  */
48 NTSTATUS dcerpc_lsa_open_policy2(struct dcerpc_binding_handle *h,
49                                  TALLOC_CTX *mem_ctx,
50                                  const char *srv_name_slash,
51                                  bool sec_qos,
52                                  uint32_t des_access,
53                                  struct policy_handle *pol,
54                                  NTSTATUS *result);
55 NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
56                                  TALLOC_CTX *mem_ctx, bool sec_qos,
57                                  uint32 des_access, struct policy_handle *pol);
58
59 /**
60  * @brief Look up the names that correspond to an array of sids.
61  *
62  * @param[in]  h        The initialized binding handle for a dcerpc connection.
63  *
64  * @param[in]  mem_ctx  The memory context to use.
65  *
66  * @param[in]  pol      The opened domain policy handle.
67  *
68  * @param[in]  num_sids The number of sids in the sids array to look up.
69  *
70  * @param[in]  sids     The array of sids to look up.
71  *
72  * @param[out]  pdomains A pointer to store the refercenced domains.
73  *
74  * @param[out]  pnames  A pointer to an array for the translated names.
75  *
76  * @param[out]  ptypes  A pointer to an array for the types of the names.
77  *
78  * @param[out]  result  A pointer for the conversion result.
79  *
80  * @return              A corresponding NTSTATUS error code.
81  */
82 NTSTATUS dcerpc_lsa_lookup_sids(struct dcerpc_binding_handle *h,
83                                 TALLOC_CTX *mem_ctx,
84                                 struct policy_handle *pol,
85                                 int num_sids,
86                                 const struct dom_sid *sids,
87                                 char ***pdomains,
88                                 char ***pnames,
89                                 enum lsa_SidType **ptypes,
90                                 NTSTATUS *result);
91 NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
92                                 TALLOC_CTX *mem_ctx,
93                                 struct policy_handle *pol,
94                                 int num_sids,
95                                 const struct dom_sid *sids,
96                                 char ***pdomains,
97                                 char ***pnames,
98                                 enum lsa_SidType **ptypes);
99
100 /**
101  * @brief Look up the names that correspond to an array of sids.
102  *
103  * @param[in]  h        The initialized binding handle for a dcerpc connection.
104  *
105  * @param[in]  mem_ctx  The memory context to use.
106  *
107  * @param[in]  pol      The opened domain policy handle.
108  *
109  * @param[in]  num_sids The number of sids in the sids array to look up.
110  *
111  * @param[in]  sids     The array of sids to look up.
112  *
113  * @param[out]  pdomains A pointer to store the refercenced domains.
114  *
115  * @param[out]  pnames  A pointer to an array for the translated names.
116  *
117  * @param[out]  ptypes  A pointer to an array for the types of the names.
118  *
119  * @param[out]  result  A pointer for the conversion result.
120  *
121  * @return              A corresponding NTSTATUS error code.
122  */
123 NTSTATUS dcerpc_lsa_lookup_sids3(struct dcerpc_binding_handle *h,
124                                  TALLOC_CTX *mem_ctx,
125                                  struct policy_handle *pol,
126                                  int num_sids,
127                                  const struct dom_sid *sids,
128                                  char ***pdomains,
129                                  char ***pnames,
130                                  enum lsa_SidType **ptypes,
131                                  NTSTATUS *result);
132 NTSTATUS rpccli_lsa_lookup_sids3(struct rpc_pipe_client *cli,
133                                  TALLOC_CTX *mem_ctx,
134                                  struct policy_handle *pol,
135                                  int num_sids,
136                                  const struct dom_sid *sids,
137                                  char ***pdomains,
138                                  char ***pnames,
139                                  enum lsa_SidType **ptypes);
140
141 NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
142                                  TALLOC_CTX *mem_ctx,
143                                  struct policy_handle *pol, int num_names,
144                                  const char **names,
145                                  const char ***dom_names,
146                                  int level,
147                                  struct dom_sid **sids,
148                                  enum lsa_SidType **types);
149 NTSTATUS rpccli_lsa_lookup_names4(struct rpc_pipe_client *cli,
150                                   TALLOC_CTX *mem_ctx,
151                                   struct policy_handle *pol, int num_names,
152                                   const char **names,
153                                   const char ***dom_names,
154                                   int level,
155                                   struct dom_sid **sids,
156                                   enum lsa_SidType **types);
157
158 bool fetch_domain_sid( char *domain, char *remote_machine, struct dom_sid *psid);
159