pthi

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

********************************************************************

  • Copyright (c) Intel Corporation 2021
  • SPDX-License-Identifier: Apache-2.0 *********************************************************************

********************************************************************

  • Copyright (c) Intel Corporation 2021
  • SPDX-License-Identifier: Apache-2.0 *********************************************************************

Index

Constants

View Source
const (
	AmtDisabled = AMTOperationalState(0)
	AmtEnabled  = AMTOperationalState(1)
)
View Source
const AMT_MAJOR_VERSION = 1
View Source
const AMT_MINOR_VERSION = 1
View Source
const BIOS_VERSION_LEN = 65
View Source
const CERT_HASH_MAX_LENGTH = 64
View Source
const CERT_HASH_MAX_NUMBER = 33
View Source
const CFG_MAX_ACL_PWD_LENGTH = 33
View Source
const CFG_MAX_ACL_USER_LENGTH = 33
View Source
const CLOSE_USER_INITIATED_CONNECTION_REQUEST = 0x04000045
View Source
const CLOSE_USER_INITIATED_CONNECTION_RESPONSE = 0x04800045
View Source
const CODE_VERSIONS_REQUEST = 0x0400001A
View Source
const CODE_VERSIONS_RESPONSE = 0x0480001A
View Source
const ENUMERATE_HASH_HANDLES_REQUEST = 0x0400002C
View Source
const ENUMERATE_HASH_HANDLES_RESPONSE = 0x0480002C
View Source
const GENERATE_RNG_SEED_REQUEST = 0x04000028
View Source
const GENERATE_RNG_SEED_RESPONSE = 0x04800028
View Source
const GET_AMT_STATE_REQUEST = 0x01000001
View Source
const GET_AMT_STATE_RESPONSE = 0x01800001
View Source
const GET_CERTHASH_ENTRY_REQUEST = 0x0400002D
View Source
const GET_CERTHASH_ENTRY_RESPONSE = 0x0480002D
View Source
const GET_CONTROL_MODE_REQUEST = 0x400006b
View Source
const GET_CONTROL_MODE_RESPONSE = 0x480006b
View Source
const GET_CURRENT_POWER_POLICY_REQUEST = 0x04000047
View Source
const GET_CURRENT_POWER_POLICY_RESPONSE = 0x04800047
View Source
const GET_DNS_SUFFIX_LIST_REQUEST = 0x0400003E
View Source
const GET_DNS_SUFFIX_LIST_RESPONSE = 0x0480003E
View Source
const GET_EHBC_STATE_REQUEST = 0x4000084
View Source
const GET_EHBC_STATE_RESPONSE = 0x4800084
View Source
const GET_FEATURES_STATE_REQUEST = 0x04000049
View Source
const GET_FEATURES_STATE_RESPONSE = 0x04800049
View Source
const GET_FQDN_REQUEST = 0x4000056
View Source
const GET_FQDN_RESPONSE = 0x4800056
View Source
const GET_LAN_INTERFACE_SETTINGS_REQUEST = 0x04000048
View Source
const GET_LAN_INTERFACE_SETTINGS_RESPONSE = 0x04800048
View Source
const GET_LAST_HOST_RESET_REASON_REQUEST = 0x0400004A
View Source
const GET_LAST_HOST_RESET_REASON_RESPONSE = 0x0480004A
View Source
const GET_LOCAL_SYSTEM_ACCOUNT_REQUEST = 0x04000067
View Source
const GET_LOCAL_SYSTEM_ACCOUNT_RESPONSE = 0x04800067
View Source
const GET_MAC_ADDRESSES_REQUEST = 0x04000025
View Source
const GET_MAC_ADDRESSES_RESPONSE = 0x04800025
View Source
const GET_PKI_FQDN_SUFFIX_REQUEST = 0x04000036
View Source
const GET_PKI_FQDN_SUFFIX_RESPONSE = 0x04800036
View Source
const GET_PROVISIONING_TLS_MODE_REQUEST = 0x0400002B
View Source
const GET_PROVISIONING_TLS_MODE_RESPONSE = 0x0480002B
View Source
const GET_REMOTE_ACCESS_CONNECTION_STATUS_REQUEST = 0x04000046
View Source
const GET_REMOTE_ACCESS_CONNECTION_STATUS_RESPONSE = 0x04800046
View Source
const GET_REQUEST_SIZE uint32 = 12
View Source
const GET_RNG_SEED_STATUS_REQUEST = 0x0400002E
View Source
const GET_RNG_SEED_STATUS_RESPONSE = 0x0480002E
View Source
const GET_SECURITY_PARAMETERS_REQUEST = 0x0400001B
View Source
const GET_SECURITY_PARAMETERS_RESPONSE = 0x0480001B
View Source
const GET_UUID_REQUEST = 0x400005c
View Source
const GET_UUID_RESPONSE = 0x480005c
View Source
const GET_ZERO_TOUCH_ENABLED_REQUEST = 0x04000030
View Source
const GET_ZERO_TOUCH_ENABLED_RESPONSE = 0x04800030
View Source
const IDER_LOG_ENTRIES = 6
View Source
const MAJOR_VERSION = 1
View Source
const MINOR_VERSION = 1
View Source
const MPS_HOSTNAME_LENGTH = 256
View Source
const NET_TLS_CERT_PKI_MAX_SERIAL_NUMS = 3
View Source
const NET_TLS_CERT_PKI_MAX_SERIAL_NUM_LENGTH = 16
View Source
const OPEN_USER_INITIATED_CONNECTION_REQUEST = 0x04000044
View Source
const OPEN_USER_INITIATED_CONNECTION_RESPONSE = 0x04800044
View Source
const PROVISIONING_MODE_REQUEST = 0x04000008
View Source
const PROVISIONING_MODE_RESPONSE = 0x04800008
View Source
const PROVISIONING_STATE_REQUEST = 0x04000011
View Source
const PROVISIONING_STATE_RESPONSE = 0x04800011
View Source
const SET_DNS_SUFFIX_REQUEST = 0x0400002F
View Source
const SET_DNS_SUFFIX_RESPONSE = 0x0480002F
View Source
const SET_ENTERPRISE_ACCESS_REQUEST = 0x0400003F
View Source
const SET_ENTERPRISE_ACCESS_RESPONSE = 0x0480003F
View Source
const SET_HOST_FQDN_REQUEST = 0x0400005b
View Source
const SET_HOST_FQDN_RESPONSE = 0x0480005b
View Source
const SET_PKI_FQDN_SUFFIX_REQUEST = 0x0400002f
View Source
const SET_PKI_FQDN_SUFFIX_RESPOSNE = 0x0480002f
View Source
const SET_PROVISIONING_SERVER_OTP_REQUEST = 0x0400002A
View Source
const SET_PROVISIONING_SERVER_OTP_RESPONSE = 0x0480002A
View Source
const SHA_512_KEY_SIZE = 64
View Source
const START_CONFIGURATION_HBASED_REQUEST = 0x0400008b
View Source
const START_CONFIGURATION_HBASED_RESPONSE = 0x0480008b
View Source
const START_CONFIGURATION_REQUEST = 0x04000029
View Source
const START_CONFIGURATION_RESPONSE = 0x04800029
View Source
const STATE_INDEPENNDENCE_IsChangeToAMTEnabled_CMD = 0x5
View Source
const STATE_INDEPENNDENCE_IsChangeToAMTEnabled_SUBCMD = 0x51
View Source
const STOP_CONFIGURATION_HBASED_REQUEST = 0x0400005e
View Source
const STOP_CONFIGURATION_HBASED_RESPONSE = 0x0480005e
View Source
const STOP_CONFIGURATION_REQUEST = 0x400005e
View Source
const STOP_CONFIGURATION_RESPONSE = 0x480005e
View Source
const UNICODE_STRING_LEN = 20
View Source
const UNPROVISION_REQUEST = 0x04000010
View Source
const UNPROVISION_RESPONSE = 0x04800010
View Source
const VERSIONS_NUMBER = 50

