/*
* 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
* or http://www.opensolaris.org/os/licensing.
* 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 (c) 2012, Oracle and/or its affiliates. All rights reserved.
*/
#ifndef _libdisklog_H
#define _libdisklog_H
#ifdef __cplusplus
extern "c" {
#endif
#include <stdio.h>
#include <sys/types.h>
#include <scsi/libscsi.h>
#define LDL_SUCCESS 0
#define LDL_FAILURE 1
#define LDL_INVALID_PARAM 2
#define LDL_DEVID_DECODE_FAIL 3
#define LDL_DEVPATH_DECODE_FAIL 4
#define LDL_INVALID_DISK_NAME 5
#define LDL_DIR_CREATE_ERROR 6
#define LDL_FILE_ERROR 7
#define LDL_DISK_OPEN_ERROR 8
typedef struct dl_flags {
unsigned int aflag : 1; /* All supported page data */
unsigned int bflag : 1; /* Basic inquiry/log/mode data */
unsigned int eflag : 1; /* All supported pages */
unsigned int lflag : 1; /* Log data */
unsigned int mflag : 1; /* Mode data */
unsigned int Aflag : 1; /* All data for all disks */
unsigned int m1_flag : 1; /* Subpage code valid */
} dl_flags_t;
typedef struct dl_logging_args {
char devid[MAXNAMELEN];
char devpath[MAXPATHLEN];
char dir[MAXPATHLEN];
char *uuid;
struct dl_flags flags;
} dl_logging_args_t;
extern int disklog_print_diskinfo(dl_logging_args_t *args);
extern void disklog_send_inquiry(libscsi_hdl_t *, libscsi_target_t *,
boolean_t, int, FILE *, dl_flags_t);
extern void disklog_send_log_sense(
libscsi_hdl_t *, libscsi_target_t *, int, FILE *, dl_flags_t);
extern void disklog_send_mode_sense(libscsi_hdl_t *, libscsi_target_t *,
int, int, FILE *, dl_flags_t);
extern void
disklog_get_dumplog(libscsi_target_t *, dl_logging_args_t *, FILE *);
extern int
disklog_open_device(libscsi_hdl_t **, libscsi_target_t **,
const char *, boolean_t, FILE *);
extern void
disklog_close_device(libscsi_hdl_t *, libscsi_target_t *);
#pragma pack()
#ifdef __cplusplus
}
#endif
#endif /* _libdisklog_H */