mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-01-23 07:04:21 +08:00
add pef support, from Tim Murphy
This commit is contained in:
parent
c5d65ba940
commit
0ef81e301f
@ -310,6 +310,22 @@ This command will query the BMC for information about the SDR.
|
||||
This command will read the SDR and extract sensor information, then query each sensor and print its name, reading, and status.
|
||||
.RE
|
||||
.TP
|
||||
.I pef
|
||||
.RS
|
||||
.TP
|
||||
.I info
|
||||
This command will query the BMC and print information about the PEF supported features.
|
||||
.TP
|
||||
.I status
|
||||
This command prints the current PEF status (the last SEL entry processed by the BMC, etc).
|
||||
.TP
|
||||
.I policy
|
||||
This command lists the PEF policy table entries. Each policy entry describes an alert destination. A policy set is a collection of table entries. PEF alert actions reference policy sets.
|
||||
.TP
|
||||
.I list
|
||||
This command lists the PEF table entries. Each PEF entry relates a sensor event to an action. When PEF is active, each platform event causes the BMC to scan this table for entries matching the event, and possible actions to be taken. Actions are performed in priority order (higher criticality first).
|
||||
.RE
|
||||
.TP
|
||||
.I sensor
|
||||
.RS
|
||||
.TP
|
||||
|
||||
@ -72,6 +72,13 @@ struct ipmi_session {
|
||||
unsigned char challenge[16];
|
||||
unsigned char authtype;
|
||||
unsigned char 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
|
||||
unsigned char authstatus;
|
||||
unsigned char authextra;
|
||||
unsigned char privlvl;
|
||||
int password;
|
||||
int port;
|
||||
|
||||
785
ipmitool/include/ipmitool/ipmi_pef.h
Normal file
785
ipmitool/include/ipmitool/ipmi_pef.h
Normal file
@ -0,0 +1,785 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#ifndef IPMI_PEF_H
|
||||
#define IPMI_PEF_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
|
||||
typedef unsigned char u8_t;
|
||||
typedef unsigned int u32_t;
|
||||
|
||||
/* PEF */
|
||||
|
||||
struct pef_capabilities { /* "get pef capabilities" response */
|
||||
u8_t version;
|
||||
u8_t actions; /* mapped by PEF_ACTION_xxx */
|
||||
u8_t tblsize;
|
||||
};
|
||||
|
||||
struct pef_table_entry {
|
||||
#define PEF_CONFIG_ENABLED 0x80
|
||||
#define PEF_CONFIG_PRECONFIGURED 0x40
|
||||
u8_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
|
||||
u8_t action;
|
||||
#define PEF_POLICY_NUMBER_MASK 0x0f
|
||||
u8_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
|
||||
u8_t severity;
|
||||
u8_t generator_ID_addr;
|
||||
u8_t generator_ID_lun;
|
||||
u8_t sensor_type;
|
||||
#define PEF_SENSOR_NUMBER_MATCH_ANY 0xff
|
||||
u8_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
|
||||
u8_t event_trigger;
|
||||
u8_t event_data_1_offset_mask[2];
|
||||
u8_t event_data_1_AND_mask;
|
||||
u8_t event_data_1_compare_1;
|
||||
u8_t event_data_1_compare_2;
|
||||
u8_t event_data_2_AND_mask;
|
||||
u8_t event_data_2_compare_1;
|
||||
u8_t event_data_2_compare_2;
|
||||
u8_t event_data_3_AND_mask;
|
||||
u8_t event_data_3_compare_1;
|
||||
u8_t event_data_3_compare_2;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct desc_map { /* maps a description to a value/mask */
|
||||
const char *desc;
|
||||
u32_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 */
|
||||
u32_t desc_map_type;
|
||||
struct desc_map desc_maps[];
|
||||
};
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_actions = {
|
||||
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 = {
|
||||
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 = {
|
||||
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", 0}, /* '<' : getting worse */
|
||||
{">LNC", 1}, /* '>' : getting better */
|
||||
{"<LC", 2},
|
||||
{">LC", 3},
|
||||
{"<LNR", 4},
|
||||
{">LNR", 5},
|
||||
{">UNC", 6},
|
||||
{"<UNC", 7},
|
||||
{">UC", 8},
|
||||
{"<UC", 9},
|
||||
{">UNR", 10},
|
||||
{"<UNR", 11},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_2 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"transition to idle", 0},
|
||||
{"transition to active", 1},
|
||||
{"transition to busy", 2},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_3 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"state deasserted", 0},
|
||||
{"state asserted", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_4 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"predictive failure deasserted", 0},
|
||||
{"predictive failure asserted", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_5 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"limit not exceeded", 0},
|
||||
{"limit exceeded", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_6 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"performance met", 0},
|
||||
{"performance lags", 1},
|
||||
{NULL}
|
||||
} };
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_gentype_7 = {
|
||||
BIT_DESC_MAP_LIST,
|
||||
{ {"ok", 0},
|
||||
{"<warn", 1}, /* '<' : getting worse */
|
||||
{"<fail", 2},
|
||||
{"<dead", 3},
|
||||
{">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", 3}, /* '<' : getting worse */
|
||||
{">non-redundant/sufficient", 4}, /* '>' : getting better */
|
||||
{"non-redundant/insufficient", 5},
|
||||
{"<redundancy degraded", 6},
|
||||
{">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[] = {
|
||||
&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
|
||||
u8_t policy;
|
||||
#define PEF_POLICY_CHANNEL_MASK 0xf0
|
||||
#define PEF_POLICY_CHANNEL_SHIFT 4
|
||||
#define PEF_POLICY_DESTINATION_MASK 0x0f
|
||||
u8_t chan_dest;
|
||||
#define PEF_POLICY_EVENT_SPECIFIC 0x80
|
||||
u8_t alert_string_key;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_policies = {
|
||||
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 = {
|
||||
#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
|
||||
u8_t id;
|
||||
u8_t set;
|
||||
u8_t block;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_set_in_progress {
|
||||
#define PEF_SET_IN_PROGRESS_COMMIT_WRITE 0x02
|
||||
#define PEF_SET_IN_PROGRESS 0x01
|
||||
u8_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
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_control = {
|
||||
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
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_startup_delay {
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_alert_startup_delay {
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_filter_table_size {
|
||||
#define PEF_FILTER_TABLE_SIZE_MASK 0x7f
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_filter_table_entry {
|
||||
#define PEF_FILTER_TABLE_ID_MASK 0x7f
|
||||
u8_t data1;
|
||||
struct pef_table_entry entry;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_filter_table_data_1 {
|
||||
u8_t data1;
|
||||
u8_t data2;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_policy_table_size {
|
||||
#define PEF_POLICY_TABLE_SIZE_MASK 0x7f
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_policy_table_entry {
|
||||
#define PEF_POLICY_TABLE_ID_MASK 0x7f
|
||||
u8_t data1;
|
||||
struct pef_policy_entry entry;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_system_guid {
|
||||
#define PEF_SYSTEM_GUID_USED_IN_PET 0x01
|
||||
u8_t data1;
|
||||
u8_t guid[16];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_alert_string_table_size {
|
||||
#define PEF_ALERT_STRING_TABLE_SIZE_MASK 0x7f
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_alert_string_keys {
|
||||
#define PEF_ALERT_STRING_ID_MASK 0x7f
|
||||
u8_t data1;
|
||||
#define PEF_EVENT_FILTER_ID_MASK 0x7f
|
||||
u8_t data2;
|
||||
#define PEF_ALERT_STRING_SET_ID_MASK 0x7f
|
||||
u8_t data3;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_cfgparm_alert_string_table_entry {
|
||||
u8_t id;
|
||||
u8_t blockno;
|
||||
u8_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
|
||||
u8_t ch;
|
||||
u8_t id;
|
||||
u8_t set;
|
||||
u8_t block;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_lan_cfgparm_dest_size {
|
||||
#define PEF_LAN_DEST_TABLE_SIZE_MASK 0x0f
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_lan_cfgparm_dest_type {
|
||||
#define PEF_LAN_DEST_TYPE_ID_MASK 0x0f
|
||||
u8_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
|
||||
u8_t dest_type;
|
||||
u8_t alert_timeout;
|
||||
#define PEF_LAN_RETRIES_MASK 0x07
|
||||
u8_t retries;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_lan_desttype = {
|
||||
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
|
||||
u8_t dest;
|
||||
#define PEF_LAN_DEST_ADDRTYPE_MASK 0xf0
|
||||
#define PEF_LAN_DEST_ADDRTYPE_SHIFT 4
|
||||
#define PEF_LAN_DEST_ADDRTYPE_IPV4_MAC 0x00
|
||||
u8_t addr_type;
|
||||
#define PEF_LAN_DEST_GATEWAY_USE_BACKUP 0x01
|
||||
u8_t gateway;
|
||||
u8_t ip[4];
|
||||
u8_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
|
||||
u8_t ch;
|
||||
u8_t id;
|
||||
u8_t set;
|
||||
u8_t block;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_dest_size {
|
||||
#define PEF_SERIAL_DEST_TABLE_SIZE_MASK 0x0f
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_dest_info {
|
||||
#define PEF_SERIAL_DEST_MASK 0x0f
|
||||
u8_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
|
||||
u8_t dest_type;
|
||||
u8_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
|
||||
u8_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
|
||||
u8_t data5;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_serial_desttype = {
|
||||
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
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_dial_string {
|
||||
#define PEF_SERIAL_DIAL_STRING_MASK 0x0f
|
||||
u8_t data1;
|
||||
u8_t data2;
|
||||
u8_t data3;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_tap_acct_count {
|
||||
#define PEF_SERIAL_TAP_ACCT_COUNT_MASK 0x0f
|
||||
u8_t data1;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_tap_acct_info {
|
||||
u8_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
|
||||
u8_t data2;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct pef_serial_cfgparm_tap_svc_settings {
|
||||
u8_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
|
||||
u8_t confirmation_flags;
|
||||
u8_t service_type[3];
|
||||
u8_t escape_mask[4];
|
||||
u8_t timeout_parms[3];
|
||||
u8_t retry_parms[2];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
static struct bit_desc_map
|
||||
pef_b2s_tap_svc_confirm = {
|
||||
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, u32_t val);
|
||||
void ipmi_pef_print_flags(struct bit_desc_map * map, u32_t type, u32_t val);
|
||||
void ipmi_pef_print_dec(const char * text, unsigned long val);
|
||||
void ipmi_pef_print_hex(const char * text, unsigned long val);
|
||||
void ipmi_pef_print_1xd(const char * text, unsigned long val);
|
||||
void ipmi_pef_print_2xd(const char * text, u8_t u1, u8_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 */
|
||||
@ -39,7 +39,8 @@ noinst_LTLIBRARIES = libipmitool.la
|
||||
libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_isol.c \
|
||||
ipmi_lanp.c ipmi_fru.c ipmi_chassis.c ipmi_bmc.c log.c \
|
||||
dimm_spd.c ipmi_sensor.c ipmi_channel.c ipmi_event.c \
|
||||
ipmi_session.c ipmi_strings.c ipmi_user.c ipmi_raw.c
|
||||
ipmi_session.c ipmi_strings.c ipmi_user.c ipmi_raw.c \
|
||||
ipmi_pef.c
|
||||
libipmitool_la_LDFLAGS = -export-dynamic
|
||||
libipmitool_la_LIBADD = -lm
|
||||
libipmitool_la_DEPENDENCIES =
|
||||
|
||||
@ -554,6 +554,7 @@ static void ipmi_fru_print_all(struct ipmi_intf * intf)
|
||||
struct sdr_get_rs * header;
|
||||
struct sdr_record_fru_device_locator * fru;
|
||||
char desc[17];
|
||||
unsigned char sav_addr;
|
||||
|
||||
printf ("Builtin FRU device\n");
|
||||
ipmi_fru_print(intf, 0); /* TODO: Figure out if FRU device 0 may show up in SDR records. */
|
||||
@ -582,16 +583,17 @@ static void ipmi_fru_print_all(struct ipmi_intf * intf)
|
||||
switch (fru->device_type_modifier) {
|
||||
case 0x00:
|
||||
case 0x02:
|
||||
sav_addr = intf->target_addr;
|
||||
intf->target_addr = ((fru->keys.dev_access_addr << 1)
|
||||
| (fru->keys.__reserved2 << 7));
|
||||
|
||||
if (intf->target_addr == IPMI_BMC_SLAVE_ADDR
|
||||
&& fru->keys.fru_device_id == 0)
|
||||
printf(" (Builtin FRU device)\n");
|
||||
else {
|
||||
else
|
||||
ipmi_fru_print(intf, fru->keys.fru_device_id);
|
||||
intf->target_addr = IPMI_BMC_SLAVE_ADDR;
|
||||
}
|
||||
|
||||
intf->target_addr = sav_addr;
|
||||
break;
|
||||
case 0x01:
|
||||
ipmi_spd_print(intf, fru->keys.fru_device_id);
|
||||
|
||||
858
ipmitool/lib/ipmi_pef.c
Normal file
858
ipmitool/lib/ipmi_pef.c
Normal file
@ -0,0 +1,858 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* You acknowledge that this software is not designed or intended for use
|
||||
* in the design, construction, operation or maintenance of any nuclear
|
||||
* facility.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <ipmitool/helper.h>
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/ipmi_intf.h>
|
||||
#include <ipmitool/ipmi_pef.h>
|
||||
|
||||
extern int verbose;
|
||||
/*
|
||||
// common kywd/value printf() templates
|
||||
*/
|
||||
static const char * pef_fld_fmts[][2] = {
|
||||
{"%-*s : %u\n", " | %u"}, /* F_DEC: unsigned value */
|
||||
{"%-*s : %d\n", " | %d"}, /* F_INT: signed value */
|
||||
{"%-*s : %s\n", " | %s"}, /* F_STR: string value */
|
||||
{"%-*s : 0x%x\n", " | 0x%x"}, /* F_HEX: "N hex digits" */
|
||||
{"%-*s : 0x%04x\n", " | 0x%04x"}, /* F_2XD: "2 hex digits" */
|
||||
{"%-*s : 0x%02x\n", " | 0x%02x"}, /* F_1XD: "1 hex digit" */
|
||||
{"%-*s : %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
|
||||
" | %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"},
|
||||
};
|
||||
typedef enum {
|
||||
F_DEC,
|
||||
F_INT,
|
||||
F_STR,
|
||||
F_HEX,
|
||||
F_2XD,
|
||||
F_1XD,
|
||||
F_UID,
|
||||
} fmt_e;
|
||||
#define KYWD_LENGTH 24
|
||||
static int first_field = 1;
|
||||
|
||||
static const char * pef_flag_fmts[][3] = {
|
||||
{"", "false", "true"},
|
||||
{"supported", "un", ""},
|
||||
{"active", "in", ""},
|
||||
{"abled", "dis", "en"},
|
||||
};
|
||||
typedef enum {
|
||||
P_TRUE,
|
||||
P_SUPP,
|
||||
P_ACTV,
|
||||
P_ABLE,
|
||||
} flg_e;
|
||||
static const char * listitem[] = {" | %s", ",%s", "%s"};
|
||||
|
||||
const char *
|
||||
ipmi_pef_bit_desc(struct bit_desc_map * map, u32_t value)
|
||||
{ /*
|
||||
// return description/text label(s) for the given value.
|
||||
// NB: uses a static buffer
|
||||
*/
|
||||
static char buf[128];
|
||||
char * p;
|
||||
struct desc_map * pmap;
|
||||
u32_t match, index;
|
||||
|
||||
*(p = buf) = '\0';
|
||||
index = 2;
|
||||
for (pmap=map->desc_maps; pmap && pmap->desc; pmap++) {
|
||||
if (map->desc_map_type == BIT_DESC_MAP_LIST)
|
||||
match = (value == pmap->mask);
|
||||
else
|
||||
match = ((value & pmap->mask) == pmap->mask);
|
||||
|
||||
if (match) {
|
||||
sprintf(p, listitem[index], pmap->desc);
|
||||
p = strchr(p, '\0');
|
||||
if (map->desc_map_type != BIT_DESC_MAP_ALL)
|
||||
break;
|
||||
index = 1;
|
||||
}
|
||||
}
|
||||
if (p == buf)
|
||||
return("None");
|
||||
|
||||
return((const char *)buf);
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_pef_print_flags(struct bit_desc_map * map, flg_e type, u32_t val)
|
||||
{ /*
|
||||
// print features/flags, using val (a bitmask), according to map.
|
||||
// observe the verbose flag, and print any labels, etc. based on type
|
||||
*/
|
||||
struct desc_map * pmap;
|
||||
u32_t maskval, index;
|
||||
|
||||
index = 0;
|
||||
for (pmap=map->desc_maps; pmap && pmap->desc; pmap++) {
|
||||
maskval = (val & pmap->mask);
|
||||
if (verbose)
|
||||
printf("%-*s : %s%s\n", KYWD_LENGTH,
|
||||
ipmi_pef_bit_desc(map, pmap->mask),
|
||||
pef_flag_fmts[type][1 + (maskval != 0)],
|
||||
pef_flag_fmts[type][0]);
|
||||
else if (maskval != 0) {
|
||||
printf(listitem[index], ipmi_pef_bit_desc(map, maskval));
|
||||
index = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_print_field(const char * fmt[2], const char * label, unsigned long val)
|
||||
{ /*
|
||||
// print a 'field' (observes 'verbose' flag)
|
||||
*/
|
||||
if (verbose)
|
||||
printf(fmt[0], KYWD_LENGTH, label, val);
|
||||
else if (first_field)
|
||||
printf(&fmt[1][2], val); /* skip field separator */
|
||||
else
|
||||
printf(fmt[1], val);
|
||||
|
||||
first_field = 0;
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_pef_print_dec(const char * text, unsigned long val)
|
||||
{ /* unsigned */
|
||||
ipmi_pef_print_field(pef_fld_fmts[F_DEC], text, val);
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_pef_print_int(const char * text, unsigned long val)
|
||||
{ /* signed */
|
||||
ipmi_pef_print_field(pef_fld_fmts[F_INT], text, val);
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_pef_print_hex(const char * text, unsigned long val)
|
||||
{ /* hex */
|
||||
ipmi_pef_print_field(pef_fld_fmts[F_HEX], text, val);
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_pef_print_str(const char * text, const char * val)
|
||||
{ /* string */
|
||||
ipmi_pef_print_field(pef_fld_fmts[F_STR], text, (unsigned long)val);
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_pef_print_2xd(const char * text, u8_t u1, u8_t u2)
|
||||
{ /* 2 hex digits */
|
||||
unsigned long val = ((u1 << 8) + u2) & 0xffff;
|
||||
ipmi_pef_print_field(pef_fld_fmts[F_2XD], text, val);
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_pef_print_1xd(const char * text, unsigned long val)
|
||||
{ /* 1 hex digit */
|
||||
ipmi_pef_print_field(pef_fld_fmts[F_1XD], text, val);
|
||||
}
|
||||
|
||||
static struct ipmi_rs *
|
||||
ipmi_pef_msg_exchange(struct ipmi_intf * intf, struct ipmi_rq * req, char * txt)
|
||||
{ /*
|
||||
// common IPMItool rqst/resp handling
|
||||
*/
|
||||
struct ipmi_rs * rsp = intf->sendrecv(intf, req);
|
||||
if (!rsp)
|
||||
return(NULL);
|
||||
if (rsp->ccode) {
|
||||
printf(" **Error %x in '%s' command\n", rsp ? rsp->ccode : 0, txt);
|
||||
return(NULL);
|
||||
}
|
||||
if (verbose > 2)
|
||||
printbuf(rsp->data, rsp->data_len, txt);
|
||||
return(rsp);
|
||||
}
|
||||
|
||||
static u8_t
|
||||
ipmi_pef_get_policy_table(struct ipmi_intf * intf,
|
||||
struct pef_cfgparm_policy_table_entry ** table)
|
||||
{ /*
|
||||
// get the PEF policy table: allocate space, fillin, and return its size
|
||||
// NB: the caller must free the returned area (when returned size > 0)
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_cfgparm_selector psel;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl, * ptmp;
|
||||
u32_t i;
|
||||
u8_t tbl_size;
|
||||
|
||||
memset(&psel, 0, sizeof(psel));
|
||||
psel.id = PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_SIZE;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
|
||||
req.msg.data = (u8_t *)&psel;
|
||||
req.msg.data_len = sizeof(psel);
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Alert policy table size");
|
||||
if (!rsp)
|
||||
return(0);
|
||||
tbl_size = (rsp->data[1] & PEF_POLICY_TABLE_SIZE_MASK);
|
||||
i = (tbl_size * sizeof(struct pef_cfgparm_policy_table_entry));
|
||||
if (!i
|
||||
|| (ptbl = (struct pef_cfgparm_policy_table_entry *)malloc(i)) == NULL)
|
||||
return(0);
|
||||
|
||||
memset(&psel, 0, sizeof(psel));
|
||||
psel.id = PEF_CFGPARM_ID_PEF_ALERT_POLICY_TABLE_ENTRY;
|
||||
for (ptmp=ptbl, i=1; i<=tbl_size; i++) {
|
||||
psel.set = (i & PEF_POLICY_TABLE_ID_MASK);
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Alert policy table entry");
|
||||
if (!rsp
|
||||
|| i != (rsp->data[1] & PEF_POLICY_TABLE_ID_MASK)) {
|
||||
printf(" **Error retrieving %s\n", "Alert policy table entry");
|
||||
free(ptbl);
|
||||
ptbl = NULL;
|
||||
tbl_size = 0;
|
||||
break;
|
||||
}
|
||||
memcpy(ptmp, &rsp->data[1], sizeof(*ptmp));
|
||||
ptmp++;
|
||||
}
|
||||
|
||||
*table = ptbl;
|
||||
return(tbl_size);
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_print_lan_dest(struct ipmi_intf * intf, u8_t ch, u8_t dest)
|
||||
{ /*
|
||||
// print LAN alert destination info
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_lan_cfgparm_selector lsel;
|
||||
struct pef_lan_cfgparm_dest_type * ptype;
|
||||
struct pef_lan_cfgparm_dest_info * pinfo;
|
||||
char buf[32];
|
||||
u8_t tbl_size, dsttype, timeout, retries;
|
||||
|
||||
memset(&lsel, 0, sizeof(lsel));
|
||||
lsel.id = PEF_LAN_CFGPARM_ID_DEST_COUNT;
|
||||
lsel.ch = ch;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_CMD_LAN_GET_CONFIG;
|
||||
req.msg.data = (u8_t *)&lsel;
|
||||
req.msg.data_len = sizeof(lsel);
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Alert destination count");
|
||||
if (!rsp) {
|
||||
printf(" **Error retrieving %s\n", "Alert destination count");
|
||||
return;
|
||||
}
|
||||
tbl_size = (rsp->data[1] & PEF_LAN_DEST_TABLE_SIZE_MASK);
|
||||
if (!dest || tbl_size == 0) /* LAN alerting not supported */
|
||||
return;
|
||||
|
||||
lsel.id = PEF_LAN_CFGPARM_ID_DESTTYPE;
|
||||
lsel.set = dest;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Alert destination type");
|
||||
if (!rsp || rsp->data[1] != lsel.set) {
|
||||
printf(" **Error retrieving %s\n", "Alert destination type");
|
||||
return;
|
||||
}
|
||||
ptype = (struct pef_lan_cfgparm_dest_type *)&rsp->data[1];
|
||||
dsttype = (ptype->dest_type & PEF_LAN_DEST_TYPE_MASK);
|
||||
timeout = ptype->alert_timeout;
|
||||
retries = (ptype->retries & PEF_LAN_RETRIES_MASK);
|
||||
ipmi_pef_print_str("Alert destination type",
|
||||
ipmi_pef_bit_desc(&pef_b2s_lan_desttype, dsttype));
|
||||
if (dsttype == PEF_LAN_DEST_TYPE_PET) {
|
||||
lsel.id = PEF_LAN_CFGPARM_ID_PET_COMMUNITY;
|
||||
lsel.set = 0;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "PET community");
|
||||
if (!rsp)
|
||||
printf(" **Error retrieving %s\n", "PET community");
|
||||
else {
|
||||
rsp->data[19] = '\0';
|
||||
ipmi_pef_print_str("PET Community", &rsp->data[1]);
|
||||
}
|
||||
}
|
||||
ipmi_pef_print_dec("ACK timeout/retry (secs)", timeout);
|
||||
ipmi_pef_print_dec("Retries", retries);
|
||||
|
||||
lsel.id = PEF_LAN_CFGPARM_ID_DESTADDR;
|
||||
lsel.set = dest;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Alert destination info");
|
||||
if (!rsp || rsp->data[1] != lsel.set)
|
||||
printf(" **Error retrieving %s\n", "Alert destination info");
|
||||
else {
|
||||
pinfo = (struct pef_lan_cfgparm_dest_info *)&rsp->data[1];
|
||||
sprintf(buf, "%u.%u.%u.%u",
|
||||
pinfo->ip[0], pinfo->ip[1], pinfo->ip[2], pinfo->ip[3]);
|
||||
ipmi_pef_print_str("IP address", buf);
|
||||
|
||||
sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
pinfo->mac[0], pinfo->mac[1], pinfo->mac[2],
|
||||
pinfo->mac[3], pinfo->mac[4], pinfo->mac[5]);
|
||||
ipmi_pef_print_str("MAC address", buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_print_serial_dest_dial(struct ipmi_intf * intf, char * label,
|
||||
struct pef_serial_cfgparm_selector * ssel)
|
||||
{ /*
|
||||
// print a dial string
|
||||
*/
|
||||
#define BLOCK_SIZE 16
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_serial_cfgparm_selector tmp;
|
||||
char * p, strval[(6 * BLOCK_SIZE) + 1];
|
||||
|
||||
memset(&tmp, 0, sizeof(tmp));
|
||||
tmp.id = PEF_SERIAL_CFGPARM_ID_DEST_DIAL_STRING_COUNT;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_CMD_SERIAL_GET_CONFIG;
|
||||
req.msg.data = (u8_t *)&tmp;
|
||||
req.msg.data_len = sizeof(tmp);
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Dial string count");
|
||||
if (!rsp || (rsp->data[1] & PEF_SERIAL_DIAL_STRING_COUNT_MASK) == 0)
|
||||
return; /* sssh, not supported */
|
||||
|
||||
memcpy(&tmp, ssel, sizeof(tmp));
|
||||
tmp.id = PEF_SERIAL_CFGPARM_ID_DEST_DIAL_STRING;
|
||||
tmp.block = 1;
|
||||
memset(strval, 0, sizeof(strval));
|
||||
p = strval;
|
||||
for (;;) {
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, label);
|
||||
if (!rsp
|
||||
|| (rsp->data[1] != ssel->id)
|
||||
|| (rsp->data[2] != tmp.block)) {
|
||||
printf(" **Error retrieving %s\n", label);
|
||||
return;
|
||||
}
|
||||
memcpy(p, &rsp->data[3], BLOCK_SIZE);
|
||||
if (strchr(p, '\0') <= (p + BLOCK_SIZE))
|
||||
break;
|
||||
if ((p += BLOCK_SIZE) >= &strval[sizeof(strval)-1])
|
||||
break;
|
||||
tmp.block++;
|
||||
}
|
||||
|
||||
ipmi_pef_print_str(label, strval);
|
||||
#undef BLOCK_SIZE
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_print_serial_dest_tap(struct ipmi_intf * intf,
|
||||
struct pef_serial_cfgparm_selector * ssel)
|
||||
{ /*
|
||||
// print TAP destination info
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_serial_cfgparm_selector tmp;
|
||||
struct pef_serial_cfgparm_tap_svc_settings * pset;
|
||||
u8_t dialstr_id, setting_id;
|
||||
|
||||
memset(&tmp, 0, sizeof(tmp));
|
||||
tmp.id = PEF_SERIAL_CFGPARM_ID_TAP_ACCT_COUNT;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_CMD_SERIAL_GET_CONFIG;
|
||||
req.msg.data = (u8_t *)&tmp;
|
||||
req.msg.data_len = sizeof(tmp);
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Number of TAP accounts");
|
||||
if (!rsp || (rsp->data[1] & PEF_SERIAL_TAP_ACCT_COUNT_MASK) == 0)
|
||||
return; /* sssh, not supported */
|
||||
|
||||
memcpy(&tmp, ssel, sizeof(tmp));
|
||||
tmp.id = PEF_SERIAL_CFGPARM_ID_TAP_ACCT_INFO;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "TAP account info");
|
||||
if (!rsp || (rsp->data[1] != tmp.set)) {
|
||||
printf(" **Error retrieving %s\n", "TAP account info");
|
||||
return;
|
||||
}
|
||||
dialstr_id = (rsp->data[2] & PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_MASK);
|
||||
dialstr_id >>= PEF_SERIAL_TAP_ACCT_INFO_DIAL_STRING_ID_SHIFT;
|
||||
setting_id = (rsp->data[2] & PEF_SERIAL_TAP_ACCT_INFO_SVC_SETTINGS_ID_MASK);
|
||||
tmp.set = dialstr_id;
|
||||
ipmi_pef_print_serial_dest_dial(intf, "TAP Dial string", &tmp);
|
||||
|
||||
tmp.set = setting_id;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "TAP service settings");
|
||||
if (!rsp || (rsp->data[1] != tmp.set)) {
|
||||
printf(" **Error retrieving %s\n", "TAP service settings");
|
||||
return;
|
||||
}
|
||||
pset = (struct pef_serial_cfgparm_tap_svc_settings *)&rsp->data[1];
|
||||
ipmi_pef_print_str("TAP confirmation",
|
||||
ipmi_pef_bit_desc(&pef_b2s_tap_svc_confirm, pset->confirmation_flags));
|
||||
|
||||
/* TODO : additional TAP settings? */
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_print_serial_dest_ppp(struct ipmi_intf * intf,
|
||||
struct pef_serial_cfgparm_selector * ssel)
|
||||
{ /*
|
||||
// print PPP destination info
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_print_serial_dest_callback(struct ipmi_intf * intf,
|
||||
struct pef_serial_cfgparm_selector * ssel)
|
||||
{ /*
|
||||
// print callback destination info
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_print_serial_dest(struct ipmi_intf * intf, u8_t ch, u8_t dest)
|
||||
{ /*
|
||||
// print Serial/PPP alert destination info
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_serial_cfgparm_selector ssel;
|
||||
u8_t tbl_size, wrk;
|
||||
struct pef_serial_cfgparm_dest_info * pinfo;
|
||||
|
||||
memset(&ssel, 0, sizeof(ssel));
|
||||
ssel.id = PEF_SERIAL_CFGPARM_ID_DEST_COUNT;
|
||||
ssel.ch = ch;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_TRANSPORT;
|
||||
req.msg.cmd = IPMI_CMD_SERIAL_GET_CONFIG;
|
||||
req.msg.data = (u8_t *)&ssel;
|
||||
req.msg.data_len = sizeof(ssel);
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Alert destination count");
|
||||
if (!rsp) {
|
||||
printf(" **Error retrieving %s\n", "Alert destination count");
|
||||
return;
|
||||
}
|
||||
tbl_size = (rsp->data[1] & PEF_SERIAL_DEST_TABLE_SIZE_MASK);
|
||||
if (!dest || tbl_size == 0) /* Page alerting not supported */
|
||||
return;
|
||||
|
||||
ssel.id = PEF_SERIAL_CFGPARM_ID_DESTINFO;
|
||||
ssel.set = dest;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Alert destination info");
|
||||
if (!rsp || rsp->data[1] != ssel.set)
|
||||
printf(" **Error retrieving %s\n", "Alert destination info");
|
||||
else {
|
||||
pinfo = (struct pef_serial_cfgparm_dest_info *)rsp->data;
|
||||
wrk = (pinfo->dest_type & PEF_SERIAL_DEST_TYPE_MASK);
|
||||
ipmi_pef_print_str("Alert destination type",
|
||||
ipmi_pef_bit_desc(&pef_b2s_serial_desttype, wrk));
|
||||
ipmi_pef_print_dec("ACK timeout (secs)",
|
||||
pinfo->alert_timeout);
|
||||
ipmi_pef_print_dec("Retries",
|
||||
(pinfo->retries & PEF_SERIAL_RETRIES_MASK));
|
||||
switch (wrk) {
|
||||
case PEF_SERIAL_DEST_TYPE_DIAL:
|
||||
ipmi_pef_print_serial_dest_dial(intf, "Serial dial string", &ssel);
|
||||
break;
|
||||
case PEF_SERIAL_DEST_TYPE_TAP:
|
||||
ipmi_pef_print_serial_dest_tap(intf, &ssel);
|
||||
break;
|
||||
case PEF_SERIAL_DEST_TYPE_PPP:
|
||||
ipmi_pef_print_serial_dest_ppp(intf, &ssel);
|
||||
break;
|
||||
case PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK:
|
||||
case PEF_SERIAL_DEST_TYPE_PPP_CALLBACK:
|
||||
ipmi_pef_print_serial_dest_callback(intf, &ssel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_print_dest(struct ipmi_intf * intf, u8_t ch, u8_t dest)
|
||||
{ /*
|
||||
// print generic alert destination info
|
||||
*/
|
||||
ipmi_pef_print_dec("Destination ID", dest);
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_pef_print_event_info(struct pef_cfgparm_filter_table_entry * pef, char * buf)
|
||||
{ /*
|
||||
// print PEF entry Event info: class, severity, trigger, etc.
|
||||
*/
|
||||
static char * classes[] = {"Discrete", "Threshold", "OEM"};
|
||||
unsigned short offmask;
|
||||
char * p;
|
||||
int i;
|
||||
u8_t t;
|
||||
|
||||
ipmi_pef_print_str("Event severity",
|
||||
ipmi_pef_bit_desc(&pef_b2s_severities, pef->entry.severity));
|
||||
|
||||
t = pef->entry.event_trigger;
|
||||
if (t == PEF_EVENT_TRIGGER_THRESHOLD)
|
||||
i = 1;
|
||||
else if (t > PEF_EVENT_TRIGGER_SENSOR_SPECIFIC)
|
||||
i = 2;
|
||||
else
|
||||
i = 0;
|
||||
ipmi_pef_print_str("Event class", classes[i]);
|
||||
|
||||
offmask = ((pef->entry.event_data_1_offset_mask[1] << 8)
|
||||
+ pef->entry.event_data_1_offset_mask[0]);
|
||||
|
||||
if (offmask == 0xffff || t == PEF_EVENT_TRIGGER_MATCH_ANY)
|
||||
strcpy(buf, "Any");
|
||||
else if (t == PEF_EVENT_TRIGGER_UNSPECIFIED)
|
||||
strcpy(buf, "Unspecified");
|
||||
else if (t == PEF_EVENT_TRIGGER_SENSOR_SPECIFIC)
|
||||
strcpy(buf, "Sensor-specific");
|
||||
else if (t > PEF_EVENT_TRIGGER_SENSOR_SPECIFIC)
|
||||
strcpy(buf, "OEM");
|
||||
else {
|
||||
sprintf(buf, "(0x%02x/0x%04x)", t, offmask);
|
||||
p = strchr(buf, '\0');
|
||||
for (i=0; i<PEF_B2S_GENERIC_ER_ENTRIES; i++) {
|
||||
if (offmask & 1) {
|
||||
sprintf(p, ",%s", ipmi_pef_bit_desc(pef_b2s_generic_ER[t-1], i));
|
||||
p = strchr(p, '\0');
|
||||
}
|
||||
offmask >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
ipmi_pef_print_str("Event trigger(s)", buf);
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_print_entry(struct ipmi_rs * rsp, u8_t id,
|
||||
struct pef_cfgparm_filter_table_entry * pef)
|
||||
{ /*
|
||||
// print a PEF table entry
|
||||
*/
|
||||
struct pef_cfgparm_policy_table_entry * ptbl;
|
||||
u8_t wrk, set;
|
||||
char buf[128];
|
||||
|
||||
ipmi_pef_print_dec("PEF table entry", id);
|
||||
|
||||
wrk = !!(pef->entry.config & PEF_CONFIG_ENABLED);
|
||||
sprintf(buf, "%sactive", (wrk ? "" : "in"));
|
||||
if (pef->entry.config & PEF_CONFIG_PRECONFIGURED)
|
||||
strcat(buf, ", pre-configured");
|
||||
|
||||
ipmi_pef_print_str("Status", buf);
|
||||
|
||||
if (wrk != 0) {
|
||||
ipmi_pef_print_1xd("Version", rsp->data[0]);
|
||||
ipmi_pef_print_str("Sensor type",
|
||||
ipmi_pef_bit_desc(&pef_b2s_sensortypes, pef->entry.sensor_type));
|
||||
|
||||
if (pef->entry.sensor_number == PEF_SENSOR_NUMBER_MATCH_ANY)
|
||||
ipmi_pef_print_str("Sensor number", "Any");
|
||||
else
|
||||
ipmi_pef_print_dec("Sensor number", pef->entry.sensor_number);
|
||||
|
||||
ipmi_pef_print_event_info(pef, buf);
|
||||
ipmi_pef_print_str("Action",
|
||||
ipmi_pef_bit_desc(&pef_b2s_actions, pef->entry.action));
|
||||
|
||||
if (pef->entry.action & PEF_ACTION_ALERT) {
|
||||
set = (pef->entry.policy_number & PEF_POLICY_NUMBER_MASK);
|
||||
ipmi_pef_print_int("Policy set", set);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_list_entries(struct ipmi_intf * intf)
|
||||
{ /*
|
||||
// list all PEF table entries
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_cfgparm_selector psel;
|
||||
struct pef_cfgparm_filter_table_entry * pcfg;
|
||||
u32_t i;
|
||||
u8_t max_filters;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = IPMI_CMD_GET_PEF_CAPABILITIES;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "PEF capabilities");
|
||||
if (!rsp
|
||||
|| (max_filters = ((struct pef_capabilities *)rsp->data)->tblsize) == 0)
|
||||
return; /* sssh, not supported */
|
||||
|
||||
memset(&psel, 0, sizeof(psel));
|
||||
psel.id = PEF_CFGPARM_ID_PEF_FILTER_TABLE_ENTRY;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
|
||||
req.msg.data = (u8_t *)&psel;
|
||||
req.msg.data_len = sizeof(psel);
|
||||
for (i=1; i<=max_filters; i++) {
|
||||
if (i > 1)
|
||||
printf("\n");
|
||||
psel.set = (i & PEF_FILTER_TABLE_ID_MASK);
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "PEF table entry");
|
||||
if (!rsp
|
||||
|| (psel.set != (rsp->data[1] & PEF_FILTER_TABLE_ID_MASK))) {
|
||||
printf(" **Error retrieving %s\n", "PEF table entry");
|
||||
continue;
|
||||
}
|
||||
pcfg = (struct pef_cfgparm_filter_table_entry *)&rsp->data[1];
|
||||
first_field = 1;
|
||||
ipmi_pef_print_entry(rsp, psel.set, pcfg);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_list_policies(struct ipmi_intf * intf)
|
||||
{ /*
|
||||
// list PEF alert policies
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_lan_cfgparm_selector lsel;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl, * ptmp;
|
||||
u32_t i;
|
||||
u8_t wrk, ch, medium, tbl_size;
|
||||
|
||||
tbl_size = ipmi_pef_get_policy_table(intf, &ptbl);
|
||||
if (!tbl_size)
|
||||
return;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = IPMI_CMD_GET_CHANNEL_INFO;
|
||||
req.msg.data = &ch;
|
||||
req.msg.data_len = sizeof(ch);
|
||||
for (ptmp=ptbl, i=1; i<=tbl_size; i++, ptmp++) {
|
||||
if ((ptmp->entry.policy & PEF_POLICY_ENABLED) == PEF_POLICY_ENABLED) {
|
||||
if (i > 1)
|
||||
printf("\n");
|
||||
first_field = 1;
|
||||
ipmi_pef_print_dec("Alert policy table entry",
|
||||
(ptmp->data1 & PEF_POLICY_TABLE_ID_MASK));
|
||||
ipmi_pef_print_dec("Policy set",
|
||||
(ptmp->entry.policy & PEF_POLICY_ID_MASK) >> PEF_POLICY_ID_SHIFT);
|
||||
ipmi_pef_print_str("Policy entry rule",
|
||||
ipmi_pef_bit_desc(&pef_b2s_policies, (ptmp->entry.policy & PEF_POLICY_FLAGS_MASK)));
|
||||
|
||||
if (ptmp->entry.alert_string_key & PEF_POLICY_EVENT_SPECIFIC) {
|
||||
ipmi_pef_print_str("Event-specific", "true");
|
||||
continue;
|
||||
}
|
||||
wrk = ptmp->entry.chan_dest;
|
||||
|
||||
/* channel/description */
|
||||
ch = (wrk & PEF_POLICY_CHANNEL_MASK) >> PEF_POLICY_CHANNEL_SHIFT;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Channel info");
|
||||
if (!rsp || rsp->data[0] != ch) {
|
||||
printf(" **Error retrieving %s\n", "Channel info");
|
||||
continue;
|
||||
}
|
||||
medium = rsp->data[1];
|
||||
ipmi_pef_print_dec("Channel number", ch);
|
||||
ipmi_pef_print_str("Channel medium",
|
||||
ipmi_pef_bit_desc(&pef_b2s_ch_medium, medium));
|
||||
|
||||
/* destination/description */
|
||||
wrk &= PEF_POLICY_DESTINATION_MASK;
|
||||
switch (medium) {
|
||||
case PEF_CH_MEDIUM_TYPE_LAN:
|
||||
ipmi_pef_print_lan_dest(intf, ch, wrk);
|
||||
break;
|
||||
case PEF_CH_MEDIUM_TYPE_SERIAL:
|
||||
ipmi_pef_print_serial_dest(intf, ch, wrk);
|
||||
break;
|
||||
default:
|
||||
ipmi_pef_print_dest(intf, ch, wrk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
free(ptbl);
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_get_status(struct ipmi_intf * intf)
|
||||
{ /*
|
||||
// report the PEF status
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_cfgparm_selector psel;
|
||||
char tbuf[40];
|
||||
time_t ts;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = IPMI_CMD_GET_LAST_PROCESSED_EVT_ID;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "Last S/W processed ID");
|
||||
if (!rsp) {
|
||||
printf(" **Error retrieving %s\n", "Last S/W processed ID");
|
||||
return;
|
||||
}
|
||||
#if WORDS_BIGENDIAN
|
||||
ts = (time_t)(rsp->data[0]<<24 + rsp->data[1]<<16 + rsp->data[2]<<8 + rsp->data[3]);
|
||||
#else
|
||||
ts = (time_t)(*(long *)rsp->data);
|
||||
#endif
|
||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&ts));
|
||||
|
||||
ipmi_pef_print_str("Last SEL addition", tbuf);
|
||||
ipmi_pef_print_2xd("Last SEL record ID", rsp->data[5], rsp->data[4]);
|
||||
ipmi_pef_print_2xd("Last S/W processed ID", rsp->data[7], rsp->data[6]);
|
||||
ipmi_pef_print_2xd("Last BMC processed ID", rsp->data[9], rsp->data[8]);
|
||||
|
||||
memset(&psel, 0, sizeof(psel));
|
||||
psel.id = PEF_CFGPARM_ID_PEF_CONTROL;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
|
||||
req.msg.data = (u8_t *)&psel;
|
||||
req.msg.data_len = sizeof(psel);
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "PEF control");
|
||||
if (!rsp) {
|
||||
printf(" **Error retrieving %s\n", "PEF control");
|
||||
return;
|
||||
}
|
||||
ipmi_pef_print_flags(&pef_b2s_control, P_ABLE, rsp->data[1]);
|
||||
}
|
||||
|
||||
static void
|
||||
ipmi_pef_get_info(struct ipmi_intf * intf)
|
||||
{ /*
|
||||
// report PEF capabilities + System GUID
|
||||
*/
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
struct pef_capabilities * pcap;
|
||||
struct pef_cfgparm_selector psel;
|
||||
struct pef_cfgparm_policy_table_entry * ptbl;
|
||||
u8_t * uid;
|
||||
u8_t actions, tbl_size;
|
||||
|
||||
if ((tbl_size = ipmi_pef_get_policy_table(intf, &ptbl)) > 0)
|
||||
free(ptbl);
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = IPMI_CMD_GET_PEF_CAPABILITIES;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "PEF capabilities");
|
||||
if (!rsp)
|
||||
return;
|
||||
pcap = (struct pef_capabilities *)rsp->data;
|
||||
ipmi_pef_print_1xd("Version", pcap->version);
|
||||
ipmi_pef_print_dec("PEF table size", pcap->tblsize);
|
||||
ipmi_pef_print_dec("Alert policy table size", tbl_size);
|
||||
actions = pcap->actions;
|
||||
|
||||
memset(&psel, 0, sizeof(psel));
|
||||
psel.id = PEF_CFGPARM_ID_SYSTEM_GUID;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_SE;
|
||||
req.msg.cmd = IPMI_CMD_GET_PEF_CONFIG_PARMS;
|
||||
req.msg.data = (u8_t *)&psel;
|
||||
req.msg.data_len = sizeof(psel);
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "System GUID");
|
||||
uid = NULL;
|
||||
if (rsp && (rsp->data[1] & PEF_SYSTEM_GUID_USED_IN_PET))
|
||||
uid = &rsp->data[2];
|
||||
else {
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = IPMI_CMD_GET_SYSTEM_GUID;
|
||||
rsp = ipmi_pef_msg_exchange(intf, &req, "System GUID");
|
||||
if (rsp)
|
||||
uid = &rsp->data[0];
|
||||
}
|
||||
if (uid) { /* got GUID? */
|
||||
if (verbose)
|
||||
printf(pef_fld_fmts[F_UID][0], KYWD_LENGTH, "System GUID",
|
||||
uid[0], uid[1], uid[2], uid[3], uid[4], uid[5], uid[6], uid[7],
|
||||
uid[8], uid[9], uid[10],uid[11],uid[12],uid[13],uid[14],uid[15]);
|
||||
else
|
||||
printf(pef_fld_fmts[F_UID][1],
|
||||
uid[0], uid[1], uid[2], uid[3], uid[4], uid[5], uid[6], uid[7],
|
||||
uid[8], uid[9], uid[10],uid[11],uid[12],uid[13],uid[14],uid[15]);
|
||||
}
|
||||
ipmi_pef_print_flags(&pef_b2s_actions, P_SUPP, actions);
|
||||
}
|
||||
|
||||
int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv)
|
||||
{ /*
|
||||
// PEF subcommand handling
|
||||
*/
|
||||
int help = 0;
|
||||
|
||||
if (!argc || !strncmp(argv[0], "info", 4))
|
||||
ipmi_pef_get_info(intf);
|
||||
else if (!strncmp(argv[0], "help", 4))
|
||||
help = 1;
|
||||
else if (!strncmp(argv[0], "status", 6))
|
||||
ipmi_pef_get_status(intf);
|
||||
else if (!strncmp(argv[0], "policy", 6))
|
||||
ipmi_pef_list_policies(intf);
|
||||
else if (!strncmp(argv[0], "list", 4))
|
||||
ipmi_pef_list_entries(intf);
|
||||
else {
|
||||
help = 1;
|
||||
printf("Invalid PEF command: '%s'\n\n", argv[0]);
|
||||
}
|
||||
if (help)
|
||||
printf("PEF commands: info status policy list\n");
|
||||
else if (!verbose)
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
@ -60,6 +60,7 @@
|
||||
#include <ipmitool/ipmi_event.h>
|
||||
#include <ipmitool/ipmi_user.h>
|
||||
#include <ipmitool/ipmi_raw.h>
|
||||
#include <ipmitool/ipmi_pef.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@ -92,6 +93,7 @@ struct ipmi_cmd {
|
||||
{ ipmi_sensor_main, "sensor", "Print detailed sensor information" },
|
||||
{ ipmi_fru_main, "fru", "Print built-in FRU and scan SDR for FRU locators" },
|
||||
{ ipmi_sel_main, "sel", "Print System Evelnt Log" },
|
||||
{ ipmi_pef_main, "pef", "Configure Platform Event Filtering (PEF)" },
|
||||
{ ipmi_sol_main, "sol", "Configure IPMIv2.0 Serial-over-LAN" },
|
||||
{ ipmi_isol_main, "isol", "Configure Intel IPMIv1.5 Serial-over-LAN" },
|
||||
{ ipmi_user_main, "user", "Configure BMC users" },
|
||||
|
||||
@ -457,7 +457,7 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
||||
memcpy(&rsp->session.id, rsp->data+x, 4);
|
||||
x += 4;
|
||||
|
||||
if (intf->session->active && intf->session->authtype)
|
||||
if (intf->session->active && (rsp->session.authtype || intf->session->authtype))
|
||||
x += 16;
|
||||
|
||||
rsp->session.msglen = rsp->data[x++];
|
||||
@ -497,11 +497,13 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
|
||||
if (verbose > 2)
|
||||
printf("IPMI Request Match found\n");
|
||||
if (intf->target_addr != IPMI_BMC_SLAVE_ADDR) {
|
||||
if (verbose > 2)
|
||||
printf("Bridged cmd resp: %s\n", buf2str(&rsp->data[x],rsp->data_len));
|
||||
/* bridged command: lose extra header */
|
||||
x += sizeof(rsp->payload.ipmi_response);
|
||||
if (verbose && rsp->data[x-1] != 0)
|
||||
printf("WARNING: Bridged cmd ccode = 0x%02x\n",
|
||||
rsp->data[x-1]);
|
||||
rsp->data[x-1]);
|
||||
}
|
||||
ipmi_req_remove_entry(rsp->payload.ipmi_response.rq_seq,
|
||||
rsp->payload.ipmi_response.cmd);
|
||||
@ -751,7 +753,7 @@ unsigned char * ipmi_lan_build_rsp(struct ipmi_intf * intf, struct ipmi_rs * rsp
|
||||
unsigned char * msg;
|
||||
|
||||
len = rsp->data_len + 22;
|
||||
if (intf->session->active && intf->session->authtype)
|
||||
if (intf->session->active)
|
||||
len += 16;
|
||||
|
||||
msg = malloc(len);
|
||||
@ -915,17 +917,18 @@ ipmi_get_auth_capabilities_cmd(struct ipmi_intf * intf)
|
||||
printf("OEM ");
|
||||
printf("\n");
|
||||
printf(" Per-msg auth : %sabled\n",
|
||||
(rsp->data[2] & 1<<4) ? "dis" : "en");
|
||||
(rsp->data[2] & IPMI_AUTHSTATUS_PER_MSG_DISABLED) ? "dis" : "en");
|
||||
printf(" User level auth : %sabled\n",
|
||||
(rsp->data[2] & 1<<3) ? "dis" : "en");
|
||||
(rsp->data[2] & IPMI_AUTHSTATUS_PER_USER_DISABLED) ? "dis" : "en");
|
||||
printf(" Non-null users : %sabled\n",
|
||||
(rsp->data[2] & 1<<2) ? "en" : "dis");
|
||||
(rsp->data[2] & IPMI_AUTHSTATUS_NONNULL_USERS_ENABLED) ? "en" : "dis");
|
||||
printf(" Null users : %sabled\n",
|
||||
(rsp->data[2] & 1<<1) ? "en" : "dis");
|
||||
(rsp->data[2] & IPMI_AUTHSTATUS_NULL_USERS_ENABLED) ? "en" : "dis");
|
||||
printf(" Anonymous login : %sabled\n",
|
||||
(rsp->data[2] & 1<<0) ? "en" : "dis");
|
||||
(rsp->data[2] & IPMI_AUTHSTATUS_ANONYMOUS_USERS_ENABLED) ? "en" : "dis");
|
||||
printf("\n");
|
||||
}
|
||||
s->authstatus = rsp->data[2];
|
||||
|
||||
if (s->password &&
|
||||
(!s->authtype_set ||
|
||||
@ -1106,7 +1109,13 @@ ipmi_activate_session_cmd(struct ipmi_intf * intf)
|
||||
memcpy(&s->session_id, rsp->data + 1, 4);
|
||||
s->in_seq = rsp->data[8] << 24 | rsp->data[7] << 16 | rsp->data[6] << 8 | rsp->data[5];
|
||||
if (!s->in_seq) ++s->in_seq;
|
||||
s->authtype = rsp->data[0] & 0xf;
|
||||
|
||||
if (s->authtype & IPMI_AUTHSTATUS_PER_MSG_DISABLED)
|
||||
s->authtype = IPMI_SESSION_AUTHTYPE_NONE;
|
||||
else if (s->authtype != rsp->data[0] & 0xf) {
|
||||
printf("\nInvalid Session AuthType in response!!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (verbose > 1) {
|
||||
printf("\nSession Activated\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user