Variables

This section is empty.

Functions

This section is empty.

Types

type AMTANSIString

type AMTANSIString struct {
	Length uint16
	Buffer [1000]uint8
}

type AMTHashHandles

type AMTHashHandles struct {
	Length  uint32
	Handles [CERT_HASH_MAX_NUMBER]uint32
}

type AMTOperationalState

type AMTOperationalState uint8

func (AMTOperationalState) String

func (opstate AMTOperationalState) String() string

type AMTUnicodeString

type AMTUnicodeString struct {
	Length uint16
	String [UNICODE_STRING_LEN]uint8
}

type AMTVersionType

type AMTVersionType struct {
	Description AMTUnicodeString
	Version     AMTUnicodeString
}

type AMT_BOOLEAN

type AMT_BOOLEAN uint32
const (
	AMT_FALSE AMT_BOOLEAN = 0
	AMT_TRUE  AMT_BOOLEAN = 1
)

type CERT_HASH_ALGORITHM

type CERT_HASH_ALGORITHM uint8
const (
	CERT_HASH_ALGORITHM_MD5    CERT_HASH_ALGORITHM = 0
	CERT_HASH_ALGORITHM_SHA1   CERT_HASH_ALGORITHM = 1
	CERT_HASH_ALGORITHM_SHA256 CERT_HASH_ALGORITHM = 2
	CERT_HASH_ALGORITHM_SHA384 CERT_HASH_ALGORITHM = 3
	CERT_HASH_ALGORITHM_SHA224 CERT_HASH_ALGORITHM = 4
	CERT_HASH_ALGORITHM_SHA512 CERT_HASH_ALGORITHM = 5
)

