ipmiutil-3.0.7/0000755000000000000000000000000013160502164012051 5ustar rootrootipmiutil-3.0.7/doc/0000755000076400007640000000000013160502164013634 5ustar acressloggersipmiutil-3.0.7/doc/idelloem.80000644000076400007640000001024613160502144015520 0ustar acressloggers.TH IDELLOEM 8 "Version 1.0: 17 Aug 2011" .SH NAME ipmiutil_delloem \- OEM commands for Dell servers .SH SYNOPSIS .B "ipmiutil delloem [-mx -NPRUEFJTVY] commands" .SH DESCRIPTION .I ipmiutil delloem commands is a program that uses Dell OEM IPMI commands to perform platform-specific functions. .SH OPTIONS .IP "-m 002000" Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH COMMANDS .RS .RE .TP \fImac\fP \fIlist\fP .RS Lists the MAC address of LOMs .RE .TP \fImac\fP \fIget\fP <\fBNIC number\fR> .RS Shows the MAC address of specified LOM. 0-7 System LOM, 8- DRAC/iDRAC. .RE .TP \fIlan\fP \fIset\fP <\fBMode\fR> .RS Sets the NIC Selection Mode (dedicated, shared, shared with failover lom2, shared with Failover all loms). .RE .TP \fIlan\fP \fIget\fP .RS Returns the current NIC Selection Mode (dedicated, shared, shared with failover lom2, shared with Failover all loms). .RE .TP \fIlan\fP \fIget\fP \fIactive\fP .RS Returns the current active NIC (dedicated, LOM1, LOM2, LOM3, LOM4). .RE .TP \fIpowermonitor\fP .RS Shows power tracking statistics .RE .TP \fIpowermonitor\fP \fIclear\fP \fIcumulativepower\fP .RS Reset cumulative power reading .RE .TP \fIpowermonitor\fP \fIclear\fP \fIpeakpower\fP .RS Reset peak power reading .RE .TP \fIpowermonitor\fP \fIpowerconsumption\fP .RS Displays power consumption in .RE .TP \fIpowermonitor\fP \fIpowerconsumptionhistory\fP <\fBwatt|btuphr\fR> .RS Displays power consumption history .RE .TP \fIpowermonitor\fP \fIgetpowerbudget\fP .RS Displays power cap in .RE .TP \fIpowermonitor\fP \fIsetpowerbudget\fP <\fBval\fR> <\fBwatt|btuphr|percent\fR> .RS Allows user to set the power cap in .RE .TP \fIpowermonitor\fP \fIenablepowercap\fP .RS To enable set power cap .RE .TP \fIpowermonitor\fP \fIdisablepowercap\fP .RS To disable set power cap .RE .TP \fIwindbg\fP \fIstart\fP .RS Starts the windbg session (Cold Reset & SOL Activation) .RE .TP \fIwindbg\fP \fIend\fP .RS Ends the windbg session (SOL Deactivation) .RE .TP \fIvFlash\fP \fIinfo\fP \fICard\fP .RS Shows Extended SD Card information .RE .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/itsol.80000644000076400007640000000335013160502144015056 0ustar acressloggers.TH ITSOL 8 "Version 1.0: 03 Feb 2012" .SH NAME ipmiutil_tsol \- Tyan IPMIv1.5 Serial-Over-LAN Console application .SH SYNOPSIS .B "ipmiutil tsol [recvip] [port=NUM] [ro|rw] [rows=NUM] [cols=NUM] [altterm] .SH DESCRIPTION This command allows Serial-over-LAN sessions to be established with Tyan IPMIv1.5 SMDC such as the M3289 or M3290. The default command run with no arguments will establish default SOL session back to local IP address. Optional arguments may be supplied in any order. .SH OPTIONS .IP "" Send receiver IP address to SMDC which it will use to send serial traffic to. By default this detects the local IP address and establishes two-way session. Format of ipaddr is XX.XX.XX.XX .IP "port" Configure UDP port to receive serial traffic on. By default this is 6230. .IP "ro|rw" Confiure SOL session as read-only or read-write. Sessions are read-write by default. .IP "rows" Set terminal rows [default: rows=24] .IP "cols" Set terminal columns [default: cols=80] .IP "altterm" Alternate terminal setup [default is off] .SH "EXAMPLES" ipmiutil tsol 192.168.1.1 .br Starts a Tyan SOL console session to the IP address. .PP .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2012 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/iuser.80000644000076400007640000000712113160502144015053 0ustar acressloggers.TH IUSER 8 "Version 1.0: 23 Feb 2017" .SH NAME ipmiutil_user \- handle user functions .SH SYNOPSIS .B "ipmiutil user [-cmsx -NUPREFTVY] .SH DESCRIPTION This .I ipmiutil user subcommand handles IPMI LAN user functions separately. These functions can also be handled from ipmiutil lan -q, -u, -p, -v. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-c" Canonical, delimited output format .IP "-m 002000" Target a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-s" When getting info, also get the DCMI sensor information. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH FUNCTIONS .IP "list [channel]" List the IPMI LAN users with enabled status, privilege level, and username. Optionally specify a channel number. .IP "enable [channel]" Enable the specified user number and optionally specify an IPMI LAN channel number. .IP "disable ]" Disable the specified user number, so that it has 'No access'. .IP "set name " Set the username for a specified user number. .IP "set password " Set the password for a specified user number. .IP "set priv [channel]" Set the privilege level for a specified user number, where the privilege level is 4=Admin, 3=Operator, 2=User. Also optionally specify a channel number. .IP "help" Show the help (usage) message .SH "EXAMPLES" ipmiutil user set 2 name user2 .br Sets the username for user 2 to "user2". .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2017 Andy Cress .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ihealth.80000644000076400007640000000654713160502144015355 0ustar acressloggers.TH IHEALTH 8 "Version 1.1: 17 Feb 2010" .SH NAME ipmiutil_health\- show IPMI health .SH SYNOPSIS .B "ipmiutil health [-ifhglmnopqsx -N node -U user -P/-R pswd -EFJTVY]" .SH DESCRIPTION .I ipmiutil health is a program that uses IPMI commands to show the health of the BMC. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-c" Show canonical, delimited output. .IP "-f" Show the FRUSDR version also. .IP "-g" Show the IPMI GUID of this system. The GUID is a read-only unique identifier. .IP "-h" Check the health of the HotSwap Controller also. .IP "-l" Show the IPMI LAN channel statistics also. .IP "-m 002000" Target a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-n string" Set the System Name to this string in the IPMI System Information. .IP "-o string" Set the Primary Operating System to this string in the IPMI System Information. .IP "-p 1" Set the chassis Power restore policy, governing the desired behavior when power was lost and is restored. Values: 0 = stay off, 1 = last state, 2 = always on. .IP "-q string" Set the Secondary Operating System to this string in the IPMI System Information. .IP "-s" Show the IPMI Session information also. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ilan.80000644000076400007640000003132213160502144014647 0ustar acressloggers.TH ILAN 8 "Version 1.8: 17 Feb 2010" .SH NAME ipmiutil_lan \- show and configure IPMI LAN parameters, users, and set up a PEF rule to send BMC LAN Alerts for OS Critical Stop log events .SH SYNOPSIS .B "ipmiutil lan [-abcdefghijklmnopq#rstuvwxyzBDQK -i eth1 ]" [\-I ipadr \-M macadr \-S subnet \-B baud_sol ] [\-G gwyip \-H gwymac \-L lan_channel_num ] [\-A alertip \-X alertmac \-C community ] [\-u user_to_set \-p password_to_set ] [\-N nodename \-U username \-Fimb ] [\-P/\-R rmt_node_pswd \-EFJTVY ] .SH DESCRIPTION .I ipmiutil lan shows or sets all of the IPMI LAN Parameters and users to enable remote LAN sessions or BMC LAN Alerts. The IP address and MAC address of the local system, the default gateway, and the alert destination can be defaulted to those specified in Linux, or can be overridden by specific parameters. It also creates a new Platform Event Filter table rule for an OS Critical Stop (0x20) SEL firmware log event, so that it will be enabled to send a BMC LAN Alert. This utility will skip the PEF records if the system does not support IPMI 1.5 or greater. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. Note that without options, ipmiutil lan behaves as if option \-r were used. To configure IPMI LAN & PEF, use option \-e. .IP "-a alertnum" Specify which PEF alert number is to be used. Default is 1. This would only be used if extra PEF alert destinations had been set. .IP "-b authmask" Specify a certain authtype mask in hex to use when configuring this channel. The default mask is 0x16, so to include authtype None (bit 0), it would require entering '\-b 17'. .IP "-c" Show Canonical output, which shows only interpreted text and streamlines the parameters shown, using a common delimiter. .IP "-d" This option disables the IPMI LAN and PEF parameters, so as not to allow BMC LAN connections or alerts. This option also sets the IP address to zeros. .IP "-e" This option enables the BMC LAN configuration and PEF event alerts. The utility will attempt to obtain the default BMC LAN parameters from the OS automatically, or they can be specified with command options below. .IP "-f" Set the ARP control parameter to 1 = gratuituous ARPs, 2 = ARP responses, or 3 = both grat ARP and ARP responses. The default is 1. .IP "-g" This specifies the secondary gateway IP address to use for the BMC LAN. The default is to omit this parameter and only use the default gateway. See also \-G. .IP "-h" Set the IPMI VLAN ID to this value. Setting to a value >=4096 disables the VLAN ID. The default behavior is not to set this parameter. .IP "-i ethif" By default, the eth0 interface is used to find IP and MAC addresses. Sometimes, however, the first ethernet port on the baseboard may be represented by Linux as eth1 or eth2 instead. If so, use this option to indicate the correct ethernet interface to use. By default, ipmiutil lan will scan up to 32 eth interfaces for the onboard one that BMC LAN uses. .IP "-j" This sets a custom PEF rule as the last PEF entry. The input is a series of 10 hex bytes, forming the PEF entry. For example, this sample PEF entry would perform a power down action if the Baseboard Temp reached its threshold. "ipmiutil lan \-e \-j020110ffff013001950a" .IP "-k" This causes ipmiutil lan to also insert two rules to send alerts for transition-to-OK events, including Power Redundancy OK and Temperature OK. .IP "-l" This option enables the BMC LAN configuration, but not PEF events. The utility will attempt to obtain the default BMC LAN parameters from the OS automatically, or they can be specified with command options below. .IP "-n num" By default, the new PEF entry for OS Critical Stop is inserted at offset 12 into the table. This can be changed to insert it at an offset > 12 if another entry already exists at offset 12. .IP "-o" Disable Only SOL. This could be used after the IPMI LAN was configured, to disable Serial-Over-LAN console access but still allow other IPMI LAN access. .IP "-p password_to_set" This specifies the firmware password to set for BMC LAN access. If not specified, the user and password configuration will not be changed. .IP "-q" Specify an alternate user number for the LAN username from the \-u option. This is normally user number 2, 3, or 4, where 2 is the default. The maximum number of users is 15. Same as -# below. .IP "-#" Specify an alternate user number for the LAN username from the \-u option. Same as \-q above. .IP "-r" This option just reads the configuration without writing any BMC LAN parameters or writing any new entries to the PEF table. .IP "-s" This option will also display some of the Serial parameters. .IP "-t" Test if the BMC LAN has already been configured. Returns 0 if so. .IP "-u username_to_set" This specifies the firmware username to set for BMC LAN access. If a username is specified, user 3 will be set. If not specified, the default user 1 will be used. .IP "-v priv" Set a specific access priVilege for this user, where priv can be: 1=Callback, 2=User, 3=Operator, 4=Admin, 5=OEM, 15=NoAccess The default if not specified or specified in error, is to use 4=Admin. .IP "-w N" Set the Gratuitous ARP Interval to N seconds. This has no effect if the firmware does not support Grat-ARP, as shown in Lan Param 10. If not set, the interval remains at the firmware default. .IP "-x" Causes extra debug messages to be displayed. .IP "-y N" Set the OEM LAN Failover parameter to N. Values for N with Intel Romley/S2600 baseboards: 1 = enable, 0 = disable. Values for N with SuperMicro baseboards: 2 = failover, 1 = lan1 , 0 = dedicated. .IP "-z" Also show the IPMI LAN Statistics .IP "-A alert_ip_addr" This specifies the SNMP Alert Destination IP address to use for the BMC LAN. By default, this utility will attempt to obtain this from the /etc/snmp/snmpd.conf file, via the trapsink parameter. The alert destination will see the BMC LAN traps with the enterprises.3183.1.1 OID. If no alert IP address is specified in either snmpd.conf or this parameter, or if that IP address does not respond, the other SNMP parameters for BMC LAN will be skipped. .IP "-B baud_sol" This specifies the Baud rate for SerialOverLan. The possible values are: 9600, 19.2k, 38.4k, 57.6k, and 115.2k. The default is 19.2k. .IP "-C snmp_community" This specifies the SNMP Community name to use for BMC LAN Alerts. The default community string is "public". This parameter is ignored if there is no Alert IP address. .IP "-D " This causes the local IP address to be determined by DHCP instead of a static IP address. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-G gwy_ip_addr" This specifies the default gateway IP address to use for the BMC LAN. The default is to automatically obtain this from the Linux route table. .IP "-H gwy_mac_addr" This specifies the default gateway MAC address to use for the BMC LAN. The format can be either 11:22:33:44:55:66 or 11-22-33-44-55-66. The default is to try to automatically obtain this by sending an arp request from an OS LAN eth interface: the default one, or as specified by \-i. .IP "-K hostname" This specifies the IPMI hostname to set, for Kontron servers only. This enables the firmware to properly map the IP address to a hostname, especially with the web interface. The default is not to set this parameter, and use IP address only. .IP "-I ip_addr" This specifies the local IP address to use for the BMC LAN on eth0. The default is to automatically obtain this from the Linux ifconfig. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-L lan_ch_num" This specifies the IPMI LAN channel number used for BMC LAN. This varies by platform, and can be found in the platform technical specifications. For instance, Intel platforms usually use channels 1 & 2 for onboard NICs, and channel 3 for optional RMM NICs. By default, ipmiutil lan scans all IPMI channels to find the first LAN channel for BMC LAN. To just list all IPMI channels to see what is available, use the string 'list' instead of a LAN channel number. This will list the channels and exit. .IP "-M mac_addr" This specifies the local MAC address to use for the BMC LAN on eth0. The format can be either 11:22:33:44:55:66 or 11-22-33-44-55-66. The default is to automatically obtain this from the Linux ifconfig. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-O" Observe security. Disables the default null user and disable cipher 0. .IP "-P rmt_pswd" Remote password for the nodename given. The default is a null password. Same as \-R below. .IP "-Q" Set the IPMI VLAN Priority. The default priority is 0. .IP "-R rmt_pswd" Remote password for the nodename given. The default is a null password. Same as \-P above. .IP "-S subnet" This specifies the local subnet mask to use for the BMC LAN on eth0. The default is to automatically obtain this from the Linux ifconfig. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-X alert_mac_addr" This specifies the SNMP Alert Destinations's MAC address to use for the BMC LAN. The format can be either 11:22:33:44:55:66 or 11-22-33-44-55-66. The default is to attempt to obtain this from the Linux arp cache. This parameter is ignored if there is no Alert IP address. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH EXAMPLES To read existing settings: .br ipmiutil lan \-r .PP To enable IPMI LAN with default settings detected, assuming shared MAC/IP: .br ipmiutil lan \-e .PP To set up IPMI LAN for a unique IP address and set PEF SNMP Alerts: .br ipmiutil lan \-e \-I 192.168.1.1 \-A 192.168.1.10 .PP To set the IPMI LAN password for the default user: .br ipmiutil lan \-e \-p mypassword .PP To disable access to the IPMI LAN channel: .br ipmiutil lan \-d .SH "SAMPLE PEF TABLE" These 11 PEF table entries are configured from the factory for various Intel Sahalee BMC systems, and will be applied as the defaults for a system with an empty PEF table: .br PEF(01): 01 Temperature Sensor event - enabled for alert .br 01 c0 01 01 00 ff ff 01 ff 01 95 0a 00 00 00 00 00 00 00 00 00 .br PEF(02): 02 Voltage Sensor event - enabled for alert .br 02 c0 01 01 00 ff ff 02 ff 01 95 0a 00 00 00 00 00 00 00 00 00 .br PEF(03): 04 Fan Failure event - enabled for alert .br 03 c0 01 01 00 ff ff 04 ff 01 95 0a 00 00 00 00 00 00 00 00 00 .br PEF(04): 05 Chassis Intrusion event - enabled for alert .br 04 c0 01 01 00 ff ff 05 05 6f 01 00 00 00 00 00 00 00 00 00 00 .br PEF(05): 08 Power Supply Fault event - enabled for alert .br 05 c0 01 01 00 ff ff 08 ff 6f 06 00 00 00 00 00 00 00 00 00 00 .br PEF(06): 0c Memory ECC Error event - enabled for alert .br 06 c0 01 01 00 ff ff 0c 08 6f 02 00 00 00 00 00 00 00 00 00 00 .br PEF(07): 0f FRB Failure event - enabled for alert .br 07 c0 01 01 00 ff ff 0f 06 6f 01 00 00 00 00 00 00 00 00 00 00 .br PEF(08): 07 BIOS POST Error event - enabled for alert .br 08 c0 01 01 00 ff ff 07 ff 6f 1c 00 00 00 00 00 00 00 00 00 00 .br PEF(09): 13 Fatal NMI event - enabled for alert .br 09 c0 01 01 00 ff ff 13 ff 6f 3e 03 00 00 00 00 00 00 00 00 00 .br PEF(10): 23 Watchdog Timer Reset event - enabled for alert .br 0a c0 01 01 00 ff ff 23 03 6f 0e 00 00 00 00 00 00 00 00 00 00 .br PEF(11): 12 System Restart event - enabled for alert .br 0b c0 01 01 00 ff ff 12 ff 6f 02 00 00 00 00 00 00 00 00 00 00 .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/idcmi.80000644000076400007640000000735713160502144015024 0ustar acressloggers.TH IDCMI 8 "Version 1.0: 02 Feb 2012" .SH NAME ipmiutil_dcmi \- handle DCMI functions .SH SYNOPSIS .B "ipmiutil dcmi [-admsx -NUPREFTVY] .SH DESCRIPTION This .I ipmiutil dcmi subcommand handles DCMI command functions according to the DCMI specification. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-a string" Set the DCMI Asset Tag to this string. .IP "-d string" Set the DCMI MC ID to this string. .IP "-m 002000" Target a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-s" When getting info, also get the DCMI sensor information. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH FUNCTIONS .IP "info" Get DCMI Capabilities, MC ID, and Asset Tag. This is the default function if no function was specified. .IP "power " Get DCMI Power reading and DCMI Power limit, if supported in the DCMI capabilties. .IP "power set_limit" Set Power limit .IP "power set_action " Set Power limit exception action (where action = no_action | power_off | log_sel) .IP "power set_correction" Set Power limit correction time (in ms) .IP "power set_sample" Set Power limit sampling period (in sec) .IP "power activate" Activate Power limit .IP "power deactivate" Deactivate Power limit .IP "thermal" Get/Set DCMI Thermal parameters. This requires DCMI 1.5 support. .IP "config" Get/Set DCMI Configuration parameters. This requires DCMI 1.5 support. .IP "help" Show the help (usage) message .SH "EXAMPLES" ipmiutil dcmi info \-s .br Gets DCMI information, plus DCMI sensor information .PP ipmiutil dcmi \-N 192.168.1.1 \-U root \-P pswd .br Gets DCMI information over IPMI LAN. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2010 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/Makefile.am0000644000076400007640000000335413160502144015673 0ustar acressloggers#!/bin/sh # Makefile to build/install doc files # MKDIR = sh ../mkinstalldirs INSTALL_SH = sh ../install-sh -c INSTALL_DATA_SH = ${INSTALL_SH} -m 644 prefix = /usr datadir = ${prefix}/share mandir = ${prefix}/share/man docdir = ${prefix}/share/doc/ipmiutil-${version} etcdir = /etc datato = ${DESTDIR}${datadir}/ipmiutil cronto = ${DESTDIR}${etcdir}/cron.daily manto = ${DESTDIR}${mandir}/man8 varto = ${DESTDIR}/var/lib/ipmiutil all: clean: clobber: distclean: check: install: $(MKDIR) ${manto} $(MKDIR) ${datato} $(MKDIR) ${varto} ${INSTALL_DATA_SH} isel.8 ${manto} ${INSTALL_DATA_SH} isensor.8 ${manto} ${INSTALL_DATA_SH} ireset.8 ${manto} ${INSTALL_DATA_SH} ialarms.8 ${manto} ${INSTALL_DATA_SH} iwdt.8 ${manto} ${INSTALL_DATA_SH} ifru.8 ${manto} ${INSTALL_DATA_SH} ilan.8 ${manto} ${INSTALL_DATA_SH} iserial.8 ${manto} ${INSTALL_DATA_SH} icmd.8 ${manto} ${INSTALL_DATA_SH} igetevent.8 ${manto} ${INSTALL_DATA_SH} ihealth.8 ${manto} ${INSTALL_DATA_SH} ipmiutil.8 ${manto} ${INSTALL_DATA_SH} isol.8 ${manto} ${INSTALL_DATA_SH} idiscover.8 ${manto} ${INSTALL_DATA_SH} ievents.8 ${manto} ${INSTALL_DATA_SH} iconfig.8 ${manto} ${INSTALL_DATA_SH} ipmi_port.8 ${manto} ${INSTALL_DATA_SH} ipicmg.8 ${manto} ${INSTALL_DATA_SH} ifirewall.8 ${manto} ${INSTALL_DATA_SH} ifwum.8 ${manto} ${INSTALL_DATA_SH} ihpm.8 ${manto} ${INSTALL_DATA_SH} isunoem.8 ${manto} ${INSTALL_DATA_SH} itsol.8 ${manto} ${INSTALL_DATA_SH} iekanalyzer.8 ${manto} ${INSTALL_DATA_SH} idelloem.8 ${manto} ${INSTALL_DATA_SH} idcmi.8 ${manto} ${INSTALL_DATA_SH} ismcoem.8 ${manto} ${INSTALL_DATA_SH} iuser.8 ${manto} ${INSTALL_DATA_SH} bmclanpet.mib ${datato} cd ${manto}; gzip -f *.8 ipmiutil-3.0.7/doc/isensor.80000644000076400007640000002311413160502144015406 0ustar acressloggers.TH ISENSOR 8 "Version 1.6: 09 Nov 2011" .SH NAME ipmiutil_sensor \- show Sensor Data Records .SH SYNOPSIS .B "ipmiutil sensor [-abcdefgjkmpqrstuvwxL -i id -n snum -h tval -l tval -NUPREFJTVY]" .SH DESCRIPTION .I ipmiutil sensor is a program that uses IPMI commands to show and decode Sensor Data Records and current sensor readings for all sensors in the system. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. Note that this utility by default only displays Sensor Data Records reported by from the Baseboard Management Controller. To show sensors for other controllers, see options \-b and \-m below. .SH OPTIONS Command line options are described below. .IP "-a snum" ReArms the sensor number for events .IP "-b" Shows SDRs for Bladed (PICMG or ATCA) systems by traversing the child MCs (same as \-e). .IP "-c" Show sensor list in a simpler/Canonical format without uninterpreted binary values. Only the user-friendly interpreted sensor information is shown. (same as \-s). .IP "-d " Dump the SDRs to a specified binary file. This file can be used with -j to jumpstart getting the sensor readings. .IP "-e" Show Every SDR in a bladed system by traversing the child MCs (same as \-b). .IP "-f " Restore the SDRs from the specified binary File. This is normally only done with the initial factory provisioning. .IP "-g sens_type" Shows only those SDRs matching the given sensor type group. The sens_type string can be "fan", "temp", "voltage", or any string or substring matching those in the IPMI 2.0 Table 42-3 for Sensor Types. Multiple types can be listed, separated by a comma (,) but no spaces. .IP "-h tval" Highest threshold value to set for the specified sensor. This tval can be in decimal, or of the form 0x1a, to match the raw reading value shown by sensor following the " = ". The value passed is set as the non-critical threshold value, with the more critical ones set by the utility as incrementally lower. This simplifies the interface and ensures that the threshold values do not get out of order. This requires specifying the sensor number via \-n. .IP "-i ID" Show or set only the sensor Index corresponding to ID, where ID is the hex ID of the SDR as shown in the sensor output under "_ID_". The ID argument can be one hex number (e.g. 0x0e or 0e), or a range of hex numbers (e.g. 0e-1a or 1a,2a or 0x0e-0x2a). This is useful to repeatedly view just a few sensor readings for changes, or to set just one sensor quickly without reading all of the SDRs. .IP "-j file" Jump-start by caching the SDRs from a file. This uses an SDR binary file to read the SDRs, so that only the sensor readings need to be read from the firmware. This avoids getting the SDR reservation and reading each SDR, so it makes getting the sensor readings more efficient. The SDR binary file can be created using the \-d option to dump the SDRs to a file, or -j will try to create the file if not there. .IP "-k K" When looping with \-L, wait K seconds between loops. Default is 1 second. .IP "-l tval" Lowest threshold value to set for the specified sensor. This tval can be in decimal, or of the form 0x1a, to match the raw reading value shown by sensor following the " = ". The value passed is set as the non-critical threshold value, with the more critical ones set by the utility as incrementally higher. This simplifies the interface and ensures that the threshold values do not get out of order. This requires specifying the sensor number via \-n. .IP "-m 002000s" Show SDRs for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-n snum" Number of the sensor to set. This num can be in decimal, or of the form 0x1a, to match the value shown by sensor following the "snum" tag. This is required if setting hi/lo thresholds via \-h/\-l. .IP "-o" Output the memory DIMM information from SMBIOS, including size. Not available if using IPMI LAN via \-N. Sample output: .br Memory Device (0,0): DIMM_A1 : size=2048MB .br Memory Device (0,1): DIMM_A2 : not present .IP "-p" Persist the threshold being set (as specified via \-l or \-h). This writes a "sensor \-i" script line to the file /usr/share/ipmiutil/thresholds.sh, which can then be executed at each reboot by starting the /etc/init.d/ipmi_port service for the desired runlevels. For Windows, the filename is thresholds.cmd. .IP "-q" Show threshold values in d:d:d format. Thresholds are shown for each sensor in short format with ':' delimiters, which is useful as an example for setting thresholds with '\-u'. .IP "-r" Show Raw SDR bytes also. .IP "-s" Show sensor list in a simpler/canonical format without uninterpreted binary values. Only the user-friendly interpreted sensor information is shown. (same as \-c). .IP "-t" Show any Thresholds for each sensor also, in text format. .IP "-u" Set unique threshold values. The values are specified in a string of threshold values. It can be in raw hex characters or in float values. All 6 possible thresholds must be specified, but only the ones that are valid for this sensor will be applied. These values are validated for ordering. For example: \-u 6:5:4:60:65:69 (float) or \-u 0x0605043c4145 (raw hex) would mean 0x06=noncrit_lo, 0x05=crit_lo, 0x04=nonrec_lo, 0x3c=noncrit_hi, 0x41=crit_hi, 0x45=nonrec_hi. .IP "-v" Show Verbose output, including volatile thresholds, SDR thresholds, max/min, hysteresis, and BMC_TAM decoding. .IP "-w" Wrap the threshold data onto the same line as the sensor. This may be convenient for scripting. .IP "-x" Causes eXtra debug messages to be displayed. .IP "-L n" Loop n times every K seconds. Default is one loop and K defaults to 1 second. See option \-k to change K seconds if desired. This is useful along with \-i or \-g to read some sensors as they change. Using \-j with this option makes run it quicker. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "EXAMPLES" ipmiutil sensor sample output is below. .br ipmiutil ver 2.21 .br sensor: version 2.21 .br -- BMC version 0.17, IPMI version 2.0 .br _ID_ SDR_Type_xx ET Own Typ S_Num Sens_Description Hex & Interp Reading .br 000b SDR Full 01 01 20 a 01 snum 30 Baseboard Temp = 2e OK 46.00 degrees C .br 000e SDR Full 01 01 20 m 04 snum 50 Fan 1A = 6f OK 7659.00 RPM .br 0042 SDR Comp 02 6f 20 a 21 snum e0 DIMM 1A = 00 c0 04 00 Present .br 004e SDR FRU 11 1b dev: 20 03 80 00 0a 01 Pwr Supply 1 FRU .br 0050 SDR IPMB 12 1b dev: 20 00 bf 07 01 Basbrd Mgmt Ctlr .br 0051 SDR OEM c0 09 Intel: 02 02 00 01 70 71 .br 0065 SDR OEM c0 11 Intel: SDR Package 17 .br [...] .PP Output Columns: .br _ID_: This is an SDR ID or index number, in hex. This may vary from chassis to chassis. .br SDR_Type_xx: This shows the SDR Type and its hex representation. Some SDR types have a custom display. The OEM SDRs only show the OEM vendor by IANA number and then usually the data is listed in hex. .br ET: For Full or Comp SDRs, this shows the Event Type. For other SDRs, this shows the size of the SDR entry in hex (Sz). .br Own: This is the hex slave address of the SDR Owner, usually 20 if BMC. .br a/m: This indicates whether this sensor is either automatically or manually rearmed, respectively. .br Typ: This is the Sensor Type as defined in Table 42-3 of the IPMI 2.0 spec. (01 = Temperature, 02 = Voltage, 03 = Current, 04 = Fan, etc.) .br S_Num: This is the sensor number in hex. This remains consistent across baseboards of the same type. The output can be parsed with the "snum" delimiter to extract this value. .br Sens_Description: This is the text description of this SDR, which is stored within the SDR on the BMC. .br Hex & Interp Reading: This is the raw hex value returned by GetSensorReading, and its interpreted meaning. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/bmclanaol.mib0000644000076400007640000001366313160502144016264 0ustar acressloggers--************************************************************************\ --* * --* Copyright (c) 1998-2004 Intel Corporation. All Rights Reserved. * --* * --* Redistribution and use in source and binary forms, with or without * --* modification, are permitted provided that the following conditions * --* are met: * --* * --* a.. Redistributions of source code must retain the above copyright * --* notice, this list of conditions and the following disclaimer. * --* b.. Redistributions in binary form must reproduce the above * --* copyright notice, this list of conditions and the following * --* disclaimer in the documentation and/or other materials provided * --* with the distribution. * --* c.. Neither the name of Intel Corporation nor the names of its * --* contributors may be used to endorse or promote products derived * --* from this software without specific prior written permission. * --* * --* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * --* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * --* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * --* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * --* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * --* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * --* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * --* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * --* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * --* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * --* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * --* DAMAGE. * --* * --\***********************************************************************/ --/************************************************************************** --* --* NAME: --* aolnprxy.mib --* --* DESCRIPTION: --* Alert on LAN MIB --* --* --* $WorkFile: $ --* $Revision: 6 $ --* $ModTime: $ --* $Author: Psaranga $ --* --*************************************************************************** PET-MIB DEFINITIONS ::= BEGIN -- Title : Alert on LAN pET MIB version 1.0. IMPORTS MODULE-IDENTITY, OBJECT-TYPE, Integer32, IpAddress FROM SNMPv2-SMI enterprises FROM RFC1155-SMI DisplayString FROM RFC1213-MIB TRAP-TYPE FROM RFC-1215 ; wired_for_management OBJECT IDENTIFIER ::= { enterprises 3183 } pET OBJECT IDENTIFIER ::= { wired_for_management 1 } pET_version_1 OBJECT IDENTIFIER ::= { pET 1 } -- MODULE IDENTIFICATION -- -- Alert_on_LAN MODULE-IDENTITY -- LAST-UPDATED "9807210000Z" -- ORGANIZATION "Intel Corporation" -- CONTACT-INFO -- " Alert On LAN* Software -- Intel Corporation, JF3-4 -- Hillsboro, OR. " -- DESCRIPTION -- " This is the pET MIB. Version 1.0 " -- We should be able to plug this branch into any tree from this point forward -- **************************************** -- SYSTEM INFORMATION BRANCH STARTS HERE. -- **************************************** pETTrap OBJECT-TYPE SYNTAX OCTET STRING ( SIZE(110) ) ACCESS read-only STATUS current DESCRIPTION "Trap information" ::= { pET_version_1 1 } pET_PresenceHeartbeat TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Presence Heartbeat Expired" ::= 2584320 pET_CoverTamper TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Cover Tamper" ::= 356096 pET_Voltage_Fan_Temperature TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Voltage/Fan/Temperature Out of Specification" ::= 552706 pET_LANLeash TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "LAN Leash Tamper" ::= 356100 pET_Temperature TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Temperature Out of Specification" ::= 93952 pET_ProcessorMissing TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Processor Missing" ::= 356099 pET_ProcessorTemperature TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Processor Over Temperature" ::= 487169 pET_Watchdog TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Watchdog Event" ::= 1142534 pET_P_O_S_T TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "P.O.S.T." ::= 1011456 pET_Voltage TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Voltage Out of Specification" ::= 159488 pET_Fan TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Fan Out of Specification" ::= 290560 pET_Fan_Temperature TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Fan/Temperature Out of Specification" ::= 683778 pET_Undock TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Surprised Undock event" ::= 356101 pET_EventClear TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Event clear" ::= 1076994 pET_AlertOnLAN_2 TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Alert on LAN 2 Event has occurred" ::= 2277391 pET_AlertOnLAN_Boot TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "System Boot Event occurred" ::= 1208065 pET_AlertOnLAN_Fan TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Fan Event occurred" ::= 262400 pET_AlertOnLAN_Fan2 TRAP-TYPE ENTERPRISE pET_version_1 DESCRIPTION "Fan Event occurred" ::= 262402 END ipmiutil-3.0.7/doc/Makefile.in0000644000000000000000000002640713160502154014673 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS_CFLAGS = @CROSS_CFLAGS@ CROSS_LFLAGS = @CROSS_LFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPL_CFLAGS = @GPL_CFLAGS@ GREP = @GREP@ IA64_CFLAGS = @IA64_CFLAGS@ INIT_DIR = @INIT_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INS_LIB = @INS_LIB@ LANDESK_CFLAGS = @LANDESK_CFLAGS@ LANDESK_LDADD = @LANDESK_LDADD@ LANPLUS_CFLAGS = @LANPLUS_CFLAGS@ LANPLUS_CRYPTO = @LANPLUS_CRYPTO@ LANPLUS_LDADD = @LANPLUS_LDADD@ LANPLUS_LIB = @LANPLUS_LIB@ LANPLUS_SAM = @LANPLUS_SAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_SAMX = @LD_SAMX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSENSORS = @LIBSENSORS@ LIBTOOL = @LIBTOOL@ LIB_DIR = @LIB_DIR@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS_CFLAGS = @OS_CFLAGS@ OS_DRIVERS = @OS_DRIVERS@ OS_LFLAGS = @OS_LFLAGS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_DIR = @PKG_DIR@ RANLIB = @RANLIB@ SAM2OBJ = @SAM2OBJ@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHR_LINK = @SHR_LINK@ STRIP = @STRIP@ SUBDIR_S = @SUBDIR_S@ SYSTEMD_DIR = @SYSTEMD_DIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = ${prefix}/share datarootdir = @datarootdir@ docdir = ${prefix}/share/doc/ipmiutil-${version} dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = ${prefix}/share/man mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = /usr program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #!/bin/sh # Makefile to build/install doc files # MKDIR = sh ../mkinstalldirs INSTALL_SH = sh ../install-sh -c INSTALL_DATA_SH = ${INSTALL_SH} -m 644 etcdir = /etc datato = ${DESTDIR}${datadir}/ipmiutil cronto = ${DESTDIR}${etcdir}/cron.daily manto = ${DESTDIR}${mandir}/man8 varto = ${DESTDIR}/var/lib/ipmiutil all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am all: clean: clobber: distclean: check: install: $(MKDIR) ${manto} $(MKDIR) ${datato} $(MKDIR) ${varto} ${INSTALL_DATA_SH} isel.8 ${manto} ${INSTALL_DATA_SH} isensor.8 ${manto} ${INSTALL_DATA_SH} ireset.8 ${manto} ${INSTALL_DATA_SH} ialarms.8 ${manto} ${INSTALL_DATA_SH} iwdt.8 ${manto} ${INSTALL_DATA_SH} ifru.8 ${manto} ${INSTALL_DATA_SH} ilan.8 ${manto} ${INSTALL_DATA_SH} iserial.8 ${manto} ${INSTALL_DATA_SH} icmd.8 ${manto} ${INSTALL_DATA_SH} igetevent.8 ${manto} ${INSTALL_DATA_SH} ihealth.8 ${manto} ${INSTALL_DATA_SH} ipmiutil.8 ${manto} ${INSTALL_DATA_SH} isol.8 ${manto} ${INSTALL_DATA_SH} idiscover.8 ${manto} ${INSTALL_DATA_SH} ievents.8 ${manto} ${INSTALL_DATA_SH} iconfig.8 ${manto} ${INSTALL_DATA_SH} ipmi_port.8 ${manto} ${INSTALL_DATA_SH} ipicmg.8 ${manto} ${INSTALL_DATA_SH} ifirewall.8 ${manto} ${INSTALL_DATA_SH} ifwum.8 ${manto} ${INSTALL_DATA_SH} ihpm.8 ${manto} ${INSTALL_DATA_SH} isunoem.8 ${manto} ${INSTALL_DATA_SH} itsol.8 ${manto} ${INSTALL_DATA_SH} iekanalyzer.8 ${manto} ${INSTALL_DATA_SH} idelloem.8 ${manto} ${INSTALL_DATA_SH} idcmi.8 ${manto} ${INSTALL_DATA_SH} ismcoem.8 ${manto} ${INSTALL_DATA_SH} iuser.8 ${manto} ${INSTALL_DATA_SH} bmclanpet.mib ${datato} cd ${manto}; gzip -f *.8 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ipmiutil-3.0.7/doc/ifwum.80000644000076400007640000000707413160502144015062 0ustar acressloggers.TH IFWUM 8 "Version 1.0: 24 Aug 2010" .SH NAME ipmiutil_fwum \- Update IPMC using Kontron OEM Firmware Update Manager .SH SYNOPSIS .B "ipmiutil fwum [-mixNUPREFJTVY] parameters" .SH DESCRIPTION This .I ipmiutil fwum subcommand updates IPMC firmware using Kontron OEM Firmware Update Manager. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-i 00" This option specifies a specific FRU ID to show. The input value should be in hex (0b, 1a, etc.), as shown from the sensor SDR output. The default FRU ID is zero (0). .IP "-m 002000" Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH PARAMETERS \fIfwum\fP \fBparameters\fR .RS .TP \fIinfo\fP .br Show information about current firmware. .TP \fIstatus\fP .br Show status of each firmware bank present in the hardware. .TP \fIdownload\fP \fBfilename\fR .br Download the specified firmware image. .TP \fIupgrade\fP [\fBfilename\fR] .br Install firmware upgrade. If the filename is specified, the file is downloaded first, otherwise the last firmware downloaded is used. .TP \fIrollback\fP .br Ask IPMC to rollback to previous version. .TP \fItracelog\fP .br Show the firmware upgrade log. .SH "EXAMPLES" ipmiutil fwum info .br Gets Firmware information .PP ipmiutil fwum \-N 192.168.1.1 \-U root \-P pswd download firmware.img .br Downloads the firmware version contained in firmware.img over IPMI LAN. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2010 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ipmiutil.80000644000076400007640000001050213160502144015555 0ustar acressloggers.TH IPMIUTIL 8 "Version 1.1: 10 May 2012" .SH NAME ipmiutil \- a meta-command to invoke various IPMI functions. .SH SYNOPSIS .B "ipmiutil [-x -NUPREFJTVY] [other command options] .SH DESCRIPTION This utility performs various IPMI functions. Each of the individual commands in the ipmiutil project can be invoked via this meta-command. The is one of the following: alarms show/set the front panel alarm LEDs and relays leds show/set the front panel alarm LEDs and relays cmd send a specified raw IPMI command to the BMC config list/save/restore BMC configuration parameters dcmi get/set DCMI parameters discover discover all IPMI servers on this LAN ekanalyzer run FRU-EKeying analyzer on FRU files (deprecated, see fru) events decode IPMI events and display them firewall show/set firmware firewall functions fru show decoded FRU inventory data, write asset tag fwum OEM firmware update manager extensions getevt get IPMI events and display them, event daemon getevent get IPMI events and display them, event daemon health check and show the basic health of the IPMI BMC hpm HPM firmware update manager extensions lan show/set IPMI LAN parameters and PEF table picmg show/set picmg extended functions reset cause the BMC to reset or power down the system sel show/clear firmware System Event Log records sensor show Sensor Data Records, readings, thresholds serial show/set IPMI Serial & Terminal Mode parameters sol start/stop an SOL console session smcoem SuperMicro OEM functions sunoem Sun OEM functions delloem Dell OEM functions tsol Tyan SOL console start/stop session wdt show/set/reset the watchdog timer .br For help on each command (e.g. 'sel'), enter: ipmiutil sel -? .br For man pages on each command, its man page is named "i", or refer to SEE ALSO below. .br This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N is used. .SH OPTIONS Command options are described in the man page for each command. Below are a few of the common options. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "EXAMPLES" ipmiutil sel .br Shows the IPMI System Event Log entries. .PP ipmiutil wdt .br Shows the watchdog timer values. .PP .SH "SEE ALSO" ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifirewall(8) ifru(8) ifruset(8) ifwum(8) igetevent(8) ihealth(8) ihpm(8) ilan(8) ipicmg(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) isunoem(8) iwdt(8) ipmiutil(8) ipmi_port(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ireset.80000644000076400007640000001040613160502144015217 0ustar acressloggers.TH IRESET 8 "Version 1.5: 01 Jul 2011" .SH NAME ipmiutil_reset \- perform a hardware reset on the system .SH SYNOPSIS .B "ipmiutil reset [-bcdDefhijmnoprsuwxy -N node -U user -P/-R pswd -EFJTVY]" .SH DESCRIPTION .I ipmiutil reset is a program that uses IPMI commands to perform a hardware reset of the chassis, or boot to a specific device. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-c" Power Cycle the system chassis .IP "-d" Power Down the system chassis .IP "-n" Send NMI to the system .IP "-u" Power Up the system chassis .IP "-r" Hard Reset the system chassis .IP "-D" Do a soft shutdown of the OS, and then power down. Note that remote soft shutdown (\-D \-N) for Intel S5000 baseboard requires ipmiutil getevt \-a running on the target server. .IP "-o" Do a soft shutdown of the OS, and then reset. Note that remote soft shutdown (\-o \-N) for Intel S5000 baseboard requires ipmiutil getevt \-a running on the target server. .IP "-k" Do a cold reset to restart the BMC firmware. .IP "-m 002000s" Perform these function for a specific MC (e.g. bus 00, sa 20, lun 00). The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-b" Do a hard reset and reboot to the BIOS Setup menu, for this reboot only. .IP "-e" Do a hard reset to EFI, if IPMI EFI boot is enabled, for this reboot only. .IP "-f" Do a hard reset to Floppy/Removable, for this reboot only. .IP "-h" Do a hard reset to a Hard Disk, for this reboot only. .IP "-i" Set the boot Initiator mailbox string, usually for PXE use. The string must be less than 78 characters. .IP "-j" Set the IANA number used for the boot Initiator mailbox string. .IP "-p" Do a hard reset and network boot to PXE server, for this reboot only. .IP "-s" Do a hard reset and reboot to the Service/Diagnostic Partition, for this reboot only. Reboots to the default if no service partition is configured. .IP "-v" Do a hard reset to DVD/CDROM Media, for this reboot only. .IP "-w" Wait for BMC ready after a reset before exiting the utility. .IP "-x" Causes extra debug messages to be displayed. .IP "-y" Yes, try to persist any boot options used [\-befhprsv]. This requires the IPMI firmware to ask the BIOS to change boot order settings, so it may not be supported by all BMC firmware vendors. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/Makefile0000644000000000000000000002702613160502163014264 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # doc/Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. pkgdatadir = $(datadir)/ipmiutil pkgincludedir = $(includedir)/ipmiutil pkglibdir = $(libdir)/ipmiutil pkglibexecdir = $(libexecdir)/ipmiutil am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = x86_64-redhat-linux-gnu host_triplet = x86_64-redhat-linux-gnu subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run aclocal-1.11 AMTAR = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run tar AR = ar AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run autoconf AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run autoheader AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = gcc -E CPPFLAGS = CROSS_CFLAGS = CROSS_LFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps DSYMUTIL = DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E EXEEXT = FGREP = /bin/grep -F GPL_CFLAGS = GREP = /bin/grep IA64_CFLAGS = INIT_DIR = /etc//rc.d/init.d INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s INS_LIB = LANDESK_CFLAGS = LANDESK_LDADD = LANPLUS_CFLAGS = -DHAVE_LANPLUS LANPLUS_CRYPTO = -lcrypto LANPLUS_LDADD = -L../lib -lipmi_lanplus -L/usr/local/lib -lcrypto LANPLUS_LIB = ../lib/libipmi_lanplus.a LANPLUS_SAM = yes LD = /usr/bin/ld -m elf_x86_64 LDFLAGS = LD_SAMX = ../lib/libipmi_lanplus.a -lcrypto LIBOBJS = LIBS = LIBSENSORS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LIB_DIR = /usr/lib64 LIPO = LN_S = ln -s LTLIBOBJS = MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run makeinfo MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = OBJDUMP = objdump OBJEXT = o OS_CFLAGS = -DLINUX -fPIC -Wno-pointer-sign -Wno-sign-conversion -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 OS_DRIVERS = imbapi.c ipmimv.c ipmild.c ipmidir.c OS_LFLAGS = OTOOL = OTOOL64 = PACKAGE = ipmiutil PACKAGE_BUGREPORT = PACKAGE_NAME = ipmiutil PACKAGE_STRING = ipmiutil 3.0.7 PACKAGE_TARNAME = ipmiutil PACKAGE_VERSION = 3.0.7 PATH_SEPARATOR = : PKG_DIR = /root/rpmbuild RANLIB = ranlib SAM2OBJ = isensor2.o ievents2.o SED = sed SET_MAKE = SHELL = /bin/sh SHR_LINK = libipmiutil.so.1 STRIP = strip SUBDIR_S = doc scripts lib util SYSTEMD_DIR = /usr/share/ipmiutil VERSION = 3.0.7 abs_builddir = /usr/dev/ipmiutil-3.0.7/doc abs_srcdir = /usr/dev/ipmiutil-3.0.7/doc abs_top_builddir = /usr/dev/ipmiutil-3.0.7 abs_top_srcdir = /usr/dev/ipmiutil-3.0.7 ac_ct_CC = gcc ac_ct_DUMPBIN = am__include = include am__leading_dot = . am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin build = x86_64-redhat-linux-gnu build_alias = build_cpu = x86_64 build_os = linux-gnu build_vendor = redhat builddir = . datadir = ${prefix}/share datarootdir = ${prefix}/share docdir = ${prefix}/share/doc/ipmiutil-${version} dvidir = ${docdir} exec_prefix = ${prefix} host = x86_64-redhat-linux-gnu host_alias = host_cpu = x86_64 host_os = linux-gnu host_vendor = redhat htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /usr/dev/ipmiutil-3.0.7/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var lt_ECHO = echo mandir = ${prefix}/share/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} pkgconfigdir = ${libdir}/pkgconfig prefix = /usr program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = top_build_prefix = ../ top_builddir = .. top_srcdir = .. #!/bin/sh # Makefile to build/install doc files # MKDIR = sh ../mkinstalldirs INSTALL_SH = sh ../install-sh -c INSTALL_DATA_SH = ${INSTALL_SH} -m 644 etcdir = /etc datato = ${DESTDIR}${datadir}/ipmiutil cronto = ${DESTDIR}${etcdir}/cron.daily manto = ${DESTDIR}${mandir}/man8 varto = ${DESTDIR}/var/lib/ipmiutil all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am all: clean: clobber: distclean: check: install: $(MKDIR) ${manto} $(MKDIR) ${datato} $(MKDIR) ${varto} ${INSTALL_DATA_SH} isel.8 ${manto} ${INSTALL_DATA_SH} isensor.8 ${manto} ${INSTALL_DATA_SH} ireset.8 ${manto} ${INSTALL_DATA_SH} ialarms.8 ${manto} ${INSTALL_DATA_SH} iwdt.8 ${manto} ${INSTALL_DATA_SH} ifru.8 ${manto} ${INSTALL_DATA_SH} ilan.8 ${manto} ${INSTALL_DATA_SH} iserial.8 ${manto} ${INSTALL_DATA_SH} icmd.8 ${manto} ${INSTALL_DATA_SH} igetevent.8 ${manto} ${INSTALL_DATA_SH} ihealth.8 ${manto} ${INSTALL_DATA_SH} ipmiutil.8 ${manto} ${INSTALL_DATA_SH} isol.8 ${manto} ${INSTALL_DATA_SH} idiscover.8 ${manto} ${INSTALL_DATA_SH} ievents.8 ${manto} ${INSTALL_DATA_SH} iconfig.8 ${manto} ${INSTALL_DATA_SH} ipmi_port.8 ${manto} ${INSTALL_DATA_SH} ipicmg.8 ${manto} ${INSTALL_DATA_SH} ifirewall.8 ${manto} ${INSTALL_DATA_SH} ifwum.8 ${manto} ${INSTALL_DATA_SH} ihpm.8 ${manto} ${INSTALL_DATA_SH} isunoem.8 ${manto} ${INSTALL_DATA_SH} itsol.8 ${manto} ${INSTALL_DATA_SH} iekanalyzer.8 ${manto} ${INSTALL_DATA_SH} idelloem.8 ${manto} ${INSTALL_DATA_SH} idcmi.8 ${manto} ${INSTALL_DATA_SH} ismcoem.8 ${manto} ${INSTALL_DATA_SH} iuser.8 ${manto} ${INSTALL_DATA_SH} bmclanpet.mib ${datato} cd ${manto}; gzip -f *.8 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ipmiutil-3.0.7/doc/icmd.80000644000076400007640000000755013160502144014646 0ustar acressloggers.TH ICMD 8 "Version 1.0: 10 Aug 2004" .SH NAME ipmiutil_cmd \- a tool to send specific IPMI commands via the command line. .SH SYNOPSIS .B "ipmiutil cmd [-pqsx -NUPREFJTVY] bus rsSa netFn/lun cmd [data bytes]" .SH DESCRIPTION This .I ipmiutil cmd tool sends specific IPMI commands to the firmware. The commands are composed as hex values on the command line. This tool was written to allow in-band use to match the DOS CMDTOOL.EXE or IPMITOOL.EXE program which is distributed with many Intel servers. Certain scripts or pre-written commands may have been supplied for the DOS tool that can now be used while the system is running Linux or Windows. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. This tool should only be used if you are familiar with the IPMI 1.5 specification, or you have specific pre-written commands to send. .SH OPTIONS Command line options are described below. .IP "-p" Port to use. Defaults to RMCP port 623. .IP "-q" Quiet mode. Show only minimal header information. .IP "-s" Skips the GetDeviceID command .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH PARAMETERS The following parameters are used by icmd. Each is represented as a two-digit hex byte. The parameters have no default values. .IP "bus" This byte contains the bus number for this command, usually 00. .IP "rsSa" This is the resource slave address, usually 0x20 for the BMC. .IP "netFn/lun" This byte combines the net Function and Lun. The 2 low-order bits are the Lun and the 6 high-order bits are the net Function. This representation is consistent with the DOS CMDTOOL/IPMITOOL. .IP "cmd" This byte contains the IPMI command. .IP "[data bytes]" This is a sequence of zero to 16 bytes that represent data bytes specific to this command. .SH "EXAMPLES" icmd 00 20 18 01 .br Sends the GetDevice ID command to the BMC. .PP icmd 00 20 28 43 00 00 ff ff 00 ff .br Sends a Get SEL entry command for the last entry in the firmware log. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ifirewall.80000644000076400007640000001303313160502144015701 0ustar acressloggers.TH IFIREWALL 8 "Version 1.0: 04 Jun 2010" .SH NAME ipmiutil_firewall \- configure the IPMI firmware firewall functions .SH SYNOPSIS .B "ipmiutil firewall [-mxNUPREFJTVY] parameters" .SH DESCRIPTION This .I ipmiutil firewall command supports the IPMI Firmware Firewall capability. It may be used to add or remove security-based restrictions on certain commands/command sub-functions or to list the current firmware firewall restrictions set on any commands. For each firmware firewall command listed below, parameters may be included to cause the command to be executed with increasing granularity on a specific LUN, for a specific NetFn, for a specific IPMI Command, and finally for a specific command's sub-function. See Appendix H in the IPMI 2.0 Specification for a listing of any sub-function numbers that may be associated with a particular command. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-m 002000" Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH PARAMETERS Parameter syntax and dependencies are as follows: firewall [\fIchannel\fP \fBH\fR] [\fIlun\fP \fBL\fR [ \fInetfn\fP \fBN\fR [\fIcommand\fP \fBC\fR [\fIsubfn\fP \fBS\fR]]]] Note that if "netfn \fBN\fR" is specified, then "lun \fBL\fR" must also be specified; if "command \fBC\fR" is specified, then "netfn \fBN\fR" (and therefore "lun \fBL\fR") must also be specified, and so forth. "channel \fBH\fR" is an optional and standalone parameter. If not specified, the requested operation will be performed on the current channel. Note that command support may vary from channel to channel. Firmware firewall commands: .RS .TP \fIinfo\fP [\fB(Parms as described above)\fR] .br List firmware firewall information for the specified LUN, NetFn, and Command (if supplied) on the current or specified channel. Listed information includes the support, configurable, and enabled bits for the specified command or commands. Some usage examples: .RS .TP \fIinfo\fP [\fBchannel H\fR] [\fBlun L\fR] .br This command will list firmware firewall information for all NetFns for the specified LUN on either the current or the specified channel. .TP \fIinfo\fP [\fBchannel H\fR] [\fBlun L\fR [ \fBnetfn N\fR ] .br This command will print out all command information for a single LUN/NetFn pair. .TP \fIinfo\fP [\fBchannel H\fR] [\fBlun L\fR [ \fBnetfn N\fR [\fBcommand C\fR] ]] .br This prints out detailed, human-readable information showing the support, configurable, and enabled bits for the specified command on the specified LUN/NetFn pair. Information will be printed about each of the command subfunctions. .TP \fIinfo\fP [\fBchannel H\fR] [\fBlun L\fR [ \fBnetfn N\fR [\fBcommand C\fR [\fBsubfn S\fR]]]] .br Print out information for a specific sub-function. .RE .TP \fIenable\fP [\fB(Parms as described above)\fR] .br This command is used to enable commands for a given NetFn/LUN combination on the specified channel. .TP \fIdisable\fP [\fB(Parms as described above)\fR] [\fBforce\fR] .br This command is used to disable commands for a given NetFn/LUN combination on the specified channel. Great care should be taken if using the "force" option so as not to disable the "Set Command Enables" command. .TP \fIreset\fP [\fB(Parms as described above)\fR] .br This command may be used to reset the firmware firewall back to a state where all commands and command sub-functions are enabled. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2010 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/iconfig.80000644000076400007640000000762013160502144015346 0ustar acressloggers.TH ICONFIG 8 "Version 1.4: 17 Feb 2010" .SH NAME ipmiutil_config \- list, save, and restore BMC configuration parameters .SH SYNOPSIS .B "ipmiutil config [-lpxLNUPREFJTVY] [-r file] [-s file]" .SH DESCRIPTION .I ipmiutil config is a program that uses an IPMI driver to send IPMI commands which list, save and restore BMC configuration parameters for LAN, Serial, PEF, SOL, User, Channel. This combines the functionality of ipmiutil lan (ilan) and ipmiutil serial (iserial). Note that some of the LAN parameters cannot be restored remotely over the IPMI LAN, changing the configuration that is in use. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-l" Lists BMC configuration parameters with a keyword, index, and its hex values. This is the default behavior if no options are specified. .IP "-r config_file" Restores BMC configuration from config_file, which was produced with \-s below. .IP "-s config_file" Saves BMC configuration to config_file. This file could be edited, in certain cases, such as to vary the BMC IP address (LanParam 3), or to use the UserPassword records. Note that lines beginning with '#' are comments and are ignored. For editing UserPassword records, convert your text value to hex format; for example "echo 'mypassword' |od \-t x1", and leave off the trailing 0a. .IP "-x" Causes extra debug messages to be displayed. .IP "-p password_to_set" This specifies the firmware password to set for BMC LAN access for all users during the restore. If not specified, the password configuration will not be changed, unless a valid UserPassword record is present in the file to be restored. Note that user passwords are write-only via standard IPMI commands. .IP "-L lan_ch_num" This specifies the IPMI LAN channel number used for BMC LAN. This varies by platform, and can be found in the platform technical specifications. By default, bmcconfig scans all IPMI channels to find a LAN channel for BMC LAN. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "SEE ALSO" ipmiutil(8) ialarms(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ihpm.80000644000076400007640000001057213160502144014665 0ustar acressloggers.TH IHPM 8 "Version 1.0: 25 Aug 2010" .SH NAME ipmiutil_hpm \- PICMG HPM.1 Upgrade Agent .SH SYNOPSIS .B "ipmiutil hpm [-mxNUPREFJTVY] parameters" .SH DESCRIPTION This .I ipmiutil hpm subcommand updates HPM components using PICMG HPM.1 file This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-m 002000" Target a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH PARAMETERS \fIhpm\fP \fBparameters\fR .RS .TP \fIcheck\fR .br Check the target information. .TP \fIcheck\fP \fBfilename\fR .br Display both the existing target version and image version on the screen. .TP \fIdownload\fP \fBfilename\fR .br Download specified firmware. .TP \fIupgrade\fP \fBfilename\fR [\fBall\fR] [\fBcomponent x\fR] [\fBactivate\fR] .br Upgrade the firmware using a valid HPM.1 image file. If no option is specified, the firmware versions are checked first and the firmware is upgraded only if they are different. .RS .TP \fIall\fR .br Upgrade all components even if the firmware versions are the same (use this only after using "check" command). .TP \fIcomponent\fP \fBx\fR .br Upgrade only given component from the given file. .br component 0 - BOOT .br component 1 - RTK .TP \fIactivate\fR .br Activate new firmware right away. .RE .TP \fIactivate\fR .br Activate the newly uploaded firmware. .TP \fItargetcap\fR .br Get the target upgrade capabilities. .TP \fIcompprop\fP \fBid\fR \fBopt\fR .br Get the specified component properties. Valid component \fBid\fR: 0-7. \fBOpt\fR can be one of following: .br 0 - General properties .br 1 - Current firmware version .br 2 - Description string .br 3 - Rollback firmware version .br 4 - Deferred firmware version .TP \fIabort\fR .br Abort the on-going firmware upgrade. .TP \fIupgstatus\fR .br Show status of the last long duration command. .TP \fIrollback\fR .br Perform manual rollback on the IPM Controller firmware. .TP \fIrollbackstatus\fR .br Show the rollback status. .TP \fIselftestresult\fR .br Query the self test results. .RE .SH "EXAMPLES" ipmiutil hpm targetcap .br Gets HPM target capabilities .PP ipmiutil hpm \-N 192.168.1.1 \-U root \-P pswd download firmware.img .br Downloads the HPM firmware version contained in firmware.img over IPMI LAN. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2010 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/isol.80000644000076400007640000001627713160502144014706 0ustar acressloggers.TH ISOL 8 "Version 1.1: 17 Feb 2010" .SH NAME ipmiutil_sol \- an IPMI Serial-Over-LAN Console application .SH SYNOPSIS .B "ipmiutil sol [-acdeilorsvwxz -NUPREFJTVY] .SH DESCRIPTION This utility starts an IPMI Serial-Over-LAN console session. A Serial-over-LAN console allows the client to see and modify functions before the OS boots, such as BIOS setup, grub, etc. This utility uses either the IPMI LAN 1.5 or 2.0 SOL interface. The 1.5 SOL interface is specific to Intel BMCs, while any IPMI 2.0 BMC should support 2.0 SOL. The target system/node must first have these parameters configured before SOL sessions can be started: .br - [BIOS] serial console redirection parameters, .br - [IPMI] lan and SOL parameters (see ipmiutil lan or ilan), and .br - [OS] For Linux, edit grub.conf, inittab, and securetty parameters. .br Be sure that the baud rate matches in all of the above places. See the ipmiutil UserGuide section 4.8 for details. .SH OPTIONS .IP "-a" Activate the SOL Console session, and enter console mode. Use the escape sequence ('~.') to exit the session. .IP "-c '^'" Set the escape Character to '^', or another ANSI character. This changes the default two-character escape sequence ('~.') to the specified single escape character, which will end the SOL session. .IP "-d" Deactivate the SOL Console session. Use this if the previous session was aborted abnormally and starting a new session gives an error. .IP "-e" Turn Encryption off in negotiation when activating a session. By default, encryption is on for Serial-Over-LAN console sessions. .IP "-l" Use Legacy BIOS mapping for Enter key (CR+LF) instead of just LF. This is needed for BIOS Setup menus and DOS, but causes an extra LF to occur in Linux. So, only use this option if doing BIOS or DOS changes. This should be seldom be needed since now the default is to automatically detect these menus with colored backgrounds and change the mapping. .IP "-i input_file" Use this file as an input script. The input_file will be read after the session is established. This can be used to automate certain tasks. The input_file is read one line at a time. If the input_file does not have an escape character (~) to end the session, then the input is returned to the keyboard when the file ends. .IP "-o output_file" Use a Trace log. The output_file is created and all SOL screen output is written to the file, including VT100 escape sequences. If the output_file exists, the output is appended to it. This can be used to log what the user has done in an SOL session. .IP "-p" Port to use. Defaults to RMCP port 623. .IP "-r" Use Raw terminal I/O instead of custom VT100 to ANSI translation (in Windows). Use this option if the server is configured in BIOS and BMC for ANSI and the utility is being invoked from Windows. .IP "-s NNN" For a slow link with high latency, this adds a delay of NNN microseconds between sending and receiving SOL packets. The default is 100 microseconds. .IP "-w" (Windows only) Do not use the Windows Console buffer, but use Windows stdio instead. This does not handle cursor positioning correctly in some cases, however. .IP "-v log_file" Causes debug messages to be displayed to the specified debug log_file. The default log_file is isoldbg.log in the current directory. .IP "-x" Causes debug messages to be displayed to the debug log file. .IP "-z" Causes more verbose debug messages to be displayed to the debug log file. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any supported driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "EXAMPLES" ipmiutil sol \-a \-N nodename \-U username \-P password .br Starts an SOL console session to the nodename. Detect the lan protocol. .PP ipmiutil sol \-a \-N nodename \-U username \-P password \-Flan2 .br Starts an SOL console session to the nodename. Force lan protocol to 2.0. .PP .SH "PLATFORM SERIAL PORT CONFIGURATION EXAMPLES" First, enter BIOS Setup for Serial Console Redirection parameters: (these vary by platform) .br Console Redirection = Serial Port B .br ACPI Redirection = Disabled .br Baud Rate = 115.2K .br Flow Control = CTS/RTS .br Terminal Type = VT100 .br Legacy Redirection = Enabled .br Note that the Baud Rate can vary, but it must match in all locations where it is used (BIOS, IPMI, and Linux). .br For some non-Intel platforms, the serial console would be COM1 instead of COM2, but should be enabled in BIOS. .br From Linux, run "ipmiutil serial \-c" for Terminal Mode shared configuration. .br Or, on older Intel TSRLT2 platforms: From Linux, run "ipmiutil serial \-s" for Basic Mode Shared configuration. .SH "LINUX CONFIGURATION FOR SERIAL CONSOLE" If using lilo, in /etc/lilo.conf, add .br append="console=ttyS1,19200n8 console=tty0" .br (and comment out the "message=" line because it includes graphics) .br Note that the append line can be placed in the global section and removed from each kernel section if there are no other differences. .PP Or, if using grub, edit /boot/grub/grub.conf as follows: .br #Omit the splashimage or gfxmenu .br # splashimage=(hd0,0)/grub/splash.xpm.gz .br #The serial and terminal lines are not usually needed .br # serial \-\-unit=1 \-\-speed=19200 \-\-word=8 \-\-parity=no \-\-stop=1 .br # terminal \-\-timeout=10 serial console .br #Add the console=ttyS* parameter to the kernel line .br kernel (hd0,0) /vmlinuz root=/dev/sda2 console=ttyS1,19200n8 .PP Add this line to /etc/initab, if ttyS1 is not already there: .br co:2345:respawn:/sbin/agetty ttyS1 19200 vt100 .PP Add this line to /etc/securetty, if ttyS1 is not already there: .br ttyS1 .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/isel.80000644000076400007640000001213513160502144014661 0ustar acressloggers.TH ISEL 8 "Version 1.4: 17 Feb 2010" .SH NAME ipmiutil_sel \- show firmware System Event Log records .SH SYNOPSIS .B "ipmiutil sel [-abcflswvx -N node -P/-R pswd -U user -EFJTVY]" .SH DESCRIPTION .I ipmiutil sel is a program that uses IPMI commands to to read and display the System Event Log (SEL) which is stored by the BMC firmware. IPMI commands are issued to read each record, and, if specified, incrementally write records that have not previously been read into the Linux syslog (/var/log/messages). This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-a string" Add a SEL record with a string of up to 13 characters. Longer strings will be truncated. Note that this should be used sparingly, but would be useful for changes made to the hardware or firmware environment, like "Fan replaced" or "flash FW2.1". .IP "-b bin_file" Interpret a file containing raw binary/hex SEL data dumped in binary form, such as that produced by "ipmitool sel writeraw bin_file". Each set of 16 bytes in the file will be interpreted as an IPMI event. .IP "-c" Show output in a canonical format, with a default delimiter of '|'. (same as \-n). .IP "-d" Deletes/Clears the SEL of all records. If the SEL becomes full (free space = 0), it no longer accepts new records, so the SEL should be cleared periodically (use checksel cron script). .IP "-e" Show Extended sensor descriptions for events if run locally. This option will attempt to get the full sensor description from /var/lib/ipmiutil/sensor_out.txt, and also use its SDR to decode any raw threshold values in the event, if present. .IP "-f sel_file" Interpret a file containing raw ascii text SEL data captured with ipmiutil sel \-r, or some other similar utility. Each line in the file should be in this form, with no leading spaces: .br 04 00 02 76 a9 4a 47 20 00 04 10 09 6f 42 0f ff .br Lines not in this format will be ignored. .IP "-l N" Show last N SEL records, in reverse order (newest first). For some BMC implementations, this may not show all N records specified. .IP "-n" Show output in a nominal/canonical format, with a default delimiter of '|'. (same as \-c). .IP "-r" Show the 16 raw hex bytes for each SEL entry. The default is to display interpreted entries, and include relevant hex event bytes. .IP "-p" Port to use. Defaults to RMCP port 623. .IP "-s N" Show only SEL events with severity N or greater. Severity 0=INF, 1=MIN, 2=MAJ, 3=CRT. The default is to show all SEL events. .IP "-u" Show the SEL time as UTC and also get the SEL Time UTC offset if that command is supported. The default is to convert the SEL Time to local time. .IP "-v" Only show the version information. This shows: the ipmiutil sel utility version, the BMC version, the IPMI version, the SEL version, and the amount of free space in the SEL. .IP "-w" This option writes SEL records to the Linux syslog (/var/log/messages) or Windows Application Log. It only writes SEL records that have timestamps newer than the last record written to syslog. It saves the last timestamp in an index file named /usr/share/ipmiutil/sel.idx (.\\sel.idx in Windows). .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/rh_spec.patch0000664000076400007640000000607013160502144016303 0ustar acressloggers--- ipmiutil.spec.orig 2012-06-12 12:05:50.000000000 -0400 +++ ipmiutil.spec 2012-06-12 12:07:47.000000000 -0400 @@ -7,7 +7,7 @@ Release: 1%{?dist} Summary: Easy-to-use IPMI server management utilities License: BSD -Group: System/Management +Group: System Environment/Base Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz URL: http://ipmiutil.sourceforge.net BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -15,18 +15,9 @@ %if 0%{?fedora} >= 15 Requires: systemd-units %endif -%if 0%{?suse_version} >= 1210 -%define req_systemd 1 -%endif -%if 0%{?req_systemd} -BuildRequires: openssl-devel gcc gcc-c++ libtool systemd -%define systemd_fls %{_unitdir} -# Requires: %{?systemd_requires} -%else BuildRequires: openssl-devel gcc gcc-c++ libtool -%define systemd_fls %{_datadir}/%{name} -%endif -%define init_dir %{_initrddir} +%global systemd_fls %{_datadir}/%{name} +%global init_dir %{_initrddir} %description The ipmiutil package provides easy-to-use utilities to view the SEL, @@ -53,12 +44,8 @@ %setup -q %build -%if 0%{?req_systemd} -%configure --enable-systemd -%else %configure -%endif -make +make %{?_smp_mflags} %install rm -rf %{buildroot} @@ -146,11 +133,6 @@ %{_libdir}/libipmiutil.a -%pre -%if 0%{?req_systemd} -%service_add_pre ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service -%endif - %post # POST_INSTALL, $1 = 1 if rpm -i, $1 = 2 if rpm -U @@ -160,9 +142,6 @@ vardir=%{_var}/lib/%{name} scr_dir=%{_datadir}/%{name} -%if 0%{?req_systemd} -%service_add_post ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service -%else if [ -x /bin/systemctl ]; then systemd_dir=%{_unitdir} echo "IINITDIR=%{init_dir}" >>%{_datadir}/%{name}/ipmiutil.env @@ -177,7 +156,6 @@ cp -f ${scr_dir}/ipmiutil_evt %{init_dir} cp -f ${scr_dir}/ipmi_port %{init_dir} fi -%endif # Run some ipmiutil command to see if any IPMI interface works. %{_bindir}/ipmiutil sel -v >/dev/null 2>&1 @@ -213,9 +191,6 @@ # before uninstall, $1 = 1 if rpm -U, $1 = 0 if rpm -e if [ "$1" = "0" ] then -%if 0%{?req_systemd} -%service_del_preun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service -%else if [ -x /bin/systemctl ]; then systemd_dir=%{_unitdir} if [ -f ${systemd_dir}/ipmiutil_evt.service ]; then @@ -250,16 +225,12 @@ rm -f %{init_dir}/ipmiutil_evt 2>/dev/null rm -f %{init_dir}/ipmi_port 2>/dev/null fi -%endif if [ -f %{_sysconfdir}/cron.daily/checksel ]; then rm -f %{_sysconfdir}/cron.daily/checksel fi fi %postun -%if 0%{?req_systemd} -%service_del_postun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service -%else if [ -x /bin/systemctl ]; then systemctl daemon-reload || : if [ $1 -ge 1 ] ; then @@ -267,7 +238,6 @@ systemctl try-restart ipmi_port.service || : fi fi -%endif %changelog * Fri May 04 2012 Andrew Cress 2.8.4-1 ipmiutil-3.0.7/doc/igetevent.80000644000076400007640000001415613160502144015724 0ustar acressloggers.TH IGETEVENT 8 "Version 1.2: 17 Feb 2010" .SH NAME ipmiutil_getevt \- wait for IPMI events .SH SYNOPSIS .B "ipmiutil getevt [-abosx -t secs -N node -U user -P/-R pswd -EFJTVY]" .SH DESCRIPTION .I ipmiutil getevt is a program that uses IPMI commands to wait for IPMI events sent from the BMC firmware. These events are also sent to the IPMI System Event Log (SEL). This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. Some server management functions want to trigger custom actions or alerts when IPMI hardware-related events occur, but do not want to track all events, just newly occurring events. This utility waits a specified timeout period for any events, and returns interpreted output for each event. It is designed as a scriptable command-line utility, but if the timeout is infinite (\-t 0), then this code could be used for a sample service as well. .br There are several methods to do this which are implemented here. .PP The SEL method: .br This method polls the SEL once a second, keeps track of the last SEL event read, and only new events are processed. This ensures that in a series of rapid events, all events are received in order, however, some transition-to-OK events may not be configured to write to the SEL on certain platforms. This method is used if getevent \-s is specified. This is the only method supported over IPMI LAN, i.e. with \-N. .PP The ReadEventMessageBuffer method: .br This uses an IPMI Message Buffer in the BMC firmware to read each new event. This receives any event, but if two events occur nearly simultaneously, only the most recent of the two will be returned with this method. An example of simultaneous events might be, if a fan stops/fails, both the non-critical and critical fan threshold events would occur at that time. This is the default method for getevent. .PP The OpenIPMI custom method: .br Different IPMI drivers may have varying behavior. For instance, the OpenIPMI driver uses the IPMI GetMessage commands internally and does not allow client programs to use those commands. It has its own custom mechanism, see getevent_mv(). This method is used if the OpenIPMI driver is detected, and no other method is specified. .PP The Async Event method: .br This only gets certain Asynchronous requests from the BMC to an SMS OS service, like a remote OS shutdown, and get_software_id. This method is disabled by default and only turned on if the getevent \-a option is specified. This method is only supported via the Intel IMB and OpenIPMI driver interfaces. There is an init script provided with ipmiutil to automate the task of starting this async event daemon. .br # chkconfig \-\-add ipmiutil_asy (skip this if no chkconfig) .br # /etc/init.d/ipmiutil_asy start .br This listens for IPMI LAN requests for soft-shutdown, and logs the output to /var/log/ipmiutil_asy.log .SH OPTIONS Command line options are described below. .IP "-a" Use the Async request method, which receives SMS OS requests from the BMC using the IMB or OpenIPMI driver interface. This services remote SMS bridge agent requests, like remote OS shutdown and get software_id. .IP "-b" Run in Background as a daemon. If this option is specified, normal output will be redirected to /var/log/ipmiutil_getevt.log. The default is to run in foreground. .IP "-c" Show output in a canonical format, with a delimiter of '|'. .IP "-e N" Wait for a specific event sensor type N. The parameter can be in hex (0x23) or decimal (35). The default is 0xFF which means wait for any event. .IP "-r F" Run script file F when an event occurs. The filename can include a full path. The script will be passed the event description as a parameter. A sample evt.sh script is included with the ipmiutil package. .IP "-o" Only run one pass to wait for the first event. Default is to loop for multiple events for the timeout period. .IP "-s" Use the SEL method to get events. This polls the SEL once a second for new events. The last SEL record read is saved in /usr/share/ipmiutil/evt.idx. Otherwise, the default is to use the ReadEventMessageBuffer method to get new events. .IP "-t N" Set the timeout period to N seconds. Default is 120 seconds. A timeout of 0 means an infinite period. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ifruset.80000644000076400007640000001214113160502144015403 0ustar acressloggers.TH IFRUSET 8 "Version 1.0: 14 Apr 2010" .SH NAME ifruset \- show/set Field Replacable Unit configuration data .SH SYNOPSIS .B "ifruset [-bcimx -unpvsafo -N node -U user -P/-R pswd -EFJTVY]" .SH DESCRIPTION .I ifruset is a program that uses IPMI commands to show FRU configuration data and optionally write any Product area fields into the FRU data. Setting the FRU Product area fields is a function that might be done by a manufacturer or system integrator. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. This program is not built or installed by default. Integrators who wish to use it should build ipmiutil from source, then do 'cd util; make ifruset'. .SH OPTIONS Command line options are described below. .IP "-u manuf" This option specifies a product manufacturer string to be written to the baseboard FRU Product area field 0. This field can be any string up to 20 characters. The default is to not modify this FRU field. .IP "-n name" This option specifies a product name string to be written to the baseboard FRU Product area field 1. This field can be any string up to 20 characters. The default is to not modify this FRU field. .IP "-p partnum" This option specifies a product part number string to be written to the baseboard FRU Product area field 2. This field can be any string up to 20 characters. The default is to not modify this FRU field. .IP "-v prod_ver" This option specifies a product version number string to be written to the baseboard FRU Product area field 3. The version number can be any string up to 20 characters. The default is to not modify this FRU field. .IP "-s serial_num" This option specifies a serial number string to be written to the baseboard FRU Product area field 4. The serial number can be any string up to 20 characters. The default is to not modify this FRU field. .IP "-a asset_string" This option specifies an asset tag string to be written to the baseboard FRU Product area field 5. The asset tag length is limited by the existing FRU Product data, but is usually allowed up to 20 characters. The default is to not modify this FRU field. .IP "-f fruid" This option specifies a product FRU file ID string to be written to the baseboard FRU Product area field 6. This field can be any string up to 20 characters. .IP "-o oem" This option specifies a product OEM field string to be written to the baseboard FRU Product area field 7. This field can be any string up to 20 characters. .IP "-b" Only show the Baseboard FRU data. The default behavior is to also scan for any SDR FRU data or DIMM SPD data referenced by the SDRs. .IP "-c" Show FRU output in a canonical format, with a default delimiter of '|'. .IP "-i 00" This option specifies a specific FRU ID to show. The input value should be in hex (0b, 1a, etc.), as shown from the sensor SDR output. By default, all FRU IDs that are specified in the FRU locator SDRs are shown. .IP "-m 002000" Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-x" Causes eXtra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/iekanalyzer.80000644000076400007640000002010313160502144016235 0ustar acressloggers.TH IEKANALYZER 8 "Version 1.0: 09 Sep 2010" .SH NAME ipmiutil_ekanalyzer \- run FRU-Ekeying analyzer with FRU files .SH SYNOPSIS .B "ipmiutil ekanalyzer [-mx -NPRUEFJTVY] commands" .B (deprecated, see ifru instead) .SH DESCRIPTION .I ipmiutil ekanalyzer is a program that analyzes FRU Ekeying information from files saved from PICMG IPMI systems. .br \fIekanalyzer\fP \fBcommand\fR \fBxx=filename1\fR \fBxx=filename2\fR [\fBrc=filename3\fR] .br NOTE: This command can support a maximum of 8 files per command line .IP "\fIfilename1\fP" binary file that stores FRU data of a Carrier or an AMC module .IP "\fIfilename2\fP" binary file that stores FRU data of an AMC module. These binary files can be generated from this command: \fIipmiutil fru \-i id \-d filename\fP .IP "\fIfilename3\fP" configuration file used for configuring On-Carrier Device ID or OEM GUID. This file is optional. .IP "\fIxx\fP" indicates the type of the file. It can take the following value: .br \fIoc\fP : On-Carrier device .br \fIa1\fP : AMC slot A1 .br \fIa2\fP : AMC slot A2 .br \fIa3\fP : AMC slot A3 .br \fIa4\fP : AMC slot A4 .br \fIb1\fP : AMC slot B1 .br \fIb2\fP : AMC slot B2 .br \fIb3\fP : AMC slot B3 .br \fIb4\fP : AMC slot B4 .br \fIsm\fP : Shelf Manager .SH OPTIONS .IP "-m 002000" Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "COMMANDS" .RE .TP .br The available commands for ekanalyzer are: .RE .RS .TP \fIprint\fP [\fBcarrier\fR | \fBpower\fR | \fBall\fR] .RS .TP \fIcarrier\fP (default) \fBoc=filename1\fR \fBoc=filename2\fR \fB...\fR .br Display point to point physical connectivity between carriers and AMC modules. Example: # ipmiutil ekanalyzer print carrier oc=fru oc=carrierfru From Carrier file: fru Number of AMC bays supported by Carrier: 2 AMC slot B1 topology: Port 0 =====> On Carrier Device ID 0, Port 16 Port 1 =====> On Carrier Device ID 0, Port 12 Port 2 =====> AMC slot B2, Port 2 AMC slot B2 topology: Port 0 =====> On Carrier Device ID 0, Port 3 Port 2 =====> AMC slot B1, Port 2 *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* From Carrier file: carrierfru On Carrier Device ID 0 topology: Port 0 =====> AMC slot B1, Port 4 Port 1 =====> AMC slot B1, Port 5 Port 2 =====> AMC slot B2, Port 6 Port 3 =====> AMC slot B2, Port 7 AMC slot B1 topology: Port 0 =====> AMC slot B2, Port 0 AMC slot B1 topology: Port 1 =====> AMC slot B2, Port 1 Number of AMC bays supported by Carrier: 2 .TP \fIpower\fP \fBxx=filename1\fR \fBxx=filename2\fR \fB...\fr .br Display power supply information between carrier and AMC modules. .TP \fIall\fP \fBxx=filename\fR \fBxx=filename\fR \fB...\fr .br Display both physical connectivity and power supply of each carrier and AMC modules. .RE .TP \fIfrushow\fP \fBxx=filename\fR .br Convert a binary FRU file into human readable text format. Use \-v option to get more display information. .RE .RS .TP \fIsummary\fP [\fBmatch\fR | \fBunmatch\fR | \fBall\fR] .RS .TP \fImatch\fP (default) \fBxx=filename\fR \fBxx=filename\fR \fB...\fR .br Display only matched results of Ekeying match between an On-Carrier device and an AMC module or between 2 AMC modules. Example: # ipmiutil ekanalyzer summary match oc=fru b1=amcB1 a2=amcA2 On-Carrier Device vs AMC slot B1 AMC slot B1 port 0 ==> On-Carrier Device 0 port 16 Matching Result From On-Carrier Device ID 0 Channel ID 11 || Lane 0: enable Link Type: AMC.2 Ethernet Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link Link Group ID: 0 || Link Asym. Match: exact match To AMC slot B1 Channel ID 0 || Lane 0: enable Link Type: AMC.2 Ethernet Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link Link Group ID: 0 || Link Asym. Match: exact match *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* AMC slot B1 port 1 ==> On-Carrier Device 0 port 12 Matching Result From On-Carrier Device ID 0 Channel ID 6 || Lane 0: enable Link Type: AMC.2 Ethernet Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link Link Group ID: 0 || Link Asym. Match: exact match To AMC slot B1 Channel ID 1 || Lane 0: enable Link Type: AMC.2 Ethernet Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link Link Group ID: 0 || Link Asym. Match: exact match *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* On-Carrier Device vs AMC slot A2 AMC slot A2 port 0 ==> On-Carrier Device 0 port 3 Matching Result From On-Carrier Device ID 0 Channel ID 9 || Lane 0: enable Link Type: AMC.2 Ethernet Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link Link Group ID: 0 || Link Asym. Match: exact match To AMC slot A2 Channel ID 0 || Lane 0: enable Link Type: AMC.2 Ethernet Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link Link Group ID: 0 || Link Asym. Match: exact match *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* AMC slot B1 vs AMC slot A2 AMC slot A2 port 2 ==> AMC slot B1 port 2 Matching Result From AMC slot B1 Channel ID 2 || Lane 0: enable Link Type: AMC.3 Storage Link Type extension: Serial Attached SCSI (SAS/SATA) Link Group ID: 0 || Link Asym. Match: FC or SAS interface {exact match} To AMC slot A2 Channel ID 2 || Lane 0: enable Link Type: AMC.3 Storage Link Type extension: Serial Attached SCSI (SAS/SATA) Link Group ID: 0 || Link Asym. Match: FC or SAS interface {exact match} *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* .TP \fIunmatch\fP \fBxx=filename\fR \fBxx=filename\fR \fB...\fr .br Display the unmatched results of Ekeying match between an On-Carrier device and an AMC module or between 2 AMC modules .TP \fIall\fP \fBxx=filename\fR \fBxx=filename\fR \fB...\fr .br Display both matched result and unmatched results of Ekeying match between two cards or two modules. .RE .SH "SEE ALSO" ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifirewall(8) ifru(8) ifruset(8) ifwum(8) igetevent(8) ihealth(8) ihpm(8) ilan(8) ipicmg(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) isunoem(8) iwdt(8) ipmiutil(8) ipmi_port(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ievents.80000644000076400007640000000604213160502144015402 0ustar acressloggers.TH IEVENTS 8 "Version 1.3: 23 June 2009" .SH NAME ievents \- decode IPMI and PET event data .SH SYNOPSIS .B "ievents [-bfhnprsx] 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10" .SH DESCRIPTION .I ievents is a standalone utility delivered with ipmiutil, used to interpret raw hex data from IPMI events or from IPMI PET SNMP trap varbind data. This utility uses the same interpretation logic as is used by "ipmiutil sel" (showsel) and "ipmiutil getevt" (getevents). The data bytes in the input are always assumed to be in hex form. This could be useful if a utility other than "ipmiutil sel" were used to obtain IPMI SEL records or events and interpretation is needed. This would also be needed at an enterprise management station to interpret the PET SNMP trap hex data into human-readable form, see option \-p. .SH OPTIONS .IP "-b bin_file" Interpret a file containing raw binary/hex SEL data dumped in binary form, such as that produced by "ipmitool sel writeraw bin_file". Each set of 16 bytes in the file will be interpreted as an IPMI event. (same as \-h) .IP "-f sel_file" Interpret a file containing raw ascii text SEL data captured with ipmiutil sel \-r, or some other similar utility. Each line in the file should be in this form, with no leading spaces: .br 04 00 02 76 a9 4a 47 20 00 04 10 09 6f 42 0f ff .br If this option is not specified, the default is to use the 16 bytes taken from the command-line arguments. (same as \-r) .IP "-h bin_file" Interpret a file containing raw binary/hex SEL data dumped in binary form, such as that produced by "ipmitool sel writeraw bin_file". Each set of 16 bytes in the file will be interpreted as an IPMI event. (same as \-b) .IP "-n" This option generates a New IPMI platform event, using 9 bytes of input. The input bytes are the same as the last 9 bytes of an IPMI event. .IP "-p" Decode as PET event bytes, where the input is 34 PET hex data bytes, skipping the first 8 of the 47-byte PET data. The default without \-p assumes that the input is a 16-byte IPMI event. .IP "-r sel_file" Interpret a file containing raw ascii text SEL data captured with ipmiutil sel \-r, or some other similar utility. (same as \-f) .IP "-s sensor_file" Sensor file with the output of "ipmiutil sensor", used to get the PET sensor_type from the sensor_num. The default is /usr/share/ipmiutil/sensor_out.txt as generated during the ipmiutil package installation. This is only needed with PET interpretation (\-p). .IP "-x" show eXtra debug messages .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/winsockerr.txt0000644000076400007640000005404713160502144016573 0ustar acressloggers(from http://msdn2.microsoft.com/en-us/library/ms740668.aspx) Windows Sockets Error Codes The following list describes the possible error codes returned by the WSAGetLastError function. Errors are listed in alphabetical order by error macro. Some error codes defined in Winsock2.h are not returned from any functionthese are not included in this list. Return code/value Description WSA_INVALID_HANDLE 6 Specified event object handle is invalid. An application attempts to use an event object, but the specified handle is not valid. Note that this error is returned by the operating system, so the error number may change in future releases of Windows. WSA_NOT_ENOUGH_MEMORY 8 Insufficient memory available. An application used a Windows Sockets function that directly maps to a Windows function. The Windows function is indicating a lack of required memory resources. Note that this error is returned by the operating system, so the error number may change in future releases of Windows. WSA_INVALID_PARAMETER 87 One or more parameters are invalid. An application used a Windows Sockets function which directly maps to a Windows function. The Windows function is indicating a problem with one or more parameters. Note that this error is returned by the operating system, so the error number may change in future releases of Windows. WSA_OPERATION_ABORTED 995 Overlapped operation aborted. An overlapped operation was canceled due to the closure of the socket, or the execution of the SIO_FLUSH command in WSAIoctl. Note that this error is returned by the operating system, so the error number may change in future releases of Windows. WSA_IO_INCOMPLETE 996 Overlapped I/O event object not in signaled state. The application has tried to determine the status of an overlapped operation which is not yet completed. Applications that use WSAGetOverlappedResult (with the fWait flag set to FALSE) in a polling mode to determine when an overlapped operation has completed, get this error code until the operation is complete. Note that this error is returned by the operating system, so the error number may change in future releases of Windows. WSA_IO_PENDING 997 Overlapped operations will complete later. The application has initiated an overlapped operation that cannot be completed immediately. A completion indication will be given later when the operation has been completed. Note that this error is returned by the operating system, so the error number may change in future releases of Windows. WSAEINTR 10004 Interrupted function call. A blocking operation was interrupted by a call to WSACancelBlockingCall. WSAEBADF 10009 File handle is not valid. The file handle supplied is not valid. WSAEACCES 10013 Permission denied. An attempt was made to access a socket in a way forbidden by its access permissions. An example is using a broadcast address for sendto without broadcast permission being set using setsockopt(SO_BROADCAST). Another possible reason for the WSAEACCES error is that when the bind function is called (on Windows NT 4 SP4 or later), another application, service, or kernel mode driver is bound to the same address with exclusive access. Such exclusive access is a new feature of Windows NT 4 SP4 and later, and is implemented by using the SO_EXCLUSIVEADDRUSE option. WSAEFAULT 10014 Bad address. The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a sockaddr structure, is smaller than the sizeof(sockaddr). WSAEINVAL 10022 Invalid argument. Some invalid argument was supplied (for example, specifying an invalid level to the setsockopt function). In some instances, it also refers to the current state of the socketfor instance, calling accept on a socket that is not listening. WSAEMFILE 10024 Too many open files. Too many open sockets. Each implementation may have a maximum number of socket handles available, either globally, per process, or per thread. WSAEWOULDBLOCK 10035 Resource temporarily unavailable. This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established. WSAEINPROGRESS 10036 Operation now in progress. A blocking operation is currently executing. Windows Sockets only allows a single blocking operationper- task or threadto be outstanding, and if any other function call is made (whether or not it references that or any other socket) the function fails with the WSAEINPROGRESS error. WSAEALREADY 10037 Operation already in progress. An operation was attempted on a nonblocking socket with an operation already in progressthat is, calling connect a second time on a nonblocking socket that is already connecting, or canceling an asynchronous request (WSAAsyncGetXbyY) that has already been canceled or completed. WSAENOTSOCK 10038 Socket operation on nonsocket. An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid. WSAEDESTADDRREQ 10039 Destination address required. A required address was omitted from an operation on a socket. For example, this error is returned if sendto is called with the remote address of ADDR_ANY. WSAEMSGSIZE 10040 Message too long. A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself. WSAEPROTOTYPE 10041 Protocol wrong type for socket. A protocol was specified in the socket function call that does not support the semantics of the socket type requested. For example, the ARPA Internet UDP protocol cannot be specified with a socket type of SOCK_STREAM. WSAENOPROTOOPT 10042 Bad protocol option. An unknown, invalid or unsupported option or level was specified in a getsockopt or setsockopt call. WSAEPROTONOSUPPORT 10043 Protocol not supported. The requested protocol has not been configured into the system, or no implementation for it exists. For example, a socket call requests a SOCK_DGRAM socket, but specifies a stream protocol. WSAESOCKTNOSUPPORT 10044 Socket type not supported. The support for the specified socket type does not exist in this address family. For example, the optional type SOCK_RAW might be selected in a socket call, and the implementation does not support SOCK_RAW sockets at all. WSAEOPNOTSUPP 10045 Operation not supported. The attempted operation is not supported for the type of object referenced. Usually this occurs when a socket descriptor to a socket that cannot support this operation is trying to accept a connection on a datagram socket. WSAEPFNOSUPPORT 10046 Protocol family not supported. The protocol family has not been configured into the system or no implementation for it exists. This message has a slightly different meaning from WSAEAFNOSUPPORT. However, it is interchangeable in most cases, and all Windows Sockets functions that return one of these messages also specify WSAEAFNOSUPPORT. WSAEAFNOSUPPORT 10047 Address family not supported by protocol family. An address incompatible with the requested protocol was used. All sockets are created with an associated address family (that is, AF_INET for Internet Protocols) and a generic protocol type (that is, SOCK_STREAM). This error is returned if an incorrect protocol is explicitly requested in the socket call, or if an address of the wrong family is used for a socket, for example, in sendto. WSAEADDRINUSE 10048 Address already in use. Typically, only one usage of each socket address (protocol/IP address/port) is permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that was not closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt (SO_REUSEADDR). Client applications usually need not call bind at all connect chooses an unused port automatically. When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed. This could happen with a call to another function later, including connect, listen, WSAConnect, or WSAJoinLeaf. WSAEADDRNOTAVAIL 10049 Cannot assign requested address. The requested address is not valid in its context. This normally results from an attempt to bind to an address that is not valid for the local computer. This can also result from connect, sendto, WSAConnect, WSAJoinLeaf, or WSASendTo when the remote address or port is not valid for a remote computer (for example, address or port 0). WSAENETDOWN 10050 Network is down. A socket operation encountered a dead network. This could indicate a serious failure of the network system (that is, the protocol stack that the Windows Sockets DLL runs over), the network interface, or the local network itself. WSAENETUNREACH 10051 Network is unreachable. A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host. WSAENETRESET 10052 Network dropped connection on reset. The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. It can also be returned by setsockopt if an attempt is made to set SO_KEEPALIVE on a connection that has already failed. WSAECONNABORTED 10053 Software caused connection abort. An established connection was aborted by the software in your host computer, possibly due to a data transmission time-out or protocol error. WSAECONNRESET 10054 Connection reset by peer. An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were i n progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET. WSAENOBUFS 10055 No buffer space available. An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. WSAEISCONN 10056 Socket is already connected. A connect request was made on an already-connected socket. Some implementations also return this error if sendto is called on a connected SOCK_DGRAM socket (for SOCK_STREAM sockets, the to parameter in sendto is ignored) although other implementations treat this as a legal occurrence. WSAENOTCONN 10057 Socket is not connected. A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using sendto) no address was supplied. Any other type of operation might also return this errorfor example, setsockopt setting SO_KEEPALIVE if the connection has been reset. WSAESHUTDOWN 10058 Cannot send after socket shutdown. A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call. By calling shutdown a partial close of a socket is requested, which is a signal that sending or receiving, or both have been discontinued. WSAETOOMANYREFS 10059 Too many references. Too many references to some kernel object. WSAETIMEDOUT 10060 Connection timed out. A connection attempt failed because the connected party did not properly respond after a period of time, or the established connection failed because the connected host has failed to respond. WSAECONNREFUSED 10061 Connection refused. No connection could be made because the target computer actively refused it. This usually results from trying to connect to a service that is inactive on the foreign hostthat is, one with no server application running. WSAELOOP 10062 Cannot translate name. Cannot translate a name. WSAENAMETOOLONG 10063 Name too long. A name component or a name was too long. WSAEHOSTDOWN 10064 Host is down. A socket operation failed because the destination host is down. A socket operation encountered a dead host. Networking activity on the local host has not been initiated. These conditions are more likely to be indicated by the error WSAETIMEDOUT. WSAEHOSTUNREACH 10065 No route to host. A socket operation was attempted to an unreachable host. See WSAENETUNREACH. WSAENOTEMPTY 10066 Directory not empty. Cannot remove a directory that is not empty. WSAEPROCLIM 10067 Too many processes. A Windows Sockets implementation may have a limit on the number of applications that can use it simultaneously.WSAStartup may fail with this error if the limit has been reached. WSAEUSERS 10068 User quota exceeded. Ran out of user quota. WSAEDQUOT 10069 Disk quota exceeded. Ran out of disk quota. WSAESTALE 10070 Stale file handle reference. The file handle reference is no longer available. WSAEREMOTE 10071 Item is remote. The item is not available locally. WSASYSNOTREADY 10091 Network subsystem is unavailable. This error is returned by WSAStartup if the Windows Sockets implementation cannot function at this time because the underlying system it uses to provide network services is currently unavailable. Users should check: That the appropriate Windows Sockets DLL file is in the current path. That they are not trying to use more than one Windows Sockets implementation simultaneously. If there is more than one Winsock DLL on your system, be sure the first one in the path is appropriate for the network subsystem currently loaded. The Windows Sockets implementation documentation to be sure all necessary components are currently installed and configured correctly. WSAVERNOTSUPPORTED 10092 Winsock.dll version out of range. The current Windows Sockets implementation does not support the Windows Sockets specification version requested by the application. Check that no old Windows Sockets DLL files are being accessed. WSANOTINITIALISED 10093 Successful WSAStartup not yet performed. Either the application has not called WSAStartup or WSAStartup failed. The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks), or WSACleanup has been called too many times. WSAEDISCON 10101 Graceful shutdown in progress. Returned by WSARecv and WSARecvFrom to indicate that the remote party has initiated a graceful shutdown sequence. WSAENOMORE 10102 No more results. No more results can be returned by the WSALookupServiceNext function. WSAECANCELLED 10103 Call has been canceled. A call to the WSALookupServiceEnd function was made while this call was still processing. The call has been canceled. WSAEINVALIDPROCTABLE 10104 Procedure call table is invalid. The service provider procedure call table is invalid. A service provider returned a bogus procedure table to Ws2_32.dll. This is usually caused by one or more of the function pointers being NULL. WSAEINVALIDPROVIDER 10105 Service provider is invalid. The requested service provider is invalid. This error is returned by the WSCGetProviderInfo and WSCGetProviderInfo32 functions if the protocol entry specified could not be found. This error is also returned if the service provider returned a version number other than 2.0. WSAEPROVIDERFAILEDINIT 10106 Service provider failed to initialize. The requested service provider could not be loaded or initialized. This error is returned if either a service provider's DLL could not be loaded (LoadLibrary failed) or the provider's WSPStartup or NSPStartup function failed. WSASYSCALLFAILURE 10107 System call failure. A system call that should never fail has failed. This is a generic error code, returned under various conditions. Returned when a system call that should never fail does fail. For example, if a call to WaitForMultipleEvents fails or one of the registry functions fails trying to manipulate the protocol/namespace catalogs. Returned when a provider does not return SUCCESS and does not provide an extended error code. Can indicate a service provider implementation error. WSASERVICE_NOT_FOUND 10108 Service not found. No such service is known. The service cannot be found in the specified name space. WSATYPE_NOT_FOUND 10109 Class type not found. The specified class was not found. WSA_E_NO_MORE 10110 No more results. No more results can be returned by the WSALookupServiceNext function. WSA_E_CANCELLED 10111 Call was canceled. A call to the WSALookupServiceEnd function was made while this call was still processing. The call has been canceled. WSAEREFUSED 10112 Database query was refused. A database query failed because it was actively refused. WSAHOST_NOT_FOUND 11001 Host not found. No such host is known. The name is not an official host name or alias, or it cannot be found in the database(s) being queried. This error may also be returned for protocol and service queries, and means that the specified name could not be found in the relevant database. WSATRY_AGAIN 11002 Nonauthoritative host not found. This is usually a temporary error during host name resolution and means that the local server did not receive a response from an authoritative server. A retry at some time later may be successful. WSANO_RECOVERY 11003 This is a nonrecoverable error. This indicates that some sort of nonrecoverable error occurred during a database lookup. This may be because the database files (for example, BSD-compatible HOSTS, SERVICES, or PROTOCOLS files) could not be found, or a DNS request was returned by the server with a severe error. WSANO_DATA 11004 Valid name, no data record of requested type. The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. The usual example for this is a host name-to-address translation attempt (using gethostbyname or WSAAsyncGetHostByName) which uses the DNS (Domain Name Server). An MX record is returned but no A recordindicating the host itself exists, but is not directly reachable. WSA_QOS_RECEIVERS 11005 QOS receivers. At least one QOS reserve has arrived. WSA_QOS_SENDERS 11006 QOS senders. At least one QOS send path has arrived. WSA_QOS_NO_SENDERS 11007 No QOS senders. There are no QOS senders. WSA_QOS_NO_RECEIVERS 11008 QOS no receivers. There are no QOS receivers. WSA_QOS_REQUEST_CONFIRMED 11009 QOS request confirmed. The QOS reserve request has been confirmed. WSA_QOS_ADMISSION_FAILURE 11010 QOS admission error. A QOS error occurred due to lack of resources. WSA_QOS_POLICY_FAILURE 11011 QOS policy failure. The QOS request was rejected because the policy system couldnt allocate the requested resource within the existing policy. WSA_QOS_BAD_STYLE 11012 QOS bad style. An unknown or conflicting QOS style was encountered. WSA_QOS_BAD_OBJECT 11013 QOS bad object. A problem was encountered with some part of the filterspec or the provider-specific buffer in general. WSA_QOS_TRAFFIC_CTRL_ERROR 11014 QOS traffic control error. An error with the underlying traffic control (TC) API as the generic QOS request was converted for local enforcement by the TC API. This could be due to an out of memory error or to an internal QOS provider error. WSA_QOS_GENERIC_ERROR 11015 QOS generic error. A general QOS error. WSA_QOS_ESERVICETYPE 11016 QOS service type error. An invalid or unrecognized service type was found in the QOS flowspec. WSA_QOS_EFLOWSPEC 11017 QOS flowspec error. An invalid or inconsistent flowspec was found in the QOS structure. WSA_QOS_EPROVSPECBUF 11018 Invalid QOS provider buffer. An invalid QOS provider-specific buffer. WSA_QOS_EFILTERSTYLE 11019 Invalid QOS filter style. An invalid QOS filter style was used. WSA_QOS_EFILTERTYPE 11020 Invalid QOS filter type. An invalid QOS filter type was used. WSA_QOS_EFILTERCOUNT 11021 Incorrect QOS filter count. An incorrect number of QOS FILTERSPECs were specified in the FLOWDESCRIPTOR. WSA_QOS_EOBJLENGTH 11022 Invalid QOS object length. An object with an invalid ObjectLength field was specified in the QOS provider-specific buffer. WSA_QOS_EFLOWCOUNT 11023 Incorrect QOS flow count. An incorrect number of flow descriptors was specified in the QOS structure. WSA_QOS_EUNKOWNPSOBJ 11024 Unrecognized QOS object. An unrecognized object was found in the QOS provider-specific buffer. WSA_QOS_EPOLICYOBJ 11025 Invalid QOS policy object. An invalid policy object was found in the QOS provider-specific buffer. WSA_QOS_EFLOWDESC 11026 Invalid QOS flow descriptor. An invalid QOS flow descriptor was found in the flow descriptor list. WSA_QOS_EPSFLOWSPEC 11027 Invalid QOS provider-specific flowspec. An invalid or inconsistent flowspec was found in the QOS provider-specific buffer. WSA_QOS_EPSFILTERSPEC 11028 Invalid QOS provider-specific filterspec. An invalid FILTERSPEC was found in the QOS provider-specific buffer. WSA_QOS_ESDMODEOBJ 11029 Invalid QOS shape discard mode object. An invalid shape discard mode object was found in the QOS provider-specific buffer. WSA_QOS_ESHAPERATEOBJ 11030 Invalid QOS shaping rate object. An invalid shaping rate object was found in the QOS provider-specific buffer. WSA_QOS_RESERVED_PETYPE 11031 Reserved policy QOS element type. A reserved policy element was found in the QOS provider-specific buffer. ipmiutil-3.0.7/doc/ipmiutil.spec0000644000000000000000000004222513160502144015331 0ustar rootroot# spec file for package ipmiutil # # Copyright (c) 2012 Andy Cress # Name: ipmiutil Version: 3.0.7 Release: 1%{?dist} Summary: Easy-to-use IPMI server management utilities License: BSD Group: System/Management Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz URL: http://ipmiutil.sourceforge.net BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) # Suggests: cron or vixie-cron or cronie or similar %if 0%{?sles_version} >= 10 %define bldreq0 libopenssl-devel %else %define bldreq0 openssl-devel %endif %if 0%{?fedora} >= 15 %define bldreq_extra systemd autoconf automake systemd-units Requires: systemd-units Group: System Environment/Base %endif %if 0%{?rhel} >= 7 %define bldreq_extra autoconf automake systemd-units %endif %if 0%{?suse_version} >= 1210 %define bldreq_extra gcc gcc-c++ libtool systemd %define req_systemd 1 %define unit_dir %{_unitdir} %define systemd_fls %{unit_dir} # Requires: %{?systemd_requires} %else %define bldreq_extra gcc gcc-c++ libtool %define systemd_fls %{_datadir}/%{name} %if 0%{?fedora} == 16 %define unit_dir /lib/systemd/system %else %{!?_unitdir: %define _unitdir /usr/lib/systemd/system} %define unit_dir %{_unitdir} %endif %endif BuildRequires: %{bldreq0} %{bldreq_extra} %define init_dir %{_initrddir} %description The ipmiutil package provides easy-to-use utilities to view the SEL, perform an IPMI chassis reset, set up the IPMI LAN and Platform Event Filter entries to allow SNMP alerts, Serial-Over-LAN console, event daemon, and other IPMI tasks. These can be invoked with the metacommand ipmiutil, or via subcommand shortcuts as well. IPMIUTIL can also write sensor thresholds, FRU asset tags, and has a full IPMI configuration save/restore. An IPMI driver can be provided by either the OpenIPMI driver (/dev/ipmi0) or the Intel IPMI driver (/dev/imb), etc. If used locally and no driver is detected, ipmiutil will use user-space direct I/Os instead. %package devel Group: Development/Libraries Summary: Includes libraries and headers for the ipmiutil package %description devel The ipmiutil-devel package contains headers and libraries which are useful for building custom IPMI applications. %package static Group: Development/Libraries Summary: Includes static libraries for the ipmiutil package %description static The ipmiutil-static package contains static libraries which are useful for building custom IPMI applications. %prep %setup -q %build %if 0%{?fedora} >= 15 autoconf %endif %if 0%{?req_systemd} %configure --enable-systemd %else %configure %endif %if 0%{?fedora} >= 15 make %{?_smp_mflags} %else make %endif %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} %clean rm -rf %{buildroot} %files %defattr(-, root, root, -) %dir %{_datadir}/%{name} %dir %{_var}/lib/%{name} %{_bindir}/ipmiutil %{_bindir}/idiscover %{_bindir}/ievents %{_sbindir}/iseltime %{_sbindir}/ipmi_port %{_sbindir}/ialarms %{_sbindir}/iconfig %{_sbindir}/icmd %{_sbindir}/ifru %{_sbindir}/igetevent %{_sbindir}/ihealth %{_sbindir}/ilan %{_sbindir}/ireset %{_sbindir}/isel %{_sbindir}/isensor %{_sbindir}/iserial %{_sbindir}/isol %{_sbindir}/iwdt %{_sbindir}/ipicmg %{_sbindir}/ifirewall %{_sbindir}/ifwum %{_sbindir}/ihpm %{_sbindir}/iuser %{_libdir}/libipmiutil.so.1 %{_datadir}/%{name}/ipmiutil_evt %{_datadir}/%{name}/ipmiutil_asy %{_datadir}/%{name}/ipmiutil_wdt %{_datadir}/%{name}/ipmi_port %{_datadir}/%{name}/ipmi_info %{_datadir}/%{name}/checksel %{systemd_fls}/ipmiutil_evt.service %{systemd_fls}/ipmiutil_asy.service %{systemd_fls}/ipmiutil_wdt.service %{systemd_fls}/ipmi_port.service %{_datadir}/%{name}/ipmiutil.env %{_datadir}/%{name}/ipmiutil.pre %{_datadir}/%{name}/ipmiutil.setup %{_datadir}/%{name}/ipmi_if.sh %{_datadir}/%{name}/evt.sh %{_datadir}/%{name}/ipmi.init.basic %{_datadir}/%{name}/bmclanpet.mib %{_mandir}/man8/isel.8* %{_mandir}/man8/isensor.8* %{_mandir}/man8/ireset.8* %{_mandir}/man8/igetevent.8* %{_mandir}/man8/ihealth.8* %{_mandir}/man8/iconfig.8* %{_mandir}/man8/ialarms.8* %{_mandir}/man8/iwdt.8* %{_mandir}/man8/ilan.8* %{_mandir}/man8/iserial.8* %{_mandir}/man8/ifru.8* %{_mandir}/man8/icmd.8* %{_mandir}/man8/isol.8* %{_mandir}/man8/ipmiutil.8* %{_mandir}/man8/idiscover.8* %{_mandir}/man8/ievents.8* %{_mandir}/man8/ipmi_port.8* %{_mandir}/man8/ipicmg.8* %{_mandir}/man8/ifirewall.8* %{_mandir}/man8/ifwum.8* %{_mandir}/man8/ihpm.8* %{_mandir}/man8/isunoem.8* %{_mandir}/man8/idelloem.8* %{_mandir}/man8/ismcoem.8* %{_mandir}/man8/iekanalyzer.8* %{_mandir}/man8/itsol.8* %{_mandir}/man8/idcmi.8* %{_mandir}/man8/iuser.8* %doc AUTHORS ChangeLog COPYING NEWS README TODO %doc doc/UserGuide %files devel %defattr(-,root,root) # %{_datadir}/%{name} is used by both ipmiutil and ipmituil-devel %dir %{_datadir}/%{name} %{_datadir}/%{name}/ipmi_sample.c %{_datadir}/%{name}/ipmi_sample_evt.c %{_datadir}/%{name}/isensor.c %{_datadir}/%{name}/ievents.c %{_datadir}/%{name}/isensor.h %{_datadir}/%{name}/ievents.h %{_datadir}/%{name}/Makefile %{_libdir}/libipmiutil.so %{_includedir}/ipmicmd.h %files static %defattr(-,root,root) %{_libdir}/libipmiutil.a %post devel /sbin/ldconfig %pre %if 0%{?req_systemd} %service_add_pre ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service %endif %post /sbin/ldconfig # POST_INSTALL, $1 = 1 if rpm -i, $1 = 2 if rpm -U if [ "$1" = "1" ] then # doing rpm -i, first time vardir=%{_var}/lib/%{name} scr_dir=%{_datadir}/%{name} %if 0%{?req_systemd} %service_add_post ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service %else if [ -x /bin/systemctl ] && [ -d %{unit_dir} ]; then echo "IINITDIR=%{init_dir}" >>%{_datadir}/%{name}/ipmiutil.env cp -f ${scr_dir}/ipmiutil_evt.service %{unit_dir} cp -f ${scr_dir}/ipmiutil_asy.service %{unit_dir} cp -f ${scr_dir}/ipmiutil_wdt.service %{unit_dir} cp -f ${scr_dir}/ipmi_port.service %{unit_dir} # systemctl enable ipmi_port.service >/dev/null 2>&1 || : else cp -f ${scr_dir}/ipmiutil_wdt %{init_dir} cp -f ${scr_dir}/ipmiutil_asy %{init_dir} cp -f ${scr_dir}/ipmiutil_evt %{init_dir} cp -f ${scr_dir}/ipmi_port %{init_dir} cp -f ${scr_dir}/ipmi_info %{init_dir} fi %endif # Test whether an IPMI interface is known to the motherboard IPMIret=1 %{_sbindir}/dmidecode |grep -q IPMI && IPMIret=0 # Run some ipmiutil command to see if any IPMI interface works. # Some may not have IPMI on the motherboard, so need to check, but # some kernels may have IPMI driver partially loaded, which breaks this %{_bindir}/ipmiutil sel -v >/dev/null 2>&1 && IPMIret=0 if [ $IPMIret -eq 0 ]; then if [ ! -x %{init_dir}/ipmi ]; then cp -f %{scr_dir}/ipmi.init.basic %{init_dir}/ipmi fi # If IPMI is enabled, automate managing the IPMI SEL if [ -d %{_sysconfdir}/cron.daily ]; then cp -f %{_datadir}/%{name}/checksel %{_sysconfdir}/cron.daily fi # IPMI_IS_ENABLED, so enable services, but only if Red Hat if [ -f /etc/redhat-release ]; then if [ -x /bin/systemctl ]; then touch ${scr_dir}/ipmi_port.service elif [ -x /sbin/chkconfig ]; then /sbin/chkconfig --add ipmi_port /sbin/chkconfig --add ipmi_info # /sbin/chkconfig --add ipmiutil_wdt # /sbin/chkconfig --add ipmiutil_evt fi fi # Capture a snapshot of IPMI sensor data once now for later reuse. sensorout=$vardir/sensor_out.txt if [ ! -f $sensorout ]; then %{_bindir}/ipmiutil sensor -q >$sensorout || : if [ $? -ne 0 ]; then # remove file if error, try again in ipmi_port on reboot. rm -f $sensorout fi fi fi else # postinstall, doing rpm update IPMIret=0 %{_bindir}/ipmiutil sel -v >/dev/null 2>&1 || IPMIret=1 if [ $IPMIret -eq 0 ]; then if [ -d %{_sysconfdir}/cron.daily ]; then cp -f %{_datadir}/%{name}/checksel %{_sysconfdir}/cron.daily fi fi fi %if 0%{?fedora} >= 18 %systemd_post ipmiutil_evt.service %systemd_post ipmiutil_asy.service %systemd_post ipmiutil_wdt.service %systemd_post ipmi_port.service %endif %preun # before uninstall, $1 = 1 if rpm -U, $1 = 0 if rpm -e if [ "$1" = "0" ] then %if 0%{?req_systemd} %service_del_preun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service %else if [ -x /bin/systemctl ]; then if [ -f %{unit_dir}/ipmiutil_evt.service ]; then %if 0%{?fedora} >= 18 %systemd_preun ipmiutil_evt.service %systemd_preun ipmiutil_asy.service %systemd_preun ipmiutil_wdt.service %systemd_preun ipmi_port.service %else systemctl disable ipmi_port.service >/dev/null 2>&1 || : systemctl disable ipmiutil_evt.service >/dev/null 2>&1 || : systemctl disable ipmiutil_asy.service >/dev/null 2>&1 || : systemctl disable ipmiutil_wdt.service >/dev/null 2>&1 || : systemctl stop ipmiutil_evt.service >/dev/null 2>&1 || : systemctl stop ipmiutil_asy.service >/dev/null 2>&1 || : systemctl stop ipmiutil_wdt.service >/dev/null 2>&1 || : systemctl stop ipmi_port.service >/dev/null 2>&1 || : %endif fi else if [ -x /sbin/service ]; then /sbin/service ipmi_port stop >/dev/null 2>&1 || : /sbin/service ipmiutil_wdt stop >/dev/null 2>&1 || : /sbin/service ipmiutil_asy stop >/dev/null 2>&1 || : /sbin/service ipmiutil_evt stop >/dev/null 2>&1 || : fi if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --del ipmi_port >/dev/null 2>&1 || : /sbin/chkconfig --del ipmiutil_wdt >/dev/null 2>&1 || : /sbin/chkconfig --del ipmiutil_asy >/dev/null 2>&1 || : /sbin/chkconfig --del ipmiutil_evt >/dev/null 2>&1 || : fi fi %endif if [ -f %{_sysconfdir}/cron.daily/checksel ]; then rm -f %{_sysconfdir}/cron.daily/checksel fi fi %postun # after uninstall, $1 = 1 if update, $1 = 0 if rpm -e /sbin/ldconfig %if 0%{?req_systemd} %service_del_postun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service %else if [ -x /bin/systemctl ]; then %if 0%{?fedora} >= 18 %systemd_postun_with_restart ipmi_port.service %else systemctl daemon-reload || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall systemctl try-restart ipmi_port.service || : fi %endif if [ -f %{unit_dir}/ipmiutil_evt.service ]; then rm -f %{unit_dir}/ipmiutil_evt.service 2>/dev/null || : rm -f %{unit_dir}/ipmiutil_asy.service 2>/dev/null || : rm -f %{unit_dir}/ipmiutil_wdt.service 2>/dev/null || : rm -f %{unit_dir}/ipmi_port.service 2>/dev/null || : fi else if [ -f %{init_dir}/ipmiutil_evt.service ]; then rm -f %{init_dir}/ipmiutil_wdt 2>/dev/null || : rm -f %{init_dir}/ipmiutil_asy 2>/dev/null || : rm -f %{init_dir}/ipmiutil_evt 2>/dev/null || : rm -f %{init_dir}/ipmi_port 2>/dev/null || : fi fi %endif %changelog * Mon Jun 29 2015 Andrew Cress 2.9.7-1 - move libipmiutil.so from devel into ipmiutil base package (RH#1177213) * Mon Nov 03 2014 Andrew Cress 2.9.5-1 - separate libipmiutil.a into ipmiutil-static package * Thu Aug 28 2014 Andrew Cress 2.9.4-1 - Updated to ipmiutil-2.9.4 * Tue Aug 21 2012 Andrew Cress 2.8.5-2 Added F18 systemd macros for RH bug #850163 * Fri May 04 2012 Andrew Cress 2.8.4-1 Fixups for devel rpm (RH bug #818910) * Tue Apr 24 2012 Andrew Cress 2.8.3-1 Use service_* macros if req_systemd is set * Thu Mar 08 2012 Andrew Cress 2.8.2-1 reworked systemd logic/macros, moved ipmiutil from sbindir to bindir * Mon Dec 12 2011 Andrew Cress 2.8.0-1 added devel package files * Fri Nov 11 2011 Andrew Cress 2.7.9-3 fix RH bug #752319 to not copy checksel to cron.daily if IPMI not enabled * Tue Sep 13 2011 Andrew Cress 2.7.8-1 added systemd scripts, added idelloem.8 * Mon Jun 06 2011 Andrew Cress 2.7.7-1 add gcc,gcc-c++ to BuildRequires to detect broken build systems * Mon May 09 2011 Andrew Cress 2.7.6-1 updated ipmiutil * Fri Nov 12 2010 Andrew Cress 2.7.3-1 updated package description * Fri Oct 15 2010 Andrew Cress 2.7.1-1 skip chkconfig --add if not Red Hat * Mon Sep 27 2010 Andrew Cress 2.7.0-1 added fwum, hpm, sunoem, ekanalyzer man pages * Mon Jul 19 2010 Andrew Cress 2.6.8-1 cleaned up two more rpmlint issues * Mon Jul 12 2010 Andrew Cress 2.6.7-1 cleaned up some rpmlint issues, include ipmiutil_evt in chkconfig's * Thu Apr 29 2010 Andrew Cress 2.6.4-1 cleaned up some style issues * Fri Mar 5 2010 Andrew Cress 2.6.1-1 cleaned up some style issues * Tue Feb 16 2010 Andrew Cress 2.6.0-1 cleaned up some script clutter, changed naming scheme for sub-commands * Tue Jan 26 2010 Andrew Cress 2.5.3-1 cleaned up some rpmlint issues, removed bmclanaol.mib * Mon Nov 9 2009 Andrew Cress 2.5.1-1 do not gzip man files, clean up scripts, move distro specifics to configure * Tue Jun 23 2009 Andrew Cress 2.4.0-1 moved all progs to sbin, install init/cron scripts via files not post * Wed Dec 10 2008 Andrew Cress 2.3.2-1 changes for Fedora with ipmiutil-2.3.2 * Fri Jun 08 2007 Andrew Cress rpmlint tweaks for ipmiutil-1.9.8 * Mon May 21 2007 Andrew Cress added isroot flag for chroot cases * Fri May 18 2007 Andrew Cress added ipmi_port init handling * Mon Jul 10 2006 Andrew Cress changed to libfreeipmi.so.2, include and run ipmi_if.sh * Tue Aug 02 2005 Andrew Cress changed not to run pefconfig if already configured * Thu Feb 03 2005 Andrew Cress changed /usr/man to /usr/share/man, fixed postun to recognize rpm -U via arg 1 * Mon Nov 1 2004 Andrew Cress added freeipmi install files and logic * Mon Aug 23 2004 Andrew Cress - added MIB links to /usr/share/snmp/mibs * Tue Aug 10 2004 Andrew Cress - added icmd utility to the rpm * Thu Aug 05 2004 Andrew Cress - added special logic for SuSE snmpd.conf * Fri Apr 02 2004 Andrew Cress - added checksel cron job * Tue Jan 28 2003 Andrew Cress - added sensor & fruconfig for ipmiutil 1.2.8 * Fri Aug 2 2002 Andrew Cress - fixed bug 793 (dont need Require:ipmidrvr) for ipmiutil 1.2.2 * Tue Jul 2 2002 Andrew Cress - fixed bug 555 in showsel for ipmiutil 1.2.1 * Fri May 10 2002 Andrew Cress - fixed bug 504 in pefconfig for ipmiutil 1.1.5 * Thu Apr 11 2002 Andrew Cress - updated pathnames for ipmiutil 1.1.4, some cleanup * Mon Mar 18 2002 Andrew Cress - updated for 1.1.3-2, added checking for grub vs. lilo to .spec * Tue Mar 12 2002 Andrew Cress - updated for 1.1.3, added source rpm, changed license, etc. * Thu Jan 31 2002 Andrew Cress - updated for 1.1.0-2, changed selpef to pefconfig * Fri Jan 25 2002 Andrew Cress - updated for 1.1.0, changed to ipmidrvr rather than isc dependency * Wed Jan 16 2002 Andrew Cress - updated for 1.1.0, added hwreset utility * Fri Dec 14 2001 Andrew Cress - updated for 1.0.0, man page updates * Mon Nov 19 2001 Andrew Cress - updated for 0.9.0, uses new OSS bmc_panic, so don't install module. * Tue Nov 13 2001 Andrew Cress - updated for 0.8.5, add "Requires: isc" (#32), hide selpef output (#38) * Thu Nov 8 2001 Andrew Cress - updated for 0.8.4, eliminate "file exists" messages by fixing removal * Thu Oct 25 2001 Andrew Cress - updated for 0.8.2, run selpef (objdump:applypatch gives bogus warning) * Thu Oct 25 2001 Andrew Cress - updated for 0.8.2, run selpef (objdump:applypatch gives bogus warning) * Wed Oct 24 2001 Andrew Cress - created ipmiutil package 0.8.1 without kbuild * Tue Oct 23 2001 Andrew Cress - created ipmiutil package 0.8.0 ipmiutil-3.0.7/doc/iserial.80000644000076400007640000002323013160502144015353 0ustar acressloggers.TH ISERIAL 8 "Version 2.2: 17 Feb 2010" .SH NAME ipmiutil_serial \- configure a system for Serial/EMP management functions, such as Terminal Mode, and optionally share the port with the Serial Console. .SH SYNOPSIS .B "ipmiutil serial [-bcdeflq#rsvxB -m0 -m1 -n ser_chan -u user -p passwd -NUPREFJTVY]" .SH DESCRIPTION .I ipmiutil serial is a program that uses an IPMI driver to send IPMI commands which configure a system to enable EMP/serial Terminal Mode management functions within the firmware, so that an administrator can use command-line character commands via the serial port to power cycle the system and perform other functions, even if the system is not running an OS. This level of access needs to be protected by a username/password login, which can be specified with this utility. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-b" Set up and enable the Serial Port EMP parameters for Basic Mode management functions. This does not set a username or password. .IP "-c" Configure and enable the Serial Port EMP parameters for Terminal Mode management functions, shared with BIOS Console Redirection. Setting a new username and password for serial access via \-u and \-p is recommended for security. .IP "-d" Disable the serial port access for IPMI commands. The serial port is then only available for BIOS console and OS functions. A side-effect of this option is that it sets the default user (1) back to admin access. .IP "-e" Enable EMP Terminal Mode without shared BIOS console. The serial port is then only available for EMP Terminal Mode functions. .IP "-f" Specifies the Flow Control for the Serial EMP. 0 means no flow control, and 1 means RTS/CTS flow control (default). This must match the BIOS Serial Console setting. .IP "-l" Show LAN Parameters. This option reads and displays the LAN Parameter configuration also. .IP "-m0" Switch the Serial Port MUX to Baseboard/BIOS Console operation. Set no other configuration parameters. .IP "-m1" Switch the Serial Port MUX to Terminal Mode management. Set no other configuration parameters. .IP "-n ser_chan" Sets the IPMI channel number to use for the EMP serial channel (often 4). Note that the IPMI channels for LAN, Serial, etc. are numbered differently on each platform type. The default is to detect the first available IPMI serial channel. .IP "-#" Same as \-q below. .IP "-q" Specify an alternate user number for the EMP Username from the \-u option. This is normally user number 2, 3, or 4, where 3 is the default. The maximum number of users is 15. .IP "-r" Read Only. This option just reads the Serial Parameter configuration without writing any values. .IP "-s" Set up and enable the Serial Port EMP parameters for Shared operation between Basic Mode management functions and Baseboard (BIOS) Remote Console. This option switches the Serial Port MUX to Baseboard Console operation. .IP "-t" Configure and enable the Serial Port EMP parameters for Terminal Mode management functions, shared with BIOS Console Redirection. Same as \-c, but easier to remember. .IP "-u username" This specifies a username for the EMP Terminal Mode login. It can be any string, up to 15 characters. If \-u is not used, the default user 1 (null) will be assumed. The username, if specified, will be set for user 3, unless option \-q is specified. .IP "-p password" This specifies a password for the EMP Terminal Mode login. It can be any string, up to 15 characters. A null password is used if none is specified. This password applies to user 3 if \-u is used, to user 1 otherwise. .IP "-v priv" Set a specific access priVilege for this user, where priv can be: 1=Callback, 2=User, 3=Operator, 4=Admin, 5=OEM, 15=NoAccess The default if not specified or specified in error, is to use 4=Admin. .IP "-x" Causes extra debug messages to be displayed. .IP "-B" Set the Baud rate of the serial port to one of the following: 9600, 19,2K, 38.4K, 57.6K, or 115.2K. The default is 19.2K bps. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH EXAMPLES .IP "ipmiutil serial -t (or -c)" Enables Terminal Mode management functions, shared with BIOS Serial Console redirection. The user can switch between serial console operations and IPMI Terminal Mode commands by typing ESC ')' and ESC 'Q'. .IP "ipmiutil serial -s" Enables Basic Mode management functions shared with BIOS Serial Console redirection. The user can switch between serial console operations and IPMI Basic Mode management programs on the same serial port. .IP "ipmiutil serial -d" Disables the serial port management functions. This would be used if only the BIOS Serial Console were used and no BMC serial management functions. .P How to login to a Terminal Mode console: .br ESC ( (switch to Terminal mode) .br [SYS PWD \-N ] (login for default user, null psw) .br [SYS PWD \-U ROOT \-N PASSWORD] (syntax example for user 3) .br [SYS 000157 ACTIVATE] (activate advanced commands) .br [SYS HEALTH QUERY] .br [SYS HELP] .br [SYS PWD] (logoff) .br ESC Q (switch to BIOS console) .br See IPMI 1.5 Spec, Appendix E, and Intel TIGPR2U TPS for more information. .SH DEPENDENCIES The ipmiutil serial utility is intended to configure the EMP serial port on the server for shared access between BMC/IPMI functions and BIOS Console Redirection. Some platforms only support only Basic Mode for BMC/IPMI functions. Basic Mode requires a remote client application to utilize it (Windows ISC Console/DPC, or a special modified Linux telnet). There are some platforms which implement Terminal Mode via IPMI v1.5 Appendix E to make remote management with character commands available on the serial port without a special remote client application. For example, Intel TSRLT2 systems would use "ipmiutil serial \-s" for Basic Mode shared functions, but Intel TIGPR2U systems could use "ipmiutil serial \-c" to configure Terminal Mode functions. On your system, run "ipmiutil serial \-r" to check whether Serial Param(29): "Terminal Mode Config" is supported. If not, configure Basic Mode via "ipmiutil serial \-s". .SH "PLATFORM SERIAL PORT CONFIGURATION EXAMPLES" First, enter BIOS Setup for Serial Console Redirection parameters: (these vary by platform) .br Console Redirection = Serial Port B .br ACPI Redirection = Disabled .br Baud Rate = 115.2K .br Flow Control = CTS/RTS .br Terminal Type = VT100 .br Legacy Redirection = Enabled .br Note that the Baud Rate can vary, but it must match in all locations where it is used (BIOS, IPMI, and Linux). .br For some non-Intel platforms, the serial console would be COM1 instead of COM2, but should be enabled in BIOS. .br From Linux, run "ipmiutil serial \-c" for Terminal Mode shared configuration. .br Or, on older Intel TSRLT2 platforms: From Linux, run "ipmiutil serial \-s" for Basic Mode Shared configuration. .SH "LINUX CONFIGURATION FOR SERIAL CONSOLE" If using lilo, in /etc/lilo.conf, add .br append="console=ttyS1,19200n8 console=tty0" .br (and comment out the "message=" line because it includes graphics) .br Note that the append line can be placed in the global section and removed from each kernel section if there are no other differences. .PP Or, if using grub, edit /boot/grub/grub.conf as follows: .br #Omit the splashimage or gfxmenu .br # splashimage=(hd0,0)/grub/splash.xpm.gz .br #The serial and terminal lines are not usually needed .br # serial \-\-unit=1 \-\-speed=19200 \-\-word=8 \-\-parity=no \-\-stop=1 .br # terminal \-\-timeout=10 serial console .br #Add the console=ttyS* parameter to the kernel line .br kernel (hd0,0) /vmlinuz root=/dev/sda2 console=ttyS1,19200n8 .PP Add this line to /etc/initab, if ttyS1 is not already there: .br co:2345:respawn:/sbin/agetty ttyS1 19200 vt100 .PP Add this line to /etc/securetty, if ttyS1 is not already there: .br ttyS1 .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/isunoem.80000644000076400007640000001002313160502144015376 0ustar acressloggers.TH ISUNOEM 8 "Version 1.0: 09 Sep 2010" .SH NAME ipmiutil_sunoem \- OEM commands for Sun servers .SH SYNOPSIS .B "ipmiutil sunoem [-mx -NPRUEFJTVY] commands" .SH DESCRIPTION .I ipmiutil sunoem commands is a program that uses Sun OEM IPMI commands to perform platform-specific functions. .SH OPTIONS .IP "-m 002000" Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH COMMANDS .TP \fIled\fP .RS These commands provide a way to get and set the status of LEDs on a Sun Microsystems server. Use 'sdr list generic' to get a list of devices that are controllable LEDs. The \fIledtype\fP parameter is optional and not necessary to provide on the command line unless it is required by hardware. .TP \fIget\fP \fBsensorid\fR [\fBledtype\fR] Get status of a particular LED described by a Generic Device Locator record in the SDR. A sensorid of \fIall\fP will get the status of all available LEDS. .TP \fIset\fP \fBsensorid\fR \fBledmode\fR [\fBledtype\fR] Set status of a particular LED described by a Generic Device Locator record in the SDR. A sensorid of \fIall\fP will set the status of all available LEDS to the specified \fIledmode\fP and \fIledtype\fP. .TP LED Mode is required for set operations: .br \fIOFF\fP Off .br \fION\fP Steady On .br \fISTANDBY\fP 100ms on 2900ms off blink rate .br \fISLOW\fP 1HZ blink rate .br \fIFAST\fP 4HZ blink rate .TP LED Type is optional: .br \fIOK2RM\fP Ok to Remove .br \fISERVICE\fP Service Required .br \fIACT\fP Activity .br \fILOCATE\fP Locate .RE .TP \fIfan\fP \fIspeed\fP 0-100 Set system fan speed (PWM duty cycle). .RS .TP \fIsshkey\fP .RS .TP \fIset\fP \fBuserid\fR \fBkeyfile\fR This command will allow you to specify an SSH key to use for a particular user on the Service Processor. This key will be used for CLI logins to the SP and not for IPMI sessions. View available users and their userids with the 'user list' command. .TP \fIdel\fP \fBuserid\fR This command will delete the SSH key for a specified userid. .RE .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/bmclanpet.mib0000644000076400007640000007020713160502144016276 0ustar acressloggers--/************************************************************************ --* * --* Copyright (c) 1998-2004 Intel Corporation. All Rights Reserved. * --* * --* Redistribution and use in source and binary forms, with or without * --* modification, are permitted provided that the following conditions * --* are met: * --* * --* a.. Redistributions of source code must retain the above copyright * --* notice, this list of conditions and the following disclaimer. * --* b.. Redistributions in binary form must reproduce the above * --* copyright notice, this list of conditions and the following * --* disclaimer in the documentation and/or other materials provided * --* with the distribution. * --* c.. Neither the name of Intel Corporation nor the names of its * --* contributors may be used to endorse or promote products derived * --* from this software without specific prior written permission. * --* * --* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * --* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * --* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * --* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * --* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * --* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * --* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * --* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * --* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * --* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * --* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * --* DAMAGE. * --* * --************************************************************************* --* Name : PetEvents.mib --* Description : MIB file for PET events --* Created : Wesdnesday, December 17, 2003 --* Author : Intel Corporation --* --* $History:$ --* --* Date : March 7th,2002 --* Changed by : --* Change Description : Updated MIB file --* --* Date : December 17th,2003 --* Changed by : --* Change Description : Started with ASF MIB file --* --*************************************************************************/ PET-EVENTS DEFINITIONS ::= BEGIN IMPORTS enterprises FROM RFC1155-SMI OBJECT-TYPE FROM RFC-1212 TRAP-TYPE FROM RFC-1215 DisplayString FROM RFC1213-MIB; wiredformgmt OBJECT IDENTIFIER ::= { enterprises 3183 } pet OBJECT IDENTIFIER ::= { wiredformgmt 1 } -- MODULE IDENTIFICATION -- -- PET Events Alerting MODULE-IDENTITY -- LAST-UPDATED "February 4, 2004" -- ORGANIZATION "Intel Corporation" -- CONTACT-INFO -- " PET Events, -- Intel Corporation, DP3-407 -- DuPont, WA 98352" -- DESCRIPTION -- "This is the MIB file for SNMPv1.0 based PET traps" -- **************************************** -- SYSTEM INFORMATION BRANCH STARTS HERE. -- **************************************** petevts OBJECT IDENTIFIER ::= { pet 1 } -- ********************************************** -- * Temperature * -- ********************************************** -- Lower Non Critical threshold crossed trapUnderTemperatureWarning TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Under-Temperature Warning (Lower non-critical, going low)" --#TYPE "Temperature Event" --#SUMMARY "Under-Temperature Warning (Lower non-critical, going low)" --#ARGUMENTS {} --#SEVERITY WARNING ::= 65792 -- Lower Critical threshold crossed trapUnderTemperatureCritical TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Under-Temperature Problem (Lower Critical - going low)" --#TYPE "Temperature Event" --#SUMMARY "Critical Under-Temperature Problem (Lower Critical - going low)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 65794 -- Upper Non Critical threshold crossed trapOverTemperatureWarning TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Over-Temperature Warning (Upper non-critical, going high)" --#TYPE "Temperature Event" --#SUMMARY "Over-Temperature Warning (Upper non-critical, going high)" --#ARGUMENTS {} --#SEVERITY WARNING ::= 65799 -- Upper Critical threshold crossed trapOverTemperatureCritical TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Over-Temperature Problem (Upper Critical - going high)" --#TYPE "Temperature Event" --#SUMMARY "Critical Over-Temperature Problem (Upper Critical - going high)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 65801 -- Back to Normal from Lower Non Critical trapUnderTemperatureWarningCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Under-Temperature Warning Cleared" --#TYPE "Temperature Event" --#SUMMARY "Under-Temperature Warning Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 65920 -- Back to Normal from Lower Critical trapUnderTemperatureCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Under-Temperature Problem Cleared" --#TYPE "Temperature Event" --#SUMMARY "Under-Temperature Problem Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 65922 -- Back to Normal from Upper Non Critical trapOverTemperatureWarningCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Over-Temperature warning Cleared" --#TYPE "Temperature Event" --#SUMMARY "Over-Temperature Warning Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 65927 -- Back to Normal from Upper Critical trapOverTemperatureCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Over-Temperature Problem Cleared" --#TYPE "Temperature Event" --#SUMMARY "Over-Temperature Problem Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 65929 -- Generic critical temperature problem trapGenericCriticalTemperature TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Generic Critical Temperature Problem (Transition to Critical from less severe)" --#TYPE "Temperature Event" --#SUMMARY "Generic Critical Temperature Problem (Transition to Critical from less severe)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 67330 -- Generic temperature warning trapGenericTemperatureWarning TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Generic Temperature Warning (Transition to Warning from less severe)" --#TYPE "Temperature Event" --#SUMMARY "Generic Temperature Warning (Transition to Warning from less severe)" --#ARGUMENTS {} --#SEVERITY WARNING ::= 67331 -- ********************************************** -- * Voltage * -- ********************************************** -- (Analog voltage) Lower Non Critical threshold crossed trapUnderAnalogVoltageWarning TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Under-Voltage Warning (Lower Non Critical - going low)" --#TYPE "Voltage Event" --#SUMMARY "Under-Voltage Warning (Lower Non Critical - going low)" --#ARGUMENTS {} --#SEVERITY WARNING ::= 131328 -- (Analog voltage) Lower Critical threshold crossed trapUnderAnalogVoltageCritical TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Under-Voltage Problem (Lower Critical - going low)" --#TYPE "Voltage Event" --#SUMMARY "Critical Under-Voltage Problem (Lower Critical - going low)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 131330 -- (Analog voltage) Upper Non Critical threshold crossed trapOverAnalogVoltageWarning TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Over-Voltage Warning (Upper Non Critical - going high)" --#TYPE "Voltage Event" --#SUMMARY "Over-Voltage Warning (Upper Non Critical - going high)" --#ARGUMENTS {} --#SEVERITY WARNING ::= 131335 -- (Analog voltage) Upper Critical threshold crossed trapOverAnalogVoltageCritical TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Over-Voltage Problem (Upper Critical - going high)" --#TYPE "Voltage Event" --#SUMMARY "Critical Over-Voltage Problem (Upper Critical - going high)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 131337 -- (Analog voltage) Voltage back to OK from Lower Non Critical trapUnderAnalogVoltageWarningCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Under-Voltage Warning Cleared" --#TYPE "Voltage Event" --#SUMMARY "Under-Voltage Warning Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 131456 -- (Analog voltage) Voltage back to OK from Lower Non Critical trapUnderAnalogVoltageCriticalCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Under-Voltage Problem Cleared" --#TYPE "Voltage Event" --#SUMMARY "Under-Voltage Problem Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 131458 -- (Analog voltage) Voltage back to OK from Upper Non Critical Warning trapOverAnalogVoltageWarningCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Over-Voltage Warning Cleared" --#TYPE "Voltage Event" --#SUMMARY "Over-Voltage Warning Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 131463 -- (Analog voltage) Voltage back to OK from Upper Critical trapOverAnalogVoltageCriticalCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Over-Voltage Problem Cleared" --#TYPE "Voltage Event" --#SUMMARY "Over-Voltage Problem Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 131465 -- (Discrete voltage) Critical voltage problem trapGenericCriticalDiscreteVoltageCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Generic Critical Voltage Problem Cleared" --#TYPE "Voltage Event" --#SUMMARY "Generic Critical Voltage Problem Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 131840 -- (Discrete voltage) Critical voltage problem trapGenericCriticalDiscreteVoltage TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Generic Critical Voltage Problem (Transition to Critical from less severe)" --#TYPE "Voltage Event" --#SUMMARY "Generic Critical Voltage Problem (Transition to Critical from less severe)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 131841 -- (Discrete voltage) Critical voltage problem trapGenericCriticalDiscreteVoltage2 TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Generic Critical Voltage Problem (Transition to Critical from less severe)" --#TYPE "Voltage Event" --#SUMMARY "Generic Critical Voltage Problem (Transition to Critical from less severe)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 132866 -- (Discrete voltage) Non-Critical voltage problem trapGenericDiscreteVoltageWarning TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Generic Voltage Warning (Transition to Non-Critical from less severe)" --#TYPE "Voltage Event" --#SUMMARY "Generic Voltage Warning (Transition to Non-Critical from less severe)" --#ARGUMENTS {} --#SEVERITY WARNING ::= 132867 -- ********************************************** -- * Fan * -- ********************************************** -- Lower Non Critical threshold crossed trapFanUnderSpeedWarning TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Fan speed warning (Fan speed below expected speed)" --#TYPE "Fan Event" --#SUMMARY "Fan speed Warning (Fan speed below expected speed)" --#ARGUMENTS {} --#SEVERITY WARNING ::= 262400 -- Fan Lower Critical threshold crossed trapFanCriticalUnderSpeed TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Generic Critical Fan Failure (Transition to Critical from less severe)" --#TYPE "Fan Event" --#SUMMARY "Critical Fan Failure (Transition to Critical from less severe)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 262402 -- Fan back to OK from warning level trapFanUnderSpeedWarningCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Fan speed Warning Cleared" --#TYPE "Fan Event" --#SUMMARY "Fan speed Warning Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 262528 -- Fan back to OK from critical level trapFanCriticalUnderSpeedCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Fan Failure Cleared" --#TYPE "Fan Event" --#SUMMARY "Critical Fan Failure Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 262530 -- Fan Full Redundancy trapFanFullRedundancy TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Fan redundancy has returned to Normal" --#TYPE "Fan Event" --#SUMMARY "Fan redundancy has returned to Normal" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 264960 -- Fan Redundancy lost trapFanRedundancyLost TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Fan Redundancy has been Lost" --#TYPE "Fan Event" --#SUMMARY "Fan Redundancy has been Lost" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 264961 -- Fan Redundancy degraded trapFanRedundancyDegraded TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Fan Redundancy is in a degraded state" --#TYPE "Fan Event" --#SUMMARY "Fan Redundancy is in a degraded state" --#ARGUMENTS {} --#SEVERITY WARNING ::= 264962 -- ********************************************** -- * Power Supply * -- ********************************************** -- Power Supply Full Redundancy trapPowerSupplyFullRedundancy TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Supply Redundancy Has Returned to Normal" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply Redundancy Has Returned to Normal" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 527104 -- Power Supply Redundancy lost trapPowerSupplyRedundancyLost TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Supply Redundancy has been Lost" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply Redundancy has been Lost" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 527105 -- Power Supply Redundancy degraded trapPowerSupplyRedundancyDegraded TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Supply Redundancy is in a degraded state" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply Redundancy is in a degraded state" --#ARGUMENTS {} --#SEVERITY WARNING ::= 527106 -- Power Supply presence detected trapPowerSupplyPresenceDeteced TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Supply Inserted" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply Inserted" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 552704 trapPowerSupplyFailureDetected TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power supply Failure detected" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply failure detected" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 552705 trapPowerSupplyWarning TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power supply Warning" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply Warning" --#ARGUMENTS {} --#SEVERITY WARNING ::= 552706 -- AC Lost trapPowerSupplyACLost TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Supply AC Lost" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply AC Lost" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 552707 -- Power Supply removed trapPowerSupplyPresenceRemoved TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Supply Removed" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply Removed" --#ARGUMENTS {} --#SEVERITY WARNING ::= 552832 -- Back to normal from failure trapPowerSupplyFailureCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Supply Failure Cleared" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply Failure Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 552833 -- Predictive Failure cleared trapPowerSupplyWarningCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Supply Warning Cleared" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply Warning Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 552834 -- AC Back trapPowerSupplyACBack TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Supply AC Restored" --#TYPE "Power Supply Event" --#SUMMARY "Power Supply AC Restored" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 552835 -- Power Unit Redundancy OK trapPowerUnitRedundancyOk TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Unit Redundancy has been restored" --#TYPE "Power Supply Event" --#SUMMARY "Power Unit Redundancy has been restored" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 592640 -- Power Unit Redundancy lost trapPowerUnitRedundancyLost TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Power Unit Redundancy has been Lost" --#TYPE "Power Supply Event" --#SUMMARY "Power Unit Redundancy has been Lost" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 592641 -- ********************************************** -- * Processor * -- ********************************************** -- Processor internal error trapProcessorInternalError TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Internal Error" --#TYPE "Processor Event" --#SUMMARY "Processor Internal Error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 487168 -- Processor Thermal Trip trapProcessorThermalTrip TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Thermal Trip (Over Temperature Shutdown)" --#TYPE "Processor Event" --#SUMMARY "Processor Thermal Trip (Over Temperature Shutdown)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 487169 -- Processor Fault Resilient Booting (FRB) 1 / Built-in self test (BIST) Error trapProcessorBistError TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Fault Resilient Booting (FRB) 1 / BIST (Built In Self Test) Failure" --#TYPE "Processor Event" --#SUMMARY "Processor Fault Resilient Booting (FRB) 1 / Processor BIST (Built In Self Test) Failure" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 487170 -- Processor Fault Resilient Booting (FRB) 2 / Hang in Power On Self Test (POST) trapProcessorFRB2Failure TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Fault Resilient Booting (FRB) 2 / Hang in Power On Self Test (POST) Failure" --#TYPE "Processor Event" --#SUMMARY "Processor Fault Resilient Booting (FRB) 2 / Hang in Power On Self Test (POST) Failure" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 487171 -- Processor Fault Resilient Booting (FRB) 3 / Processor Setup / Initialization Failure trapProcessorFRB3Failure TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Fault Resilient Booting (FRB) 3 / Processor Setup / Initialization Failure" --#TYPE "Processor Event" --#SUMMARY "Processor Fault Resilient Booting (FRB) 3 / Processor Setup / Initialization Failure" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 487172 -- Processor config error trapProcessorConfigError TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Configuration Error" --#TYPE "Processor Event" --#SUMMARY "Processor Configuration Error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 487173 -- Processor throttle. trapProcessorThrottle TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Throttled (Processor Speed Reduced)" --#TYPE "Processor Event" --#SUMMARY "Processor Throttled (Processor Speed Reduced)" --#ARGUMENTS {} --#SEVERITY WARNING ::= 487178 -- Processor internal error cleared trapProcessorInternalErrorCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Internal Error Cleared" --#TYPE "Processor Event" --#SUMMARY "Processor Internal Error Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 487296 -- Processor Back to normal from Thermal Trip trapProcessorThermalTripCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Thermal Trip (Over Temperature Shutdown) Cleared" --#TYPE "Processor Event" --#SUMMARY "Processor Thermal Trip (Over Temperature Shutdown) Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 487297 -- Processor BIST Error cleared trapProcessorBistErrorCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor BIST (Built In Self Test) Failure Cleared" --#TYPE "Processor Event" --#SUMMARY "Processor BIST (Built In Self Test) Failure Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 487298 -- Processor config error cleared trapProcessorConfigErrorCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Configuration Error Cleared" --#TYPE "Processor Event" --#SUMMARY "Processor Configuration Error Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 487301 -- Processor return to normal from throttled trapProcessorThrottleCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Processor Throttle Cleared (Normal Processor Speed)" --#TYPE "Processor Event" --#SUMMARY "Processor Throttle Cleared (Normal Processor Speed)" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 487306 -- ********************************************** -- * Memory * -- ********************************************** trapMemoryUncorrectableECC TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Uncorrectable ECC or other uncorrectable memory error" --#TYPE "Memory Event" --#SUMMARY "Uncorrectable ECC or other uncorrectable memory error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 814849 --********************** --* Chassis Intrusion * --********************** -- Chassis Intrusion trapChassisIntrusion TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Chassis Intrusion - Physical Security Violation" --#TYPE "Chassis Intrusion Event" --#SUMMARY "Chassis Intrusion - Physical Security Violation" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 356096 -- Chassis Intrusion cleared trapChassisIntrusionCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Chassis Intrusion (Physical Security Violation) Event Cleared" --#TYPE "Chassis Intrusion Event" --#SUMMARY "Chassis Intrusion( Physical Security Violation) Event Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 356224 -- ********************************************** -- * Critical Interrupts * -- ********************************************** -- Critical Interrupt, Bus timeout error trapCriticalInterruptBusTimeout TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Interrupt, Bus Timeout error" --#TYPE "Critical Interrupts Event" --#SUMMARY "Critical Interrupt, Bus Timeout error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 1273601 -- Critical Interrupt, IO Channel Non-Maskable Interrupt trapCriticalInterruptIOChannelNMI TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Interrupt, IO Channel check NMI error" --#TYPE "Critical Interrupts Event" --#SUMMARY "Critical Interrupt, IO Channel check NMI error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 1273602 -- Critical Interrupt, Software Non-Maskable Interrupt error trapCriticalInterruptSoftwareNMI TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Interrupt, software NMI error" --#TYPE "Critical Interrupts Event" --#SUMMARY "Critical Interrupt, software NMI error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 1273603 -- Non special-cycle parity errors trapCriticalInterruptPCIPERR TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Interrupt, PCI PERR parity error" --#TYPE "Critical Interrupts Event" --#SUMMARY "Critical Interrupt, PCI PERR parity error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 1273604 -- Special-cycle parity errors trapCriticalInterruptPCISERR TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Interrupt, PCI SERR parity error" --#TYPE "Critical Interrupts Event" --#SUMMARY "Critical Interrupt, PCI SERR parity error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 1273605 -- Bus uncorrectable error trapCriticalInterruptBusUncorrect TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Interrupt, Bus Uncorrectable error" --#TYPE "Critical Interrupts Event" --#SUMMARY "Critical Interrupt, Bus Uncorrectable error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 1273608 -- Fatal non-maskable interrupt (NMI) trapCriticalInterruptFatalNMI TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Critical Interrupt, Fatal NMI error" --#TYPE "Critical Interrupts Event" --#SUMMARY "Critical Interrupt, Fatal NMI error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 1273609 -- ********************************************** -- * System Firmware Progress * -- ********************************************** -- Power On Self Test (POST) code error trapBIOSPOSTCodeError TRAP-TYPE ENTERPRISE petevts DESCRIPTION "System Firmware Progress: BIOS POST code error" --#TYPE "System Firmware Progress Event" --#SUMMARY "System Firmware Progress: BIOS POST code error" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 1011456 -- ********************************************** -- * WatchDog * -- ********************************************** -- Watchdog reset event trapWatchdogReset TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Watchdog Reset" --#TYPE "Watchdog Event" --#SUMMARY "Watchdog Reset" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 2322177 -- Watchdog power down event trapWatchdogPowerDown TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Watchdog Power Down" --#TYPE "Watchdog Event" --#SUMMARY "Watchdog Power Down" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 2322178 -- Watchdog power cycle event trapWatchdogPowerCycle TRAP-TYPE ENTERPRISE petevts DESCRIPTION "Watchdog Power Cycle" --#TYPE "Watchdog Event" --#SUMMARY "Watchdog Power cycle" --#ARGUMENTS {} --#SEVERITY WARNING ::= 2322179 -- ********************************************** -- * System Event Log * -- ********************************************** -- System Event Log Cleared trapSystemEventLogCleared TRAP-TYPE ENTERPRISE petevts DESCRIPTION "System Event Log (SEL) Cleared" --#TYPE "System Event Log" --#SUMMARY "System Event Log (SEL) Cleared" --#ARGUMENTS {} --#SEVERITY INFORMATIONAL ::= 1076994 -- System Event Log Full trapSystemEventLogFull TRAP-TYPE ENTERPRISE petevts DESCRIPTION "System Event Log (SEL) Full (Logging Disabled)" --#TYPE "System Event Log" --#SUMMARY "System Event Log (SEL) Full (Logging Disabled)" --#ARGUMENTS {} --#SEVERITY CRITICAL ::= 1076995 -- ********************************************** -- * System * -- ********************************************** -- System boot event trapSystemBootEvent TRAP-TYPE ENTERPRISE petevts DESCRIPTION "System Boot Event" --#TYPE "System Event" --#SUMMARY "System Boot Event" --#ARGUMENTS {} --#SEVERITY WARNING ::= 1208065 -- ********************************************** -- * Linux Panic, Critical Stop * -- ********************************************** -- Linux panic event trapOSCriticalStop TRAP-TYPE ENTERPRISE petevts DESCRIPTION "OS Critical Stop occurred" --#TYPE "System Event" --#SUMMARY "System Boot Event" --#ARGUMENTS {} --#SEVERITY WARNING ::= 2125569 END ipmiutil-3.0.7/doc/UserGuide0000644000076400007640000077532013160502164015471 0ustar acressloggers IPMIUTIL USER GUIDE VERSION 3.0.7 An easy-to-use IPMI server management utility ------------------------ CONTENTS ------------------------ 1.0 Overview 1.1 Features 2.0 Dependencies 2.1 Configuration 2.2 References 3.0 Utility Man Pages 3.1 IPMIUTIL (ipmiutil) 3.2 IALARMS (ipmiutil alarms) 3.3 ICMD (ipmiutil cmd) 3.4 ICONFIG (ipmiutil config) 3.5 IDISCOVER (ipmiutil discover) 3.6 IEVENTS (ipmiutil events) 3.7 IFRU (ipmiutil fru) 3.8 IGETEVENT (ipmiutil getevt) 3.9 IHEALTH (ipmiutil health) 3.10 ILAN (ipmiutil lan) 3.11 IRESET (ipmiutil reset) 3.12 ISEL (ipmiutil sel) 3.13 ISENSOR (ipmiutil sensor) 3.14 ISERIAL (ipmiutil serial) 3.15 ISOL (ipmiutil sol) 3.16 IWDT (ipmiutil wdt) 3.17 IFRUSET (ifruset) 3.18 IPMI_PORT (ipmi_port) 3.19 IPICMG (ipmiutil picmg) 3.20 IFIREWALL (ipmiutil ifirewall) 3.21 IFWUM (ipmiutil fwum) 3.22 IHPM (ipmiutil hpm) 3.23 ISUNOEM (ipmiutil sunoem) 3.24 IEKANALYZER (ipmiutil ekanalyzer, deprecated) 3.25 ITSOL (ipmiutil tsol) 3.26 IDELLOEM (ipmiutil delloem) 3.27 IDCMI (ipmiutil dcmi) 3.28 ISMCOEM (ipmiutil smcoem) 3.29 ISELTIME (iseltime) 3.30 IUSER (ipmiutil user) 4.0 Use Cases 4.1 Usage of IPMI utilities for sensor thresholds 4.2 Usage to configure a system for IPMI LAN 4.3 Usage of IPMI utilities for Automated IPMI LAN configuration 4.4 Usage of IPMI utilities to Set Watchdog timer 4.5 Usage of kernel panic handler code 4.6 Interpreting BMC LAN SNMP Traps from Platform Events 4.7 Interpreting newer PECI sensors for CPU Thermal Margin 4.8 How to configure a system for IPMI Serial-Over-LAN Console 4.9 Using ipmiutil Library APIs for custom programs 4.10 How to configure a system for SNMP Traps via IPMI PEF rules 5.0 IPMI Utilities on Windows 5.1 Windows Install Instructions 5.2 Windows Build Instructions 5.3 Windows Command Usage 6.0 Sample output 7.0 Problems 7.1 Error Return Codes 7.2 IPMI Completion Codes 8.0 Building IPMI Utilities 8.1 Building ipmiutil on Linux 8.2 Building ipmiutil on Windows 8.3 Building ipmiutil on Solaris 8.4 Building ipmiutil on FreeBSD 8.5 Building ipmiutil on ARM (Android) 9.0 IPMIUtil Library APIs 10.0 Related Information 9.1 History 9.2 Links ------------------------ 1.0 OVERVIEW ------------------------ The IPMI Specification provides a standard way to do both simple and complex server management functions. Everything from remote reset/power-off to sending an SNMP alert from a sensor event even if the OS is down. Being able to perform these tasks in Baseboard Management Controller (BMC) firmware allows OS-independent management. What many integrators need, however, is a set of utilities and/or sample code to perform these functions within their enterprise management subsystem without a learning curve. The IPMI Management Utilities project provides a series of utilities that perform common IPMI server management functions, such as viewing the firmware log, or configuring the BMC LAN & PEF features. The utilities are designed for end-users, so that they should not require intimate knowledge of how to build IPMI commands. Each of the utilities detects or reasonably assigns default values so that a working configuration can be easily obtained. More detailed options allow changes to these default values. These utilities can be used separately, or merged with a larger server management subsystem. The source license is BSD and ipmiutil compiles under Linux (Makefile) and Windows (buildwin.cmd). There are also corresponding SA Forum HPI standard utilities that run with two different HPI implementations, including OpenHPI. These were the basis of the current openhpi/clients. This project includes both IPMI utilities and a kernel patch for panic handler enhancements. See the project web site for binaries and documentation at http://ipmiutil.sourceforge.net. The ipmiutil IPMI utilities below allow the user to access the firmware System Event Log and configure the Platform Event Filter table for the new 'OS Critical Stop' records, as well as other common IPMI system management functions. ipmiutil - a meta-command to invoke all of the below as sub-commands ievents - a standalone utility to interpret IPMI and PET event data isel - show/set the firmware System Event Log records isensor - show Sensor Data Records, sensor readings, and thresholds ireset - cause the BMC to hard reset or power down the system ilan - show and configure the BMC LAN port and Platform Event Filter table to allow BMC LAN alerts from firmware events and OS Critical Stop messages, iserial - show and configure the BMC Serial port for various modes, such as Terminal Mode. ifru - show the FRU chassis, board, and product inventory data, and optionally write a FRU asset tag. ialarms - show and set front panel alarms (LEDs and relays) iwdt - show and set watchdog timer parameters igetevent - receive any IPMI events and display them ihealth - check and report the basic health of the IPMI BMC iconfig - list/save/restore the BMC configuration parameters icmd - send specific IPMI commands to the BMC, mainly for testing and debug purposes. idiscover - discover the available IPMI LAN nodes on a subnet isol - start/stop an IPMI Serial-Over-LAN Console session ipicmg - show/set the IPMI PICMG parameters ifirewall - show/set the IPMI firmware firewall configuration iekanalyzer - run FRU-EKeying analyzer on FRU files ifwum - OEM firmware update manager extensions ihpm - HPM firmware update manager extensions isunoem - Sun OEM functions idelloem - Dell OEM functions itsol - Tyan SOL console start/stop session idcmi - get/set DCMI parameters, if supporting the DCMI spec Other supporting files: checksel = cron script using ipmiutil sel to check the SEL, write new events to the OS system log, and clear the SEL if nearly full. ipmi_port = daemon to bind the RMCP port and sleep to prevent Linux portmap from stealing the RMCP port ipmi_port.sh = init script to reserve the RMCP port from portmap, this also restores saved sensor thresholds, if any. ipmiutil_wdt = init script to restart watchdog timer every 60 sec via cron ipmiutil_asy = init script runs 'ipmiutil getevt -a' for remote shutdown ipmiutil_evt = init script runs 'ipmiutil getevt -s' for monitoring events evt.sh = sample script which can be invoked by ipmiutil_evt ipmi_if.sh = script using dmidecode to determine the IPMI Interface Type bmclanpet.mib = SNMP MIB for BMC LAN Platform Event Traps test/* = scripts and utilities used in testing ipmiutil/panicsel kern/* = kernel patches for panic handling The kernel panic handler patch (kern/bmcpanic.patch) adds additional features to the Linux Panic Handler so that more information can be saved and passed along if a Linux panic condition occurs. bmc_panic features: 1. Write an OS Critical Stop event to firmware System Event Log (SEL) This is in bmcpanic.patch, in OpenIPMI and in Intel IMB. 2. Send SNMP trap via BMC LAN Alerting mechanism Accomplished by configuring the BMC with 'ipmiutil lan'. 3. Turn on the Critical Alarm LED on the Telco Alarms Panel This is in bmcpanic.patch, but not in OpenIPMI due to platform-specific issues with the alarms panel. The kernel portion of this, except item 3, is now included in the OpenIPMI project with the CONFIG_IPMI_PANIC_EVENT option, and the OpenIPMI driver has merged into Linux kernel 2.4.21 and beyond. The latest version of the OpenIPMI driver can be obtained from http://openipmi.sourceforge.net. This patch is also included in the Intel IMB IPMI driver v28 and greater, for any Linux kernel. This Intel IMB IPMI driver can be obtained from http://downloadcenter.intel.com/Product_Search.aspx?Prod_nm=imbsrc or a copy is cached on http://ipmiutil.sf.net also. ------------------------ 1.1 FEATURES ------------------------ These are the key strengths, user features and functions that are supported by ipmiutil. Key Strengths = supports any IPMI server platforms, top-down user-friendly IPMI functions, detection, portability, incorporates fixes and new features quickly Target Market = Administrators, Developers, and OEMs OS Support = Linux, Windows, Solaris, FreeBSD, and MacOSX (supports Windows natively for local or remote interface) License = BSD Drivers = For Linux: openipmi, imb, valinux ipmikcs, lan, lanplus, landesk, and driverless direct KCS or SSIF For Windows: Intel IMB and Microsoft IPMI drivers For Solaris: bmc For FreeBSD: openipmi, driverless KCS or SSIF For MacOSX: remote only LEDs = Show/set ATCA LEDs, set identify LED, Intel Telco Alarm LEDs health = show overall health and product information discovery = find all IPMI LAN servers on a given subnet fru = Display all FRU and SPD inventory data, also Set some FRU product fields (asset tag, serial number) sensor = Show SDRs and sensor readings, also set sensor thresholds getevent = Receive any IPMI events and decode them, The IPMI event monitoring service is automated in Linux via the ipmiutil_evt init script. reset = IPMI local and remote reset/power-control, IPMI boot device selection. remote IPMI = Perform an OS shutdown/restart request via IPMI LAN, soft-shutdown using ipmiutil getevt -a and invoking ipmiutil reset -o. This async bridge service is automated in Linux via the ipmiutil_asy init script. cmd = Execute raw IPMI commands locally or remotely lan = Show/set IPMI LAN and PEF configuration parameters, adds more PEF rules, or can add a custom PEF rule serial = Show/set IPMI serial configuration parameters sel = Show decoded System Event Log records, clear SEL, see the checksel cron script to automate SEL management. sol console = Start/stop an SOL console session watchdog = Show, set, and reset the IPMI watchdog timer and its actions, The watchdog timer service can be automated in Linux via the ipmiutil_wdt init script. save/restore = save and restore all BMC configuration parameters ievents = Standalone app to decode IPMI or PET event data, especially useful at the management station for interpreting IPMI PET SNMP traps. See also SNMP PET MIB (bmclanpet.mib). picmg = Support IPMI PICMG functions firewall = Support IPMI firmware firewall functions Through various services, ipmiutil allows automatic management of common IPMI tasks: ipmi_port = Automatically prevent Linux port mapper from stealing the RMCP port 623 used by IPMI LAN firmware. checksel = a cron script to daily write new SEL records to syslog, and clear the SEL if nearly full. ipmiutil_asy = A Linux init script using the ipmiutil getevt -a service to enable receiving soft-shutdown requests from ipmiutil reset -o ipmiutil_wdt = A Linux init script to reset the watchdog timer every 60 sec. ipmiutil_evt = A Linux init script using the ipmiutil getevt -s service to monitor IPMI events, log them, and optionally run a script. ------------------------ 2.0 DEPENDENCIES ------------------------ The IPMI Utilities will run on Linux, Windows Solaris, or FreeBSD, and should be portable to other OSs, if an IPMI driver for that OS can be obtained. The IPMI Utilities and Panic Handler Enhancements currently work with platforms that support the IPMI standard. If the platform does not support IPMI, these changes are inert. The Service Availability Forum has developed a Hardware Platform Interface (HPI) specification that can be used to group IPMI and other system management interfaces together. A set of comparable HPI utilities is included in the ipmiutil project source as hpiutil/*. The Panic Handler kernel enhancements (via kern/bmcpanic.patch) are now included in the Intel IMB driver v28 and later, and in the OpenIPMI driver via the CONFIG_IPMI_PANIC_EVENT and CONFIG_IPMI_PANIC_STRING parameters in the kernel config file (/usr/src/linux/.config) with kernels 2.4.21 or greater. If run locally, the ipmiutil utilities must be run as superuser/Administrator and an IPMI driver must be used. For Linux, these IPMI drivers are supported: . the MontaVista OpenIPMI driver (/dev/ipmi0), . the Intel IMB IPMI driver (/dev/imb, via 'ipmidrvr' or 'ipmi_imb'), . the valinux IPMI Driver (/dev/ipmikcs), . the LANDesk ldipmi daemon, . or direct user-space I/Os to the IPMI KCS or SSIF/SMBus interfaces, if no other driver is detected. For Windows, these drivers are supported: . the Intel IMB IPMI driver (imbdrv.sys) for any Windows Server OS, . the Microsoft IPMI driver (ipmidrv.sys) for Win2003R2 or Win2008. For Solaris, these drivers are supported: . the Sun bmc driver (/dev/bmc) for Solaris 10 and greater For FreeBSD, these drivers are supported: . the FreeBSD 7.x OpenIPMI driver port (kldload ipmi, /dev/ipmi0) . direct user-space I/Os to the IPMI KCS or SSIF/SMBus interfaces Each of the IPMI management utilities will detect which IPMI driver is present, and in Linux, if none are found, it will attempt to use direct KCS or SSIF I/Os to communicate with the IPMI BMC. If using the IPMI LAN interface, neither the local or remote system requires any IPMI driver, but the remote target system must have had IPMI LAN enabled, (e.g. via ipmiutil lan) which is done locally on the target system. Note that the IPMI LAN session password is sent with either MD5 or MD2 encryption by default. See http://openipmi.sourceforge.net for the OpenIPMI driver. See http://downloadcenter.intel.com/Product_Search.aspx?Prod_nm=imbsrc for Intel IMB driver See http://cvs.sf.net/cgi-bin/viewcvs.cgi/ipmitools/ipmitools/kernel/kcs/patches/2.4.x/ for the valinux driver. See http://www.landesk.com/ or the CD supplied with your server for LANDesk. List of companies that have adopted IPMI (over 198): http://www.intel.com/design/servers/ipmi/adopterlist.htm Example IPMI Server Platforms tested with ipmiutil, by BMC manufacturer: Intel RackMount Servers (various, both 32-bit and 64-bit) Intel ATCA (MPCMM0001 and MPBL00xx) Kontron CRMS servers and KTC5520 Dell PowerEdge 18xx, 19xx, 2800 SuperMicro with AOC-IPMI20 (by LMC) SuperMicro with AOC-SIMSO (by Peppercon) Sun (product id 0x4701) Tyan (product id 0x14e9) NSC (product id 0x4311, National SemiConductor) NEC (product id 0x024b) Tatung TS-2552 (product id 0x09f8) AMI IPMI MegaRAC ------------------------ 2.1 CONFIGURATION ------------------------ To find the base address of the IPMI KCS interface, or to find the IPMI SSIF/SMBus slave address, you can use the 'dmidecode' utility provided with most Linux distributions. See also http://www.nongnu.org/dmidecode. The ipmi_if.sh script can determine the IPMI Interface Type, and the resulting /usr/share/ipmiutil/ipmi_if.txt file can be edited if needed. The ipmiutil binary uses the same mechanism to detect the IPMI KCS or SSIF interface parameters by default if no driver is loaded. For some IPMI systems, a minimum firmware version may be needed to support the BMC LAN/PEF feature. On an Intel TSRLT2 system, for instance, these are the minimum levels: BMC Firmware ver 54 or greater Systems with IPMI versions prior to 1.5 do not support BMC LAN or PEF features By default, the ipmiutil IPMI utilities rpm does not set the panic timeout. If a different kernel panic timeout is desired, add the kernel parameter "panic=10" in grub.conf/lilo.conf, or do "echo 10 >/proc/sys/kernel/panic" in one of the /etc/init.d scripts to set it to 10 seconds, for instance. The ipmiutil lan (ilan) utility can be used to configure the BMC LAN Alerting while the OS is running. It has additional PEF rules and LAN parameter detection logic beyond what most other utilities provide. The ipmiutil serial (iserial) utility is intended to configure the EMP serial port on the server for shared access between BMC/IPMI functions and BIOS Console Redirection. Some older platforms only support only Basic Mode for BMC/IPMI functions. Basic Mode requires a remote client application to utilize it (Windows ISC Console/DPC applet, or a special modified Linux telnet). There are many platforms which implement Terminal Mode via IPMI v1.5 Appendix E to make remote management with character commands available on the serial port without a special remote client application. Notes about BMC Users: Most IPMI 1.5 systems support at least 3 users, numbered 1,2,3, where user 1 is the default and has a null username. Users 2 and 3 are alternate users whose usernames can be set. For ipmiutil, these are currently implemented by default as follows: user 1: used by default for BMC LAN and Serial (ilan & iserial) user 2: set for BMC LAN if ipmiutil lan -u is specified user 3: set for BMC Serial/EMP if ipmiutil serial -u is specified Also note that the -q option can be used to set different users by number. Note that the checksel script will be copied to /etc/cron.daily when the Linux ipmiutil rpm is installed, so that ipmiutil sel will automatically save SEL records to syslog and clear the SEL if it gets nearly full. If you do not want this to happen automatically, remove the checksel script from the /etc/cron.daily directory. In order for the ipmiutil sel -w function to work cleanly on a Windows system, the showselmsg.dll should be copied to %SystemRoot%\system32, and the showsel.reg should be run to set up the corresponding EventLog service registry values. See install.cmd to perform these functions. The BSD License in the COPYING file applies to all source files herein, except for * util/md5.c (Aladdin unrestricted license, compatible with BSD) * util/md2.h (GPL) * util/ipmi_ioctls.h (GPL) While the BSD License allows code reuse in both open and non-open applications, the md2.h and ipmi_ioctls.h files would have to be removed if used in a non-open application. The default ipmiutil build omits GPL code. There is a ALLOW_GPL compile flag for this that is disabled by default, but can be enabled for open-source by running "./configure --enable-gpl". See the INSTALL file for build instructions for various configurations. ------------------------ 2.2 REFERENCES ------------------------ The IPMI 1.5 spec, Table 36-3 defines the sensor types for SEL records, as used by ipmiutil sel. The IPMI 1.5 spec, Table 15-2 defines the Platform Event Filter table entries, as used by ipmiutil lan. The IPMI 1.5 spec, Table 19-4 defines the LAN Configuration Parameters, as used by ipmiutil lan. The IPMI 2.0 spec, Section 15 defines the Serial-Over-LAN functionality. The enterprises.3183 SNMP traps come from the BMC firmware, and are defined in bmclan*.mib files in the ipmiutil project. Details about the format of these Platform Event Traps are available in section 12.2 through 12.5 of the ISM (Intel Server Management) 5.x Technical Product Specification at http://www.intel.com/support/motherboards/server/isc/sb/cs-008024.htm The enterprises.343 SNMP traps come from ISM or SNMPSA and are defined in basebrd*.mib or mapbase*.mib files on the platform CD. The enterprises.412 SNMP traps come from ISM/DMTF, defined in dmtf*.mib files on the platform CD. ------------------------ 3.0 UTILITY MAN PAGES ------------------------ -------------------------------------- 3.1 IPMIUTIL (ipmiutil) IPMIUTIL(8) IPMIUTIL(8) NAME ipmiutil - a meta-command to invoke various IPMI functions. SYNOPSIS ipmiutil [-x -NUPREFJTVY] [other command options] DESCRIPTION This utility performs various IPMI functions. Each of the individual commands in the ipmiutil project can be invoked via this meta-command. The is one of the following: alarms show/set the front panel alarm LEDs and relays leds show/set the front panel alarm LEDs and relays cmd send a specified raw IPMI command to the BMC config list/save/restore BMC configuration parameters dcmi get/set DCMI parameters discover discover all IPMI servers on this LAN ekanalyzer run FRU-EKeying analyzer on FRU files (deprecated, see fru) events decode IPMI events and display them firewall show/set firmware firewall functions fru show decoded FRU inventory data, write asset tag fwum OEM firmware update manager extensions getevt get IPMI events and display them, event daemon getevent get IPMI events and display them, event daemon health check and show the basic health of the IPMI BMC hpm HPM firmware update manager extensions lan show/set IPMI LAN parameters and PEF table picmg show/set picmg extended functions reset cause the BMC to reset or power down the system sel show/clear firmware System Event Log records sensor show Sensor Data Records, readings, thresholds serial show/set IPMI Serial & Terminal Mode parameters sol start/stop an SOL console session smcoem SuperMicro OEM functions sunoem Sun OEM functions delloem Dell OEM functions tsol Tyan SOL console start/stop session wdt show/set/reset the watchdog timer For help on each command (e.g. ’sel’), enter: ipmiutil sel -? For man pages on each command, its man page is named "i", or refer to SEE ALSO below. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N is used. OPTIONS Command options are described in the man page for each command. Below are a few of the common options. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. EXAMPLES ipmiutil sel Shows the IPMI System Event Log entries. ipmiutil wdt Shows the watchdog timer values. SEE ALSO ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifirewall(8) ifru(8) ifruset(8) ifwum(8) igetevent(8) ihealth(8) ihpm(8) ilan(8) ipicmg(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) isunoem(8) iwdt(8) ipmiutil(8) ipmi_port(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.2 IALARMS (ipmiutil alarms) IALARMS(8) IALARMS(8) NAME ipmiutil_alarms - display and set alarm indicators SYNOPSIS ipmiutil alarms [-abcdimnoprx -N node -U user -P/-R pswd -EFJTVY] DESCRIPTION ipmiutil alarms is a program that uses IPMI commands to display and set alarm indicators, which are usually LEDs on the system chassis front panel. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. Note that a LAN user must have Administrative privileges to read or write the alarm LEDs. Note that this utility may not be the only logic setting alarm states. The BMC firmware, system management software, or cluster fault manager may also want to set alarm states. Intel provides a Telco Alarms Man- ager API which presents a consolidated interface for all alarm manage- ment applications. OPTIONS Command line options are described below. -r Read-only. Show the alarms status, but do not set any states. This is also the default mode if no parameters are specified. -iN Sets the Chassis Identify feature, which can be an LED or some other alarm. If N=0, turn off the Chassis ID, otherwise turn the ID on for N seconds. N=255 will turn on the ID indefi- nitely, if it is IPMI 2.0. -aN Sets Disk A Fault LED. If N=0, turn it off. If N=1, turn it on. Used only for TIGPT1U platform. -bN Sets Disk B Fault LED. If N=0, turn it off. If N=1, turn it on. Used only for TIGPT1U platform. -dXN Sets Disk X Fault LED, where X=0-6. If N=0, turn it off. If N=1, turn it on. Used only for NSC2U platform. -cN Sets the Critical Alarm. If N=0, turn it off. If N=1, turn it on. -mN Sets the Major Alarm. If N=0, turn it off. If N=1, turn it on. -nN Sets the Minor Alarm. If N=0, turn it off. If N=1, turn it on. -pN Sets the Power Alarm. If N=0, turn it off. If N=1, turn it on. Note that the Power LED is also wired to the System Fault LED in the back of the system, so this state may be off for Power, but the LED could be lit for a System Fault reason instead. Refer to the system Technical Product Specification for System Faults. -o Sets all alarms off, including the Chassis ID. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use this IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use this IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ipmiutil(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.3 ICMD (ipmiutil cmd) ICMD(8) ICMD(8) NAME ipmiutil_cmd - a tool to send specific IPMI commands via the command line. SYNOPSIS ipmiutil cmd [-qsx -NUPREFJTVY] bus rsSa netFn/lun cmd [data bytes] DESCRIPTION This ipmiutil cmd tool sends specific IPMI commands to the firmware. The commands are composed as hex values on the command line. This tool was written to allow in-band use to match the DOS CMDTOOL.EXE or IPMI- TOOL.EXE program which is distributed with many Intel servers. Certain scripts or pre-written commands may have been supplied for the DOS tool that can now be used while the system is running Linux or Windows. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. This tool should only be used if you are familiar with the IPMI 1.5 specification, or you have specific pre-written commands to send. OPTIONS Command line options are described below. -q Quiet mode. Show only minimal header information. -s Skips the GetDeviceID command -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. PARAMETERS The following parameters are used by icmd. Each is represented as a two-digit hex byte. The parameters have no default values. bus This byte contains the bus number for this command, usually 00. rsSa This is the resource slave address, usually 0x20 for the BMC. netFn/lun This byte combines the net Function and Lun. The 2 low-order bits are the Lun and the 6 high-order bits are the net Function. This representation is consistent with the DOS CMDTOOL/IPMITOOL. cmd This byte contains the IPMI command. [data bytes] This is a sequence of zero to 16 bytes that represent data bytes specific to this command. EXAMPLES icmd 00 20 18 01 Sends the GetDevice ID command to the BMC. icmd 00 20 28 43 00 00 ff ff 00 ff Sends a Get SEL entry command for the last entry in the firmware log. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.4 ICONFIG (ipmiutil config) ICONFIG(8) ICONFIG(8) NAME ipmiutil_config - list, save, and restore BMC configuration parameters SYNOPSIS ipmiutil config [-lpxLNUPREFJTVY] [-r file] [-s file] DESCRIPTION ipmiutil config is a program that uses an IPMI driver to send IPMI com- mands which list, save and restore BMC configuration parameters for LAN, Serial, PEF, SOL, User, Channel. This combines the functionality of ipmiutil lan (ilan) and ipmiutil serial (iserial). Note that some of the LAN parameters cannot be restored remotely over the IPMI LAN, changing the configuration that is in use. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -l Lists BMC configuration parameters with a keyword, index, and its hex values. This is the default behavior if no options are specified. -r config_file Restores BMC configuration from config_file, which was produced with -s below. -s config_file Saves BMC configuration to config_file. This file could be edited, in certain cases, such as to vary the BMC IP address (LanParam 3), or to use the UserPassword records. Note that lines beginning with ’#’ are comments and are ignored. For editing UserPassword records, convert your text value to hex format; for example "echo ’mypassword’ |od -t x1", and leave off the trailing 0a. -x Causes extra debug messages to be displayed. -p password_to_set This specifies the firmware password to set for BMC LAN access for all users during the restore. If not specified, the pass- word configuration will not be changed, unless a valid UserPass- word record is present in the file to be restored. Note that user passwords are write-only via standard IPMI commands. -L lan_ch_num This specifies the IPMI LAN channel number used for BMC LAN. This varies by platform, and can be found in the platform tech- nical specifications. By default, bmcconfig scans all IPMI channels to find a LAN channel for BMC LAN. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ipmiutil(8) ialarms(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.5 IDISCOVER (ipmiutil discover) IDISCOVER(8) IDISCOVER(8) NAME ipmiutil_discover - discover IPMI LAN-enabled nodes SYNOPSIS idiscover [-abegisx] DESCRIPTION idiscover is a program that uses IPMI LAN commands to discover any nodes on the LAN that are available, by probing the RMCP port (623.) on those nodes. This utility uses IPMI LAN, so no IPMI drivers are needed. There are three methods that can be used: -a = broadcast RMCP ping method (default) -g = GetChannelAuthCap command method else = specific RMCP ping method A beginning IP address can be specified with -b for broadcast and spe- cific methods. An ending IP can be specified for non-broadcast methods. OPTIONS Command line options are described below. -a All nodes, use the broadcast ping method. This is the default if no options are specified. This will detect the first enabled ethernet interface, and defaults to the broadcast address x.x.x.255 (where x.x.x.x is IP address) unless -b is used to specify otherwise. -b Beginning IP address, required, unless using broadcast with defaults. This could be a specific IP address, or a broadcast address, ending in 255, if the broadcast method (-a) is used. -e Endign IP address of the range. Not used for broadcast method. If this is not specified, a range of one IP address matching the beginning IP is assumed. -g Use the GetChannelAuthenticationCapabilities command method over IPMI LAN instead of the RMCP ping. Not compatible with broad- cast. This may be useful if the vendor BMC does not support RMCP ping for some reason. -i eth0 The interface name to use when sending the probes. The default is to detect the first enabled ethernet interface (e.g. eth0). -m shows MAC address. Uses the broadcast ping method, but uses a raw socket so that the MAC address can be displayed. This detects the first enabled ethernet interface, and defaults to the broadcast address 255.255.255.255 like -a. Using -m with raw sockets requires root privilege. -r N Repeat the ping N times to each node. Default is to send 1 ping per node. -x Causes extra debug messages to be displayed. EXAMPLES idiscover -a -b 192.168.1.255 Sends a broadcast RMCP ping to discover IPMI LAN nodes on the specified subnet. idiscover -b 192.168.1.100 -e 192.168.1.254 Sends RMCP pings to a range of IP addresses. idiscover -g -b 192.168.1.100 -e 192.168.1.254 Sends GetChannelAuthCap commands to a range of IP addresses. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.6 IEVENTS (ipmiutil events) IEVENTS(8) IEVENTS(8) NAME ievents - decode IPMI and PET event data SYNOPSIS ievents [-bfhnprsx] 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 DESCRIPTION ievents is a standalone utility delivered with ipmiutil, used to inter- pret raw hex data from IPMI events or from IPMI PET SNMP trap varbind data. This utility uses the same interpretation logic as is used by "ipmiutil sel" (showsel) and "ipmiutil getevt" (getevents). The data bytes in the input are always assumed to be in hex form. This could be useful if a utility other than "ipmiutil sel" were used to obtain IPMI SEL records or events and interpretation is needed. This would also be needed at an enterprise management station to inter- pret the PET SNMP trap hex data into human-readable form, see option -p. OPTIONS -b bin_file Interpret a file containing raw binary/hex SEL data dumped in binary form, such as that produced by "ipmitool sel writeraw bin_file". Each set of 16 bytes in the file will be interpreted as an IPMI event. (same as -h) -f sel_file Interpret a file containing raw ascii text SEL data captured with ipmiutil sel -r, or some other similar utility. Each line in the file should be in this form, with no leading spaces: 04 00 02 76 a9 4a 47 20 00 04 10 09 6f 42 0f ff If this option is not specified, the default is to use the 16 bytes taken from the command-line arguments. (same as -r) -h bin_file Interpret a file containing raw binary/hex SEL data dumped in binary form, such as that produced by "ipmitool sel writeraw bin_file". Each set of 16 bytes in the file will be interpreted as an IPMI event. (same as -b) -n This option generates a New IPMI platform event, using 9 bytes of input. The input bytes are the same as the last 9 bytes of an IPMI event. -p Decode as PET event bytes, where the input is 34 PET hex data bytes, skipping the first 8 of the 47-byte PET data. The default without -p assumes that the input is a 16-byte IPMI event. -r sel_file Interpret a file containing raw ascii text SEL data captured with ipmiutil sel -r, or some other similar utility. (same as -f) -s sensor_file Sensor file with the output of "ipmiutil sensor", used to get the PET sensor_type from the sensor_num. The default is /usr/share/ipmiutil/sensor_out.txt as generated during the ipmiutil package installation. This is only needed with PET interpretation (-p). -x show eXtra debug messages SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.7 IFRU (ipmiutil fru) IFRU(8) IFRU(8) NAME ipmiutil_fru - show Field Replacable Unit configuration data SYNOPSIS ipmiutil fru [-abcdeikmsvx -N node -U user -P/-R pswd -EFJTVY] DESCRIPTION ipmiutil fru is a program that uses IPMI commands to show FRU configu- ration data and optionally write an asset tag string into the FRU data. Setting the asset tag is a function that can be used to uniquely iden- tify the unit, even if the storage devices are removed or changed. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -a asset_string This option specifies an asset tag string to be written to the baseboard FRU Product area. The asset tag length is limited by the existing FRU Product data, but is usually allowed up to 16 characters. The default is to not modify this FRU field. -b Only show the Baseboard FRU data. The default behavior is to also scan for any SDR FRU data or DIMM SPD data referenced by the SDRs. -c Show FRU output in a canonical format, with a default delimiter of '|'. -d file Dump binary FRU data to the specified file. -e Show Every FRU output in a bladed chassis, including those under child MCs. The default is to show FRUs referred to by just the target MC. -i 00 This option specifies a specific FRU ID to show. The input value should be in hex (0b, 1a, etc.), as shown from the sensor SDR output. By default, all FRU IDs that are specified in the FRU locator SDRs are shown. -k These Kontron OEM functions set FRU data based on existing data stored elsewhere. The setsn option sets the FRU Board and Prod- uct serial number, and the setmfgdate option sets the FRU Board Mfg DateTime. The nextboot option specifies the boot device for the next boot: BIOS, FDD, HDD, CDROM, or network. These options are only supported on Kontron ATCA boards which have this func- tionality. -m 002000 Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -s serial_num This option specifies a serial number string to be written to the baseboard FRU Product area. The serial number can be any string up to 16 characters. The default is to not modify this FRU field. -v prod_ver This option specifies a product version number string to be written to the baseboard FRU Product area. The version number can be any string up to 16 characters. The default is to not modify this FRU field. -x Causes eXtra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.8 IGETEVENT (ipmiutil getevt) IGETEVENT(8) IGETEVENT(8) NAME ipmiutil_getevt - wait for IPMI events SYNOPSIS ipmiutil getevt [-abosx -t secs -N node -U user -P/-R pswd -EFJTVY] DESCRIPTION ipmiutil getevt is a program that uses IPMI commands to wait for IPMI events sent from the BMC firmware. These events are also sent to the IPMI System Event Log (SEL). This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. Some server management functions want to trigger custom actions or alerts when IPMI hardware-related events occur, but do not want to track all events, just newly occurring events. This utility waits a specified timeout period for any events, and returns interpreted output for each event. It is designed as a scriptable command-line utility, but if the timeout is infinite (-t 0), then this code could be used for a sample service as well. There are several methods to do this which are implemented here. The SEL method: This method polls the SEL once a second, keeps track of the last SEL event read, and only new events are processed. This ensures that in a series of rapid events, all events are received in order, however, some transition-to-OK events may not be configured to write to the SEL on certain platforms. This method is used if getevent -s is specified. This is the only method supported over IPMI LAN, i.e. with -N. The ReadEventMessageBuffer method: This uses an IPMI Message Buffer in the BMC firmware to read each new event. This receives any event, but if two events occur nearly simul- taneously, only the most recent of the two will be returned with this method. An example of simultaneous events might be, if a fan stops/fails, both the non-critical and critical fan threshold events would occur at that time. This is the default method for getevent. The OpenIPMI custom method: Different IPMI drivers may have varying behavior. For instance, the OpenIPMI driver uses the IPMI GetMessage commands internally and does not allow client programs to use those commands. It has its own custom mechanism, see getevent_mv(). This method is used if the OpenIPMI driver is detected, and no other method is specified. The Async Event method: This only gets certain Asynchronous requests from the BMC to an SMS OS service, like a remote OS shutdown, and get_software_id. This method is disabled by default and only turned on if the getevent -a option is specified. This method is only supported via the Intel IMB and OpenIPMI driver interfaces. There is an init script provided with ipmiutil to automate the task of starting this async event daemon. # chkconfig --add ipmiutil_asy (skip this if no chkconfig) # /etc/init.d/ipmiutil_asy start This listens for IPMI LAN requests for soft-shutdown, and logs the out- put to /var/log/ipmiutil_asy.log OPTIONS Command line options are described below. -a Use the Async request method, which receives SMS OS requests from the BMC using the IMB or OpenIPMI driver interface. This services remote SMS bridge agent requests, like remote OS shut- down and get software_id. -b Run in Background as a daemon. If this option is specified, normal output will be redirected to /var/log/ipmiu- til_getevt.log. The default is to run in foreground. -c Show output in a canonical format, with a delimiter of '|'. -e N Wait for a specific event sensor type N. The parameter can be in hex (0x23) or decimal (35). The default is 0xFF which means wait for any event. -r F Run script file F when an event occurs. The filename can include a full path. The script will be passed the event description as a parameter. A sample evt.sh script is included with the ipmiutil package. -o Only run one pass to wait for the first event. Default is to loop for multiple events for the timeout period. -s Use the SEL method to get events. This polls the SEL once a second for new events. The last SEL record read is saved in /usr/share/ipmiutil/evt.idx. Otherwise, the default is to use the ReadEventMessageBuffer method to get new events. -t N Set the timeout period to N seconds. Default is 120 seconds. A timeout of 0 means an infinite period. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.9 IHEALTH (ipmiutil health) IHEALTH(8) IHEALTH(8) NAME ipmiutil_health- show IPMI health SYNOPSIS ipmiutil health [-ifhglmnopqsx -N node -U user -P/-R pswd -EFJTVY] DESCRIPTION ipmiutil health is a program that uses IPMI commands to show the health of the BMC. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -c Show canonical, delimited output. -f Show the FRUSDR version also. -g Show the IPMI GUID of this system. The GUID is a read-only unique identifier. -h Check the health of the HotSwap Controller also. -l Show the IPMI LAN channel statistics also. -m 002000 Target a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing charac- ter, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -n string Set the System Name to this string in the IPMI System Informa- tion. -o string Set the Primary Operating System to this string in the IPMI Sys- tem Information. -p 1 Set the chassis Power restore policy, governing the desired behavior when power was lost and is restored. Values: 0 = stay off, 1 = last state, 2 = always on. -q string Set the Secondary Operating System to this string in the IPMI System Information. -s Show the IPMI Session information also. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.10 ILAN (ipmiutil lan) ILAN(8) ILAN(8) NAME ipmiutil_lan - show and configure BMC LAN parameters and set up a PEF entry to send BMC LAN Alerts for OS Critical Stop log events SYNOPSIS ipmiutil lan [-abcdefghijklmnopq#rstuvwxyzBDQK -i eth1 ] [-I ipadr -M macadr -S subnet -B baud_sol ] [-G gwyip -H gwymac -L lan_channel_num ] [-A alertip -X alertmac -C community ] [-u user_to_set -p password_to_set ] [-N nodename -U username -Fimb ] [-P/-R rmt_node_pswd -EFJTVY ] DESCRIPTION ipmiutil lan shows or sets all of the IPMI LAN Parameters to enable remote LAN sessions or BMC LAN Alerts. The IP address and MAC address of the local system, the default gateway, and the alert destination can be defaulted to those specified in Linux, or can be overridden by user parameters. It also creates a new Platform Event Filter table entry for an OS Critical Stop (0x20) SEL firmware log event, so that it will be enabled to send a BMC LAN Alert. This utility will skip the PEF records if the system does not support IPMI 1.5 or greater. This util- ity can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user- space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. Note that without options, ipmiutil lan behaves as if option -r were used. To configure IPMI LAN & PEF, use option -e. -a alertnum Specify which PEF alert number is to be used. Default is 1. This would only be used if extra PEF alert destinations had been set. -b authmask Specify a certain authtype mask in hex to use when configuring this channel. The default mask is 0x16, so to include authtype None (bit 0), it would require entering ’-b 17’. -c Show Canonical output, which shows only interpreted text and streamlines the parameters shown, using a common delimiter. -d This option disables the IPMI LAN and PEF parameters, so as not to allow BMC LAN connections or alerts. This option also sets the IP address to zeros. -e This option enables the BMC LAN configuration and PEF event alerts. The utility will attempt to obtain the default BMC LAN parameters from the OS automatically, or they can be specified with command options below. -f Set the ARP control parameter to 1 = gratuituous ARPs, 2 = ARP responses, or 3 = both grat ARP and ARP responses. The default is 1. -g This specifies the secondary gateway IP address to use for the BMC LAN. The default is to omit this parameter and only use the default gateway. See also -G. -h Set the IPMI VLAN ID to this value. Setting to a value >=4096 disables the VLAN ID. The default behavior is not to set this parameter. -i ethif By default, the eth0 interface is used to find IP and MAC addresses. Sometimes, however, the first ethernet port on the baseboard may be represented by Linux as eth1 or eth2 instead. If so, use this option to indicate the correct ethernet inter- face to use. By default, ipmiutil lan will scan up to 32 eth interfaces for the onboard one that BMC LAN uses. -j This sets a custom PEF rule as the last PEF entry. The input is a series of 10 hex bytes, forming the PEF entry. For example, this sample PEF entry would perform a power down action if the Baseboard Temp reached its threshold. "ipmiutil lan -e -j020110ffff013001950a" -k This causes ipmiutil lan to also insert two rules to send alerts for transition-to-OK events, including Power Redundancy OK and Temperature OK. -l This option enables the BMC LAN configuration, but not PEF events. The utility will attempt to obtain the default BMC LAN parameters from the OS automatically, or they can be specified with command options below. -n num By default, the new PEF entry for OS Critical Stop is inserted at offset 12 into the table. This can be changed to insert it at an offset > 12 if another entry already exists at offset 12. -o Disable Only SOL. This could be used after the IPMI LAN was configured, to disable Serial-Over-LAN console access but still allow other IPMI LAN access. -p password_to_set This specifies the firmware password to set for BMC LAN access. If not specified, the user and password configuration will not be changed. -q Specify an alternate user number for the LAN username from the -u option. This is normally user number 2, 3, or 4, where 2 is the default. The maximum number of users is 15. Same as -# below. -# Specify an alternate user number for the LAN username from the -u option. Same as -q above. -r This option just reads the configuration without writing any BMC LAN parameters or writing any new entries to the PEF table. -s This option will also display some of the Serial parameters. -t Test if the BMC LAN has already been configured. Returns 0 if so. -u username_to_set This specifies the firmware username to set for BMC LAN access. If a username is specified, user 3 will be set. If not speci- fied, the default user 1 will be used. -v priv Set a specific access priVilege for this user, where priv can be: 1=Callback, 2=User, 3=Operator, 4=Admin, 5=OEM, 15=NoAccess The default if not specified or specified in error, is to use 4=Admin. -w N Set the Gratuitous ARP Interval to N seconds. This has no effect if the firmware does not support Grat-ARP, as shown in Lan Param 10. If not set, the interval remains at the firmware default. -x Causes extra debug messages to be displayed. -y N Set the OEM LAN Failover parameter to N. Values for N with Intel Romley/S2600 baseboards: 1 = enable, 0 = disable. Val- ues for N with SuperMicro baseboards: 2 = failover, 1 = lan1 , 0 = dedicated. -z Also show the IPMI LAN Statistics -A alert_ip_addr This specifies the SNMP Alert Destination IP address to use for the BMC LAN. By default, this utility will attempt to obtain this from the /etc/snmp/snmpd.conf file, via the trapsink param- eter. The alert destination will see the BMC LAN traps with the enterprises.3183.1.1 OID. If no alert IP address is specified in either snmpd.conf or this parameter, or if that IP address does not respond, the other SNMP parameters for BMC LAN will be skipped. -B baud_sol This specifies the Baud rate for SerialOverLan. The possible values are: 9600, 19.2k, 38.4k, 57.6k, and 115.2k. The default is 19.2k. -C snmp_community This specifies the SNMP Community name to use for BMC LAN Alerts. The default community string is "public". This parame- ter is ignored if there is no Alert IP address. -D This causes the local IP address to be determined by DHCP instead of a static IP address. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -G gwy_ip_addr This specifies the default gateway IP address to use for the BMC LAN. The default is to automatically obtain this from the Linux route table. -H gwy_mac_addr This specifies the default gateway MAC address to use for the BMC LAN. The format can be either 11:22:33:44:55:66 or 11-22-33-44-55-66. The default is to try to automatically obtain this by sending an arp request from an OS LAN eth inter- face: the default one, or as specified by -i. -K hostname This specifies the IPMI hostname to set, for Kontron servers only. This enables the firmware to properly map the IP address to a hostname, especially with the web interface. The default is not to set this parameter, and use IP address only. -I ip_addr This specifies the local IP address to use for the BMC LAN on eth0. The default is to automatically obtain this from the Linux ifconfig. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -L lan_ch_num This specifies the IPMI LAN channel number used for BMC LAN. This varies by platform, and can be found in the platform tech- nical specifications. For instance, Intel platforms usually use channels 1 & 2 for onboard NICs, and channel 3 for optional RMM NICs. By default, ipmiutil lan scans all IPMI channels to find the first LAN channel for BMC LAN. To just list all IPMI chan- nels to see what is available, use the string ’list’ instead of a LAN channel number. This will list the channels and exit. -M mac_addr This specifies the local MAC address to use for the BMC LAN on eth0. The format can be either 11:22:33:44:55:66 or 11-22-33-44-55-66. The default is to automatically obtain this from the Linux ifconfig. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P rmt_pswd Remote password for the nodename given. The default is a null password. Same as -R below. -Q Set the IPMI VLAN Priority. The default priority is 0. -R rmt_pswd Remote password for the nodename given. The default is a null password. Same as -P above. -S subnet This specifies the local subnet mask to use for the BMC LAN on eth0. The default is to automatically obtain this from the Linux ifconfig. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -U rmt_user Remote username for the nodename given. The default is a null username. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -X alert_mac_addr This specifies the SNMP Alert Destinations’s MAC address to use for the BMC LAN. The format can be either 11:22:33:44:55:66 or 11-22-33-44-55-66. The default is to attempt to obtain this from the Linux arp cache. This parameter is ignored if there is no Alert IP address. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. EXAMPLES To read existing settings: ipmiutil lan -r To enable IPMI LAN with default settings detected, assuming shared MAC/IP: ipmiutil lan -e To set up IPMI LAN for a unique IP address and set PEF SNMP Alerts: ipmiutil lan -e -I 192.168.1.1 -A 192.168.1.10 To set the IPMI LAN password for the default user: ipmiutil lan -e -p mypassword To disable access to the IPMI LAN channel: ipmiutil lan -d SAMPLE PEF TABLE These 11 PEF table entries are configured from the factory for various Intel Sahalee BMC systems, and will be applied as the defaults for a system with an empty PEF table: PEF(01): 01 Temperature Sensor event - enabled for alert 01 c0 01 01 00 ff ff 01 ff 01 95 0a 00 00 00 00 00 00 00 00 00 PEF(02): 02 Voltage Sensor event - enabled for alert 02 c0 01 01 00 ff ff 02 ff 01 95 0a 00 00 00 00 00 00 00 00 00 PEF(03): 04 Fan Failure event - enabled for alert 03 c0 01 01 00 ff ff 04 ff 01 95 0a 00 00 00 00 00 00 00 00 00 PEF(04): 05 Chassis Intrusion event - enabled for alert 04 c0 01 01 00 ff ff 05 05 6f 01 00 00 00 00 00 00 00 00 00 00 PEF(05): 08 Power Supply Fault event - enabled for alert 05 c0 01 01 00 ff ff 08 ff 6f 06 00 00 00 00 00 00 00 00 00 00 PEF(06): 0c Memory ECC Error event - enabled for alert 06 c0 01 01 00 ff ff 0c 08 6f 02 00 00 00 00 00 00 00 00 00 00 PEF(07): 0f FRB Failure event - enabled for alert 07 c0 01 01 00 ff ff 0f 06 6f 01 00 00 00 00 00 00 00 00 00 00 PEF(08): 07 BIOS POST Error event - enabled for alert 08 c0 01 01 00 ff ff 07 ff 6f 1c 00 00 00 00 00 00 00 00 00 00 PEF(09): 13 Fatal NMI event - enabled for alert 09 c0 01 01 00 ff ff 13 ff 6f 3e 03 00 00 00 00 00 00 00 00 00 PEF(10): 23 Watchdog Timer Reset event - enabled for alert 0a c0 01 01 00 ff ff 23 03 6f 0e 00 00 00 00 00 00 00 00 00 00 PEF(11): 12 System Restart event - enabled for alert 0b c0 01 01 00 ff ff 12 ff 6f 02 00 00 00 00 00 00 00 00 00 00 SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.11 IRESET (ipmiutil reset) IRESET(8) IRESET(8) NAME ipmiutil_reset - perform a hardware reset on the system SYNOPSIS ipmiutil reset [-bcdDefhijmnoprsuwxy -N node -U user -P/-R pswd -EFJTVY] DESCRIPTION ipmiutil reset is a program that uses IPMI commands to perform a hard- ware reset of the chassis, or boot to a specific device. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -c Power Cycle the system chassis -d Power Down the system chassis -n Send NMI to the system -u Power Up the system chassis -r Hard Reset the system chassis -D Do a soft shutdown of the OS, and then power down. Note that remote soft shutdown (-D -N) for Intel S5000 baseboard requires ipmiutil getevt -a running on the target server. -o Do a soft shutdown of the OS, and then reset. Note that remote soft shutdown (-o -N) for Intel S5000 baseboard requires ipmiu- til getevt -a running on the target server. -k Do a cold reset to restart the BMC firmware. -m 002000s Perform these function for a specific MC (e.g. bus 00, sa 20, lun 00). The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -b Do a hard reset and reboot to the BIOS Setup menu, for this reboot only. -e Do a hard reset to EFI, if IPMI EFI boot is enabled, for this reboot only. -f Do a hard reset to Floppy/Removable, for this reboot only. -h Do a hard reset to a Hard Disk, for this reboot only. -i Set the boot Initiator mailbox string, usually for PXE use. The string must be less than 78 characters. -j Set the IANA number used for the boot Initiator mailbox string. -p Do a hard reset and network boot to PXE server, for this reboot only. -s Do a hard reset and reboot to the Service/Diagnostic Partition, for this reboot only. Reboots to the default if no service par- tition is configured. -v Do a hard reset to DVD/CDROM Media, for this reboot only. -w Wait for BMC ready after a reset before exiting the utility. -x Causes extra debug messages to be displayed. -y Yes, try to persist any boot options used [-befhprsv]. This requires the IPMI firmware to ask the BIOS to change boot order settings, so it may not be supported by all BMC firmware ven- dors. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.12 ISEL (ipmiutil sel) ISEL(8) ISEL(8) NAME ipmiutil_sel - show firmware System Event Log records SYNOPSIS ipmiutil sel [-abcflswvx -N node -P/-R pswd -U user -EFJTVY] DESCRIPTION ipmiutil sel is a program that uses IPMI commands to to read and dis- play the System Event Log (SEL) which is stored by the BMC firmware. IPMI commands are issued to read each record, and, if specified, incre- mentally write records that have not previously been read into the Linux syslog (/var/log/messages). This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -a string Add a SEL record with a string of up to 13 characters. Longer strings will be truncated. Note that this should be used spar- ingly, but would be useful for changes made to the hardware or firmware environment, like "Fan replaced" or "flash FW2.1". -b bin_file Interpret a file containing raw binary/hex SEL data dumped in binary form, such as that produced by "ipmitool sel writeraw bin_file". Each set of 16 bytes in the file will be interpreted as an IPMI event. -c Show output in a canonical format, with a default delimiter of '|'. (same as -n). -d Deletes/Clears the SEL of all records. If the SEL becomes full (free space = 0), it no longer accepts new records, so the SEL should be cleared periodically (use checksel cron script). -e Show Extended sensor descriptions for events if run locally. This option will attempt to get the full sensor description from /var/lib/ipmiutil/sensor_out.txt, and also use its SDR to decode any raw threshold values in the event, if present. -f sel_file Interpret a file containing raw ascii text SEL data captured with ipmiutil sel -r, or some other similar utility. Each line in the file should be in this form, with no leading spaces: 04 00 02 76 a9 4a 47 20 00 04 10 09 6f 42 0f ff Lines not in this format will be ignored. -l N Show last N SEL records, in reverse order (newest first). For some BMC implementations, this may not show all N records speci- fied. -n Show output in a nominal/canonical format, with a default delim- iter of '|'. (same as -c). -r Show the 16 raw hex bytes for each SEL entry. The default is to display interpreted entries, and include relevant hex event bytes. -p By default, all SEL records are displayed. This option causes only the Panic events with sensor_type = 0x20 (OS Critical Stop) to be displayed. -s N Show only SEL events with severity N or greater. Severity 0=INF, 1=MIN, 2=MAJ, 3=CRT. The default is to show all SEL events. -u Show the SEL time as UTC and also get the SEL Time UTC offset if that command is supported. The default is to convert the SEL Time to local time. -v Only show the version information. This shows: the ipmiutil sel utility version, the BMC version, the IPMI version, the SEL version, and the amount of free space in the SEL. -w This option writes SEL records to the Linux syslog (/var/log/messages) or Windows Application Log. It only writes SEL records that have timestamps newer than the last record written to syslog. It saves the last timestamp in an index file named /usr/share/ipmiutil/sel.idx (.\sel.idx in Windows). -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.13 ISENSOR (ipmiutil sensor) ISENSOR(8) ISENSOR(8) NAME ipmiutil_sensor - show Sensor Data Records SYNOPSIS ipmiutil sensor [-abcdefgjkmpqrstuvwxL -i id -n snum -h tval -l tval -NUPREFJTVY] DESCRIPTION ipmiutil sensor is a program that uses IPMI commands to show and decode Sensor Data Records and current sensor readings for all sensors in the system. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. Note that this utility by default only displays Sensor Data Records reported by from the Baseboard Management Controller. To show sensors for other controllers, see options -b and -m below. OPTIONS Command line options are described below. -a snum ReArms the sensor number for events -b Shows SDRs for Bladed (PICMG or ATCA) systems by traversing the child MCs (same as -e). -c Show sensor list in a simpler/Canonical format without uninter- preted binary values. Only the user-friendly interpreted sensor information is shown. (same as -s). -d Dump the SDRs to a specified binary file. This file can be used with -j to jumpstart getting the sensor readings. -e Show Every SDR in a bladed system by traversing the child MCs (same as -b). -f Restore the SDRs from the specified binary File. This is nor- mally only done with the initial factory provisioning. -g sens_type Shows only those SDRs matching the given sensor type group. The sens_type string can be "fan", "temp", "voltage", or any string or substring matching those in the IPMI 2.0 Table 42-3 for Sen- sor Types. Multiple types can be listed, separated by a comma (,) but no spaces. -h tval Highest threshold value to set for the specified sensor. This tval can be in decimal, or of the form 0x1a, to match the raw reading value shown by sensor following the " = ". The value passed is set as the non-critical threshold value, with the more critical ones set by the utility as incrementally lower. This simplifies the interface and ensures that the threshold values do not get out of order. This requires specifying the sensor number via -n. -i ID Show or set only the sensor Index corresponding to ID, where ID is the hex ID of the SDR as shown in the sensor output under "_ID_". The ID argument can be one hex number (e.g. 0x0e or 0e), or a range of hex numbers (e.g. 0e-1a or 1a,2a or 0x0e-0x2a). This is useful to repeatedly view just a few sensor readings for changes, or to set just one sensor quickly without reading all of the SDRs. -j file Jump-start by caching the SDRs from a file. This uses an SDR binary file to read the SDRs, so that only the sensor readings need to be read from the firmware. This avoids getting the SDR reservation and reading each SDR, so it makes getting the sensor readings more efficient. The SDR binary file can be created using the -d option to dump the SDRs to a file, or -j will try to create the file if not there. -k K When looping with -L, wait K seconds between loops. Default is 1 second. -l tval Lowest threshold value to set for the specified sensor. This tval can be in decimal, or of the form 0x1a, to match the raw reading value shown by sensor following the " = ". The value passed is set as the non-critical threshold value, with the more critical ones set by the utility as incrementally higher. This simplifies the interface and ensures that the threshold values do not get out of order. This requires specifying the sensor number via -n. -m 002000s Show SDRs for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -n snum Number of the sensor to set. This num can be in decimal, or of the form 0x1a, to match the value shown by sensor following the "snum" tag. This is required if setting hi/lo thresholds via -h/-l. -o Output the memory DIMM information from SMBIOS, including size. Not available if using IPMI LAN via -N. Sample output: Memory Device (0,0): DIMM_A1 : size=2048MB Memory Device (0,1): DIMM_A2 : not present -p Persist the threshold being set (as specified via -l or -h). This writes a "sensor -i" script line to the file /usr/share/ipmiutil/thresholds.sh, which can then be executed at each reboot by starting the /etc/init.d/ipmi_port service for the desired runlevels. For Windows, the filename is thresh- olds.cmd. -q Show threshold values in d:d:d format. Thresholds are shown for each sensor in short format with ’:’ delimiters, which is useful as an example for setting thresholds with ’-u’. -r Show Raw SDR bytes also. -s Show sensor list in a simpler/canonical format without uninter- preted binary values. Only the user-friendly interpreted sensor information is shown. (same as -c). -t Show any Thresholds for each sensor also, in text format. -u Set unique threshold values. The values are specified in a string of threshold values. It can be in raw hex characters or in float values. All 6 possible thresholds must be specified, but only the ones that are valid for this sensor will be applied. These values are validated for ordering. For example: -u 6:5:4:60:65:69 (float) or -u 0x0605043c4145 (raw hex) would mean 0x06=noncrit_lo, 0x05=crit_lo, 0x04=nonrec_lo, 0x3c=noncrit_hi, 0x41=crit_hi, 0x45=nonrec_hi. -v Show Verbose output, including volatile thresholds, SDR thresh- olds, max/min, hysteresis, and BMC_TAM decoding. -w Wrap the threshold data onto the same line as the sensor. This may be convenient for scripting. -x Causes eXtra debug messages to be displayed. -L n Loop n times every K seconds. Default is one loop and K defaults to 1 second. See option -k to change K seconds if desired. This is useful along with -i or -g to read some sensors as they change. Using -j with this option makes run it quicker. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. EXAMPLES ipmiutil sensor sample output is below. ipmiutil ver 2.21 sensor: version 2.21 -- BMC version 0.17, IPMI version 2.0 _ID_ SDR_Type_xx ET Own Typ S_Num Sens_Description Hex & Interp Read- ing 000b SDR Full 01 01 20 a 01 snum 30 Baseboard Temp = 2e OK 46.00 degrees C 000e SDR Full 01 01 20 m 04 snum 50 Fan 1A = 6f OK 7659.00 RPM 0042 SDR Comp 02 6f 20 a 21 snum e0 DIMM 1A = 00 c0 04 00 Present 004e SDR FRU 11 1b dev: 20 03 80 00 0a 01 Pwr Supply 1 FRU 0050 SDR IPMB 12 1b dev: 20 00 bf 07 01 Basbrd Mgmt Ctlr 0051 SDR OEM c0 09 Intel: 02 02 00 01 70 71 0065 SDR OEM c0 11 Intel: SDR Package 17 [...] Output Columns: _ID_: This is an SDR ID or index number, in hex. This may vary from chassis to chassis. SDR_Type_xx: This shows the SDR Type and its hex representation. Some SDR types have a custom display. The OEM SDRs only show the OEM vendor by IANA number and then usually the data is listed in hex. ET: For Full or Comp SDRs, this shows the Event Type. For other SDRs, this shows the size of the SDR entry in hex (Sz). Own: This is the hex slave address of the SDR Owner, usually 20 if BMC. a/m: This indicates whether this sensor is either automatically or man- ually rearmed, respectively. Typ: This is the Sensor Type as defined in Table 42-3 of the IPMI 2.0 spec. (01 = Temperature, 02 = Voltage, 03 = Current, 04 = Fan, etc.) S_Num: This is the sensor number in hex. This remains consistent across baseboards of the same type. The output can be parsed with the "snum" delimiter to extract this value. Sens_Description: This is the text description of this SDR, which is stored within the SDR on the BMC. Hex & Interp Reading: This is the raw hex value returned by GetSensor- Reading, and its interpreted meaning. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.14 ISERIAL (ipmiutil serial) ISERIAL(8) ISERIAL(8) NAME ipmiutil_serial - configure a system for Serial/EMP management func- tions, such as Terminal Mode, and optionally share the port with the Serial Console. SYNOPSIS ipmiutil serial [-bcdeflq#rsvxB -m0 -m1 -n ser_chan -u user -p passwd -NUPREFJTVY] DESCRIPTION ipmiutil serial is a program that uses an IPMI driver to send IPMI com- mands which configure a system to enable EMP/serial Terminal Mode man- agement functions within the firmware, so that an administrator can use command-line character commands via the serial port to power cycle the system and perform other functions, even if the system is not running an OS. This level of access needs to be protected by a username/pass- word login, which can be specified with this utility. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -b Set up and enable the Serial Port EMP parameters for Basic Mode management functions. This does not set a username or password. -c Configure and enable the Serial Port EMP parameters for Terminal Mode management functions, shared with BIOS Console Redirection. Setting a new username and password for serial access via -u and -p is recommended for security. -d Disable the serial port access for IPMI commands. The serial port is then only available for BIOS console and OS functions. A side-effect of this option is that it sets the default user (1) back to admin access. -e Enable EMP Terminal Mode without shared BIOS console. The serial port is then only available for EMP Terminal Mode func- tions. -f Specifies the Flow Control for the Serial EMP. 0 means no flow control, and 1 means RTS/CTS flow control (default). This must match the BIOS Serial Console setting. -l Show LAN Parameters. This option reads and displays the LAN Parameter configuration also. -m0 Switch the Serial Port MUX to Baseboard/BIOS Console operation. Set no other configuration parameters. -m1 Switch the Serial Port MUX to Terminal Mode management. Set no other configuration parameters. -n ser_chan Sets the IPMI channel number to use for the EMP serial channel (often 4). Note that the IPMI channels for LAN, Serial, etc. are numbered differently on each platform type. The default is to detect the first available IPMI serial channel. -# Same as -q below. -q Specify an alternate user number for the EMP Username from the -u option. This is normally user number 2, 3, or 4, where 3 is the default. The maximum number of users is 15. -r Read Only. This option just reads the Serial Parameter configu- ration without writing any values. -s Set up and enable the Serial Port EMP parameters for Shared operation between Basic Mode management functions and Baseboard (BIOS) Remote Console. This option switches the Serial Port MUX to Baseboard Console operation. -t Configure and enable the Serial Port EMP parameters for Terminal Mode management functions, shared with BIOS Console Redirection. Same as -c, but easier to remember. -u username This specifies a username for the EMP Terminal Mode login. It can be any string, up to 15 characters. If -u is not used, the default user 1 (null) will be assumed. The username, if speci- fied, will be set for user 3, unless option -q is specified. -p password This specifies a password for the EMP Terminal Mode login. It can be any string, up to 15 characters. A null password is used if none is specified. This password applies to user 3 if -u is used, to user 1 otherwise. -v priv Set a specific access priVilege for this user, where priv can be: 1=Callback, 2=User, 3=Operator, 4=Admin, 5=OEM, 15=NoAccess The default if not specified or specified in error, is to use 4=Admin. -x Causes extra debug messages to be displayed. -B Set the Baud rate of the serial port to one of the following: 9600, 19,2K, 38.4K, 57.6K, or 115.2K. The default is 19.2K bps. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. EXAMPLES ipmiutil serial -t (or -c) Enables Terminal Mode management functions, shared with BIOS Serial Console redirection. The user can switch between serial console operations and IPMI Terminal Mode commands by typing ESC ’)’ and ESC ’Q’. ipmiutil serial -s Enables Basic Mode management functions shared with BIOS Serial Console redirection. The user can switch between serial console operations and IPMI Basic Mode management programs on the same serial port. ipmiutil serial -d Disables the serial port management functions. This would be used if only the BIOS Serial Console were used and no BMC serial management functions. How to login to a Terminal Mode console: ESC ( (switch to Terminal mode) [SYS PWD -N ] (login for default user, null psw) [SYS PWD -U ROOT -N PASSWORD] (syntax example for user 3) [SYS 000157 ACTIVATE] (activate advanced commands) [SYS HEALTH QUERY] [SYS HELP] [SYS PWD] (logoff) ESC Q (switch to BIOS console) See IPMI 1.5 Spec, Appendix E, and Intel TIGPR2U TPS for more informa- tion. DEPENDENCIES The ipmiutil serial utility is intended to configure the EMP serial port on the server for shared access between BMC/IPMI functions and BIOS Console Redirection. Some platforms only support only Basic Mode for BMC/IPMI functions. Basic Mode requires a remote client applica- tion to utilize it (Windows ISC Console/DPC, or a special modified Linux telnet). There are some platforms which implement Terminal Mode via IPMI v1.5 Appendix E to make remote management with character com- mands available on the serial port without a special remote client application. For example, Intel TSRLT2 systems would use "ipmiutil serial -s" for Basic Mode shared functions, but Intel TIGPR2U systems could use "ipmiutil serial -c" to configure Terminal Mode functions. On your system, run "ipmiutil serial -r" to check whether Serial Param(29): "Terminal Mode Config" is supported. If not, configure Basic Mode via "ipmiutil serial -s". PLATFORM SERIAL PORT CONFIGURATION EXAMPLES First, enter BIOS Setup for Serial Console Redirection parameters: (these vary by platform) Console Redirection = Serial Port B ACPI Redirection = Disabled Baud Rate = 115.2K Flow Control = CTS/RTS Terminal Type = VT100 Legacy Redirection = Enabled Note that the Baud Rate can vary, but it must match in all locations where it is used (BIOS, IPMI, and Linux). For some non-Intel platforms, the serial console would be COM1 instead of COM2, but should be enabled in BIOS. From Linux, run "ipmiutil serial -c" for Terminal Mode shared configu- ration. Or, on older Intel TSRLT2 platforms: From Linux, run "ipmiutil serial -s" for Basic Mode Shared configuration. LINUX CONFIGURATION FOR SERIAL CONSOLE If using lilo, in /etc/lilo.conf, add append="console=ttyS1,19200n8 console=tty0" (and comment out the "message=" line because it includes graphics) Note that the append line can be placed in the global section and removed from each kernel section if there are no other differences. Or, if using grub, edit /boot/grub/grub.conf as follows: #Omit the splashimage or gfxmenu # splashimage=(hd0,0)/grub/splash.xpm.gz #The serial and terminal lines are not usually needed # serial --unit=1 --speed=19200 --word=8 --parity=no --stop=1 # terminal --timeout=10 serial console #Add the console=ttyS* parameter to the kernel line kernel (hd0,0) /vmlinuz root=/dev/sda2 console=ttyS1,19200n8 Add this line to /etc/initab, if ttyS1 is not already there: co:2345:respawn:/sbin/agetty ttyS1 19200 vt100 Add this line to /etc/securetty, if ttyS1 is not already there: ttyS1 SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.15 ISOL (ipmiutil sol) ISOL(8) ISOL(8) NAME ipmiutil_sol - an IPMI Serial-Over-LAN Console application SYNOPSIS ipmiutil sol [-acdeilorsvwxz -NUPREFJTVY] DESCRIPTION This utility starts an IPMI Serial-Over-LAN console session. A Serial- over-LAN console allows the client to see and modify functions before the OS boots, such as BIOS setup, grub, etc. This utility uses either the IPMI LAN 1.5 or 2.0 SOL interface. The 1.5 SOL interface is spe- cific to Intel BMCs, while any IPMI 2.0 BMC should support 2.0 SOL. The target system/node must first have these parameters configured before SOL sessions can be started: - [BIOS] serial console redirection parameters, - [IPMI] lan and SOL parameters (see ipmiutil lan or ilan), and - [OS] For Linux, edit grub.conf, inittab, and securetty parameters. Be sure that the baud rate matches in all of the above places. See the ipmiutil UserGuide section 4.8 for details. OPTIONS -a Activate the SOL Console session, and enter console mode. Use the escape sequence (’~.’) to exit the session. -c ’^’ Set the escape Character to ’^’, or another ANSI character. This changes the default two-character escape sequence (’~.’) to the specified single escape character, which will end the SOL session. -d Deactivate the SOL Console session. Use this if the previous session was aborted abnormally and starting a new session gives an error. -e Turn Encryption off in negotiation when activating a session. By default, encryption is on for Serial-Over-LAN console ses- sions. -l Use Legacy BIOS mapping for Enter key (CR+LF) instead of just LF. This is needed for BIOS Setup menus and DOS, but causes an extra LF to occur in Linux. So, only use this option if doing BIOS or DOS changes. This should be seldom be needed since now the default is to automatically detect these menus with colored backgrounds and change the mapping. -i input_file Use this file as an input script. The input_file will be read after the session is established. This can be used to automate certain tasks. The input_file is read one line at a time. If the input_file does not have an escape character (~) to end the session, then the input is returned to the keyboard when the file ends. -o output_file Use a Trace log. The output_file is created and all SOL screen output is written to the file, including VT100 escape sequences. If the output_file exists, the output is appended to it. This can be used to log what the user has done in an SOL session. -r Use Raw terminal I/O instead of custom VT100 to ANSI translation (in Windows). Use this option if the server is configured in BIOS and BMC for ANSI and the utility is being invoked from Win- dows. -s NNN For a slow link with high latency, this adds a delay of NNN microseconds between sending and receiving SOL packets. The default is 100 microseconds. -w (Windows only) Do not use the Windows Console buffer, but use Windows stdio instead. This does not handle cursor positioning correctly in some cases, however. -v log_file Causes debug messages to be displayed to the specified debug log_file. The default log_file is isoldbg.log in the current directory. -x Causes debug messages to be displayed to the debug log file. -z Causes more verbose debug messages to be displayed to the debug log file. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any supported driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. EXAMPLES ipmiutil sol -a -N nodename -U username -P password Starts an SOL console session to the nodename. Detect the lan proto- col. ipmiutil sol -a -N nodename -U username -P password -Flan2 Starts an SOL console session to the nodename. Force lan protocol to 2.0. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.16 IWDT (ipmiutil wdt) IWDT(8) IWDT(8) NAME ipmiutil_wdt- display and set WatchDog Timer parameters SYNOPSIS ipmiutil wdt [-acdelrtx -N node -P/-R pswd -U user -EFJTVY] DESCRIPTION ipmiutil wdt is a program that uses IPMI commands to display and set WatchDog Timer parameters. This utility can use either any available IPMI driver, or direct user- space IOs, or the IPMI LAN interface if -N. This utility is an example of how to access the IPMI watchdog parame- ters directly, which allows changing the timer configuration. There is an init script provided with ipmiutil to automate the task of managing the watchdog timer in user-space. # chkconfig --add ipmiutil_wdt (skip this if no chkconfig) # /etc/init.d/ipmiutil_wdt start This sets the watchdog timer to reset the system if the wdt is not restarted within 90 seconds. It creates an /etc/cron.d/wdt file to restart wdt every 60 seconds. See also ipmiutil UserGuide section 4.4 for more information. OPTIONS Command line options are described below. -a N Set watchdog event Action to N. Values: 0 = No action, 1 = Hard Reset(default), 2 = Power down, 3 = Power cycle. -c Show watchdog output in a canonical format, with a default delimiter of '|'. -d Disables the watchdog timer. -e Enables the watchdog timer. The timer is not actually started, however, until the timer is reset. The pre-timeout action is not enabled. -l Set the watchdog dontLog bit to not log watchdog events in the SEL. -p N Set watchdog Pretimeout event action to N. Values: 0 = No action(default), 1 = SMI, 2 = NMI, 3 = Messaging Interrupt. If this is set to an action other than 0, the pretimeout will also be set to 90% of the timeout. However, if the timeout is less than 20 seconds, the pretimeout will not be enabled. -q S Set watchdog pretimeout value to S seconds, rather than 90% of the timeout as in -p. The pretimeout value must be >= 5 and at least 5 seconds less than the timeout value. -r Resets the watchdog timer. This should be done every N seconds if the timer is running to prevent the watchdog action (usually a system reset) from occurring. -tN Set the watchdog Timeout to N seconds. The default is 120 sec- onds (2 minutes). -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifirewall(8) ifru(8) ifruset(8) ifwum(8) igetevent(8) ihealth(8) ihpm(8) ilan(8) ipicmg(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) isunoem(8) iwdt(8) ipmiutil(8) ipmi_port(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.17 IFRUSET (ifruset) IFRUSET(8) IFRUSET(8) NAME ifruset - show/set Field Replacable Unit configuration data SYNOPSIS ifruset [-bcimx -unpvsafo -N node -U user -P/-R pswd -EFJTVY] DESCRIPTION ifruset is a program that uses IPMI commands to show FRU configuration data and optionally write any Product area fields into the FRU data. Setting the FRU Product area fields is a function that might be done by a manufacturer or system integrator. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. This program is not built or installed by default. Integrators who wish to use it should build ipmiutil from source, then do ’cd util; make ifruset’. OPTIONS Command line options are described below. -u manuf This option specifies a product manufacturer string to be writ- ten to the baseboard FRU Product area field 0. This field can be any string up to 20 characters. The default is to not modify this FRU field. -n name This option specifies a product name string to be written to the baseboard FRU Product area field 1. This field can be any string up to 20 characters. The default is to not modify this FRU field. -p partnum This option specifies a product part number string to be written to the baseboard FRU Product area field 2. This field can be any string up to 20 characters. The default is to not modify this FRU field. -v prod_ver This option specifies a product version number string to be written to the baseboard FRU Product area field 3. The version number can be any string up to 20 characters. The default is to not modify this FRU field. -s serial_num This option specifies a serial number string to be written to the baseboard FRU Product area field 4. The serial number can be any string up to 20 characters. The default is to not modify this FRU field. -a asset_string This option specifies an asset tag string to be written to the baseboard FRU Product area field 5. The asset tag length is limited by the existing FRU Product data, but is usually allowed up to 20 characters. The default is to not modify this FRU field. -f fruid This option specifies a product FRU file ID string to be written to the baseboard FRU Product area field 6. This field can be any string up to 20 characters. -o oem This option specifies a product OEM field string to be written to the baseboard FRU Product area field 7. This field can be any string up to 20 characters. -b Only show the Baseboard FRU data. The default behavior is to also scan for any SDR FRU data or DIMM SPD data referenced by the SDRs. -c Show FRU output in a canonical format, with a default delimiter of '|'. -i 00 This option specifies a specific FRU ID to show. The input value should be in hex (0b, 1a, etc.), as shown from the sensor SDR output. By default, all FRU IDs that are specified in the FRU locator SDRs are shown. -m 002000 Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -x Causes eXtra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.18 IPMI_PORT (ipmi_port) IPMI_PORT(8) IPMI_PORT(8) NAME ipmi_port - a daemon to bind RMCP port 623 to prevent portmap from using it SYNOPSIS ipmi_port [-bx] DESCRIPTION This ipmi_port service starts and binds port 623, then sleeps forever, so that the portmap service will not try to reuse port 623, which it otherwise might try to do. Since the IPMI firmware snoops the NIC channel and grabs any traffic destined for RMCP port 623, any applica- tion in the OS which tried to use port 623 would fail. OPTIONS Command line options are described below. -b Background mode. Convert to a daemon and run in background. Without specifying this option, ipmi_port will run in fore- ground. -x Causes eXtra debug messages to be displayed. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.19 IPICMG (ipmiutil picmg) IPICMG(8) IPICMG(8) NAME ipmiutil_picmg - send specific PICMG extended IPMI commands SYNOPSIS ipmiutil picmg [-mixNUPREFJTVY] parameters DESCRIPTION This ipmiutil picmg subcommand sends specific PICMG/ATCA extended IPMI commands to the firmware. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -i 00 This option specifies a specific FRU ID to show. The input value should be in hex (0b, 1a, etc.), as shown from the sensor SDR output. The default FRU ID is zero (0). -m 002000 Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. PARAMETERS picmg parameters properties Get PICMG properties may be used to obtain and print Extension major version information, PICMG identifier, FRU Device ID and Max FRU Device ID. addrinfo Get address information. This command may return infor- mation on the Hardware address, IPMB-0 Address, FRU ID, Site/Entity ID, and Site/Entity Type. frucontrol fru id options Set various control options: 0x00 - Cold Reset 0x01 - Warm Reset 0x02 - Graceful Reboot 0x03 - Issue Diagnostic Interrupt 0x04 - Quiesce [AMC only] 0x05-0xFF - Cold Reset activate fru id Activate the specified FRU. deactivate fru id Deactivate the specified FRU. policy get fru id Get FRU activation policy. policy set fru id lockmask lock Set FRU activation policy. lockmask is 1 or 0 to indi- cate action on the deactivation or activation locked bit respectively. lock is 1 or 0 to set/clear locked bit. portstate set|getall|getgranted|getdenied parameters Get or set various port states. See usage for parameter details. EXAMPLES ipmiutil picmg properties Gets PICMG properties from the default target address (slave address 0x20). ipmiutil picmg -N 192.168.1.1 -U root -P pswd addrinfo Gets PICMG Address Information from the specified IP address. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.20 IFIREWALL (ipmiutil firewall) IFIREWALL(8) IFIREWALL(8) NAME ipmiutil_firewall - configure the IPMI firmware firewall functions SYNOPSIS ipmiutil firewall [-mxNUPREFJTVY] parameters DESCRIPTION This ipmiutil firewall command supports the IPMI Firmware Firewall capability. It may be used to add or remove security-based restric- tions on certain commands/command sub-functions or to list the current firmware firewall restrictions set on any commands. For each firmware firewall command listed below, parameters may be included to cause the command to be executed with increasing granularity on a specific LUN, for a specific NetFn, for a specific IPMI Command, and finally for a specific command’s sub-function. See Appendix H in the IPMI 2.0 Speci- fication for a listing of any sub-function numbers that may be associ- ated with a particular command. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -m 002000 Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. PARAMETERS Parameter syntax and dependencies are as follows: firewall [channel H] [lun L [ netfn N [command C [subfn S]]]] Note that if "netfn N" is specified, then "lun L" must also be speci- fied; if "command C" is specified, then "netfn N" (and therefore "lun L") must also be specified, and so forth. "channel H" is an optional and standalone parameter. If not specified, the requested operation will be performed on the current channel. Note that command support may vary from channel to channel. Firmware firewall commands: info [(Parms as described above)] List firmware firewall information for the specified LUN, NetFn, and Command (if supplied) on the current or speci- fied channel. Listed information includes the support, configurable, and enabled bits for the specified command or commands. Some usage examples: info [channel H] [lun L] This command will list firmware firewall informa- tion for all NetFns for the specified LUN on either the current or the specified channel. info [channel H] [lun L [ netfn N ] This command will print out all command informa- tion for a single LUN/NetFn pair. info [channel H] [lun L [ netfn N [command C] ]] This prints out detailed, human-readable informa- tion showing the support, configurable, and enabled bits for the specified command on the specified LUN/NetFn pair. Information will be printed about each of the command subfunctions. info [channel H] [lun L [ netfn N [command C [subfn S]]]] Print out information for a specific sub-func- tion. enable [(Parms as described above)] This command is used to enable commands for a given NetFn/LUN combination on the specified channel. disable [(Parms as described above)] [force] This command is used to disable commands for a given NetFn/LUN combination on the specified channel. Great care should be taken if using the "force" option so as not to disable the "Set Command Enables" command. reset [(Parms as described above)] This command may be used to reset the firmware firewall back to a state where all commands and command sub-func- tions are enabled. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.21 IFWUM (ipmiutil fwum) IFWUM(8) IFWUM(8) NAME ipmiutil_fwum - Update IPMC using Kontron OEM Firmware Update Manager SYNOPSIS ipmiutil fwum [-mixNUPREFJTVY] parameters DESCRIPTION This ipmiutil fwum subcommand updates IPMC firmware using Kontron OEM Firmware Update Manager. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -i 00 This option specifies a specific FRU ID to show. The input value should be in hex (0b, 1a, etc.), as shown from the sensor SDR output. The default FRU ID is zero (0). -m 002000 Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. PARAMETERS fwum parameters info Show information about current firmware. status Show status of each firmware bank present in the hard- ware. download filename Download the specified firmware image. upgrade [filename] Install firmware upgrade. If the filename is specified, the file is downloaded first, otherwise the last firmware downloaded is used. rollback Ask IPMC to rollback to previous version. tracelog Show the firmware upgrade log. EXAMPLES ipmiutil fwum info Gets Firmware information ipmiutil fwum -N 192.168.1.1 -U root -P pswd download firmware.img Downloads the firmware version contained in firmware.img over IPMI LAN. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.22 IHPM (ipmiutil hpm) IHPM(8) IHPM(8) NAME ipmiutil_hpm - PICMG HPM.1 Upgrade Agent SYNOPSIS ipmiutil hpm [-mxNUPREFJTVY] parameters DESCRIPTION This ipmiutil hpm subcommand updates HPM components using PICMG HPM.1 file This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -m 002000 Target a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing charac- ter, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. PARAMETERS hpm parameters check Check the target information. check filename Display both the existing target version and image ver- sion on the screen. download filename Download specified firmware. upgrade filename [all] [component x] [activate] Upgrade the firmware using a valid HPM.1 image file. If no option is specified, the firmware versions are checked first and the firmware is upgraded only if they are dif- ferent. all Upgrade all components even if the firmware ver- sions are the same (use this only after using "check" command). component x Upgrade only given component from the given file. component 0 - BOOT component 1 - RTK activate Activate new firmware right away. activate Activate the newly uploaded firmware. targetcap Get the target upgrade capabilities. compprop id opt Get the specified component properties. Valid component id: 0-7. Opt can be one of following: 0 - General properties 1 - Current firmware version 2 - Description string 3 - Rollback firmware version 4 - Deferred firmware version abort Abort the on-going firmware upgrade. upgstatus Show status of the last long duration command. rollback Perform manual rollback on the IPM Controller firmware. rollbackstatus Show the rollback status. selftestresult Query the self test results. EXAMPLES ipmiutil hpm targetcap Gets HPM target capabilities ipmiutil hpm -N 192.168.1.1 -U root -P pswd download firmware.img Downloads the HPM firmware version contained in firmware.img over IPMI LAN. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.23 ISUNOEM (ipmiutil sunoem) ISUNOEM(8) ISUNOEM(8) NAME ipmiutil_sunoem - OEM commands for Sun servers SYNOPSIS ipmiutil sunoem [-mx -NPRUEFJTVY] commands DESCRIPTION ipmiutil sunoem commands is a program that uses Sun OEM IPMI commands to perform platform-specific functions. OPTIONS -m 002000 Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. COMMANDS led These commands provide a way to get and set the status of LEDs on a Sun Microsystems server. Use ’sdr list generic’ to get a list of devices that are controllable LEDs. The ledtype parame- ter is optional and not necessary to provide on the command line unless it is required by hardware. get sensorid [ledtype] Get status of a particular LED described by a Generic Device Locator record in the SDR. A sensorid of all will get the status of all available LEDS. set sensorid ledmode [ledtype] Set status of a particular LED described by a Generic Device Locator record in the SDR. A sensorid of all will set the status of all available LEDS to the specified ledmode and ledtype. LED Mode is required for set operations: OFF Off ON Steady On STANDBY 100ms on 2900ms off blink rate SLOW 1HZ blink rate FAST 4HZ blink rate LED Type is optional: OK2RM Ok to Remove SERVICE Service Required ACT Activity LOCATE Locate fan speed 0-100 Set system fan speed (PWM duty cycle). sshkey set userid keyfile This command will allow you to specify an SSH key to use for a particular user on the Service Pro- cessor. This key will be used for CLI logins to the SP and not for IPMI sessions. View available users and their userids with the ’user list’ com- mand. del userid This command will delete the SSH key for a speci- fied userid. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.24 IEKANALYZER (ipmiutil ekanalyzer) IEKANALYZER(8) IEKANALYZER(8) NAME ipmiutil_ekanalyzer - run FRU-Ekeying analyzer with FRU files SYNOPSIS ipmiutil ekanalyzer [-mx -NPRUEFJTVY] commands (deprecated, see ifru instead) DESCRIPTION ipmiutil ekanalyzer is a program that analyzes FRU Ekeying information from files saved from PICMG IPMI systems. ekanalyzer command xx=filename1 xx=filename2 [rc=filename3] NOTE: This command can support a maximum of 8 files per command line filename1 binary file that stores FRU data of a Carrier or an AMC module filename2 binary file that stores FRU data of an AMC module. These binary files can be generated from this command: ipmiutil fru -i id -d filename filename3 configuration file used for configuring On-Carrier Device ID or OEM GUID. This file is optional. xx indicates the type of the file. It can take the following value: oc : On-Carrier device a1 : AMC slot A1 a2 : AMC slot A2 a3 : AMC slot A3 a4 : AMC slot A4 b1 : AMC slot B1 b2 : AMC slot B2 b3 : AMC slot B3 b4 : AMC slot B4 sm : Shelf Manager OPTIONS -m 002000 Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. COMMANDS The available commands for ekanalyzer are: print [carrier | power | all] carrier (default) oc=filename1 oc=filename2 ... Display point to point physical connectivity between carriers and AMC modules. Example: # ipmiutil ekanalyzer print carrier oc=fru oc=carrierfru From Carrier file: fru Number of AMC bays supported by Carrier: 2 AMC slot B1 topology: Port 0 =====> On Carrier Device ID 0, Port 16 Port 1 =====> On Carrier Device ID 0, Port 12 Port 2 =====> AMC slot B2, Port 2 AMC slot B2 topology: Port 0 =====> On Carrier Device ID 0, Port 3 Port 2 =====> AMC slot B1, Port 2 *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* From Carrier file: carrierfru On Carrier Device ID 0 topology: Port 0 =====> AMC slot B1, Port 4 Port 1 =====> AMC slot B1, Port 5 Port 2 =====> AMC slot B2, Port 6 Port 3 =====> AMC slot B2, Port 7 AMC slot B1 topology: Port 0 =====> AMC slot B2, Port 0 AMC slot B1 topology: Port 1 =====> AMC slot B2, Port 1 Number of AMC bays supported by Carrier: 2 power xx=filename1 xx=filename2 ... Display power supply information between carrier and AMC modules. all xx=filename xx=filename ... Display both physical connectivity and power supply of each car- rier and AMC modules. frushow xx=filename Convert a binary FRU file into human readable text format. Use -v option to get more display information. summary [match | unmatch | all] match (default) xx=filename xx=filename ... Display only matched results of Ekeying match between an On-Car- rier device and an AMC module or between 2 AMC modules. Example: # ipmiutil ekanalyzer summary match oc=fru b1=amcB1 a2=amcA2 On-Carrier Device vs AMC slot B1 AMC slot B1 port 0 ==> On-Carrier Device 0 port 16 Matching Result - From On-Carrier Device ID 0 -Channel ID 11 || Lane 0: enable -Link Type: AMC.2 Ethernet -Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link -Link Group ID: 0 || Link Asym. Match: exact match - To AMC slot B1 -Channel ID 0 || Lane 0: enable -Link Type: AMC.2 Ethernet -Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link -Link Group ID: 0 || Link Asym. Match: exact match *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* AMC slot B1 port 1 ==> On-Carrier Device 0 port 12 Matching Result - From On-Carrier Device ID 0 -Channel ID 6 || Lane 0: enable -Link Type: AMC.2 Ethernet -Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link -Link Group ID: 0 || Link Asym. Match: exact match - To AMC slot B1 -Channel ID 1 || Lane 0: enable -Link Type: AMC.2 Ethernet -Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link -Link Group ID: 0 || Link Asym. Match: exact match *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* On-Carrier Device vs AMC slot A2 AMC slot A2 port 0 ==> On-Carrier Device 0 port 3 Matching Result - From On-Carrier Device ID 0 -Channel ID 9 || Lane 0: enable -Link Type: AMC.2 Ethernet -Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link -Link Group ID: 0 || Link Asym. Match: exact match - To AMC slot A2 -Channel ID 0 || Lane 0: enable -Link Type: AMC.2 Ethernet -Link Type extension: 1000BASE-BX (SerDES Gigabit) Ethernet link -Link Group ID: 0 || Link Asym. Match: exact match *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* AMC slot B1 vs AMC slot A2 AMC slot A2 port 2 ==> AMC slot B1 port 2 Matching Result - From AMC slot B1 -Channel ID 2 || Lane 0: enable -Link Type: AMC.3 Storage -Link Type extension: Serial Attached SCSI (SAS/SATA) -Link Group ID: 0 || Link Asym. Match: FC or SAS interface {exact match} - To AMC slot A2 -Channel ID 2 || Lane 0: enable -Link Type: AMC.3 Storage -Link Type extension: Serial Attached SCSI (SAS/SATA) -Link Group ID: 0 || Link Asym. Match: FC or SAS interface {exact match} *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* unmatch xx=filename xx=filename ... Display the unmatched results of Ekeying match between an On- Carrier device and an AMC module or between 2 AMC modules all xx=filename xx=filename ... Display both matched result and unmatched results of Ekeying match between two cards or two modules. SEE ALSO ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifirewall(8) ifru(8) ifruset(8) ifwum(8) igetevent(8) ihealth(8) ihpm(8) ilan(8) ipicmg(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) isunoem(8) iwdt(8) ipmiutil(8) ipmi_port(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.25 ITSOL (ipmiutil tsol) ITSOL(8) ITSOL(8) NAME ipmiutil_tsol - Tyan IPMIv1.5 Serial-Over-LAN Console application SYNOPSIS ipmiutil tsol [recvip] [port=NUM] [ro|rw] [rows=NUM] [cols=NUM] [alt- term] DESCRIPTION This command allows Serial-over-LAN sessions to be established with Tyan IPMIv1.5 SMDC such as the M3289 or M3290. The default command run with no arguments will establish default SOL session back to local IP address. Optional arguments may be supplied in any order. OPTIONS Send receiver IP address to SMDC which it will use to send serial traffic to. By default this detects the local IP address and establishes two-way session. Format of ipaddr is XX.XX.XX.XX port Configure UDP port to receive serial traffic on. By default this is 6230. ro|rw Confiure SOL session as read-only or read-write. Sessions are read-write by default. rows Set terminal rows [default: rows=24] cols Set terminal columns [default: cols=80] altterm Alternate terminal setup [default is off] EXAMPLES ipmiutil tsol 192.168.1.1 Starts a Tyan SOL console session to the IP address. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.26 IDELLOEM (ipmiutil delloem) IDELLOEM(8) IDELLOEM(8) NAME ipmiutil_delloem - OEM commands for Dell servers SYNOPSIS ipmiutil delloem [-mx -NPRUEFJTVY] commands DESCRIPTION ipmiutil delloem commands is a program that uses Dell OEM IPMI commands to perform platform-specific functions. OPTIONS -m 002000 Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. COMMANDS mac list Lists the MAC address of LOMs mac get Shows the MAC address of specified LOM. 0-7 System LOM, 8- DRAC/iDRAC. lan set Sets the NIC Selection Mode (dedicated, shared, shared with failover lom2, shared with Failover all loms). lan get Returns the current NIC Selection Mode (dedicated, shared, shared with failover lom2, shared with Failover all loms). lan get active Returns the current active NIC (dedicated, LOM1, LOM2, LOM3, LOM4). powermonitor Shows power tracking statistics powermonitor clear cumulativepower Reset cumulative power reading powermonitor clear peakpower Reset peak power reading powermonitor powerconsumption Displays power consumption in powermonitor powerconsumptionhistory Displays power consumption history powermonitor getpowerbudget Displays power cap in powermonitor setpowerbudget Allows user to set the power cap in powermonitor enablepowercap To enable set power cap powermonitor disablepowercap To disable set power cap windbg start Starts the windbg session (Cold Reset & SOL Activation) windbg end Ends the windbg session (SOL Deactivation) vFlash info Card Shows Extended SD Card information SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.27 IDCMI (ipmiutil dcmi) IDCMI(8) IDCMI(8) NAME ipmiutil_dcmi - handle DCMI functions SYNOPSIS ipmiutil dcmi [-admsx -NUPREFTVY] DESCRIPTION This ipmiutil dcmi subcommand handles DCMI command functions according to the DCMI specification. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -a string Set the DCMI Asset Tag to this string. -d string Set the DCMI MC ID to this string. -m 002000 Target a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing charac- ter, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -s When getting info, also get the DCMI sensor information. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. FUNCTIONS info Get DCMI Capabilities, MC ID, and Asset Tag. This is the default function if no function was specified. power Get DCMI Power reading and DCMI Power limit, if supported in the DCMI capabilties. power set_limit Set Power limit power set_action Set Power limit exception action (where action = no_action | power_off | log_sel) power set_correction Set Power limit correction time (in ms) power set_sample Set Power limit sampling period (in sec) power activate Activate Power limit power deactivate Deactivate Power limit thermal Get/Set DCMI Thermal parameters. This requires DCMI 1.5 sup- port. config Get/Set DCMI Configuration parameters. This requires DCMI 1.5 support. help Show the help (usage) message EXAMPLES ipmiutil dcmi info -s Gets DCMI information, plus DCMI sensor information ipmiutil dcmi -N 192.168.1.1 -U root -P pswd Gets DCMI information over IPMI LAN. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.28 ISMCOEM (ipmiutil smcoem) ISMCOEM(8) ISMCOEM(8) NAME ipmiutil_smcoem - OEM commands for SuperMicro servers SYNOPSIS ipmiutil smcoem [-mx -NPRUEFJTVY] commands DESCRIPTION ipmiutil smcoem is a function that uses SuperMicro OEM IPMI commands to perform platform-specific functions. OPTIONS -m 002000 Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -U rmt_user Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. COMMANDS intrusion This command resets any chassis intrusion condition that may have occurred. bmcstatus [enable|disable] This command gets or sets the BMC service status. Alone, with- out arguments, it gets the BMC status as either enabled or dis- abled. With an argument of either enable or disable, it will also set the BMC status as specified. firmware This command gets the extra firmware version information, if available. lanport [dedicated|lan1|failover] This command gets or sets the IPMI LAN interface port. If set to dedicated, only the dedicated IPMI NIC can be configured for IPMI LAN. If set to lan1, only the first onboard NIC (LAN1) can be configured for IPMI LAN. If set to failover, both the dedi- cated and onboard LAN1 port would be configured for IPMI LAN, with the same IP address. SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.29 ISELTIME (iseltime) ISELTIME(8) ISELTIME(8) NAME iseltime - synchronize BMC SEL time with OS system time SYNOPSIS seltime [-sx -NUPRETVF] DESCRIPTION seltime is a program that uses IPMI commands to set the BMC SEL time from the OS system time. The OS system time should be in sync with the BIOS Real-Time-Clock. The OS system time may also be kept from drift- ing via an NTP server. Normally the BIOS will set the BMC time from the RTC during boot, but running this command may be necessary periodi- cally if the system does not reboot for many weeks, for instance. Note that this command should not be run too frequently to avoid BMC timing issues. Once per day should be sufficient. Run with no options, this command reads the BMC SEL time without set- ting anything. This utility can use either the /dev/ipmi0 openipmi driver, the /dev/imb Intel driver, the /dev/ipmikcs valinux driver, a driverless interface, or IPMI LAN. OPTIONS -s Sets the SEL time (no more than once a day). -x Causes eXtra debug messages to be displayed. -N nodename Nodename of the remote target system. If a nodename is speci- fied, IPMI LAN interface is used. Otherwise the local system management interface is used. -P/-R password Remote password for the nodename given. The default is a null password. -U username Remote username for the nodename given. The default is a null username. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 14): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. SEE ALSO ipmiutil(8) isel(8) ievents(8) icmd(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------------------- 3.30 IUSER (ipmiutil user) IUSER(8) IUSER(8) NAME ipmiutil_user - handle user functions SYNOPSIS ipmiutil user [-cmsx -NUPREFTVY] DESCRIPTION This ipmiutil user subcommand handles IPMI LAN user functions sepa- rately. These functions can also be handled from ipmiutil lan -q, -u, -p, -v. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if -N. OPTIONS Command line options are described below. -c Canonical, delimited output format -m 002000 Target a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing charac- ter, if present, indicates SMI addressing if ’s’, or IPMB addressing if ’i’ or not present. -s When getting info, also get the DCMI sensor information. -x Causes extra debug messages to be displayed. -N nodename Nodename or IP address of the remote target system. If a node- name is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. -U rmt_user Remote username for the nodename given. The default is a null username. -P/-R rmt_pswd Remote password for the nodename given. The default is a null password. -E Use the remote password from Environment variable IPMI_PASSWORD. -F drv_t Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. -J Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. -T Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. -V Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. -Y Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. FUNCTIONS list [channel] List the IPMI LAN users with enabled status, privilege level, and username. Optionally specify a channel number. enable [channel] Enable the specified user number and optionally specify an IPMI LAN channel number. disable ] Disable the specified user number, so that it has ’No access’. set name Set the username for a specified user number. set password Set the password for a specified user number. set priv [channel] Set the privilege level for a specified user number, where the privilege level is 4=Admin, 3=Operator, 2=User. Also optionally specify a channel number. help Show the help (usage) message EXAMPLES ipmiutil user set 2 name user2 Sets the username for user 2 to "user2". SEE ALSO ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. -------------------------- 4.0 USE CASES -------------------------- ---------------------------------------------------------------- 4.1 Usage of IPMI utilities for sensor thresholds ---------------------------------------------------------------- Get and set the Baseboard Temperature sensor threshold with the 'sensor' utility like this: # ipmiutil sensor -t [...] 000e SDR Full 01 39 20 sensnum 30 Baseboard Temp = 1d OK 29.00 degrees C hi-crit 65.00 hi-noncr 60.00 lo-noncr 10.00 lo-crit 5.00 [...] Using sensor number 30, index 000e, and the hex raw reading (1d) as a baseline from above, we can set the lower threshold above the current reading, i.e. 0x1e or 30 C. # ipmiutil sensor -i 0e -t -n 0x30 -l 30 sensor: version 1.39 idx = 0e -- BMC version 0.48, IPMI version 1.5 _ID_ SDR_Type_xx Sz Own Typ S_Num Sens_Description Hex & Interp Reading 000e SDR Full 01 39 20 sensnum 30 Baseboard Temp = 1d OK 29.00 degrees C hi-crit 65.00 hi-noncr 60.00 lo-noncr 10.00 lo-crit 5.00 Setting SDR 000e sensor 30 to lo=1e hi=ff GetThreshold[30]: 30 1b 0a 05 00 3c 41 00 SetThreshold[30]: 30 03 20 1f 1e 00 00 00 SetSensorThreshold[30] to lo=1e(30.000) hi=ff(0.000), ret = 0 # This sets the lower non-crit to 1e (30 C), and lower crit to 1f (31 C), and would cause a sensor threshold event. Note that this utility takes the raw threshold value and increments it sequentially for each of the severities. Now we should set the lower threshold back to a more normal value of 5 C. # ipmiutil sensor -i 0e -t -n 0x30 -l 5 sensor: version 1.39 idx = 0e -- BMC version 0.48, IPMI version 1.5 _ID_ SDR_Type_xx Sz Own Typ S_Num Sens_Description Hex & Interp Reading 000e SDR Full 01 39 20 a 01 snum 30 Baseboard Temp = 1b Crit-lo 27.00 degrees C hi-crit 66.00 hi-noncr 60.00 lo-noncr 10.00 lo-crit 5.00 Setting SDR 000e sensor 30 to lo=05 hi=ff GetThreshold[30]: 30 1b 20 1f 00 3c 42 00 SetThreshold[30]: 30 03 07 06 05 00 00 00 SetSensorThreshold[30] to lo=05(5.000) hi=ff(0.000), ret = 0 # The threshold events can be displayed via ipmiutil sel. # ipmiutil sel -l4 4b18 07/17/06 14:33:14 BMC 01 Temperature 30 LoC thresh OK now act=1b thr=06 4b04 07/17/06 14:33:14 BMC 01 Temperature 30 LoN thresh OK now act=1b thr=07 4af0 07/17/06 14:26:38 BMC 01 Temperature 30 Lo Crit thresh act=1b thr=1f 4adc 07/17/06 14:26:38 BMC 01 Temperature 30 Lo Noncrit thresh act=1b thr=20 # ---------------------------------------------------------------- 4.2 How to configure a system for IPMI LAN ---------------------------------------------------------------- Below is a sample IPMI LAN configuration with IPMI LAN enabled, PEF Alerts enabled, and 2 users configured for IPMI LAN. The key unique LAN parameters that must be configured for basic IPMI LAN functionality are: 3,4,5,6,12,13, plus the Channel Access Mode and User Access. Additional parameters for PEF and SOL are shown below also. Defaults for required parameters are detected by ipmiutil lan, except for the username, password, and the BMC LAN IP if it is not shared. The detection uses the OS LAN configuration to find the gateway IP, MAC addresses, mask, etc. # ipmiutil lan -e -u user2 -p password2 [-I 192.168.1.1 ] [-L 3] Running "ipmiutil lan -e -u user2 -p password2" would set up all required IPMI LAN parameters if the OS and BMC share an IP address. If not, the -I parameter should be included to specify the BMC IP. You may want to add -G [-H] to specify the gateway IP address [gateway MAC] if the OS does not have a NIC on the same subnet. To configure an RMM NIC for IPMI LAN, the '-L 3' parameter specifies the RMM NIC as IPMI LAN channel 3. Otherwise ipmiutil detects the first available IPMI LAN channel and configures it (usually channel 1). Note that this also sets up the PEF table for events, but the channel is not enabled for PEF events unless an Alert destination is specified, either in snmpd.conf or via -A. Note that the IPMI LAN protocol works only from remote systems. The IPMI LAN cannot recognize LAN commands from the local system because those requests never really go onto the physical network. Use the non-LAN form of a given ipmiutil command (without -N) to run locally. Below is sample output from a system after being configured for IPMI LAN. # ipmiutil lan ipmiutil ver 2.71 ilan ver 2.71 -- BMC version 0.66, IPMI version 2.0 ilan, GetPefEntry ... PEFilter(01): 01 Temperature Sensor event - enabled for alert PEFilter(02): 02 Voltage Sensor event - enabled for alert PEFilter(03): 04 Fan Failure event - enabled for alert PEFilter(04): 05 Chassis Intrusion event - enabled for alert PEFilter(05): 08 Power Supply Fault event - enabled for alert PEFilter(06): 0c Memory ECC Error event - enabled for alert PEFilter(07): 0f BIOS POST Error event - enabled for alert PEFilter(08): 07 FRB Failure event - enabled for alert PEFilter(09): 13 Fatal NMI event - enabled for alert PEFilter(10): 23 Watchdog Timer Reset event - enabled for alert PEFilter(11): 12 System Restart event - enabled for alert PEFilter(12): 20 OS Critical Stop event - enabled for alert PEFilter(13): 09 Power Redundancy Lost event - enabled for alert PEFilter(14): 09 Power Unit OK event - enabled for alert PEFilter(15): 01 Temperature OK event - enabled for alert PEFilter(16): 02 Voltage OK event - enabled for alert PEF Control: 01 : PEFenable PEF Actions: 2f : Alert PwrDn Reset PwrCyc DiagInt PEF Startup Delay: 3c : 60 sec PEF Alert Startup Delay: 3c: 60 sec PEF Alert Policy[1]: 01 18 11 00 : Chan[1] Dest[1] Enabled PEF Alert Policy[2]: 02 00 00 00 : Disabled PEF Alert Policy[3]: 03 00 00 00 : Disabled PEF Alert Policy[4]: 04 00 00 00 : Disabled ilan, GetLanEntry for channel 1 ... Lan Param(0) Set in progress: 00 Lan Param(1) Auth type support: 15 : None MD5 Pswd Lan Param(2) Auth type enables: 14 14 14 14 00 : MD5 Pswd Lan Param(3) IP address: 192 168 1 192 Lan Param(4) IP addr src: 01 : Static Lan Param(5) MAC addr: 00 15 17 8b b4 aa Lan Param(6) Subnet mask: 255 255 255 0 Lan Param(7) IPv4 header: 1e 00 00 Lan Param(10) BMC grat ARP: 01 : Grat-ARP enabled Lan Param(11) grat ARP interval: 04 : 2 sec Lan Param(12) Def gateway IP: 192 168 1 200 Lan Param(13) Def gateway MAC: 00 15 17 8b b4 71 Lan Param(14) Sec gateway IP: 0 0 0 0 Lan Param(15) Sec gateway MAC: 00 00 00 00 00 00 Lan Param(16) Community string: public Lan Param(17) Num dest: 04 Lan Param(18) Dest type: 01 00 01 00 00 Lan Param(18) Dest type: 02 00 00 00 00 Lan Param(18) Dest type: 03 00 00 00 00 Lan Param(18) Dest type: 04 00 00 00 00 Lan Param(19) Dest address: 01 00 00 [192 168 1 161] 00 07 e9 06 15 31 Lan Param(19) Dest address: 02 00 00 [0 0 0 0] 00 00 00 00 00 00 Lan Param(19) Dest address: 03 00 00 [0 0 0 0] 00 00 00 00 00 00 Lan Param(19) Dest address: 04 00 00 [0 0 0 0] 00 00 00 00 00 00 Lan Param(192) DHCP Server IP: 0 0 0 0 Lan Param(193) DHCP MAC Address: 00 00 00 00 00 00 Lan Param(194) DHCP Enable: 00 Channel(1=lan) Access Mode: 02 04 : Always Avail, PEF Alerts Enabled ilan, GetSOL for channel 1 ... SOL Enable: 01 : enabled SOL Auth: 82 : User SOL Accum Interval: 04 32 : 20 msec SOL Retry Interval: 06 14 : 200 msec SOL nvol Baud Rate: 0a : 115.2k SOL vol Baud Rate: 00 : nobaud SOL Payload Support(1): 03 00 15 00 00 00 00 00 SOL Payload Access(1,1): 02 00 00 00 : enabled SOL Payload Access(1,2): 02 00 00 00 : enabled SOL Payload Access(1,3): 00 00 00 00 : disabled SOL Payload Access(1,4): 00 00 00 00 : disabled Users: showing 4 of max 15 users (2 enabled) User Access(chan1,user1): 0f 02 01 14 : IPMI, Admin () User Access(chan1,user2): 0f 02 01 14 : IPMI, Admin (root) User Access(chan1,user3): 0f 02 01 0f : No access (admin) User Access(chan1,user4): 0f 02 01 0f : No access () ipmiutil lan, completed successfully ---------------------------------------------------------------- 4.3 Usage of IPMI utilities for Automatic IPMI LAN configuration ---------------------------------------------------------------- Suppose there are a number of IPMI servers that need to have their IPMI LAN interface configured. Shell access to the servers (via ssh or similar) is assumed. IPMI LAN, Simple case, password is not changed, default user: [ssh connection] # ipmiutil lan -e [ssh exit] IPMI LAN, Complex case, assuming that a password needs to be set and that the session text (or script) must encrypt the password. Assumes that we are setting a non-default user named 'admin' below. So, using the gnupg.org utilities with public/private keys would look something like this: [ Set up list (or db) of encrypted passwords & key by nodename. Note that the list and keyfile could reside locally, building the ssh script syntax, so that only the encrypted password is exposed remotely. ] [ssh connection] # gpg --import mykey.file # mynode=`uname -n` # my_enc_psw=`grep $mynode mylist.file |cut -f2` # ipmiutil lan -e -u admin -p `gpg --decrypt $my_enc_psw` [ssh exit] ---------------------------------------------------------------- 4.4 Usage of IPMI Utilities to Set Watchdog timer ---------------------------------------------------------------- Watchdog timer coverage over the phases of boot and OS operation: Power-on to end-of-POST = BIOS FRB2 end-of-POST to OS Running = BIOS OS Boot Timeout OS User-space operation = SMS Timeout via "ipmiutil wdt" Each of these phases uses the same watchdog timer mechanism but initializes the timer with different values. For user-space watchdog control, use "ipmiutil wdt" to read, set, and reset the IPMI watchdog timer. There is an init script provided with ipmiutil to automate this task. # chkconfig --add ipmiutil_wdt (skip this if no chkconfig) # /etc/rc.d/init.d/ipmiutil_wdt start This sets the watchdog timer to reset the system if the wdt is not restarted within 90 seconds. It creates an /etc/cron.d/wdt file to restart wdt every 60 seconds. This user-space approach is desirable if you wish the watchdog to expire for such conditions as out-of-memory or out-of-processes, since the cron job will start a short process for each invocation. Note that this also does not require additional services or modules to be running all the time. Note that the device-independent way to start/stop watchdog timers in Linux is to use the /dev/watchdog interface via the OpenIPMI driver. For kernel-space watchdog management, you could build a custom kernel with embedded watchdog support by changing the CONFIG_IPMI_* driver parameters to =y in the Linux .config (including CONFIG_IPMI_WATCHDOG) and building the kernel. Then edit grub.conf to start the watchdog with the kernel parameter "ipmi_watchdog_start_now=1". ---------------------------------------------------------------- 4.5 Usage of kernel panic handler code (now CONFIG_IPMI_PANIC_EVENT): ---------------------------------------------------------------- If a Linux panic occurs, the bmc_panic module will automatically save the date/time of the panic, and minimal information about the panic. This information will also be sent via SNMP to the remote management console, and (if bmcpanic.patch) the Alarms panel LED will be turned on. If lkcd is also configured, a full crash-dump of the panic will be saved for later analysis. After this, the system will automatically reboot. This provides instant notification to the administrator, and significantly improved post-mortem diagnosis. Without these features, the administrator may never have any indication that the system had crashed, and no way to know how to diagnose and fix the problem. To enable this, set CONFIG_IPMI_PANIC_EVENT=y and CONFIG_IPMI_PANIC_STRING=y in the kernel .config file. You can also run ipmiutil lan to enable sending an SNMP trap for a kernel panic as an "OS Critical Stop" event. Make sure that the panic timeout is not zero (infinite), by using echo "5" > /proc/sys/kernel/panic or by adding 'append="panic=5"' to the lilo or grub configuration. After a panic occurs, you can then use ipmiutil sel to view the firmware SEL for that event. It should look something like this: # ipmiutil sel [...] 2d04 07/21/04 07:54:22 SMI 20 OS Critical Stop 46 (Fat) 6f [a1 61 74] 2d18 OEM Event 20 00 Fatal excep 2d2c OEM Event 20 01 tion [...] ---------------------------------------------------------------- 4.6 Interpreting BMC LAN SNMP Traps from Platform Events. ---------------------------------------------------------------- There are MIB files provided for BMC LAN SNMP traps with this project. They are installed into /usr/share/ipmiutil/bmclan*.mib, and sym-linked into /usr/share/snmp/mibs/. The Platform Event Traps (enterprises.3183) are defined in bmclanpet.mib. The Alert-on-LAN traps (enterprises.3183) are defined in bmclanaol.mib. Note that Plaform Event Traps also have a 46-byte binary variable bindings field included with the trap. See Section 12.5 and 12.6 from the Intel ISM 5.x TPS for background. Actual PET Trap Data from a System Restart Event trap: snmputil: trap generic=6 specific=1208065 from -> 10.243.42.197 Variable = .iso.org.dod.internet.private.enterprises.3183.1.1.1 Value = String <0xa4><0x12><0x00><0x5f><0x62><0xa1><0xd5><0x11><0x00><0x80><0x60><0xff><0x94><0x47><0x03><0x00><0x21><0x19><0x0c><0x7f><0x3b><0x12><0xff><0xff><0x20><0x20><0x00><0x01><0x83><0x00><0x00><0x01><0xff><0xff><0x00><0x00><0x00><0x00><0x00><0x19><0x00><0x00><0x01><0x57><0x00><0x0c><0xc1> Byte Mapping Bytes of the trap variable binding data are mapped. An extra byte of data is at the end (47). Byte Data Meaning 1 0xa4 System GUID (16 bytes) 2 0x12 3 0x00 4 0x5f 5 0x62 6 0xa1 7 0xd5 8 0x11 9 0x00 10 0x80 11 0x60 12 0xff 13 0x94 14 0x47 15 0x03 16 0x00 17 0x21 Sequence Number/Cookie (2 bytes) 18 0x19 19 0x0c Local Timestamp (4 bytes) 20 0x7f 21 0x3b 22 0x12 23 0xff UTC Offset (2 bytes) 24 0xff 25 0x20 Trap Source Type 26 0x20 Event Source Type 27 0x00 Event Severity 28 0x01 Sensor Device 29 0x83 Sensor Number 30 0x00 Entity 31 0x00 Entity Instance 32 0x01 Event Data (8 bytes max, 3 bytes used) 33 0xff 34 0xff 35 0x00 36 0x00 37 0x00 38 0x00 39 0x00 40 0x19 filler byte 41 0x00 Manufacturer ID (4 bytes, 000157=Intel) 42 0x00 43 0x01 44 0x57 45 0x00 Product ID (2 bytes) 46 0x0c 47 0xc1 extra byte Also, there is an optional "Extended Platform Event Trap" format defined for IPMI which breaks up the 46-byte binary varbind into separate varbinds for easier parsing. See section 4.10 for how to use ipmiutil to perform the configuration and interpretation of IPMI PET traps. For example, the above trap would be interpreted as follows: # events -p 00 80 60 ff 94 47 03 00 21 19 0c 7f 3b 12 ff ff 20 20 00 01 83 00 00 01 ff ff 00 00 00 00 00 19 00 00 01 57 00 0c c1 events version 2.34 0019 08/23/04 11:13:06 BMC 12 System Event #83 OEM System Boot 6f [01 ff ff] ---------------------------------------------------------------- 4.7 Interpreting newer PECI sensors for CPU Thermal Margin ---------------------------------------------------------------- The newer CPUs do more monitoring internally rather that using absolute temperature thresholds from the BMC. The CPU knows best what its thresholds should be, and the thresholds may be different for different CPUs. So, there are several IPMI sensors that expose the state of the CPU temperature via the newer PECI interface. 1) Thermal Margin - A negative value indicating margin to throttling point. Once margin reaches 0, throttling begins 2) Therm Control % - Reports the percentage of time within a 5.8 second sliding window during which the processor was throttling 3) VRD Hot - Discrete sensor indicating one of the phases of the processor VRD circuit on the baseboard has exceeded it's limit. This is not indicative of CPU - just the VR circuit on the baseboard. Therm Margin is the one to watch if you want max performance without throttling. If it reaches 0, you will start losing performance to throttling. However, the Therm Margin throttling is well in advance of the temperatures that would cause a CPU ThermTrip condition and shut off the system. ---------------------------------------------------------------- 4.8 How to configure a system for IPMI Serial-Over-LAN Console ---------------------------------------------------------------- The Serial-Over-LAN (SOL) console configuration requires configuring BIOS, BMC/IPMI, and OS parameters. Intel S5000 motherboards and prior use Serial Port B (ttyS1) for SOL, but Intel S5500 and most other vendors use Serial Port A (ttyS0). Enter BIOS Setup for Serial Console Redirection parameters: (these vary by platform) Console Redirection = Serial Port A ACPI Redirection = Disabled Baud Rate = 19.2K (or 115.2k) Flow Control = CTS/RTS Terminal Type = VT100 Legacy Redirection = Enabled or Disabled (optional, for DOS) Note that the Baud Rate can vary, but it must match in all locations where it is used (BIOS, IPMI, and Linux). Some vendors may have OS utilities to change BIOS parameters, for instance, Intel BIOS would use 'syscfg /bcs COM1 19200 CTS VT100' to do this. Run this sample command for IPMI LAN & SOL configuration: ipmiutil lan -e -u user2 -p password2 [-B 115.2k] [-I 192.168.1.1] Use the -I portion if your BMC does not share a MAC address with the OS. If not specified, the baud rate defaults to either 19.2k or the baud previously set with "ipmiutil serial", if set. If there is more than one IPMI LAN channel, the alternate channel can be configured by adding "-L 3" for channel 3. ---- FOR LINUX SERIAL CONSOLE ----- Edit /boot/grub/grub.conf to: add "console=ttyS0,19200n8" on the end of the kernel line, then comment out the "splashimage=" line and optionally add these lines for grub menu display serial --unit=0 --speed=19200 --word=8 --parity=no --stop=1 (use --unit=1 if ttyS1) terminal --timeout=10 serial console (Adding these two lines sometimes does not timeout and continue without user interaction using some grub-0.9x versions.) If using /etc/inittab, edit it to add: co:2345:respawn:/sbin/agetty -h -L 19200 ttyS0 vt100 If using Ubuntu, RHEL6, or Fedora 11, the /etc/inittab has been replaced by Upstart, with a different procedure. If using Upstart (Ubuntu, RHEL6), adding the console=ttyS0,19200n8 in grub will auto-start everything. Editing the serial init for getty is not required. However, if you want to use hardware flow control, change the /etc/init/serial.conf last line to: exec /sbin/agetty -h -L $SPEED /dev/$DEV vt100-nav Edit /etc/securetty to add: ttyS0 Edit $HOME/.bashrc or /etc/bashrc to add: stty crtscts Adding "stty crtscts" in your bashrc turns on RTS/CTS flow control once you are logged in. Otherwise operations with lots of output may miss some chunks of data. Some Linux distributions do not turn this on by default. ---- FOR WINDOWS SERIAL CONSOLE ----- To configure Windows for Serial (System Admin Console), these BOOTCFG.EXE commands manipulate the BOOT.INI for SAC: BOOTCFG /EMS ON /PORT BIOSSET /ID 1 (Enables SAC) BOOTCFG /EMS OFF /ID 1 (Disables SAC) ---- FOR FREEBSD SERIAL CONSOLE ----- Open the file /etc/ttys with an editor and set up a line like this: ttyu0 "/usr/libexec/getty std.19200" vt100 on secure For more details, see http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/serialconsole-setup.html ---------------------------------------------------------------- 4.9 Using ipmiutil Library APIs for custom programs ---------------------------------------------------------------- The various driver modules and LAN interfaces are included in libipmiutil.a which is built by "cd util; make libipmiutil.a". The library is named ipmiutil.lib in Windows. The library is built by default along with the ipmi_sample application to show how to use this library. Note that ipmi_sample is linked with libcrypto.so (option -lcrypto) in order to support the lanplus interface. Only the SOL console function requires lanplus, all other functions can use the lan interface, since the IPMI 2.0 firmware is required to support both lan and lanplus. If the custom program does not require the lanplus interface, it can be reconfigured without lanplus by first running './configure --enable-standalone'. This library provides a common interface to use IPMI commands. See section 9.0 for more information about the common library APIs. See util/ipmi_sample.c for an example of how these APIs can be used. ---------------------------------------------------------------- 4.10 How to configure a system for SNMP Traps via IPMI PEF rules ---------------------------------------------------------------- The IPMI Platform Event Filter (PEF) actions support sending SNMP v1 traps from the IPMI firmware when IPMI events occur, regardless of the state of the OS. 1) Configure the server to send IPMI PET traps. These can be configured using ipmiutil on the target server with ipmiutil. This command will enable the PEF rules for SNMP traps. # ipmiutil lan -e -I -A [-k] [-a num] The -k option enables PEF rules for the "OK" or clearing traps for certain IPMI events. Note that several SNMP alert destinations can be specified by using the -a num option, where num=1,2,3,4 (1 is the default). This enables the following PEF rules: PEFilter(01): 01 Temperature Sensor event - enabled for alert PEFilter(02): 02 Voltage Sensor event - enabled for alert PEFilter(03): 04 Fan Failure event - enabled for alert PEFilter(04): 05 Chassis Intrusion event - enabled for alert PEFilter(05): 08 Power Supply Fault event - enabled for alert PEFilter(06): 0c Memory ECC Error event - enabled for alert PEFilter(07): 0f BIOS POST Error event - enabled for alert PEFilter(08): 07 FRB Failure event - enabled for alert PEFilter(09): 13 Fatal NMI event - enabled for alert PEFilter(10): 23 Watchdog Timer Reset event - enabled for alert PEFilter(11): 12 System Restart event - enabled for alert PEFilter(12): 20 OS Critical Stop event - enabled for alert PEFilter(13): 09 Power Redundancy Lost event - enabled for alert PEFilter(14): 09 Power Unit OK event - enabled for alert PEFilter(15): 01 Temperature OK event - enabled for alert PEFilter(16): 02 Voltage OK event - enabled for alert Note that Fan failure events do not have a clearing trap because a fan failure would usually require removing system power to physically replace the fan. The IPMI Platform Event Traps (PET) can then be tested with these steps: 2) On the trap receiver, start the SNMP services. For Linux, this would be: Optionally edit /etc/snmp/snmpd.conf for a broader view, e.g.: view systemview included .1 /etc/init.d/snmpd start /etc/init.d/snmptrapd start 3) On the server under test, cause an event by: a) removing and reinserting a power supply, or b) setting the temperature thresholds out of range: ipmiutil sensor -n 20 -t -h 15 (sets the Baseboard Temp high threshold to 15 degrees C) then setting the temperature thresholds back to normal: ipmiutil sensor -n 20 -t -h 61 (sets the Baseboard Temp high threshold to 61 degrees C) c) you can see the IPMI events generated by doing: ipmiutil sel The IPMI PET traps (enterprises.3183) are defined in /usr/share/ipmiutil/bmclanpet.mib, and the alert destination system (trap receiver) can interpret them with the ipmiutil events utility as follows: 4) Get the sensor output from a server of the same type. Copy /usr/share/ipmiutil/sensor_out.txt to the system where the traps are received. This would not be required if the trap receiver and server are both the same type. 5) Get the hex data bytes from the IPMI PET trap. This sample was taken from /var/log/messages on a Linux system with snmptrapd: Sep 26 11:22:17 chapin1 snmptrapd[19859]: 2008-09-26 11:22:17 ac1-tigw1u-bmc [10.243.42.235] (via 10.243.42.235) TRAP, SNMP v1, community public SNMPv2-SMI::enterprises.3183.1.1 Enterprise Specific Trap (65792) Uptime: 141 days, 11:37:06.13 SNMPv2-SMI::enterprises.3183.1.1.1 = Hex-STRING: B1 D8 4F 76 1D E2 11 DC B3 E8 00 0E 0C C7 1B A0 11 08 14 31 D3 D4 FF FF 20 20 10 20 30 53 44 50 2B 30 00 00 00 00 00 19 00 00 01 57 08 11 C1 6) Skip the first 8 hex bytes from the hex data above and pass the data to the ipmiutil events application. # sfil=/usr/share/ipmiutil/sensor_out.txt # ipmiutil events -p -s $sfil B3 E8 00 0E 0C C7 1B A0 11 08 14 31 D3 D4 FF FF 20 20 10 20 30 53 44 50 2B 30 00 00 00 00 00 19 00 00 01 57 08 11 C1 events version 2.34 000b SDR Full 01 01 20 a 01 snum 30 Baseboard Temp 0008 09/26/08 04:50:12 BMC 01 Temperature #30 Lo Noncrit thresh act=2b thr=30 This output should match the output from 'ipmiutil sel' on the server. See also section 4.6 for the format of the IPMI PET data. ---------------------------------- 5.0 IPMI UTILITIES ON WINDOWS ---------------------------------- Sample file contents of the ipmiutil win32/64 zip archive: README.txt - Information about the archive, with install instructions LICENSE.txt - the BSD license UserGuide.txt - the ipmiutil User Guide ChangeLog.txt - change history install.cmd - INSTALL ipmiutil uninstall.cmd - UNINSTALL ipmiutil ipmiutil.exe - meta-command for all of the functions ipmiutil_wdt.cmd - automatically resets the watchdog timer checksel.cmd - automatically checks the SEL for nearly full ialarms.cmd - shortcut for ipmiutil alarms icmd.cmd - shortcut for ipmiutil cmd iconfig.cmd - shortcut for ipmiutil config idiscover.cmd - shortcut for ipmiutil discover ievents.exe - shortcut for ipmiutil events ifru.cmd - shortcut for ipmiutil fru igetevent.cmd - shortcut for ipmiutil getevent ihealth.cmd - shortcut for ipmiutil health ilan.cmd - shortcut for ipmiutil lan isensor.cmd - shortcut for ipmiutil sensor iserial.cmd - shortcut for ipmiutil serial isel.cmd - shortcut for ipmiutil sel isol.cmd - shortcut for ipmiutil sol ireset.cmd - shortcut for ipmiutil reset iwdt.cmd - shortcut for ipmiutil wdt showsel.reg - to add showsel DLL to registry showselun.reg - to remove showsel DLL from registry showselmsg.dll - DLL for System Log IPMI messages libeay32.dll - from openssl crypto ssleay32.dll - from openssl crypto buildsamp.cmd - to build the sample programs ipmiutil.dll - use this with the static library ipmiutil.lib - static library with ipmiutil functions ipmiutillib.dll - Use this for dynamic DLL ipmiutillib.lib - link this into samples to use dynamic DLL ipmiutillib.exp - exported list of ipmiutil functions ipmi_sample.exe - sample application ipmi_sample_evt.exe - sample application with eventing The install and build instructions are below, all other information in the UserGuide.txt is the same for Windows and Linux. ---------------------------------- 5.1 WINDOWS INSTALL INSTRUCTIONS ---------------------------------- If installing from an MSI file, just double-click to run the install wizard. If installing from the ZIP file, just run install.cmd. Otherwise, these are the manual steps to perform. The showselmsg.dll needs to be copied into the %SystemRoot%\System32 directory and then run showsel.reg, so that the Windows EventLog service can find information about the showsel events. Note that the openssl crypto libraries (libeay32.dll and ssleay32.dll) should be copied to %SystemRoot%\System32 to provide crypto functions for the lanplus logic, if they are not already present. For WinPE 64-bit, or other variants without openssl, see also http://www.indyproject.org/Sockets/fpc/OpenSSLforWin64.en.aspx Note that for Windows Vista/7 workstation and later, make sure to 'Run as administrator' when installing. Windows Server should not require this step. The utilities can be run separately, or an ipmiutil directory can be added into the %PATH%. A sample install batch file: > set MYBIN=c:\bin > copy libeay32.dll %SystemRoot%\system32 > copy ssleay32.dll %SystemRoot%\system32 > copy showselmsg.dll %SystemRoot%\system32 > start showsel.reg > mkdir %MYBIN% > copy *.exe %MYBIN% The usage of ipmiutil in Windows is the same as in Linux OS, with the exception of drivers: * The Intel IPMI driver supported is the Intel IMB driver (imbdrv.sys), which can be obtained from the Intel Resource CD for your system, from the ISM CD, or from http://www.intel.com by searching downloads for IMB driver. http://downloadfinder.intel.com/scripts-df-external/Product_Search.aspx?Prod_nm=imb+driver or cached at http://ipmiutil.sf.net/kern/imbdrv130.zip * The Microsoft IPMI driver (ipmidrv.sys), which comes with Windows 2003 R2 and later, is also supported. It should be noted that the two IPMI drivers should not be installed at the same time, since they will interfere with each other. Note that there are several outstanding bug reports against the Microsoft ipmidrv.sys driver which may affect its usage: * ipmidrv.sys does not support systems with 4-byte register spacing https://social.technet.microsoft.com/forums/windowsserver/en-US/223e3a0d-3daa-4141-9c13-3169f766a7d5/win2008-ipmidrvsys-does-not-load-if-register-spacing-4 * ipmidrv.sys WBEM access memory leak https://sourceforge.net/p/ipmiutil/support-requests/11/ https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/ca4df181-7fd4-4912-83a0-5896b030e3ca/latest-version-of-microsoft-ipmi-driver-ipmidrvsys?forum=wdk * ipmidrv.sys with Windows 2012 does not work on many IPMI systems This version is more broken than the Win2008 version. If you are affected by any of these issues, you can download and install the imbdrv.sys as described below, but you must also disable the MS ipmidrv.sys. For some systems or applications, you may need to uninstall the Microsoft IPMI driver, like this: * start Control Panel/System app * go to Hardware tab, start Device Manager * select View/Show Hidden Devices * go to "System Devices", * right-click "Microsoft Generic IPMI Compliant Device" * select Properties * on driver tab, click "Uninstall" * then reboot. If you are running Windows 2012, the Device Manager does not support this, so use these steps to disable the Microsoft IPMIDRV: * Start a command prompt with 'Run as administrator' * cd \windows\system32\drivers * move ipmidrv.sys ipmidrv.old * then reboot How to install Intel IPMI driver from the cached copy at http://ipmiutil.sf.net/kern/imbdrv130.zip Extract imbdrv130.zip to c:\temp or similar > cd c:\temp > cd x86_64 (or 'cd ia32' if 32-bit Windows) > install.bat (DeviceSetup.exe install imbdrv.inf *IMBDRV) > driverquery (shows the drivers currently installed/running) How to install the Windows Intel IPMI driver (imbdrv.sys from the Intel CD): > cd c:\temp > copy d:\ism\software\win32\pi\common\imb*.* > copy d:\ism\software\win32\pi\common\win2k*.exe > ren imbdrv2k.sys imbdrv.sys > copy imbapi.dll %SystemRoot%\system32 > win2kinstall c:\temp\imbdrv.inf *IMBDRV > driverquery (shows the drivers currently installed/running) Note that when using 32-bit binaries on 64-bit Windows Server installations, make sure that the Microsoft VC++ Redistributable package is installed (vcredist_x86.exe). See http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en to download this if needed. ---------------------------------- 5.2 WINDOWS BUILD INSTRUCTIONS ---------------------------------- The ipmiutil Windows binaries for each release are pre-built and posted at http://ipmiutil.sourceforge.net, but here is how to build the ipmiutil EXEs for Windows from source. Note that the WIN32 compile flag is used. The ipmiutil buildwin.cmd shows how to compile and link the lib and exe files, although many people prefer instead to do builds with the Microsoft VisualStudio project GUI. 5.2.1 Install Visual Studio The build environment assumes that VisualStudio 6.0 VC98 or later is installed. 5.2.2 Download contrib files Before running buildwin.cmd, first download the contributed files for Windows (includes getopt.c and openssl). A copy of these files is available from http://ipmiutil.sf.net/FILES/ipmiutil-contrib.zip The above zip contains all of the contributed source used. Refer to getopt.c from one of these BSD getopt.c (used by default in ipmiutil.exe): http://www.openmash.org/lxr/source/src/getopt.c?c=gsm public domain getopt.c: http://www.koders.com/c/fid034963469B932D9D87F91C86680EB08DB4DE9AA3.aspx GNU LGPL getopt.c: http://svn.xiph.org/trunk/ogg-tools/oggsplit/ Refer to openssl from this link (Apache-style license, not gpl) http://www.openssl.org/source/openssl-0.9.8x.tar.gz (used by default) 5.2.3 Copy initial contrib files into ipmiutil Below are sample directories where ipmiutil*.tar.gz was unpacked, and where the openssl*.tar.gz was unpacked. > set ipmiutil_dir=c:\dev\ipmiutil > set openssl_dir=c:\dev\openssl First, copy the getopt.c & getopt.h into the util directory. From the directory where ipmiutil-contrib.zip was unpacked, > copy getopt.* %ipmiutil_dir%\util The iphlpapi.lib comes from Visual Studio (2003 .Net), Win2003 DDK, or WinSDK. > copy iphlpapi.lib %ipmiutil_dir%\lib > copy iphlpapi.h %ipmiutil_dir%\util 5.2.4 Build the openssl libraries To build from original source you would then want to build a copy of openssl for Windows, and copy the built openssl files to lib & inc. Follow the openssl build instructions from INSTALL.W32 for VC++ to build these binaries. 5.2.5 Copy the resulting LIB and DLL binaries to ipmiutil > copy %openssl_dir%\out32dll\libeay32.lib %ipmiutil_dir%\lib > copy %openssl_dir%\out32dll\ssleay32.lib %ipmiutil_dir%\lib > copy %openssl_dir%\out32dll\libeay32.dll %ipmiutil_dir%\util > copy %openssl_dir%\out32dll\ssleay32.dll %ipmiutil_dir%\util > mkdir %ipmiutil_dir%\lib\lanplus\openssl > copy %openssl_dir%\include\openssl\*.h %ipmiutil_dir%\lib\lanplus\openssl 5.2.6 Set the Visual Studio variables with vcvars*.bat For your installation of Microsoft Visual Studio, it has batch files to set the Visual C variables. Run the appropriate architecture version of these batch files to set the VC variables. Example: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat or C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat or C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat 5.2.7 For Windows builds, run buildwin.cmd buildwin.cmd will build all of the Windows EXE and DLL files. It will detect whether the vcvars has been run with 32bit or 64bit. buildwin32.cmd will build only the 32-bit Windows EXE and DLL files. buildwin64.cmd will build only the 64-bit Windows EXE and DLL files. 5.2.8 For WinPE builds, run buildmin.cmd If you are using ipmiutil for a bootable WinPE environment, you will not need Serial-Over-LAN functionality, the buildmin.cmd will build the Windows ipmiutil EXE files without using the openssl libraries, to simplify the process. The openssl libraries are required for the IPMI LANplus 2.0 crypto functions that Serial-Over-LAN uses. buildmin.cmd will build the ipmiutil.exe in a minimal standalone configuration. For WinPE 64-bit, if you do want openssl for some reason, see http://www.indyproject.org/Sockets/fpc/OpenSSLforWin64.en.aspx ---------------------------------- 5.3 WINDOWS COMMAND USAGE ---------------------------------- Because of the differences in Linux getopt and the BSD getopt.c used by default in the Windows build, the order of parameters is more important in Windows. For example in Linux, the following command usages work, but not in Windows: # ipmiutil cmd 00 20 18 01 -N 192.168.1.154 # ipmiutil cmd 00 20 -N 192.168.1.154 18 01 The Windows equivalent would have to put the -N option immediately after the subfunction, as shown below: > ipmiutil cmd -N 192.168.1.154 00 20 18 01 -------------------------- 6.0 SAMPLE OUTPUT -------------------------- Below is sample ipmiutil output from an Intel TIGW1U server. # ipmiutil alarms ipmiutil ver 2.13 alarms ver 2.13 -- BMC version 0.19, IPMI version 2.0 Alarm LEDs: critical = off major = off minor = off power = off Alarm Relays: major = off minor = off disk slot 0 LED: off disk slot 1 LED: off disk slot 2 LED: off disk slot 3 LED: off disk slot 4 LED: off disk slot 5 LED: off alarms, completed successfully # ipmiutil cmd 00 20 18 01 ipmiutil ver 2.21 icmd ver 2.21 This is a test tool to compose IPMI commands. Do not use without knowledge of the IPMI specification. -- BMC version 0.19, IPMI version 2.0 respData[len=15]: 20 01 00 19 02 9f 57 01 00 11 08 00 48 00 16 send_icmd ret = 0 icmd, completed successfully # ipmiutil config -s /tmp/bmcconfig.out ipmiutil ver 2.21 bmcconfig ver 1.1 -- BMC version 0.19, IPMI version 2.0 ### bmcconfig, GetPefEntry ... ### bmcconfig, GetLanEntry for channel 1 ... ### bmcconfig, GetSOL for channel 1 ... ### bmcconfig, GetSerEntry for channel 4 ... bmcconfig, completed successfully # cat /tmp/bmcconfig.out PEFParam 6,01: 01 c0 01 01 10 ff ff 01 ff 01 95 0a 00 00 00 00 00 00 00 00 00 PEFParam 6,02: 02 c0 01 01 10 ff ff 02 ff 01 95 0a 00 00 00 00 00 00 00 00 00 PEFParam 6,03: 03 c0 01 01 08 ff ff 04 ff 01 95 0a 00 00 00 00 00 00 00 00 00 PEFParam 6,04: 04 c0 01 01 08 ff ff 05 05 6f 01 00 00 00 00 00 00 00 00 00 00 PEFParam 6,05: 05 c0 01 01 08 ff ff 08 ff 6f 06 00 00 00 00 00 00 00 00 00 00 PEFParam 6,06: 06 c0 01 01 10 ff ff 0c 08 6f 02 00 00 00 00 00 00 00 00 00 00 PEFParam 6,07: 07 c0 01 01 08 ff ff 0f 06 6f 01 00 00 00 00 00 00 00 00 00 00 PEFParam 6,08: 08 c0 01 01 10 ff ff 07 ff 6f 1c 00 00 00 00 00 00 00 00 00 00 PEFParam 6,09: 09 c0 01 01 02 ff ff 13 ff 6f 3e 03 00 00 00 00 00 00 00 00 00 PEFParam 6,10: 0a c0 01 01 01 ff ff 23 03 6f 0e 00 00 00 00 00 00 00 00 00 00 PEFParam 6,11: 0b c0 01 01 01 ff ff 12 ff 6f 02 00 00 00 00 00 00 00 00 00 00 PEFParam 6,12: 0c 80 01 01 10 ff ff 20 ff 6f ff 00 00 00 00 00 00 00 00 00 00 PEFParam 6,13: 0d 80 01 01 08 ff ff 09 ff 0b 02 00 00 00 00 00 00 00 00 00 00 PEFParam 6,14: 0e 80 01 01 04 ff ff 09 ff 0b 01 00 00 00 00 00 00 00 00 00 00 PEFParam 6,15: 0f 80 01 01 04 ff ff 01 ff 81 95 0a 00 00 00 00 00 00 00 00 00 PEFParam 6,16: 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 PEFParam 6,17: 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 PEFParam 6,18: 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 PEFParam 6,19: 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 PEFParam 6,20: 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 PEFParam 1: 01 PEFParam 2: 2f PEFParam 3: 3c PEFParam 4: 3c PEFParam 9,1: 01 18 11 00 PEFParam 9,2: 02 00 00 00 PEFParam 9,3: 03 00 00 00 PEFParam 9,4: 04 00 00 00 LanParam 0,0: 00 LanParam 1,0: 15 LanParam 2,0: 14 14 14 14 00 LanParam 3,0: 0a f3 2a eb LanParam 4,0: 01 LanParam 5,0: 00 0e 0c c7 1b a2 LanParam 6,0: ff ff ff 00 LanParam 7,0: 40 40 10 LanParam 10,0: 01 LanParam 11,0: 04 LanParam 12,0: 0a f3 2a fb LanParam 13,0: 00 d0 06 21 eb fc LanParam 14,0: 00 00 00 00 LanParam 15,0: 00 00 00 00 00 00 LanParam 16,0: 70 75 62 6c 69 63 00 00 00 00 00 00 00 00 00 00 00 00 LanParam 17,0: 04 LanParam 18,1: 01 00 01 00 00 LanParam 18,2: 02 00 00 00 00 LanParam 18,3: 03 00 00 00 00 LanParam 18,4: 04 00 00 00 00 LanParam 19,1: 01 00 00 0a f3 2a d8 00 07 e9 06 15 30 LanParam 19,2: 02 00 00 00 00 00 00 00 00 00 00 00 00 LanParam 19,3: 03 00 00 00 00 00 00 00 00 00 00 00 00 LanParam 19,4: 04 00 00 00 00 00 00 00 00 00 00 00 00 LanParam 192,0: 00 00 00 00 LanParam 193,0: 00 00 00 00 00 00 LanParam 194,0: 00 ChannelAccess 1: 02 04 SOLParam 1,0: 01 SOLParam 2,0: 82 SOLParam 3,0: 04 32 SOLParam 4,0: 06 14 SOLParam 5,0: 0a SOLParam 6,0: 00 SOLPayloadSupport 1: 00 15 00 00 00 00 00 SOLPayloadAccess 1,1: 02 00 00 00 SOLPayloadAccess 1,2: 02 00 00 00 SOLPayloadAccess 1,3: 00 00 00 00 UserAccess 1,1: 0f 02 01 14 UserName 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # UserPassword 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 UserAccess 1,2: 0f 02 01 14 UserName 2: 75 73 72 32 00 00 00 00 00 00 00 00 00 00 00 00 # UserPassword 2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 UserAccess 1,3: 0f 02 01 0f UserName 3: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # UserPassword 3: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 UserAccess 1,4: 0f 02 01 0f UserName 4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # UserPassword 4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 SerialParam 0,0: 00 SerialParam 1,0: 15 SerialParam 2,0: 14 14 14 14 00 SerialParam 3,0: 87 SerialParam 4,0: 00 SerialParam 5,0: 00 00 ff ff ff SerialParam 6,0: 03 SerialParam 7,0: 20 0a SerialParam 8,0: 16 08 SerialParam 9,0: 3f 00 SerialParam 10,0: 01 41 54 45 31 51 30 56 31 58 34 26 44 32 26 43 31 SerialParam 11,0: 2b 2b 2b 00 00 SerialParam 12,0: 41 54 48 00 00 00 00 00 SerialParam 13,0: 41 54 44 00 00 00 00 00 SerialParam 14,0: 00 SerialParam 15,0: 70 75 62 6c 69 63 00 00 00 00 00 00 00 00 00 00 00 00 SerialParam 16,0: 08 SerialParam 17,1: 01 00 05 03 00 SerialParam 17,2: 02 00 05 03 00 SerialParam 17,3: 03 00 05 03 00 SerialParam 17,4: 04 00 05 03 00 SerialParam 18,0: 3c SerialParam 19,1: 01 00 07 SerialParam 19,2: 02 00 07 SerialParam 19,3: 03 00 07 SerialParam 19,4: 04 00 07 SerialParam 29,0: 66 11 ChannelAccess 4: 2b 04 UserAccess 4,1: 0f 02 01 14 UserName 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # UserPassword 1: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 UserAccess 4,2: 0f 02 01 14 UserName 2: 75 73 72 32 00 00 00 00 00 00 00 00 00 00 00 00 # UserPassword 2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 UserAccess 4,3: 0f 02 01 0f UserName 3: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # UserPassword 3: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 UserAccess 4,4: 0f 02 01 0f UserName 4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # UserPassword 4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # ipmiutil discover -a -b 10.243.42.255 ipmiutil ver 2.21 idiscover ver 1.3 Discovering IPMI Devices: 1: response from 10.243.42.141 2: response from 10.243.42.7 3: response from 10.243.42.14 4: response from 10.243.42.145 5: response from 10.243.42.172 6: response from 10.243.42.182 7: response from 10.243.42.185 8: response from 10.243.42.183 9: response from 10.243.42.184 10: response from 10.243.42.138 11: response from 10.243.42.181 12: response from 10.243.42.179 13: response from 10.243.42.139 14: response from 10.243.42.216 15: response from 10.243.42.210 16: response from 10.243.42.229 17: response from 10.243.42.150 18: response from 10.243.42.120 19: response from 10.243.42.246 20: response from 10.243.42.158 21: response from 10.243.42.168 22: response from 10.243.42.248 23: response from 10.243.42.242 24: response from 10.243.42.243 25: response from 10.243.42.223 26: response from 10.243.42.171 27: response from 10.243.42.174 28: response from 10.243.42.222 29: response from 10.243.42.226 30: response from 10.243.42.228 31: response from 10.243.42.110 32: response from 10.243.42.120 33: response from 10.243.42.128 34: response from 10.243.42.169 idiscover: 1 pings sent, 34 responses # ipmiutil events 18 00 02 02 00 00 00 20 00 04 09 01 6f 44 0f ff ipmiutil ver 2.40 ievents version 2.40 RecId Date/Time_______ Source_ Evt_Type SensNum Evt_detail - Trig [Evt_data] 0018 12/31/69 19:00:02 BMC 09 Power Unit #01 AC Lost 6f [44 0f ff] ievents, completed successfully # ipmiutil events -p -s sensor-TIGW1U.out B3 E8 00 0E 0C C7 1B A0 11 08 12 7F 10 90 FF FF 20 20 00 20 02 15 01 41 0F FF ipmiutil ver 2.40 ievents version 2.40 0023 SDR Comp 02 2b 20 a 09 snum 02 Power Redundancy 0008 11/01/07 10:13:20 BMC 09 Power Unit #02 Redundancy Lost 0b [41 0f ff] ievents, completed successfully # ipmiutil fru ipmiutil ver 2.21 fruconfig: version 2.21 -- BMC version 0.19, IPMI version 2.0 SDR[004c] FRU 20 00 0c 01 Baseboard FRU SDR[004d] FRU 20 02 15 01 Power Dist FRU Component FRU Size : 256 Product Manufacturer: DELTA Product Name : AC-061 B Product Part Number : D76441-003 Product Version : 00 Product Serial Num : DLD0719000969 Product Asset Tag : Product FRU File ID : SDR[004e] FRU 20 03 0a 01 Pwr Supply 1 FRU Component FRU Size : 256 Product Manufacturer: DELTA Product Name : DPS-450KBA Product Part Number : D40117-007 Product Version : S6 Product Serial Num : DLD0721003047 Product Asset Tag : Product FRU File ID : SDR[004f] FRU 20 04 0a 02 Pwr Supply 2 FRU Component FRU Size : 256 Product Manufacturer: DELTA Product Name : DPS-450KBA Product Part Number : D40117-003 Product Version : S2 Product Serial Num : DLC0630000244 Product Asset Tag : Product FRU File ID : SDR[0050] IPMB 20 00 07 01 Basbrd Mgmt Ctlr Mainboard FRU Size : 256 Chassis Type : Rack-Mount Chassis Chassis Part Number : TIGW1U Chassis Serial Num : Chassis OEM Field : TIGW1U Board Mfg DateTime : Sun Jun 17 16:11:00 2007 Board Manufacturer : Intel Board Product Name : S5000PHB Board Serial Number : CFTW72400602 Board Part Number : D40552-601 Board FRU File ID : FRU Ver 0.05 Board OEM Field : Product Manufacturer: Intel Product Name : S5000PHB Product Part Number : TMWA0201W Product Version : Product Serial Num : sernum4wd Product Asset Tag : asset4wd Product FRU File ID : Product OEM Field : System GUID : b1d84f76-1de2-11dc-b3e8-000e0cc71ba0 BIOS Version : S5000.86B.10.00.D414.081520081354 fruconfig, completed successfully # ipmiutil getevt ipmiutil ver 2.21 getevent ver 2.21 -- BMC version 0.19, IPMI version 2.0 event receiver sa = 20 lun = 00 bmc enables = 0f Waiting 120 seconds for an event ... got event, sensor_type = 01 event data: 3c 22 02 7b e6 bf 48 20 00 04 01 30 01 50 2e 33 223c 09/04/08 09:45:31 BMC 01 Temperature #30 Lo Noncrit thresh act=2e thr=33 Waiting 120 seconds for an event ... got event, sensor_type = 01 event data: 64 22 02 7d e6 bf 48 20 00 04 01 30 81 50 2e 07 2264 09/04/08 09:45:33 BMC 01 Temperature #30 LoN thresh OK now act=2e thr=07 Waiting 120 seconds for an event ... get_event timeout getevent, completed successfully # ipmiutil health ipmiutil ver 2.21 bmchealth ver 2.21 BMC version 0.19, IPMI version 2.0 BMC manufacturer = 000157 (Intel), product = 0811 (TIGW1U) BIOS Version = S5000.86B.10.00.D414.081520081354 Chassis Status = 01 (on, restore_policy=stay_off) Power State = 00 (S0: working) Selftest status = 0055 (OK) Channel 15 Auth Types: Status = 00, OEM ID 000000 OEM Aux 00 bmchealth, completed successfully # ipmiutil lan ipmiutil ver 2.21 pefconfig ver 2.21 -- BMC version 0.19, IPMI version 2.0 pefconfig, GetPefEntry ... PEFilter(01): 01 Temperature Sensor event - enabled for alert PEFilter(02): 02 Voltage Sensor event - enabled for alert PEFilter(03): 04 Fan Failure event - enabled for alert PEFilter(04): 05 Chassis Intrusion event - enabled for alert PEFilter(05): 08 Power Supply Fault event - enabled for alert PEFilter(06): 0c Memory ECC Error event - enabled for alert PEFilter(07): 0f FRB Failure event - enabled for alert PEFilter(08): 07 BIOS POST Error event - enabled for alert PEFilter(09): 13 Fatal NMI event - enabled for alert PEFilter(10): 23 Watchdog Timer Reset event - enabled for alert PEFilter(11): 12 System Restart event - enabled for alert PEFilter(12): 20 OS Critical Stop event - enabled for alert PEFilter(13): 09 Power Redundancy Lost event - enabled for alert PEFilter(14): 09 Power Unit OK event - enabled for alert PEFilter(15): 01 Temperature OK event - enabled for alert PEF Control: 01 : PEFenable PEF Actions: 2f : Alert PwrDn Reset PwrCyc DiagInt PEF Startup Delay: 3c : 60 sec PEF Alert Startup Delay: 3c: 60 sec PEF Alert Policy[1]: 01 18 11 00 : Chan[1] Dest[1] Enabled PEF Alert Policy[2]: 02 00 00 00 : Disabled PEF Alert Policy[3]: 03 00 00 00 : Disabled PEF Alert Policy[4]: 04 00 00 00 : Disabled pefconfig, GetLanEntry for channel 1 ... Lan Param(0) Set in progress: 00 Lan Param(1) Auth type support: 15 : None MD5 Pswd Lan Param(2) Auth type enables: 14 14 14 14 00 Lan Param(3) IP address: 10 243 42 235 Lan Param(4) IP addr src: 01 : Static Lan Param(5) MAC addr: 00 0e 0c c7 1b a2 Lan Param(6) Subnet mask: 255 255 255 0 Lan Param(7) IPv4 header: 40 40 10 Lan Param(10) BMC grat ARP: 01 : Grat-ARP enabled Lan Param(11) grat ARP interval: 04 : 2 sec Lan Param(12) Def gateway IP: 10 243 42 251 Lan Param(13) Def gateway MAC: 00 d0 06 21 eb fc Lan Param(14) Sec gateway IP: 0 0 0 0 Lan Param(15) Sec gateway MAC: 00 00 00 00 00 00 Lan Param(16) Community string: public Lan Param(17) Num dest: 04 Lan Param(18) Dest type: 01 00 01 00 00 Lan Param(18) Dest type: 02 00 00 00 00 Lan Param(18) Dest type: 03 00 00 00 00 Lan Param(18) Dest type: 04 00 00 00 00 Lan Param(19) Dest address: 01 00 00 [10 243 42 216] 00 07 e9 06 15 30 Lan Param(19) Dest address: 02 00 00 [0 0 0 0] 00 00 00 00 00 00 Lan Param(19) Dest address: 03 00 00 [0 0 0 0] 00 00 00 00 00 00 Lan Param(19) Dest address: 04 00 00 [0 0 0 0] 00 00 00 00 00 00 Lan Param(192) DHCP Server IP: 0 0 0 0 Lan Param(193) DHCP MAC Address: 00 00 00 00 00 00 Lan Param(194) DHCP Enable: 00 Channel Access Mode(1=lan): 02 04 : Access = Always Avail, PEF Alerts Enabled pefconfig, GetSOL for channel 1 ... SOL Enable: 01 : enabled SOL Auth: 82 : User SOL Accum Interval: 04 32 : 20 msec SOL Retry Interval: 06 14 : 200 msec SOL nvol Baud Rate: 0a : 115.2k SOL vol Baud Rate: 00 : nobaud SOL Payload Support(1): 03 00 15 00 00 00 00 00 SOL Payload Access(1,1): 02 00 00 00 : enabled SOL Payload Access(1,2): 02 00 00 00 : enabled SOL Payload Access(1,3): 00 00 00 00 : disabled SOL Payload Access(1,4): 00 00 00 00 : disabled Get User Access(1): 0f 02 01 14 : IPMI, Admin () Get User Access(2): 0f 02 01 14 : IPMI, Admin (usr2) Get User Access(3): 0f 02 01 0f : No access () Get User Access(4): 0f 02 01 0f : No access () pefconfig, completed successfully # ipmiutil reset -n ipmiutil ver 2.21 hwreset ver 2.21 -- BMC version 0.19, IPMI version 2.0 Power State = 00 (S0: working) hwreset: sending NMI ... chassis_reset ok hwreset: IPMI_Reset ok hwreset, completed successfully # ipmiutil sel ipmiutil ver 2.21 showsel: version 2.21 -- BMC version 0.19, IPMI version 2.0 SEL Ver 51 Support f, Size = 3987 records, Free space = 3553 records RecId Date/Time_______ Source_ Evt_Type SensNum Evt_detail - Trig [Evt_data] 0004 07/16/08 15:17:58 BMC 10 SEL Disabled #09 Log Cleared 6f [42 0f ff] 0018 07/16/08 15:23:08 BIOS 12 System Event #83 Boot: ClockSync_1 6f [05 00 ff] 002c 07/16/08 10:23:08 BIOS 12 System Event #83 Boot: ClockSync_2 6f [05 80 ff] 0040 07/16/08 10:24:37 0033 12 System Event #01 OEM System Booted 6f [01 ff 00] 0054 07/16/08 10:24:49 BMC 22 ACPI Power State #82 S0/G0 Working 6f [40 0f ff] 0068 07/16/08 11:12:55 BMC 08 Power Supply #70 Removed ef [40 0f ff] 007c 07/16/08 11:12:55 BMC 09 Power Unit #02 Redundancy Lost 0b [41 0f ff] 0090 07/16/08 11:12:55 BMC 09 Power Unit #02 Not Redundant 0b [43 0f ff] 00a4 07/16/08 11:13:23 BMC 08 Power Supply #70 Inserted 6f [40 0f ff] 00b8 07/16/08 11:13:23 BMC 09 Power Unit #02 Redundancy OK 0b [40 0f ff] 00cc 07/16/08 11:31:30 BMC 08 Power Supply #70 Removed ef [40 0f ff] 00e0 07/16/08 11:31:31 BMC 09 Power Unit #02 Redundancy Lost 0b [41 0f ff] 00f4 07/16/08 11:31:31 BMC 09 Power Unit #02 Not Redundant 0b [43 0f ff] 0108 07/16/08 11:31:40 BMC 08 Power Supply #70 Inserted 6f [40 0f ff] 011c 07/16/08 11:31:41 BMC 09 Power Unit #02 Redundancy OK 0b [40 0f ff] 0130 07/16/08 11:46:34 BMC 01 Temperature #30 Lo Noncrit thresh act=2f thr=34 0144 07/16/08 11:46:34 BMC 01 Temperature #30 Lo Crit thresh act=2f thr=33 0158 07/16/08 11:46:36 BMC 01 Temperature #30 LoN thresh OK now act=2f thr=07 016c 07/16/08 11:46:36 BMC 01 Temperature #30 LoC thresh OK now act=2f thr=06 0180 07/16/08 12:00:59 BMC 08 Power Supply #70 Removed ef [40 0f ff] 0194 07/16/08 12:01:00 BMC 09 Power Unit #02 Redundancy Lost 0b [41 0f ff] 01a8 07/16/08 12:01:00 BMC 09 Power Unit #02 Not Redundant 0b [43 0f ff] 01bc 07/16/08 12:01:32 BMC 08 Power Supply #70 Inserted 6f [40 0f ff] [...] 1a08 08/12/08 01:57:20 SMI 20 OS Critical Stop #64 panic(dop) 6f [a1 6f 70] 1a1c 08/12/08 01:58:08 BMC 2a Session Audit #0a Deactivated User 1 6f [a1 01 11] 1a30 08/12/08 01:58:18 BMC 2a Session Audit #0a Activated User 1 6f [a0 01 01] [...] 219c 08/27/08 06:29:24 BIOS 12 System Event #83 Boot: ClockSync_1 6f [05 00 ff] 21b0 08/27/08 06:29:25 BIOS 12 System Event #83 Boot: ClockSync_2 6f [05 80 ff] 21c4 08/27/08 06:30:18 0033 12 System Event #01 OEM System Booted 6f [01 ff 00] 21d8 08/27/08 06:30:29 BMC 22 ACPI Power State #82 S0/G0 Working 6f [40 0f ff] showsel, completed successfully # ipmiutil sensor ipmiutil ver 2.21 sensor: version 2.21 -- BMC version 0.20, IPMI version 2.0 _ID_ SDR_Type_xx ET Own Typ S_Num Sens_Description Hex & Interp Reading 0001 SDR Full 01 01 20 a 02 snum 10 BB +1.2V Vtt = be OK 1.20 Volts 0002 SDR Full 01 01 20 a 02 snum 12 BB +1.5V AUX = bd OK 1.47 Volts 0003 SDR Full 01 01 20 a 02 snum 13 BB +1.5V = 75 OK 1.52 Volts 0004 SDR Full 01 01 20 a 02 snum 14 BB +1.8V = af OK 1.78 Volts 0005 SDR Full 01 01 20 a 02 snum 15 BB +3.3V = c1 OK 3.32 Volts 0006 SDR Full 01 01 20 a 02 snum 16 BB +3.3V STB = bf OK 3.29 Volts 0007 SDR Full 01 01 20 a 02 snum 17 BB +1.5V ESB = be OK 1.48 Volts 0008 SDR Full 01 01 20 a 02 snum 18 BB +5V = c3 OK 5.07 Volts 0009 SDR Full 01 01 20 a 02 snum 1a BB +12V AUX = c1 OK 11.97 Volts 000a SDR Full 01 01 20 a 02 snum 1b BB +0.9V = ba OK 0.89 Volts 000b SDR Full 01 01 20 a 01 snum 30 Baseboard Temp = 2d OK 45.00 degrees C 000c SDR Full 01 01 20 a 01 snum 32 Front Panel Temp = 1a OK 26.00 degrees C 000d SDR Full 01 01 20 a 01 snum 48 Mem Therm Margin = 00 Init 0.00 degrees C 000e SDR Full 01 01 20 m 04 snum 50 Fan 1A = 6f OK 7659.00 RPM 000f SDR Full 01 01 20 m 04 snum 51 Fan 1B = 6b OK 5457.00 RPM 0010 SDR Full 01 01 20 m 04 snum 52 Fan 2A = 69 OK 7245.00 RPM 0011 SDR Full 01 01 20 m 04 snum 53 Fan 2B = 6b OK 5457.00 RPM 0012 SDR Full 01 01 20 m 04 snum 54 Fan 3A = 6c OK 7452.00 RPM 0013 SDR Full 01 01 20 m 04 snum 55 Fan 3B = 6b OK 5457.00 RPM 0014 SDR Full 01 01 20 m 04 snum 56 Fan 4A = 6f OK 7659.00 RPM 0015 SDR Full 01 01 20 m 04 snum 57 Fan 4B = 69 OK 5355.00 RPM 0016 SDR Full 01 01 20 m 04 snum 58 Fan 5 = 63 OK 6534.00 RPM 0017 SDR Full 01 01 20 a 03 snum 78 PS1 AC Current = 05 OK 0.31 Amps 0018 SDR Full 01 01 20 a 03 snum 79 PS2 AC Current = 16 OK 1.39 Amps 0019 SDR Full 01 01 20 a 03 snum 7a PS1 +12V Current = 01 OK 0.50 Amps 001a SDR Full 01 01 20 a 03 snum 7b PS2 +12V Current = 12 OK 9.00 Amps 001b SDR Full 01 01 20 a 0b snum 7c PS1 +12V Power = 01 OK 4.00 Watts 001c SDR Full 01 01 20 a 0b snum 7d PS2 +12V Power = 1b OK 108.00 Watts 001d SDR Full 01 01 20 a 01 snum 99 P1 Therm Margin = c7 OK -57.00 degrees C 001e SDR Full 01 01 20 m 01 snum c0 P1 Therm Ctrl % = 00 OK 0.00 unspecified 001f SDR Full 01 01 20 a 02 snum d0 Proc 1 Vccp = b0 OK 1.09 Volts 0020 SDR Comp 02 6f 20 a 09 snum 01 Power Unit = 00 c0 00 00 Enabled 0021 SDR Comp 02 0b 20 a 09 snum 02 Power Redundancy = 00 c0 01 00 Redundant 0022 SDR Comp 02 6f 20 a 23 snum 03 BMC Watchdog = 00 c0 00 00 OK 0023 SDR Comp 02 6f 20 a 06 snum 04 Scrty Violation = 00 c0 00 00 OK 0024 SDR Comp 02 6f 20 a 13 snum 07 FP Interrupt = 00 c0 00 00 OK 0025 SDR Comp 02 6f 20 a 10 snum 09 Event Log Clear = 00 c0 00 00 OK 0026 SDR Comp 02 6f 20 a 2a snum 0a Session Audit = 00 c0 00 00 Activated 0027 SDR Comp 02 6f 20 a 12 snum 0b System Event = 00 c0 00 00 OK 0028 SDR Comp 02 6f 20 a 29 snum 1e BB Vbat = 00 c0 00 00 OK 0029 SDR Comp 02 6f 20 a 08 snum 70 PS1 Status = 00 c0 01 00 Present 002a SDR Comp 02 6f 20 a 08 snum 71 PS2 Status = 00 c0 01 00 Present 002b SDR Comp 02 6f 20 a 22 snum 82 ACPI State = 00 c0 01 00 Working 002c SDR Comp 02 6f 20 a 14 snum 84 Button = 00 c0 00 00 OK 002d SDR Comp 02 03 20 a f3 snum 85 SMI Timeout = 00 c0 01 00 Enabled 002e SDR Comp 02 03 20 a c0 snum 87 NMI State = 00 c0 01 00 Enabled 002f SDR Comp 02 03 20 a c0 snum 88 SMI State = 00 80 01 00 Enabled 0030 SDR Comp 02 6f 20 m 07 snum 90 Processor 1 Stat = 00 c0 80 00 ProcPresent 0031 SDR Comp 02 6f 20 a 13 snum a0 PCIe Link0 = 00 c0 00 00 OK 0032 SDR Comp 02 6f 20 a 13 snum a1 PCIe Link1 = 00 c0 00 00 OK 0033 SDR Comp 02 6f 20 a 13 snum a2 PCIe Link2 = 00 c0 00 00 OK 0034 SDR Comp 02 6f 20 a 13 snum a3 PCIe Link3 = 00 c0 00 00 OK 0035 SDR Comp 02 6f 20 a 13 snum a4 PCIe Link4 = 00 c0 00 00 OK 0036 SDR Comp 02 6f 20 a 13 snum a5 PCIe Link5 = 00 c0 00 00 OK 0037 SDR Comp 02 6f 20 a 13 snum a6 PCIe Link6 = 00 c0 00 00 OK 0038 SDR Comp 02 6f 20 a 13 snum a7 PCIe Link7 = 00 c0 00 00 OK 0039 SDR Comp 02 6f 20 a 13 snum a8 PCIe Link8 = 00 c0 00 00 OK 003a SDR Comp 02 6f 20 a 13 snum a9 PCIe Link9 = 00 c0 00 00 OK 003b SDR Comp 02 6f 20 a 13 snum aa PCIe Link10 = 00 c0 00 00 OK 003c SDR Comp 02 6f 20 a 13 snum ab PCIe Link11 = 00 c0 00 00 OK 003d SDR Comp 02 6f 20 a 13 snum ac PCIe Link12 = 00 c0 00 00 OK 003e SDR Comp 02 6f 20 a 13 snum ad PCIe Link13 = 00 c0 00 00 OK 003f SDR Comp 02 05 20 m 01 snum c8 CPU1 VRD Temp = 00 c0 00 00 OK* 0040 SDR Comp 02 05 20 a 02 snum d2 CPU1 Vcc OOR = 00 c0 00 00 OK 0041 SDR Comp 02 03 20 a 07 snum d8 CPU Popul Error = 00 c0 00 00 OK 0042 SDR Comp 02 6f 20 a 21 snum e0 DIMM 1A = 00 c0 04 00 Present 0043 SDR Comp 02 6f 20 a 21 snum e1 DIMM 2A = 00 e0 40 00 NotAvailable 0044 SDR Comp 02 6f 20 a 21 snum e2 DIMM 3A = 00 e0 40 00 NotAvailable 0045 SDR Comp 02 6f 20 a 21 snum e3 DIMM 1B = 00 c0 04 00 Present 0046 SDR Comp 02 6f 20 a 21 snum e4 DIMM 2B = 00 e0 40 00 NotAvailable 0047 SDR Comp 02 6f 20 a 21 snum e5 DIMM 3B = 00 e0 40 00 NotAvailable 0048 SDR Comp 02 6f 20 a 0c snum ec Mem A Error = 00 c0 00 00 OK 0049 SDR Comp 02 6f 20 a 0c snum ed Mem B Error = 00 c0 00 00 OK 004a SDR Comp 02 6f 20 a 25 snum f0 DIMM Spare Enb = 00 e0 40 00 NotAvailable 004b SDR Comp 02 0b 20 a 0c snum f1 DIMM Spare Redu = 00 e0 40 00 NotAvailable 004c SDR FRU 11 18 dev: 20 00 80 00 0c 01 Baseboard FRU 004d SDR FRU 11 19 dev: 20 02 80 00 15 01 Power Dist FRU 004e SDR FRU 11 1b dev: 20 03 80 00 0a 01 Pwr Supply 1 FRU 004f SDR FRU 11 1b dev: 20 04 80 00 0a 02 Pwr Supply 2 FRU 0050 SDR IPMB 12 1b dev: 20 00 bf 07 01 Basbrd Mgmt Ctlr 0051 SDR OEM c0 09 Intel: 02 02 00 01 70 71 0052 SDR OEM c0 05 Intel: 06 01 0053 SDR OEM c0 19 Intel: 0b 01 01 32 14 f0 0a a4 01 96 00 61 00 08 0a 64 00 05 00 00 00 00 0054 SDR OEM c0 19 Intel: 0b 02 01 32 14 f0 0a a4 01 ff ff ff ff 10 14 ff ff 06 00 00 00 00 0055 SDR OEM c0 19 Intel: 0b 01 02 32 14 f0 0a a4 01 96 00 61 00 08 0a 64 00 05 00 00 00 00 0056 SDR OEM c0 19 Intel: 0b 02 02 32 14 f0 0a a4 01 ff ff ff ff 10 14 ff ff 06 00 00 00 00 0057 SDR OEM c0 2c Intel: 0c 01 30 64 64 01 02 03 30 20 32 64 01 90 0d 00 2b 20 30 21 35 22 3a 23 3f 24 43 25 47 26 4c 27 51 28 56 29 5b 2a 60 2b 64 0058 SDR OEM c0 2c Intel: 0c 02 30 64 64 01 02 03 30 20 32 64 01 90 0d 00 2b 20 30 21 35 22 3a 23 3f 24 43 25 47 26 4c 27 51 28 56 29 5b 2a 60 2b 64 0059 SDR OEM c0 2c Intel: 0c 03 30 64 64 01 02 03 30 20 32 64 01 90 0d 00 2b 20 30 21 35 22 3a 23 3f 24 43 25 47 26 4c 27 51 28 56 29 5b 2a 60 2b 64 005a SDR OEM c0 15 Intel: 0c 01 30 64 64 01 02 03 00 20 99 64 02 90 01 06 00 11 005b SDR OEM c0 15 Intel: 0c 01 30 64 64 01 02 03 00 20 48 00 02 b8 01 02 00 00 005c SDR OEM c0 15 Intel: 0c 02 30 64 64 01 02 03 00 20 99 64 02 90 01 06 00 11 005d SDR OEM c0 15 Intel: 0c 03 30 64 64 01 02 03 00 20 30 64 02 90 01 02 3c 00 005e SDR OEM c0 0e Intel: 08 00 00 45 88 45 88 45 88 45 88 005f SDR OEM c0 16 Intel: 09 00 00 90 33 90 33 90 33 90 33 90 33 90 33 68 42 68 42 0060 SDR OEM c0 08 Intel: BMC_TAM0 60 01 03 01 20 nrec=4 cfg=01 0061 SDR OEM c0 31 Intel: BMC_TAM1 60 01 13 00 20 41 01 01 01 23 71 93 41 02 01 02 24 72 94 41 03 01 02 24 72 94 21 04 01 01 23 11 02 05 14 31 29 6f 01 13 23 21 09 0b 14 34 0062 SDR OEM c0 31 Intel: BMC_TAM2 60 01 23 00 20 71 07 6f 03 13 23 33 43 55 83 11 08 6f 14 21 09 6f 54 64 20 7c 01 72 94 20 7d 01 72 94 11 21 6f 03 53 23 6f 05 15 25 35 85 0063 SDR OEM c0 17 Intel: BMC_TAM3 60 01 33 00 c0 22 02 00 03 51 22 03 00 03 51 22 04 00 03 51 0064 SDR OEM c0 0e Intel: SDR File 18 0065 SDR OEM c0 11 Intel: SDR Package 18 SDR IPMI sensor: Power On Hours = 6923 hours sensor, completed successfully # ipmiutil serial ipmiutil ver 2.21 tmconfig ver 2.21 -- BMC version 0.19, IPMI version 2.0 Code 0 SEL Ver 81 Support 15 tmconfig: GetSerEntry for channel 4 ... Serial Param(0) Set in progress: 00 Serial Param(1) Auth type support: 15 : None MD5 Pswd Serial Param(2) Auth type enables: 14 14 14 14 00 Serial Param(3) Connection Mode: 87 Serial Param(4) Sess Inactiv Timeout: 00 : infinite Serial Param(5) Channel Callback: 00 00 ff ff ff Serial Param(6) Session Termination: 03 Serial Param(7) IPMI Msg Comm: 20 0a : no_flow, DTR, 115.2k Serial Param(8) Mux Switch: 16 08 Serial Param(9) Modem Ring Time: 3f 00 Serial Param(10) Modem Init String: 01 ATE1Q0V1X4&D2&C1 Serial Param(11) Modem Escape Seq: +++ Serial Param(12) Modem Hangup Seq: ATH Serial Param(13) Modem Dial Command: ATD Serial Param(14) Page Blackout Interval: 00 Serial Param(15) Community String: public Serial Param(16) Num of Alert Dest: 08 Serial Param(17) Destination Info: 01 00 05 03 00 Serial Param(17) Destination Info: 02 00 05 03 00 Serial Param(17) Destination Info: 03 00 05 03 00 Serial Param(17) Destination Info: 04 00 05 03 00 Serial Param(17) Destination Info: 05 00 05 03 00 Serial Param(17) Destination Info: 06 00 05 03 00 Serial Param(17) Destination Info: 07 00 05 03 00 Serial Param(17) Destination Info: 08 00 05 03 00 Serial Param(18) Call Retry Interval: 3c Serial Param(19) Destination Comm Settings: 01 00 07 : no_flow, 8N1, 19.2k Serial Param(19) Destination Comm Settings: 02 00 07 : no_flow, 8N1, 19.2k Serial Param(19) Destination Comm Settings: 03 00 07 : no_flow, 8N1, 19.2k Serial Param(19) Destination Comm Settings: 04 00 07 : no_flow, 8N1, 19.2k Serial Param(19) Destination Comm Settings: 05 00 07 : no_flow, 8N1, 19.2k Serial Param(19) Destination Comm Settings: 06 00 07 : no_flow, 8N1, 19.2k Serial Param(19) Destination Comm Settings: 07 00 07 : no_flow, 8N1, 19.2k Serial Param(19) Destination Comm Settings: 08 00 07 : no_flow, 8N1, 19.2k Serial Param(20) Number Dial Strings: 06 Serial Param(21) Dest Dial String: 01 01 Serial Param(21) Dest Dial String: 02 01 Serial Param(21) Dest Dial String: 03 01 Serial Param(21) Dest Dial String: 04 01 Serial Param(21) Dest Dial String: 05 01 Serial Param(21) Dest Dial String: 06 01 Serial Param(22) Number Dest IP Addrs: 04 Serial Param(23) Dest IP Address: 01 0 0 0 0 Serial Param(23) Dest IP Address: 02 0 0 0 0 Serial Param(23) Dest IP Address: 03 0 0 0 0 Serial Param(23) Dest IP Address: 04 0 0 0 0 Serial Param(29) Terminal Mode Config: 66 11 Channel Access Mode(4=Ser): 2b 04 : Access = Shared, PEF Alerts Disabled Get User Access (1): 0f 02 01 14 : IPMI, Admin () Get User Access (2): 0f 02 01 14 : IPMI, Admin (usr2) Get User Access (3): 0f 02 01 0f : No access () Get User Access (4): 0f 02 01 0f : No access () Get Serial MUX Status: 04 Get Boot Options(3): 01 03 00 tmconfig, completed successfully # ipmiutil sol -a -N 10.243.42.136 ipmiutil ver 2.21 isolconsole ver 2.21 Opening connection to node 10.243.42.136 ... Connected to node 10.243.42.136 10.243.42.136 -- BMC version 0.17, IPMI version 2.0 Opening connection to node 10.243.42.136 ... [SOL session is running, use '~' to end session.] isolconsole exit via user input isolconsole, completed successfully # ipmiutil wdt ipmiutil ver 2.21 wdt ver 2.21 -- BMC version 0.19, IPMI version 2.0 wdt data: 01 01 00 00 00 00 00 00 Watchdog timer is stopped for use with BIOS FRB2. Logging pretimeout is 0 seconds, pre-action is None timeout is 0 seconds, counter is 0 seconds action is Hard Reset wdt, completed successfully # ipmi_port ipmi_port ver 1.1 open_rmcp_port(623) succeeded, sleeping -------------------------- 7.0 PROBLEMS -------------------------- Note that each utility function has an option for extra debug output (-x), which can be used to find out the specific function which returned an error. For best-effort support, email the ipmiutil-developer mailing list: http://lists.sourceforge.net/lists/listinfo/ipmiutil-developers or enter a bug report at: http://sourceforge.net/tracker/?group_id=116222&func=browse 7.1 ERROR RETURN CODES Return code = 0 means success, negative numbers indicate failure, and a positive return code represents an IPMI completion code. RetCode Description ------ ----------------------------------------- 0 "completed successfully" -1 "error -1", a generic error, usually returned by an OS routine -2 "send to BMC failed" over IPMI LAN -3 "receive from BMC failed" over IPMI LAN -4 "cannot connect to BMC" over IPMI LAN -5 "abort signal caught", the user pressed Ctl-C -6 "timeout occurred", the timeout for a response expired -7 "length greater than max", length supplied was too big -8 "invalid lan parameter", invalid parameter for IPMI LAN function -9 "request not supported", a requested function is not supported -10 "receive too short", did not receive the minimum number of bytes -11 "error resolving hostname" neither DNS or hosts could resolve to an IP -12 "error during ping" could not perform the RMCP ping function -13 "BMC only supports lan v1". LAN 2.0 (lanplus) was attempted, but this BMC firmware only supports IPMI LAN 1.x -14 "BMC only supports lan v2". LAN 1.x was attempted, but this BMC supports LAN 2.0 but not LAN 1.x, which violates the IPMI 2.0 spec. -15 "other error", an unknown error occurred -16 "cannot open IPMI driver". No IPMI driver could be opened. Since the driverless mode is also attempted, this usually means that the user does not have root privilege. -17 "invalid parameter" a parameter was out of bounds -18 "access not allowed" user does not have access to this file or function -19 "session dropped by BMC" the BMC firmware aborted the IPMI session -20 "cannot open file" cannot open the specified file -21 "item not found" requested item was not found -22 "usage or help requested", the user requested usage/help -23 "bad format", the data format is invalid, cannot proceed -504 "error getting msg from BMC" during driverless I/Os, a command did not get a response. 7.2 IPMI COMPLETION CODES IPMI Completion Codes are defined in IPMI 1.5, Table 5-2, and are also included below in both hex and decimal format. Note that the meaning of completion codes 0x80-0x9f may vary depending on the command. Code Dec Description ---- --- ----------------------------------------- 0x00, 0, "Command completed successfully", 0x80, 128, "Invalid Session Handle or Empty Buffer", 0x81, 129, "Lost Arbitration", 0x82, 130, "Bus Error", 0x83, 131, "NAK on Write - busy", 0x84, 132, "Truncated Read", 0xC0, 192, "Node Busy", 0xC1, 193, "Invalid Command", 0xC2, 194, "Command invalid for given LUN", 0xC3, 195, "Timeout while processing command", 0xC4, 196, "Out of space", 0xC5, 197, "Invalid Reservation ID, or cancelled", 0xC6, 198, "Request data truncated", 0xC7, 199, "Request data length invalid", 0xC8, 200, "Request data field length limit exceeded", 0xC9, 201, "Parameter out of range", 0xCA, 202, "Cannot return requested number of data bytes", 0xCB, 203, "Requested sensor, data, or record not present", 0xCC, 204, "Invalid data field in request", 0xCD, 205, "Command illegal for this sensor/record type", 0xCE, 206, "Command response could not be provided", 0xCF, 207, "Cannot execute duplicated request", 0xD0, 208, "SDR Repository in update mode, no response", 0xD1, 209, "Device in firmware update mode, no response", 0xD2, 210, "BMC initialization in progress, no response", 0xD3, 211, "Destination unavailable", 0xD4, 212, "Cannot execute command. Insufficient privilege level", 0xD5, 213, "Cannot execute command. Request parameters not supported", 0xFF, 255, "Unspecified error" ------------------------------- 8.0 BUILDING IPMI UTILITIES ------------------------------- The ipmiutil source package provides IPMI-based utilities and kernel patches for managing various servers in Linux or Windows. The same source files can be built in both Linux and Windows as shown below. To get the ipmiutil source: Download the latest released ipmiutil-*.tar.gz from http://sourceforge.net/projects/ipmiutil/files/ Or download a tar.gz of the current subversion trunk with the latest source http://ipmiutil.svn.sourceforge.net/viewvc/ipmiutil/trunk/?view=tar Or, if you have subversion installed, you can check out the latest source by doing: # svn co https://ipmiutil.svn.sourceforge.net/svnroot/ipmiutil ipmiutil See also section 4.9 for information about building custom applications using ipmiutil library APIs. The ipmi_sample.c shows a sample application using the ipmiutil library. 8.1 Build instructions for Linux To build with some GPL code: If you are building ipmiutil for open-source, then the MD2 hash for IPMI LAN and the valinux driver interface (/dev/ipmikcs) can be supported. If so, you should specify the following during configure: "./configure --enable-gpl" The default is to build with only BSD-licensed code and not to include the MD2 and valinux features. The md2.h and ipmi_ioctl.h files with GPL code can be removed if this option is not enabled. To build a standalone binary without IPMI LAN 2.0 (lanplus plugin), which may be desirable for use on bootable media (USB/CDROM), to decrease the size or to avoid using libcrypto, you can specify the following during configure: "./configure --enable-standalone" builds it without lanplus libs and without GPL code. Only the SOL console function requires lanplus, all other functions can use the lan interface, since the IPMI 2.0 firmware is required to support both lan and lanplus. However, lanplus does have more secure encryption, as provided by libcrypto. To add LanDesk IPMI support: Support for the LanDesk IPMI driver requires a library supplied by LanDesk (libipmiapi.a). After obtaining this library, place it in lib/libipmiapi.a. Then you can link ipmiutil to support it by specifying the following during configure: "./configure --enable-landesk=yes" Steps to build for Linux: # ./beforeconf.sh Which automates these functions: * copying libtool files * aclocal (may be needed if automake versions are different) * autoconf (may be needed if automake versions are different) * automake # ./configure --enable-landesk adds landesk library support [default=no] --disable-lanplus disable lanplus library support --enable-standalone build standalone, with no GPL or LanPlus libs. --enable-gpl build with some GPL code [default=no] # make To add the ifruset utility, which allows setting any FRU Product fields: # cd util; make ifruset # ifruset -? To build and install an rpm package, use one of the following: # make install # make rpm The make rpm produces a binary rpm, and a source rpm, which can be installed with "rpm -i *.rpm". To build and install a Debian package, do this: # mv debpkg debian # dpkg-buildpackage then install it with "dpkg -i *.deb". 8.2 Build instructions for Windows The ipmiutil Windows binaries for each release are pre-built and posted at http://ipmiutil.sourceforge.net, but here is how to build the ipmiutil EXEs for Windows from source. Note that the WIN32 compile flag is used. The ipmiutil buildwin.cmd shows how to compile and link the lib and exe files, although many people prefer instead to do builds with the Microsoft VisualStudio project GUI. See also ipmiutil UserGuide section 5.2 for more details. 1) Install Visual Studio (e.g. VS 6.0 or VC98) 2) Download contrib files from http://ipmiutil.sf.net/FILES/ipmiutil-contrib.zip and see section 5.2 for getopt.c and openssl. 3) Copy initial contrib files into ipmiutil See section 5.2.3 for details 4) Build the openssl libraries according to its INSTALL.W32 5) Copy the resulting openssl LIB and DLL binaries to ipmiutil 6) Set the Visual C variables Example: "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" 7) Run buildwin.cmd buildwin.cmd will build all of the Windows EXE and DLL files. 8.3 Build instructions for Solaris # iver=2.7.9 # uname -a SunOS unknown 5.10 Generic_127128-11 i86pc i386 i86pc # gunzip ipmiutil-${iver}.tar.gz # tar xvf ipmiutil-${iver}.tar # cd ipmiutil-${iver} # PATH=/usr/sbin:/usr/bin:/usr/ucb:/usr/openwin:/usr/ccs/bin:/usr/sfw/bin # ./configure # make # make tarsol This produces /tmp/ipmiutil-${iver}-solaris.tar with the binaries. # gzip /tmp/ipmiutil-${iver}-solaris.tar Solaris Release Notes: - Built with support for bmc, lan, and lanplus interfaces. Supports the Solaris 10 /dev/bmc driver via putmsg method. - Requests to slave addresses other than BMC are not supported by the Solaris bmc driver (e.g. to HSC at 0xc0), and are sent to the BMC sa instead. - Memory mapping logic returns an error (e.g. BIOS version). - idiscover -a broadcast ioctl works now in ipmiutil-2.3.1 To Install on Solaris: gunzip /tmp/ipmiutil-${iver}-solaris.tar.gz tar xvf /tmp/ipmiutil-${iver}-solaris.tar ./install.sh 8.4 Build instructions for FreeBSD # iver=2.7.9 # gunzip ipmiutil-${iver}.tar.gz # tar xvf ipmiutil-${iver}.tar # cd ipmiutil-${iver} # ./configure # make # make tarbsd This produces /tmp/ipmiutil-${iver}-bsd.tar with the binaries. # gzip /tmp/ipmiutil-${iver}-bsd.tar FreeBSD Release Notes: - ipmiutil-2.3.5 supports FreeBSD with direct driverless KCS - ipmiutil-2.5.2 adds support for FreeBSD 7.x ipmi driver port To Install on FreeBSD: gunzip /tmp/ipmiutil-${iver}-bsd.tar.gz tar xvf /tmp/ipmiutil-${iver}-bsd.tar ./install.sh 8.5 Build instructions for ARM (Android) # tar -xzvf ipmiutil-${iver}.tar.gz # cd ipmiutil-${iver} # ./configure --enable-standalone --host=arm # make ----------------------------- 10.0 IPMIUTIL LIBRARY APIS ----------------------------- Below are some common routines available in the ipmiutil library. Also refer to util/ipmi_sample.c for an example of how these APIs are used. /* * ipmi_cmd * ushort cmd (input): (netfn << 8) + command * uchar *pdata (input): pointer to ipmi data * int sdata (input): size of ipmi data * uchar *presp (output): pointer to response data buffer * int *sresp (input/output): on input, size of response buffer, * on output, length of response data * uchar *cc (output): completion code * char fdebugcmd(input): flag =1 if debug output desired * returns 0 if successful, <0 if error */ int ipmi_cmd(ushort cmd, uchar *pdata, int sdata, uchar *presp, int *sresp, uchar *pcc, char fdebugcmd); /* * ipmi_cmdraw * uchar cmd (input): IPMI Command * uchar netfn (input): IPMI NetFunction * uchar sa (input): IPMI Slave Address of the MC * uchar bus (input): BUS of the MC * uchar lun (input): IPMI LUN * uchar *pdata (input): pointer to ipmi data * int sdata (input): size of ipmi data * uchar *presp (output): pointer to response data buffer * int *sresp (input/output): on input, size of response buffer, * on output, length of response data * uchar *cc (output): completion code * char fdebugcmd(input): flag =1 if debug output desired * returns 0 if successful, <0 if error */ int ipmi_cmdraw(uchar cmd, uchar netfn, uchar sa, uchar bus, uchar lun, uchar *pdata, int sdata, uchar *presp, int *sresp, uchar *pcc, char fdebugcmd); /* * ipmi_close_ * Called to close an IPMI session. * returns 0 if successful, <0 if error */ int ipmi_close_(void); int ipmi_close(void); /*ditto*/ /*-----------------------------------------------------------------* * These externals are conditionally compiled in ipmicmd.c ipmi_cmdraw_ia() Intel IMB driver, /dev/imb ipmi_cmdraw_mv() MontaVista OpenIPMI driver ipmi_cmdraw_va() VALinux driver ipmi_cmdraw_ld() LANDesk driver ipmi_cmdraw_direct() Direct/Driverless KCS or SSIF ipmi_cmdraw_lan() IPMI LAN ipmi_cmdraw_lan2() IPMI LANplus (RMCP+ in IPMI 2.0) *-----------------------------------------------------------------*/ /* * parse_lan_options * Parse the IPMI LAN options from the command-line getopt. * int c (input): command-line option from getopt, one of: case 'F': force driver type case 'T': auth type case 'V': priv level case 'J': cipher suite case 'N': nodename case 'U': username case 'R': remote password case 'P': remote password case 'E': get password from IPMI_PASSWORD environment var case 'Y': prompt for remote password case 'Z': set local MC address * char *optarg (input): command-line argument from getopt * char fdebug (input): show debug messages if =1, default=0 */ void parse_lan_options(int c, char *optarg, char fdebug); /* * set_lan_options * Use this routine to set the lan options 'gnode','guser','gpswd', etc. * This would only be required before opening a new session. * char *node (input): IP address or nodename of remote node's IPMI LAN * char *user (input): IPMI LAN username * char *pswd (input): IPMI LAN password * int auth (input): IPMI LAN authentication type (1 - 5) * IPMI_SESSION_AUTHTYPE_NONE 0x00 * IPMI_SESSION_AUTHTYPE_MD2 0x01 * IPMI_SESSION_AUTHTYPE_MD5 0x02 * IPMI_SESSION_AUTHTYPE_PASSWORD 0x04 * IPMI_SESSION_AUTHTYPE_OEM 0x05 * int priv (input): IPMI LAN privilege level (1 - 5) * IPMI_PRIV_LEVEL_CALLBACK 0x01 * IPMI_PRIV_LEVEL_USER 0x02 * IPMI_PRIV_LEVEL_OPERATOR 0x03 * IPMI_PRIV_LEVEL_ADMIN 0x04 * IPMI_PRIV_LEVEL_OEM 0x05 * int cipher (input): IPMI LAN cipher suite (0 thru 17, default is 3) * See table 22-19 in the IPMIv2 spec. * void *addr (input): Socket Address to use (SOCKADDR_T *) if not NULL * This is only used in itsol.c because it has an * existing socket open. Default is NULL for this. * int addr_len (input): length of Address buffer (128 if ipv6, 16 if ipv4) * returns 0 if successful, <0 if error */ int set_lan_options(char *node, char *user, char *pswd, int auth, int priv, int cipher, void *addr, int addr_len); int get_lan_options(char *node, char *user, char *pswd, int *auth, int *priv, int *cipher, void *addr, int *addr_len); void print_lan_opt_usage(void); int ipmi_getdeviceid(uchar *presp, int sresp, char fdebugcmd); /* int ipmi_open(void); * embedded in ipmi_cmd() */ int ipmi_getpicmg(uchar *presp, int sresp, char fdebug); char *show_driver_type(int idx); int set_driver_type(char *tag); int get_driver_type(void); int nodeislocal(char *nodename); /* These *_mc routines are used to manage changing the mc. * The local mc (mymc) may be changed via -Z, and * the remote mc (mc) may be changed with -m. */ void ipmi_set_mc(uchar bus, uchar sa, uchar lun, uchar type); void ipmi_get_mc(uchar *bus, uchar *sa, uchar *lun, uchar *type); void ipmi_restore_mc(void); void ipmi_set_mymc(uchar bus, uchar sa, uchar lun, uchar type); void ipmi_get_mymc(uchar *bus, uchar *sa, uchar *lun, uchar *type); /* ipmi_cmdraw_mc and ipmi_cmd_mc are used in cases where the mc may * have been changed via ipmi_set_mc. */ int ipmi_cmdraw_mc(uchar cmd, uchar netfn, uchar *pdata, int sdata, uchar *presp, int *sresp, uchar *pcc, char fdebugcmd); int ipmi_cmd_mc(ushort icmd, uchar *pdata, int sdata, uchar *presp, int *sresp, uchar *pcc, char fdebugcmd); /* ipmi_sendrecv is a wrapper for ipmi_cmdraw which maps to ipmitool syntax */ int ipmi_sendrecv(struct ipmi_rq * req, uchar *rsp, int *rsp_len); /* other common subroutines */ char * decode_rv(int rv); /*ipmicmd.c*/ char * decode_cc(ushort icmd, int cc); void dump_buf(char *tag,uchar *pbuf,int sz, char fshowascii); int get_lan_channel(uchar chstart, uchar *chan); void show_fru_picmg(uchar *pdata, int dlen); /* ifru_picmg.c*/ /* show_outcome outputs the meaning of the return code. */ void show_outcome(char *prog, int ret); /* these log routines are primarily for the isol debug log */ FILE *open_log(char *mname); void close_log(void); void flush_log(void); void print_log( char *pattn, ... ); void dump_log(FILE *fp,char *tag,uchar *pbuf,int sz, char fshowascii); void logmsg( char *pname, char *pattn, ... ); #ifdef WIN32 /* Implement the Linux strncasecmp for Windows. */ int strncasecmp(const char *s1, const char *s2, int n); #endif const char *val2str(ushort val, const struct valstr *vs); /*ipmilanplus.c*/ const char * oemval2str(ushort oem, uchar val, const struct oemvalstr *vs); void set_debug(void); /*used only by oem_sun.c*/ void set_iana(int iana); /*ipmicmd.c*/ void set_mfgid(uchar *devid, int len); void get_mfgid(int *pvend, int *pprod); void get_devid_ver(uchar *bmaj, uchar *bmin, uchar *iver); char *get_nodename(void); char is_remote(void); void show_devid(uchar b1, uchar b2, uchar i1, uchar i2); int set_max_kcs_loops(int ms); /* ipmicmd.c, calls ipmidir.c if ok */ /* These common subroutines are in subs.c */ int str_icmp(char *s1, char *s2); /*used internally in ipmicmd.c*/ char * strdup_(const char *instr); /*wrapper for strdup, supports WIN32*/ int strlen_(const char *s); /*wrapper for strlen, avoids compile warnings*/ uchar htoi(char *inhex); void os_usleep(int s, int u); char *get_iana_str(int mfg); /*subs.c*/ int get_errno(void); /*subs.c*/ const char * buf2str(uchar * buf, int len); /*subs.c*/ int str2uchar(char *str_in, uchar *uchr_out); uchar atob(char *str_in); /* calls str2uchar*/ void atoip(uchar *array,char *instr); int get_system_info(uchar parm, char *pbuf, int *szbuf); /*subs.c*/ int set_system_info(uchar parm, uchar *pbuf, int szbuf); /*subs.c*/ int ipmi_reserved_user(int vend, int userid); /*subs.c*/ /* from mem_if.c */ int get_BiosVersion(char *str); /* See util/isensor.h for SDR cache routines. */ /* See util/ievents.h for sensor_type_desc, sel_opts, decode_sel routines. */ -------------------------- 10.0 RELATED INFORMATION -------------------------- 10.1 History History of ipmiutil: This project started in October 2001 as part of the Carrier Grade Linux effort. It was then known as 'panicsel' and included a kernel patch to write a Linux panic event to the IPMI firmware log, as well as utilities. This code was first included in MontaVista CGE Linux 2.1 in July 2002. The panicsel functionality was included in OSDL CGL 1.0 and 2.0 requirements. The kernel panic functionality was included in the OpenIPMI driver for 2.6 Linux kernels. Compile flags for Windows 2000 & 2003 support were added in Jan 2004. In August 2004, the project was moved from panicsel.sf.net to ipmiutil.sf.net. The new name more clearly reflects the purpose of the project in its current state. In November 2004, support for the FreeIPMI library was added. A Linux rpm and a Windows setup package for ipmiutil is included on the Resource CD with Intel carrier-grade servers. The ipmiutil (or panicsel) rpm is known to be included in the following distributions: MontaVista CGE 2.1/3.0/3.1/4.0, SuSE SLES9, Red Flag 5.0 10.2 Links Links with information related to the IPMI Management Utilities project. ipmiutil project, sourceforge http://ipmiutil.sourceforge.net (current) panicsel project, sourceforge http://panicsel.sourceforge.net (old) IPMI Specification http://www.intel.com/design/servers/ipmi/index.htm OSDL Carrier Grade Linux http://www.osdl.org/lab_activities/carrier_grade_linux/ Intel imb driver source http://downloadfinder.intel.com/scripts-df-external/Product_Search.asp?Prod_nm=ipmi*driver*source Intel imb driver for Windows http://downloadfinder.intel.com/scripts-df-external/Product_Search.aspx?Prod_nm=imb+driver OpenIPMI project http://sourceforge.net/projects/openipmi/ by Corey Minyard of MontaVista (home= http://openipmi.sourceforge.net) ipmitools project by San Mehat http://sourceforge.net/projects/ipmitools/ valinux IPMI driver http://cvs.sf.net/cgi-bin/viewcvs.cgi/ipmitools/ipmitools/kernel/kcs/patches/2.4.x/ GNU FreeIPMI library project http://www.gnu.org/software/freeipmi/ LANDesk IPMI driver/daemon http://www.landesk.com/Support/ (or see Intel System Resource CD for Intel servers) lm-sensors project http://secure.netroedge.com/~lm78/ dmidecode project http://www.nongnu.org/dmidecode/ IPMI vendor/mfg IDs http://www.iana.org/assignments/enterprise-numbers ipmiutil-3.0.7/doc/rh.patch0000664000076400007640000000607013160502144015271 0ustar acressloggers--- ipmiutil.spec.orig 2012-06-12 12:05:50.000000000 -0400 +++ ipmiutil.spec 2012-06-12 12:07:47.000000000 -0400 @@ -7,7 +7,7 @@ Release: 1%{?dist} Summary: Easy-to-use IPMI server management utilities License: BSD -Group: System/Management +Group: System Environment/Base Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz URL: http://ipmiutil.sourceforge.net BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -15,18 +15,9 @@ %if 0%{?fedora} >= 15 Requires: systemd-units %endif -%if 0%{?suse_version} >= 1210 -%define req_systemd 1 -%endif -%if 0%{?req_systemd} -BuildRequires: openssl-devel gcc gcc-c++ libtool systemd -%define systemd_fls %{_unitdir} -# Requires: %{?systemd_requires} -%else BuildRequires: openssl-devel gcc gcc-c++ libtool -%define systemd_fls %{_datadir}/%{name} -%endif -%define init_dir %{_initrddir} +%global systemd_fls %{_datadir}/%{name} +%global init_dir %{_initrddir} %description The ipmiutil package provides easy-to-use utilities to view the SEL, @@ -53,12 +44,8 @@ %setup -q %build -%if 0%{?req_systemd} -%configure --enable-systemd -%else %configure -%endif -make +make %{?_smp_mflags} %install rm -rf %{buildroot} @@ -146,11 +133,6 @@ %{_libdir}/libipmiutil.a -%pre -%if 0%{?req_systemd} -%service_add_pre ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service -%endif - %post # POST_INSTALL, $1 = 1 if rpm -i, $1 = 2 if rpm -U @@ -160,9 +142,6 @@ vardir=%{_var}/lib/%{name} scr_dir=%{_datadir}/%{name} -%if 0%{?req_systemd} -%service_add_post ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service -%else if [ -x /bin/systemctl ]; then systemd_dir=%{_unitdir} echo "IINITDIR=%{init_dir}" >>%{_datadir}/%{name}/ipmiutil.env @@ -177,7 +156,6 @@ cp -f ${scr_dir}/ipmiutil_evt %{init_dir} cp -f ${scr_dir}/ipmi_port %{init_dir} fi -%endif # Run some ipmiutil command to see if any IPMI interface works. %{_bindir}/ipmiutil sel -v >/dev/null 2>&1 @@ -213,9 +191,6 @@ # before uninstall, $1 = 1 if rpm -U, $1 = 0 if rpm -e if [ "$1" = "0" ] then -%if 0%{?req_systemd} -%service_del_preun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service -%else if [ -x /bin/systemctl ]; then systemd_dir=%{_unitdir} if [ -f ${systemd_dir}/ipmiutil_evt.service ]; then @@ -250,16 +225,12 @@ rm -f %{init_dir}/ipmiutil_evt 2>/dev/null rm -f %{init_dir}/ipmi_port 2>/dev/null fi -%endif if [ -f %{_sysconfdir}/cron.daily/checksel ]; then rm -f %{_sysconfdir}/cron.daily/checksel fi fi %postun -%if 0%{?req_systemd} -%service_del_postun ipmi_port.service ipmiutil_evt.service ipmiutil_asy.service ipmiutil_wdt.service -%else if [ -x /bin/systemctl ]; then systemctl daemon-reload || : if [ $1 -ge 1 ] ; then @@ -267,7 +238,6 @@ systemctl try-restart ipmi_port.service || : fi fi -%endif %changelog * Fri May 04 2012 Andrew Cress 2.8.4-1 ipmiutil-3.0.7/doc/ifru.80000644000076400007640000001110713160502144014670 0ustar acressloggers.TH IFRU 8 "Version 1.4: 09 Sep 2010" .SH NAME ipmiutil_fru \- show Field Replacable Unit configuration data .SH SYNOPSIS .B "ipmiutil fru [-abcdeikmsvx -N node -U user -P/-R pswd -EFJTVY]" .SH DESCRIPTION .I ipmiutil fru is a program that uses IPMI commands to show FRU configuration data and optionally write an asset tag string into the FRU data. Setting the asset tag is a function that can be used to uniquely identify the unit, even if the storage devices are removed or changed. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-a asset_string" This option specifies an asset tag string to be written to the baseboard FRU Product area. The asset tag length is limited by the existing FRU Product data, but is usually allowed up to 16 characters. The default is to not modify this FRU field. .IP "-b" Only show the Baseboard FRU data. The default behavior is to also scan for any SDR FRU data or DIMM SPD data referenced by the SDRs. .IP "-c" Show FRU output in a canonical format, with a default delimiter of '|'. .IP "-d file" Dump binary FRU data to the specified file. .IP "-e" Show Every FRU output in a bladed chassis, including those under child MCs. The default is to show FRUs referred to by just the target MC. .IP "-i 00" This option specifies a specific FRU ID to show. The input value should be in hex (0b, 1a, etc.), as shown from the sensor SDR output. By default, all FRU IDs that are specified in the FRU locator SDRs are shown. .IP "-k " These Kontron OEM functions set FRU data based on existing data stored elsewhere. The setsn option sets the FRU Board and Product serial number, and the setmfgdate option sets the FRU Board Mfg DateTime. The nextboot option specifies the boot device for the next boot: BIOS, FDD, HDD, CDROM, or network. These options are only supported on Kontron ATCA boards which have this functionality. .IP "-m 002000" Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-s serial_num" This option specifies a serial number string to be written to the baseboard FRU Product area. The serial number can be any string up to 16 characters. The default is to not modify this FRU field. .IP "-v prod_ver" This option specifies a product version number string to be written to the baseboard FRU Product area. The version number can be any string up to 16 characters. The default is to not modify this FRU field. .IP "-x" Causes eXtra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/idiscover.80000644000076400007640000000607313160502144015720 0ustar acressloggers.TH IDISCOVER 8 "Version 1.0: 02 May 2007" .SH NAME ipmiutil_discover \- discover IPMI LAN-enabled nodes .SH SYNOPSIS .B "idiscover [-abegisx]" .SH DESCRIPTION .I idiscover is a program that uses IPMI LAN commands to discover any nodes on the LAN that are available, by probing the RMCP port (623.) on those nodes. This utility uses IPMI LAN, so no IPMI drivers are needed. There are three methods that can be used: .br \-a = broadcast RMCP ping method (default) .br \-g = GetChannelAuthCap command method .br else = specific RMCP ping method .P A beginning IP address can be specified with \-b for broadcast and specific methods. An ending IP can be specified for non-broadcast methods. .SH OPTIONS Command line options are described below. .IP "-a" All nodes, use the broadcast ping method. This is the default if no options are specified. This will detect the first enabled ethernet interface, and defaults to the broadcast address x.x.x.255 (where x.x.x.x is IP address) unless \-b is used to specify otherwise. .IP "-b " Beginning IP address, required, unless using broadcast with defaults. This could be a specific IP address, or a broadcast address, ending in 255, if the broadcast method (\-a) is used. .IP "-e " Endign IP address of the range. Not used for broadcast method. If this is not specified, a range of one IP address matching the beginning IP is assumed. .IP "-g" Use the GetChannelAuthenticationCapabilities command method over IPMI LAN instead of the RMCP ping. Not compatible with broadcast. This may be useful if the vendor BMC does not support RMCP ping for some reason. .IP "-i eth0" The interface name to use when sending the probes. The default is to detect the first enabled ethernet interface (e.g. eth0). .IP "-m" shows MAC address. Uses the broadcast ping method, but uses a raw socket so that the MAC address can be displayed. This detects the first enabled ethernet interface, and defaults to the broadcast address 255.255.255.255 like \-a. Using \-m with raw sockets requires root privilege. .IP "-r N" Repeat the ping N times to each node. Default is to send 1 ping per node. .IP "-x" Causes extra debug messages to be displayed. .SH "EXAMPLES" idiscover \-a \-b 192.168.1.255 .br Sends a broadcast RMCP ping to discover IPMI LAN nodes on the specified subnet. .PP idiscover \-b 192.168.1.100 \-e 192.168.1.254 .br Sends RMCP pings to a range of IP addresses. .PP idiscover \-g \-b 192.168.1.100 \-e 192.168.1.254 .br Sends GetChannelAuthCap commands to a range of IP addresses. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ipmi_port.80000644000076400007640000000251013160502144015723 0ustar acressloggers.TH IPMI_PORT 8 "Version 1.0: 14 Apr 2010" .SH NAME ipmi_port \- a daemon to bind RMCP port 623 to prevent portmap from using it .SH SYNOPSIS .B "ipmi_port [-bx]" .SH DESCRIPTION This .I ipmi_port service starts and binds port 623, then sleeps forever, so that the portmap service will not try to reuse port 623, which it otherwise might try to do. Since the IPMI firmware snoops the NIC channel and grabs any traffic destined for RMCP port 623, any application in the OS which tried to use port 623 would fail. .SH OPTIONS Command line options are described below. .IP "-b" Background mode. Convert to a daemon and run in background. Without specifying this option, ipmi_port will run in foreground. .IP "-x" Causes eXtra debug messages to be displayed. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/iwdt.80000644000076400007640000001025613160502144014676 0ustar acressloggers.TH IWDT 8 "Version 1.3: 26 Apr 2010" .SH NAME ipmiutil_wdt\- display and set WatchDog Timer parameters .SH SYNOPSIS .B "ipmiutil wdt [-acdelrtx -N node -P/-R pswd -U user -EFJTVY]" .SH DESCRIPTION .I ipmiutil wdt is a program that uses IPMI commands to display and set WatchDog Timer parameters. This utility can use either any available IPMI driver, or direct user-space IOs, or the IPMI LAN interface if \-N. This utility is an example of how to access the IPMI watchdog parameters directly, which allows changing the timer configuration. There is an init script provided with ipmiutil to automate the task of managing the watchdog timer in user-space. .br # chkconfig \-\-add ipmiutil_wdt (skip this if no chkconfig) .br # /etc/init.d/ipmiutil_wdt start .br This sets the watchdog timer to reset the system if the wdt is not restarted within 90 seconds. It creates an /etc/cron.d/wdt file to restart wdt every 60 seconds. See also ipmiutil UserGuide section 4.4 for more information. .SH OPTIONS Command line options are described below. .IP "-a N" Set watchdog event Action to N. Values: 0 = No action, 1 = Hard Reset(default), 2 = Power down, 3 = Power cycle. .IP "-c" Show watchdog output in a canonical format, with a default delimiter of '|'. .IP "-d" Disables the watchdog timer. .IP "-e" Enables the watchdog timer. The timer is not actually started, however, until the timer is reset. The pre-timeout action is not enabled. .IP "-l" Set the watchdog dontLog bit to not log watchdog events in the SEL. .IP "-p N" Set watchdog Pretimeout event action to N. Values: 0 = No action(default), 1 = SMI, 2 = NMI, 3 = Messaging Interrupt. If this is set to an action other than 0, the pretimeout will also be set to 90% of the timeout. However, if the timeout is less than 20 seconds, the pretimeout will not be enabled. .IP "-q S" Set watchdog pretimeout value to S seconds, rather than 90% of the timeout as in \-p. The pretimeout value must be >= 5 and at least 5 seconds less than the timeout value. .IP "-r" Resets the watchdog timer. This should be done every N seconds if the timer is running to prevent the watchdog action (usually a system reset) from occurring. .IP "-tN" Set the watchdog Timeout to N seconds. The default is 120 seconds (2 minutes). .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "SEE ALSO" ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifirewall(8) ifru(8) ifruset(8) ifwum(8) igetevent(8) ihealth(8) ihpm(8) ilan(8) ipicmg(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) isunoem(8) iwdt(8) ipmiutil(8) ipmi_port(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ismcoem.80000644000076400007640000000640613160502144015365 0ustar acressloggers.TH ISMCOEM 8 "Version 1.0: 05 Apr 2013" .SH NAME ipmiutil_smcoem \- OEM commands for SuperMicro servers .SH SYNOPSIS .B "ipmiutil smcoem [-mx -NPRUEFJTVY] commands" .SH DESCRIPTION .I ipmiutil smcoem is a function that uses SuperMicro OEM IPMI commands to perform platform-specific functions. .SH OPTIONS .IP "-m 002000" Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH COMMANDS .TP \fIintrusion\fP .RS This command resets any chassis intrusion condition that may have occurred. .RE .TP \fIbmcstatus\fP \fB[enable|disable]\fR .RS This command gets or sets the BMC service status. Alone, without arguments, it gets the BMC status as either enabled or disabled. With an argument of either enable or disable, it will also set the BMC status as specified. .RE .TP \fIfirmware\fP .RS This command gets the extra firmware version information, if available. .RE .TP \fIlanport\fP \fB[dedicated|lan1|failover]\fR .RS This command gets or sets the IPMI LAN interface port. If set to dedicated, only the dedicated IPMI NIC can be configured for IPMI LAN. If set to lan1, only the first onboard NIC (LAN1) can be configured for IPMI LAN. If set to failover, both the dedicated and onboard LAN1 port would be configured for IPMI LAN, with the same IP address. .RE .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2013 Andy Cress .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/iseltime.80000644000076400007640000000533013160502144015537 0ustar acressloggers.TH ISELTIME 8 "Version 1.0: 01 Apr 2013" .SH NAME iseltime \- synchronize BMC SEL time with OS system time .SH SYNOPSIS .B "seltime [-sx -NUPRETVF]" .SH DESCRIPTION .I seltime is a program that uses IPMI commands to set the BMC SEL time from the OS system time. The OS system time should be in sync with the BIOS Real-Time-Clock. The OS system time may also be kept from drifting via an NTP server. Normally the BIOS will set the BMC time from the RTC during boot, but running this command may be necessary periodically if the system does not reboot for many weeks, for instance. Note that this command should not be run too frequently to avoid BMC timing issues. Once per day should be sufficient. Run with no options, this command reads the BMC SEL time without setting anything. This utility can use either the /dev/ipmi0 openipmi driver, the /dev/imb Intel driver, the /dev/ipmikcs valinux driver, a driverless interface, or IPMI LAN. .SH OPTIONS .IP "-s" Sets the SEL time (no more than once a day). .IP "-x" Causes eXtra debug messages to be displayed. .IP "-N nodename" Nodename of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R password" Remote password for the nodename given. The default is a null password. .IP "-U username" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 14): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are -E or -P. .SH "SEE ALSO" ipmiutil(8) isel(8) ievents(8) icmd(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2013 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ialarms.80000644000076400007640000001013413160502144015352 0ustar acressloggers.TH IALARMS 8 "Version 1.3: 20 Apr 2007" .SH NAME ipmiutil_alarms \- display and set alarm indicators .SH SYNOPSIS .B "ipmiutil alarms [-abcdimnoprx -N node -U user -P/-R pswd -EFJTVY]" .SH DESCRIPTION .I ipmiutil alarms is a program that uses IPMI commands to display and set alarm indicators, which are usually LEDs on the system chassis front panel. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. Note that a LAN user must have Administrative privileges to read or write the alarm LEDs. Note that this utility may not be the only logic setting alarm states. The BMC firmware, system management software, or cluster fault manager may also want to set alarm states. Intel provides a Telco Alarms Manager API which presents a consolidated interface for all alarm management applications. .SH OPTIONS Command line options are described below. .IP "-r" Read-only. Show the alarms status, but do not set any states. This is also the default mode if no parameters are specified. .IP "-iN" Sets the Chassis Identify feature, which can be an LED or some other alarm. If N=0, turn off the Chassis ID, otherwise turn the ID on for N seconds. N=255 will turn on the ID indefinitely, if it is IPMI 2.0. .IP "-aN" Sets Disk A Fault LED. If N=0, turn it off. If N=1, turn it on. Used only for TIGPT1U platform. .IP "-bN" Sets Disk B Fault LED. If N=0, turn it off. If N=1, turn it on. Used only for TIGPT1U platform. .IP "-dXN" Sets Disk X Fault LED, where X=0-6. If N=0, turn it off. If N=1, turn it on. Used only for NSC2U platform. .IP "-cN" Sets the Critical Alarm. If N=0, turn it off. If N=1, turn it on. .IP "-mN" Sets the Major Alarm. If N=0, turn it off. If N=1, turn it on. .IP "-nN" Sets the Minor Alarm. If N=0, turn it off. If N=1, turn it on. .IP "-pN" Sets the Power Alarm. If N=0, turn it off. If N=1, turn it on. Note that the Power LED is also wired to the System Fault LED in the back of the system, so this state may be off for Power, but the LED could be lit for a System Fault reason instead. Refer to the system Technical Product Specification for System Faults. .IP "-o" Sets all alarms off, including the Chassis ID. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use this IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use this IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH "SEE ALSO" ipmiutil(8) iconfig(8) icmd(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2009 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/doc/ipicmg.80000644000076400007640000001055313160502144015177 0ustar acressloggers.TH IPICMG 8 "Version 1.0: 04 Jun 2010" .SH NAME ipmiutil_picmg \- send specific PICMG extended IPMI commands .SH SYNOPSIS .B "ipmiutil picmg [-mixNUPREFJTVY] parameters" .SH DESCRIPTION This .I ipmiutil picmg subcommand sends specific PICMG/ATCA extended IPMI commands to the firmware. This utility can use either the /dev/ipmi0 driver from OpenIPMI, the /dev/imb driver from Intel, the /dev/ipmikcs driver from valinux, direct user-space IOs, or the IPMI LAN interface if \-N. .SH OPTIONS Command line options are described below. .IP "-i 00" This option specifies a specific FRU ID to show. The input value should be in hex (0b, 1a, etc.), as shown from the sensor SDR output. The default FRU ID is zero (0). .IP "-m 002000" Show FRU for a specific MC (e.g. bus 00, sa 20, lun 00). This could be used for PICMG or ATCA blade systems. The trailing character, if present, indicates SMI addressing if 's', or IPMB addressing if 'i' or not present. .IP "-x" Causes extra debug messages to be displayed. .IP "-N nodename" Nodename or IP address of the remote target system. If a nodename is specified, IPMI LAN interface is used. Otherwise the local system management interface is used. .IP "-U rmt_user" Remote username for the nodename given. The default is a null username. .IP "-P/-R rmt_pswd" Remote password for the nodename given. The default is a null password. .IP "-E" Use the remote password from Environment variable IPMI_PASSWORD. .IP "-F drv_t" Force the driver type to one of the followng: imb, va, open, gnu, landesk, lan, lan2, lan2i, kcs, smb. Note that lan2i means lan2 with intelplus. The default is to detect any available driver type and use it. .IP "-J" Use the specified LanPlus cipher suite (0 thru 17): 0=none/none/none, 1=sha1/none/none, 2=sha1/sha1/none, 3=sha1/sha1/cbc128, 4=sha1/sha1/xrc4_128, 5=sha1/sha1/xrc4_40, 6=md5/none/none, ... 14=md5/md5/xrc4_40. Default is 3. .IP "-T" Use a specified IPMI LAN Authentication Type: 0=None, 1=MD2, 2=MD5, 4=Straight Password, 5=OEM. .IP "-V" Use a specified IPMI LAN privilege level. 1=Callback level, 2=User level, 3=Operator level, 4=Administrator level (default), 5=OEM level. .IP "-Y" Yes, do prompt the user for the IPMI LAN remote password. Alternatives for the password are \-E or \-P. .SH PARAMETERS \fIpicmg\fP \fBparameters\fR .RS .TP \fIproperties\fP Get PICMG properties may be used to obtain and print Extension major version information, PICMG identifier, FRU Device ID and Max FRU Device ID. .TP \fIaddrinfo\fP .br Get address information. This command may return information on the Hardware address, IPMB-0 Address, FRU ID, Site/Entity ID, and Site/Entity Type. .TP \fIfrucontrol\fP \fBfru id\fR \fBoptions\fR .br Set various control options: .RS .TP \fI0x00\fP - Cold Reset .br .TP \fI0x01\fP - Warm Reset .br .TP \fI0x02\fP - Graceful Reboot .br .TP \fI0x03\fP - Issue Diagnostic Interrupt .br .TP \fI0x04\fP - Quiesce [AMC only] .br .TP \fI0x05-0xFF\fP - Cold Reset .br .RE .TP \fIactivate\fP \fBfru id\fR .br Activate the specified FRU. .TP \fIdeactivate\fP \fBfru id\fR .br Deactivate the specified FRU. .TP \fIpolicy\fP \fIget\fP \fBfru id\fR .br Get FRU activation policy. .TP \fIpolicy\fP \fIset\fP \fBfru id\fR \fBlockmask\fR \fBlock\fR .br Set FRU activation policy. \fBlockmask\fR is 1 or 0 to indicate action on the deactivation or activation locked bit respectively. \fBlock\fR is 1 or 0 to set/clear locked bit. .TP \fIportstate\fP \fBset\fR|\fBgetall\fR|\fBgetgranted\fR|\fBgetdenied\fR \fBparameters\fR .br Get or set various port states. See usage for parameter details. .SH "EXAMPLES" ipmiutil picmg properties .br Gets PICMG properties from the default target address (slave address 0x20). .PP ipmiutil picmg \-N 192.168.1.1 \-U root \-P pswd addrinfo .br Gets PICMG Address Information from the specified IP address. .SH "SEE ALSO" ipmiutil(8) ialarms(8) iconfig(8) idiscover(8) ievents(8) ifru(8) igetevent(8) ihealth(8) ilan(8) ireset(8) isel(8) isensor(8) iserial(8) isol(8) iwdt(8) .SH WARNINGS See http://ipmiutil.sourceforge.net/ for the latest version of ipmiutil and any bug fix list. .SH COPYRIGHT Copyright (C) 2010 Kontron America, Inc. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/scripts/0000755000076400007640000000000013160502163014555 5ustar acressloggersipmiutil-3.0.7/scripts/iuser0000755000076400007640000000003313160502144015625 0ustar acressloggers#!/bin/sh ipmiutil user $* ipmiutil-3.0.7/scripts/isel.cmd0000644000076400007640000000002113160502144016166 0ustar acressloggersipmiutil sel %* ipmiutil-3.0.7/scripts/igetevent.cmd0000644000076400007640000000002413160502144017227 0ustar acressloggersipmiutil getevt %* ipmiutil-3.0.7/scripts/ilan0000755000076400007640000000003213160502144015420 0ustar acressloggers#!/bin/sh ipmiutil lan $* ipmiutil-3.0.7/scripts/igetevent0000755000076400007640000000003513160502144016472 0ustar acressloggers#!/bin/sh ipmiutil getevt $* ipmiutil-3.0.7/scripts/ifru0000755000076400007640000000003213160502144015442 0ustar acressloggers#!/bin/sh ipmiutil fru $* ipmiutil-3.0.7/scripts/iwdt.cmd0000644000076400007640000000002113160502144016201 0ustar acressloggersipmiutil wdt %* ipmiutil-3.0.7/scripts/startsol0000755000076400007640000000042613160502144016357 0ustar acressloggers# start a serial-over-lan session # BMC port 0x26f (=623). # if [ $# -gt 0 ] then host=$1 else host=telco64 fi echo "Starting Serial-Over-LAN session to $host ..." # Use isolconsole application for IPMI LAN 2.0 SOL # If IPMI 1.5, use dpccli. ipmiutil sol -a -N $host ipmiutil-3.0.7/scripts/ipmiutil_evt0000755000076400007640000000615413160502144017222 0ustar acressloggers#! /bin/sh # # ipmiutil_evt init script # # chkconfig: - 91 59 # description: ipmiutil event monitoring service # # This starts a daemon that listens for IPMI events. Any events are logged # in /var/log/ipmiutil_evt.log and also to syslog. # By changing RUNSCRIPT below, the specified script could also be invoked # whenever an event occurs. A sample event script is provided at # /usr/share/ipmiutil/evt.sh # ### BEGIN INIT INFO # Provides: ipmiutil_evt # Required-Start: $local_fs $remote_fs $syslog # Required-Stop: $local_fs $remote_fs $syslog # Default-Start: 3 4 5 3 4 5 # Default-Stop: 0 1 2 6 0 1 2 6 # Short-Description: ipmiutil event monitoring init script # Description: Init script starts ipmiutil event monitoring service ### END INIT INFO # #if [ -f /etc/init.d/functions ]; then # Source function library. #. /etc/init.d/functions #fi name="ipmiutil_evt" getevtlog=/var/log/$name.log lockfile=/var/lock/subsys/$name prog=/usr/bin/ipmiutil RUNSCRIPT= # RUNSCRIPT="-r /usr/share/ipmiutil/evt.sh" getpid () { p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` echo $p } start() { echo -n "Starting $name: " # do not start if in driverless mode ipmiutil cmd -k |grep "driverless" >/dev/null 2>&1 if [ $? -eq 0 ]; then driverok=0 else driverok=1 fi if [ $driverok -eq 1 ] then [ -x $prog ] || exit 5 $prog getevt -s -b -t 0 $RUNSCRIPT >$getevtlog retval=$? PID=$! if [ $retval -eq 0 ]; then PID=`getpid "$prog getevt -s"` echo $PID >$lockfile fi else echo "No imb or ipmi driver loaded, aborting." retval=1 fi echo return $retval } stop() { echo -n "Stopping $name: " retval=1 if [ -f $lockfile ]; then p=`cat $lockfile` if [ "x$p" = "x" ]; then p=`getpid "$prog getevt -s"` fi if [ "x$p" != "x" ]; then kill $p retval=$? fi fi echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { stop start } rh_status() { if [ -f $lockfile ]; then p=`cat $lockfile` if [ "x$p" != "x" ]; then pid=`getpid $p` if [ "x$pid" != "x" ]; then echo "$name (pid $pid) is running..." retval=0 else echo "$name is dead but $lockfile exists" retval=1 fi else echo "$name $lockfile exists but is empty" retval=1 fi else echo "$name is stopped" retval=3 fi return $retval } rh_status_q() { rh_status >/dev/null 2>&1 } if [ ! -d /var/lock/subsys ]; then lockfile=/var/run/$name.pid fi case "$1" in start) rh_status_q && exit 0 start ;; stop) rh_status_q || exit 0 stop ;; restart) restart ;; reload) rh_status_q || exit 7 restart ;; force-reload) restart ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 restart ;; *) echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" exit 2 esac exit $? ipmiutil-3.0.7/scripts/ipmiutil_wdt.service0000644000076400007640000000045413160502144020653 0ustar acressloggers[Unit] Description=ipmiutil Watchdog Timer Service using cron After=network.target [Service] ExecStart=/usr/share/ipmiutil/ipmiutil_wdt start ExecStop=/usr/share/ipmiutil/ipmiutil_wdt stop ExecReload=/usr/share/ipmiutil/ipmiutil_wdt restart RemainAfterExit=1 [Install] WantedBy=multi-user.target ipmiutil-3.0.7/scripts/evt.sh0000755000076400007640000000240413160502144015711 0ustar acressloggers#!/bin/sh # evt.sh # A sample script to use via ipmiutil getevt -s -r /path/evt.sh # evtdesc=$1 log=/var/log/ipmi_evt.log echo "$0 got IPMI event `date`" >>$log echo "$evtdesc" >>$log # Check SEVerity for anything other than INFormational. echo $evtdesc |grep -v INF >/dev/null 2>&1 if [ $? -eq 0 ]; then # Could take various specific actions here, like snmptrap, or other alert. echo "*** Non-INF IPMI Event requiring attention ***" >>$log snmpdest=`grep trapsink /etc/snmp/snmpd.conf 2>/dev/null |head -n1` if [ "x$snmpdest" = "x" ]; then echo "No SNMP trapsink destination" >>$log else snmpipadr=`echo $snmpdest |awk '{ print $2 }'` community=`echo $snmpdest |awk '{ print $3 }'` snmphost=`uname -n` uptim=`cat /proc/uptime |cut -f1 -d' '` trapoid="enterprises.1" vboid1=".enterprises.1.1" #trapString vboid2=".enterprises.1.2" #trapSeverity sev=`echo $evtdesc |cut -c24-26` case $sev in MIN) tsev=2 ;; MAJ) tsev=3 ;; CRT) tsev=4 ;; *) tsev=1 ;; esac snmptrap -v 1 -c $community $snmpipadr $trapoid $snmphost 6 0 $uptim $vboid1 s "$evtdesc" $vboid2 i $tsev echo "Send SNMP trap to $snmpipadr for IPMI $sev event, status=$?" >>$log fi fi ipmiutil-3.0.7/scripts/Makefile.am0000644000076400007640000000346113160502144016614 0ustar acressloggers#!/bin/sh # Makefile to build/install script files # MKDIR = sh ../mkinstalldirs INSTALL_SH = sh ../install-sh -c INSTALL_DATA_SH = ${INSTALL_SH} -m 644 INSTALL_SCRIPT_SH = ${INSTALL_SH} -m 755 prefix = /usr datadir = ${prefix}/share mandir = ${prefix}/share/man docdir = ${prefix}/share/doc/ipmiutil-${version} sbindir = ${prefix}/sbin etcdir = /etc datato = ${DESTDIR}${datadir}/ipmiutil cronto = ${DESTDIR}${etcdir}/cron.daily sbinto = ${DESTDIR}${sbindir} varto = ${DESTDIR}/var/lib/ipmiutil initto = ${DESTDIR}@INIT_DIR@ sysdto = ${DESTDIR}@SYSTEMD_DIR@ sysvinit = ${datato} sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm iuser all: clean: clobber: distclean: check: install: $(MKDIR) ${datato} $(MKDIR) ${sbinto} $(MKDIR) ${initto} $(MKDIR) ${varto} $(MKDIR) ${sysdto} ${INSTALL_SCRIPT_SH} ipmi_if.sh ${datato} ${INSTALL_SCRIPT_SH} evt.sh ${datato} if [ -f /etc/debian_version ]; then \ sysvinit=${initto}; fi ${INSTALL_SCRIPT_SH} ipmiutil_wdt ${sysvinit}/ipmiutil_wdt ${INSTALL_SCRIPT_SH} ipmiutil_asy ${sysvinit}/ipmiutil_asy ${INSTALL_SCRIPT_SH} ipmiutil_evt ${sysvinit}/ipmiutil_evt ${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port ${INSTALL_SCRIPT_SH} ipmi_info ${sysvinit}/ipmi_info ${INSTALL_SCRIPT_SH} checksel ${datato} ${INSTALL_DATA_SH} ipmiutil_wdt.service ${sysdto} ${INSTALL_DATA_SH} ipmiutil_asy.service ${sysdto} ${INSTALL_DATA_SH} ipmiutil_evt.service ${sysdto} ${INSTALL_DATA_SH} ipmi_port.service ${sysdto} ${INSTALL_SCRIPT_SH} ipmiutil.env ${datato} ${INSTALL_SCRIPT_SH} ipmiutil.pre ${datato} ${INSTALL_SCRIPT_SH} ipmiutil.setup ${datato} ${INSTALL_SCRIPT_SH} ipmi.init.basic ${datato} for f in ${sbinfls}; do \ ${INSTALL_SCRIPT_SH} $$f ${sbinto}; done ipmiutil-3.0.7/scripts/iconfig0000755000076400007640000000003513160502144016116 0ustar acressloggers#!/bin/sh ipmiutil config $* ipmiutil-3.0.7/scripts/ilan.cmd0000644000076400007640000000002113160502144016155 0ustar acressloggersipmiutil lan %* ipmiutil-3.0.7/scripts/ifru.cmd0000644000076400007640000000002113160502144016177 0ustar acressloggersipmiutil fru %* ipmiutil-3.0.7/scripts/uninstall.vbs0000644000076400007640000000427013160502144017304 0ustar acressloggers' This VBScript should run before any files are actually removed On Error Resume Next Set sh = CreateObject("WScript.Shell") ' Set fso = CreateObject("Scripting.FileSystemObject") Dim installer : Set installer = Nothing Set installer = CreateObject("WindowsInstaller.Installer") 'key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot" 'SysLoc = sh.RegRead(key) & "\system32" ' remove the showsel EventLog source entries keybase = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\showsel" key1 = keybase & "\EventMessageFile" key2 = keybase & "\TypesSupported" sh.RegDelete key1 sh.RegDelete key2 sh.RegDelete keybase ' Find out where our files were installed If(IsEmpty(Session)) Then 'Not running from within installer. Source path is current directory. InstallLoc = sh.CurrentDirectory Else 'Running inside the installer, use CustomActionData "[TARGETDIR]". ' InstallLoc = installer.ProductInfo(productCode, "InstallLocation") InstallLoc = Session.Property("CustomActionData") If(IsEmpty(InstallLoc)) Then InstallLoc = "C:\Program Files\sourceforge\ipmiutil" End If End If ' wscript.echo "InstallLoc=" & InstallLoc ' Remove the InstallLoc from the Environment Path key3 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path" EnvPath = sh.RegRead(key3) ' wscript.echo "EnvPath= " & EnvPath ' Calculates strStartAt which cuts the strSearchFor value from the path ' strSearchFor = ";C:\program files\intel\ipmirastools" strSearchFor = ";" & InstallLoc newPath = EnvPath iStartAt = "0" strSearchForLen=len(strSearchFor) strStartAt = inStr(lCase(newPath), lCase(strSearchFor)) If (strStartAt > "0") then iStartAt = (strStartAt-1) ' wscript.echo "strStartAt= " & strStartAt & " iStartAt= " & iStartAt ' Builds the new Path ' Joins the Values to the left and right of strSearchFor strTotalLen=len(newPath) newPathLeft=left(newPath,iStartAt) newPathRight=right(newPath, (strTotalLen-strSearchForLen-iStartAt)) newPath=newPathLeft + newPathRight end if ' wscript.echo "newPath= " & newPath sh.RegWrite key3, newPath, "REG_EXPAND_SZ" ipmiutil-3.0.7/scripts/isensor.cmd0000644000076400007640000000002413160502144016717 0ustar acressloggersipmiutil sensor %* ipmiutil-3.0.7/scripts/ipmi_port.service0000644000076400007640000000044113160502144020137 0ustar acressloggers[Unit] Description=ipmiutil ipmi_port service After=network.target [Service] Type=forking PIDFile=/run/ipmi_port.pid EnvironmentFile=/usr/share/ipmiutil/ipmiutil.env ExecStartPre=/usr/share/ipmiutil/ipmiutil.setup ExecStart=-/usr/sbin/ipmi_port -b [Install] WantedBy=multi-user.target ipmiutil-3.0.7/scripts/ireset0000755000076400007640000000003413160502144015772 0ustar acressloggers#!/bin/sh ipmiutil reset $* ipmiutil-3.0.7/scripts/Makefile.in0000644000000000000000000002650413160502154015613 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = scripts DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS_CFLAGS = @CROSS_CFLAGS@ CROSS_LFLAGS = @CROSS_LFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPL_CFLAGS = @GPL_CFLAGS@ GREP = @GREP@ IA64_CFLAGS = @IA64_CFLAGS@ INIT_DIR = @INIT_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INS_LIB = @INS_LIB@ LANDESK_CFLAGS = @LANDESK_CFLAGS@ LANDESK_LDADD = @LANDESK_LDADD@ LANPLUS_CFLAGS = @LANPLUS_CFLAGS@ LANPLUS_CRYPTO = @LANPLUS_CRYPTO@ LANPLUS_LDADD = @LANPLUS_LDADD@ LANPLUS_LIB = @LANPLUS_LIB@ LANPLUS_SAM = @LANPLUS_SAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_SAMX = @LD_SAMX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSENSORS = @LIBSENSORS@ LIBTOOL = @LIBTOOL@ LIB_DIR = @LIB_DIR@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS_CFLAGS = @OS_CFLAGS@ OS_DRIVERS = @OS_DRIVERS@ OS_LFLAGS = @OS_LFLAGS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_DIR = @PKG_DIR@ RANLIB = @RANLIB@ SAM2OBJ = @SAM2OBJ@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHR_LINK = @SHR_LINK@ STRIP = @STRIP@ SUBDIR_S = @SUBDIR_S@ SYSTEMD_DIR = @SYSTEMD_DIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = ${prefix}/share datarootdir = @datarootdir@ docdir = ${prefix}/share/doc/ipmiutil-${version} dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = ${prefix}/share/man mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = /usr program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = ${prefix}/sbin sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #!/bin/sh # Makefile to build/install script files # MKDIR = sh ../mkinstalldirs INSTALL_SH = sh ../install-sh -c INSTALL_DATA_SH = ${INSTALL_SH} -m 644 INSTALL_SCRIPT_SH = ${INSTALL_SH} -m 755 etcdir = /etc datato = ${DESTDIR}${datadir}/ipmiutil cronto = ${DESTDIR}${etcdir}/cron.daily sbinto = ${DESTDIR}${sbindir} varto = ${DESTDIR}/var/lib/ipmiutil initto = ${DESTDIR}@INIT_DIR@ sysdto = ${DESTDIR}@SYSTEMD_DIR@ sysvinit = ${datato} sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm iuser all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am all: clean: clobber: distclean: check: install: $(MKDIR) ${datato} $(MKDIR) ${sbinto} $(MKDIR) ${initto} $(MKDIR) ${varto} $(MKDIR) ${sysdto} ${INSTALL_SCRIPT_SH} ipmi_if.sh ${datato} ${INSTALL_SCRIPT_SH} evt.sh ${datato} if [ -f /etc/debian_version ]; then \ sysvinit=${initto}; fi ${INSTALL_SCRIPT_SH} ipmiutil_wdt ${sysvinit}/ipmiutil_wdt ${INSTALL_SCRIPT_SH} ipmiutil_asy ${sysvinit}/ipmiutil_asy ${INSTALL_SCRIPT_SH} ipmiutil_evt ${sysvinit}/ipmiutil_evt ${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port ${INSTALL_SCRIPT_SH} ipmi_info ${sysvinit}/ipmi_info ${INSTALL_SCRIPT_SH} checksel ${datato} ${INSTALL_DATA_SH} ipmiutil_wdt.service ${sysdto} ${INSTALL_DATA_SH} ipmiutil_asy.service ${sysdto} ${INSTALL_DATA_SH} ipmiutil_evt.service ${sysdto} ${INSTALL_DATA_SH} ipmi_port.service ${sysdto} ${INSTALL_SCRIPT_SH} ipmiutil.env ${datato} ${INSTALL_SCRIPT_SH} ipmiutil.pre ${datato} ${INSTALL_SCRIPT_SH} ipmiutil.setup ${datato} ${INSTALL_SCRIPT_SH} ipmi.init.basic ${datato} for f in ${sbinfls}; do \ ${INSTALL_SCRIPT_SH} $$f ${sbinto}; done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ipmiutil-3.0.7/scripts/showsel.reg0000644000076400007640000000051313160502144016736 0ustar acressloggersREGEDIT4 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\showsel] "EventMessageFile"="%SystemRoot%\\system32\\showselmsg.dll" "TypesSupported"=dword:00000007 "IndexFile"="%ipmiutildir%\\sel.idx" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule] "AtTaskMaxHours"=dword:00000000 ipmiutil-3.0.7/scripts/ipmiutil_wdt0000755000076400007640000000547313160502144017225 0ustar acressloggers#! /bin/sh # # wdt Enable & reset the IPMI watchdog timer via cron # # chkconfig: - 91 59 # description: wdt is a utility from ipmiutil.sf.net to configure the \ # IPMI watchdog timer. # # It enables watchdog for 90 second timeout, reset every 1 min (60 sec). # It uses the cron daemon which reads files from /etc/cron.d # Note that the $crond_sh variable is different for RedHat & SuSE. # ### BEGIN INIT INFO # Provides: ipmiutil_wdt # Required-Start: $local_fs $remote_fs $syslog # Required-Stop: $local_fs $remote_fs $syslog # Default-Start: 3 4 5 3 4 5 # Default-Stop: 0 1 2 6 0 1 2 6 # Short-Description: ipmiutil watchdog timer init script # Description: Init script to enable and reset ipmiutil watchdog timer via cron ### END INIT INFO # name=ipmiutil_wdt prog="/usr/bin/ipmiutil wdt" wdtcron=/etc/cron.d/wdt LOCKFILE=/var/lock/subsys/$name wdtlog=/var/log/$name wdtsec=150 # default 150 seconds for watchdog timeout (2*60 + 30) start() { echo -n "Starting $prog: " echo # do not start if in driverless mode ipmiutil cmd -k |grep "driverless" >/dev/null 2>&1 if [ $? -eq 0 ]; then driverok=0 else driverok=1 fi if [ $driverok -eq 0 ] then echo "No ipmi driver loaded, aborting." RETVAL=1 else # configure the watchdog for a 150 second timeout $prog -e -t $wdtsec >$wdtlog RETVAL=$? if [ $RETVAL -eq 0 ]; then # restart the watchdog every 60 seconds via /etc/cron.d cat - <<%%% >$wdtcron * * * * * root $prog -r >/dev/null %%% # make crond re-read the /etc/cron.d $restart_cron >>$wdtlog touch $LOCKFILE fi fi echo return $RETVAL } stop() { echo -n "Stopping $prog: " echo # first disable the watchdog $prog -d >>$wdtlog RETVAL=$? # now remove the wdt cron job rm -f $wdtcron # make crond re-read the /etc/cron.d $restart_cron >>$wdtlog rm -f ${LOCKFILE} echo return $RETVAL } restart() { stop start } get_status() { $prog if [ -f ${LOCKFILE} ]; then if [ -f $wdtcron ]; then echo "$name is running..." retval=0 else echo "$name is not running but ${LOCKFILE} exists" retval=1 fi else echo "$name is stopped" retval=3 fi return $retval } # Begin mainline script here if [ -x /bin/systemctl ]; then restart_cron='systemctl restart crond.service' elif [ -f /etc/redhat-release ]; then restart_cron='/etc/init.d/crond restart' else # SuSE, MontaVista, etc. restart_cron='/etc/init.d/cron restart' fi if [ ! -d /var/lock/subsys ]; then LOCKFILE=/var/run/$name.pid fi case "$1" in start) start ;; stop) stop ;; status) get_status ;; restart) restart ;; reload) restart ;; *) echo "Usage: $0 {start|stop|status|restart|reload}" exit 1 esac ipmiutil-3.0.7/scripts/iserial.cmd0000644000076400007640000000002413160502144016665 0ustar acressloggersipmiutil serial %* ipmiutil-3.0.7/scripts/ipmiutil.setup0000755000076400007640000000177513160502144017507 0ustar acressloggers#! /bin/sh # ipmiutil ipmi_port setup script for systemd # . /usr/share/ipmiutil/ipmiutil.env getpid () { # This is messy if the parent script is same name as $1 p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` echo $p } isetup() { retval=1 PID=0 mkdir -p $IVARDIR if [ ! -f $ISENSOROUT ]; then # Capture a snapshot of IPMI sensor data for later reuse. ipmiutil sensor -q >$ISENSOROUT fi if [ -f $ITHRESH ] then # apply saved IPMI sensor thresholds, if any sh $ITHRESH fi if [ -d ${IMIBDIR} ] then # put bmclanpet MIB where SNMP can find it cp -f $IDATADIR/bmclanpet.mib ${IMIBDIR}/BMCLAN-PET-MIB.txt fi dpc=`getpid dpcproxy` if [ "x${dpc}" != "x" ] then echo "dpcproxy is already running on port 623, so not needed." retval=6 else # portmap may have been replaced by portreserve # only need ipmi_port if portmap exists if [ -x $IPORTMAP ] then retval=0 else retval=6 fi fi return $retval } isetup ipmiutil-3.0.7/scripts/ipmiutil.env0000644000076400007640000000117213160502144017123 0ustar acressloggers#!/bin/sh # These environment variables go with ipmiutil systemd services. # IDATADIR=/usr/share/ipmiutil # For ipmiutil_evt # Its log is /var/log/ipmiutil_evt.log IPMIUTILEVTARGS="-s -b -t 0" # to run a script for each IPMI event, use this instead: # IPMIUTILEVTARGS="-s -b -t 0 -r /usr/share/ipmiutil/evt.sh" # For ipmiutil_asy: # Its log is /var/log/ipmiutil_asy.log # For ipmi_port: IPORTMAP=/etc/init.d/portmap IMIBDIR=/usr/share/snmp/mibs IVARDIR=/var/lib/ipmiutil ISENSOROUT=${IVARDIR}/sensor_out.txt # This threshold script could be created by ipmiutil sensor -p ... ITHRESH="${IVARDIR}/thresholds.sh" IINITDIR=/etc/init.d ipmiutil-3.0.7/scripts/ipmiutil_asy.service0000644000076400007640000000045113160502144020646 0ustar acressloggers[Unit] Description=ipmiutil Async Bridge Agent After=network.target [Service] Type=forking PIDFile=/run/ipmiutil_asy.pid EnvironmentFile=/usr/share/ipmiutil/ipmiutil.env ExecStartPre=/usr/share/ipmiutil/ipmiutil.pre ExecStart=/usr/bin/ipmiutil getevt -a -b [Install] WantedBy=multi-user.target ipmiutil-3.0.7/scripts/Makefile0000644000000000000000000002714213160502163015205 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # scripts/Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. pkgdatadir = $(datadir)/ipmiutil pkgincludedir = $(includedir)/ipmiutil pkglibdir = $(libdir)/ipmiutil pkglibexecdir = $(libexecdir)/ipmiutil am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = x86_64-redhat-linux-gnu host_triplet = x86_64-redhat-linux-gnu subdir = scripts DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run aclocal-1.11 AMTAR = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run tar AR = ar AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run autoconf AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run autoheader AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = gcc -E CPPFLAGS = CROSS_CFLAGS = CROSS_LFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps DSYMUTIL = DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E EXEEXT = FGREP = /bin/grep -F GPL_CFLAGS = GREP = /bin/grep IA64_CFLAGS = INIT_DIR = /etc//rc.d/init.d INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s INS_LIB = LANDESK_CFLAGS = LANDESK_LDADD = LANPLUS_CFLAGS = -DHAVE_LANPLUS LANPLUS_CRYPTO = -lcrypto LANPLUS_LDADD = -L../lib -lipmi_lanplus -L/usr/local/lib -lcrypto LANPLUS_LIB = ../lib/libipmi_lanplus.a LANPLUS_SAM = yes LD = /usr/bin/ld -m elf_x86_64 LDFLAGS = LD_SAMX = ../lib/libipmi_lanplus.a -lcrypto LIBOBJS = LIBS = LIBSENSORS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LIB_DIR = /usr/lib64 LIPO = LN_S = ln -s LTLIBOBJS = MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run makeinfo MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = OBJDUMP = objdump OBJEXT = o OS_CFLAGS = -DLINUX -fPIC -Wno-pointer-sign -Wno-sign-conversion -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 OS_DRIVERS = imbapi.c ipmimv.c ipmild.c ipmidir.c OS_LFLAGS = OTOOL = OTOOL64 = PACKAGE = ipmiutil PACKAGE_BUGREPORT = PACKAGE_NAME = ipmiutil PACKAGE_STRING = ipmiutil 3.0.7 PACKAGE_TARNAME = ipmiutil PACKAGE_VERSION = 3.0.7 PATH_SEPARATOR = : PKG_DIR = /root/rpmbuild RANLIB = ranlib SAM2OBJ = isensor2.o ievents2.o SED = sed SET_MAKE = SHELL = /bin/sh SHR_LINK = libipmiutil.so.1 STRIP = strip SUBDIR_S = doc scripts lib util SYSTEMD_DIR = /usr/share/ipmiutil VERSION = 3.0.7 abs_builddir = /usr/dev/ipmiutil-3.0.7/scripts abs_srcdir = /usr/dev/ipmiutil-3.0.7/scripts abs_top_builddir = /usr/dev/ipmiutil-3.0.7 abs_top_srcdir = /usr/dev/ipmiutil-3.0.7 ac_ct_CC = gcc ac_ct_DUMPBIN = am__include = include am__leading_dot = . am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin build = x86_64-redhat-linux-gnu build_alias = build_cpu = x86_64 build_os = linux-gnu build_vendor = redhat builddir = . datadir = ${prefix}/share datarootdir = ${prefix}/share docdir = ${prefix}/share/doc/ipmiutil-${version} dvidir = ${docdir} exec_prefix = ${prefix} host = x86_64-redhat-linux-gnu host_alias = host_cpu = x86_64 host_os = linux-gnu host_vendor = redhat htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /usr/dev/ipmiutil-3.0.7/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var lt_ECHO = echo mandir = ${prefix}/share/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} pkgconfigdir = ${libdir}/pkgconfig prefix = /usr program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = top_build_prefix = ../ top_builddir = .. top_srcdir = .. #!/bin/sh # Makefile to build/install script files # MKDIR = sh ../mkinstalldirs INSTALL_SH = sh ../install-sh -c INSTALL_DATA_SH = ${INSTALL_SH} -m 644 INSTALL_SCRIPT_SH = ${INSTALL_SH} -m 755 etcdir = /etc datato = ${DESTDIR}${datadir}/ipmiutil cronto = ${DESTDIR}${etcdir}/cron.daily sbinto = ${DESTDIR}${sbindir} varto = ${DESTDIR}/var/lib/ipmiutil initto = ${DESTDIR}/etc//rc.d/init.d sysdto = ${DESTDIR}/usr/share/ipmiutil sysvinit = ${datato} sbinfls = ialarms ihealth ifru igetevent ireset icmd isol ilan isensor isel iserial iwdt iconfig ipicmg ifirewall ifwum ihpm iuser all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am all: clean: clobber: distclean: check: install: $(MKDIR) ${datato} $(MKDIR) ${sbinto} $(MKDIR) ${initto} $(MKDIR) ${varto} $(MKDIR) ${sysdto} ${INSTALL_SCRIPT_SH} ipmi_if.sh ${datato} ${INSTALL_SCRIPT_SH} evt.sh ${datato} if [ -f /etc/debian_version ]; then \ sysvinit=${initto}; fi ${INSTALL_SCRIPT_SH} ipmiutil_wdt ${sysvinit}/ipmiutil_wdt ${INSTALL_SCRIPT_SH} ipmiutil_asy ${sysvinit}/ipmiutil_asy ${INSTALL_SCRIPT_SH} ipmiutil_evt ${sysvinit}/ipmiutil_evt ${INSTALL_SCRIPT_SH} ipmi_port.sh ${sysvinit}/ipmi_port ${INSTALL_SCRIPT_SH} ipmi_info ${sysvinit}/ipmi_info ${INSTALL_SCRIPT_SH} checksel ${datato} ${INSTALL_DATA_SH} ipmiutil_wdt.service ${sysdto} ${INSTALL_DATA_SH} ipmiutil_asy.service ${sysdto} ${INSTALL_DATA_SH} ipmiutil_evt.service ${sysdto} ${INSTALL_DATA_SH} ipmi_port.service ${sysdto} ${INSTALL_SCRIPT_SH} ipmiutil.env ${datato} ${INSTALL_SCRIPT_SH} ipmiutil.pre ${datato} ${INSTALL_SCRIPT_SH} ipmiutil.setup ${datato} ${INSTALL_SCRIPT_SH} ipmi.init.basic ${datato} for f in ${sbinfls}; do \ ${INSTALL_SCRIPT_SH} $$f ${sbinto}; done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ipmiutil-3.0.7/scripts/ihealth0000755000076400007640000000003513160502144016116 0ustar acressloggers#!/bin/sh ipmiutil health $* ipmiutil-3.0.7/scripts/setlib.sh0000755000076400007640000000146013160502144016376 0ustar acressloggers#!/bin/sh # setup sequence for ipmiutil # # Resolve whatever libcrypto.so is present to the one that ipmiutil # was built to reference. # The default build on RHEL4.4 references libcrypto.so.4 libver=4 found=0 # check where the libcrypto.so is located dirs="/usr/lib64 /lib64 /usr/lib /lib" for d in $dirs do libt=`ls $d/libcrypto.so.0.* 2>/dev/null |tail -n1` if [ "x$libt" != "x" ]; then # Found a libcrypto.so libcry=$libt libdir=$d found=1 libnew=$libdir/libcrypto.so.$libver echo "libcry=$libcry libdir=$libdir libnew=$libnew" if [ ! -f $libnew ]; then # Need a sym-link to resolve it echo "ln -s $libcry $libnew" ln -s $libcry $libnew ldconfig fi fi done if [ $found -eq 0 ]; then echo "libcrypto.so not found, install openssl rpm" rv=1 else rv=0 fi exit $rv ipmiutil-3.0.7/scripts/ipmiutil_evt.service0000644000076400007640000000046013160502144020650 0ustar acressloggers[Unit] Description=ipmiutil Event Daemon After=network.target [Service] Type=forking PIDFile=/run/ipmiutil_evt.pid EnvironmentFile=/usr/share/ipmiutil/ipmiutil.env ExecStartPre=/usr/share/ipmiutil/ipmiutil.pre ExecStart=/usr/bin/ipmiutil getevt $IPMIUTILEVTARGS [Install] WantedBy=multi-user.target ipmiutil-3.0.7/scripts/ireset.cmd0000644000076400007640000000002313160502144016527 0ustar acressloggersipmiutil reset %* ipmiutil-3.0.7/scripts/ihpm0000755000076400007640000000003213160502144015432 0ustar acressloggers#!/bin/sh ipmiutil hpm $* ipmiutil-3.0.7/scripts/ipdiff.sh0000755000076400007640000000173613160502144016363 0ustar acressloggers# ipdiff.sh # For non-shared BMC LAN channels, take the OS IP and add an increment, # then run pefconfig -I to set the new BMC LAN IP. # # eth: Get the OS IP from eth0 by default # incr: Increment is 128. by default # Customers may wish to customize the $eth and $incr parameters below to # vary these for their network environments. # # This produces a series of systems with IP addresses allocated like this: # OS IP BMC LAN IP # system1 192.168.0.1 192.168.0.129 # system2 192.168.0.2 192.168.0.130 # system3 192.168.0.3 192.168.0.131 # ... eth=eth0 incr=128 ip=`ifconfig $eth |grep "inet addr:" |cut -f2 -d':' |awk '{print $1}'` last=`echo $ip |cut -f4 -d'.'` first=`echo $ip |cut -f1-3 -d'.'` sysname=`uname -n` newlast=`expr $last + $incr` if [ $newlast -ge 255 ] then # overflow, so wrap IP (could return error instead) newlast=`expr $newlast - 255` fi newip=${first}.${newlast} echo "$sysname: $eth IP = $ip, BMC IP = $newip" ipmiutil lan -e -I $newip ipmiutil-3.0.7/scripts/isol0000755000076400007640000000003213160502144015443 0ustar acressloggers#!/bin/sh ipmiutil sol $* ipmiutil-3.0.7/scripts/ihealth.cmd0000644000076400007640000000002413160502144016653 0ustar acressloggersipmiutil health %* ipmiutil-3.0.7/scripts/checksel0000755000076400007640000000175313160502144016271 0ustar acressloggers#!/bin/sh # # checksel # # This script runs ipmiutil sel, writing any new records to syslog, # and will then clear the SEL if free space is low. # # The IPMI SEL should not normally be cleared, because the history # of the events is important, but if the IPMI SEL fills up, no new # events are logged, so saving the previous SEL events and clearing # the SEL must be done occasionally, as needed. # # app=`basename $0` # pdir=`echo $0 |sed -e "s/$app//"` pdir=/usr/bin ddir=/var/lib/ipmiutil # First check to see if the IPMI SEL is enabled on this system. # If not, do nothing else. $pdir/ipmiutil sel -v >/dev/null 2>&1 if [ $? -eq 0 ]; then # Write new SEL events to syslog, and check if free space is low $pdir/ipmiutil sel -w |grep "WARNING: free space" if [ $? -eq 0 ]; then today=`date +%y%m%d` # The old SEL records are in syslog, but save a copy in $ddir also. $pdir/ipmiutil sel -e >$ddir/ipmisel_${today}.txt # Clear the IPMI SEL $pdir/ipmiutil sel -d fi fi ipmiutil-3.0.7/scripts/init.sh0000755000076400007640000000164513160502144016064 0ustar acressloggers#!/bin/sh # init.sh - run this at install time if rpm postinstall not used # sbindir=/usr/bin vardir=/var/lib/ipmiutil datadir=/usr/share/ipmiutil sensorout=$vardir/sensor_out.txt if [ -x $datadir/setlib.sh ]; then $datadir/setlib.sh fi mkdir -p $vardir if [ ! -f $vardir/ipmi_if.txt ]; then $datadir/ipmi_if.sh fi # Run some ipmiutil command to see if any IPMI interface works. $sbindir/ipmiutil wdt >/dev/null 2>&1 IPMIret=$? # If IPMIret==0, the IPMI cmd was successful, and IPMI is enabled locally. if [ $IPMIret -eq 0 ]; then # IPMI_IS_ENABLED, so enable services if [ -x /sbin/chkconfig ]; then /sbin/chkconfig --add ipmi_port /sbin/chkconfig --add ipmiutil_wdt /sbin/chkconfig --add ipmiutil_asy fi # Capture a snapshot of IPMI sensor data once now for later reuse. if [ ! -f $sensorout ]; then $sbindir/ipmiutil sensor -q >$sensorout fi fi ipmiutil-3.0.7/scripts/ifirewall0000755000076400007640000000003713160502144016460 0ustar acressloggers#!/bin/sh ipmiutil firewall $* ipmiutil-3.0.7/scripts/isensor0000755000076400007640000000003513160502144016162 0ustar acressloggers#!/bin/sh ipmiutil sensor $* ipmiutil-3.0.7/scripts/showselun.reg0000644000076400007640000000014413160502144017301 0ustar acressloggersREGEDIT4 [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\showsel] ipmiutil-3.0.7/scripts/ipmi_info0000755000076400007640000000453313160502144016460 0ustar acressloggers#! /bin/sh # # ipmi_info # # chkconfig: 345 91 07 # description: ipmi_info saves the OS info (hostname, OS release) into # the IPMI System Info variables, if supported. # It does nothing if IPMI System Info is not supported. # ### BEGIN INIT INFO # Provides: ipmi_info # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Default-Start: # Default-Stop: # Short-Description: ipmi_info saves OS info to the IPMI system info # Description: ipmi_info saves OS info to the IPMI system info ### END INIT INFO name=ipmi_info iuprog=/usr/bin/ipmiutil tmp=/tmp/ipmi_info.tmp getosver() { if [ -f /etc/os-release ]; then . /etc/os-release echo "${NAME} ${VERSION} kernel ${KERNEL_VERSION}" elif [ -f /etc/redhat-release ]; then cat /etc/redhat-release |head -n1 elif [ -f /etc/SuSE-release ]; then cat /etc/SuSE-release |head -n1 elif [ -f /etc/mvl-release ]; then sver=`grep Monta /etc/mvl-release |awk '{ print $4 }' |cut -f1 -d'.'` echo "Monta Vista Linux version $sver" elif [ -f /etc/debian_version ]; then sver=`grep Debian /etc/issue |awk '{ print $3 }'` echo "Debian Linux version $sver" else sver=`uname -r` styp=`uname -s` echo "$styp $sver" fi } start() { echo -n "Starting $name: " echo retval=0 PID=0 ${iuprog} health -i >$tmp 2>&1 if [ $? -eq 0 ]; then name=`hostname` os=`getosver` echo "setting name=$name, os=$os ..." >>$tmp ${iuprog} health -n "$name" >>$tmp 2>&1 ${iuprog} health -o "$os" >>$tmp 2>&1 else # IPMI System Info is not supported. retval=0 fi echo return $retval } stop() { echo -n "Stopping $name: " echo retval=0 echo return $retval } restart() { stop start } rh_status() { echo "$name is stopped" retval=3 return $retval } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 start ;; stop) rh_status_q || exit 0 stop ;; status) rh_status ;; restart) restart ;; reload) rh_status_q || exit 7 restart ;; force_reload) restart ;; condrestart|try-restart) rh_status_q || exit 0 restart ;; *) echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" exit 2 esac exit $? ipmiutil-3.0.7/scripts/install-solaris.sh0000755000076400007640000000121313160502144020230 0ustar acressloggers#!/bin/sh # Solaris or BSD install.sh # datadir=/usr/share/ipmiutil vardir=/var/lib/ipmiutil sbindir=/usr/bin mandir=/usr/share/man/man8 manfiles="ialarms.8 iconfig.8 ihealth.8 ievents.8 ifru.8 igetevent.8 ireset.8 icmd.8 idiscover.8 ipmiutil.8 isol.8 ilan.8 isensor.8 isel.8 iserial.8 iwdt.8" shfiles="checksel ipmi_if.sh ipmi_port.sh ipmiutil_wdt" mibfiles="bmclanpet.mib" mkdir -p $datadir mkdir -p $vardir mkdir -p $mandir cp ipmiutil ievents idiscover ipmi_port $sbindir cp $manfiles $mandir cp UserGuide $mibfiles $shfiles $datadir $sbindir/ipmiutil sensor -q >$vardir/sensor_out.txt # Admin should set up checksel cron script also ipmiutil-3.0.7/scripts/ifwum0000755000076400007640000000003313160502144015625 0ustar acressloggers#!/bin/sh ipmiutil fwum $* ipmiutil-3.0.7/scripts/icmd.cmd0000644000076400007640000000002113160502144016146 0ustar acressloggersipmiutil cmd %* ipmiutil-3.0.7/scripts/isol.cmd0000644000076400007640000000002113160502144016200 0ustar acressloggersipmiutil sol %* ipmiutil-3.0.7/scripts/iserial0000755000076400007640000000003513160502144016130 0ustar acressloggers#!/bin/sh ipmiutil serial $* ipmiutil-3.0.7/scripts/icmd0000755000076400007640000000003213160502144015411 0ustar acressloggers#!/bin/sh ipmiutil cmd $* ipmiutil-3.0.7/scripts/iconfig.cmd0000644000076400007640000000002413160502144016653 0ustar acressloggersipmiutil config %* ipmiutil-3.0.7/scripts/ipmiutil.pre0000755000076400007640000000050213160502144017120 0ustar acressloggers#!/bin/sh # # Before starting an ipmiutil service, make sure we have a driver loaded, # since running driverless for multi-user is not supported. /usr/bin/ipmiutil cmd -k 2>/dev/null |grep "driverless" >/dev/null 2>&1 if [ $? -eq 0 ]; then rv=1 echo "No Linux IPMI driver loaded, aborting." else rv=0 fi exit $rv ipmiutil-3.0.7/scripts/ialarms0000755000076400007640000000003513160502144016130 0ustar acressloggers#!/bin/sh ipmiutil alarms $* ipmiutil-3.0.7/scripts/ipicmg0000755000076400007640000000003413160502144015747 0ustar acressloggers#!/bin/sh ipmiutil picmg $* ipmiutil-3.0.7/scripts/isel0000755000076400007640000000003213160502144015431 0ustar acressloggers#!/bin/sh ipmiutil sel $* ipmiutil-3.0.7/scripts/showsel.mc0000644000076400007640000000127713160502144016570 0ustar acressloggers; // This is the header section. MessageIdTypedef=DWORD SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS Informational=0x1:STATUS_SEVERITY_INFORMATIONAL Warning=0x2:STATUS_SEVERITY_WARNING Error=0x3:STATUS_SEVERITY_ERROR ) FacilityNames=(System=0x0:FACILITY_SYSTEM Runtime=0x2:FACILITY_RUNTIME Stubs=0x3:FACILITY_STUBS Io=0x4:FACILITY_IO_ERROR_CODE ) LanguageNames=(English=0x409:MSG00409) ; // The following are message definitions. MessageId=0x101 Severity=Informational Facility=System SymbolicName=MSG_SEL_RECORD Language=English SEL: %1 . ipmiutil-3.0.7/scripts/iwdt0000755000076400007640000000003213160502144015444 0ustar acressloggers#!/bin/sh ipmiutil wdt $* ipmiutil-3.0.7/scripts/install.cmd0000644000076400007640000000152613160502144016713 0ustar acressloggers@echo off REM install Windows ipmiutil on this system REM install the DLLs, registry entries, and start the checksel task REM Use the current directory as the starting path set ipmiutildir=%CD% set orgdir=%SystemDrive%\Program Files\sourceforge set installdir=%orgdir%\ipmiutil REM DLLs: showsel.dll, libeay32.dll, ssleay32.dll copy *.dll %SystemRoot%\system32 %ipmiutildir%\showsel.reg echo Copying files to "%installdir%" mkdir "%orgdir%" mkdir "%installdir%" copy "%ipmiutildir%\*.*" "%installdir%" REM echo PATH=%PATH% set PATH=%PATH%;%installdir% set pathkey="HKLM\System\CurrentControlSet\Control\Session Manager\Environment" reg add %pathkey% /v Path /t REG_EXPAND_SZ /d "%PATH%;%installdir%" REM reg query %pathkey% /v Path at 23:30 /every:m,t,w,th,f,s,su "%installdir%\checksel.cmd" >"%installdir%\checksel.id" ipmiutil-3.0.7/scripts/idiscover.cmd0000644000076400007640000000002613160502144017226 0ustar acressloggersipmiutil discover %* ipmiutil-3.0.7/scripts/uninstall.cmd0000644000076400007640000000171113160502144017252 0ustar acressloggers@echo off REM uninstall Windows ipmiutil on this system REM uninstall the DLLs, registry entries, and stop the checksel task set installdir=%SystemDrive%\Program Files\sourceforge\ipmiutil "%installdir%\showselun.reg" del /Q %SystemRoot%\system32\showsel.dll REM remove %installdir% from the PATH set pathkey="HKLM\System\CurrentControlSet\Control\Session Manager\Environment" REM reg query %pathkey% /v Path |findstr Path set NEWPATH=%PATH:;%installdir%=% reg add %pathkey% /v Path /t REG_EXPAND_SZ /d "%NEWPATH%" set PATH=%NEWPATH% REM type "%installdir%\checksel.id" FOR /F "usebackq tokens=1*" %%i IN (`type "%installdir%\checksel.id"`) DO call :SETAT %%i %%j goto :NEXTJ :SETAT REM %1 %2 %3 %4 %5 %6 %7 %8 REM Added a new job with job ID = 2 echo %1 %2 %3 %4 %5 %6 %7 %8 %9 set ATJOB=%8 echo at %ATJOB% /DELETE at %ATJOB% /DELETE goto :EOF :NEXTJ del /Q "%installdir%\*.*" ipmiutil-3.0.7/scripts/checksel.cmd0000644000076400007640000000060213160502144017020 0ustar acressloggers@echo off REM checksel.cmd REM This at script runs ipmiutil sel, writing any new records to syslog, REM and will then clear the SEL if free space is low. REM Get path from arg 0 set ipmiutildir=%~d0%~p0 cd %ipmiutildir% cmd /c %ipmiutildir%\ipmiutil sel -w | findstr /c:"WARNING: free space" if errorlevel 1 goto done cmd /c %ipmiutildir%\ipmiutil sel -d :done ipmiutil-3.0.7/scripts/ipmi.init.basic0000755000076400007640000000364713160502144017474 0ustar acressloggers#!/bin/sh # # ipmi: OpenIPMI Driver init script (basic only) # Author: Andy Cress # # chkconfig: - 13 87 # description: OpenIPMI Driver init script # # Use this if the Linux distro does not provide one. #Sample script to install it without chkconfig: #===== #ipmisvc=/etc/init.d/ipmi #cp -f ipmi.init.basic $ipmisvc #ln -s $ipmisvc /etc/rc0.d/K87ipmi #ln -s $ipmisvc /etc/rc1.d/K87ipmi #ln -s $ipmisvc /etc/rc6.d/K87ipmi #ln -s $ipmisvc /etc/rc2.d/S13ipmi #ln -s $ipmisvc /etc/rc3.d/S13ipmi #ln -s $ipmisvc /etc/rc4.d/S13ipmi #ln -s $ipmisvc /etc/rc5.d/S13ipmi #===== # rv=0 start() { lsmod |grep ipmi_dev >/dev/null if [ $? -ne 0 ]; then echo "Starting OpenIPMI driver ..." # load the ipmi modules, if not already loaded or builtin cat /proc/kallsyms |grep ipmi_init_msghandler >/dev/null 2>&1 if [ $? -ne 0 ]; then modprobe ipmi_msghandler fi cat /proc/kallsyms |grep init_ipmi_si >/dev/null 2>&1 if [ $? -ne 0 ]; then modprobe ipmi_si rv=$? if [ $rv -ne 0 ]; then modprobe ipmi_si_drv # try old module name fi fi modprobe ipmi_devintf # do not start ipmi_watchdog for Supermicro dmidecode |grep -A1 'Base Board' |grep -q -i Supermicro if [ $? -ne 0 ]; then modprobe ipmi_watchdog 2>/dev/null fi fi maj=$(cat /proc/devices | awk '/ipmidev/{print $1}') if [ "x$maj" != "x" ]; then test -e /dev/ipmi0 && rm -f /dev/ipmi0 /bin/mknod /dev/ipmi0 c $maj 0 fi } stop() { lsmod |grep ipmi_msghandler >/dev/null if [ $? -eq 0 ]; then echo "Stopping OpenIPMI driver ..." rmmod ipmi_poweroff 2>/dev/null rmmod ipmi_watchdog 2>/dev/null rmmod ipmi_devintf 2>/dev/null rmmod ipmi_si rv=$? rmmod ipmi_msghandler else rv=2 fi } status() { lsmod |grep ipmi rv=$? } case "$1" in start) start ;; stop) stop ;; status) status ;; *) start ;; esac exit $rv ipmiutil-3.0.7/scripts/ialarms.cmd0000644000076400007640000000002413160502144016665 0ustar acressloggersipmiutil alarms %* ipmiutil-3.0.7/scripts/ipmi_port.sh0000755000076400007640000000744313160502144017125 0ustar acressloggers#! /bin/sh # # ipmi_port # # chkconfig: 345 91 07 # description: ipmi_port reserves the IPMI RMCP port 623 from portmap # which prevents portmap from trying to use port 623. # This script also applies any saved IPMI thresholds, and # copies the bmclanpet.mib to where SNMP can find it. # It is recommended that this service be started for # all systems with ipmiutil that also have portmap. # ### BEGIN INIT INFO # Provides: ipmi_port # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Default-Start: 3 4 5 3 4 5 # Default-Stop: 0 1 2 6 0 1 2 6 # Short-Description: ipmi_port reserves the RMCP port from portmap # Description: ipmi_port is used to reserve the RMCP port from portmap ### END INIT INFO # #if [ -f /etc/init.d/functions ]; then # Source function library. #. /etc/init.d/functions #fi name=ipmi_port progdir=/usr/sbin prog="$progdir/$name" lockfile=/var/lock/subsys/$name portmap=/etc/init.d/portmap shardir=/usr/share mibdir=$shardir/snmp/mibs datadir=$shardir/ipmiutil vardir=/var/lib/ipmiutil ifout=${vardir}/ipmi_if.txt sensorout=${vardir}/sensor_out.txt threshout=${vardir}/thresh_out.txt # This threshold script could be created by ipmiutil sensor -p ... thresh="${vardir}/thresholds.sh" getpid () { # This is messy if the parent script is same name as $1 p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` echo $p } start() { echo -n "Starting $name: " echo retval=1 PID=0 mkdir -p $vardir # if [ ! -f $ifout ]; then # ${datadir}/ipmi_if.sh # fi if [ ! -f $sensorout ]; then # Capture a snapshot of IPMI sensor data for later reuse. ipmiutil sensor -q >$sensorout fi if [ -f $thresh ] then # apply saved IPMI sensor thresholds, if any sh $thresh >$threshout 2>&1 fi if [ -d ${mibdir} ] then # put bmclanpet MIB where SNMP can find it cp -f $datadir/bmclanpet.mib ${mibdir}/BMCLAN-PET-MIB.txt fi dpc=`getpid dpcproxy` if [ "x${dpc}" != "x" ] then echo "$name: dpcproxy is already running on port 623," echo "so $name is not needed." retval=6 else [ -x $portmap ] || exit 6 [ -x $prog ] || exit 5 $prog -b retval=$? if [ $retval -eq 0 ]; then PID=`getpid "$prog -b"` echo $PID >$lockfile fi fi echo return $retval } stop() { echo -n "Stopping $name: " echo retval=1 if [ -f $lockfile ]; then p=`cat $lockfile` if [ "x$p" = "x" ]; then p=`getpid "$prog -b"` fi if [ "x$p" != "x" ]; then kill $p retval=$? fi fi echo if [ -d ${mibdir} ]; then rm -f ${mibdir}/BMCLAN-PET-MIB.txt fi [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { stop start } rh_status() { if [ -f $lockfile ]; then p=`cat $lockfile` if [ "x$p" != "x" ]; then pid=`getpid $p` if [ "x$pid" != "x" ]; then echo "$name (pid $pid) is running..." retval=0 else echo "$name is dead but $lockfile exists" retval=1 fi else echo "$name $lockfile exists but is empty" retval=2 fi else echo "$name is stopped" retval=3 fi return $retval } rh_status_q() { rh_status >/dev/null 2>&1 } if [ ! -d /var/lock/subsys ]; then lockfile=/var/run/$name.pid fi case "$1" in start) rh_status_q && exit 0 start ;; stop) rh_status_q || exit 0 stop ;; status) rh_status ;; restart) restart ;; reload) rh_status_q || exit 7 restart ;; force_reload) restart ;; condrestart|try-restart) rh_status_q || exit 0 restart ;; *) echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" exit 2 esac exit $? ipmiutil-3.0.7/scripts/ipmiutil_wdt.cmd0000755000076400007640000000023213160502144017753 0ustar acressloggersREM ipmiutil_wdt.cmd REM wdt Reset the IPMI watchdog timer every NSEC seconds set NSEC 60 :WDTLOOP ipmiutil wdt -r sleep %NSEC% goto WDTLOOP ipmiutil-3.0.7/scripts/install.vbs0000644000076400007640000000355313160502144016744 0ustar acressloggers' This VBScript should run after all files have been copied onto the system. Set sh = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") Dim installer : Set installer = Nothing Set installer = CreateObject("WindowsInstaller.Installer") Dim sOutFile, outs, sScrFile ' Find out where our files were installed If(IsEmpty(Session)) Then 'Not running from within installer. Source path is current directory. InstallLoc = sh.CurrentDirectory Else 'Running inside the installer, use CustomActionData "[TARGETDIR]". ' InstallLoc = installer.ProductInfo(productCode, "InstallLocation") InstallLoc = Session.Property("CustomActionData") If(IsEmpty(InstallLoc)) Then InstallLoc = "C:\Program Files\sourceforge\ipmiutil" End If End If ' wscript.echo "InstallLoc=" & InstallLoc ' Find System Folder (usually c:\windows\system32). key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot" SysLoc = sh.RegRead(key) & "\system32" ' Add InstallLoc to the Environment Path key3 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path" EnvPath = sh.RegRead(key3) & ";" & InstallLoc sh.RegWrite key3, EnvPath, "REG_EXPAND_SZ" ' Set up the showsel EventLog source ' showselmsg.dll is copied by the installer already keybase = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\showsel\" key1 = keybase & "EventMessageFile" key2 = keybase & "TypesSupported" sh.RegWrite key1, "%SystemRoot%\system32\showselmsg.dll", "REG_EXPAND_SZ" sh.RegWrite key2, 7, "REG_DWORD" 'val1 = sh.RegRead(key1) 'val2 = sh.RegRead(key2) 'wscript.echo "showsel: msgfile " & val1 & " types " & val2 ' Schedule the checksel.cmd to run sScrFile = InstallLoc & "\checksel.cmd" sh.Run "at 23.30 /every:m,t,w,th,f,s,su """ & sScrFile & """ ", 0, True ipmiutil-3.0.7/scripts/ipmi_if.sh0000755000076400007640000000307313160502144016532 0ustar acressloggers#!/bin/sh # ipmi_if.sh # detect IPMI Interface type, usually KCS or SSIF # # Future: also include preferred Driver type on another line # # ifdir=/usr/share/ipmiutil ifdir=/var/lib/ipmiutil ifout=$ifdir/ipmi_if.txt dmiout=/tmp/dmi.out.$$ mkdir -p $ifdir which dmidecode >/dev/null 2>&1 if [ $? -ne 0 ] then # if no dmidecode, old, so assume KCS echo "Interface type: KCS" >$ifout exit 0 fi dmidecode >$dmiout # dmidecode |grep IPMI >/dev/null 2>&1 grep IPMI $dmiout >/dev/null 2>&1 if [ $? -ne 0 ] then echo "Interface type: None" >$ifout exit 0 fi iftype=`grep "Interface Type:" $dmiout |cut -f2 -d':'` echo $iftype |grep KCS >/dev/null 2>&1 if [ $? -eq 0 ] then echo "Interface type: KCS" >$ifout else echo $iftype |grep "OUT OF SPEC" >/dev/null 2>&1 if [ $? -eq 0 ] then echo "Interface type: SSIF" >$ifout else echo "Interface type: $iftype" >$ifout fi fi # echo "IPMI `cat $ifout` interface found" sa=`grep "I2C Slave Address:" $dmiout |cut -f2 -d':'` echo "I2C Slave Address: $sa" >>$ifout base=`grep "Base Address:" $dmiout |tail -n1 |cut -f2 -d':'` echo "Base Address: $base" >>$ifout spacing=1 spac_str=`grep "Register Spacing:" $dmiout |cut -f2 -d':'` echo $spac_str | grep "Successive Byte" >/dev/null 2>&1 if [ $? -eq 0 ]; then spacing=1 else echo $spac_str | grep "32-bit" >/dev/null 2>&1 if [ $? -eq 0 ]; then spacing=4 else spacing=2 fi fi echo "Register Spacing: $spacing" >>$ifout biosver=`grep "Version: " $dmiout |head -n1 |cut -f2 -d':'` echo "BIOS Version: $biosver" >>$ifout exit 0 ipmiutil-3.0.7/scripts/ipmiutil_asy0000755000076400007640000000600413160502144017212 0ustar acressloggers#! /bin/sh # # ipmiutil_asy init script # # chkconfig: - 91 59 # description: ipmiutil async bridge agent, listens for IPMI LAN client requests # # This starts a daemon that listens for asynchronous IPMI LAN soft-shutdown # requests from a remote ipmiutil reset (-o/-D). It depends upon an imb or # openipmi driver. # ### BEGIN INIT INFO # Provides: ipmiutil_asy # Required-Start: $local_fs $remote_fs $syslog # Required-Stop: $local_fs $remote_fs $syslog # Default-Start: 3 4 5 3 4 5 # Default-Stop: 0 1 2 6 0 1 2 6 # Short-Description: ipmiutil async bridge agent init script # Description: Init script starts ipmiutil async bridge agent for remote reset ### END INIT INFO # #if [ -f /etc/init.d/functions ]; then # Source function library. #. /etc/init.d/functions #fi name="ipmiutil_asy" dname="ipmiutil_asy bridge agent" getevtlog=/var/log/${name}.log lockfile=/var/lock/subsys/${name} prog=/usr/bin/ipmiutil getpid () { p=`ps -ef |grep "$1" |grep -v grep |awk '{print $2}'` echo $p } start() { echo -n "Starting $dname: " driverok=0 dtype=`ipmiutil cmd -k |grep "IPMI access" |cut -f2 -d'=' |awk '{ print $1 }'` if [ "x$dtype" = "xopen" ]; then driverok=1 fi if [ "x$dtype" = "ximb" ]; then driverok=1 fi if [ $driverok -eq 1 ] then [ -x $prog ] || exit 5 $prog getevt -a -b >$getevtlog & retval=$? PID=$! if [ $retval -eq 0 ]; then echo $PID >$lockfile fi else echo "No imb or ipmi driver loaded, aborting." retval=1 fi echo return $retval } stop() { echo -n "Stopping $dname: " retval=1 if [ -f $lockfile ]; then p=`cat $lockfile` if [ "x$p" = "x" ]; then p=`getpid "$prog getevt -a"` fi if [ "x$p" != "x" ]; then kill $p retval=$? fi fi echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { stop start } rh_status() { if [ -f $lockfile ]; then p=`cat $lockfile` if [ "x$p" != "x" ]; then pid=`getpid $p` if [ "x$pid" != "x" ]; then echo "$dname (pid $pid) is running..." retval=0 else echo "$dname is dead but $lockfile exists" retval=1 fi else echo "$dname $lockfile exists but is empty" retval=1 fi else echo "$dname is stopped" retval=3 fi return $retval } rh_status_q() { rh_status >/dev/null 2>&1 } if [ ! -d /var/lock/subsys ]; then lockfile=/var/run/${name}.pid fi case "$1" in start) rh_status_q && exit 0 start ;; stop) rh_status_q || exit 0 stop ;; restart) restart ;; reload) rh_status_q || exit 7 restart ;; force-reload) restart ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 restart ;; *) echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" exit 2 esac exit $? ipmiutil-3.0.7/buildwin64.cmd0000644000076400007640000000234313160502144015543 0ustar acressloggers@echo off REM # buildwin.cmd REM # build ipmiutil for windows REM # REM # First download a copy of getopt.c getopt.h. REM # copy getopt.* util REM # Then download and build a copy of openssl for Windows, REM # and copy the built openssl files needed to lib & inc. REM # copy libeay32.lib ssleay32.lib lib REM # copy libeay32.dll ssleay32.dll util REM # copy include\openssl\*.h lib\lanplus\inc\openssl REM # REM # You should either run this from the Visual Studio Command Line, REM # or first run the appropriate vcvars.bat script. set | findstr VCINSTALLDIR if %errorlevel% EQU 1 goto vcerror call vcvars64.bat REM TODO, prebuild checking: REM check for getopt.c,h REM check for ssl libs REM check for ssl includes REM call mkssl set UTMAKE=ipmiutil64.mak echo %LIBPATH% |findstr /C:64 >NUL if %errorlevel% EQU 1 goto vcerror call cleanwin.cmd cd lib nmake /nologo -f ipmilib.mak all cd .. REM # echo make lib done cd util nmake /nologo -f %UTMAKE% all cd .. REM # echo make util done echo buildwin64 ipmiutil done goto done :vcerror echo Either VCINSTALLDIR is missing or LIBPATH does not include 64bit echo Need to run vcvars64.bat for 64bit from a fresh session :done ipmiutil-3.0.7/Makefile.am0000644000076400007640000000420613160502144015123 0ustar acressloggers SUBDIRS = @SUBDIR_S@ PKGDIR = @PKG_DIR@ SOURCEDIR = $(PKGDIR)/SOURCES BUILDDIR = $(PKGDIR)/BUILD RSPEC = doc/$(PACKAGE).spec PNAME = $(PACKAGE)-$(VERSION) TARDIR = /tmp/iu TMPDIR = $(TARDIR)/$(PNAME) BDIR = $(TMPDIR)-1-root RPMB = rpmbuild # $(RPMB) -bb --buildroot $(BDIR) $(RSPEC) # Note: put files here, until lib/Makefile.am supports # pkg-config support rules # if WITH_PKG_CONFIG # pkgconfig_DATA = lib/libipmiutil.pc # endif rpm: $(RSPEC) make tarball mkdir -p $(SOURCEDIR) cp -f $(TARDIR)/$(PNAME).tar.gz $(SOURCEDIR) $(RPMB) -bb $(RSPEC) $(RPMB) -bs $(RSPEC) tarball: rm -f $(TMPDIR)/../$(PNAME).tar.gz rm -rf $(TMPDIR) mkdir -p $(TMPDIR) find . -print | cpio -pdumv $(TMPDIR) cd $(TMPDIR)/test; make clean; cd .. cd $(TMPDIR)/hpiutil; make clean; cd .. cd $(TMPDIR); make distclean cd $(TMPDIR); rm -rf util/.deps lib/lanplus/.deps cd $(TMPDIR); rm -f lib/libipmiapi*.a* lib/libipmi*.a cd $(TMPDIR); rm -rf autom4te.cache cd $(TMPDIR); rm -f util/events cd $(TMPDIR); sed -i 's/\r//' ChangeLog AUTHORS COPYING NEWS README TODO doc/UserGuide cd $(TMPDIR); chmod 644 doc/UserGuide cd $(TMPDIR); rm -f cprpm debug*.list *~ .*.swp cd $(TMPDIR); find . -name '*.orig' -delete cd $(TMPDIR); find . -name '*.rej' -delete cd $(TMPDIR); cd ..; tar -czvf $(TARDIR)/$(PNAME).tar.gz $(PNAME) ls $(TARDIR)/*.gz rm -rf $(TMPDIR) # chown -R root:root $(TMPDIR) tarsol: util/ipmiutil rm -f /tmp/$(PNAME)-solaris.tar rm -rf $(TMPDIR) mkdir -p $(TMPDIR) cd util; cp ipmiutil idiscover ievents ipmi_port $(TMPDIR) cd doc; cp UserGuide *.8 *.mib $(TMPDIR) cd scripts; cp checksel ipmiutil_??? *.sh $(TMPDIR) cd $(TMPDIR); mv install-solaris.sh install.sh cd $(TMPDIR); tar cvf /tmp/$(PNAME)-solaris.tar . rm -rf $(TMPDIR) tarbsd: util/ipmiutil rm -f /tmp/$(PNAME)-bsd.tar rm -rf $(TMPDIR) mkdir -p $(TMPDIR) cd util; cp ipmiutil idiscover ievents ipmi_port $(TMPDIR) cd doc; cp UserGuide *.8 *.mib $(TMPDIR) cd scripts; cp checksel ipmiutil_??? *.sh $(TMPDIR) cd $(TMPDIR); mv install-solaris.sh install.sh cd $(TMPDIR); tar -cvf /tmp/$(PNAME)-bsd.tar . rm -rf $(TMPDIR) clean-generic: rm -f *.log *.tmp debug*.list ipmiutil-3.0.7/AUTHORS0000644000076400007640000000052313160502164014137 0ustar acressloggersipmiutil: Andy Cress util/AnsiTerm.cpp Robert Nelson util/oem_dell.c Harsha S util/ihpm.c Frederic.Lelievre@ca.kontron.com, Francois.Isabelle@ca.kontron.com, Jean-Michel.Audet@ca.kontron.com, MarieJosee.Blais@ca.kontron.com ipmiutil-3.0.7/config.sub0000755000076400007640000007305513160502144015062 0ustar acressloggers#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2003-06-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ipmiutil-3.0.7/Makefile.in0000644000000000000000000006073713160502154014132 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ TODO config.guess config.sub depcomp install-sh ltconfig \ ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS_CFLAGS = @CROSS_CFLAGS@ CROSS_LFLAGS = @CROSS_LFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPL_CFLAGS = @GPL_CFLAGS@ GREP = @GREP@ IA64_CFLAGS = @IA64_CFLAGS@ INIT_DIR = @INIT_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INS_LIB = @INS_LIB@ LANDESK_CFLAGS = @LANDESK_CFLAGS@ LANDESK_LDADD = @LANDESK_LDADD@ LANPLUS_CFLAGS = @LANPLUS_CFLAGS@ LANPLUS_CRYPTO = @LANPLUS_CRYPTO@ LANPLUS_LDADD = @LANPLUS_LDADD@ LANPLUS_LIB = @LANPLUS_LIB@ LANPLUS_SAM = @LANPLUS_SAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_SAMX = @LD_SAMX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSENSORS = @LIBSENSORS@ LIBTOOL = @LIBTOOL@ LIB_DIR = @LIB_DIR@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS_CFLAGS = @OS_CFLAGS@ OS_DRIVERS = @OS_DRIVERS@ OS_LFLAGS = @OS_LFLAGS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_DIR = @PKG_DIR@ RANLIB = @RANLIB@ SAM2OBJ = @SAM2OBJ@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHR_LINK = @SHR_LINK@ STRIP = @STRIP@ SUBDIR_S = @SUBDIR_S@ SYSTEMD_DIR = @SYSTEMD_DIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = @SUBDIR_S@ PKGDIR = @PKG_DIR@ SOURCEDIR = $(PKGDIR)/SOURCES BUILDDIR = $(PKGDIR)/BUILD RSPEC = doc/$(PACKAGE).spec PNAME = $(PACKAGE)-$(VERSION) TARDIR = /tmp/iu TMPDIR = $(TARDIR)/$(PNAME) BDIR = $(TMPDIR)-1-root RPMB = rpmbuild all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am # $(RPMB) -bb --buildroot $(BDIR) $(RSPEC) # Note: put files here, until lib/Makefile.am supports # pkg-config support rules # if WITH_PKG_CONFIG # pkgconfig_DATA = lib/libipmiutil.pc # endif rpm: $(RSPEC) make tarball mkdir -p $(SOURCEDIR) cp -f $(TARDIR)/$(PNAME).tar.gz $(SOURCEDIR) $(RPMB) -bb $(RSPEC) $(RPMB) -bs $(RSPEC) tarball: rm -f $(TMPDIR)/../$(PNAME).tar.gz rm -rf $(TMPDIR) mkdir -p $(TMPDIR) find . -print | cpio -pdumv $(TMPDIR) cd $(TMPDIR)/test; make clean; cd .. cd $(TMPDIR)/hpiutil; make clean; cd .. cd $(TMPDIR); make distclean cd $(TMPDIR); rm -rf util/.deps lib/lanplus/.deps cd $(TMPDIR); rm -f lib/libipmiapi*.a* lib/libipmi*.a cd $(TMPDIR); rm -rf autom4te.cache cd $(TMPDIR); rm -f util/events cd $(TMPDIR); sed -i 's/\r//' ChangeLog AUTHORS COPYING NEWS README TODO doc/UserGuide cd $(TMPDIR); chmod 644 doc/UserGuide cd $(TMPDIR); rm -f cprpm debug*.list *~ .*.swp cd $(TMPDIR); find . -name '*.orig' -delete cd $(TMPDIR); find . -name '*.rej' -delete cd $(TMPDIR); cd ..; tar -czvf $(TARDIR)/$(PNAME).tar.gz $(PNAME) ls $(TARDIR)/*.gz rm -rf $(TMPDIR) # chown -R root:root $(TMPDIR) tarsol: util/ipmiutil rm -f /tmp/$(PNAME)-solaris.tar rm -rf $(TMPDIR) mkdir -p $(TMPDIR) cd util; cp ipmiutil idiscover ievents ipmi_port $(TMPDIR) cd doc; cp UserGuide *.8 *.mib $(TMPDIR) cd scripts; cp checksel ipmiutil_??? *.sh $(TMPDIR) cd $(TMPDIR); mv install-solaris.sh install.sh cd $(TMPDIR); tar cvf /tmp/$(PNAME)-solaris.tar . rm -rf $(TMPDIR) tarbsd: util/ipmiutil rm -f /tmp/$(PNAME)-bsd.tar rm -rf $(TMPDIR) mkdir -p $(TMPDIR) cd util; cp ipmiutil idiscover ievents ipmi_port $(TMPDIR) cd doc; cp UserGuide *.8 *.mib $(TMPDIR) cd scripts; cp checksel ipmiutil_??? *.sh $(TMPDIR) cd $(TMPDIR); mv install-solaris.sh install.sh cd $(TMPDIR); tar -cvf /tmp/$(PNAME)-bsd.tar . rm -rf $(TMPDIR) clean-generic: rm -f *.log *.tmp debug*.list # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ipmiutil-3.0.7/buildsamp.cmd0000644000076400007640000000026513160502144015535 0ustar acressloggers set | findstr VCINSTALLDIR if %errorlevel% EQU 1 goto vcerror cd util nmake -f ipmi_sample.mak all cd .. goto done :vcerror echo Need to first run vcvars.bat :done ipmiutil-3.0.7/mkinstalldirs0000755000076400007640000000662213160502144015701 0ustar acressloggers#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2005-06-29.22 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ipmiutil-3.0.7/lib/0000755000076400007640000000000013160502163013634 5ustar acressloggersipmiutil-3.0.7/lib/libipmiutil.pc.in0000664000076400007640000000043513160502144017113 0ustar acressloggersprefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ sysconfdir=@CONFPATH@ statepath=@STATEPATH@ nutuser=@RUN_AS_USER@ Name: libipmiutil Description: Library for ipmiutil Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lipmi_lanplus Cflags: -I${includedir} ipmiutil-3.0.7/lib/Makefile.am0000644000076400007640000000467613160502144015704 0ustar acressloggers#!/bin/sh # Makefile.am to build/install ipmiutil lib files # # If --enable-lanplus (-DHAVE_LANPLUS), then this script # does a make from lib/lanplus/ for the lanplus library. # If --enable-landesk (-DLINK_LANDESK), then this script # assumes that these files are copied into this lib/ directory: # libipmiapi32.a libipmiapi64.a.suse libipmiapi64.a.redhat # MKDIR = sh ../mkinstalldirs INSTALL = sh ../install-sh -c # INSTALL_DATA = $(INSTALL) -m 644 INSTALL_SCRIPT = $(INSTALL) -m 755 INSTALL_BIN = /usr/bin/install -c iprefix = @prefix@ iexec_prefix = @exec_prefix@ PLUSFLAGS = @LANPLUS_CFLAGS@ sbindir = $(iexec_prefix)/sbin mandir = $(iprefix)/man libdir = $(iprefix)/lib datadir = $(iprefix)/share datato = ${DESTDIR}${datadir}/ipmiutil lib32 = ${DESTDIR}$(iprefix)/lib lib64 = ${DESTDIR}$(iprefix)/lib64 all: if [ -f libipmiapi32.a ]; then \ rm -f libipmiapi.a; \ if [ "`uname -m`" = "x86_64" ]; then \ if [ -f /etc/SuSE-release ]; then \ cp -f libipmiapi64.a.suse libipmiapi.a; \ else cp -f libipmiapi64.a.redhat libipmiapi.a; fi \ else cp -f libipmiapi32.a libipmiapi.a; fi \ fi if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \ cd lanplus; make clean; make ; \ pwd; cp -f libipmi_lanplus.a .. ; \ fi clean: rm -f libipmiapi.a lib*_lanplus.a lib*_lanplus.so cd lanplus; make clean clobber: rm -f libipmiapi.a lib*_lanplus.a lib*_lanplus.so cd lanplus; make clean distclean: rm -f libipmiapi.a lib*.a lib*_lanplus.so cd lanplus; make distclean install: if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \ $(MKDIR) ${datato} ; \ cd lanplus; make install ; \ fi check: installso: @if [ -d /usr/lib64 ]; then \ $(MKDIR) ${lib64} ; \ echo "installing libipmi_lanplus into ${lib64}"; \ cd lanplus; /bin/sh ../../libtool --mode=install $(INSTALL_BIN) 'libipmi_lanplus.la' '${lib64}/libipmi_lanplus.la' ; \ $(INSTALL_BIN) .libs/libipmi_lanplus.so.0.0.0 ${lib64}/libipmi_lanplus.so.0.0.0 ; \ (cd ${lib64} && rm -f libipmi_lanplus.so.0 && ln -s libipmi_lanplus.so.0.0.0 libipmi_lanplus.so.0) ; \ (cd ${lib64} && rm -f libipmi_lanplus.so && ln -s libipmi_lanplus.so.0.0.0 libipmi_lanplus.so) ; \ $(INSTALL_BIN) .libs/libipmi_lanplus.lai ${lib64}/libipmi_lanplus.la ; \ $(INSTALL_BIN) .libs/libipmi_lanplus.a ${lib64}/libipmi_lanplus.a; \ ranlib ${lib64}/libipmi_lanplus.a ; \ chmod 644 ${lib64}/libipmi_lanplus.a ; \ (cd ${lib32} && rm -f libipmi_lanplus.* ); \ ../../libtool --finish ${lib64} \ fi ipmiutil-3.0.7/lib/Makefile.in0000644000000000000000000003012513160502154014664 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/libipmiutil.pc.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = libipmiutil.pc CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS_CFLAGS = @CROSS_CFLAGS@ CROSS_LFLAGS = @CROSS_LFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPL_CFLAGS = @GPL_CFLAGS@ GREP = @GREP@ IA64_CFLAGS = @IA64_CFLAGS@ INIT_DIR = @INIT_DIR@ INSTALL = sh ../install-sh -c INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ # INSTALL_DATA = $(INSTALL) -m 644 INSTALL_SCRIPT = $(INSTALL) -m 755 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INS_LIB = @INS_LIB@ LANDESK_CFLAGS = @LANDESK_CFLAGS@ LANDESK_LDADD = @LANDESK_LDADD@ LANPLUS_CFLAGS = @LANPLUS_CFLAGS@ LANPLUS_CRYPTO = @LANPLUS_CRYPTO@ LANPLUS_LDADD = @LANPLUS_LDADD@ LANPLUS_LIB = @LANPLUS_LIB@ LANPLUS_SAM = @LANPLUS_SAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_SAMX = @LD_SAMX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSENSORS = @LIBSENSORS@ LIBTOOL = @LIBTOOL@ LIB_DIR = @LIB_DIR@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS_CFLAGS = @OS_CFLAGS@ OS_DRIVERS = @OS_DRIVERS@ OS_LFLAGS = @OS_LFLAGS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_DIR = @PKG_DIR@ RANLIB = @RANLIB@ SAM2OBJ = @SAM2OBJ@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHR_LINK = @SHR_LINK@ STRIP = @STRIP@ SUBDIR_S = @SUBDIR_S@ SYSTEMD_DIR = @SYSTEMD_DIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = $(iprefix)/share datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = $(iprefix)/lib libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = $(iprefix)/man mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = $(iexec_prefix)/sbin sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #!/bin/sh # Makefile.am to build/install ipmiutil lib files # # If --enable-lanplus (-DHAVE_LANPLUS), then this script # does a make from lib/lanplus/ for the lanplus library. # If --enable-landesk (-DLINK_LANDESK), then this script # assumes that these files are copied into this lib/ directory: # libipmiapi32.a libipmiapi64.a.suse libipmiapi64.a.redhat # MKDIR = sh ../mkinstalldirs INSTALL_BIN = /usr/bin/install -c iprefix = @prefix@ iexec_prefix = @exec_prefix@ PLUSFLAGS = @LANPLUS_CFLAGS@ datato = ${DESTDIR}${datadir}/ipmiutil lib32 = ${DESTDIR}$(iprefix)/lib lib64 = ${DESTDIR}$(iprefix)/lib64 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libipmiutil.pc: $(top_builddir)/config.status $(srcdir)/libipmiutil.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am all: if [ -f libipmiapi32.a ]; then \ rm -f libipmiapi.a; \ if [ "`uname -m`" = "x86_64" ]; then \ if [ -f /etc/SuSE-release ]; then \ cp -f libipmiapi64.a.suse libipmiapi.a; \ else cp -f libipmiapi64.a.redhat libipmiapi.a; fi \ else cp -f libipmiapi32.a libipmiapi.a; fi \ fi if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \ cd lanplus; make clean; make ; \ pwd; cp -f libipmi_lanplus.a .. ; \ fi clean: rm -f libipmiapi.a lib*_lanplus.a lib*_lanplus.so cd lanplus; make clean clobber: rm -f libipmiapi.a lib*_lanplus.a lib*_lanplus.so cd lanplus; make clean distclean: rm -f libipmiapi.a lib*.a lib*_lanplus.so cd lanplus; make distclean install: if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \ $(MKDIR) ${datato} ; \ cd lanplus; make install ; \ fi check: installso: @if [ -d /usr/lib64 ]; then \ $(MKDIR) ${lib64} ; \ echo "installing libipmi_lanplus into ${lib64}"; \ cd lanplus; /bin/sh ../../libtool --mode=install $(INSTALL_BIN) 'libipmi_lanplus.la' '${lib64}/libipmi_lanplus.la' ; \ $(INSTALL_BIN) .libs/libipmi_lanplus.so.0.0.0 ${lib64}/libipmi_lanplus.so.0.0.0 ; \ (cd ${lib64} && rm -f libipmi_lanplus.so.0 && ln -s libipmi_lanplus.so.0.0.0 libipmi_lanplus.so.0) ; \ (cd ${lib64} && rm -f libipmi_lanplus.so && ln -s libipmi_lanplus.so.0.0.0 libipmi_lanplus.so) ; \ $(INSTALL_BIN) .libs/libipmi_lanplus.lai ${lib64}/libipmi_lanplus.la ; \ $(INSTALL_BIN) .libs/libipmi_lanplus.a ${lib64}/libipmi_lanplus.a; \ ranlib ${lib64}/libipmi_lanplus.a ; \ chmod 644 ${lib64}/libipmi_lanplus.a ; \ (cd ${lib32} && rm -f libipmi_lanplus.* ); \ ../../libtool --finish ${lib64} \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ipmiutil-3.0.7/lib/libimbapi64.a.suse0000644000076400007640000002657413160502144017073 0ustar acressloggers! / 1147900453 0 0 0 564 ` xxxxxxxxxxxxxxxxxxxxxxxAsyncEventHandleGetIpmiVersionclose_imbipmi_close_iatermIPMIopen_imbSendTimedImbpRequestNTstatusSetShutDownCodeUnRegisterForImbAsyncMessageNotificationRegisterForImbAsyncMessageNotificationIsAsyncMessageAvailableGetAsyncImbpMessage_ExGetAsyncImbpMessageSendAsyncImbpRequestSendTimedLanMessageResponse_ExSendTimedLanMessageResponseSendTimedEmpMessageResponse_ExSendTimedEmpMessageResponseSendTimedI2cRequestStartAsyncMesgPollipmi_open_iainitIPMIimbapi.o/ 1147881108 503 102 100644 10952 ` ELF>@@ ¶ÃffffffHƒì‹=1À…ÿuHƒÄÃèHƒÄfÃfffffffffffHƒìèHƒÄÃfHƒìèHƒÄÃfS‰ûHìÀ‹…Àt¸HÄÀ[ÃH=1À¾è…Àˆó…Û‰t ÇQëÁH”$H¼$ LD$HL$¾Æ„$ Æ„$¡ Æ„$¤Æ„$£Æ„$¢HÇ„$¥Ç„$­ÇD$è…Àu1¶T$„Òt/H=‰Æ¶Ò1ÀèÇ1ÀHÄÀ[öT$ëу|$ Çéÿÿÿ€¼$”Q¸QºE‰éäþÿÿ€=Çt¥H\$H HH51ÀH‰ßèH‰ßèétÿÿÿfffffffffH‰\$ØH‰l$àL‰d$èL‰l$ðL‰t$ø1ÀHƒìx¿H‰ÕI‰öH‰ËM‰ÄM‰Íè1Ò…ÀtgHƒû/¸.‹=HCØH‹„$€H‰âL‰öH‰l$ H‰\$(L‰d$0L‰l$8H‰D$@H‹„$ˆH‰D$HH‹H‰D$1Àè1Ò…Àx1Ò…À”ÂH‹\$PH‹l$X‰ÐL‹d$`L‹l$hL‹t$pHƒÄxÃffffffffHƒì(‰ù‹=¸ƒÿÿtQH¸ÿÿÿÿH#D$ ‰òE1ÉE1À¾’HÇD$H ÐHT$ H‰D$ HD$‰L$$¹H‰$èÑþÿÿÿÈ•À¶ÀHƒÄ(ÃfffHƒì(H‹¸9:t HƒÄ(Ãfffff‹=HD$ LD$A¹¹¾šHÇD$H‰$ènþÿÿÿÈ•À¶ÀHƒÄ(ÃH‰l$øH‰\$ðHƒì8H…ÿH‰ýt H‹‹…ÒtºH‹\$(H‹l$0‰ÐHƒÄ8Ãfffff‹=HD$ HT$A¹I‰Ø¹¾˜HÇD$H‰$èëýÿÿHƒ|$ •ÂÿÈ•À к¨uš‹1Ò‰EH‹\$(H‹l$0‰ÐHƒÄ8ÃfffffffHƒìH‹¸ÇD$9:tHƒÄË=HD$LD$A¹¹¾œHÇD$H‰$è]ýÿÿÿÈ•À¶ÀHƒÄÃAWHiÒèAVI‰þAUM‰ÅA‰×ATI‰ôUSH‰ËHƒìhHl$0L‰L$HÇD$ %ëRfffffHƒ|$”ÂHƒ¼$ ”À к¨…¶EH‹´$ ‰ÂƒàÁêˆA¶Õ9Є ‹E‰M…ö”ÂM…ä”À Ш…H…Û„H¸ÿÿÿÿH#D$(‹=HT$(A¹%I‰è¹¾ˆL øH‰D$(‹HÇD$‰D$,HD$ H‰$èTüÿÿÿÈ…ÊH‹L$ ºHƒùvnHQüH‰T$ H‰ÖI94$ºrW=…ÿÿÿM…í¸t Iƒý…7ÿÿÿ1À¶Ð¶Eƒà9Â…#ÿÿÿH‰òHuL‰÷èH‹D$ I‰$‹E1Ò‰HƒÄh‰Ð[]A\A]A^A_öEH‹T$HuL‰÷ˆHQûèH‹D$ HÿÈ뿺HƒÄh‰Ð[]A\A]A^A_ÃH‹ºàH9”À¶ÐTë™fffffAWHiÒèAVI‰þAUM‰ÅA‰×ATI‰ôUSH‰ËHƒìXHl$ HÇD$%ëD8m„‹E‰M…ö”ÂM…ä”À Ш…H…Û„üH¸ÿÿÿÿH#D$‹=HT$A¹%I‰è¹¾ˆL øH‰D$‹HÇD$‰D$HD$H‰$è¬úÿÿÿÈ…¶H‹L$¸HƒùviHQüH‰T$I9$H‰ÖrW=…FÿÿÿM…í¸t Iƒý…<ÿÿÿ1À¶Ð¶Eƒà9Â…(ÿÿÿH‰òHuL‰÷èH‹D$I‰$‹E‰1ÀHƒÄX[]A\A]A^A_ÃHQûHuL‰÷èH‹D$HÿÈë̸HƒÄX[]A\A]A^A_ÃH‹ºàH9”À¶ÀDë¨ffATUH‰õSHƒÄ€HÇD$"¶GH\$ Ld$PˆD$(¶ˆD$)¶GˆD$*¶GˆD$+¶G ˆD$,HcW H‹wH{ è‹=HD$H‰ÚA¹"M‰à¹"¾‚ÇD$ ÇD$$HÇD$H‰$è7ùÿÿÿȺtHƒì€‰Ð[]A\ÃffHƒ|$uê¶D$Q1ÒˆEëÞfffffffffAT¸zA‰ÌD‰ÁUH‰õ‰Öº4SH‰ûHƒÄ€‹=HÇD$"L\$ ÆD$( ÆD$*ÆD$+ÿEÂE1ÒƒÿˆD$)„tƒÿQ„ŽIcÂAÿÂBˆL ¶CIcÒAÿÂIcÊAÿÂBˆD D¶KD¶CD‰ÈD‰Âƒàüƒâ ЃÈÿBˆD „ƒÿ„@A¶CIcÒAC÷ØAÿÂAƒàüBˆD AƒáIcÂAÿÂBÆD E ÈIcÂ1ÉAÿÂFˆD ¶CIcÒAÿÂ9ñBˆD }HcÑÿÁIc¶*AÿÂ9ñBˆT |èIcò1ÉÿBÆD t 1Ƀÿ•ÁÿÁARý9Ñ}AÿÁH˜B¶D BD 9Ñ|êAiÄè‹=LD$PBö\ AÿÂA¹"¹"L‰Ú¾‚A‰CHD$EˆS AÇHÇD$H‰$èS÷ÿÿÿÈt/¸Hƒì€[]A\ÃA¶CIcÒAC éöþÿÿÆD$-Aºé…þÿÿHƒ|$uÉ1À€|$PtÅë¾DˆL$-ëÛA¶CIcÒACé»þÿÿfffAT¸zA‰ÌA¸UH‰õ‰Öº4SHƒÄ€‹HÇD$"LT$ ÆD$( ÆD$*ÆD$+ûEˆD$)t ÆD$-A¸¶GIcÐAÿÀIcÈAÿÀBˆD D¶_D¶OD‰ØD‰Êƒàüƒâ ЃÈûBˆD „¶D$/IcÐD$.÷ØAÿÀAƒáüBˆD AƒãIcÀAÿÀBÆD E ÙIcÀ1ÉAÿÀFˆL ¶GIcÐAÿÀ9ñBˆD }fffHcÑÿÁIcÀ¶*AÿÀ9ñBˆT |è1ÉAPýû•ÁIcð9ÑBÆD }AÿÁH˜B¶D BD 9Ñ|êAiÄèAÿÀ‹=EˆB LD$PBö\ A¹"¹"L‰ÒA‰BHD$¾‚AÇHÇD$H‰$ècõÿÿÿÈt¸Hƒì€[]A\öD$.IcÐD$-éúþÿÿHƒ|$uÙ1À€|$PtÕëÎfffffffffAT¸zA‰ÌD‰ÁUH‰õ‰Öº4SH‰ûHƒÄ€‹=HÇD$"L\$ ÆD$( ÆD$*ÆD$+ÿEÂE1ÒƒÿˆD$)„tƒÿQ„ŽIcÂAÿÂBˆL ¶CIcÒAÿÂIcÊAÿÂBˆD D¶KD¶CD‰ÈD‰Âƒàüƒâ ЃÈÿBˆD „ƒÿ„@A¶CIcÒAC÷ØAÿÂAƒàüBˆD AƒáIcÂAÿÂBÆD E ÈIcÂ1ÉAÿÂFˆD ¶CIcÒAÿÂ9ñBˆD }HcÑÿÁIc¶*AÿÂ9ñBˆT |èIcò1ÉÿBÆD t 1Ƀÿ•ÁÿÁARý9Ñ}AÿÁH˜B¶D BD 9Ñ|êAiÄè‹=LD$PBö\ AÿÂA¹"¹"L‰Ú¾‚A‰CHD$EˆS AÇHÇD$H‰$èsóÿÿÿÈt/¸Hƒì€[]A\ÃA¶CIcÒAC éöþÿÿÆD$-Aºé…þÿÿHƒ|$uÉ1À€|$PtÅë¾DˆL$-ëÛA¶CIcÒACé»þÿÿfffAT¸zA‰ÌA¸UH‰õ‰Öº4SHƒÄ€‹HÇD$"LT$ ÆD$( ÆD$*ÆD$+ûEˆD$)t ÆD$-A¸¶GIcÐAÿÀIcÈAÿÀBˆD D¶_D¶OD‰ØD‰Êƒàüƒâ ЃÈûBˆD „¶D$/IcÐD$.÷ØAÿÀAƒáüBˆD AƒãIcÀAÿÀBÆD E ÙIcÀ1ÉAÿÀFˆL ¶GIcÐAÿÀ9ñBˆD }fffHcÑÿÁIcÀ¶*AÿÀ9ñBˆT |è1ÉAPýû•ÁIcð9ÑBÆD }AÿÁH˜B¶D BD 9Ñ|êAiÄèAÿÀ‹=EˆB LD$PBö\ A¹"¹"L‰ÒA‰BHD$¾‚AÇHÇD$H‰$èƒñÿÿÿÈt¸Hƒì€[]A\öD$.IcÐD$-éúþÿÿHƒ|$uÙ1À€|$PtÕëÎfffffffffH‰\$ÐH‰l$ØL‰d$àL‰l$èL‰t$ðL‰|$øHì¸I‰×‰õÆD$( ÆD$)RÆD$*ÆD$+¶G HÇD$"H\$ I‰ÍM‰ÄLt$PHS ƒÀˆD$,¶GˆD$-¶ˆB¶GˆBHcW H‹wH{èiÅè‹=H‰ÚA¹"M‰ð¹"¾‚ÇD$ HÇD$‰D$$HD$H‰$èoðÿÿÿȺt:H‹œ$ˆH‹¬$‰ÐL‹¤$˜L‹¬$ L‹´$¨L‹¼$°HĸÃHƒ|$t¾¶D$PAˆ$‹D$ÿÈ…ÀA‰EtM…ÿtIvHcÐL‰ÿè1ÒëfffHƒì‹=E1ÉHD$E1À1É1Ò¾”HÇD$H‰$èÀïÿÿÿÈ•ÀHƒÄ¶ÀÃffH‰\$ÐH‰l$ØL‰d$àL‰l$èL‰t$ðL‰|$øHìØI‰Ö‰õHÇD$@¶GH\$ I‰ÍM‰ÄL|$`ˆD$(¶ˆD$)¶GˆD$*¶GˆD$+¶G ˆD$,HcW H‹wH{ èiÅè¶L$,‹=H‰ÚA¹@M‰ø¾‚ÇD$ HÇD$‰D$$HD$ƒÁ H‰$èíîÿÿÿȺt:H‹œ$¨H‹¬$°‰ÐL‹¤$¸L‹¬$ÀL‹´$ÈL‹¼$ÐHÄØÃH‹L$H…Ét¼¶D$`Hƒù—ÂM…öAˆ$•À!Шu AÇE1Ò딋T$IwL‰÷ÿÊA‰UHcÒèëáfffffffffHƒì@ˆ=1ÿèÿÈ”ÀHƒÄ¶ÀÿÈÃfffffffffffHƒì1ÿèHƒÄÃ/dev/imb../src/util/imbapi.cipmi_open_ia: SendTimedImbpRequest error. Ret = %d CC = 0x%02X %s ipmi_open_ia: open(%s) failedzRx 4!DLDdD|tAƒIМÅ_€ŽŒ†ƒ¼lD0Ô_D0ì¦N@ƒ†`D 4éBIŽE H(ŒD0A8ƒ†G 4TBIŽE H(ŒD0A8ƒ†G$ŒÄBA†ŒD D ƒ$´ BŒL†K ƒG $ÜÃBŒO†K D ƒ$ BŒL†K ƒG $,ÃBŒO†K D ƒ$TKeÀŽŒ†ƒ|=D $”SeàŽŒ†ƒ¼!DÔDGCC: (GNU) 3.3.3 (SuSE Linux).symtab.strtab.shstrtab.rela.text.data.bss.rodata.str1.1.rodata.str1.8.rela.eh_frame.note.GNU-stack.comment @и" &,12@20aT˜èO¸( ^€n€Ÿw˜°  H iñÿ  &àÅ6 >CH M@ Rcr!|’˜@¦P¯`t¸½0SÒÙáèòÿñ÷°l _0€¦W0`o醀¡Ķà Õð ÃñÀ ÐÃ, K@ð=S!`Àimbapi.cfdebugIpmiVersionhDevice1DeviceIoControlhDevice.LC0.LC3.LC1.LC2AsyncEventHandleGetIpmiVersionclose_imb_GLOBAL_OFFSET_TABLE_closeipmi_close_iatermIPMIopen_imbopenSendTimedImbpRequestprintfsprintfperrorNTstatusioctlSetShutDownCodeUnRegisterForImbAsyncMessageNotificationRegisterForImbAsyncMessageNotificationIsAsyncMessageAvailableGetAsyncImbpMessage_ExmemcpyGetAsyncImbpMessageSendAsyncImbpRequestSendTimedLanMessageResponse_ExSendTimedLanMessageResponseSendTimedEmpMessageResponse_ExSendTimedEmpMessageResponseSendTimedI2cRequestStartAsyncMesgPollipmi_open_iainitIPMI&üÿÿÿÿÿÿÿEüÿÿÿÿÿÿÿUüÿÿÿÿÿÿÿl…üÿÿÿÿÿÿÿ‘üÿÿÿÿÿÿÿ¡©üÿÿÿÿÿÿÿ.üÿÿÿÿÿÿÿ:üÿÿÿÿÿÿÿ@c‡’ÿÿÿÿÿÿÿÿ™«üÿÿÿÿÿÿÿ²üÿÿÿÿÿÿÿ¹üÿÿÿÿÿÿÿÃüÿÿÿÿÿÿÿËüÿÿÿÿÿÿÿüÿÿÿÿÿÿÿ)h üÿÿÿÿÿÿÿt!üÿÿÿÿÿÿÿ¸ ' üÿÿÿÿÿÿÿB ™ üÿÿÿÿÿÿÿ 7 üÿÿÿÿÿÿÿS K ½þ'üÿÿÿÿÿÿÿ:'üÿÿÿÿÿÿÿa üÿÿÿÿÿÿÿó `¡'üÿÿÿÿÿÿÿÐ'üÿÿÿÿÿÿÿõ üÿÿÿÿÿÿÿb'üÿÿÿÿÿÿÿh  C   6  â # ò ('üÿÿÿÿÿÿÿ4 ã'üÿÿÿÿÿÿÿö §'üÿÿÿÿÿÿÿ¸ }'üÿÿÿÿÿÿÿ—žüÿÿÿÿÿÿÿÇüÿÿÿÿÿÿÿ 8P@hP€` àÀ°Ø ð€0 X€¸ààð À 0ÐX €ð˜0ÀØÀipmiutil-3.0.7/lib/libipmiutil.pc0000644000000000000000000000043013160502163015462 0ustar rootrootprefix=/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include sysconfdir=@CONFPATH@ statepath=@STATEPATH@ nutuser=@RUN_AS_USER@ Name: libipmiutil Description: Library for ipmiutil Version: 3.0.7 Libs: -L${libdir} -lipmi_lanplus Cflags: -I${includedir} ipmiutil-3.0.7/lib/Makefile0000644000000000000000000003053313160502163014262 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # lib/Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. pkgdatadir = $(datadir)/ipmiutil pkgincludedir = $(includedir)/ipmiutil pkglibdir = $(libdir)/ipmiutil pkglibexecdir = $(libexecdir)/ipmiutil am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = x86_64-redhat-linux-gnu host_triplet = x86_64-redhat-linux-gnu subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/libipmiutil.pc.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = libipmiutil.pc CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run aclocal-1.11 AMTAR = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run tar AR = ar AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run autoconf AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run autoheader AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run automake-1.11 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = gcc -E CPPFLAGS = CROSS_CFLAGS = CROSS_LFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps DSYMUTIL = DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E EXEEXT = FGREP = /bin/grep -F GPL_CFLAGS = GREP = /bin/grep IA64_CFLAGS = INIT_DIR = /etc//rc.d/init.d INSTALL = sh ../install-sh -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} # INSTALL_DATA = $(INSTALL) -m 644 INSTALL_SCRIPT = $(INSTALL) -m 755 INSTALL_STRIP_PROGRAM = $(install_sh) -c -s INS_LIB = LANDESK_CFLAGS = LANDESK_LDADD = LANPLUS_CFLAGS = -DHAVE_LANPLUS LANPLUS_CRYPTO = -lcrypto LANPLUS_LDADD = -L../lib -lipmi_lanplus -L/usr/local/lib -lcrypto LANPLUS_LIB = ../lib/libipmi_lanplus.a LANPLUS_SAM = yes LD = /usr/bin/ld -m elf_x86_64 LDFLAGS = LD_SAMX = ../lib/libipmi_lanplus.a -lcrypto LIBOBJS = LIBS = LIBSENSORS = LIBTOOL = $(SHELL) $(top_builddir)/libtool LIB_DIR = /usr/lib64 LIPO = LN_S = ln -s LTLIBOBJS = MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.0.7/missing --run makeinfo MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = OBJDUMP = objdump OBJEXT = o OS_CFLAGS = -DLINUX -fPIC -Wno-pointer-sign -Wno-sign-conversion -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 OS_DRIVERS = imbapi.c ipmimv.c ipmild.c ipmidir.c OS_LFLAGS = OTOOL = OTOOL64 = PACKAGE = ipmiutil PACKAGE_BUGREPORT = PACKAGE_NAME = ipmiutil PACKAGE_STRING = ipmiutil 3.0.7 PACKAGE_TARNAME = ipmiutil PACKAGE_VERSION = 3.0.7 PATH_SEPARATOR = : PKG_DIR = /root/rpmbuild RANLIB = ranlib SAM2OBJ = isensor2.o ievents2.o SED = sed SET_MAKE = SHELL = /bin/sh SHR_LINK = libipmiutil.so.1 STRIP = strip SUBDIR_S = doc scripts lib util SYSTEMD_DIR = /usr/share/ipmiutil VERSION = 3.0.7 abs_builddir = /usr/dev/ipmiutil-3.0.7/lib abs_srcdir = /usr/dev/ipmiutil-3.0.7/lib abs_top_builddir = /usr/dev/ipmiutil-3.0.7 abs_top_srcdir = /usr/dev/ipmiutil-3.0.7 ac_ct_CC = gcc ac_ct_DUMPBIN = am__include = include am__leading_dot = . am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin build = x86_64-redhat-linux-gnu build_alias = build_cpu = x86_64 build_os = linux-gnu build_vendor = redhat builddir = . datadir = $(iprefix)/share datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} host = x86_64-redhat-linux-gnu host_alias = host_cpu = x86_64 host_os = linux-gnu host_vendor = redhat htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /usr/dev/ipmiutil-3.0.7/install-sh libdir = $(iprefix)/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var lt_ECHO = echo mandir = $(iprefix)/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} pkgconfigdir = ${libdir}/pkgconfig prefix = /usr program_transform_name = s,x,x, psdir = ${docdir} sbindir = $(iexec_prefix)/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = top_build_prefix = ../ top_builddir = .. top_srcdir = .. #!/bin/sh # Makefile.am to build/install ipmiutil lib files # # If --enable-lanplus (-DHAVE_LANPLUS), then this script # does a make from lib/lanplus/ for the lanplus library. # If --enable-landesk (-DLINK_LANDESK), then this script # assumes that these files are copied into this lib/ directory: # libipmiapi32.a libipmiapi64.a.suse libipmiapi64.a.redhat # MKDIR = sh ../mkinstalldirs INSTALL_BIN = /usr/bin/install -c iprefix = /usr iexec_prefix = ${prefix} PLUSFLAGS = -DHAVE_LANPLUS datato = ${DESTDIR}${datadir}/ipmiutil lib32 = ${DESTDIR}$(iprefix)/lib lib64 = ${DESTDIR}$(iprefix)/lib64 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): libipmiutil.pc: $(top_builddir)/config.status $(srcdir)/libipmiutil.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am all: if [ -f libipmiapi32.a ]; then \ rm -f libipmiapi.a; \ if [ "`uname -m`" = "x86_64" ]; then \ if [ -f /etc/SuSE-release ]; then \ cp -f libipmiapi64.a.suse libipmiapi.a; \ else cp -f libipmiapi64.a.redhat libipmiapi.a; fi \ else cp -f libipmiapi32.a libipmiapi.a; fi \ fi if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \ cd lanplus; make clean; make ; \ pwd; cp -f libipmi_lanplus.a .. ; \ fi clean: rm -f libipmiapi.a lib*_lanplus.a lib*_lanplus.so cd lanplus; make clean clobber: rm -f libipmiapi.a lib*_lanplus.a lib*_lanplus.so cd lanplus; make clean distclean: rm -f libipmiapi.a lib*.a lib*_lanplus.so cd lanplus; make distclean install: if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \ $(MKDIR) ${datato} ; \ cd lanplus; make install ; \ fi check: installso: @if [ -d /usr/lib64 ]; then \ $(MKDIR) ${lib64} ; \ echo "installing libipmi_lanplus into ${lib64}"; \ cd lanplus; /bin/sh ../../libtool --mode=install $(INSTALL_BIN) 'libipmi_lanplus.la' '${lib64}/libipmi_lanplus.la' ; \ $(INSTALL_BIN) .libs/libipmi_lanplus.so.0.0.0 ${lib64}/libipmi_lanplus.so.0.0.0 ; \ (cd ${lib64} && rm -f libipmi_lanplus.so.0 && ln -s libipmi_lanplus.so.0.0.0 libipmi_lanplus.so.0) ; \ (cd ${lib64} && rm -f libipmi_lanplus.so && ln -s libipmi_lanplus.so.0.0.0 libipmi_lanplus.so) ; \ $(INSTALL_BIN) .libs/libipmi_lanplus.lai ${lib64}/libipmi_lanplus.la ; \ $(INSTALL_BIN) .libs/libipmi_lanplus.a ${lib64}/libipmi_lanplus.a; \ ranlib ${lib64}/libipmi_lanplus.a ; \ chmod 644 ${lib64}/libipmi_lanplus.a ; \ (cd ${lib32} && rm -f libipmi_lanplus.* ); \ ../../libtool --finish ${lib64} \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ipmiutil-3.0.7/lib/lanplus/0000755000076400007640000000000013160502164015313 5ustar acressloggersipmiutil-3.0.7/lib/lanplus/lanplus_dump.h0000644000076400007640000000375013160502144020172 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_LANPLUS_DUMP_H #define IPMI_LANPLUS_DUMP_H #include /* See the implementation file for documentation */ void lanplus_dump_open_session_response(const struct ipmi_rs * rsp); void lanplus_dump_rakp2_message(const struct ipmi_rs * rsp, uint8_t auth_alg); void lanplus_dump_rakp4_message(const struct ipmi_rs * rsp, uint8_t auth_alg); #endif /* IPMI_LANPLUS_DUMP_H */ ipmiutil-3.0.7/lib/lanplus/lanplus.h0000644000076400007640000001265313160502144017147 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_LANPLUS_H #define IPMI_LANPLUS_H #include #include #define IPMI_LANPLUS_PORT 0x26f /* * RAKP return codes. These values come from table 13-15 of the IPMI v2 * specification. */ #define IPMI_RAKP_STATUS_NO_ERRORS 0x00 #define IPMI_RAKP_STATUS_INSUFFICIENT_RESOURCES_FOR_SESSION 0x01 #define IPMI_RAKP_STATUS_INVALID_SESSION_ID 0x02 #define IPMI_RAKP_STATUS_INVALID_PAYLOAD_TYPE 0x03 #define IPMI_RAKP_STATUS_INVALID_AUTHENTICATION_ALGORITHM 0x04 #define IPMI_RAKP_STATUS_INVALID_INTEGRITTY_ALGORITHM 0x05 #define IPMI_RAKP_STATUS_NO_MATCHING_AUTHENTICATION_PAYLOAD 0x06 #define IPMI_RAKP_STATUS_NO_MATCHING_INTEGRITY_PAYLOAD 0x07 #define IPMI_RAKP_STATUS_INACTIVE_SESSION_ID 0x08 #define IPMI_RAKP_STATUS_INVALID_ROLE 0x09 #define IPMI_RAKP_STATUS_UNAUTHORIZED_ROLE_REQUESTED 0x0A #define IPMI_RAKP_STATUS_INSUFFICIENT_RESOURCES_FOR_ROLE 0x0B #define IPMI_RAKP_STATUS_INVALID_NAME_LENGTH 0x0C #define IPMI_RAKP_STATUS_UNAUTHORIZED_NAME 0x0D #define IPMI_RAKP_STATUS_UNAUTHORIZED_GUID 0x0E #define IPMI_RAKP_STATUS_INVALID_INTEGRITY_CHECK_VALUE 0x0F #define IPMI_RAKP_STATUS_INVALID_CONFIDENTIALITY_ALGORITHM 0x10 #define IPMI_RAKP_STATUS_NO_CIPHER_SUITE_MATCH 0x11 #define IPMI_RAKP_STATUS_ILLEGAL_PARAMTER 0x12 #define IPMI_LAN_CHANNEL_1 0x07 #define IPMI_LAN_CHANNEL_2 0x06 #define IPMI_LAN_CHANNEL_E 0x0e #define IPMI_LAN_TIMEOUT 1 #define IPMI_LAN_RETRY 4 #define IPMI_PRIV_CALLBACK 1 #define IPMI_PRIV_USER 2 #define IPMI_PRIV_OPERATOR 3 #define IPMI_PRIV_ADMIN 4 #define IPMI_PRIV_OEM 5 #define IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE 0x10 /* Session message offsets, from table 13-8 of the v2 specification */ #define IPMI_LANPLUS_OFFSET_AUTHTYPE 0x04 #define IPMI_LANPLUS_OFFSET_PAYLOAD_TYPE 0x05 #define IPMI_LANPLUS_OFFSET_SESSION_ID 0x06 #define IPMI_LANPLUS_OFFSET_SEQUENCE_NUM 0x0A #define IPMI_LANPLUS_OFFSET_PAYLOAD_SIZE 0x0E #define IPMI_LANPLUS_OFFSET_PAYLOAD 0x10 #define IPMI_GET_CHANNEL_AUTH_CAP 0x38 /* * Do not change these unless you understand how they interact. * Note: * OpenSSL 0.9.7: #define EVP_MAX_MD_SIZE (16+20) // The SSLv3 md5+sha1 type * OpenSSL 0.9.8: #define EVP_MAX_MD_SIZE 64 // longest known is SHA512 */ #define IPMI_MAX_INTEGRITY_PAD_SIZE EVP_MAX_MD_SIZE // HMAC_SHA256_128: 16 HMAC_SHA1_96: 12 HMAC_MD5: 16 MD5: 16 #define IPMI_MAX_AUTH_CODE_SIZE EVP_MAX_MD_SIZE // must be at least 32. #define IPMI_MAX_MAC_SIZE EVP_MAX_MD_SIZE /* The largest mac we ever expect to generate */ #define IPMI_MAX_CONF_HEADER_SIZE 0x20 #define IPMI_MAX_PAYLOAD_SIZE 0xFFFF /* Includes confidentiality header/trailer */ #define IPMI_MAX_CONF_TRAILER_SIZE 0x20 #define IPMI_REQUEST_MESSAGE_SIZE 0x07 #define IPMI_SHA1_AUTHCODE_SIZE 12 #define IPMI_HMAC_MD5_AUTHCODE_SIZE 16 #define IPMI_MD5_AUTHCODE_SIZE 16 #define IPMI_HMAC_SHA256_AUTHCODE_SIZE 16 #define SHA256_DIGEST_LENGTH 32 /*may appear in openssl/sha.h later*/ /* *This is accurate, as long as we're only passing 1 auth algorithm, * one integrity algorithm, and 1 encyrption alogrithm */ #define IPMI_OPEN_SESSION_REQUEST_SIZE 32 #define IPMI_RAKP1_MESSAGE_SIZE 44 #define IPMI_RAKP3_MESSAGE_MAX_SIZE (8+EVP_MAX_MD_SIZE) #define IPMI_MAX_USER_NAME_LENGTH 16 extern const struct valstr ipmi_privlvl_vals[]; extern const struct valstr ipmi_authtype_vals[]; extern struct ipmi_intf ipmi_lanplus_intf; struct ipmi_rs * ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req); int ipmi_lanplus_open(struct ipmi_intf * intf); void ipmi_lanplus_close(struct ipmi_intf * intf); int ipmiv2_lan_ping(struct ipmi_intf * intf); #endif /*IPMI_LAN_H*/ ipmiutil-3.0.7/lib/lanplus/lanplus_crypt.h0000644000076400007640000000622413160502144020365 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_LANPLUS_CRYPT_H #define IPMI_LANPLUS_CRYPT_H #include #include #include #include /* * See the implementation file for documentation * ipmi_intf can be used for oem specific implementations * e.g. if (ipmi_oem_active(intf, "OEM_XYZ")) */ int lanplus_rakp2_hmac_matches(const struct ipmi_session * session, const uint8_t * hmac, struct ipmi_intf * intf); int lanplus_rakp4_hmac_matches(const struct ipmi_session * session, const uint8_t * hmac, struct ipmi_intf * intf); int lanplus_generate_rakp3_authcode(uint8_t * buffer, const struct ipmi_session * session, uint32_t * auth_length, struct ipmi_intf * intf); int lanplus_generate_sik(struct ipmi_session * session); int lanplus_generate_k1(struct ipmi_session * session); int lanplus_generate_k2(struct ipmi_session * session); int lanplus_encrypt_payload(uint8_t crypt_alg, const uint8_t * key, const uint8_t * input, uint32_t input_length, uint8_t * output, uint16_t * bytesWritten); int lanplus_decrypt_payload(uint8_t crypt_alg, const uint8_t * key, const uint8_t * input, uint32_t input_length, uint8_t * output, uint16_t * payload_size); int lanplus_has_valid_auth_code(struct ipmi_rs * rs, struct ipmi_session * session); #endif /* IPMI_LANPLUS_CRYPT_H */ ipmiutil-3.0.7/lib/lanplus/Makefile.am0000644000076400007640000000335213160502144017350 0ustar acressloggers# Makefile.am for libipmi_lanplus.so and libipmi_lanplus.a ODIR = obj CFLAGS_STATIC = @OS_CFLAGS@ -DSTATIC -fno-strict-aliasing -fPIC $(CFLAGS) AM_CFLAGS = @OS_CFLAGS@ -fPIC @LANPLUS_CFLAGS@ MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I. -I./inc lanplus_liba = libipmi_lanplus.a noinst_LIBRARIES = $(lanplus_liba) libipmi_lanplus_a_SOURCES = lanplus.c lanplus.h rmcp.h asf.h \ lanplus_dump.c lanplus_dump.h \ lanplus_crypt.c lanplus_crypt.h \ lanplus_crypt_impl.c lanplus_crypt_impl.h \ lanplus_strings.c \ helper.c ipmi_strings.c lib_LTLIBRARIES = # lib_LTLIBRARIES = libipmi_lanplus.la # libipmi_lanplus_la_LIBADD = -lcrypto # libipmi_lanplus_la_SOURCES = lanplus.c lanplus.h rmcp.h asf.h \ # lanplus_dump.c lanplus_dump.h \ # lanplus_crypt.c lanplus_crypt.h \ # lanplus_crypt_impl.c lanplus_crypt_impl.h \ # lanplus_strings.c \ # helper.c ipmi_strings.c #am_libipmi_lanplus_a_OBJECTS = $(ODIR)/lanplus.o $(ODIR)/lanplus_strings.o \ # $(ODIR)/lanplus_crypt.o $(ODIR)/lanplus_crypt_impl.o \ # $(ODIR)/lanplus_dump.o \ # $(ODIR)/helper.o $(ODIR)/ipmi_strings.o clean-generic: rm -rf $(ODIR) rm -f $(lanplus_liba) $(lib_LTLIBRARIES) *.o *.so clean: clean-generic #$(lanplus_liba): $(am_libipmi_lanplus_a_OBJECTS) # $(AR) cru $(lanplus_liba) $(am_libipmi_lanplus_a_OBJECTS) # $(RANLIB) $(lanplus_liba) #$(ODIR): # mkdir -p $(ODIR) #$(ODIR)/%.o: %.c $(ODIR) # $(CC) -c $(CFLAGS_STATIC) $(INCLUDES) -o $@ $< ipmiutil-3.0.7/lib/lanplus/inc/0000755000076400007640000000000013160502163016063 5ustar acressloggersipmiutil-3.0.7/lib/lanplus/inc/config.h0000644000076400007640000001271013160502144017501 0ustar acressloggers/* config.h. Generated by configure. */ /* config.h.in. Generated from configure.in by autoheader. */ /* Define to 1 to enable all command line options. */ #define ENABLE_ALL_OPTIONS 1 /* Define to 1 for extra file security. */ /* #undef ENABLE_FILE_SECURITY */ /* Define to 1 if you have the `alarm' function. */ #define HAVE_ALARM 1 #ifdef WIN32 #undef HAVE_ARPA_INET_H #undef HAVE_BYTESWAP_H #else /* Define to 1 if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_BYTESWAP_H 1 #endif /* Define to 1 if libcrypto supports MD2. */ #define HAVE_CRYPTO_MD2 1 /* Define to 1 if libcrypto supports MD5. */ #define HAVE_CRYPTO_MD5 1 #ifdef WIN32 #undef HAVE_DLFCN_H #undef HAVE_FCNTL_H #undef HAVE_INTTYPES_H #undef HAVE_NETDB_H #undef HAVE_NETINET_IN_H #undef HAVE_SYS_IOCTL_H #undef HAVE_OPENIPMI_H #else /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_FREEBSD_IPMI_H */ /* Define to 1 if you have the header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_OPENIPMI_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 #endif /* Define to 1 if you have the `gethostbyname' function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the `getpassphrase' function. */ /* #undef HAVE_GETPASSPHRASE */ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #define HAVE_MALLOC 1 /* Define to 1 if you have the `memmove' function. */ #define HAVE_MEMMOVE 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 /* Define to 1 if you have the header file. */ #define HAVE_PATHS_H 1 /* Define to 1 if readline present. */ #define HAVE_READLINE 1 /* Define to 1 if you have the `select' function. */ #define HAVE_SELECT 1 /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1 /* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the `strerror' function. */ #define HAVE_STRERROR 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_BYTEORDER_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have . */ /* #undef HAVE_SYS_TERMIOS_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have . */ #define HAVE_TERMIOS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 to enable Solaris 10 BMC interface. */ /* #undef IPMI_INTF_BMC */ /* Define to 1 to enable Intel IMB interface. */ /* #undef IPMI_INTF_IMB, or #define IPMI_INTF_IMB 1 */ /* Define to 1 to enable LAN IPMIv1.5 interface. */ // #define IPMI_INTF_LAN 1 /* Define to 1 to enable LAN+ IPMIv2 interface. */ #define IPMI_INTF_LANPLUS 1 /* Define to 1 to enable Solaris 9 LIPMI interface. */ /* #undef IPMI_INTF_LIPMI */ /* Define to 1 to enable Linux OpenIPMI interface. */ // #define IPMI_INTF_OPEN 1 /* Name of package */ #define PACKAGE "ipmitool" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" /* Define to the version of this package. */ #define PACKAGE_VERSION "" /* Define to the type of arg 1 for `select'. */ #define SELECT_TYPE_ARG1 int /* Define to the type of args 2, 3 and 4 for `select'. */ #define SELECT_TYPE_ARG234 (fd_set *) /* Define to the type of arg 5 for `select'. */ #define SELECT_TYPE_ARG5 (struct timeval *) /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ #define VERSION "1.8.7" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to rpl_malloc if the replacement function should be used. */ /* #undef malloc */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/0000755000076400007640000000000013160502163017717 5ustar acressloggersipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_oem.h0000644000076400007640000000362413160502144021672 0ustar acressloggers/* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_OEM_H #define IPMI_OEM_H #include /* oem handler, see lib/ipmi_oem.c */ struct ipmi_oem_handle { const char * name; const char * desc; int (*setup)(struct ipmi_intf * intf); }; void ipmi_oem_print(void); int ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype); int ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype); #endif /*IPMI_OEM_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_lanp.h0000644000076400007640000001161313160502144022041 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_LANP_H #define IPMI_LANP_H #include #define IPMI_LAN_SET_CONFIG 0x01 #define IPMI_LAN_GET_CONFIG 0x02 #define IPMI_LAN_SUSPEND_ARP 0x03 # define IPMI_LAN_SUSPEND_ARP_RESP (2) # define IPMI_LAN_SUSPEND_ARP_GRAT (1) #define IPMI_LAN_GET_STAT 0x04 #define IPMI_CHANNEL_NUMBER_MAX 0xe #define IPMI_LANP_TIMEOUT 3 #define IPMI_LANP_RETRIES 10 #define IPMI_LANP_WRITE_UNLOCK 0 #define IPMI_LANP_WRITE_LOCK 1 #define IPMI_LANP_WRITE_COMMIT 2 enum { IPMI_LANP_SET_IN_PROGRESS, IPMI_LANP_AUTH_TYPE, IPMI_LANP_AUTH_TYPE_ENABLE, IPMI_LANP_IP_ADDR, IPMI_LANP_IP_ADDR_SRC, IPMI_LANP_MAC_ADDR, /* 5 */ IPMI_LANP_SUBNET_MASK, IPMI_LANP_IP_HEADER, IPMI_LANP_PRI_RMCP_PORT, IPMI_LANP_SEC_RMCP_PORT, IPMI_LANP_BMC_ARP, /* 10 */ IPMI_LANP_GRAT_ARP, IPMI_LANP_DEF_GATEWAY_IP, IPMI_LANP_DEF_GATEWAY_MAC, IPMI_LANP_BAK_GATEWAY_IP, IPMI_LANP_BAK_GATEWAY_MAC, /* 15 */ IPMI_LANP_SNMP_STRING, IPMI_LANP_NUM_DEST, IPMI_LANP_DEST_TYPE, IPMI_LANP_DEST_ADDR, IPMI_LANP_VLAN_ID, /* 20 */ IPMI_LANP_VLAN_PRIORITY, IPMI_LANP_RMCP_CIPHER_SUPPORT, IPMI_LANP_RMCP_CIPHERS, IPMI_LANP_RMCP_PRIV_LEVELS, IPMI_LANP_OEM_ALERT_STRING=96, IPMI_LANP_ALERT_RETRY=97, IPMI_LANP_UTC_OFFSET=98, IPMI_LANP_DHCP_SERVER_IP=192, IPMI_LANP_DHCP_SERVER_MAC=193, IPMI_LANP_DHCP_ENABLE=194, IPMI_LANP_CHAN_ACCESS_MODE=201, }; static struct lan_param { int cmd; int size; char desc[24]; uint8_t * data; int data_len; } ipmi_lan_params[] __attribute__((unused)) = { { IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress" }, { IPMI_LANP_AUTH_TYPE, 1, "Auth Type Support" }, { IPMI_LANP_AUTH_TYPE_ENABLE, 5, "Auth Type Enable" }, { IPMI_LANP_IP_ADDR, 4, "IP Address" }, { IPMI_LANP_IP_ADDR_SRC, 1, "IP Address Source" }, { IPMI_LANP_MAC_ADDR, 6, "MAC Address" }, /* 5 */ { IPMI_LANP_SUBNET_MASK, 4, "Subnet Mask" }, { IPMI_LANP_IP_HEADER, 3, "IP Header" }, { IPMI_LANP_PRI_RMCP_PORT, 2, "Primary RMCP Port" }, { IPMI_LANP_SEC_RMCP_PORT, 2, "Secondary RMCP Port" }, { IPMI_LANP_BMC_ARP, 1, "BMC ARP Control" }, /* 10 */ { IPMI_LANP_GRAT_ARP, 1, "Gratituous ARP Intrvl" }, { IPMI_LANP_DEF_GATEWAY_IP, 4, "Default Gateway IP" }, { IPMI_LANP_DEF_GATEWAY_MAC, 6, "Default Gateway MAC" }, { IPMI_LANP_BAK_GATEWAY_IP, 4, "Backup Gateway IP" }, { IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC" }, /* 15 */ { IPMI_LANP_SNMP_STRING, 18, "SNMP Community String" }, { IPMI_LANP_NUM_DEST, 1, "Number of Destinations"}, { IPMI_LANP_DEST_TYPE, 4, "Destination Type" }, { IPMI_LANP_DEST_ADDR, 13, "Destination Addresses" }, { IPMI_LANP_VLAN_ID, 2, "802.1q VLAN ID" }, /* 20 */ { IPMI_LANP_VLAN_PRIORITY, 1, "802.1q VLAN Priority" }, { IPMI_LANP_RMCP_CIPHER_SUPPORT,1, "RMCP+ Cipher Suite Count" }, { IPMI_LANP_RMCP_CIPHERS, 16, "RMCP+ Cipher Suites" }, { IPMI_LANP_RMCP_PRIV_LEVELS, 9, "Cipher Suite Priv Max" }, { IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String" }, /* 25 */ { IPMI_LANP_ALERT_RETRY, 1, "Alert Retry Algorithm" }, { IPMI_LANP_UTC_OFFSET, 3, "UTC Offset" }, { IPMI_LANP_DHCP_SERVER_IP, 4, "DHCP Server IP" }, { IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC" }, { IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable" }, /* 30 */ { IPMI_LANP_CHAN_ACCESS_MODE, 2, "Channel Access Mode" }, { -1 } }; int ipmi_lanp_main(struct ipmi_intf *, int, char **); #endif /*IPMI_LANP_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_mc.h0000644000076400007640000000737113160502144021514 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_MC_H #define IPMI_MC_H #include #define BMC_GET_DEVICE_ID 0x01 #define BMC_COLD_RESET 0x02 #define BMC_WARM_RESET 0x03 #define BMC_GET_SELF_TEST 0x04 #define BMC_SET_GLOBAL_ENABLES 0x2e #define BMC_GET_GLOBAL_ENABLES 0x2f #define BMC_GET_GUID 0x37 int ipmi_mc_main(struct ipmi_intf *, int, char **); /* * Response data from IPM Get Device ID Command (IPMI rev 1.5, section 17.1) * The following really apply to any IPM device, not just BMCs... */ struct ipm_devid_rsp { uint8_t device_id; uint8_t device_revision; uint8_t fw_rev1; uint8_t fw_rev2; uint8_t ipmi_version; uint8_t adtl_device_support; uint8_t manufacturer_id[3]; uint8_t product_id[2]; uint8_t aux_fw_rev[4]; } __attribute__ ((packed)); #define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */ #define IPM_DEV_DEVICE_ID_REV_MASK (0x07) /* BCD-enoded */ #define IPM_DEV_FWREV1_AVAIL_MASK (0x80) /* 0 = normal operation */ #define IPM_DEV_FWREV1_MAJOR_MASK (0x3f) /* Major rev, BCD-encoded */ #define IPM_DEV_IPMI_VER_MAJOR_MASK (0x0F) /* Major rev, BCD-encoded */ #define IPM_DEV_IPMI_VER_MINOR_MASK (0xF0) /* Minor rev, BCD-encoded */ #define IPM_DEV_IPMI_VER_MINOR_SHIFT (4) /* Minor rev shift */ #define IPM_DEV_IPMI_VERSION_MAJOR(x) \ (x & IPM_DEV_IPMI_VER_MAJOR_MASK) #define IPM_DEV_IPMI_VERSION_MINOR(x) \ ((x & IPM_DEV_IPMI_VER_MINOR_MASK) >> IPM_DEV_IPMI_VER_MINOR_SHIFT) #define IPM_DEV_MANUFACTURER_ID(x) \ ((uint32_t) ((x[2] & 0x0F) << 16 | x[1] << 8 | x[0])) #define IPM_DEV_ADTL_SUPPORT_BITS (8) struct ipm_selftest_rsp { unsigned char code; unsigned char test; } __attribute__ ((packed)); #define IPM_SFT_CODE_OK 0x55 #define IPM_SFT_CODE_NOT_IMPLEMENTED 0x56 #define IPM_SFT_CODE_DEV_CORRUPTED 0x57 #define IPM_SFT_CODE_FATAL_ERROR 0x58 #define IPM_SFT_CODE_RESERVED 0xff #define IPM_SELFTEST_SEL_ERROR 0x80 #define IPM_SELFTEST_SDR_ERROR 0x40 #define IPM_SELFTEST_FRU_ERROR 0x20 #define IPM_SELFTEST_IPMB_ERROR 0x10 #define IPM_SELFTEST_SDRR_EMPTY 0x08 #define IPM_SELFTEST_INTERNAL_USE 0x04 #define IPM_SELFTEST_FW_BOOTBLOCK 0x02 #define IPM_SELFTEST_FW_CORRUPTED 0x01 #endif /*IPMI_MC_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_user.h0000644000076400007640000000540713160502144022071 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_USER_H #define IPMI_USER_H #if HAVE_CONFIG_H # include #endif #include /* * The GET USER ACCESS response from table 22-32 of the IMPI v2.0 spec */ struct user_access_rsp { #if WORDS_BIGENDIAN uint8_t __reserved1 : 2; uint8_t maximum_ids : 6; #else uint8_t maximum_ids : 6; uint8_t __reserved1 : 2; #endif #if WORDS_BIGENDIAN uint8_t __reserved2 : 2; uint8_t enabled_user_count : 6; #else uint8_t enabled_user_count : 6; uint8_t __reserved2 : 2; #endif #if WORDS_BIGENDIAN uint8_t __reserved3 : 2; uint8_t fixed_name_count : 6; #else uint8_t fixed_name_count : 6; uint8_t __reserved3 : 2; #endif #if WORDS_BIGENDIAN uint8_t __reserved4 : 1; uint8_t no_callin_access : 1; uint8_t link_auth_access : 1; uint8_t ipmi_messaging_access : 1; uint8_t channel_privilege_limit : 4; #else uint8_t channel_privilege_limit : 4; uint8_t ipmi_messaging_access : 1; uint8_t link_auth_access : 1; uint8_t no_callin_access : 1; uint8_t __reserved4 : 1; #endif } __attribute__ ((packed)); int ipmi_user_main(struct ipmi_intf *, int, char **); #endif /* IPMI_USER_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/log.h0000644000076400007640000000524613160502144020657 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMITOOL_LOG_H #define IPMITOOL_LOG_H #ifdef WIN32 #define LOG_EMERG 0 #define LOG_ALERT 1 #define LOG_CRIT 2 #define LOG_ERR 3 #define LOG_WARNING 4 #define LOG_NOTICE 5 #define LOG_INFO 6 #define LOG_DEBUG 7 #else #include /* sys/syslog.h: * LOG_EMERG 0 system is unusable * LOG_ALERT 1 action must be taken immediately * LOG_CRIT 2 critical conditions * LOG_ERR 3 error conditions * LOG_WARNING 4 warning conditions * LOG_NOTICE 5 normal but significant condition * LOG_INFO 6 informational * LOG_DEBUG 7 debug-level messages */ #endif #define LOG_ERROR LOG_ERR #define LOG_WARN LOG_WARNING #define LOG_NAME_DEFAULT "ipmitool" #define LOG_MSG_LENGTH 1024 void log_init(const char * name, int isdaemon, int verbose); void log_halt(void); void log_level_set(int level); int log_level_get(void); void lprintf(int level, const char * format, ...); void lperror(int level, const char * format, ...); #endif /*IPMITOOL_LOG_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_sol.h0000644000076400007640000000577113160502144021714 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_SOL_H #define IPMI_SOL_H #include #define SOL_ESCAPE_CHARACTER_DEFAULT '~' #define SOL_KEEPALIVE_TIMEOUT 30 #define IPMI_SOL_SERIAL_ALERT_MASK_SUCCEED 0x08 #define IPMI_SOL_SERIAL_ALERT_MASK_DEFERRED 0x04 #define IPMI_SOL_SERIAL_ALERT_MASK_FAIL 0x00 #define IPMI_SOL_BMC_ASSERTS_CTS_MASK_TRUE 0x00 #define IPMI_SOL_BMC_ASSERTS_CTS_MASK_FALSE 0x02 struct sol_config_parameters { uint8_t set_in_progress; uint8_t enabled; uint8_t force_encryption; uint8_t force_authentication; uint8_t privilege_level; uint8_t character_accumulate_level; uint8_t character_send_threshold; uint8_t retry_count; uint8_t retry_interval; uint8_t non_volatile_bit_rate; uint8_t volatile_bit_rate; uint8_t payload_channel; uint16_t payload_port; }; /* * The ACTIVATE PAYLOAD command reponse structure * From table 24-2 of the IPMI v2.0 spec */ struct activate_payload_rsp { uint8_t auxiliary_data[4]; uint8_t inbound_payload_size[2]; /* LS byte first */ uint8_t outbound_payload_size[2]; /* LS byte first */ uint8_t payload_udp_port[2]; /* LS byte first */ uint8_t payload_vlan_number[2]; /* LS byte first */ } __attribute__ ((packed)); int ipmi_sol_main(struct ipmi_intf *, int, char **); int ipmi_get_sol_info(struct ipmi_intf * intf, uint8_t channel, struct sol_config_parameters * params); #endif /* IPMI_SOL_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_channel.h0000644000076400007640000002004713160502144022520 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_CHANNEL_H #define IPMI_CHANNEL_H #if HAVE_CONFIG_H # include #endif #include #define IPMI_GET_CHANNEL_AUTH_CAP 0x38 #define IPMI_GET_CHANNEL_ACCESS 0x41 #define IPMI_GET_CHANNEL_INFO 0x42 #define IPMI_SET_USER_ACCESS 0x43 #define IPMI_GET_USER_ACCESS 0x44 #define IPMI_SET_USER_NAME 0x45 #define IPMI_GET_USER_NAME 0x46 #define IPMI_SET_USER_PASSWORD 0x47 #define IPMI_GET_CHANNEL_CIPHER_SUITES 0x54 /* * The Get Authentication Capabilities response structure * From table 22-15 of the IPMI v2.0 spec */ struct get_channel_auth_cap_rsp { uint8_t channel_number; #if WORDS_BIGENDIAN uint8_t v20_data_available : 1; /* IPMI v2.0 data is available */ uint8_t __reserved1 : 1; uint8_t enabled_auth_types : 6; /* IPMI v1.5 enabled auth types */ #else uint8_t enabled_auth_types : 6; /* IPMI v1.5 enabled auth types */ uint8_t __reserved1 : 1; uint8_t v20_data_available : 1; /* IPMI v2.0 data is available */ #endif #if WORDS_BIGENDIAN uint8_t __reserved2 : 2; uint8_t kg_status : 1; /* two-key login status */ uint8_t per_message_auth : 1; /* per-message authentication status */ uint8_t user_level_auth : 1; /* user-level authentication status */ uint8_t non_null_usernames : 1; /* one or more non-null users exist */ uint8_t null_usernames : 1; /* one or more null usernames non-null pwds */ uint8_t anon_login_enabled : 1; /* a null-named, null-pwd user exists */ #else uint8_t anon_login_enabled : 1; /* a null-named, null-pwd user exists */ uint8_t null_usernames : 1; /* one or more null usernames non-null pwds */ uint8_t non_null_usernames : 1; /* one or more non-null users exist */ uint8_t user_level_auth : 1; /* user-level authentication status */ uint8_t per_message_auth : 1; /* per-message authentication status */ uint8_t kg_status : 1; /* two-key login status */ uint8_t __reserved2 : 2; #endif #if WORDS_BIGENDIAN uint8_t __reserved3 : 6; uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */ uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */ #else uint8_t ipmiv20_support : 1; /* channel supports IPMI v2.0 connections */ uint8_t ipmiv15_support : 1; /* channel supports IPMI v1.5 connections */ uint8_t __reserved3 : 6; #endif uint8_t oem_id[3]; /* IANA enterprise number for auth type */ uint8_t oem_aux_data; /* Additional OEM specific data for oem auths */ } __attribute__ ((packed)); /* * The Get Channel Info response structure * From table 22-29 of the IPMI v2.0 spec */ struct get_channel_info_rsp { #if WORDS_BIGENDIAN uint8_t __reserved1 : 4; uint8_t channel_number : 4; /* channel number */ #else uint8_t channel_number : 4; /* channel number */ uint8_t __reserved1 : 4; #endif #if WORDS_BIGENDIAN uint8_t __reserved2 : 1; uint8_t channel_medium : 7; /* Channel medium type per table 6-3 */ #else uint8_t channel_medium : 7; /* Channel medium type per table 6-3 */ uint8_t __reserved2 : 1; #endif #if WORDS_BIGENDIAN uint8_t __reserved3 : 3; uint8_t channel_protocol : 5; /* Channel protocol per table 6-2 */ #else uint8_t channel_protocol : 5; /* Channel protocol per table 6-2 */ uint8_t __reserved3 : 3; #endif #if WORDS_BIGENDIAN uint8_t session_support : 2; /* Description of session support */ uint8_t active_sessions : 6; /* Count of active sessions */ #else uint8_t active_sessions : 6; /* Count of active sessions */ uint8_t session_support : 2; /* Description of session support */ #endif uint8_t vendor_id[3]; /* For OEM that specified the protocol */ uint8_t aux_info[2]; /* Not used*/ } __attribute__ ((packed)); /* * The Get Channel Access response structure * From table 22-28 of the IPMI v2.0 spec */ struct get_channel_access_rsp { #if WORDS_BIGENDIAN uint8_t __reserved1 : 2; uint8_t alerting : 1; uint8_t per_message_auth : 1; uint8_t user_level_auth : 1; uint8_t access_mode : 3; #else uint8_t access_mode : 3; uint8_t user_level_auth : 1; uint8_t per_message_auth : 1; uint8_t alerting : 1; uint8_t __reserved1 : 2; #endif #if WORDS_BIGENDIAN uint8_t __reserved2 : 4; uint8_t channel_priv_limit : 4; /* Channel privilege level limit */ #else uint8_t channel_priv_limit : 4; /* Channel privilege level limit */ uint8_t __reserved2 : 4; #endif } __attribute__ ((packed)); struct get_user_access_rsp { #if WORDS_BIGENDIAN uint8_t __reserved1 : 2; uint8_t max_user_ids : 6; uint8_t __reserved2 : 2; uint8_t enabled_user_ids : 6; uint8_t __reserved3 : 2; uint8_t fixed_user_ids : 6; uint8_t __reserved4 : 1; uint8_t callin_callback : 1; uint8_t link_auth : 1; uint8_t ipmi_messaging : 1; uint8_t privilege_limit : 4; #else uint8_t max_user_ids : 6; uint8_t __reserved1 : 2; uint8_t enabled_user_ids : 6; uint8_t __reserved2 : 2; uint8_t fixed_user_ids : 6; uint8_t __reserved3 : 2; uint8_t privilege_limit : 4; uint8_t ipmi_messaging : 1; uint8_t link_auth : 1; uint8_t callin_callback : 1; uint8_t __reserved4 : 1; #endif } __attribute__ ((packed)); struct set_user_access_data { #if WORDS_BIGENDIAN uint8_t change_bits : 1; uint8_t callin_callback : 1; uint8_t link_auth : 1; uint8_t ipmi_messaging : 1; uint8_t channel : 4; uint8_t __reserved1 : 2; uint8_t user_id : 6; uint8_t __reserved2 : 4; uint8_t privilege_limit : 4; uint8_t __reserved3 : 4; uint8_t session_limit : 4; #else uint8_t channel : 4; uint8_t ipmi_messaging : 1; uint8_t link_auth : 1; uint8_t callin_callback : 1; uint8_t change_bits : 1; uint8_t user_id : 6; uint8_t __reserved1 : 2; uint8_t privilege_limit : 4; uint8_t __reserved2 : 4; uint8_t session_limit : 4; uint8_t __reserved3 : 4; #endif } __attribute__ ((packed)); uint8_t ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel); uint8_t ipmi_current_channel_medium(struct ipmi_intf * intf); int ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv); int ipmi_get_channel_auth_cap(struct ipmi_intf * intf, uint8_t channel, uint8_t priv); int ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel); #endif /*IPMI_CHANNEL_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_sunoem.h0000644000076400007640000000445513160502144022423 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_SUNOEM_H #define IPMI_SUNOEM_H #if HAVE_CONFIG_H # include #endif #include #include #define IPMI_NETFN_SUNOEM 0x2e #define IPMI_SUNOEM_SET_SSH_KEY 0x01 #define IPMI_SUNOEM_DEL_SSH_KEY 0x02 #define IPMI_SUNOEM_GET_HEALTH_STATUS 0x10 #define IPMI_SUNOEM_SET_FAN_SPEED 0x20 #define IPMI_SUNOEM_LED_GET 0x21 #define IPMI_SUNOEM_LED_SET 0x22 int ipmi_sunoem_main(struct ipmi_intf *, int, char **); struct ipmi_rs * sunoem_led_get(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev, int ledtype); struct ipmi_rs * sunoem_led_set(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev, int ledtype, int ledmode); #endif /*IPMI_SUNOEM_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_hpmfwupg.h0000644000076400007640000000347613160502144022754 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_HPMFWUPG_H #define IPMI_HPMFWUPG_H #ifdef WIN32 #include #else #include #endif #include int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **); #endif /* IPMI_KFWUM_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_pef.h0000644000076400007640000005764513160502144021700 0ustar acressloggers/* * Copyright (c) 2004 Dell Computers. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Dell Computers, or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * DELL COMPUTERS ("DELL") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * DELL OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_PEF_H #define IPMI_PEF_H #include /* PEF */ struct pef_capabilities { /* "get pef capabilities" response */ uint8_t version; uint8_t actions; /* mapped by PEF_ACTION_xxx */ uint8_t tblsize; }; typedef enum { P_TRUE, P_SUPP, P_ACTV, P_ABLE, } flg_e; struct pef_table_entry { #define PEF_CONFIG_ENABLED 0x80 #define PEF_CONFIG_PRECONFIGURED 0x40 uint8_t config; #define PEF_ACTION_DIAGNOSTIC_INTERRUPT 0x20 #define PEF_ACTION_OEM 0x10 #define PEF_ACTION_POWER_CYCLE 0x08 #define PEF_ACTION_RESET 0x04 #define PEF_ACTION_POWER_DOWN 0x02 #define PEF_ACTION_ALERT 0x01 uint8_t action; #define PEF_POLICY_NUMBER_MASK 0x0f uint8_t policy_number; #define PEF_SEVERITY_NON_RECOVERABLE 0x20 #define PEF_SEVERITY_CRITICAL 0x10 #define PEF_SEVERITY_WARNING 0x08 #define PEF_SEVERITY_OK 0x04 #define PEF_SEVERITY_INFORMATION 0x02 #define PEF_SEVERITY_MONITOR 0x01 uint8_t severity; uint8_t generator_ID_addr; uint8_t generator_ID_lun; uint8_t sensor_type; #define PEF_SENSOR_NUMBER_MATCH_ANY 0xff uint8_t sensor_number; #define PEF_EVENT_TRIGGER_UNSPECIFIED 0x0 #define PEF_EVENT_TRIGGER_THRESHOLD 0x1 #define PEF_EVENT_TRIGGER_SENSOR_SPECIFIC 0x6f #define PEF_EVENT_TRIGGER_MATCH_ANY 0xff uint8_t event_trigger; uint8_t event_data_1_offset_mask[2]; uint8_t event_data_1_AND_mask; uint8_t event_data_1_compare_1; uint8_t event_data_1_compare_2; uint8_t event_data_2_AND_mask; uint8_t event_data_2_compare_1; uint8_t event_data_2_compare_2; uint8_t event_data_3_AND_mask; uint8_t event_data_3_compare_1; uint8_t event_data_3_compare_2; } __attribute__ ((packed)); struct desc_map { /* maps a description to a value/mask */ const char *desc; uint32_t mask; }; struct bit_desc_map { /* description text container */ #define BIT_DESC_MAP_LIST 0x1 /* index-based text array */ #define BIT_DESC_MAP_ANY 0x2 /* bitwise, but only print 1st one */ #define BIT_DESC_MAP_ALL 0x3 /* bitwise, print them all */ uint32_t desc_map_type; struct desc_map desc_maps[128]; }; static struct bit_desc_map pef_b2s_actions __attribute__((unused)) = { BIT_DESC_MAP_ALL, { {"Alert", PEF_ACTION_ALERT}, {"Power-off", PEF_ACTION_POWER_DOWN}, {"Reset", PEF_ACTION_RESET}, {"Power-cycle", PEF_ACTION_POWER_CYCLE}, {"OEM-defined", PEF_ACTION_OEM}, {"Diagnostic-interrupt", PEF_ACTION_DIAGNOSTIC_INTERRUPT}, {NULL} } }; static struct bit_desc_map pef_b2s_severities __attribute__((unused)) = { BIT_DESC_MAP_ANY, { {"Non-recoverable", PEF_SEVERITY_NON_RECOVERABLE}, {"Critical", PEF_SEVERITY_CRITICAL}, {"Warning", PEF_SEVERITY_WARNING}, {"OK", PEF_SEVERITY_OK}, {"Information", PEF_SEVERITY_INFORMATION}, {"Monitor", PEF_SEVERITY_MONITOR}, {NULL} } }; static struct bit_desc_map pef_b2s_sensortypes __attribute__((unused)) = { BIT_DESC_MAP_LIST, { {"Any", 255}, {"Temperature", 1}, {"Voltage", 2}, {"Current", 3}, {"Fan", 4}, {"Chassis Intrusion", 5}, {"Platform security breach", 6}, {"Processor", 7}, {"Power supply", 8}, {"Power Unit", 9}, {"Cooling device", 10}, {"Other (units-based)", 11}, {"Memory", 12}, {"Drive Slot", 13}, {"POST memory resize", 14}, {"POST error", 15}, {"Logging disabled", 16}, {"Watchdog 1", 17}, {"System event", 18}, {"Critical Interrupt", 19}, {"Button", 20}, {"Module/board", 21}, {"uController/coprocessor", 22}, {"Add-in card", 23}, {"Chassis", 24}, {"Chipset", 25}, {"Other (FRU)", 26}, {"Cable/interconnect", 27}, {"Terminator", 28}, {"System boot", 29}, {"Boot error", 30}, {"OS boot", 31}, {"OS critical stop", 32}, {"Slot/connector", 33}, {"ACPI power state", 34}, {"Watchdog 2", 35}, {"Platform alert", 36}, {"Entity presence", 37}, {"Monitor ASIC/IC", 38}, {"LAN", 39}, {"Management subsytem health",40}, {"Battery", 41}, {NULL} } }; static struct bit_desc_map pef_b2s_gentype_1 = { BIT_DESC_MAP_LIST, { {"LNC", 1}, /* '>' : getting better */ {"LC", 3}, {"LNR", 5}, {">UNC", 6}, {"UC", 8}, {"UNR", 10}, {"warn", 4}, /* '>' : getting better */ {">fail", 5}, {"dead", 6}, {"monitor", 7}, {"informational", 8}, {NULL} } }; static struct bit_desc_map pef_b2s_gentype_8 = { BIT_DESC_MAP_LIST, { {"device removed/absent", 0}, {"device inserted/present", 1}, {NULL} } }; static struct bit_desc_map pef_b2s_gentype_9 = { BIT_DESC_MAP_LIST, { {"device disabled", 0}, {"device enabled", 1}, {NULL} } }; static struct bit_desc_map pef_b2s_gentype_10 = { BIT_DESC_MAP_LIST, { {"transition to running", 0}, {"transition to in test", 1}, {"transition to power off", 2}, {"transition to online", 3}, {"transition to offline", 4}, {"transition to off duty", 5}, {"transition to degraded", 6}, {"transition to power save", 7}, {"install error", 8}, {NULL} } }; static struct bit_desc_map pef_b2s_gentype_11 = { BIT_DESC_MAP_LIST, { {"fully redundant", 0}, {"redundancy lost", 1}, {"redundancy degraded", 2}, {"non-redundant/sufficient", 4}, /* '>' : getting better */ {"non-redundant/insufficient", 5}, {"redundancy degraded", 7}, {NULL} } }; static struct bit_desc_map pef_b2s_gentype_12 = { BIT_DESC_MAP_LIST, { {"D0 power state", 0}, {"D1 power state", 1}, {"D2 power state", 2}, {"D3 power state", 3}, {NULL} } }; static struct bit_desc_map * pef_b2s_generic_ER[] __attribute__((unused)) = { &pef_b2s_gentype_1, &pef_b2s_gentype_2, &pef_b2s_gentype_3, &pef_b2s_gentype_4, &pef_b2s_gentype_5, &pef_b2s_gentype_6, &pef_b2s_gentype_7, &pef_b2s_gentype_8, &pef_b2s_gentype_9, &pef_b2s_gentype_10, &pef_b2s_gentype_11, &pef_b2s_gentype_12, }; #define PEF_B2S_GENERIC_ER_ENTRIES \ (sizeof(pef_b2s_generic_ER) / sizeof(pef_b2s_generic_ER[0])) struct pef_policy_entry { #define PEF_POLICY_ID_MASK 0xf0 #define PEF_POLICY_ID_SHIFT 4 #define PEF_POLICY_ENABLED 0x08 #define PEF_POLICY_FLAGS_MASK 0x07 #define PEF_POLICY_FLAGS_MATCH_ALWAYS 0 #define PEF_POLICY_FLAGS_PREV_OK_SKIP 1 #define PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET 2 #define PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET 3 #define PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET 4 uint8_t policy; #define PEF_POLICY_CHANNEL_MASK 0xf0 #define PEF_POLICY_CHANNEL_SHIFT 4 #define PEF_POLICY_DESTINATION_MASK 0x0f uint8_t chan_dest; #define PEF_POLICY_EVENT_SPECIFIC 0x80 uint8_t alert_string_key; } __attribute__ ((packed)); static struct bit_desc_map pef_b2s_policies __attribute__((unused)) = { BIT_DESC_MAP_LIST, { {"Match-always", PEF_POLICY_FLAGS_MATCH_ALWAYS}, {"Try-next-entry", PEF_POLICY_FLAGS_PREV_OK_SKIP}, {"Try-next-set", PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET}, {"Try-next-channel", PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET}, {"Try-next-destination", PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET}, {NULL} } }; static struct bit_desc_map pef_b2s_ch_medium __attribute__((unused)) = { #define PEF_CH_MEDIUM_TYPE_IPMB 1 #define PEF_CH_MEDIUM_TYPE_ICMB_10 2 #define PEF_CH_MEDIUM_TYPE_ICMB_09 3 #define PEF_CH_MEDIUM_TYPE_LAN 4 #define PEF_CH_MEDIUM_TYPE_SERIAL 5 #define PEF_CH_MEDIUM_TYPE_XLAN 6 #define PEF_CH_MEDIUM_TYPE_PCI_SMBUS 7 #define PEF_CH_MEDIUM_TYPE_SMBUS_V1X 8 #define PEF_CH_MEDIUM_TYPE_SMBUS_V2X 9 #define PEF_CH_MEDIUM_TYPE_USB_V1X 10 #define PEF_CH_MEDIUM_TYPE_USB_V2X 11 #define PEF_CH_MEDIUM_TYPE_SYSTEM 12 BIT_DESC_MAP_LIST, { {"IPMB (I2C)", PEF_CH_MEDIUM_TYPE_IPMB}, {"ICMB v1.0", PEF_CH_MEDIUM_TYPE_ICMB_10}, {"ICMB v0.9", PEF_CH_MEDIUM_TYPE_ICMB_09}, {"802.3 LAN", PEF_CH_MEDIUM_TYPE_LAN}, {"Serial/Modem (RS-232)", PEF_CH_MEDIUM_TYPE_SERIAL}, {"Other LAN", PEF_CH_MEDIUM_TYPE_XLAN}, {"PCI SMBus", PEF_CH_MEDIUM_TYPE_PCI_SMBUS}, {"SMBus v1.0/1.1", PEF_CH_MEDIUM_TYPE_SMBUS_V1X}, {"SMBus v2.0", PEF_CH_MEDIUM_TYPE_SMBUS_V2X}, {"USB 1.x", PEF_CH_MEDIUM_TYPE_USB_V1X}, {"USB 2.x", PEF_CH_MEDIUM_TYPE_USB_V2X}, {"System I/F (KCS,SMIC,BT)", PEF_CH_MEDIUM_TYPE_SYSTEM}, {NULL} } }; struct pef_cfgparm_selector { #define PEF_CFGPARM_ID_REVISION_ONLY_MASK 0x80 #define PEF_CFGPARM_ID_SET_IN_PROGRESS 0 #define PEF_CFGPARM_ID_PEF_CONTROL 1 #define PEF_CFGPARM_ID_PEF_ACTION 2 #define PEF_CFGPARM_ID_PEF_STARTUP_DELAY 3 #define PEF_CFGPARM_ID_PEF_ALERT_STARTUP_DELAY 4 #define PEF_CFGPARM_ID_PEF_FILTER_TABLE_SIZE 5 #define PEF_CFGPARM_ID_PEF_FILTER_TABLE_ENTRY 6 #define PEF_CFGPARM_ID_PEF_FILTER_TABLE_DATA_1 7 #define PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_SIZE 8 #define PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_ENTRY 9 #define PEF_CFGPARM_ID_SYSTEM_GUID 10 #define PEF_CFGPARM_ID_PEF_ALERT_STRING_TABLE_SIZE 11 #define PEF_CFGPARM_ID_PEF_ALERT_STRING_KEY 12 #define PEF_CFGPARM_ID_PEF_ALERT_STRING_TABLE_ENTRY 13 uint8_t id; uint8_t set; uint8_t block; } __attribute__ ((packed)); struct pef_cfgparm_set_in_progress { #define PEF_SET_IN_PROGRESS_COMMIT_WRITE 0x02 #define PEF_SET_IN_PROGRESS 0x01 uint8_t data1; } __attribute__ ((packed)); struct pef_cfgparm_control { #define PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY 0x08 #define PEF_CONTROL_ENABLE_STARTUP_DELAY 0x04 #define PEF_CONTROL_ENABLE_EVENT_MESSAGES 0x02 #define PEF_CONTROL_ENABLE 0x01 uint8_t data1; } __attribute__ ((packed)); static struct bit_desc_map pef_b2s_control __attribute__((unused)) = { BIT_DESC_MAP_ALL, { {"PEF", PEF_CONTROL_ENABLE}, {"PEF event messages", PEF_CONTROL_ENABLE_EVENT_MESSAGES}, {"PEF startup delay", PEF_CONTROL_ENABLE_STARTUP_DELAY}, {"Alert startup delay", PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY}, {NULL} } }; struct pef_cfgparm_action { #define PEF_ACTION_ENABLE_DIAGNOSTIC_INTERRUPT 0x20 #define PEF_ACTION_ENABLE_OEM 0x10 #define PEF_ACTION_ENABLE_POWER_CYCLE 0x08 #define PEF_ACTION_ENABLE_RESET 0x04 #define PEF_ACTION_ENABLE_POWER_DOWN 0x02 #define PEF_ACTION_ENABLE_ALERT 0x01 uint8_t data1; } __attribute__ ((packed)); struct pef_cfgparm_startup_delay { uint8_t data1; } __attribute__ ((packed)); struct pef_cfgparm_alert_startup_delay { uint8_t data1; } __attribute__ ((packed)); struct pef_cfgparm_filter_table_size { #define PEF_FILTER_TABLE_SIZE_MASK 0x7f uint8_t data1; } __attribute__ ((packed)); struct pef_cfgparm_filter_table_entry { #define PEF_FILTER_TABLE_ID_MASK 0x7f uint8_t data1; struct pef_table_entry entry; } __attribute__ ((packed)); struct pef_cfgparm_filter_table_data_1 { uint8_t data1; uint8_t data2; } __attribute__ ((packed)); struct pef_cfgparm_policy_table_size { #define PEF_POLICY_TABLE_SIZE_MASK 0x7f uint8_t data1; } __attribute__ ((packed)); struct pef_cfgparm_policy_table_entry { #define PEF_POLICY_TABLE_ID_MASK 0x7f uint8_t data1; struct pef_policy_entry entry; } __attribute__ ((packed)); struct pef_cfgparm_system_guid { #define PEF_SYSTEM_GUID_USED_IN_PET 0x01 uint8_t data1; uint8_t guid[16]; } __attribute__ ((packed)); struct pef_cfgparm_alert_string_table_size { #define PEF_ALERT_STRING_TABLE_SIZE_MASK 0x7f uint8_t data1; } __attribute__ ((packed)); struct pef_cfgparm_alert_string_keys { #define PEF_ALERT_STRING_ID_MASK 0x7f uint8_t data1; #define PEF_EVENT_FILTER_ID_MASK 0x7f uint8_t data2; #define PEF_ALERT_STRING_SET_ID_MASK 0x7f uint8_t data3; } __attribute__ ((packed)); struct pef_cfgparm_alert_string_table_entry { uint8_t id; uint8_t blockno; uint8_t block[16]; } __attribute__ ((packed)); /* PEF - LAN */ struct pef_lan_cfgparm_selector { #define PEF_LAN_CFGPARM_CH_REVISION_ONLY_MASK 0x80 #define PEF_LAN_CFGPARM_CH_MASK 0x0f #define PEF_LAN_CFGPARM_ID_PET_COMMUNITY 16 #define PEF_LAN_CFGPARM_ID_DEST_COUNT 17 #define PEF_LAN_CFGPARM_ID_DESTTYPE 18 #define PEF_LAN_CFGPARM_ID_DESTADDR 19 uint8_t ch; uint8_t id; uint8_t set; uint8_t block; } __attribute__ ((packed)); struct pef_lan_cfgparm_dest_size { #define PEF_LAN_DEST_TABLE_SIZE_MASK 0x0f uint8_t data1; } __attribute__ ((packed)); struct pef_lan_cfgparm_dest_type { #define PEF_LAN_DEST_TYPE_ID_MASK 0x0f uint8_t dest; #define PEF_LAN_DEST_TYPE_ACK 0x80 #define PEF_LAN_DEST_TYPE_MASK 0x07 #define PEF_LAN_DEST_TYPE_PET 0 #define PEF_LAN_DEST_TYPE_OEM_1 6 #define PEF_LAN_DEST_TYPE_OEM_2 7 uint8_t dest_type; uint8_t alert_timeout; #define PEF_LAN_RETRIES_MASK 0x07 uint8_t retries; } __attribute__ ((packed)); static struct bit_desc_map pef_b2s_lan_desttype __attribute__((unused)) = { BIT_DESC_MAP_LIST, { {"Acknowledged", PEF_LAN_DEST_TYPE_ACK}, {"PET", PEF_LAN_DEST_TYPE_PET}, {"OEM 1", PEF_LAN_DEST_TYPE_OEM_1}, {"OEM 2", PEF_LAN_DEST_TYPE_OEM_2}, {NULL} } }; struct pef_lan_cfgparm_dest_info { #define PEF_LAN_DEST_MASK 0x0f uint8_t dest; #define PEF_LAN_DEST_ADDRTYPE_MASK 0xf0 #define PEF_LAN_DEST_ADDRTYPE_SHIFT 4 #define PEF_LAN_DEST_ADDRTYPE_IPV4_MAC 0x00 uint8_t addr_type; #define PEF_LAN_DEST_GATEWAY_USE_BACKUP 0x01 uint8_t gateway; uint8_t ip[4]; uint8_t mac[6]; } __attribute__ ((packed)); /* PEF - Serial/PPP */ struct pef_serial_cfgparm_selector { #define PEF_SERIAL_CFGPARM_CH_REVISION_ONLY_MASK 0x80 #define PEF_SERIAL_CFGPARM_CH_MASK 0x0f #define PEF_SERIAL_CFGPARM_ID_DEST_COUNT 16 #define PEF_SERIAL_CFGPARM_ID_DESTINFO 17 #define PEF_SERIAL_CFGPARM_ID_DEST_DIAL_STRING_COUNT 20 #define PEF_SERIAL_CFGPARM_ID_DEST_DIAL_STRING 21 #define PEF_SERIAL_CFGPARM_ID_TAP_ACCT_COUNT 24 #define PEF_SERIAL_CFGPARM_ID_TAP_ACCT_INFO 25 #define PEF_SERIAL_CFGPARM_ID_TAP_ACCT_PAGER_STRING 27 uint8_t ch; uint8_t id; uint8_t set; uint8_t block; } __attribute__ ((packed)); struct pef_serial_cfgparm_dest_size { #define PEF_SERIAL_DEST_TABLE_SIZE_MASK 0x0f uint8_t data1; } __attribute__ ((packed)); struct pef_serial_cfgparm_dest_info { #define PEF_SERIAL_DEST_MASK 0x0f uint8_t dest; #define PEF_SERIAL_DEST_TYPE_ACK 0x80 #define PEF_SERIAL_DEST_TYPE_MASK 0x0f #define PEF_SERIAL_DEST_TYPE_DIAL 0 #define PEF_SERIAL_DEST_TYPE_TAP 1 #define PEF_SERIAL_DEST_TYPE_PPP 2 #define PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK 3 #define PEF_SERIAL_DEST_TYPE_PPP_CALLBACK 4 #define PEF_SERIAL_DEST_TYPE_OEM_1 14 #define PEF_SERIAL_DEST_TYPE_OEM_2 15 uint8_t dest_type; uint8_t alert_timeout; #define PEF_SERIAL_RETRIES_MASK 0x77 #define PEF_SERIAL_RETRIES_POST_CONNECT_MASK 0x70 #define PEF_SERIAL_RETRIES_PRE_CONNECT_MASK 0x07 uint8_t retries; #define PEF_SERIAL_DIALPAGE_STRING_ID_MASK 0xf0 #define PEF_SERIAL_DIALPAGE_STRING_ID_SHIFT 4 #define PEF_SERIAL_TAP_PAGE_SERVICE_ID_MASK 0x0f #define PEF_SERIAL_PPP_ACCT_IPADDR_ID_MASK 0xf0 #define PEF_SERIAL_PPP_ACCT_IPADDR_ID_SHIFT 4 #define PEF_SERIAL_PPP_ACCT_ID_MASK 0x0f #define PEF_SERIAL_CALLBACK_IPADDR_ID_MASK 0x0f #define PEF_SERIAL_CALLBACK_IPADDR_ID_SHIFT 4 #define PEF_SERIAL_CALLBACK_ACCT_ID_MASK 0xf0 uint8_t data5; } __attribute__ ((packed)); static struct bit_desc_map pef_b2s_serial_desttype __attribute__((unused)) = { BIT_DESC_MAP_LIST, { {"Acknowledged", PEF_SERIAL_DEST_TYPE_ACK}, {"TAP page", PEF_SERIAL_DEST_TYPE_TAP}, {"PPP PET", PEF_SERIAL_DEST_TYPE_PPP}, {"Basic callback", PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK}, {"PPP callback", PEF_SERIAL_DEST_TYPE_PPP_CALLBACK}, {"OEM 1", PEF_SERIAL_DEST_TYPE_OEM_1}, {"OEM 2", PEF_SERIAL_DEST_TYPE_OEM_2}, {NULL} } }; struct pef_serial_cfgparm_dial_string_count { #define PEF_SERIAL_DIAL_STRING_COUNT_MASK 0x0f uint8_t data1; } __attribute__ ((packed)); struct pef_serial_cfgparm_dial_string { #define PEF_SERIAL_DIAL_STRING_MASK 0x0f uint8_t data1; uint8_t data2; uint8_t data3; } __attribute__ ((packed)); struct pef_serial_cfgparm_tap_acct_count { #define PEF_SERIAL_TAP_ACCT_COUNT_MASK 0x0f uint8_t data1; } __attribute__ ((packed)); struct pef_serial_cfgparm_tap_acct_info { uint8_t data1; #define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_MASK 0xf0 #define PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_SHIFT 4 #define PEF_SERIAL_TAP_ACCT_INFO_SVC_SETTINGS_ID_MASK 0x0f uint8_t data2; } __attribute__ ((packed)); struct pef_serial_cfgparm_tap_svc_settings { uint8_t data1; #define PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX 0x0 #define PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX 0x01 #define PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX 0x02 uint8_t confirmation_flags; uint8_t service_type[3]; uint8_t escape_mask[4]; uint8_t timeout_parms[3]; uint8_t retry_parms[2]; } __attribute__ ((packed)); static struct bit_desc_map pef_b2s_tap_svc_confirm __attribute__((unused)) = { BIT_DESC_MAP_LIST, { {"ACK", PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX}, {"211+ACK", PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX}, {"{211|213}+ACK", PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX}, {NULL} } }; #if 0 /* FYI : config parm groupings */ struct pef_config_parms { /* PEF */ struct pef_cfgparm_set_in_progress; struct pef_cfgparm_control; struct pef_cfgparm_action; struct pef_cfgparm_startup_delay; /* in seconds, 1-based */ struct pef_cfgparm_alert_startup_delay; /* in seconds, 1-based */ struct pef_cfgparm_filter_table_size; /* 1-based, READ-ONLY */ struct pef_cfgparm_filter_table_entry; struct pef_cfgparm_filter_table_data_1; struct pef_cfgparm_policy_table_size; struct pef_cfgparm_policy_table_entry; struct pef_cfgparm_system_guid; struct pef_cfgparm_alert_string_table_size; struct pef_cfgparm_alert_string_keys; struct pef_cfgparm_alert_string_table_entry; } __attribute__ ((packed)); struct pef_lan_config_parms { /* LAN */ struct pef_lan_cfgparm_set_in_progress; struct pef_lan_cfgparm_auth_capabilities; struct pef_lan_cfgparm_auth_type; struct pef_lan_cfgparm_ip_address; struct pef_lan_cfgparm_ip_address_source; struct pef_lan_cfgparm_mac_address; struct pef_lan_cfgparm_subnet_mask; struct pef_lan_cfgparm_ipv4_header_parms; struct pef_lan_cfgparm_primary_rmcp_port; struct pef_lan_cfgparm_secondary_rmcp_port; struct pef_lan_cfgparm_bmc_generated_arp_control; struct pef_lan_cfgparm_gratuitous_arp; struct pef_lan_cfgparm_default_gateway_ipaddr; struct pef_lan_cfgparm_default_gateway_macaddr; struct pef_lan_cfgparm_backup_gateway_ipaddr; struct pef_lan_cfgparm_backup_gateway_macaddr; struct pef_lan_cfgparm_pet_community; struct pef_lan_cfgparm_destination_count; struct pef_lan_cfgparm_destination_type; struct pef_lan_cfgparm_destination_ipaddr; } __attribute__ ((packed)); struct pef_serial_config_parms { /* Serial/PPP */ struct pef_serial_cfgparm_set_in_progress; struct pef_serial_cfgparm_auth_capabilities; struct pef_serial_cfgparm_auth_type; struct pef_serial_cfgparm_connection_mode; struct pef_serial_cfgparm_idle_timeout; struct pef_serial_cfgparm_callback_control; struct pef_serial_cfgparm_session_termination; struct pef_serial_cfgparm_ipmi_settings; struct pef_serial_cfgparm_mux_control; struct pef_serial_cfgparm_modem_ring_time; struct pef_serial_cfgparm_modem_init_string; struct pef_serial_cfgparm_modem_escape_sequence; struct pef_serial_cfgparm_modem_hangup_sequence; struct pef_serial_cfgparm_modem_dial_command; struct pef_serial_cfgparm_page_blackout_interval; struct pef_serial_cfgparm_pet_community; struct pef_serial_cfgparm_destination_count; struct pef_serial_cfgparm_destination_info; struct pef_serial_cfgparm_call_retry_interval; struct pef_serial_cfgparm_destination_settings; struct pef_serial_cfgparm_dialstring_count; struct pef_serial_cfgparm_dialstring_info; struct pef_serial_cfgparm_ipaddr_count; struct pef_serial_cfgparm_ipaddr_info; struct pef_serial_cfgparm_tap_acct_count; struct pef_serial_cfgparm_tap_acct_info; struct pef_serial_cfgparm_tap_acct_passwords; /* WRITE only */ struct pef_serial_cfgparm_tap_pager_id_strings; struct pef_serial_cfgparm_tap_service_settings; struct pef_serial_cfgparm_terminal_mode_config; struct pef_serial_cfgparm_ppp_otions; struct pef_serial_cfgparm_ppp_primary_rmcp_port; struct pef_serial_cfgparm_ppp_secondary_rmcp_port; struct pef_serial_cfgparm_ppp_link_auth; struct pef_serial_cfgparm_ppp_chap_name; struct pef_serial_cfgparm_ppp_accm; struct pef_serial_cfgparm_ppp_snoop_accm; struct pef_serial_cfgparm_ppp_acct_count; struct pef_serial_cfgparm_ppp_acct_dialstring_selector; struct pef_serial_cfgparm_ppp_acct_ipaddrs; struct pef_serial_cfgparm_ppp_acct_user_names; struct pef_serial_cfgparm_ppp_acct_user_domains; struct pef_serial_cfgparm_ppp_acct_user_passwords; /* WRITE only */ struct pef_serial_cfgparm_ppp_acct_auth_settings; struct pef_serial_cfgparm_ppp_acct_connect_hold_times; struct pef_serial_cfgparm_ppp_udp_proxy_ipheader; struct pef_serial_cfgparm_ppp_udp_proxy_xmit_bufsize; struct pef_serial_cfgparm_ppp_udp_proxy_recv_bufsize; struct pef_serial_cfgparm_ppp_remote_console_ipaddr; } __attribute__ ((packed)); #endif #define IPMI_CMD_GET_PEF_CAPABILITIES 0x10 #define IPMI_CMD_GET_PEF_CONFIG_PARMS 0x13 #define IPMI_CMD_GET_LAST_PROCESSED_EVT_ID 0x15 #define IPMI_CMD_GET_SYSTEM_GUID 0x37 #define IPMI_CMD_GET_CHANNEL_INFO 0x42 #define IPMI_CMD_LAN_GET_CONFIG 0x02 #define IPMI_CMD_SERIAL_GET_CONFIG 0x11 const char * ipmi_pef_bit_desc(struct bit_desc_map * map, uint32_t val); void ipmi_pef_print_flags(struct bit_desc_map * map, flg_e type, uint32_t val); void ipmi_pef_print_dec(const char * text, uint32_t val); void ipmi_pef_print_hex(const char * text, uint32_t val); void ipmi_pef_print_1xd(const char * text, uint32_t val); void ipmi_pef_print_2xd(const char * text, uint8_t u1, uint8_t u2); void ipmi_pef_print_str(const char * text, const char * val); int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv); #endif /* IPMI_PEF_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_tsol.h0000644000076400007640000000355213160502144022073 0ustar acressloggers/* * Copyright (c) 2005 Tyan Computer Corp. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_TSOL_H #define IPMI_TSOL_H #include #define IPMI_TSOL_CMD_SENDKEY 0x03 #define IPMI_TSOL_CMD_START 0x06 #define IPMI_TSOL_CMD_STOP 0x02 #define IPMI_TSOL_DEF_PORT 6230 int ipmi_tsol_main(struct ipmi_intf *, int, char **); #endif /* IPMI_TSOL_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_sdr.h0000644000076400007640000006303313160502144021702 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_SDR_H #define IPMI_SDR_H #if HAVE_CONFIG_H # include #endif #ifdef WIN32 #include #else #include #endif #include #include #include #include int ipmi_sdr_main(struct ipmi_intf *, int, char **); #define tos32(val, bits) ((val & ((1<<((bits)-1)))) ? (-((val) & (1<<((bits)-1))) | (val)) : (val)) #if WORDS_BIGENDIAN # define __TO_TOL(mtol) (uint16_t)(mtol & 0x3f) # define __TO_M(mtol) (int16_t)(tos32((((mtol & 0xff00) >> 8) | ((mtol & 0xc0) << 2)), 10)) # define __TO_B(bacc) (int32_t)(tos32((((bacc & 0xff000000) >> 24) | ((bacc & 0xc00000) >> 14)), 10)) # define __TO_ACC(bacc) (uint32_t)(((bacc & 0x3f0000) >> 16) | ((bacc & 0xf000) >> 6)) # define __TO_ACC_EXP(bacc) (uint32_t)((bacc & 0xc00) >> 10) # define __TO_R_EXP(bacc) (int32_t)(tos32(((bacc & 0xf0) >> 4), 4)) # define __TO_B_EXP(bacc) (int32_t)(tos32((bacc & 0xf), 4)) #else # define __TO_TOL(mtol) (uint16_t)(BSWAP_16(mtol) & 0x3f) # define __TO_M(mtol) (int16_t)(tos32((((BSWAP_16(mtol) & 0xff00) >> 8) | ((BSWAP_16(mtol) & 0xc0) << 2)), 10)) # define __TO_B(bacc) (int32_t)(tos32((((BSWAP_32(bacc) & 0xff000000) >> 24) | \ ((BSWAP_32(bacc) & 0xc00000) >> 14)), 10)) # define __TO_ACC(bacc) (uint32_t)(((BSWAP_32(bacc) & 0x3f0000) >> 16) | ((BSWAP_32(bacc) & 0xf000) >> 6)) # define __TO_ACC_EXP(bacc) (uint32_t)((BSWAP_32(bacc) & 0xc00) >> 10) # define __TO_R_EXP(bacc) (int32_t)(tos32(((BSWAP_32(bacc) & 0xf0) >> 4), 4)) # define __TO_B_EXP(bacc) (int32_t)(tos32((BSWAP_32(bacc) & 0xf), 4)) #endif enum { ANALOG_SENSOR, DISCRETE_SENSOR, }; #define READING_UNAVAILABLE 0x20 #define SCANNING_DISABLED 0x40 #define EVENT_MSG_DISABLED 0x80 #define IS_READING_UNAVAILABLE(val) ((val) & READING_UNAVAILABLE) #define IS_SCANNING_DISABLED(val) (!((val) & SCANNING_DISABLED)) #define IS_EVENT_MSG_DISABLED(val) (!((val) & EVENT_MSG_DISABLED)) #define GET_SDR_REPO_INFO 0x20 #define GET_SDR_ALLOC_INFO 0x21 #define SDR_SENSOR_STAT_LO_NC (1<<0) #define SDR_SENSOR_STAT_LO_CR (1<<1) #define SDR_SENSOR_STAT_LO_NR (1<<2) #define SDR_SENSOR_STAT_HI_NC (1<<3) #define SDR_SENSOR_STAT_HI_CR (1<<4) #define SDR_SENSOR_STAT_HI_NR (1<<5) #define GET_DEVICE_SDR_INFO 0x20 #define GET_DEVICE_SDR 0x21 #define GET_SENSOR_FACTORS 0x23 #define GET_SENSOR_FACTORS 0x23 #define SET_SENSOR_HYSTERESIS 0x24 #define GET_SENSOR_HYSTERESIS 0x25 #define SET_SENSOR_THRESHOLDS 0x26 #define GET_SENSOR_THRESHOLDS 0x27 #define SET_SENSOR_EVENT_ENABLE 0x28 #define GET_SENSOR_EVENT_ENABLE 0x29 #define GET_SENSOR_EVENT_STATUS 0x2b #define GET_SENSOR_READING 0x2d #define GET_SENSOR_TYPE 0x2f #define GET_SENSOR_READING 0x2d #define GET_SENSOR_TYPE 0x2f struct sdr_repo_info_rs { uint8_t version; /* SDR version (51h) */ uint16_t count; /* number of records */ uint16_t free; /* free space in SDR */ uint32_t add_stamp; /* last add timestamp */ uint32_t erase_stamp; /* last del timestamp */ uint8_t op_support; /* supported operations */ } __attribute__ ((packed)); /* builtin (device) sdrs support */ struct sdr_device_info_rs { unsigned char count; /* number of records */ unsigned char flags; /* flags */ unsigned char popChangeInd[3]; /* free space in SDR */ } __attribute__ ((packed)); #define GET_SDR_RESERVE_REPO 0x22 struct sdr_reserve_repo_rs { uint16_t reserve_id; /* reservation ID */ } __attribute__ ((packed)); #define GET_SDR 0x23 struct sdr_get_rq { uint16_t reserve_id; /* reservation ID */ uint16_t id; /* record ID */ uint8_t offset; /* offset into SDR */ #define GET_SDR_ENTIRE_RECORD 0xff uint8_t length; /* length to read */ } __attribute__ ((packed)); struct sdr_get_rs { uint16_t next; /* next record id */ uint16_t id; /* record ID */ uint8_t version; /* SDR version (51h) */ #define SDR_RECORD_TYPE_FULL_SENSOR 0x01 #define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02 #define SDR_RECORD_TYPE_EVENTONLY_SENSOR 0x03 #define SDR_RECORD_TYPE_ENTITY_ASSOC 0x08 #define SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC 0x09 #define SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR 0x10 #define SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR 0x11 #define SDR_RECORD_TYPE_MC_DEVICE_LOCATOR 0x12 #define SDR_RECORD_TYPE_MC_CONFIRMATION 0x13 #define SDR_RECORD_TYPE_BMC_MSG_CHANNEL_INFO 0x14 #define SDR_RECORD_TYPE_OEM 0xc0 uint8_t type; /* record type */ uint8_t length; /* remaining record bytes */ } __attribute__ ((packed)); struct sdr_record_mask { union { struct { uint16_t assert_event; /* assertion event mask */ uint16_t deassert_event; /* de-assertion event mask */ uint16_t read; /* discrete reading mask */ } discrete; struct { #if WORDS_BIGENDIAN uint16_t reserved:1; uint16_t status_lnr:1; uint16_t status_lcr:1; uint16_t status_lnc:1; uint16_t assert_unr_high:1; uint16_t assert_unr_low:1; uint16_t assert_ucr_high:1; uint16_t assert_ucr_low:1; uint16_t assert_unc_high:1; uint16_t assert_unc_low:1; uint16_t assert_lnr_high:1; uint16_t assert_lnr_low:1; uint16_t assert_lcr_high:1; uint16_t assert_lcr_low:1; uint16_t assert_lnc_high:1; uint16_t assert_lnc_low:1; #else uint16_t assert_lnc_low:1; uint16_t assert_lnc_high:1; uint16_t assert_lcr_low:1; uint16_t assert_lcr_high:1; uint16_t assert_lnr_low:1; uint16_t assert_lnr_high:1; uint16_t assert_unc_low:1; uint16_t assert_unc_high:1; uint16_t assert_ucr_low:1; uint16_t assert_ucr_high:1; uint16_t assert_unr_low:1; uint16_t assert_unr_high:1; uint16_t status_lnc:1; uint16_t status_lcr:1; uint16_t status_lnr:1; uint16_t reserved:1; #endif #if WORDS_BIGENDIAN uint16_t reserved_2:1; uint16_t status_unr:1; uint16_t status_ucr:1; uint16_t status_unc:1; uint16_t deassert_unr_high:1; uint16_t deassert_unr_low:1; uint16_t deassert_ucr_high:1; uint16_t deassert_ucr_low:1; uint16_t deassert_unc_high:1; uint16_t deassert_unc_low:1; uint16_t deassert_lnr_high:1; uint16_t deassert_lnr_low:1; uint16_t deassert_lcr_high:1; uint16_t deassert_lcr_low:1; uint16_t deassert_lnc_high:1; uint16_t deassert_lnc_low:1; #else uint16_t deassert_lnc_low:1; uint16_t deassert_lnc_high:1; uint16_t deassert_lcr_low:1; uint16_t deassert_lcr_high:1; uint16_t deassert_lnr_low:1; uint16_t deassert_lnr_high:1; uint16_t deassert_unc_low:1; uint16_t deassert_unc_high:1; uint16_t deassert_ucr_low:1; uint16_t deassert_ucr_high:1; uint16_t deassert_unr_low:1; uint16_t deassert_unr_high:1; uint16_t status_unc:1; uint16_t status_ucr:1; uint16_t status_unr:1; uint16_t reserved_2:1; #endif union { struct { #if WORDS_BIGENDIAN /* settable threshold mask */ uint16_t reserved:2; uint16_t unr:1; uint16_t ucr:1; uint16_t unc:1; uint16_t lnr:1; uint16_t lcr:1; uint16_t lnc:1; /* padding lower 8 bits */ uint16_t readable:8; #else uint16_t readable:8; uint16_t lnc:1; uint16_t lcr:1; uint16_t lnr:1; uint16_t unc:1; uint16_t ucr:1; uint16_t unr:1; uint16_t reserved:2; #endif } set; struct { #if WORDS_BIGENDIAN /* readable threshold mask */ /* padding upper 8 bits */ uint16_t settable:8; uint16_t reserved:2; uint16_t unr:1; uint16_t ucr:1; uint16_t unc:1; uint16_t lnr:1; uint16_t lcr:1; uint16_t lnc:1; #else uint16_t lnc:1; uint16_t lcr:1; uint16_t lnr:1; uint16_t unc:1; uint16_t ucr:1; uint16_t unr:1; uint16_t reserved:2; uint16_t settable:8; #endif } read; } mask; } threshold; } type; } __attribute__ ((packed)); struct sdr_record_compact_sensor { struct { uint8_t owner_id; #if WORDS_BIGENDIAN uint8_t channel:4; /* channel number */ uint8_t __reserved1:2; uint8_t lun:2; /* sensor owner lun */ #else uint8_t lun:2; /* sensor owner lun */ uint8_t __reserved1:2; uint8_t channel:4; /* channel number */ #endif uint8_t sensor_num; /* unique sensor number */ } keys; struct entity_id entity; struct { struct { #if WORDS_BIGENDIAN uint8_t __reserved2:1; uint8_t scanning:1; uint8_t events:1; uint8_t thresholds:1; uint8_t hysteresis:1; uint8_t type:1; uint8_t event_gen:1; uint8_t sensor_scan:1; #else uint8_t sensor_scan:1; uint8_t event_gen:1; uint8_t type:1; uint8_t hysteresis:1; uint8_t thresholds:1; uint8_t events:1; uint8_t scanning:1; uint8_t __reserved2:1; #endif } init; struct { #if WORDS_BIGENDIAN uint8_t ignore:1; uint8_t rearm:1; uint8_t hysteresis:2; uint8_t threshold:2; uint8_t event_msg:2; #else uint8_t event_msg:2; uint8_t threshold:2; uint8_t hysteresis:2; uint8_t rearm:1; uint8_t ignore:1; #endif } capabilities; uint8_t type; /* sensor type */ } sensor; uint8_t event_type; /* event/reading type code */ struct sdr_record_mask mask; struct { #if WORDS_BIGENDIAN uint8_t analog:2; uint8_t rate:3; uint8_t modifier:2; uint8_t pct:1; #else uint8_t pct:1; uint8_t modifier:2; uint8_t rate:3; uint8_t analog:2; #endif struct { uint8_t base; uint8_t modifier; } type; } unit; struct { #if WORDS_BIGENDIAN uint8_t __reserved3:2; uint8_t mod_type:2; uint8_t count:4; #else uint8_t count:4; uint8_t mod_type:2; uint8_t __reserved3:2; #endif #if WORDS_BIGENDIAN uint8_t entity_inst:1; uint8_t mod_offset:7; #else uint8_t mod_offset:7; uint8_t entity_inst:1; #endif } share; struct { struct { uint8_t positive; uint8_t negative; } hysteresis; } threshold; uint8_t __reserved4[3]; uint8_t oem; /* reserved for OEM use */ uint8_t id_code; /* sensor ID string type/length code */ uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */ } __attribute__ ((packed)); struct sdr_record_eventonly_sensor { struct { uint8_t owner_id; #if WORDS_BIGENDIAN uint8_t channel:4; /* channel number */ uint8_t fru_owner:2; /* fru device owner lun */ uint8_t lun:2; /* sensor owner lun */ #else uint8_t lun:2; /* sensor owner lun */ uint8_t fru_owner:2; /* fru device owner lun */ uint8_t channel:4; /* channel number */ #endif uint8_t sensor_num; /* unique sensor number */ } keys; struct entity_id entity; uint8_t sensor_type; /* sensor type */ uint8_t event_type; /* event/reading type code */ struct { #if WORDS_BIGENDIAN uint8_t __reserved1:2; uint8_t mod_type:2; uint8_t count:4; #else uint8_t count:4; uint8_t mod_type:2; uint8_t __reserved1:2; #endif #if WORDS_BIGENDIAN uint8_t entity_inst:1; uint8_t mod_offset:7; #else uint8_t mod_offset:7; uint8_t entity_inst:1; #endif } share; uint8_t __reserved4; uint8_t oem; /* reserved for OEM use */ uint8_t id_code; /* sensor ID string type/length code */ uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */ } __attribute__ ((packed)); struct sdr_record_full_sensor { struct { uint8_t owner_id; #if WORDS_BIGENDIAN uint8_t channel:4; /* channel number */ uint8_t __reserved1:2; uint8_t lun:2; /* sensor owner lun */ #else uint8_t lun:2; /* sensor owner lun */ uint8_t __reserved1:2; uint8_t channel:4; /* channel number */ #endif uint8_t sensor_num; /* unique sensor number */ } keys; struct entity_id entity; struct { struct { #if WORDS_BIGENDIAN uint8_t __reserved2:1; uint8_t scanning:1; uint8_t events:1; uint8_t thresholds:1; uint8_t hysteresis:1; uint8_t type:1; uint8_t event_gen:1; uint8_t sensor_scan:1; #else uint8_t sensor_scan:1; uint8_t event_gen:1; uint8_t type:1; uint8_t hysteresis:1; uint8_t thresholds:1; uint8_t events:1; uint8_t scanning:1; uint8_t __reserved2:1; #endif } init; struct { #if WORDS_BIGENDIAN uint8_t ignore:1; uint8_t rearm:1; uint8_t hysteresis:2; uint8_t threshold:2; uint8_t event_msg:2; #else uint8_t event_msg:2; uint8_t threshold:2; uint8_t hysteresis:2; uint8_t rearm:1; uint8_t ignore:1; #endif } capabilities; uint8_t type; } sensor; uint8_t event_type; /* event/reading type code */ struct sdr_record_mask mask; struct { #if WORDS_BIGENDIAN uint8_t analog:2; uint8_t rate:3; uint8_t modifier:2; uint8_t pct:1; #else uint8_t pct:1; uint8_t modifier:2; uint8_t rate:3; uint8_t analog:2; #endif struct { uint8_t base; uint8_t modifier; } type; } unit; #define SDR_SENSOR_L_LINEAR 0x00 #define SDR_SENSOR_L_LN 0x01 #define SDR_SENSOR_L_LOG10 0x02 #define SDR_SENSOR_L_LOG2 0x03 #define SDR_SENSOR_L_E 0x04 #define SDR_SENSOR_L_EXP10 0x05 #define SDR_SENSOR_L_EXP2 0x06 #define SDR_SENSOR_L_1_X 0x07 #define SDR_SENSOR_L_SQR 0x08 #define SDR_SENSOR_L_CUBE 0x09 #define SDR_SENSOR_L_SQRT 0x0a #define SDR_SENSOR_L_CUBERT 0x0b #define SDR_SENSOR_L_NONLINEAR 0x70 uint8_t linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */ uint16_t mtol; /* M, tolerance */ uint32_t bacc; /* accuracy, B, Bexp, Rexp */ struct { #if WORDS_BIGENDIAN uint8_t __reserved3:5; uint8_t normal_min:1; /* normal min field specified */ uint8_t normal_max:1; /* normal max field specified */ uint8_t nominal_read:1; /* nominal reading field specified */ #else uint8_t nominal_read:1; /* nominal reading field specified */ uint8_t normal_max:1; /* normal max field specified */ uint8_t normal_min:1; /* normal min field specified */ uint8_t __reserved3:5; #endif } analog_flag; uint8_t nominal_read; /* nominal reading, raw value */ uint8_t normal_max; /* normal maximum, raw value */ uint8_t normal_min; /* normal minimum, raw value */ uint8_t sensor_max; /* sensor maximum, raw value */ uint8_t sensor_min; /* sensor minimum, raw value */ struct { struct { uint8_t non_recover; uint8_t critical; uint8_t non_critical; } upper; struct { uint8_t non_recover; uint8_t critical; uint8_t non_critical; } lower; struct { uint8_t positive; uint8_t negative; } hysteresis; } threshold; uint8_t __reserved4[2]; uint8_t oem; /* reserved for OEM use */ uint8_t id_code; /* sensor ID string type/length code */ uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */ } __attribute__ ((packed)); struct sdr_record_mc_locator { uint8_t dev_slave_addr; #if WORDS_BIGENDIAN uint8_t __reserved2:4; uint8_t channel_num:4; #else uint8_t channel_num:4; uint8_t __reserved2:4; #endif #if WORDS_BIGENDIAN uint8_t pwr_state_notif:3; uint8_t __reserved3:1; uint8_t global_init:4; #else uint8_t global_init:4; uint8_t __reserved3:1; uint8_t pwr_state_notif:3; #endif uint8_t dev_support; uint8_t __reserved4[3]; struct entity_id entity; uint8_t oem; uint8_t id_code; uint8_t id_string[16]; } __attribute__ ((packed)); struct sdr_record_fru_locator { uint8_t dev_slave_addr; uint8_t device_id; #if WORDS_BIGENDIAN uint8_t logical:1; uint8_t __reserved2:2; uint8_t lun:2; uint8_t bus:3; #else uint8_t bus:3; uint8_t lun:2; uint8_t __reserved2:2; uint8_t logical:1; #endif #if WORDS_BIGENDIAN uint8_t channel_num:4; uint8_t __reserved3:4; #else uint8_t __reserved3:4; uint8_t channel_num:4; #endif uint8_t __reserved4; uint8_t dev_type; uint8_t dev_type_modifier; struct entity_id entity; uint8_t oem; uint8_t id_code; uint8_t id_string[16]; } __attribute__ ((packed)); struct sdr_record_generic_locator { uint8_t dev_access_addr; uint8_t dev_slave_addr; #if WORDS_BIGENDIAN uint8_t channel_num:3; uint8_t lun:2; uint8_t bus:3; #else uint8_t bus:3; uint8_t lun:2; uint8_t channel_num:3; #endif #if WORDS_BIGENDIAN uint8_t addr_span:3; uint8_t __reserved1:5; #else uint8_t __reserved1:5; uint8_t addr_span:3; #endif uint8_t __reserved2; uint8_t dev_type; uint8_t dev_type_modifier; struct entity_id entity; uint8_t oem; uint8_t id_code; uint8_t id_string[16]; } __attribute__ ((packed)); struct sdr_record_entity_assoc { struct entity_id entity; /* container entity ID and instance */ struct { #if WORDS_BIGENDIAN uint8_t isrange:1; uint8_t islinked:1; uint8_t isaccessable:1; uint8_t __reserved1:5; #else uint8_t __reserved1:5; uint8_t isaccessable:1; uint8_t islinked:1; uint8_t isrange:1; #endif } flags; uint8_t entity_id_1; /* entity ID 1 | range 1 entity */ uint8_t entity_inst_1; /* entity inst 1 | range 1 first instance */ uint8_t entity_id_2; /* entity ID 2 | range 1 entity */ uint8_t entity_inst_2; /* entity inst 2 | range 1 last instance */ uint8_t entity_id_3; /* entity ID 3 | range 2 entity */ uint8_t entity_inst_3; /* entity inst 3 | range 2 first instance */ uint8_t entity_id_4; /* entity ID 4 | range 2 entity */ uint8_t entity_inst_4; /* entity inst 4 | range 2 last instance */ } __attribute__ ((packed)); struct sdr_record_oem { uint8_t *data; int data_len; }; /* * The Get SDR Repository Info response structure * From table 33-3 of the IPMI v2.0 spec */ struct get_sdr_repository_info_rsp { uint8_t sdr_version; uint8_t record_count_lsb; uint8_t record_count_msb; uint8_t free_space[2]; uint8_t most_recent_addition_timestamp[4]; uint8_t most_recent_erase_timestamp[4]; #if WORDS_BIGENDIAN uint8_t overflow_flag:1; uint8_t modal_update_support:2; uint8_t __reserved1:1; uint8_t delete_sdr_supported:1; uint8_t partial_add_sdr_supported:1; uint8_t reserve_sdr_repository_supported:1; uint8_t get_sdr_repository_allo_info_supported:1; #else uint8_t get_sdr_repository_allo_info_supported:1; uint8_t reserve_sdr_repository_supported:1; uint8_t partial_add_sdr_supported:1; uint8_t delete_sdr_supported:1; uint8_t __reserved1:1; uint8_t modal_update_support:2; uint8_t overflow_flag:1; #endif } __attribute__ ((packed)); struct ipmi_sdr_iterator { uint16_t reservation; int total; int next; }; struct sdr_record_list { uint16_t id; uint8_t version; uint8_t type; uint8_t length; uint8_t *raw; struct sdr_record_list *next; union { struct sdr_record_full_sensor *full; struct sdr_record_compact_sensor *compact; struct sdr_record_eventonly_sensor *eventonly; struct sdr_record_generic_locator *genloc; struct sdr_record_fru_locator *fruloc; struct sdr_record_mc_locator *mcloc; struct sdr_record_entity_assoc *entassoc; struct sdr_record_oem *oem; } record; }; /* unit description codes (IPMI v1.5 section 37.16) */ #define UNIT_MAX 0x90 static const char *unit_desc[] __attribute__ ((unused)) = { "unspecified", "degrees C", "degrees F", "degrees K", "Volts", "Amps", "Watts", "Joules", "Coulombs", "VA", "Nits", "lumen", "lux", "Candela", "kPa", "PSI", "Newton", "CFM", "RPM", "Hz", "microsecond", "millisecond", "second", "minute", "hour", "day", "week", "mil", "inches", "feet", "cu in", "cu feet", "mm", "cm", "m", "cu cm", "cu m", "liters", "fluid ounce", "radians", "steradians", "revolutions", "cycles", "gravities", "ounce", "pound", "ft-lb", "oz-in", "gauss", "gilberts", "henry", "millihenry", "farad", "microfarad", "ohms", "siemens", "mole", "becquerel", "PPM", "reserved", "Decibels", "DbA", "DbC", "gray", "sievert", "color temp deg K", "bit", "kilobit", "megabit", "gigabit", "byte", "kilobyte", "megabyte", "gigabyte", "word", "dword", "qword", "line", "hit", "miss", "retry", "reset", "overflow", "underrun", "collision", "packets", "messages", "characters", "error", "correctable error", "uncorrectable error",}; /* sensor type codes (IPMI v1.5 table 36.3) / Updated to v2.0 Table 42-3, Sensor Type Codes */ #define SENSOR_TYPE_MAX 0x2C static const char *sensor_type_desc[] __attribute__ ((unused)) = { "reserved", "Temperature", "Voltage", "Current", "Fan", "Physical Security", "Platform Security", "Processor", "Power Supply", "Power Unit", "Cooling Device", "Other", "Memory", "Drive Slot / Bay", "POST Memory Resize", "System Firmwares", "Event Logging Disabled", "Watchdog", "System Event", "Critical Interrupt", "Button", "Module / Board", "Microcontroller", "Add-in Card", "Chassis", "Chip Set", "Other FRU", "Cable / Interconnect", "Terminator", "System Boot Initiated", "Boot Error", "OS Boot", "OS Critical Stop", "Slot / Connector", "System ACPI Power State", "Watchdog", "Platform Alert", "Entity Presence", "Monitor ASIC", "LAN", "Management Subsystem Health", "Battery","Session Audit", "Version Change","FRU State" }; struct ipmi_sdr_iterator *ipmi_sdr_start(struct ipmi_intf *intf); struct sdr_get_rs *ipmi_sdr_get_next_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *i); uint8_t *ipmi_sdr_get_record(struct ipmi_intf *intf, struct sdr_get_rs *header, struct ipmi_sdr_iterator *i); void ipmi_sdr_end(struct ipmi_intf *intf, struct ipmi_sdr_iterator *i); int ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type); int ipmi_sdr_print_rawentry(struct ipmi_intf *intf, uint8_t type, uint8_t * raw, int len); int ipmi_sdr_print_listentry(struct ipmi_intf *intf, struct sdr_record_list *entry); char *ipmi_sdr_get_unit_string(uint8_t type, uint8_t base, uint8_t modifier); const char *ipmi_sdr_get_status(struct sdr_record_full_sensor *sensor, uint8_t stat); double sdr_convert_sensor_tolerance(struct sdr_record_full_sensor *sensor, uint8_t val); double sdr_convert_sensor_reading(struct sdr_record_full_sensor *sensor, uint8_t val); double sdr_convert_sensor_hysterisis(struct sdr_record_full_sensor *sensor, uint8_t val); uint8_t sdr_convert_sensor_value_to_raw(struct sdr_record_full_sensor *sensor, double val); struct ipmi_rs *ipmi_sdr_get_sensor_reading(struct ipmi_intf *intf, uint8_t sensor); struct ipmi_rs *ipmi_sdr_get_sensor_reading_ipmb(struct ipmi_intf *intf, uint8_t sensor, uint8_t target, uint8_t lun); struct ipmi_rs *ipmi_sdr_get_sensor_thresholds(struct ipmi_intf *intf, uint8_t sensor); struct ipmi_rs *ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf, uint8_t sensor); const char *ipmi_sdr_get_sensor_type_desc(const uint8_t type); int ipmi_sdr_get_reservation(struct ipmi_intf *intf, uint16_t * reserve_id); int ipmi_sdr_print_sensor_full(struct ipmi_intf *intf, struct sdr_record_full_sensor *sensor); int ipmi_sdr_print_sensor_compact(struct ipmi_intf *intf, struct sdr_record_compact_sensor *sensor); int ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf, struct sdr_record_eventonly_sensor *sensor); int ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf, struct sdr_record_generic_locator *fru); int ipmi_sdr_print_sensor_fru_locator(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru); int ipmi_sdr_print_sensor_mc_locator(struct ipmi_intf *intf, struct sdr_record_mc_locator *mc); int ipmi_sdr_print_sensor_entity_assoc(struct ipmi_intf *intf, struct sdr_record_entity_assoc *assoc); struct sdr_record_list *ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf, struct entity_id *entity); struct sdr_record_list *ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf, uint8_t num, uint8_t type); struct sdr_record_list *ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type); struct sdr_record_list *ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id); struct sdr_record_list *ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf, uint8_t type); int ipmi_sdr_list_cache(struct ipmi_intf *intf); int ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile); void ipmi_sdr_list_empty(struct ipmi_intf *intf); int ipmi_sdr_print_info(struct ipmi_intf *intf); void ipmi_sdr_print_discrete_state(const char *desc, uint8_t sensor_type, uint8_t event_type, uint8_t state1, uint8_t state2); void ipmi_sdr_print_discrete_state_mini(const char *separator, uint8_t sensor_type, uint8_t event_type, uint8_t state1, uint8_t state2); int ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf, uint8_t sensor_num, uint8_t sensor_type, uint8_t event_type, int numeric_fmt); int ipmi_sdr_print_sensor_event_enable(struct ipmi_intf *intf, uint8_t sensor_num, uint8_t sensor_type, uint8_t event_type, int numeric_fmt); #endif /* IPMI_SDR_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_main.h0000644000076400007640000000363513160502144022040 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_MAIN_H #define IPMI_MAIN_H #include int ipmi_main(int argc, char ** argv, struct ipmi_cmd * cmdlist, struct ipmi_intf_support * intflist); void ipmi_cmd_print(struct ipmi_cmd * cmdlist); int ipmi_cmd_run(struct ipmi_intf * intf, char * name, int argc, char ** argv); #endif /* IPMI_MAIN_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_strings.h0000644000076400007640000000517013160502144022601 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_STRINGS_H #define IPMI_STRINGS_H #include extern const struct valstr completion_code_vals[]; extern const struct valstr entity_id_vals[]; extern const struct valstr entity_device_type_vals[]; extern const struct valstr ipmi_netfn_vals[]; extern const struct valstr ipmi_channel_activity_type_vals[]; extern const struct valstr ipmi_privlvl_vals[]; extern const struct valstr impi_bit_rate_vals[]; extern const struct valstr ipmi_set_in_progress_vals[]; extern const struct valstr ipmi_authtype_session_vals[]; extern const struct valstr ipmi_authtype_vals[]; extern const struct valstr ipmi_channel_protocol_vals[]; extern const struct valstr ipmi_channel_medium_vals[]; extern const struct valstr ipmi_chassis_power_control_vals[]; extern const struct valstr ipmi_auth_algorithms[]; extern const struct valstr ipmi_integrity_algorithms[]; extern const struct valstr ipmi_encryption_algorithms[]; extern const struct valstr ipmi_oem_info[]; extern const struct oemvalstr ipmi_oem_sdr_type_vals[]; #endif /*IPMI_STRINGS_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/bswap.h0000644000076400007640000000410413160502144021202 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_BSWAP_H #define IPMI_BSWAP_H #if HAVE_CONFIG_H # include #endif #undef BSWAP_16 #undef BSWAP_32 #if HAVE_BYTESWAP_H # include # define BSWAP_16(x) bswap_16(x) # define BSWAP_32(x) bswap_32(x) #else # define BSWAP_16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8)) # define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) |\ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) #endif #endif /* IPMI_BSWAP_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_picmg.h0000644000076400007640000000500213160502144022201 0ustar acressloggers /* (C) Kontron */ #ifndef _IPMI_PICMG_H_ #define _IPMI_PICMG_H_ #include /* PICMG commands */ #define PICMG_GET_PICMG_PROPERTIES_CMD 0x00 #define PICMG_GET_ADDRESS_INFO_CMD 0x01 #define PICMG_GET_SHELF_ADDRESS_INFO_CMD 0x02 #define PICMG_SET_SHELF_ADDRESS_INFO_CMD 0x03 #define PICMG_FRU_CONTROL_CMD 0x04 #define PICMG_GET_FRU_LED_PROPERTIES_CMD 0x05 #define PICMG_GET_LED_COLOR_CAPABILITIES_CMD 0x06 #define PICMG_SET_FRU_LED_STATE_CMD 0x07 #define PICMG_GET_FRU_LED_STATE_CMD 0x08 #define PICMG_SET_IPMB_CMD 0x09 #define PICMG_SET_FRU_POLICY_CMD 0x0A #define PICMG_GET_FRU_POLICY_CMD 0x0B #define PICMG_FRU_ACTIVATION_CMD 0x0C #define PICMG_GET_DEVICE_LOCATOR_RECORD_CMD 0x0D #define PICMG_SET_PORT_STATE_CMD 0x0E #define PICMG_GET_PORT_STATE_CMD 0x0F #define PICMG_COMPUTE_POWER_PROPERTIES_CMD 0x10 #define PICMG_SET_POWER_LEVEL_CMD 0x11 #define PICMG_GET_POWER_LEVEL_CMD 0x12 #define PICMG_RENEGOTIATE_POWER_CMD 0x13 #define PICMG_GET_FAN_SPEED_PROPERTIES_CMD 0x14 #define PICMG_SET_FAN_LEVEL_CMD 0x15 #define PICMG_GET_FAN_LEVEL_CMD 0x16 #define PICMG_BUSED_RESOURCE_CMD 0x17 /* AMC.0 commands */ #define PICMG_AMC_SET_PORT_STATE_CMD 0x19 #define PICMG_AMC_GET_PORT_STATE_CMD 0x1A /* Site Types */ #define PICMG_ATCA_BOARD 0x00 #define PICMG_POWER_ENTRY 0x01 #define PICMG_SHELF_FRU 0x02 #define PICMG_DEDICATED_SHMC 0x03 #define PICMG_FAN_TRAY 0x04 #define PICMG_FAN_FILTER_TRAY 0x05 #define PICMG_ALARM 0x06 #define PICMG_AMC 0x07 #define PICMG_PMC 0x08 #define PICMG_RTM 0x09 struct picmg_set_fru_activation_cmd { unsigned char picmg_id; /* always 0*/ unsigned char fru_id; /* threshold setting mask */ unsigned char fru_state; /* fru activation/deactivation */ } __attribute__ ((packed)); /* the LED color capabilities */ static const char* led_color_str[] __attribute__((unused)) = { "reserved", "BLUE", "RED", "GREEN", "AMBER", "ORANGE", "WHITE", "reserved" }; static const char* amc_link_type_str[] __attribute__((unused)) = { " FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED", " FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1", " FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS", " FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1", " FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2", " FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET", " FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO", " FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE", }; int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv); #endif ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/helper.h0000644000076400007640000000650013160502144021347 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_HELPER_H #define IPMI_HELPER_H #ifdef WIN32 #include #include #include #define snprintf _snprintf #define vsnprintf _vsnprintf #define strncasecmp strnicmp #define strcasecmp _stricmp // #define strcasecmp stricmp // extern int stricmp(const char *__s1, const char *__s2); #else #include #include #include #include #endif struct ipmi_intf; struct valstr { uint16_t val; const char * str; }; struct oemvalstr { uint16_t oem; uint16_t val; const char * str; }; const char * val2str(uint16_t val, const struct valstr * vs); const char * oemval2str(uint16_t oem,uint16_t val, const struct oemvalstr * vs); uint16_t str2val(const char * str, const struct valstr * vs); void print_valstr(const struct valstr * vs, const char * title, int loglevel); void print_valstr_2col(const struct valstr * vs, const char * title, int loglevel); uint16_t buf2short(uint8_t * buf); uint32_t buf2long(uint8_t * buf); const char * buf2str(uint8_t * buf, int len); void printbuf(const uint8_t * buf, int len, const char * desc); uint8_t ipmi_csum(uint8_t * d, int s); FILE * ipmi_open_file(const char * file, int rw); void ipmi_start_daemon(struct ipmi_intf *intf); #define ipmi_open_file_read(file) ipmi_open_file(file, 0) #define ipmi_open_file_write(file) ipmi_open_file(file, 1) #ifndef WIN32 #ifndef __min # define __min(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef __max # define __max(a, b) ((a) > (b) ? (a) : (b)) #endif #endif #ifndef __minlen # define __minlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x < y) ? x : y;}) #endif #ifndef __maxlen # define __maxlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x > y) ? x : y;}) #endif #endif /* IPMI_HELPER_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_constants.h0000644000076400007640000001250713160502144023126 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_CONSTANTS_H #define IPMI_CONSTANTS_H /* * COMMANDS */ #define IPMI_GET_SDR_REPOSITORY_INFO 0x20 #define IMPI_SOL_ACTIVATING 0x20 #define IMPI_SET_SOL_CONFIG_PARAMETERS 0x21 #define IMPI_GET_SOL_CONFIG_PARAMETERS 0x22 #define IPMI_SET_USER_ACCESS 0x43 #define IPMI_GET_USER_ACCESS 0x44 #define IPMI_SET_USER_NAME 0x45 #define IPMI_GET_USER_NAME 0x46 #define IPMI_SET_USER_PASSWORD 0x47 #define IPMI_ACTIVATE_PAYLOAD 0x48 #define IPMI_DEACTIVATE_PAYLOAD 0x49 #define IPMI_SUSPEND_RESUME_PAYLOAD_ENCRYPTYION 0x55 #define IPMI_GET_SEL_TIME 0x48 #define IPMI_SET_SEL_TIME 0x49 #define IPMI_SET_USER_PAYLOAD_ACCESS 0x4c #define IPMI_GET_USER_PAYLOAD_ACCESS 0x4d #define IPMI_1_5_AUTH_TYPE_BIT_NONE 0x01 #define IPMI_1_5_AUTH_TYPE_BIT_MD2 0x02 #define IPMI_1_5_AUTH_TYPE_BIT_MD5 0x04 #define IPMI_1_5_AUTH_TYPE_BIT_PASSWORD 0x10 #define IPMI_1_5_AUTH_TYPE_BIT_OEM 0x20 #define IPMI_SESSION_AUTHTYPE_NONE 0x0 #define IPMI_SESSION_AUTHTYPE_MD2 0x1 #define IPMI_SESSION_AUTHTYPE_MD5 0x2 #define IPMI_SESSION_AUTHTYPE_KEY 0x4 #define IPMI_SESSION_AUTHTYPE_PASSWORD IPMI_SESSION_AUTHTYPE_KEY #define IPMI_SESSION_AUTHTYPE_OEM 0x5 #define IPMI_SESSION_AUTHTYPE_RMCP_PLUS 0x6 #define IPMI_SESSION_PRIV_UNSPECIFIED 0x0 #define IPMI_SESSION_PRIV_CALLBACK 0x1 #define IPMI_SESSION_PRIV_USER 0x2 #define IPMI_SESSION_PRIV_OPERATOR 0x3 #define IPMI_SESSION_PRIV_ADMIN 0x4 #define IPMI_SESSION_PRIV_OEM 0x5 #define IPMI_SET_IN_PROGRESS_SET_COMPLETE 0x00 #define IPMI_SET_IN_PROGRESS_IN_PROGRESS 0x01 #define IPMI_SET_IN_PROGRESS_COMMIT_WRITE 0x02 #define IPMI_CHANNEL_MEDIUM_RESERVED 0x0 #define IPMI_CHANNEL_MEDIUM_IPMB_I2C 0x1 #define IPMI_CHANNEL_MEDIUM_ICMB_1 0x2 #define IPMI_CHANNEL_MEDIUM_ICMB_09 0x3 #define IPMI_CHANNEL_MEDIUM_LAN 0x4 #define IPMI_CHANNEL_MEDIUM_SERIAL 0x5 #define IPMI_CHANNEL_MEDIUM_LAN_OTHER 0x6 #define IPMI_CHANNEL_MEDIUM_SMBUS_PCI 0x7 #define IPMI_CHANNEL_MEDIUM_SMBUS_1 0x8 #define IPMI_CHANNEL_MEDIUM_SMBUS_2 0x9 #define IPMI_CHANNEL_MEDIUM_USB_1 0xa #define IPMI_CHANNEL_MEDIUM_USB_2 0xb #define IPMI_CHANNEL_MEDIUM_SYSTEM 0xc #define IPMI_CHASSIS_CTL_POWER_DOWN 0x0 #define IPMI_CHASSIS_CTL_POWER_UP 0x1 #define IPMI_CHASSIS_CTL_POWER_CYCLE 0x2 #define IPMI_CHASSIS_CTL_HARD_RESET 0x3 #define IPMI_CHASSIS_CTL_PULSE_DIAG 0x4 #define IPMI_CHASSIS_CTL_ACPI_SOFT 0x5 #define IPMI_CHASSIS_POLICY_NO_CHANGE 0x3 #define IPMI_CHASSIS_POLICY_ALWAYS_ON 0x2 #define IPMI_CHASSIS_POLICY_PREVIOUS 0x1 #define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0 #define IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS 0 #define IPMI_CHASSIS_BOOTPARAM_SVCPART_SELECT 1 #define IPMI_CHASSIS_BOOTPARAM_SVCPART_SCAN 2 #define IPMI_CHASSIS_BOOTPARAM_FLAG_VALID 3 #define IPMI_CHASSIS_BOOTPARAM_INFO_ACK 4 #define IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS 5 #define IPMI_CHASSIS_BOOTPARAM_INIT_INFO 6 #define IPMI_CHASSIS_BOOTPARAM_INIT_MBOX 7 /* From table 13-17 of the IPMI v2 specification */ #define IPMI_AUTH_RAKP_NONE 0x00 #define IPMI_AUTH_RAKP_HMAC_SHA1 0x01 #define IPMI_AUTH_RAKP_HMAC_MD5 0x02 #define IPMI_AUTH_RAKP_HMAC_SHA256 0x03 /* From table 13-18 of the IPMI v2 specification */ #define IPMI_INTEGRITY_NONE 0x00 #define IPMI_INTEGRITY_HMAC_SHA1_96 0x01 #define IPMI_INTEGRITY_HMAC_MD5_128 0x02 #define IPMI_INTEGRITY_MD5_128 0x03 #define IPMI_INTEGRITY_HMAC_SHA256_128 0x04 /* From table 13-19 of the IPMI v2 specfication */ #define IPMI_CRYPT_NONE 0x00 #define IPMI_CRYPT_AES_CBC_128 0x01 #define IPMI_CRYPT_XRC4_128 0x02 #define IPMI_CRYPT_XRC4_40 0x03 #endif /*IPMI_CONSTANTS_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_session.h0000644000076400007640000000702613160502144022575 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_SESSION_H #define IPMI_SESSION_H #if HAVE_CONFIG_H # include #endif #include #define IPMI_GET_SESSION_INFO 0x3D /* * From table 22.25 of the IPMIv2 specification */ struct get_session_info_rsp { uint8_t session_handle; #if WORDS_BIGENDIAN uint8_t __reserved1 : 2; uint8_t session_slot_count : 6; /* 1-based */ #else uint8_t session_slot_count : 6; /* 1-based */ uint8_t __reserved1 : 2; #endif #if WORDS_BIGENDIAN uint8_t __reserved2 : 2; uint8_t active_session_count : 6; /* 1-based */ #else uint8_t active_session_count : 6; /* 1-based */ uint8_t __reserved2 : 2; #endif #if WORDS_BIGENDIAN uint8_t __reserved3 : 2; uint8_t user_id : 6; #else uint8_t user_id : 6; uint8_t __reserved3 : 2; #endif #if WORDS_BIGENDIAN uint8_t __reserved4 : 4; uint8_t privilege_level : 4; #else uint8_t privilege_level : 4; uint8_t __reserved4 : 4; #endif #if WORDS_BIGENDIAN uint8_t auxiliary_data : 4; uint8_t channel_number : 4; #else uint8_t channel_number : 4; uint8_t auxiliary_data : 4; #endif union { /* Only exists if channel type is 802.3 LAN */ struct { uint8_t console_ip[4]; /* MSBF */ uint8_t console_mac[6]; /* MSBF */ uint16_t console_port; /* LSBF */ } lan_data; /* Only exists if channel type is async. serial modem */ struct { uint8_t session_channel_activity_type; #if WORDS_BIGENDIAN uint8_t __reserved5 : 4; uint8_t destination_selector : 4; #else uint8_t destination_selector : 4; uint8_t __reserved5 : 4; #endif uint8_t console_ip[4]; /* MSBF */ /* Only exists if session is PPP */ uint16_t console_port; /* LSBF */ } modem_data; } channel_data; } __attribute__ ((packed)); int ipmi_session_main(struct ipmi_intf *, int, char **); #endif /*IPMI_CHANNEL_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_kontronoem.h0000644000076400007640000000371713160502144023310 0ustar acressloggers/* * Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved. * * Base on code from * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_KONTRONOEM_H #define IPMI_KONTRONOEM_H #ifdef WIN32 #include #else #include #endif #include int ipmi_kontronoem_main(struct ipmi_intf *, int, char **); #endif /* IPMI_KONTRONOEM_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi.h0000644000076400007640000001556013160502144021034 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_H #define IPMI_H #ifdef WIN32 #include #include #include #include #else #include #include #include #include #include #include #include #endif #include #define IPMI_BUF_SIZE 1024 /* From table 13.16 of the IPMI v2 specification */ #define IPMI_PAYLOAD_TYPE_IPMI 0x00 #define IPMI_PAYLOAD_TYPE_SOL 0x01 #define IPMI_PAYLOAD_TYPE_OEM 0x02 #define IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST 0x10 #define IPMI_PAYLOAD_TYPE_RMCP_OPEN_RESPONSE 0x11 #define IPMI_PAYLOAD_TYPE_RAKP_1 0x12 #define IPMI_PAYLOAD_TYPE_RAKP_2 0x13 #define IPMI_PAYLOAD_TYPE_RAKP_3 0x14 #define IPMI_PAYLOAD_TYPE_RAKP_4 0x15 extern int verbose; extern int csv_output; #ifndef _IPMI_RQ_ #define _IPMI_RQ_ struct ipmi_rq { struct { uint8_t netfn:6; uint8_t lun:2; uint8_t cmd; uint8_t target_cmd; uint16_t data_len; uint8_t *data; } msg; }; #endif /* * This is what the sendrcv_v2() function would take as an argument. The common case * is for payload_type to be IPMI_PAYLOAD_TYPE_IPMI. */ struct ipmi_v2_payload { uint16_t payload_length; uint8_t payload_type; union { struct { uint8_t rq_seq; struct ipmi_rq *request; } ipmi_request; struct { uint8_t rs_seq; struct ipmi_rs *response; } ipmi_response; /* Only used internally by the lanplus interface */ struct { uint8_t *request; } open_session_request; /* Only used internally by the lanplus interface */ struct { uint8_t *message; } rakp_1_message; /* Only used internally by the lanplus interface */ struct { uint8_t *message; } rakp_2_message; /* Only used internally by the lanplus interface */ struct { uint8_t *message; } rakp_3_message; /* Only used internally by the lanplus interface */ struct { uint8_t *message; } rakp_4_message; struct { uint8_t data[IPMI_BUF_SIZE]; uint16_t character_count; uint8_t packet_sequence_number; uint8_t acked_packet_number; uint8_t accepted_character_count; uint8_t is_nack; /* bool */ uint8_t assert_ring_wor; /* bool */ uint8_t generate_break; /* bool */ uint8_t deassert_cts; /* bool */ uint8_t deassert_dcd_dsr; /* bool */ uint8_t flush_inbound; /* bool */ uint8_t flush_outbound; /* bool */ } sol_packet; } payload; }; struct ipmi_rq_entry { struct ipmi_rq req; struct ipmi_intf *intf; uint8_t rq_seq; uint8_t *msg_data; int msg_len; struct ipmi_rq_entry *next; }; struct ipmi_rs { uint8_t ccode; uint8_t data[IPMI_BUF_SIZE]; /* * Looks like this is the length of the entire packet, including the RMCP * stuff, then modified to be the length of the extra IPMI message data */ int data_len; struct { uint8_t netfn; uint8_t cmd; uint8_t seq; uint8_t lun; } msg; struct { uint8_t authtype; uint32_t seq; uint32_t id; uint8_t bEncrypted; /* IPMI v2 only */ uint8_t bAuthenticated; /* IPMI v2 only */ uint8_t payloadtype; /* IPMI v2 only */ /* This is the total length of the payload or IPMI message. IPMI v2.0 requires this to be 2 bytes. Not really used for much. */ uint16_t msglen; } session; /* * A union of the different possible payload meta-data */ union { struct { uint8_t rq_addr; uint8_t netfn; uint8_t rq_lun; uint8_t rs_addr; uint8_t rq_seq; uint8_t rs_lun; uint8_t cmd; } ipmi_response; struct { uint8_t message_tag; uint8_t rakp_return_code; uint8_t max_priv_level; uint32_t console_id; uint32_t bmc_id; uint8_t auth_alg; uint8_t integrity_alg; uint8_t crypt_alg; } open_session_response; struct { uint8_t message_tag; uint8_t rakp_return_code; uint32_t console_id; uint8_t bmc_rand[16]; /* Random number generated by the BMC */ uint8_t bmc_guid[16]; uint8_t key_exchange_auth_code[EVP_MAX_MD_SIZE]; } rakp2_message; struct { uint8_t message_tag; uint8_t rakp_return_code; uint32_t console_id; uint8_t integrity_check_value[EVP_MAX_MD_SIZE]; } rakp4_message; struct { uint8_t packet_sequence_number; uint8_t acked_packet_number; uint8_t accepted_character_count; uint8_t is_nack; /* bool */ uint8_t transfer_unavailable; /* bool */ uint8_t sol_inactive; /* bool */ uint8_t transmit_overrun; /* bool */ uint8_t break_detected; /* bool */ } sol_packet; } payload; }; #define IPMI_NETFN_CHASSIS 0x0 #define IPMI_NETFN_BRIDGE 0x2 #define IPMI_NETFN_SE 0x4 #define IPMI_NETFN_APP 0x6 #define IPMI_NETFN_FIRMWARE 0x8 #define IPMI_NETFN_STORAGE 0xa #define IPMI_NETFN_TRANSPORT 0xc #define IPMI_NETFN_PICMG 0x2C #define IPMI_NETFN_ISOL 0x34 #define IPMI_NETFN_TSOL 0x30 #define IPMI_BMC_SLAVE_ADDR 0x20 #define IPMI_REMOTE_SWID 0x81 /* These values are IANA numbers */ typedef enum IPMI_OEM { IPMI_OEM_UNKNOWN = 0, IPMI_OEM_SUN = 42, IPMI_OEM_NOKIA = 94, IPMI_OEM_INTEL = 343, IPMI_OEM_TYAN = 6653, IPMI_OEM_NEWISYS = 9237, IPMI_OEM_SUPERMICRO = 10876, IPMI_OEM_GOOGLE = 11129, IPMI_OEM_PICMG = 12634, IPMI_OEM_KONTRON = 15000, } IPMI_OEM; extern const struct valstr completion_code_vals[]; #endif /* IPMI_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_sensor.h0000644000076400007640000000666213160502144022430 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_SENSOR_H #define IPMI_SENSOR_H #include #include #include #include /* threshold specification bits for analog sensors for get sensor threshold command * and set sensor threshold command */ #define UPPER_NON_RECOV_SPECIFIED 0x20 #define UPPER_CRIT_SPECIFIED 0x10 #define UPPER_NON_CRIT_SPECIFIED 0x08 #define LOWER_NON_RECOV_SPECIFIED 0x04 #define LOWER_CRIT_SPECIFIED 0x02 #define LOWER_NON_CRIT_SPECIFIED 0x01 /* state assertion bits for discrete sensors for get sensor reading command */ #define STATE_0_ASSERTED 0x01 #define STATE_1_ASSERTED 0x02 #define STATE_2_ASSERTED 0x04 #define STATE_3_ASSERTED 0x08 #define STATE_4_ASSERTED 0x10 #define STATE_5_ASSERTED 0x20 #define STATE_6_ASSERTED 0x40 #define STATE_7_ASSERTED 0x80 #define STATE_8_ASSERTED 0x01 #define STATE_9_ASSERTED 0x02 #define STATE_10_ASSERTED 0x04 #define STATE_11_ASSERTED 0x08 #define STATE_12_ASSERTED 0x10 #define STATE_13_ASSERTED 0x20 #define STATE_14_ASSERTED 0x40 struct sensor_set_thresh_rq { uint8_t sensor_num; /* sensor # */ uint8_t set_mask; /* threshold setting mask */ uint8_t lower_non_crit; /* new lower non critical threshold*/ uint8_t lower_crit; /* new lower critical threshold*/ uint8_t lower_non_recov; /* new lower non recoverable threshold*/ uint8_t upper_non_crit; /* new upper non critical threshold*/ uint8_t upper_crit; /* new upper critical threshold*/ uint8_t upper_non_recov; /* new upper non recoverable threshold*/ } __attribute__ ((packed)); int ipmi_sensor_main(struct ipmi_intf *, int, char **); int ipmi_sensor_print_full(struct ipmi_intf *, struct sdr_record_full_sensor *); int ipmi_sensor_print_compact(struct ipmi_intf *, struct sdr_record_compact_sensor *); #endif /* IPMI_SENSOR_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_intf.h0000644000076400007640000001552513160502144022055 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_INTF_H #define IPMI_INTF_H #include #include #include #ifdef WIN32 #include #include #include #else #include #include #include #include #endif #include #include #ifdef MOVED // moved this to "lanplus_defs.h" /* * An enumeration that describes every possible session state for * an IPMIv2 / RMCP+ session. */ enum LANPLUS_SESSION_STATE { LANPLUS_STATE_PRESESSION = 0, LANPLUS_STATE_OPEN_SESSION_SENT, LANPLUS_STATE_OPEN_SESSION_RECEIEVED, LANPLUS_STATE_RAKP_1_SENT, LANPLUS_STATE_RAKP_2_RECEIVED, LANPLUS_STATE_RAKP_3_SENT, LANPLUS_STATE_ACTIVE, LANPLUS_STATE_CLOSE_SENT, }; #define IPMI_AUTHCODE_BUFFER_SIZE 20 // KG or KUID #define IPMI_SIK_BUFFER_SIZE EVP_MAX_MD_SIZE #define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */ struct ipmi_session { uint8_t hostname[64]; uint8_t username[17]; uint8_t authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1]; uint8_t challenge[16]; uint8_t authtype; uint8_t authtype_set; #define IPMI_AUTHSTATUS_PER_MSG_DISABLED 0x10 #define IPMI_AUTHSTATUS_PER_USER_DISABLED 0x08 #define IPMI_AUTHSTATUS_NONNULL_USERS_ENABLED 0x04 #define IPMI_AUTHSTATUS_NULL_USERS_ENABLED 0x02 #define IPMI_AUTHSTATUS_ANONYMOUS_USERS_ENABLED 0x01 uint8_t authstatus; uint8_t authextra; uint8_t privlvl; uint8_t cipher_suite_id; char sol_escape_char; int password; int port; int active; int retry; uint32_t session_id; uint32_t in_seq; uint32_t out_seq; uint32_t timeout; struct sockaddr_in addr; /*old*/ socklen_t addrlen; /* * This struct holds state data specific to IPMI v2 / RMCP+ sessions */ struct { enum LANPLUS_SESSION_STATE session_state; /* These are the algorithms agreed upon for the session */ uint8_t requested_auth_alg; uint8_t requested_integrity_alg; uint8_t requested_crypt_alg; uint8_t auth_alg; uint8_t integrity_alg; uint8_t crypt_alg; uint8_t max_priv_level; uint8_t lookupbit; uint32_t console_id; uint32_t bmc_id; /* * Values required for RAKP mesages */ /* Random number generated byt the console */ uint8_t console_rand[16]; /* Random number generated by the BMC */ uint8_t bmc_rand[16]; uint8_t bmc_guid[16]; uint8_t requested_role; /* As sent in the RAKP 1 message */ uint8_t rakp2_return_code; uint8_t sik[EVP_MAX_MD_SIZE]; /* Session integrity key */ uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */ uint8_t k1[EVP_MAX_MD_SIZE]; /* Used for Integrity checking? */ uint8_t k2[EVP_MAX_MD_SIZE]; /* First 16 bytes used for AES */ uint8_t sik_len; /* length of sik */ uint8_t k1_len; /* length of k1 */ uint8_t k2_len; /* length of k2 */ } v2_data; /* * This data is specific to the Serial Over Lan session */ struct { uint16_t max_inbound_payload_size; uint16_t max_outbound_payload_size; uint16_t port; uint8_t sequence_number; /* This data describes the last SOL packet */ uint8_t last_received_sequence_number; uint8_t last_received_byte_count; void (*sol_input_handler)(struct ipmi_rs * rsp); } sol_data; }; struct ipmi_cmd { int (*func)(struct ipmi_intf * intf, int argc, char ** argv); const char * name; const char * desc; }; struct ipmi_intf_support { const char * name; int supported; }; struct ipmi_intf { char name[16]; char desc[128]; int fd; int opened; int abort; int noanswer; struct ipmi_session * session; struct ipmi_oem_handle * oem; struct ipmi_cmd * cmdlist; uint32_t my_addr; uint32_t target_addr; uint8_t target_lun; uint8_t target_channel; uint32_t transit_addr; uint8_t transit_channel; uint8_t devnum; int (*setup)(struct ipmi_intf * intf); int (*open)(struct ipmi_intf * intf); void (*close)(struct ipmi_intf * intf); struct ipmi_rs *(*sendrecv)(struct ipmi_intf * intf, struct ipmi_rq * req); int (*sendrsp)(struct ipmi_intf * intf, struct ipmi_rs * rsp); struct ipmi_rs *(*recv_sol)(struct ipmi_intf * intf); struct ipmi_rs *(*send_sol)(struct ipmi_intf * intf, struct ipmi_v2_payload * payload); int (*keepalive)(struct ipmi_intf * intf); }; #else #include "lanplus_defs.h" #endif struct ipmi_intf * ipmi_intf_load(char * name); void ipmi_intf_print(struct ipmi_intf_support * intflist); void ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname); void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username); void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password); void ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, uint8_t privlvl); void ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit); void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id); void ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char); void ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey); void ipmi_intf_session_set_port(struct ipmi_intf * intf, int port); void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, uint8_t authtype); void ipmi_intf_session_set_timeout(struct ipmi_intf * intf, uint32_t timeout); void ipmi_intf_session_set_retry(struct ipmi_intf * intf, int retry); void ipmi_cleanup(struct ipmi_intf * intf); #endif /* IPMI_INTF_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_sel.h0000644000076400007640000011241613160502144021675 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_SEL_H #define IPMI_SEL_H #ifdef WIN32 #include #else #include #endif #include #include #define IPMI_CMD_GET_SEL_INFO 0x40 #define IPMI_CMD_GET_SEL_ALLOC_INFO 0x41 #define IPMI_CMD_RESERVE_SEL 0x42 #define IPMI_CMD_GET_SEL_ENTRY 0x43 #define IPMI_CMD_ADD_SEL_ENTRY 0x44 #define IPMI_CMD_PARTIAL_ADD_SEL_ENTRY 0x45 #define IPMI_CMD_DELETE_SEL_ENTRY 0x46 #define IPMI_CMD_CLEAR_SEL 0x47 #define IPMI_CMD_GET_SEL_TIME 0x48 #define IPMI_CMD_SET_SEL_TIME 0x49 #define IPMI_CMD_GET_AUX_LOG_STATUS 0x5A #define IPMI_CMD_SET_AUX_LOG_STATUS 0x5B enum { IPMI_EVENT_CLASS_DISCRETE, IPMI_EVENT_CLASS_DIGITAL, IPMI_EVENT_CLASS_THRESHOLD, IPMI_EVENT_CLASS_OEM, }; struct sel_get_rq { uint16_t reserve_id; uint16_t record_id; uint8_t offset; uint8_t length; } __attribute__ ((packed)); struct standard_spec_sel_rec{ uint32_t timestamp; uint16_t gen_id; uint8_t evm_rev; uint8_t sensor_type; uint8_t sensor_num; #if WORDS_BIGENDIAN uint8_t event_dir : 1; uint8_t event_type : 7; #else uint8_t event_type : 7; uint8_t event_dir : 1; #endif #define DATA_BYTE2_SPECIFIED_MASK 0xc0 /* event_data[0] bit mask */ #define DATA_BYTE3_SPECIFIED_MASK 0x30 /* event_data[0] bit mask */ #define EVENT_OFFSET_MASK 0x0f /* event_data[0] bit mask */ uint8_t event_data[3]; }; #define SEL_OEM_TS_DATA_LEN 6 #define SEL_OEM_NOTS_DATA_LEN 13 struct oem_ts_spec_sel_rec{ uint32_t timestamp; uint8_t manf_id[3]; uint8_t oem_defined[SEL_OEM_TS_DATA_LEN]; }; struct oem_nots_spec_sel_rec{ uint8_t oem_defined[SEL_OEM_NOTS_DATA_LEN]; }; struct sel_event_record { uint16_t record_id; uint8_t record_type; union{ struct standard_spec_sel_rec standard_type; struct oem_ts_spec_sel_rec oem_ts_type; struct oem_nots_spec_sel_rec oem_nots_type; } sel_type; } __attribute__ ((packed)); struct ipmi_event_sensor_types { uint8_t code; uint8_t offset; #define ALL_OFFSETS_SPECIFIED 0xff uint8_t data; uint8_t class; const char * type; const char * desc; }; static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unused)) = { /* Threshold Based States */ { 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going low " }, { 0x01, 0x01, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going high" }, { 0x01, 0x02, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going low " }, { 0x01, 0x03, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going high" }, { 0x01, 0x04, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going low " }, { 0x01, 0x05, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going high" }, { 0x01, 0x06, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going low " }, { 0x01, 0x07, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going high" }, { 0x01, 0x08, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going low " }, { 0x01, 0x09, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going high" }, { 0x01, 0x0a, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going low " }, { 0x01, 0x0b, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going high" }, /* DMI-based "usage state" States */ { 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Idle" }, { 0x02, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Active" }, { 0x02, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Busy" }, /* Digital-Discrete Event States */ { 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Deasserted" }, { 0x03, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Asserted" }, { 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Deasserted" }, { 0x04, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Asserted" }, { 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Not Exceeded" }, { 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Exceeded" }, { 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Met" }, { 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Lags" }, /* Severity Event States */ { 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to OK" }, { 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from OK" }, { 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from less severe" }, { 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable from less severe" }, { 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from more severe" }, { 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from Non-recoverable" }, { 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable" }, { 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Monitor" }, { 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Informational" }, /* Availability Status States */ { 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Absent" }, { 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Present" }, { 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Disabled" }, { 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Enabled" }, { 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Running" }, { 0x0a, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to In Test" }, { 0x0a, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Off" }, { 0x0a, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to On Line" }, { 0x0a, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Line" }, { 0x0a, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Duty" }, { 0x0a, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Degraded" }, { 0x0a, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Save" }, { 0x0a, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Install Error" }, /* Redundancy States */ { 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Fully Redundant" }, { 0x0b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Lost" }, { 0x0b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded" }, { 0x0b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Redundant" }, { 0x0b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Insufficient" }, { 0x0b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Insufficient Resources" }, { 0x0b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Fully Redundant" }, { 0x0b, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Non-Redundant" }, /* ACPI Device Power States */ { 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D0 Power State" }, { 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D1 Power State" }, { 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D2 Power State" }, { 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D3 Power State" }, /* END */ { 0x00, 0x00, 0xff, 0x00, NULL, NULL }, }; static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unused)) = { { 0x00, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Reserved", NULL }, { 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Temperature", NULL }, { 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Voltage", NULL }, { 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Current", NULL }, { 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Fan", NULL }, { 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "General Chassis intrusion" }, { 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Drive Bay intrusion" }, { 0x05, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "I/O Card area intrusion" }, { 0x05, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Processor area intrusion" }, { 0x05, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "System unplugged from LAN" }, { 0x05, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Unauthorized dock" }, { 0x05, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "FAN area intrusion" }, { 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Front Panel Lockout violation attempted" }, { 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - user password" }, { 0x06, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - setup password" }, { 0x06, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - network boot password" }, { 0x06, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Other pre-boot password violation" }, { 0x06, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Out-of-band access password violation" }, { 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "IERR" }, { 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Thermal Trip" }, { 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB1/BIST failure" }, { 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB2/Hang in POST failure" }, { 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB3/Processor startup/init failure" }, { 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Configuration Error" }, { 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "SM BIOS Uncorrectable CPU-complex Error" }, { 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Presence detected" }, { 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Disabled" }, { 0x07, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Terminator presence detected" }, { 0x07, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Throttled" }, { 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Presence detected" }, { 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Failure detected" }, { 0x08, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Predictive failure" }, { 0x08, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Power Supply AC lost" }, { 0x08, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC lost or out-of-range" }, { 0x08, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC out-of-range, but present" }, { 0x08, 0x06, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Vendor Mismatch" }, { 0x08, 0x06, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Revision Mismatch" }, { 0x08, 0x06, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Processor Missing" }, { 0x08, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error" }, { 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power off/down" }, { 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power cycle" }, { 0x09, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "240VA power down" }, { 0x09, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Interlock power down" }, { 0x09, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "AC lost" }, { 0x09, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Soft-power control failure" }, { 0x09, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Failure detected" }, { 0x09, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Predictive failure" }, { 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cooling Device", NULL }, { 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other Units-based Sensor", NULL }, { 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC" }, { 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Uncorrectable ECC" }, { 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Parity" }, { 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Scrub Failed" }, { 0x0c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Device Disabled" }, { 0x0c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC logging limit reached" }, { 0x0c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Presence Detected" }, { 0x0c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Configuration Error" }, { 0x0c, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Spare" }, { 0x0c, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Throttled" }, { 0x0d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Present" }, { 0x0d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Fault" }, { 0x0d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Predictive Failure" }, { 0x0d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Hot Spare" }, { 0x0d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Parity Check In Progress" }, { 0x0d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Critical Array" }, { 0x0d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Failed Array" }, { 0x0d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild In Progress" }, { 0x0d, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild Aborted" }, { 0x0e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "POST Memory Resize", NULL }, { 0x0f, 0x00, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unspecified" }, { 0x0f, 0x00, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No system memory installed" }, { 0x0f, 0x00, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No usable system memory" }, { 0x0f, 0x00, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable IDE device failure" }, { 0x0f, 0x00, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable system-board failure" }, { 0x0f, 0x00, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable diskette failure" }, { 0x0f, 0x00, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable hard-disk controller failure" }, { 0x0f, 0x00, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable PS/2 or USB keyboard failure" }, { 0x0f, 0x00, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Removable boot media not found" }, { 0x0f, 0x00, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable video controller failure" }, { 0x0f, 0x00, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No video device selected" }, { 0x0f, 0x00, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "BIOS corruption detected" }, { 0x0f, 0x00, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU voltage mismatch" }, { 0x0f, 0x00, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU speed mismatch failure" }, { 0x0f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unknown Error" }, { 0x0f, 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unspecified" }, { 0x0f, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Memory initialization" }, { 0x0f, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Hard-disk initialization" }, { 0x0f, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Secondary CPU Initialization" }, { 0x0f, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User authentication" }, { 0x0f, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User-initiated system setup" }, { 0x0f, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "USB resource configuration" }, { 0x0f, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "PCI resource configuration" }, { 0x0f, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Option ROM initialization" }, { 0x0f, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Video initialization" }, { 0x0f, 0x01, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Cache initialization" }, { 0x0f, 0x01, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "SMBus initialization" }, { 0x0f, 0x01, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard controller initialization" }, { 0x0f, 0x01, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Management controller initialization" }, { 0x0f, 0x01, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station attachment" }, { 0x0f, 0x01, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Enabling docking station" }, { 0x0f, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station ejection" }, { 0x0f, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Disabling docking station" }, { 0x0f, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Calling operating system wake-up vector" }, { 0x0f, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "System boot initiated" }, { 0x0f, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Motherboard initialization" }, { 0x0f, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "reserved" }, { 0x0f, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Floppy initialization" }, { 0x0f, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard test" }, { 0x0f, 0x01, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Pointing device test" }, { 0x0f, 0x01, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Primary CPU initialization" }, { 0x0f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unknown Hang" }, { 0x0f, 0x02, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unspecified" }, { 0x0f, 0x02, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Memory initialization" }, { 0x0f, 0x02, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Hard-disk initialization" }, { 0x0f, 0x02, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Secondary CPU Initialization" }, { 0x0f, 0x02, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User authentication" }, { 0x0f, 0x02, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User-initiated system setup" }, { 0x0f, 0x02, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "USB resource configuration" }, { 0x0f, 0x02, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "PCI resource configuration" }, { 0x0f, 0x02, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Option ROM initialization" }, { 0x0f, 0x02, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Video initialization" }, { 0x0f, 0x02, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Cache initialization" }, { 0x0f, 0x02, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "SMBus initialization" }, { 0x0f, 0x02, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard controller initialization" }, { 0x0f, 0x02, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Management controller initialization" }, { 0x0f, 0x02, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station attachment" }, { 0x0f, 0x02, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Enabling docking station" }, { 0x0f, 0x02, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station ejection" }, { 0x0f, 0x02, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Disabling docking station" }, { 0x0f, 0x02, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Calling operating system wake-up vector" }, { 0x0f, 0x02, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "System boot initiated" }, { 0x0f, 0x02, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Motherboard initialization" }, { 0x0f, 0x02, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "reserved" }, { 0x0f, 0x02, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Floppy initialization" }, { 0x0f, 0x02, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard test" }, { 0x0f, 0x02, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Pointing device test" }, { 0x0f, 0x02, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Primary CPU initialization" }, { 0x0f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unknown Progress" }, { 0x10, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Correctable memory error logging disabled" }, { 0x10, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Event logging disabled" }, { 0x10, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log area reset/cleared" }, { 0x10, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "All event logging disabled" }, { 0x10, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log full" }, { 0x10, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log almost full" }, { 0x11, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "BIOS Reset" }, { 0x11, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Reset" }, { 0x11, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Shut Down" }, { 0x11, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Down" }, { 0x11, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Cycle" }, { 0x11, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS NMI/Diag Interrupt" }, { 0x11, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Expired" }, { 0x11, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS pre-timeout Interrupt" }, { 0x12, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "System Reconfigured" }, { 0x12, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "OEM System boot event" }, { 0x12, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Undetermined system hardware failure" }, { 0x12, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Entry added to auxiliary log" }, { 0x12, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "PEF Action" }, { 0x12, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Timestamp Clock Sync" }, { 0x13, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "NMI/Diag Interrupt" }, { 0x13, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Timeout" }, { 0x13, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "I/O Channel check NMI" }, { 0x13, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Software NMI" }, { 0x13, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI PERR" }, { 0x13, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI SERR" }, { 0x13, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "EISA failsafe timeout" }, { 0x13, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Correctable error" }, { 0x13, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Uncorrectable error" }, { 0x13, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Fatal NMI" }, { 0x13, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Fatal Error" }, { 0x14, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Power Button pressed" }, { 0x14, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Sleep Button pressed" }, { 0x14, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Reset Button pressed" }, { 0x14, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Latch" }, { 0x14, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Service" }, { 0x15, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module/Board", NULL }, { 0x16, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Microcontroller/Coprocessor", NULL }, { 0x17, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Add-in Card", NULL }, { 0x18, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chassis", NULL }, { 0x19, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chip Set", NULL }, { 0x1a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other FRU", NULL }, { 0x1b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Connected" }, { 0x1b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Config Error" }, { 0x1c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Terminator", NULL }, { 0x1d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by power up" }, { 0x1d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by hard reset" }, { 0x1d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by warm reset" }, { 0x1d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "User requested PXE boot" }, { 0x1d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Automatic boot to diagnostic" }, { 0x1d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated hard reset" }, { 0x1d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated warm reset" }, { 0x1d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "System Restart" }, { 0x1e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "No bootable media" }, { 0x1e, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Non-bootable disk in drive" }, { 0x1e, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "PXE server not found" }, { 0x1e, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Invalid boot sector" }, { 0x1e, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Timeout waiting for selection" }, { 0x1f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "A: boot completed" }, { 0x1f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "C: boot completed" }, { 0x1f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "PXE boot completed" }, { 0x1f, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Diagnostic boot completed" }, { 0x1f, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "CD-ROM boot completed" }, { 0x1f, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "ROM boot completed" }, { 0x1f, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "boot completed - device not specified" }, { 0x20, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Error during system startup" }, { 0x20, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Run-time critical stop" }, { 0x20, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful stop" }, { 0x20, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful shutdown" }, { 0x20, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "PEF initiated soft shutdown" }, { 0x20, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Agent not responding" }, { 0x21, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Fault Status" }, { 0x21, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Identify Status" }, { 0x21, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Installed" }, { 0x21, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Installation" }, { 0x21, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Removal" }, { 0x21, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot Power is Off" }, { 0x21, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Removal Request" }, { 0x21, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Interlock" }, { 0x21, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot is Disabled" }, { 0x21, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Spare Device" }, { 0x22, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S0/G0: working" }, { 0x22, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S1: sleeping with system hw & processor context maintained" }, { 0x22, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S2: sleeping, processor context lost" }, { 0x22, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S3: sleeping, processor & hw context lost, memory retained" }, { 0x22, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4: non-volatile sleep/suspend-to-disk" }, { 0x22, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5/G2: soft-off" }, { 0x22, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4/S5: soft-off" }, { 0x22, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G3: mechanical off" }, { 0x22, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Sleeping in S1/S2/S3 state" }, { 0x22, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G1: sleeping" }, { 0x22, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5: entered by override" }, { 0x22, 0x0b, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy ON state" }, { 0x22, 0x0c, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy OFF state" }, { 0x22, 0x0e, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Unknown" }, { 0x23, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer expired" }, { 0x23, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Hard reset" }, { 0x23, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power down" }, { 0x23, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power cycle" }, { 0x23, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" }, { 0x23, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" }, { 0x23, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" }, { 0x23, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" }, { 0x23, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer interrupt" }, { 0x24, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated page" }, { 0x24, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated LAN alert" }, { 0x24, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform Event Trap generated" }, { 0x24, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated SNMP trap, OEM format" }, { 0x25, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Present" }, { 0x25, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Absent" }, { 0x25, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Disabled" }, { 0x26, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Monitor ASIC/IC", NULL }, { 0x27, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat Lost" }, { 0x27, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat" }, { 0x28, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor access degraded or unavailable" }, { 0x28, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Controller access degraded or unavailable" }, { 0x28, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller off-line" }, { 0x28, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller unavailable" }, { 0x28, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor failure" }, { 0x28, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "FRU failure" }, { 0x29, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Low" }, { 0x29, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Failed" }, { 0x29, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Presence Detected" }, { 0x2b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change detected" }, { 0x2b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected" }, { 0x2b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware incompatibility detected" }, { 0x2b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software incompatibility detected" }, { 0x2b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported hardware version" }, { 0x2b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported firmware or software version" }, { 0x2b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change success" }, { 0x2b, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success" }, { 0x2c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Not Installed" }, { 0x2c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Inactive" }, { 0x2c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation Requested" }, { 0x2c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation in Progress" }, { 0x2c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Active" }, { 0x2c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation Requested" }, { 0x2c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation in Progress" }, { 0x2c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Communication lost" }, { 0xF0, 0x00, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M0" }, { 0xF0, 0x01, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M1" }, { 0xF0, 0x02, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M2" }, { 0xF0, 0x03, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M3" }, { 0xF0, 0x04, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M4" }, { 0xF0, 0x05, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M5" }, { 0xF0, 0x06, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M6" }, { 0xF0, 0x06, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M7" }, { 0xF1, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B disabled" }, { 0xF1, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMB-B disabled" }, { 0xF1, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B enabled" }, { 0xF1, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMP-B enabled" }, { 0xF2, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Closed" }, { 0xF2, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Opened" }, { 0xF2, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Quiesced" }, { 0xC0, 0x00, 0xff, 0x00, "OEM", "OEM Specific" }, { 0x00, 0x00, 0x00, 0x00, NULL, NULL }, }; int ipmi_sel_main(struct ipmi_intf *, int, char **); void ipmi_sel_print_std_entry(struct ipmi_intf * intf, struct sel_event_record * evt); void ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt); void ipmi_sel_print_extended_entry(struct ipmi_intf * intf, struct sel_event_record * evt); void ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt); void ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc); const char * ipmi_sel_get_sensor_type(uint8_t code); const char * ipmi_sel_get_sensor_type_offset(uint8_t code, uint8_t offset); uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel_event_record * evt); char * get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec); IPMI_OEM ipmi_get_oem(struct ipmi_intf * intf); char * ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec); int ipmi_sel_oem_init(const char * filename); #endif /* IPMI_SEL_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_firewall.h0000644000076400007640000000714113160502144022715 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_FIREWALL_H #define IPMI_FIREWALL_H #include int ipmi_firewall_main(struct ipmi_intf *, int, char **); #define BMC_GET_NETFN_SUPPORT 0x09 #define BMC_GET_COMMAND_SUPPORT 0x0A #define BMC_GET_COMMAND_SUBFUNCTION_SUPPORT 0x0B #define BMC_GET_CONFIGURABLE_COMMANDS 0x0C #define BMC_GET_CONFIGURABLE_COMMAND_SUBFUNCTIONS 0x0D #define BMC_SET_COMMAND_ENABLES 0x60 #define BMC_GET_COMMAND_ENABLES 0x61 #define BMC_SET_COMMAND_SUBFUNCTION_ENABLES 0x62 #define BMC_GET_COMMAND_SUBFUNCTION_ENABLES 0x63 #define BMC_OEM_NETFN_IANA_SUPPORT 0x64 #define SET_COMMAND_ENABLE_BYTE (BMC_SET_COMMAND_ENABLES / 8) #define SET_COMMAND_ENABLE_BIT (BMC_SET_COMMAND_ENABLES % 8) #define MAX_LUN 4 #define MAX_NETFN 64 #define MAX_NETFN_PAIR (MAX_NETFN/2) #define MAX_COMMAND 256 #define MAX_SUBFN 32 #define MAX_COMMAND_BYTES (MAX_COMMAND>>3) #define MAX_SUBFN_BYTES (MAX_SUBFN>>3) // support is a bitfield with the following bits set... #define BIT_AVAILABLE 0x01 #define BIT_CONFIGURABLE 0x02 #define BIT_ENABLED 0x04 extern int verbose; struct command_support { unsigned char support; unsigned char version[3]; unsigned char subfn_support[MAX_SUBFN_BYTES]; unsigned char subfn_config[MAX_SUBFN_BYTES]; unsigned char subfn_enable[MAX_SUBFN_BYTES]; }; struct lun_netfn_support { unsigned char support; struct command_support command[MAX_COMMAND]; unsigned char command_mask[MAX_COMMAND_BYTES]; unsigned char config_mask[MAX_COMMAND_BYTES]; unsigned char enable_mask[MAX_COMMAND_BYTES]; }; struct lun_support { unsigned char support; struct lun_netfn_support netfn[MAX_NETFN_PAIR]; }; struct bmc_fn_support { struct lun_support lun[MAX_LUN]; }; struct ipmi_function_params { int channel; int lun; int netfn; int command; int subfn; unsigned char force; }; static inline int bit_test(const unsigned char * bf, int n) { return !!(bf[n>>3]&(1<<(n%8))); } static inline void bit_set(unsigned char * bf, int n, int v) { bf[n>>3] = (bf[n>>3] & ~(1<<(n%8))) | ((v?1:0)<<(n%8)); } #endif /*IPMI_FIREWALL_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_isol.h0000644000076400007640000000431213160502144022053 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_ISOL_H #define IPMI_ISOL_H #include #define ACTIVATE_ISOL 0x01 #define SET_ISOL_CONFIG 0x03 #define GET_ISOL_CONFIG 0x04 #define ISOL_ENABLE_PARAM 0x01 #define ISOL_AUTHENTICATION_PARAM 0x02 #define ISOL_ENABLE_FLAG 0x01 #define ISOL_PRIVILEGE_LEVEL_USER 0x02 #define ISOL_BAUD_RATE_PARAM 0x05 #define ISOL_BAUD_RATE_9600 0x06 #define ISOL_BAUD_RATE_19200 0x07 #define ISOL_BAUD_RATE_38400 0x08 #define ISOL_BAUD_RATE_57600 0x09 #define ISOL_BAUD_RATE_115200 0x0A #define ISOL_PREFERRED_BAUD_RATE 0x07 int ipmi_isol_main(struct ipmi_intf *, int, char **); #endif /* IPMI_SOL_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_fwum.h0000644000076400007640000000346513160502144022073 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_KFWUM_H #define IPMI_KFWUM_H #ifdef WIN32 #include #else #include #endif #include int ipmi_fwum_main(struct ipmi_intf *, int, char **); #endif /* IPMI_KFWUM_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_chassis.h0000644000076400007640000000453413160502144022550 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_CHASSIS_H #define IPMI_CHASSIS_H #include #define IPMI_CHASSIS_CTL_POWER_DOWN 0x0 #define IPMI_CHASSIS_CTL_POWER_UP 0x1 #define IPMI_CHASSIS_CTL_POWER_CYCLE 0x2 #define IPMI_CHASSIS_CTL_HARD_RESET 0x3 #define IPMI_CHASSIS_CTL_PULSE_DIAG 0x4 #define IPMI_CHASSIS_CTL_ACPI_SOFT 0x5 #define IPMI_CHASSIS_POLICY_NO_CHANGE 0x3 #define IPMI_CHASSIS_POLICY_ALWAYS_ON 0x2 #define IPMI_CHASSIS_POLICY_PREVIOUS 0x1 #define IPMI_CHASSIS_POLICY_ALWAYS_OFF 0x0 int ipmi_chassis_power_status(struct ipmi_intf * intf); int ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl); int ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv); int ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv); #endif /*IPMI_CHASSIS_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_entity.h0000644000076400007640000000372513160502144022430 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_ENTITY_H #define IPMI_ENTITY_H struct entity_id { uint8_t id; /* physical entity id */ #if WORDS_BIGENDIAN uint8_t logical : 1; /* physical/logical */ uint8_t instance : 7; /* instance number */ #else uint8_t instance : 7; /* instance number */ uint8_t logical : 1; /* physical/logical */ #endif } __attribute__ ((packed)); #endif /* IPMI_ENTITY_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_event.h0000644000076400007640000000414313160502144022230 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_EVENT_H #define IPMI_EVENT_H #if HAVE_CONFIG_H # include #endif #include #define EVENT_DIR_ASSERT 0 #define EVENT_DIR_DEASSERT 1 struct platform_event_msg { uint8_t evm_rev; uint8_t sensor_type; uint8_t sensor_num; #if WORDS_BIGENDIAN uint8_t event_dir : 1; uint8_t event_type : 7; #else uint8_t event_type : 7; uint8_t event_dir : 1; #endif uint8_t event_data[3]; } __attribute__((packed)); int ipmi_event_main(struct ipmi_intf *, int, char **); #endif /*IPMI_EVENT_H*/ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_raw.h0000644000076400007640000000402113160502144021673 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_RAW_H #define IPMI_RAW_H #include int ipmi_raw_main(struct ipmi_intf * intf, int argc, char ** argv); struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, uint8_t addr, uint8_t * wdata, uint8_t wsize, uint8_t rsize); int ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv); int ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv); #endif /* IPMI_RAW_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_fru.h0000644000076400007640000002403013160502144021700 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_FRU_H #define IPMI_FRU_H #ifdef WIN32 #include #else #include #endif #include #include #if HAVE_CONFIG_H # include #endif #define GET_FRU_INFO 0x10 #define GET_FRU_DATA 0x11 #define SET_FRU_DATA 0x12 enum { FRU_CHASSIS_PARTNO, FRU_CHASSIS_SERIAL, FRU_BOARD_MANUF, FRU_BOARD_PRODUCT, FRU_BOARD_SERIAL, FRU_BOARD_PARTNO, FRU_PRODUCT_MANUF, FRU_PRODUCT_NAME, FRU_PRODUCT_PARTNO, FRU_PRODUCT_VERSION, FRU_PRODUCT_SERIAL, FRU_PRODUCT_ASSET, }; struct fru_info { uint16_t size; uint8_t access:1; } __attribute__ ((packed)); struct fru_header { uint8_t version; struct { uint8_t internal; uint8_t chassis; uint8_t board; uint8_t product; uint8_t multi; } offset; uint8_t pad; uint8_t checksum; } __attribute__ ((packed)); struct fru_area_chassis { uint8_t area_ver; uint8_t type; uint16_t area_len; char *part; char *serial; }; struct fru_area_board { uint8_t area_ver; uint8_t lang; uint16_t area_len; uint32_t mfg_date_time; char *mfg; char *prod; char *serial; char *part; char *fru; }; struct fru_area_product { uint8_t area_ver; uint8_t lang; uint16_t area_len; char *mfg; char *name; char *part; char *version; char *serial; char *asset; char *fru; }; struct fru_multirec_header { #define FRU_RECORD_TYPE_POWER_SUPPLY_INFORMATION 0x00 #define FRU_RECORD_TYPE_DC_OUTPUT 0x01 #define FRU_RECORD_TYPE_DC_LOAD 0x02 #define FRU_RECORD_TYPE_MANAGEMENT_ACCESS 0x03 #define FRU_RECORD_TYPE_BASE_COMPATIBILITY 0x04 #define FRU_RECORD_TYPE_EXTENDED_COMPATIBILITY 0x05 #define FRU_RECORD_TYPE_OEM_EXTENSION 0xc0 uint8_t type; uint8_t format; uint8_t len; uint8_t record_checksum; uint8_t header_checksum; } __attribute__ ((packed)); struct fru_multirec_powersupply { #if WORDS_BIGENDIAN uint16_t capacity; #else uint16_t capacity:12; uint16_t __reserved1:4; #endif uint16_t peak_va; uint8_t inrush_current; uint8_t inrush_interval; uint16_t lowend_input1; uint16_t highend_input1; uint16_t lowend_input2; uint16_t highend_input2; uint8_t lowend_freq; uint8_t highend_freq; uint8_t dropout_tolerance; #if WORDS_BIGENDIAN uint8_t __reserved2:3; uint8_t tach:1; uint8_t hotswap:1; uint8_t autoswitch:1; uint8_t pfc:1; uint8_t predictive_fail:1; #else uint8_t predictive_fail:1; uint8_t pfc:1; uint8_t autoswitch:1; uint8_t hotswap:1; uint8_t tach:1; uint8_t __reserved2:3; #endif uint16_t peak_cap_ht; #if WORDS_BIGENDIAN uint8_t combined_voltage1:4; uint8_t combined_voltage2:4; #else uint8_t combined_voltage2:4; uint8_t combined_voltage1:4; #endif uint16_t combined_capacity; uint8_t rps_threshold; } __attribute__ ((packed)); static const char *combined_voltage_desc[] __attribute__ ((unused)) = { "12 V", "-12 V", "5 V", "3.3 V"}; struct fru_multirec_dcoutput { #if WORDS_BIGENDIAN uint8_t standby:1; uint8_t __reserved1:3; uint8_t output_number:4; #else uint8_t output_number:4; uint8_t __reserved1:3; uint8_t standby:1; #endif short nominal_voltage; short max_neg_dev; short max_pos_dev; uint16_t ripple_and_noise; uint16_t min_current; uint16_t max_current; } __attribute__ ((packed)); struct fru_multirec_dcload { #if WORDS_BIGENDIAN uint8_t __reserved1:4; uint8_t output_number:4; #else uint8_t output_number:4; uint8_t __reserved1:4; #endif short nominal_voltage; short min_voltage; short max_voltage; uint16_t ripple_and_noise; uint16_t min_current; uint16_t max_current; } __attribute__ ((packed)); struct fru_multirec_oem_header { unsigned char mfg_id[3]; #define FRU_PICMG_BACKPLANE_P2P 0x04 #define FRU_PICMG_ADDRESS_TABLE 0x10 #define FRU_PICMG_SHELF_POWER_DIST 0x11 #define FRU_PICMG_SHELF_ACTIVATION 0x12 #define FRU_PICMG_SHMC_IP_CONN 0x13 #define FRU_PICMG_BOARD_P2P 0x14 #define FRU_AMC_CURRENT 0x16 #define FRU_AMC_ACTIVATION 0x17 #define FRU_AMC_CARRIER_P2P 0x18 #define FRU_AMC_P2P 0x19 #define FRU_AMC_CARRIER_INFO 0x1a unsigned char record_id; unsigned char record_version; } __attribute__ ((packed)); struct fru_picmgext_guid { unsigned char guid[16]; } __attribute__ ((packed)); struct fru_picmgext_link_desc { #ifndef WORDS_BIGENDIAN unsigned int designator:12; #define FRU_PICMGEXT_LINK_TYPE_BASE 0x01 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04 #define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05 unsigned int type:8; unsigned int ext:4; unsigned int grouping:8; #else unsigned int grouping:8; unsigned int ext:4; #define FRU_PICMGEXT_LINK_TYPE_BASE 0x01 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04 #define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05 unsigned int type:8; unsigned int designator:12; #endif } __attribute__ ((packed)); #define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED 0x00 #define FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 0x01 #define FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS 0x02 #define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 0x03 #define FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 0x04 #define FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET 0x05 #define FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO 0x06 #define FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE 0x07 /* This is used in command, not in FRU */ struct fru_picmgext_amc_link_info { unsigned char linkInfo[3]; } __attribute__ ((packed)); struct fru_picmgext_amc_link_desc_core { #ifndef WORDS_BIGENDIAN unsigned int designator:12; unsigned int type:8; unsigned int ext:4; unsigned int grouping:8; #else unsigned int grouping:8; unsigned int ext:4; unsigned int type:8; unsigned int designator:12; #endif } __attribute__ ((packed)); struct fru_picmgext_amc_link_desc_extra { #ifndef WORDS_BIGENDIAN unsigned char asymetricMatch:2; unsigned char reserved:6; #else unsigned char reserved:6; unsigned char asymetricMatch:2; #endif } __attribute__ ((packed)); struct fru_picmgext_amc_link_desc { #ifndef WORDS_BIGENDIAN struct fru_picmgext_amc_link_desc_core core;/* lsb */ struct fru_picmgext_amc_link_desc_extra extra; #else struct fru_picmgext_amc_link_desc_extra extra; struct fru_picmgext_amc_link_desc_core core;/* lsb */ #endif } __attribute__ ((packed)); struct fru_picmgext_chn_desc { #ifndef WORDS_BIGENDIAN unsigned char remote_slot:8; unsigned char remote_chn:5; unsigned char local_chn:5; unsigned char:6; #else unsigned char:6; unsigned char local_chn:5; unsigned char remote_chn:5; unsigned char remote_slot:8; #endif } __attribute__ ((packed)); struct fru_picmgext_slot_desc { unsigned char chan_type; unsigned char slot_addr; unsigned char chn_count; } __attribute__ ((packed)); #define FRU_PICMGEXT_DESIGN_IF_BASE 0x00 #define FRU_PICMGEXT_DESIGN_IF_FABRIC 0x01 #define FRU_PICMGEXT_DESIGN_IF_UPDATE_CHANNEL 0x02 #define FRU_PICMGEXT_DESIGN_IF_RESERVED 0x03 struct fru_picmgext_carrier_activation_record { unsigned short max_internal_curr; unsigned char allowance_for_readiness; unsigned char module_activation_record_count; } __attribute__ ((packed)); struct fru_picmgext_activation_record { unsigned char ibmb_addr; unsigned char max_module_curr; unsigned char reserved; } __attribute__ ((packed)); struct fru_picmgext_carrier_p2p_record { unsigned char resource_id; unsigned char p2p_count; } __attribute__ ((packed)); struct fru_picmgext_carrier_p2p_descriptor { #ifndef WORDS_BIGENDIAN unsigned char remote_resource_id; unsigned short remote_port:5; unsigned short local_port:5; unsigned short reserved:6; #else unsigned short reserved:6; unsigned short local_port:5; unsigned short remote_port:5; unsigned char remote_resource_id; #endif } __attribute__ ((packed)); static const char *chassis_type_desc[] __attribute__ ((unused)) = { "Unspecified", "Other", "Unknown", "Desktop", "Low Profile Desktop", "Pizza Box", "Mini Tower", "Tower", "Portable", "LapTop", "Notebook", "Hand Held", "Docking Station", "All in One", "Sub Notebook", "Space-saving", "Lunch Box", "Main Server Chassis", "Expansion Chassis", "SubChassis", "Bus Expansion Chassis", "Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis"}; int ipmi_fru_main(struct ipmi_intf *intf, int argc, char **argv); int ipmi_fru_print(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru); int ipmi_spd_print(uint8_t *data, int len); int ipmi_spd_print_fru(struct ipmi_intf * intf, uint8_t id); #endif /* IPMI_FRU_H */ ipmiutil-3.0.7/lib/lanplus/inc/ipmitool/ipmi_cc.h0000644000076400007640000000642513160502144021501 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_CC_H #define IPMI_CC_H /* Thu Jan 11 09:32:41 2007 francois.isabelle@ca.kontron.com I just noticed that most modules refer to IPMI completion codes using hard coded values ... */ /* * CC * See IPMI specification table 5-2 Generic Completion Codes */ #define IPMI_CC_OK 0x00 #define IPMI_CC_NODE_BUSY 0xc0 #define IPMI_CC_INV_CMD 0xc1 #define IPMI_CC_INV_CMD_FOR_LUN 0xc2 #define IPMI_CC_TIMEOUT 0xc3 #define IPMI_CC_OUT_OF_SPACE 0xc4 #define IPMI_CC_RES_CANCELED 0xc5 #define IPMI_CC_REQ_DATA_TRUNC 0xc6 #define IPMI_CC_REQ_DATA_INV_LENGTH 0xc7 #define IPMI_CC_REQ_DATA_FIELD_EXCEED 0xc8 #define IPMI_CC_PARAM_OUT_OF_RANGE 0xc9 #define IPMI_CC_CANT_RET_NUM_REQ_BYTES 0xca #define IPMI_CC_REQ_DATA_NOT_PRESENT 0xcb #define IPMI_CC_INV_DATA_FIELD_IN_REQ 0xcc #define IPMI_CC_ILL_SENSOR_OR_RECORD 0xcd #define IPMI_CC_RESP_COULD_NOT_BE_PRV 0xce #define IPMI_CC_CANT_RESP_DUPLI_REQ 0xcf #define IPMI_CC_CANT_RESP_SDRR_UPDATE 0xd0 #define IPMI_CC_CANT_RESP_FIRM_UPDATE 0xd1 #define IPMI_CC_CANT_RESP_BMC_INIT 0xd2 #define IPMI_CC_DESTINATION_UNAVAILABLE 0xd3 #define IPMI_CC_INSUFFICIENT_PRIVILEGES 0xd4 #define IPMI_CC_NOT_SUPPORTED_PRESENT_STATE 0xd5 #define IPMI_CC_ILLEGAL_COMMAND_DISABLED 0xd6 #define IPMI_CC_UNSPECIFIED_ERROR 0xff #endif /*IPMI_CC_H*/ ipmiutil-3.0.7/lib/lanplus/inc/inttypes-win.h0000644000076400007640000000073613160502144020713 0ustar acressloggers/* * inttypes.h * */ #ifdef WIN32 #ifndef INTTYPES_WIN #define INTTYPES_WIN typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; /* #if __WORDSIZE == 64 typedef unsigned long int uint64_t; #else typedef unsigned long long uint64_t; #endif */ typedef uint32_t socklen_t; #ifndef __attribute__ #define __attribute__(Spec) /*empty*/ #endif #endif #else /* Linux */ #include #endif /* end of inttypes.h */ ipmiutil-3.0.7/lib/lanplus/inc/openssl/0000755000076400007640000000000010777167162017567 5ustar acressloggersipmiutil-3.0.7/lib/lanplus/Makefile.in0000644000000000000000000004562213160502154016352 0ustar rootroot# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile.am for libipmi_lanplus.so and libipmi_lanplus.a VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib/lanplus DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libipmi_lanplus_a_AR = $(AR) $(ARFLAGS) libipmi_lanplus_a_LIBADD = am_libipmi_lanplus_a_OBJECTS = lanplus.$(OBJEXT) \ lanplus_dump.$(OBJEXT) lanplus_crypt.$(OBJEXT) \ lanplus_crypt_impl.$(OBJEXT) lanplus_strings.$(OBJEXT) \ helper.$(OBJEXT) ipmi_strings.$(OBJEXT) libipmi_lanplus_a_OBJECTS = $(am_libipmi_lanplus_a_OBJECTS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libipmi_lanplus_a_SOURCES) DIST_SOURCES = $(libipmi_lanplus_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CROSS_CFLAGS = @CROSS_CFLAGS@ CROSS_LFLAGS = @CROSS_LFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GPL_CFLAGS = @GPL_CFLAGS@ GREP = @GREP@ IA64_CFLAGS = @IA64_CFLAGS@ INIT_DIR = @INIT_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INS_LIB = @INS_LIB@ LANDESK_CFLAGS = @LANDESK_CFLAGS@ LANDESK_LDADD = @LANDESK_LDADD@ LANPLUS_CFLAGS = @LANPLUS_CFLAGS@ LANPLUS_CRYPTO = @LANPLUS_CRYPTO@ LANPLUS_LDADD = @LANPLUS_LDADD@ LANPLUS_LIB = @LANPLUS_LIB@ LANPLUS_SAM = @LANPLUS_SAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_SAMX = @LD_SAMX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSENSORS = @LIBSENSORS@ LIBTOOL = @LIBTOOL@ LIB_DIR = @LIB_DIR@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS_CFLAGS = @OS_CFLAGS@ OS_DRIVERS = @OS_DRIVERS@ OS_LFLAGS = @OS_LFLAGS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_DIR = @PKG_DIR@ RANLIB = @RANLIB@ SAM2OBJ = @SAM2OBJ@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHR_LINK = @SHR_LINK@ STRIP = @STRIP@ SUBDIR_S = @SUBDIR_S@ SYSTEMD_DIR = @SYSTEMD_DIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ODIR = obj CFLAGS_STATIC = @OS_CFLAGS@ -DSTATIC -fno-strict-aliasing -fPIC $(CFLAGS) AM_CFLAGS = @OS_CFLAGS@ -fPIC @LANPLUS_CFLAGS@ MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I. -I./inc lanplus_liba = libipmi_lanplus.a noinst_LIBRARIES = $(lanplus_liba) libipmi_lanplus_a_SOURCES = lanplus.c lanplus.h rmcp.h asf.h \ lanplus_dump.c lanplus_dump.h \ lanplus_crypt.c lanplus_crypt.h \ lanplus_crypt_impl.c lanplus_crypt_impl.h \ lanplus_strings.c \ helper.c ipmi_strings.c lib_LTLIBRARIES = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/lanplus/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/lanplus/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libipmi_lanplus.a: $(libipmi_lanplus_a_OBJECTS) $(libipmi_lanplus_a_DEPENDENCIES) -rm -f libipmi_lanplus.a $(libipmi_lanplus_a_AR) libipmi_lanplus.a $(libipmi_lanplus_a_OBJECTS) $(libipmi_lanplus_a_LIBADD) $(RANLIB) libipmi_lanplus.a install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_strings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_crypt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_crypt_impl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_strings.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLIBRARIES ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-libLTLIBRARIES # lib_LTLIBRARIES = libipmi_lanplus.la # libipmi_lanplus_la_LIBADD = -lcrypto # libipmi_lanplus_la_SOURCES = lanplus.c lanplus.h rmcp.h asf.h \ # lanplus_dump.c lanplus_dump.h \ # lanplus_crypt.c lanplus_crypt.h \ # lanplus_crypt_impl.c lanplus_crypt_impl.h \ # lanplus_strings.c \ # helper.c ipmi_strings.c #am_libipmi_lanplus_a_OBJECTS = $(ODIR)/lanplus.o $(ODIR)/lanplus_strings.o \ # $(ODIR)/lanplus_crypt.o $(ODIR)/lanplus_crypt_impl.o \ # $(ODIR)/lanplus_dump.o \ # $(ODIR)/helper.o $(ODIR)/ipmi_strings.o clean-generic: rm -rf $(ODIR) rm -f $(lanplus_liba) $(lib_LTLIBRARIES) *.o *.so clean: clean-generic #$(lanplus_liba): $(am_libipmi_lanplus_a_OBJECTS) # $(AR) cru $(lanplus_liba) $(am_libipmi_lanplus_a_OBJECTS) # $(RANLIB) $(lanplus_liba) #$(ODIR): # mkdir -p $(ODIR) #$(ODIR)/%.o: %.c $(ODIR) # $(CC) -c $(CFLAGS_STATIC) $(INCLUDES) -o $@ $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ipmiutil-3.0.7/lib/lanplus/lanplus_crypt.c0000644000076400007640000007212113160502144020357 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #include #include #if defined(HAVE_CONFIG_H) # include #endif #include #include #include "lanplus.h" #include "lanplus_crypt.h" #include "lanplus_crypt_impl.h" /* * lanplus_rakp2_hmac_matches * * param session holds all the state data that we need to generate the hmac * param hmac is the HMAC sent by the BMC in the RAKP 2 message * * The HMAC was generated [per RFC2404] from : * * SIDm - Remote console session ID * SIDc - BMC session ID * Rm - Remote console random number * Rc - BMC random number * GUIDc - BMC guid * ROLEm - Requested privilege level (entire byte) * ULENGTHm - Username length * - Username (absent for null user names) * * generated by using Kuid. I am aware that the subscripts on the values * look backwards, but that's the way they are written in the specification. * * If the authentication algorithm is IPMI_AUTH_RAKP_NONE, we return success. * * return 0 on success (the authcode matches) * 1 on failure (the authcode does not match) */ int lanplus_rakp2_hmac_matches(const struct ipmi_session * session, const uint8_t * bmc_mac, struct ipmi_intf * intf) { uint8_t * buffer; int bufferLength, i; uint8_t mac[EVP_MAX_MD_SIZE]; uint32_t macLength; uint32_t SIDm_lsbf, SIDc_lsbf; if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE) return 1; /* We don't yet support other algorithms (was assert) */ if ((session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_SHA1) && (session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_MD5) && (session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_SHA256)) { printf("Error, unsupported rakp2 auth alg %d\n", session->v2_data.auth_alg); return 1; } bufferLength = 4 + /* SIDm */ 4 + /* SIDc */ 16 + /* Rm */ 16 + /* Rc */ 16 + /* GUIDc */ 1 + /* ROLEm */ 1 + /* ULENGTHm */ (int)strlen((const char *)session->username); /* optional */ buffer = malloc(bufferLength); if (buffer == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return 1; } /* * Fill the buffer. I'm assuming that we're using the LSBF representation of the * multibyte numbers in use. */ /* SIDm */ SIDm_lsbf = session->v2_data.console_id; #if WORDS_BIGENDIAN SIDm_lsbf = BSWAP_32(SIDm_lsbf); #endif memcpy(buffer, &SIDm_lsbf, 4); /* SIDc */ SIDc_lsbf = session->v2_data.bmc_id; #if WORDS_BIGENDIAN SIDc_lsbf = BSWAP_32(SIDc_lsbf); #endif memcpy(buffer + 4, &SIDc_lsbf, 4); /* Rm */ #if WORDS_BIGENDIAN for (i = 0; i < 16; ++i) buffer[8 + i] = session->v2_data.console_rand[16 - 1 - i]; #else for (i = 0; i < 16; ++i) buffer[8 + i] = session->v2_data.console_rand[i]; #endif /* Rc */ #if WORDS_BIGENDIAN for (i = 0; i < 16; ++i) buffer[24 + i] = session->v2_data.bmc_rand[16 - 1 - i]; #else for (i = 0; i < 16; ++i) buffer[24 + i] = session->v2_data.bmc_rand[i]; #endif /* GUIDc */ #if WORDS_BIGENDIAN for (i = 0; i < 16; ++i) buffer[40 + i] = session->v2_data.bmc_guid[16 - 1 - i]; #else for (i = 0; i < 16; ++i) buffer[40 + i] = session->v2_data.bmc_guid[i]; #endif /* ROLEm */ buffer[56] = session->v2_data.requested_role; /* ULENGTHm */ buffer[57] = (uint8_t)strlen((const char *)session->username); /* UserName [optional] */ for (i = 0; i < buffer[57]; ++i) buffer[58 + i] = session->username[i]; if (verbose > 2) { lprintf(LOG_DEBUG,"rakp2 mac input buffer (%d bytes)", bufferLength); } /* * The buffer is complete. Let's hash. */ lanplus_HMAC(session->v2_data.auth_alg, session->authcode, IPMI_AUTHCODE_BUFFER_SIZE, buffer, bufferLength, mac, &macLength); free(buffer); if (verbose > 2) { printbuf(mac, macLength, ">> rakp2 mac as computed by the remote console"); } return (memcmp(bmc_mac, mac, macLength) == 0); } /* * lanplus_rakp4_hmac_matches * * param session holds all the state data that we need to generate the hmac * param hmac is the HMAC sent by the BMC in the RAKP 4 message * * The HMAC was generated [per RFC2404] from : * * Rm - Remote console random number * SIDc - BMC session ID * GUIDc - BMC guid * * generated by using SIK (the session integrity key). I am aware that the * subscripts on the values look backwards, but that's the way they are * written in the specification. * * If the authentication algorithm is IPMI_AUTH_RAKP_NONE, we return success. * * return 1 on success (the authcode matches) * 0 on failure (the authcode does not match) * */ int lanplus_rakp4_hmac_matches(const struct ipmi_session * session, const uint8_t * bmc_mac, struct ipmi_intf * intf) { uint8_t * buffer; int bufferLength, i; uint8_t mac[EVP_MAX_MD_SIZE]; uint32_t macLength; uint32_t cmpLength; uint32_t SIDc_lsbf; int unsupported = 0; uint8_t alg; if (ipmi_oem_active(intf, "intelplus")){ /* Intel BMC responds with the integrity Algorithm in RAKP4 */ if (session->v2_data.integrity_alg == IPMI_INTEGRITY_NONE) return 1; /* (Old) Intel BMC doesn't support other algorithms */ if ((session->v2_data.integrity_alg != IPMI_INTEGRITY_HMAC_SHA1_96) && (session->v2_data.integrity_alg != IPMI_INTEGRITY_HMAC_MD5_128)) { printf("Error, unsupported rakp4 integrity_alg %d\n", session->v2_data.integrity_alg); return 1; } } else { if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE) return 1; /* We don't yet support other algorithms (was assert) */ if ((session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_SHA1) && (session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_MD5) && (session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_SHA256)) { printf("Error, unsupported rakp4 auth alg %d\n", session->v2_data.auth_alg); return 1; } } bufferLength = 16 + /* Rm */ 4 + /* SIDc */ 16; /* GUIDc */ buffer = (uint8_t *)malloc(bufferLength); if (buffer == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return 1; } /* * Fill the buffer. I'm assuming that we're using the LSBF * representation of the multibyte numbers in use. */ /* Rm */ #if WORDS_BIGENDIAN for (i = 0; i < 16; ++i) buffer[i] = session->v2_data.console_rand[16 - 1 - i]; #else for (i = 0; i < 16; ++i) buffer[i] = session->v2_data.console_rand[i]; #endif /* SIDc */ SIDc_lsbf = session->v2_data.bmc_id; #if WORDS_BIGENDIAN SIDc_lsbf = BSWAP_32(SIDc_lsbf); #endif memcpy(buffer + 16, &SIDc_lsbf, 4); /* GUIDc */ #if WORDS_BIGENDIAN for (i = 0; i < 16; ++i) buffer[i + 20] = session->v2_data.bmc_guid[16 - 1 - i]; #else for (i = 0; i < 16; ++i) buffer[i + 20] = session->v2_data.bmc_guid[i]; #endif if (verbose > 2) { printbuf((const uint8_t *)buffer, bufferLength, ">> rakp4 mac input buffer"); printbuf(session->v2_data.sik, session->v2_data.sik_len, ">> rakp4 mac key (sik)"); } /* * The buffer is complete. Let's hash. */ alg = ( (ipmi_oem_active(intf, "intelplus")) ? session->v2_data.integrity_alg : session->v2_data.auth_alg ); lanplus_HMAC(alg, session->v2_data.sik, session->v2_data.sik_len, buffer, bufferLength, mac, &macLength); if (verbose > 2) { printbuf(bmc_mac, macLength, ">> rakp4 mac as computed by the BMC"); printbuf(mac, macLength, ">> rakp4 mac as computed by the remote console"); } if (ipmi_oem_active(intf, "intelplus")){ /* Intel BMC responds with the integrity Algorithm in RAKP4 */ switch(session->v2_data.integrity_alg) { case IPMI_INTEGRITY_HMAC_SHA1_96: if (macLength != SHA_DIGEST_LENGTH) unsupported = 1; cmpLength = IPMI_SHA1_AUTHCODE_SIZE; break; case IPMI_INTEGRITY_HMAC_MD5_128: if (macLength != MD5_DIGEST_LENGTH) unsupported = 1; cmpLength = IPMI_HMAC_MD5_AUTHCODE_SIZE; break; default: unsupported = 1; break; } } else { /* We don't yet support other algorithms (was assert) */ switch(session->v2_data.auth_alg) { case IPMI_AUTH_RAKP_HMAC_SHA1: if (macLength != SHA_DIGEST_LENGTH) unsupported = 1; cmpLength = IPMI_SHA1_AUTHCODE_SIZE; break; case IPMI_AUTH_RAKP_HMAC_MD5 : if (macLength != MD5_DIGEST_LENGTH) unsupported = 1; cmpLength = IPMI_HMAC_MD5_AUTHCODE_SIZE; break; case IPMI_AUTH_RAKP_HMAC_SHA256: if (macLength != SHA256_DIGEST_LENGTH) unsupported = 1; cmpLength = IPMI_HMAC_SHA256_AUTHCODE_SIZE; break; default: unsupported = 1; break; } } if (unsupported) { printf("Unsupported rakp4 macLength %d for auth %d\n", macLength, session->v2_data.auth_alg); return 1; } free(buffer); return (memcmp(bmc_mac, mac, cmpLength) == 0); } /* * lanplus_generate_rakp3_auth_code * * This auth code is an HMAC generated with : * * Rc - BMC random number * SIDm - Console session ID * ROLEm - Requested privilege level (entire byte) * ULENGTHm - Username length * - Usename (absent for null usernames) * * The key used to generated the MAC is Kuid * * I am aware that the subscripts look backwards, but that is the way they are * written in the spec. * * param output_buffer [out] will hold the generated MAC * param session [in] holds all the state data we need to generate the auth code * param mac_length [out] will be set to the length of the auth code * * returns 0 on success * 1 on failure */ int lanplus_generate_rakp3_authcode(uint8_t * output_buffer, const struct ipmi_session * session, uint32_t * mac_length, struct ipmi_intf * intf) { int ret = 0; int input_buffer_length, i; uint8_t * input_buffer; uint32_t SIDm_lsbf; if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE) { *mac_length = 0; return 0; } /* We don't yet support other algorithms (was assert) */ if ((session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_SHA1) && (session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_MD5) && (session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_SHA256)) { printf("Error, unsupported rakp3 auth alg %d\n", session->v2_data.auth_alg); return 1; } input_buffer_length = 16 + /* Rc */ 4 + /* SIDm */ 1 + /* ROLEm */ 1 + /* ULENGTHm */ (int)strlen((const char *)session->username); input_buffer = malloc(input_buffer_length); if (input_buffer == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return 1; } /* * Fill the buffer. I'm assuming that we're using the LSBF representation of the * multibyte numbers in use. */ /* Rc */ #if WORDS_BIGENDIAN for (i = 0; i < 16; ++i) input_buffer[i] = session->v2_data.bmc_rand[16 - 1 - i]; #else for (i = 0; i < 16; ++i) input_buffer[i] = session->v2_data.bmc_rand[i]; #endif /* SIDm */ SIDm_lsbf = session->v2_data.console_id; #if WORDS_BIGENDIAN SIDm_lsbf = BSWAP_32(SIDm_lsbf); #endif memcpy(input_buffer + 16, &SIDm_lsbf, 4); /* ROLEm */ if (ipmi_oem_active(intf, "intelplus")) input_buffer[20] = session->privlvl; else input_buffer[20] = session->v2_data.requested_role; /* ULENGTHm */ input_buffer[21] = (uint8_t)strlen((const char *)session->username); /* USERNAME */ for (i = 0; i < input_buffer[21]; ++i) input_buffer[22 + i] = session->username[i]; if (verbose > 2) { printbuf((const uint8_t *)input_buffer, input_buffer_length, ">> rakp3 mac input buffer"); printbuf((const uint8_t *)session->authcode, IPMI_AUTHCODE_BUFFER_SIZE, ">> rakp3 mac key"); } lanplus_HMAC(session->v2_data.auth_alg, session->authcode, IPMI_AUTHCODE_BUFFER_SIZE, input_buffer, input_buffer_length, output_buffer, mac_length); if (verbose > 2) printbuf((const uint8_t *)output_buffer, *mac_length, "generated rakp3 mac"); free(input_buffer); return ret; } /* * lanplus_generate_sik * * Generate the session integrity key (SIK) used for integrity checking * during the IPMI v2 / RMCP+ session * * This session integrity key is a HMAC generated with : * * Rm - Console generated random number * Rc - BMC generated random number * ROLEm - Requested privilege level (entire byte) * ULENGTHm - Username length * - Usename (absent for null usernames) * * The key used to generated the SIK is Kg if Kg is not null (two-key logins are * enabled). Otherwise Kuid (the user authcode) is used as the key to genereate * the SIK. * * I am aware that the subscripts look backwards, but that is the way they are * written in the spec. * * param session [in/out] contains our input and output fields. * * returns 0 on success * 1 on failure */ int lanplus_generate_sik(struct ipmi_session * session) { uint8_t * input_buffer; int input_buffer_length, i; uint8_t * input_key; uint32_t mac_length; int unsupported = 0; memset(session->v2_data.sik, 0, sizeof(session->v2_data.sik)); session->v2_data.sik_len = 0; if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE) return 0; /* We don't yet support other algorithms (was assert) */ if ((session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_SHA1) && (session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_MD5) && (session->v2_data.auth_alg != IPMI_AUTH_RAKP_HMAC_SHA256)) { printf("Error, unsupported sik auth alg %d\n", session->v2_data.auth_alg); return 1; } input_buffer_length = 16 + /* Rm */ 16 + /* Rc */ 1 + /* ROLEm */ 1 + /* ULENGTHm */ (int)strlen((const char *)session->username); input_buffer = malloc(input_buffer_length); if (input_buffer == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return 1; } /* * Fill the buffer. I'm assuming that we're using the LSBF representation of the * multibyte numbers in use. */ /* Rm */ #if WORDS_BIGENDIAN for (i = 0; i < 16; ++i) input_buffer[i] = session->v2_data.console_rand[16 - 1 - i]; #else for (i = 0; i < 16; ++i) input_buffer[i] = session->v2_data.console_rand[i]; #endif /* Rc */ #if WORDS_BIGENDIAN for (i = 0; i < 16; ++i) input_buffer[16 + i] = session->v2_data.bmc_rand[16 - 1 - i]; #else for (i = 0; i < 16; ++i) input_buffer[16 + i] = session->v2_data.bmc_rand[i]; #endif /* ROLEm */ input_buffer[32] = session->v2_data.requested_role; /* ULENGTHm */ input_buffer[33] = (uint8_t)strlen((const char *)session->username); /* USERNAME */ for (i = 0; i < input_buffer[33]; ++i) input_buffer[34 + i] = session->username[i]; if (session->v2_data.kg[0]) { /* We will be hashing with Kg */ /* * Section 13.31 of the IPMI v2 spec describes the SIK creation * using Kg. It specifies that Kg should not be truncated. * Kg is set in ipmi_intf. */ input_key = session->v2_data.kg; } else { /* We will be hashing with Kuid */ input_key = session->authcode; } if (verbose >= 2) printbuf((const uint8_t *)input_buffer, input_buffer_length, "session integrity key input"); lanplus_HMAC(session->v2_data.auth_alg, input_key, IPMI_AUTHCODE_BUFFER_SIZE, input_buffer, input_buffer_length, session->v2_data.sik, &mac_length); free(input_buffer); switch(session->v2_data.auth_alg) { case IPMI_AUTH_RAKP_HMAC_SHA1 : if (mac_length != SHA_DIGEST_LENGTH) unsupported = 1; break; case IPMI_AUTH_RAKP_HMAC_MD5 : if (mac_length != MD5_DIGEST_LENGTH) unsupported = 1; break; case IPMI_AUTH_RAKP_HMAC_SHA256: if (mac_length != SHA256_DIGEST_LENGTH) unsupported = 1; break; default : unsupported = 1; break; } if (unsupported) { /*was assert*/ printf("Unsupported sik macLength %d for auth %d\n", mac_length, session->v2_data.auth_alg); return 1; } session->v2_data.sik_len = (uint8_t)mac_length; /* * The key MAC generated is 20 bytes, but we will only be using the first * 12 for SHA1 96 */ if (verbose >= 2) printbuf(session->v2_data.sik, session->v2_data.sik_len, "Generated session integrity key"); return 0; } /* * lanplus_generate_k1 * * Generate K1, the key presumably used to generate integrity authcodes * * We use the authentication algorithm to generated the HMAC, using * the session integrity key (SIK) as our key. * * param session [in/out]. * * returns 0 on success * 1 on failure */ int lanplus_generate_k1(struct ipmi_session * session) { uint32_t mac_length; int unsupported = 0; uint8_t CONST_1[36] = /*EVP_MAX_MD_SIZE = 36*/ {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}; if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE) memcpy(session->v2_data.k1, CONST_1, 20); else { lanplus_HMAC(session->v2_data.auth_alg, session->v2_data.sik, session->v2_data.sik_len,/* SIK length */ CONST_1, IPMI_AUTHCODE_BUFFER_SIZE, /*=20*/ session->v2_data.k1, &mac_length); switch(session->v2_data.auth_alg) { case IPMI_AUTH_RAKP_HMAC_SHA1 : if (mac_length != SHA_DIGEST_LENGTH) unsupported = 1; break; case IPMI_AUTH_RAKP_HMAC_MD5 : if (mac_length != MD5_DIGEST_LENGTH) unsupported = 1; break; case IPMI_AUTH_RAKP_HMAC_SHA256: if (mac_length != SHA256_DIGEST_LENGTH) unsupported = 1; break; default : unsupported = 1; break; } if (unsupported) { /*was assert*/ printf("Unsupported k1 macLength %d for auth %d\n", mac_length, session->v2_data.auth_alg); return 1; } session->v2_data.k1_len = (uint8_t)mac_length; } if (verbose >= 2) printbuf(session->v2_data.k1, session->v2_data.k1_len, "Generated K1"); return 0; } /* * lanplus_generate_k2 * * Generate K2, the key used for RMCP+ AES encryption. * * We use the authentication algorithm to generated the HMAC, using * the session integrity key (SIK) as our key. * * param session [in/out]. * * returns 0 on success * 1 on failure */ int lanplus_generate_k2(struct ipmi_session * session) { uint32_t mac_length; int unsupported = 0; uint8_t CONST_2[36] = /*EVP_MAX_MD_SIZE = 36*/ {0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02}; if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE) memcpy(session->v2_data.k2, CONST_2, 20); else { lanplus_HMAC(session->v2_data.auth_alg, session->v2_data.sik, session->v2_data.sik_len,/* SIK length */ CONST_2, IPMI_AUTHCODE_BUFFER_SIZE, /*=20*/ session->v2_data.k2, &mac_length); switch(session->v2_data.auth_alg) { case IPMI_AUTH_RAKP_HMAC_SHA1 : if (mac_length != SHA_DIGEST_LENGTH) unsupported = 1; break; case IPMI_AUTH_RAKP_HMAC_MD5 : if (mac_length != MD5_DIGEST_LENGTH) unsupported = 1; break; case IPMI_AUTH_RAKP_HMAC_SHA256: if (mac_length != SHA256_DIGEST_LENGTH) unsupported = 1; break; default : unsupported = 1; break; } if (unsupported) { /*was assert*/ printf("Unsupported k2 macLength %d for auth %d\n", mac_length, session->v2_data.auth_alg); return 1; } session->v2_data.k2_len = (uint8_t)mac_length; } if (verbose >= 2) printbuf(session->v2_data.k2, session->v2_data.k2_len, "Generated K2"); return 0; } /* * lanplus_encrypt_payload * * Perform the appropriate encryption on the input data. Output the encrypted * data to output, including the required confidentiality header and trailer. * If the crypt_alg is IPMI_CRYPT_NONE, simply copy the input to the output and * set bytes_written to input_length. * * param crypt_alg specifies the encryption algorithm (from table 13-19 of the * IPMI v2 spec) * param key is the used as input to the encryption algorithmf * param input is the input data to be encrypted * param input_length is the length of the input data to be encrypted * param output is the cipher text generated by the encryption process * param bytes_written is the number of bytes written during the encryption * process * * returns 0 on success * 1 on failure */ int lanplus_encrypt_payload(uint8_t crypt_alg, const uint8_t * key, const uint8_t * input, uint32_t input_length, uint8_t * output, uint16_t * bytes_written) { uint8_t * padded_input; uint32_t mod, i, bytes_encrypted; uint8_t pad_length = 0; if (crypt_alg == IPMI_CRYPT_NONE) { /* Just copy the input to the output */ *bytes_written = (uint16_t)input_length; return 0; } /* Currently, we only support AES (was assert) */ if ((crypt_alg != IPMI_CRYPT_AES_CBC_128) || (input_length > IPMI_MAX_PAYLOAD_SIZE)) { lprintf(LOG_ERR,"lanplus crypt: unsupported alg %d or len %d\n", crypt_alg,input_length); return 1; } /* * The input to the AES encryption algorithm has to be a multiple of the * block size (16 bytes). The extra byte we are adding is the pad length * byte. */ mod = (input_length + 1) % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE; if (mod) pad_length = IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE - mod; padded_input = (uint8_t*)malloc(input_length + pad_length + 1); if (padded_input == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return 1; } memcpy(padded_input, input, input_length); /* add the pad */ for (i = 0; i < pad_length; ++i) padded_input[input_length + i] = i + 1; /* add the pad length */ padded_input[input_length + pad_length] = pad_length; /* Generate an initialization vector, IV, for the encryption process */ if (lanplus_rand(output, IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE)) { lprintf(LOG_ERR, "lanplus_encrypt_payload: Error generating IV"); free(padded_input); return 1; } if (verbose > 2) printbuf(output, IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE, ">> Initialization vector"); lanplus_encrypt_aes_cbc_128(output, /* IV */ key, /* K2 */ padded_input, /* Data to encrypt */ input_length + pad_length + 1, /* Input length */ output + IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE, /* output */ &bytes_encrypted); /* bytes written */ *bytes_written = IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE + /* IV */ bytes_encrypted; free(padded_input); return 0; } /* * lanplus_has_valid_auth_code * * Determine whether the packets authcode field is valid for packet. * * We always return success if any of the following are true. * - this is not an IPMIv2 packet * - the session is not yet active * - the packet specifies that it is not authenticated * - the integrity algorithm agreed upon during session creation is "none" * * The authcode is computed using the specified integrity algorithm starting * with the AuthType / Format field, and ending with the field immediately * preceeding the authcode itself. * * The key key used to generate the authcode MAC is K1. * * param rs holds the response structure. * param session holds our session state, including our chosen algorithm, key, etc. * * returns 1 on success (authcode is valid) * 0 on failure (autchode integrity check failed) */ int lanplus_has_valid_auth_code(struct ipmi_rs * rs, struct ipmi_session * session) { uint8_t * bmc_authcode; uint8_t generated_authcode[EVP_MAX_MD_SIZE]; uint32_t generated_authcode_length; uint32_t authcode_length; if ((rs->session.authtype != IPMI_SESSION_AUTHTYPE_RMCP_PLUS) || (session->v2_data.session_state != LANPLUS_STATE_ACTIVE) || (! rs->session.bAuthenticated) || (session->v2_data.integrity_alg == IPMI_INTEGRITY_NONE)) return 1; switch(session->v2_data.integrity_alg) { case IPMI_INTEGRITY_HMAC_SHA1_96 : authcode_length = IPMI_SHA1_AUTHCODE_SIZE; break; case IPMI_INTEGRITY_HMAC_MD5_128 : authcode_length = IPMI_HMAC_MD5_AUTHCODE_SIZE; break; case IPMI_INTEGRITY_HMAC_SHA256_128: authcode_length = IPMI_HMAC_SHA256_AUTHCODE_SIZE; break; /* Unsupported */ default: printf("Unsupported lanplus auth_code %d\n", session->v2_data.auth_alg); return 1; break; } /* * For SHA1-96, the authcode will be the last 12 bytes in the packet */ bmc_authcode = rs->data + (rs->data_len - authcode_length); lanplus_HMAC(session->v2_data.integrity_alg, session->v2_data.k1, session->v2_data.k1_len, rs->data + IPMI_LANPLUS_OFFSET_AUTHTYPE, rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - authcode_length, generated_authcode, &generated_authcode_length); if (verbose > 3) { lprintf(LOG_DEBUG+2, "Validating authcode"); printbuf(session->v2_data.k1, session->v2_data.k1_len, "K1"); printbuf(rs->data + IPMI_LANPLUS_OFFSET_AUTHTYPE, rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - authcode_length, "Authcode Input Data"); printbuf(generated_authcode, authcode_length, "Generated authcode"); printbuf(bmc_authcode, authcode_length, "Expected authcode"); } // assert(generated_authcode_length == 20); return (memcmp(bmc_authcode, generated_authcode, authcode_length) == 0); } /* * lanplus_decrypt_payload * * * param input points to the beginning of the payload (which will be the IV if * we are using AES) * param payload_size [out] will be set to the size of the payload EXCLUDING * padding * * returns 0 on success (we were able to successfully decrypt the packet) * 1 on failure (we were unable to successfully decrypt the packet) */ int lanplus_decrypt_payload(uint8_t crypt_alg, const uint8_t * key, const uint8_t * input, uint32_t input_length, uint8_t * output, uint16_t * payload_size) { uint8_t * decrypted_payload; uint32_t bytes_decrypted; if (crypt_alg == IPMI_CRYPT_NONE) { /* We are not encrypted. The paylaod size is is everything. */ *payload_size = (uint16_t)input_length; memmove(output, input, input_length); return 0; } /* We only support AES (was assert) */ if (crypt_alg != IPMI_CRYPT_AES_CBC_128) { lprintf(LOG_ERR,"lanplus decrypt: unsupported alg %d\n", crypt_alg); return 1; } decrypted_payload = (uint8_t*)malloc(input_length); if (decrypted_payload == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return 1; } lanplus_decrypt_aes_cbc_128(input, /* IV */ key, /* Key */ input + /* Data to decrypt */ IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE, input_length - /* Input length */ IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE, decrypted_payload, /* output */ &bytes_decrypted); /* bytes written */ if (bytes_decrypted != 0) { /* Success */ uint8_t conf_pad_length; int i; memmove(output, decrypted_payload, bytes_decrypted); /* * We have to determine the payload size, by substracting the padding, etc. * The last byte of the decrypted payload is the confidentiality pad length. */ conf_pad_length = decrypted_payload[bytes_decrypted - 1]; *payload_size = bytes_decrypted - conf_pad_length - 1; /* * Extra test to make sure that the padding looks like it should (should start * with 0x01, 0x02, 0x03, etc... */ for (i = 0; i < conf_pad_length; ++i) { if (decrypted_payload[*payload_size + i] == i) { lprintf(LOG_ERR, "Malformed payload padding"); return 1; /* assert(0); */ } } } else { lprintf(LOG_ERR, "ERROR: lanplus_decrypt_aes_cbc_128 decryptd 0 bytes"); return 1; /* assert(0); */ } free(decrypted_payload); return (bytes_decrypted == 0); } ipmiutil-3.0.7/lib/lanplus/rmcp.h0000644000076400007640000000534013160502144016425 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_RMCP_H #define IPMI_RMCP_H #include #include "lanplus.h" #define RMCP_VERSION_1 0x06 #define RMCP_UDP_PORT 0x26f /* port 623 */ #define RMCP_UDP_SECURE_PORT 0x298 /* port 664 */ #define RMCP_TYPE_MASK 0x80 #define RMCP_TYPE_NORM 0x00 #define RMCP_TYPE_ACK 0x01 static const struct valstr rmcp_type_vals[] __attribute__((unused)) = { { RMCP_TYPE_NORM, "Normal RMCP" }, { RMCP_TYPE_ACK, "RMCP ACK" }, { 0, NULL } }; #define RMCP_CLASS_MASK 0x1f #define RMCP_CLASS_ASF 0x06 #define RMCP_CLASS_IPMI 0x07 #define RMCP_CLASS_OEM 0x08 static const struct valstr rmcp_class_vals[] __attribute__((unused)) = { { RMCP_CLASS_ASF, "ASF" }, { RMCP_CLASS_IPMI, "IPMI" }, { RMCP_CLASS_OEM, "OEM" }, { 0, NULL } }; /* RMCP message header */ #ifdef GCC_42 struct rmcp_hdr { uint8_t ver; uint8_t __rsvd; uint8_t seq; uint8_t class; } __attribute__((packed)); #else /* pragma pack works in gcc-4.3 */ #pragma pack(1) struct rmcp_hdr { uint8_t ver; uint8_t __rsvd; uint8_t seq; uint8_t class; }; #pragma pack() #endif int handle_rmcp(struct ipmi_intf * intf, uint8_t * data, int data_len); #endif /* IPMI_RMCP_H */ ipmiutil-3.0.7/lib/lanplus/lanplus_dump.c0000644000076400007640000001345413160502144020167 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #include "lanplus.h" #include "lanplus_crypt.h" #include "lanplus_dump.h" extern const struct valstr ipmi_rakp_return_codes[]; extern const struct valstr ipmi_priv_levels[]; extern const struct valstr ipmi_auth_algorithms[]; extern const struct valstr ipmi_integrity_algorithms[]; extern const struct valstr ipmi_encryption_algorithms[]; #define DUMP_PREFIX_INCOMING "<<" void lanplus_dump_open_session_response(const struct ipmi_rs * rsp) { if (verbose < 2) return; printf("%sOPEN SESSION RESPONSE\n", DUMP_PREFIX_INCOMING); printf("%s Message tag : 0x%02x\n", DUMP_PREFIX_INCOMING, rsp->payload.open_session_response.message_tag); printf("%s RMCP+ status : %s\n", DUMP_PREFIX_INCOMING, val2str(rsp->payload.open_session_response.rakp_return_code, ipmi_rakp_return_codes)); printf("%s Maximum privilege level : %s\n", DUMP_PREFIX_INCOMING, val2str(rsp->payload.open_session_response.max_priv_level, ipmi_priv_levels)); printf("%s Console Session ID : 0x%08lx\n", DUMP_PREFIX_INCOMING, (long)rsp->payload.open_session_response.console_id); /* only tag, status, privlvl, and console id are returned if error */ if (rsp->payload.open_session_response.rakp_return_code != IPMI_RAKP_STATUS_NO_ERRORS) return; printf("%s BMC Session ID : 0x%08lx\n", DUMP_PREFIX_INCOMING, (long)rsp->payload.open_session_response.bmc_id); printf("%s Negotiated authenticatin algorithm : %s\n", DUMP_PREFIX_INCOMING, val2str(rsp->payload.open_session_response.auth_alg, ipmi_auth_algorithms)); printf("%s Negotiated integrity algorithm : %s\n", DUMP_PREFIX_INCOMING, val2str(rsp->payload.open_session_response.integrity_alg, ipmi_integrity_algorithms)); printf("%s Negotiated encryption algorithm : %s\n", DUMP_PREFIX_INCOMING, val2str(rsp->payload.open_session_response.crypt_alg, ipmi_encryption_algorithms)); printf("\n"); } void lanplus_dump_rakp2_message(const struct ipmi_rs * rsp, uint8_t auth_alg) { int i; if (verbose < 2) return; printf("%sRAKP 2 MESSAGE\n", DUMP_PREFIX_INCOMING); printf("%s Message tag : 0x%02x\n", DUMP_PREFIX_INCOMING, rsp->payload.rakp2_message.message_tag); printf("%s RMCP+ status : %s\n", DUMP_PREFIX_INCOMING, val2str(rsp->payload.rakp2_message.rakp_return_code, ipmi_rakp_return_codes)); printf("%s Console Session ID : 0x%08lx\n", DUMP_PREFIX_INCOMING, (long)rsp->payload.rakp2_message.console_id); printf("%s BMC GUID : 0x", DUMP_PREFIX_INCOMING); for (i = 0; i < 16; ++i) printf("%02x", rsp->payload.rakp2_message.bmc_guid[i]); printf("\n"); switch(auth_alg) { case IPMI_AUTH_RAKP_NONE: printf("%s Key exchange auth code : none\n", DUMP_PREFIX_INCOMING); break; case IPMI_AUTH_RAKP_HMAC_SHA1: case IPMI_AUTH_RAKP_HMAC_MD5: case IPMI_AUTH_RAKP_HMAC_SHA256: printf("%s Key exchange auth code : ok\n", DUMP_PREFIX_INCOMING); break; default: printf("%s Key exchange auth code : invalid", DUMP_PREFIX_INCOMING); } printf("\n"); } void lanplus_dump_rakp4_message(const struct ipmi_rs * rsp, uint8_t auth_alg) { //int i; if (verbose < 2) return; printf("%sRAKP 4 MESSAGE\n", DUMP_PREFIX_INCOMING); printf("%s Message tag : 0x%02x\n", DUMP_PREFIX_INCOMING, rsp->payload.rakp4_message.message_tag); printf("%s RMCP+ status : %s\n", DUMP_PREFIX_INCOMING, val2str(rsp->payload.rakp4_message.rakp_return_code, ipmi_rakp_return_codes)); printf("%s Console Session ID : 0x%08lx\n", DUMP_PREFIX_INCOMING, (long)rsp->payload.rakp4_message.console_id); switch(auth_alg) { case IPMI_AUTH_RAKP_NONE: printf("%s Key exchange auth code : none\n", DUMP_PREFIX_INCOMING); break; case IPMI_AUTH_RAKP_HMAC_SHA1: case IPMI_AUTH_RAKP_HMAC_MD5: case IPMI_AUTH_RAKP_HMAC_SHA256: printf("%s Key exchange auth code : ok\n", DUMP_PREFIX_INCOMING); break; default: printf("%s Key exchange auth code : invalid", DUMP_PREFIX_INCOMING); } printf("\n"); } ipmiutil-3.0.7/lib/lanplus/asf.h0000644000076400007640000000511013160502144016230 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_ASF_H #define IPMI_ASF_H #include #include "lanplus.h" #define ASF_RMCP_IANA 0x000011be #define ASF_TYPE_PING 0x80 #define ASF_TYPE_PONG 0x40 static const struct valstr asf_type_vals[] __attribute__((unused)) = { { 0x10, "Reset" }, { 0x11, "Power-up" }, { 0x12, "Unconditional Power-down" }, { 0x13, "Power Cycle" }, { 0x40, "Presence Pong" }, { 0x41, "Capabilities Response" }, { 0x42, "System State Response" }, { 0x80, "Presence Ping" }, { 0x81, "Capabilities Request" }, { 0x82, "System State Request" }, { 0x00, NULL } }; /* ASF message header */ #ifdef GCC_42 struct asf_hdr { uint32_t iana; uint8_t type; uint8_t tag; uint8_t reserved; uint8_t len; } __attribute__((packed)); #else /* pragma pack works in gcc-4.3 */ #pragma pack(1) struct asf_hdr { uint32_t iana; uint8_t type; uint8_t tag; uint8_t reserved; uint8_t len; }; #pragma pack() #endif int handle_asf(struct ipmi_intf * intf, uint8_t * data, int data_len); #endif /* IPMI_ASF_H */ ipmiutil-3.0.7/lib/lanplus/README0000644000076400007640000000125013160502144016167 0ustar acressloggersipmitool/plugins/lanplus for ipmiutil lib/lanplus directory This contains the lanplus plugin source from the ipmitool project, which supports IPMI LAN 2.0 RMCP+ protocol. This is a slightly modified version from ipmitool-1.8.8.90 with changes to link better with ipmiutil and changes for WIN32. See http://ipmitool.sourceforge.net for the latest version of lanplus, then apply the iutil.diff patch to make it compatible with ipmiutil. This builds a lanplus library that is used by ipmiutil, along with the crypto libraries from openssl (see openssl.org). The util/ipmilanplus.c code in ipmiutil calls the lanplus routines, if the HAVE_LANPLUS compile flag is defined. ipmiutil-3.0.7/lib/lanplus/lanplus_crypt_impl.h0000644000076400007640000000454513160502144021412 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef IPMI_LANPLUS_CRYPT_IMPL_H #define IPMI_LANPLUS_CRYPT_IMPL_H int lanplus_seed_prng(uint32_t bytes); int lanplus_rand(uint8_t * buffer, uint32_t num_bytes); uint8_t * lanplus_HMAC(uint8_t mac, const void *key, int key_len, const uint8_t *d, int n, uint8_t *md, uint32_t *md_len); void lanplus_encrypt_aes_cbc_128(const uint8_t * iv, const uint8_t * key, const uint8_t * input, uint32_t input_length, uint8_t * output, uint32_t * bytes_written); void lanplus_decrypt_aes_cbc_128(const uint8_t * iv, const uint8_t * key, const uint8_t * input, uint32_t input_length, uint8_t * output, uint32_t * bytes_written); #endif /* IPMI_LANPLUS_CRYPT_IMPL_H */ ipmiutil-3.0.7/lib/lanplus/ipmi_strings.c0000644000076400007640000002677013160502144020200 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #include #include #include #include #include /* for IPMI_OEM */ const struct valstr ipmi_oem_info[] = { { IPMI_OEM_UNKNOWN, "Unknown" }, { IPMI_OEM_SUN, "Sun Microsystems" }, { IPMI_OEM_INTEL, "Intel Corporation" }, { IPMI_OEM_TYAN, "Tyan Computer Corporation" }, { IPMI_OEM_NEWISYS, "Newisys" }, { IPMI_OEM_SUPERMICRO, "Supermicro" }, { IPMI_OEM_GOOGLE, "Google" }, { IPMI_OEM_KONTRON, "Kontron" }, { IPMI_OEM_NOKIA, "Nokia" }, { 0xffff , NULL }, }; const struct oemvalstr ipmi_oem_sdr_type_vals[] = { /* Keep OEM grouped together */ { IPMI_OEM_KONTRON , 0xC0 , "OEM Firmware Info" }, { IPMI_OEM_KONTRON , 0xC2 , "OEM Init Agent" }, { IPMI_OEM_KONTRON , 0xC3 , "OEM IPMBL Link State" }, { IPMI_OEM_KONTRON , 0xC4 , "OEM Board Reset" }, { IPMI_OEM_KONTRON , 0xC5 , "OEM FRU Information Agent" }, { IPMI_OEM_KONTRON , 0xC6 , "OEM POST Value Sensor" }, { IPMI_OEM_KONTRON , 0xC7 , "OEM FWUM Status" }, { IPMI_OEM_KONTRON , 0xC8 , "OEM Switch Mngt Software Status" }, { IPMI_OEM_PICMG , 0xF0 , "PICMG FRU Hotswap" }, { IPMI_OEM_PICMG , 0xF1 , "PICMG IPMB0 Link State" }, { 0xffff, 0x00, NULL } }; const struct valstr ipmi_netfn_vals[] = { { IPMI_NETFN_CHASSIS, "Chassis" }, { IPMI_NETFN_BRIDGE, "Bridge" }, { IPMI_NETFN_SE, "SensorEvent" }, { IPMI_NETFN_APP, "Application" }, { IPMI_NETFN_FIRMWARE, "Firmware" }, { IPMI_NETFN_STORAGE, "Storage" }, { IPMI_NETFN_TRANSPORT, "Transport" }, { 0xff, NULL }, }; /* * From table 26-4 of the IPMI v2 specification */ const struct valstr impi_bit_rate_vals[] = { { 0x00, "IPMI-Over-Serial-Setting"}, /* Using the value in the IPMI Over Serial Config */ { 0x06, "9.6" }, { 0x07, "19.2" }, { 0x08, "38.4" }, { 0x09, "57.6" }, { 0x0A, "115.2" }, { 0x00, NULL }, }; const struct valstr ipmi_channel_activity_type_vals[] = { { 0, "IPMI Messaging session active" }, { 1, "Callback Messaging session active" }, { 2, "Dial-out Alert active" }, { 3, "TAP Page Active" }, { 0x00, NULL }, }; const struct valstr ipmi_privlvl_vals[] = { { IPMI_SESSION_PRIV_CALLBACK, "CALLBACK" }, { IPMI_SESSION_PRIV_USER, "USER" }, { IPMI_SESSION_PRIV_OPERATOR, "OPERATOR" }, { IPMI_SESSION_PRIV_ADMIN, "ADMINISTRATOR" }, { IPMI_SESSION_PRIV_OEM, "OEM" }, { 0xF, "NO ACCESS" }, { 0xFF, NULL }, }; const struct valstr ipmi_set_in_progress_vals[] = { { IPMI_SET_IN_PROGRESS_SET_COMPLETE, "set-complete" }, { IPMI_SET_IN_PROGRESS_IN_PROGRESS, "set-in-progress" }, { IPMI_SET_IN_PROGRESS_COMMIT_WRITE, "commit-write" }, { 0, NULL }, }; const struct valstr ipmi_authtype_session_vals[] = { { IPMI_SESSION_AUTHTYPE_NONE, "NONE" }, { IPMI_SESSION_AUTHTYPE_MD2, "MD2" }, { IPMI_SESSION_AUTHTYPE_MD5, "MD5" }, { IPMI_SESSION_AUTHTYPE_PASSWORD, "PASSWORD" }, { IPMI_SESSION_AUTHTYPE_OEM, "OEM" }, { 0xFF, NULL }, }; const struct valstr ipmi_authtype_vals[] = { { IPMI_1_5_AUTH_TYPE_BIT_NONE, "NONE" }, { IPMI_1_5_AUTH_TYPE_BIT_MD2, "MD2" }, { IPMI_1_5_AUTH_TYPE_BIT_MD5, "MD5" }, { IPMI_1_5_AUTH_TYPE_BIT_PASSWORD, "PASSWORD" }, { IPMI_1_5_AUTH_TYPE_BIT_OEM, "OEM" }, { 0, NULL }, }; const struct valstr entity_id_vals[] = { { 0x00, "Unspecified" }, { 0x01, "Other" }, { 0x02, "Unknown" }, { 0x03, "Processor" }, { 0x04, "Disk or Disk Bay" }, { 0x05, "Peripheral Bay" }, { 0x06, "System Management Module" }, { 0x07, "System Board" }, { 0x08, "Memory Module" }, { 0x09, "Processor Module" }, { 0x0a, "Power Supply" }, { 0x0b, "Add-in Card" }, { 0x0c, "Front Panel Board" }, { 0x0d, "Back Panel Board" }, { 0x0e, "Power System Board" }, { 0x0f, "Drive Backplane" }, { 0x10, "System Internal Expansion Board" }, { 0x11, "Other System Board" }, { 0x12, "Processor Board" }, { 0x13, "Power Unit" }, { 0x14, "Power Module" }, { 0x15, "Power Management" }, { 0x16, "Chassis Back Panel Board" }, { 0x17, "System Chassis" }, { 0x18, "Sub-Chassis" }, { 0x19, "Other Chassis Board" }, { 0x1a, "Disk Drive Bay" }, { 0x1b, "Peripheral Bay" }, { 0x1c, "Device Bay" }, { 0x1d, "Fan Device" }, { 0x1e, "Cooling Unit" }, { 0x1f, "Cable/Interconnect" }, { 0x20, "Memory Device" }, { 0x21, "System Management Software" }, { 0x22, "BIOS" }, { 0x23, "Operating System" }, { 0x24, "System Bus" }, { 0x25, "Group" }, { 0x26, "Remote Management Device" }, { 0x27, "External Environment" }, { 0x28, "Battery" }, { 0x29, "Processing Blade" }, { 0x2A, "Connectivity Switch" }, { 0x2B, "Processor/Memory Module" }, { 0x2C, "I/O Module" }, { 0x2D, "Processor/IO Module" }, { 0x2E, "Management Controller Firmware" }, { 0x2F, "IPMI Channel" }, { 0x30, "PCI Bus" }, { 0x31, "PCI Express Bus" }, { 0x32, "SCSI Bus (parallel)" }, { 0x33, "SATA/SAS Bus" }, { 0x34, "Processor/Front-Side Bus" }, /* PICMG */ { 0xA0, "PICMG Front Board" }, { 0xC0, "PICMG Rear Transition Module" }, { 0xC1, "PICMG AdvancedMC Module" }, { 0xF0, "PICMG Shelf Management Controller" }, { 0xF1, "PICMG Filtration Unit" }, { 0xF2, "PICMG Shelf FRU Information" }, { 0xF3, "PICMG Alarm Panel" }, { 0x00, NULL }, }; const struct valstr entity_device_type_vals[] = { { 0x00, "Reserved" }, { 0x01, "Reserved" }, { 0x02, "DS1624 temperature sensor" }, { 0x03, "DS1621 temperature sensor" }, { 0x04, "LM75 Temperature Sensor" }, { 0x05, "Heceta ASIC" }, { 0x06, "Reserved" }, { 0x07, "Reserved" }, { 0x08, "EEPROM, 24C01" }, { 0x09, "EEPROM, 24C02" }, { 0x0a, "EEPROM, 24C04" }, { 0x0b, "EEPROM, 24C08" }, { 0x0c, "EEPROM, 24C16" }, { 0x0d, "EEPROM, 24C17" }, { 0x0e, "EEPROM, 24C32" }, { 0x0f, "EEPROM, 24C64" }, { 0x1000, "IPMI FRU Inventory" }, { 0x1001, "DIMM Memory ID" }, { 0x1002, "IPMI FRU Inventory" }, { 0x1003, "System Processor Cartridge FRU" }, { 0x11, "Reserved" }, { 0x12, "Reserved" }, { 0x13, "Reserved" }, { 0x14, "PCF 8570 256 byte RAM" }, { 0x15, "PCF 8573 clock/calendar" }, { 0x16, "PCF 8574A I/O Port" }, { 0x17, "PCF 8583 clock/calendar" }, { 0x18, "PCF 8593 clock/calendar" }, { 0x19, "Clock calendar" }, { 0x1a, "PCF 8591 A/D, D/A Converter" }, { 0x1b, "I/O Port" }, { 0x1c, "A/D Converter" }, { 0x1d, "D/A Converter" }, { 0x1e, "A/D, D/A Converter" }, { 0x1f, "LCD Controller/Driver" }, { 0x20, "Core Logic (Chip set) Device" }, { 0x21, "LMC6874 Intelligent Battery controller" }, { 0x22, "Intelligent Batter controller" }, { 0x23, "Combo Management ASIC" }, { 0x24, "Maxim 1617 Temperature Sensor" }, { 0xbf, "Other/Unspecified" }, { 0x00, NULL }, }; const struct valstr ipmi_channel_protocol_vals[] = { { 0x00, "reserved" }, { 0x01, "IPMB-1.0" }, { 0x02, "ICMB-1.0" }, { 0x03, "reserved" }, { 0x04, "IPMI-SMBus" }, { 0x05, "KCS" }, { 0x06, "SMIC" }, { 0x07, "BT-10" }, { 0x08, "BT-15" }, { 0x09, "TMode" }, { 0x1c, "OEM 1" }, { 0x1d, "OEM 2" }, { 0x1e, "OEM 3" }, { 0x1f, "OEM 4" }, { 0x00, NULL }, }; const struct valstr ipmi_channel_medium_vals[] = { { IPMI_CHANNEL_MEDIUM_RESERVED, "reserved" }, { IPMI_CHANNEL_MEDIUM_IPMB_I2C, "IPMB (I2C)" }, { IPMI_CHANNEL_MEDIUM_ICMB_1, "ICMB v1.0" }, { IPMI_CHANNEL_MEDIUM_ICMB_09, "ICMB v0.9" }, { IPMI_CHANNEL_MEDIUM_LAN, "802.3 LAN" }, { IPMI_CHANNEL_MEDIUM_SERIAL, "Serial/Modem" }, { IPMI_CHANNEL_MEDIUM_LAN_OTHER,"Other LAN" }, { IPMI_CHANNEL_MEDIUM_SMBUS_PCI,"PCI SMBus" }, { IPMI_CHANNEL_MEDIUM_SMBUS_1, "SMBus v1.0/v1.1" }, { IPMI_CHANNEL_MEDIUM_SMBUS_2, "SMBus v2.0" }, { IPMI_CHANNEL_MEDIUM_USB_1, "USB 1.x" }, { IPMI_CHANNEL_MEDIUM_USB_2, "USB 2.x" }, { IPMI_CHANNEL_MEDIUM_SYSTEM, "System Interface" }, { 0x00, NULL }, }; const struct valstr completion_code_vals[] = { { 0x00, "Command completed normally" }, { 0xc0, "Node busy" }, { 0xc1, "Invalid command" }, { 0xc2, "Invalid command on LUN" }, { 0xc3, "Timeout" }, { 0xc4, "Out of space" }, { 0xc5, "Reservation cancelled or invalid" }, { 0xc6, "Request data truncated" }, { 0xc7, "Request data length invalid" }, { 0xc8, "Request data field length limit exceeded" }, { 0xc9, "Parameter out of range" }, { 0xca, "Cannot return number of requested data bytes" }, { 0xcb, "Requested sensor, data, or record not found" }, { 0xcc, "Invalid data field in request" }, { 0xcd, "Command illegal for specified sensor or record type" }, { 0xce, "Command response could not be provided" }, { 0xcf, "Cannot execute duplicated request" }, { 0xd0, "SDR Repository in update mode" }, { 0xd1, "Device firmeware in update mode" }, { 0xd2, "BMC initialization in progress" }, { 0xd3, "Destination unavailable" }, { 0xd4, "Insufficient privilege level" }, { 0xd5, "Command not supported in present state" }, { 0xff, "Unspecified error" }, { 0x00, NULL } }; const struct valstr ipmi_chassis_power_control_vals[] = { { IPMI_CHASSIS_CTL_POWER_DOWN, "Down/Off" }, { IPMI_CHASSIS_CTL_POWER_UP, "Up/On" }, { IPMI_CHASSIS_CTL_POWER_CYCLE, "Cycle" }, { IPMI_CHASSIS_CTL_HARD_RESET, "Reset" }, { IPMI_CHASSIS_CTL_PULSE_DIAG, "Diag" }, { IPMI_CHASSIS_CTL_ACPI_SOFT, "Soft" }, { 0x00, NULL }, }; const struct valstr ipmi_auth_algorithms[] = { { IPMI_AUTH_RAKP_NONE, "none" }, { IPMI_AUTH_RAKP_HMAC_SHA1, "hmac_sha1" }, { IPMI_AUTH_RAKP_HMAC_MD5, "hmac_md5" }, { IPMI_AUTH_RAKP_HMAC_SHA256, "hmac_sha256" }, { 0x00, NULL } }; const struct valstr ipmi_integrity_algorithms[] = { { IPMI_INTEGRITY_NONE, "none" }, { IPMI_INTEGRITY_HMAC_SHA1_96, "hmac_sha1_96" }, { IPMI_INTEGRITY_HMAC_MD5_128, "hmac_md5_128" }, { IPMI_INTEGRITY_MD5_128 , "md5_128" }, { IPMI_INTEGRITY_HMAC_SHA256_128, "hmac_sha256_128" }, { 0x00, NULL } }; const struct valstr ipmi_encryption_algorithms[] = { { IPMI_CRYPT_NONE, "none" }, { IPMI_CRYPT_AES_CBC_128, "aes_cbc_128" }, { IPMI_CRYPT_XRC4_128, "xrc4_128" }, { IPMI_CRYPT_XRC4_40, "xrc4_40" }, { 0x00, NULL } }; ipmiutil-3.0.7/lib/lanplus/helper.c0000644000076400007640000002504313160502144016740 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifdef WIN32 #include #include #include #include #include #include #include #else #include #include #include /* For TIOCNOTTY */ #include #include #include #include #include #include #include #include #include #endif #if HAVE_CONFIG_H # include #endif #ifdef HAVE_PATHS_H #include #else #define _PATH_VARRUN "/var/run/" #define _PATH_TTY "/dev/tty" #endif #include #include #include #include extern int verbose; /* By default, moved to util/subs.c for more global access. * Define LANHELPER to define these here for ipmi_lanplus.a */ #ifdef LANHELPER uint32_t buf2long(uint8_t * buf) { return (uint32_t)(buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0]); } uint16_t buf2short(uint8_t * buf) { return (uint16_t)(buf[1] << 8 | buf[0]); } const char * buf2str(uint8_t * buf, int len) { static char str[1024]; int i; if (len <= 0 || len > 1024) return NULL; memset(str, 0, 1024); for (i=0; i 0; s--, d++) c += *d; return -c; } /* ipmi_open_file - safely open a file for reading or writing * * @file: filename * @rw: read-write flag, 1=write * * returns pointer to file handler on success * returns NULL on error */ FILE * ipmi_open_file(const char * file, int rw) { #ifndef WIN32 struct stat st1, st2; #endif FILE * fp; /* verify existence */ #ifdef WIN32 if (1 == 0) #else if (lstat(file, &st1) < 0) #endif { if (rw) { /* does not exist, ok to create */ fp = fopen(file, "w"); if (fp == NULL) { lperror(LOG_ERR, "Unable to open file %s " "for write", file); return NULL; } /* created ok, now return the descriptor */ return fp; } else { lprintf(LOG_ERR, "File %s does not exist", file); return NULL; } } #ifndef ENABLE_FILE_SECURITY if (!rw) { /* on read skip the extra checks */ fp = fopen(file, "r"); if (fp == NULL) { lperror(LOG_ERR, "Unable to open file %s", file); return NULL; } return fp; } #endif #ifndef WIN32 /* it exists - only regular files, not links */ if (S_ISREG(st1.st_mode) == 0) { lprintf(LOG_ERR, "File %s has invalid mode: %d", file, st1.st_mode); return NULL; } /* allow only files with 1 link (itself) */ if (st1.st_nlink != 1) { lprintf(LOG_ERR, "File %s has invalid link count: %d != 1", file, (int)st1.st_nlink); return NULL; } #endif fp = fopen(file, rw ? "w+" : "r"); if (fp == NULL) { lperror(LOG_ERR, "Unable to open file %s", file); return NULL; } #ifndef WIN32 /* stat again */ if (fstat(fileno(fp), &st2) < 0) { lperror(LOG_ERR, "Unable to stat file %s", file); fclose(fp); return NULL; } /* verify inode */ if (st1.st_ino != st2.st_ino) { lprintf(LOG_ERR, "File %s has invalid inode: %d != %d", file, st1.st_ino, st2.st_ino); fclose(fp); return NULL; } /* verify owner */ if (st1.st_uid != st2.st_uid) { lprintf(LOG_ERR, "File %s has invalid user id: %d != %d", file, st1.st_uid, st2.st_uid); fclose(fp); return NULL; } /* verify inode */ if (st2.st_nlink != 1) { lprintf(LOG_ERR, "File %s has invalid link count: %d != 1", file, st2.st_nlink); fclose(fp); return NULL; } #endif return fp; } void ipmi_start_daemon(struct ipmi_intf *intf) { #ifndef WIN32 pid_t pid; int fd, i; #ifdef SIGHUP sigset_t sighup; #endif /* if we are started from init no need to become daemon */ if (getppid() == 1) return; #ifdef SIGHUP sigemptyset(&sighup); sigaddset(&sighup, SIGHUP); if (sigprocmask(SIG_UNBLOCK, &sighup, NULL) < 0) fprintf(stderr, "ERROR: could not unblock SIGHUP signal\n"); signal(SIGHUP, SIG_IGN); #endif #ifdef SIGTTOU signal(SIGTTOU, SIG_IGN); #endif #ifdef SIGTTIN signal(SIGTTIN, SIG_IGN); #endif #ifdef SIGQUIT signal(SIGQUIT, SIG_IGN); #endif #ifdef SIGTSTP signal(SIGTSTP, SIG_IGN); #endif pid = (pid_t) fork(); if (pid < 0 || pid > 0) exit(0); #if defined(SIGTSTP) && defined(TIOCNOTTY) if (setpgid(0, getpid()) == -1) exit(1); if ((fd = open(_PATH_TTY, O_RDWR)) >= 0) { ioctl(fd, TIOCNOTTY, NULL); close(fd); } #else if (setpgid(0, 0) == -1) exit(1); pid = (pid_t) fork(); if (pid < 0 || pid > 0) exit(0); #endif i = chdir("/"); umask(0); for (fd=0; fd<64; fd++) { if (fd != intf->fd) close(fd); } fd = open("/dev/null", O_RDWR); i = dup(0); i = dup(0); #endif } ipmiutil-3.0.7/lib/lanplus/lanplus.c0000644000076400007640000033277113160502144017150 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ /* ARCress, TODO: improve error handling and remove all assert() calls here. */ #ifdef WIN32 #include #include #include #include #include #include //#define HAVE_IPV6 1 #ifdef HAVE_IPV6 #include //#include #else #include #endif #include #else #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #if defined(LINUX) #define HAVE_IPV6 1 /* TODO: fixups in BSD/Solaris for ipv6 method */ #endif #if defined(MACOS) #include #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include "lanplus.h" #include "lanplus_crypt.h" #include "lanplus_crypt_impl.h" #include "lanplus_dump.h" #include "rmcp.h" #include "asf.h" extern const struct valstr ipmi_rakp_return_codes[]; extern const struct valstr ipmi_priv_levels[]; extern const struct valstr ipmi_auth_algorithms[]; extern const struct valstr ipmi_integrity_algorithms[]; extern const struct valstr ipmi_encryption_algorithms[]; #if defined(AI_NUMERICSERV) static int my_ai_flags = AI_NUMERICSERV; /*0x0400 Dont use name resolution NEW*/ // static int my_ai_flags = AI_NUMERICHOST; /*0x0004 Dont use name resolution*/ #else #undef HAVE_IPV6 #endif #ifdef HAVE_IPV6 #define SOCKADDR_T struct sockaddr_storage #else #define SOCKADDR_T struct sockaddr_in #endif char lan2_nodename[80] = {0}; /*SZGNOE = 80*/ static int lan2_timeout = IPMI_LAN_TIMEOUT; /*lanplus.h, usu =1*/ static int slow_link = 0; /* flag, =1 if slow link, latency > 100ms */ static int recv_delay = 100; /* delay before recv, usually 100us */ static struct ipmi_rq_entry * ipmi_req_entries; static struct ipmi_rq_entry * ipmi_req_entries_tail; static int ipmi_lanplus_setup(struct ipmi_intf * intf); static int ipmi_lanplus_keepalive(struct ipmi_intf * intf); static int ipmi_lan_send_packet(struct ipmi_intf * intf, uint8_t * data, int data_len); static struct ipmi_rs * ipmi_lan_recv_packet(struct ipmi_intf * intf); static struct ipmi_rs * ipmi_lan_poll_recv(struct ipmi_intf * intf); static struct ipmi_rs * ipmi_lanplus_send_ipmi_cmd(struct ipmi_intf * intf, struct ipmi_rq * req); static struct ipmi_rs * ipmi_lanplus_send_payload(struct ipmi_intf * intf, struct ipmi_v2_payload * payload); static void getIpmiPayloadWireRep( struct ipmi_intf * intf, struct ipmi_v2_payload * payload, /* in */ uint8_t * out, struct ipmi_rq * req, uint8_t rq_seq, uint8_t curr_seq); static void getSolPayloadWireRep( struct ipmi_intf * intf, uint8_t * msg, struct ipmi_v2_payload * payload); static void read_open_session_response(struct ipmi_rs * rsp, int offset); static void read_rakp2_message(struct ipmi_rs * rsp, int offset, uint8_t alg); static void read_rakp4_message(struct ipmi_rs * rsp, int offset, uint8_t alg); static int read_session_data(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s); static int read_session_data_v15(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s); static int read_session_data_v2x(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s); static void read_ipmi_response(struct ipmi_rs * rsp, int * offset); static void read_sol_packet(struct ipmi_rs * rsp, int * offset); static struct ipmi_rs * ipmi_lanplus_recv_sol(struct ipmi_intf * intf); static struct ipmi_rs * ipmi_lanplus_send_sol( struct ipmi_intf * intf, void * payload); static int check_sol_packet_for_new_data( struct ipmi_intf * intf, struct ipmi_rs *rsp); static void ack_sol_packet( struct ipmi_intf * intf, struct ipmi_rs * rsp); static uint8_t bridgePossible = 0; #if defined(WIN32) || defined(SOLARIS) || defined(HPUX) struct ipmi_intf ipmi_lanplus_intf; void ipmilanplus_init(struct ipmi_intf *intf) { strcpy(intf->name,"lanplus"); intf->setup = ipmi_lanplus_setup; intf->open = ipmi_lanplus_open; intf->close = ipmi_lanplus_close; intf->sendrecv = ipmi_lanplus_send_ipmi_cmd; intf->recv_sol = ipmi_lanplus_recv_sol; intf->send_sol = ipmi_lanplus_send_sol; intf->keepalive = ipmi_lanplus_keepalive; intf->target_addr = IPMI_BMC_SLAVE_ADDR; /*0x20*/ } #else struct ipmi_intf ipmi_lanplus_intf = { name: "lanplus", desc: "IPMI v2.0 RMCP+ LAN Interface", setup: ipmi_lanplus_setup, open: ipmi_lanplus_open, close: ipmi_lanplus_close, sendrecv: ipmi_lanplus_send_ipmi_cmd, recv_sol: ipmi_lanplus_recv_sol, send_sol: ipmi_lanplus_send_sol, keepalive: ipmi_lanplus_keepalive, target_addr: IPMI_BMC_SLAVE_ADDR, }; void ipmilanplus_init(struct ipmi_intf *intf) { return; } #endif extern int verbose; #ifdef WIN32 WSADATA lan2_ws; #define assert(N) /*empty*/ #endif static void lan2_usleep(int s, int u) /*lanplus copy of os_usleep*/ { if (s == 0) { #ifdef WIN32 if (u >= 1000) Sleep(u/1000); } else { Sleep(s * 1000); #else usleep(u); } else { sleep(s); #endif } } void show_lasterr(char *tag) { #ifdef WIN32 int rv = 0; rv = WSAGetLastError(); fprintf(stderr,"%s LastError = %d\n",tag,rv); #else fprintf(stderr,"%s errno = %d\n",tag,errno); #endif } /* * lanplus_get_requested_ciphers * * Set the authentication, integrity and encryption algorithms based * on the cipher suite ID. See table 22-19 in the IPMIv2 spec for the * source of this information. * * param cipher_suite_id [in] * param auth_alg [out] * param integrity_alg [out] * param crypt_alg [out] * * returns 0 on success * 1 on failure */ int lanplus_get_requested_ciphers(int cipher_suite_id, uint8_t * auth_alg, uint8_t * integrity_alg, uint8_t * crypt_alg) { if ((cipher_suite_id < 0) || (cipher_suite_id > 17)) return 1; /* See table 22-19 for the source of the statement */ switch (cipher_suite_id) { case 0: *auth_alg = IPMI_AUTH_RAKP_NONE; *integrity_alg = IPMI_INTEGRITY_NONE; *crypt_alg = IPMI_CRYPT_NONE; break; case 1: *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1; *integrity_alg = IPMI_INTEGRITY_NONE; *crypt_alg = IPMI_CRYPT_NONE; break; case 2: *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1; *integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96; *crypt_alg = IPMI_CRYPT_NONE; break; case 3: *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1; *integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96; *crypt_alg = IPMI_CRYPT_AES_CBC_128; break; case 4: *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1; *integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96; *crypt_alg = IPMI_CRYPT_XRC4_128; break; case 5: *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1; *integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96; *crypt_alg = IPMI_CRYPT_XRC4_40; break; case 6: *auth_alg = IPMI_AUTH_RAKP_HMAC_MD5; *integrity_alg = IPMI_INTEGRITY_NONE; *crypt_alg = IPMI_CRYPT_NONE; break; case 7: *auth_alg = IPMI_AUTH_RAKP_HMAC_MD5; *integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128; *crypt_alg = IPMI_CRYPT_NONE; break; case 8: *auth_alg = IPMI_AUTH_RAKP_HMAC_MD5; *integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128; *crypt_alg = IPMI_CRYPT_AES_CBC_128; break; case 9: *auth_alg = IPMI_AUTH_RAKP_HMAC_MD5; *integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128; *crypt_alg = IPMI_CRYPT_XRC4_128; break; case 10: *auth_alg = IPMI_AUTH_RAKP_HMAC_MD5; *integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128; *crypt_alg = IPMI_CRYPT_XRC4_40; break; case 11: *auth_alg = IPMI_AUTH_RAKP_HMAC_MD5; *integrity_alg = IPMI_INTEGRITY_MD5_128; *crypt_alg = IPMI_CRYPT_NONE; break; case 12: *auth_alg = IPMI_AUTH_RAKP_HMAC_MD5; *integrity_alg = IPMI_INTEGRITY_MD5_128; *crypt_alg = IPMI_CRYPT_AES_CBC_128; break; case 13: *auth_alg = IPMI_AUTH_RAKP_HMAC_MD5; *integrity_alg = IPMI_INTEGRITY_MD5_128; *crypt_alg = IPMI_CRYPT_XRC4_128; break; case 14: *auth_alg = IPMI_AUTH_RAKP_HMAC_MD5; *integrity_alg = IPMI_INTEGRITY_MD5_128; *crypt_alg = IPMI_CRYPT_XRC4_40; break; #ifdef HAVE_SHA256 case 15: // Note: Cipher Suite ID 15 is in in IPMI Spec or Errata 7 *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA256; *integrity_alg = IPMI_INTEGRITY_NONE; *crypt_alg = IPMI_CRYPT_NONE; break; case 16: // Note: Cipher Suite ID 16 is in in IPMI Spec or Errata 7 *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA256; *integrity_alg = IPMI_INTEGRITY_HMAC_SHA256_128; *crypt_alg = IPMI_CRYPT_NONE; break; case 17: // Note: Cipher Suite Id from DCMI 1.1 Spec *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA256; *integrity_alg = IPMI_INTEGRITY_HMAC_SHA256_128; *crypt_alg = IPMI_CRYPT_AES_CBC_128; break; /* HAVE_SHA256: based on an MD5_SHA256 patch from Holger Liebig */ #endif default: lprintf(LOG_ERR, "invalid cipher suite id %d",cipher_suite_id); return 1; break; } return 0; } /* * Reverse the order of arbitrarily long strings of bytes */ void lanplus_swap( uint8_t * buffer, int length) { int i; uint8_t temp; for (i =0; i < length/2; ++i) { temp = buffer[i]; buffer[i] = buffer[length - 1 - i]; buffer[length - 1 - i] = temp; } } void lanplus_set_recvdelay( int delay) { /* set the delay between send & recv in usec, default = 100us */ recv_delay = delay; if (delay > 100) { slow_link = 1; lan2_timeout = 2; } } static const struct valstr plus_payload_types_vals[] = { { IPMI_PAYLOAD_TYPE_IPMI, "IPMI (0)" }, // IPMI Message { IPMI_PAYLOAD_TYPE_SOL, "SOL (1)" }, // SOL (Serial over LAN) { IPMI_PAYLOAD_TYPE_OEM, "OEM (2)" }, // OEM Explicid { IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST, "OpenSession Req (0x10)" }, { IPMI_PAYLOAD_TYPE_RMCP_OPEN_RESPONSE,"OpenSession Resp (0x11)" }, { IPMI_PAYLOAD_TYPE_RAKP_1, "RAKP1 (0x12)" }, { IPMI_PAYLOAD_TYPE_RAKP_2, "RAKP2 (0x13)" }, { IPMI_PAYLOAD_TYPE_RAKP_3, "RAKP3 (0x14)" }, { IPMI_PAYLOAD_TYPE_RAKP_4, "RAKP4 (0x15)" }, { 0x00, NULL }, }; static struct ipmi_rq_entry * ipmi_req_add_entry(struct ipmi_intf * intf, struct ipmi_rq * req, uint8_t req_seq) { struct ipmi_rq_entry * e; e = malloc(sizeof(struct ipmi_rq_entry)); if (e == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return NULL; } memset(e, 0, sizeof(struct ipmi_rq_entry)); memcpy(&e->req, req, sizeof(struct ipmi_rq)); e->intf = intf; e->rq_seq = req_seq; if (ipmi_req_entries == NULL) ipmi_req_entries = e; else ipmi_req_entries_tail->next = e; ipmi_req_entries_tail = e; lprintf(LOG_DEBUG+3, "added list entry seq=0x%02x cmd=0x%02x", e->rq_seq, e->req.msg.cmd); return e; } static struct ipmi_rq_entry * ipmi_req_lookup_entry(uint8_t seq, uint8_t cmd) { struct ipmi_rq_entry * e = ipmi_req_entries; while (e && (e->rq_seq != seq || e->req.msg.cmd != cmd)) { if (e == e->next) return NULL; e = e->next; } return e; } static void ipmi_req_remove_entry(uint8_t seq, uint8_t cmd) { struct ipmi_rq_entry * p, * e, *saved_next_entry; e = p = ipmi_req_entries; while (e && (e->rq_seq != seq || e->req.msg.cmd != cmd)) { p = e; e = e->next; } if (e) { lprintf(LOG_DEBUG+3, "removed list entry seq=0x%02x cmd=0x%02x", seq, cmd); saved_next_entry = e->next; p->next = (p->next == e->next) ? NULL : e->next; /* If entry being removed is first in list, fix up list head */ if (ipmi_req_entries == e) { if (ipmi_req_entries != p) ipmi_req_entries = p; else ipmi_req_entries = saved_next_entry; } /* If entry being removed is last in list, fix up list tail */ if (ipmi_req_entries_tail == e) { if (ipmi_req_entries_tail != p) ipmi_req_entries_tail = p; else ipmi_req_entries_tail = NULL; } if (e->msg_data) free(e->msg_data); free(e); } } static void ipmi_req_clear_entries(void) { struct ipmi_rq_entry * p, * e; e = ipmi_req_entries; while (e) { lprintf(LOG_DEBUG+3, "cleared list entry seq=0x%02x cmd=0x%02x", e->rq_seq, e->req.msg.cmd); p = e->next; if (e->msg_data) free(e->msg_data); /*added in v2.8.5*/ free(e); e = p; } ipmi_req_entries = NULL; } int ipmi_lan_send_packet( struct ipmi_intf * intf, uint8_t * data, int data_len) { if (verbose >= 5) printbuf(data, data_len, ">> sending packet"); return send(intf->fd, data, data_len, 0); } struct ipmi_rs * ipmi_lan_recv_packet(struct ipmi_intf * intf) { static struct ipmi_rs rsp; fd_set read_set, err_set; struct timeval tmout; int ret = 0; int er,rd; FD_ZERO(&read_set); FD_SET(intf->fd, &read_set); FD_ZERO(&err_set); FD_SET(intf->fd, &err_set); tmout.tv_sec = intf->session->timeout; tmout.tv_usec = 0; ret = select((int)(intf->fd + 1), &read_set, NULL, &err_set, &tmout); er = FD_ISSET(intf->fd, &err_set); rd = FD_ISSET(intf->fd, &read_set); if (ret < 0 || er || !rd) { if (verbose >= 5) lprintf(LOG_INFO, "select1 error ret=%d, err=%d read=%d", ret,er,rd); return NULL; } /* the first read may return ECONNREFUSED because the rmcp ping * packet--sent to UDP port 623--will be processed by both the * BMC and the OS. * * The problem with this is that the ECONNREFUSED takes * priority over any other received datagram; that means that * the Connection Refused shows up _before_ the response packet, * regardless of the order they were sent out. (unless the * response is read before the connection refused is returned) */ #ifdef WIN32 ret = recv(intf->fd, &rsp.data[0], IPMI_BUF_SIZE, 0); #else ret = recv(intf->fd, &rsp.data, IPMI_BUF_SIZE, 0); #endif if (ret < 0) { if (verbose >= 5) lprintf(LOG_INFO, "recv1 ret=%d",ret); FD_ZERO(&read_set); FD_SET(intf->fd, &read_set); FD_ZERO(&err_set); FD_SET(intf->fd, &err_set); tmout.tv_sec = intf->session->timeout; tmout.tv_usec = 0; ret = select((int)(intf->fd + 1), &read_set, NULL, &err_set, &tmout); if (ret < 0) { if (FD_ISSET(intf->fd, &err_set) || !FD_ISSET(intf->fd, &read_set)) { if (verbose >= 5) lprintf(LOG_INFO,"select2 error ret=%d",ret); return NULL; } #ifdef WIN32 ret = recv(intf->fd, &rsp.data[0], IPMI_BUF_SIZE, 0); #else ret = recv(intf->fd, &rsp.data, IPMI_BUF_SIZE, 0); #endif if (ret < 0) { if (verbose >= 5) lprintf(LOG_INFO, "recv2 ret=%d",ret); return NULL; } } } if (ret == 0) { if (verbose >= 5) lprintf(LOG_INFO, "recv ret==0"); return NULL; } rsp.data[ret] = '\0'; rsp.data_len = ret; if (verbose >= 5) printbuf(rsp.data, rsp.data_len, "<< received packet"); return &rsp; } /* * parse response RMCP "pong" packet * * return -1 if ping response not received * returns 0 if IPMI is NOT supported * returns 1 if IPMI is supported * * udp.source = 0x026f // RMCP_UDP_PORT * udp.dest = ? // udp.source from rmcp-ping * udp.len = ? * udp.check = ? * rmcp.ver = 0x06 // RMCP Version 1.0 * rmcp.__res = 0x00 // RESERVED * rmcp.seq = 0xff // no RMCP ACK * rmcp.class = 0x06 // RMCP_CLASS_ASF * asf.iana = 0x000011be // ASF_RMCP_IANA * asf.type = 0x40 // ASF_TYPE_PONG * asf.tag = ? // asf.tag from rmcp-ping * asf.__res = 0x00 // RESERVED * asf.len = 0x10 // 16 bytes * asf.data[3:0]= 0x000011be // IANA# = RMCP_ASF_IANA if no OEM * asf.data[7:4]= 0x00000000 // OEM-defined (not for IPMI) * asf.data[8] = 0x81 // supported entities * // [7]=IPMI [6:4]=RES [3:0]=ASF_1.0 * asf.data[9] = 0x00 // supported interactions (reserved) * asf.data[f:a]= 0x000000000000 */ static int ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp) { struct rmcp_pong { struct rmcp_hdr rmcp; struct asf_hdr asf; uint32_t iana; uint32_t oem; uint8_t sup_entities; uint8_t sup_interact; uint8_t reserved[6]; } * pong; if (!rsp) return -1; pong = (struct rmcp_pong *)rsp->data; if (verbose) printf("Received IPMI/RMCP response packet: " "IPMI%s Supported\n", (pong->sup_entities & 0x80) ? "" : " NOT"); if (verbose > 1) printf(" ASF Version %s\n" " RMCP Version %s\n" " RMCP Sequence %d\n" " IANA Enterprise %lu\n\n", (pong->sup_entities & 0x01) ? "1.0" : "unknown", (pong->rmcp.ver == 6) ? "1.0" : "unknown", pong->rmcp.seq, (unsigned long)ntohl(pong->iana)); return (pong->sup_entities & 0x80) ? 1 : 0; } /* build and send RMCP presence ping packet * * RMCP ping * * udp.source = ? * udp.dest = 0x026f // RMCP_UDP_PORT * udp.len = ? * udp.check = ? * rmcp.ver = 0x06 // RMCP Version 1.0 * rmcp.__res = 0x00 // RESERVED * rmcp.seq = 0xff // no RMCP ACK * rmcp.class = 0x06 // RMCP_CLASS_ASF * asf.iana = 0x000011be // ASF_RMCP_IANA * asf.type = 0x80 // ASF_TYPE_PING * asf.tag = ? // ASF sequence number * asf.__res = 0x00 // RESERVED * asf.len = 0x00 * */ int ipmiv2_lan_ping(struct ipmi_intf * intf) { uint8_t * data; int rv; #if defined(WIN32) || defined(SOLARIS) || defined(HPUX) struct asf_hdr asf_ping; struct rmcp_hdr rmcp_ping; int len = sizeof(rmcp_ping) + sizeof(asf_ping); asf_ping.iana = htonl(ASF_RMCP_IANA); asf_ping.type = ASF_TYPE_PING; rmcp_ping.ver = RMCP_VERSION_1; rmcp_ping.__rsvd = 0; rmcp_ping.class = RMCP_CLASS_ASF; rmcp_ping.seq = 0xff; #else struct asf_hdr asf_ping = { .iana = htonl(ASF_RMCP_IANA), .type = ASF_TYPE_PING, }; struct rmcp_hdr rmcp_ping = { .ver = RMCP_VERSION_1, .__rsvd = 0, .class = RMCP_CLASS_ASF, .seq = 0xff, }; int len = sizeof(rmcp_ping) + sizeof(asf_ping); #endif data = malloc(len); if (data == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return -1; } memset(data, 0, len); memcpy(data, &rmcp_ping, sizeof(rmcp_ping)); memcpy(data+sizeof(rmcp_ping), &asf_ping, sizeof(asf_ping)); lprintf(LOG_DEBUG, "Sending IPMI/RMCP presence ping packet"); rv = ipmi_lan_send_packet(intf, data, len); free(data); if (rv < 0) { lprintf(LOG_ERR, "Unable to send IPMI presence ping packet"); return -1; } if (ipmi_lan_poll_recv(intf) == 0) /*NULL rsp*/ return 0; return 1; } /** * * ipmi_lan_poll_recv * * Receive whatever comes back. Ignore received packets that don't correspond * to a request we've sent. * * Returns: the ipmi_rs packet describing the/a reponse we expect. */ static struct ipmi_rs * ipmi_lan_poll_recv(struct ipmi_intf * intf) { struct rmcp_hdr rmcp_rsp; struct ipmi_rs * rsp; struct ipmi_session * session = intf->session; int offset, rv; uint16_t payload_size; uint8_t ourAddress = (uint8_t)intf->my_addr; if (ourAddress == 0) { ourAddress = IPMI_BMC_SLAVE_ADDR; } rsp = ipmi_lan_recv_packet(intf); /* * Not positive why we're looping. Do we sometimes get stuff we don't * expect? */ while (rsp != NULL) { /* parse response headers */ memcpy(&rmcp_rsp, rsp->data, 4); if (rmcp_rsp.class == RMCP_CLASS_ASF) { /* might be ping response packet */ rv = ipmi_handle_pong(intf, rsp); return (rv <= 0) ? NULL : rsp; } if (rmcp_rsp.class != RMCP_CLASS_IPMI) { lprintf(LOG_DEBUG, "Invalid RMCP class: %x", rmcp_rsp.class); rsp = ipmi_lan_recv_packet(intf); continue; } /* * The authtype / payload type determines what we are receiving */ offset = 4; /*-------------------------------------------------------------- * * The current packet could be one of several things: * * 1) An IPMI 1.5 packet (the response to our GET CHANNEL * AUTHENTICATION CAPABILITIES request) * 2) An RMCP+ message with an IPMI response payload * 3) AN RMCP+ open session response * 4) An RAKP-2 message (response to an RAKP 1 message) * 5) An RAKP-4 message (response to an RAKP 3 message) * 6) A Serial Over LAN packet * 7) An Invalid packet (one that doesn't match a request) * ------------------------------------------------------------- */ rv = read_session_data(rsp, &offset, intf->session); if (rv != 0) return(NULL); lprintf(LOG_INFO, "rsp session_id=%08lx session_seq=%08lx", (long)rsp->session.id, (long)rsp->session.seq); if (lanplus_has_valid_auth_code(rsp, intf->session) == 0) { lprintf(LOG_ERR, "ERROR: Received message with invalid authcode!"); return(NULL); /*was ipmi_lan_recv_packet, assert*/ } if ((session->v2_data.session_state == LANPLUS_STATE_ACTIVE) && (rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS) && (rsp->session.bEncrypted)) { lanplus_decrypt_payload(session->v2_data.crypt_alg, session->v2_data.k2, rsp->data + offset, rsp->session.msglen, rsp->data + offset, &payload_size); } else payload_size = rsp->session.msglen; /* * Handle IPMI responses (case #1 and #2) -- all IPMI reponses */ if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_IPMI) { struct ipmi_rq_entry * entry; int payload_start = offset; int extra_data_length; read_ipmi_response(rsp, &offset); lprintf(LOG_DEBUG+1, "<< IPMI Response Session Header"); lprintf(LOG_DEBUG+1, "<< Authtype : %s", val2str(rsp->session.authtype, ipmi_authtype_session_vals)); lprintf(LOG_DEBUG+1, "<< Payload type : %s", val2str(rsp->session.payloadtype, plus_payload_types_vals)); lprintf(LOG_DEBUG+1, "<< Session ID : 0x%08lx", (long)rsp->session.id); lprintf(LOG_DEBUG+1, "<< Sequence : 0x%08lx", (long)rsp->session.seq); lprintf(LOG_DEBUG+1, "<< IPMI Msg/Payload Length : %d", rsp->session.msglen); lprintf(LOG_DEBUG+1, "<< IPMI Response Message Header"); lprintf(LOG_DEBUG+1, "<< Rq Addr : %02x", rsp->payload.ipmi_response.rq_addr); lprintf(LOG_DEBUG+1, "<< NetFn : %02x", rsp->payload.ipmi_response.netfn); lprintf(LOG_DEBUG+1, "<< Rq LUN : %01x", rsp->payload.ipmi_response.rq_lun); lprintf(LOG_DEBUG+1, "<< Rs Addr : %02x", rsp->payload.ipmi_response.rs_addr); lprintf(LOG_DEBUG+1, "<< Rq Seq : %02x", rsp->payload.ipmi_response.rq_seq); lprintf(LOG_DEBUG+1, "<< Rs Lun : %01x", rsp->payload.ipmi_response.rs_lun); lprintf(LOG_DEBUG+1, "<< Command : %02x", rsp->payload.ipmi_response.cmd); lprintf(LOG_DEBUG+1, "<< Compl Code : 0x%02x", rsp->ccode); /* Are we expecting this packet? */ entry = ipmi_req_lookup_entry(rsp->payload.ipmi_response.rq_seq, rsp->payload.ipmi_response.cmd); if (entry != NULL) { lprintf(LOG_DEBUG+2, "IPMI Request Match found"); if ( intf->target_addr != intf->my_addr && bridgePossible && rsp->data_len && rsp->payload.ipmi_response.cmd == 0x34 ) { /* Check completion code */ if (rsp->data[offset-1] == 0) { lprintf(LOG_DEBUG, "Bridged command answer," " waiting for next answer... "); ipmi_req_remove_entry( rsp->payload.ipmi_response.rq_seq, rsp->payload.ipmi_response.cmd); return(ipmi_lan_poll_recv(intf)); } else { lprintf(LOG_DEBUG, "WARNING: Bridged" "cmd ccode = 0x%02x", rsp->data[offset-1]); } if (rsp->data_len && rsp->payload.ipmi_response.cmd== 0x34) { memmove(rsp->data, &rsp->data[offset], (rsp->data_len-offset)); printbuf( &rsp->data[offset], (rsp->data_len-offset), "bridge command response"); } } ipmi_req_remove_entry( rsp->payload.ipmi_response.rq_seq, rsp->payload.ipmi_response.cmd); } else { lprintf(LOG_INFO, "IPMI Request Match NOT FOUND"); rsp = ipmi_lan_recv_packet(intf); continue; } /* * Good packet. Shift response data to start of array. * rsp->data becomes the variable length IPMI response data * rsp->data_len becomes the length of that data */ extra_data_length = payload_size - (offset - payload_start) - 1; if (rsp != NULL && extra_data_length) { rsp->data_len = extra_data_length; memmove(rsp->data, rsp->data + offset, extra_data_length); } else rsp->data_len = 0; break; } /* * Open Response */ else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_RMCP_OPEN_RESPONSE) { if (session->v2_data.session_state != LANPLUS_STATE_OPEN_SESSION_SENT) { lprintf(LOG_ERR, "Error: Received an Unexpected Open Session " "Response"); rsp = ipmi_lan_recv_packet(intf); continue; } read_open_session_response(rsp, offset); break; } /* * RAKP 2 */ else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_RAKP_2) { if (session->v2_data.session_state != LANPLUS_STATE_RAKP_1_SENT) { lprintf(LOG_ERR, "Error: Received an Unexpected RAKP 2 message"); rsp = ipmi_lan_recv_packet(intf); continue; } read_rakp2_message(rsp, offset, session->v2_data.auth_alg); break; } /* * RAKP 4 */ else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_RAKP_4) { if (session->v2_data.session_state != LANPLUS_STATE_RAKP_3_SENT) { lprintf(LOG_ERR, "Error: Received an Unexpected RAKP 4 message"); rsp = ipmi_lan_recv_packet(intf); continue; } read_rakp4_message(rsp, offset, session->v2_data.auth_alg); break; } /* * SOL */ else if (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL) { int payload_start = offset; int extra_data_length; if (session->v2_data.session_state != LANPLUS_STATE_ACTIVE) { lprintf(LOG_ERR, "Error: Received an Unexpected SOL packet"); rsp = ipmi_lan_recv_packet(intf); continue; } read_sol_packet(rsp, &offset); extra_data_length = payload_size - (offset - payload_start); if (rsp && extra_data_length) { rsp->data_len = extra_data_length; memmove(rsp->data, rsp->data + offset, extra_data_length); } else rsp->data_len = 0; break; } else { lprintf(LOG_ERR, "Invalid RMCP+ payload type : 0x%x", rsp->session.payloadtype); return(NULL); //assert(0); } } return rsp; } /* * read_open_session_reponse * * Initialize the ipmi_rs from the IPMI 2.x open session response data. * * The offset should point to the first byte of the the Open Session Response * payload when this function is called. * * param rsp [in/out] reading from the data and writing to the open_session_response * section * param offset [in] tells us where the Open Session Response payload starts * * returns 0 on success, 1 on error */ void read_open_session_response(struct ipmi_rs * rsp, int offset) { memset(&rsp->payload.open_session_response, 0, sizeof(rsp->payload.open_session_response)); /* Message tag */ rsp->payload.open_session_response.message_tag = rsp->data[offset]; /* RAKP reponse code */ rsp->payload.open_session_response.rakp_return_code = rsp->data[offset + 1]; /* Maximum privilege level */ rsp->payload.open_session_response.max_priv_level = rsp->data[offset + 2]; /*** offset + 3 is reserved ***/ /* Remote console session ID */ memcpy(&(rsp->payload.open_session_response.console_id), rsp->data + offset + 4, 4); #if WORDS_BIGENDIAN rsp->payload.open_session_response.console_id = BSWAP_32(rsp->payload.open_session_response.console_id); #endif /* only tag, status, privlvl, and console id are returned if error */ if (rsp->payload.open_session_response.rakp_return_code != IPMI_RAKP_STATUS_NO_ERRORS) return; /* BMC session ID */ memcpy(&(rsp->payload.open_session_response.bmc_id), rsp->data + offset + 8, 4); #if WORDS_BIGENDIAN rsp->payload.open_session_response.bmc_id = BSWAP_32(rsp->payload.open_session_response.bmc_id); #endif /* And of course, our negotiated algorithms */ rsp->payload.open_session_response.auth_alg = rsp->data[offset + 16]; rsp->payload.open_session_response.integrity_alg = rsp->data[offset + 24]; rsp->payload.open_session_response.crypt_alg = rsp->data[offset + 32]; } /* * read_rakp2_message * * Initialize the ipmi_rs from the IPMI 2.x RAKP 2 message * * The offset should point the first byte of the the RAKP 2 payload when this * function is called. * * param rsp [in/out] reading from the data variable and writing to the rakp 2 * section * param offset [in] tells us where hte rakp2 payload starts * param auth_alg [in] describes the authentication algorithm was agreed upon in * the open session request/response phase. We need to know that here so * that we know how many bytes (if any) to read fromt the packet. * * returns 0 on success, 1 on error */ void read_rakp2_message( struct ipmi_rs * rsp, int offset, uint8_t auth_alg) { int i; /* Message tag */ rsp->payload.rakp2_message.message_tag = rsp->data[offset]; /* RAKP reponse code */ rsp->payload.rakp2_message.rakp_return_code = rsp->data[offset + 1]; /* Console session ID */ memcpy(&(rsp->payload.rakp2_message.console_id), rsp->data + offset + 4, 4); #if WORDS_BIGENDIAN rsp->payload.rakp2_message.console_id = BSWAP_32(rsp->payload.rakp2_message.console_id); #endif /* BMC random number */ memcpy(&(rsp->payload.rakp2_message.bmc_rand), rsp->data + offset + 8, 16); #if WORDS_BIGENDIAN lanplus_swap(rsp->payload.rakp2_message.bmc_rand, 16); #endif /* BMC GUID */ memcpy(&(rsp->payload.rakp2_message.bmc_guid), rsp->data + offset + 24, 16); #if WORDS_BIGENDIAN lanplus_swap(rsp->payload.rakp2_message.bmc_guid, 16); #endif /* Key exchange authentication code */ switch (auth_alg) { case IPMI_AUTH_RAKP_NONE: /* Nothing to do here */ break; case IPMI_AUTH_RAKP_HMAC_SHA1: /* We need to copy 20 bytes */ for (i = 0; i < SHA_DIGEST_LENGTH; ++i) rsp->payload.rakp2_message.key_exchange_auth_code[i] = rsp->data[offset + 40 + i]; break; case IPMI_AUTH_RAKP_HMAC_MD5: /* We need to copy 16 bytes */ for (i = 0; i < MD5_DIGEST_LENGTH; ++i) rsp->payload.rakp2_message.key_exchange_auth_code[i] = rsp->data[offset + 40 + i]; break; case IPMI_AUTH_RAKP_HMAC_SHA256: /* We need to copy 32 bytes */ for (i = 0; i < SHA256_DIGEST_LENGTH; ++i) rsp->payload.rakp2_message.key_exchange_auth_code[i] = rsp->data[offset + 40 + i]; break; default: lprintf(LOG_ERR, "read_rakp2_message: no support for authentication algorithm 0x%x", auth_alg); assert(0); /*void routine*/ break; } } /* * read_rakp4_message * * Initialize the ipmi_rs from the IPMI 2.x RAKP 4 message * * The offset should point the first byte of the the RAKP 4 payload when this * function is called. * * param rsp [in/out] reading from the data variable and writing to the rakp * 4 section * param offset [in] tells us where hte rakp4 payload starts * param integrity_alg [in] describes the authentication algorithm was * agreed upon in the open session request/response phase. We need * to know that here so that we know how many bytes (if any) to read * from the packet. * * returns 0 on success, 1 on error */ void read_rakp4_message( struct ipmi_rs * rsp, int offset, uint8_t auth_alg) { int i; /* Message tag */ rsp->payload.rakp4_message.message_tag = rsp->data[offset]; /* RAKP reponse code */ rsp->payload.rakp4_message.rakp_return_code = rsp->data[offset + 1]; /* Console session ID */ memcpy(&(rsp->payload.rakp4_message.console_id), rsp->data + offset + 4, 4); #if WORDS_BIGENDIAN rsp->payload.rakp4_message.console_id = BSWAP_32(rsp->payload.rakp4_message.console_id); #endif /* Integrity check value */ switch (auth_alg) { case IPMI_AUTH_RAKP_NONE: /* Nothing to do here */ break; case IPMI_AUTH_RAKP_HMAC_SHA1: /* We need to copy 12 bytes */ for (i = 0; i < IPMI_SHA1_AUTHCODE_SIZE; ++i) rsp->payload.rakp4_message.integrity_check_value[i] = rsp->data[offset + 8 + i]; break; case IPMI_AUTH_RAKP_HMAC_MD5: /* We need to copy 16 bytes */ for (i = 0; i < IPMI_HMAC_MD5_AUTHCODE_SIZE; ++i) rsp->payload.rakp4_message.integrity_check_value[i] = rsp->data[offset + 8 + i]; break; case IPMI_AUTH_RAKP_HMAC_SHA256: /* We need to copy 16 bytes */ for (i = 0; i < IPMI_HMAC_SHA256_AUTHCODE_SIZE; ++i) rsp->payload.rakp4_message.integrity_check_value[i] = rsp->data[offset + 8 + i]; break; default: lprintf(LOG_ERR, "read_rakp4_message: no support " "for authentication algorithm 0x%x", auth_alg); assert(0); /*void routine*/ break; } } /* * read_session_data * * Initialize the ipmi_rsp from the session data in the packet * * The offset should point the first byte of the the IPMI session when this * function is called. * * param rsp [in/out] we read from the data buffer and populate the session * specific fields. * param offset [in/out] should point to the beginning of the session when * this function is called. The offset will be adjusted to * point to the end of the session when this function exits. * param session holds our session state */ int read_session_data( struct ipmi_rs * rsp, int * offset, struct ipmi_session * s) { int rv; /* We expect to read different stuff depending on the authtype */ rsp->session.authtype = rsp->data[*offset]; if (rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS) rv = read_session_data_v2x(rsp, offset, s); else rv = read_session_data_v15(rsp, offset, s); return(rv); } /* * read_session_data_v2x * * Initialize the ipmi_rsp from the v2.x session header of the packet. * * The offset should point to the first byte of the the IPMI session when this * function is called. When this function exits, offset will point to the * start of payload. * * Should decrypt and perform integrity checking here? * * param rsp [in/out] we read from the data buffer and populate the session * specific fields. * param offset [in/out] should point to the beginning of the session when this * function is called. The offset will be adjusted to point to * the end of the session when this function exits. * param s holds our session state */ int read_session_data_v2x( struct ipmi_rs * rsp, int * offset, struct ipmi_session * s) { rsp->session.authtype = rsp->data[(*offset)++]; rsp->session.bEncrypted = (rsp->data[*offset] & 0x80 ? 1 : 0); rsp->session.bAuthenticated = (rsp->data[*offset] & 0x40 ? 1 : 0); /* Payload type */ rsp->session.payloadtype = rsp->data[(*offset)++] & 0x3F; /* Session ID */ memcpy(&rsp->session.id, rsp->data + *offset, 4); *offset += 4; #if WORDS_BIGENDIAN rsp->session.id = BSWAP_32(rsp->session.id); #endif /* * Verify that the session ID is what we think it should be */ if ((s->v2_data.session_state == LANPLUS_STATE_ACTIVE) && (rsp->session.id != s->v2_data.console_id)) { lprintf(LOG_ERR, "packet session id 0x%x does not " "match active session 0x%0x", rsp->session.id, s->v2_data.console_id); /* assert(0); * the session is broken, cannot proceed */ /* return and abort session here. */ return(-13); /* LAN_ERR_OTHER = -13 */ } /* Ignored, so far */ memcpy(&rsp->session.seq, rsp->data + *offset, 4); *offset += 4; #if WORDS_BIGENDIAN rsp->session.seq = BSWAP_32(rsp->session.seq); #endif memcpy(&rsp->session.msglen, rsp->data + *offset, 2); *offset += 2; #if WORDS_BIGENDIAN rsp->session.msglen = BSWAP_16(rsp->session.msglen); #endif return(0); } /* * read_session_data_v15 * * Initialize the ipmi_rsp from the session header of the packet. * * The offset should point the first byte of the the IPMI session when this * function is called. When this function exits, the offset will point to * the start of the IPMI message. * * param rsp [in/out] we read from the data buffer and populate the session * specific fields. * param offset [in/out] should point to the beginning of the session when this * function is called. The offset will be adjusted to point to the * end of the session when this function exits. * param s holds our session state */ int read_session_data_v15( struct ipmi_rs * rsp, int * offset, struct ipmi_session * s) { /* All v15 messages are IPMI messages */ rsp->session.payloadtype = IPMI_PAYLOAD_TYPE_IPMI; rsp->session.authtype = rsp->data[(*offset)++]; /* All v15 messages that we will receive are unencrypted/unauthenticated */ rsp->session.bEncrypted = 0; rsp->session.bAuthenticated = 0; /* skip the session id and sequence number fields */ *offset += 8; /* This is the size of the whole payload */ rsp->session.msglen = rsp->data[(*offset)++]; return(0); } /* * read_ipmi_response * * Initialize the impi_rs from with the IPMI response specific data * * The offset should point the first byte of the the IPMI payload when this * function is called. * * param rsp [in/out] we read from the data buffer and populate the IPMI * specific fields. * param offset [in/out] should point to the beginning of the IPMI payload when * this function is called. */ void read_ipmi_response(struct ipmi_rs * rsp, int * offset) { /* * The data here should be decrypted by now. */ rsp->payload.ipmi_response.rq_addr = rsp->data[(*offset)++]; rsp->payload.ipmi_response.netfn = rsp->data[*offset] >> 2; rsp->payload.ipmi_response.rq_lun = rsp->data[(*offset)++] & 0x3; (*offset)++; /* checksum */ rsp->payload.ipmi_response.rs_addr = rsp->data[(*offset)++]; rsp->payload.ipmi_response.rq_seq = rsp->data[*offset] >> 2; rsp->payload.ipmi_response.rs_lun = rsp->data[(*offset)++] & 0x3; rsp->payload.ipmi_response.cmd = rsp->data[(*offset)++]; rsp->ccode = rsp->data[(*offset)++]; } /* * read_sol_packet * * Initialize the ipmi_rs with the SOL response data * * The offset should point the first byte of the the SOL payload when this * function is called. * * param rsp [in/out] we read from the data buffer and populate the * SOL specific fields. * param offset [in/out] should point to the beginning of the SOL payload * when this function is called. */ void read_sol_packet(struct ipmi_rs * rsp, int * offset) { /* * The data here should be decrypted by now. */ rsp->payload.sol_packet.packet_sequence_number = rsp->data[(*offset)++] & 0x0F; rsp->payload.sol_packet.acked_packet_number = rsp->data[(*offset)++] & 0x0F; rsp->payload.sol_packet.accepted_character_count = rsp->data[(*offset)++]; rsp->payload.sol_packet.is_nack = rsp->data[*offset] & 0x40; rsp->payload.sol_packet.transfer_unavailable = rsp->data[*offset] & 0x20; rsp->payload.sol_packet.sol_inactive = rsp->data[*offset] & 0x10; rsp->payload.sol_packet.transmit_overrun = rsp->data[*offset] & 0x08; rsp->payload.sol_packet.break_detected = rsp->data[(*offset)++] & 0x04; lprintf(LOG_DEBUG, "<<<<<<<<<< RECV FROM BMC <<<<<<<<<<<"); lprintf(LOG_DEBUG, "< SOL sequence number : 0x%02x", rsp->payload.sol_packet.packet_sequence_number); lprintf(LOG_DEBUG, "< SOL acked packet : 0x%02x", rsp->payload.sol_packet.acked_packet_number); lprintf(LOG_DEBUG, "< SOL accepted char count : 0x%02x", rsp->payload.sol_packet.accepted_character_count); lprintf(LOG_DEBUG, "< SOL is nack : %s", rsp->payload.sol_packet.is_nack? "true" : "false"); lprintf(LOG_DEBUG, "< SOL xfer unavailable : %s", rsp->payload.sol_packet.transfer_unavailable? "true" : "false"); lprintf(LOG_DEBUG, "< SOL inactive : %s", rsp->payload.sol_packet.sol_inactive? "true" : "false"); lprintf(LOG_DEBUG, "< SOL transmit overrun : %s", rsp->payload.sol_packet.transmit_overrun? "true" : "false"); lprintf(LOG_DEBUG, "< SOL break detected : %s", rsp->payload.sol_packet.break_detected? "true" : "false"); lprintf(LOG_DEBUG, "< rs Session sequence num : %d", rsp->session.seq); lprintf(LOG_DEBUG, "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); if (verbose >= 5) printbuf(rsp->data + *offset - 4, 4, "SOL MSG FROM BMC"); } /* * getIpmiPayloadWireRep * * param out [out] will contain our wire representation * param req [in] is the IPMI request to be written * param crypt_alg [in] specifies the encryption to use * param rq_seq [in] is the IPMI command sequence number. */ void getIpmiPayloadWireRep( struct ipmi_intf * intf, /* in out */ struct ipmi_v2_payload * payload, /* in */ uint8_t * msg, struct ipmi_rq * req, uint8_t rq_seq, uint8_t curr_seq) { int cs, tmp, len; int cs2 = 0; int cs3 = 0; uint8_t ourAddress = (uint8_t)intf->my_addr; uint8_t bridgedRequest = 0; if (ourAddress == 0) ourAddress = IPMI_BMC_SLAVE_ADDR; len = 0; /* IPMI Message Header -- Figure 13-4 of the IPMI v2.0 spec */ if ((intf->target_addr == ourAddress) || (!bridgePossible)) cs = len; else { bridgedRequest = 1; if(intf->transit_addr != ourAddress && intf->transit_addr != 0) { bridgedRequest++; } /* bridged request: encapsulate w/in Send Message */ cs = len; msg[len++] = IPMI_BMC_SLAVE_ADDR; msg[len++] = IPMI_NETFN_APP << 2; tmp = len - cs; msg[len++] = ipmi_csum(msg+cs, tmp); cs2 = len; msg[len++] = IPMI_REMOTE_SWID; msg[len++] = curr_seq << 2; msg[len++] = 0x34; /* Send Message rqst */ if(bridgedRequest == 2) msg[len++] = (0x40|intf->transit_channel); /* Track request*/ else msg[len++] = (0x40|intf->target_channel); /* Track request*/ #if 0 /* From lan.c example */ entry->req.msg.target_cmd = entry->req.msg.cmd; /* Save target command */ entry->req.msg.cmd = 0x34; /* (fixup request entry) */ #endif payload->payload_length += 7; cs = len; if(bridgedRequest == 2) { /* bridged request: encapsulate w/in Send Message */ cs = len; msg[len++] = (uint8_t)intf->transit_addr; msg[len++] = IPMI_NETFN_APP << 2; tmp = len - cs; msg[len++] = ipmi_csum(msg+cs, tmp); cs3 = len; msg[len++] = (uint8_t)intf->my_addr; msg[len++] = curr_seq << 2; msg[len++] = 0x34; /* Send Message rqst */ msg[len++] = (0x40|intf->target_channel); /* Track request*/ payload->payload_length += 7; cs = len; } } /* rsAddr */ msg[len++] = (uint8_t)intf->target_addr; /* IPMI_BMC_SLAVE_ADDR; */ /* net Fn */ msg[len++] = req->msg.netfn << 2 | (req->msg.lun & 3); tmp = len - cs; /* checkSum */ msg[len++] = ipmi_csum(msg+cs, tmp); cs = len; /* rqAddr */ if (!bridgedRequest) msg[len++] = IPMI_REMOTE_SWID; else /* Bridged message */ msg[len++] = (uint8_t)intf->my_addr; /* rqSeq / rqLUN */ msg[len++] = rq_seq << 2; /* cmd */ msg[len++] = req->msg.cmd; /* message data */ if (req->msg.data_len) { memcpy(msg + len, req->msg.data, req->msg.data_len); len += req->msg.data_len; } /* second checksum */ tmp = len - cs; msg[len++] = ipmi_csum(msg+cs, tmp); /* Dual bridged request: 2nd checksum */ if (bridgedRequest == 2) { tmp = len - cs3; msg[len++] = ipmi_csum(msg+cs3, tmp); payload->payload_length += 1; } /* bridged request: 2nd checksum */ if (bridgedRequest) { tmp = len - cs2; msg[len++] = ipmi_csum(msg+cs2, tmp); payload->payload_length += 1; if (verbose) printbuf(msg,len,"Bridged Request"); } } /* * getSolPayloadWireRep * * param msg [out] will contain our wire representation * param payload [in] holds the v2 payload with our SOL data */ void getSolPayloadWireRep( struct ipmi_intf * intf, /* in out */ uint8_t * msg, /* output */ struct ipmi_v2_payload * payload) /* input */ { int i = 0; lprintf(LOG_DEBUG, ">>>>>>>>>> SENDING TO BMC >>>>>>>>>>"); lprintf(LOG_DEBUG, "> SOL sequence number : 0x%02x", payload->payload.sol_packet.packet_sequence_number); lprintf(LOG_DEBUG, "> SOL acked packet : 0x%02x", payload->payload.sol_packet.acked_packet_number); lprintf(LOG_DEBUG, "> SOL accepted char count : 0x%02x", payload->payload.sol_packet.accepted_character_count); lprintf(LOG_DEBUG, "> SOL is nack : %s", payload->payload.sol_packet.is_nack ? "true" : "false"); lprintf(LOG_DEBUG, "> SOL assert ring wor : %s", payload->payload.sol_packet.assert_ring_wor ? "true" : "false"); lprintf(LOG_DEBUG, "> SOL generate break : %s", payload->payload.sol_packet.generate_break ? "true" : "false"); lprintf(LOG_DEBUG, "> SOL deassert cts : %s", payload->payload.sol_packet.deassert_cts ? "true" : "false"); lprintf(LOG_DEBUG, "> SOL deassert dcd dsr : %s", payload->payload.sol_packet.deassert_dcd_dsr ? "true" : "false"); lprintf(LOG_DEBUG, "> SOL flush inbound : %s", payload->payload.sol_packet.flush_inbound ? "true" : "false"); lprintf(LOG_DEBUG, "> SOL flush outbound : %s", payload->payload.sol_packet.flush_outbound ? "true" : "false"); msg[i++] = payload->payload.sol_packet.packet_sequence_number; msg[i++] = payload->payload.sol_packet.acked_packet_number; msg[i++] = payload->payload.sol_packet.accepted_character_count; msg[i] = payload->payload.sol_packet.is_nack ? 0x40 : 0; msg[i] |= payload->payload.sol_packet.assert_ring_wor ? 0x20 : 0; msg[i] |= payload->payload.sol_packet.generate_break ? 0x10 : 0; msg[i] |= payload->payload.sol_packet.deassert_cts ? 0x08 : 0; msg[i] |= payload->payload.sol_packet.deassert_dcd_dsr ? 0x04 : 0; msg[i] |= payload->payload.sol_packet.flush_inbound ? 0x02 : 0; msg[i++] |= payload->payload.sol_packet.flush_outbound ? 0x01 : 0; /* We may have data to add */ memcpy(msg + i, payload->payload.sol_packet.data, payload->payload.sol_packet.character_count); lprintf(LOG_DEBUG, "> SOL character count : %d", payload->payload.sol_packet.character_count); lprintf(LOG_DEBUG, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); if (verbose >= 5 && payload->payload.sol_packet.character_count) printbuf(payload->payload.sol_packet.data, payload->payload.sol_packet.character_count, "SOL SEND DATA"); /* * At this point, the payload length becomes the whole payload * length, including the 4 bytes at the beginning of the SOL * packet */ payload->payload_length = payload->payload.sol_packet.character_count + 4; } /* * ipmi_lanplus_build_v2x_msg * * Encapsulates the payload data to create the IPMI v2.0 / RMCP+ packet. * * * IPMI v2.0 LAN Request Message Format * +----------------------+ * | rmcp.ver | 4 bytes * | rmcp.__rsvd | * | rmcp.seq | * | rmcp.class | * +----------------------+ * | session.authtype | 10 bytes * | session.payloadtype | * | session.id | * | session.seq | * +----------------------+ * | message length | 2 bytes * +----------------------+ * | Confidentiality Hdr | var (possibly absent) * +----------------------+ * | Payload | var Payload * +----------------------+ * | Confidentiality Trlr | var (possibly absent) * +----------------------+ * | Integrity pad | var (possibly absent) * +----------------------+ * | Pad length | 1 byte (WTF?) * +----------------------+ * | Next Header | 1 byte (WTF?) * +----------------------+ * | Authcode | var (possibly absent) * +----------------------+ */ int ipmi_lanplus_build_v2x_msg( struct ipmi_intf * intf, /* in */ struct ipmi_v2_payload * payload, /* in */ int * msg_len, /* out */ uint8_t ** msg_data, /* out */ uint8_t curr_seq) { uint32_t session_trailer_length = 0; struct ipmi_session * session = intf->session; /* msg will hold the entire message to be sent */ uint8_t * msg; int len = 0; int rv = 0; #if defined(WIN32) || defined(SOLARIS) || defined(HPUX) struct rmcp_hdr rmcp; rmcp.ver = RMCP_VERSION_1; rmcp.class = RMCP_CLASS_IPMI; rmcp.seq = 0xff; rmcp.__rsvd = 0; #else struct rmcp_hdr rmcp = { .ver = RMCP_VERSION_1, .__rsvd = 0, .class = RMCP_CLASS_IPMI, .seq = 0xff, }; #endif len = sizeof(rmcp) + // RMCP Header (4) 10 + // IPMI Session Header 2 + // Message length payload->payload_length + // The actual payload IPMI_MAX_INTEGRITY_PAD_SIZE + // Integrity Pad 1 + // Pad Length 1 + // Next Header IPMI_MAX_AUTH_CODE_SIZE; // Authcode (usu 20+16) msg = malloc(len); if (msg == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return -1; } memset(msg, 0, len); /* *------------------------------------------ * RMCP HEADER *------------------------------------------ */ memcpy(msg, &rmcp, sizeof(rmcp)); len = sizeof(rmcp); /* *------------------------------------------ * IPMI SESSION HEADER *------------------------------------------ */ /* ipmi session Auth Type / Format is always 0x06 for IPMI v2 */ msg[IPMI_LANPLUS_OFFSET_AUTHTYPE] = 0x06; /* Payload Type -- also specifies whether were authenticated/encyrpted */ msg[IPMI_LANPLUS_OFFSET_PAYLOAD_TYPE] = payload->payload_type; if (session->v2_data.session_state == LANPLUS_STATE_ACTIVE) { msg[IPMI_LANPLUS_OFFSET_PAYLOAD_TYPE] |= ((session->v2_data.crypt_alg != IPMI_CRYPT_NONE )? 0x80 : 0x00); msg[IPMI_LANPLUS_OFFSET_PAYLOAD_TYPE] |= ((session->v2_data.integrity_alg != IPMI_INTEGRITY_NONE)? 0x40 : 0x00); } if (session->v2_data.session_state == LANPLUS_STATE_ACTIVE) { /* Session ID -- making it LSB */ msg[IPMI_LANPLUS_OFFSET_SESSION_ID ] = session->v2_data.bmc_id & 0xff; msg[IPMI_LANPLUS_OFFSET_SESSION_ID + 1] = (session->v2_data.bmc_id >> 8) & 0xff; msg[IPMI_LANPLUS_OFFSET_SESSION_ID + 2] = (session->v2_data.bmc_id >> 16) & 0xff; msg[IPMI_LANPLUS_OFFSET_SESSION_ID + 3] = (session->v2_data.bmc_id >> 24) & 0xff; /* Sequence Number -- making it LSB */ msg[IPMI_LANPLUS_OFFSET_SEQUENCE_NUM ] = session->out_seq & 0xff; msg[IPMI_LANPLUS_OFFSET_SEQUENCE_NUM + 1] = (session->out_seq >> 8) & 0xff; msg[IPMI_LANPLUS_OFFSET_SEQUENCE_NUM + 2] = (session->out_seq >> 16) & 0xff; msg[IPMI_LANPLUS_OFFSET_SEQUENCE_NUM + 3] = (session->out_seq >> 24) & 0xff; } /* * Payload Length is set below (we don't know how big the payload is until after * encryption). */ /* * Payload * * At this point we are ready to slam the payload in. * This includes: * 1) The confidentiality header * 2) The payload proper (possibly encrypted) * 3) The confidentiality trailer * */ switch (payload->payload_type) { case IPMI_PAYLOAD_TYPE_IPMI: getIpmiPayloadWireRep(intf, payload, /* in */ msg + IPMI_LANPLUS_OFFSET_PAYLOAD, payload->payload.ipmi_request.request, payload->payload.ipmi_request.rq_seq, curr_seq); break; case IPMI_PAYLOAD_TYPE_SOL: getSolPayloadWireRep(intf, msg + IPMI_LANPLUS_OFFSET_PAYLOAD, payload); if (verbose >= 5) printbuf(msg + IPMI_LANPLUS_OFFSET_PAYLOAD, 4, "SOL MSG TO BMC"); len += payload->payload_length; break; case IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST: /* never encrypted, so our job is easy */ memcpy(msg + IPMI_LANPLUS_OFFSET_PAYLOAD, payload->payload.open_session_request.request, payload->payload_length); len += payload->payload_length; break; case IPMI_PAYLOAD_TYPE_RAKP_1: /* never encrypted, so our job is easy */ memcpy(msg + IPMI_LANPLUS_OFFSET_PAYLOAD, payload->payload.rakp_1_message.message, payload->payload_length); len += payload->payload_length; break; case IPMI_PAYLOAD_TYPE_RAKP_3: /* never encrypted, so our job is easy */ memcpy(msg + IPMI_LANPLUS_OFFSET_PAYLOAD, payload->payload.rakp_3_message.message, payload->payload_length); len += payload->payload_length; break; default: lprintf(LOG_ERR, "unsupported payload type 0x%x", payload->payload_type); free(msg); return -1; break; } /* *------------------------------------------ * ENCRYPT THE PAYLOAD IF NECESSARY *------------------------------------------ */ if (session->v2_data.session_state == LANPLUS_STATE_ACTIVE) { /* Payload len is adjusted as necessary by lanplus_encrypt_payload */ lanplus_encrypt_payload(session->v2_data.crypt_alg, /* input */ session->v2_data.k2, /* input */ msg + IPMI_LANPLUS_OFFSET_PAYLOAD, /* input */ payload->payload_length, /* input */ msg + IPMI_LANPLUS_OFFSET_PAYLOAD, /* output */ &(payload->payload_length)); /* output */ } /* Now we know the payload length */ msg[IPMI_LANPLUS_OFFSET_PAYLOAD_SIZE ] = payload->payload_length & 0xff; msg[IPMI_LANPLUS_OFFSET_PAYLOAD_SIZE + 1] = (payload->payload_length >> 8) & 0xff; /* *------------------------------------------ * SESSION TRAILER *------------------------------------------ */ if ((session->v2_data.session_state == LANPLUS_STATE_ACTIVE) && (session->v2_data.integrity_alg != IPMI_INTEGRITY_NONE)) { uint32_t hmac_length, hmac_input_size; uint32_t i, auth_length = 0, integrity_pad_size = 0; uint8_t * hmac_output; uint32_t start_of_session_trailer = IPMI_LANPLUS_OFFSET_PAYLOAD + payload->payload_length; /* * Determine the required integrity pad length. We have to make the * data range covered by the authcode a multiple of 4. */ uint32_t length_before_authcode; if (ipmi_oem_active(intf, "icts")) { length_before_authcode = 12 + /* the stuff before the payload */ payload->payload_length; } else { length_before_authcode = 12 + /* the stuff before the payload */ payload->payload_length + 1 + /* pad length field */ 1; /* next header field */ } if (length_before_authcode % 4) integrity_pad_size = 4 - (length_before_authcode % 4); for (i = 0; i < integrity_pad_size; ++i) msg[start_of_session_trailer + i] = 0xFF; /* Pad length */ msg[start_of_session_trailer + integrity_pad_size] = (uint8_t)integrity_pad_size; /* Next Header */ msg[start_of_session_trailer + integrity_pad_size + 1] = 0x07; /* Hardcoded per the spec, table 13-8 */ hmac_input_size = 12 + payload->payload_length + integrity_pad_size + 2; hmac_output = msg + IPMI_LANPLUS_OFFSET_PAYLOAD + payload->payload_length + integrity_pad_size + 2; if (verbose > 2) printbuf(msg + IPMI_LANPLUS_OFFSET_AUTHTYPE, hmac_input_size, "authcode input"); /* Auth Code */ hmac_length = 20; /* init length, just in case*/ lanplus_HMAC(session->v2_data.integrity_alg, session->v2_data.k1, /*key */ session->v2_data.k1_len, /*key length*/ msg + IPMI_LANPLUS_OFFSET_AUTHTYPE, /*hmac input*/ hmac_input_size, hmac_output, &hmac_length); switch(session->v2_data.integrity_alg) { case IPMI_INTEGRITY_HMAC_SHA1_96: if (hmac_length != SHA_DIGEST_LENGTH) rv = -1; auth_length = IPMI_SHA1_AUTHCODE_SIZE; break; case IPMI_INTEGRITY_HMAC_MD5_128 : if (hmac_length != MD5_DIGEST_LENGTH) rv = -1; auth_length = IPMI_HMAC_MD5_AUTHCODE_SIZE; break; #ifdef HAVE_SHA256 /* based on an MD5_SHA256 patch from Holger Liebig */ case IPMI_INTEGRITY_HMAC_SHA256_128: if (hmac_length != SHA256_DIGEST_LENGTH) rv = -1; auth_length = IPMI_HMAC_SHA256_AUTHCODE_SIZE; break; #endif default: lprintf(LOG_ERR,"unsupported integrity_alg 0x%x", session->v2_data.integrity_alg); free(msg); return -1; //assert(0); break; } if (rv != 0) { lprintf(LOG_ERR,"Invalid alg %d length %d", session->v2_data.integrity_alg, hmac_length); return(rv); } if (verbose > 2) printbuf(hmac_output, auth_length, "authcode output"); /* Set session_trailer_length appropriately */ session_trailer_length = integrity_pad_size + 2 + /* pad length + next header */ auth_length; /* Size of the authcode (we only use the first 12 bytes) */ } ++(session->out_seq); if (!session->out_seq) ++(session->out_seq); *msg_len = IPMI_LANPLUS_OFFSET_PAYLOAD + payload->payload_length + session_trailer_length; *msg_data = msg; return 0; } /* * ipmi_lanplus_build_v2x_ipmi_cmd * * Wraps ipmi_lanplus_build_v2x_msg and returns a new entry object for the * command * */ static struct ipmi_rq_entry * ipmi_lanplus_build_v2x_ipmi_cmd( struct ipmi_intf * intf, struct ipmi_rq * req) { struct ipmi_v2_payload v2_payload; struct ipmi_rq_entry * entry; int rv; /* * We have a problem. we need to know the sequence number here, * because we use it in our stored entry. But we also need to * know the sequence number when we generate our IPMI * representation far below. */ static uint8_t curr_seq = 0; curr_seq += 1; if (curr_seq >= 64) curr_seq = 0; /* IPMI Message Header -- Figure 13-4 of the IPMI v2.0 spec */ if ((intf->target_addr == intf->my_addr) || (!bridgePossible)) { entry = ipmi_req_add_entry(intf, req, curr_seq); } else /* it's a bridge command */ { unsigned char backup_cmd; /* Add entry for cmd */ entry = ipmi_req_add_entry(intf, req, curr_seq); if (entry) { /* Add entry for bridge cmd */ backup_cmd = req->msg.cmd; req->msg.cmd = 0x34; entry = ipmi_req_add_entry(intf, req, curr_seq); req->msg.cmd = backup_cmd; } } if (entry == NULL) return NULL; // Build our payload v2_payload.payload_type = IPMI_PAYLOAD_TYPE_IPMI; v2_payload.payload_length = req->msg.data_len + 7; v2_payload.payload.ipmi_request.request = req; v2_payload.payload.ipmi_request.rq_seq = curr_seq; rv = ipmi_lanplus_build_v2x_msg(intf, // in &v2_payload, // in &(entry->msg_len), // out &(entry->msg_data), // out curr_seq); // in if (rv != 0) return NULL; return entry; } /* * IPMI LAN Request Message Format * +--------------------+ * | rmcp.ver | 4 bytes * | rmcp.__rsvd | * | rmcp.seq | * | rmcp.class | * +--------------------+ * | session.authtype | 9 bytes * | session.seq | * | session.id | * +--------------------+ * | [session.authcode] | 16 bytes (AUTHTYPE != none) * +--------------------+ * | message length | 1 byte * +--------------------+ * | message.rs_addr | 6 bytes * | message.netfn_lun | * | message.checksum | * | message.rq_addr | * | message.rq_seq | * | message.cmd | * +--------------------+ * | [request data] | data_len bytes * +--------------------+ * | checksum | 1 byte * +--------------------+ */ static struct ipmi_rq_entry * ipmi_lanplus_build_v15_ipmi_cmd( struct ipmi_intf * intf, struct ipmi_rq * req) { uint8_t * msg; int cs, mp, len = 0, tmp; struct ipmi_session * session = intf->session; struct ipmi_rq_entry * entry; #if defined(WIN32) || defined(SOLARIS) || defined(HPUX) struct rmcp_hdr rmcp; rmcp.ver = RMCP_VERSION_1; rmcp.class = RMCP_CLASS_IPMI; rmcp.seq = 0xff; rmcp.__rsvd = 0; #else struct rmcp_hdr rmcp = { .ver = RMCP_VERSION_1, .__rsvd = 0, .class = RMCP_CLASS_IPMI, .seq = 0xff, }; #endif entry = ipmi_req_add_entry(intf, req, 0); if (entry == NULL) return NULL; len = req->msg.data_len + 21; msg = malloc(len); if (msg == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); free(entry); return NULL; } memset(msg, 0, len); /* rmcp header */ memcpy(msg, &rmcp, sizeof(rmcp)); len = sizeof(rmcp); /* * ipmi session header */ /* Authtype should always be none for 1.5 packets sent from this * interface */ msg[len++] = IPMI_SESSION_AUTHTYPE_NONE; msg[len++] = session->out_seq & 0xff; msg[len++] = (session->out_seq >> 8) & 0xff; msg[len++] = (session->out_seq >> 16) & 0xff; msg[len++] = (session->out_seq >> 24) & 0xff; /* * The session ID should be all zeroes for pre-session commands. We * should only be using the 1.5 interface for the pre-session Get * Channel Authentication Capabilities command */ msg[len++] = 0; msg[len++] = 0; msg[len++] = 0; msg[len++] = 0; /* message length */ msg[len++] = req->msg.data_len + 7; /* ipmi message header */ cs = mp = len; msg[len++] = IPMI_BMC_SLAVE_ADDR; msg[len++] = req->msg.netfn << 2; tmp = len - cs; msg[len++] = ipmi_csum(msg+cs, tmp); cs = len; msg[len++] = IPMI_REMOTE_SWID; entry->rq_seq = 0; /*should swseq start w 1?*/ msg[len++] = entry->rq_seq << 2; msg[len++] = req->msg.cmd; lprintf(LOG_DEBUG+1, ">> IPMI Request Session Header"); lprintf(LOG_DEBUG+1, ">> Authtype : %s", val2str(IPMI_SESSION_AUTHTYPE_NONE, ipmi_authtype_session_vals)); lprintf(LOG_DEBUG+1, ">> Sequence : 0x%08lx", (long)session->out_seq); lprintf(LOG_DEBUG+1, ">> Session ID : 0x%08lx", (long)0); lprintf(LOG_DEBUG+1, ">> IPMI Request Message Header"); lprintf(LOG_DEBUG+1, ">> Rs Addr : %02x", IPMI_BMC_SLAVE_ADDR); lprintf(LOG_DEBUG+1, ">> NetFn : %02x", req->msg.netfn); lprintf(LOG_DEBUG+1, ">> Rs LUN : %01x", 0); lprintf(LOG_DEBUG+1, ">> Rq Addr : %02x", IPMI_REMOTE_SWID); lprintf(LOG_DEBUG+1, ">> Rq Seq : %02x", entry->rq_seq); lprintf(LOG_DEBUG+1, ">> Rq Lun : %01x", 0); lprintf(LOG_DEBUG+1, ">> Command : %02x", req->msg.cmd); /* message data */ if (req->msg.data_len) { memcpy(msg+len, req->msg.data, req->msg.data_len); len += req->msg.data_len; } /* second checksum */ tmp = len - cs; msg[len++] = ipmi_csum(msg+cs, tmp); entry->msg_len = len; entry->msg_data = msg; return entry; } /* * is_sol_packet */ static int is_sol_packet(struct ipmi_rs * rsp) { return (rsp && (rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS) && (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL)); } /* * sol_response_acks_packet */ static int sol_response_acks_packet( struct ipmi_rs * rsp, struct ipmi_v2_payload * payload) { return (is_sol_packet(rsp) && payload && (payload->payload_type == IPMI_PAYLOAD_TYPE_SOL) && (rsp->payload.sol_packet.acked_packet_number == payload->payload.sol_packet.packet_sequence_number)); } /* * ipmi_lanplus_send_payload * */ struct ipmi_rs * ipmi_lanplus_send_payload( struct ipmi_intf * intf, struct ipmi_v2_payload * payload) { struct ipmi_rs * rsp = NULL; uint8_t * msg_data = NULL; int msg_length; struct ipmi_session * session = intf->session; int itry = 0; int xmit = 1; time_t ltime; int rv = 0; struct ipmi_rq_entry *entry = NULL; if (!intf->opened && intf->open && intf->open(intf) < 0) return NULL; while (itry < session->retry) { ltime = time(NULL); if (xmit) { if (payload->payload_type == IPMI_PAYLOAD_TYPE_IPMI) { /* * Build an IPMI v1.5 or v2 command */ struct ipmi_rq * ipmi_request = payload->payload.ipmi_request.request; lprintf(LOG_DEBUG, ""); lprintf(LOG_DEBUG, ">> Sending IPMI command payload"); lprintf(LOG_DEBUG, ">> netfn : 0x%02x", ipmi_request->msg.netfn); lprintf(LOG_DEBUG, ">> command : 0x%02x", ipmi_request->msg.cmd); lprintf(LOG_DEBUG, ">> data_len: %d", ipmi_request->msg.data_len); if (verbose > 1) { char msg[256]; uint16_t i; size_t n; sprintf(msg, ">> data : "); n = strlen(msg); for (i = 0; i < ipmi_request->msg.data_len; ++i) { sprintf(&msg[n], "0x%02x ", ipmi_request->msg.data[i]); n += 5; if ((n+5) >= sizeof(msg)) break; } // strcat(msg,"\n"); lprintf(LOG_DEBUG, msg); } /* * If we are presession, and the command is GET CHANNEL AUTHENTICATION * CAPABILITIES, we will build the command in v1.5 format. This is so * that we can ask any server whether it supports IPMI v2 / RMCP+ * before we attempt to open a v2.x session. */ if ((ipmi_request->msg.netfn == IPMI_NETFN_APP) && (ipmi_request->msg.cmd == IPMI_GET_CHANNEL_AUTH_CAP) && // (!ipmi_oem_active(intf, "hp")) && (session->v2_data.bmc_id == 0)) // jme - check { lprintf(LOG_DEBUG+1, "BUILDING A v1.5 COMMAND"); entry = ipmi_lanplus_build_v15_ipmi_cmd(intf, ipmi_request); } else { lprintf(LOG_DEBUG+1, "BUILDING A v2 COMMAND"); entry = ipmi_lanplus_build_v2x_ipmi_cmd(intf, ipmi_request); } if (entry == NULL) { lprintf(LOG_ERR, "Aborting send command, unable to build"); return NULL; } msg_data = entry->msg_data; msg_length = entry->msg_len; // entry is freed later for IPMI payloads } else if (payload->payload_type == IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST) { lprintf(LOG_DEBUG, ">> SENDING AN OPEN SESSION REQUEST\n"); /* assert(session->v2_data.session_state == LANPLUS_STATE_PRESESSION); */ if (session->v2_data.session_state != LANPLUS_STATE_PRESESSION) { /* Sometimes state==OPEN_SESSION_SENT(1) */ lprintf(LOG_ERR, "lanplus open session_state %x != LANPLUSLANPLUS_STATE_PRESESSION\n",session->v2_data.session_state); return NULL; } /*ARC, removed assert*/ rv = ipmi_lanplus_build_v2x_msg(intf, /* in */ payload, /* in */ &msg_length, /* out*/ &msg_data, /* out*/ 0); /* irrelevant for this msg*/ if (rv != 0) return NULL; } else if (payload->payload_type == IPMI_PAYLOAD_TYPE_RAKP_1) { lprintf(LOG_DEBUG, ">> SENDING A RAKP 1 MESSAGE\n"); /* sometimes hit this assert - ARC */ // assert(session->v2_data.session_state == // LANPLUS_STATE_OPEN_SESSION_RECEIEVED); if (session->v2_data.session_state != LANPLUS_STATE_OPEN_SESSION_RECEIEVED) { lprintf(LOG_ERR, "lanplus rakp1 payload: session_state %x != LANPLUS_STATE_OPEN_SESSION_RECEIEVED\n",session->v2_data.session_state); return NULL; } rv = ipmi_lanplus_build_v2x_msg(intf, /* in */ payload, /* in */ &msg_length, /* out*/ &msg_data, /* out*/ 0); /* irrelevant for this msg*/ if (rv != 0) return NULL; } else if (payload->payload_type == IPMI_PAYLOAD_TYPE_RAKP_3) { lprintf(LOG_DEBUG, ">> SENDING A RAKP 3 MESSAGE\n"); // assert(session->v2_data.session_state == // LANPLUS_STATE_RAKP_2_RECEIVED); if (session->v2_data.session_state != LANPLUS_STATE_RAKP_2_RECEIVED) { /* Sometimes state==RAKP_3_SENT(5) */ lprintf(LOG_ERR, "lanplus rakp3 payload: session_state %x != LANPLUS_STATE_RAKP_2_RECEIVED, try=%d\n",session->v2_data.session_state,itry); return NULL; } rv = ipmi_lanplus_build_v2x_msg(intf, /* in */ payload, /* in */ &msg_length, /* out*/ &msg_data, /* out*/ 0); /* irrelevant for this msg*/ if (rv != 0) return NULL; } else if (payload->payload_type == IPMI_PAYLOAD_TYPE_SOL) { lprintf(LOG_DEBUG, ">> SENDING A SOL MESSAGE\n"); // assert(session->v2_data.session_state == LANPLUS_STATE_ACTIVE); if (session->v2_data.session_state != LANPLUS_STATE_ACTIVE) { lprintf(LOG_ERR, "lanplus session_state %x != LANPLUS_STATE_ACTIVE, try=%d\n",session->v2_data.session_state, itry); return NULL; } /*ARC, removed assert*/ rv = ipmi_lanplus_build_v2x_msg(intf, /* in */ payload, /* in */ &msg_length, /* out*/ &msg_data, /* out*/ 0); /* irrelevant for this msg*/ if (rv != 0) return NULL; } else { lprintf(LOG_ERR, "Payload type 0x%0x is unsupported!", payload->payload_type); // assert(0); return NULL; } if (ipmi_lan_send_packet(intf, msg_data, msg_length) < 0) { lprintf(LOG_ERR, "IPMI LAN send command failed"); free(msg_data); /*added in v2.8.5*/ return(NULL); } } /* if we are set to noanswer we do not expect response */ if (intf->noanswer) break; lan2_usleep(0,recv_delay); /* wait 100us before doing recv */ /* Remember our connection state */ switch (payload->payload_type) { case IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST: session->v2_data.session_state = LANPLUS_STATE_OPEN_SESSION_SENT; break; case IPMI_PAYLOAD_TYPE_RAKP_1: session->v2_data.session_state = LANPLUS_STATE_RAKP_1_SENT; break; case IPMI_PAYLOAD_TYPE_RAKP_3: session->v2_data.session_state = LANPLUS_STATE_RAKP_3_SENT; break; } /* * Special case for SOL outbound packets. */ if (payload->payload_type == IPMI_PAYLOAD_TYPE_SOL) { if (!payload->payload.sol_packet.packet_sequence_number) { /* We're just sending an ACK. No need to retry. */ if (verbose > 2) lprintf(LOG_INFO, "send_payload(SOL,ack) nowait"); /*ARC*/ break; } if (verbose > 2) lprintf(LOG_INFO, "send_payload(SOL,timeout=%d)",intf->session->timeout); /*ARC*/ rsp = ipmi_lanplus_recv_sol(intf); /* Grab the next packet */ if (sol_response_acks_packet(rsp, payload)) { if (verbose > 2) lprintf(LOG_INFO, /*ARC*/ "send_payload(SOL) rsp acks_packet %d", payload->payload.sol_packet.packet_sequence_number); break; } else if (is_sol_packet(rsp) && rsp->data_len) { lprintf(LOG_INFO, /*ARC*/ "send_payload(SOL,%d,%d), rlen=%d seq=%d, no ack yet", intf->session->timeout,itry,rsp->data_len, payload->payload.sol_packet.packet_sequence_number); /* * We're still waiting for our ACK, but we got * more data from the BMC. Send to handler. */ intf->session->sol_data.sol_input_handler(rsp); /* In order to avoid duplicate output, just set data_len to 0 */ rsp->data_len = 0; /*added 04/17/08*/ if (slow_link) break; /*ARC 09/01/09*/ } else { lprintf(LOG_INFO, /*ARC*/ "send_payload(SOL,%d,%d) sol_seq=%d rsp=%p no ack", intf->session->timeout,itry, payload->payload.sol_packet.packet_sequence_number, rsp); } } /* Non-SOL processing */ else { lprintf(LOG_INFO, "send_payload(non-SOL) type=%d data", payload->payload_type); rsp = ipmi_lan_poll_recv(intf); if (rsp) { lprintf(LOG_INFO, "send_payload(non-SOL) rsp dlen=%d, rs_seq=%d", rsp->data_len,rsp->session.seq); break; } } xmit = ((u_long)(time(NULL) - ltime) >= intf->session->timeout); lan2_usleep(0,5000); /*sleep 5.0ms before next try*/ if (xmit) { /* incremet session timeout each try */ intf->session->timeout++; } itry++; } /* Reset timeout after retry loop completes */ intf->session->timeout = lan2_timeout; /* IPMI messages are deleted under ipmi_lan_poll_recv() */ switch (payload->payload_type) { case IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST: case IPMI_PAYLOAD_TYPE_RAKP_1: case IPMI_PAYLOAD_TYPE_RAKP_3: free(msg_data); break; } return rsp; } /* * is_sol_partial_ack * * Determine if the response is a partial ACK/NACK that indicates * we need to resend part of our packet. * * returns the number of characters we need to resend, or * 0 if this isn't an ACK or we don't need to resend anything */ int is_sol_partial_ack( struct ipmi_intf * intf, struct ipmi_v2_payload * v2_payload, struct ipmi_rs * rs) { int chars_to_resend = 0; if (v2_payload && rs && is_sol_packet(rs) && sol_response_acks_packet(rs, v2_payload) && (rs->payload.sol_packet.accepted_character_count < v2_payload->payload.sol_packet.character_count)) { lprintf(LOG_INFO, "is_sol_partial_ack: count=%d > accepted=%d", v2_payload->payload.sol_packet.character_count, rs->payload.sol_packet.accepted_character_count ); if (ipmi_oem_active(intf, "intelplus") && rs->payload.sol_packet.accepted_character_count == 0) return 0; chars_to_resend = v2_payload->payload.sol_packet.character_count - rs->payload.sol_packet.accepted_character_count; } return chars_to_resend; } /* * set_sol_packet_sequence_number */ static void set_sol_packet_sequence_number( struct ipmi_intf * intf, struct ipmi_v2_payload * v2_payload) { /* Keep our sequence number sane */ if (intf->session->sol_data.sequence_number > 0x0F) intf->session->sol_data.sequence_number = 1; v2_payload->payload.sol_packet.packet_sequence_number = intf->session->sol_data.sequence_number++; } /* * ipmi_lanplus_send_sol * * Sends a SOL packet.. We handle partial ACK/NACKs from the BMC here. * * Returns a pointer to the SOL ACK we received, or * 0 on failure * */ struct ipmi_rs * ipmi_lanplus_send_sol( struct ipmi_intf * intf, void * v2_in) { struct ipmi_v2_payload * v2_payload = v2_in; struct ipmi_rs * rs; /* * chars_to_resend indicates either that we got a NACK telling us * that we need to resend some part of our data. */ int chars_to_resend = 0; v2_payload->payload_type = IPMI_PAYLOAD_TYPE_SOL; /* * Payload length is just the length of the character * data here. */ v2_payload->payload_length = v2_payload->payload.sol_packet.character_count; v2_payload->payload.sol_packet.acked_packet_number = 0; /* NA */ set_sol_packet_sequence_number(intf, v2_payload); v2_payload->payload.sol_packet.accepted_character_count = 0; /* NA */ rs = ipmi_lanplus_send_payload(intf, v2_payload); /* Determine if we need to resend some of our data */ chars_to_resend = is_sol_partial_ack(intf, v2_payload, rs); if ((verbose > 2) && (chars_to_resend > 0)) { /*show warnings if here*/ if (rs == NULL) lprintf(LOG_INFO,"send_sol: nresend=%d no rs",chars_to_resend); else lprintf(LOG_INFO,"send_sol: nresend=%d unavail=%d nack=%d", chars_to_resend, rs->payload.sol_packet.transfer_unavailable, rs->payload.sol_packet.is_nack); } while (rs && !rs->payload.sol_packet.transfer_unavailable && !rs->payload.sol_packet.is_nack && chars_to_resend) { /* * We first need to handle any new data we might have * received in our NACK */ if (rs->data_len) intf->session->sol_data.sol_input_handler(rs); set_sol_packet_sequence_number(intf, v2_payload); /* Just send the required data */ memmove(v2_payload->payload.sol_packet.data, v2_payload->payload.sol_packet.data + rs->payload.sol_packet.accepted_character_count, chars_to_resend); v2_payload->payload.sol_packet.character_count = (uint16_t)chars_to_resend; v2_payload->payload_length = v2_payload->payload.sol_packet.character_count; rs = ipmi_lanplus_send_payload(intf, v2_payload); chars_to_resend = is_sol_partial_ack(intf, v2_payload, rs); } return rs; } /* * check_sol_packet_for_new_data * * Determine whether the SOL packet has already been seen * and whether the packet has new data for us. * * This function has the side effect of removing an previously * seen data, and moving new data to the front. * * It also "Remembers" the data so we don't get repeats. * * returns the number of new bytes in the SOL packet */ static int check_sol_packet_for_new_data( struct ipmi_intf * intf, struct ipmi_rs *rsp) { static uint8_t last_received_sequence_number = 0; static uint8_t last_received_byte_count = 0; int new_data_size = 0; if (rsp && (rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS) && (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL)) { /* Store the data length before we mod it */ uint8_t unaltered_data_len = (uint8_t)rsp->data_len; lprintf(LOG_INFO,"check_sol_packet_for_new_data: " "rsp dlen=%d rs_seq=%d sol_rseq=%d", rsp->data_len, rsp->session.seq, rsp->payload.sol_packet.packet_sequence_number); if (rsp->payload.sol_packet.packet_sequence_number == last_received_sequence_number) { if (verbose > 2) lprintf(LOG_INFO,"check_sol: seq=%x retry match len=%d nlast=%d", rsp->payload.sol_packet.packet_sequence_number, rsp->data_len, last_received_byte_count); /* * This is the same as the last packet, but may include * extra data */ new_data_size = rsp->data_len - last_received_byte_count; if (new_data_size > 0) { /* We have more data to process */ memmove(rsp->data, rsp->data + rsp->data_len - new_data_size, new_data_size); } rsp->data_len = new_data_size; } /* * Remember the data for next round * if non-zero sequence number */ if (rsp->payload.sol_packet.packet_sequence_number) { last_received_sequence_number = rsp->payload.sol_packet.packet_sequence_number; last_received_byte_count = unaltered_data_len; } else if (rsp->data_len > 0) { /* rsp sol seq is zero, so ignore any data */ lprintf(LOG_INFO,"check_sol: rseq=%d rlen=%d ack, zero data", rsp->payload.sol_packet.packet_sequence_number, rsp->data_len); rsp->data_len = 0; } } return new_data_size; } /* * ack_sol_packet * * Provided the specified packet looks reasonable, ACK it. */ static void ack_sol_packet( struct ipmi_intf * intf, struct ipmi_rs * rsp) { if (rsp && (rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS) && (rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL) && (rsp->payload.sol_packet.packet_sequence_number)) { struct ipmi_v2_payload ack; memset(&ack, 0, sizeof(struct ipmi_v2_payload)); ack.payload_type = IPMI_PAYLOAD_TYPE_SOL; /* * Payload length is just the length of the character * data here. */ ack.payload_length = 0; /* ACK packets have sequence numbers of 0 */ ack.payload.sol_packet.packet_sequence_number = 0; ack.payload.sol_packet.acked_packet_number = rsp->payload.sol_packet.packet_sequence_number; ack.payload.sol_packet.accepted_character_count = (uint8_t)rsp->data_len; if (verbose > 2) lprintf(LOG_INFO,"ack of seq_num 0x%x",rsp->payload.sol_packet.packet_sequence_number); ipmi_lanplus_send_payload(intf, &ack); } } /* * ipmi_lanplus_recv_sol * * Receive a SOL packet and send an ACK in response. * */ struct ipmi_rs * ipmi_lanplus_recv_sol(struct ipmi_intf * intf) { struct ipmi_rs * rsp = ipmi_lan_poll_recv(intf); if (rsp && rsp->session.authtype != 0) { ack_sol_packet(intf, rsp); /* * Remembers the data sent, and alters the data to just * include the new stuff. */ check_sol_packet_for_new_data(intf, rsp); } return rsp; } /** * ipmi_lanplus_send_ipmi_cmd * * Build a payload request and dispatch it. */ struct ipmi_rs * ipmi_lanplus_send_ipmi_cmd( struct ipmi_intf * intf, struct ipmi_rq * req) { struct ipmi_v2_payload v2_payload; v2_payload.payload_type = IPMI_PAYLOAD_TYPE_IPMI; // v2_payload.payload_length = 7 + req->msg.data_len; /*initial ++++*/ v2_payload.payload.ipmi_request.request = req; // if (verbose > 2) lprintf(LOG_INFO,"ipmi cmd payload"); /*++++*/ return ipmi_lanplus_send_payload(intf, &v2_payload); } /* * ipmi_get_auth_capabilities_cmd * * This command may have to be sent twice. We first ask for the * authentication capabilities with the "request IPMI v2 data bit" * set. If this fails, we send the same command without that bit * set. * * param intf is the initialized (but possibly) pre-session interface * on which we will send the command * param auth_cap [out] will be initialized to hold the Get Channel * Authentication Capabilities return data on success. Its * contents will be undefined on error. * * returns 0 on success * non-zero if we were unable to contact the BMC, or we cannot * get a successful response * */ static int ipmi_get_auth_capabilities_cmd( struct ipmi_intf * intf, struct get_channel_auth_cap_rsp * auth_cap) { struct ipmi_rs * rsp; struct ipmi_rq req; uint8_t msg_data[2]; uint8_t backupBridgePossible; backupBridgePossible = bridgePossible; bridgePossible = 0; msg_data[0] = IPMI_LAN_CHANNEL_E | 0x80; // Ask for IPMI v2 data as well msg_data[1] = intf->session->privlvl; memset(&req, 0, sizeof(req)); req.msg.netfn = IPMI_NETFN_APP; // 0x06 req.msg.cmd = IPMI_GET_CHANNEL_AUTH_CAP; // 0x38 req.msg.data = msg_data; req.msg.data_len = 2; rsp = intf->sendrecv(intf, &req); if (rsp == NULL || rsp->ccode > 0) { /* * It's very possible that this failed because we asked for IPMI * v2 data. Ask again, without requesting IPMI v2 data. */ msg_data[0] &= 0x7F; rsp = intf->sendrecv(intf, &req); if (rsp == NULL) { lprintf(LOG_INFO, "Get Auth Capabilities error"); return 1; } if (rsp->ccode > 0) { lprintf(LOG_INFO, "Get Auth Capabilities error: %s", val2str(rsp->ccode, completion_code_vals)); return 1; } } memcpy(auth_cap, rsp->data, sizeof(struct get_channel_auth_cap_rsp)); bridgePossible = backupBridgePossible; return 0; } static int ipmi_close_session_cmd(struct ipmi_intf * intf) { struct ipmi_rs * rsp; struct ipmi_rq req; uint8_t msg_data[4]; uint32_t bmc_session_lsbf; uint8_t backupBridgePossible; if (intf->session->v2_data.session_state != LANPLUS_STATE_ACTIVE) return -1; backupBridgePossible = bridgePossible; intf->target_addr = IPMI_BMC_SLAVE_ADDR; bridgePossible = 0; bmc_session_lsbf = intf->session->v2_data.bmc_id; #if WORDS_BIGENDIAN bmc_session_lsbf = BSWAP_32(bmc_session_lsbf); #endif memcpy(&msg_data, &bmc_session_lsbf, 4); memset(&req, 0, sizeof(req)); req.msg.netfn = IPMI_NETFN_APP; req.msg.cmd = 0x3c; req.msg.data = msg_data; req.msg.data_len = 4; rsp = intf->sendrecv(intf, &req); if (rsp == NULL) { /* Looks like the session was closed */ lprintf(LOG_ERR, "Close Session command failed"); return -1; } if (verbose > 2) printbuf(rsp->data, rsp->data_len, "close_session"); if (rsp->ccode == 0x87) { lprintf(LOG_ERR, "Failed to Close Session: invalid " "session ID %08lx", (long)intf->session->v2_data.bmc_id); return -1; } if (rsp->ccode > 0) { lprintf(LOG_ERR, "Close Session command failed: %s", val2str(rsp->ccode, completion_code_vals)); return -1; } lprintf(LOG_DEBUG, "Closed Session %08lx\n", (long)intf->session->v2_data.bmc_id); bridgePossible = backupBridgePossible; return 0; } /* * ipmi_lanplus_open_session * * Build and send the open session command. See section 13.17 of the IPMI * v2 specification for details. */ static int ipmi_lanplus_open_session(struct ipmi_intf * intf) { struct ipmi_v2_payload v2_payload; struct ipmi_session * session = intf->session; uint8_t * msg; struct ipmi_rs * rsp; int rc = 0; lprintf(LOG_INFO,"ipmi_lanplus_open_session, verbose=%d\n", verbose); /* * Build an Open Session Request Payload */ msg = (uint8_t*)malloc(IPMI_OPEN_SESSION_REQUEST_SIZE); if (msg == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return -1; } memset(msg, 0, IPMI_OPEN_SESSION_REQUEST_SIZE); msg[0] = 0; /* Message tag */ if (ipmi_oem_active(intf, "intelplus") || session->privlvl != IPMI_SESSION_PRIV_ADMIN) msg[1] = session->privlvl; else msg[1] = 0; /* Give us highest privlg level based on supported algorithms */ msg[2] = 0; /* reserved */ msg[3] = 0; /* reserved */ /* Choose our session ID for easy recognition in the packet dump */ session->v2_data.console_id = 0xA0A2A3A4; msg[4] = session->v2_data.console_id & 0xff; msg[5] = (session->v2_data.console_id >> 8) & 0xff; msg[6] = (session->v2_data.console_id >> 16) & 0xff; msg[7] = (session->v2_data.console_id >> 24) & 0xff; if (lanplus_get_requested_ciphers(session->cipher_suite_id, &(session->v2_data.requested_auth_alg), &(session->v2_data.requested_integrity_alg), &(session->v2_data.requested_crypt_alg))) { lprintf(LOG_WARNING, "Unsupported cipher suite ID : %d\n", session->cipher_suite_id); free(msg); return -1; } /* * Authentication payload */ msg[8] = 0; /* specifies authentication payload */ msg[9] = 0; /* reserved */ msg[10] = 0; /* reserved */ msg[11] = 8; /* payload length */ msg[12] = session->v2_data.requested_auth_alg; msg[13] = 0; /* reserved */ msg[14] = 0; /* reserved */ msg[15] = 0; /* reserved */ /* * Integrity payload */ msg[16] = 1; /* specifies integrity payload */ msg[17] = 0; /* reserved */ msg[18] = 0; /* reserved */ msg[19] = 8; /* payload length */ msg[20] = session->v2_data.requested_integrity_alg; msg[21] = 0; /* reserved */ msg[22] = 0; /* reserved */ msg[23] = 0; /* reserved */ /* * Confidentiality/Encryption payload */ msg[24] = 2; /* specifies confidentiality payload */ msg[25] = 0; /* reserved */ msg[26] = 0; /* reserved */ msg[27] = 8; /* payload length */ msg[28] = session->v2_data.requested_crypt_alg; msg[29] = 0; /* reserved */ msg[30] = 0; /* reserved */ msg[31] = 0; /* reserved */ v2_payload.payload_type = IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST; v2_payload.payload_length = IPMI_OPEN_SESSION_REQUEST_SIZE; v2_payload.payload.open_session_request.request = msg; rsp = ipmi_lanplus_send_payload(intf, &v2_payload); free(msg); if (rsp == NULL) { /* failsafe check for Dell PE1955 - ARCress 02/28/07 */ lprintf(LOG_WARNING, "Error in open session, no response.\n"); return -1; } if (verbose) lanplus_dump_open_session_response(rsp); if (rsp->payload.open_session_response.rakp_return_code != IPMI_RAKP_STATUS_NO_ERRORS) { lprintf(LOG_WARNING, "Error in open session response message : %s\n", val2str(rsp->payload.open_session_response.rakp_return_code, ipmi_rakp_return_codes)); return -1; } else { if (rsp->payload.open_session_response.console_id != session->v2_data.console_id) { lprintf(LOG_WARNING, "Warning: Console session ID is not " "what we requested"); } session->v2_data.max_priv_level = rsp->payload.open_session_response.max_priv_level; session->v2_data.bmc_id = rsp->payload.open_session_response.bmc_id; session->v2_data.auth_alg = rsp->payload.open_session_response.auth_alg; session->v2_data.integrity_alg = rsp->payload.open_session_response.integrity_alg; session->v2_data.crypt_alg = rsp->payload.open_session_response.crypt_alg; session->v2_data.session_state = LANPLUS_STATE_OPEN_SESSION_RECEIEVED; /* * Verify that we have agreed on a cipher suite */ if (rsp->payload.open_session_response.auth_alg != session->v2_data.requested_auth_alg) { lprintf(LOG_WARNING, "Authentication algorithm 0x%02x is " "not what we requested 0x%02x\n", rsp->payload.open_session_response.auth_alg, session->v2_data.requested_auth_alg); rc = -1; } else if (rsp->payload.open_session_response.integrity_alg != session->v2_data.requested_integrity_alg) { lprintf(LOG_WARNING, "Integrity algorithm 0x%02x is " "not what we requested 0x%02x\n", rsp->payload.open_session_response.integrity_alg, session->v2_data.requested_integrity_alg); rc = -1; } else if (rsp->payload.open_session_response.crypt_alg != session->v2_data.requested_crypt_alg) { lprintf(LOG_WARNING, "Encryption algorithm 0x%02x is " "not what we requested 0x%02x\n", rsp->payload.open_session_response.crypt_alg, session->v2_data.requested_crypt_alg); rc = -1; } } return rc; } /* * ipmi_lanplus_rakp1 * * Build and send the RAKP 1 message as part of the IPMI v2 / RMCP+ session * negotiation protocol. We also read and validate the RAKP 2 message received * from the BMC, here. See section 13.20 of the IPMI v2 specification for * details. * * returns 0 on success * 1 on failure * * Note that failure is only indicated if we have an internal error of * some kind. If we actually get a RAKP 2 message in response to our * RAKP 1 message, any errors will be stored in * session->v2_data.rakp2_return_code and sent to the BMC in the RAKP * 3 message. */ static int ipmi_lanplus_rakp1(struct ipmi_intf * intf) { struct ipmi_v2_payload v2_payload; struct ipmi_session * session = intf->session; uint8_t * msg; struct ipmi_rs * rsp; int rc = 0; /* * Build a RAKP 1 message */ msg = (uint8_t*)malloc(IPMI_RAKP1_MESSAGE_SIZE); if (msg == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return 1; } memset(msg, 0, IPMI_RAKP1_MESSAGE_SIZE); msg[0] = 0; /* Message tag */ msg[1] = 0; /* reserved */ msg[2] = 0; /* reserved */ msg[3] = 0; /* reserved */ /* BMC session ID */ msg[4] = session->v2_data.bmc_id & 0xff; msg[5] = (session->v2_data.bmc_id >> 8) & 0xff; msg[6] = (session->v2_data.bmc_id >> 16) & 0xff; msg[7] = (session->v2_data.bmc_id >> 24) & 0xff; /* We need a 16 byte random number */ if (lanplus_rand(session->v2_data.console_rand, 16)) { // ERROR; lprintf(LOG_ERR, "ERROR generating random number " "in ipmi_lanplus_rakp1"); free(msg); return 1; } memcpy(msg + 8, session->v2_data.console_rand, 16); #if WORDS_BIGENDIAN lanplus_swap(msg + 8, 16); #endif if (verbose > 1) printbuf(session->v2_data.console_rand, 16, ">> Console generated random number"); /* * Requested maximum privilege level. */ msg[24] = 0x10; /* We will specify a name-only lookup */ msg[24] |= session->privlvl; // msg[24] = session->privlvl | session->v2_data.lookupbit; *++++* session->v2_data.requested_role = msg[24]; msg[25] = 0; /* reserved */ msg[26] = 0; /* reserved */ /* Username specification */ msg[27] = (uint8_t)strlen((const char *)session->username); if (msg[27] > IPMI_MAX_USER_NAME_LENGTH) { lprintf(LOG_ERR, "ERROR: user name too long. " "(Exceeds %d characters)", IPMI_MAX_USER_NAME_LENGTH); free(msg); return 1; } memcpy(msg + 28, session->username, msg[27]); v2_payload.payload_type = IPMI_PAYLOAD_TYPE_RAKP_1; v2_payload.payload_length = IPMI_RAKP1_MESSAGE_SIZE - (16 - msg[27]); v2_payload.payload.rakp_1_message.message = msg; rsp = ipmi_lanplus_send_payload(intf, &v2_payload); free(msg); if (rsp == NULL) { lprintf(LOG_INFO, "> Error: no response from RAKP 1 message"); return 1; } session->v2_data.session_state = LANPLUS_STATE_RAKP_2_RECEIVED; if (verbose) lanplus_dump_rakp2_message(rsp, session->v2_data.auth_alg); if (rsp->payload.rakp2_message.rakp_return_code != IPMI_RAKP_STATUS_NO_ERRORS) { lprintf(LOG_INFO, "RAKP 2 message indicates an error : %s", val2str(rsp->payload.rakp2_message.rakp_return_code, ipmi_rakp_return_codes)); rc = 1; } else { memcpy(session->v2_data.bmc_rand, rsp->payload.rakp2_message.bmc_rand, 16); memcpy(session->v2_data.bmc_guid, rsp->payload.rakp2_message.bmc_guid, 16); if (verbose > 2) printbuf(session->v2_data.bmc_rand, 16, "bmc_rand"); /* * It is at this point that we have to decode the random number and determine * whether the BMC has authenticated. */ if (! lanplus_rakp2_hmac_matches(session, rsp->payload.rakp2_message.key_exchange_auth_code, intf)) { /* Error */ lprintf(LOG_INFO, "> RAKP 2 HMAC is invalid"); session->v2_data.rakp2_return_code = IPMI_RAKP_STATUS_INVALID_INTEGRITY_CHECK_VALUE; rc = 1; /*added 03/28/07*/ } else { /* Success */ session->v2_data.rakp2_return_code = IPMI_RAKP_STATUS_NO_ERRORS; } } return rc; } /* * ipmi_lanplus_rakp3 * * Build and send the RAKP 3 message as part of the IPMI v2 / RMCP+ session * negotiation protocol. We also read and validate the RAKP 4 message received * from the BMC, here. See section 13.20 of the IPMI v2 specification for * details. * * If the RAKP 2 return code is not IPMI_RAKP_STATUS_NO_ERRORS, we will * exit with an error code immediately after sendint the RAKP 3 message. * * param intf is the intf that holds all the state we are concerned with * * returns 0 on success * 1 on failure */ static int ipmi_lanplus_rakp3(struct ipmi_intf * intf) { struct ipmi_v2_payload v2_payload; struct ipmi_session * session = intf->session; uint8_t * msg; struct ipmi_rs * rsp; if (session->v2_data.session_state != LANPLUS_STATE_RAKP_2_RECEIVED) { lprintf(LOG_ERR, "lanplus: state %d not RAKP2_RECEIVED", session->v2_data.session_state); return 1; /*was assert*/ } /* * Build a RAKP 3 message */ msg = (uint8_t*)malloc(IPMI_RAKP3_MESSAGE_MAX_SIZE); if (msg == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return 1; } memset(msg, 0, IPMI_RAKP3_MESSAGE_MAX_SIZE); msg[0] = 0; /* Message tag */ msg[1] = session->v2_data.rakp2_return_code; msg[2] = 0; /* reserved */ msg[3] = 0; /* reserved */ /* BMC session ID */ msg[4] = session->v2_data.bmc_id & 0xff; msg[5] = (session->v2_data.bmc_id >> 8) & 0xff; msg[6] = (session->v2_data.bmc_id >> 16) & 0xff; msg[7] = (session->v2_data.bmc_id >> 24) & 0xff; v2_payload.payload_type = IPMI_PAYLOAD_TYPE_RAKP_3; v2_payload.payload_length = 8; v2_payload.payload.rakp_3_message.message = msg; /* * If the rakp2 return code indicates and error, we don't have to * generate an authcode or session integrity key. In that case, we * are simply sending a RAKP 3 message to indicate to the BMC that the * RAKP 2 message caused an error. */ if (session->v2_data.rakp2_return_code == IPMI_RAKP_STATUS_NO_ERRORS) { uint32_t auth_length; if (lanplus_generate_rakp3_authcode(msg + 8, session, &auth_length, intf)) { /* Error */ lprintf(LOG_INFO, "> Error generating RAKP 3 authcode"); free(msg); return 1; } else { /* Success */ v2_payload.payload_length += (uint16_t)auth_length; } /* Generate our Session Integrity Key, K1, and K2 */ if (lanplus_generate_sik(session)) { /* Error */ lprintf(LOG_INFO, "> Error generating session integrity key"); free(msg); return 1; } else if (lanplus_generate_k1(session)) { /* Error */ lprintf(LOG_INFO, "> Error generating K1 key"); free(msg); return 1; } else if (lanplus_generate_k2(session)) { /* Error */ lprintf(LOG_INFO, "> Error generating K2 key"); free(msg); return 1; } } rsp = ipmi_lanplus_send_payload(intf, &v2_payload); free(msg); if (session->v2_data.rakp2_return_code != IPMI_RAKP_STATUS_NO_ERRORS) { /* * If the previous RAKP 2 message received was deemed erroneous, * we have nothing else to do here. We only sent the RAKP 3 message * to indicate to the BMC that the RAKP 2 message failed. */ lprintf(LOG_INFO, "> Error: RAKP2 return code %d", session->v2_data.rakp2_return_code); return 1; } else if (rsp == NULL) { lprintf(LOG_INFO, "> Error: no response from RAKP 3 message"); return 1; } /* * We have a RAKP 4 message to chew on. */ if (verbose) lanplus_dump_rakp4_message(rsp, session->v2_data.auth_alg); if (rsp->payload.open_session_response.rakp_return_code != IPMI_RAKP_STATUS_NO_ERRORS) { lprintf(LOG_INFO, "RAKP 4 message indicates an error : %s", val2str(rsp->payload.rakp4_message.rakp_return_code, ipmi_rakp_return_codes)); return 1; } else { /* Validate the authcode */ if (lanplus_rakp4_hmac_matches(session, rsp->payload.rakp4_message.integrity_check_value, intf)) { /* Success */ session->v2_data.session_state = LANPLUS_STATE_ACTIVE; } else { /* Error */ lprintf(LOG_INFO, "> RAKP 4 message has invalid integrity check value"); return 1; } } intf->abort = 0; return 0; } /** * ipmi_lan_close */ void ipmi_lanplus_close(struct ipmi_intf * intf) { if (!intf->abort) ipmi_close_session_cmd(intf); if (intf->fd != SockInvalid) { #ifdef WIN32 closesocket(intf->fd); WSACleanup(); #else close(intf->fd); #endif intf->fd = 0; } ipmi_req_clear_entries(); if (intf->session) free(intf->session); intf->session = NULL; intf->opened = 0; } static int ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf) { struct ipmi_rs * rsp; struct ipmi_rq req; uint8_t backupBridgePossible; uint8_t privlvl = intf->session->privlvl; if (privlvl <= IPMI_SESSION_PRIV_USER) return 0; /* no need to set higher */ backupBridgePossible = bridgePossible; bridgePossible = 0; memset(&req, 0, sizeof(req)); req.msg.netfn = IPMI_NETFN_APP; req.msg.cmd = 0x3b; req.msg.data = &privlvl; req.msg.data_len = 1; rsp = intf->sendrecv(intf, &req); if (rsp == NULL) { lprintf(LOG_ERR, "Set Session Privilege Level to %s failed", val2str(privlvl, ipmi_privlvl_vals)); return -1; } if (verbose > 2) printbuf(rsp->data, rsp->data_len, "set_session_privlvl"); if (rsp->ccode > 0) { lprintf(LOG_ERR, "Set Session Privilege Level to %s failed: %s", val2str(privlvl, ipmi_privlvl_vals), val2str(rsp->ccode, completion_code_vals)); return -1; } lprintf(LOG_DEBUG, "Set Session Privilege Level to %s\n", val2str(rsp->data[0], ipmi_privlvl_vals)); bridgePossible = backupBridgePossible; return 0; } /** * ipmi_lanplus_open */ int ipmi_lanplus_open(struct ipmi_intf * intf) { int rc; struct get_channel_auth_cap_rsp auth_cap; SOCKADDR_T addr; socklen_t addrlen; struct ipmi_session *session; #ifdef HAVE_IPV6 struct addrinfo hints; struct addrinfo *result, *rp; char service[NI_MAXSERV]; #else char *temp; #endif if (!intf || !intf->session) return -1; session = intf->session; if (!session->port) session->port = IPMI_LANPLUS_PORT; if (!session->privlvl) session->privlvl = IPMI_SESSION_PRIV_ADMIN; if (!session->timeout) session->timeout = lan2_timeout; /*default timeout*/ else lan2_timeout = session->timeout; /*set by caller*/ if (!session->retry) session->retry = IPMI_LAN_RETRY; if (session->hostname == NULL || strlen((const char *)session->hostname) == 0) { lprintf(LOG_ERR, "No hostname specified!"); return -1; } intf->abort = 1; /* Setup our lanplus session state */ session->v2_data.session_state = LANPLUS_STATE_PRESESSION; session->v2_data.auth_alg = IPMI_AUTH_RAKP_NONE; session->v2_data.crypt_alg = IPMI_CRYPT_NONE; session->v2_data.console_id = 0x00; session->v2_data.bmc_id = 0x00; session->sol_data.sequence_number = 1; //session->sol_data.last_received_sequence_number = 0; //session->sol_data.last_received_byte_count = 0; memset(session->v2_data.sik, 0, sizeof(session->v2_data.sik)); session->v2_data.sik_len = 0; /* Kg is set in ipmi_intf */ //memset(session->v2_data.kg, 0, IPMI_KG_BUFFER_SIZE); #ifdef WIN32 { DWORD rvl; rvl = WSAStartup(0x0202,&lan2_ws); if (rvl != 0) { lprintf(LOG_ERR, "WSAStartup(2.2) error %ld, try 1.1\n", rvl); rvl = WSAStartup(0x0101,&lan2_ws); if (rvl != 0) { lprintf(LOG_ERR, "WSAStartup(1.1) error %ld\n", rvl); return((int)rvl); } } } #endif #ifdef HAVE_IPV6 session->addrlen = 0; memset(&session->addr, 0, sizeof(session->addr)); memset(&addr, 0, sizeof(addr)); sprintf(service, "%d", session->port); /* Obtain address(es) matching host/port */ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ hints.ai_flags = my_ai_flags; hints.ai_protocol = IPPROTO_UDP; /* */ rc = getaddrinfo((char *)session->hostname, service, &hints, &result); if (rc != 0) { lprintf(LOG_ERR, "Address lookup for %s failed with %d", session->hostname,rc); return -1; } /* getaddrinfo() returns a list of address structures. * Try each address until we successfully connect(2). */ for (rp = result; rp != NULL; rp = rp->ai_next) { intf->fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if (intf->fd == -1) continue; /* valid protocols are IPPROTO_UDP, IPPROTO_IPV6 */ if (rp->ai_protocol == IPPROTO_TCP) continue; /*IPMI != TCP*/ lprintf(LOG_DEBUG, "lanplus socket(%d,%d,%d), connect(%d)", rp->ai_family, rp->ai_socktype, rp->ai_protocol, intf->fd ); if (connect(intf->fd, rp->ai_addr, rp->ai_addrlen) != -1) { lprintf(LOG_DEBUG, "lanplus connect ok, addrlen=%d size=%d", rp->ai_addrlen,sizeof(addr)); addrlen = rp->ai_addrlen; memcpy(&addr, rp->ai_addr, addrlen); // memcpy(&session->addr, rp->ai_addr, rp->ai_addrlen); session->addrlen = rp->ai_addrlen; break; /* Success */ } close(intf->fd); intf->fd = -1; } freeaddrinfo(result); /* Done with addrinfo */ if (intf->fd < 0) { lperror(LOG_ERR, "Connect to %s failed", session->hostname); intf->close(intf); return -1; } #else /* open port to BMC via ipv4 */ addrlen = sizeof(struct sockaddr_in); memset(&addr, 0, addrlen); addr.sin_family = AF_INET; addr.sin_port = htons((uint16_t)session->port); #ifdef WIN32 rc = -1; #else rc = inet_pton(AF_INET, (const char *)session->hostname, &addr.sin_addr); #endif if (rc <= 0) { struct hostent *host = gethostbyname((const char *)session->hostname); if (host == NULL) { lprintf(LOG_ERR, "Address lookup for %s failed", session->hostname); return -1; } addr.sin_family = host->h_addrtype; memcpy(&addr.sin_addr, host->h_addr, host->h_length); } lprintf(LOG_DEBUG, "IPMI LAN host %s port %d", session->hostname, ntohs(addr.sin_port)); intf->fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); if (intf->fd == SockInvalid) { lperror(LOG_ERR, "Socket failed"); return -1; } /* connect to UDP socket so we get async errors */ rc = connect(intf->fd, (struct sockaddr *)&addr, addrlen); if (rc < 0) { lperror(LOG_ERR, "Connect failed"); intf->close(intf); return -1; } #endif intf->opened = 1; /* * Make sure the BMC supports IPMI v2 / RMCP+ * * I'm not sure why we accept a failure for the first call */ if (ipmi_get_auth_capabilities_cmd(intf, &auth_cap)) { lan2_usleep(1,0); if (ipmi_get_auth_capabilities_cmd(intf, &auth_cap)) { lprintf(LOG_INFO, "Error issuing Get Channel " "Authentication Capabilies request"); goto fail; } } if (! auth_cap.v20_data_available) { lprintf(LOG_INFO, "This BMC does not support IPMI v2 / RMCP+"); goto fail; } /* * Open session */ if (ipmi_lanplus_open_session(intf)){ intf->close(intf); goto fail; } /* * RAKP 1 */ if (ipmi_lanplus_rakp1(intf)){ lprintf(LOG_ERROR,"LANPLUS error in RAKP1"); intf->close(intf); goto fail; } /* * RAKP 3 */ if (ipmi_lanplus_rakp3(intf)){ lprintf(LOG_ERROR,"LANPLUS error in RAKP3"); intf->close(intf); goto fail; } lprintf(LOG_DEBUG, "IPMIv2 / RMCP+ SESSION OPENED SUCCESSFULLY\n"); bridgePossible = 1; rc = ipmi_set_session_privlvl_cmd(intf); if (rc < 0) { lprintf(LOG_ERROR,"LANPLUS error in set_session_privlvl"); intf->close(intf); goto fail; } #ifdef HAVE_IPV6 lan2_nodename[0] = 0; lprintf(LOG_NOTICE,"Connected to node %s\n", session->hostname); #else #ifdef WIN32 /* check for ws2_32.lib(getnameinfo) resolution */ lan2_nodename[0] = 0; #else rc = getnameinfo((struct sockaddr *)&addr, sizeof(struct sockaddr_in), lan2_nodename,sizeof(lan2_nodename), NULL,0,0); if (rc != 0) { lprintf(LOG_DEBUG, "LANPLUS: getnameinfo rv = %d\n",rc); lan2_nodename[0] = 0; } #endif temp = inet_ntoa(addr.sin_addr); lprintf(LOG_NOTICE,"Connected to node %s %s\n",lan2_nodename,temp); #endif return (int)(intf->fd); fail: lprintf(LOG_ERR, "Error: Unable to establish IPMI v2 / RMCP+ session"); intf->opened = 0; return -1; } void test_crypt1(void) { uint8_t key[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14}; uint16_t bytes_encrypted; uint16_t bytes_decrypted; uint8_t decrypt_buffer[1000]; uint8_t encrypt_buffer[1000]; uint8_t data[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12}; printbuf(data, sizeof(data), "original data"); if (lanplus_encrypt_payload(IPMI_CRYPT_AES_CBC_128, key, data, sizeof(data), encrypt_buffer, &bytes_encrypted)) { lprintf(LOG_ERR, "Encrypt test failed"); assert(0); /*assert for testing*/ } printbuf(encrypt_buffer, bytes_encrypted, "encrypted payload"); if (lanplus_decrypt_payload(IPMI_CRYPT_AES_CBC_128, key, encrypt_buffer, bytes_encrypted, decrypt_buffer, &bytes_decrypted)) { lprintf(LOG_ERR, "Decrypt test failed\n"); assert(0); /*assert for testing*/ } printbuf(decrypt_buffer, bytes_decrypted, "decrypted payload"); lprintf(LOG_DEBUG, "\nDone testing the encrypt/decyrpt methods!\n"); exit(0); } void test_crypt2(void) { uint8_t key[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14}; uint8_t iv[] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14}; uint8_t data[8] = "12345678"; uint8_t encrypt_buffer[1000]; uint8_t decrypt_buffer[1000]; uint32_t bytes_encrypted; uint32_t bytes_decrypted; int len; len = (int)strlen((const char *)data), printbuf((const uint8_t *)data, len, "input data"); lanplus_encrypt_aes_cbc_128(iv, key, data, (uint32_t)len, encrypt_buffer, &bytes_encrypted); printbuf((const uint8_t *)encrypt_buffer, bytes_encrypted, "encrypt_buffer"); lanplus_decrypt_aes_cbc_128(iv, key, encrypt_buffer, bytes_encrypted, decrypt_buffer, &bytes_decrypted); printbuf((const uint8_t *)decrypt_buffer, bytes_decrypted, "decrypt_buffer"); lprintf(LOG_INFO, "\nDone testing the encrypt/decyrpt methods!\n"); exit(0); } /** * send a get device id command to keep session active */ static int ipmi_lanplus_keepalive(struct ipmi_intf * intf) { struct ipmi_rs * rsp; struct ipmi_rq req; if (!intf->opened) return 0; // printf("lanplus_keepalive called\n"); /*++++*/ req.msg.netfn = IPMI_NETFN_APP; req.msg.cmd = 0x01; /*GetDeviceID*/ req.msg.data_len = 0; rsp = intf->sendrecv(intf, &req); while (rsp != NULL && is_sol_packet(rsp)) { /* rsp was SOL data instead of our answer */ /* since it didn't go through the sol recv, do sol recv stuff here */ // printf( "lanplus_keepalive got SOL rsp\n"); /*++++*/ ack_sol_packet(intf, rsp); check_sol_packet_for_new_data(intf, rsp); // printf( "lanplus_keepalive SOL data len %d\n",rsp->data_len); /*++++*/ if (rsp->data_len) intf->session->sol_data.sol_input_handler(rsp); rsp = ipmi_lan_poll_recv(intf); if (rsp == NULL) /* the get device id answer never got back, but retry mechanism was bypassed by SOL data */ return 0; /* so get device id command never returned, the connection is still alive */ } if (rsp == NULL) return -1; if (rsp->ccode > 0) return -1; return 0; } /** * ipmi_lanplus_setup */ static int ipmi_lanplus_setup(struct ipmi_intf * intf) { if (lanplus_seed_prng(16)) { lprintf(LOG_ERR, "lanplus_seed_prng failure"); return -1; } intf->session = malloc(sizeof(struct ipmi_session)); if (intf->session == NULL) { lprintf(LOG_ERR, "lanplus: malloc failure"); return -1; } memset(intf->session, 0, sizeof(struct ipmi_session)); return 0; } /* end of lanplus.c */ ipmiutil-3.0.7/lib/lanplus/ipmiplus.mak0000644000076400007640000000312613160502144017647 0ustar acressloggers# ipmiplus.mak # This makefile will build the ipmiutil lib\lanplus directory # # Make sure to download and build openssl for Windows first # # The ipmiutil lanplus directory SRC_D=. INC=/I$(SRC_D) /I$(SRC_D)\inc O_LIB=lanplus.lib # Set your compiler options CC=cl CF_EX=/DWIN32 $(INC) /D_CONSOLE /DNDEBUG /D_CRT_SECURE_NO_DEPRECATE # CFLAGS= /MD /W3 /WX /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo $(CF_EX) # CFLAGS= /W3 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo $(CF_EX) # CFLAGS= /W3 /O2 /Zi /MD /GF /Gy /nologo $(CF_EX) # CFLAGS= /W3 /O2 /Zi /MD /nologo $(CF_EX) CFLAGS= /W3 /O2 /Zi /MT /nologo $(CF_EX) MKLIB=lib RM=del LIB_OBJ = lanplus.obj lanplus_crypt.obj lanplus_crypt_impl.obj \ lanplus_dump.obj lanplus_strings.obj helper.obj ipmi_strings.obj HEADERS = all: banner $(O_LIB) banner: @echo Building ipmi lanplus library install: clean: $(RM) *.obj 2>NUL $(RM) $(O_LIB) 2>NUL distclean: $(RM) *.obj 2>NUL $(RM) $(O_LIB) 2>NUL $(RM) *.lib 2>NUL lanplus.obj: lanplus.c $(CC) /c $(CFLAGS) lanplus.c lanplus_crypt.obj: lanplus_crypt.c $(CC) /c $(CFLAGS) lanplus_crypt.c lanplus_crypt_impl.obj: lanplus_crypt_impl.c $(CC) /c $(CFLAGS) lanplus_crypt_impl.c lanplus_dump.obj: lanplus_dump.c $(CC) /c $(CFLAGS) lanplus_dump.c lanplus_strings.obj: lanplus_strings.c $(CC) /c $(CFLAGS) lanplus_strings.c ipmi_strings.obj: ipmi_strings.c $(CC) /c $(CFLAGS) ipmi_strings.c helper.obj: helper.c $(CC) /c $(CFLAGS) helper.c $(O_LIB): $(LIB_OBJ) $(MKLIB) /OUT:$(O_LIB) /nologo $(LIB_OBJ) ipmiutil-3.0.7/lib/lanplus/lanplus_crypt_impl.c0000644000076400007640000002275213160502144021405 0ustar acressloggers/* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ /* ARCress, TODO: improve error handling and remove all assert() calls here. */ #include "ipmitool/log.h" #include "ipmitool/ipmi_constants.h" #include "lanplus.h" #include "lanplus_crypt_impl.h" #include #include #include #include #include /* * lanplus_seed_prng * * Seed our PRNG with the specified number of bytes from /dev/random * * param bytes specifies the number of bytes to read from /dev/random * * returns 0 on success * 1 on failure */ int lanplus_seed_prng(uint32_t bytes) { #ifdef WIN32 const char *randfile; char buffer[200]; static FILE *fp = NULL; size_t i; randfile = RAND_file_name(buffer, sizeof buffer); /* usu C:\.rnd */ if ((randfile != NULL) && (fp == NULL)) { fp = fopen(randfile,"r"); /*check the randfile*/ if (fp == NULL) { /*does not exist, create it*/ /*first time, so open/create file*/ fp = fopen(randfile,"w"); /*create the randfile*/ if (fp != NULL) { i = fwrite(" \n",2,1,fp); fclose(fp); } else { printf("seed_prng: cannot create %s file\n",randfile); } } else { /*file opened, so close it*/ fclose(fp); } } if (verbose > 0) printf("seed_prng: RAND_file_name = %s, fp=%p\n",randfile,fp); #else const char *randfile = "/dev/urandom"; #endif if (RAND_load_file(randfile, bytes) == 0) { printf("seed_prng: RAND_load_file(%s) failed\n",randfile); return 1; } else { /*success*/ return 0; } } /* * lanplus_rand * * Generate a random number of the specified size * * param num_bytes [in] is the size of the random number to be * generated * param buffer [out] is where we will place our random number * * return 0 on success * 1 on failure */ int lanplus_rand(uint8_t * buffer, uint32_t num_bytes) { #undef IPMI_LANPLUS_FAKE_RAND #ifdef IPMI_LANPLUS_FAKE_RAND /* * This code exists so that we can easily find the generated random * number in the hex dumps. */ int i; for (i = 0; i < num_bytes; ++i) buffer[i] = 0x70 | i; return 0; #else return (! RAND_bytes(buffer, num_bytes)); #endif } /* * lanplus_HMAC * * param mac specifies the algorithm to be used, currently only SHA1 is supported * param key is the key used for HMAC generation * param key_len is the lenght of key * param d is the data to be MAC'd * param n is the length of the data at d * param md is the result of the HMAC algorithm * param md_len is the length of md * * returns a pointer to md */ uint8_t * lanplus_HMAC(uint8_t mac, const void *key, int key_len, const uint8_t *d, int n, uint8_t *md, uint32_t *md_len) { const EVP_MD *evp_md = NULL; unsigned int mlen; uint8_t *pnew; *md_len = 0; /*if return NULL, also return zero length*/ if ((mac == IPMI_AUTH_RAKP_HMAC_SHA1) || (mac == IPMI_INTEGRITY_HMAC_SHA1_96)) evp_md = EVP_sha1(); else if ((mac == IPMI_AUTH_RAKP_HMAC_MD5) || (mac == IPMI_INTEGRITY_HMAC_MD5_128)) evp_md = EVP_md5(); else if ((mac == IPMI_AUTH_RAKP_HMAC_SHA256) || (mac == IPMI_INTEGRITY_HMAC_SHA256_128)) { #ifdef HAVE_SHA256 evp_md = EVP_sha256(); #else lprintf(LOG_ERR, "Invalid EVP_sha256 in lanplus_HMAC"); return NULL; // assert(0); #endif } else { lprintf(LOG_ERR,"Invalid mac type 0x%x in lanplus_HMAC",mac); return NULL; // assert(0); } mlen = 20; /* *md_len is usually not initialized */ pnew = HMAC(evp_md, key, key_len, d, n, md, &mlen); *md_len = (uint32_t)mlen; return(pnew); } /* * lanplus_encrypt_aes_cbc_128 * * Encrypt with the AES CBC 128 algorithm * * param iv is the 16 byte initialization vector * param key is the 16 byte key used by the AES algorithm * param input is the data to be encrypted * param input_length is the number of bytes to be encrypted. This MUST * be a multiple of the block size, 16. * param output is the encrypted output * param bytes_written is the number of bytes written. This param is set * to 0 on failure, or if 0 bytes were input. */ void lanplus_encrypt_aes_cbc_128(const uint8_t * iv, const uint8_t * key, const uint8_t * input, uint32_t input_length, uint8_t * output, uint32_t * bytes_written) { int nwritten = 0; int inlen = 0; EVP_CIPHER_CTX *pctx; #ifdef SSL11 EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); pctx = ctx; #else EVP_CIPHER_CTX ctx; pctx = &ctx; #endif EVP_CIPHER_CTX_init(pctx); EVP_EncryptInit_ex(pctx, EVP_aes_128_cbc(), NULL, key, iv); EVP_CIPHER_CTX_set_padding(pctx, 0); *bytes_written = 0; if (input_length == 0) return; if (verbose >= 5) { printbuf(iv, 16, "encrypting with this IV"); printbuf(key, 16, "encrypting with this key"); printbuf(input, input_length, "encrypting this data"); } /* * The default implementation adds a whole block of padding if the input * data is perfectly aligned. We would like to keep that from happening. * We have made a point to have our input perfectly padded. */ assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); inlen = input_length; if(!EVP_EncryptUpdate(pctx, output, &nwritten, input, inlen)) { *bytes_written = 0; /* Error */ } else { int tmplen; if(!EVP_EncryptFinal_ex(pctx, output + nwritten, &tmplen)) { *bytes_written = 0; /* Error */ } else { /* Success */ *bytes_written = nwritten + tmplen; EVP_CIPHER_CTX_cleanup(pctx); } } #ifdef SSL11 EVP_CIPHER_CTX_free(ctx); #endif return; } /* * lanplus_decrypt_aes_cbc_128 * * Decrypt with the AES CBC 128 algorithm * * param iv is the 16 byte initialization vector * param key is the 16 byte key used by the AES algorithm * param input is the data to be decrypted * param input_length is the number of bytes to be decrypted. This MUST * be a multiple of the block size, 16. * param output is the decrypted output * param bytes_written is the number of bytes written. This param is set * to 0 on failure, or if 0 bytes were input. */ void lanplus_decrypt_aes_cbc_128(const uint8_t * iv, const uint8_t * key, const uint8_t * input, uint32_t input_length, uint8_t * output, uint32_t * bytes_written) { int nwritten = 0; int inlen = 0; EVP_CIPHER_CTX *pctx; #ifdef SSL11 EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new(); pctx = ctx; #else EVP_CIPHER_CTX ctx; pctx = &ctx; #endif EVP_CIPHER_CTX_init(pctx); EVP_DecryptInit_ex(pctx, EVP_aes_128_cbc(), NULL, key, iv); EVP_CIPHER_CTX_set_padding(pctx, 0); if (verbose >= 5) { printbuf(iv, 16, "decrypting with this IV"); printbuf(key, 16, "decrypting with this key"); printbuf(input, input_length, "decrypting this data"); } *bytes_written = 0; if (input_length == 0) return; /* * The default implementation adds a whole block of padding if the input * data is perfectly aligned. We would like to keep that from happening. * We have made a point to have our input perfectly padded. */ assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); inlen = input_length; if (!EVP_DecryptUpdate(pctx, output, &nwritten, input, inlen)) { /* Error */ lprintf(LOG_DEBUG, "ERROR: decrypt update failed"); *bytes_written = 0; return; } else { int tmplen; if (!EVP_DecryptFinal_ex(pctx, output + nwritten, &tmplen)) { char buffer[1000]; ERR_error_string(ERR_get_error(), buffer); lprintf(LOG_DEBUG, "the ERR error %s", buffer); lprintf(LOG_DEBUG, "ERROR: decrypt final failed"); *bytes_written = 0; goto evpfin2; } else { /* Success */ *bytes_written = nwritten + tmplen; EVP_CIPHER_CTX_cleanup(pctx); } } if (verbose >= 5) { lprintf(LOG_DEBUG, "Decrypted %d encrypted bytes",input_length); printbuf(output, *bytes_written, "Decrypted this data"); } evpfin2: #ifdef SSL11 EVP_CIPHER_CTX_free(ctx); #endif return; } ipmiutil-3.0.7/lib/lanplus/lanplus_strings.c0000644000076400007640000000467313160502144020716 0ustar acressloggers/* * lanplus_strings.c * extracts all lanplus string messages to one location for potential * customization or translation. * * 01/09/2007 ARCress - created */ #include "lanplus.h" #include "ipmitool/ipmi_constants.h" const struct valstr ipmi_rakp_return_codes[] = { { IPMI_RAKP_STATUS_NO_ERRORS, "no errors" }, { IPMI_RAKP_STATUS_INSUFFICIENT_RESOURCES_FOR_SESSION, "insufficient resources for session" }, { IPMI_RAKP_STATUS_INVALID_SESSION_ID, "invalid session ID" }, { IPMI_RAKP_STATUS_INVALID_PAYLOAD_TYPE, "invalid payload type" }, { IPMI_RAKP_STATUS_INVALID_AUTHENTICATION_ALGORITHM, "invalid authentication algorithm" }, { IPMI_RAKP_STATUS_INVALID_INTEGRITTY_ALGORITHM, "invalid integrity algorithm" }, { IPMI_RAKP_STATUS_NO_MATCHING_AUTHENTICATION_PAYLOAD, "no matching authentication algorithm"}, { IPMI_RAKP_STATUS_NO_MATCHING_INTEGRITY_PAYLOAD, "no matching integrity payload" }, { IPMI_RAKP_STATUS_INACTIVE_SESSION_ID, "inactive session ID" }, { IPMI_RAKP_STATUS_INVALID_ROLE, "invalid role" }, { IPMI_RAKP_STATUS_UNAUTHORIZED_ROLE_REQUESTED, "unauthorized role requested" }, { IPMI_RAKP_STATUS_INSUFFICIENT_RESOURCES_FOR_ROLE, "insufficient resources for role" }, { IPMI_RAKP_STATUS_INVALID_NAME_LENGTH, "invalid name length" }, { IPMI_RAKP_STATUS_UNAUTHORIZED_NAME, "unauthorized name" }, { IPMI_RAKP_STATUS_UNAUTHORIZED_GUID, "unauthorized GUID" }, { IPMI_RAKP_STATUS_INVALID_INTEGRITY_CHECK_VALUE, "invalid integrity check value" }, { IPMI_RAKP_STATUS_INVALID_CONFIDENTIALITY_ALGORITHM, "invalid confidentiality algorithm" }, { IPMI_RAKP_STATUS_NO_CIPHER_SUITE_MATCH, "no matching cipher suite" }, { IPMI_RAKP_STATUS_ILLEGAL_PARAMTER, "illegal parameter" }, { 0, 0 }, }; const struct valstr ipmi_priv_levels[] = { { IPMI_PRIV_CALLBACK, "callback" }, { IPMI_PRIV_USER, "user" }, { IPMI_PRIV_OPERATOR, "operator" }, { IPMI_PRIV_ADMIN, "admin" }, { IPMI_PRIV_OEM, "oem" }, { 0, 0 }, }; ipmiutil-3.0.7/lib/lanplus/lanplus_defs.h0000644000076400007640000002515613160502144020152 0ustar acressloggers/* * lanplus_defs.h: (extracted from ipmitool/ipmi_intf.h) * * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #ifndef LANPLUS_DEFS_H #define LANPLUS_DEFS_H #if defined(HAVE_CONFIG_H) #include "config.h" #else #ifndef HPUX /* HPUX already has socklen_t but no #define */ #ifndef socklen_t typedef unsigned int socklen_t; #endif #endif #endif #if defined(MACOS) #include #endif #include #ifdef WIN32 #define SockType SOCKET #define SockInvalid INVALID_SOCKET /*=0*/ #else #define SockType int #define SockInvalid -1 #endif #ifndef IPMI_H #ifndef _IPMI_RQ_ #define _IPMI_RQ_ struct ipmi_rq { struct { uint8_t netfn:6; uint8_t lun:2; uint8_t cmd; uint8_t target_cmd; uint16_t data_len; uint8_t *data; } msg; }; #endif #ifndef _IPMI_RS_ #define _IPMI_RS_ struct ipmi_rs { uint8_t ccode; uint8_t data[IPMI_BUF_SIZE]; /* * Looks like this is the length of the entire packet, including the RMCP * stuff, then modified to be the length of the extra IPMI message data */ int data_len; struct { uint8_t netfn; uint8_t cmd; uint8_t seq; uint8_t lun; } msg; struct { uint8_t authtype; uint32_t seq; uint32_t id; uint8_t bEncrypted; /* IPMI v2 only */ uint8_t bAuthenticated; /* IPMI v2 only */ uint8_t payloadtype; /* IPMI v2 only */ /* This is the total length of the payload or IPMI message. IPMI v2.0 requires this to be 2 bytes. Not really used for much. */ uint16_t msglen; } session; /* * A union of the different possible payload meta-data */ union { struct { uint8_t rq_addr; uint8_t netfn; uint8_t rq_lun; uint8_t rs_addr; uint8_t rq_seq; uint8_t rs_lun; uint8_t cmd; } ipmi_response; struct { uint8_t message_tag; uint8_t rakp_return_code; uint8_t max_priv_level; uint32_t console_id; uint32_t bmc_id; uint8_t auth_alg; uint8_t integrity_alg; uint8_t crypt_alg; } open_session_response; struct { uint8_t message_tag; uint8_t rakp_return_code; uint32_t console_id; uint8_t bmc_rand[16]; /* Random number generated by the BMC */ uint8_t bmc_guid[16]; uint8_t key_exchange_auth_code[EVP_MAX_MD_SIZE]; } rakp2_message; struct { uint8_t message_tag; uint8_t rakp_return_code; uint32_t console_id; uint8_t integrity_check_value[EVP_MAX_MD_SIZE]; } rakp4_message; struct { uint8_t packet_sequence_number; uint8_t acked_packet_number; uint8_t accepted_character_count; uint8_t is_nack; /* bool */ uint8_t transfer_unavailable; /* bool */ uint8_t sol_inactive; /* bool */ uint8_t transmit_overrun; /* bool */ uint8_t break_detected; /* bool */ } sol_packet; } payload; }; #endif struct ipmi_v2_payload { uint16_t payload_length; uint8_t payload_type; union { struct { uint8_t rq_seq; struct ipmi_rq *request; } ipmi_request; struct { uint8_t rs_seq; struct ipmi_rs *response; } ipmi_response; /* Only used internally by the lanplus interface */ struct { uint8_t *request; } open_session_request; /* Only used internally by the lanplus interface */ struct { uint8_t *message; } rakp_1_message; /* Only used internally by the lanplus interface */ struct { uint8_t *message; } rakp_2_message; /* Only used internally by the lanplus interface */ struct { uint8_t *message; } rakp_3_message; /* Only used internally by the lanplus interface */ struct { uint8_t *message; } rakp_4_message; struct { uint8_t data[IPMI_BUF_SIZE]; uint16_t character_count; uint8_t packet_sequence_number; uint8_t acked_packet_number; uint8_t accepted_character_count; uint8_t is_nack; /* bool */ uint8_t assert_ring_wor; /* bool */ uint8_t generate_break; /* bool */ uint8_t deassert_cts; /* bool */ uint8_t deassert_dcd_dsr; /* bool */ uint8_t flush_inbound; /* bool */ uint8_t flush_outbound; /* bool */ } sol_packet; } payload; }; #endif /**************************************/ /* define ipmi_intf locally */ /* * An enumeration that describes every possible session state for * an IPMIv2 / RMCP+ session. */ enum LANPLUS_SESSION_STATE { LANPLUS_STATE_PRESESSION = 0, LANPLUS_STATE_OPEN_SESSION_SENT, LANPLUS_STATE_OPEN_SESSION_RECEIEVED, LANPLUS_STATE_RAKP_1_SENT, LANPLUS_STATE_RAKP_2_RECEIVED, LANPLUS_STATE_RAKP_3_SENT, LANPLUS_STATE_ACTIVE, LANPLUS_STATE_CLOSE_SENT, }; #define IPMI_AUTHCODE_BUFFER_SIZE 20 // KG or KUID #define IPMI_SIK_BUFFER_SIZE EVP_MAX_MD_SIZE #define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */ struct ipmi_session { uint8_t hostname[64]; uint8_t username[17]; uint8_t authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1]; uint8_t challenge[16]; uint8_t authtype; uint8_t authtype_set; #define IPMI_AUTHSTATUS_PER_MSG_DISABLED 0x10 #define IPMI_AUTHSTATUS_PER_USER_DISABLED 0x08 #define IPMI_AUTHSTATUS_NONNULL_USERS_ENABLED 0x04 #define IPMI_AUTHSTATUS_NULL_USERS_ENABLED 0x02 #define IPMI_AUTHSTATUS_ANONYMOUS_USERS_ENABLED 0x01 uint8_t authstatus; uint8_t authextra; uint8_t privlvl; uint8_t cipher_suite_id; char sol_escape_char; int password; int port; int active; int retry; uint32_t session_id; uint32_t in_seq; uint32_t out_seq; uint32_t timeout; #ifdef HAVE_IPV6 /* struct sockaddr_storage addr; *causes rest of structure to break */ struct sockaddr_in addr; #else struct sockaddr_in addr; #endif socklen_t addrlen; /* * This struct holds state data specific to IMPI v2 / RMCP+ sessions */ struct { enum LANPLUS_SESSION_STATE session_state; /* These are the algorithms agreed upon for the session */ uint8_t requested_auth_alg; uint8_t requested_integrity_alg; uint8_t requested_crypt_alg; uint8_t auth_alg; uint8_t integrity_alg; uint8_t crypt_alg; uint8_t max_priv_level; uint32_t console_id; uint32_t bmc_id; /* * Values required for RAKP mesages */ /* Random number generated byt the console */ uint8_t console_rand[16]; /* Random number generated by the BMC */ uint8_t bmc_rand[16]; uint8_t bmc_guid[16]; uint8_t requested_role; /* As sent in the RAKP 1 message */ uint8_t rakp2_return_code; uint8_t sik[EVP_MAX_MD_SIZE]; /* Session integrity key */ uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */ uint8_t k1[EVP_MAX_MD_SIZE]; /* Used for Integrity checking? */ uint8_t k2[EVP_MAX_MD_SIZE]; /* First 16 bytes used for AES */ uint8_t sik_len; /* length of sik */ uint8_t k1_len; /* length of k1 */ uint8_t k2_len; /* length of k2 */ } v2_data; /* * This data is specific to the Serial Over Lan session */ struct { uint16_t max_inbound_payload_size; uint16_t max_outbound_payload_size; uint16_t port; uint8_t sequence_number; /* This data describes the last SOL packet */ uint8_t last_received_sequence_number; uint8_t last_received_byte_count; void (*sol_input_handler)(struct ipmi_rs * rsp); } sol_data; }; struct ipmi_intf_support { const char * name; int supported; }; struct ipmi_intf { char name[16]; char desc[128]; SockType fd; int opened; int abort; int noanswer; struct ipmi_session * session; struct ipmi_oem_handle * oem; struct ipmi_cmd * cmdlist; uint32_t my_addr; uint32_t target_addr; uint8_t target_lun; uint8_t target_channel; uint32_t transit_addr; uint8_t transit_channel; uint8_t devnum; int (*setup)(struct ipmi_intf * intf); int (*open)(struct ipmi_intf * intf); void (*close)(struct ipmi_intf * intf); struct ipmi_rs *(*sendrecv)(struct ipmi_intf * intf, struct ipmi_rq * req); int (*sendrsp)(struct ipmi_intf * intf, struct ipmi_rs * rsp); struct ipmi_rs *(*recv_sol)(struct ipmi_intf * intf); struct ipmi_rs *(*send_sol)(struct ipmi_intf * intf, void *payload); /*struct ipmi_v2_payload * payload);*/ int (*keepalive)(struct ipmi_intf * intf); }; struct ipmi_cmd { int (*func)(struct ipmi_intf * intf, int argc, char ** argv); const char * name; const char * desc; }; #endif /* lanplus_defs.h */ ipmiutil-3.0.7/lib/ipmilib.mak0000644000076400007640000000124313160502144015752 0ustar acressloggers# ipmilib.mak # This makefile will build the ipmiutil lib directory # # Make sure to download and build openssl for Windows # # The ipmiutil lib directory PLUS_DIR=lanplus PLUS_LIB=lanplus.lib # Set your compiler options RM=del CP=copy all: banner $(PLUS_LIB) banner: @echo Building ipmi libs $(PLUS_LIB): cd $(PLUS_DIR) nmake /nologo -f ipmiplus.mak all cd .. $(CP) $(PLUS_DIR)\$(PLUS_LIB) . clean: $(RM) $(PLUS_LIB) 2>NUL cd $(PLUS_DIR) nmake /nologo -f ipmiplus.mak clean cd .. distclean: $(RM) $(PLUS_LIB) 2>NUL cd $(PLUS_DIR) nmake /nologo -f ipmiplus.mak distclean cd .. ipmiutil-3.0.7/lib/libimbapi64.a.redhat0000644000076400007640000013421413160502144017352 0ustar acressloggers! / 1147299938 0 0 0 564 ` xxxxxxxxxxxxxxxxxxxxxxxAsyncEventHandleopen_imbSendTimedImbpRequestNTstatusclose_imbinitIPMItermIPMIipmi_open_iaipmi_close_iaStartAsyncMesgPollSendTimedI2cRequestSendTimedEmpMessageResponseSendTimedEmpMessageResponse_ExSendTimedLanMessageResponseSendTimedLanMessageResponse_ExSendAsyncImbpRequestGetAsyncImbpMessageGetAsyncImbpMessage_ExIsAsyncMessageAvailableRegisterForImbAsyncMessageNotificationUnRegisterForImbAsyncMessageNotificationSetShutDownCodeGetIpmiVersionimbapi.o/ 1147299938 0 0 100644 46552 ` ELF>àm@@S‰ûHìÀ‹…ÀtHÄÀ¸[Ã1À¾¿è…Àˆ¤…Û‰t ÇQëÃH”$H¼$ LD$HL$¾Æ„$ Æ„$¡ Æ„$¤Æ„$£Æ„$¢HÇ„$¥Ç„$­ÇD$è…Àu=¶T$„Òu9ƒ|$ {Çé5ÿÿÿ€=Çu/1ÀHÄÀ[öT$‰Æ¶Ò¿1Àè1ÀÇëÓH\$¹º¾1ÀH‰ßèH‰ßè1Àë©€¼$”Q¸QºE‰é©þÿÿfffH‰\$ØH‰l$à1ÀL‰d$èL‰l$ð¿L‰t$øHƒìxH‰ÕI‰öH‰ËM‰ÄM‰Íè1Ò…Àtb¸.‹=H‰âH9ØL‰öH‰l$ HBØH‹„$€L‰d$0H‰\$(L‰l$8HÇD$H‰D$@H‹„$ˆH‰D$H1Àè1Ò…À|”À¶ÐH‹\$PH‹l$X‰ÐL‹d$`L‹l$hL‹t$pHƒÄxÃH‰\$ÐH‰l$؉õL‰d$àL‰l$èM‰ÄL‰t$ðL‰|$øHìØHÇD$@¶GI‰ÖH\$ I‰ÍL|$`ˆD$(¶ˆD$)¶GˆD$*¶GˆD$+HcW ˆT$,H‹wH{ èiÅè¶L$,‹=H‰ÚA¹@M‰ø¾‚ÇD$ HÇD$‰D$$HD$ƒÁ H‰$èþÿÿÿȺt:H‹œ$¨H‹¬$°‰ÐL‹¤$¸L‹¬$ÀL‹´$ÈL‹¼$ÐHÄØÃH‹L$H…Ét¼¶D$`Hƒù—ÂAˆ$1ÀM…ö•À…Âu 1ÒAÇEë”QÿIwL‰÷A‰UHcÒè1ÒéwÿÿÿfffffffffffHƒì‹=1À…ÿuHƒÄÃèHƒÄfÃfffffffffff1ÿéfffffféffffffffHƒì@ˆ=1ÿèÿÈ”ÀHƒÄ¶ÀÿÈÃffffffffffféffffffffHƒì‹=E1ÉHD$E1À1É1Ò¾”HÇD$H‰$è ýÿÿÿÈ•ÀHƒÄ¶ÀÃffH‰\$ÐH‰l$؉õL‰d$àL‰l$èI‰ÍL‰t$ðL‰|$øHì¸ÆD$( ÆD$)RI‰ÖÆD$*ÆD$+H\$ HcW HÇD$"M‰ÄHK L|$PBˆD$,¶GˆD$-¶ˆA¶GˆAH‹wH{èiÅè‹=¹"A¹"M‰øH‰Ú¾‚ÇD$ HÇD$‰D$$HD$H‰$èCüÿÿÿȹt:H‹œ$ˆH‹¬$‰ÈL‹¤$˜L‹¬$ L‹´$¨L‹¼$°HĸÃH‹T$H…Òt¼¶D$PJÿ…É•ÂAˆ$1ÀM…ö•ÀA‰M…Âu1Éë—IwHcÑL‰÷è1Éë„ffffffffffAT¸zA‰ÌA¸U‰Õº4SHƒÄ€‹HÇD$"LT$ ÆD$( ÆD$*ÆD$+ûEˆD$)tÆD$-A°¶GIcÐAÿÀIcÈAÿÀAˆD D¶_D¶OD‰ØD‰Êƒàüƒâ ЃÈûAˆD „ ¶D$/IcÐD$.÷ØAÿÀAƒáüAˆD AƒãIcÀAÿÀAÆD E ÙIcÀAÿÀEˆL ¶GIcÐAÿÀ…íAˆD ~‰é¶IcÐHÿÆAÿÀÿÉAˆD uë1ÉAPýûIcð•ÁAÆD2 ëAÿÁH˜A¶D AD2 9ÊêAiÄèAÿÀ‹=EˆB LD$PAö\2 A¹"¹"L‰ÒA‰BHD$¾‚AÇHÇD$H‰$è3úÿÿƒøt¸Hƒì€[]A\ÃHƒ|$uê0À€|$Ptæëß¶D$.IcÐD$-éðþÿÿfffffffffAT¸zA‰ÌD‰ÁU‰Õº4SH‰ûHƒÄ€‹=HÇD$"L\$ ÆD$( ÆD$*ÆD$+ÿEÂE1ÒƒÿˆD$)„ŠƒÿQ„ŸIcÂD¶KD¶CAˆL ¶CAÿÂIcÒAÿÂIcÊAÿÂAˆD D‰ÈD‰Âƒàüƒâ ЃÈÿAˆD „$ƒÿ„9A¶CIcÒAC÷ØAÿÂAƒàüAˆD AƒáIcÂAÿÂAÆD E ÈIcÂAÿÂEˆD ¶CIcÒAÿÂ…íAˆD ~‰é¶IcÒHÿÆAÿÂÿÉAˆD uëIcò1ÉÿAÆD3 t 1Ƀÿ•ÁÿÁARýëfffAÿÁH˜A¶D AD3 9ÊêAiÄè‹=LD$PAö\3 AÿÂA¹"¹"L‰Ú¾‚A‰CHD$EˆS AÇHÇD$H‰$èGøÿÿƒøt¸Hƒì€[]A\ÃHƒ|$uê0À€|$PtæffëÜA¶CIcÒAC éàþÿÿA²ÆD$-érþÿÿA¶CIcÒACéÂþÿÿAºDˆL$-éQþÿÿfffffffffffAT¸zA‰ÌA¸U‰Õº4SHƒÄ€‹HÇD$"LT$ ÆD$( ÆD$*ÆD$+ûEˆD$)tÆD$-A°¶GIcÐAÿÀIcÈAÿÀAˆD D¶_D¶OD‰ØD‰Êƒàüƒâ ЃÈûAˆD „ ¶D$/IcÐD$.÷ØAÿÀAƒáüAˆD AƒãIcÀAÿÀAÆD E ÙIcÀAÿÀEˆL ¶GIcÐAÿÀ…íAˆD ~‰é¶IcÐHÿÆAÿÀÿÉAˆD uë1ÉAPýûIcð•ÁAÆD2 ëAÿÁH˜A¶D AD2 9ÊêAiÄèAÿÀ‹=EˆB LD$PAö\2 A¹"¹"L‰ÒA‰BHD$¾‚AÇHÇD$H‰$èSöÿÿƒøt¸Hƒì€[]A\ÃHƒ|$uê0À€|$Ptæëß¶D$.IcÐD$-éðþÿÿfffffffffAT¸zA‰ÌD‰ÁU‰Õº4SH‰ûHƒÄ€‹=HÇD$"L\$ ÆD$( ÆD$*ÆD$+ÿEÂE1ÒƒÿˆD$)„ŠƒÿQ„ŸIcÂD¶KD¶CAˆL ¶CAÿÂIcÒAÿÂIcÊAÿÂAˆD D‰ÈD‰Âƒàüƒâ ЃÈÿAˆD „$ƒÿ„9A¶CIcÒAC÷ØAÿÂAƒàüAˆD AƒáIcÂAÿÂAÆD E ÈIcÂAÿÂEˆD ¶CIcÒAÿÂ…íAˆD ~‰é¶IcÒHÿÆAÿÂÿÉAˆD uëIcò1ÉÿAÆD3 t 1Ƀÿ•ÁÿÁARýëfffAÿÁH˜A¶D AD3 9ÊêAiÄè‹=LD$PAö\3 AÿÂA¹"¹"L‰Ú¾‚A‰CHD$EˆS AÇHÇD$H‰$ègôÿÿƒøt¸Hƒì€[]A\ÃHƒ|$uê0À€|$PtæffëÜA¶CIcÒAC éàþÿÿA²ÆD$-érþÿÿA¶CIcÒACéÂþÿÿAºDˆL$-éQþÿÿfffffffffffATUH‰õSHƒÄ€HÇD$"¶GH\$ Ld$PˆD$(¶ˆD$)¶GˆD$*¶GˆD$+HcW ˆT$,H‹wH{ è‹=HD$H‰ÚA¹"M‰à¹"¾‚ÇD$ ÇD$$HÇD$H‰$è[óÿÿÿȺtHƒì€‰Ð[]A\ÃfffffHƒ|$uæ¶D$Q0ÒˆEëÚfffffffffAWI‰×AVI‰þAUM‰ÅATI‰ôUSH‰ËHƒìXHl$ HÇD$%fffM…ö”ÂM…ä”À Ш…H…Û„÷IiÇè‹=HT$A¹%I‰è¹¾ˆ‰D$‹HÇD$‰D$HD$H‰$è‹òÿÿÿÈ…½H‹D$Hƒø†šHHüH‰L$I9 $‚‡=tED8mt ‹E‰éUÿÿÿHPûHuL‰÷èH‹D$HÿÈI‰$‹E‰1ÀHƒÄX[]A\A]A^A_ÃffM…í¸tIƒýu±1À¶Ð¶Eƒà9Âu¡HuH‰ÊL‰÷èH‹D$ë­HƒÄX¸[]A\A]A^A_øàH9”À¶ÀDëŒffffffffffAWI‰×AVI‰þAUM‰ÅATI‰ôUSH‰ËHƒìhHl$0L‰L$HÇD$ %M…ö”ÂM…ä”À Ш…JH…Û„AIiÇè‹=HT$(A¹%I‰è¹¾ˆ‰D$(‹HÇD$‰D$,HD$ H‰$è ñÿÿÿÈ…H‹t$ Hƒþ†äHNüH‰L$ I9 $‚Ñ=„„Hƒ|$”ÂHƒ¼$ ”À Ш…¢¶EH‹Œ$ ‰ÂƒàÁêˆA¶Õ9Ðt ‹E‰éÿÿÿ¶EH‹T$L‰÷ˆHVûHuèH‹D$ HÿÈI‰$‹E‰1ÀHƒÄh[]A\A]A^A_ÃM…í¸tIƒýu©1À¶Ð¶Eƒà9Âu™HuH‰ÊL‰÷èH‹D$ ë°fffffHƒÄh¸[]A\A]A^A_øàH9”À¶ÀDëˆfffHƒì;=¸ÇD$tHƒÄÃf‹=HD$LD$A¹¹º¾œHÇD$H‰$è‰ïÿÿÿÈ•ÀHƒÄ¶ÀÃfffffffffSH‰ûHƒì H…ÿt ‹…Òt ºHƒÄ ‰Ð[Ë=HD$HT$A¹A¸¹¾˜HÇD$H‰$èïÿÿHƒ|$•ÂÿÈ•À к¨u§‹0Ò‰HƒÄ ‰Ð[ÃffffffHƒì(;=¸tHƒÄ(Ë=HD$ LD$A¹¹º¾šHÇD$H‰$è“îÿÿÿÈ•ÀHƒÄ(¶ÀÃffffHƒì(D‹¸Aƒúÿt?HD$HT$ ‰t$ ‰|$$E1ÉE1À¹¾’D‰×HÇD$H‰$è3îÿÿÿÈ•À¶ÀHƒÄ(Ãffff¶Ã% $ > $ > : ; I I  : ;  : ;I8 : ; : ; I8 I !I/  : ;  : ;: ;I : ;I8  : ;( .? : ;' I@: ;I4: ;I 4: ;I U4: ;I .: ; ' I@: ; I: ; I 4: ; I 4: ; I4: ; I.? : ;' I< I!4: ;I" #4: ;I$.? : ;' I%.? : ;' I&4: ;I' : ;(: ;I): ;I *4: ; I? < +4: ; I?  ,4: ; I -4: ; I ·int^^ˆ4Ø. W#‚#‚#‚#‚# ‚#(‚#0‚#8‚#@‚#H‚#P‚#Xx#` ~#h"W#p&W#t(e#x,;#€-I#‚.„#ƒ2”#ˆ;p#A#˜B# DW#¨Fš#¬4 °x¶ ·x# ¸~# ¼W#A˜ ”ˆ {: ªˆ {+=B>-?W@4ÒW¼NðOBW Y Z¼# [¼# \¼# ]¼#_bl-žW smiPÍ μ# ϼ# м# Ñ# Ò# Ó¼#( Ô#0 Õ¼#8 Öö#@ ×W#H@Ú Ûh# Üh#Ýq þW# ÿW#Kð Ò# Ò# Ò#Ò#Ò#cmdÒ#ð# Ò {}p=7Ò#cmd8Ò#9Ò#:Ò#;Ò#<ð#= ³C?±#A±#reqBp#C|çTRÒ#Sð#T¿\±'ca±#bó#cÿ[hfó#gð#h3›Ýågòë4#ì4#í4#î4#ï4#ð4#ñW# ò§{ü÷4#ø4#ù4#ú4#ûW# ü&#§W¦Wª‘ «#‘¬W­Ò¯WbufÇ3‘ 3Ò { Cˆ {) ©Ç s¡¼¢£¼¤¥¼¦öP¨WPsª~‘rc«W«W¬W§W W- ›- Wäêä3 ‘à C  ¼ ¼ 3 ‘ !req I Ç"#9¼ C Ò {?ç³… W!rcW$!W$%W .W-ˆ!rc/W%5 8W&rc9W{ C›E¼‘FÇÉ z›sÉ tWuävêyä{Ç|Ï ‘Ð}C ~¼Ï ‘ !req€I 'š ‚ƒÒ#„Ò#…Ò#†ð#‡ß "#­¼{ ß Ò {!P ³ Ú›(ptrÕ³ Ö‚×WÙWÛÇÜÏ ‘ÐÞ¼ßÏ ‘ &reqàI !iáW!jáW§D›(ptr:³ ;‚<W=W>ÒCÒEÇFÏ ‘ÐH¼IÏ ‘ &reqJI !iKW!jKWuÑ›(ptr̳ Í‚ÎWÐWÒÇÓÏ ‘ÐÕ¼ÖÏ ‘ &req×I !iØW!jØWc=›(ptr3³ 4‚5W6W7Ò<Ò>Ç?Ï ‘ÐA¼BÏ ‘ &reqCI !iDW!jDW'Ä›Á- ÃäÆÇÇÏ ‘ÐÈC ɼÊÏ ‘ !reqËI "#æ¼› ³  ð ¼ ¼Ç‘ !lunÒ#,¼req'‘"#3¼ó ,Ò {$[A¡›˜³ ™ðš¼›¼žä) ä‘ £Ç¤‘0!lun¤Ò#¥,¦¼req§'‘("#ü¦4›3B5W‘6W‘7Ç ÷›õ øÇù¼úW‘6›4B4W7Ç8¼‘ 9W‘öf›cWeWg¼‘hÇcmdiq‘ $WÒ*Ž~*~+qs ,r-sW +y@ -zs -{s -}ˆ Riû /usr/include/usr/include/bitsimbapi.cimb_api.hstdio.hlibio.htypes.h ¦ ›Ý›pV·+œ·uÓ€€€€€¸ªƒ rTánž(++cÓ*]·È!N®}%¢y+¢yUèW*G Uu 9w9SM}TWX‹VÉwz+Gká*”vG?zU;]Hr€€…ÈiWwc xOS;.R+n:¢XnJ¾²:pHƒÅUIb,OQYZó÷IrrXDXô ïO,ZB>G*ViU9VmUUjG‰ 9vGUs€dsÈe¦‚‹I Ó.R+q:¢V;RJ}IJEã +tU9nc 9tU UycYZVQÌ,œbVœbVfzG[C»Õœ*VHb€u.Da;7…8,ÄNm@zcMxU]ÐJ—uWXˆƒ'TÑ· +tU tU ycYZVQ“?t9 Ge‘?z›XD*_g0Ÿœ8,ÄOsx©V@)IzUJtW[xƒ'¿·oýÅmýòÓ +tU9jc 9tU UycYZZxU Å,œbVœbVfzG[C»Õœ*VHb€u.Da;7…8,ÄNm@zcMxU]ÐJ—uWXˆƒ'UÏ· +tU tU ycYZZxU =r9Ge‘?z›XD*_g0Ÿœ8,ÄOtw©VA(JyUJuWXˆƒ'@·oýÅmýêÓ®‘ERZHr€€Êì€ .R+v…W)!ý»VÚÖuÁH.ŠJÓä¡"·eŸð¿W.M;S…3 ÓâqEG;U·©Wçï»QZ”ÖuÁH.ŠJÓä¡ ïÚÕ7W£Ž8,Æ¿W.Aá;S…3 Óâ'Ó_G!U«©WêcOdyU…+nq7YC=¦ņâUh 8ðTLh&1ýNdT+oU7XD<qOrTi˜HI%‚Ó©r/dev/imbimbapi.cipmi_open_ia: SendTimedImbpRequest error. Ret = %d CC = 0x%02X %s ipmi_open_ia: open(%s) failedÿÿÿÿx $kAƒIÐ$Àd€ŽŒ†ƒ,QJ†ƒLŒTàŽ!D!D=D ,RJ†ƒLŒTÀŽ,´BŒO†H D ƒ,BŒL†H ƒG ,´BŒO†H D ƒ,BŒL†H ƒG ,ÄBA†ŒD D ƒ<rBEŽE E(ŒD0A8ƒ†G<¼BEŽE E(ŒD0A8ƒ†G dD ‡AƒG0ZD0ZD0x $kAƒIÐ$DÀd€ŽŒ†ƒ,lQJ†ƒLŒTàŽœ!D¼Ôì!D $=D ,DRJ†ƒLŒTÀŽ,t´BŒO†H D ƒ,¤BŒL†H ƒG ,Ô´BŒO†H D ƒ,BŒL†H ƒG ,4ÄBA†ŒD D ƒ<drBEŽE E(ŒD0A8ƒ†G<¤¼BEŽE E(ŒD0A8ƒ†G ädD ‡AƒG0$ZD0DZD0dw¸~ wÀ~ w!wÀ~!"w¸~"ûwûüwÀ~üýw¸~ýkwU!S!"U"üSý&SKkS"‘Éß‘Kk‘"‘ÀÉ‘ÉßQôý‘ý‘Q!‘K]Q]k‘ P¼ßPýPTKXPp”wˆ”/w/0wˆp‹Up¨T¨+^p¨Q¨Vp¨R¨Sp¨X¨!\p¨Y¨&]ª³PP³ÓP PP0Zw¨~Z1w12w¨~2w0¢U0žTžV2V0–Q–"^2^0§R§]2]0§X§\2\w*_2_ø2‘2<‘<zRz‘æïRoS2SïñP”wx”¤w¤¥wx¥®w®±wxœ¤P¥ªPàäwxäûwûwxàíUòôPþP $wh$YwY]whPRP`ŠwÈ~ŠowopwÈ~p²w`ãU`ßTßFVp²V`ªQª`^p²^`ºRºX]p²]`èXèP\p²\-/P¿h_p²_6p‘pz‘z‡Q‡²‘¦>Sp²SºèRÀÂwè~ÂÑwð~ÑÙwø~ÙÝw€ÝKwKLw€LMwø~MOwð~OPwè~PtwÀúUctUÀÉTctTÀØQØMVPtVÀRO\Pt\=GPPZPBP‘Pc‘ÐXXXXdRdÀQÀÔXÔ$TctR¥R€‚wè~‚Žwð~Ž–wø~–w€7 w7 8 w€8 9 wø~9 ; wð~; < wè~< ‘ w€£U£8 S< ‘ S€œTR ‘ T€•Q•9 V< ‘ V€R; \< ‘ \€ÙXÙRc p R ‘ R€êYc p Y ‘ Y) 3 P< F P. < ‘< R ‘Ì.Z.CRC¬Q¬¼T¼) ZR c Rc f Zp R ‘ Z„ûR  ¢ wè~¢ ± wð~± ¹ wø~¹ ½ w€½ + w+ , w€, - wø~- / wð~/ 0 wè~0 T w  Ú UC T U  © TC T T  ¸ Q¸ - V0 T V  ï Rï / \0 T \ ' P0 : P" 0 ‘0 C ‘° ÷ X÷ 8 X8 D RD   Q  ´ X´  TC T R… ó R` b wè~b n wð~n v wø~v } w€}  w  w€  wø~  wð~  wè~ q w` ƒ Uƒ  S q S` | T2 q T` u Qu  V q V` m Rm  \ q \` ¹ X¹ ä RC P Ra q R` Ê YC P Ya q Y  P & P  ‘ 2 ‘¬  Z # R# Œ QŒ œ Tœ Z2 C RC F ZP a Ra q Zd Û R€ ‚ wè~‚ ƒ wð~ƒ ‡ wø~‡ ‹ w€‹ "w"%w€%&wø~&(wð~()wè~)Dw€ Í U€ É TÉ &V)DVP¢ (\)D\)‘0D‘ %S)DSPRwø~RWw€W\wˆ\awaew˜efw fmw¨mRwRSw¨STw TVw˜VXwXZwˆZ\w€\]wø~]šwš w¨ ¡w ¡£w˜£¥w¥§wˆ§©w€©ªwø~ªÂwP{U{Z^]§^§ªUªÂ^P{T{V\]£\£ªTªÂ\P{Q{\_]©_ªÂ_P{R{SS] S ªRªÂSP{X{X]]¥]¥ªXªÂ]åçP{†Q!+QhyPy‡Q{ü‘üP‘ÐÒwè~Ò×wð~×Üwø~Üáw€áåwˆåæwæíw˜íww˜wwˆw€ wø~ "wð~"#wè~#dwdjw˜jkwkmwˆmow€oqwø~qswð~stwè~tŒwÐU ^#q^qtUtŒ^ÐT\#m\mtTtŒ\ÐQ"_#s_tŒ_ÐRS#jSjtRtŒSÐXæ]ï]#o]otXtŒ]ÐYŒ‘egPQÜæQ+<P<JQ|‘ |TŒ‘ ”wh”­w­®wh®ðwðôwh¶UçéPwXw` w #w`#$wX$ƒwƒ†w`†‡wXU#S#*U*†SegP$‘\‡‘”wX”¥w¥¦wX¦æwæêwX¬UËTÝßPðôwXôIwIJwXð+UEJUð(TEJT=?P=»‡open_imb) SendTimedImbpRequestO close_imb… initIPMI£ termIPMIÁ ipmi_open_ia ipmi_close_ia5 StartAsyncMesgPoll{ SendTimedI2cRequestå SendTimedEmpMessageResponse¹ SendTimedEmpMessageResponse_Ex§SendTimedLanMessageResponseuSendTimedLanMessageResponse_ExcSendAsyncImbpRequest'GetAsyncImbpMessage2GetAsyncImbpMessage_ExAIsAsyncMessageAvailable¦RegisterForImbAsyncMessageNotification UnRegisterForImbAsyncMessageNotificationSetShutDownCodeöGetIpmiVersion.AsyncEventHandleeNTstatus,Xßò!GinitIPMILPOVERLAPPEDInformationbusType_IO_save_endeventId_IO_write_base_lockhandleIdtimeOut_IO_save_basemax_iRegisterForImbAsyncMessageNotificationSendTimedImbpRequestWriteReadI2C_chain_cur_columnBYTE_modeSendTimedI2cRequestGetIpmiVersionrespLengthlong intrespSendTimedEmpMessageResponse_IO_markershort unsigned intchannelNumbererrorrespDataLensigned char_IO_FILEcompletionCodeunsigned char_sbufipmi_close_iacharresponseDataLenACCESN_TIMED_OUT_IO_lock_tI2CREQUESTDATAopen_imbDeviceIoControlhDeviceStartAsyncMesgPollULONGflags_IO_read_ptrIpmiVersionrequestDataOffsetHigh_posstdindwIoControlCodeACCESN_UNSUPPORTEDACCESN_END_OF_DATA_markerscSum1smi_VersionNoGetAsyncImbpMessage_ExSendTimedLanMessageResponse_Ex_offsetIsAsyncMessageAvailableseqLnACCESN_ERRORlong unsigned intstatus_flags2ACCESN_INVALID_TRANSACTION_IO_read_baseioctl_status_unused2thisSeqUINT32ImbPacket_old_offsetipmi_open_iaImbAsyncSeqStatusdelayTimerespDataPtrACCESN_OKlpoOverlappedlong long intrqSa_IO_write_endrsLunACCESN_OUT_OF_RANGEcountclose_imbShutdownCmdBuffer_IO_buf_base_nextunsigned intfdebugcmdlpcbBytesReturnedLPDWORD__pad1__pad2IMBPREQUESTDATASetShutDownCodeiFlag_flagsSendAsyncImbpRequestsmi_Reserved1smi_Reserved2cbOutBufferLPVOIDseqNoDWORDmsgPtrInternalHighntstatusOffsetAsyncEventHandleUnRegisterForImbAsyncMessageNotification/root/src/ipmiutil-1.6.10/utildataLengthmsgLenHANDLEAsyncEventObjectimbapi.cresponseDatalong long unsigned intreqLength__off_tImbRequestBufferlastSeqnfLn_OVERLAPPEDcbInBufferGetAsyncImbpMessageImbAsyncResponseSendTimedLanMessageResponse_IO_STATUS_BLOCK_IO_backup_base_shortbufsessionHandletermIPMINTstatus__off64_tcodecCodemy_ret_codedummyresponseDataBuf_IO_buf_enddummy_hDeviceretLengthrespBuffercmdTypeshort int_vtable_offsetnetFnInternalImbAsyncRequestprivilegeGNU C 3.4.4 20050721 (Red Hat 3.4.4-2)lpvOutBuffernumberOfBytesToRead_IO_read_endfskipcmdImbRequest_filenoACCESN_STATUSrsSareqPtrIO_STATUS_BLOCKSendTimedEmpMessageResponse_ExfloatstdoutwrReqImbResponseBufferlpvInBuffer_IO_write_ptrBOOLdatahDevice1fdebugGCC: (GNU) 3.4.4 20050721 (Red Hat 3.4.4-2).symtab.strtab.shstrtab.rela.text.data.bss.debug_abbrev.rela.debug_info.rela.debug_line.rodata.str1.1.rodata.str1.8.rela.debug_frame.rela.eh_frame.debug_loc.rela.debug_pubnames.rela.debug_aranges.debug_ranges.debug_str.note.GNU-stack.comment @X0|`&˜,˜1˜‚D»?‚¸,UÕ+VPH¯a2+0p2@0a„¨0x`¯  – 4x‘€³ ˜7Ø)°paA«µÅ±c0À¨µ0Ôác0â0dœí­lý­l-Úlàt ðy?ñÿ    &pÀ6 >OkX]0Qryˆòÿ‘—ž!¨®À·ÐÀà!ÍÛ =î`RÀ´€=  ´Y` x€ ÄPr¡Ð¼¸dЇ÷Z ðZ0Pimbapi.cfdebughDevice1IpmiVersionDeviceIoControlhDeviceAsyncEventHandleopen_imbopenSendTimedImbpRequestprintfsprintfperrorNTstatusioctlmemcpyclose_imbcloseinitIPMItermIPMIipmi_open_iaipmi_close_iaStartAsyncMesgPollSendTimedI2cRequestSendTimedEmpMessageResponseSendTimedEmpMessageResponse_ExSendTimedLanMessageResponseSendTimedLanMessageResponse_ExSendAsyncImbpRequestGetAsyncImbpMessageGetAsyncImbpMessage_ExIsAsyncMessageAvailableRegisterForImbAsyncMessageNotificationUnRegisterForImbAsyncMessageNotificationSetShutDownCodeGetIpmiVersion * /üÿÿÿÿÿÿÿ?G¸üÿÿÿÿÿÿÿÒáÿÿÿÿÿÿÿÿè üÿÿÿÿÿÿÿ' , 1 @;üÿÿÿÿÿÿÿCüÿÿÿÿÿÿÿb¤üÿÿÿÿÿÿÿµç  üÿÿÿÿÿÿÿ£!üÿÿÿÿÿÿÿ´ v!üÿÿÿÿÿÿÿ–¦#üÿÿÿÿÿÿÿçîüÿÿÿÿÿÿÿ& ä!üÿÿÿÿÿÿÿð ª!üÿÿÿÿÿÿÿßö Ÿß ¿ Ö   ¿  Î !üÿÿÿÿÿÿÿÔ  ¨ 7!üÿÿÿÿÿÿÿ‹!üÿÿÿÿÿÿÿ²üÿÿÿÿÿÿÿ( ‘ý!üÿÿÿÿÿÿÿN!üÿÿÿÿÿÿÿ|üÿÿÿÿÿÿÿ–üÿÿÿÿÿÿÿ² Ì üÿÿÿÿÿÿÿ& < wüÿÿÿÿÿÿÿ–üÿÿÿÿÿÿÿ¨  ÷ SÃüÿÿÿÿÿÿÿÑ"üÿÿÿÿÿÿÿ"üÿÿÿÿÿÿÿ  X ‰% Ù) . 35 š< CC vJ vQ G_ f q Ù| 3‰ ¼’  ‚¥ Û´ <à ÑÒ oá ?ð tÿ  c , e; ŸJ *Y ­h Âw ò† L• ¬¤ É´ QÄ ¯Ô Nä ô § ® Ú$ Š; âF 8N p\ ¨j l« ï² ›½ ,È ‚Ó ÕÞ C÷ Ÿ  6 f- 9; OI aX  i 0t Á‹ ¼™ ÷§ µ Fà hÑ Bß °í û   ø Ž$ Ñ2 A U ãc Ør Q‡ – 1¥ ¶´ à  á ‡ ¢ 4 `C 'R ¯a ‡q ç† 6• ]´ É èØ ‡è Vô Å  ] )( o= “L ‡\ aq îw &} -ƒ š‰ ‡ T• Ñœ ú± ?À Ï "Þ `í 'ü ‡  ¯ µ0 ? "N ½] ‡l ¯| í ü™¡k© ® Þ¹ ʾ UÎ 4Þ é Lî ‹ù ˜þ î  Y H Sp[0c Èh r w w 9† h o• BŸ ¥¤ °® Û³ ½ Â Ï øñ Gö s } }   ü/  ; 0C K ÖP  [ 8` ]k [p â{ ¤€ j‹ í ‹› 6  â° » À Ë µÐ Û à Uú 7ÿ E m ñ ö dU Ga i ±q € ‡ “ À› Ç¥ DZ й ÕÇ ¸Ó àÛ ã :è ƒó † © ® ! ; G  O ]W ß\ *k Ev + à `• ² N ¢  ­ ° ² ]½ Ó Â âÍ  Ò jÝ e â ‹í ® ò Eý ÷  â   " - P 2 UL ¯ U µ^ "m | A‹ ‡› P¦ å « /³ 4¼ dë ÷ Àÿ t   è  '  , Á7 T < ]G  L EW æ \ âl w | U  T® é¿ $Ë €Ó ‘ Û  ë ìð û 5 Á  k ] ´  ¹+ ý0 V; Y@ EK ¢P â` k Øp U” ¢ Ë­ r¹  ÁT É îÙ ÎÞ é î Áù :þ ]  ƒ E Ì â. 9 > Ub :p Ï{ á‡` q — ò§ Ò¬ · ¼ ÁÇ QÌ ]× šÜ ¹ç ãì V÷ ?ü E ˆ  â ' ¾, UP ö^ ±i âu€ }D… ÔŠ  • ´š &¥ ת Eµ  º âÊ Õ CÚ å yê U ±  d- M9PAÂI çN 2Y ì^ ºi [n ]y Ê~ &‰ &Ž V™ •ž E©  ® âÈ ' Í Ù ä ƒ øªÂ  d8 ÊDÐLŒT Î Y 2d Ó"i ºt B#y ]„ ±#‰ &”  $™ V¤ |$© ¹´ þ$¹ É EÔ 5%Ù âó X%ø   ´%#t+Œ4 dG S[ôc ÿ%h 7s s&x ú‡ – E¡ –&¬ y¸À‡È ¹&Í TØ i'Ý Eè Å'í ø è'ý ú g&ê.  (3 T> ”(C ÕN ·(S E^ Ú(c r ú‡ Å“ð›J£ ý(¨ س I)¸ ãà )È *× Eâ µ)ø ôP X q" I/ V<E ÈQ I]f Ðs| Œˆ ‘ ¦ •²v  D Hpl p0œ  ¼ ÀÀÔ ØÐì ðà  $ ( D H`t xÀ¤ ¨€Ô Ø   ` 4 8€ d hP¤ ¨Ðä è $ (D Hðd hP Hpp0 ÀÀØÐðà( H`xÀ¨€Ø  ` 8€ hP¨Ðè(HðhP  ipmiutil-3.0.7/configure.ac0000644000076400007640000004007013160502144015354 0ustar acressloggersdnl Process this file with autoconf to produce a configure script. AC_INIT(ipmiutil,3.0.7) AC_CONFIG_SRCDIR(util/ipmiutil.c) echo "ipmiutil version ${PACKAGE_VERSION}" AC_CONFIG_HEADERS(config.h) AC_PREFIX_DEFAULT(/usr) AM_INIT_AUTOMAKE() AC_PREFIX_DEFAULT(/usr) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_CHECK_PROG([SED], [sed], [sed]) dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/ioctl.h syslog.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_OFF_T AC_HEADER_TIME AC_STRUCT_TM AC_CHECK_TYPES(wchar_t) dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MMAP AC_FUNC_STRFTIME AC_FUNC_VPRINTF AC_CHECK_FUNCS(select socket strcspn strdup strspn strtoul memcpy) AM_PROG_LIBTOOL AC_CONST AC_TRY_COMPILE([#include #include ], [socklen_t len = 42; return 0;], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no) if test $ac_cv_type_socklen_t != yes; then AC_DEFINE(socklen_t, int, [if socklen_t is not defined, provide something useful]) else AC_DEFINE(HAVE_SOCKLEN_T, 1, [if socklen_t is defined, make note of it]) fi tmpspec=/tmp/iuspec.tmp$$ archm=`uname -m` archp=`uname -p 2>/dev/null` sysname=`uname -s` LIB_DIR="/usr/lib" isredhat=0 init_scripts="scripts/ipmi_port.sh scripts/ipmiutil_evt scripts/ipmiutil_asy scripts/ipmiutil_wdt" projdir=`pwd` SUBDIR_S="doc scripts lib util" os=Linux # ltmain.sh, config.sub, et al should have been created, but check to be sure. beforeprog="./beforeconf.sh" progs="config.sub ltmain.sh" for p in $progs do echo -e "checking for $p... \c" if test -f "$p"; then echo "yes" else echo "no" echo "Run $beforeprog to configure the build environment." exit 1 fi done #[ if test -n "$GCC"; then # CFLAGS="$CFLAGS -Wall -D_REENTRANT" # fi] drv_landesk=0 dnl configure for LANDESK libipmiapi or not AC_ARG_ENABLE([landesk], [ --enable-landesk adds landesk library support [[default=no]]], [if test "x$enableval" = "xyes"; then drv_landesk=1 LANDESK_CFLAGS="-DLINK_LANDESK" LANDESK_LDADD="-lipmiapi -L../lib" AC_SUBST(LANDESK_CFLAGS) AC_SUBST(LANDESK_LDADD) fi] ) dnl Configure ipmiutil for lanplus (libipmi_lanplus.a) or not (default yes) AC_ARG_ENABLE([lanplus], [ --disable-lanplus disable lanplus support [[default=enabled]]],) if test "x$enable_lanplus" = "xno"; then drv_lanplus="" LANPLUS_CFLAGS="" LANPLUS_LDADD="" LANPLUS_LIB="" LANPLUS_CRYPTO="" LANPLUS_SAM="no" LD_SAMX="" else drv_lanplus="lanplus" LANPLUS_CFLAGS="-DHAVE_LANPLUS" # LANPLUS_CFLAGS="-DHAVE_LANPLUS -I${projdir}/lib/lanplus/inc" # LANPLUS_LDADD="-L../lib -lintf_lanplus -L/usr/local/lib -lcrypto" LANPLUS_LDADD="-L../lib -lipmi_lanplus -L/usr/local/lib -lcrypto" LANPLUS_LIB="../lib/libipmi_lanplus.a" LANPLUS_CRYPTO="-lcrypto" LANPLUS_SAM="yes" LD_SAMX="../lib/libipmi_lanplus.a -lcrypto" fi dnl Configure libipmiutil.a for lanplus or not dnl Only SOL requires lanplus, so usually build libipmiutil.a without lanplus #AC_ARG_ENABLE([liblanplus], # [ --enable-liblanplus build libipmiutil.a with lanplus [[default=disabled]]],) #if test "x$enable_liblanplus" = "xyes"; then # LANPLUS_SAM="yes" # LD_SAMX= "../lib/libipmi_lanplus.a -lcrypto" #else # LANPLUS_SAM="no" # LD_SAMX="" #fi # strings /lib/libssl.so* |grep EVP_sha256 dnl configure for SHA256, build lanplus with SHA256 support, uses later openssl. AC_ARG_ENABLE([sha256], [ --enable-sha256 build with SHA256 support, requires later openssl.], [if test "x$enableval" = "xyes"; then LANPLUS_CFLAGS="$LANPLUS_CFLAGS -DHAVE_SHA256" fi] ) dnl configure for EKANALYZER, build with ekanalyzer function enabled AC_ARG_ENABLE([ekanalyzer], [ --enable-ekanalyzer build with ekanalyzer function enabled.], [if test "x$enableval" = "xyes"; then OS_CFLAGS="$OS_CFLAGS -DHAVE_EKANAL" fi] ) GPL_CFLAGS="" CROSS_LFLAGS="" CROSS_CFLAGS="" LIBSENSORS="" SAM2OBJ="isensor2.o ievents2.o" SYSTEMD_DIR=/usr/share/ipmiutil AC_ARG_ENABLE([useflags], [ --enable-useflags include environment CFLAGS and LDFLAGS.], [if test "x$enableval" = "xyes"; then CROSS_CFLAGS="$CFLAGS" CROSS_LFLAGS="$LDFLAGS" fi] ) dnl configure for standalone, with no lanplus or GPL libs AC_ARG_ENABLE([standalone], [ --enable-standalone build standalone, with no GPL or LanPlus libs.], [if test "x$enableval" = "xyes"; then GPL_CFLAGS="" LANPLUS_CFLAGS="" LANPLUS_LDADD="" LANPLUS_LIB="" LANPLUS_CRYPTO="" LANPLUS_SAM="no" LD_SAMX="" CFLAGS="-O2" SUBDIR_S="doc scripts util" if test "x$cross_compiling" = "xyes"; then # cross-compiling, so link with -static (e.g. Android ARM) CROSS_LFLAGS="-static" CROSS_CFLAGS="-DCROSS_COMPILE" sed -i -e 's/^# ipmiutil: $(METASOURCE:.c=.o)/ipmiutil:\t$(METASOURCE:.c=.o)\n\t$(CC) $(CFLAGS) $(LDFLAGS) -o ipmiutil $(METASOURCE:.c=.o) $(LDADD)/' util/Makefile.am fi fi] ) dnl build libipmiutil with sensor modules AC_ARG_ENABLE([libsensors], [ --enable-libsensors build libipmiutil with sensor modules [[default=no]]], [if test "x$enableval" = "xyes"; then LIBSENSORS="isensor2.o ievents2.o" SAM2OBJ="" fi] ) dnl configure for GPL build or not (GPL files: md2.h, ipmi_ioctl.h) AC_ARG_ENABLE([gpl], [ --enable-gpl build with some GPL code [[default=no]]], [if test "x$enableval" = "xyes"; then GPL_CFLAGS="-DALLOW_GPL" fi] ) dnl Does this Linux have systemd enabled? Otherwise use sysv init. AC_ARG_ENABLE([systemd], [ --enable-systemd enable systemd service type=notify support and %_unitdir [[default=disabled]]],) if test "x$enable_systemd" = "xyes"; then GPL_CFLAGS="$GPL_CFLAGS -DENABLE_SYSTEMD" # if systemd enabled, install service scripts in unitdir which rpm >/dev/null 2>&1 if test $? -eq 0 ; then SYSTEMD_DIR=`rpm --eval "%{_unitdir}"` else SYSTEMD_DIR=/usr/share/ipmiutil fi else # otherwise install the systemd service scripts in the data dir SYSTEMD_DIR=/usr/share/ipmiutil if test "x$sysname" != "xDarwin" ; then if test "x$os" != "xhpux" ; then # MacOS and HP-UX: 'which' command returns 0 always which rpm >/dev/null 2>&1 if test $? -eq 0 ; then datad=`rpm --eval "%{_datadir}"` SYSTEMD_DIR=${datad}/ipmiutil fi fi fi fi dnl start main logic case "$archm" in ia64) IA64_CFLAGS="-D__IA64__" LIB_DIR="/usr/lib64" ;; ppc64) IA64_CFLAGS="-DSTUB_IO" LIB_DIR="/usr/lib64" ;; x86_64) IA64_CFLAGS="" LIB_DIR="/usr/lib64" ;; i386) IA64_CFLAGS="" ;; i586) IA64_CFLAGS="" ;; i686) IA64_CFLAGS="" ;; sun4u) IA64_CFLAGS="-D__SPARC__" ;; *) IA64_CFLAGS="-DSTUB_IO" ;; esac dnl pkg-config support pkgconfigdir='${libdir}/pkgconfig' AC_MSG_CHECKING(whether to install pkg-config *.pc files) AC_ARG_WITH(pkgconfig-dir, AS_HELP_STRING([--with-pkgconfig-dir=PATH], [where to install pkg-config *.pc files (EPREFIX/lib/pkgconfig)]), [ case "${withval}" in yes|auto) ;; no) pkgconfigdir="" ;; *) pkgconfigdir="${withval}" ;; esac ], []) if test -n "${pkgconfigdir}"; then AC_MSG_RESULT(using ${pkgconfigdir}) else AC_MSG_RESULT(no) fi AM_CONDITIONAL(WITH_PKG_CONFIG, test -n "${pkgconfigdir}") dnl # libdir can be set with --libdir=/usr/lib (default=${exec_prefix}/lib) echo $libdir |grep exec_prefix >/dev/null 2>&1 if test $? -ne 0; then LIB_DIR="$libdir" echo "libdir set to $libdir" fi PKG_DIR=/usr/src/packages INS_LIB="" SHR_LINK="libipmiutil.so.1" init0= if test "x$sysname" = "xSunOS"; then echo "Detected Solaris" os=solaris # archp=`uname -p` if test -d "/usr/sfw/lib"; then sfwdir=/usr/sfw else sfwdir=/usr/local fi OS_CFLAGS="-DSOLARIS -I${sfwdir}/include" OS_LFLAGS="-L${sfwdir}/lib -lxnet -lsocket -lnsl -lresolv" OS_DRIVERS="ipmibmc.c ipmilipmi.c" drivers="bmc lipmi" INS_LIB="# " SHR_LINK="" else if test "x$sysname" = "xLinux"; then MD2_CFLAGS="" OS_LFLAGS="" OS_DRIVERS="imbapi.c ipmimv.c ipmild.c ipmidir.c" if test $drv_landesk -eq 1; then drivers="open imb landesk direct" else drivers="open imb direct" fi os=linux tmpc=/tmp/tmp.c tmpo=/tmp/tmp.o echo $ECHO_N "checking compile sign warning flags ... $ECHO_C" cfwarn="-Wno-pointer-sign -Wno-sign-conversion" # want "-Wno-unused-result", but unrecognized echo "int main() { return(1); }" >$tmpc $CC -o $tmpo -c $cfwarn $tmpc >/dev/null 2>&1 if test $? -ne 0 ; then cfwarn= echo "skip" else echo "ok, suppress excess warnings" fi rm -f $tmpc $tmpo >/dev/null 2>&1 echo $ECHO_N "checking compile gnu warning flags ... $ECHO_C" cfgnu="-Wgnu-designator" echo "int main() { return(1); }" >$tmpc $CC -o $tmpo -c $cfgnu $tmpc >/dev/null 2>&1 if test $? -ne 0 ; then cfgnu= echo "skip" else echo "ok, suppress excess warnings" fi rm -f $tmpc $tmpo >/dev/null 2>&1 echo $ECHO_N "checking compile fortify flags ... $ECHO_C" cfhard="-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" echo "int main() { alloca(100); return(1); }" >$tmpc $CC -o $tmpo $cfhard $tmpc >/dev/null 2>&1 if test $? -ne 0 ; then cfhard= echo "skip" else echo "ok, add" fi rm -f $tmpc $tmpo >/dev/null 2>&1 if test -f "/etc/debian_version"; then echo "Detected Debian Linux" os=debian PKG_DIR=.. INS_LIB="# " # use dpkg-buildpackage instead of rpmbuild else which rpm >/dev/null 2>&1 if test $? -eq 0; then pkgtop=`rpm --eval "%{_topdir}"` PKG_DIR=$pkgtop fi fi if test -f "/etc/redhat-release"; then echo "Detected Red Hat Linux" os=redhat isredhat=1 fi if test -f "/etc/SuSE-release"; then echo "Detected SuSE Linux" os=suse sed -e 's/# POST_INSTALL/if [ ! -f \/etc\/snmp\/snmpd.conf ]; then\n if [ -f \/etc\/ucdsnmpd.conf ]; then\n mkdir -p \/etc\/snmp; ln -s \/etc\/ucdsnmpd.conf \/etc\/snmp\/snmpd.conf\n fi\nif [ -f \/etc\/snmpd.conf ]; then\nmkdir -p \/etc\/snmp; ln -s \/etc\/snmpd.conf \/etc\/snmp\/snmpd.conf\nfi\nfi\n#/' -e 's/make install DEST/make install-strip DEST/' doc/ipmiutil.spec >$tmpspec cp -f $tmpspec doc/ipmiutil.spec fi if test -f "/etc/mvl-release"; then echo "Detected MontaVista Linux" os=montavista init0=/etc/init.d sed -e 's/openssl-devel/openssl-dev\n%ifarch x86_pentium3 x86_pentium4\nAutoReqProv: No\n%endif/' -e 's/%{_mandir}/\/usr\/share\/man/' -e 's/%{_initrddir}/\/etc\/init.d/' -e 's/%{_sysconfdir}/\/etc/' -e 's/# POST_INSTALL/newcrypto=%{_libdir}\/libcrypto.so.4\nif [ ! -f $newcrypto ]; then\n cp -f %{_libdir}\/libcrypto.so.0 $newcrypto\nfi\n#/' -e 's/make install DEST/make install-strip DEST/' doc/ipmiutil.spec >$tmpspec cp -f $tmpspec doc/ipmiutil.spec fi if test -f "/etc/wrs-release" -o -d "$WIND_HOME"; then echo "Detected WindRiver Linux" os=windriver echo "Be sure to set up the WR build environment first" # WR requires extra steps in the spec file. grep "%configure_target" doc/ipmiutil.spec >/dev/null 2>&1 if test $? -ne 0; then # WR changes have not been patched in, so make them. sed -e 's/Release: 1%{?dist}/Release: 1_WR/' -e 's/%build/%build\n%configure_target\n%define _config_cache config.cache\n/' -e 's/^make$/make CC="$CC" TARGET_CFLAGS="$CFLAGS" TARGET_LDADD="-L%{_host_cross_lib_dir}" LDFLAGS="$LDFLAGS" CXX="$CXX" CXXFLAGS="$CXXFLAGS" LD="$LD" AS="$AS" AR="$AR" CPP="$CPP" NM="$NM" OBJCOPY="$OPBJCOPY" OBJDUMP="$OPBJDUMP" RANLIB="$RANLIB" STRIP="$STRIP"/' -e 's/%install/%install\n%configure_target\n/' doc/ipmiutil.spec >$tmpspec cp -f $tmpspec doc/ipmiutil.spec fi # WRL libcrypto does not have MD2 MD2_CFLAGS="-DSKIP_MD2" init0=/etc/rc.d/init.d fi if test $isredhat -eq 0 ; then # set default start/stop for init scripts sed -i 's/# Default-Start:/# Default-Start: 3 4 5/' $init_scripts sed -i 's/# Default-Stop:/# Default-Stop: 0 1 2 6/' $init_scripts fi # The openssl rpm might not be installed which rpm >/dev/null 2>&1 if test $? -eq 0 ; then sslver=`rpm -q openssl-devel |cut -f3 -d'-' |cut -f1-2 -d'.'` else sslver=`openssl version |awk '{ print $2 }'|cut -f1-2 -d'.'` fi if test "$sslver" = "1.1"; then echo "Detected openssl-$sslver" MD2_CFLAGS="-DSKIP_MD2 -DSSL11" else if test -f "$LIB_DIR/libcrypto.so"; then strings $LIB_DIR/libcrypto.so | grep EVP_md2 >/dev/null 2>&1 if test $? -ne 0; then echo "No MD2 detected in openssl libcrypto.so" MD2_CFLAGS="-DSKIP_MD2" fi else echo "No openssl $LIB_DIR/libcrypto.so detected" MD2_CFLAGS="-DSKIP_MD2" fi fi OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfgnu $cfhard" else macos=1 # =1 means not mac # usually "x$sysname" = "xFreeBSD", but allow NetBSD # echo $sysname | grep 'BSD' >/dev/null 2>&1 echo $sysname | grep -q BSD bsd=$? if test "x$sysname" = "xDarwin" ; then if test "$archp" = "powerpc" ; then macos=0 else # else treat Darwin like BSD bsd=0 fi fi uname -a | grep -i HP-UX >/dev/null 2>&1 hpux=$? if test $hpux -eq 0; then echo "Detected HP-UX" os=hpux MD2_CFLAGS="-DSKIP_MD2" OS_CFLAGS="-DHPUX $MD2_CFLAGS" OS_LFLAGS="" OS_DRIVERS="imbapi.c ipmimv.c ipmidir.c" drivers="imb open direct" SHR_LINK="" else if test $bsd -eq 0; then # FreeBSD uname -K shows 903000 for 9.3 os=bsd osver=`uname -K |cut -c1` echo "Detected BSD $osver" if [ $osver -eq 7 ]; then OS_CFLAGS="-DBSD7 -DBSD -fPIC" else OS_CFLAGS="-DBSD -fPIC" fi OS_LFLAGS="" OS_DRIVERS="ipmimv.c ipmidir.c" drivers="open direct" elif test $macos -eq 0; then echo "Detected MacOSX" os=macos MD2_CFLAGS="-DSKIP_MD2" OS_CFLAGS="-DMACOS $MD2_CFLAGS -fPIC" OS_LFLAGS="" OS_DRIVERS="ipmimv.c ipmidir.c" drivers="open direct" SHR_LINK="" # optionally check for AppleBMC.kext here? else # not Solaris, Linux, BSD, or HP-UX = error echo "OS $sysname not yet supported" exit 1 fi fi fi fi dnl determine where the init.d directory is if test "x$init0" = "x" ; then if test "x$os" != "xmacos" ; then if test "x$os" != "xhpux" ; then which rpmbuild >/dev/null 2>&1 if test $? -eq 0 ; then init1=`rpmbuild --showrc |grep " _initrddir" | cut -d'}' -f2` if test "x$init1" != "x" ; then init0=/etc/${init1} fi fi fi fi fi if test "x$init0" = "x" ; then if test -d ${etcdir}/rc.d/init.d ; then init0=/etc/rc.d/init.d; else init0=/etc/init.d; fi fi INIT_DIR=${init0} AC_SUBST(IA64_CFLAGS) AC_SUBST(LANPLUS_CFLAGS) AC_SUBST(LANPLUS_LDADD) AC_SUBST(LANPLUS_LIB) AC_SUBST(LANPLUS_CRYPTO) AC_SUBST(LANPLUS_SAM) AC_SUBST(LIBSENSORS) AC_SUBST(SAM2OBJ) AC_SUBST(LD_SAMX) AC_SUBST(GPL_CFLAGS) AC_SUBST(OS_CFLAGS) AC_SUBST(OS_LFLAGS) AC_SUBST(OS_DRIVERS) AC_SUBST(PKG_DIR) AC_SUBST(INIT_DIR) AC_SUBST(LIB_DIR) AC_SUBST(INS_LIB) AC_SUBST(SUBDIR_S) AC_SUBST(CROSS_CFLAGS) AC_SUBST(CROSS_LFLAGS) AC_SUBST(SYSTEMD_DIR) AC_SUBST(SHR_LINK) AC_SUBST(pkgconfigdir) AC_OUTPUT(Makefile util/Makefile lib/Makefile lib/libipmiutil.pc lib/lanplus/Makefile doc/Makefile scripts/Makefile) if test "x$sysname" = "xSunOS"; then sed -e 's/^LDFLAGS = /LDFLAGS = -L\/usr\/sfw\/lib -lxnet -lsocket -lnsl /' -e 's/-DLINUX/-DSOLARIS -I\/usr\/sfw\/include/' util/Makefile >/tmp/make # -e 's/ipmidir.c/ipmibmc.c/' cp -f /tmp/make util/Makefile fi if test "x$os" = "xhpux" ; then for mk in Makefile util/Makefile lib/Makefile lib/libipmiutil.pc lib/lanplus/Makefile doc/Makefile scripts/Makefile do sed -e 's/^.NOEXPORT:/#.NOEXPORT:/' $mk >/tmp/make cp -f /tmp/make $mk done fi AC_MSG_RESULT([]) AC_MSG_RESULT([ipmiutil $VERSION]) AC_MSG_RESULT([ OS : $os]) AC_MSG_RESULT([ ARCH : $archm]) AC_MSG_RESULT([ DRIVERS : $drivers lan $drv_lanplus]) AC_MSG_RESULT([]) ipmiutil-3.0.7/test/0000755000076400007640000000000013160502163014045 5ustar acressloggersipmiutil-3.0.7/test/panicsel-c.sh0000755000076400007640000000052513160502144016423 0ustar acressloggers# ABAT test for panicsel component utilities # tag: rh71__build # util=/usr/share/panicsel/showsel util=/usr/sbin/isel echo "panicsel component, basic acceptance test" if [ ! -f $util ] then echo "%%FAILURE%%" exit 1 fi $util >/dev/null 2>&1 if [ $? -eq 0 ] then echo "%%SUCCESS%%" exit 0 else echo "%%FAILURE%%" exit 1 fi ipmiutil-3.0.7/test/panicsel_test_needreboot.sh0000644000076400007640000000654613160502144021456 0ustar acressloggers#!/bin/sh # pkg=panicsel # isel=showsel # ipef=pefconfig # ireset=hwreset pkg=ipmiutil isel=isel ipef=ilan ireset=ireset env() { if [ -x /usr/local/bin/$isel ];then PATH_EXEC="/usr/local/bin" fi if [ -x /usr/sbin/$isel ];then PATH_EXEC="/usr/sbin" fi } check_os() { if [ -d "/etc/redhat-release" ];then linux_type="redhat" fi if [ -d "/etc/SuSE-release" ];then linux_type="suse" fi if [ -d "/usr/src/hardhat" ];then linux_type="hardhat" fi } check_driver() { lsmod|grep "ipmi_comb" > /dev/null 2>&1 if [ $? -eq 0 ];then echo "The ipmi_comb driver has been inserted already" Major=`cat /proc/devices|grep imb|awk '{print $1}'` if [ ! -c /dev/imb ];then mknod /dev/imb c $Major 0 return 0 fi fi modprobe "ipmi_comb" > /dev/null 2>&1 if [ $? -eq 0 ];then echo "The ipmi_comb driver be inserted corretly" else # echo "There are no ipmi driver or ipmi driver can not be inserted correctly" return 0 fi lsmod|grep "ipmi_comb" > /dev/null 2>&1 if [ $? -eq 0 ];then Major=`cat /proc/devices|grep imb|awk '{print $1}'` if [ ! -c /dev/imb ];then mknod /dev/imb c $Major 0 fi fi } prepare() { env # check_driver } Test_kernelpatch() { oldnum=0 newnum=0 prepare DIR=`pwd` if [ -f /tmp/mark ];then MARK=`cat /tmp/mark` else MARK=0 fi $PATH_EXEC/$ipef -A $1 -C public if [ $? -ne 0 ];then echo "Pefconfig incorrectly,pls check your machine" exit 1 fi cd /usr/share/$pkg if [ "$MARK" -ne "1" ];then cd $DIR cp -f ./dopanic /usr/share/$pkg/ echo "Init a panic for $pkg..." $PATH_EXEC/$isel -s|grep -c "OS Critical Stop" > /tmp/ocs_num sync sleep 2 echo 1 > /tmp/mark cd /usr/share/$pkg insmod -f ./dopanic fi echo "check the result for $pkg..." read oldnum < /tmp/ocs_num $PATH_EXEC/$isel -s |grep -c "OS Critical Stop" > /tmp/ocs_num read newnum < /tmp/ocs_num let oldnum=oldnum+1 if [ $newnum -eq $oldnum ] then echo "PASS:KernelPactch:Panic sel insert record" return 0 else echo "FAIL: Kernel PatchPanic sel insert record" return 1 fi rm -f /tmp/mark } ts_hwresetr() { prepare if [ -f /tmp/count ];then COUNT=`cat /tmp/count` else COUNT=0 fi if [ "$COUNT" -ne "1" ];then $PATH_EXEC/$isel -c >/dev/null 2>&1 echo 1 > /tmp/count $PATH_EXEC/$ireset #reset the system fi $PATH_EXEC/$isel > /tmp/hwreset 2>&1 isevent=`cat /tmp/hwreset|grep "System Event"` isboot=`cat /tmp/hwreset|grep "System Boot"` if [ -n "$isevent" ] && [ -n "$isboot" ];then echo "PASS: $pkg power reset" return 0 else echo "FAIL: $pkg power reset" return 1 fi rm -f /tmp/count } ts_hwresetc() { prepare if [ -f /tmp/hwresetc ];then MARK=`cat /tmp/hwresetc` else MARK=0 fi if [ "$MARK" -ne "1" ];then $PATH_EXEC/$isel -c >/dev/null 2>&1 echo 1 > /tmp/hwresetc $PATH_EXEC/$ireset -c #reset the system fi $PATH_EXEC/$isel >/tmp/hwresetc 2>&1 power=`cat /tmp/hwresetc|grep "Power Off/Down"` if [ -n "$power" ];then echo "PASS: $pkg power cycle" return 0 else echo "FAIL: $pkg power cycle" return 1 fi rm -f /tmp/hwresetc } ipmiutil-3.0.7/test/ipmievt.sh0000755000076400007640000000265513160502144016070 0ustar acressloggers#!/bin/sh # ipmievt.sh - generate an IPMI temperature event # # Baseboard Temp is usually index 0d, 0e or 15, & sensor num 0x30 # Note that values displayed/used are in hex. # # sensor |grep -i "Baseboard Temp" # 000d SDR Full 01 39 20 a 01 snum 30 Baseboard Temp = 2f OK 47.00 degrees C # ^^=ibasetemp ^^=nbasetemp ^^+4=lotemp # pattn="Temp" sensorfil=/var/lib/ipmiutil/sensor_out.txt if [ ! -f $sensorfil ]; then sensorfil=/usr/share/ipmiutil/sensor_out.txt fi # get sensor readings again, since current temp may have changed ipmiutil sensor >$sensorfil #ibasetemp=0d #nbasetemp=30 # usually snum 30 on my test unit #lotemp=33 nbasetemp=`grep -i "$pattn" $sensorfil |head -n1|awk '{print $10}'` ibasetemp=`grep "snum $nbasetemp" $sensorfil |awk '{print $1}'` curtemp=`grep "snum $nbasetemp" $sensorfil| cut -f2 -d'=' |awk '{print $3}'|cut -f1 -d'.'` lotemp=`expr $curtemp + 4` hitemp=`expr $curtemp - 4` hinorm=`expr $curtemp + 25` if [ "x$curtemp" = "x" ]; then echo "Cannot find sensor reading for /$pattn/ in $sensorfil" exit 1 fi echo "Setting $pattn upper threshold to $hitemp - current temp = $curtemp" # cause a crit-hi for Baseboard Temp ipmiutil sensor -i $ibasetemp -t -n $nbasetemp -h $hitemp # give it 2 secs before clearing to OK sleep 2 # put Baseboard Temp back to OK ipmiutil sensor -i $ibasetemp -t -n $nbasetemp -h $hinorm sleep 1 # show the SEL events ipmiutil sel -l6 ipmiutil-3.0.7/test/sensor-TIGW1U.txt0000644000076400007640000001752213160502144017103 0ustar acressloggerssensor: version 2.3 -- BMC version 0.16, IPMI version 2.0 _ID_ SDR_Type_xx Sz Own Typ S_Num Sens_Description Hex & Interp Reading 0001 SDR Full 01 37 20 a 02 snum 10 BB +1.2V Vtt = be OK 1.20 Volts 0002 SDR Full 01 3b 20 a 02 snum 11 BB+1.9V NIC Core = cb OK 1.91 Volts 0003 SDR Full 01 37 20 a 02 snum 12 BB +1.5V AUX = bd OK 1.47 Volts 0004 SDR Full 01 33 20 a 02 snum 13 BB +1.5V = 75 OK 1.52 Volts 0005 SDR Full 01 33 20 a 02 snum 14 BB +1.8V = af OK 1.78 Volts 0006 SDR Full 01 33 20 a 02 snum 15 BB +3.3V = c1 OK 3.32 Volts 0007 SDR Full 01 37 20 a 02 snum 16 BB +3.3V STB = be OK 3.27 Volts 0008 SDR Full 01 37 20 a 02 snum 17 BB +1.5V ESB = be OK 1.48 Volts 0009 SDR Full 01 31 20 a 02 snum 18 BB +5V = c3 OK 5.07 Volts 000a SDR Full 01 37 20 a 02 snum 19 BB +1.2V NIC = ed OK 1.21 Volts 000b SDR Full 01 36 20 a 02 snum 1a BB +12V AUX = c1 OK 11.97 Volts 000c SDR Full 01 33 20 a 02 snum 1b BB +0.9V = ba OK 0.89 Volts 000d SDR Full 01 39 20 a 01 snum 30 Baseboard Temp = 30 OK 48.00 degrees C 000e SDR Full 01 3b 20 a 01 snum 32 Front Panel Temp = 1a OK 26.00 degrees C 000f SDR Full 01 31 20 m 04 snum 50 Fan 1A = 6f OK 7659.00 RPM 0010 SDR Full 01 31 20 m 04 snum 51 Fan 1B = 6c OK 5508.00 RPM 0011 SDR Full 01 31 20 m 04 snum 52 Fan 2A = 68 OK 7176.00 RPM 0012 SDR Full 01 31 20 m 04 snum 53 Fan 2B = 6b OK 5457.00 RPM 0013 SDR Full 01 31 20 m 04 snum 54 Fan 3A = 6c OK 7452.00 RPM 0014 SDR Full 01 31 20 m 04 snum 55 Fan 3B = 6b OK 5457.00 RPM 0015 SDR Full 01 31 20 m 04 snum 56 Fan 4A = 6f OK 7659.00 RPM 0016 SDR Full 01 31 20 m 04 snum 57 Fan 4B = 69 OK 5355.00 RPM 0017 SDR Full 01 30 20 m 04 snum 58 Fan 5 = 63 OK 6534.00 RPM 0018 SDR Full 01 39 20 a 03 snum 78 PS1 AC Current = 05 OK 0.62 Amps 0019 SDR Full 01 39 20 a 03 snum 79 PS2 AC Current = 16 OK 2.75 Amps 001a SDR Full 01 3b 20 a 03 snum 7a PS1 +12V Current = 01 OK 0.50 Amps 001b SDR Full 01 3b 20 a 03 snum 7b PS2 +12V Current = 11 OK 8.50 Amps 001c SDR Full 01 39 20 a 0b snum 7c PS1 +12V Power = 01 OK 4.00 Watts 001d SDR Full 01 39 20 a 0b snum 7d PS2 +12V Power = 19 OK 100.00 Watts 001e SDR Full 01 3a 20 a 01 snum 99 P1 Therm Margin = c9 OK -55.00 degrees C 001f SDR Full 01 3a 20 m 01 snum c0 P1 Therm Ctrl % = 00 OK 0.00 unspecified 0020 SDR Full 01 36 20 a 02 snum d0 Proc 1 Vccp = c3 OK 1.21 Volts 0021 SDR Full 01 38 c0 a 01 snum 01 SAS HSBP Temp = 1d OK* 29.00 degrees C 0022 SDR Comp 02 25 20 a 09 snum 01 Power Unit = 00 c0 00 00 Enabled 0023 SDR Comp 02 2b 20 a 09 snum 02 Power Redundancy = 00 c0 01 00 Redundant 0024 SDR Comp 02 27 20 a 23 snum 03 BMC Watchdog = 00 c0 00 00 OK 0025 SDR Comp 02 2a 20 a 06 snum 04 Scrty Violation = 00 c0 00 00 OK 0026 SDR Comp 02 27 20 a 13 snum 07 FP Interrupt = 00 c0 00 00 OK 0027 SDR Comp 02 2a 20 a 10 snum 09 Event Log Clear = 00 c0 00 00 OK 0028 SDR Comp 02 28 20 a 2a snum 0a Session Audit = 00 c0 00 00 Activated 0029 SDR Comp 02 27 20 a 12 snum 0b System Event = 00 c0 00 00 OK 002a SDR Comp 02 22 20 a 29 snum 1e BB Vbat = 00 c0 00 00 OK* 002b SDR Comp 02 25 20 a 08 snum 70 PS1 Status = 00 c0 01 00 Present 002c SDR Comp 02 25 20 a 08 snum 71 PS2 Status = 00 c0 01 00 Present 002d SDR Comp 02 25 20 a 22 snum 82 ACPI State = 00 c0 01 00 Working 002e SDR Comp 02 21 20 a 14 snum 84 Button = 00 c0 00 00 OK 002f SDR Comp 02 26 20 a f3 snum 85 SMI Timeout = 00 c0 01 00 Enabled 0030 SDR Comp 02 24 20 a c0 snum 87 NMI State = 00 c0 01 00 Enabled 0031 SDR Comp 02 24 20 a c0 snum 88 SMI State = 00 80 01 00 Enabled 0032 SDR Comp 02 2b 20 m 07 snum 90 Processor 1 Stat = 00 c0 80 00 OK* 0033 SDR Comp 02 25 20 a 13 snum a0 PCIe Link0 = 00 c0 00 00 OK 0034 SDR Comp 02 25 20 a 13 snum a1 PCIe Link1 = 00 c0 00 00 OK 0035 SDR Comp 02 25 20 a 13 snum a2 PCIe Link2 = 00 c0 00 00 OK 0036 SDR Comp 02 25 20 a 13 snum a3 PCIe Link3 = 00 c0 00 00 OK 0037 SDR Comp 02 25 20 a 13 snum a4 PCIe Link4 = 00 c0 00 00 OK 0038 SDR Comp 02 25 20 a 13 snum a5 PCIe Link5 = 00 c0 00 00 OK 0039 SDR Comp 02 25 20 a 13 snum a6 PCIe Link6 = 00 c0 00 00 OK 003a SDR Comp 02 25 20 a 13 snum a7 PCIe Link7 = 00 c0 00 00 OK 003b SDR Comp 02 25 20 a 13 snum a8 PCIe Link8 = 00 c0 00 00 OK 003c SDR Comp 02 28 20 m 01 snum c8 CPU1 VRD Temp = 00 c0 00 00 OK* 003d SDR Comp 02 27 20 a 02 snum d2 CPU1 Vcc OOR = 00 c0 00 00 OK 003e SDR Comp 02 2a 20 a 07 snum d8 CPU Popul Error = 00 c0 00 00 OK 003f SDR Comp 02 22 20 a 21 snum e0 DIMM 1A = 00 c0 04 00 Present 0040 SDR Comp 02 22 20 a 21 snum e1 DIMM 2A = 00 e0 00 00 NotAvailable 0041 SDR Comp 02 22 20 a 21 snum e2 DIMM 3A = 00 e0 00 00 NotAvailable 0042 SDR Comp 02 22 20 a 21 snum e3 DIMM 1B = 00 c0 04 00 Present 0043 SDR Comp 02 22 20 a 21 snum e4 DIMM 2B = 00 e0 00 00 NotAvailable 0044 SDR Comp 02 22 20 a 21 snum e5 DIMM 3B = 00 e0 00 00 NotAvailable 0045 SDR Comp 02 26 20 a 0c snum ec Mem A Error = 00 c0 00 00 OK 0046 SDR Comp 02 26 20 a 0c snum ed Mem B Error = 00 c0 00 00 OK 0047 SDR Comp 02 29 20 a 25 snum f0 DIMM Spare Enb = 00 e0 00 00 NotAvailable 0048 SDR Comp 02 2a 20 a 0c snum f1 DIMM Spare Redu = 00 e0 00 00 NotAvailable 0049 SDR Comp 02 29 c0 a 0d snum 02 SAS Drv 1 Stat = 00 d0 00 8e Ready 004a SDR Comp 02 29 c0 a 0d snum 03 SAS Drv 2 Stat = 00 d0 00 8e Ready 004b SDR Comp 02 29 c0 a 0d snum 04 SAS Drv 3 Stat = 00 d0 00 80 Unused 004c SDR Comp 02 29 c0 a 0d snum 09 SAS Drv 1 Pres = 00 d0 02 80 Present 004d SDR Comp 02 29 c0 a 0d snum 0a SAS Drv 2 Pres = 00 d0 02 80 Present 004e SDR Comp 02 29 c0 a 0d snum 0b SAS Drv 3 Pres = 00 d0 00 80 Unused 004f SDR FRU 11 18 dev: 20 00 80 00 0c 01 Baseboard FRU 0050 SDR FRU 11 19 dev: 20 02 80 00 15 01 Power Dist FRU 0051 SDR FRU 11 1b dev: 20 03 80 00 0a 01 Pwr Supply 1 FRU 0052 SDR FRU 11 1b dev: 20 04 80 00 0a 02 Pwr Supply 2 FRU 0053 SDR IPMB 12 1b dev: 20 00 bf 07 01 Basbrd Mgmt Ctlr 0054 SDR IPMB 12 1b dev: c0 00 29 0f 01 SFP HotSwap Ctlr 0055 SDR OEM c0 09 Intel: 02 02 00 01 70 71 0056 SDR OEM c0 05 Intel: 06 01 0057 SDR OEM c0 18 Intel: 0b 01 01 32 14 f0 0a a4 01 96 00 61 00 07 0a 64 05 00 00 00 00 0058 SDR OEM c0 2c Intel: 0c 01 30 64 64 01 02 01 30 20 32 64 01 90 0d 00 2b 20 30 21 35 22 3a 23 3f 24 43 25 47 26 4c 27 51 28 56 29 5b 2a 60 2b 64 0059 SDR OEM c0 2c Intel: 0c 02 30 64 64 01 02 01 30 20 32 64 01 90 0d 00 2b 20 30 21 35 22 3a 23 3f 24 43 25 47 26 4c 27 51 28 56 29 5b 2a 60 2b 64 005a SDR OEM c0 2c Intel: 0c 03 30 64 64 01 02 01 30 20 32 64 01 90 0d 00 2b 20 30 21 35 22 3a 23 3f 24 43 25 47 26 4c 27 51 28 56 29 5b 2a 60 2b 64 005b SDR OEM c0 15 Intel: 0c 01 64 64 64 01 02 01 00 20 99 64 02 90 01 06 00 11 005c SDR OEM c0 15 Intel: 0c 02 64 64 64 01 02 01 00 20 99 64 02 90 01 06 00 11 005d SDR OEM c0 15 Intel: 0c 03 64 64 64 01 02 01 00 20 30 64 02 90 01 02 3c 00 005e SDR OEM c0 0e Intel: 08 00 00 45 88 45 88 45 88 45 88 005f SDR OEM c0 16 Intel: 09 00 00 90 33 90 33 90 33 90 33 90 33 90 33 68 42 68 42 0060 SDR OEM c0 08 Intel: BMC_TAM0 60 01 03 02 20 nrec=4 cfg=02 0061 SDR OEM c0 31 Intel: BMC_TAM1 60 01 13 00 20 41 01 01 01 23 71 93 41 02 01 02 24 72 94 41 03 01 02 24 72 94 21 04 01 01 23 11 02 05 14 31 29 6f 01 13 23 21 09 0b 14 34 0062 SDR OEM c0 31 Intel: BMC_TAM2 60 01 23 00 20 71 07 6f 03 13 23 33 43 55 83 11 08 6f 14 21 09 6f 54 64 20 7c 01 72 94 20 7d 01 72 94 11 21 6f 03 53 23 6f 05 15 25 35 85 0063 SDR OEM c0 17 Intel: BMC_TAM3 60 01 33 00 c0 22 02 00 03 51 22 03 00 03 51 22 04 00 03 51 0064 SDR OEM c0 0e Intel: SDR File 12 0065 SDR OEM c0 11 Intel: SDR Package 12 SDR IPMI sensor: Power On Hours = 1014 hours sensor: completed successfully ipmiutil-3.0.7/test/retro.sh0000755000076400007640000000211113160502144015531 0ustar acressloggers#!/bin/sh # retro.sh # # retrofit ipmiutil subcommand naming for pre-2.6.0 scripts. # # old new full command #alarms ialarms (ipmiutil alarms) #bmcconfig iconfig (ipmiutil config) #bmchealth ihealth (ipmiutil health) #fruconfig ifru (ipmiutil fru) #getevent igetevent (ipmiutil getevent) #hwreset ireset (ipmiutil reset) #icmd icmd (ipmiutil cmd) #idiscover idiscover (ipmiutil discover) #ievents ievents (ipmiutil events) #isolconsole isol (ipmiutil sol) #pefconfig ilan (ipmiutil lan) #sensor isensor (ipmiutil sensor) #showsel isel (ipmiutil sel) #tmconfig iserial (ipmiutil serial) #wdt iwdt (ipmiutil wdt) mydir=`pwd` cd /usr/sbin ln ialarms alarms ln iconfig bmcconfig ln ihealth bmchealth ln ifru fruconfig ln igetevent getevent ln ireset hwreset ln isol isolconsole ln ilan pefconfig ln isensor sensor ln iserial tmconfig ln iwdt wdt cd $mydir ipmiutil-3.0.7/test/make2600000755000076400007640000000250413160502144015140 0ustar acressloggers# build dopanic as a linux 2.6 module # kdir=/usr/src/linux basename=dopanic # gcc -Wp,-MD,${basename}.o.d -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=pentium3 -I$kdir/include/asm-i386/mach-default -D__KERNEL__ -I$kdir/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=pentium3 -I$kdir/include/asm-i386/mach-default -fomit-frame-pointer -DMODULE -c -o ${basename}.o ${basename}.c # gcc -Wp,-MD,${basename}.mod.o.d -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=pentium3 -I$kdir/include/asm-i386/mach-default -D__KERNEL__ -I$kdir/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=pentium3 -I$kdir/include/asm-i386/mach-default -fomit-frame-pointer -DMODULE -c -o ${basename}.mod.o ${basename}.mod.c # ld -m elf_i386 -r -o ${basename}.ko ${basename}.o ${basename}.mod.o mkdir -p $kdir/drivers/char/dopanic cp dopanic.c $kdir/drivers/char/dopanic cp Kconfig $kdir/drivers/char/dopanic cp Makefile-26 $kdir/drivers/char/dopanic/Makefile make -C $kdir V=1 SUBDIRS=drivers/char/dopanic modules ls -l $kdir/drivers/char/dopanic/dopanic.ko ipmiutil-3.0.7/test/sensor-CG2100.txt0000644000076400007640000002575513160502144016726 0ustar acressloggersipmiutil ver 2.53 sensor: version 2.53 -- BMC version 0.48, IPMI version 2.0 _ID_ SDR_Type_xx ET Own Typ S_Num Sens_Description Hex & Interp Reading 0001 SDR Full 01 01 20 a 02 snum 10 BB +1.1V IOH = e9 OK 1.09 Volts 0002 SDR Full 01 01 20 a 02 snum 11 BB +1.1V P1 Vccp = a1 OK 0.99 Volts 0003 SDR Full 01 01 20 a 02 snum 12 BB +1.1V P2 Vccp = a2 OK 0.99 Volts 0004 SDR Full 01 01 20 a 02 snum 13 BB +1.5V P1 DDR3 = ec OK 1.53 Volts 0005 SDR Full 01 01 20 a 02 snum 14 BB +1.5V P2 DDR3 = eb OK 1.52 Volts 0006 SDR Full 01 01 20 a 02 snum 15 BB +1.8V AUX = e8 OK 1.77 Volts 0007 SDR Full 01 01 20 a 02 snum 16 BB +3.3V = e8 OK 3.34 Volts 0008 SDR Full 01 01 20 a 02 snum 17 BB +3.3V STBY = e6 OK 3.31 Volts 0009 SDR Full 01 01 20 a 02 snum 18 BB +3.3V Vbat = e7 OK 3.01 Volts 000a SDR Full 01 01 20 a 02 snum 19 BB +5.0V = e0 OK 4.90 Volts 000b SDR Full 01 01 20 a 02 snum 1a BB +5.0V STBY = e8 OK 5.08 Volts 000c SDR Full 01 01 20 a 02 snum 1b BB +12.0V = e3 OK 11.99 Volts 000d SDR Full 01 01 20 a 02 snum 1c BB -12.0V = be OK -11.59 Volts 000e SDR Full 01 01 20 a 01 snum 20 Baseboard Temp = 1d OK 29.00 degrees C 000f SDR Full 01 01 20 a 01 snum 21 Front Panel Temp = 18 OK 24.00 degrees C 0010 SDR Full 01 01 20 a 01 snum 22 IOH Therm Margin = cf OK -49.00 degrees C 0011 SDR Full 01 01 20 a 01 snum 23 Mem P1 Thrm Mrgn = d8 OK -40.00 degrees C 0012 SDR Full 01 01 20 a 01 snum 24 Mem P2 Thrm Mrgn = d6 OK -42.00 degrees C 0013 SDR Full 01 01 20 m 04 snum 30 System Fan 1 = 66 OK 4590.00 RPM 0014 SDR Full 01 01 20 m 04 snum 31 System Fan 2 = 65 OK 4545.00 RPM 0015 SDR Full 01 01 20 m 04 snum 32 System Fan 3 = 67 OK 4635.00 RPM 0016 SDR Full 01 01 20 m 04 snum 33 System Fan 4 = 65 OK 4545.00 RPM 0017 SDR Full 01 01 20 m 04 snum 38 System Fan 5 = 72 OK 5700.00 RPM 0018 SDR Full 01 01 20 m 04 snum 39 System Fan 6 = 72 OK 5700.00 RPM 0019 SDR Full 01 01 20 a 0b snum 52 PS1 Power In = 2a OK 168.00 Watts 001a SDR Full 01 01 20 a 03 snum 54 PS1 Curr Out % = 14 OK 20.00 unspecified 001b SDR Full 01 01 20 a 01 snum 56 PS1 Temperature = 1b OK 27.00 degrees C 001c SDR Full 01 01 20 a 01 snum 62 P1 Therm Margin = b9 OK -71.00 degrees C 001d SDR Full 01 01 20 a 01 snum 63 P2 Therm Margin = b8 OK -72.00 degrees C 001e SDR Full 01 01 20 a 01 snum 64 P1 Therm Ctrl % = 00 OK 0.00 unspecified 001f SDR Full 01 01 20 a 01 snum 65 P2 Therm Ctrl % = 00 OK 0.00 unspecified 0020 SDR Full 01 01 c0 a 01 snum 01 HSBP Temperature = 19 OK* 25.00 degrees C 0021 SDR Comp 02 6f 20 a 09 snum 01 Power Unit Stat = 00 c0 00 00 Enabled 0022 SDR Comp 02 6f 20 a 23 snum 03 IPMI Watchdog = 00 c0 00 00 OK 0023 SDR Comp 02 6f 20 a 05 snum 04 Physical Scrty = 00 c0 01 00 ChassisIntrus 0024 SDR Comp 02 6f 20 a 13 snum 05 FP NMI Diag Int = 00 c0 00 00 OK 0025 SDR Comp 02 03 20 a f3 snum 06 SMI Timeout = 00 c0 00 00 Disabled 0026 SDR Comp 02 6f 20 a 10 snum 07 System Event Log = 00 c0 00 00 MemLogDisab 0027 SDR Comp 02 6f 20 a 12 snum 08 System Event = 00 c0 00 00 OK 0028 SDR Comp 02 6f 20 a 14 snum 09 Button = 00 c0 00 00 OK 0029 SDR Comp 02 08 20 a 04 snum 40 Fan 1 Present = 00 c0 02 00 Present 002a SDR Comp 02 08 20 a 04 snum 41 Fan 2 Present = 00 c0 02 00 Present 002b SDR Comp 02 08 20 a 04 snum 42 Fan 3 Present = 00 c0 02 00 Present 002c SDR Comp 02 08 20 a 04 snum 43 Fan 4 Present = 00 c0 02 00 Present 002d SDR Comp 02 08 20 a 04 snum 44 Fan 5 Present = 00 c0 02 00 Present 002e SDR Comp 02 08 20 a 04 snum 45 Fan 6 Present = 00 c0 02 00 Present 002f SDR Comp 02 0b 20 a 04 snum 46 Fan Redundancy = 00 c0 01 00 Redundant 0030 SDR Comp 02 6f 20 a 08 snum 50 PS1 Status = 00 c0 01 00 Present 0031 SDR Comp 02 6f 20 m 07 snum 60 P1 Status = 00 c0 80 00 ProcPresent 0032 SDR Comp 02 6f 20 m 07 snum 61 P2 Status = 00 c0 80 00 ProcPresent 0033 SDR Comp 02 05 20 m 01 snum 66 P1 VRD Hot = 00 c0 00 00 OK 0034 SDR Comp 02 05 20 m 01 snum 67 P2 VRD Hot = 00 c0 00 00 OK 0035 SDR Comp 02 03 20 m 07 snum 68 CATERR = 00 c0 00 00 OK 0036 SDR Comp 02 03 20 m 07 snum 69 CPU Missing = 00 c0 00 00 OK 0037 SDR Comp 02 03 20 m 01 snum 6a IOH Therm Trip = 00 c0 00 00 OK 0038 SDR Comp 02 74 2c a dc snum 1a NM Capabilities = 00 00 00 00 NotAvailable 0039 SDR Comp 02 6f c0 a 0d snum 02 Drv 0 Stat = 00 c0 00 8e Ready 003a SDR Comp 02 6f c0 a 0d snum 03 Drv 1 Stat = 00 c0 00 80 Unused 003b SDR Comp 02 6f c0 a 0d snum 04 Drv 2 Stat = 00 c0 00 80 Unused 003c SDR Comp 02 6f c0 a 0d snum 05 Drv 3 Stat = 00 c0 00 80 Unused 003d SDR Comp 02 6f c0 a 0d snum 06 Drv 4 Stat = 00 c0 00 80 Unused 003e SDR Comp 02 6f c0 a 0d snum 07 Drv 5 Stat = 00 c0 00 80 Unused 003f SDR Comp 02 08 c0 a 0d snum 09 Drv 0 Pres = 00 c0 02 80 Present 0040 SDR Comp 02 08 c0 a 0d snum 0a Drv 1 Pres = 00 c0 00 80 Unused 0041 SDR Comp 02 08 c0 a 0d snum 0b Drv 2 Pres = 00 c0 00 80 Unused 0042 SDR Comp 02 08 c0 a 0d snum 0c Drv 3 Pres = 00 c0 00 80 Unused 0043 SDR Comp 02 08 c0 a 0d snum 0d Drv 4 Pres = 00 c0 00 80 Unused 0044 SDR Comp 02 08 c0 a 0d snum 0e Drv 5 Pres = 00 c0 00 80 Unused 0045 SDR EvtO 03 19 2c 00 snum 17 SPS FW Health = 00 00 00 00 OK 0046 SDR EvtO 03 18 2c 00 snum 18 NM Exception = 00 00 00 00 OK 0047 SDR EvtO 03 15 2c 00 snum 19 NM Health = 00 00 00 00 OK 0048 SDR EvtO 03 18 2c 00 snum 1b NM Threshold = 00 00 00 00 OK 0049 SDR EvtO 03 1b 33 01 snum 01 Mem Mirr Sensor = 00 00 00 00 OK 004a SDR EvtO 03 1b 33 01 snum 02 Mmry ECC Sensor = 00 00 00 00 OK 004b SDR EvtO 03 1b 33 01 snum 03 PCI Lgcy Sensor = 00 00 00 00 OK 004c SDR EvtO 03 1b 33 01 snum 04 PCIe Fat Sensor = 00 00 00 00 OK 004d SDR EvtO 03 1b 33 01 snum 05 PCIe Cor Sensor = 00 00 00 00 OK 004e SDR EvtO 03 1b 33 01 snum 06 QPI Corr Sensor = 00 00 00 00 OK 004f SDR EvtO 03 1b 33 01 snum 07 QPI NonF Sensor = 00 00 00 00 OK 0050 SDR EvtO 03 1b 33 01 snum 11 Mem Spar Sensor = 00 00 00 00 OK 0051 SDR EvtO 03 1b 33 01 snum 12 Mirr Mod Sensor = 00 00 00 00 OK 0052 SDR EvtO 03 1b 33 01 snum 13 Spar Mod Sensor = 00 00 00 00 OK 0053 SDR EvtO 03 1b 33 01 snum 14 Mem Parity Snsr = 00 00 00 00 OK 0054 SDR EvtO 03 1b 33 01 snum 17 QPI Fatl Sensor = 00 00 00 00 OK 0055 SDR EvtO 03 1b 33 01 snum 18 QPI Fatl Sensor = 00 00 00 00 OK 0056 SDR EvtO 03 1b 01 01 snum 83 BIOS Evt Sensor = 00 00 00 00 OK 0057 SDR FRU 11 14 dev: 20 00 80 00 07 01 Baseboard 0058 SDR FRU 11 1b dev: 20 01 80 00 15 01 Power Dist Board 0059 SDR FRU 11 1b dev: 20 02 80 00 0a 01 Pwr Supply 1 FRU 005a SDR IPMB 12 1b dev: 20 00 bf 07 01 Basbrd Mgmt Ctlr 005b SDR IPMB 12 17 dev: c0 00 29 0f 01 HotSwap Ctlr 005c SDR IPMB 12 0d dev: 2c 06 21 2e 01 ME 005d SDR OEM c0 0b Intel: 0d 01 2c 60 19 18 1a 1b 005e SDR OEM c0 15 Intel: 05 46 00 04 04 01 30 40 31 41 32 42 33 43 38 44 39 45 005f SDR OEM c0 32 Intel: 09 0f 10 54 14 11 88 0f 12 88 0f 13 a5 0e 14 a5 0e 15 73 0c 16 b6 0a 17 b6 0a 18 d5 09 19 bb 0a 1a bb 0a 1b d5 0a 1c 39 1e 1d 44 10 1e 44 10 0060 SDR OEM c0 1e Intel: 0a 00 00 50 2d 50 2d 50 2d 50 2d 00 01 00 01 00 01 00 01 c8 32 c8 32 00 01 00 01 0061 SDR OEM c0 0e Intel: 0b 01 01 23 07 10 21 90 01 01 08 0062 SDR OEM c0 0e Intel: 0b 01 02 23 07 10 21 90 01 01 08 0063 SDR OEM c0 0e Intel: 0b 01 04 23 07 10 21 90 01 01 08 0064 SDR OEM c0 0e Intel: 0b 01 08 23 07 10 21 90 01 01 08 0065 SDR OEM c0 0e Intel: 0b 01 10 23 07 10 21 90 01 01 08 0066 SDR OEM c0 0e Intel: 0b 01 20 23 07 10 21 90 01 01 08 0067 SDR OEM c0 0e Intel: 0b 01 40 23 07 10 21 90 01 01 08 0068 SDR OEM c0 0e Intel: 0b 01 80 23 07 10 21 90 01 01 08 0069 SDR OEM c0 0e Intel: 0b 02 ff 23 07 10 21 90 01 03 08 006a SDR OEM c0 1a Intel: 0c 01 00 19 ff 01 02 03 20 21 64 00 41 10 04 14 26 19 2a 1e 31 23 38 006b SDR OEM c0 1a Intel: 0c 01 00 19 ff 01 02 0c 20 21 64 00 41 10 04 14 28 19 2d 1e 35 23 3e 006c SDR OEM c0 1a Intel: 0c 01 00 19 ff 01 02 30 20 21 64 00 41 10 04 14 2e 19 31 1e 3b 23 41 006d SDR OEM c0 1a Intel: 0c 01 00 19 ff 01 02 c0 20 21 64 00 41 10 04 14 39 19 3c 1e 48 23 50 006e SDR OEM c0 1a Intel: 0c 01 00 19 ff 01 02 03 20 21 64 00 41 50 04 14 32 19 37 1e 3f 23 4b 006f SDR OEM c0 1a Intel: 0c 01 00 19 ff 01 02 0c 20 21 64 00 41 50 04 14 32 19 37 1e 41 23 55 0070 SDR OEM c0 1a Intel: 0c 01 00 19 ff 01 02 30 20 21 64 00 41 50 04 14 37 00 37 1e 41 23 55 0071 SDR OEM c0 1a Intel: 0c 01 00 19 ff 01 02 c0 20 21 64 00 41 50 04 14 46 00 37 1e 41 23 55 0072 SDR OEM c0 15 Intel: 0c 01 00 19 ff 01 02 ff 20 63 64 00 42 28 40 00 00 11 0073 SDR OEM c0 15 Intel: 0c 01 00 19 ff 01 02 ff 20 23 64 00 42 38 10 00 fc 00 0074 SDR OEM c0 10 Intel: 0c 01 00 14 ff 01 02 ff ff 64 64 ff 00 0075 SDR OEM c0 0e Intel: 0c 01 00 14 ff 01 02 ff fd 01 04 0076 SDR OEM c0 1a Intel: 0c 01 01 19 ff 01 02 03 20 21 64 00 41 10 04 14 26 19 2a 1e 31 23 38 0077 SDR OEM c0 1a Intel: 0c 01 01 19 ff 01 02 0c 20 21 64 00 41 10 04 14 28 19 2d 1e 35 23 3e 0078 SDR OEM c0 1a Intel: 0c 01 01 19 ff 01 02 30 20 21 64 00 41 10 04 14 2e 19 31 1e 3b 23 41 0079 SDR OEM c0 1a Intel: 0c 01 01 19 ff 01 02 c0 20 21 64 00 41 10 04 14 39 19 3c 1e 48 23 50 007a SDR OEM c0 1a Intel: 0c 01 01 19 ff 01 02 03 20 21 64 00 41 50 04 14 32 19 37 1e 3f 23 4b 007b SDR OEM c0 1a Intel: 0c 01 01 19 ff 01 02 0c 20 21 64 00 41 50 04 14 32 19 37 1e 41 23 55 007c SDR OEM c0 1a Intel: 0c 01 01 19 ff 01 02 30 20 21 64 00 41 50 04 14 37 19 41 1e 55 23 64 007d SDR OEM c0 1a Intel: 0c 01 01 19 ff 01 02 c0 20 21 64 00 41 50 04 14 46 19 50 1e 5a 23 64 007e SDR OEM c0 15 Intel: 0c 01 01 19 ff 01 02 ff 20 62 64 00 42 28 40 00 00 01 007f SDR OEM c0 15 Intel: 0c 01 01 19 ff 01 02 ff 20 24 64 00 42 38 10 00 fc 10 0080 SDR OEM c0 10 Intel: 0c 01 01 14 ff 01 02 ff ff 64 64 ff 00 0081 SDR OEM c0 0e Intel: 0c 01 01 14 ff 01 02 ff fd 01 04 0082 SDR OEM c0 1a Intel: 0c 01 02 19 ff 01 02 03 20 21 64 00 41 10 04 14 26 19 2a 1e 31 23 38 0083 SDR OEM c0 1a Intel: 0c 01 02 19 ff 01 02 0c 20 21 64 00 41 10 04 14 28 19 2d 1e 35 23 3e 0084 SDR OEM c0 1a Intel: 0c 01 02 19 ff 01 02 30 20 21 64 00 41 10 04 14 2e 19 31 1e 3b 23 41 0085 SDR OEM c0 1a Intel: 0c 01 02 19 ff 01 02 c0 20 21 64 00 41 10 04 14 39 19 3c 1e 48 23 50 0086 SDR OEM c0 1a Intel: 0c 01 02 19 ff 01 02 03 20 21 64 00 41 50 04 14 32 19 37 1e 3f 23 4b 0087 SDR OEM c0 1a Intel: 0c 01 02 19 ff 01 02 0c 20 21 64 00 41 50 04 14 32 19 37 1e 41 23 55 0088 SDR OEM c0 1a Intel: 0c 01 02 19 ff 01 02 30 20 21 64 00 41 50 04 14 37 19 41 1e 55 23 64 0089 SDR OEM c0 1a Intel: 0c 01 02 19 ff 01 02 c0 20 21 64 00 41 50 04 14 46 19 50 1e 5a 23 64 008a SDR OEM c0 15 Intel: 0c 01 02 19 ff 01 02 ff 20 22 64 00 42 38 00 01 fb 00 008b SDR OEM c0 10 Intel: 0c 01 02 14 ff 01 02 ff ff 64 64 ff 00 008c SDR OEM c0 0e Intel: 0c 01 02 14 ff 01 02 ff fd 01 04 008d SDR OEM c0 14 Intel: 0e 01 07 01 06 30 2a 31 2b 32 34 33 35 38 36 39 37 008e GetSDR error 0xca Cannot return requested number of data bytes, rlen=0 SDR IPMI sensor: Power On Hours = 255 hours sensor Cannot return requested number of data bytes ipmiutil-3.0.7/test/panicsel-k.sh0000755000076400007640000000046113160502144016432 0ustar acressloggers# ABAT test for panicsel kernel patch # tag: panicsel__build echo "panicsel kernel patch (BMC_PANIC), basic acceptance test" # dmesg |grep "BMC IPMI" >/dev/null 2>&1 dmesg |grep bmc_panic >/dev/null 2>&1 if [ $? -eq 0 ] then echo "%%SUCCESS%%" exit 0 else echo "%%FAILURE%%" exit 1 fi ipmiutil-3.0.7/test/Kconfig0000644000076400007640000000027513160502144015353 0ustar acressloggers# # DOPANIC device configuration # menu "DOPANIC" config DOPANIC tristate 'Do Panic' help This causes a Linux kernel panic when loaded. If unsure, say N. endmenu ipmiutil-3.0.7/test/dopanic_drv.c0000644000076400007640000000201113160502144016472 0ustar acressloggers/* dopanic.c * * Cause a panic in a loadable driver. */ #include /* We're doing kernel work */ #include /* Specifically, a module */ static int device_open(void *inode, void *file) { printk (KERN_DEBUG "device_open(%p,%p)\n", inode, file); return 0; } static int device_release(void *inode, void *file) { printk ("device_release(%p,%p)\n", inode, file); return 0; } static int device_read(void *file, char *buffer, /* The buffer to fill with data */ int length, /* The length of the buffer */ int *offset) /* Our offset in the file */ { return 0; } static int device_write(void *file, const char *buffer, /* The buffer */ int length, /* The length of the buffer */ int *offset) /* Our offset in the file */ { return -1; } /* Initialize the module */ int init_module() { panic("dopanic: init_module calls panic"); return 0; } /* Cleanup - unregister the appropriate file from /proc */ void cleanup_module() { } ipmiutil-3.0.7/test/dopanic.80000644000076400007640000000143313160502144015553 0ustar acressloggers.TH DOPANIC 8 "Version 1.0: 28 Feb 2007" .SH NAME dopanic \- kernel module to cause a panic .SH SYNOPSIS .B "insmod ./dopanic.ko" .SH DESCRIPTION dopanic is a Linux kernel module that calls panic when it is loaded. This can be used to test the CONFIG_IPMI_PANIC_STRING feature in the OpenIPMI driver. .SH "SEE ALSO" pefconfig(8) showsel(8) .SH WARNINGS Be sure to sync your filesystem before using this module. See http://ipmiutil.sourceforge.net/ for the latest version and any bug fix list. .SH COPYRIGHT Copyright (C) 2007 Intel Corp. .PP See the file COPYING in the distribution for more details regarding redistribution. .PP This utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. .SH AUTHOR .PP Andy Cress .br ipmiutil-3.0.7/test/Makefile-260000644000076400007640000000016513160502144015733 0ustar acressloggers# # Makefile for the dopanic module. # TARGET = dopanic.ko CONFIG_DOPANIC=m obj-$(CONFIG_DOPANIC) += dopanic.o ipmiutil-3.0.7/test/Makefile0000644000076400007640000002331213160502144015505 0ustar acressloggers################################################################################ # # # Copyright(c) 1999 - 2007 Intel Corporation. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # The full GNU General Public License is included in this distribution in the # file called LICENSE. # # Contact Information: # Linux NICS # Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 # ################################################################################ MYDIR =$(shell echo `pwd`) ########################################################################### # Driver files # core driver files CFILES = dopanic_drv.c HFILES = ifeq (,$(BUILD_KERNEL)) BUILD_KERNEL=$(shell uname -r) endif ########################################################################### # Environment tests # Kernel Search Path # All the places we look for kernel source KSP := /lib/modules/$(BUILD_KERNEL)/source \ /lib/modules/$(BUILD_KERNEL)/build \ /usr/src/linux-$(BUILD_KERNEL) \ /usr/src/linux-$($(BUILD_KERNEL) | sed 's/-.*//') \ /usr/src/kernel-headers-$(BUILD_KERNEL) \ /usr/src/kernel-source-$(BUILD_KERNEL) \ /usr/src/linux-$($(BUILD_KERNEL) | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \ /usr/src/linux # prune the list down to only values that exist # and have an include/linux sub-directory test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir)) KSP := $(foreach dir, $(KSP), $(test_dir)) # we will use this first valid entry in the search path ifeq (,$(KSRC)) KSRC := $(firstword $(KSP)) endif ifeq (,$(KSRC)) $(error Linux kernel source not found) else ifeq (/lib/modules/$(shell uname -r)/source, $(KSRC)) KOBJ := /lib/modules/$(shell uname -r)/build else KOBJ := $(KSRC) endif endif # check for version.h and autoconf.h for running kernel in /boot (SUSE) ifneq (,$(wildcard /boot/vmlinuz.version.h)) VERSION_FILE := /boot/vmlinuz.version.h CONFIG_FILE := /boot/vmlinuz.autoconf.h KVER := $(shell $(CC) $(CFLAGS) -E -dM $(VERSION_FILE) | \ grep UTS_RELEASE | awk '{ print $$3 }' | sed 's/\"//g') ifeq ($(KVER),$(shell uname -r)) # set up include path to override headers from kernel source x:=$(shell rm -rf include) x:=$(shell mkdir -p include/linux) x:=$(shell cp /boot/vmlinuz.version.h include/linux/version.h) x:=$(shell cp /boot/vmlinuz.autoconf.h include/linux/autoconf.h) CFLAGS += -I./include else VERSION_FILE := $(KOBJ)/include/linux/version.h CONFIG_FILE := $(KSRC)/include/linux/autoconf.h endif else VERSION_FILE := $(KOBJ)/include/linux/version.h CONFIG_FILE := $(KSRC)/include/linux/autoconf.h endif ifeq (,$(wildcard $(VERSION_FILE))) $(error Linux kernel source not configured - missing version.h) endif ifeq (,$(wildcard $(CONFIG_FILE))) $(error Linux kernel source not configured - missing config.h) endif # pick a compiler ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version))) CC := kgcc gcc cc else CC := gcc cc endif test_cc = $(shell $(cc) --version > /dev/null 2>&1 && echo $(cc)) CC := $(foreach cc, $(CC), $(test_cc)) CC := $(firstword $(CC)) ifeq (,$(CC)) $(error Compiler not found) endif # we need to know what platform the driver is being built on # some additional features are only built on Intel platforms ARCH := $(shell uname -m | sed 's/i.86/i386/') ifeq ($(ARCH),alpha) CFLAGS += -ffixed-8 -mno-fp-regs endif ifeq ($(ARCH),x86_64) CFLAGS += -mcmodel=kernel -mno-red-zone endif ifeq ($(ARCH),ppc) CFLAGS += -msoft-float endif ifeq ($(ARCH),ppc64) CFLAGS += -m64 -msoft-float LDFLAGS += -melf64ppc endif # standard flags for module builds CFLAGS += -DLINUX -D__KERNEL__ -DMODULE -O2 -pipe -Wall CFLAGS += -I$(KSRC)/include -I. CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \ echo "-DMODVERSIONS -DEXPORT_SYMTAB \ -include $(KSRC)/include/linux/modversions.h") CFLAGS += $(CFLAGS_EXTRA) #ifeq (,$(shell echo $(CFLAGS_EXTRA) | grep NAPI)) #CFLAGS += -DE1000_NO_NAPI #CFLAGS_EXTRA += -DE1000_NO_NAPI #endif RHC := $(KSRC)/include/linux/rhconfig.h ifneq (,$(wildcard $(RHC))) # 7.3 typo in rhconfig.h ifneq (,$(shell $(CC) $(CFLAGS) -E -dM $(RHC) | grep __module__bigmem)) CFLAGS += -D__module_bigmem endif endif # get the kernel version - we use this to find the correct install path KVER := $(shell $(CC) $(CFLAGS) -E -dM $(VERSION_FILE) | grep UTS_RELEASE | \ awk '{ print $$3 }' | sed 's/\"//g') KKVER := $(shell echo $(KVER) | \ awk '{ if ($$0 ~ /2\.[4-9]\./) print "1"; else print "0"}') # ifeq ($(KKVER), 0) # $(error *** Aborting the build. \ # *** This driver is not supported on kernel versions older than 2.4.0) # endif # set the install path INSTDIR := /lib/modules/$(KVER)/kernel/drivers/char # look for SMP in config.h SMP := $(shell $(CC) $(CFLAGS) -E -dM $(CONFIG_FILE) | \ grep CONFIG_SMP | awk '{ print $$3 }') ifneq ($(SMP),1) SMP := 0 endif ifneq ($(SMP),$(shell uname -a | grep SMP > /dev/null 2>&1 && echo 1 || echo 0)) $(warning ***) ifeq ($(SMP),1) $(warning *** Warning: kernel source configuration (SMP)) $(warning *** does not match running kernel (UP)) else $(warning *** Warning: kernel source configuration (UP)) $(warning *** does not match running kernel (SMP)) endif $(warning *** Continuing with build,) $(warning *** resulting driver may not be what you want) $(warning ***) endif ifeq ($(SMP),1) CFLAGS += -D__SMP__ endif # Any special handling for this driver ########################################################################### # 2.4.x & 2.6.x Specific rules K_VERSION:=$(shell uname -r | cut -c1-3 | sed 's/2\.[56]/2\.6/') ifeq ($(K_VERSION), 2.6) # Makefile for 2.6.x kernel TARGET = dopanic.ko # man page MANSECTION = 8 MANFILE = $(TARGET:.ko=.$(MANSECTION)) # ifeq (,$(wildcard /etc/SuSE-release)) # CFLAGS_DOPANIC += -I$(KSRC)/include/asm/mach-generic # CFLAGS_EXTRA += $(CFLAGS_DOPANIC) # endif ifneq ($(PATCHLEVEL),) EXTRA_CFLAGS += $(CFLAGS_EXTRA) obj-m += dopanic.o dopanic-objs := $(CFILES:.c=.o) else default: ifeq ($(KOBJ),$(KSRC)) make -C $(KSRC) V=1 SUBDIRS=$(shell pwd) modules else make -C $(KSRC) V=1 O=$(KOBJ) SUBDIRS=$(shell pwd) modules endif endif else # ifeq ($(K_VERSION),2.6) # Makefile for 2.4.x kernel TARGET = dopanic # man page MANSECTION = 8 MANFILE = $(TARGET:.o=.$(MANSECTION)) # Get rid of compile warnings in kernel header files from SuSE ifneq (,$(wildcard /etc/SuSE-release)) CFLAGS += -Wno-sign-compare -fno-strict-aliasing endif # Get rid of compile warnings in kernel header files from fedora ifneq (,$(wildcard /etc/fedora-release)) CFLAGS += -fno-strict-aliasing endif .SILENT: $(TARGET) $(TARGET): $(filter-out $(TARGET), $(CFILES:.c=.o)) $(LD) $(LDFLAGS) -r $^ -o $@ echo; echo echo "**************************************************" echo "** $(TARGET) built for $(KVER)" echo -n "** SMP " if [ "$(SMP)" = "1" ]; \ then echo "Enabled"; else echo "Disabled"; fi echo "**************************************************" echo $(CFILES:.c=.o): $(HFILES) Makefile default: echo "** CFLAGS = $(CFLAGS)" make endif # ifeq ($(K_VERSION),2.6) ifeq (,$(MANDIR)) # find the best place to install the man page MANPATH := $(shell (manpath 2>/dev/null || echo $MANPATH) | sed 's/:/ /g') ifneq (,$(MANPATH)) # test based on inclusion in MANPATH test_dir = $(findstring $(dir), $(MANPATH)) else # no MANPATH, test based on directory existence test_dir = $(shell [ -e $(dir) ] && echo $(dir)) endif # our preferred install path # should /usr/local/man be in here ? MANDIR := /usr/share/man /usr/man MANDIR := $(foreach dir, $(MANDIR), $(test_dir)) MANDIR := $(firstword $(MANDIR)) endif ifeq (,$(MANDIR)) # fallback to /usr/man MANDIR := /usr/man endif # depmod version for rpm builds DEPVER := $(shell /sbin/depmod -V 2>/dev/null | \ awk 'BEGIN {FS="."} NR==1 {print $$2}') ########################################################################### # Build rules $(MANFILE).gz: ../$(MANFILE) gzip -c $< > $@ install: default $(MANFILE).gz # remove all old versions of the driver find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET) -exec rm -f {} \; || true find $(INSTALL_MOD_PATH)/lib/modules/$(KVER) -name $(TARGET).gz -exec rm -f {} \; || true install -D -m 644 $(TARGET) $(INSTALL_MOD_PATH)$(INSTDIR)/$(TARGET) ifeq (,$(INSTALL_MOD_PATH)) /sbin/depmod -a || true else ifeq ($(DEPVER),1 ) /sbin/depmod -r $(INSTALL_MOD_PATH) -a || true else /sbin/depmod -b $(INSTALL_MOD_PATH) -a -n > /dev/null || true endif endif install -D -m 644 $(MANFILE).gz $(INSTALL_MOD_PATH)$(MANDIR)/man$(MANSECTION)/$(MANFILE).gz man -c -P'cat > /dev/null' $(MANFILE:.$(MANSECTION)=) || true uninstall: if [ -e $(INSTDIR)/$(TARGET) ] ; then \ rm -f $(INSTDIR)/$(TARGET) ; \ fi /sbin/depmod -a if [ -e $(MANDIR)/man$(MANSECTION)/$(MANFILE).gz ] ; then \ rm -f $(MANDIR)/man$(MANSECTION)/$(MANFILE).gz ; \ fi .PHONY: clean install clean: rm -rf $(TARGET) $(TARGET:.ko=.o) $(TARGET:.ko=.mod.c) $(TARGET:.ko=.mod.o) $(CFILES:.c=.o) $(MANFILE).gz .*cmd .tmp_versions ipmiutil-3.0.7/test/testipmi.sh0000755000076400007640000002334113160502144016244 0ustar acressloggers#!/bin/sh # testipmi.sh [node_ip] # Main test script for ipmiutil functions # Other files used: # ./ipmievt.sh # ./sensor-TIGW1U.txt # ./sensor-CG2100.txt # # If a remote node is specified as the target, it must be confiugred for # IPMI LAN and should have the ipmiutil_asy service running. # outf=/tmp/testipmi.out remote=0 dosol=0 # default remote node for SOL test node=192.168.134.52 # use canned username and password, edit as needed. user=admin pswd=password mydir=`pwd` indir=`dirname $0` c1=`echo $indir |cut -c1` if [ "$c1" = "/" ]; then testdir=$indir else testdir=$mydir/$indir fi # datadir=/usr/share/ipmiutil datadir=/var/lib/ipmiutil # sfil is used only to read from with events -p -s below # normally, sfil=$datadir/sensor-out.txt sfil=${testdir}/sensor-TIGW1U.txt sfil2=${testdir}/sensor-CG2100.txt evtsh=${testdir}/ipmievt.sh tmpc=/tmp/cfg.tmp tmpin=/tmp/sol.in npass=0 nfail=0 # march=`rpmbuild --showrc |grep " _target_cpu" | head -n1 |awk '{print $3}'` uarch=`uname -m` LANPARAMS= os=`uname -s` if [ "$os" = "SunOS" ];then TAIL="tail -1" TAIL2="tail -2" else TAIL="tail -n1" TAIL2="tail -n2" fi errexit() { rv=$1 echo "FAIL $rv" nfail=`expr $nfail + 1` echo "## Passed=$npass, Failed=$nfail, see $outf for detailed results" exit $rv } waitready() { i=0 while [ 1 ]; do if [ $i -gt 15 ]; then return 1 fi echo "wait for ready: loop $i ..." ipmiutil wdt $LANPARAMS if [ $? -eq 0 ]; then return 0 else sleep 1 fi i=`expr $i + 1` done } runcmd() { # runcmd checks for the tag 'successful' in the output and exits otherwise. CMD="$*" TAG=`echo $CMD |cut -f1-3 -d' '` tmpcmd=/tmp/cmdout.$$ echo -n "$TAG ... " echo "# $CMD" > $tmpcmd $CMD >>$tmpcmd 2>&1 rv=$? $TAIL $tmpcmd | grep successful >/dev/null success=$? cat $tmpcmd >>$outf if [ $success -ne 0 ]; then if [ $rv -eq 0 ]; then rv=1 fi echo "FAIL $rv" echo "=== $CMD FAIL $rv" >>$outf nfail=`expr $nfail + 1` else echo "PASS" echo "=== $CMD PASS" >>$outf npass=`expr $npass + 1` fi return $rv } runcmdr() { # runcmdr checks only the return value for 0, and exits otherwise. CMD="$*" TAG=`echo $CMD |cut -f1-3 -d' '` tmpcmd=/tmp/cmdoutr.$$ echo -n "$TAG ... " echo "# $CMD" > $tmpcmd $CMD >>$tmpcmd 2>&1 rv=$? cat $tmpcmd >>$outf if [ $rv -ne 0 ]; then echo "FAIL $rv" echo "=== $CMD FAIL $rv" >>$outf nfail=`expr $nfail + 1` else echo "PASS" echo "=== $CMD PASS" >>$outf npass=`expr $npass + 1` fi return $rv } if [ $# -ge 1 ];then node=$1 LANPARAMS="-N $node -U $user -P $pswd" remote=1 dosol=1 fi >$outf pushd /tmp echo "## testipmi.sh $LANPARAMS" | tee -a $outf if [ ! -f $sfil ]; then echo "Cannot find required file $sfil" echo "Make sure that $sfil, $sfil2, and $evtsh are present." exit 1 fi if [ ! -f $sfil2 ]; then echo "Cannot find required file $sfil2" echo "Make sure that $sfil, $sfil2, and $evtsh are present." exit 1 fi if [ ! -x $evtsh ]; then echo "Cannot find required file $evtsh" echo "Make sure that $sfil, $sfil2, and $evtsh are present." exit 1 fi runcmd "ipmiutil health $LANPARAMS" runcmd "ipmiutil health -x $LANPARAMS" runcmd "ipmiutil health -c $LANPARAMS" runcmd "ipmiutil health -f -g -h -s -c $LANPARAMS" runcmd "ipmiutil cmd -x $LANPARAMS 00 20 18 01 " runcmdr "ipmiutil cmd -q $LANPARAMS 00 20 18 01 " runcmd "ipmiutil fru -b $LANPARAMS" MODEL=`grep "Chassis OEM Field" $outf| cut -f2 -d':'| awk '{ print $1 }'` ASSET=`grep "Product Asset Tag" $outf| cut -f2 -d':'| awk '{ print $1 }'` runcmd "ipmiutil fru $LANPARAMS" runcmd "ipmiutil fru -c $LANPARAMS" runcmd "ipmiutil fru -i 00 -m 002000s $LANPARAMS" runcmd "ipmiutil fru -a test_asset $LANPARAMS" -V4 runcmd "ipmiutil fru -a ${ASSET} $LANPARAMS" -V4 runcmd "ipmiutil config $LANPARAMS -s $tmpc" runcmd "ipmiutil lan -c $LANPARAMS " IPADDR=`grep "IP address" $outf| tail -n1|cut -f2 -d'|'| awk '{ print $1 }'` if [ "x$IPADDR" = "x0.0.0.0" ]; then # if not already configured, use value from node variable. IPADDR=$node fi if [ $remote -eq 0 ]; then runcmd "ipmiutil lan -e -I $IPADDR -u $user -p $pswd $LANPARAMS " fi runcmd "ipmiutil lan $LANPARAMS " if [ $remote -eq 0 ]; then # restore previous IPMI LAN settings runcmd "ipmiutil config $LANPARAMS -r $tmpc" fi ipmiutil serial | grep "No serial channel" >/dev/null 2>&1 if [ $? -ne 0 ]; then runcmd "ipmiutil serial $LANPARAMS" runcmd "ipmiutil serial -c $LANPARAMS" fi tmpsel=/tmp/selout.$$ runcmd "ipmiutil sel $LANPARAMS" runcmd "ipmiutil sel -e $LANPARAMS" runcmd "ipmiutil sel -v $LANPARAMS" runcmd "ipmiutil sel -l5 $LANPARAMS" echo -n "ipmiutil sel -r" ipmiutil sel -r -l20 $LANPARAMS >$tmpsel if [ $? -ne 0 ]; then echo "... FAIL $rv" |tee -a $outf nfail=`expr $nfail + 1` fi echo " ... PASS" |tee -a $outf npass=`expr $npass + 1` runcmd "ipmiutil sel -f $tmpsel $LANPARAMS " runcmd "ipmiutil sensor $LANPARAMS" runcmd "ipmiutil sensor -v $LANPARAMS" runcmd "ipmiutil sensor -g temp,fan,voltage $LANPARAMS" runcmd "ipmiutil sensor -c $LANPARAMS" if [ $remote -eq 0 ]; then runcmd "$evtsh" fi # Test getevt SEL method runcmdr "ipmiutil getevt -s $LANPARAMS -t 3 " if [ $remote -eq 0 ]; then # if local, also test getevt MessageBuffer method runcmdr "ipmiutil getevt $LANPARAMS -t 3 " fi # Do not run SOL test if no remote server is configured for SOL. if [ $dosol -eq 1 ]; then # runcmd "ipmiutil sol -d $LANPARAMS " (do not check success) echo -n "ipmiutil sol -d ... " echo "# ipmiutil sol -d $LANPARAMS " >> $outf ipmiutil sol -d $LANPARAMS >>$outf 2>&1 if [ $? -eq -3 ]; then echo "FAIL" echo "=== ipmiutil sol -d FAIL" >>$outf nfail=`expr $nfail + 1` else echo "PASS" echo "=== ipmiutil sol -d PASS" >>$outf npass=`expr $npass + 1` fi cat - <<%%% >$tmpin root password ls pwd echo success exit ~. %%% runcmd "ipmiutil sol -a $LANPARAMS -i $tmpin" fi runcmd "ipmiutil wdt $LANPARAMS" runcmd "ipmiutil wdt -e -a0 -t 5 -p 2 $LANPARAMS" runcmd "ipmiutil wdt -c $LANPARAMS" runcmd "ipmiutil wdt -r $LANPARAMS" sleep 5 runcmd "ipmiutil wdt -d $LANPARAMS" runcmd "ipmiutil sel -l5 $LANPARAMS" runcmdr "ipmiutil discover -a" CMD="ipmiutil events 18 00 02 02 00 00 00 20 00 04 09 01 6f 44 0f ff" echo -n "ipmiutil events (AC Lost)" echo "# $CMD" >>$outf $CMD >>$outf $TAIL2 $outf |grep "AC Lost" >/dev/null if [ $? -ne 0 ]; then echo " ... FAIL 1" |tee -a $outf nfail=`expr $nfail + 1` fi echo " ... PASS" |tee -a $outf npass=`expr $npass + 1` CMD="ievents -p -s $sfil B3 E8 00 0E 0C C7 1B A0 11 08 12 7F 10 90 FF FF 20 20 00 20 02 15 01 41 0F FF" echo -n "ievents -p (Redundancy Lost)" echo "# $CMD" >>$outf $CMD >>$outf $TAIL2 $outf |grep "Redundancy Lost" >/dev/null if [ $? -ne 0 ]; then echo " ... FAIL 1" |tee -a $outf nfail=`expr $nfail + 1` fi echo " ... PASS" |tee -a $outf npass=`expr $npass + 1` CMD="ipmiutil events -s $sfil2 -p B5 19 00 15 17 C6 C9 D0 00 02 B2 76 C1 16 FF FF 20 20 10 20 20 00 00 52 1D 20 00 00 00 00 00 00 00 00 00 00 00 00 C1 00 00 00 00 00 00 00 00 00 00" echo -n "ipmiutil events -p (Lo Crit)" echo "# $CMD" >>$outf $CMD >>$outf $TAIL2 $outf |grep "Lo Crit thresh" >/dev/null if [ $? -ne 0 ]; then echo " ... FAIL 1" |tee -a $outf nfail=`expr $nfail + 1` fi echo " ... PASS" |tee -a $outf npass=`expr $npass + 1` # The alarms command will fail on systems without an alarm panel. echo "MODEL=$MODEL" >> $outf case "$MODEL" in TIGW1U) tamok=1 ;; TIGH2U) tamok=1 ;; TIGI2U) tamok=1 ;; TIGPR2U) tamok=1 ;; TIGPT1U) tamok=1 ;; TSRLT2) tamok=1 ;; TSRMT2) tamok=1 ;; CG2100) tamok=1 ;; *) tamok=0 ;; esac if [ $tamok -eq 1 ]; then picmg=0 runcmd "ipmiutil alarms $LANPARAMS" runcmdr "ipmiutil alarms -m1 -n1 $LANPARAMS" runcmdr "ipmiutil alarms -o $LANPARAMS" fi runcmd "ipmiutil alarms -i10 $LANPARAMS" # The rackmount servers with TAM are not PICMG, # so if the have TAM, skip the PICMG test. # otherwise try a PICMG test. if [ $tamok -eq 0 ]; then picmg=1 CMD="ipmiutil picmg $LANPARAMS properties" echo -n "$CMD" echo "# $CMD" >>$outf $CMD >>$outf rv=$? if [ $rv -eq 193 ]; then echo " ... N/A" picmg=0 elif [ $? -ne 0 ]; then echo " ... FAIL $rv" |tee -a $outf nfail=`expr $nfail + 1` else echo " ... PASS" |tee -a $outf npass=`expr $npass + 1` fi fi # The firmware firewall feature is only for PICMG if [ $picmg -eq 1 ]; then CMD="ipmiutil firewall $LANPARAMS info" echo -n "$CMD" echo "# $CMD" >>$outf $CMD >>$outf rv=$? if [ $rv -ne 0 ]; then echo " ... FAIL $rv" |tee -a $outf nfail=`expr $nfail + 1` else echo " ... PASS" |tee -a $outf npass=`expr $npass + 1` fi fi if [ "$uarch" = "ia64" ] then # Note that ireset -n (NMI) causes a full reset on ia64 echo "ia64, so skip ipmiutil reset -n" |tee -a $outf else # Use hwreset -n to send an NMI. runcmd "ipmiutil reset -n $LANPARAMS " fi if [ $remote -eq 1 ]; then # reset if the system is remote runcmd "ipmiutil reset -o $LANPARAMS " # after soft-reboot, could do waitready here instead sleep 80 runcmd "ipmiutil reset -r -w $LANPARAMS " sleep 1 runcmd "ipmiutil reset -c -w $LANPARAMS " sleep 1 runcmd "ipmiutil reset -d -w $LANPARAMS " sleep 1 runcmd "ipmiutil reset -w -u $LANPARAMS " # if the system isn't fully down yet, the up request may be ignored. sleep 1 runcmd "ipmiutil reset -u $LANPARAMS " # wait for init to complete sleep 80 # Should be up now, but some systems take a bit longer for # everything to come back up. So we do this last. fi echo "## Passed=$npass, Failed=$nfail, see $outf for detailed results" # remove temp files (tmpcmdr=/tmp/cmdoutr.$$ tmpcmd=/tmp/cmdout.$$) rm -f $tmpc $tmpin /tmp/cmdout* /tmp/selout* popd exit 0 ipmiutil-3.0.7/test/unittest.sh0000755000076400007640000001516313160502144016270 0ustar acressloggers#!/bin/sh # unittest.sh [node_ip] # Basic unit test for ipmiutil functions # dosol=0 doserial=0 outf=/tmp/unittest.out # default remote node for SOL test node=192.168.1.154 mydir=`pwd` indir=`dirname $0` c1=`echo $indir |cut -c1` if [ "$c1" = "/" ]; then testdir=$indir else testdir=$mydir/$indir fi # datadir=/usr/share/ipmiutil datadir=/var/lib/ipmiutil # sfil is used only to read from with events -p -s below # normally, sfil=$datadir/sensor-out.txt sfil=${testdir}/sensor-TIGW1U.txt sfil2=${testdir}/sensor-CG2100.txt tmpc=/tmp/cfg.tmp tmpin=/tmp/sol.in # march=`rpmbuild --showrc |grep " _target_cpu" | head -n1 |awk '{print $3}'` uarch=`uname -m` LANPARAMS= os=`uname -s` if [ "$os" = "SunOS" ];then TAIL="tail -1" TAIL2="tail -2" else TAIL="tail -n1" TAIL2="tail -n2" fi if [ $# -ge 1 ];then node=$1 # use canned username and password, edit as needed. LANPARAMS="-N $node -U admin -P password" fi >$outf cd /tmp echo "# ipmiutil sel -v $LANPARAMS" |tee -a $outf ipmiutil sel -v $LANPARAMS >>$outf 2>&1 if [ $? -ne 0 ]; then echo "No IPMI support detected" exit 1 fi echo "# ipmiutil health $LANPARAMS" |tee -a $outf ipmiutil health $LANPARAMS |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi echo "# ipmiutil cmd $LANPARAMS -x 00 20 18 01 " |tee -a $outf ipmiutil cmd $LANPARAMS -x 00 20 18 01 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi echo "# ipmiutil fru $LANPARAMS" |tee -a $outf ipmiutil fru $LANPARAMS 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi MODEL=`grep "Chassis OEM Field" $outf| cut -f2 -d':'| awk '{ print $1 }'` echo "# ipmiutil config $LANPARAMS -s $tmpc" |tee -a $outf ipmiutil config $LANPARAMS -s $tmpc 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi echo "# ipmiutil lan $LANPARAMS " |tee -a $outf ipmiutil lan $LANPARAMS 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi echo "# ipmiutil sel $LANPARAMS" |tee -a $outf ipmiutil sel $LANPARAMS 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi echo "# ipmiutil sel -e $LANPARAMS" |tee -a $outf ipmiutil sel -e $LANPARAMS 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi echo "# ipmiutil sensor $LANPARAMS" |tee -a $outf ipmiutil sensor $LANPARAMS 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi # ipmiutil discover -a -b 10.243.42.255 |tee -a $outf echo "# ipmiutil discover -a" |tee -a $outf ipmiutil discover -a 2>&1 |tee -a $outf $TAIL2 $outf |grep responses >/dev/null if [ $? -ne 0 ]; then exit 1 fi # Test getevt SEL method echo "# ipmiutil getevt -s $LANPARAMS -t 3 " |tee -a $outf ipmiutil getevt -s $LANPARAMS -t 3 2>&1 |tee -a $outf rv=$? # $TAIL $outf |grep successful >/dev/null if [ $rv -ne 0 ]; then echo "igetevt error $rv" exit 1 fi if [ "x$LANPARAMS" = "x" ]; then # if local, also test getevt MessageBuffer method echo "# ipmiutil getevt $LANPARAMS -t 3 " |tee -a $outf ipmiutil getevt $LANPARAMS -t 3 2>&1 |tee -a $outf rv=$? # $TAIL $outf |grep successful >/dev/null if [ $rv -ne 0 ]; then echo "igetevt error $rv" exit 1 fi fi if [ "$uarch" = "ia64" ] then # Note that ireset -n causes a real reset on ia64 (?) echo "skipping ia64 ipmiutil reset" |tee -a $outf else # Use hwreset -n to send an NMI. echo "# ipmiutil reset $LANPARAMS -n" |tee -a $outf ipmiutil reset $LANPARAMS -n 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi fi # Might not do SOL test if no remote server is configured for SOL. if [ $dosol -eq 1 ]; then echo "# ipmiutil sol -d -N $node " |tee -a $outf ipmiutil sol -d -N $node 2>&1 |tee -a $outf cat - <<%%% >$tmpin root password ls pwd echo success exit ~. %%% echo "# ipmiutil sol -a -N $node -i $tmpin " |tee -a $outf ipmiutil sol -a -N $node -i $tmpin 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi fi echo "# ipmiutil events 18 00 02 02 00 00 00 20 00 04 09 01 6f 44 0f ff " |tee -a $outf ipmiutil events 18 00 02 02 00 00 00 20 00 04 09 01 6f 44 0f ff |tee -a $outf $TAIL2 $outf |grep "AC Lost" >/dev/null if [ $? -ne 0 ]; then exit 1 fi echo "# ievents -p -s $sfil B3 E8 00 0E 0C C7 1B A0 11 08 12 7F 10 90 FF FF 20 20 00 20 02 15 01 41 0F FF " |tee -a $outf ievents -p -s $sfil B3 E8 00 0E 0C C7 1B A0 11 08 12 7F 10 90 FF FF 20 20 00 20 02 15 01 41 0F FF |tee -a $outf $TAIL2 $outf |grep "Redundancy Lost" >/dev/null if [ $? -ne 0 ]; then exit 1 fi echo "# ipmiutil events -s $sfil2 -p B5 19 00 15 17 C6 C9 D0 00 02 B2 76 C1 16 FF FF 20 20 10 20 20 00 00 52 1D 20 00 00 00 00 00 00 00 00 00 00 00 00 C1 00 00 00 00 00 00 00 00 00 00" |tee -a $outf ipmiutil events -s $sfil2 -p B5 19 00 15 17 C6 C9 D0 00 02 B2 76 C1 16 FF FF 20 20 10 20 20 00 00 52 1D 20 00 00 00 00 00 00 00 00 00 00 00 00 C1 00 00 00 00 00 00 00 00 00 00 |tee -a $outf $TAIL2 $outf |grep "Lo Crit thresh" >/dev/null if [ $? -ne 0 ]; then exit 1 fi echo "# ievents 40 78 02 37 86 41 4e 20 00 04 0c 08 6f 20 ff 04" |tee -a $outf ievents 40 78 02 37 86 41 4e 20 00 04 0c 08 6f 20 ff 04 |tee -a $outf $TAIL2 $outf |grep DIMM >/dev/null if [ $? -ne 0 ]; then echo "DIMM event FAIL" exit 1 fi echo "# ipmiutil events -d 40 78 02 37 86 41 4e 20 00 04 0c 08 6f 20 ff 04" |tee -a $outf ipmiutil events -d 40 78 02 37 86 41 4e 20 00 04 0c 08 6f 20 ff 04 |tee -a $outf $TAIL2 $outf |grep DIMM >/dev/null if [ $? -ne 0 ]; then echo "DIMM event FAIL" exit 1 fi echo "# ipmiutil wdt $LANPARAMS" |tee -a $outf ipmiutil wdt $LANPARAMS 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi if [ $doserial -eq 1 ]; then # some platforms do not support IPMI serial channels echo "# ipmiutil serial $LANPARAMS" |tee -a $outf ipmiutil serial $LANPARAMS 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi fi # The model can be used to detect if the chassis has an alarm panel. echo "MODEL=$MODEL" |tee -a $outf case "$MODEL" in TIGW1U) tamok=1 ;; TIGH2U) tamok=1 ;; TIGI2U) tamok=1 ;; TIGPR2U) tamok=1 ;; TIGPT1U) tamok=1 ;; TSRLT2) tamok=1 ;; TSRMT2) tamok=1 ;; CG2100) tamok=1 ;; *) tamok=0 ;; esac # Run it anyway, the alarms command has better detection now. tamok=1 if [ $tamok -eq 1 ]; then echo "# ipmiutil alarms $LANPARAMS" |tee -a $outf ipmiutil alarms $LANPARAMS 2>&1 |tee -a $outf $TAIL $outf |grep successful >/dev/null if [ $? -ne 0 ]; then exit 1 fi fi cd $mydir ipmiutil-3.0.7/test/unittest.cmd0000644000076400007640000001170213160502144016411 0ustar acressloggers@echo off REM #!/bin/sh REM # unittest.cmd REM # Basic unit test for ipmiutil functions REM # REM # default remote node for SOL test set node=192.168.134.52 set testdir=c:\temp set LANPARAMS=-N %node% -U ADMIN -P ADMIN REM set LANPARAMS= REM # datadir=/usr/share/ipmiutil REM # sfil is used only to read from with events -p -s below REM # normally, sfil=%datadir%/sensor-out.txt set outf=%testdir%\unittest.out set sfil=%testdir%\sensor-TIGW1U.txt set sfil2=%testdir%\sensor-CG2100.txt set tmpc=%testdir%\cfg.tmp set tmpin=%testdir%\sol.in echo "# ipmiutil health %LANPARAMS%" > %outf% ipmiutil health %LANPARAMS% >> %outf% findstr /C:"health, completed successfully" %outf% echo "# ipmiutil cmd %LANPARAMS% -x 00 20 18 01 " >> %outf% ipmiutil cmd %LANPARAMS% -x 00 20 18 01 >> %outf% findstr /C:"cmd, completed successfully" %outf% echo "# ipmiutil fru %LANPARAMS%" >> %outf% ipmiutil fru %LANPARAMS% >> %outf% findstr /C:"fru, completed successfully" %outf% echo "# ipmiutil config %LANPARAMS% -s %tmpc%" >> %outf% ipmiutil config %LANPARAMS% -s %tmpc% >> %outf% findstr /C:"config, completed successfully" %outf% echo "# ipmiutil lan %LANPARAMS% " >> %outf% ipmiutil lan %LANPARAMS% >> %outf% findstr /C:"lan, completed successfully" %outf% echo "# ipmiutil sel %LANPARAMS%" >> %outf% ipmiutil sel %LANPARAMS% >> %outf% findstr /C:"sel, completed successfully" %outf% echo "# ipmiutil sel -e %LANPARAMS%" >> %outf% ipmiutil sel -e %LANPARAMS% >> %outf% findstr /C:"sel, completed successfully" %outf% echo "# ipmiutil sensor %LANPARAMS%" >> %outf% ipmiutil sensor %LANPARAMS% >> %outf% findstr /C:"sensor, completed successfully" %outf% REM # ipmiutil discover -a -b 10.243.42.255 >> %outf% echo "# ipmiutil discover -a" >> %outf% ipmiutil discover -a >> %outf% findstr /C:"responses" %outf% REM # Test getevt SEL method echo "# ipmiutil getevt -s %LANPARAMS% -t 3 " >> %outf% ipmiutil getevt -s %LANPARAMS% -t 3 >> %outf% echo "getevt -s errorlevel %errorlevel%" >> %outf% REM if errorlevel REM # if local, also test getevt MessageBuffer method echo "# ipmiutil getevt %LANPARAMS% -t 3 " >> %outf% ipmiutil getevt %LANPARAMS% -t 3 >> %outf% echo "getevt errorlevel %errorlevel%" >> %outf% REM if errorlevel REM # Use hwreset -n to send an NMI. echo "# ipmiutil reset %LANPARAMS% -n" >> %outf% ipmiutil reset %LANPARAMS% -n >> %outf% findstr /C:"reset, completed successfully" %outf% REM # Might skip SOL test if no remote server is configured for SOL. echo "# ipmiutil sol -d %LANPARAMS% " >> %outf% ipmiutil sol -d %LANPARAMS% >> %outf% echo " " >%tmpin% echo "root" >>%tmpin% echo "password" >>%tmpin% echo "ls" >>%tmpin% echo "pwd" >>%tmpin% echo "exit" >>%tmpin% echo "~." >>%tmpin% echo "# ipmiutil sol -a %LANPARAMS% -i %tmpin%" >> %outf% ipmiutil sol -a %LANPARAMS% -i %tmpin% >> %outf% findstr /C:"sol, completed successfully" %outf% echo "# ipmiutil events 18 00 02 02 00 00 00 20 00 04 09 01 6f 44 0f ff " >> %outf% ipmiutil events 18 00 02 02 00 00 00 20 00 04 09 01 6f 44 0f ff >> %outf% findstr /C:"AC Lost" %outf% echo "# ievents -p -s %sfil% B3 E8 00 0E 0C C7 1B A0 11 08 12 7F 10 90 FF FF 20 20 00 20 02 15 01 41 0F FF " >> %outf% ievents -p -s %sfil% B3 E8 00 0E 0C C7 1B A0 11 08 12 7F 10 90 FF FF 20 20 00 20 02 15 01 41 0F FF >> %outf% findstr /C:"Redundancy Lost" %outf% echo "# ipmiutil events -s %sfil2% -p B5 19 00 15 17 C6 C9 D0 00 02 B2 76 C1 16 FF FF 20 20 10 20 20 00 00 52 1D 20 00 00 00 00 00 00 00 00 00 00 00 00 C1 00 00 00 00 00 00 00 00 00 00" >> %outf% ipmiutil events -s %sfil2% -p B5 19 00 15 17 C6 C9 D0 00 02 B2 76 C1 16 FF FF 20 20 10 20 20 00 00 52 1D 20 00 00 00 00 00 00 00 00 00 00 00 00 C1 00 00 00 00 00 00 00 00 00 00 >> %outf% findstr /C:"Lo Crit thresh" %outf% echo "# ievents 40 78 02 37 86 41 4e 20 00 04 0c 08 6f 20 ff 04" >> %outf% ievents 40 78 02 37 86 41 4e 20 00 04 0c 08 6f 20 ff 04 >> %outf% findstr /C:"DIMM" %outf% echo "# ipmiutil events -d 40 78 02 37 86 41 4e 20 00 04 0c 08 6f 20 ff 04" >> %outf% ipmiutil events -d 40 78 02 37 86 41 4e 20 00 04 0c 08 6f 20 ff 04 >> %outf% findstr /C:"DIMM" %outf% echo "# ipmiutil wdt %LANPARAMS%" >> %outf% ipmiutil wdt %LANPARAMS% >> %outf% findstr /C:"wdt, completed successfully" %outf% REM # some platforms do not support IPMI serial channels echo "# ipmiutil serial %LANPARAMS%" >> %outf% ipmiutil serial %LANPARAMS% >> %outf% findstr /C:"serial, completed successfully" %outf% REM # The model can be used to detect if the chassis has an alarm panel. REM echo "MODEL=%MODEL%" >> %outf% REM # Run it anyway, the alarms command has better detection now. echo "# ipmiutil alarms %LANPARAMS%" >> %outf% ipmiutil alarms %LANPARAMS% >> %outf% findstr /C:"alarms, completed successfully" %outf% ipmiutil-3.0.7/test/panicsel_apptool_test.sh0000644000076400007640000003206313160502144020777 0ustar acressloggers#!/bin/sh linux_type="redhat" # pkg=panicsel # isel=showsel # ipef=pefconfig # iserial=tmconfig pkg=ipmiutil isel=isel ipef=ilan iserial=iserial iselout=/tmp/isel.out ipefout=/tmp/pefconfigoutput basic_test() { $isel > /dev/null 2>&1 if [ "$?" -eq 0 ];then echo "PASS_BASIC: The $isel tool can run correctly" return 0 else echo "FAIL_BASIC: The $isel tool can not run correctly" return 1 fi } showsel_ov() { $isel -v|grep version|grep -v BMC > /dev/null if [ "$?" -eq "0" ];then $isel -v|grep "Free" > /dev/null 2>&1 if [ "$?" -eq 0 ];then echo "PASS: $isel option -v testing" return 0 else echo "FAIL: $isel testing -v fail" fi else echo "FAIL: $isel testing -v fail" return 1 fi } showsel_oc() { message_original=`$isel|wc -l` $isel -c > /dev/null 2>&1 message_now=`$isel|wc -l` if [ "$message_original" -ge "$message_now" ];then echo "PASS: $isel option -c testing" return 0 else echo "FAIL: $isel option -c testing" return 1 fi } check_os() { if [ -d "/usr/src/redhat" ];then linux_type="redhat" fi if [ -d "/usr/src/hardhat" ];then linux_type="hardhat" fi } check_driver() { lsmod|grep "ipmi_comb" > /dev/null 2>&1 if [ $? -eq 0 ];then echo "The ipmi_comb driver has been inserted already" Major=`cat /proc/devices|grep imb|awk '{print $1}'` if [ ! -c /dev/imb ];then mknod /dev/imb c $Major 0 fi return 1 fi modprobe "ipmi_comb" > /dev/null 2>&1 if [ $? -eq 0 ];then echo "The ipmi_comb driver be inserted corretly" else # echo "There are no ipmi driver or ipmi driver can not be inserted correctly" return 1 fi lsmod|grep "ipmi_comb" > /dev/null 2>&1 if [ $? -eq 0 ];then Major=`cat /proc/devices|grep imb|awk '{print $1}'` if [ ! -c /dev/imb ];then mknod /dev/imb c $Major 0 fi fi } showsel_ow() { cp -f /var/log/messages /tmp/tempbackup if [ ! -d /usr/share/$pkg ];then mkdir /usr/share/$pkg fi if [ -f /usr/share/$pkg/sel.idx ];then rm -f sel.idx fi $isel -w > /dev/null 2>&1 idx=`cat /usr/share/$pkg/sel.idx |awk '{ print $2}'` diff /var/log/messages /tmp/tempbackup > /tmp/diff_log log=`cat /tmp/diff_log|grep $idx` if [ -n "$idx" -a -n "$log" ];then echo "PASS: $isel option w" else echo "FAIL: $isel option w" fi } ########################################### #test show OS critical message correctly### ########################################### showsel_os() { $isel > $iselout osnumber=`grep "OS Critical Stop" $iselout|wc -l` if [ $osnumber -eq 0 ];then echo "SKIP: $isel option s - no OS critical messages" return 1 fi $isel -s >$iselout osnumber=`grep "OS Critical Stop" $iselout|wc -l` if [ $? -eq 0 -a $osnumber -gt 0 ];then echo " PASS: $isel option s " return 0 else echo "FAIL: $isel option s" return 1 fi } showsel_test() { check_os check_driver basic_test if [ "$?" -eq 0 ];then showsel_ov showsel_oc showsel_ow showsel_os fi } ##################################################################### #test pefconfig can read PEF entry ### ##################################################################### pefconfig_basic() { if [ -f $ipefout ];then rm -rf $ipefout fi; $ipef -r > $ipefout 2>&1 pefnumber=`grep PEFilter $ipefout|wc -l` lannumber=`grep Lan $ipefout|wc -l` if [ $pefnumber -ge 12 ];then echo "PASS: $ipef basic requirement " return 0 else echo "FAIL: $ipef basic requirement" return 1 fi; if [ -f $ipefout ];then rm -rf $ipefout fi; } ##################################################################### #test pefconfig can enable or disable the new PEF 0x20 events ### ##################################################################### pefconfig_od() { ipefdout=/tmp/pefconfigoutputd if [ -f $ipefdout ];then rm $ipefdout fi $ipef -d > $ipefdout 2>&1 disable=`cat $ipefdout|grep "Access = Disabled"` if [ -n "$disable" ];then echo "PASS: pefconfig disable OS critical Event " return 0 else echo "FAIL: pefconfig disable OS critical Event " return 1 fi } ##################################################################### #test pefconfig can write new entry at different offset than 12 ### ##################################################################### ts_pefconfign() { total=`$ipef -r | grep PEFilter | wc -l` total=`echo $((total))` PASS="PASS" tmp_num=$1 num=`echo $((tmp_num))` peftmp=/tmp/ipefn if [ "$num" -le "$total" ];then $ipef -n $num |grep PEFilter|tail -n $num > ${peftmp}_$num $ipef -r |grep PEFilter|head -n $num > ${peftmp}_r$num dif=`diff ${peftmp}_$num ${peftmp}_r$num` if [ -n "$dif" ];then PASS="FAIL" fi rm -f ${peftmp}_$num rm -f ${peftmp}_r$num else succnum=`$ipef e -x -n $num |grep SetPefEntry|awk '{print $2}'|grep "successful"|wc -l` succnum=`echo $((succnum))` eqnum=`expr $num \* 2 - 1` if [ "$succnum" -eq "$eqnum" ];then lastrecord=`$ipef -n 15 |grep PEFilter|tail -n 1|awk '{print $3}'` if [ $lastrecord -ne "80" ];then PASS="FAIL" fi fi fi if [ $PASS == "$FAIL" ];then echo "FAIL: $ipef -n" $1 else echo "PASS: $ipef -n" $1 fi } ##################################################################### #test pefconfig can output more debug information ### ##################################################################### ts_pefconfigx() { ipefxout=/tmp/pefconfigoutputx if [ -f $ipefout ];then rm -rf $ipefout fi if [ -f $ipefxout ];then rm -rf $ipefxout fi $ipef -x >> $ipefxout test=`grep "PEF record" $ipefxout` if [ ! -z test ];then echo "PASS: $ipef parameter x " return 0 else echo "FAIL: $ipef parameter x" return 1 fi if [ -f $ipefxout ];then rm -rf $ipefxout fi } ############################################################## #Basic function for testing pefconfig configuration ################################################################ get_host_ip_address() { ifconfig|grep "inet addr"|grep -v "127.0.0.1"|awk '{print $2}'|cut -d: -f2 } get_host_mac_address() { ifconfig|grep eth0|awk '{print $5}' } get_route_ip_address() { netstat -rn|grep eth0|grep UG|awk '{print $2}' #cat /proc/net/arp|grep -v "HW"|awk '{print $1}' } get_route_mac_address() { routeip=`get_route_ip_address` cat /proc/net/arp|grep -v "HW"|grep $routeip|awk '{print $4}' } get_subnet_mask_address() { ifconfig|grep Mask|grep -v "127.0.0.1"|awk '{print $4}'|cut -d: -f2 } get_alert_ip_address() { cat /etc/snmp/snmpd.conf|grep trapsink|cut -f2 -d' ' } get_alert_mac_address() { routip=get_route_ip_address arping -c 1 $routeip > /dev/null 2>&1 arping -c 2 $1|grep reply|tail -1|awk '{print $5}'|cut -c2-18 } get_pef_ip_address() { cat $1|grep $2|grep -v "Param"|awk '{print $2}'|cut -d= -f2 } get_pef_mac_address() { cat $1|grep $2|grep -v "Param"|awk '{print $3}'|cut -d= -f2 } check_pef() { cat $1|grep "SetLanEntry"|grep "($2"|awk '{print $4}' } upper() { echo $1|tr 'a-z' 'A-Z' } #################################################### #Test pefconfig set host ip and mac addresses ################################################### ts_pefconfig_sethost() { rm /tmp/pefconfig_host ip=`get_host_ip_address` mac=`get_host_mac_address` ip=192.168.2.222 # $ipef -I $ip -M $mac > /tmp/pefconfig_host 2>&1 $ipef -e -I $ip > /tmp/pefconfig_host 2>&1 setip=`get_pef_ip_address /tmp/pefconfig_host eth0` setmac=`get_pef_mac_address /tmp/pefconfig_host eth0` setmac=`upper $setmac` isip=`check_pef /tmp/pefconfig_host 3` ismac=`check_pef /tmp/pefconfig_host 4` # if [ $mac == $setmac ] && [ $ismac -eq 0 ]; then if [ $ip == $setip ] && [ $isip -eq 0 ] ; then echo "PASS: $ipef Set host ip address to $ip" return 0 else echo "FAIL: $ipef Set host ip address" return 1 fi } ############################################################### ##Test pefconfig set route ip and mac addresses ############################################################### ts_pefconfig_setroute() { ip=`get_route_ip_address` count=`get_route_ip_address` mac=`get_route_mac_address` $ipef -e -G $ip -H $mac > /tmp/pefconfig_route 2>&1 setip=`get_pef_ip_address /tmp/pefconfig_route gateway` setmac=`get_pef_mac_address /tmp/pefconfig_route gateway` setmac=`upper $setmac` isip=`check_pef /tmp/pefconfig_route 12` ismac=`check_pef /tmp/pefconfig_route 13` if [ $ip == $setip ] && [ $mac == $setmac ] \ && [ $isip -eq 0 ] && [ $ismac -eq 0 ];then echo "PASS: $ipef Set route ip $ip and mac address" return 0 else echo "FAIL: $ipef Set route ip and mac address" return 1 fi } get_alert_setip_address() { cat $1|grep $2|awk '{print $3}'|cut -d= -f2 } get_alert_setmac_address() { cat $1|grep $2|awk '{print $4}'|cut -d= -f2 } ps_pefconfig_setalert() { rm -f /tmp/pefconfig_alert > /dev/null 2>&1 ip=`get_host_ip_address` mac=`get_host_mac_address` $ipef -A $ip -B $mac > /tmp/pefconfig_alert 2>&1 setip=`get_alert_setip_address /tmp/pefconfig_alert alert` setmac=`get_alert_setmac_address /tmp/pefconfig_alert alert` setmac=`upper $setmac` isip=`check_pef /tmp/pefconfig_alert 18` ismac=`check_pef /tmp/pefconfig_alert 19` if [ $ip == $setip ] && [ $mac == $setmac ] \ && [ $isip -eq 0 ] && [ $ismac -eq 0 ];then echo "PASS: $ipef Set alert" return 0 else echo "FAIL: $ipef Set Alert" return 1 fi } ########################################################### #Test pefconfig set community ########################################################### ts_pefconfig_setcommunity() { rm -f /tmp/pefconfig_comm $ipef -A 127.0.0.1 -C private > /tmp/pefconfig_comm 2>&1 pef_comm=`cat /tmp/pefconfig_comm|grep Community|awk '{print $5}'` if [ $pef_comm == "private" ];then echo "PASS: $ipef set community" return 0 else echo "FAIL: $ipef set community" return 1 fi } get_pef_subnet() { a=`cat $1|grep Subnet|awk '{print $5}'` b=`cat $1|grep Subnet|awk '{print $6}'` c=`cat $1|grep Subnet|awk '{print $7}'` d=`cat $1|grep Subnet|awk '{print $8}'` echo $a.$b.$c.$d } ############################################################## #Test pefconfig set subnet mask ############################################################### ts_pefconfig_setsubnet() { subnet=`get_subnet_mask_address`; $ipef -S $subnet > /tmp/pefconfig_subnet 2>&1 pef_subnet=`get_pef_subnet /tmp/pefconfig_subnet` if [ $subnet == $pef_subnet ];then echo "PASS: $ipef get sub net mask address" return 0 else echo "FAIL: $ipef get sub net mask address" return 1 fi } pefconfig_test() { pefconfig_basic if [ "$?" -eq 0 ];then ts_pefconfign 9 ts_pefconfign 12 ts_pefconfign 16 ts_pefconfigx ts_pefconfig_sethost ts_pefconfig_setroute ts_pefconfig_setsubnet else echo "System does not support pefconfig function" fi } #*****************************************************/ #Test the tmconfig util******************************/ #*****************************************************/ EntryTest() { which $iserial > /dev/null 2>&1 if [ $? -ne 0 ];then if [ -f /usr/share/$pkg/$iserial ];then cp -f /usr/share/$pkg/$iserial /usr/sbin else echo "$iserial: there is no $iserial util" exit 1 fi fi } TestPara() { result=`cat $1|grep $2|awk '{print $4}'|cut -d , -f 1` if [ "x$result" = "x" ]; then echo "FAIL: $iserial $2, no result" return 1 fi if [ $result -eq 0 ];then echo "PASS: $iserial $2" return 0 else echo "FAIL: $iserial $2" return 1 fi } ts_tmconfigr() { infoline="$iserial Test parameter r" EntryTest $iserial -r > /dev/null 2>&1 if [ $? -eq 0 ];then echo "PASS: $infoline" return 0 else echo "FAIL: $infoline" return 1 fi } ts_tmconfigs() { infoline="$iserial Test parameter n" EntryTest $iserial -s > /tmp/tmconfigs 2>&1 TestPara /tmp/tmconfigs "SetChanAcc(ser)" $infoline } ts_tmconfigup() { infoline="$iserial Test parameter u and p" EntryTest $iserial -u root -p password >/dev/null 2>&1 if [ $? -eq 0 ];then echo PASS: $infoline else echo FAIL: $infoline fi } LanTest() { infoline="$iserial Test parameter l" $iserial -l > /tmp/tmconfigl line=`cat /tmp/tmconfigl|grep "Lan Param"|wc -l` if [ $line -ge 22 ];then echo "PASS: $infoline" else echo "FAIL: $infoline" fi } ts_tmconfigl() { EntryTest LanTest } ts_tmconfign() { infoline="$iserial Test parameter m0" EntryTest $iserial -m0 >/tmp/tmconfign 2>&1 TestPara /tmp/tmconfign "SetSerialMux(System)" $infoline } ts_tmconfigt() { infoline="$iserial Test parameter m1" EntryTest $iserial -m1 >/tmp/tmconfigt 2>&1 TestPara /tmp/tmconfigt "SetSerialMux(BMC)" $infoline } tmconfig_test() { ts_tmconfigr if [ $? -eq 0 ];then ts_tmconfigs ts_tmconfigl ts_tmconfign ts_tmconfigup ts_tmconfigt else echo "FAIL:Basic tmconfig testing" fi } showsel_test pefconfig_test tmconfig_test ipmiutil-3.0.7/test/Makefile-240000644000076400007640000000305013160502144015725 0ustar acressloggers# # Makefile for building the dopanic module on Linux 2.4 # MOD=dopanic MOD_CONF= $(MOD:%=%.conf) RHVER=RH7.1 KVER=2.6.0 KTAG= KSRC=/usr/src/linux # Note: /usr/src/linux should point to /usr/src/linux-$(KVER)$(KTAG). # The KVER is only used here for "make install". CC=gcc #Use the cflags that shows all warnings or the one that doesn't. #CFLAGS = -O2 -Wall -DLINUX_DEBUG CFLAGS = -O2 #Note: Use the following to build a driver with no versioning. #K_CFLAGS = -D__KERNEL__ -DMODULE -D__SMP__ -DCONFIG_X86_LOCAL_APIC -D__NO_VERSION__ # #The K_CFLAGS is used to build on all RedHat systems. #ADDK_CFLAGS is used only when building on pre RedHat 7.0 systems. # K_CFLAGS = -D__KERNEL__ -DMODULE -D__SMP__ -DCONFIG_X86_LOCAL_APIC -DMODULES ADDK_CFLAGS = -DMODVERSIONS -include /usr/include/linux/modversions.h CPPFLAGS = -I. -DLINUX -I/usr/src/linux/include K_VERSION:=$(shell uname -r | cut -c1-3 | sed 's/2\.[56]/2\.6/') ifeq ($(K_VERSION), 2.6) TARGET = dopanic.ko # CFILES = dopanic.c # dopanic-objs := $(CFILES:.c=.o) obj-m += dopanic.o make -C $(KSRC) V=1 SUBDIRS=$(shell pwd) modules endif #List all the relevant files here OBJS = dopanic.o all: $(MOD) $(MOD): $(OBJS) $(LD) -r -o $(MOD) $(OBJS) %.o: %.c if [ "$(RHVER)" = "PRE-7.0" ]; \ then \ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(K_CFLAGS) $(ADDK_CFLAGS) -o $@ $< ; \ else \ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(K_CFLAGS) -o $@ $< ; \ fi install: $(MOD) cp $(MOD) /lib/modules/$(KVER)$(KTAG)/kernel/arch/i386/kernel clean: rm -f $(OBJS) $(MOD) clobber: rm -f $(OBJS) $(MOD) ipmiutil-3.0.7/ltconfig0000755000076400007640000027666013160502144014641 0ustar acressloggers#! /bin/sh # ltconfig - Create a system-specific libtool. # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A lot of this script is taken from autoconf-2.10. # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} echo=echo if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell. exec "$SHELL" "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null`} case X$UNAME in *-DOS) PATH_SEPARATOR=';' ;; *) PATH_SEPARATOR=':' ;; esac fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then break fi done fi if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH /usr/ucb; do if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$dir/echo" break fi done IFS="$save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running ltconfig again with it. ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf "%s\n"' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then # Cool, printf works : elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # The name of this program. progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` # Constants: PROGRAM=ltconfig PACKAGE=libtool VERSION=1.3.5 TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' rm="rm -f" help="Try \`$progname --help' for more information." # Global variables: default_ofile=libtool can_build_shared=yes enable_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). enable_static=yes enable_fast_install=yes enable_dlopen=unknown enable_win32_dll=no ltmain= silent= srcdir= ac_config_guess= ac_config_sub= host= nonopt= ofile="$default_ofile" verify_host=yes with_gcc=no with_gnu_ld=no need_locks=yes ac_ext=c objext=o libext=a exeext= cache_file= old_AR="$AR" old_CC="$CC" old_CFLAGS="$CFLAGS" old_CPPFLAGS="$CPPFLAGS" old_LDFLAGS="$LDFLAGS" old_LD="$LD" old_LN_S="$LN_S" old_LIBS="$LIBS" old_NM="$NM" old_RANLIB="$RANLIB" old_DLLTOOL="$DLLTOOL" old_OBJDUMP="$OBJDUMP" old_AS="$AS" # Parse the command line options. args= prev= for option do case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then eval "$prev=\$option" prev= continue fi case "$option" in --help) cat <&2 echo "$help" 1>&2 exit 1 ;; *) if test -z "$ltmain"; then ltmain="$option" elif test -z "$host"; then # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then # echo "$progname: warning \`$option' is not a valid host type" 1>&2 # fi host="$option" else echo "$progname: too many arguments" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac done if test -z "$ltmain"; then echo "$progname: you must specify a LTMAIN file" 1>&2 echo "$help" 1>&2 exit 1 fi if test ! -f "$ltmain"; then echo "$progname: \`$ltmain' does not exist" 1>&2 echo "$help" 1>&2 exit 1 fi # Quote any args containing shell metacharacters. ltconfig_args= for arg do case "$arg" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ltconfig_args="$ltconfig_args '$arg'" ;; *) ltconfig_args="$ltconfig_args $arg" ;; esac done # A relevant subset of AC_INIT. # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 5 compiler messages saved in config.log # 6 checking for... messages and results if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>>./config.log # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi if test -n "$cache_file" && test -r "$cache_file"; then echo "loading cache $cache_file within ltconfig" . $cache_file fi if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi if test -z "$srcdir"; then # Assume the source directory is the same one as the path to LTMAIN. srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` test "$srcdir" = "$ltmain" && srcdir=. fi trap "$rm conftest*; exit 1" 1 2 15 if test "$verify_host" = yes; then # Check for config.guess and config.sub. ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/config.guess; then ac_aux_dir=$ac_dir break fi done if test -z "$ac_aux_dir"; then echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 echo "$help" 1>&2 exit 1 fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub # Make sure we can run config.sub. if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : else echo "$progname: cannot run $ac_config_sub" 1>&2 echo "$help" 1>&2 exit 1 fi echo $ac_n "checking host system type""... $ac_c" 1>&6 host_alias=$host case "$host_alias" in "") if host_alias=`$SHELL $ac_config_guess`; then : else echo "$progname: cannot guess host type; you must specify one" 1>&2 echo "$help" 1>&2 exit 1 fi ;; esac host=`$SHELL $ac_config_sub $host_alias` echo "$ac_t$host" 1>&6 # Make sure the host verified. test -z "$host" && exit 1 elif test -z "$host"; then echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 echo "$help" 1>&2 exit 1 else host_alias=$host fi # Transform linux* to *-*-linux-gnu*, to support old configure scripts. case "$host_os" in linux-gnu*) ;; linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` case "$host_os" in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Determine commands to create old-style static archives. old_archive_cmds='$AR cru $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= # Set a sane default for `AR'. test -z "$AR" && AR=ar # Set a sane default for `OBJDUMP'. test -z "$OBJDUMP" && OBJDUMP=objdump # If RANLIB is not set, then run the test. if test "${RANLIB+set}" != "set"; then result=no echo $ac_n "checking for ranlib... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then RANLIB="ranlib" result="ranlib" break fi done IFS="$save_ifs" echo "$ac_t$result" 1>&6 fi if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" fi # Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$AS" && AS=as # Check to see if we are using GCC. if test "$with_gcc" != yes || test -z "$CC"; then # If CC is not set, then try to find GCC or a usable CC. if test -z "$CC"; then echo $ac_n "checking for gcc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then CC="gcc" break fi done IFS="$save_ifs" if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi fi # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". if test -z "$CC"; then echo $ac_n "checking for cc... $ac_c" 1>&6 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" cc_rejected=no for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/cc || test -f $dir/cc$ac_exeext; then if test "$dir/cc" = "/usr/ucb/cc"; then cc_rejected=yes continue fi CC="cc" break fi done IFS="$save_ifs" if test $cc_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $CC shift if test $# -gt 0; then # We chose a different compiler from the bogus one. # However, it has the same name, so the bogon will be chosen # first if we set CC to just the name; use the full file name. shift set dummy "$dir/cc" "$@" shift CC="$@" fi fi if test -n "$CC"; then echo "$ac_t$CC" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$CC"; then echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 exit 1 fi fi # Now see if the compiler is really GCC. with_gcc=no echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 echo "$progname:581: checking whether we are using GNU C" >&5 $rm conftest.c cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then with_gcc=yes fi $rm conftest.c echo "$ac_t$with_gcc" 1>&6 fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for object suffix... $ac_c" 1>&6 $rm conftest* echo 'int i = 1;' > conftest.c echo "$progname:603: checking for object suffix" >& 5 if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c) ;; *) objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* echo "$ac_t$objext" 1>&6 echo $ac_n "checking for executable suffix... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_exeext="no" $rm conftest* echo 'main () { return 0; }' > conftest.c echo "$progname:629: checking for executable suffix" >& 5 if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then # Append any warnings to the config.log. cat conftest.err 1>&5 for ac_file in conftest.*; do case $ac_file in *.c | *.err | *.$objext ) ;; *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; esac done else cat conftest.err 1>&5 echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* fi if test "X$ac_cv_exeext" = Xno; then exeext="" else exeext="$ac_cv_exeext" fi echo "$ac_t$ac_cv_exeext" 1>&6 echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 pic_flag= special_shlib_compile_flags= wl= link_static_flag= no_builtin_flag= if test "$with_gcc" = yes; then wl='-Wl,' link_static_flag='-static' case "$host_os" in beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; aix*) # Below there is a dirty hack to force normal static linking with -ldl # The problem is because libdl dynamically linked with both libc and # libC (AIX C++ library), which obviously doesn't included in libraries # list by gcc. This cause undefined symbols with -static flags. # This hack allows C programs to be linked with "-static -ldl", but # we not sure about C++ programs. link_static_flag="$link_static_flag ${wl}-lC" ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. pic_flag='-m68020 -resident32 -malways-restore-a4' ;; sysv4*MP*) if test -d /usr/nec; then pic_flag=-Kconform_pic fi ;; *) pic_flag='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case "$host_os" in aix3* | aix4*) # All AIX code is PIC. link_static_flag='-bnso -bI:/lib/syscalls.exp' ;; hpux9* | hpux10* | hpux11*) # Is there a better link_static_flag that works with the bundled CC? wl='-Wl,' link_static_flag="${wl}-a ${wl}archive" pic_flag='+Z' ;; irix5* | irix6*) wl='-Wl,' link_static_flag='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | os2*) # We can build DLLs from non-PIC. ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. wl='-Wl,' link_static_flag='-non_shared' ;; sco3.2v5*) pic_flag='-Kpic' link_static_flag='-dn' special_shlib_compile_flags='-belf' ;; solaris*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; sunos4*) pic_flag='-PIC' link_static_flag='-Bstatic' wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) pic_flag='-KPIC' link_static_flag='-Bstatic' wl='-Wl,' ;; uts4*) pic_flag='-pic' link_static_flag='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then pic_flag='-Kconform_pic' link_static_flag='-Bstatic' fi ;; *) can_build_shared=no ;; esac fi if test -n "$pic_flag"; then echo "$ac_t$pic_flag" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $pic_flag -DPIC" echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then # Append any warnings to the config.log. cat conftest.err 1>&5 case "$host_os" in hpux9* | hpux10* | hpux11*) # On HP-UX, both CC and GCC only warn that PIC is supported... then they # create non-PIC objects. So, if there were any warnings, we assume that # PIC is not supported. if test -s conftest.err; then echo "$ac_t"no 1>&6 can_build_shared=no pic_flag= else echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" fi ;; *) echo "$ac_t"yes 1>&6 pic_flag=" $pic_flag" ;; esac else # Append any errors to the config.log. cat conftest.err 1>&5 can_build_shared=no pic_flag= echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else echo "$ac_t"none 1>&6 fi # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 $rm -r conftest 2>/dev/null mkdir conftest cd conftest $rm conftest* echo "int some_variable = 0;" > conftest.c mkdir out # According to Tom Tromey, Ian Lance Taylor reported there are C compilers # that will create temporary files in the current directory regardless of # the output directory. Thus, making CWD read-only will cause this test # to fail, enabling locking or at least warning the user not to do parallel # builds. chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.o" echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then echo "$ac_t"no 1>&6 compiler_c_o=no else echo "$ac_t"yes 1>&6 compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 compiler_c_o=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_o_lo=no else echo "$ac_t"yes 1>&6 compiler_o_lo=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_o_lo=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* else compiler_o_lo=no fi # Check to see if we can do hard links to lock some files if needed hard_links="nottested" if test "$compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$ac_t$hard_links" 1>&6 $rm conftest* if test "$hard_links" = no; then echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 need_locks=warn fi else need_locks=no fi if test "$with_gcc" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 $rm conftest* echo "int some_variable = 0;" > conftest.c save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then echo "$ac_t"no 1>&6 compiler_rtti_exceptions=no else echo "$ac_t"yes 1>&6 compiler_rtti_exceptions=yes fi else # Append any errors to the config.log. cat conftest.err 1>&5 compiler_rtti_exceptions=no echo "$ac_t"no 1>&6 fi CFLAGS="$save_CFLAGS" $rm conftest* if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # Check for any special shared library compilation flags. if test -n "$special_shlib_compile_flags"; then echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : else echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 $rm conftest* echo 'main(){return(0);}' > conftest.c save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $link_static_flag" echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then echo "$ac_t$link_static_flag" 1>&6 else echo "$ac_t"none 1>&6 link_static_flag= fi LDFLAGS="$save_LDFLAGS" $rm conftest* if test -z "$LN_S"; then # Check to see if we can use ln -s, or we need hard links. echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 $rm conftest.dat if ln -s X conftest.dat 2>/dev/null; then $rm conftest.dat LN_S="ln -s" else LN_S=ln fi if test "$LN_S" = "ln -s"; then echo "$ac_t"yes 1>&6 else echo "$ac_t"no 1>&6 fi fi # Make sure LD is an absolute path. if test -z "$LD"; then ac_prog=ld if test "$with_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 echo "$progname:991: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we are not using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld... $ac_c" 1>&6 echo "$progname:1015: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "$progname:1018: checking for non-GNU ld" >&5 fi if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break fi fi done IFS="$ac_save_ifs" fi if test -n "$LD"; then echo "$ac_t$LD" 1>&6 else echo "$ac_t"no 1>&6 fi if test -z "$LD"; then echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 exit 1 fi fi # Check to see if it really is or is not GNU ld. echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then with_gnu_ld=yes else with_gnu_ld=no fi echo "$ac_t$with_gnu_ld" 1>&6 # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 allow_undefined_flag= no_undefined_flag= need_lib_prefix=unknown need_version=unknown # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments archive_cmds= archive_expsym_cmds= old_archive_from_new_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an egrep regular expression of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. case "$host_os" in cygwin* | mingw*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$with_gcc" != yes; then with_gnu_ld=no fi ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # See if GNU ld supports shared libraries. case "$host_os" in aix3* | aix4*) # On AIX, the GNU linker is very broken ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=yes # Extract the symbol export list from an `--export-all' def file, # then regenerate the def file from the symbol export list, so that # the compiled dll only exports the symbol export list. # Be careful not to strip the DATA tag left by newer dlltools. export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \$# in 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done~ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' # can we support soname and/or expsyms with a.out? -oliva fi ;; solaris* | sysv5*) if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' case $host_os in cygwin* | mingw*) # dlltool doesn't understand --whole-archive et. al. whole_archive_flag_spec= ;; *) # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi ;; esac fi else # PORTME fill in a description of your system's linker (not GNU ld) case "$host_os" in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$with_gcc" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4*) hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' hardcode_libdir_separator=':' if test "$with_gcc" = yes; then collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi shared_flag='-shared' else shared_flag='${wl}-bM:SRE' hardcode_direct=yes fi allow_undefined_flag=' ${wl}-berok' archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' case "$host_os" in aix4.[01]|aix4.[01].*) # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on always_export_symbols=yes ;; esac ;; amigaos*) archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; cygwin* | mingw*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs' fix_srcfile_path='`cygpath -w $srcfile`' ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case "$host_os" in hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; esac hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_minus_L=yes # Not in the search PATH, but as the default # location of the library. export_dynamic_flag_spec='${wl}-E' ;; irix5* | irix6*) if test "$with_gcc" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF fi hardcode_libdir_flag_spec='${wl}-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; openbsd*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' ;; osf3*) if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # As osf3* with the addition of the -msym flag if test "$with_gcc" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; rhapsody*) archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flags_spec='-L$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case "$host_os" in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; unixware7*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$ac_t$ld_shlibs" 1>&6 test "$ld_shlibs" = no && can_build_shared=no if test -z "$NM"; then echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 case "$NM" in [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -B" break elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then NM="$ac_dir/nm -p" break else NM=${NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" test -z "$NM" && NM=nm ;; esac echo "$ac_t$NM" 1>&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform the above into a raw symbol and a C symbol. symxfrm='\1 \2\3 \3' # Transform an extracted symbol line into a proper C declaration global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Define system-specific variables. case "$host_os" in aix*) symcode='[BCDT]' ;; cygwin* | mingw*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then symcode='[ABCDGISTW]' fi # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Write the raw and C identifiers. global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no $rm conftest* cat > conftest.c <&5 if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then # Now try to grab the symbols. nlist=conftest.nm if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$nlist" >/dev/null; then if egrep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.c #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' cat <> conftest.c #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c cat <<\EOF >> conftest.c {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$objext conftstm.$objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi LIBS="$save_LIBS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.c >&5 fi $rm conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else global_symbol_pipe= fi done if test "$pipe_works" = yes; then echo "${ac_t}ok" 1>&6 else echo "${ac_t}failed" 1>&6 fi if test -z "$global_symbol_pipe"; then global_symbol_to_cdecl= fi # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var"; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$hardcode_shlibpath_var" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$ac_t$hardcode_action" 1>&6 reload_flag= reload_cmds='$LD$reload_flag -o $output$reload_objs' echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 # PORTME Some linkers may need a different reload flag. reload_flag='-r' echo "$ac_t$reload_flag" 1>&6 test -n "$reload_flag" && reload_flag=" $reload_flag" # PORTME Fill in your ld.so characteristics library_names_spec= libname_spec='lib$name' soname_spec= postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" file_magic_cmd= file_magic_test_file= deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [regex]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given egrep regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 case "$host_os" in aix3*) version_type=linux library_names_spec='${libname}${release}.so$versuffix $libname.a' shlibpath_var=LIBPATH # AIX has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}.so$major' ;; aix4*) version_type=linux # AIX has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. # We preserve .a as extension for shared libraries though AIX4.2 # and later linker supports .so library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' shlibpath_var=LIBPATH deplibs_check_method=pass_all ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' ;; beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH deplibs_check_method=pass_all lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; bsdi4*) version_type=linux need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw*) version_type=windows need_version=no need_lib_prefix=no if test "$with_gcc" = yes; then library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' else library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' fi dynamic_linker='Win32 ld.exe' deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' file_magic_cmd='${OBJDUMP} -f' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; freebsd1*) dynamic_linker=no ;; freebsd*) objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case "$version_type" in freebsd-elf*) deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) deplibs_check_method=unknown library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case "$host_os" in freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' soname_spec='${libname}${release}.sl$major' # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' case "$host_os" in hpux10.20*) # TODO: Does this work for hpux-11 too? deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6*) version_type=irix need_lib_prefix=no need_version=no soname_spec='${libname}${release}.so.$major' library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' case "$host_os" in irix5*) libsuff= shlibsuff= # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case "$LD" in # libtool.m4 will add one of these switches to LD *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /lib${libsuff}/libc.so*` deplibs_check_method='pass_all' ;; # No shared lib support for Linux oldld, aout, or coff. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) dynamic_linker=no ;; # This must be Linux ELF. linux-gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no deplibs_check_method=pass_all if test -f /lib/ld.so.1; then dynamic_linker='GNU ld.so' else # Only the GNU ld.so supports shared libraries on MkLinux. case "$host_cpu" in powerpc*) dynamic_linker=no ;; *) dynamic_linker='Linux ld.so' ;; esac fi ;; netbsd*) version_type=sunos if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH ;; openbsd*) version_type=sunos if test "$with_gnu_ld" = yes; then need_lib_prefix=no need_version=no fi library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' need_lib_prefix=no library_names_spec='$libname.dll $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_version=no soname_spec='${libname}${release}.so' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' shlibpath_var=LD_LIBRARY_PATH # this will be overridden with pass_all, but let us keep it just in case deplibs_check_method='file_magic COFF format alpha shared library' file_magic_cmd=/usr/bin/file file_magic_test_file=/shlib/libc.so deplibs_check_method='pass_all' sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rhapsody*) version_type=sunos library_names_spec='${libname}.so' soname_spec='${libname}.so' shlibpath_var=DYLD_LIBRARY_PATH deplibs_check_method=pass_all ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}.so$major' library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" file_magic_cmd=/usr/bin/file file_magic_test_file=/lib/libc.so ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH case "$host_vendor" in sequent) file_magic_cmd='/bin/file' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; ncr) deplibs_check_method='pass_all' ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' file_magic_cmd=/usr/bin/file file_magic_test_file=`echo /usr/lib/libc.so*` ;; esac ;; uts4*) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' soname_spec='${libname}${release}.so$major' shlibpath_var=LD_LIBRARY_PATH ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' soname_spec='$libname.so.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; *) dynamic_linker=no ;; esac echo "$ac_t$dynamic_linker" 1>&6 test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 # Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in # configure.in, otherwise build static only libraries. case "$host_os" in cygwin* | mingw* | os2*) if test x$can_build_shared = xyes; then test x$enable_win32_dll = xno && can_build_shared=no echo "checking if package supports dlls... $can_build_shared" 1>&6 fi ;; esac if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | egrep "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4*) test "$enable_shared" = yes && enable_static=no ;; esac echo "$ac_t$enable_shared" 1>&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "checking whether to build static libraries... $enable_static" 1>&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi echo $ac_n "checking for objdir... $ac_c" 1>&6 rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. objdir=_libs fi rmdir .libs 2>/dev/null echo "$ac_t$objdir" 1>&6 if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then lt_cv_dlopen=no lt_cv_dlopen_libs= echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 echo "$progname:2248: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo "$progname:2288: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else dlopen(); #endif ; return 0; } EOF if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_dlopen=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dlopen" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 echo "$progname:2335: checking for dld_link in -ldld" >&5 ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo "$progname:2375: checking for shl_load" >&5 if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else shl_load(); #endif ; return 0; } EOF if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shl_load=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_shl_load=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 echo "$progname:2423: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else echo "$ac_t""no" 1>&6 fi fi fi fi fi fi if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes fi case "$lt_cv_dlopen" in dlopen) for ac_hdr in dlfcn.h; do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "$progname:2488: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int fnord = 0; EOF ac_try="$ac_compile >/dev/null 2>conftest.out" { (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi done if test "x$ac_cv_header_dlfcn_h" = xyes; then CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" fi eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2526: checking whether a program can dlopen itself" >&5 if test "${lt_cv_dlopen_self+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "$lt_cv_dlopen_self" = yes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then lt_cv_dlopen_self_static=cross else cat > conftest.c < #endif #include #ifdef RTLD_GLOBAL # define LTDL_GLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LTDL_GLOBAL DL_GLOBAL # else # define LTDL_GLOBAL 0 # endif #endif /* We may have to define LTDL_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LTDL_LAZY_OR_NOW # ifdef RTLD_LAZY # define LTDL_LAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LTDL_LAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LTDL_LAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LTDL_LAZY_OR_NOW DL_NOW # else # define LTDL_LAZY_OR_NOW 0 # endif # endif # endif # endif #endif fnord() { int i=42;} main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } EOF if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then lt_cv_dlopen_self_static=yes else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* lt_cv_dlopen_self_static=no fi rm -fr conftest* fi fi echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 fi ;; esac case "$lt_cv_dlopen_self" in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case "$lt_cv_dlopen_self_static" in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Copy echo and quote the copy, instead of the original, because it is # used later. ltecho="$echo" if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then ltecho="$CONFIG_SHELL \$0 --fallback-echo" fi LTSHELL="$SHELL" LTCONFIG_VERSION="$VERSION" # Only quote variables if we're using ltmain.sh. case "$ltmain" in *.sh) # Now quote all the things that may contain metacharacters. for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ reload_flag reload_cmds wl \ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ thread_safe_flag_spec whole_archive_flag_spec libname_spec \ library_names_spec soname_spec \ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ hardcode_libdir_flag_spec hardcode_libdir_separator \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do case "$var" in reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case "$ltecho" in *'\$0 --fallback-echo"') ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac trap "$rm \"$ofile\"; exit 1" 1 2 15 echo "creating $ofile" $rm "$ofile" cat < "$ofile" #! $SHELL # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. # # Copyright (C) 1996-1999 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="sed -e s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi ### BEGIN LIBTOOL CONFIG EOF cfgfile="$ofile" ;; *) # Double-quote the variables that need it (for aesthetics). for var in old_CC old_CFLAGS old_CPPFLAGS \ old_LD old_LDFLAGS old_LIBS \ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do eval "$var=\\\"\$var\\\"" done # Just create a config file. cfgfile="$ofile.cfg" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 echo "creating $cfgfile" $rm "$cfgfile" cat < "$cfgfile" # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) EOF ;; esac cat <> "$cfgfile" # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ # LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ # NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ # DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ # $0$ltconfig_args # # Compiler and other test output produced by $progname, useful for # debugging $progname, is in ./config.log if it exists. # The version of $progname that generated this script. LTCONFIG_VERSION=$LTCONFIG_VERSION # Shell to use when invoking shell scripts. SHELL=$LTSHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host # An echo program that does not interpret backslashes. echo=$ltecho # The archiver. AR=$AR # The default C compiler. CC=$CC # The linker used to build libraries. LD=$LD # Whether we need hard or soft links. LN_S=$LN_S # A BSD-compatible nm program. NM=$NM # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$reload_flag reload_cmds=$reload_cmds # How to pass a linker flag through the compiler. wl=$wl # Object file suffix (normally "o"). objext="$objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$pic_flag # Does compiler simultaneously support -c and -o options? compiler_c_o=$compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$compiler_o_lo # Must we lock files when doing compilation ? need_locks=$need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$library_names_spec # The coded name of the library, if different from the real name. soname_spec=$soname_spec # Commands used to build and install an old-style archive. RANLIB=$RANLIB old_archive_cmds=$old_archive_cmds old_postinstall_cmds=$old_postinstall_cmds old_postuninstall_cmds=$old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$old_archive_from_new_cmds # Commands used to build and install a shared archive. archive_cmds=$archive_cmds archive_expsym_cmds=$archive_expsym_cmds postinstall_cmds=$postinstall_cmds postuninstall_cmds=$postuninstall_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$global_symbol_to_cdecl # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$hardcode_libdir_separator # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Compile-time system search path for libraries sys_lib_search_path_spec=$sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$exclude_expsyms # Symbols that must always be exported. include_expsyms=$include_expsyms EOF case "$ltmain" in *.sh) echo '### END LIBTOOL CONFIG' >> "$ofile" echo >> "$ofile" case "$host_os" in aix3*) cat <<\EOF >> "$ofile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # Append the ltmain.sh script. sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? chmod +x "$ofile" ;; *) # Compile the libtool program. echo "FIXME: would compile $ltmain" ;; esac test -n "$cache_file" || exit 0 # AC_CACHE_SAVE trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: ipmiutil-3.0.7/kern/0000755000076400007640000000000013160502163014025 5ustar acressloggersipmiutil-3.0.7/kern/bmcpanic-2.5.62.patch0000644000076400007640000005473713160502144017371 0ustar acressloggersdiff -Naru linux-2.5.62/arch/i386/kernel/reboot.c linux-2.5.62p/arch/i386/kernel/reboot.c --- linux-2.5.62/arch/i386/kernel/reboot.c 2003-03-07 16:33:50.000000000 +0800 +++ linux-2.5.62p/arch/i386/kernel/reboot.c 2003-03-06 22:27:16.000000000 +0800 @@ -221,6 +221,10 @@ : "i" ((void *) (0x1000 - sizeof (real_mode_switch) - 100))); } +#ifdef CONFIG_IPMI_PANIC_ACTION +extern void ipmi_reset(int mode); +#endif + void machine_restart(char * __unused) { #if CONFIG_SMP @@ -277,6 +281,9 @@ } } +#ifdef CONFIG_IPMI_PANIC_ACTION + ipmi_reset(1); +#endif machine_real_restart(jump_to_bios, sizeof(jump_to_bios)); } @@ -288,5 +295,8 @@ { if (pm_power_off) pm_power_off(); +#ifdef CONFIG_IPMI_PANIC_ACTION + ipmi_reset(0); +#endif } diff -Naru linux-2.5.62/drivers/char/ipmi/ipmi_msghandler.c linux-2.5.62p/drivers/char/ipmi/ipmi_msghandler.c --- linux-2.5.62/drivers/char/ipmi/ipmi_msghandler.c 2003-03-07 16:34:18.000000000 +0800 +++ linux-2.5.62p/drivers/char/ipmi/ipmi_msghandler.c 2003-03-06 22:27:16.000000000 +0800 @@ -45,6 +45,14 @@ #include #include +#ifdef CONFIG_IPMI_PANIC_ACTION +#define uchar unsigned char +extern int ipmi_panic_init(void); +extern int ipmi_send_recv(uchar cmd, uchar netfn, uchar lun, + uchar *sbuf, int slen, uchar *rbuf, int rlen, + int *nret, uchar *cc); +#endif + struct ipmi_recv_msg *ipmi_alloc_recv_msg(void); static int ipmi_init_msghandler(void); @@ -345,7 +353,7 @@ unsigned int i; for (i=intf->curr_seq; - i!=(intf->curr_seq-1); + (i+1)%IPMI_IPMB_NUM_SEQ != intf->curr_seq; i=(i+1)%IPMI_IPMB_NUM_SEQ) { if (! intf->seq_table[i].inuse) @@ -437,6 +445,7 @@ return rv; } +static int fIPMIok = 0; /* true if an IPMI interface is valid */ int ipmi_create_user(unsigned int if_num, struct ipmi_user_hndl *handler, @@ -480,6 +489,7 @@ goto out_unlock; } + fIPMIok = 1; /* at least one IPMI interface is valid */ new_user->handler = handler; new_user->handler_data = handler_data; new_user->intf = ipmi_interfaces[if_num]; @@ -906,8 +916,6 @@ probably, so abort. */ spin_unlock_irqrestore(&(intf->seq_lock), flags); - ipmi_free_recv_msg(recv_msg); - ipmi_free_smi_msg(smi_msg); goto out_err; } @@ -1794,8 +1802,13 @@ return rv; } +extern void machine_restart(char * __unused); +extern void machine_power_off(void); +extern char *panic_string; + #ifdef CONFIG_IPMI_PANIC_EVENT +#ifndef CONFIG_IPMI_PANIC_ACTION static void dummy_smi_done_handler(struct ipmi_smi_msg *msg) { } @@ -1828,12 +1841,9 @@ data[4] = 0x6f; /* Sensor specific, IPMI table 36-1 */ data[5] = 0xa1; /* Runtime stop OEM bytes 2 & 3. */ - /* These used to have the first three bytes of the panic string, - but not only is that not terribly useful, it's not available - any more. */ - data[3] = 0; - data[6] = 0; - data[7] = 0; + data[3] = panic_string[0]; + data[6] = panic_string[1]; + data[7] = panic_string[2]; smi_msg.done = dummy_smi_done_handler; recv_msg.done = dummy_recv_done_handler; @@ -1857,6 +1867,30 @@ intf->my_lun); } } +#endif + +void ipmi_reset(int mode) +{ +#ifdef CONFIG_IPMI_PANIC_ACTION + unsigned char imode; + unsigned char cc; + int rc, i; + + /* Input mode param: 0 = soft reset, 1 = power down, 2 = power cycle */ + if (!fIPMIok || mode == 0 || mode > 3) { + machine_restart(NULL); /* normal Linux reset (arch/i386/) */ + return; + } + /* + * IPMI Chassis Reset modes: + * 0 = power down, 1 = power up, 2 = power cycle, 3 = hard reset + */ + if (mode == 1) imode = 0; + else imode = mode; + rc = ipmi_send_recv(0x02,0x00,0,&imode,1,NULL,0,&i,&cc); +#endif + return; +} #endif /* CONFIG_IPMI_PANIC_EVENT */ static int has_paniced = 0; @@ -1875,14 +1909,55 @@ /* For every registered interface, set it to run to completion. */ for (i=0; ihandlers->set_run_to_completion(intf->send_info, 1); } #ifdef CONFIG_IPMI_PANIC_EVENT - send_panic_events(); + if (fIPMIok) { +#ifdef CONFIG_IPMI_PANIC_ACTION + unsigned char alarms, cc; + unsigned char obuf[16]; + unsigned char ibuf[16]; + int olen, rc; + + /* Get Alarm LED values */ + obuf[0] = 0x03; // PRIVATE_BUS_ID; + obuf[1] = 0x41; // ALARMS_PANEL_READ; + obuf[2] = 1; // one byte of alarms data + obuf[3] = 0; // initial alarms value + olen = 3; + rc = ipmi_send_recv(0x52,0x06,0,obuf,olen,ibuf,4,&i,&cc); + alarms = ibuf[0]; + printk("ipmi_panic: get alarms rc=%d cc=%x, alarms=%02x\n", + rc,cc,alarms); + if (alarms == 0) alarms = 0x0F; /* 0=err, fallback to default */ + if (rc == 0) { // valid, so ok to set alarm LED + /* Set Crit Alarm LED */ + obuf[0] = 0x03; // PRIVATE_BUS_ID; + obuf[1] = 0x40; // ALARMS_PANEL_WRITE; + obuf[2] = 1; // one byte of alarms data + obuf[3] = (alarms & 0x0D) | 0xF0; // turn on critical alarm + olen = 4; + rc = ipmi_send_recv(0x52,0x06,0,obuf,olen,NULL,0,&i,&cc); + printk("ipmi_panic: set crit alarm rc=%d cc=%x\n",rc,cc); + } + /* Log the OS Critical Stop to the SEL (BMC firmware log). */ + obuf[0] = 0x21; /* Kernel generator ID, IPMI table 5-4 */ + obuf[1] = 0x03; /* This is for IPMI 1.0. */ + obuf[2] = 0x20; /* OS Critical Stop, IPMI table 36-3 */ + obuf[4] = 0x6f; /* Sensor specific, IPMI table 36-1 */ + obuf[5] = 0xa1; /* Runtime stop OEM bytes 2 & 3. */ + obuf[3] = panic_string[0]; + obuf[6] = panic_string[1]; + obuf[7] = panic_string[2]; + olen = 8; + rc = ipmi_send_recv(0x02,0x04,0,obuf,olen,NULL,0,&i,&cc); + printk("ipmi_panic: log OS Critical Stop rc=%d cc=%x\n",rc,cc); +#else + send_panic_events(); +#endif + } #endif return NOTIFY_DONE; @@ -1914,6 +1989,9 @@ notifier_chain_register(&panic_notifier_list, &panic_block); +#ifdef CONFIG_IPMI_PANIC_ACTION + ipmi_panic_init(); +#endif initialized = 1; printk(KERN_INFO "ipmi: message handler initialized\n"); @@ -1971,3 +2049,6 @@ EXPORT_SYMBOL(ipmi_get_my_address); EXPORT_SYMBOL(ipmi_set_my_LUN); EXPORT_SYMBOL(ipmi_get_my_LUN); +#ifdef CONFIG_IPMI_PANIC_ACTION +EXPORT_SYMBOL(ipmi_reset); +#endif diff -Naru linux-2.5.62/drivers/char/ipmi/ipmi_panic.c linux-2.5.62p/drivers/char/ipmi/ipmi_panic.c --- linux-2.5.62/drivers/char/ipmi/ipmi_panic.c 1970-01-01 08:00:00.000000000 +0800 +++ linux-2.5.62p/drivers/char/ipmi/ipmi_panic.c 2003-03-06 22:27:16.000000000 +0800 @@ -0,0 +1,515 @@ +/* + * ipmi_panic.c + * + * This code is needed to run a streamlined IPMI KCS command when + * the rest of the system may be dead (panic time). It must wait + * for completion of the receive function also. + * There will be zero or one BMC, with KCS as a minimum and perhaps + * other interfaces, so doing KCS to a default BMC LUN is valid here. + * + * Note that CONFIG_IPMI_HANDLER should be =y (rather than =m) to + * ensure that this handler is loaded early enough to cover boot + * time panic conditions. CONFIG_IPMI_PANIC_ACTION can only be + * defined if CONFIG_IPMI_HANDLER=y. + * + * Author: Andy Cress + * + * Change History: + * 01/31/03 Andy Cress - created for kernel 2.5.44 with OpenIPMI + * + * Copyright 2003 Intel Corp. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define uchar unsigned char + +#define KCS_READY_DELAY 5 +#define BMC_RESPONSE_DELAY 5 +#define BMC_RETRY_DELAY 60 + +#if defined(__ia64__) +#define KCS_BASE 0x8a2 +#else +#define KCS_BASE 0xca2 +#endif +#define KCS_STATUS_REG (KCS_BASE + 1) +#define KCS_COMMAND_REG (KCS_BASE + 1) +#define KCS_DATAIN_REG (KCS_BASE + 0) +#define KCS_DATAOUT_REG (KCS_BASE + 0) + +/* State bits based on S1 & S0 below */ +#define KCS_STATE_MASK 0xC0 +#define KCS_IDLE_STATE 0x00 +#define KCS_READ_STATE 0x40 +#define KCS_WRITE_STATE 0x80 +#define KCS_ERROR_STATE 0xC0 + +#define KCS_IBF 0x02 +#define KCS_OBF 0x01 +#define KCS_SMS_ATN 0x04 + +#define SEND_INIT 1 +#define SEND_START 2 +#define SEND_NEXT 3 +#define SEND_END 4 +#define RECV_START 5 +#define RECV_INIT 6 +#define RECV_NEXT 7 +#define RECV_INIT2 8 +#define RECV_END 9 +#define END 10 +#define ERROR 0 + +/* SMS Transfer Stream Control Codes */ +#define GET_STATUS_ABORT 0x60 +#define WRITE_START 0x61 +#define WRITE_END 0x62 +#define KCS_READ 0x68 + +#define MAX_INVALID_RESPONSE_COUNT 2 +#define MIN_BMC_RESPONSE_SIZE 3 +#define MAX_IMB_PACKET_SIZE 33 +#define MAX_BMC_RESPONSE_SIZE (MIN_BMC_RESPONSE_SIZE + MAX_IMB_PACKET_SIZE) +#define MAX_XFER_LENGTH (MAX_IMB_PACKET_SIZE * 2) + +#define MAX_BUFFER_SIZE 64 + +typedef struct bmc_response + { + unsigned char lun :2; + unsigned char netfn :6; + unsigned char cmd; + unsigned char cc; + unsigned char data[1]; + }BMC_RESPONSE; + +typedef struct bmc_request + { + unsigned char lun :2; + unsigned char netfn :6; + unsigned char cmd; + unsigned char data[1]; + }BMC_REQUEST; + +/* GET_DEVICE_ID RESPONSE (11 bytes) */ +typedef struct device_id_response + { + unsigned char device_id; + + unsigned char device_revision :4; + unsigned char reserved :3; + unsigned char provides_sdr :1; + + unsigned char major_firmware_revision :7; + #define NORMAL_OPERATION 0 + #define DEVICE_BUSY 1 + unsigned char device_available :1; + + unsigned char minor_firmware_revision; + unsigned char ipmi_version_major :4; + unsigned char ipmi_version_minor :4; + + unsigned char supports_sensor_device :1; + unsigned char supports_sdr_device :1; + unsigned char supports_sel_device :1; + unsigned char supports_fru_device :1; + unsigned char supports_ipmb_receiver :1; + unsigned char supports_ipmb_generator :1; + unsigned char supports_bridge :1; + unsigned char supports_chassis_device :1; + + unsigned char manufacturer_id1; + unsigned char manufacturer_id2; + unsigned char manufacturer_id3; + unsigned short product_id; + } DEVICE_ID_RESPONSE; + +/*************************************/ + +#if defined(__ia64__) +static char kcs_new = 1; +#else +static char kcs_new = 0; +#endif +DECLARE_MUTEX(kcs_sem); + +/*************************************/ + +/* + * kcs chip mashing stuff + */ +static int wait_while_ibf(void) +{ + unsigned char status_byte; + + status_byte = inb_p(KCS_STATUS_REG); + if ((status_byte & KCS_IBF) == 0) return (0); + mdelay(KCS_READY_DELAY); + status_byte = inb_p(KCS_STATUS_REG); + if (status_byte & KCS_IBF) return (-1); + return (0); +} + +static int is_obf_set(void) +{ + unsigned char cs; + cs = inb_p(KCS_STATUS_REG); + return ((cs & KCS_OBF) == KCS_OBF); +} + +static int wait_until_obf(void) +{ + int retries = 0; + + while (retries < 2) { + if (is_obf_set()) return (0); + mdelay(KCS_READY_DELAY); + retries++; + } + return (-ETIMEDOUT); +} + +static unsigned char get_kcs_state(void) +{ + unsigned char cs; + + cs = inb_p(KCS_STATUS_REG); + return (cs & KCS_STATE_MASK); +} + +static unsigned char read_kcs_data(void) +{ + unsigned char data; + + data = inb_p(KCS_DATAOUT_REG); + return (data); +} + +static void write_kcs_data(unsigned char data) +{ + outb_p(data, KCS_DATAIN_REG); +} + +static void write_kcs_cmd(unsigned char cmd) +{ + outb_p(cmd, KCS_COMMAND_REG); +} + +static int clear_obf(void) +{ + read_kcs_data(); + return (0); +} + +static int kcs_xfer(BMC_REQUEST * request, int request_len, + BMC_RESPONSE * response, int *response_len) +{ + unsigned char *xmit_buffer, *recv_buffer; + int i = 0, rc = 0, state = SEND_INIT, bad = 0; + + xmit_buffer = (unsigned char *) request; + recv_buffer = (unsigned char *) response; + + while (1) { + if (state == END) + break; + else if (bad > 2) { + printk("[ipmi_panic] Maximum retries exceeded.\n"); + rc = -EIO; + break; + } + switch (state) { + case SEND_INIT: + { + i = 0; + state = SEND_START; + wait_while_ibf(); + if (kcs_new) clear_obf(); + } + case SEND_START: + { + state = SEND_NEXT; + write_kcs_cmd(WRITE_START); + wait_while_ibf(); + } + case SEND_NEXT: + { + if (i == (request_len - 1)) { + state = SEND_END; + break; + } + if (get_kcs_state() != KCS_WRITE_STATE) { + state = ERROR; + break; + } + write_kcs_data(xmit_buffer[i++]); + wait_while_ibf(); + if (kcs_new) clear_obf(); + break; + } + case SEND_END: + { + if (!kcs_new) wait_while_ibf(); + write_kcs_cmd(WRITE_END); + wait_while_ibf(); + if (get_kcs_state() != KCS_WRITE_STATE) { + state = ERROR; + break; + } + if (kcs_new) clear_obf(); + write_kcs_data(xmit_buffer[i++]); + wait_while_ibf(); + state = RECV_START; + } + case RECV_START: + { + switch (get_kcs_state()) { + case KCS_ERROR_STATE: + { + state = ERROR; + break; + } + case KCS_WRITE_STATE: + case KCS_IDLE_STATE: + { + mdelay(BMC_RESPONSE_DELAY); + break; + } + case KCS_READ_STATE: + { + i = 0; + memset(recv_buffer, 0, + *response_len); + state = RECV_INIT; + break; + } + } + break; + } + case RECV_INIT: + { + switch (get_kcs_state()) { + case KCS_ERROR_STATE: + case KCS_WRITE_STATE: + { + state = ERROR; + break; + } + case KCS_IDLE_STATE: + { + state = RECV_END; + break; + } + case KCS_READ_STATE: + { + if (is_obf_set()) + state = RECV_NEXT; + else mdelay(1); + break; + } + default: + { + mdelay(1); + break; + } + } + break; + } + case RECV_NEXT: + { + if (i >= *response_len) { + rc = -EOVERFLOW; + state = ERROR; + break; + } + recv_buffer[i++] = read_kcs_data(); + if (!kcs_new) wait_while_ibf(); + write_kcs_data(KCS_READ); + if (kcs_new) wait_while_ibf(); + state = RECV_INIT2; + break; + } + case RECV_INIT2: + { + switch (get_kcs_state()) { + case KCS_ERROR_STATE: + case KCS_WRITE_STATE: + { + state = ERROR; + break; + } + case KCS_IDLE_STATE: + { + if (kcs_new) { + if (wait_until_obf() == 0) { + clear_obf(); + state = RECV_END; + } else { + state = ERROR; + } + } else { + state = RECV_END; + } + break; + } + case KCS_READ_STATE: + { + if (kcs_new) { + if (wait_until_obf() == 0) + state = RECV_NEXT; + else state = ERROR; + } else { + if (is_obf_set()) + state = RECV_NEXT; + } + break; + } + } + break; + } + case RECV_END: + { + if ((i < MIN_BMC_RESPONSE_SIZE) || + (response->netfn != (request->netfn | 0x01)) + || (response->cmd != request->cmd)) { + if (request->cmd == 0x01 && + request->netfn == 0x06 && + response->netfn == 0x2b) /*ok*/; + else { /* flag the error */ + printk("[ipmi_panic] Request/Response CMD/NETFN mismatch error\n"); + + printk(" i=%d, RQcmd/RQnetfn=0x%x/0x%x,RScmd/RSnetfn=0x%x/0x%x\n", + i, request->cmd, request->netfn, + response->cmd, response->netfn); + mdelay(BMC_RETRY_DELAY); + bad++; + state = SEND_INIT; + break; + } + } + + *response_len = i; + rc = 0; + state = END; + break; + } + case ERROR: + default: + { + printk("[ipmi_panic] BMC in bad state. Retrying transfer\n"); + mdelay(BMC_RETRY_DELAY); + bad++; + state = SEND_INIT; + break; + } + } + } + return (rc); +} + +int ipmi_send_recv(uchar cmd, uchar netfn, uchar lun, uchar *sbuf, int slen, + uchar *rbuf, int rlen, int *nret, uchar *cc) +{ + uchar bmc_outbuf[MAX_BUFFER_SIZE]; + uchar bmc_inbuf[MAX_BUFFER_SIZE]; + BMC_REQUEST *bmc_req; + BMC_RESPONSE *bmc_resp; + int bmc_outlen; + int bmc_inlen; + int rc = 0; + + if (kcs_new == 2) return (-ENXIO); + + memset(bmc_outbuf,0, sizeof(bmc_outbuf)); + memset(bmc_inbuf,0, sizeof(bmc_inbuf)); + bmc_req = (BMC_REQUEST *)bmc_outbuf; + bmc_resp = (BMC_RESPONSE *)bmc_inbuf; + bmc_req->cmd = cmd; + bmc_req->netfn = netfn; + bmc_req->lun = lun; + bmc_outlen = slen + 2; + bmc_inlen = sizeof(bmc_inbuf); + if (slen > 0) memcpy(bmc_req->data,sbuf,slen); + + rc = kcs_xfer(bmc_req, bmc_outlen, bmc_resp, &bmc_inlen); + if (bmc_resp->cc == 0xcc) /* flaky NMI fixup */ + rc = kcs_xfer(bmc_req, bmc_outlen, bmc_resp, &bmc_inlen); /*retry*/ + + /* copy the response */ + *cc = bmc_resp->cc; + if (bmc_inlen > rlen) bmc_inlen = rlen; + *nret = bmc_inlen; + if (bmc_inlen > 0) memcpy(rbuf,bmc_resp->data,bmc_inlen); + + return(rc); +} + +int ipmi_panic_init(void) +{ + int i, rc; + uchar cc; + uchar bdev[16]; + DEVICE_ID_RESPONSE *dev_id; + + printk("ipmi_panic driver at io 0x%x\n", KCS_BASE); + if ((inb_p(KCS_STATUS_REG) == 0xFF) && + (inb_p(KCS_DATAIN_REG) == 0xFF)) { + printk("--KCS ISA window not present, exiting.\n"); + return (-ENXIO); + } + + /* Get Device ID */ + rc = ipmi_send_recv(0x01,0x06,0,NULL,0,bdev,sizeof(bdev),&i,&cc); + if (rc != 0) kcs_new = 2; /* bad */ + else if (cc != 0) kcs_new = 2; /* bad */ + else + { + dev_id = (DEVICE_ID_RESPONSE *)&bdev[0]; + printk("--BMC version %x.%x, IPMI version %d.%d\n", + dev_id->major_firmware_revision, + dev_id->minor_firmware_revision, + dev_id->ipmi_version_major, dev_id->ipmi_version_minor); + if ((dev_id->ipmi_version_major == 0) && + (dev_id->ipmi_version_minor == 9)) { + printk("--Using legacy KCS state machine\n"); + kcs_new = 0; + } else { + printk("--Using new KCS state machine\n"); + kcs_new = 1; + } + } + /* dont care about chipset vendor, but test Lancewood & IPF to be sure*/ + + return(rc); +} + +/* end ipmi_panic.c */ diff -Naru linux-2.5.62/drivers/char/ipmi/Kconfig linux-2.5.62p/drivers/char/ipmi/Kconfig --- linux-2.5.62/drivers/char/ipmi/Kconfig 2003-03-07 16:34:23.000000000 +0800 +++ linux-2.5.62p/drivers/char/ipmi/Kconfig 2003-03-06 22:46:58.000000000 +0800 @@ -7,8 +7,14 @@ tristate 'IPMI top-level message handler' help This enables the central IPMI message handler, required for IPMI - to work. Note that you must have this enabled to do any other IPMI - things. See IPMI.txt for more details. + to work. + + IPMI is a standard for managing sensors (temperature, + voltage, etc.) in a system. + + See Documentation/IPMI.txt for more details on the driver. + + If unsure, say N. config IPMI_PANIC_EVENT bool 'Generate a panic event to all BMCs on a panic' @@ -36,5 +42,11 @@ depends on IPMI_HANDLER help This enables the IPMI watchdog timer. +config IPMI_PANIC_ACTION + int 'Action after Panic (0=reset,1=power down,2=power cycle)' + requires IPMI_HANDLER=y + default "0" + help + Set the Action after Panic endmenu diff -Naru linux-2.5.62/drivers/char/ipmi/Makefile linux-2.5.62p/drivers/char/ipmi/Makefile --- linux-2.5.62/drivers/char/ipmi/Makefile 2003-03-07 16:34:54.000000000 +0800 +++ linux-2.5.62p/drivers/char/ipmi/Makefile 2003-03-06 22:27:16.000000000 +0800 @@ -4,7 +4,7 @@ ipmi_kcs_drv-objs := ipmi_kcs_sm.o ipmi_kcs_intf.o -obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o +obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o ipmi_panic.o obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o obj-$(CONFIG_IPMI_KCS) += ipmi_kcs_drv.o obj-$(CONFIG_IPMI_WATCHDOG) += ipmi_watchdog.o diff -Naru linux-2.5.62/drivers/char/Kconfig linux-2.5.62p/drivers/char/Kconfig --- linux-2.5.62/drivers/char/Kconfig 2003-03-07 16:33:38.000000000 +0800 +++ linux-2.5.62p/drivers/char/Kconfig 2003-03-07 16:22:02.000000000 +0800 @@ -999,5 +999,6 @@ out to lunch past a certain margin. It can reboot the system or merely print a warning. + endmenu diff -Naru linux-2.5.62/kernel/panic.c linux-2.5.62p/kernel/panic.c --- linux-2.5.62/kernel/panic.c 2003-03-07 16:34:58.000000000 +0800 +++ linux-2.5.62p/kernel/panic.c 2003-03-06 22:27:07.000000000 +0800 @@ -20,6 +20,10 @@ asmlinkage void sys_sync(void); /* it's really int */ int panic_timeout; +char *panic_string; +#ifdef CONFIG_IPMI_PANIC_ACTION + extern void ipmi_reset(int mode); +#endif struct notifier_block *panic_notifier_list; @@ -53,6 +57,7 @@ va_start(args, fmt); vsprintf(buf, fmt, args); va_end(args); + panic_string = buf; printk(KERN_EMERG "Kernel panic: %s\n",buf); if (in_interrupt()) printk(KERN_EMERG "In interrupt handler - not syncing\n"); @@ -81,7 +86,11 @@ * choosing not too. It might crash, be corrupt or do * more harm than good for other reasons. */ +#ifdef CONFIG_IPMI_PANIC_ACTION + ipmi_reset(CONFIG_IPMI_PANIC_ACTION); +#else machine_restart(NULL); +#endif } #ifdef __sparc__ { ipmiutil-3.0.7/kern/openipmi-emu-rh80.patch0000644000076400007640000015667013160502144020247 0ustar acressloggers--- linux-2.4.18-14orig/Documentation/Configure.help 2003-03-27 15:37:28.000000000 -0500 +++ linux-2.4.18-14/Documentation/Configure.help 2003-03-27 15:32:58.000000000 -0500 @@ -25590,6 +25590,17 @@ CONFIG_IPMI_WATCHDOG This enables the IPMI watchdog timer. +Emulate Radisys IPMI driver +CONFIG_IPMI_EMULATE_RADISYS + This enables emulation of the Radisys IPMI device driver. + +Emulate Intel IBM driver +CONFIG_IPMI_EMULATE_IMB + This enables emulation of the Intel IMB device driver. Note that you + MUST have the IPMI watchdog timer enabled to use this. This code + uses some of the watchdog code, but the dependency is not enforced + by config. + # # A couple of things I keep forgetting: # capitalize: AppleTalk, Ethernet, DOS, DMA, FAT, FTP, Internet, --- linux-2.4.18-14orig/drivers/char/Config.in 2003-03-27 15:37:28.000000000 -0500 +++ linux-2.4.18-14/drivers/char/Config.in 2003-03-27 15:32:58.000000000 -0500 @@ -180,6 +180,8 @@ dep_tristate ' Device interface for IPMI' CONFIG_IPMI_DEVICE_INTERFACE $CONFIG_IPMI_HANDLER dep_tristate ' IPMI KCS handler' CONFIG_IPMI_KCS $CONFIG_IPMI_HANDLER dep_tristate ' IPMI Watchdog Timer' CONFIG_IPMI_WATCHDOG $CONFIG_IPMI_HANDLER +dep_tristate ' Emulate Radisys IPMI driver' CONFIG_IPMI_EMULATE_RADISYS $CONFIG_IPMI_HANDLER +dep_tristate ' Emulate Intel IMB driver' CONFIG_IPMI_EMULATE_IMB $CONFIG_IPMI_WATCHDOG mainmenu_option next_comment comment 'Watchdog Cards' --- linux-2.4.18-14orig/drivers/char/ipmi/Makefile 2003-03-27 15:37:28.000000000 -0500 +++ linux-2.4.18-14/drivers/char/ipmi/Makefile 2003-03-27 15:32:58.000000000 -0500 @@ -13,6 +13,8 @@ obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o obj-$(CONFIG_IPMI_KCS) += ipmi_kcs_drv.o obj-$(CONFIG_IPMI_WATCHDOG) += ipmi_watchdog.o +obj-$(CONFIG_IPMI_EMULATE_RADISYS) += ipmi_radisys.o +obj-$(CONFIG_IPMI_EMULATE_IMB) += ipmi_imb.o include $(TOPDIR)/Rules.make --- /dev/null 2002-08-30 19:31:37.000000000 -0400 +++ linux-2.4.18-14/include/linux/ipmi_imb.h 2003-03-27 15:33:11.000000000 -0500 @@ -0,0 +1,144 @@ +/* + * ipmi_imb.h + * + * Intels IMB emulation on the MontaVista IPMI interface + * + * Author: MontaVista Software, Inc. + * Corey Minyard + * source@mvista.com + * + * Copyright 2002 MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __LINUX_IPMI_IMB_H +#define __LINUX_IPMI_IMB_H + +typedef struct overlapped_s { + unsigned long Internal; + unsigned long InternalHigh; + unsigned long Offset; + unsigned long OffsetHigh; +} overlapped_t; + +struct smi { + unsigned long smi_VersionNo; + unsigned long smi_Reserved1; + unsigned long smi_Reserved2; + void *ntstatus; /* address of NT status block*/ + void *lpvInBuffer; /* address of buffer for input data*/ + unsigned long cbInBuffer; /* size of input buffer*/ + void *lpvOutBuffer; /* address of output buffer*/ + unsigned long cbOutBuffer; /* size of output buffer*/ + unsigned long *lpcbBytesReturned; /* address of actual bytes of output*/ + overlapped_t *lpoOverlapped; /* address of overlapped structure*/ +}; + + +#define MAX_IMB_PACKET_SIZE 33 + +typedef struct { + unsigned char rsSa; + unsigned char cmd; + unsigned char netFn; + unsigned char rsLun; + unsigned char dataLength; + unsigned char data[1]; +} ImbRequest; + +typedef struct { + unsigned long flags; +#define NO_RESPONSE_EXPECTED 0x01 + + unsigned long timeOut; + ImbRequest req; +} ImbRequestBuffer; + +#define MIN_IMB_REQ_BUF_SIZE 13 + + +typedef struct { + unsigned char cCode; + unsigned char data[1]; +} ImbResponseBuffer; + +#define MIN_IMB_RESP_BUF_SIZE 1 // a buffer without any request data +#define MAX_IMB_RESP_SIZE (MIN_IMB_RESP_BUF_SIZE + MAX_IMB_RESPONSE_SIZE) + +#define MIN_IMB_RESPONSE_SIZE 7 +#define MAX_IMB_RESPONSE_SIZE MAX_IMB_PACKET_SIZE + +typedef struct { + unsigned long timeOut; + unsigned long lastSeq; +} ImbAsyncRequest; + +typedef struct { + unsigned long thisSeq; + unsigned char data[1]; +} ImbAsyncResponse; + +#define MIN_ASYNC_RESP_SIZE sizeof(unsigned long) +#define MAX_ASYNC_RESP_SIZE (MIN_ASYNC_RESP_SIZE + MAX_IMB_PACKET_SIZE) + +#define STATUS_SUCCESS (0x00000000U) +#define IMB_NO_ASYNC_MSG ((unsigned long)0xE0070012L) +#define IMB_SEND_REQUEST_FAILED ((unsigned long)0xE0070013L) +#define INVALID_ARGUMENTS ((unsigned long)0xE0070002L) + + +#define FILE_DEVICE_IMB 0x00008010 +#define IOCTL_IMB_BASE 0x00000880 + +#define CTL_CODE(DeviceType, Function, Method, Access)\ + _IO(DeviceType & 0x00FF, Function & 0x00FF) + +#define FILE_DEVICE_IMB 0x00008010 +#define IOCTL_IMB_BASE 0x00000880 +#define METHOD_BUFFERED 0 +#define FILE_ANY_ACCESS 0 + + +typedef struct { + int code; +#define SD_NO_ACTION 0 +#define SD_RESET 1 +#define SD_POWER_OFF 2 + + int delayTime; /* in units of 100 millisecond */ +} ShutdownCmdBuffer; + + +/* BMC added parentheses around IOCTL_IMB_BASE + 2 */ +#define IOCTL_IMB_SEND_MESSAGE CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 2), METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IMB_GET_ASYNC_MSG CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 8), METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IMB_MAP_MEMORY CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 14),METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IMB_UNMAP_MEMORY CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 16),METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IMB_SHUTDOWN_CODE CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 18),METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IMB_REGISTER_ASYNC_OBJ CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 24),METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IMB_DEREGISTER_ASYNC_OBJ CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 26),METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IMB_CHECK_EVENT CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 28),METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_IMB_POLL_ASYNC CTL_CODE(FILE_DEVICE_IMB, (IOCTL_IMB_BASE + 20),METHOD_BUFFERED, FILE_ANY_ACCESS) + + +#endif /* __LINUX_IPMI_IMB_H */ --- /dev/null 2002-08-30 19:31:37.000000000 -0400 +++ linux-2.4.18-14/include/linux/ipmi_radisys.h 2003-03-27 15:33:11.000000000 -0500 @@ -0,0 +1,128 @@ +/* + * ipmi_radisys.h + * + * An emulation of the Radisys IPMI interface on top of the MontaVista + * interface. + * + * Author: MontaVista Software, Inc. + * Corey Minyard + * source@mvista.com + * + * Copyright 2002 MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __LINUX_IPMI_RADISYS_H +#define __LINUX_IPMI_RADISYS_H + +/****************************************************************************** + * This is the old IPMI interface defined by Radisys. We are + * compliant with that. Don't use it for new designs, though. + */ +#define IOCTL_IPMI_RCV ( IPMI_IOC_MAGIC<<8 | 1 ) +#define IOCTL_IPMI_SEND ( IPMI_IOC_MAGIC<<8 | 2 ) +#define IOCTL_IPMI_EVENT ( IPMI_IOC_MAGIC<<8 | 3 ) +#define IOCTL_IPMI_REGISTER ( IPMI_IOC_MAGIC<<8 | 4 ) +#define IOCTL_IPMI_UNREGISTER ( IPMI_IOC_MAGIC<<8 | 5 ) +#define IOCTL_IPMI_CLEAR ( IPMI_IOC_MAGIC<<8 | 9 ) + +/* These don't seem to be implemented in the Radisys driver. +#define IOCTL_IPMI_RESET_BMC ( IPMI_IOC_MAGIC<<8 | 6 ) +#define IOCTL_IPMI_GET_BMC_ADDR ( IPMI_IOC_MAGIC<<8 | 7 ) +#define IOCTL_IPMI_SET_BMC_ADDR ( IPMI_IOC_MAGIC<<8 | 8 ) +*/ + +/* + * Network Function Codes + */ +#define IPMI_NETFN_CHASSIS 0x00 /* Chassis - 0x00 << 2 */ +#define IPMI_NETFN_CHASSIS_RESP 0x04 /* Chassis - 0x01 << 2 */ + +#define IPMI_NETFN_BRIDGE 0x08 /* Bridge - 0x02 << 2 */ +#define IPMI_NETFN_BRIDGE_RESP 0x0c /* Bridge - 0x03 << 2 */ + +#define IPMI_NETFN_SENSOR_EVT 0x10 /* Sensor/Event - 0x04 << 2 */ +#define IPMI_NETFN_SENSOR_EVT_RESP 0x14 /* Sensor/Event - 0x05 << 2 */ + +#define IPMI_NETFN_APP 0x18 /* Application - 0x06 << 2 */ +#define IPMI_NETFN_APP_RESP 0x1c /* Application - 0x07 << 2 */ + +#define IPMI_NETFN_FIRMWARE 0x20 /* Firmware - 0x08 << 2 */ +#define IPMI_NETFN_FIRMWARE_RESP 0x24 /* Firmware - 0x09 << 2 */ + +#define IPMI_NETFN_STORAGE 0x28 /* Storage - 0x0a << 2 */ +#define IPMI_NETFN_STORAGE_RESP 0x2c /* Storage - 0x0b << 2 */ + +#define IPMI_NETFN_OEM_1 0xC0 /* Storage - 0x30 << 2 */ +#define IPMI_NETFN_OEM_1_RESP 0xC4 /* Storage - 0x31 << 2 */ + +/* there are 15 other OEM netfn pairs (OEM - 0x30-0x3f) */ + +typedef struct _IPMI_LIST_ENTRY { + struct _IPMI_LIST_ENTRY * volatile Flink; + struct _IPMI_LIST_ENTRY * volatile Blink; +} IPMI_LIST_ENTRY, *PIPMI_LIST_ENTRY; + +typedef struct IPMI_semaphore IPMI_KSEMAPHORE; +typedef struct IPMI_semaphore * IPMI_PKSEMAPHORE; + +/* IPMI Address structure */ +typedef struct _IPMI_ADDR { + unsigned char uchSlave; /* Slave Address */ + unsigned char uchLun; /* Logical Unit Number */ +} IPMI_ADDR, *PIPMI_ADDR; + +#define IPMI_MAX_MSG_SIZE 36 + +/* IPMI Message Descriptor structure */ +typedef struct _IPMI_MSGDESC { + /************************************/ + /* Device Driver Specific Elements */ + /************************************/ + IPMI_LIST_ENTRY Entry; /* Linked list element */ + void *pIRPacket; /* Pointer to IRP object */ + IPMI_PKSEMAPHORE pSema; /* Semaphore Object */ + long lTimeout; /* Timeout value */ + /************************************/ + /* Shared elements */ + /************************************/ + unsigned char auchBuffer[IPMI_MAX_MSG_SIZE]; /* Message buffer */ + unsigned long ulLength; /* Length of message in bytes */ + int fDefer; /* TRUE - Defer I/O + operation, doesn't seem + to be used in the + Radisys driver. */ + IPMI_ADDR Dest; /* Destination IPM Address */ + unsigned char uchNetFn; /* Network Function */ + unsigned char uchCmd; /* Command */ + unsigned char uchSeq; /* Sequence Number */ + unsigned char uchComplete; /* Completion Code */ +} IPMI_MSGDESC, *PIPMI_MSGDESC; + +/* Byte return codes for some things. */ +#define LOWLRC_SUCCESS 0x00 /* routine completed successfully */ +#define LOWLRC_ERROR 0xff /* routine did not complete */ +#define LOWLRC_INVALID_PARAMETERS 0xfe /* invalid parameters */ +#define LOWLRC_INVALID_REQUEST_DATA 0xfd /* invalid request data */ + +#endif /* __LINUX_IPMI_RADISYS_H */ --- /dev/null 2002-08-30 19:31:37.000000000 -0400 +++ linux-2.4.18-14/drivers/char/ipmi/ipmi_imb.c 2003-03-27 15:32:59.000000000 -0500 @@ -0,0 +1,744 @@ +/* + * ipmi_imb.c + * + * Intel IMB emulation for the IPMI interface. + * + * Author: MontaVista Software, Inc. + * Corey Minyard + * source@mvista.com + * + * Copyright 2002 MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#define MAX_BUFFER_SIZE 64 +#define BMC_SA 0x20 + +struct priv_data +{ + /* This is for supporting the old Imb interface. */ + ipmi_user_t imb_user; + spinlock_t imb_lock; + + unsigned long curr_msgid; + + /* A list of responses in the queue. */ + struct list_head imb_waiting_rsps; + + /* A list of things waiting for responses. We wake them all up + when a response comes in. */ + wait_queue_head_t imb_waiting_rsp_rcvrs; + + /* A list of commands that have come in. */ + struct list_head imb_waiting_cmds; + + /* A list of thing waiting for commands. We wake them all up + when a command comes in. */ + wait_queue_head_t imb_waiting_cmd_rcvrs; + + /* The registered command receiver value. This only allows someone + with the "magic number" to issue commands. */ + unsigned long imb_cmd_receiver; + + /* Is someone already waiting for a command? The Imb driver + only allows one waiter, this enforces that. */ + int imb_cmd_waiting; + + /* A list of IPMI events waiting to be delivered. (not that + the Imb driver calls incoming commands "events", this + variable is actual IPMI events, not incoming commands). */ + struct list_head imb_waiting_events; + +#define IMB_EVENT_QUEUE_LIMIT 16 /* Allow up to 16 events. */ + /* The number of events in the event queue. */ + unsigned int imb_waiting_event_count; +}; + +static devfs_handle_t devfs_handle; + + +/* We cheat and use a piece of the address as the timeout. */ +static long *imb_timeout(struct ipmi_recv_msg *msg) +{ + char *base = (char *) &(msg->addr); + base += sizeof(struct ipmi_ipmb_addr); + return (long *) base; +} + +static void imb_msg_recv(struct ipmi_recv_msg *msg, + void *data) +{ + struct priv_data *priv = data; + unsigned long flags; + + spin_lock_irqsave(&(priv->imb_lock), flags); + if (msg->recv_type == IPMI_RESPONSE_RECV_TYPE) { + *imb_timeout(msg) = 5000; + list_add_tail(&(msg->link), &(priv->imb_waiting_rsps)); + wake_up_all(&(priv->imb_waiting_rsp_rcvrs)); + } else if (msg->recv_type == IPMI_CMD_RECV_TYPE) { + *imb_timeout(msg) = 5000; + list_add_tail(&(msg->link), &(priv->imb_waiting_cmds)); + wake_up_all(&(priv->imb_waiting_cmd_rcvrs)); + } else if (msg->recv_type == IPMI_ASYNC_EVENT_RECV_TYPE) { + if (priv->imb_waiting_event_count > IMB_EVENT_QUEUE_LIMIT) { + ipmi_free_recv_msg(msg); + } else { + list_add_tail(&(msg->link),&(priv->imb_waiting_events)); + (priv->imb_waiting_event_count)++; + } + } else { + ipmi_free_recv_msg(msg); + } + spin_unlock_irqrestore(&(priv->imb_lock), flags); +} + +/* We emulate the event queue in the driver for the imb emulation. */ +static int imb_handle_event_request(struct priv_data *priv, + struct ipmi_recv_msg **rsp) +{ + struct list_head *entry; + unsigned long flags; + struct ipmi_recv_msg *msg = NULL; + int rv = 0; + + spin_lock_irqsave(&(priv->imb_lock), flags); + if (list_empty(&(priv->imb_waiting_events))) { + /* Nothing in the event queue, just return an error. */ + msg = ipmi_alloc_recv_msg(); + if (msg == NULL) { + rv = -EAGAIN; + goto out_err; + } + msg->addr.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + msg->addr.channel = IPMI_BMC_CHANNEL; + msg->msg.cmd = IPMI_READ_EVENT_MSG_BUFFER_CMD; + msg->msgid = 0; + msg->recv_type = IPMI_ASYNC_EVENT_RECV_TYPE; + msg->msg.netfn = IPMI_NETFN_APP_RESPONSE; + msg->msg.data = msg->msg_data; + msg->msg.data[0] = 0x80; /* Data not available. */ + msg->msg.data_len = 1; + } else { + /* Pull an item from the event queue . */ + entry = priv->imb_waiting_events.next; + list_del(entry); + msg = list_entry(entry, struct ipmi_recv_msg, link); + (priv->imb_waiting_event_count)--; + } + + *rsp = msg; + + out_err: + spin_unlock_irqrestore(&(priv->imb_lock), flags); + return rv; +} + +static struct priv_data *ipmi_user; +static unsigned int user_count = 0; /* How many users have this open. */ +static spinlock_t dev_lock = SPIN_LOCK_UNLOCKED; + +static int ipmi_imb_open(struct inode *inode, struct file *file) +{ + int rv; + + if (user_count == 0) { + rv = ipmi_register_all_cmd_rcvr(ipmi_user->imb_user); + if (rv) { + return rv; + } + } + + file->private_data = ipmi_user; + spin_lock(&dev_lock); + if (user_count == 0) + ipmi_set_gets_events(ipmi_user->imb_user, 1); + user_count++; + spin_unlock(&dev_lock); + + return 0; +} + +static int ipmi_imb_release(struct inode *inode, struct file *file) +{ + spin_lock(&dev_lock); + user_count--; + if (user_count == 0) { + ipmi_set_gets_events(ipmi_user->imb_user, 0); + ipmi_unregister_all_cmd_rcvr(ipmi_user->imb_user); + } + spin_unlock(&dev_lock); + return 0; +} + +static unsigned char +ipmb_checksum(unsigned char *data, int size) +{ + unsigned char csum = 0; + + for (; size > 0; size--, data++) + csum += *data; + + return -csum; +} + +extern void ipmi_delayed_shutdown(long delay, int power_off); + +static int ipmi_imb_ioctl(struct inode *inode, + struct file *file, + unsigned int cmd, + unsigned long data) +{ + struct priv_data *priv = file->private_data; + int rv = -EINVAL; + struct smi smi; + unsigned long flags; + + if (copy_from_user((caddr_t)&smi, (caddr_t)data, sizeof(smi))) { + return -EFAULT; + } + + switch(cmd) { + case IOCTL_IMB_POLL_ASYNC: + /* + * No-op for this, the low-level driver polls. + */ + break; + + case IOCTL_IMB_GET_ASYNC_MSG: + { + unsigned char resp[MAX_ASYNC_RESP_SIZE]; + struct ipmi_recv_msg *msg = NULL; + ImbAsyncResponse *pAsyncResp = (ImbAsyncResponse *) resp; + unsigned long length = 0; + + if (smi.cbInBuffer < sizeof(ImbAsyncRequest)) + return -EINVAL; + if (smi.cbOutBuffer < MIN_ASYNC_RESP_SIZE) + return -EINVAL; + + spin_lock_irqsave(&(priv->imb_lock), flags); + + if (list_empty(&(priv->imb_waiting_cmds))) { + /* No command waiting, just return an error. */ + rv = IMB_NO_ASYNC_MSG; + } else { + struct list_head *entry; + + /* Got a command, pull it out and handle it. */ + entry = priv->imb_waiting_cmds.next; + list_del(entry); + msg = list_entry(entry, struct ipmi_recv_msg, link); + rv = STATUS_SUCCESS; + } + spin_unlock_irqrestore(&(priv->imb_lock), flags); + + if (msg != NULL) { + struct ipmi_ipmb_addr *ipmb_addr; + + ipmb_addr = (struct ipmi_ipmb_addr *) &(msg->addr); + pAsyncResp->thisSeq = msg->msgid; + pAsyncResp->data[0] = IPMI_NETFN_APP_REQUEST << 2; + pAsyncResp->data[1] = IPMI_SEND_MSG_CMD; + pAsyncResp->data[2] = 0; + pAsyncResp->data[3] = msg->addr.channel; + pAsyncResp->data[4] = ((msg->msg.netfn << 2) + | 2); + pAsyncResp->data[5] + = ipmb_checksum(&(pAsyncResp->data[3]), + 2); + pAsyncResp->data[6] = ipmb_addr->slave_addr; + pAsyncResp->data[7] = ((msg->msgid << 2) + | ipmb_addr->lun); + pAsyncResp->data[8] = msg->msg.cmd; + + memcpy(&(pAsyncResp->data[9]), + &(msg->msg.data[0]), + msg->msg.data_len); + + length = msg->msg.data_len + MIN_ASYNC_RESP_SIZE; + + ipmi_free_recv_msg(msg); + + if (copy_to_user(smi.lpvOutBuffer, pAsyncResp, length)) + { + return -EFAULT; + } + } + + if (copy_to_user(smi.lpcbBytesReturned, + &length, + sizeof(length))) + { + return -EFAULT; + } + rv = 0; + break; + } + + case IOCTL_IMB_SEND_MESSAGE: + { + unsigned char imbReqBuffer[MAX_IMB_RESPONSE_SIZE + 8]; + unsigned char imbRespBuffer[MAX_IMB_RESPONSE_SIZE + 8]; + ImbRequestBuffer *pImbReq=(ImbRequestBuffer *)imbReqBuffer; + ImbResponseBuffer *pImbResp=(ImbResponseBuffer*)imbRespBuffer; + struct ipmi_addr addr; + struct ipmi_msg msg; + unsigned long msgid; + struct ipmi_recv_msg *rsp; + unsigned long length; + wait_queue_t wait; + struct list_head *entry; + + + if ((smi.cbInBuffer < MIN_IMB_REQ_BUF_SIZE) + || (smi.cbOutBuffer < MIN_IMB_RESP_BUF_SIZE)) + { + return -EINVAL; + } + + if (smi.cbInBuffer > (MAX_IMB_RESPONSE_SIZE + 8)) { + /* Input buffer is too large */ + return -EINVAL; + } + + if (copy_from_user(pImbReq, smi.lpvInBuffer, smi.cbInBuffer)) { + return -EFAULT; + } + if ((pImbReq->req.dataLength + MIN_IMB_REQ_BUF_SIZE) + > smi.cbInBuffer) + { + return -EINVAL; + } + if (pImbReq->req.dataLength > MAX_BUFFER_SIZE) { + return -EINVAL; + } + + if (pImbReq->req.rsSa == BMC_SA) { + struct ipmi_system_interface_addr *smi_addr + = (struct ipmi_system_interface_addr *) &addr; + + if ((pImbReq->req.netFn + == (IPMI_NETFN_APP_REQUEST << 2)) + && (pImbReq->req.cmd + == IPMI_READ_EVENT_MSG_BUFFER_CMD)) + { + /* The driver gets event messages + automatically, so we emulate + this. */ + rv = imb_handle_event_request(priv, &rsp); + goto copy_resp; + } else { + smi_addr->addr_type + = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + smi_addr->channel = IPMI_BMC_CHANNEL; + smi_addr->lun = 0; + } + } else { + struct ipmi_ipmb_addr *ipmb_addr = + (struct ipmi_ipmb_addr *) &addr; + + ipmb_addr->addr_type = IPMI_IPMB_ADDR_TYPE; + ipmb_addr->slave_addr = pImbReq->req.rsSa; + ipmb_addr->lun = pImbReq->req.rsLun; + ipmb_addr->channel = 0; + } + + if (pImbReq->flags & NO_RESPONSE_EXPECTED) { + spin_lock(&priv->imb_lock); + msgid = priv->curr_msgid; + (priv->curr_msgid)++; + spin_unlock(&priv->imb_lock); + } else { + msgid = 0; + } + + msg.netfn = pImbReq->req.netFn; + msg.cmd = pImbReq->req.cmd; + msg.data = pImbReq->req.data; + msg.data_len = pImbReq->req.dataLength; + rv = ipmi_request(priv->imb_user, + &addr, + msgid, + &msg, + 0); + if (rv) { + rv = IMB_SEND_REQUEST_FAILED; + goto copy_resp; + } + + if (pImbReq->flags & NO_RESPONSE_EXPECTED) + goto no_response; + + /* Now wait for the response to come back. */ + spin_lock_irqsave(&(priv->imb_lock), flags); + init_waitqueue_entry(&wait, current); + add_wait_queue(&(priv->imb_waiting_rsp_rcvrs), + &wait); + for (;;) { + /* Check to see if it's there. */ + if (!list_empty(&(priv->imb_waiting_rsps))) { + entry = priv->imb_waiting_rsps.next; + list_del(entry); + rsp = list_entry(entry, + struct ipmi_recv_msg, + link); + if (rsp->msgid != msgid) { + ipmi_free_recv_msg(rsp); + rsp = NULL; + } else { + break; + } + } + + set_current_state(TASK_INTERRUPTIBLE); + if (!signal_pending(current)) { + spin_unlock_irqrestore + (&(priv->imb_lock), flags); + schedule(); + spin_lock_irqsave + (&(priv->imb_lock), flags); + } else { + rv = -ERESTARTSYS; + break; + } + } + remove_wait_queue(&(priv->imb_waiting_rsp_rcvrs), + &wait); + spin_unlock_irqrestore(&(priv->imb_lock), flags); + + copy_resp: + if (rsp != NULL) { + pImbResp->cCode = rsp->msg.data[0]; + memcpy(pImbResp->data, + rsp->msg.data+1, + rsp->msg.data_len-1); + length = (rsp->msg.data_len - 1 + + MIN_IMB_RESP_BUF_SIZE); + + if (copy_to_user(smi.lpvOutBuffer, pImbResp, length)) { + return -EFAULT; + } + + if (copy_to_user(smi.lpcbBytesReturned, + &length, + sizeof(length))) + { + return -EFAULT; + } + } + no_response: + break; + } + + case IOCTL_IMB_SHUTDOWN_CODE: + { + ShutdownCmdBuffer shutdownCmd; + + if (copy_from_user(&shutdownCmd, + smi.lpvInBuffer, + sizeof(ShutdownCmdBuffer))) + { + return -EFAULT; + } + + if (smi.cbInBuffer < sizeof(ShutdownCmdBuffer)) + { + return -EINVAL; + } + + rv = 0; + switch (shutdownCmd.code) { + case SD_POWER_OFF: + ipmi_delayed_shutdown(shutdownCmd.delayTime / 10, 1); + break; + + case SD_RESET: + ipmi_delayed_shutdown(shutdownCmd.delayTime / 10, 0); + break; + + case SD_NO_ACTION: + break; + + default: + rv = INVALID_ARGUMENTS; + } + + } + + case IOCTL_IMB_REGISTER_ASYNC_OBJ: + rv = STATUS_SUCCESS; + break; + + + case IOCTL_IMB_CHECK_EVENT: + { + wait_queue_t wait; + + spin_lock_irqsave(&(priv->imb_lock), flags); + init_waitqueue_entry(&wait, current); + add_wait_queue(&(priv->imb_waiting_cmd_rcvrs), + &wait); + while (!list_empty(&(priv->imb_waiting_cmds))) { + set_current_state(TASK_INTERRUPTIBLE); + if (!signal_pending(current)) { + spin_unlock_irqrestore + (&(priv->imb_lock), flags); + schedule(); + spin_lock_irqsave + (&(priv->imb_lock), flags); + } else { + rv = -ERESTARTSYS; + break; + } + } + remove_wait_queue(&(priv->imb_waiting_cmd_rcvrs), + &wait); + spin_unlock_irqrestore(&(priv->imb_lock), flags); + rv = 0; + break; + } + } + + return rv; +} + +static int ipmi_imb_mmap(struct file *file, struct vm_area_struct *vma) +{ + off_t offset = vma->vm_pgoff << PAGE_SHIFT; + + if (offset < 0) + return -EINVAL; + + if (remap_page_range(vma->vm_start, offset, + vma->vm_end - vma->vm_start, + vma->vm_page_prot)) + { + return -EAGAIN; + } + + /*vma->vm_inode = what_goes_here; */ + + return 0; + +} + + +static struct file_operations ipmi_fops = { + owner: THIS_MODULE, + ioctl: ipmi_imb_ioctl, + open: ipmi_imb_open, + release: ipmi_imb_release, + mmap: ipmi_imb_mmap +}; + +static struct timer_list ipmi_imb_timer; + +/* Call every 100 ms. */ +#define IPMI_TIMEOUT_TIME 100 +#define IPMI_TIMEOUT_JIFFIES (IPMI_TIMEOUT_TIME/(1000/HZ)) + +static volatile int stop_operation = 0; +static volatile int timer_stopped = 0; + +static void ipmi_imb_timeout(unsigned long data) +{ + struct list_head *entry, *entry2; + struct priv_data *priv = (struct priv_data *) data; + int timeout_period = IPMI_TIMEOUT_TIME; + struct ipmi_recv_msg *msg; + + if (stop_operation) { + timer_stopped = 1; + return; + } + + /* Now time out any messages in the Imb message queue. */ + spin_lock(&(priv->imb_lock)); + list_for_each_safe(entry, entry2, &(priv->imb_waiting_rsps)) { + long *timeout; + msg = list_entry(entry, struct ipmi_recv_msg, link); + timeout = imb_timeout(msg); + *timeout -= timeout_period; + if ((*timeout) <= 0) { + list_del(entry); + ipmi_free_recv_msg(msg); + } + } + list_for_each_safe(entry, entry2, &(priv->imb_waiting_cmds)) { + long *timeout; + msg = list_entry(entry, struct ipmi_recv_msg, link); + timeout = imb_timeout(msg); + *timeout -= timeout_period; + if ((*timeout) <= 0) { + list_del(entry); + ipmi_free_recv_msg(msg); + } + } + spin_unlock(&priv->imb_lock); + + ipmi_imb_timer.expires += IPMI_TIMEOUT_JIFFIES; + add_timer(&ipmi_imb_timer); +} + +#define DEVICE_NAME "imb" + +static int ipmi_imb_major = 0; +MODULE_PARM(ipmi_imb_major, "i"); + +static struct ipmi_user_hndl ipmi_hndlrs = +{ + ipmi_recv_hndl : imb_msg_recv +}; + +static int init_ipmi_imb(void) +{ + int rv; + + if (ipmi_imb_major < 0) + return -EINVAL; + + ipmi_user = kmalloc(sizeof(*ipmi_user), GFP_KERNEL); + if (!ipmi_user) { + return -ENOMEM; + } + + /* Create the Imb interface user. */ + spin_lock_init(&(ipmi_user->imb_lock)); + INIT_LIST_HEAD(&(ipmi_user->imb_waiting_rsps)); + init_waitqueue_head(&(ipmi_user->imb_waiting_rsp_rcvrs)); + INIT_LIST_HEAD(&(ipmi_user->imb_waiting_cmds)); + init_waitqueue_head(&(ipmi_user->imb_waiting_cmd_rcvrs)); + ipmi_user->imb_cmd_waiting = 0; + INIT_LIST_HEAD(&(ipmi_user->imb_waiting_events)); + + rv = ipmi_create_user(0, + &ipmi_hndlrs, + ipmi_user, + &(ipmi_user->imb_user)); + if (rv) { + kfree(ipmi_user); + ipmi_user = NULL; + return rv; + } + + rv = register_chrdev(ipmi_imb_major, DEVICE_NAME, &ipmi_fops); + if (rv < 0) + { + kfree(ipmi_user); + ipmi_user = NULL; + printk(KERN_ERR "ipmi: can't get major %d\n", + ipmi_imb_major); + return rv; + } + + if (ipmi_imb_major == 0) + { + ipmi_imb_major = rv; + } + + devfs_handle = devfs_register(NULL, DEVICE_NAME, DEVFS_FL_NONE, + ipmi_imb_major, 0, + S_IFCHR | S_IRUSR | S_IWUSR, + &ipmi_fops, NULL); + + ipmi_imb_timer.data = (long) ipmi_user; + ipmi_imb_timer.function = ipmi_imb_timeout; + ipmi_imb_timer.expires = jiffies + IPMI_TIMEOUT_JIFFIES; + add_timer(&ipmi_imb_timer); + + printk(KERN_INFO "ipmi_imb: driver initialized at char major %d\n", + ipmi_imb_major); + + return 0; +} + +#ifdef MODULE +static void free_recv_msg_list(struct list_head *q) +{ + struct list_head *entry, *entry2; + struct ipmi_recv_msg *msg; + + list_for_each_safe(entry, entry2, q) { + msg = list_entry(entry, struct ipmi_recv_msg, link); + list_del(entry); + ipmi_free_recv_msg(msg); + } +} + +static void cleanup_ipmi_imb(void) +{ + devfs_unregister(devfs_handle); + + /* Tell the timer to stop, then wait for it to stop. This avoids + problems with race conditions removing the timer here. */ + stop_operation = 1; + while (!timer_stopped) { + schedule_timeout(1); + } + + ipmi_destroy_user(ipmi_user->imb_user); + + free_recv_msg_list(&(ipmi_user->imb_waiting_rsps)); + free_recv_msg_list(&(ipmi_user->imb_waiting_cmds)); + free_recv_msg_list(&(ipmi_user->imb_waiting_events)); + + kfree(ipmi_user); + ipmi_user = NULL; + + unregister_chrdev(ipmi_imb_major, DEVICE_NAME); +} +module_exit(cleanup_ipmi_imb); +#else +static int __init ipmi_imb_setup (char *str) +{ + int x; + + if (get_option (&str, &x)) { + /* ipmi=x sets the major number to x. */ + ipmi_imb_major = x; + } else if (!strcmp(str, "off")) { + ipmi_imb_major = -1; + } + + return 1; +} +__setup("ipmi_imb=", ipmi_imb_setup); +#endif + +module_init(init_ipmi_imb); +MODULE_LICENSE("GPL"); --- /dev/null 2002-08-30 19:31:37.000000000 -0400 +++ linux-2.4.18-14/drivers/char/ipmi/ipmi_radisys.c 2003-03-27 15:32:59.000000000 -0500 @@ -0,0 +1,834 @@ +/* + * ipmi_radisys.c + * + * Radisys emulation for the IPMI interface. + * + * Author: MontaVista Software, Inc. + * Corey Minyard + * source@mvista.com + * + * Copyright 2002 MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +struct priv_data +{ + /* This is for supporting the old Radisys interface. */ + ipmi_user_t rs_user; + spinlock_t rs_lock; + + /* A list of responses in the queue. */ + struct list_head rs_waiting_rsps; + + /* A list of things waiting for responses. We wake them all up + when a response comes in. */ + wait_queue_head_t rs_waiting_rsp_rcvrs; + + /* A list of commands that have come in. */ + struct list_head rs_waiting_cmds; + + /* A list of thing waiting for commands. We wake them all up + when a command comes in. */ + wait_queue_head_t rs_waiting_cmd_rcvrs; + + /* The registered command receiver value. This only allows someone + with the "magic number" to issue commands. */ + unsigned long rs_cmd_receiver; + + /* Is someone already waiting for a command? The Radisys driver + only allows one waiter, this enforces that. */ + int rs_cmd_waiting; + + /* A list of IPMI events waiting to be delivered. (not that + the Radisys driver calls incoming commands "events", this + variable is actual IPMI events, not incoming commands). */ + struct list_head rs_waiting_events; + +#define RS_EVENT_QUEUE_LIMIT 16 /* Allow up to 16 events. */ + /* The number of events in the event queue. */ + unsigned int rs_waiting_event_count; +}; + + +static devfs_handle_t devfs_handle; + +/* We cheat and use a piece of the address as the timeout. */ +static long *rs_timeout(struct ipmi_recv_msg *msg) +{ + char *base = (char *) &(msg->addr); + base += sizeof(struct ipmi_ipmb_addr); + return (long *) base; +} + +static void rs_msg_recv(struct ipmi_recv_msg *msg, + void *data) +{ + struct priv_data *priv = data; + unsigned long flags; + + spin_lock_irqsave(&(priv->rs_lock), flags); + if (msg->recv_type == IPMI_RESPONSE_RECV_TYPE) { + *rs_timeout(msg) = 5000; + list_add_tail(&(msg->link), &(priv->rs_waiting_rsps)); + wake_up_all(&(priv->rs_waiting_rsp_rcvrs)); + } else if (msg->recv_type == IPMI_CMD_RECV_TYPE) { + *rs_timeout(msg) = 5000; + list_add_tail(&(msg->link), &(priv->rs_waiting_cmds)); + wake_up_all(&(priv->rs_waiting_cmd_rcvrs)); + } else if (msg->recv_type == IPMI_ASYNC_EVENT_RECV_TYPE) { + if (priv->rs_waiting_event_count > RS_EVENT_QUEUE_LIMIT) { + ipmi_free_recv_msg(msg); + } else { + list_add_tail(&(msg->link),&(priv->rs_waiting_events)); + (priv->rs_waiting_event_count)++; + } + } else { + ipmi_free_recv_msg(msg); + } + spin_unlock_irqrestore(&(priv->rs_lock), flags); +} + +/* We emulate the event queue in the driver for the Radisys emulation. */ +static int rs_handle_event_request(struct priv_data *priv) +{ + struct list_head *entry; + unsigned long flags; + struct ipmi_recv_msg *msg = NULL; + int rv = 0; + + spin_lock_irqsave(&(priv->rs_lock), flags); + if (list_empty(&(priv->rs_waiting_events))) { + /* Nothing in the event queue, just return an error. */ + msg = ipmi_alloc_recv_msg(); + if (msg == NULL) { + rv = -EAGAIN; + goto out_err; + } + msg->addr.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + msg->addr.channel = IPMI_BMC_CHANNEL; + msg->msg.cmd = IPMI_READ_EVENT_MSG_BUFFER_CMD; + msg->msgid = 0; + msg->recv_type = IPMI_ASYNC_EVENT_RECV_TYPE; + msg->msg.netfn = IPMI_NETFN_APP_RESPONSE; + msg->msg.data = msg->msg_data; + msg->msg.data[0] = 0x80; /* Data not available. */ + msg->msg.data_len = 1; + } else { + /* Pull an item from the event queue . */ + entry = priv->rs_waiting_events.next; + list_del(entry); + msg = list_entry(entry, struct ipmi_recv_msg, link); + (priv->rs_waiting_event_count)--; + } + + /* Put the response into the list of waiting responses and + wake all the response waiters up. */ + *rs_timeout(msg) = 5000; + list_add_tail(&(msg->link), &(priv->rs_waiting_rsps)); + wake_up_all(&(priv->rs_waiting_rsp_rcvrs)); + + out_err: + spin_unlock_irqrestore(&(priv->rs_lock), flags); + return rv; +} + +static struct ipmi_recv_msg *rs_find_in_list(struct list_head *q, + unsigned char slave_addr, + unsigned char lun, + unsigned char netfn, + unsigned char cmd, + unsigned char seq) +{ + struct list_head *entry; + struct ipmi_recv_msg *msg; + struct ipmi_addr addr; + unsigned char msg_seq; + + if (slave_addr == 1) { + struct ipmi_system_interface_addr *smi_addr; + smi_addr = (struct ipmi_system_interface_addr *) &addr; + smi_addr->addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + smi_addr->lun = lun; + /* Slave address 1 means no matching sequence in the + Radisys driver. */ + } else { + struct ipmi_ipmb_addr *ipmb_addr; + ipmb_addr = (struct ipmi_ipmb_addr *) &addr; + ipmb_addr->addr_type = IPMI_IPMB_ADDR_TYPE; + ipmb_addr->slave_addr = slave_addr; + ipmb_addr->lun = lun; + } + + list_for_each(entry, q) { + msg = list_entry(entry, struct ipmi_recv_msg, link); + if (msg->addr.channel == IPMI_BMC_CHANNEL) + msg_seq = 0; + else + msg_seq = msg->msgid; + + /* We ignore the channel for these comparisons, since the + Radisys driver seems to ignore it. */ + addr.channel = msg->addr.channel; + + if ((msg_seq == seq) + && (msg->msg.cmd == cmd) + && (msg->msg.netfn == (netfn >> 2)) + && ipmi_addr_equal(&addr, &(msg->addr))) + { + list_del(entry); + return msg; + } + } + + return NULL; +} + +static struct priv_data *ipmi_user; +static unsigned int user_count = 0; /* How many users have this open. */ +static spinlock_t dev_lock = SPIN_LOCK_UNLOCKED; + +static int ipmi_open(struct inode *inode, struct file *file) +{ + file->private_data = ipmi_user; + spin_lock(&dev_lock); + if (user_count == 0) + ipmi_set_gets_events(ipmi_user->rs_user, 1); + user_count++; + spin_unlock(&dev_lock); + + return 0; +} + +static int ipmi_release(struct inode *inode, struct file *file) +{ + spin_lock(&dev_lock); + user_count--; + if (user_count == 0) + ipmi_set_gets_events(ipmi_user->rs_user, 0); + spin_unlock(&dev_lock); + return 0; +} + +static unsigned char +ipmb_checksum(unsigned char *data, int size) +{ + unsigned char csum = 0; + + for (; size > 0; size--, data++) + csum += *data; + + return -csum; +} + +static int ipmi_ioctl(struct inode *inode, + struct file *file, + unsigned int cmd, + unsigned long data) +{ + struct priv_data *priv = file->private_data; + int rv = -EINVAL; + + switch(cmd) { + case IOCTL_IPMI_RCV: /* get ipmi message */ + { + IPMI_MSGDESC rsp; + struct ipmi_recv_msg *msg; + unsigned long flags; + long timeout; + wait_queue_t wait; + + if (copy_from_user(&rsp, (void *) data, sizeof(rsp))) { + rv = -EFAULT; + break; + } + + rv = 0; + + spin_lock_irqsave(&(priv->rs_lock), flags); + + msg = rs_find_in_list(&(priv->rs_waiting_rsps), + rsp.Dest.uchSlave, + rsp.Dest.uchLun, + rsp.uchNetFn, + rsp.uchCmd, + rsp.uchSeq); + init_waitqueue_entry(&wait, current); + add_wait_queue(&(priv->rs_waiting_rsp_rcvrs), + &wait); + timeout = 5000 / (1000 / HZ); + while (msg == NULL) { + set_current_state(TASK_INTERRUPTIBLE); + if (!signal_pending(current)) { + spin_unlock_irqrestore + (&(priv->rs_lock), flags); + timeout = schedule_timeout(timeout); + spin_lock_irqsave + (&(priv->rs_lock), flags); + } else { + rv = -ERESTARTSYS; + break; + } + if (timeout <= 0) { + rsp.uchComplete = IPMI_TIMEOUT_COMPLETION_CODE; + break; + } else { + msg = rs_find_in_list + (&(priv->rs_waiting_rsps), + rsp.Dest.uchSlave, + rsp.Dest.uchLun, + rsp.uchNetFn, + rsp.uchCmd, + rsp.uchSeq); + } + } + remove_wait_queue(&(priv->rs_waiting_rsp_rcvrs), + &wait); + spin_unlock_irqrestore(&(priv->rs_lock), flags); + + if (msg != NULL) { + rsp.uchComplete = msg->msg.data[0]; + /* The Radisys driver expects all the data to + be there in the data, even the stuff we + already have processed for it. So make is + so. */ + if (msg->addr.channel == IPMI_BMC_CHANNEL) { + struct ipmi_system_interface_addr *smi_addr; + + smi_addr = ((struct ipmi_system_interface_addr *) + &(msg->addr)); + memcpy(&(rsp.auchBuffer[2]), + &(msg->msg.data[0]), + msg->msg.data_len); + rsp.ulLength = msg->msg.data_len+2; + rsp.auchBuffer[0] = ((msg->msg.netfn << 2) + | (smi_addr->lun)); + rsp.auchBuffer[1] = msg->msg.cmd; + } else { + struct ipmi_ipmb_addr *ipmb_addr; + + ipmb_addr = (struct ipmi_ipmb_addr *) &msg->addr; + memcpy(&(rsp.auchBuffer[9]), + &(msg->msg.data[0]), + msg->msg.data_len); + rsp.ulLength = msg->msg.data_len+10; + rsp.auchBuffer[0] = IPMI_NETFN_APP_REQUEST << 2; + rsp.auchBuffer[1] = IPMI_GET_MSG_CMD; + rsp.auchBuffer[2] = 0; + rsp.auchBuffer[3] = msg->addr.channel; + rsp.auchBuffer[4] = ((msg->msg.netfn << 2) + | 2); + rsp.auchBuffer[5] + = ipmb_checksum(&(rsp.auchBuffer[3]), + 2); + rsp.auchBuffer[6] = ipmb_addr->slave_addr; + rsp.auchBuffer[7] = ((msg->msgid << 2) + | ipmb_addr->lun); + rsp.auchBuffer[8] = msg->msg.cmd; + rsp.auchBuffer[msg->msg.data_len+9] + = ipmb_checksum(&(rsp.auchBuffer[6]), + msg->msg.data_len+3); + } + ipmi_free_recv_msg(msg); + } + + if (copy_to_user((void *) data, &rsp, sizeof(rsp))) { + rv = -EFAULT; + break; + } + + break; + } + + case IOCTL_IPMI_SEND: /* send ipmi message */ + { + IPMI_MSGDESC req; + struct ipmi_addr addr; + struct ipmi_msg msg; + unsigned char source_address; + unsigned char source_lun; + unsigned int start_offset; + + if (copy_from_user(&req, (void *) data, sizeof(req))) { + rv = -EFAULT; + break; + } + + if (req.Dest.uchSlave == 1) { + struct ipmi_system_interface_addr *smi_addr + = (struct ipmi_system_interface_addr *) &addr; + if ((req.uchNetFn == (IPMI_NETFN_APP_REQUEST << 2)) + && (req.uchCmd == IPMI_READ_EVENT_MSG_BUFFER_CMD)) + { + /* The driver gets event messages + automatically, so we emulate + this. */ + rv = rs_handle_event_request(priv); + break; + } + + smi_addr->addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + smi_addr->channel = IPMI_BMC_CHANNEL; + smi_addr->lun = req.uchNetFn & 0x3; + source_address = 0; + source_lun = 0; + start_offset = 2; + } else { + struct ipmi_ipmb_addr *ipmb_addr = + (struct ipmi_ipmb_addr *) &addr; + + ipmb_addr->addr_type = IPMI_IPMB_ADDR_TYPE; + ipmb_addr->channel = 0; + ipmb_addr->slave_addr = req.Dest.uchSlave; + ipmb_addr->lun = req.Dest.uchLun; + source_address = req.auchBuffer[6]; + source_lun = req.auchBuffer[7] & 0x3; + start_offset = 9; + req.ulLength--; /* Remove the checksum the userland + process adds. */ + } + + msg.netfn = req.uchNetFn >> 2; + msg.cmd = req.uchCmd; + msg.data = req.auchBuffer + start_offset; + msg.data_len = req.ulLength - start_offset; + + rv = ipmi_request_with_source(priv->rs_user, + &addr, + req.uchSeq, + &msg, + 0, + source_address, + source_lun); + if (rv) + req.uchComplete = IPMI_UNKNOWN_ERR_COMPLETION_CODE; + else + req.uchComplete = 0; + /* The Radisys driver does no error checking here. */ + copy_to_user((void *) data, &req, sizeof(req)); + rv = 0; + break; + } + + case IOCTL_IPMI_EVENT: /* get an incoming command. Don't be + fooled by the name, these are + commands, not IPMI events. */ + { + IPMI_MSGDESC rsp; + struct ipmi_recv_msg *msg = NULL; + struct list_head *entry; + unsigned long flags; + long timeout; + unsigned long receiver; + wait_queue_t wait; + + if (copy_from_user(&receiver, (void *) data, sizeof(receiver))) + { + rv = -EFAULT; + break; + } + + if (copy_from_user(&timeout, + (void *) (data + sizeof(receiver)), + sizeof(timeout))) + { + rv = -EFAULT; + break; + } + + rv = 0; + + spin_lock_irqsave(&(priv->rs_lock), flags); + + /* If someone else is already waiting, the Radisys driver + returns EFAULT, so we do to. */ + if (priv->rs_cmd_waiting) { + spin_unlock_irqrestore(&(priv->rs_lock), flags); + rv = -EFAULT; + break; + } + + /* If the user thread doesn't match up, abort. */ + if (receiver != priv->rs_cmd_receiver) { + spin_unlock_irqrestore(&(priv->rs_lock), flags); + rsp.uchComplete = IPMI_INVALID_CMD_COMPLETION_CODE; + break; + } + + init_waitqueue_entry(&wait, current); + add_wait_queue(&(priv->rs_waiting_cmd_rcvrs), + &wait); + priv->rs_cmd_waiting = 1; + timeout = timeout / (1000 / HZ); /* from ms to jiffies */ + while ((timeout > 0) && + list_empty(&(priv->rs_waiting_cmds))) + { + set_current_state(TASK_INTERRUPTIBLE); + if (!signal_pending(current)) { + spin_unlock_irqrestore + (&(priv->rs_lock), flags); + timeout = schedule_timeout(timeout); + spin_lock_irqsave + (&(priv->rs_lock), flags); + } else { + rv = -ERESTARTSYS; + break; + } + } + if (!list_empty(&(priv->rs_waiting_cmds))) { + entry = priv->rs_waiting_cmds.next; + list_del(entry); + msg = list_entry(entry, struct ipmi_recv_msg, link); + } + priv->rs_cmd_waiting = 0; + remove_wait_queue(&(priv->rs_waiting_cmd_rcvrs), + &wait); + spin_unlock_irqrestore(&(priv->rs_lock), flags); + + if (msg != NULL) { + /* The Radisys driver expects all the data to + be there in the data, even the stuff we + already have processed for it. So make is + so. */ + struct ipmi_ipmb_addr *ipmb_addr; + + ipmb_addr = (struct ipmi_ipmb_addr *) &msg->addr; + memcpy(&(rsp.auchBuffer[9]), + &(msg->msg.data[0]), + msg->msg.data_len); + rsp.ulLength = msg->msg.data_len+9; + rsp.auchBuffer[0] = IPMI_NETFN_APP_REQUEST << 2; + rsp.auchBuffer[1] = IPMI_SEND_MSG_CMD; + rsp.auchBuffer[2] = 0; + rsp.auchBuffer[3] = msg->addr.channel; + rsp.auchBuffer[4] = ((msg->msg.netfn << 2) + | 2); + rsp.auchBuffer[5] + = ipmb_checksum(&(rsp.auchBuffer[3]), + 2); + rsp.auchBuffer[6] = ipmb_addr->slave_addr; + rsp.auchBuffer[7] = ((msg->msgid << 2) + | ipmb_addr->lun); + rsp.auchBuffer[8] = msg->msg.cmd; + + rsp.uchNetFn = (msg->msg.netfn << 2); + rsp.uchCmd = msg->msg.cmd; + rsp.uchSeq = msg->msgid; + rsp.ulLength = msg->msg.data_len + 9; + ipmi_free_recv_msg(msg); + } else if (!rv) { + /* On a time out, the Radisys driver returns + IPMIRC_ERROR in the completion code, for + some wierd reason. */ + rsp.uchComplete = IPMI_UNKNOWN_ERR_COMPLETION_CODE; + } + + /* The Radisys driver does no error checking here. */ + copy_to_user((void *) data, &rsp, sizeof(rsp)); + rv = 0; + break; + } + + case IOCTL_IPMI_REGISTER: /* register as event receiver */ + { + unsigned long receiver; + unsigned char rc = LOWLRC_SUCCESS; + unsigned long flags; + + if (copy_from_user(&receiver, (void *) data, sizeof(receiver))) + { + rv = -EFAULT; + break; + } + + spin_lock_irqsave(&(priv->rs_lock), flags); + if (priv->rs_cmd_receiver == 0) { + rv = ipmi_register_all_cmd_rcvr(priv->rs_user); + if (rv) { + priv->rs_cmd_receiver = receiver; + } else { + rc = LOWLRC_ERROR; + } + } else if (priv->rs_cmd_receiver != receiver) { + rc = LOWLRC_ERROR; + } + spin_unlock_irqrestore(&(priv->rs_lock), flags); + + /* The Radisys driver does no error checking here. */ + copy_to_user((void *) data, &rc, sizeof(rc)); + rv = 0; + break; + } + + case IOCTL_IPMI_UNREGISTER: /* unregister as event receiver */ + { + unsigned long receiver; + unsigned char rc = LOWLRC_SUCCESS; + unsigned long flags; + + if (copy_from_user(&receiver, (void *) data, sizeof(receiver))) + { + rv = -EFAULT; + break; + } + + spin_lock_irqsave(&(priv->rs_lock), flags); + if (priv->rs_cmd_receiver == receiver) { + ipmi_unregister_all_cmd_rcvr(priv->rs_user); + priv->rs_cmd_receiver = 0; + } else { + rc = LOWLRC_ERROR; + } + spin_unlock_irqrestore(&(priv->rs_lock), flags); + + /* The Radisys driver does no error checking here. */ + copy_to_user((void *) data, &rc, sizeof(rc)); + rv = 0; + break; + } + + case IOCTL_IPMI_CLEAR: /* clear registered event receiver */ + { + unsigned char rc = LOWLRC_SUCCESS; + unsigned long flags; + + spin_lock_irqsave(&(priv->rs_lock), flags); + ipmi_unregister_all_cmd_rcvr(priv->rs_user); + priv->rs_cmd_receiver = 0; + spin_unlock_irqrestore(&(priv->rs_lock), flags); + + /* The Radisys driver does no error checking here. */ + copy_to_user((void *) data, &rc, sizeof(rc)); + rv = 0; + break; + } + } + + return rv; +} + +static struct file_operations ipmi_fops = { + owner: THIS_MODULE, + ioctl: ipmi_ioctl, + open: ipmi_open, + release: ipmi_release +}; + +static struct timer_list ipmi_radisys_timer; + +/* Call every 100 ms. */ +#define IPMI_TIMEOUT_TIME 100 +#define IPMI_TIMEOUT_JIFFIES (IPMI_TIMEOUT_TIME/(1000/HZ)) + +/* Request events from the queue every second. Hopefully, in the + future, IPMI will add a way to know immediately if an event is + in the queue. */ +#define IPMI_REQUEST_EV_TIME (1000 / (IPMI_TIMEOUT_TIME)) + +static volatile int stop_operation = 0; +static volatile int timer_stopped = 0; + +static void ipmi_radisys_timeout(unsigned long data) +{ + struct list_head *entry, *entry2; + struct priv_data *priv = (struct priv_data *) data; + int timeout_period = IPMI_TIMEOUT_TIME; + struct ipmi_recv_msg *msg; + + if (stop_operation) { + timer_stopped = 1; + return; + } + + /* Now time out any messages in the Radisys message queue. */ + spin_lock(&(priv->rs_lock)); + list_for_each_safe(entry, entry2, &(priv->rs_waiting_rsps)) { + long *timeout; + msg = list_entry(entry, struct ipmi_recv_msg, link); + timeout = rs_timeout(msg); + *timeout -= timeout_period; + if ((*timeout) <= 0) { + list_del(entry); + ipmi_free_recv_msg(msg); + } + } + list_for_each_safe(entry, entry2, &(priv->rs_waiting_cmds)) { + long *timeout; + msg = list_entry(entry, struct ipmi_recv_msg, link); + timeout = rs_timeout(msg); + *timeout -= timeout_period; + if ((*timeout) <= 0) { + list_del(entry); + ipmi_free_recv_msg(msg); + } + } + spin_unlock(&priv->rs_lock); + + ipmi_radisys_timer.expires += IPMI_TIMEOUT_JIFFIES; + add_timer(&ipmi_radisys_timer); +} + +#define DEVICE_NAME "ipmi_radisys" + +static int ipmi_radisys_major = 0; +MODULE_PARM(ipmi_radisys_major, "i"); + +static struct ipmi_user_hndl ipmi_hndlrs = +{ + ipmi_recv_hndl : rs_msg_recv +}; + + +static int init_ipmi_radisys(void) +{ + int rv; + + if (ipmi_radisys_major < 0) + return -EINVAL; + + ipmi_user = kmalloc(sizeof(*ipmi_user), GFP_KERNEL); + if (!ipmi_user) { + printk("ipmi_radisys: Unable to allocate memory\n"); + return -ENOMEM; + } + + /* Create the Radisys interface user. */ + spin_lock_init(&(ipmi_user->rs_lock)); + INIT_LIST_HEAD(&(ipmi_user->rs_waiting_rsps)); + init_waitqueue_head(&(ipmi_user->rs_waiting_rsp_rcvrs)); + INIT_LIST_HEAD(&(ipmi_user->rs_waiting_cmds)); + init_waitqueue_head(&(ipmi_user->rs_waiting_cmd_rcvrs)); + ipmi_user->rs_cmd_waiting = 0; + INIT_LIST_HEAD(&(ipmi_user->rs_waiting_events)); + + rv = ipmi_create_user(0, + &ipmi_hndlrs, + ipmi_user, + &(ipmi_user->rs_user)); + if (rv) { + printk("ipmi_radisys: Unable to create an IPMI user, probably" + " no physical devices present.\n"); + kfree(ipmi_user); + ipmi_user = NULL; + return rv; + } + + rv = register_chrdev(ipmi_radisys_major, DEVICE_NAME, &ipmi_fops); + if (rv < 0) + { + printk("ipmi_radisys: Unable to create the character device\n"); + kfree(ipmi_user); + ipmi_user = NULL; + printk(KERN_ERR "ipmi: can't get major %d\n", + ipmi_radisys_major); + return rv; + } + + if (ipmi_radisys_major == 0) + { + ipmi_radisys_major = rv; + } + + devfs_handle = devfs_register(NULL, DEVICE_NAME, DEVFS_FL_NONE, + ipmi_radisys_major, 0, + S_IFCHR | S_IRUSR | S_IWUSR, + &ipmi_fops, NULL); + + ipmi_radisys_timer.data = (long) ipmi_user; + ipmi_radisys_timer.function = ipmi_radisys_timeout; + ipmi_radisys_timer.expires = jiffies + IPMI_TIMEOUT_JIFFIES; + add_timer(&ipmi_radisys_timer); + + printk(KERN_INFO "ipmi_radisys: driver initialized at char major %d\n", + ipmi_radisys_major); + + return 0; +} + +#ifdef MODULE +static void free_recv_msg_list(struct list_head *q) +{ + struct list_head *entry, *entry2; + struct ipmi_recv_msg *msg; + + list_for_each_safe(entry, entry2, q) { + msg = list_entry(entry, struct ipmi_recv_msg, link); + list_del(entry); + ipmi_free_recv_msg(msg); + } +} + +static void cleanup_ipmi_radisys(void) +{ + devfs_unregister(devfs_handle); + + /* Tell the timer to stop, then wait for it to stop. This avoids + problems with race conditions removing the timer here. */ + stop_operation = 1; + while (!timer_stopped) { + schedule_timeout(1); + } + + ipmi_destroy_user(ipmi_user->rs_user); + + free_recv_msg_list(&(ipmi_user->rs_waiting_rsps)); + free_recv_msg_list(&(ipmi_user->rs_waiting_cmds)); + free_recv_msg_list(&(ipmi_user->rs_waiting_events)); + + kfree(ipmi_user); + ipmi_user = NULL; + + unregister_chrdev(ipmi_radisys_major, DEVICE_NAME); +} +module_exit(cleanup_ipmi_radisys); +#else +static int __init ipmi_radisys_setup (char *str) +{ + int x; + + if (get_option (&str, &x)) { + /* ipmi=x sets the major number to x. */ + ipmi_radisys_major = x; + } else if (!strcmp(str, "off")) { + ipmi_radisys_major = -1; + } + + return 1; +} +__setup("ipmi_radisys=", ipmi_radisys_setup); +#endif + +module_init(init_ipmi_radisys); +MODULE_LICENSE("GPL"); ipmiutil-3.0.7/kern/ipmi_kcs.patch0000644000076400007640000011630313160502144016647 0ustar acressloggers--- linux-2.4.2-virgin/drivers/char/misc.c Sun Apr 8 18:22:17 2001 +++ linux-bmc/drivers/char/misc.c Tue Oct 30 17:18:07 2001 @@ -273,6 +273,9 @@ #ifdef CONFIG_TOSHIBA tosh_init(); #endif +#ifdef CONFIG_IPMI_KCS + ipmi_kcs_init(); +#endif if (devfs_register_chrdev(MISC_MAJOR,"misc",&misc_fops)) { printk("unable to get major %d for misc devices\n", MISC_MAJOR); --- linux-2.4.2-virgin/drivers/char/Config.in Sun Apr 8 18:22:22 2001 +++ linux-bmc/drivers/char/Config.in Tue Oct 30 17:18:07 2001 @@ -81,6 +81,11 @@ dep_tristate 'Support for user-space parallel port device drivers' CONFIG_PPDEV $CONFIG_PARPORT fi +tristate 'IPMI KCS Interface' CONFIG_IPMI_KCS +if [ "$CONFIG_IPMI_KCS" != "n" ]; then + bool ' BMC watchdog timer support' CONFIG_BMC_WDT +fi + source drivers/i2c/Config.in source drivers/sensors/Config.in --- linux-2.4.2-virgin/drivers/char/Makefile Sun Apr 8 18:22:17 2001 +++ linux-bmc/drivers/char/Makefile Tue Oct 30 17:18:08 2001 @@ -191,6 +191,8 @@ obj-$(CONFIG_NWBUTTON) += nwbutton.o obj-$(CONFIG_NWFLASH) += nwflash.o +obj-$(CONFIG_IPMI_KCS) += ipmi_kcs.o + # Only one watchdog can succeed. We probe the hardware watchdog # drivers first, then the softdog driver. This means if your hardware # watchdog dies or is 'borrowed' for some reason the software watchdog --- linux-2.4.2-virgin/include/linux/miscdevice.h Sun Apr 8 18:47:26 2001 +++ linux-bmc/include/linux/miscdevice.h Tue Oct 30 17:32:42 2001 @@ -31,6 +31,9 @@ #define SGI_STREAMS_KEYBOARD 150 /* drivers/sgi/char/usema.c */ #define SGI_USEMACLONE 151 +#define IPMI_KCS_MINOR 173 +#define IPMI_BT_MINOR 210 +#define IPMI_SMIC_MINOR 211 #define TUN_MINOR 200 --- /dev/null Fri Mar 23 23:37:44 2001 +++ linux-bmc/drivers/char/ipmi_kcs.c Tue Oct 30 17:18:07 2001 @@ -0,0 +1,1211 @@ +/* + * Intelligent Platform Management Interface driver for Linux 2.2.x + * + * (c) Copyright 2000 San Mehat , All Rights Reserved. + * http://www.valinux.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Neither San Mehat nor VA Linux Systems admit liability nor provide + * warranty for any of this software. This material is provided + * "AS-IS" and at no charge. + * + * (c) Copyright 1999 San Mehat + * + * Release 0.04. - Initial Release + * + * Release 0.05. - Fixed ring buffer bugs... better buffer handling + * + * Release 0.06. - Changed polling freq to 1/10 sec + * + * Release 0.07. - Integrated watchdog commands into IOCTL's and added + * support for blinking front panel LED + * + * Release 0.08. - Sensor read commands added as ioctl + * + * Release 0.09. - Changed polling freq back to 1 second + * - Fixed possible bug where a chip status variable was + * not declared volatile. + * - Fixed buffer memory leak + * - Fixed ioctl return value problem + * - Changed architecture so that applications calling + * driver ioctl()'s are put to sleep after request + * is sent. The reply is handled by the normal + * driver polling timer queue and ring buffer + * + * Release 0.10. - Modified kcs_write routine so once a write is complete + * if the interface isn't in a 'READ STATE' it's okay. + * + * Release 0.12. - Added Intel Nightshade MB fixups since NS boards don't + * support pre-timeout NMI support + * - FRU download support added + * - /proc/ipmi created with fru data and driver status + * Release 0.13. - Added ioctl for setting asset tag + * - Fixed bug in /proc + * - Added asset tag max length field + * Release 1.00 - Added intelligent proc reading so that asset tag is + * refreshed whenever /proc/ipmi is read + * - Code cleanup + * - When asset tag is set with data whoes size is < maximum, + * pad the rest out with NULLs + * Release 1.10 - Fixed SMP bug which was causing command failures when + * /proc/ipmi was being read while a command was being + * executed (added semaphore) + * - Fixed /proc/ipmi so commands only get issued once + * Release 1.20 - Removed a bunch of useless warning msgs + * Release 1.30 - Added more stringent error checking when ISA state + * enters ERROR_STATE + * - Added better unexpected OBF handling on transactions + * - Explicitly set power sensor state to NO BLINKY on + * startup + * Release 2.0 - Re-wrote kcs state machine + * - Removed high level functions from driver + * - removed driver read() and write() capabilities + * - /proc/ipmi renamed to /proc/ipmi_kcs + * - /proc/ipmi_kcs now contains only BMC info + * + * Release 2.1 - Added support of watchdog timer through /dev/watchdog + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ipmi_kcs.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_PROC_FS +#include +#endif + +#ifdef CONFIG_BMC_WDT +#include +#endif + +/* function prototypes */ + +int ipmi_kcs_init(void); + +static int kcs_open(struct inode *inode, struct file *file); +static int kcs_release(struct inode *inode, struct file *file); +static ssize_t kcs_read(struct file *file, char *buf, size_t count, + loff_t * ptr); +static ssize_t kcs_write(struct file *file, const char *buf, size_t count, + loff_t * ppos); +static long long kcs_llseek(struct file *file, long long offset, + int origin); +static int kcs_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); + +#ifdef CONFIG_BMC_WDT +static int wdt_is_open; +static int watchdog_set(int cmd); +static int watchdog_reset(void); +static int wdt_open(struct inode *inode, struct file *file); +static int wdt_release(struct inode *inode, struct file *file); +static ssize_t wdt_write(struct file *file, const char *buf, size_t count, + loff_t * ppos); +static int wdt_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); + +static struct file_operations wdt_fops = { + owner:THIS_MODULE, + write:wdt_write, + ioctl:wdt_ioctl, + open:wdt_open, + release:wdt_release, +}; + +static struct miscdevice wdt_miscdev = { + WATCHDOG_MINOR, + "bmc_wdt", + &wdt_fops +}; + +/* module parameters */ +static int wdt_margin = 60; /* watchdog timer interval in seconds */ +static int wdt_pre = 1; /* watchdog pre-timeout interval in seconds */ +static int wdt_action = 0x03; /* Default is no pre-timeout interrupt and power cycle upon timeout */ + +MODULE_PARM(wdt_margin, "i"); +MODULE_PARM(wdt_pre, "i"); +MODULE_PARM(wdt_action, "i"); + +#define WATCHDOG_ENABLE 0x01 +#define WATCHDOG_DISABLE 0x02 +#endif + +static unsigned char get_kcs_state(void); +static unsigned char read_kcs_data(void); +static void write_kcs_data(unsigned char data); +static void write_kcs_cmd(unsigned char cmd); +static int is_obf_set(void); +static int clear_obf(void); +static int wait_while_ibf(void); +static int get_deviceid(void); +static int kcs_do_xfer(BMC_REQUEST * request, int request_len, + BMC_RESPONSE * response, int *response_len); +static int old_kcs_do_xfer(BMC_REQUEST * request, int request_len, + BMC_RESPONSE * response, int *response_len); +static int new_kcs_do_xfer(BMC_REQUEST * request, int request_len, + BMC_RESPONSE * response, int *response_len); + +#ifdef CONFIG_PROC_FS +int ipmi_get_info(char *buf, char **start, off_t fpos, int length, + int *eof, void *unused); +#endif + +/* static globals */ +static int kcs_refcnt = 0; +static int driver_major = 2; +static int driver_minor = 1; +static int kcs_machine = 0; + +static struct { + unsigned int tx_good; + unsigned int tx_bad; +} kcs_stat; + +static DEVICE_ID_RESPONSE dev_id; +DECLARE_MUTEX(kcs_sem); + +#ifdef CONFIG_PROC_FS +static struct proc_dir_entry *ipmi_proc_entry; +#endif + +static struct file_operations kcs_fops = { + owner:THIS_MODULE, + write:kcs_write, + ioctl:kcs_ioctl, + open:kcs_open, + release:kcs_release, + read:kcs_read, +}; + +static struct miscdevice kcs_miscdev = { + IPMI_KCS_MINOR, + "ipmi_kcs", + &kcs_fops +}; + +static struct ipmi_driver_info drv_inf; + +/***************/ + +static long long kcs_llseek(struct file *file, long long offset, + int origin) +{ + return -ESPIPE; +} + +static ssize_t kcs_write(struct file *file, const char *buf, size_t count, + loff_t * ppos) +{ + return (-ENOSYS); +} + +static ssize_t kcs_read(struct file *file, char *buf, size_t count, + loff_t * ptr) +{ + return (-ENOSYS); +} + +static int kcs_ioctl(struct inode *inode, + struct file *file, + unsigned int cmd, unsigned long arg) +{ + switch (cmd) { + case IOCTL_IPMI_XFER: + { + IPMI_XFER user_buffer; + int rc; + int response_len = sizeof(user_buffer.response); + + if (!arg) + return (-EFAULT); + if (copy_from_user + ((void *) &user_buffer, (void *) arg, + sizeof(IPMI_XFER))) + return (-EFAULT); + if ((user_buffer.request_len < 2) + || (user_buffer.response_len < 3)) + return (-EINVAL); + + rc = kcs_do_xfer((BMC_REQUEST *) & user_buffer. + request, user_buffer.request_len, + (BMC_RESPONSE *) & user_buffer. + response, &response_len); + user_buffer.response_len = response_len; + copy_to_user((void *) arg, (void *) &user_buffer, + sizeof(IPMI_XFER)); + return (rc); + } + case IOCTL_DRIVER_INFO: + { + struct ipmi_driver_info user_buffer; + + if (!arg) + return (-EFAULT); + if (copy_from_user + ((void *) &user_buffer, (void *) arg, + sizeof(user_buffer))) + return (-EFAULT); + copy_to_user((void *) arg, (void *) &drv_inf, + sizeof(drv_inf)); + return (0); + } + default: + return -EINVAL; + } + return (0); +} + +static int get_deviceid() +{ + unsigned char request_buffer[MAX_BUFFER_SIZE]; + unsigned char response_buffer[MAX_BUFFER_SIZE]; + BMC_REQUEST *bmc_req; + BMC_RESPONSE *bmc_resp; + int rc, response_len; + + memset(&dev_id, 0, sizeof(DEVICE_ID_RESPONSE)); + memset(request_buffer, 0, sizeof(request_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + bmc_req = (BMC_REQUEST *) request_buffer; + bmc_resp = (BMC_RESPONSE *) response_buffer; + response_len = sizeof(response_buffer); + + bmc_req->lun = 0; + bmc_req->netfn = APP_REQUEST; + bmc_req->cmd = 0x01; /* GET_DEVICE_ID */ + +#if defined(__ia64__) + rc = new_kcs_do_xfer(bmc_req, 2, bmc_resp, &response_len); +#else + rc = old_kcs_do_xfer(bmc_req, 2, bmc_resp, &response_len); +#endif + if (bmc_resp->cc != 0x00) { + printk("[IPMI_KCS] get_deviceid() failed (0x%.2x)\n", + bmc_resp->cc); + return (-EIO); + } + memcpy(&dev_id, bmc_resp->data, sizeof(DEVICE_ID_RESPONSE)); + return (0); +} + +static int kcs_open(struct inode *inode, struct file *file) +{ + switch (MINOR(inode->i_rdev)) { + case IPMI_KCS_MINOR: + { + MOD_INC_USE_COUNT; + kcs_refcnt++; + return 0; + } + default: + return -ENODEV; + } +} + +static int kcs_release(struct inode *inode, struct file *file) +{ + if (MINOR(inode->i_rdev) == IPMI_KCS_MINOR) { + kcs_refcnt--; + } + MOD_DEC_USE_COUNT; + return 0; +} + +#ifdef CONFIG_BMC_WDT +static ssize_t wdt_write(struct file *file, const char *buf, size_t count, + loff_t * ppos) +{ + /* Can't seek (pwrite) on this device */ + if (ppos != &file->f_pos) + return -ESPIPE; + + /* + * Stop and then restart the watchdog timer. + */ + if (count) { + if (watchdog_set(WATCHDOG_DISABLE)) + return -EIO; + if (watchdog_set(WATCHDOG_ENABLE)) + return -EIO; + if (watchdog_reset()) + return -EIO; + return 1; + } + return 0; +} + +static int wdt_ioctl(struct inode *inode, + struct file *file, + unsigned int cmd, unsigned long arg) +{ + static struct watchdog_info ident = { + WDIOF_KEEPALIVEPING, 1, "BMC WDT" + }; + + switch (cmd) { + case WDIOC_GETSUPPORT: + if (copy_to_user + ((struct watchdog_info *) arg, &ident, sizeof(ident))) + return -EFAULT; + break; + + case WDIOC_GETSTATUS: + if (copy_to_user((int *) arg, &wdt_is_open, sizeof(int))) + return -EFAULT; + break; + + case WDIOC_KEEPALIVE: + if (watchdog_set(WATCHDOG_DISABLE)) + return -EIO; + if (watchdog_set(WATCHDOG_ENABLE)) + return -EIO; + if (watchdog_reset()) + return -EIO; + break; + + default: + return -ENOIOCTLCMD; + } + return 0; +} + +static int watchdog_set(int cmd) +{ + unsigned char request_buffer[MAX_BUFFER_SIZE]; + unsigned char response_buffer[MAX_BUFFER_SIZE]; + BMC_REQUEST *bmc_req; + BMC_RESPONSE *bmc_resp; + int rc, response_len; + SET_WATCHDOG *set; + int fixup = 0; + + memset(request_buffer, 0, sizeof(request_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + bmc_req = (BMC_REQUEST *) request_buffer; + bmc_resp = (BMC_RESPONSE *) response_buffer; + response_len = sizeof(response_buffer); + + bmc_req->lun = 0; + bmc_req->netfn = APP_REQUEST; + bmc_req->cmd = 0x24; /* Set Watchdog Timer */ + + set = (SET_WATCHDOG *) bmc_req->data; + + while (1) { + set->timer_use = 0x04; + + set->timeout_action = wdt_action & 0x0F; + set->pre_irq = (wdt_action >> 4) & 0x0F; + + if (cmd == WATCHDOG_DISABLE) { + set->timeout_action = 0x00; + set->pre_irq = 0x00; + } + set->pretimeout_interval = wdt_pre; + + if (fixup) { + set->pre_irq = 0x00; + set->pretimeout_interval = 0; + } + + set->tuefc_biosfrb2 = 0x00; + set->tuefc_biospost = 0x0; + set->tuefc_osload = 0x00; + set->tuefc_smsos = 0x01; + set->initial_count = wdt_margin * 10; + + rc = kcs_do_xfer(bmc_req, 2 + sizeof(SET_WATCHDOG), + bmc_resp, &response_len); + + if (bmc_resp->cc == 0xcc) { + fixup++; + if (fixup == 2) { + printk + ("[IPMI_KCS] Flakey NMI fixup failed\n"); + return (-EIO); + } + printk("[IPMI_KCS] Flakey NMI fixup enabled\n"); + continue; + } else if (bmc_resp->cc != 0x00) { + printk + ("[IPMI_KCS] Set watchdog timer failed (rc = 0x%.2x)\n", + bmc_resp->cc); + return (-EIO); + } + break; + } + return (0); +} + +static int watchdog_reset() +{ + unsigned char request_buffer[MAX_BUFFER_SIZE]; + unsigned char response_buffer[MAX_BUFFER_SIZE]; + BMC_REQUEST *bmc_req; + BMC_RESPONSE *bmc_resp; + int rc, response_len; + + memset(request_buffer, 0, sizeof(request_buffer)); + memset(response_buffer, 0, sizeof(response_buffer)); + bmc_req = (BMC_REQUEST *) request_buffer; + bmc_resp = (BMC_RESPONSE *) response_buffer; + response_len = sizeof(response_buffer); + + bmc_req->lun = 0; + bmc_req->netfn = APP_REQUEST; + bmc_req->cmd = 0x22; /* Reset Watchdog Timer */ + + rc = kcs_do_xfer(bmc_req, 2, bmc_resp, &response_len); + if (bmc_resp->cc != 0x00) { + printk("[IPMI_KCS] Reset Watchdog Timer failed (0x%.2x)\n", + bmc_resp->cc); + return (-EIO); + } + return (0); +} + +static int wdt_open(struct inode *inode, struct file *file) +{ + switch (MINOR(inode->i_rdev)) { + case WATCHDOG_MINOR: + if (wdt_is_open) + return -EBUSY; + + MOD_INC_USE_COUNT; + /* + * Activate + */ + wdt_is_open = 1; + if (watchdog_reset()) + return -EIO; + return 0; + default: + return -ENODEV; + } +} + +static int wdt_release(struct inode *inode, struct file *file) +{ + lock_kernel(); + if (MINOR(inode->i_rdev) == WATCHDOG_MINOR) { +#ifndef CONFIG_WATCHDOG_NOWAYOUT + if (watchdog_set(WATCHDOG_DISABLE)) + return -EIO; +#endif + wdt_is_open = 0; + MOD_DEC_USE_COUNT; + } + unlock_kernel(); + return 0; +} + +/* + * Notifier for system down + */ + +static int wdt_notify_sys(struct notifier_block *this, unsigned long code, + void *unused) +{ + if (code == SYS_DOWN || code == SYS_HALT) { + /* Turn the timer off */ + watchdog_set(WATCHDOG_DISABLE); + } + return NOTIFY_DONE; +} + +/* + * The BMC needs to learn about soft shutdowns in order to + * turn the watchdog timer off. + */ + +static struct notifier_block wdt_notifier = { + wdt_notify_sys, + NULL, + 0 +}; +#endif + +#ifdef MODULE +int init_module(void) +{ + return (ipmi_kcs_init()); +} + +void cleanup_module(void) +{ + printk("[IPMI_KCS] Driver shutting down.\n"); +#ifdef CONFIG_PROC_FS + remove_proc_entry("ipmi_kcs", 0); +#endif + misc_deregister(&kcs_miscdev); +#ifdef CONFIG_BMC_WDT + misc_deregister(&wdt_miscdev); + unregister_reboot_notifier(&wdt_notifier); +#endif + release_region(KCS_BASE, 16); +} +#endif + +int ipmi_kcs_init() +{ + printk + ("IPMI KCS driver (San Mehat nettwerk@valinux.com) v%d.%d at io 0x%x\n", + driver_major, driver_minor, KCS_BASE); + request_region(KCS_BASE, 16, "ipmi_kcs"); + if ((inb_p(KCS_STATUS_REG) == 0xFF) && + (inb_p(KCS_DATAIN_REG) == 0xFF)) { + printk("--KCS ISA window not present. Driver exiting\n"); + release_region(KCS_BASE, 16); + return (-ENXIO); + } + + kcs_stat.tx_good = 0; + kcs_stat.tx_bad = 0; + memset(&drv_inf, 0, sizeof(drv_inf)); + strcpy(drv_inf.driver_name, "ipmi_kcs"); + drv_inf.major_ver = driver_major; + drv_inf.minor_ver = driver_minor; + + misc_register(&kcs_miscdev); +#ifdef CONFIG_BMC_WDT + misc_register(&wdt_miscdev); + register_reboot_notifier(&wdt_notifier); +#endif + get_deviceid(); + printk("--BMC version %x.%x, IPMI version %d.%d\n", + dev_id.major_firmware_revision, + dev_id.minor_firmware_revision, + dev_id.ipmi_version_major, dev_id.ipmi_version_minor); + if ((dev_id.ipmi_version_major == 0) && + (dev_id.ipmi_version_minor == 9)) { + printk("--Using legacy KCS state machine\n"); + kcs_machine = KCS_LEGACY; + drv_inf.flags |= KCS_FLAG_LEGACY; + } else { + printk("--Using new KCS state machine\n"); + kcs_machine = KCS_NEW; + } + if (!pci_present()) { + printk + ("--PCIBIOS not present. Unable to determine chipset vendor\n"); + drv_inf.flags |= KCS_FLAG_BLINKY; + } else { + int pci_index = 0; + unsigned char pci_bus, pci_device_fn; + unsigned short vendor, device; + + for (; pci_index < 0xff; pci_index++) { + if (pcibios_find_class(PCI_CLASS_BRIDGE_HOST << 8, + pci_index, + &pci_bus, + &pci_device_fn) != + PCIBIOS_SUCCESSFUL) { + break; + } + pcibios_read_config_word(pci_bus, pci_device_fn, + PCI_VENDOR_ID, &vendor); + pcibios_read_config_word(pci_bus, pci_device_fn, + PCI_DEVICE_ID, &device); + drv_inf.mb_chipset_vendor = vendor; + drv_inf.mb_chipset_device = device; + printk + ("--Motherboard Chipset vendor 0x%.4x, device 0x%.4x\n", + vendor, device); + if ((vendor == 0x8086) && (device == 0x71a0)) { + drv_inf.flags |= KCS_FLAG_BLINKY; + } + } + } + if (drv_inf.flags & KCS_FLAG_BLINKY) { + printk("--Intel Lancewood features enabled\n"); + } else + printk("--No vendor specific features enabled\n"); +#ifdef CONFIG_PROC_FS + if (!(ipmi_proc_entry = create_proc_entry("ipmi_kcs", 0, 0))) + printk(KERN_ERR, + "--ERROR: Unable to register /proc/ipmi_kcs\n"); + else + ipmi_proc_entry->read_proc = ipmi_get_info; + +#endif + return (0); +} + +static int kcs_do_xfer(BMC_REQUEST * request, + int request_len, + BMC_RESPONSE * response, int *response_len) +{ + int rc = 0; + + down(&kcs_sem); + switch (kcs_machine) { + case KCS_LEGACY: + { + rc = old_kcs_do_xfer(request, request_len, + response, response_len); + break; + } + case KCS_NEW: + { + rc = new_kcs_do_xfer(request, request_len, + response, response_len); + break; + } + default: + { + printk + ("[IPMI_KCS] Undefined or bad KCS state machine selected (%d)\n", + kcs_machine); + get_deviceid(); + if ((dev_id.ipmi_version_major == 0) && + (dev_id.ipmi_version_minor == 9)) { + printk + ("Recalibrated to use legacy KCS state machine\n"); + kcs_machine = KCS_LEGACY; + } else { + printk + ("Recalibrated to use new KCS state machine\n"); + kcs_machine = KCS_NEW; + } + rc = -EAGAIN; + break; + } + } + if (rc == 0) + kcs_stat.tx_good++; + else + kcs_stat.tx_bad++; + up(&kcs_sem); + return (rc); +} + +static int new_kcs_do_xfer(BMC_REQUEST * request, + int request_len, + BMC_RESPONSE * response, int *response_len) +{ + unsigned char *xmit_buffer, *recv_buffer; + int i = 0, rc = 0, state = SEND_INIT, bad = 0; + + xmit_buffer = (unsigned char *) request; + recv_buffer = (unsigned char *) response; + + while (1) { + if (state == END) + break; + else if (bad > 2) { + printk + ("[IPMI_KCS] Maximum retries exceeded. Aborting transfer\n"); + rc = -EIO; + break; + } + switch (state) { + case SEND_INIT: + { + i = 0; + state = SEND_START; + wait_while_ibf(); + if (clear_obf() != 0) { + state = ERROR; + break; + } + } + case SEND_START: + { + state = SEND_NEXT; + write_kcs_cmd(WRITE_START); + wait_while_ibf(); + if (get_kcs_state() != KCS_WRITE_STATE) { + state = ERROR; + break; + } + } + case SEND_NEXT: + { + if (i == (request_len - 1)) { + state = SEND_END; + break; + } + if (get_kcs_state() != KCS_WRITE_STATE) { + state = ERROR; + break; + } + write_kcs_data(xmit_buffer[i++]); + wait_while_ibf(); + if (get_kcs_state() != KCS_WRITE_STATE) { + state = ERROR; + break; + } + if (clear_obf() != 0) { + state = ERROR; + break; + } + break; + } + case SEND_END: + { + write_kcs_cmd(WRITE_END); + wait_while_ibf(); + if (get_kcs_state() != KCS_WRITE_STATE) { + state = ERROR; + break; + } + if (clear_obf() != 0) { + state = ERROR; + break; + } + write_kcs_data(xmit_buffer[i++]); + wait_while_ibf(); + state = RECV_START; + } + case RECV_START: + { + switch (get_kcs_state()) { + case KCS_ERROR_STATE: + { + state = ERROR; + break; + } + case KCS_WRITE_STATE: + case KCS_IDLE_STATE: + { + mdelay(BMC_RESPONSE_DELAY); + break; + } + case KCS_READ_STATE: + { + i = 0; + memset(recv_buffer, 0, + *response_len); + state = RECV_INIT; + break; + } + } + break; + } + case RECV_INIT: + { + switch (get_kcs_state()) { + case KCS_ERROR_STATE: + case KCS_WRITE_STATE: + { + state = ERROR; + break; + } + case KCS_IDLE_STATE: + { + state = RECV_END; + break; + } + case KCS_READ_STATE: + { + if (is_obf_set()) + state = RECV_NEXT; + else + mdelay(1); + break; + } + default: + { + mdelay(1); + break; + } + } + break; + } + case RECV_NEXT: + { + if (i >= *response_len) { + rc = -EOVERFLOW; + state = ERROR; + break; + } + recv_buffer[i++] = read_kcs_data(); + write_kcs_data(KCS_READ); + wait_while_ibf(); + state = RECV_INIT2; + break; + } + case RECV_INIT2: + { + switch (get_kcs_state()) { + case KCS_ERROR_STATE: + case KCS_WRITE_STATE: + { + state = ERROR; + break; + } + case KCS_IDLE_STATE: + { + if (wait_until_obf() == 0) { + clear_obf(); + state = RECV_END; + break; + } else { + state = ERROR; + break; + } + } + case KCS_READ_STATE: + { + if (wait_until_obf() == 0) + state = RECV_NEXT; + else + state = ERROR; + break; + } + } + break; + } + case RECV_END: + { + if ((i < MIN_BMC_RESPONSE_SIZE) || + (response->netfn != + (request->netfn | 0x01)) + || (response->cmd != request->cmd)) { + mdelay(BMC_RETRY_DELAY); + bad++; + state = SEND_INIT; + printk + ("[IPMI_KCS] Request/Response CMD/NETFN mismatch error\n"); + + printk + (" RQcmd/RQnetfn=0x%x/0x%x,RScmd/RSnetfn=0x%x/0x%x\n", + request->cmd, request->netfn, + response->cmd, + response->netfn); + break; + } + + *response_len = i; + rc = 0; + state = END; + break; + } + case ERROR: + default: + { + printk + ("[IPMI_KCS] BMC in bad state. Retrying transfer\n"); + mdelay(BMC_RETRY_DELAY); + bad++; + state = SEND_INIT; + break; + } + } + } + return (rc); +} + +static int old_kcs_do_xfer(BMC_REQUEST * request, + int request_len, + BMC_RESPONSE * response, int *response_len) +{ + unsigned char *xmit_buffer, *recv_buffer; + int i = 0, rc = 0, state = SEND_INIT, bad = 0; + + xmit_buffer = (unsigned char *) request; + recv_buffer = (unsigned char *) response; + + while (1) { + if (state == END) + break; + else if (bad > 2) { + printk + ("[IPMI_KCS] Maximum retries exceeded. Aborting transfer\n"); + rc = -EIO; + break; + } + switch (state) { + case SEND_INIT: + { + i = 0; + state = SEND_START; + wait_while_ibf(); + } + case SEND_START: + { + state = SEND_NEXT; + write_kcs_cmd(WRITE_START); + wait_while_ibf(); + } + case SEND_NEXT: + { + if (i == (request_len - 1)) { + state = SEND_END; + break; + } + if (get_kcs_state() != KCS_WRITE_STATE) { + state = ERROR; + break; + } + write_kcs_data(xmit_buffer[i++]); + wait_while_ibf(); + break; + } + case SEND_END: + { + wait_while_ibf(); + write_kcs_cmd(WRITE_END); + wait_while_ibf(); + if (get_kcs_state() != KCS_WRITE_STATE) { + state = ERROR; + break; + } + write_kcs_data(xmit_buffer[i++]); + wait_while_ibf(); + state = RECV_START; + } + case RECV_START: + { + switch (get_kcs_state()) { + case KCS_ERROR_STATE: + { + state = ERROR; + break; + } + case KCS_WRITE_STATE: + case KCS_IDLE_STATE: + { + mdelay(BMC_RESPONSE_DELAY); + break; + } + case KCS_READ_STATE: + { + i = 0; + memset(recv_buffer, 0, + *response_len); + state = RECV_INIT; + break; + } + } + break; + } + case RECV_INIT: + { + switch (get_kcs_state()) { + case KCS_ERROR_STATE: + case KCS_WRITE_STATE: + { + state = ERROR; + break; + } + case KCS_IDLE_STATE: + { + state = RECV_END; + break; + } + case KCS_READ_STATE: + { + if (is_obf_set()) + state = RECV_NEXT; + else + mdelay(1); + break; + } + default: + { + mdelay(1); + break; + } + } + break; + } + case RECV_NEXT: + { + if (i >= *response_len) { + rc = -EOVERFLOW; + state = ERROR; + break; + } + recv_buffer[i++] = read_kcs_data(); + wait_while_ibf(); + write_kcs_data(KCS_READ); + state = RECV_INIT2; + break; + } + case RECV_INIT2: + { + switch (get_kcs_state()) { + case KCS_ERROR_STATE: + case KCS_WRITE_STATE: + { + state = ERROR; + break; + } + case KCS_IDLE_STATE: + { + state = RECV_END; + break; + } + case KCS_READ_STATE: + { + if (is_obf_set()) + state = RECV_NEXT; + break; + } + } + break; + } + case RECV_END: + { + if ((i < MIN_BMC_RESPONSE_SIZE) || + (response->netfn != + (request->netfn | 0x01)) + || (response->cmd != request->cmd)) { + mdelay(BMC_RETRY_DELAY); + bad++; + state = SEND_INIT; + printk + ("[IPMI_KCS] Request/Response CMD/NETFN mismatch error\n"); + + printk + (" RQcmd/RQnetfn=0x%x/0x%x,RScmd/RSnetfn=0x%x/0x%x\n", + request->cmd, request->netfn, + response->cmd, + response->netfn); + break; + } + + *response_len = i; + rc = 0; + state = END; + break; + } + case ERROR: + default: + { + printk + ("[IPMI_KCS] BMC in bad state. Retrying transfer\n"); + mdelay(BMC_RETRY_DELAY); + bad++; + state = SEND_INIT; + break; + } + } + } + return (rc); +} + +#ifdef CONFIG_PROC_FS +int ipmi_get_info(char *buf, char **start, off_t fpos, int length, + int *eof, void *unused) +{ + char *p; + + if (get_deviceid() != 0) { + printk("[IPMI_KCS] Unable to get device ID\n"); + memset(&dev_id, 0, sizeof(dev_id)); + } + + p = buf; + p += sprintf(p, "Driver Version\t: %d.%d\n", + driver_major, driver_minor); + p += sprintf(p, "BMC Version\t: %x.%x\n", + dev_id.major_firmware_revision, + dev_id.minor_firmware_revision); + p += sprintf(p, "IPMI Version\t: %d.%d\n", + dev_id.ipmi_version_major, dev_id.ipmi_version_minor); + p += sprintf(p, "\nTotal Good Transactions\t: %d\n", + kcs_stat.tx_good); + p += sprintf(p, "Total Bad Transactions\t: %d\n", kcs_stat.tx_bad); + + return p - buf; +} +#endif + +/* + * kcs chip mashing stuff + */ +static int wait_while_ibf() +{ + unsigned char status_byte; + + status_byte = inb_p(KCS_STATUS_REG); + if ((status_byte & KCS_IBF) == 0) + return (0); + mdelay(KCS_READY_DELAY); + status_byte = inb_p(KCS_STATUS_REG); + if (status_byte & KCS_IBF) + return (-1); + return (0); +} + +static int wait_until_obf() +{ + int retries = 0; + + while (retries < 2) { + if (is_obf_set()) + return (0); + mdelay(KCS_READY_DELAY); + retries++; + } + return (-ETIMEDOUT); +} + +static unsigned char get_kcs_state() +{ + unsigned char cs; + + cs = inb_p(KCS_STATUS_REG); + return (cs & KCS_STATE_MASK); +} + +static unsigned char read_kcs_data() +{ + unsigned char data; + + data = inb_p(KCS_DATAOUT_REG); + return (data); +} + +static void write_kcs_data(unsigned char data) +{ + outb_p(data, KCS_DATAIN_REG); +} + +static void write_kcs_cmd(unsigned char cmd) +{ + outb_p(cmd, KCS_COMMAND_REG); +} + +static int is_obf_set() +{ + unsigned char cs; + + cs = inb_p(KCS_STATUS_REG); + return ((cs & KCS_OBF) == KCS_OBF); +} + +static int clear_obf() +{ + read_kcs_data(); + return (0); +} --- /dev/null Fri Mar 23 23:37:44 2001 +++ linux-bmc/drivers/char/ipmi_kcs.h Tue Oct 30 17:18:07 2001 @@ -0,0 +1,171 @@ +/* + * Intelligent Platform Management Interface driver for Linux 2.x + * + * (c) Copyright 1999 San Mehat & VA Linux Systems + * 1382 Bordeaux Dr. + * Sunnyvale, California + * 94089 + * + * http://www.valinux.com + * + * This driver is provided under the GNU public license, incorporated + * herein by reference. The driver is provided without warranty or + * support. + * + * + */ + +#include + +#define KCS_LEGACY 1 +#define KCS_NEW 2 + +#define KCS_READY_DELAY 5 +#define BMC_RESPONSE_DELAY 5 +#define BMC_RETRY_DELAY 60 + +#if defined(__ia64__) +#define KCS_BASE 0x8a2 +#else +#define KCS_BASE 0xca2 +#endif +#define KCS_STATUS_REG (KCS_BASE + 1) +#define KCS_COMMAND_REG (KCS_BASE + 1) +#define KCS_DATAIN_REG (KCS_BASE + 0) +#define KCS_DATAOUT_REG (KCS_BASE + 0) + +/* State bits based on S1 & S0 below */ +#define KCS_STATE_MASK 0xC0 +#define KCS_IDLE_STATE 0x00 +#define KCS_READ_STATE 0x40 +#define KCS_WRITE_STATE 0x80 +#define KCS_ERROR_STATE 0xC0 + +#define KCS_IBF 0x02 +#define KCS_OBF 0x01 +#define KCS_SMS_ATN 0x04 + +#define SEND_INIT 1 +#define SEND_START 2 +#define SEND_NEXT 3 +#define SEND_END 4 +#define RECV_START 5 +#define RECV_INIT 6 +#define RECV_NEXT 7 +#define RECV_INIT2 8 +#define RECV_END 9 +#define END 10 +#define ERROR 0 + +/* SMS Transfer Stream Control Codes */ +#define GET_STATUS_ABORT 0x60 +#define WRITE_START 0x61 +#define WRITE_END 0x62 +#define KCS_READ 0x68 + +#define MAX_INVALID_RESPONSE_COUNT 2 +#define MIN_BMC_RESPONSE_SIZE 3 +#define MAX_IMB_PACKET_SIZE 33 +#define MAX_BMC_RESPONSE_SIZE (MIN_BMC_RESPONSE_SIZE + MAX_IMB_PACKET_SIZE) +#define MAX_XFER_LENGTH (MAX_IMB_PACKET_SIZE * 2) + +#define MAX_BUFFER_SIZE 64 + +typedef struct bmc_response + { + unsigned char lun :2; + unsigned char netfn :6; + + unsigned char cmd; + unsigned char cc; + unsigned char data[1]; + }BMC_RESPONSE; + +typedef struct bmc_request + { + unsigned char lun :2; + unsigned char netfn :6; + + unsigned char cmd; + unsigned char data[1]; + }BMC_REQUEST; + +/* GET_DEVICE_ID RESPONSE */ +typedef struct device_id_response + { + unsigned char device_id; + + unsigned char device_revision :4; + unsigned char reserved :3; + unsigned char provides_sdr :1; + + unsigned char major_firmware_revision :7; + #define NORMAL_OPERATION 0 + #define DEVICE_BUSY 1 + unsigned char device_available :1; + + unsigned char minor_firmware_revision; + + unsigned char ipmi_version_major :4; + unsigned char ipmi_version_minor :4; + + unsigned char supports_sensor_device :1; + unsigned char supports_sdr_device :1; + unsigned char supports_sel_device :1; + unsigned char supports_fru_device :1; + unsigned char supports_ipmb_receiver :1; + unsigned char supports_ipmb_generator :1; + unsigned char supports_bridge :1; + unsigned char supports_chassis_device :1; + + unsigned char manufacturer_id1; + unsigned char manufacturer_id2; + unsigned char manufacturer_id3; + + unsigned short product_id; + } DEVICE_ID_RESPONSE; + +typedef struct set_watchdog + { + unsigned char timer_use :3; + unsigned char res1 :4; + unsigned char dontlog :1; + + unsigned char timeout_action :3; + unsigned char res2 :1; + unsigned char pre_irq :3; + unsigned char res3 :1; + + unsigned char pretimeout_interval; + + unsigned char tuefc_res1 :1; + unsigned char tuefc_biosfrb2 :1; + unsigned char tuefc_biospost :1; + unsigned char tuefc_osload :1; + unsigned char tuefc_smsos :1; + unsigned char tuefc_oem :1; + unsigned char tuefc_res2 :1; + unsigned char tuefc_res3 :1; + + unsigned short initial_count; + } SET_WATCHDOG; + +typedef struct get_watchdog_response + { + unsigned char timer_use :3; + unsigned char res1 :3; + unsigned char timer_status :1; + unsigned char sel_log :1; + + unsigned char timeout_act :3; + unsigned char res2 :1; + unsigned char pre_irq_act :3; + unsigned char res3 :1; + + unsigned char pre_timeout __attribute__ ((packed)); + + unsigned char timer_use_xp __attribute__ ((packed)); + + unsigned short init_count __attribute__ ((packed)); + unsigned short current_count __attribute__ ((packed)); + } GET_WATCHDOG_RESPONSE; --- /dev/null Fri Mar 23 23:37:44 2001 +++ linux-bmc/include/linux/ipmi_ioctls.h Tue Oct 30 17:18:07 2001 @@ -0,0 +1,152 @@ +/* + * Intelligent Platform Management Interface driver for Linux 2.x + * + * (c) Copyright 1999 San Mehat & VA Linux Systems + * 1382 Bordeaux Dr. + * Sunnyvale, California + * 94089 + * + * http://www.valinux.com + * + * This driver is provided under the GNU public license, incorporated + * herein by reference. The driver is provided without warranty or + * support. + * + * IOCTL definitions for IPMI drivers + */ + +/* + * Note: The following macros should be used on the IPMI_XFER structure. + * DO NOT try to muck with this structure directly.. use the macros + * to ensure future compatibility: + * + * INIT_XFER(IPMI_XFER *); + * -- Zero out a IPMI_XFER structure and initialize it for use + * + * SET_REQUEST_LUN(IPMI_XFER *, unsigned char lun); + * -- Set the request packet logical unit + * + * SET_REQUEST_NETFN(IPMI_XFER *, unsigned char netfn); + * -- Set the request packet network function code + * + * SET_REQUEST_CMD(IPMI_XFER *, unsigned char cmd); + * -- Set the request packet IPMI command code + * + * SET_REQUEST_DATA(IPMI_XFER *, unsigned char *data, int length); + * -- Set the request packet optional argument data field + * + * GET_RESPONSE_LUN(IPMI_XFER *, unsigned char lun); + * -- Get the response packet logical unit + * + * GET_RESPONSE_NETFN(IPMI_XFER *, unsigned char netfn); + * -- Get the response packet network function code + * + * GET_RESPONSE_CMD(IPMI_XFER *, unsigned char cmd); + * -- Get the response packet command + * + * GET_RESPONSE_CC(IPMI_XFER *, unsigned char cc); + * -- Get the response packet completion code + * + * GET_RESPONSE_DATA_LENGTH(IPMI_XFER *, int len); + * -- Get the response packet data length + * + * GET_RESPONSE_DATA(IPMI_XFER *, unsigned char *buffer); + * -- Copy the response packet data into local buffer + */ + +#ifndef _IPMI_IOCTLS_H +#define _IPMI_IOCTLS_H + +#define IOCTL_IPMI_XFER 0x01 +#define IOCTL_DRIVER_INFO 0x02 + +typedef struct ipmi_xfer + { + unsigned char request[64]; + unsigned char response[64]; + int request_len; + int response_len; + } IPMI_XFER; + +struct ipmi_driver_info + { + char driver_name[64]; /* Name of the driver */ + int major_ver; + int minor_ver; + unsigned short mb_chipset_vendor; /* PCI host bridge vendor tag */ + unsigned short mb_chipset_device; /* PCI host bridge vendor device id */ + unsigned int flags; /* driver specific flags */ + unsigned int reserved; + }; + +/* flags definitions for the 'ipmi_kcs' driver */ +#define KCS_FLAG_BLINKY 0x01 /* Set if blinky works (only on Intel L440GX) */ +#define KCS_FLAG_LEGACY 0x02 /* Set if using legacy KCS interface ( < IPMI 1.0) */ + +#define INIT_XFER(_xferp) \ + memset(_xferp, 0, sizeof(IPMI_XFER)); \ + _xferp->request_len = 2; \ + _xferp->response_len = sizeof(_xferp->response); + +#define SET_REQUEST_LUN(_xferp, _lun) \ + { \ + unsigned char _netfn_copy; \ + \ + _netfn_copy = (_xferp->request[0] & 0xFC); \ + _xferp->request[0] = _lun; \ + _xferp->request[0]|= _netfn_copy; \ + } + +#define SET_REQUEST_NETFN(_xferp, netfn) \ + { \ + unsigned char __lun_copy; \ + \ + __lun_copy = (_xferp->request[0] & 0x3); \ + _xferp->request[0] = (netfn << 2); \ + _xferp->request[0]|= __lun_copy; \ + } + +#define SET_REQUEST_CMD(_xferp, _cmd) \ + _xferp->request[1] = _cmd; + +#define SET_REQUEST_DATA(_xferp, datap, _len) \ + { \ + memcpy(&_xferp->request[2], datap, _len); \ + _xferp->request_len = (_len + 2); \ + } + +#define GET_RESPONSE_LUN(_xferp, _lun) \ + _lun = (_xferp->response[0] & 0x3); + +#define GET_RESPONSE_NETFN(_xferp, netfn) \ + netfn = ((_xferp->response[0] & 0xFC) >> 2); + +#define GET_RESPONSE_CMD(_xferp, _cmd) \ + _cmd = _xferp->response[1]; + +#define GET_RESPONSE_CC(_xferp, cc) \ + cc = _xferp->response[2]; + +#define GET_RESPONSE_DATA_LENGTH(_xferp, _len) \ + _len = (_xferp->response_len - 3); + +#define GET_RESPONSE_DATA(_xferp, datap) \ + memcpy(datap, &_xferp->response[3], (_xferp->response_len -3)); + +/* + * The Netfn codes + */ +#define CHASSIS_REQUEST 0x00 +#define CHASSIS_RESPONSE 0x01 +#define BRIDGE_REQUEST 0x02 +#define BRIDGE_RESPONSE 0x03 +#define SENSOR_REQUEST 0x04 +#define SENSOR_RESPONSE 0x05 +#define APP_REQUEST 0x06 +#define APP_RESPONSE 0x07 +#define FIRMWARE_REQUEST 0x08 +#define FIRMWARE_RESPONSE 0x09 +#define STORAGE_REQUEST 0x0A +#define STORAGE_RESPONSE 0x0B + +#endif ipmiutil-3.0.7/kern/openipmi-rh80.patch0000644000076400007640000056515213160502144017462 0ustar acressloggers--- linux-2.4.18-14orig/Documentation/Configure.help 2002-09-04 11:54:06.000000000 -0400 +++ linux-2.4.18-14/Documentation/Configure.help 2003-03-27 15:26:22.000000000 -0500 @@ -25565,6 +25565,31 @@ information: http://www.candelatech.com/~greear/vlan.html If unsure, you can safely say 'N'. +IPMI top-level message handler +CONFIG_IPMI_HANDLER + This enables the central IPMI message handler, required for IPMI + to work. Note that you must have this enabled to do any other IPMI + things. See IPMI.txt for more details. + +Generate a panic event to all BMCs on a panic +CONFIG_IPMI_PANIC_EVENT + When a panic occurs, this will cause the IPMI message handler to + generate an IPMI event describing the panic to each interface + registered with the message handler. + +Device interface for IPMI +CONFIG_IPMI_DEVICE_INTERFACE + This provides an IOCTL interface to the IPMI message handler so + userland processes may use IPMI. It supports poll() and select(). + +IPMI KCS handler +CONFIG_IPMI_KCS + Provides a driver for a KCS-style interface to a BMC. + +IPMI Watchdog Timer +CONFIG_IPMI_WATCHDOG + This enables the IPMI watchdog timer. + # # A couple of things I keep forgetting: # capitalize: AppleTalk, Ethernet, DOS, DMA, FAT, FTP, Internet, --- linux-2.4.18-14orig/drivers/char/Makefile 2002-09-04 11:54:03.000000000 -0400 +++ linux-2.4.18-14/drivers/char/Makefile 2003-03-27 15:26:22.000000000 -0500 @@ -293,6 +293,11 @@ obj-y += oprofile/oprofile_mod.o endif +subdir-$(CONFIG_IPMI_HANDLER) += ipmi +ifeq ($(CONFIG_IPMI_HANDLER),y) + obj-y += ipmi/ipmi.o +endif + include $(TOPDIR)/Rules.make fastdep: --- linux-2.4.18-14orig/drivers/char/Config.in 2002-09-04 11:54:05.000000000 -0400 +++ linux-2.4.18-14/drivers/char/Config.in 2003-03-27 15:26:22.000000000 -0500 @@ -175,6 +175,12 @@ fi fi +tristate 'IPMI top-level message handler' CONFIG_IPMI_HANDLER +dep_mbool ' Generate a panic event to all BMCs on a panic' CONFIG_IPMI_PANIC_EVENT $CONFIG_IPMI_HANDLER +dep_tristate ' Device interface for IPMI' CONFIG_IPMI_DEVICE_INTERFACE $CONFIG_IPMI_HANDLER +dep_tristate ' IPMI KCS handler' CONFIG_IPMI_KCS $CONFIG_IPMI_HANDLER +dep_tristate ' IPMI Watchdog Timer' CONFIG_IPMI_WATCHDOG $CONFIG_IPMI_HANDLER + mainmenu_option next_comment comment 'Watchdog Cards' bool 'Watchdog Timer Support' CONFIG_WATCHDOG --- linux-2.4.18-14orig/kernel/ksyms.c 2002-09-04 11:54:06.000000000 -0400 +++ linux-2.4.18-14/kernel/ksyms.c 2003-03-27 15:26:22.000000000 -0500 @@ -70,6 +70,8 @@ extern int request_dma(unsigned int dmanr, char * deviceID); extern void free_dma(unsigned int dmanr); extern spinlock_t dma_spin_lock; +extern int panic_timeout; + #ifdef CONFIG_MODVERSIONS const struct module_symbol __export_Using_Versions @@ -507,6 +509,8 @@ /* misc */ EXPORT_SYMBOL(panic); +EXPORT_SYMBOL(panic_notifier_list); +EXPORT_SYMBOL(panic_timeout); EXPORT_SYMBOL(__out_of_line_bug); EXPORT_SYMBOL(sprintf); EXPORT_SYMBOL(snprintf); --- /dev/null 2002-08-30 19:31:37.000000000 -0400 +++ linux-2.4.18-14/Documentation/IPMI.txt 2003-03-27 15:26:22.000000000 -0500 @@ -0,0 +1,352 @@ + + The Linux IPMI Driver + --------------------- + Corey Minyard + + + +This document describes how to use the IPMI driver for Linux. If you +are not familiar with IPMI itself, see the web site at +http://www.intel.com/design/servers/ipmi/index.htm. IPMI is a big +subject and I can't cover it all here! + +Basic Design +------------ + +The Linux IPMI driver is designed to be very modular and flexible, you +only need to take the pieces you need and you can use it in many +different ways. Because of that, it's broken into many chunks of +code. These chunks are: + +ipmi_msghandler - This is the central piece of software for the IPMI +system. It handles all messages, message timing, and responses. The +IPMI users tie into this, and the IPMI physical interfaces (called +System Management Interfaces, or SMIs) also tie in here. This +provides the kernelland interface for IPMI, but does not provide an +interface for use by application processes. + +ipmi_devintf - This provides a userland IOCTL interface for the IPMI +driver, each open file for this device ties in to the message handler +as an IPMI user. + +ipmi_kcs_drv - A driver for the KCS SMI. Most system have a KCS +interface for IPMI. + + +Much documentation for the interface is in the include files. The +IPMI include files are: + +ipmi.h - Contains the user interface and IOCTL interface for IPMI. + +ipmi_smi.h - Contains the interface for SMI drivers to use. + +ipmi_msgdefs.h - General definitions for base IPMI messaging. + + +Addressing +---------- + +The IPMI addressing works much like IP addresses, you have an overlay +to handle the different address types. The overlay is: + + struct ipmi_addr + { + int addr_type; + short channel; + char data[IPMI_MAX_ADDR_SIZE]; + }; + +The addr_type determines what the address really is. The driver +currently understands two different types of addresses. + +"System Interface" addresses are defined as: + + struct ipmi_system_interface_addr + { + int addr_type; + short channel; + }; + +and the type is IPMI_SYSTEM_INTERFACE_ADDR_TYPE. This is used for talking +straight to the BMC on the current card. The channel must be +IPMI_BMC_CHANNEL. + +Messages that are destined to go out on the IPMB bus use the +IPMI_IPMB_ADDR_TYPE address type. The format is + + struct ipmi_ipmb_addr + { + int addr_type; + short channel; + unsigned char slave_addr; + unsigned char lun; + }; + +The "channel" here is generally zero, but some devices support more +than one channel, it corresponds to the channel as defined in the IPMI +spec. + + +Messages +-------- + +Messages are defined as: + +struct ipmi_msg +{ + unsigned char netfn; + unsigned char lun; + unsigned char cmd; + unsigned char *data; + int data_len; +}; + +The driver takes care of adding/stripping the header information. The +data portion is just the data to be send (do NOT put addressing info +here) or the response. Note that the completion code of a response is +the first item in "data", it is not stripped out because that is how +all the messages are defined in the spec (and thus makes counting the +offsets a little easier :-). + +When using the IOCTL interface from userland, you must provide a block +of data for "data", fill it, and set data_len to the length of the +block of data, even when receiving messages. Otherwise the driver +will have no place to put the message. + +Messages coming up from the message handler in kernelland will come in +as: + + struct ipmi_recv_msg + { + struct list_head link; + + /* The type of message as defined in the "Receive Types" + defines above. */ + int recv_type; + + ipmi_user_t *user; + struct ipmi_addr addr; + long msgid; + struct ipmi_msg msg; + + /* Call this when done with the message. It will presumably free + the message and do any other necessary cleanup. */ + void (*done)(struct ipmi_recv_msg *msg); + + /* Place-holder for the data, don't make any assumptions about + the size or existence of this, since it may change. */ + unsigned char msg_data[IPMI_MAX_MSG_LENGTH]; + }; + +You should look at the receive type and handle the message +appropriately. + + +The Upper Layer Interface (Message Handler) +------------------------------------------- + +The upper layer of the interface provides the users with a consistent +view of the IPMI interfaces. It allows multiple SMI interfaces to be +addressed (because some boards actually have multiple BMCs on them) +and the user should not have to care what type of SMI is below them. + + +Creating the User + +To user the message handler, you must first create a user using +ipmi_create_user. The interface number specifies which SMI you want +to connect to, and you must supply callback functions to be called +when data comes in. The callback function can run at interrupt level, +so be careful using the callbacks. This also allows to you pass in a +piece of data, the handler_data, that will be passed back to you on +all calls. + +Once you are done, call ipmi_destroy_user() to get rid of the user. + +From userland, opening the device automatically creates a user, and +closing the device automatically destroys the user. + + +Messaging + +To send a message from kernel-land, the ipmi_request() call does +pretty much all message handling. Most of the parameter are +self-explanatory. However, it takes a "msgid" parameter. This is NOT +the sequence number of messages. It is simply a long value that is +passed back when the response for the message is returned. You may +use it for anything you like. + +Responses come back in the function pointed to by the ipmi_recv_hndl +field of the "handler" that you passed in to ipmi_create_user(). +Remember again, these may be running at interrupt level. Remember to +look at the receive type, too. + +From userland, you fill out an ipmi_req_t structure and use the +IPMICTL_SEND_COMMAND ioctl. For incoming stuff, you can use select() +or poll() to wait for messages to come in. However, you cannot use +read() to get them, you must call the IPMICTL_RECEIVE_MSG with the +ipmi_recv_t structure to actually get the message. Remember that you +must supply a pointer to a block of data in the msg.data field, and +you must fill in the msg.data_len field with the size of the data. +This gives the receiver a place to actually put the message. + +If the message cannot fit into the data you provide, you will get an +EMSGSIZE error and the driver will leave the data in the receive +queue. If you want to get it and have it truncate the message, us +the IPMICTL_RECEIVE_MSG_TRUNC ioctl. + +When you send a command (which is defined by the lowest-order bit of +the netfn per the IPMI spec) on the IPMB bus, the driver will +automatically assign the sequence number to the command and save the +command. If the response is not receive in the IPMI-specified 5 +seconds, it will generate a response automatically saying the command +timed out. If an unsolicited response comes in (if it was after 5 +seconds, for instance), that response will be ignored. + +In kernelland, after you receive a message and are done with it, you +MUST call ipmi_free_recv_msg() on it, or you will leak messages. Note +that you should NEVER mess with the "done" field of a message, that is +required to properly clean up the message. + +Note that when sending, there is an ipmi_request_supply_msgs() call +that lets you supply the smi and receive message. This is useful for +pieces of code that need to work even if the system is out of buffers +(the watchdog timer uses this, for instance). You supply your own +buffer and own free routines. This is not recommended for normal use, +though, since it is tricky to manage your own buffers. + + +Events and Incoming Commands + +The driver takes care of polling for IPMI events and receiving +commands (commands are messages that are not responses, they are +commands that other things on the IPMB bus have sent you). To receive +these, you must register for them, they will not automatically be sent +to you. + +To receive events, you must call ipmi_set_gets_events() and set the +"val" to non-zero. Any events that have been received by the driver +since startup will immediately be delivered to the first user that +registers for events. After that, if multiple users are registered +for events, they will all receive all events that come in. + +For receiving commands, you have to individually register commands you +want to receive. Call ipmi_register_for_cmd() and supply the netfn +and command name for each command you want to receive. Only one user +may be registered for each netfn/cmd, but different users may register +for different commands. + +From userland, equivalent IOCTLs are provided to do these functions. + + +The Lower Layer (SMI) Interface +------------------------------- + +As mentioned before, multiple SMI interfaces may be registered to the +message handler, each of these is assigned an interface number when +they register with the message handler. They are generally assigned +in the order they register, although if an SMI unregisters and then +another one registers, all bets are off. + +The ipmi_smi.h defines the interface for SMIs, see that for more +details. + + +The KCS Driver +-------------- + +The KCS driver allows up to 4 KCS interfaces to be configured in the +system. By default, the driver will register one KCS interface at the +spec-specified I/O port 0xca2 without interrupts. You can change this +at module load time (for a module) with: + + insmod ipmi_kcs_drv.o kcs_ports=,... kcs_addrs=, + kcs_irqs=,... kcs_trydefaults=[0|1] + +The KCS driver supports two types of interfaces, ports (for I/O port +based KCS interfaces) and memory addresses (for KCS interfaces in +memory). The driver will support both of them simultaneously, setting +the port to zero (or just not specifying it) will allow the memory +address to be used. The port will override the memory address if it +is specified and non-zero. kcs_trydefaults sets whether the standard +IPMI interface at 0xca2 and any interfaces specified by ACPE are +tried. By default, the driver tries it, set this value to zero to +turn this off. + +When compiled into the kernel, the addresses can be specified on the +kernel command line as: + + ipmi_kcs=:,:....,[nodefault] + +The values is either "p" or "m" for port or memory +addresses. So for instance, a KCS interface at port 0xca2 using +interrupt 9 and a memory interface at address 0xf9827341 with no +interrupt would be specified "ipmi_kcs=p0xca2:9,m0xf9827341". +If you specify zero for in irq or don't specify it, the driver will +run polled unless the software can detect the interrupt to use in the +ACPI tables. + +By default, the driver will attempt to detect a KCS device at the +spec-specified 0xca2 address and any address specified by ACPI. If +you want to turn this off, use the "nodefault" option. + +If you have high-res timers compiled into the kernel, the driver will +use them to provide much better performance. Note that if you do not +have high-res timers enabled in the kernel and you don't have +interrupts enabled, the driver will run VERY slowly. Don't blame me, +the KCS interface sucks. + + +Other Pieces +------------ + +Watchdog + +A watchdog timer is provided that implements the Linux-standard +watchdog timer interface. It has three module parameters that can be +used to control it: + + insmod ipmi_watchdog timeout= pretimeout= action= + preaction= preop= + +The timeout is the number of seconds to the action, and the pretimeout +is the amount of seconds before the reset that the pre-timeout panic will +occur (if pretimeout is zero, then pretimeout will not be enabled). + +The action may be "reset", "power_cycle", or "power_off", and +specifies what to do when the timer times out, and defaults to +"reset". + +The preaction may be "pre_smi" for an indication through the SMI +interface, "pre_int" for an indication through the SMI with an +interrupts, and "pre_nmi" for a NMI on a preaction. This is how +the driver is informed of the pretimeout. + +The preop may be set to "preop_none" for no operation on a pretimeout, +"preop_panic" to set the preoperation to panic, or "preop_give_data" +to provide data to read from the watchdog device when the pretimeout +occurs. A "pre_nmi" setting CANNOT be used with "preop_give_data" +because you can't do data operations from an NMI. + +When preop is set to "preop_give_data", one byte comes ready to read +on the device when the pretimeout occurs. Select and fasync work on +the device, as well. + +When compiled into the kernel, the kernel command line is available +for configuring the watchdog: + + ipmi_wdog=[,[,