mirror of
https://github.com/samba-team/samba.git
synced 2025-01-14 19:24:43 +03:00
r7422: Create a ejs object to wrap a smbcli_transport pointer.
(This used to be commit a55e40651d06f416871ccbe04ad3b7d25444d645)
This commit is contained in:
parent
7931aed30d
commit
0b119901d8
@ -24,6 +24,20 @@
|
|||||||
#include "lib/ejs/ejs.h"
|
#include "lib/ejs/ejs.h"
|
||||||
#include "librpc/gen_ndr/ndr_nbt.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 */
|
/* Connect to a server */
|
||||||
|
|
||||||
static int ejs_cli_connect(MprVarHandle eid, int argc, char **argv)
|
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 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return a socket object */
|
||||||
|
|
||||||
|
ejsSetReturnValue(eid, mprTransport(transport));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user