/* @(#)67	1.6  src/admin/dced/idl/dced_base.idl, dced.src, os2dce21.dss, 960602a.1 5/17/95 09:52:19  */
/*
 *   COMPONENT_NAME: dced.src
 *
 *   FUNCTIONS: none
 *
 *   ORIGINS: 72
 *
 */
/*
 * @OSF_COPYRIGHT@
 * Copyright (c) 1994 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: dced_base.idl,v $
 * Revision 1.1.2.22  1994/09/30  20:14:34  rsalz
 * 	Add srvrexec_data_t.sc_uuid and use it to restart servers (OT CR 12442).
 * 	[1994/09/30  20:10:46  rsalz]
 *
 * Revision 1.1.2.21  1994/09/17  08:05:03  rsalz
 * 	Remote ep-compat fake server (OT CR 12140).
 * 	[1994/09/17  07:55:59  rsalz]
 * 
 * Revision 1.1.2.20  1994/08/28  17:56:16  rsalz
 * 	Add missing server convenience functions (OT CR 11791).
 * 	Rename some fields for clarity.
 * 	[1994/08/28  17:55:44  rsalz]
 * 
 * Revision 1.1.2.19  1994/08/24  19:27:01  bowe
 * 	Expunge transmit_rep from key struct. [CR 11773]
 * 	[1994/08/24  19:12:25  bowe]
 * 
 * Revision 1.1.2.18  1994/08/23  19:24:02  rsalz
 * 	Add entryname field to server_t (OT CR 11396).
 * 	[1994/08/23  19:18:47  rsalz]
 * 
 * Revision 1.1.2.17  1994/05/26  19:42:00  rsalz
 * 	EP functionality.
 * 	[1994/05/26  19:35:28  rsalz]
 * 
 * 	Checkpointing.
 * 	[1994/05/18  19:34:16  rsalz]
 * 
 * Revision 1.1.2.16  1994/05/05  20:07:20  rsalz
 * 	Initial server functionality drop.
 * 	[1994/05/05  20:00:47  rsalz]
 * 
 * Revision 1.1.2.15  1994/04/19  15:51:20  rsalz
 * 	Forgot to upgrade server_c_startup flags (OT CR 9768)
 * 	[1994/04/19  15:44:37  rsalz]
 * 
 * Revision 1.1.2.14  1994/04/14  20:08:28  rsalz
 * 	Make server and API all compile.
 * 	[1994/04/14  19:45:06  rsalz]
 * 
 * Revision 1.1.2.13  1994/04/11  18:45:50  rsalz
 * 	Update to final RFC revision.
 * 	[1994/04/11  18:26:19  rsalz]
 * 
 * Revision 1.1.2.12  1994/03/11  14:30:45  bowe
 * 	Added sec_passwd_rec_t to dced_key_t.
 * 	[1994/03/11  14:10:56  bowe]
 * 
 * Revision 1.1.2.11  1994/03/09  22:38:42  bowe
 * 	added prin_names to server-t
 * 	[1994/03/09  22:28:10  bowe]
 * 
 * Revision 1.1.2.10  1994/03/09  20:13:15  rsalz
 * 	Second round of fixes.
 * 	[1994/03/09  20:12:48  rsalz]
 * 
 * Revision 1.1.2.9  1994/03/09  20:03:51  rsalz
 * 	Fix errors found in review of previous submit.
 * 	[1994/03/09  19:52:58  rsalz]
 * 
 * Revision 1.1.2.8  1994/03/08  15:15:47  rsalz
 * 	Turn dced_key_t.principal back into a dced_string_t.
 * 	[1994/03/08  15:15:22  rsalz]
 * 
 * Revision 1.1.2.7  1994/03/07  20:17:59  rsalz
 * 	Merged with changes from 1.1.2.6
 * 	[1994/03/07  20:17:37  rsalz]
 * 
 * 	Updating to second edition of functional spec.
 * 	Removed changes in 1.1.2.6 version.
 * 	[1994/03/07  19:39:18  rsalz]
 * 
 * Revision 1.1.2.6  1994/03/04  22:12:32  bowe
 * 	Added dce_db_header_t struct to dced_entry_s_t and server_s_t.
 * 	[1994/03/04  21:46:29  bowe]
 * 
 * Revision 1.1.2.5  1994/02/23  14:44:46  bowe
 * 	renamed dkey_t->dced_key_t, dkey_list_t->dced_key_list_t
 * 	[1994/02/23  14:43:32  bowe]
 * 
 * Revision 1.1.2.4  1994/02/22  21:22:17  bowe
 * 	In the dkey_t structure, made transmit_rep be a pointer ([ptr] and *).
 * 	[1994/02/22  21:17:14  bowe]
 * 
 * Revision 1.1.2.3  1994/02/22  18:28:47  rsalz
 * 	Add dced_opnum_list_t datatype; use it in service_t.
 * 	[1994/02/22  18:28:27  rsalz]
 * 
 * Revision 1.1.2.2  1994/02/01  21:43:14  bowe
 * 	Remove definition of server_fixattr_t, which was mistakenly added.
 * 	server_fixedattr_t is the one to use.
 * 	[1994/01/27  14:33:33  bowe]
 * 
 * Revision 1.1.2.1  1994/01/21  18:03:27  bowe
 * 	Initial checkin
 * 	[1994/01/21  18:00:23  bowe]
 * 
 * $EndLog$
 */