type CertHashEntry

type CertHashEntry struct {
	IsDefault       uint32
	IsActive        uint32
	CertificateHash [CERT_HASH_MAX_LENGTH]uint8
	HashAlgorithm   uint8
	Name            AMTANSIString
}

type CodeVersions

type CodeVersions struct {
	BiosVersion   [BIOS_VERSION_LEN]uint8
	VersionsCount uint32
	Versions      [VERSIONS_NUMBER]AMTVersionType
}

type Command

type Command struct {
	Heci heci.Interface
}

func NewCommand

func NewCommand() Command

func (Command) Call

func (pthi Command) Call(command []byte, commandSize uint32) (result []byte, err error)

func (Command) Close

func (pthi Command) Close()

func (Command) CloseUserInitiatedConnection added in v1.2.0

func (pthi Command) CloseUserInitiatedConnection() (status Status, err error)

func (Command) GetCertificateHashes

func (pthi Command) GetCertificateHashes(hashHandles AMTHashHandles) (hashEntryList []CertHashEntry, err error)

func (Command) GetCodeVersions

func (pthi Command) GetCodeVersions() (GetCodeVersionsResponse, error)

func (Command) GetControlMode

func (pthi Command) GetControlMode() (state int, err error)

func (Command) GetDNSSuffix

func (pthi Command) GetDNSSuffix() (suffix string, err error)

func (Command) GetHardwareId

func (pthi Command) GetHardwareId() string

func (Command) GetIsAMTEnabled

func (pthi Command) GetIsAMTEnabled() (uint8, error)

func (Command) GetLANInterfaceSettings

func (pthi Command) GetLANInterfaceSettings(useWireless bool) (LANInterface GetLANInterfaceSettingsResponse, err error)

func (Command) GetLocalSystemAccount

func (pthi Command) GetLocalSystemAccount() (localAccount GetLocalSystemAccountResponse, err error)

func (Command) GetRemoteAccessConnectionStatus

func (pthi Command) GetRemoteAccessConnectionStatus() (RAStatus GetRemoteAccessConnectionStatusResponse, err error)

func (Command) GetUUID

func (pthi Command) GetUUID() (uuid string, err error)

func (Command) Open

func (pthi Command) Open(useLME bool) error

func (Command) OpenUserInitiatedConnection added in v1.2.0

func (pthi Command) OpenUserInitiatedConnection() (status Status, err error)

func (Command) OpenWatchdog

func (pthi Command) OpenWatchdog() error

func (Command) Receive

func (pthi Command) Receive() (result []byte, bytesRead uint32, err error)

func (Command) Send

func (pthi Command) Send(command []byte, commandSize uint32) (err error)

func (Command) SetAmtOperationalState

