Make chk_nm_rsp() search for the codes really defined in the
NM dictionary and not just check some arbitrary completion codes
range. For all codes not defined in NM dictionary, print strings
from the generic IPMI completion codes dictionary.
Rename chk_nm_rsp() to is_nm_err() to better reflect the purpose
of the function. Make it 'bool'. Use centralized exiting for the
function.
Also fix wording for invalid NM ID.
End-user-impact: On invalid responses from the NM, instead of
"A valid NM command was not returned!" accompanied
by a single byte of data, the following message
with full 3 bytes of data will now be printed:
"No valid NM ID in response!"
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Replace all magic numbers implied to mean NM completions codes
with descriptive macro names.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Add nm_set_id() and nm_check_id() functions, use them and
the existing htoipmi24() to reduce code duplication.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>