dm_impl.h revision cee0fb94c0d4227de0a00efc162fb2739844b641
/*
* 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 __DM_IMPL_H
#define __DM_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <netdb.h>
#include <mms_network.h>
#include <dmd_impl.h>
#include <mms_parser.h>
#include <dm_drive.h>
#include <mms_sock.h>
typedef struct dm_wka {
int dm_counter;
int dm_drm_fd; /* drive manager dev fd */
/*
* dm_drm_path is the pseudo device the DM opens for its own use.
*/
char *dm_drm_path; /* drive manager path */
/*
* dm_targ_base_major and dm_targ_base_minor are major and minor
*/
char *dm_target_base; /* base device of target */
/*
* dm_targ_hdl is the pathname DM returns to the client.
*/
char *dm_targ_hdl; /* target handle for client */
/*
* dm_hdl_major and dm_hdl_id are major and minor device numbers
* of dm_targ_hdl.
* dm_hdl_major is the same as dm_drm_major.
* dm_hdl_minor is a unique id which is used as the minor device number
* and is mapped to (dm_drm_minor + 1).
*/
char *dm_host;
char *dm_port;
char *dm_passwd;
char *dm_mm_passwd;
int dm_ssl_enabled;
char *dm_ssl_cert_file;
char *dm_ssl_pass;
char *dm_ssl_pass_file;
char *dm_ssl_crl_file;
char *dm_ssl_peer_file;
char *dm_ssl_cipher;
void *dm_ssl_data;
char *dm_hdl_prefix;
/* local hostname */
void *dm_default_lib_hdl;
void *dm_dev_lib_hdl;
int dm_msg_level;
int dm_cmd_dispatchable;
char *dm_dev_lib;
char *dm_pwbuf; /* _SC_GETPW_R_SIZE_MAX */
int dm_pwbuf_size;
/*
* If both dm_queue_mutex and dm_worker_mutex must be held,
* lock dm_queue_mutex first before locking dm_worker_mutex.
*/
int dm_work_todo; /* work todo flag */
} dm_wka_t;
/*
* DM flags
*/
typedef struct dm_command {
int cmd_flags;
int cmd_state; /* Continue from state */
int cmd_rc; /* return code from send */
char *cmd_task; /* task string */
int (*cmd_func)(struct dm_command *);
char *cmd_textcmd;
} dm_command_t;
#define CMD_DISPATCHABLE 0x01
#define CMD_INCOMING 0x02
#define CMD_COMPLETE 0x04
#define DM_OPEN_RETRIES 30
#define DM_WRITE_ACCEPT 1
#define DM_DEV_LIB_DIR "/usr/lib/mms/dm"
#define DM_TRACE_DIR "/var/log/mms/dm"
#define MMS_AUTHNAME "solaris.mms.io.*"
#define DM_ERROR (-1)
#define DM_PARTIAL_WRITE (-2)
#define DM_RESTART 2
#define DM_NO_RESTART 1
#define DM_REP_ERROR (-1)
#define DM_REP_YES 0x01
#define DM_REP_NO 0x02
#define DM_REP_UNATTENDED 0x04
#define DM_REP_STRING 0x08
#define DM_REP_ABORT 0x10
#define DM_REP_RETRY 0x20
#define DM_FAILED 0x01
#ifdef __cplusplus
}
#endif
#endif /* __DM_IMPL_H */