MFTCommon

package module
v0.0.0-...-2e96a46 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: AGPL-3.0 Imports: 28 Imported by: 2

Documentation

Index

Constants

View Source
const BiosImages = "biosimages"
View Source
const CurrentFlashDataDefinition = "0.1+initial"
View Source
const CurrentImportDataDefinition = "0.2+lastImportTimestamp"
View Source
const DeleteTopic = "delete"
View Source
const DownloadedTopic = "downloaded"
View Source
const ExtractedQeueTopic = "extracted"
View Source
const FlashImages = "flashimages"
View Source
const MEImages = "meimages"
View Source
const MainBucket = "files"
View Source
const URLQueueTopic = "url"

Variables

This section is empty.

Functions

func DataDefinitionUpgradeRequired

func DataDefinitionUpgradeRequired(latestKnown string, current string) (bool, error)

Types

type AMDAGESA

type AMDAGESA struct {
	Header string
	Raw    string
	Offset uint32
}

type AMDBinaryEntry

type AMDBinaryEntry struct {
	Header    map[string]string `json:Header`
	Signature string
	Comment   []string
	TypeInfo  *amdfw.TypeInfo
	Version   string
	Size      string
	Type      string
}

type AMDDirectory

type AMDDirectory struct {
	Header   AMDDirectoryHeader
	Entries  []AMDEntry
	Location string
}

type AMDDirectoryEntry

type AMDDirectoryEntry struct {
	Type     string
	Size     string
	Location string
	Reserved string
	Unknown  string
}

type AMDDirectoryHeader

type AMDDirectoryHeader struct {
	Cookie        string
	Checksum      string
	ChecksumValid bool
	TotalEntries  string
	Reserved      string
}

type AMDEntry

type AMDEntry struct {
	DBEntry
	DirectoryEntry AMDDirectoryEntry
}

type AMDFirmware

type AMDFirmware struct {
	AGESA    []AMDAGESA
	Firmware *AMDImage
}

type AMDFirmwareEntryTable

type AMDFirmwareEntryTable struct {
	Location      string
	Signature     string
	ImcRomBase    string
	GecRomBase    string
	XHCRomBase    string
	PSPDirBase    string
	NewPSPDirBase string
	BHDDirBase    string
	NewBHDDirBase string
}

type AMDImage

type AMDImage struct {
	FET          *AMDFirmwareEntryTable
	FlashMapping string
	Roms         []AMDRom
}

type AMDRom

type AMDRom struct {
	Type        amdfw.RomType
	Directories []AMDDirectory
}

type AMDTypeInfo

type AMDTypeInfo struct {
	Type    string
	Name    string
	Comment string
}

type AppBundle

type AppBundle struct {
	MessageQueue MessageBundle
	Storage      Storage
	DB           DataBase
	Log          *logrus.Logger
	Config       *AppConfiguration
}

func Init

func Init(serviceName string) AppBundle

type AppConfiguration

type AppConfiguration struct {
	Logger  LoggerConfiguration
	MQ      MQConfiguration
	Storage StorageConfiguration
	DB      DBConfiguration
	App     AppRunConfiguration
}

func ConfigInit

func ConfigInit(file string) *AppConfiguration

type AppRunConfiguration

type AppRunConfiguration struct {
	Frontend struct {
		DownloadEnabled bool
		ReportResults   uint
	}
	Importer struct {
		ForceReimport bool
	}
	Reindexer struct {
		ReindexTimeInHours uint
	}
}

type ComponentSection

type ComponentSection struct {
	FLCOMP ComponentSectionFLCOMP
	FLILL  ComponentSectionFLILL
	FLPB   ComponentSectionFLPB
}

type ComponentSectionFLCOMP

type ComponentSectionFLCOMP struct {
	DualOutputFastReadSupport  bool
	ReadIDStatusClockFrequency uint32
	WriteEraseClockFrequency   uint32
	FastReadClockFrequency     uint32
	FastReadSupport            bool
	ReadClockFrequency         uint32
	Component1Density          uint32
	Component2Density          uint32
}

type ComponentSectionFLILL

type ComponentSectionFLILL struct {
	InvalidInstruction0 string
	InvalidInstruction1 string
	InvalidInstruction2 string
	InvalidInstruction3 string
}

type ComponentSectionFLPB

type ComponentSectionFLPB struct {
	FlashPartitionBoundaryAddress string
}

type DBConfiguration

type DBConfiguration struct {
	URI      string
	Protocol string
}

type DBEntry

type DBEntry struct {
	AMDBinaryEntry
	ID IDEntry
}

type DataBase

type DataBase struct {
	ES *elastic.Client
	// contains filtered or unexported fields
}

func (DataBase) Exists

func (d DataBase) Exists(index string, id string) (bool, error, *elastic.GetResult)

func (DataBase) Flush

func (d DataBase) Flush(index string)

