mlsvc_util.h revision dc20a3024900c47dd2ee44b9707e6df38f7d62a5
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SMBSRV_MLSVC_UTIL_H
#define _SMBSRV_MLSVC_UTIL_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* MLSVC RPC interface and utility function definitions.
*/
#include <smbsrv/smb_token.h>
#ifndef _KERNEL
#include <stdio.h>
#include <string.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
smb_userinfo_t *mlsvc_alloc_user_info(void);
char *mlsvc_sid_name_use(unsigned int snu_id);
extern int mlsvc_is_local_domain(const char *);
/*
* The definition of a local unique id (LUID). This is an opaque id
* used by servers to identify local resources, such as privileges.
* A client will use lookup functions to translate the LUID to a
* more general, machine independent form; like a string.
*/
struct ms_luid {
};
/*
* As with SIDs, this is the generic, interface independent string
* definition.
*/
struct ms_string_desc {
};
typedef struct ms_string_desc ms_string_t;
/*
* This is the generic, interface independent handle definition.
*/
typedef struct ms_handle {
} ms_handle_t;
/*
* The mlsvc_rpc_context structure provides the connection binding context
* for client RPC calls. This space must be provided by the client library
* for use by the underlying RPC library. Note that we need two binding
* pools per connection.
*/
#define CTXT_N_BINDING_POOL 2
struct mlsvc_rpc_context {
struct mlrpc_client cli;
int fid;
int server_os;
int server_pdc;
struct mlrpc_binding *binding;
};
/*
* Each RPC interface requires a context and each RPC call within that
* interface requires a handle. Handles are call specific, however, so
* a number of different handles may be used during a sequence of calls
* to a specific RPC interface. Contexts are interface specific so
* there is one per interface per thread of execution. This structure
* provides a handle to context relationship so that we know which
* context to use with any particular handle.
*
* The context contains a pointer to the top level handle for the
* interface, which is assigned during the bind. It's used when closing
* to detect when to free the context.
*/
typedef struct mlsvc_rpc_desc {
struct mlsvc_rpc_context *context;
#ifdef __cplusplus
}
#endif
#endif /* _SMBSRV_MLSVC_UTIL_H */