diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-11 09:19:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:20:06 -0500 |
commit | 683432660ea53304d25212c56fd119aaabe2c0e3 (patch) | |
tree | 309f503b0a17d17f7e46ba076365535330618be0 /source4/scripting/ejs/smbcalls.c | |
parent | 1864b27857c71b998dd201acaaa3c8664b8be960 (diff) | |
download | samba-683432660ea53304d25212c56fd119aaabe2c0e3.tar.gz samba-683432660ea53304d25212c56fd119aaabe2c0e3.tar.bz2 samba-683432660ea53304d25212c56fd119aaabe2c0e3.zip |
r8318: added a bunch more ejs calls.
getgr*()
getpw*()
strlower()
strupper()
IfaceList()
(This used to be commit 1517ad490dd67302f38ab9dcd8a3b24b73b8d550)
Diffstat (limited to 'source4/scripting/ejs/smbcalls.c')
-rw-r--r-- | source4/scripting/ejs/smbcalls.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/scripting/ejs/smbcalls.c b/source4/scripting/ejs/smbcalls.c index 328bd14ab5..5972518036 100644 --- a/source4/scripting/ejs/smbcalls.c +++ b/source4/scripting/ejs/smbcalls.c @@ -64,6 +64,20 @@ static int ejs_typeof(MprVarHandle eid, int argc, struct MprVar **argv) return 0; } +/* + return the list of configured network interfaces +*/ +static int ejs_IfaceList(MprVarHandle eid, int argc, struct MprVar **argv) +{ + int i, count = iface_count(); + struct MprVar ret = mprCreateObjVar("interfaces", MPR_DEFAULT_HASH_SIZE); + for (i=0;i<count;i++) { + mprAddArray(&ret, i, mprString(iface_n_ip(i))); + } + mpr_Return(eid, ret); + return 0; +} + /* libinclude() allows you to include js files using a search path specified @@ -123,8 +137,11 @@ void smb_setup_ejs_functions(void) smb_setup_ejs_rpc(); smb_setup_ejs_auth(); smb_setup_ejs_options(); + smb_setup_ejs_nss(); + smb_setup_ejs_string(); ejsDefineCFunction(-1, "typeof", ejs_typeof, NULL, MPR_VAR_SCRIPT_HANDLE); + ejsDefineCFunction(-1, "IfaceList", ejs_IfaceList, NULL, MPR_VAR_SCRIPT_HANDLE); ejsDefineStringCFunction(-1, "libinclude", ejs_libinclude, NULL, MPR_VAR_SCRIPT_HANDLE); } |