[
    uuid(00793bb4-2581-1d33-96e7-0000c09ce054),
    version(1.0)
]


/*
**  D C E D _ B A S E 
**  Common datatypes for all dced services.
**  Some fields within the datatypes defined below are for later expansion
**  so that enhancements can be made while maintaining compatibility.  Such
**  fields are marked "advisory" in the comments.  Of course, no guarantee
**  as is made as to future implementation.
*/
interface dced_base
{ 
	/* For rpc_if_id_t datatype: */
    import "dce/rpctypes.idl";
	/* For sec_attr_t datatype: */
    import "dce/sec_attr_base.idl";
	/* For sec_passwd_rec_t datatype: */
    import "dce/passwd.idl";


    /*
    **  D C E D _ T O W E R _ L I S T _ T 
    **  A list of tower vectors.  The list field is an array of pointers to
    **  sec_attr_twr_set_t's.  A sec_attr_twr_set_t is the same as an
    **  rpc_tower_vector_t except that the latter is, sigh, in a [local]
    **  interface.
    */
    typedef struct dced_tower_list_s_t {
		unsigned32			count;
	[ptr,size_is(count)]
		sec_attr_twr_set_p_t		*list;
    } dced_tower_list_t;


    /*
    **  
    **  S R V R E X E C _ E P _ T 
    **  S R V R E X E C _ E P _ L I S T _ T 
    **  A list of endpoints for a particular interface.
    */
    typedef struct srvrexec_ep_s_t {
		rpc_if_id_t			ifid;
		dced_tower_list_t		towers;
    } srvrexec_ep_t;

    typedef struct srvrexec_ep_list_s_t {
		    unsigned32			count;
	    [ptr,size_is(count)]
		    srvrexec_ep_t		*list;
    } srvrexec_ep_list_t;


    /*
    ** U U I D _ L I S T _ T 
    **  This is like uuid_vector_t in uuid.idl but exists to follow the
    **  standard dced conventions.
    */
    typedef struct uuid_list_s_t {
		unsigned32			count;
	[ptr,size_is(count)]
		uuid_t				*list;
    } uuid_list_t;


    /*
    **  D C E D _ A T T R _ L I S T
    **  A list of attributes.
    */
    typedef struct dced_attr_list_s_t {
		unsigned32			count;
	[ptr,size_is(count)]
		sec_attr_t			*list;
    } dced_attr_list_t;


    /*
    **  D C E D _ S T R I N G _ T 
    **  D C E D _ S T R I N G _ L I S T _ T 
    **  A text string and a list of text strings.
    */
    typedef [ptr,string] char *dced_string_t;

    typedef struct dced_string_list_s_t {
		unsigned32			count;
	[ptr,size_is(count)]
		dced_string_t			*list;
    } dced_string_list_t;


    /*
    **  D C E D _ E N T R Y _ T 
    **  D C E D _ E N T R Y _ L I S T _ T 
    **  The common short-hand name for most dced objects.
    **  The storage_tag indicates where the "true" object may be found;
    **  for example, in the hostdata and rkeytab services it is a filename.
    */
    typedef struct dced_entry_s_t {
		uuid_t				id;
		dced_string_t			name;
		dced_string_t			description;
		dced_string_t			storage_tag;
    } dced_entry_t;

    typedef struct dced_entry_list_s_t {
		unsigned32			count;
	[ptr,size_is (count)]
		dced_entry_t			*list;
    } dced_entry_list_t;


    /*
    **  D C E D _ O P N U M _ L I S T _ T 
    **  List of operation indices.
    */
    typedef struct dced_opnum_list_s_t {
		unsigned32			count;
	[ptr,size_is (count)]
		unsigned32			*list;
    } dced_opnum_list_t;


    /*
    **  S E R V I C E _ T 
    **  S E R V I C E _ L I S T _ T 
    **  Conceptually, a service is a set of objects, a set of things
    **  that can be done to those objects, and a place where it might
    **  be found.  The operations field is advisory.
    */
    typedef struct service_s_t {
		/* XXX should be ifid. */
		rpc_if_id_t			ifspec;
		dced_string_t			ifname;
		dced_string_t			annotation;
		unsigned32			flags;
		dced_string_t			entryname;
		uuid_list_t			objects;
		dced_opnum_list_t		operations;
		dced_tower_list_t		towers;
    } service_t;

