~iheino+ub/+junk/nut-upsconf-docfix

« back to all changes in this revision

Viewing changes to drivers/nut-ipmi.h

  • Committer: Tuomas Heino
  • Author(s): Laurent Bigonville
  • Date: 2014-04-22 20:46:12 UTC
  • Revision ID: iheino+ub@cc.hut.fi-20140422204612-1x2gh3nkezfsdao4
Tags: upstream-2.7.2
ImportĀ upstreamĀ versionĀ 2.7.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  nut-ipmi.h - Abstract IPMI interface, to allow using different IPMI backends
 
2
 *
 
3
 *  Copyright (C) 2011 - Arnaud Quette <arnaud.quette@free.fr>
 
4
 *
 
5
 *  This program is free software; you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation; either version 2 of the License, or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
19
 *
 
20
 */
 
21
 
 
22
#ifndef NUT_IPMI_H
 
23
#define NUT_IPMI_H
 
24
 
 
25
typedef enum {
 
26
        PSU_STATUS_UNKNOWN = 1,
 
27
        PSU_PRESENT,                    /* = status OL */
 
28
        PSU_ABSENT,                             /* = status stale */
 
29
        PSU_POWER_FAILURE               /* = status OFF */
 
30
} psu_status_t;
 
31
 
 
32
/* Abstract structure to store information */
 
33
typedef struct IPMIDevice_s {
 
34
        int                     ipmi_id;                                /* FRU ID */
 
35
        char*           manufacturer;                   /* Manufacturer Name */
 
36
        char*           product;                                /* Product Name */
 
37
        char*           serial;                                 /* Product serial number */
 
38
        char*           part;                                   /* Part Number */
 
39
        char*           date;                                   /* Manufacturing Date/Time */
 
40
        int                     overall_capacity;               /* realpower.nominal? */
 
41
        int                     input_minvoltage;
 
42
        int                     input_maxvoltage;
 
43
        int                     input_minfreq;
 
44
        int                     input_maxfreq;
 
45
        int                     voltage;                                /* psu.voltage or device.voltage */
 
46
        unsigned int    sensors_count;                  /* number of sensors IDs in sensors_id_list */
 
47
        unsigned int    sensors_id_list[20];    /* ID of sensors linked to this FRU */
 
48
 
 
49
        /* measurements... */
 
50
        int                     status;                                 /* values from psu_status_t */
 
51
        double          input_voltage;
 
52
        double          input_current;
 
53
        double          temperature;
 
54
} IPMIDevice_t;
 
55
 
 
56
/* Generic functions, to implement in the backends */
 
57
int nut_ipmi_open(int ipmi_id, IPMIDevice_t *ipmi_dev);
 
58
void nut_ipmi_close(void);
 
59
int nut_ipmi_monitoring_init();
 
60
int nut_ipmi_get_sensors_status(IPMIDevice_t *ipmi_dev);
 
61
 
 
62
#endif /* NUT_IPMI_H */
 
63