1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

r8575: the beginnings of a smbstatus command

(This used to be commit 4ecaf72a31)
This commit is contained in:
Andrew Tridgell
2005-07-19 03:59:25 +00:00
committed by Gerald (Jerry) Carter
parent 25428433e3
commit 340b3d7301
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,33 @@
/*
backend code for Samba4 management
Copyright Andrew Tridgell 2005
Released under the GNU GPL v2 or later
*/
/*
return a list of current sessions
*/
function smbsrv_sessions()
{
var conn = new Object();
var irpc = irpc_init();
status = irpc_connect(conn, "smb_server");
assert(status.is_ok == true);
var io = irpcObj();
io.input.level = irpc.SMBSRV_INFO_SESSIONS;
status = irpc.smbsrv_information(conn, io);
/* gather the results into a single array */
var i, count=0, ret = new Object();
for (i=0;i<io.results.length;i++) {
var sessions = io.results[i].info.sessions.sessions;
var j;
for (j=0;j<sessions.length;j++) {
ret[count] = sessions[j];
count++;
}
}
ret.length = count;
return ret;
}