func (DataBase) Search

func (d DataBase) Search(index string, terms map[string]string) error

func (DataBase) StoreElement

func (d DataBase) StoreElement(index string, typeString *string, entry interface{}, id *string)

func (DataBase) StoreJSON

func (d DataBase) StoreJSON(index string, typeString *string, entry string, id *string)

type DownloadEntry

type DownloadEntry struct {
	Vendor           string  `json:",omitempty"`
	Product          string  `json:",omitempty"`
	Version          string  `json:",omitempty"`
	Title            string  `json:",omitempty"`
	Description      string  `json:",omitempty"`
	ReleaseDate      string  `json:",omitempty"`
	DownloadFileSize string  `json:",omitempty"`
	DownloadURL      string  `json:",omitempty"`
	DownloadPath     string  `json:",omitempty"`
	DownloadTime     string  `json:",omitempty" hash:"-"`
	PackageID        IDEntry `json:",omitempty" hash:"-"`
}

type DownloadWrapper

type DownloadWrapper struct {
	DownloadEntry
	ForceReimport bool
}

type FlashDescriptorHeader

type FlashDescriptorHeader struct {
	FLVALSIG string
	FLMAP0   FlashDescriptorHeaderFLMAP0
	FLMAP1   FlashDescriptorHeaderFLMAP1
	FLMAP2   FlashDescriptorHeaderFLMAP2
	RESERVED [(0xefc - 0x20) / 4]uint32
	FLUMAP1  FlashDescriptorHeaderFLUMAP1
}

type FlashDescriptorHeaderFLMAP0

type FlashDescriptorHeaderFLMAP0 struct {
	RESERVED0 uint32
	NR        uint32
	FRBA      string
	RESERVED2 uint32
	RESERVED3 uint32
	RESERVED4 uint32
	RESERVED5 uint32
	NC        uint32
	FCBA      string
}

type FlashDescriptorHeaderFLMAP1

type FlashDescriptorHeaderFLMAP1 struct {
	ISL       string
	FPSBA     string
	RESERVED0 uint32
	NM        uint32
	FMBA      string
}

type FlashDescriptorHeaderFLMAP2

type FlashDescriptorHeaderFLMAP2 struct {
	RIL     string
	ICCRIBA string
	PSL     string
	FMSBA   string
}

type FlashDescriptorHeaderFLUMAP1

type FlashDescriptorHeaderFLUMAP1 struct {
	RESERVED0 uint32
	VTL       uint32
	VTBA      string
}

type FlashImage

type FlashImage struct {
	FlashimageDataDefinition string         `json:",omitempty"`
	MetaData                 DownloadEntry  `json:",omitempty"`
	ID                       IDEntry        `json:",omitempty"`
	Tags                     []string       `json:",omitempty"`
	FirmwareOffset           int64          `json:",omitempty"`
	AMD                      *AMDFirmware   `json:"AMD"`
	INTEL                    *IntelFirmware `json:"INTEL""`
	Certificates             []string       `json:"Certificates"`
	EFIBlob                  string         `json:",omitempty"`
}

type IDEntry

type IDEntry struct {
	SSDEEP    string `json:",omitempty"`
	SHA3_512  string `json:",omitempty"`
	SHA512    string `json:",omitempty"`
	SHA256    string `json:",omitempty"`
	SHA1      string `json:",omitempty"`
	MD5       string `json:",omitempty"`
	Whirlpool string `json:",omitempty"`
	Algorithm string `json:",omitempty"`
}

func GenerateID

func GenerateID(data []byte) IDEntry

func (IDEntry) GetID

func (d IDEntry) GetID() string

type ImportEntry

type ImportEntry struct {
	ImportDataDefinition string         `json:",omitempty"`
	MetaData             DownloadEntry  `json:",omitempty"`
	Contents             []StorageEntry `json:",omitempty"`
	ImportTime           string         `json:",omitempty"`
	LastImportTime       string         `json:",omitempty"`
	Success              bool           `json:",omitempty"`
}

type IntelFSP

type IntelFSP struct {
	intelfsp.IntelFSP
	ID IDEntry
}

type IntelFirmware

type IntelFirmware struct {
	IFD *IntelFlashDescriptor `json:"IFD"`
	FIT *intelfit.FIT         `json:"FIT"`
	FSP []IntelFSP            `json:"FSP,omitempty"`
}

type IntelFlashDescriptor

type IntelFlashDescriptor struct {
	HeaderOffset uint32
	Version      uint32
	HEADER       FlashDescriptorHeader
	OEM          [0x40]uint8
	FLASHCONTROL []MEFlashControl
	REGION       RegionSection
	COMPONENT    ComponentSection
	PCHSTRAP     [18]string
	MASTER       MasterSection
	STRAP        [8]string
}

type LoggerConfiguration

type LoggerConfiguration struct {
	Protocol string
	URI      string
}

