X hits on this document

PDF document

February 10, 2006 - page 198 / 238

577 views

0 shares

0 downloads

0 comments

198 / 238

186

APPENDIX I. SAMPLE PROGRAM SHOWING EVENT SETUP

  • *

    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/

#include

<stdio.h>

#include

<stdlib.h>

#include

<string.h>

#include

<malloc.h>

#include

<sys/types.h>

#include

<sys/stat.h>

#include

<fcntl.h>

#include

<unistd.h>

#include

<netdb.h>

#include

<ctype.h>

#include

<time.h>

#include #include #include #include #include #include

<OpenIPMI/ipmiif.h> <OpenIPMI/ipmi_smi.h> <OpenIPMI/ipmi_err.h> <OpenIPMI/ipmi_auth.h> <OpenIPMI/ipmi_lan.h> <OpenIPMI/ipmi_posix.h>

/* This sample application demostrates some general handling of sensors, like reading values, setting up events, and things of that nature. It also demonstrates some good coding practices like refcounting structures. */

static const char *progname;

unsigned int

refcount;

_ ipmi_sensor_id t

sensor_id;

char

_ _ name[MAX_SENSOR NAME SIZE];

_ ipmi event_state_t *es;

_ ipmi thresholds_t *th;

int

state_sup;

int

thresh_sup;

s t a t i c s d a t a _ t * s d a t a _ l i s t = N U L L ;

#define MAX SENSOR NAME SIZE 128

_

_

_

struct sdata s } sdata_t; _

*next, *prev;

t y p e d e f s t r u c t s d a t a _ s

{

Document info
Document views577
Page views577
Page last viewedMon Dec 05 11:56:08 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments