]> git.proxmox.com Git - mirror_smartmontools-debian.git/blame - smartctl.h
Update to Standards-Version 3.9.5, no changes need
[mirror_smartmontools-debian.git] / smartctl.h
CommitLineData
832b75ed
GG
1/*
2 * smartctl.h
3 *
4 * Home page of code is: http://smartmontools.sourceforge.net
5 *
cfbba5b9
GI
6 * Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
7 * Copyright (C) 2008-10 Christian Franke <smartmontools-support@lists.sourceforge.net>
832b75ed
GG
8 * Copyright (C) 2000 Michael Cornwell <cornwell@acm.org>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
13 * any later version.
14 *
15 * You should have received a copy of the GNU General Public License
ee38a438
GI
16 * (for example COPYING); if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
832b75ed
GG
18 *
19 * This code was originally developed as a Senior Thesis by Michael Cornwell
20 * at the Concurrent Systems Laboratory (now part of the Storage Systems
21 * Research Center), Jack Baskin School of Engineering, University of
22 * California, Santa Cruz. http://ssrc.soe.ucsc.edu/
23 *
24 */
25
26#ifndef SMARTCTL_H_
27#define SMARTCTL_H_
28
ee38a438 29#define SMARTCTL_H_CVSID "$Id: smartctl.h 3727 2012-12-13 17:23:06Z samm2 $\n"
832b75ed
GG
30
31// Return codes (bitmask)
32
33// command line did not parse, or internal error occured in smartctl
34#define FAILCMD (0x01<<0)
35
36// device open failed
37#define FAILDEV (0x01<<1)
38
4d59bff9
GG
39// device is in low power mode and -n option requests to exit
40#define FAILPOWER (0x01<<1)
41
832b75ed
GG
42// read device identity (ATA only) failed
43#define FAILID (0x01<<1)
44
45// smart command failed, or ATA identify device structure missing information
46#define FAILSMART (0x01<<2)
47
48// SMART STATUS returned FAILURE
49#define FAILSTATUS (0x01<<3)
50
51// Attributes found <= threshold with prefail=1
52#define FAILATTR (0x01<<4)
53
54// SMART STATUS returned GOOD but age attributes failed or prefail
55// attributes have failed in the past
56#define FAILAGE (0x01<<5)
57
58// Device had Errors in the error log
59#define FAILERR (0x01<<6)
60
61// Device had Errors in the self-test log
62#define FAILLOG (0x01<<7)
63
64// Classes of SMART commands. Here 'mandatory' means "Required by the
65// ATA/ATAPI-5 Specification if the device implements the S.M.A.R.T.
66// command set." The 'mandatory' S.M.A.R.T. commands are: (1)
67// Enable/Disable Attribute Autosave, (2) Enable/Disable S.M.A.R.T.,
68// and (3) S.M.A.R.T. Return Status. All others are optional.
cfbba5b9
GI
69enum failure_type {
70 OPTIONAL_CMD,
71 MANDATORY_CMD,
72};
73
74// Globals to set failuretest() policy
75extern bool failuretest_conservative;
76extern unsigned char failuretest_permissive;
77
78// Compares failure type to policy in effect, and either exits or
79// simply returns to the calling routine.
80void failuretest(failure_type type, int returnvalue);
81
82// Globals to control printing
83extern bool printing_is_switchable;
84extern bool printing_is_off;
85
86// Printing control functions
87inline void print_on()
88{
89 if (printing_is_switchable)
90 printing_is_off = false;
91}
92inline void print_off()
93{
94 if (printing_is_switchable)
95 printing_is_off = true;
96}
832b75ed
GG
97
98#endif