diff options
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_lsa.c | 136 | ||||
-rw-r--r-- | source3/rpc_parse/parse_net.c | 236 |
2 files changed, 0 insertions, 372 deletions
diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index ef54b4a30d..5f22a28082 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -1985,60 +1985,6 @@ bool lsa_io_r_unk_get_connuser(const char *desc, LSA_R_UNK_GET_CONNUSER *out, pr return True; } -void init_lsa_q_open_account(LSA_Q_OPENACCOUNT *trn, POLICY_HND *hnd, DOM_SID *sid, uint32 desired_access) -{ - memcpy(&trn->pol, hnd, sizeof(trn->pol)); - - init_dom_sid2(&trn->sid, sid); - trn->access = desired_access; -} - -/******************************************************************* - Reads or writes an LSA_Q_OPENACCOUNT structure. -********************************************************************/ - -bool lsa_io_q_open_account(const char *desc, LSA_Q_OPENACCOUNT *out, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "lsa_io_q_open_account"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("pol", &out->pol, ps, depth)) - return False; - - if(!smb_io_dom_sid2("sid", &out->sid, ps, depth)) /* domain SID */ - return False; - - if(!prs_uint32("access", ps, depth, &out->access)) - return False; - - return True; -} - -/******************************************************************* - Reads or writes an LSA_R_OPENACCOUNT structure. -********************************************************************/ - -bool lsa_io_r_open_account(const char *desc, LSA_R_OPENACCOUNT *out, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "lsa_io_r_open_account"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("pol", &out->pol, ps, depth)) - return False; - - if(!prs_ntstatus("status", ps, depth, &out->status)) - return False; - - return True; -} - - void init_lsa_q_enum_privsaccount(LSA_Q_ENUMPRIVSACCOUNT *trn, POLICY_HND *hnd) { memcpy(&trn->pol, hnd, sizeof(trn->pol)); @@ -2192,88 +2138,6 @@ bool lsa_io_r_enum_privsaccount(const char *desc, LSA_R_ENUMPRIVSACCOUNT *out, p return True; } - - -/******************************************************************* - Reads or writes an LSA_Q_GETSYSTEMACCOUNTstructure. -********************************************************************/ - -bool lsa_io_q_getsystemaccount(const char *desc, LSA_Q_GETSYSTEMACCOUNT *out, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "lsa_io_q_getsystemaccount"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("pol", &out->pol, ps, depth)) - return False; - - return True; -} - -/******************************************************************* - Reads or writes an LSA_R_GETSYSTEMACCOUNTstructure. -********************************************************************/ - -bool lsa_io_r_getsystemaccount(const char *desc, LSA_R_GETSYSTEMACCOUNT *out, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "lsa_io_r_getsystemaccount"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_uint32("access", ps, depth, &out->access)) - return False; - - if(!prs_ntstatus("status", ps, depth, &out->status)) - return False; - - return True; -} - - -/******************************************************************* - Reads or writes an LSA_Q_SETSYSTEMACCOUNT structure. -********************************************************************/ - -bool lsa_io_q_setsystemaccount(const char *desc, LSA_Q_SETSYSTEMACCOUNT *out, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "lsa_io_q_setsystemaccount"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!smb_io_pol_hnd("pol", &out->pol, ps, depth)) - return False; - - if(!prs_uint32("access", ps, depth, &out->access)) - return False; - - return True; -} - -/******************************************************************* - Reads or writes an LSA_R_SETSYSTEMACCOUNT structure. -********************************************************************/ - -bool lsa_io_r_setsystemaccount(const char *desc, LSA_R_SETSYSTEMACCOUNT *out, prs_struct *ps, int depth) -{ - prs_debug(ps, depth, desc, "lsa_io_r_setsystemaccount"); - depth++; - - if(!prs_align(ps)) - return False; - - if(!prs_ntstatus("status", ps, depth, &out->status)) - return False; - - return True; -} - - void init_lsa_string( LSA_STRING *uni, const char *string ) { init_unistr2(&uni->unistring, string, UNI_FLAGS_NONE); diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c index c68d9300b9..55af8211cf 100644 --- a/source3/rpc_parse/parse_net.c +++ b/source3/rpc_parse/parse_net.c @@ -3240,239 +3240,3 @@ bool net_io_r_sam_deltas(const char *desc, return True; } - -/******************************************************************* - Inits a NET_Q_DSR_GETDCNAME structure. -********************************************************************/ - -void init_net_q_dsr_getdcname(NET_Q_DSR_GETDCNAME *r_t, const char *server_unc, - const char *domain_name, - struct GUID *domain_guid, - struct GUID *site_guid, - uint32_t flags) -{ - DEBUG(5, ("init_net_q_dsr_getdcname\n")); - - r_t->ptr_server_unc = (server_unc != NULL); - init_unistr2(&r_t->uni_server_unc, server_unc, UNI_STR_TERMINATE); - - r_t->ptr_domain_name = (domain_name != NULL); - init_unistr2(&r_t->uni_domain_name, domain_name, UNI_STR_TERMINATE); - - r_t->ptr_domain_guid = (domain_guid != NULL); - r_t->domain_guid = domain_guid; - - r_t->ptr_site_guid = (site_guid != NULL); - r_t->site_guid = site_guid; - - r_t->flags = flags; -} - -/******************************************************************* - Reads or writes an NET_Q_DSR_GETDCNAME structure. -********************************************************************/ - -bool net_io_q_dsr_getdcname(const char *desc, NET_Q_DSR_GETDCNAME *r_t, - prs_struct *ps, int depth) -{ - if (r_t == NULL) - return False; - - prs_debug(ps, depth, desc, "net_io_q_dsr_getdcname"); - depth++; - - if (!prs_uint32("ptr_server_unc", ps, depth, &r_t->ptr_server_unc)) - return False; - - if (!smb_io_unistr2("server_unc", &r_t->uni_server_unc, - r_t->ptr_server_unc, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("ptr_domain_name", ps, depth, &r_t->ptr_domain_name)) - return False; - - if (!smb_io_unistr2("domain_name", &r_t->uni_domain_name, - r_t->ptr_domain_name, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("ptr_domain_guid", ps, depth, &r_t->ptr_domain_guid)) - return False; - - if (UNMARSHALLING(ps) && (r_t->ptr_domain_guid)) { - r_t->domain_guid = PRS_ALLOC_MEM(ps, struct GUID, 1); - if (r_t->domain_guid == NULL) - return False; - } - - if ((r_t->ptr_domain_guid) && - (!smb_io_uuid("domain_guid", r_t->domain_guid, ps, depth))) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("ptr_site_guid", ps, depth, &r_t->ptr_site_guid)) - return False; - - if (UNMARSHALLING(ps) && (r_t->ptr_site_guid)) { - r_t->site_guid = PRS_ALLOC_MEM(ps, struct GUID, 1); - if (r_t->site_guid == NULL) - return False; - } - - if ((r_t->ptr_site_guid) && - (!smb_io_uuid("site_guid", r_t->site_guid, ps, depth))) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_uint32("flags", ps, depth, &r_t->flags)) - return False; - - return True; -} - -/******************************************************************* - Inits a NET_R_DSR_GETDCNAME structure. -********************************************************************/ -void init_net_r_dsr_getdcname(NET_R_DSR_GETDCNAME *r_t, const char *dc_unc, - const char *dc_address, int32 dc_address_type, - struct GUID domain_guid, const char *domain_name, - const char *forest_name, uint32 dc_flags, - const char *dc_site_name, - const char *client_site_name) -{ - DEBUG(5, ("init_net_q_dsr_getdcname\n")); - - r_t->ptr_dc_unc = (dc_unc != NULL); - init_unistr2(&r_t->uni_dc_unc, dc_unc, UNI_STR_TERMINATE); - - r_t->ptr_dc_address = (dc_address != NULL); - init_unistr2(&r_t->uni_dc_address, dc_address, UNI_STR_TERMINATE); - - r_t->dc_address_type = dc_address_type; - r_t->domain_guid = domain_guid; - - r_t->ptr_domain_name = (domain_name != NULL); - init_unistr2(&r_t->uni_domain_name, domain_name, UNI_STR_TERMINATE); - - r_t->ptr_forest_name = (forest_name != NULL); - init_unistr2(&r_t->uni_forest_name, forest_name, UNI_STR_TERMINATE); - - r_t->dc_flags = dc_flags; - - r_t->ptr_dc_site_name = (dc_site_name != NULL); - init_unistr2(&r_t->uni_dc_site_name, dc_site_name, UNI_STR_TERMINATE); - - r_t->ptr_client_site_name = (client_site_name != NULL); - init_unistr2(&r_t->uni_client_site_name, client_site_name, - UNI_STR_TERMINATE); -} - -/******************************************************************* - Reads or writes an NET_R_DSR_GETDCNAME structure. -********************************************************************/ - -bool net_io_r_dsr_getdcname(const char *desc, NET_R_DSR_GETDCNAME *r_t, - prs_struct *ps, int depth) -{ - uint32 info_ptr = 1; - - if (r_t == NULL) - return False; - - prs_debug(ps, depth, desc, "net_io_r_dsr_getdcname"); - depth++; - - /* The reply contains *just* an info struct, this is the ptr to it */ - if (!prs_uint32("info_ptr", ps, depth, &info_ptr)) - return False; - - if (info_ptr == 0) - return False; - - if (!prs_uint32("ptr_dc_unc", ps, depth, &r_t->ptr_dc_unc)) - return False; - - if (!prs_uint32("ptr_dc_address", ps, depth, &r_t->ptr_dc_address)) - return False; - - if (!prs_int32("dc_address_type", ps, depth, &r_t->dc_address_type)) - return False; - - if (!smb_io_uuid("domain_guid", &r_t->domain_guid, ps, depth)) - return False; - - if (!prs_uint32("ptr_domain_name", ps, depth, &r_t->ptr_domain_name)) - return False; - - if (!prs_uint32("ptr_forest_name", ps, depth, &r_t->ptr_forest_name)) - return False; - - if (!prs_uint32("dc_flags", ps, depth, &r_t->dc_flags)) - return False; - - if (!prs_uint32("ptr_dc_site_name", ps, depth, &r_t->ptr_dc_site_name)) - return False; - - if (!prs_uint32("ptr_client_site_name", ps, depth, - &r_t->ptr_client_site_name)) - return False; - - if (!prs_align(ps)) - return False; - - if (!smb_io_unistr2("dc_unc", &r_t->uni_dc_unc, - r_t->ptr_dc_unc, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!smb_io_unistr2("dc_address", &r_t->uni_dc_address, - r_t->ptr_dc_address, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!smb_io_unistr2("domain_name", &r_t->uni_domain_name, - r_t->ptr_domain_name, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!smb_io_unistr2("forest_name", &r_t->uni_forest_name, - r_t->ptr_forest_name, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!smb_io_unistr2("dc_site_name", &r_t->uni_dc_site_name, - r_t->ptr_dc_site_name, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!smb_io_unistr2("client_site_name", &r_t->uni_client_site_name, - r_t->ptr_client_site_name, ps, depth)) - return False; - - if (!prs_align(ps)) - return False; - - if (!prs_werror("result", ps, depth, &r_t->result)) - return False; - - return True; -} |