/* @(#)52	1.5  src/rpc/sys_idl/rpcbase.idl, rpc.idl.src, os2dce21.dss, 960602a.1  5/17/95  09:46:49 */
/*
 * COMPONENT_NAME:  rpc.idl.src
 *
 * FUNCTIONS:
 *
 * ORIGINS: 72
 *
 */
/*
 * @OSF_COPYRIGHT@
 * COPYRIGHT NOTICE
 * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
 * ALL RIGHTS RESERVED (DCE).  See the file named COPYRIGHT.DCE in the
 * src directory for the full copyright text.
 */
/*
 * HISTORY
 * $Log: rpcbase.idl,v $
 * Revision 1.1.4.3  1994/07/28  18:30:34  mori_m
 *	CR 11294  rpc_c_attr_codesets is now defined in nsattrid.h
 *	[1994/07/28  18:20:11  mori_m]
 *
 * Revision 1.1.4.2  1994/02/08  21:27:46  mori_m
 *	CR 9701:  Initial submission for RPC runtime I18N support
 *	[1994/02/08  21:24:17  mori_m]
 *
 * Revision 1.1.4.1  1994/01/28  23:09:51  burati
 *	Add rpc_authz_cred_handle_t for EPAC use (dlg_bl1)
 *	[1994/01/18  20:50:40  burati]
 *
 * Revision 1.1.2.3  1993/01/04  00:10:23  bbelch
 *	Embedding copyright notice
 *	[1993/01/03  20:15:53  bbelch]
 *
 * Revision 1.1.2.2  1992/12/23  21:20:54  zeliff
 *	Embedding copyright notice
 *	[1992/12/23  15:47:34  zeliff]
 *
 * Revision 1.1  1992/01/19  03:13:53  devrcs
 *	Initial revision
 *
 * $EndLog$
 */
/*
**  Copyright (c) 1991 by
**	Hewlett-Packard Company, Palo Alto, Ca. &
**	Digital Equipment Corporation, Maynard, Mass.
**
**
**  NAME:
**
**	rpcbase.idl
**
**  FACILITY:
**
**	Remote Procedure Call
**
**  ABSTRACT:
**
**  Base RPC types.
**
**
*/

