rps

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: 17 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteCommand

func ExecuteCommand(flags *flags.Flags) utils.ReturnCode

Types

type AMTActivationServer

type AMTActivationServer struct {
	URL  string
	Conn *websocket.Conn
	// contains filtered or unexported fields
}

AMTActivationServer struct represents the connection to RPS

func NewAMTActivationServer

func NewAMTActivationServer(flags *flags.Flags) AMTActivationServer

TODO: suggest this be renamed to RemoteProvisioningService

func (*AMTActivationServer) Close

func (amt *AMTActivationServer) Close() error

Close closes the connection to rps

func (*AMTActivationServer) Connect

func (amt *AMTActivationServer) Connect(skipCertCheck bool) error

Connect is used to connect to the RPS Server

func (*AMTActivationServer) GenerateHeartbeatResponse

func (amt *AMTActivationServer) GenerateHeartbeatResponse(activation Message) ([]byte, error)

func (*AMTActivationServer) Listen

func (amt *AMTActivationServer) Listen() chan []byte

Listen is used for listening to responses from RPS

func (*AMTActivationServer) ProcessMessage

func (amt *AMTActivationServer) ProcessMessage(message []byte) []byte

ProcessMessage inspects RPS messages, decodes the base64 payload from the server and relays it to LMS

func (*AMTActivationServer) Send

func (amt *AMTActivationServer) Send(data Message) error

Send is used for sending data to the RPS Server

type Executor

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

func NewExecutor

func NewExecutor(flags flags.Flags) (Executor, error)

func (Executor) HandleDataFromLM

func (e Executor) HandleDataFromLM(data []byte)

func (Executor) HandleDataFromRPS

func (e Executor) HandleDataFromRPS(dataFromServer []byte) bool

func (Executor) HandleInterrupt

func (e Executor) HandleInterrupt()

func (Executor) MakeItSo

func (e Executor) MakeItSo(messageRequest Message)

type Message

type Message struct {
	Method          string `json:"method"`
	APIKey          string `json:"apiKey"`
	AppVersion      string `json:"appVersion"`
	ProtocolVersion string `json:"protocolVersion"`
	Status          string `json:"status"`
	Message         string `json:"message"`
	Fqdn            string `json:"fqdn"`
	Payload         string `json:"payload"`
	TenantID        string `json:"tenantId"`
}

Message is used for tranferring messages between RPS and RPC

func PrepareInitialMessage

func PrepareInitialMessage(flags *flags.Flags) (Message, error)

type MessagePayload

type MessagePayload struct {
	Version           string                `json:"ver"`
	Build             string                `json:"build"`
	SKU               string                `json:"sku"`
	Features          string                `json:"features"`
	UUID              string                `json:"uuid"`
	Username          string                `json:"username"`
	Password          string                `json:"password"`
	CurrentMode       int                   `json:"currentMode"`
	Hostname          string                `json:"hostname"`
	FQDN              string                `json:"fqdn"`
	Client            string                `json:"client"`
	CertificateHashes []string              `json:"certHashes"`
	IPConfiguration   flags.IPConfiguration `json:"ipConfiguration"`
	HostnameInfo      flags.HostnameInfo    `json:"hostnameInfo"`
	FriendlyName      string                `json:"friendlyName,omitempty"`
}

MessagePayload struct is used for the initial request to RPS to activate or manage a device

type Payload

type Payload struct {
	AMT amt.Interface
}

func NewPayload

func NewPayload() Payload

func (Payload) CreateMessageRequest

func (p Payload) CreateMessageRequest(flags flags.Flags) (Message, error)

CreateMessageRequest is used for assembling the message to request activation of a device

func (Payload) CreateMessageResponse

func (p Payload) CreateMessageResponse(payload []byte) Message

CreateMessageResponse is used for creating a response to the server

type StatusMessage

type StatusMessage struct {
	Status           string `json:"Status,omitempty"`
	Network          string `json:"Network,omitempty"`
	CIRAConnection   string `json:"CIRAConnection,omitempty"`
	TLSConfiguration string `json:"TLSConfiguration,omitempty"`
}

Status Message is used for displaying and parsing status messages from RPS

Jump to

Keyboard shortcuts

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