summaryrefslogtreecommitdiffstats
path: root/source/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-03-28 05:20:28 +0000
committerLuke Leighton <lkcl@samba.org>2000-03-28 05:20:28 +0000
commitaaca01dc64b64345a963b9bff891831e443fb1df (patch)
treeeecf89d9257561a5d657356eca801c7bd7d78a07 /source/rpc_parse/parse_misc.c
parent1a09614b3ef3aaaab06e205c3daba403f7c43a77 (diff)
downloadsamba-aaca01dc64b64345a963b9bff891831e443fb1df.tar.gz
samba-aaca01dc64b64345a963b9bff891831e443fb1df.tar.xz
samba-aaca01dc64b64345a963b9bff891831e443fb1df.zip
moving some functions that were in parse_misc.c that i've been meaning
to put in the right modules for a long, long time.
Diffstat (limited to 'source/rpc_parse/parse_misc.c')
-rw-r--r--source/rpc_parse/parse_misc.c359
1 files changed, 3 insertions, 356 deletions
diff --git a/source/rpc_parse/parse_misc.c b/source/rpc_parse/parse_misc.c
index 21548f37a23..7f930c9d9c1 100644
--- a/source/rpc_parse/parse_misc.c
+++ b/source/rpc_parse/parse_misc.c
@@ -3,9 +3,9 @@
* Unix SMB/Netbios implementation.
* Version 1.9.
* RPC Pipe client / server routines
- * Copyright (C) Andrew Tridgell 1992-1997,
- * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
- * Copyright (C) Paul Ashton 1997.
+ * Copyright (C) Andrew Tridgell 1992-2000,
+ * Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
+ * Copyright (C) Paul Ashton 1997-2000.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -935,183 +935,6 @@ BOOL smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, i
}
/*******************************************************************
-creates a DOM_RID2 structure.
-********************************************************************/
-BOOL make_dom_rid2(DOM_RID2 *rid2, uint32 rid, uint16 type, uint32 idx)
-{
- rid2->type = type;
- rid2->rid = rid;
- rid2->rid_idx = idx;
-
- return True;
-}
-
-/*******************************************************************
-reads or writes a DOM_RID2 structure.
-********************************************************************/
-BOOL smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth)
-{
- if (rid2 == NULL) return False;
-
- prs_debug(ps, depth, desc, "smb_io_dom_rid2");
- depth++;
-
- prs_align(ps);
-
- prs_uint16("type ", ps, depth, &(rid2->type));
- prs_align(ps);
- prs_uint32("rid ", ps, depth, &(rid2->rid ));
- prs_uint32("rid_idx", ps, depth, &(rid2->rid_idx ));
-
- return True;
-}
-
-/*******************************************************************
-creates a DOM_RID3 structure.
-********************************************************************/
-BOOL make_dom_rid3(DOM_RID3 *rid3, uint32 rid, uint8 type)
-{
- rid3->rid = rid;
- rid3->type1 = type;
- rid3->ptr_type = 0x1; /* non-zero, basically. */
- rid3->type2 = 0x1;
- rid3->unk = type;
-
- return True;
-}
-
-/*******************************************************************
-reads or writes a DOM_RID3 structure.
-********************************************************************/
-BOOL smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth)
-{
- if (rid3 == NULL) return False;
-
- prs_debug(ps, depth, desc, "smb_io_dom_rid3");
- depth++;
-
- prs_align(ps);
-
- prs_uint32("rid ", ps, depth, &(rid3->rid ));
- prs_uint32("type1 ", ps, depth, &(rid3->type1 ));
- prs_uint32("ptr_type", ps, depth, &(rid3->ptr_type));
- prs_uint32("type2 ", ps, depth, &(rid3->type2 ));
- prs_uint32("unk ", ps, depth, &(rid3->unk ));
-
- return True;
-}
-
-/*******************************************************************
-makes a DOM_CLNT_SRV structure.
-********************************************************************/
-static BOOL make_clnt_srv(DOM_CLNT_SRV *log,
- const char *logon_srv,
- const char *comp_name)
-{
- if (log == NULL) return False;
-
- DEBUG(5,("make_clnt_srv: %d\n", __LINE__));
-
- if (logon_srv != NULL)
- {
- log->undoc_buffer = 1;
- make_unistr2(&(log->uni_logon_srv), logon_srv, strlen(logon_srv)+1);
- }
- else
- {
- log->undoc_buffer = 0;
- }
-
- if (comp_name != NULL)
- {
- log->undoc_buffer2 = 1;
- make_unistr2(&(log->uni_comp_name), comp_name, strlen(comp_name)+1);
- }
- else
- {
- log->undoc_buffer2 = 0;
- }
-
- return True;
-}
-
-/*******************************************************************
-reads or writes a DOM_CLNT_SRV structure.
-********************************************************************/
-static BOOL smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth)
-{
- if (log == NULL) return False;
-
- prs_debug(ps, depth, desc, "smb_io_clnt_srv");
- depth++;
-
- prs_align(ps);
-
- prs_uint32("undoc_buffer ", ps, depth, &(log->undoc_buffer ));
- if (log->undoc_buffer != 0)
- {
- smb_io_unistr2("unistr2", &(log->uni_logon_srv), log->undoc_buffer, ps, depth);
- }
-
- prs_align(ps);
-
- prs_uint32("undoc_buffer2", ps, depth, &(log->undoc_buffer2));
- if (log->undoc_buffer2 != 0)
- {
- smb_io_unistr2("unistr2", &(log->uni_comp_name), log->undoc_buffer2, ps, depth);
- }
-
- return True;
-}
-
-/*******************************************************************
-makes a DOM_LOG_INFO structure.
-********************************************************************/
-BOOL make_log_info(DOM_LOG_INFO *log,
- const char *logon_srv, const char *acct_name,
- uint16 sec_chan, const char *comp_name)
-{
- if (log == NULL) return False;
-
- DEBUG(5,("make_log_info %d\n", __LINE__));
-
- log->undoc_buffer = 1;
-
- make_unistr2(&(log->uni_logon_srv), logon_srv, strlen(logon_srv)+1);
- make_unistr2(&(log->uni_acct_name), acct_name, strlen(acct_name)+1);
-
- log->sec_chan = sec_chan;
-
- make_unistr2(&(log->uni_comp_name), comp_name, strlen(comp_name)+1);
-
- return True;
-}
-
-/*******************************************************************
-reads or writes a DOM_LOG_INFO structure.
-********************************************************************/
-BOOL smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth)
-{
- if (log == NULL) return False;
-
- prs_debug(ps, depth, desc, "smb_io_log_info");
- depth++;
-
- prs_align(ps);
-
- prs_uint32("undoc_buffer", ps, depth, &(log->undoc_buffer));
-
- smb_io_unistr2("unistr2", &(log->uni_logon_srv), True, ps, depth);
- smb_io_unistr2("unistr2", &(log->uni_acct_name), True, ps, depth);
-
- prs_uint16("sec_chan", ps, depth, &(log->sec_chan));
-
- smb_io_unistr2("unistr2", &(log->uni_comp_name), True, ps, depth);
-
- return True;
-}
-
-/*******************************************************************
reads or writes a DOM_CHAL structure.
********************************************************************/
BOOL smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth)
@@ -1147,128 +970,6 @@ BOOL smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth)
}
/*******************************************************************
-makes a DOM_CLNT_INFO2 structure.
-********************************************************************/
-BOOL make_clnt_info2(DOM_CLNT_INFO2 *clnt,
- const char *logon_srv, const char *comp_name,
- DOM_CRED *clnt_cred)
-{
- if (clnt == NULL) return False;
-
- DEBUG(5,("make_clnt_info: %d\n", __LINE__));
-
- make_clnt_srv(&(clnt->login), logon_srv, comp_name);
-
- if (clnt_cred != NULL)
- {
- clnt->ptr_cred = 1;
- memcpy(&(clnt->cred), clnt_cred, sizeof(clnt->cred));
- }
- else
- {
- clnt->ptr_cred = 0;
- }
-
- return True;
-}
-
-/*******************************************************************
-reads or writes a DOM_CLNT_INFO2 structure.
-********************************************************************/
-BOOL smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth)
-{
- if (clnt == NULL) return False;
-
- prs_debug(ps, depth, desc, "smb_io_clnt_info2");
- depth++;
-
- prs_align(ps);
-
- smb_io_clnt_srv("", &(clnt->login), ps, depth);
-
- prs_align(ps);
-
- prs_uint32("ptr_cred", ps, depth, &(clnt->ptr_cred));
- smb_io_cred ("", &(clnt->cred ), ps, depth);
-
- return True;
-}
-
-/*******************************************************************
-makes a DOM_CLNT_INFO structure.
-********************************************************************/
-BOOL make_clnt_info(DOM_CLNT_INFO *clnt,
- const char *logon_srv, const char *acct_name,
- uint16 sec_chan, const char *comp_name,
- DOM_CRED *cred)
-{
- if (clnt == NULL || cred == NULL) return False;
-
- DEBUG(5,("make_clnt_info\n"));
-
- make_log_info(&(clnt->login), logon_srv, acct_name, sec_chan, comp_name);
- memcpy(&(clnt->cred), cred, sizeof(clnt->cred));
-
- return True;
-}
-
-/*******************************************************************
-reads or writes a DOM_CLNT_INFO structure.
-********************************************************************/
-BOOL smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth)
-{
- if (clnt == NULL) return False;
-
- prs_debug(ps, depth, desc, "smb_io_clnt_info");
- depth++;
-
- prs_align(ps);
-
- smb_io_log_info("", &(clnt->login), ps, depth);
- smb_io_cred ("", &(clnt->cred ), ps, depth);
-
- return True;
-}
-
-/*******************************************************************
-makes an OWF_INFO structure.
-********************************************************************/
-BOOL make_owf_info(OWF_INFO *hash, const uint8 data[16])
-{
- if (hash == NULL) return False;
-
- DEBUG(5,("make_owf_info: %d\n", __LINE__));
-
- if (data != NULL)
- {
- memcpy(hash->data, data, sizeof(hash->data));
- }
- else
- {
- bzero(hash->data, sizeof(hash->data));
- }
-
- return True;
-}
-
-/*******************************************************************
-reads or writes an OWF_INFO structure.
-********************************************************************/
-BOOL smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth)
-{
- if (hash == NULL) return False;
-
- prs_debug(ps, depth, desc, "smb_io_owf_info");
- depth++;
-
- prs_align(ps);
-
- prs_uint8s (False, "data", ps, depth, hash->data, 16);
-
- return True;
-}
-
-/*******************************************************************
reads or writes a DOM_GID structure.
********************************************************************/
BOOL smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth)
@@ -1302,60 +1003,6 @@ BOOL smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth)
return smb_io_rpc_uuid("uuid", &pol->uuid, ps, depth);
}
-/*******************************************************************
-reads or writes a dom query structure.
-********************************************************************/
-static BOOL smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth)
-{
- if (d_q == NULL) return False;
-
- prs_debug(ps, depth, desc, "smb_io_dom_query");
- depth++;
-
- prs_align(ps);
-
- prs_uint16("uni_dom_max_len", ps, depth, &(d_q->uni_dom_max_len)); /* domain name string length * 2 */
- prs_uint16("uni_dom_str_len", ps, depth, &(d_q->uni_dom_str_len)); /* domain name string length * 2 */
-
- prs_uint32("buffer_dom_name", ps, depth, &(d_q->buffer_dom_name)); /* undocumented domain name string buffer pointer */
- prs_uint32("buffer_dom_sid ", ps, depth, &(d_q->buffer_dom_sid )); /* undocumented domain SID string buffer pointer */
-
- smb_io_unistr2("unistr2", &(d_q->uni_domain_name), d_q->buffer_dom_name, ps, depth); /* domain name (unicode string) */
-
- prs_align(ps);
-
- if (d_q->buffer_dom_sid != 0)
- {
- smb_io_dom_sid2("", &(d_q->dom_sid), ps, depth); /* domain SID */
- }
- else
- {
- bzero(&(d_q->dom_sid), sizeof(d_q->dom_sid));
- }
-
- return True;
-}
-
-/*******************************************************************
-reads or writes a dom query structure.
-********************************************************************/
-BOOL smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth)
-{
- smb_io_dom_query("", d_q, ps, depth);
-
- return True;
-}
-
-/*******************************************************************
-reads or writes a dom query structure.
-********************************************************************/
-BOOL smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth)
-{
- smb_io_dom_query("", d_q, ps, depth);
-
- return True;
-}
-
/*******************************************************************
reads or writes a UNISTR3 structure.