Beispiel #1
0
static int rap_session_info(int argc, const char **argv)
{
	const char *sessname;
	struct cli_state *cli;
	int ret;
	
	if (!(cli = net_make_ipc_connection(0))) 
                return -1;

	if (argc == 0) 
                return net_rap_session_usage(argc, argv);

	sessname = argv[0];

	ret = cli_NetSessionGetInfo(cli, sessname, display_session_func);
	if (ret < 0) {
		cli_shutdown(cli);
                return ret;
	}

	d_printf("Share name     Type     # Opens\n-------------------------"\
		 "-----------------------------------------------------\n");
	ret = cli_NetConnectionEnum(cli, sessname, display_conns_func);
	cli_shutdown(cli);
	return ret;
}
Beispiel #2
0
static int rap_session_info(struct net_context *c, int argc, const char **argv)
{
	const char *sessname;
	struct cli_state *cli;
	int ret;

	if (argc == 0 || c->display_usage)
                return net_rap_session_usage(c, argc, argv);

	if (!NT_STATUS_IS_OK(net_make_ipc_connection(c, 0, &cli)))
                return -1;

	sessname = argv[0];

	ret = cli_NetSessionGetInfo(cli, sessname, display_session_func);
	if (ret < 0) {
		cli_shutdown(cli);
                return ret;
	}

	d_printf(_("Share name     Type     # Opens\n-------------------------"
		   "-----------------------------------------------------\n"));
	ret = cli_NetConnectionEnum(cli, sessname, display_conns_func);
	cli_shutdown(cli);
	return ret;
}