func (pthi Command) SetAmtOperationalState(state AMTOperationalState) (Status, error)

func (Command) SetPkiFQDNSuffix added in v1.1.0

func (pthi Command) SetPkiFQDNSuffix(suffix string) (status Status, err error)

func (Command) StartConfigurationHBased

func (pthi Command) StartConfigurationHBased(ServerHashAlgorithm CERT_HASH_ALGORITHM, ServerCertHash []byte, HostVPNEnable bool, NetworkDnsSuffixList []string) (response StartConfigurationHBasedResponse, err error)

func (Command) StopConfiguration

func (pthi Command) StopConfiguration() (status Status, err error)

func (Command) Unprovision

func (pthi Command) Unprovision() (state int, err error)

type CommandFormat

type CommandFormat struct {
	// contains filtered or unexported fields
}

type GetCertHashEntryRequest

type GetCertHashEntryRequest struct {
	Header     MessageHeader
	HashHandle uint32
}

type GetCertHashEntryResponse

type GetCertHashEntryResponse struct {
	Header ResponseMessageHeader
	Hash   CertHashEntry
}

type GetCodeVersionsResponse

type GetCodeVersionsResponse struct {
	Header      ResponseMessageHeader
	CodeVersion CodeVersions
}

type GetControlModeResponse

type GetControlModeResponse struct {
	Header ResponseMessageHeader
	State  uint32
}

type GetHashHandlesResponse

type GetHashHandlesResponse struct {
	Header      ResponseMessageHeader
	HashHandles AMTHashHandles
}

type GetLANInterfaceSettingsRequest

type GetLANInterfaceSettingsRequest struct {
	Header         MessageHeader
	InterfaceIndex uint32
}

type GetLANInterfaceSettingsResponse

type GetLANInterfaceSettingsResponse struct {
	Header      ResponseMessageHeader
	Enabled     uint32
	Ipv4Address uint32
	DhcpEnabled uint32
	DhcpIpMode  uint8
	LinkStatus  uint8
	MacAddress  [6]uint8
}

type GetLocalSystemAccountRequest

type GetLocalSystemAccountRequest struct {
	Header   MessageHeader
	Reserved [40]uint8
}

type GetLocalSystemAccountResponse

type GetLocalSystemAccountResponse struct {
	Header  ResponseMessageHeader
	Account LocalSystemAccount
}

type GetPKIFQDNSuffixResponse

type GetPKIFQDNSuffixResponse struct {
	Header ResponseMessageHeader
	Suffix AMTANSIString
}

type GetRemoteAccessConnectionStatusResponse

type GetRemoteAccessConnectionStatusResponse struct {
	Header        ResponseMessageHeader
	NetworkStatus uint32
	RemoteStatus  uint32
	RemoteTrigger uint32
	MPSHostname   AMTANSIString
}

type GetRequest

type GetRequest struct {
	Header MessageHeader
}

GetRequest is used for the following requests: GetPKIFQDNSuffixRequest GetControlModeRequest GetUUIDRequest GetHashHandlesRequest GetRemoteAccessConnectionStatusRequest

type GetStateIndependenceIsChangeToAMTEnabledRequest

type GetStateIndependenceIsChangeToAMTEnabledRequest struct {
	Command       uint8
	ByteCount     uint8
	SubCommand    uint8
	VersionNumber uint8
}

type GetStateIndependenceIsChangeToAMTEnabledResponse

type GetStateIndependenceIsChangeToAMTEnabledResponse struct {
	Enabled uint8
}

type GetUUIDResponse

type GetUUIDResponse struct {
	Header ResponseMessageHeader
	UUID   [16]uint8
}

type Interface

type Interface interface {
	GetHardwareId() string
	Open(useLME bool) error
	OpenWatchdog() error
	Close()
	Call(command []byte, commandSize uint32) (result []byte, err error)
	GetCodeVersions() (GetCodeVersionsResponse, error)
	GetUUID() (uuid string, err error)
	GetControlMode() (state int, err error)
	GetIsAMTEnabled() (uint8, error)
	SetAmtOperationalState(state AMTOperationalState) (Status, error)
	GetDNSSuffix() (suffix string, err error)
	GetCertificateHashes(hashHandles AMTHashHandles) (hashEntryList []CertHashEntry, err error)
	GetRemoteAccessConnectionStatus() (RAStatus GetRemoteAccessConnectionStatusResponse, err error)
	GetLANInterfaceSettings(useWireless bool) (LANInterface GetLANInterfaceSettingsResponse, err error)
	GetLocalSystemAccount() (localAccount GetLocalSystemAccountResponse, err error)
	Unprovision() (mode int, err error)
	StopConfiguration() (status Status, err error)
	StartConfigurationHBased(ServerHashAlgorithm CERT_HASH_ALGORITHM, ServerCertHash []byte, HostVPNEnable bool, NetworkDnsSuffix []string) (response StartConfigurationHBasedResponse, err error)
	SetPkiFQDNSuffix(suffix string) (status Status, err error)
	OpenUserInitiatedConnection() (status Status, err error)
	CloseUserInitiatedConnection() (status Status, err error)
}

type LocalSystemAccount

type LocalSystemAccount struct {
	Username [CFG_MAX_ACL_USER_LENGTH]uint8
	Password [CFG_MAX_ACL_USER_LENGTH]uint8
}

type MessageHeader

type MessageHeader struct {
	Version  Version
	Reserved uint16
	Command  CommandFormat
	Length   uint32
}

func CreateRequestHeader

func CreateRequestHeader(command uint32, length uint32) MessageHeader

type ResponseMessageHeader

type ResponseMessageHeader struct {
	Header MessageHeader
	Status Status
}

type SetAmtOperationalState

type SetAmtOperationalState struct {
	Command       uint8
	ByteCount     uint8
	SubCommand    uint8
	VersionNumber uint8
	Enabled       AMTOperationalState
}

type SetAmtOperationalStateResponse

type SetAmtOperationalStateResponse struct {
	Command       uint8
	ByteCount     uint8
	SubCommand    uint8
	VersionNumber uint8
	Status        Status
}

type SetPkiFQDNSuffix added in v1.1.0

type SetPkiFQDNSuffix struct {
	Header MessageHeader
	Suffix AMTANSIString
}

type StartConfigurationHBasedRequest

type StartConfigurationHBasedRequest struct {
	Header               MessageHeader
	ServerHashAlgorithm  CERT_HASH_ALGORITHM
	ServerCertHash       [SHA_512_KEY_SIZE]byte
	HostVPNEnable        AMT_BOOLEAN
	SuffixListLen        uint32
	NetworkDnsSuffixList [320]byte
}

type StartConfigurationHBasedResponse

type StartConfigurationHBasedResponse struct {
	Header        ResponseMessageHeader
	HashAlgorithm CERT_HASH_ALGORITHM
	AMTCertHash   [SHA_512_KEY_SIZE]byte
}

type Status

type Status uint32
const (
	AMT_STATUS_SUCCESS                    Status = 0
	AMT_STATUS_INTERNAL_ERROR             Status = 1
	AMT_STATUS_NOT_READY                  Status = 2
	AMT_STATUS_INVALID_AMT_MODE           Status = 3
	AMT_STATUS_INVALID_MESSAGE_LENGTH     Status = 4
	AMT_STATUS_NOT_PERMITTED              Status = 16
	AMT_STATUS_MAX_LIMIT_REACHED          Status = 23
	AMT_STATUS_INVALID_PARAMETER          Status = 36
	AMT_STATUS_RNG_GENERATION_IN_PROGRESS Status = 47
	AMT_STATUS_RNG_NOT_READY              Status = 48
	AMT_STATUS_CERTIFICATE_NOT_READY      Status = 49
	AMT_STATUS_INVALID_HANDLE             Status = 2053
	AMT_STATUS_NOT_FOUND                  Status = 2068
)

func (Status) String

func (s Status) String() string

type UnprovisionRequest

type UnprovisionRequest struct {
	Header MessageHeader
	Mode   uint32
}

type UnprovisionResponse

type UnprovisionResponse struct {
	Header ResponseMessageHeader
	State  uint32
}

type Version

type Version struct {
	MajorNumber uint8
	MinorNumber uint8
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL