package
0.0.0-20240720002214-37b2b8227b91
Repository: https://github.com/progrium/go-netstack.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
Package memxattr provides a default, in-memory extended attribute implementation.

# Functions

AccessTypesForOpenFlags returns the access types required to open a file with the given OpenOptions.Flags.
CanActAsOwner returns true if creds can act as the owner of a file with the given owning UID, consistent with Linux's fs/inode.c:inode_owner_or_capable().
CheckDeleteSticky checks whether the sticky bit is set on a directory with the given file mode, and if so, checks whether creds has permission to remove a file owned by childKUID from a directory with the given mode.
CheckLimit enforces file size rlimits.
CheckSetStat checks that creds has permission to change the metadata of a file with the given permissions, UID, and GID as specified by stat, subject to the rules of Linux's fs/attr.c:setattr_prepare().
CheckXattrPermissions checks permissions for extended attribute access.
ClearSUIDAndSGID clears the setuid and/or setgid bits after a chown or write.
CopyRegularFileData copies data from srcFD to dstFD until reading from srcFD returns EOF or an error.
GenericCheckPermissions checks that creds has the given access rights on a file with the given permissions, UID, and GID, subject to the rules of fs/namei.c:generic_permission().
GenericConfigureMMap may be used by most implementations of FileDescriptionImpl.ConfigureMMap.
GenericParseMountOptions parses a comma-separated list of options of the form "key" or "key=value", where neither key nor value contain commas, and returns it as a map.
GenericStatFS returns a statfs struct filled with the common fields for a general filesystem.
HasCapabilityOnFile returns true if creds has the given capability with respect to a file with the given owning UID and GID, consistent with Linux's kernel/capability.c:capable_wrt_inode_uidgid().
InotifyEventFromStatMask generates the appropriate events for an operation that set the stats specified in mask.
InotifyRemoveChild sends the appriopriate notifications to the watch sets of the child being removed and its parent.
InotifyRename sends the appriopriate notifications to the watch sets of the file being renamed and its old/new parents.
MakeVirtualDentry creates a VirtualDentry.
MayLink determines whether creating a hard link to a file with the given mode, kuid, and kgid is permitted.
MayReadFileWithOpenFlags returns true if a file with the given open flags should be readable.
MayWriteFileWithOpenFlags returns true if a file with the given open flags should be writable.
MountNamespaceFromContext returns the MountNamespace used by ctx.
NewInotifyFD constructs a new Inotify instance.
RootFromContext returns the VFS root used by ctx.
WithMountNamespace returns a copy of ctx with the given MountNamespace.
WithRoot returns a copy of ctx with the given root.

# Constants

BlockDevice indicates a block device.
CharDevice indicates a character device.
CtxMountNamespace is a Context.Value key for a MountNamespace.
CtxRoot is a Context.Value key for a VFS root.
FileCreationFlags are the set of flags passed to FileDescription.Init() but omitted from FileDescription.StatusFlags().
enableLogging indicates whether reference-related events should be logged (with stack traces).
enableLogging indicates whether reference-related events should be logged (with stack traces).
PathEvent and InodeEvent correspond to FSNOTIFY_EVENT_PATH and FSNOTIFY_EVENT_INODE in Linux.
Bits in AccessTypes.
Bits in AccessTypes.
Bits in AccessTypes.
MountMax is the maximum number of mounts allowed.
PathEvent and InodeEvent correspond to FSNOTIFY_EVENT_PATH and FSNOTIFY_EVENT_INODE in Linux.

# Variables

obj is used to customize logging.
obj is used to customize logging.

# Structs