type MEFlashControl

type MEFlashControl struct {
	COMPONENT MEFlashControlComponent
	CONTROL   MEFlashControlControl
}

type MEFlashControlComponent

type MEFlashControlComponent struct {
	DeviceID0 string
	DeviceID1 string
	VendorID  string
}

type MEFlashControlControl

type MEFlashControlControl struct {
	LowerEraseOpcode              string
	LowerWriteEnableOnWriteStatus string
	LowerWriteStatusRequired      bool
	LowerWriteGranularity         uint32
	LowerBlockAndSectorEraseSize  string
	UpperEraseOpcode              string
	UpperWriteEnableOnWriteStatus string
	UpperWriteStatusRequired      bool
	UpperWriteGranularity         uint32
	UpperBlockAndSectorEraseSize  string
}

type MQConfiguration

type MQConfiguration struct {
	User     string
	Password string
	URI      string
}

type MasterSection

type MasterSection struct {
	BIOS     MasterSectionEntry
	ME       MasterSectionEntry
	ETHERNET MasterSectionEntry
	RESERVED MasterSectionEntry
	EC       MasterSectionEntry
}

type MasterSectionEntry

type MasterSectionEntry struct {
	FlashDescriptorReadAccess     bool
	FlashDescriptorWriteAccess    bool
	HostCPUBIOSRegionReadAccess   bool
	HostCPUBIOSRegionWriteAccess  bool
	IntelMERegionReadAccess       bool
	IntelMERegionWriteAccess      bool
	GbERegionReadAccess           bool
	GbERegionWriteAccess          bool
	PlatformDataRegionReadAccess  bool
	PlatformDataRegionWriteAccess bool
	ECRegionReadAccess            bool
	ECRegionWriteAccess           bool

	RequesterID string
}

func GetMasterSectionByNumber

func GetMasterSectionByNumber(pfd IntelFlashDescriptor, index int) (MasterSectionEntry, string)

type MessageBundle

type MessageBundle struct {
	URLQueue         MessageQueue
	DownloadedQueue  MessageQueue
	ExtractedQueue   MessageQueue
	DeleteQueue      MessageQueue
	FlashImagesQueue MessageQueue
	BiosImagesQueue  MessageQueue
	MEImagesQueue    MessageQueue
	TestQueue        MessageQueue
}

type MessageQueue

type MessageQueue struct {
	Connection *amqp.Channel
	// contains filtered or unexported fields
}

func (MessageQueue) MarshalAndSend

func (mq MessageQueue) MarshalAndSend(data interface{}) error

func (MessageQueue) RegisterCallback

func (mq MessageQueue) RegisterCallback(consumerName string, callback eventFunc)

func (MessageQueue) Send

func (mq MessageQueue) Send(data string) error

type RegionSection

type RegionSection struct {
	FLASH     RegionSectionEntry `json:",omitempty"`
	BIOS      RegionSectionEntry `json:",omitempty"`
	ME        RegionSectionEntry `json:",omitempty"`
	ETHERNET  RegionSectionEntry `json:",omitempty"`
	PLATFORM  RegionSectionEntry `json:",omitempty"`
	EXPANSION RegionSectionEntry `json:",omitempty"`
	RESERVED2 RegionSectionEntry `json:",omitempty"`
	RESERVED3 RegionSectionEntry `json:",omitempty"`
	EC        RegionSectionEntry `json:",omitempty"`
}

type RegionSectionEntry

type RegionSectionEntry struct {
	START string
	END   string
}

func GetRegionByNumber

func GetRegionByNumber(pfd IntelFlashDescriptor, index int) (RegionSectionEntry, string, string, string)

type Storage

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

func (Storage) FileExists

func (storage Storage) FileExists(remotePath string) (minio.ObjectInfo, error)

func (Storage) GetClient

func (storage Storage) GetClient() *minio.Client

func (Storage) GetFile

func (storage Storage) GetFile(remotePath string) (*minio.Object, error)

func (Storage) MakeBucket

func (storage Storage) MakeBucket(bucketName string) error

func (Storage) StoreBytes

func (storage Storage) StoreBytes(byte []byte, id string) error

func (Storage) StoreFile

func (storage Storage) StoreFile(localPath string, remotePath string) error

type StorageConfiguration

type StorageConfiguration struct {
	URI             string
	AccessKeyID     string
	SecretAccessKey string
	UseSSL          bool
}

type StorageEntry

type StorageEntry struct {
	ID        IDEntry  `json:",omitempty"`
	PackageID IDEntry  `json:",omitempty"`
	Path      string   `json:",omitempty"`
	Tags      []string `json:",omitempty"`
}

type UserUpload

type UserUpload struct {
	MetaData   DownloadEntry `json:",omitempty"`
	UploadTime string        `json:",omitempty"`
	UploadIP   string        `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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