mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
r7422: Create a ejs object to wrap a smbcli_transport pointer.
(This used to be commit a55e40651d
)
This commit is contained in:
parent
7931aed30d
commit
0b119901d8
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user