Exemplo n.º 1
0
static BOOL do_profilelevel(const pid_t pid, const int argc, const char **argv)
{
	if (argc != 1) {
		fprintf(stderr, "Usage: smbcontrol <dest> profilelevel\n");
		return False;
	}

	/* Send a message and register our interest in a reply */

	if (!send_message(pid, MSG_REQ_PROFILELEVEL, NULL, 0, False))
		return False;

	message_register(MSG_PROFILELEVEL, profilelevel_cb);
	message_register(MSG_REQ_PROFILELEVEL, profilelevel_rqst);

	wait_replies(pid == 0);

	/* No replies were received within the timeout period */

	if (num_replies == 0)
		printf("No replies received\n");

	message_deregister(MSG_PROFILE);

	return num_replies;
}
Exemplo n.º 2
0
static BOOL do_poolusage(const pid_t pid, const int argc, const char **argv)
{
	if (argc != 1) {
		fprintf(stderr, "Usage: smbcontrol <dest> pool-usage\n");
		return False;
	}

	/* Send a message and register our interest in a reply */

	if (!send_message(pid, MSG_REQ_POOL_USAGE, NULL, 0, False))
		return False;

	message_register(MSG_POOL_USAGE, print_string_cb);

	wait_replies(pid == 0);

	/* No replies were received within the timeout period */

	if (num_replies == 0)
		printf("No replies received\n");

	message_deregister(MSG_POOL_USAGE);

	return num_replies;
}
Exemplo n.º 3
0
Arquivo: status.c Projeto: aosm/samba
static void dump_user_stats(void)
{
	TDB_CONTEXT *tdb;
	int nump = 0;
	message_register(MSG_USR_STATS, handle_usr_stat_reply, NULL);
	tdb = tdb_open_log(lock_path("sessionid.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0);
	if (!tdb) {
		d_printf("\nsessionid.tdb not initialised\n");
	} else {
		d_printf("\nPID     Username      Group         OpCount              ByteCount            \n");
		d_printf("------------------------------------------------------------------------------\n");
		nump = tdb_traverse(tdb, traverse_processes, NULL);
		//DEBUG(10,("Total %d procs traversed\n", nump));
		tdb_close(tdb);
	}
	message_deregister(MSG_USR_STATS);
}