mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-01 10:13:35 +00:00
Compare commits
10 Commits
IPMITOOL_1
...
IPMITOOL_1
Author | SHA1 | Date | |
---|---|---|---|
83620456c4 | |||
29dbaf6882 | |||
f367905bef | |||
66cb3143dc | |||
79befbb112 | |||
185b762fa9 | |||
5d7197d467 | |||
b0498d93cf | |||
9f49913c2f | |||
73d088de1f |
@ -1,3 +1,17 @@
|
||||
version 1.8.6
|
||||
* Fix memory corruption when sending encrypted SOL traffic
|
||||
* Add keepalive timer to IPMIv2 SOL sessions
|
||||
|
||||
version 1.8.5
|
||||
* Add support for settable SOL escape character with -e option
|
||||
* Add support for Kg BMC key for IPMIv2 authentication with -k option
|
||||
* Add support for Tyan IPMIv1.5 SOL with tsol command
|
||||
* Add support for PICMG devices
|
||||
* Add support for OEM SEL event parsing
|
||||
* Add support for command bridging over lan and lanplus interfaces
|
||||
* New 'chassis selftest' command
|
||||
* Many bufxies and patches from contributors
|
||||
|
||||
version 1.8.3
|
||||
* Add support for 'sel readraw' and 'sel writeraw' commands.
|
||||
* Add support for entering NetFn as a string for RAW commands.
|
||||
|
@ -3,7 +3,7 @@ dnl autoconf for ipmitool
|
||||
dnl
|
||||
AC_INIT([src/ipmitool.c])
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.8.5])
|
||||
AM_INIT_AUTOMAKE([ipmitool], [1.8.6])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_SRCDIR([src/ipmitool.c])
|
||||
AC_PREREQ(2.50)
|
||||
|
@ -2,7 +2,7 @@ Name: ipmitool
|
||||
Summary: ipmitool - Utility for IPMI control
|
||||
Version: @VERSION@
|
||||
Release: 1%{?_distro:.%{_distro}}
|
||||
Copyright: BSD
|
||||
License: BSD
|
||||
Group: Utilities
|
||||
Packager: Duncan Laurie <duncan@iceblink.org>
|
||||
Source: ipmitool-@VERSION@.tar.gz
|
||||
@ -62,7 +62,11 @@ rm -rf $RPM_BUILD_DIR/ipmitool-@VERSION@
|
||||
%doc %{_datadir}/doc/ipmitool/*
|
||||
|
||||
%changelog
|
||||
* Sat Jan 14, 2006 <duncan@iceblink.org> 1.8.5-1
|
||||
* Mon Jan 17 2006 <duncan@iceblink.org> 1.8.6-1
|
||||
- Fix memory corruption when sending encrypted SOL traffic
|
||||
- Add keepalive timer to IPMIv2 SOL sessions
|
||||
|
||||
* Sat Jan 14 2006 <duncan@iceblink.org> 1.8.5-1
|
||||
- Raise privilege level after creating IPMIv2 session
|
||||
- Add support for settable SOL escape character with -e option
|
||||
- Add support for Kg BMC key for IPMIv2 authentication with -k option
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
#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
|
||||
|
@ -110,7 +110,7 @@ void printbuf(const uint8_t * buf, int len, const char * desc)
|
||||
|
||||
const char * val2str(uint16_t val, const struct valstr *vs)
|
||||
{
|
||||
static char un_str[16];
|
||||
static char un_str[32];
|
||||
int i;
|
||||
|
||||
for (i = 0; vs[i].str != NULL; i++) {
|
||||
@ -118,8 +118,8 @@ const char * val2str(uint16_t val, const struct valstr *vs)
|
||||
return vs[i].str;
|
||||
}
|
||||
|
||||
memset(un_str, 0, 16);
|
||||
snprintf(un_str, 16, "Unknown (0x%02x)", val);
|
||||
memset(un_str, 0, 32);
|
||||
snprintf(un_str, 32, "Unknown (0x%x)", val);
|
||||
|
||||
return un_str;
|
||||
}
|
||||
|
@ -97,19 +97,11 @@ print_session_info_csv(const struct get_session_info_rsp * session_info,
|
||||
if (data_len == 18)
|
||||
{
|
||||
/* We have 802.3 LAN data */
|
||||
#ifdef __CYGWIN__
|
||||
printf(",%d.%d.%d.%d",
|
||||
session_info->channel_data.lan_data.console_ip[0],
|
||||
session_info->channel_data.lan_data.console_ip[1],
|
||||
session_info->channel_data.lan_data.console_ip[2],
|
||||
session_info->channel_data.lan_data.console_ip[3]);
|
||||
#else
|
||||
printf(",%s",
|
||||
inet_ntop(AF_INET,
|
||||
&(session_info->channel_data.lan_data.console_ip),
|
||||
buffer,
|
||||
16));
|
||||
#endif
|
||||
|
||||
printf(",%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
session_info->channel_data.lan_data.console_mac[0],
|
||||
@ -137,19 +129,11 @@ print_session_info_csv(const struct get_session_info_rsp * session_info,
|
||||
printf(",%d",
|
||||
session_info->channel_data.modem_data.destination_selector);
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
printf(",%d.%d.%d.%d",
|
||||
session_info->channel_data.modem_data.console_ip[0],
|
||||
session_info->channel_data.modem_data.console_ip[1],
|
||||
session_info->channel_data.modem_data.console_ip[2],
|
||||
session_info->channel_data.modem_data.console_ip[3]);
|
||||
#else
|
||||
printf(",%s",
|
||||
inet_ntop(AF_INET,
|
||||
&(session_info->channel_data.modem_data.console_ip),
|
||||
buffer,
|
||||
16));
|
||||
#endif
|
||||
|
||||
if (data_len == 14)
|
||||
{
|
||||
@ -201,19 +185,11 @@ print_session_info_verbose(const struct get_session_info_rsp * session_info,
|
||||
if (data_len == 18)
|
||||
{
|
||||
/* We have 802.3 LAN data */
|
||||
#ifdef __CYGWIN__
|
||||
printf("console ip : %d.%d.%d.%d\n",
|
||||
session_info->channel_data.lan_data.console_ip[0],
|
||||
session_info->channel_data.lan_data.console_ip[1],
|
||||
session_info->channel_data.lan_data.console_ip[2],
|
||||
session_info->channel_data.lan_data.console_ip[3]);
|
||||
#else
|
||||
printf("console ip : %s\n",
|
||||
inet_ntop(AF_INET,
|
||||
&(session_info->channel_data.lan_data.console_ip),
|
||||
buffer,
|
||||
16));
|
||||
#endif
|
||||
|
||||
printf("console mac : %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
session_info->channel_data.lan_data.console_mac[0],
|
||||
@ -241,19 +217,11 @@ print_session_info_verbose(const struct get_session_info_rsp * session_info,
|
||||
printf("Destination selector : %d\n",
|
||||
session_info->channel_data.modem_data.destination_selector);
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
printf("console ip : %d.%d.%d.%d\n",
|
||||
session_info->channel_data.modem_data.console_ip[0],
|
||||
session_info->channel_data.modem_data.console_ip[1],
|
||||
session_info->channel_data.modem_data.console_ip[2],
|
||||
session_info->channel_data.modem_data.console_ip[3]);
|
||||
#else
|
||||
printf("console ip : %s\n",
|
||||
inet_ntop(AF_INET,
|
||||
&(session_info->channel_data.modem_data.console_ip),
|
||||
buffer,
|
||||
16));
|
||||
#endif
|
||||
|
||||
if (data_len == 14)
|
||||
{
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@ -81,6 +82,7 @@ const struct valstr sol_parameter_vals[] = {
|
||||
};
|
||||
|
||||
|
||||
static struct timeval _start_keepalive;
|
||||
static struct termios _saved_tio;
|
||||
static int _in_raw_mode = 0;
|
||||
|
||||
@ -1251,21 +1253,40 @@ processSolUserInput(
|
||||
|
||||
if (! rsp)
|
||||
{
|
||||
lprintf(LOG_ERR, "Error sending SOL data");
|
||||
retval = -1;
|
||||
rsp = intf->send_sol(intf, &v2_payload);
|
||||
lprintf(LOG_ERR, "Error sending SOL data: RETRY");
|
||||
if (! rsp)
|
||||
{
|
||||
lprintf(LOG_ERR, "Error sending SOL data: FAIL");
|
||||
retval = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the sequence number is set we know we have new data */
|
||||
else if ((rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS) &&
|
||||
(rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL) &&
|
||||
(rsp->payload.sol_packet.packet_sequence_number))
|
||||
output(rsp);
|
||||
if (retval == 0)
|
||||
if ((rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS) &&
|
||||
(rsp->session.payloadtype == IPMI_PAYLOAD_TYPE_SOL) &&
|
||||
(rsp->payload.sol_packet.packet_sequence_number))
|
||||
output(rsp);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ipmi_sol_keepalive(struct ipmi_intf * intf)
|
||||
{
|
||||
struct timeval end;
|
||||
|
||||
gettimeofday(&end, 0);
|
||||
|
||||
if (end.tv_sec - _start_keepalive.tv_sec > SOL_KEEPALIVE_TIMEOUT) {
|
||||
intf->keepalive(intf);
|
||||
gettimeofday(&_start_keepalive, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ipmi_sol_red_pill
|
||||
@ -1289,6 +1310,9 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Initialize keepalive start time */
|
||||
gettimeofday(&_start_keepalive, 0);
|
||||
|
||||
enter_raw_mode();
|
||||
|
||||
while (! bShouldExit)
|
||||
@ -1297,6 +1321,9 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
||||
FD_SET(0, &read_fds);
|
||||
FD_SET(intf->fd, &read_fds);
|
||||
|
||||
/* Send periodic keepalive packet */
|
||||
ipmi_sol_keepalive(intf);
|
||||
|
||||
/* Wait up to half a second */
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 500000;
|
||||
|
@ -430,13 +430,8 @@ ipmi_tsol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(port);
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
result = inet_aton((const char *)intf->session->hostname,
|
||||
&intf->session->addr.sin_addr);
|
||||
#else
|
||||
result = inet_pton(AF_INET, (const char *)intf->session->hostname,
|
||||
&intf->session->addr.sin_addr);
|
||||
#endif
|
||||
|
||||
if (result <= 0) {
|
||||
struct hostent *host = gethostbyname((const char *)intf->session->hostname);
|
||||
|
@ -74,7 +74,7 @@ void lprintf(int level, const char * format, ...)
|
||||
if (logpriv->daemon)
|
||||
syslog(level, "%s", logmsg);
|
||||
else
|
||||
fprintf(stderr, "%s\n", logmsg);
|
||||
fprintf(stderr, "%s\r\n", logmsg);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ void lperror(int level, const char * format, ...)
|
||||
if (logpriv->daemon)
|
||||
syslog(level, "%s: %s", logmsg, strerror(errno));
|
||||
else
|
||||
fprintf(stderr, "%s: %s\n", logmsg, strerror(errno));
|
||||
fprintf(stderr, "%s: %s\r\n", logmsg, strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ void log_init(const char * name, int isdaemon, int verbose)
|
||||
logpriv->name = strdup(LOG_NAME_DEFAULT);
|
||||
|
||||
if (logpriv->name == NULL)
|
||||
fprintf(stderr, "ipmitool: malloc failure\n");
|
||||
fprintf(stderr, "ipmitool: malloc failure\r\n");
|
||||
|
||||
logpriv->daemon = isdaemon;
|
||||
logpriv->level = verbose + LOG_NOTICE;
|
||||
|
@ -1410,11 +1410,7 @@ int ipmi_lan_open(struct ipmi_intf * intf)
|
||||
s->addr.sin_family = AF_INET;
|
||||
s->addr.sin_port = htons(s->port);
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
rc = inet_aton(s->hostname, &s->addr.sin_addr);
|
||||
#else
|
||||
rc = inet_pton(AF_INET, s->hostname, &s->addr.sin_addr);
|
||||
#endif
|
||||
if (rc <= 0) {
|
||||
struct hostent *host = gethostbyname(s->hostname);
|
||||
if (host == NULL) {
|
||||
|
@ -2307,6 +2307,8 @@ ipmi_lanplus_send_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);
|
||||
@ -2338,6 +2340,8 @@ ipmi_lanplus_send_sol(
|
||||
|
||||
v2_payload->payload.sol_packet.character_count = 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(v2_payload, rs);
|
||||
@ -3248,11 +3252,7 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(session->port);
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
rc = inet_aton(session->hostname, &addr.sin_addr);
|
||||
#else
|
||||
rc = inet_pton(AF_INET, session->hostname, &addr.sin_addr);
|
||||
#endif
|
||||
if (rc <= 0) {
|
||||
struct hostent *host = gethostbyname(session->hostname);
|
||||
if (host == NULL) {
|
||||
|
Reference in New Issue
Block a user