    typedef struct service_list_s_t {
		unsigned32			count;
	[ptr,size_is(count)]
		service_t			*list;
    } service_list_t;

    const unsigned32 service_c_disabled			= 0x00000001;
    const unsigned32 service_c__not_exported		= 0x00000002;
    const unsigned32 service_c__registered		= 0x00000004;
    const unsigned32 service_c_vendor1			= 0x01000000;
    const unsigned32 service_c_vendor2			= 0x02000000;
    const unsigned32 service_c_vendor3			= 0x04000000;
    const unsigned32 service_c_vendor4			= 0x08000000;


    /*
    **  S E R V E R _ F I X E D A T T R _ T 
    **  The fixed set of attributes common across all servers.
    **  The prerequisites and keytables are advisory.
    */
    typedef struct server_fixedattr_s_t {
		unsigned32		startupflags;
		unsigned32		flags;
		dced_string_t		program;
		dced_string_list_t	arguments;
		uuid_list_t		prerequisites;
		uuid_list_t		keytables;

		/* Posix-oriented execution attributes. */
		unsigned32		posix_uid;
		unsigned32		posix_gid;
		dced_string_t		posix_dir;
    } server_fixedattr_t;

    const unsigned32 server_c_startup_at_boot		= 0x00000001;
    const unsigned32 server_c_startup_auto		= 0x00000002;
    const unsigned32 server_c_startup_explicit		= 0x00000004;
    const unsigned32 server_c_startup_on_failure	= 0x00000008;
    const unsigned32 server_c_startup_on_schedule	= 0x00000010;
    const unsigned32 server_c_startup_vendor1		= 0x01000000;
    const unsigned32 server_c_startup_vendor2		= 0x02000000;
    const unsigned32 server_c_startup_vendor3		= 0x04000000;
    const unsigned32 server_c_startup_vendor4		= 0x08000000;

    const unsigned32 server_c_exec_notrunning		= 0x00000000;
    const unsigned32 server_c_exec_running		= 0x00000001;
    const unsigned32 server_c_exec__exiting		= 0x00000002;
    const unsigned32 server_c_exec__starting		= 0x00000004;
    const unsigned32 server_c_exec_vendor1		= 0x01000000;
    const unsigned32 server_c_exec_vendor2		= 0x02000000;
    const unsigned32 server_c_exec_vendor3		= 0x04000000;
    const unsigned32 server_c_exec_vendor4		= 0x08000000;

    /*
    **  S R V R E X E C _ D A T A _ T 
    **  Information about an executing server.
    */
    typedef struct srvrexec_data_s_t {
		uuid_t				sc_uuid;
		uuid_t                          instance;
		unsigned32			posix_pid;
    } srvrexec_data_t;


    /*
    **  S E R V E R _ T 
    **  A server is a set of services and some other attributes.
    **  Some attributes are fixed (supported across all implementations)
    **  and some are variable.  Fixed attributes come in two classes,
    **  the fixed configuration attributes and the "execdata" set
    **  which contains information about an executing server.
    */
    typedef struct server_s_t {
		uuid_t			id;
		dced_string_t		name;
		dced_string_t		entryname;
		service_list_t		services;
		server_fixedattr_t	fixed;
		dced_attr_list_t	attributes;
		dced_string_list_t	prin_names;

		/* If server is running there will be data
		 * about the executing process. */
		union switch (unsigned32 execstate) tagged_union {
		case server_c_exec_notrunning:
		    ;
		case server_c_exec_running:
		    srvrexec_data_t	running_data;
		} exec_data;
    } server_t;


    /*
    **  S R V R E X E C _ S T O P _ M E T H O D _ T 
    **  How a server should be stopped.
    */
    typedef enum {
	srvrexec_stop_rpc,
	srvrexec_stop_soft,
	srvrexec_stop_hard,
	srvrexec_stop_error
    } srvrexec_stop_method_t;


    /*
    **  D C E D _ K E Y _ T 
    **  D C E D _ K E Y _ L I S T _ T 
    **  A dced key is transmitted "in the clear" unless using DCE privacy.
    **  The authn_service field is equivalent to the
    **  sec_key_mgmt_authn_service parameter in the sec_key_mgmt_xxx API; it
    **  should be chosen from the set of rpc_c_authn_... values and is
    **  currently limited to rpc_c_authn_dce_secret.
    */
    typedef struct dced_key_s_t {
		dced_string_t		principal;
		unsigned32		version;
		unsigned32		authn_service;
	[unique]
		sec_passwd_rec_t	*passwd;
    } dced_key_t;

    typedef struct dced_key_list_s_t {
		    unsigned32		count;
	[ptr,size_is(count)]
		    dced_key_t		*list;
    } dced_key_list_t;

    /*
    **  I N T E R N A L   T Y P E S
    */
	/* This is really rpc_addr_p_t in rpc/runtime/com.h */
    typedef [ptr] byte *db_rpc_addr_p_t;
}
