2
* Stonith module for ipmi lan Stonith device
4
* Copyright (c) 2003 Intel Corp.
5
* Yixiong Zou <yixiong.zou@intel.com>
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.
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.
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
24
* A quick test program to verify that IPMI host is setup correctly.
26
* You will need to modify the values in user, pass, ip, and port.
32
#include <OpenIPMI/ipmi_auth.h>
34
int main(int argc, char * argv[])
36
struct ipmilanHostInfo host;
42
char ip[] = "192.168.1.7";
45
host.portnumber = 999;
46
host.authtype = IPMI_AUTHTYPE_NONE;
47
host.privilege = IPMI_PRIVILEGE_ADMIN;
50
memcpy(host.username, user, sizeof(user));
51
memcpy(host.password, pass, sizeof(pass));
53
memset(host.username, 0, sizeof(host.username));
54
memset(host.password, 0, sizeof(host.password));
57
rv = do_ipmi_cmd(&host, request);
59
printf("rv = %d, operation failed. \n", rv);
61
printf("operation succeeded. \n");