Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Ratan Gupta | 533d03b | 2017-07-30 10:39:22 +0530 | [diff] [blame] | 3 | #include "types.hpp" |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 4 | #include <string> |
Adriana Kobylak | 5d6481f | 2015-10-29 21:44:55 -0500 | [diff] [blame] | 5 | // IPMI commands for Transport net functions. |
| 6 | enum ipmi_netfn_storage_cmds |
| 7 | { |
| 8 | // Get capability bits |
| 9 | IPMI_CMD_SET_LAN = 0x01, |
| 10 | IPMI_CMD_GET_LAN = 0x02, |
| 11 | }; |
| 12 | |
| 13 | // Command specific completion codes |
| 14 | enum ipmi_transport_return_codes |
| 15 | { |
| 16 | IPMI_CC_PARM_NOT_SUPPORTED = 0x80, |
| 17 | }; |
| 18 | |
Adriana Kobylak | e08fbc6 | 2016-02-09 16:17:23 -0600 | [diff] [blame] | 19 | // Parameters |
| 20 | static const int LAN_PARM_INPROGRESS = 0; |
| 21 | static const int LAN_PARM_AUTHSUPPORT = 1; |
| 22 | static const int LAN_PARM_AUTHENABLES = 2; |
| 23 | static const int LAN_PARM_IP = 3; |
| 24 | static const int LAN_PARM_MAC = 5; |
| 25 | static const int LAN_PARM_SUBNET = 6; |
| 26 | static const int LAN_PARM_GATEWAY = 12; |
Ratan Gupta | 533d03b | 2017-07-30 10:39:22 +0530 | [diff] [blame] | 27 | static const int LAN_PARM_VLAN = 20; |
Adriana Kobylak | e08fbc6 | 2016-02-09 16:17:23 -0600 | [diff] [blame] | 28 | |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 29 | struct ChannelConfig_t |
| 30 | { |
| 31 | std::string ipaddr; |
| 32 | std::string netmask; |
| 33 | std::string gateway; |
| 34 | std::string macAddress; |
Ratan Gupta | 533d03b | 2017-07-30 10:39:22 +0530 | [diff] [blame] | 35 | // IPMI stores the vlan info in 16 bits,32 bits is to aligned |
| 36 | // with phosphor-dbus interfaces. |
| 37 | // vlan id is in 12 bits and the 16th bit is for enable mask. |
| 38 | uint32_t vlanID = ipmi::network::VLAN_ID_MASK; |
| 39 | |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 40 | void clear() |
| 41 | { |
| 42 | ipaddr.clear(); |
| 43 | netmask.clear(); |
| 44 | gateway.clear(); |
| 45 | macAddress.clear(); |
Ratan Gupta | 533d03b | 2017-07-30 10:39:22 +0530 | [diff] [blame] | 46 | vlanID = ipmi::network::VLAN_ID_MASK; |
Ratan Gupta | b8e9955 | 2017-07-27 07:07:48 +0530 | [diff] [blame] | 47 | } |
Nan Li | 3d0df91 | 2016-10-18 19:51:41 +0800 | [diff] [blame] | 48 | }; |