X hits on this document

PDF document

February 10, 2006 - page 186 / 238

593 views

0 shares

0 downloads

0 comments

186 / 238

174

APPENDIX H. SAMPLE PROGRAM SHOWING BASIC OPERATIONS

  • *

    License along with this program; if not, write to the Free

    • *

      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 #include

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

/*

This sample application demostrates a very simple method to use

OpenIPMI. It application,

just search all sensors you can find that there

in

the system.

From

this

is

only 4 lines

code

in main()

function callback

if you use the SMI-only functions in all cases.

interface, */

and

several

simple

static const char *progname;

static void usage(void) {

printf("Usage:\n"

" " " "

%s [options] smi <smi #>\n"

Make a connection to a local system management interface.\n" smi # is generally 0.\n" %s [options] lan <host> <port> <authtype> <privilege>"

" <username> <password>\n"

" " " " "

Make a connection to a IPMI 1.5 LAN interface.\n"

Host and port specify where to connect to (port

generally

623).

authtype

is

none,

md2,

md5,

or

is\n" straight.\n"

privilege is username and

callback, user, operator, password must be provided

or if

admin. The\n" the authtype is\n"

Document info
Document views593
Page views593
Page last viewedTue Dec 06 10:29:54 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments