prot

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	HdrSize    = 16
	HdrOffType = 0
	HdrOffSize = 4
	HdrOffID   = 8

	// maxMsgSize is the maximum size of an incoming message. This is not
	// enforced by the guest today but some maximum must be set to avoid
	// unbounded allocations.
	MaxMsgSize = 0x10000

	// LinuxGcsVsockPort is the vsock port number that the Linux GCS will
	// connect to.
	LinuxGcsVsockPort = 0x40000000
)

Variables

View Source
var HvGUIDLoopback = guid.GUID{
	Data1: 0xe0e16197,
	Data2: 0xdd56,
	Data3: 0x4a10,
	Data4: [8]uint8{0x91, 0x95, 0x5e, 0xe7, 0xa1, 0x55, 0xa8, 0x38},
}

e0e16197-dd56-4a10-9195-5ee7a155a838

View Source
var HvGUIDParent = guid.GUID{
	Data1: 0xa42e7cda,
	Data2: 0xd03f,
	Data3: 0x480c,
	Data4: [8]uint8{0x9c, 0xc2, 0xa4, 0xde, 0x20, 0xab, 0xb8, 0x78},
}

a42e7cda-d03f-480c-9cc2-a4de20abb878

View Source
var WindowsGcsHvHostID = guid.GUID{
	Data1: 0x894cc2d6,
	Data2: 0x9d79,
	Data3: 0x424f,
	Data4: [8]uint8{0x93, 0xfe, 0x42, 0x96, 0x9a, 0xe6, 0xd8, 0xd1},
}

WindowsGcsHvHostID is the hvsock address for the parent of the VM running the GCS

View Source
var WindowsGcsHvsockServiceID = guid.GUID{
	Data1: 0xacef5661,
	Data2: 0x84a1,
	Data3: 0x4e44,
	Data4: [8]uint8{0x85, 0x6b, 0x62, 0x45, 0xe6, 0x9f, 0x46, 0x20},
}

WindowsGcsHvsockServiceID is the hvsock service ID that the Windows GCS will connect to.

View Source
var WindowsSidecarGcsHvsockServiceID = guid.GUID{
	Data1: 0xae8da506,
	Data2: 0xa019,
	Data3: 0x4553,
	Data4: [8]uint8{0xa5, 0x2b, 0x90, 0x2b, 0xc0, 0xfa, 0x04, 0x11},
}

WindowsSidecarGcsHvsockServiceID is the hvsock service ID that the Windows GCS sidecar will connect to. This is only used in the confidential mode.

Functions

This section is empty.

Types

type AnyInString

type AnyInString struct {
	Value interface{}
}

func (*AnyInString) MarshalText

func (a *AnyInString) MarshalText() ([]byte, error)

func (*AnyInString) UnmarshalText

func (a *AnyInString) UnmarshalText(b []byte) error

type ContainerCreate

type ContainerCreate struct {
	RequestBase
	ContainerConfig AnyInString
}

type ContainerCreateResponse

type ContainerCreateResponse struct {
	ResponseBase
}

type ContainerExecuteProcess

type ContainerExecuteProcess struct {
	RequestBase
	Settings ExecuteProcessSettings
}

type ContainerExecuteProcessResponse

type ContainerExecuteProcessResponse struct {
	ResponseBase
	ProcessID uint32 `json:"ProcessId"`
}

type ContainerGetProperties

type ContainerGetProperties struct {
	RequestBase
	Query ContainerPropertiesQuery
}

type ContainerGetPropertiesResponse

type ContainerGetPropertiesResponse struct {
	ResponseBase
	Properties ContainerProperties
}

type ContainerGetPropertiesResponseV2

type ContainerGetPropertiesResponseV2 struct {
	ResponseBase
	Properties ContainerPropertiesV2
}

type ContainerGetPropertiesV2

type ContainerGetPropertiesV2 struct {
	RequestBase
	Query ContainerPropertiesQueryV2
}

type ContainerModifySettings

type ContainerModifySettings struct {
	RequestBase
	Request interface{}
}

type ContainerNotification

type ContainerNotification struct {
	RequestBase
	Type       string      // Compute.System.NotificationType
	Operation  string      // Compute.System.ActiveOperation
	Result     int32       // HResult
	ResultInfo AnyInString `json:",omitempty"`
}

type ContainerProperties

type ContainerProperties schema1.ContainerProperties

func (*ContainerProperties) MarshalText

func (p *ContainerProperties) MarshalText() ([]byte, error)

func (*ContainerProperties) UnmarshalText

func (p *ContainerProperties) UnmarshalText(b []byte) error

type ContainerPropertiesQuery

type ContainerPropertiesQuery schema1.PropertyQuery

func (*ContainerPropertiesQuery) MarshalText

func (q *ContainerPropertiesQuery) MarshalText() ([]byte, error)

func (*ContainerPropertiesQuery) UnmarshalText

func (q *ContainerPropertiesQuery) UnmarshalText(b []byte) error

type ContainerPropertiesQueryV2

type ContainerPropertiesQueryV2 hcsschema.PropertyQuery

func (*ContainerPropertiesQueryV2) MarshalText

func (q *ContainerPropertiesQueryV2) MarshalText() ([]byte, error)

func (*ContainerPropertiesQueryV2) UnmarshalText

func (q *ContainerPropertiesQueryV2) UnmarshalText(b []byte) error

type ContainerPropertiesV2

type ContainerPropertiesV2 hcsschema.Properties

func (*ContainerPropertiesV2) MarshalText

func (p *ContainerPropertiesV2) MarshalText() ([]byte, error)

func (*ContainerPropertiesV2) UnmarshalText

func (p *ContainerPropertiesV2) UnmarshalText(b []byte) error

type ContainerResizeConsole

