format

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

format package maintains some basic structures to allows us to read header of a cim file. This is mostly required to understand the region & objectid files associated with a particular cim. Otherwise, we don't need to parse the cim format.

Index

Constants

View Source
const (
	RegionFileName   = "region"
	ObjectIDFileName = "objectid"
)

Variables

View Source
var CurrentVersion = Version{3, 0}
View Source
var MagicValue = Magic([8]uint8{'c', 'i', 'm', 'f', 'i', 'l', 'e', '0'})
View Source
var MinSupportedVersion = Version{2, 0}

Functions

This section is empty.

Types

type CommonHeader

type CommonHeader struct {
	Magic        Magic
	HeaderLength uint32
	Type         FileType
	Reserved     uint8
	Reserved2    uint16
	Version      Version
	Reserved3    uint64
}

CommonHeader is the common header for all CIM-related files.

type FileType

type FileType uint8

type FilesystemHeader

type FilesystemHeader struct {
	Common           CommonHeader
	Regions          RegionSet
	FilesystemOffset RegionOffset
	Reserved         uint32
	Reserved1        uint16
	ParentCount      uint16
}

FilesystemHeader is the header for a filesystem file.

The filesystem file points to the filesystem object inside a region file and specifies regions sets.

type Magic

type Magic [8]uint8

Magic specifies the magic number at the beginning of a file.

type RegionOffset

type RegionOffset uint64

RegionOffset encodes an offset to objects as index of the region file containing the object and the byte offset within that file.

type RegionSet

type RegionSet struct {
	ID        guid.GUID
	Count     uint16
	Reserved  uint16
	Reserved1 uint32
}

type Version

type Version struct {
	Major, Minor uint32
}

Jump to

Keyboard shortcuts

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