dce/rpc "client" api

Jeremy Allison jeremy at valinux.com
Thu Aug 17 07:45:32 GMT 2000

On Thu, Aug 17, 2000 at 03:40:25PM +1000, Luke Kenneth Casson Leighton wrote:
> i'm adding the following api into cli_connect.c, it's basically replacing
> all the switch statements with a function table.  it will make it easier
> to add DCE/RPC over TCP.

Luke, after all our recent discussions this is the wrong way to
propose a change to HEAD (if, that is, you're proposing a change to
HEAD). "I'm adding" - ie. the implication being there's
no discussion over it, is not the correct phrasing to use here.

If it's a change to TNG then can you please confirm that, in which
case of course that is perfectly acceptable, as this is your branch.

> also, The Plan Is, to make these function tables dynamically loadable.
> cli_ncacn_np.so, for example, to handle DCE/RPC over SMB.  cli_ncalrpc.so
> to handle DCE/RPC over loop-back (currently implemented as unix domain
> sockets, only accessible by/as root).

Again, we're not yet ready to add .so support into HEAD until
we determine how this should work across all supported OS'es.

This should probably take place after the 2.2.x pullback
from HEAD.

> typedef struct cli_connect_fns
> {
> 	/* create new connection.  strictly speaking, one arg should be
> 	 * full dce/rpc format: e.g "ncacn_np:\\server\pipe\pipename" */
> 	void *cli_connect_add(const char *pipe_name,
> 				  const vuser_key *key,
> 				  const char *srv_name,
> 				  const struct ntuser_creds *ntc,
> 				  BOOL reuse, BOOL *is_new_connection);
> 	/* terminate client connection */
> 	void cli_connection_free(void *con);
> 	/* get nt creds associated with an msrpc session. */
> 	struct ntdom_info *cli_conn_get_ntinfo(void *con);
> 	/* get a server name associated with a connection */
> 	BOOL cli_con_get_srvname(void *con, char *srv_name);
> 	/* write to a pipe */
> 	BOOL rpc_api_write(void *con, prs_struct *data);
> 	/* read from a pipe */
> 	BOOL rpc_api_rcv_pdu(void *con, prs_struct *rdata);
> 	/* detect dead servers. The fd is set to -1 when we get an error */
> 	BOOL rpc_con_ok(void *con);
> 	/* read and write to a pipe */
> 	BOOL rpc_api_send_rcv_pdu(void *con, prs_struct *data,
> 			  prs_struct *rdata);
> } cli_connect_fns;

This idea looks interesting, can you explain exactly
how it would be used please, as I'm not sure of the
exact semantics of these calls.

The only thing I'm not keen on here is the returning
of (void *) as the type of a "con". I know it's the
correct abstract data type thing to do, but I'd like
to initially see the internal data type of "con" before



PS. Email response still patchy as I'm still at LinuxWorld.

Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list