type ContainerResizeConsole struct {
	RequestBase
	ProcessID uint32 `json:"ProcessId"`
	Height    uint16
	Width     uint16
}

type ContainerSignalProcess

type ContainerSignalProcess struct {
	RequestBase
	ProcessID uint32      `json:"ProcessId"`
	Options   interface{} `json:",omitempty"`
}

type ContainerWaitForProcess

type ContainerWaitForProcess struct {
	RequestBase
	ProcessID   uint32 `json:"ProcessId"`
	TimeoutInMs uint32
}

type ContainerWaitForProcessResponse

type ContainerWaitForProcessResponse struct {
	ResponseBase
	ExitCode uint32
}

type DeleteContainerStateRequest

type DeleteContainerStateRequest struct {
	RequestBase
}

type DumpStacksRequest

type DumpStacksRequest struct {
	RequestBase
}

type DumpStacksResponse

type DumpStacksResponse struct {
	ResponseBase
	GuestStacks string
}

type ExecuteProcessSettings

type ExecuteProcessSettings struct {
	ProcessParameters       AnyInString
	StdioRelaySettings      *ExecuteProcessStdioRelaySettings      `json:",omitempty"`
	VsockStdioRelaySettings *ExecuteProcessVsockStdioRelaySettings `json:",omitempty"`
}

type ExecuteProcessStdioRelaySettings

type ExecuteProcessStdioRelaySettings struct {
	StdIn  *guid.GUID `json:",omitempty"`
	StdOut *guid.GUID `json:",omitempty"`
	StdErr *guid.GUID `json:",omitempty"`
}

type ExecuteProcessVsockStdioRelaySettings

type ExecuteProcessVsockStdioRelaySettings struct {
	StdIn  uint32 `json:",omitempty"`
	StdOut uint32 `json:",omitempty"`
	StdErr uint32 `json:",omitempty"`
}

type GcsCapabilities

type GcsCapabilities struct {
	SendHostCreateMessage      bool
	SendHostStartMessage       bool
	HvSocketConfigOnStartup    bool
	SendLifecycleNotifications bool
	SupportedSchemaVersions    []hcsschema.Version
	RuntimeOsType              string
	GuestDefinedCapabilities   json.RawMessage
}

type MsgType

type MsgType uint32
const (
	MsgTypeRequest  MsgType = 0x10100000
	MsgTypeResponse MsgType = 0x20100000
	MsgTypeNotify   MsgType = 0x30100000
	MsgTypeMask     MsgType = 0xfff00000

	NotifyContainer = 1<<8 | 1
)

func (MsgType) String

func (typ MsgType) String() string

type NegotiateProtocolRequest

type NegotiateProtocolRequest struct {
	RequestBase
	MinimumVersion uint32
	MaximumVersion uint32
}

type NegotiateProtocolResponse

type NegotiateProtocolResponse struct {
	ResponseBase
	Version      uint32          `json:",omitempty"`
	Capabilities GcsCapabilities `json:",omitempty"`
}

type Ocspancontext

type Ocspancontext struct {
	// TraceID is the `hex` encoded string of the OpenCensus
	// `SpanContext.TraceID` to propagate to the guest.
	TraceID string `json:",omitempty"`
	// SpanID is the `hex` encoded string of the OpenCensus `SpanContext.SpanID`
	// to propagate to the guest.
	SpanID string `json:",omitempty"`

	// TraceOptions is the OpenCensus `SpanContext.TraceOptions` passed through
	// to propagate to the guest.
	TraceOptions uint32 `json:",omitempty"`

	// Tracestate is the `base64` encoded string of marshaling the OpenCensus
	// `SpanContext.TraceState.Entries()` to JSON.
	//
	// If `SpanContext.Tracestate == nil ||
	// len(SpanContext.Tracestate.Entries()) == 0` this will be `""`.
	Tracestate string `json:",omitempty"`
}

Ocspancontext is the internal JSON representation of the OpenCensus `trace.SpanContext` for fowarding to a GCS that supports it.

type RPCProc

type RPCProc uint32
const (
	RPCCreate RPCProc = (iota+1)<<8 | 1
	RPCStart
	RPCShutdownGraceful
	RPCShutdownForced
	RPCExecuteProcess
	RPCWaitForProcess
	RPCSignalProcess
	RPCResizeConsole
	RPCGetProperties
	RPCModifySettings
	RPCNegotiateProtocol
	RPCDumpStacks
	RPCDeleteContainerState
	RPCUpdateContainer
	RPCLifecycleNotification
)

func (RPCProc) String

func (rpc RPCProc) String() string

type RequestBase

type RequestBase struct {
	ContainerID string    `json:"ContainerId"`
	ActivityID  guid.GUID `json:"ActivityId"`

	// OpenCensusSpanContext is the encoded OpenCensus `trace.SpanContext` if
	// set when making the request.
	//
	// NOTE: This is not a part of the protocol but because its a JSON protocol
	// adding fields is a non-breaking change. If the guest supports it this is
	// just additive context.
	OpenCensusSpanContext *Ocspancontext `json:"ocsc,omitempty"`
}

func (*RequestBase) Base

func (req *RequestBase) Base() *RequestBase

type ResponseBase

type ResponseBase struct {
	Result       int32                     // HResult
	ErrorMessage string                    `json:",omitempty"`
	ActivityID   guid.GUID                 `json:"ActivityId,omitempty"`
	ErrorRecords []commonutils.ErrorRecord `json:",omitempty"`
}

func (*ResponseBase) Base

func (resp *ResponseBase) Base() *ResponseBase

type UvmConfig

type UvmConfig struct {
	SystemType          string // must be "Container"
	TimeZoneInformation *hcsschema.TimeZoneInformation
}

Jump to

Keyboard shortcuts

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