From 8308c000b2022769644ed8ea1fc772776257c99b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 8 Dec 1998 00:25:04 +0000 Subject: adding srvsvc pipe. (This used to be commit d06d6369942828ec89e90f99bd0d0d3f91d61d13) --- source3/rpc_parse/parse_rpc.c | 11 ++++ source3/rpc_parse/parse_samr.c | 65 ++++++++++++++++++++ source3/rpc_parse/parse_svc.c | 136 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 212 insertions(+) create mode 100644 source3/rpc_parse/parse_svc.c (limited to 'source3/rpc_parse') diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c index 5059ca222b..9ce83bea83 100644 --- a/source3/rpc_parse/parse_rpc.c +++ b/source3/rpc_parse/parse_rpc.c @@ -42,6 +42,16 @@ interface/version dce/rpc pipe identification }, 0x02 \ } \ +#define SYNT_SVCCTL_V2 \ +{ \ + { \ + 0x81, 0xbb, 0x7a, 0x36, \ + 0x44, 0x98, 0xf1, 0x35, \ + 0xad, 0x32, 0x98, 0xf0, \ + 0x38, 0x00, 0x10, 0x03 \ + }, 0x02 \ +} \ + #define SYNT_NETLOGON_V2 \ { \ { \ @@ -129,6 +139,7 @@ struct pipe_id_info pipe_names [] = { PIPE_SAMR , SYNT_SAMR_V1 , PIPE_LSASS , TRANS_SYNT_V2 }, { PIPE_NETLOGON, SYNT_NETLOGON_V1, PIPE_LSASS , TRANS_SYNT_V2 }, { PIPE_SRVSVC , SYNT_SRVSVC_V3 , PIPE_NTSVCS , TRANS_SYNT_V2 }, + { PIPE_SVCCTL , SYNT_SVCCTL_V2 , PIPE_NTSVCS , TRANS_SYNT_V2 }, { PIPE_WKSSVC , SYNT_WKSSVC_V1 , PIPE_NTSVCS , TRANS_SYNT_V2 }, { PIPE_WINREG , SYNT_WINREG_V1 , PIPE_WINREG , TRANS_SYNT_V2 }, { NULL , SYNT_NONE_V0 , NULL , SYNT_NONE_V0 } diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 52bcb4ff77..f4c1790254 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -258,6 +258,61 @@ void samr_io_q_query_dom_info(char *desc, SAMR_Q_QUERY_DOMAIN_INFO *q_u, prs_st prs_align(ps); } +/******************************************************************* +makes a structure. +********************************************************************/ +void make_unk_info6(SAM_UNK_INFO_6 *u_6) +{ + if (u_6 == NULL) return; + + u_6->unknown_0 = 0x00000000; + u_6->ptr_0 = 1; + memset(u_6->padding, 0, sizeof(u_6->padding)); /* 12 bytes zeros */ +} + +/******************************************************************* +reads or writes a structure. +********************************************************************/ +void sam_io_unk_info6(char *desc, SAM_UNK_INFO_6 *u_6, prs_struct *ps, int depth) +{ + if (u_6 == NULL) return; + + prs_debug(ps, depth, desc, "sam_io_unk_info6"); + depth++; + + prs_uint32("unknown_0", ps, depth, &u_6->unknown_0); /* 0x0000 0000 */ + prs_uint32("ptr_0", ps, depth, &u_6->ptr_0); /* pointer to unknown structure */ + prs_uint8s(False, "padding", ps, depth, u_6->padding, sizeof(u_6->padding)); /* 12 bytes zeros */ + + prs_align(ps); + +} + +/******************************************************************* +makes a structure. +********************************************************************/ +void make_unk_info7(SAM_UNK_INFO_7 *u_7) +{ + if (u_7 == NULL) return; + + u_7->unknown_0 = 0x0003; +} + +/******************************************************************* +reads or writes a structure. +********************************************************************/ +void sam_io_unk_info7(char *desc, SAM_UNK_INFO_7 *u_7, prs_struct *ps, int depth) +{ + if (u_7 == NULL) return; + + prs_debug(ps, depth, desc, "sam_io_unk_info7"); + depth++; + + prs_uint16("unknown_0", ps, depth, &u_7->unknown_0); /* 0x0003 */ + prs_align(ps); + +} + /******************************************************************* makes a structure. ********************************************************************/ @@ -376,6 +431,16 @@ void samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO *r_u, prs_str { switch (r_u->switch_value) { + case 0x06: + { + sam_io_unk_info6("unk_inf6", &r_u->ctr->info.inf6, ps, depth); + break; + } + case 0x07: + { + sam_io_unk_info7("unk_inf7", &r_u->ctr->info.inf7, ps, depth); + break; + } case 0x02: { sam_io_unk_info2("unk_inf2", &r_u->ctr->info.inf2, ps, depth); diff --git a/source3/rpc_parse/parse_svc.c b/source3/rpc_parse/parse_svc.c new file mode 100644 index 0000000000..288f23f46b --- /dev/null +++ b/source3/rpc_parse/parse_svc.c @@ -0,0 +1,136 @@ + +/* + * 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. + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include "includes.h" + +extern int DEBUGLEVEL; + +/******************************************************************* + make_svc_q_open_policy + ********************************************************************/ +void make_svc_q_open_policy(SVC_Q_OPEN_POLICY *q_u, + char *server, uint16 unknown) +{ + DEBUG(5,("make_svc_q_open_policy\n")); + + make_buf_unistr2(&(q_u->uni_srv_name), &(q_u->ptr_srv_name), server); + q_u->unknown = unknown; + +} + +/******************************************************************* +reads or writes a SVC_Q_OPEN_POLICY structure. +********************************************************************/ +void svc_io_q_open_policy(char *desc, SVC_Q_OPEN_POLICY *q_u, prs_struct *ps, int depth) +{ + if (q_u == NULL) return; + + prs_debug(ps, depth, desc, "svc_io_q_open_policy"); + depth++; + + prs_align(ps); + + prs_uint32("ptr_srv_name", ps, depth, &(q_u->ptr_srv_name)); + smb_io_unistr2("", &(q_u->uni_srv_name), q_u->ptr_srv_name, ps, depth); + prs_align(ps); + + prs_uint32("unknown", ps, depth, &(q_u->unknown)); + prs_align(ps); +} + +/******************************************************************* + make_svc_r_open_policy + ********************************************************************/ +void make_svc_r_open_policy(SVC_R_OPEN_POLICY *r_u, POLICY_HND *hnd, + uint32 status) +{ + DEBUG(5,("make_svc_r_unknown_0: %d\n", __LINE__)); + + memcpy(&(r_u->pol), hnd, sizeof(r_u->pol)); + r_u->status = status; +} + +/******************************************************************* +reads or writes a structure. +********************************************************************/ +void svc_io_r_open_policy(char *desc, SVC_R_OPEN_POLICY *r_u, prs_struct *ps, int depth) +{ + if (r_u == NULL) return; + + prs_debug(ps, depth, desc, "svc_io_r_open_policy"); + depth++; + + prs_align(ps); + + smb_io_pol_hnd("", &(r_u->pol), ps, depth); + + prs_uint32("status ", ps, depth, &(r_u->status)); +} + +/******************************************************************* +makes an SVC_Q_CLOSE structure. +********************************************************************/ +void make_svc_q_close(SVC_Q_CLOSE *q_c, POLICY_HND *hnd) +{ + if (q_c == NULL || hnd == NULL) return; + + DEBUG(5,("make_svc_q_close\n")); + +} + +/******************************************************************* +reads or writes a structure. +********************************************************************/ +void svc_io_q_close(char *desc, SVC_Q_CLOSE *q_u, prs_struct *ps, int depth) +{ + if (q_u == NULL) return; + + prs_debug(ps, depth, desc, "svc_io_q_close"); + depth++; + + prs_align(ps); + + smb_io_pol_hnd("", &(q_u->pol), ps, depth); + prs_align(ps); +} + +/******************************************************************* +reads or writes a structure. +********************************************************************/ +void svc_io_r_close(char *desc, SVC_R_CLOSE *r_u, prs_struct *ps, int depth) +{ + if (r_u == NULL) return; + + prs_debug(ps, depth, desc, "svc_io_r_close"); + depth++; + + prs_align(ps); + + smb_io_pol_hnd("", &(r_u->pol), ps, depth); + prs_align(ps); + + prs_uint32("status", ps, depth, &(r_u->status)); +} + -- cgit