summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_svc.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-12-09 23:16:37 +0000
committerLuke Leighton <lkcl@samba.org>1998-12-09 23:16:37 +0000
commit3cc7e2936a69ba864817e1636439722933d8475e (patch)
treeb3417d5a4b0f8d1754510208fe7cbfb0b4ee4557 /source3/rpc_parse/parse_svc.c
parenta971a74717f1a9d8c966c623b735e079da2f67ae (diff)
downloadsamba-3cc7e2936a69ba864817e1636439722933d8475e.tar.gz
samba-3cc7e2936a69ba864817e1636439722933d8475e.tar.bz2
samba-3cc7e2936a69ba864817e1636439722933d8475e.zip
adding svcctl parsing code
(This used to be commit c6f2f58c74cd79d84ec4a7802882da07a9af80d4)
Diffstat (limited to 'source3/rpc_parse/parse_svc.c')
-rw-r--r--source3/rpc_parse/parse_svc.c186
1 files changed, 186 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_svc.c b/source3/rpc_parse/parse_svc.c
index 2ebab5aea5..912582f35e 100644
--- a/source3/rpc_parse/parse_svc.c
+++ b/source3/rpc_parse/parse_svc.c
@@ -96,6 +96,131 @@ void svc_io_r_open_sc_man(char *desc, SVC_R_OPEN_SC_MAN *r_u, prs_struct *ps, i
}
/*******************************************************************
+ make_svc_q_open_service
+ ********************************************************************/
+void make_svc_q_open_service(SVC_Q_OPEN_SERVICE *q_u,
+ POLICY_HND *hnd,
+ char *server,
+ uint32 des_access)
+{
+ DEBUG(5,("make_svc_q_open_service\n"));
+
+ memcpy(&(q_u->scman_pol), hnd, sizeof(q_u->scman_pol));
+ make_unistr2(&(q_u->uni_srv_name), server, strlen(server)+1);
+ q_u->des_access = des_access;
+
+}
+
+/*******************************************************************
+reads or writes a SVC_Q_OPEN_SERVICE structure.
+********************************************************************/
+void svc_io_q_open_service(char *desc, SVC_Q_OPEN_SERVICE *q_u, prs_struct *ps, int depth)
+{
+ if (q_u == NULL) return;
+
+ prs_debug(ps, depth, desc, "svc_io_q_open_service");
+ depth++;
+
+ prs_align(ps);
+
+ smb_io_pol_hnd("", &(q_u->scman_pol), ps, depth);
+ prs_align(ps);
+
+ smb_io_unistr2("", &(q_u->uni_srv_name), 1, ps, depth);
+ prs_align(ps);
+
+ prs_uint32("des_access", ps, depth, &(q_u->des_access));
+ prs_align(ps);
+}
+
+/*******************************************************************
+ make_svc_r_open_service
+ ********************************************************************/
+void make_svc_r_open_service(SVC_R_OPEN_SERVICE *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_service(char *desc, SVC_R_OPEN_SERVICE *r_u, prs_struct *ps, int depth)
+{
+ if (r_u == NULL) return;
+
+ prs_debug(ps, depth, desc, "svc_io_r_open_service");
+ depth++;
+
+ prs_align(ps);
+
+ smb_io_pol_hnd("", &(r_u->pol), ps, depth);
+
+ prs_uint32("status ", ps, depth, &(r_u->status));
+}
+
+/*******************************************************************
+ make_svc_query_svc_cfg
+ ********************************************************************/
+void make_svc_query_svc_cfg(QUERY_SERVICE_CONFIG *q_u,
+ uint32 service_type, uint32 start_type,
+ uint32 error_control,
+ char* bin_path_name, char* load_order_grp,
+ uint32 tag_id,
+ char* dependencies, char* service_start_name,
+ char* disp_name)
+{
+ DEBUG(5,("make_svc_query_svc_cfg\n"));
+
+ q_u->service_type = service_type;
+ q_u->start_type = start_type;
+ q_u->error_control = error_control;
+ make_buf_unistr2(&(q_u->uni_bin_path_name ), &(q_u->ptr_bin_path_name ), bin_path_name );
+ make_buf_unistr2(&(q_u->uni_load_order_grp ), &(q_u->ptr_load_order_grp ), load_order_grp );
+ q_u->tag_id = tag_id;
+ make_buf_unistr2(&(q_u->uni_dependencies ), &(q_u->ptr_dependencies ), dependencies );
+ make_buf_unistr2(&(q_u->uni_service_start_name), &(q_u->ptr_service_start_name), service_start_name);
+ make_buf_unistr2(&(q_u->uni_display_name ), &(q_u->ptr_display_name ), disp_name );
+}
+
+/*******************************************************************
+reads or writes a QUERY_SERVICE_CONFIG structure.
+********************************************************************/
+void svc_io_query_svc_cfg(char *desc, QUERY_SERVICE_CONFIG *q_u, prs_struct *ps, int depth)
+{
+ if (q_u == NULL) return;
+
+ prs_debug(ps, depth, desc, "svc_io_query_svc_cfg");
+ depth++;
+
+ prs_align(ps);
+
+ prs_uint32("service_type ", ps, depth, &(q_u->service_type ));
+ prs_uint32("start_type ", ps, depth, &(q_u->start_type ));
+ prs_uint32("error_control ", ps, depth, &(q_u->error_control ));
+ prs_uint32("ptr_bin_path_name ", ps, depth, &(q_u->ptr_bin_path_name ));
+ prs_uint32("ptr_load_order_grp ", ps, depth, &(q_u->ptr_load_order_grp ));
+ prs_uint32("tag_id ", ps, depth, &(q_u->tag_id ));
+ prs_uint32("ptr_dependencies ", ps, depth, &(q_u->ptr_dependencies ));
+ prs_uint32("ptr_service_start_name", ps, depth, &(q_u->ptr_service_start_name));
+ prs_uint32("ptr_display_name ", ps, depth, &(q_u->ptr_display_name ));
+
+ smb_io_unistr2("uni_bin_path_name ", &(q_u->uni_bin_path_name ), q_u->ptr_bin_path_name , ps, depth);
+ prs_align(ps);
+ smb_io_unistr2("uni_load_order_grp ", &(q_u->uni_load_order_grp ), q_u->ptr_load_order_grp , ps, depth);
+ prs_align(ps);
+ smb_io_unistr2("uni_dependencies ", &(q_u->uni_dependencies ), q_u->ptr_dependencies , ps, depth);
+ prs_align(ps);
+ smb_io_unistr2("uni_service_start_name", &(q_u->uni_service_start_name), q_u->ptr_service_start_name, ps, depth);
+ prs_align(ps);
+ smb_io_unistr2("uni_display_name ", &(q_u->uni_display_name ), q_u->ptr_display_name , ps, depth);
+ prs_align(ps);
+}
+
+/*******************************************************************
makes an SVC_Q_ENUM_SVCS_STATUS structure.
********************************************************************/
void make_svc_q_enum_svcs_status(SVC_Q_ENUM_SVCS_STATUS *q_c, POLICY_HND *hnd,
@@ -333,6 +458,67 @@ void svc_io_svc_status(char *desc, SVC_STATUS *svc, prs_struct *ps, int depth)
}
/*******************************************************************
+makes an SVC_Q_QUERY_SVC_CONFIG structure.
+********************************************************************/
+void make_svc_q_query_svc_config(SVC_Q_QUERY_SVC_CONFIG *q_c, POLICY_HND *hnd,
+ uint32 buf_size)
+{
+ if (q_c == NULL || hnd == NULL) return;
+
+ DEBUG(5,("make_svc_q_query_svc_config\n"));
+
+ memcpy(&(q_c->pol), hnd, sizeof(q_c->pol));
+ q_c->buf_size = buf_size;
+}
+
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+void svc_io_q_query_svc_config(char *desc, SVC_Q_QUERY_SVC_CONFIG *q_u, prs_struct *ps, int depth)
+{
+ if (q_u == NULL) return;
+
+ prs_debug(ps, depth, desc, "svc_io_q_query_svc_config");
+ depth++;
+
+ prs_align(ps);
+
+ smb_io_pol_hnd("", &(q_u->pol), ps, depth);
+ prs_align(ps);
+ prs_uint32("buf_size", ps, depth, &(q_u->buf_size));
+}
+
+/*******************************************************************
+makes an SVC_R_QUERY_SVC_CONFIG structure.
+********************************************************************/
+void make_svc_r_query_svc_config(SVC_R_QUERY_SVC_CONFIG *r_c,
+ uint32 buf_size)
+{
+ if (r_c == NULL) return;
+
+ DEBUG(5,("make_svc_r_query_svc_config\n"));
+
+ r_c->buf_size = buf_size;
+}
+
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+void svc_io_r_query_svc_config(char *desc, SVC_R_QUERY_SVC_CONFIG *r_u, prs_struct *ps, int depth)
+{
+ if (r_u == NULL) return;
+
+ prs_debug(ps, depth, desc, "svc_io_r_query_svc_config");
+ depth++;
+
+ prs_align(ps);
+
+ svc_io_query_svc_cfg("cfg", r_u->cfg, ps, depth);
+ prs_uint32("buf_size", ps, depth, &(r_u->buf_size));
+ 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)