smartmontools SVN Rev 3317
Utility to control and monitor storage systems with "S.M.A.R.T."
Classes | Defines | Typedefs | Functions | Variables
knowndrives.cpp File Reference
#include "config.h"
#include "int64.h"
#include <stdio.h>
#include "atacmds.h"
#include "knowndrives.h"
#include "utility.h"
#include <stdexcept>
#include "drivedb.h"
Include dependency graph for knowndrives.cpp:

Go to the source code of this file.

Classes

class  drive_database
 Drive database class. More...
class  stdin_iterator
struct  token_info

Defines

#define MODEL_STRING_LENGTH   40
#define FIRMWARE_STRING_LENGTH   8
#define TABLEPRINTWIDTH   19

Typedefs

typedef stdin_iterator parse_ptr

Functions

static bool is_usb_modelfamily (const char *modelfamily)
static bool is_usb_entry (const drive_settings *dbentry)
static bool compile (regular_expression &regex, const char *pattern)
static bool match (const char *pattern, const char *str)
static const drive_settingslookup_drive (const char *model, const char *firmware)
static bool parse_db_presets (const char *presets, ata_vendor_attr_defs *defs, firmwarebug_defs *firmwarebugs, std::string *type)
static bool parse_presets (const char *presets, ata_vendor_attr_defs &defs, firmwarebug_defs &firmwarebugs)
static bool parse_usb_type (const char *presets, std::string &type)
static void parse_usb_names (const char *names, usb_dev_info &info)
int lookup_usb_device (int vendor_id, int product_id, int bcd_device, usb_dev_info &info, usb_dev_info &info2)
static int showonepreset (const drive_settings *dbentry)
int showallpresets ()
int showmatchingpresets (const char *model, const char *firmware)
void show_presets (const ata_identify_device *drive)
const drive_settingslookup_drive_apply_presets (const ata_identify_device *drive, ata_vendor_attr_defs &defs, firmwarebug_defs &firmwarebugs)
static parse_ptr skip_white (parse_ptr src, const char *path, int &line)
static parse_ptr get_token (parse_ptr src, token_info &token, const char *path, int &line)
static bool parse_drive_database (parse_ptr src, drive_database &db, const char *path)
bool read_drive_database (const char *path)
const char * get_drivedb_path_add ()
bool read_default_drive_databases ()

Variables

const char * knowndrives_cpp_cvsid
const drive_settings builtin_knowndrives []
static drive_database knowndrives
 The drive database.

Define Documentation

#define FIRMWARE_STRING_LENGTH   8

Definition at line 40 of file knowndrives.cpp.

#define MODEL_STRING_LENGTH   40

Definition at line 39 of file knowndrives.cpp.

#define TABLEPRINTWIDTH   19

Definition at line 41 of file knowndrives.cpp.


Typedef Documentation

Definition at line 603 of file knowndrives.cpp.


Function Documentation

static bool compile ( regular_expression regex,
const char *  pattern 
) [static]

Definition at line 156 of file knowndrives.cpp.

const char* get_drivedb_path_add ( )

Definition at line 834 of file knowndrives.cpp.

static parse_ptr get_token ( parse_ptr  src,
token_info token,
const char *  path,
int &  line 
) [static]

Definition at line 662 of file knowndrives.cpp.

static bool is_usb_entry ( const drive_settings dbentry) [inline, static]

Definition at line 150 of file knowndrives.cpp.

static bool is_usb_modelfamily ( const char *  modelfamily) [static]

Definition at line 144 of file knowndrives.cpp.

static const drive_settings* lookup_drive ( const char *  model,
const char *  firmware 
) [static]

Definition at line 180 of file knowndrives.cpp.

const drive_settings* lookup_drive_apply_presets ( const ata_identify_device drive,
ata_vendor_attr_defs defs,
firmwarebug_defs firmwarebugs 
)

Definition at line 534 of file knowndrives.cpp.

int lookup_usb_device ( int  vendor_id,
int  product_id,
int  bcd_device,
usb_dev_info info,
usb_dev_info info2 
)

Definition at line 274 of file knowndrives.cpp.

static bool match ( const char *  pattern,
const char *  str 
) [static]

Definition at line 168 of file knowndrives.cpp.

static bool parse_db_presets ( const char *  presets,
ata_vendor_attr_defs defs,
firmwarebug_defs firmwarebugs,
std::string *  type 
) [static]

Definition at line 211 of file knowndrives.cpp.

static bool parse_drive_database ( parse_ptr  src,
drive_database db,
const char *  path 
) [static]

Definition at line 720 of file knowndrives.cpp.

static bool parse_presets ( const char *  presets,
ata_vendor_attr_defs defs,
firmwarebug_defs firmwarebugs 
) [inline, static]

Definition at line 247 of file knowndrives.cpp.

static void parse_usb_names ( const char *  names,
usb_dev_info info 
) [static]

Definition at line 261 of file knowndrives.cpp.

static bool parse_usb_type ( const char *  presets,
std::string &  type 
) [inline, static]

Definition at line 255 of file knowndrives.cpp.

bool read_default_drive_databases ( )

Definition at line 860 of file knowndrives.cpp.

bool read_drive_database ( const char *  path)

Definition at line 818 of file knowndrives.cpp.

void show_presets ( const ata_identify_device drive)

Definition at line 500 of file knowndrives.cpp.

int showallpresets ( )

Definition at line 442 of file knowndrives.cpp.

int showmatchingpresets ( const char *  model,
const char *  firmware 
)

Definition at line 467 of file knowndrives.cpp.

static int showonepreset ( const drive_settings dbentry) [static]

Definition at line 330 of file knowndrives.cpp.

static parse_ptr skip_white ( parse_ptr  src,
const char *  path,
int &  line 
) [static]

Definition at line 606 of file knowndrives.cpp.


Variable Documentation

Definition at line 50 of file knowndrives.cpp.

The drive database.

Definition at line 140 of file knowndrives.cpp.

const char* knowndrives_cpp_cvsid
Initial value:
"$Id: knowndrives.cpp 3719 2012-12-03 21:19:33Z chrfranke $"
                                     KNOWNDRIVES_H_CVSID

Definition at line 36 of file knowndrives.cpp.