summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/libnetapi.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-04-08 18:43:51 +0200
committerGünther Deschner <gd@samba.org>2008-04-08 19:40:47 +0200
commit05202a5d4ef3326db3d43feff2bef5271850296b (patch)
tree6e8f36fe93ec54df4ae075c7f1403de47e4f758c /source3/lib/netapi/libnetapi.c
parent02e90acea7f21ed2b62a15d223c07c9b25c50d08 (diff)
downloadsamba-05202a5d4ef3326db3d43feff2bef5271850296b.tar.gz
samba-05202a5d4ef3326db3d43feff2bef5271850296b.tar.bz2
samba-05202a5d4ef3326db3d43feff2bef5271850296b.zip
Add DsGetDcName call to libnetapi library.
Guenther (This used to be commit 27780e984152e38c8f80e1c67ddf13b73a2b220d)
Diffstat (limited to 'source3/lib/netapi/libnetapi.c')
-rw-r--r--source3/lib/netapi/libnetapi.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/source3/lib/netapi/libnetapi.c b/source3/lib/netapi/libnetapi.c
index 9d42b7e97c..ed97df2143 100644
--- a/source3/lib/netapi/libnetapi.c
+++ b/source3/lib/netapi/libnetapi.c
@@ -391,3 +391,53 @@ NET_API_STATUS NetGetAnyDCName(const char * server_name /* [in] [unique] */,
return r.out.result;
}
+/****************************************************************
+ DsGetDcName
+****************************************************************/
+
+NET_API_STATUS DsGetDcName(const char * server_name /* [in] [unique] */,
+ const char * domain_name /* [in] [ref] */,
+ struct GUID *domain_guid /* [in] [unique] */,
+ const char * site_name /* [in] [unique] */,
+ uint32_t flags /* [in] */,
+ struct DOMAIN_CONTROLLER_INFO **dc_info /* [out] [ref] */)
+{
+ struct DsGetDcName r;
+ struct libnetapi_ctx *ctx = NULL;
+ NET_API_STATUS status;
+ WERROR werr;
+
+ status = libnetapi_getctx(&ctx);
+ if (status != 0) {
+ return status;
+ }
+
+ /* In parameters */
+ r.in.server_name = server_name;
+ r.in.domain_name = domain_name;
+ r.in.domain_guid = domain_guid;
+ r.in.site_name = site_name;
+ r.in.flags = flags;
+
+ /* Out parameters */
+ r.out.dc_info = dc_info;
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_IN_DEBUG(DsGetDcName, &r);
+ }
+
+ if (LIBNETAPI_LOCAL_SERVER(server_name)) {
+ werr = DsGetDcName_l(ctx, &r);
+ } else {
+ werr = DsGetDcName_r(ctx, &r);
+ }
+
+ r.out.result = W_ERROR_V(werr);
+
+ if (DEBUGLEVEL >= 10) {
+ NDR_PRINT_OUT_DEBUG(DsGetDcName, &r);
+ }
+
+ return r.out.result;
+}
+