summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/examples/netlogon
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-09-17 13:16:26 +0200
committerGünther Deschner <gd@samba.org>2010-09-19 02:47:11 +0200
commit1d8094172c69ec8d64701b70a87ddf31b0d8f4f9 (patch)
treecb1175868d69cdc8bf72bc5b9d47accc91c29b3a /source3/lib/netapi/examples/netlogon
parent8e73826b3c2323c6e81a285f49c6b9d606cb7a53 (diff)
downloadsamba-1d8094172c69ec8d64701b70a87ddf31b0d8f4f9.tar.gz
samba-1d8094172c69ec8d64701b70a87ddf31b0d8f4f9.tar.bz2
samba-1d8094172c69ec8d64701b70a87ddf31b0d8f4f9.zip
s3-nltest: add dsregdns command to nltest.
Guenther
Diffstat (limited to 'source3/lib/netapi/examples/netlogon')
-rw-r--r--source3/lib/netapi/examples/netlogon/nltest.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/source3/lib/netapi/examples/netlogon/nltest.c b/source3/lib/netapi/examples/netlogon/nltest.c
index e3ced90a20..0c393ea3be 100644
--- a/source3/lib/netapi/examples/netlogon/nltest.c
+++ b/source3/lib/netapi/examples/netlogon/nltest.c
@@ -58,7 +58,8 @@ enum {
OPT_SITE,
OPT_ACCOUNT,
OPT_RET_DNS,
- OPT_RET_NETBIOS
+ OPT_RET_NETBIOS,
+ OPT_DSREGDNS
};
/****************************************************************
@@ -207,6 +208,7 @@ int main(int argc, const char **argv)
char *opt_account = NULL;
int opt_ret_dns = 0;
int opt_ret_netbios = 0;
+ int opt_dsregdns = 0;
uint32_t query_level = 0;
uint8_t *buffer = NULL;
uint32_t flags = 0;
@@ -244,6 +246,7 @@ int main(int argc, const char **argv)
{"account", 0, POPT_ARG_STRING, &opt_account, OPT_ACCOUNT, "ACCOUNT"},
{"ret_dns", 0, POPT_ARG_NONE, &opt_ret_dns, OPT_RET_DNS, NULL},
{"ret_netbios", 0, POPT_ARG_NONE, &opt_ret_netbios, OPT_RET_NETBIOS, NULL},
+ {"dsregdns", 0, POPT_ARG_NONE, &opt_dsregdns, OPT_DSREGDNS, "Force registration of all DC-specific DNS records"},
POPT_COMMON_LIBNETAPI_EXAMPLES
POPT_TABLEEND
};
@@ -363,6 +366,23 @@ int main(int argc, const char **argv)
print_netlogon_info_result(query_level, buffer);
break;
+ case OPT_DSREGDNS:
+ query_level = 1;
+ status = I_NetLogonControl2(opt_server,
+ NETLOGON_CONTROL_FORCE_DNS_REG,
+ query_level,
+ NULL,
+ &buffer);
+ if (status != 0) {
+ fprintf(stderr, "I_NetlogonControl failed: Status = %d 0x%x %s\n",
+ status, status,
+ libnetapi_get_error_string(ctx, status));
+ goto done;
+ }
+
+ print_netlogon_info_result(query_level, buffer);
+
+ break;
case OPT_DSGETDC:
if (opt_pdc)
flags |= DS_PDC_REQUIRED;