go-winio – github.com/Microsoft/go-winio Index | Files | Directories

package winio

import "github.com/Microsoft/go-winio"

Index

Functions

func EncodeExtendedAttributes

func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error)

EncodeExtendedAttributes encodes a list of EAs into a FILE_FULL_EA_INFORMATION buffer for use with BackupWrite, ZwSetEaFile, etc.

func EncodeReparsePoint

func EncodeReparsePoint(rp *ReparsePoint) []byte

EncodeReparsePoint encodes a Win32 REPARSE_DATA_BUFFER structure describing a symlink or mount point.

func VsockServiceID

func VsockServiceID(port uint32) guid.GUID

VsockServiceID returns an hvsock service ID corresponding to the specified AF_VSOCK port.

Types

type ExtendedAttribute

type ExtendedAttribute struct {
	Name  string
	Value []byte
	Flags uint8
}

ExtendedAttribute represents a single Windows EA.

func DecodeExtendedAttributes

func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error)

DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION buffer retrieved from BackupRead, ZwQueryEaFile, etc.

type HvsockAddr

type HvsockAddr struct {
	VMID      guid.GUID
	ServiceID guid.GUID
}

An HvsockAddr is an address for a AF_HYPERV socket.

func (*HvsockAddr) Network

func (addr *HvsockAddr) Network() string

Network returns the address's network name, "hvsock".

func (*HvsockAddr) String

func (addr *HvsockAddr) String() string

type HvsockConn

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

HvsockConn is a connected socket of the AF_HYPERV address family.

func (*HvsockConn) Close

func (conn *HvsockConn) Close() error

Close closes the socket connection, failing any pending read or write calls.

func (*HvsockConn) CloseRead

func (conn *HvsockConn) CloseRead() error

CloseRead shuts down the read end of the socket.

func (*HvsockConn) CloseWrite

func (conn *HvsockConn) CloseWrite() error

CloseWrite shuts down the write end of the socket, notifying the other endpoint that no more data will be written.

func (*HvsockConn) LocalAddr

func (conn *HvsockConn) LocalAddr() net.Addr

LocalAddr returns the local address of the connection.

func (*HvsockConn) Read

func (conn *HvsockConn) Read(b []byte) (int, error)

func (*HvsockConn) RemoteAddr

func (conn *HvsockConn) RemoteAddr() net.Addr

RemoteAddr returns the remote address of the connection.

func (*HvsockConn) SetDeadline

func (conn *HvsockConn) SetDeadline(t time.Time) error

SetDeadline implements the net.Conn SetDeadline method.

func (*HvsockConn) SetReadDeadline

func (conn *HvsockConn) SetReadDeadline(t time.Time) error

SetReadDeadline implements the net.Conn SetReadDeadline method.

func (*HvsockConn) SetWriteDeadline

func (conn *HvsockConn) SetWriteDeadline(t time.Time) error

SetWriteDeadline implements the net.Conn SetWriteDeadline method.

func (*HvsockConn) Write

func (conn *HvsockConn) Write(b []byte) (int, error)

type HvsockListener

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

HvsockListener is a socket listener for the AF_HYPERV address family.

func ListenHvsock

func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error)

ListenHvsock listens for connections on the specified hvsock address.

func (*HvsockListener) Accept

func (l *HvsockListener) Accept() (_ net.Conn, err error)

Accept waits for the next connection and returns it.

func (*HvsockListener) Addr

func (l *HvsockListener) Addr() net.Addr

Addr returns the listener's network address.

func (*HvsockListener) Close

func (l *HvsockListener) Close() error

Close closes the listener, causing any pending Accept calls to fail.

type ReparsePoint

type ReparsePoint struct {
	Target       string
	IsMountPoint bool
}

ReparsePoint describes a Win32 symlink or mount point.

func DecodeReparsePoint

func DecodeReparsePoint(b []byte) (*ReparsePoint, error)

DecodeReparsePoint decodes a Win32 REPARSE_DATA_BUFFER structure containing either a symlink or a mount point.

func DecodeReparsePointData

func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error)

type UnsupportedReparsePointError

type UnsupportedReparsePointError struct {
	Tag uint32
}

UnsupportedReparsePointError is returned when trying to decode a non-symlink or mount point reparse point.

func (*UnsupportedReparsePointError) Error

Source Files

ea.go hvsock.go reparse.go syscall.go

Directories

PathSynopsis
archive
archive/tarPackage tar implements access to tar archives.
backuptar
pkg
pkg/etwPackage etw provides support for TraceLogging-based ETW (Event Tracing for Windows).
pkg/etwlogrus
pkg/etw/sampleShows a sample usage of the ETW logging package.
pkg/guidPackage guid provides a GUID type.
pkg/security
tools
tools/etw-provider-gen
vhd
wimPackage wim implements a WIM file parser.
wim/lzxPackage lzx implements a decompressor for the the WIM variant of the LZX compression algorithm.
wim/validate
Version
v0.4.14
Published
Aug 6, 2019
Platform
js/wasm
Imports
13 packages
Last checked
3 days ago

Tools for package owners.