diff options
author | Tim Potter <tpot@samba.org> | 2005-06-09 07:28:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:17:51 -0500 |
commit | 0b119901d8d948e62d46f760b2dd40ba5331afc9 (patch) | |
tree | 25a512fa2e16a66d25e9456419002c80f30b7cfa /source4/scripting | |
parent | 7931aed30de1f3222fe1d60042cf4951469a770f (diff) | |
download | samba-0b119901d8d948e62d46f760b2dd40ba5331afc9.tar.gz samba-0b119901d8d948e62d46f760b2dd40ba5331afc9.tar.bz2 samba-0b119901d8d948e62d46f760b2dd40ba5331afc9.zip |
r7422: Create a ejs object to wrap a smbcli_transport pointer.
(This used to be commit a55e40651d06f416871ccbe04ad3b7d25444d645)
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/ejs/smbcalls_cli.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/scripting/ejs/smbcalls_cli.c b/source4/scripting/ejs/smbcalls_cli.c index adb55a0184..de31d7a900 100644 --- a/source4/scripting/ejs/smbcalls_cli.c +++ b/source4/scripting/ejs/smbcalls_cli.c @@ -24,6 +24,20 @@ #include "lib/ejs/ejs.h" #include "librpc/gen_ndr/ndr_nbt.h" +static struct MprVar mprTransport(struct smbcli_transport *transport) +{ + struct MprVar res, val; + + res = mprCreateObjVar("transport", MPR_DEFAULT_HASH_SIZE); + + val = mprCreateStringVar(talloc_get_name(transport), 1); + mprCreateProperty(&res, "name", &val); + + /* TODO: Create a C pointer "value" property */ + + return res; +} + /* Connect to a server */ static int ejs_cli_connect(MprVarHandle eid, int argc, char **argv) @@ -77,6 +91,10 @@ static int ejs_cli_connect(MprVarHandle eid, int argc, char **argv) return 0; } + /* Return a socket object */ + + ejsSetReturnValue(eid, mprTransport(transport)); + return 0; } |