dce/rpc "client" api

Luke Kenneth Casson Leighton lkcl at samba.org
Thu Aug 17 05:40:25 GMT 2000


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.

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).


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;





More information about the samba-technical mailing list