|
1 | 1 | # -*- coding: binary -*-
|
2 | 2 |
|
| 3 | +require 'bindata' |
| 4 | + |
3 | 5 | module Rex
|
4 | 6 | module Proto
|
5 | 7 | module IPMI
|
6 | 8 |
|
7 |
| -class Channel_Auth_Reply < BitStruct |
8 |
| - unsigned :rmcp_version, 8, "RMCP Version" |
9 |
| - unsigned :rmcp_padding, 8, "RMCP Padding" |
10 |
| - unsigned :rmcp_sequence, 8, "RMCP Sequence" |
11 |
| - unsigned :rmcp_mtype, 1, "RMCP Message Type" |
12 |
| - unsigned :rmcp_class, 7, "RMCP Message Class" |
13 |
| - |
14 |
| - unsigned :session_auth_type, 8, "Session Auth Type" |
15 |
| - unsigned :session_sequence, 32, "Session Sequence Number" |
16 |
| - unsigned :session_id, 32, "Session ID" |
17 |
| - unsigned :message_length, 8, "Message Length" |
18 |
| - |
19 |
| - unsigned :ipmi_tgt_address, 8, "IPMI Target Address" |
20 |
| - unsigned :ipmi_tgt_lun, 8, "IPMI Target LUN" |
21 |
| - unsigned :ipmi_header_checksum, 8, "IPMI Header Checksum" |
22 |
| - unsigned :ipmi_src_address, 8, "IPMI Source Address" |
23 |
| - unsigned :ipmi_src_lun, 8, "IPMI Source LUN" |
24 |
| - unsigned :ipmi_command, 8, "IPMI Command" |
25 |
| - unsigned :ipmi_completion_code, 8, "IPMI Completion Code" |
26 |
| - |
27 |
| - unsigned :ipmi_channel, 8, "IPMI Channel" |
28 |
| - |
29 |
| - unsigned :ipmi_compat_20, 1, "IPMI Version Compatibility: IPMI 2.0+" |
30 |
| - unsigned :ipmi_compat_reserved1, 1, "IPMI Version Compatibility: Reserved 1" |
31 |
| - unsigned :ipmi_compat_oem_auth, 1, "IPMI Version Compatibility: OEM Authentication" |
32 |
| - unsigned :ipmi_compat_password, 1, "IPMI Version Compatibility: Straight Password" |
33 |
| - unsigned :ipmi_compat_reserved2, 1, "IPMI Version Compatibility: Reserved 2" |
34 |
| - unsigned :ipmi_compat_md5, 1, "IPMI Version Compatibility: MD5" |
35 |
| - unsigned :ipmi_compat_md2, 1, "IPMI Version Compatibility: MD2" |
36 |
| - unsigned :ipmi_compat_none, 1, "IPMI Version Compatibility: None" |
37 |
| - |
38 |
| - unsigned :ipmi_user_reserved1, 2, "IPMI User Compatibility: Reserved 1" |
39 |
| - unsigned :ipmi_user_kg, 1, "IPMI User Compatibility: KG Set to Default" |
40 |
| - unsigned :ipmi_user_disable_message_auth, 1, "IPMI User Compatibility: Disable Per-Message Authentication" |
41 |
| - unsigned :ipmi_user_disable_user_auth, 1, "IPMI User Compatibility: Disable User-Level Authentication" |
42 |
| - unsigned :ipmi_user_non_null, 1, "IPMI User Compatibility: Non-Null Usernames Enabled" |
43 |
| - unsigned :ipmi_user_null, 1, "IPMI User Compatibility: Null Usernames Enabled" |
44 |
| - unsigned :ipmi_user_anonymous, 1, "IPMI User Compatibility: Anonymous Login Enabled" |
45 |
| - |
46 |
| - unsigned :ipmi_conn_reserved1, 6, "IPMI Connection Compatibility: Reserved 1" |
47 |
| - unsigned :ipmi_conn_20, 1, "IPMI Connection Compatibility: 2.0" |
48 |
| - unsigned :ipmi_conn_15, 1, "IPMI Connection Compatibility: 1.5" |
49 |
| - |
50 |
| - unsigned :ipmi_oem_id, 24, "IPMI OEM ID", :endian => 'little' |
51 |
| - |
52 |
| - rest :ipm_oem_data, "IPMI OEM Data + Checksum Byte" |
53 |
| - |
| 9 | +class Channel_Auth_Reply < BinData::Record |
| 10 | + endian :little |
| 11 | + uint8 :rmcp_version ,label: "RMCP Version" |
| 12 | + uint8 :rmcp_padding ,label: "RMCP Padding" |
| 13 | + uint8 :rmcp_sequence ,label: "RMCP Sequence" |
| 14 | + bit1 :rmcp_mtype ,label: "RMCP Message Type" |
| 15 | + bit7 :rmcp_class ,label: "RMCP Message Class" |
| 16 | + |
| 17 | + uint8 :session_auth_type ,label: "Session Auth Type" |
| 18 | + uint32 :session_sequence ,label: "Session Sequence Number" |
| 19 | + uint32 :session_id ,label: "Session ID" |
| 20 | + uint8 :message_length ,label: "Message Length" |
| 21 | + |
| 22 | + uint8 :ipmi_tgt_address ,label: "IPMI Target Address" |
| 23 | + uint8 :ipmi_tgt_lun ,label: "IPMI Target LUN" |
| 24 | + uint8 :ipmi_header_checksum ,label: "IPMI Header Checksum" |
| 25 | + uint8 :ipmi_src_address ,label: "IPMI Source Address" |
| 26 | + uint8 :ipmi_src_luna ,label: "IPMI Source LUN" |
| 27 | + uint8 :ipmi_command ,label: "IPMI Command" |
| 28 | + uint8 :ipmi_completion_code ,label: "IPMI Completion Code" |
| 29 | + |
| 30 | + uint8 :ipmi_channel ,label: "IPMI Channel" |
| 31 | + |
| 32 | + bit1 :ipmi_compat_20 ,label: "IPMI Version Compatibility: IPMI 2.0+" |
| 33 | + bit1 :ipmi_compat_reserved1 ,label: "IPMI Version Compatibility: Reserved 1" |
| 34 | + bit1 :ipmi_compat_oem_auth ,label: "IPMI Version Compatibility: OEM Authentication" |
| 35 | + bit1 :ipmi_compat_password ,label: "IPMI Version Compatibility: Straight Password" |
| 36 | + bit1 :ipmi_compat_reserved2 ,label: "IPMI Version Compatibility: Reserved 2" |
| 37 | + bit1 :ipmi_compat_md5 ,label: "IPMI Version Compatibility: MD5" |
| 38 | + bit1 :ipmi_compat_md2 ,label: "IPMI Version Compatibility: MD2" |
| 39 | + bit1 :ipmi_compat_none ,label: "IPMI Version Compatibility: None" |
| 40 | + |
| 41 | + bit2 :ipmi_user_reserved1 ,label: "IPMI User Compatibility: Reserved 1" |
| 42 | + bit1 :ipmi_user_kg ,label: "IPMI User Compatibility: KG Set to Default" |
| 43 | + bit1 :ipmi_user_disable_message_auth ,label: "IPMI User Compatibility: Disable Per-Message Authentication" |
| 44 | + bit1 :ipmi_user_disable_user_auth ,label: "IPMI User Compatibility: Disable User-Level Authentication" |
| 45 | + bit1 :ipmi_user_non_null ,label: "IPMI User Compatibility: Non-Null Usernames Enabled" |
| 46 | + bit1 :ipmi_user_null ,label: "IPMI User Compatibility: Null Usernames Enabled" |
| 47 | + bit1 :ipmi_user_anonymous ,label: "IPMI User Compatibility: Anonymous Login Enabled" |
| 48 | + |
| 49 | + bit6 :ipmi_conn_reserved1 ,label: "IPMI Connection Compatibility: Reserved 1" |
| 50 | + bit1 :ipmi_conn_20 ,label: "IPMI Connection Compatibility: 2.0" |
| 51 | + bit1 :ipmi_conn_15 ,label: "IPMI Connection Compatibility: 1.5" |
| 52 | + bit24 :ipmi_oem_id ,label: "IPMI OEM ID" |
| 53 | + |
| 54 | + rest :ipm_oem_data ,label: "IPMI OEM Data + Checksum Byte" |
54 | 55 |
|
55 | 56 | def to_banner
|
56 | 57 | info = self
|
|
0 commit comments