summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-04-02 12:56:18 +0000
committerVolker Lendecke <vlendec@samba.org>2004-04-02 12:56:18 +0000
commit044c6f513dca21d4fc01db4a686c75d43d4952d2 (patch)
tree212fe9763acacfab4f671746ec6cec45a217996e /source3/rpc_parse
parent620e1eaddc5e72cbfc8fb7de69b56167fcb3d34d (diff)
downloadsamba-044c6f513dca21d4fc01db4a686c75d43d4952d2.tar.gz
samba-044c6f513dca21d4fc01db4a686c75d43d4952d2.tar.bz2
samba-044c6f513dca21d4fc01db4a686c75d43d4952d2.zip
Implement NETLOGON GetDCName client side. You can ask a DC for the name of
a DC it trusts. Volker (This used to be commit ae6840320ff47827c2817549fe3133a57e3fe77f)
Diffstat (limited to 'source3/rpc_parse')
-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 90cd348f5a..a98738b51f 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -425,6 +425,90 @@ BOOL net_io_r_logon_ctrl(const char *desc, NET_R_LOGON_CTRL *r_l, prs_struct *ps
}
/*******************************************************************
+ Inits an NET_R_GETDCNAME structure.
+********************************************************************/
+void init_net_q_getdcname(NET_Q_GETDCNAME *r_t, const char *logon_server,
+ const char *domainname)
+{
+ DEBUG(5,("init_r_getdcname\n"));
+
+ r_t->ptr_logon_server = (logon_server != NULL);
+ 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_GETDCNAME structure.
+********************************************************************/
+
+BOOL net_io_q_getdcname(const char *desc, NET_Q_GETDCNAME *r_t, prs_struct *ps,
+ int depth)
+{
+ if (r_t == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "net_io_q_getdcname");
+ depth++;
+
+ if (!prs_uint32("ptr_logon_server", ps, depth, &r_t->ptr_logon_server))
+ return False;
+
+ if (!smb_io_unistr2("logon_server", &r_t->uni_logon_server,
+ r_t->ptr_logon_server, 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_GETDCNAME structure.
+********************************************************************/
+void init_net_r_getdcname(NET_R_GETDCNAME *r_t, const char *dcname)
+{
+ DEBUG(5,("init_r_getdcname\n"));
+
+ init_unistr2(&r_t->uni_dcname, dcname, UNI_STR_TERMINATE);
+}
+
+/*******************************************************************
+ Reads or writes an NET_R_GETDCNAME structure.
+********************************************************************/
+
+BOOL net_io_r_getdcname(const char *desc, NET_R_GETDCNAME *r_t, prs_struct *ps,
+ int depth)
+{
+ if (r_t == NULL)
+ return False;
+
+ prs_debug(ps, depth, desc, "net_io_r_getdcname");
+ 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_ntstatus("status", ps, depth, &r_t->status))
+ return False;
+
+ return True;
+}
+
+/*******************************************************************
Inits an NET_R_TRUST_DOM_LIST structure.
********************************************************************/