mc: guid: Add support for non-standard encodings

There are lots of BMC implementations that violate the IPMI
specification in regard to GUID encoding and instead encode
GUIDs according to either RFC4122 or SMBIOS specifications.

This commit restores the default behavior of `mc guid` to
SMBIOS-based decoding and adds options to allow for decoding
according to IPMI or RFC4122 specifications.

It also allows to simply dump the received GUID as is
without any parsing.

It is possible that in future versions `ipmitool` will
change default behavior to 'ipmi' instead of 'smbios'.

Partially resolves ipmitool/ipmitool#25

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
Alexander Amelkin
2018-08-01 16:34:04 +03:00
parent b44ec2fb65
commit f43a78bfc3
3 changed files with 177 additions and 51 deletions

View File

@@ -2017,9 +2017,50 @@ The default will clear statistics on the first found LAN channel.
Instructs the BMC to perform a warm or cold reset.
.TP
\fIguid\fP
\fIguid\fP [\fBsmbios\fR|\fBrfc4122\fR|\fBipmi\fR|\fBdump\fR]
Display the Management Controller Globally Unique IDentifier.
.RS
.TP
\fIsmbios\fP
.br
This is the default behavior for ipmitool for the sake of compatibility
with old versions and broken BMC implementations whose number is legion.
Decode GUID as if it was sent by BMC as prescribed by SMBIOS specification.
\fBNOTE:\fR This is a violation of IPMI specification, but many BMC implementations do
it this way. If your BMC's GUID is shown correctly using this option, you
may want to inform your BMC manufacturer that they have a bug.
.TP
\fIrfc4122\fP or \fIrfc\fP
.br
Decode GUID as if it was sent by BMC as prescribed by RFC4122 specification.
\fBNOTE:\fR This is a violation of IPMI specification.
If your BMC's GUID is shown correctly using this option, you
may want to inform your BMC manufacturer that they have a bug.
.TP
\fIipmi\fP
.br
Decode GUID according to IPMI specification. It MUST show the correct GUID.
If it doesn't, try other options above and inform your BMC manufacturer of the bug.
.TP
\fIdump\fP
.br
Dump as hex the data received from BMC in response to Get Device GUID command.
No decoding or interpretation is performed. First received byte is dumped first.
.RE
.TP
\fIinfo\fP
.br