BadLockFD implements Lock*/Unlock* portion of FileDescriptionImpl interface returning EBADF.
BoundEndpointOptions contains options to VirtualFilesystem.BoundEndpointAt() and FilesystemImpl.BoundEndpointAt().
CompleteRestoreOptions contains options to VirtualFilesystem.CompleteRestore() and FilesystemImplSaveRestoreExtension.CompleteRestore().
Dentry represents a node in a Filesystem tree at which a file exists.
DentryMetadataFileDescriptionImpl may be embedded by implementations of FileDescriptionImpl for which FileDescriptionOptions.UseDentryMetadata is true to obtain implementations of Stat and SetStat that panic.
DirectoryFileDescriptionDefaultImpl may be embedded by implementations of FileDescriptionImpl that always represent directories to obtain implementations of non-directory I/O methods that return EISDIR.
Dirent holds the information contained in struct linux_dirent64.
DynamicBytesFileDescriptionImpl may be embedded by implementations of FileDescriptionImpl that represent read-only regular files whose contents are backed by a bytes.Buffer that is regenerated when necessary, consistent with Linux's fs/seq_file.c:single_open().
EpollInstance represents an epoll instance, as described by epoll(7).
ErrCorruption indicates a failed restore due to external file system state in corruption.
Event represents a struct inotify_event from linux.
A FileDescription represents an open file description, which is the entity referred to by a file descriptor (POSIX.1-2017 3.258 "Open File Description").
FileDescriptionDefaultImpl may be embedded by implementations of FileDescriptionImpl to obtain implementations of many FileDescriptionImpl methods with default behavior analogous to Linux's.
FileDescriptionOptions contains options to FileDescription.Init().
Refs implements refs.RefCounter.
FileLocks supports POSIX and BSD style locks, which correspond to fcntl(2) and flock(2) respectively in Linux.
A Filesystem is a tree of nodes represented by Dentries, which forms part of a VirtualFilesystem.
Refs implements refs.RefCounter.
GetDentryOptions contains options to VirtualFilesystem.GetDentryAt() and FilesystemImpl.GetDentryAt().
GetFilesystemOptions contains options to FilesystemType.GetFilesystem.
GetXattrOptions contains options to VirtualFilesystem.GetXattrAt(), FilesystemImpl.GetXattrAt(), FileDescription.GetXattr(), and FileDescriptionImpl.GetXattr().
Inotify represents an inotify instance created by inotify_init(2) or inotify_init1(2).
LockFD may be used by most implementations of FileDescriptionImpl.Lock* functions.
MkdirOptions contains options to VirtualFilesystem.MkdirAt() and FilesystemImpl.MkdirAt().
MknodOptions contains options to VirtualFilesystem.MknodAt() and FilesystemImpl.MknodAt().
A Mount is a replacement of a Dentry (Mount.key.point) from one Filesystem (Mount.key.parent.fs) with a Dentry (Mount.root) from another Filesystem (Mount.fs), which applies to path resolution in the context of a particular Mount (Mount.key.parent).
MountFlags contains flags as specified for mount(2), e.g.
A MountNamespace is a collection of Mounts.// MountNamespaces are reference-counted.
MountOptions contains options to VirtualFilesystem.MountAt(), and VirtualFilesystem.RemountAt() +stateify savable.
NoAsyncEventFD implements [Un]RegisterFileAsyncHandler of FileDescriptionImpl.
NoLockFD implements Lock*/Unlock* portion of FileDescriptionImpl interface returning ENOLCK.
OpenOptions contains options to VirtualFilesystem.OpenAt() and FilesystemImpl.OpenAt().
PathOperation specifies the path operated on by a VFS method.
PrependPathAtNonMountRootError is returned by implementations of FilesystemImpl.PrependPath() when they encounter an independent ancestor Dentry that is not the Mount root.
PrependPathAtVFSRootError is returned by implementations of FilesystemImpl.PrependPath() when they encounter the contextual VFS root.
PrependPathSyntheticError is returned by implementations of FilesystemImpl.PrependPath() for which prepended names do not represent real paths.
ReadOptions contains options to FileDescription.PRead(), FileDescriptionImpl.PRead(), FileDescription.Read(), and FileDescriptionImpl.Read().
RegisterDeviceOptions contains options to VirtualFilesystem.RegisterDevice().
RegisterFilesystemTypeOptions contains options to VirtualFilesystem.RegisterFilesystem().
RenameOptions contains options to VirtualFilesystem.RenameAt() and FilesystemImpl.RenameAt().
ResolvingPath represents the state of an in-progress path resolution, shared between VFS and FilesystemImpl methods that take a path.
SetStatOptions contains options to VirtualFilesystem.SetStatAt(), FilesystemImpl.SetStatAt(), FileDescription.SetStat(), and FileDescriptionImpl.SetStat().
SetXattrOptions contains options to VirtualFilesystem.SetXattrAt(), FilesystemImpl.SetXattrAt(), FileDescription.SetXattr(), and FileDescriptionImpl.SetXattr().
StaticData implements DynamicBytesSource over a static string.
StatOptions contains options to VirtualFilesystem.StatAt(), FilesystemImpl.StatAt(), FileDescription.Stat(), and FileDescriptionImpl.Stat().
UmountOptions contains options to VirtualFilesystem.UmountAt().
A VirtualDentry represents a node in a VFS tree, by combining a Dentry (which represents a node in a Filesystem's tree) and a Mount (which represents the Filesystem's position in a VFS mount tree).
A VirtualFilesystem (VFS for short) combines Filesystems in trees of Mounts.
Watch represent a particular inotify watch created by inotify_add_watch.
Watches is the collection of all inotify watches on a single file.
WriteOptions contains options to FileDescription.PWrite(), FileDescriptionImpl.PWrite(), FileDescription.Write(), and FileDescriptionImpl.Write().

# Interfaces

DentryImpl contains implementation details for a Dentry.
A Device backs device special files.
DynamicBytesSource represents a data source for a DynamicBytesFileDescriptionImpl.
A FileAsync sends signals to its owner when w is ready for IO.
FileDescriptionImpl contains implementation details for an FileDescription.
FilesystemImpl contains implementation details for a Filesystem.
FilesystemImplSaveRestoreExtension is an optional extension to FilesystemImpl.
A FilesystemType constructs filesystems.
IterDirentsCallback receives Dirents from FileDescriptionImpl.IterDirents.
Namespace is the namespace interface.
NamespaceInodeGetter is an interface that provides the GetNamespaceInode method.
WritableDynamicBytesSource extends DynamicBytesSource to allow writes to the underlying source.

# Type aliases

AccessTypes is a bitmask of Unix file permissions.
DeviceKind indicates whether a device is a block or character device.
EventType defines different kinds of inotfiy events.
IterDirentsCallbackFunc implements IterDirentsCallback for a function with the semantics of IterDirentsCallback.Handle.