mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
r7422: Create a ejs object to wrap a smbcli_transport pointer.
This commit is contained in:
parent
7e567a6b69
commit
a55e40651d
@ -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