blob: e9864253e2f878ebd6ab00a3d30e4630e883f7a8 [file] [log] [blame]
#pragma once
#include <iostream>
namespace openpower
{
namespace vpd
{
namespace constants
{
using RecordId = uint8_t;
using RecordOffset = uint16_t;
using RecordSize = uint16_t;
using RecordType = uint16_t;
using RecordLength = uint16_t;
using KwSize = uint8_t;
using PoundKwSize = uint16_t;
using ECCOffset = uint16_t;
using ECCLength = uint16_t;
using LE2ByteData = uint16_t;
using DataOffset = uint16_t;
static constexpr auto MAC_ADDRESS_LEN_BYTES = 6;
static constexpr auto LAST_KW = "PF";
static constexpr auto POUND_KW = '#';
static constexpr auto UUID_LEN_BYTES = 16;
static constexpr auto UUID_TIME_LOW_END = 8;
static constexpr auto UUID_TIME_MID_END = 13;
static constexpr auto UUID_TIME_HIGH_END = 18;
static constexpr auto UUID_CLK_SEQ_END = 23;
static constexpr auto MB_RESULT_LEN = 19;
static constexpr auto MB_LEN_BYTES = 8;
static constexpr auto MB_YEAR_END = 4;
static constexpr auto MB_MONTH_END = 7;
static constexpr auto MB_DAY_END = 10;
static constexpr auto MB_HOUR_END = 13;
static constexpr auto MB_MIN_END = 16;
static constexpr auto LOCATION_CODE_INF = "com.ibm.ipzvpd.Location";
constexpr int IPZ_DATA_START = 11;
constexpr uint8_t KW_VAL_PAIR_START_TAG = 0x84;
constexpr uint8_t RECORD_END_TAG = 0x78;
const std::string service = "xyz.openbmc_project.Inventory.Manager";
const std::string VPD_OBJ_PATH_PREFIX = "/xyz/openbmc_project/inventory";
namespace lengths
{
enum Lengths
{
RECORD_NAME = 4,
KW_NAME = 2,
RECORD_OFFSET = 2,
RECORD_MIN = 44,
RECORD_LENGTH = 2,
RECORD_ECC_OFFSET = 2,
VHDR_ECC_LENGTH = 11,
VHDR_RECORD_LENGTH = 44
}; // enum Lengths
} // namespace lengths
namespace offsets
{
enum Offsets
{
VHDR = 17,
VHDR_TOC_ENTRY = 29,
VTOC_PTR = 35,
VTOC_REC_LEN = 37,
VTOC_ECC_OFF = 39,
VTOC_ECC_LEN = 41,
VTOC_DATA = 13,
VHDR_ECC = 0,
VHDR_RECORD = 11
};
} // namespace offsets
namespace eccStatus
{
enum Status
{
SUCCESS = 0,
FAILED = -1
};
} // namespace eccStatus
} // namespace constants
} // namespace vpd
} // namespace openpower