[local] interface rpcbase
{

import "dce/lbase.idl";
import "dce/rpctypes.idl";
import "dce/iovector.idl";

/*************************************************************************/
/*************************  Common definitions	**************************/
/*************************************************************************/

/*
 * Communications runtime status codes
 */
const long  rpc_s_ok				= error_status_ok;

/*
 * Opaque pointer for those arguments which are pointers to
 * internal structures.
 */
typedef struct _rpc_opaque_t   /* OT7619, CMVC5209,  _rpc_opaque_t added */
{
    unsigned32	dummy;
} *rpc_opaque_ptr_t;

/*
 * Max call constants.
 */
const long  rpc_c_protseq_max_reqs_default  = 0;
const long  rpc_c_listen_max_calls_default  = 10;

/*
 * RPC call semantics.
 */
const long  rpc_c_call_non_idempotent	    = 0x00000000;
const long  rpc_c_call_brdcst		    = 0x00000001;
const long  rpc_c_call_idempotent	    = 0x00000002;
const long  rpc_c_call_maybe		    = 0x00000004;

/*
 * Binding timeout attribute.
 */
const long  rpc_c_binding_min_timeout	    = 0;
const long  rpc_c_binding_default_timeout   = 5;
const long  rpc_c_binding_max_timeout	    = 9;
const long  rpc_c_binding_infinite_timeout  = 10;

/*
 * A transfer syntax representation. The transfer syntax values are
 * architected.
 */
typedef struct rpc_syntax_id_t	 /* OT7619, CMVC5209, rpc_syntax_id_t addded */
{
    uuid_t		    id;
    unsigned32		    version;
} rpc_syntax_id_t, *rpc_syntax_id_p_t;

/*
 * Procedural mashalling/unmarshalling entry point vector type definition.
 */
typedef void (*rpc_convert_proc_t)
(
);

typedef rpc_convert_proc_t *rpc_convert_epv_t;

		     /* OT7619, CMVC5209, rpc_transfer_syntax_t added */
typedef struct rpc_transfer_syntax_t
{
    rpc_syntax_id_t	    id;
    unsigned32		    index;
    rpc_convert_epv_t	    convert_epv;
} rpc_transfer_syntax_t, *rpc_transfer_syntax_p_t;

/*
 * An opaque binding handle.
 */
typedef handle_t rpc_binding_handle_t;

/*
 * An opaque call handle for use during an RPC call.
 */
typedef rpc_opaque_ptr_t    rpc_call_handle_t, *rpc_call_handle_p_t;

/*
 * An opaque client handle to be passed to the server stub. It
 * identifies a client address space or thread of execution.
 */
typedef rpc_opaque_ptr_t    rpc_client_handle_t, *rpc_client_handle_p_t;

/*
 * A vector of binding handles.
 */
			    /* OT7619, CMVC5209, rpc_binding_vector_t added */
typedef struct rpc_binding_vector_t
{
    unsigned32		    count;
    rpc_binding_handle_t    binding_h[1];   /* count_is=count */
} rpc_binding_vector_t, *rpc_binding_vector_p_t;

/*
 * A vector of RPC protocol sequences.
 */
			    /* OT7619, CMVC5209, rpc_protseq_vector_t added */
typedef struct rpc_protseq_vector_t
{
    unsigned32		    count;
    unsigned_char_p_t	    protseq[1];   /* count_is=count */
} rpc_protseq_vector_t, *rpc_protseq_vector_p_t;

/*
 * A data structure containing a vector of pointers to network addresses,
 * along with a count of the number of pointers present.
 */

typedef struct rpc_netaddr_vector_t			      /* CMVC 13061 */
{
    unsigned32		    count;
    unsigned_char_t	   *netaddr[1];
} rpc_netaddr_vector_t, *rpc_netaddr_vector_p_t;

/*
 * Opaque interface handle representing the interface being used.
 */
typedef rpc_opaque_ptr_t    rpc_if_handle_t, *rpc_if_handle_p_t;

/*
 * Manager entry point vector type definitions
 */
typedef void (*rpc_mgr_proc_t)
(
);

typedef rpc_mgr_proc_t *rpc_mgr_epv_t;

/*
 * Version 2 (NCS 2.0) server stub and stub EPV
 */
typedef void (*rpc_v2_server_stub_proc_t)
(
    [in]	handle_t		binding_handle,
    [in]	rpc_call_handle_t	call_handle,
    [in]	rpc_iovector_elt_p_t	in_call_args,
    [in]	ndr_format_p_t		remote_ndr_fmt,
    [in]	rpc_transfer_syntax_p_t xfer_syntax,
    [in]	rpc_mgr_epv_t		mgr_epv,
    [out]	unsigned32		*st
);

typedef rpc_v2_server_stub_proc_t *rpc_v2_server_stub_epv_t;

/*
 * A pointer to the liveness rundown routine.
 */
typedef void (*rpc_network_rundown_fn_t)
(
    [in]	rpc_client_handle_t	client_h
);

/*************************************************************************/
/******************  Management Services definitions  ********************/
/*************************************************************************/

/*
 * Cancel timeout attribute
 */
const long  rpc_c_cancel_infinite_timeout   = -1;

/*
 * Authorization routine for processing remote calls to the server's
 * management routines.
 */

typedef boolean32 (*rpc_mgmt_authorization_fn_t)
(
    [in]	rpc_binding_handle_t  binding_handle,
    [in]	unsigned32	      requested_mgmt_operation,
    [out]	unsigned32	      *status
);

/*
 * Values that are passed as the 2nd paramater to the management
 * authorization routine.
 */

const long  rpc_c_mgmt_inq_if_ids		= 0;
const long  rpc_c_mgmt_inq_stats		= 1;
const long  rpc_c_mgmt_is_server_listen 	= 2;
const long  rpc_c_mgmt_stop_server_listen	= 3;
const long  rpc_c_mgmt_inq_princ_name		= 4;

/*************************************************************************/
/*********************	Name Services definitions  ***********************/
/*************************************************************************/

/*
 * Generic ns handle.
 */
typedef rpc_opaque_ptr_t    rpc_ns_handle_t, *rpc_ns_handle_p_t;

/*
 * Supported name service constants.
 */
const long  rpc_c_ns_none		    = 0; /* No name service	*/
const long  rpc_c_ns_dec_dns		    = 1; /* DECdns		*/

/*
 * Name service syntax constants (architected values).
 */
const long  rpc_c_ns_syntax_default	    = 0; /* use default 	*/
const long  rpc_c_ns_syntax_unknown	    = 1; /* unknown		*/
const long  rpc_c_ns_syntax_dec_dns	    = 2; /* DECdns		*/
const long  rpc_c_ns_syntax_dce 	    = 3; /* DCE 		*/
const long  rpc_c_ns_syntax_x500	    = 4; /* ISO OSI X.500	*/
const long  rpc_c_ns_syntax_internet_dns    = 5; /* DOD internet Domain NS */
const long  rpc_c_ns_syntax_uuid	    = 6; /* UUID string 	 */

/*
 * Name service inquiry options for profiles.
 */
const long  rpc_c_profile_default_elt	    = 1;
const long  rpc_c_profile_all_elts	    = 2;
const long  rpc_c_profile_match_by_if	    = 3;
const long  rpc_c_profile_match_by_mbr	    = 4;
const long  rpc_c_profile_match_by_both     = 5;

/*
 * Name service binding vector size for lookup.
 */
const long  rpc_c_binding_max_count_default = 5;

/*
 * NSI to generate (or use) a default expiration age value for updates to
 * name service local data.
 */
const long  rpc_c_ns_default_exp_age	= 0xffffffff;

/*************************************************************************/
/*********************	Protocol tower definitions  **********************/
/*************************************************************************/

/*
 * A vector of protocol towers
 */
typedef struct rpc_tower_vector_t  /* OT7619, CMVC5209, rpc_tower_vector_t added */
{
    unsigned32	count;
    twr_p_t	tower[1];
} rpc_tower_vector_t, *rpc_tower_vector_p_t;

/*************************************************************************/
/****************  Authentication Services definitions	******************/
/*************************************************************************/

/*
 * Handle on authentication service identity (credentials)
 *
 * This is what a client uses to refer to (one of) its own identities.
 */
typedef rpc_opaque_ptr_t rpc_auth_identity_handle_t;

/*
 * Protection level
 */
const long rpc_c_protect_level_default	       = 0; /* default for auth svc */
const long rpc_c_protect_level_none	       = 1; /* no authentication performed */
const long rpc_c_protect_level_connect	       = 2; /* only on "connect" */
const long rpc_c_protect_level_call	       = 3; /* on first pkt of each call */
const long rpc_c_protect_level_pkt	       = 4; /* on each packet */
const long rpc_c_protect_level_pkt_integ       = 5; /* strong integrity check */
const long rpc_c_protect_level_pkt_privacy     = 6; /* encrypt arguments */
const long rpc_c_protect_level_cdmf_priv       = 7; /* CDMF encryption */

/*
 * Authentication services
 *
 * The various authentication schemes/protocols available to applications.
 */
const long rpc_c_authn_none	    = 0; /* no authentication */
const long rpc_c_authn_dce_secret   = 1; /* OSF DCE shared secret key auth */
const long rpc_c_authn_dce_public   = 2; /* OSF DCE public key auth (reserved) */
const long rpc_c_authn_dce_dummy    = 3; /* OSF DCE non-crypto auth */
const long rpc_c_authn_dssa_public  = 4; /* DSSA public key auth (reserved) */

const long rpc_c_authn_default	    = 0xffffffff; /* default for environment */

/*
 * Authorization services
 *
 * The various authorization schemes/protocol available to applications.
 * The application's choice of authentication service determines the
 * set of authorization services the application is allowed to use.
 */
const long rpc_c_authz_none = 0;
const long rpc_c_authz_name = 1;
const long rpc_c_authz_dce  = 2;

/*
 * Truly opaque handle on authorization data
 *
 * An opaque handle on client authorization data obtained by
 * calling rpc_binding_inq_auth_caller().  Unlike the deprecated
 * rpc_authz_handle_t type below, an instance of the
 * rpc_authz_cred_handle_t type is truly opaque.  It cannot be
 * cast to anything meaningful.  Credentials can only extracted
 * via calls to the sec_cred_ interface.
 */
typedef struct {
    unsigned32	magic;
    void	*data;
} rpc_authz_cred_handle_t, *rpc_authz_cred_handle_p_t;

/*
 * Handle on authorization data
 *
 * This is what a server gets back when it asks who a client is (via
 * rpc_binding_inq_auth_client).  A pointer of this type must be cast
 * to some concrete type (by the server) that's a function of the
 * authorization service that the client used when authenticating to
 * the server.
 */
typedef void *rpc_authz_handle_t;

/*
 * Signature of a server-application procedure routine that returns
 * encryption keys.
 */
typedef void (*rpc_auth_key_retrieval_fn_t)
(
    [in]	void			*arg,
    [in]	unsigned_char_p_t	server_princ_name,
    [in]	unsigned32		key_type,
    [in]	unsigned32		key_ver,
    [out]	void			**key,
    [out]	unsigned32		*st
);

/*************************************************************************/
/*******************  Object Services definitions  ***********************/
/*************************************************************************/

/*
 * Signature of an application procedure that returns takes an object ID
 * and returns that object's type ID.
 */
typedef void (*rpc_object_inq_fn_t)
(
    [in]	uuid_p_t		object_uuid,
    [out]	uuid_t			*type_uuid,
    [out]	unsigned32		*status
);

/*************************************************************************/
/*******************  Endpoint Service definitions  **********************/
/*************************************************************************/

const long  rpc_c_ep_max_annotation_size    = 64;   /* including null */

/*
 * Types and constants for use by EP management functions.
 */
typedef rpc_opaque_ptr_t    rpc_ep_inq_handle_t, *rpc_ep_inq_handle_p_t;

}
