int net_rap_service(int argc, const char **argv) { struct functable func[] = { {"START", rap_service_start}, {"STOP", rap_service_stop}, {NULL, NULL} }; if (argc == 0) { struct cli_state *cli; int ret; if (!(cli = net_make_ipc_connection(0))) return -1; if (opt_long_list_entries) { d_printf("Service name Comment\n"); d_printf("-----------------------------\n"); ret = cli_RNetServiceEnum(cli, long_group_fn, NULL); } ret = cli_RNetServiceEnum(cli, service_fn, NULL); cli_shutdown(cli); return ret; } return net_run_function(argc, argv, func, net_rap_service_usage); }
int net_rap_service(struct net_context *c, int argc, const char **argv) { struct functable func[] = { { "start", rap_service_start, NET_TRANSPORT_RAP, N_("Start service on remote server"), N_("net rap service start\n" " Start service on remote server") }, { "stop", rap_service_stop, NET_TRANSPORT_RAP, N_("Stop named serve on remote server"), N_("net rap service stop\n" " Stop named serve on remote server") }, {NULL, NULL, 0, NULL, NULL} }; if (argc == 0) { struct cli_state *cli; int ret; if (c->display_usage) { d_printf(_("Usage:\n")); d_printf(_("net rap service\n" " List services on remote server\n")); net_display_usage_from_functable(func); return 0; } if (!NT_STATUS_IS_OK(net_make_ipc_connection(c, 0, &cli))) return -1; if (c->opt_long_list_entries) { d_printf(_("Service name Comment\n" "-----------------------------\n")); ret = cli_RNetServiceEnum(cli, long_group_fn, NULL); } ret = cli_RNetServiceEnum(cli, service_fn, NULL); cli_shutdown(cli); return ret; } return net_run_function(c, argc, argv, "net rap service", func); }