summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_net.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-10-07 05:26:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:18 -0500
commit7b84b133fe375e69817fe5c76089f67280507809 (patch)
tree8171348f76887d3d757d44246f1193f0663bfd88 /source3/rpc_parse/parse_net.c
parente0b6961ac5b501f51bd004a392c606e3ef308fee (diff)
downloadsamba-7b84b133fe375e69817fe5c76089f67280507809.tar.gz
samba-7b84b133fe375e69817fe5c76089f67280507809.tar.bz2
samba-7b84b133fe375e69817fe5c76089f67280507809.zip
r19161: Add NET_GETANYDCNAME (getdcname only gives the PDC while getanydcname
gives just any DC), also make sure to set timeouts in rpcclient accordingly so that we actually get the DC's reply. Guenther (This used to be commit 6091c8152a3998d2503cb0911a217ee904509633)
Diffstat (limited to 'source3/rpc_parse/parse_net.c')
-rw-r--r--source3/rpc_parse/parse_net.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c
index 6f7c453edf..1bd75cf8b1 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -566,6 +566,90 @@ BOOL net_io_r_getdcname(const char *desc, NET_R_GETDCNAME *r_t, prs_struct *ps,
return True;
}
+
+/*******************************************************************
+ Inits an NET_R_GETANYDCNAME structure.
+********************************************************************/
+void init_net_q_getanydcname(NET_Q_GETANYDCNAME *r_t, const char *logon_server,
+ const char *domainname)
+{
+ DEBUG(5,("init_r_getanydcname\n"));
+
+ init_unistr2(&r_t->uni_logon_server, logon_server, UNI_STR_TERMINATE);
+ r_t->ptr_domainname = (domainname != NULL);
+ init_unistr2(&r_t->uni_domainname, domainname, UNI_STR_TERMINATE);
+}
+
+/*******************************************************************
+ Reads or writes an NET_Q_GETANYDCNAME structure.
+********************************************************************/
+
+BOOL net_io_q_getanydcname(const char *desc, NET_Q_GETANYDCNAME *r_t, prs_struct *ps,
+ int depth)
+{
+ if (r_t == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "net_io_q_getanydcname");
+ depth++;
+
+ if (!smb_io_unistr2("logon_server", &r_t->uni_logon_server,
+ 1, ps, depth))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_uint32("ptr_domainname", ps, depth, &r_t->ptr_domainname))
+ return False;
+
+ if (!smb_io_unistr2("domainname", &r_t->uni_domainname,
+ r_t->ptr_domainname, ps, depth))
+ return False;
+
+ return True;
+}
+
+
+/*******************************************************************
+ Inits an NET_R_GETANYDCNAME structure.
+********************************************************************/
+void init_net_r_getanydcname(NET_R_GETANYDCNAME *r_t, const char *dcname)
+{
+ DEBUG(5,("init_r_getanydcname\n"));
+
+ init_unistr2(&r_t->uni_dcname, dcname, UNI_STR_TERMINATE);
+}
+
+/*******************************************************************
+ Reads or writes an NET_R_GETANYDCNAME structure.
+********************************************************************/
+
+BOOL net_io_r_getanydcname(const char *desc, NET_R_GETANYDCNAME *r_t, prs_struct *ps,
+ int depth)
+{
+ if (r_t == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "net_io_r_getanydcname");
+ depth++;
+
+ if (!prs_uint32("ptr_dcname", ps, depth, &r_t->ptr_dcname))
+ return False;
+
+ if (!smb_io_unistr2("dcname", &r_t->uni_dcname,
+ r_t->ptr_dcname, ps, depth))
+ return False;
+
+ if (!prs_align(ps))
+ return False;
+
+ if (!prs_werror("status", ps, depth, &r_t->status))
+ return False;
+
+ return True;
+}
+
/*******************************************************************
Inits an NET_R_TRUST_DOM_LIST structure.
********************************************************************/