~ampelbein/ubuntu/oneiric/heartbeat/lp-770743

« back to all changes in this revision

Viewing changes to lib/plugins/stonith/ipmilan_test.c

  • Committer: Bazaar Package Importer
  • Author(s): Ante Karamatic
  • Date: 2010-02-17 21:59:18 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100217215918-06paxph5do4saw8v
Tags: 3.0.2-0ubuntu1
* New upstream release
* Drop hard dep on pacemaker for heartbet; moved to Recommends
* debian/heartbeat.install:
  - follow upstream changes
* debian/control:
  - added docbook-xsl and xsltproc to build depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Stonith module for ipmi lan Stonith device
3
 
 *
4
 
 * Copyright (c) 2003 Intel Corp. 
5
 
 *      Yixiong Zou <yixiong.zou@intel.com>
6
 
 *
7
 
 * This library is free software; you can redistribute it and/or
8
 
 * modify it under the terms of the GNU Lesser General Public
9
 
 * License as published by the Free Software Foundation; either
10
 
 * version 2.1 of the License, or (at your option) any later version.
11
 
 * 
12
 
 * This library is distributed in the hope that it will be useful,
13
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 
 * Lesser General Public License for more details.
16
 
 * 
17
 
 * You should have received a copy of the GNU Lesser General Public
18
 
 * License along with this library; if not, write to the Free Software
19
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
 
 *
21
 
 */
22
 
 
23
 
/*
24
 
 * A quick test program to verify that IPMI host is setup correctly.
25
 
 * 
26
 
 * You will need to modify the values in user, pass, ip, and port. 
27
 
 */
28
 
 
29
 
#include <stdio.h>
30
 
#include <string.h>
31
 
#include "ipmilan.h"
32
 
#include <OpenIPMI/ipmi_auth.h>
33
 
 
34
 
int main(int argc, char * argv[])
35
 
{
36
 
        struct ipmilanHostInfo host;
37
 
        int request = 2;
38
 
        int rv;
39
 
 
40
 
        char user[] = "joe";
41
 
        char pass[] = "blow";
42
 
        char ip[] = "192.168.1.7";
43
 
 
44
 
        host.hostname = NULL;
45
 
        host.portnumber = 999;
46
 
        host.authtype = IPMI_AUTHTYPE_NONE;
47
 
        host.privilege = IPMI_PRIVILEGE_ADMIN;
48
 
 
49
 
        host.ipaddr = ip;
50
 
        memcpy(host.username, user, sizeof(user));
51
 
        memcpy(host.password, pass, sizeof(pass));
52
 
        /*
53
 
        memset(host.username, 0, sizeof(host.username));
54
 
        memset(host.password, 0, sizeof(host.password));
55
 
        */
56
 
 
57
 
        rv = do_ipmi_cmd(&host, request);
58
 
        if (rv)  
59
 
                printf("rv = %d, operation failed. \n", rv);
60
 
        else 
61
 
                printf("operation succeeded. \n");
62
 
        return rv;
63
 
}