| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| // |
| // GENERATED FILE: Do not edit! |
| // |
| // To rebuild this file, invoke third_party/go/regen-fidl. |
| |
| // +build fuchsia |
| |
| package io |
| |
| import ( |
| _zx "syscall/zx" |
| _bindings "syscall/zx/fidl" |
| fuchsiamem "syscall/zx/mem" |
| ) |
| |
| const ( |
| // Indicates the file is ready for reading. |
| FileSignalReadable uint32 = 0x01000000 |
| // Indicates the file is ready for writing. |
| FileSignalWritable uint32 = 0x02000000 |
| // Indicates the device is ready for reading. |
| DeviceSignalReadable uint32 = 0x01000000 |
| // Indicates the device is ready for writing. |
| DeviceSignalWritable uint32 = 0x02000000 |
| // Indicates the device has encountered an error state. |
| DeviceSignalError uint32 = 0x04000000 |
| // Indicates the device has hung up on the current connection. |
| DeviceSignalHangup uint32 = 0x08000000 |
| // Indicates an out-of-band state transition has occurred. |
| DeviceSignalOob uint32 = 0x10000000 |
| // Can read from target object. |
| OpenRightReadable uint32 = 0x00000001 |
| // Can write to target object. |
| OpenRightWritable uint32 = 0x00000002 |
| // Connection can mount/umount filesystem. |
| OpenRightAdmin uint32 = 0x00000004 |
| // Create the object if it doesn't exist. |
| OpenFlagCreate uint32 = 0x00010000 |
| // (with Create) Fail if the object already exists. |
| OpenFlagCreateIfAbsent uint32 = 0x00020000 |
| // Truncate the object before usage. |
| OpenFlagTruncate uint32 = 0x00040000 |
| // Return an error if the target object is not a directory. |
| OpenFlagDirectory uint32 = 0x00080000 |
| // Seek to the end of the object before all writes. |
| OpenFlagAppend uint32 = 0x00100000 |
| // If the object is a mount point, open the local directory. |
| OpenFlagNoRemote uint32 = 0x00200000 |
| // Open a reference to the object, not the object itself. |
| // |
| // If an object is opened or cloned using this method, all other flags |
| // except for: |
| // - OPEN_FLAG_DIRECTORY |
| // - OPEN_FLAG_DESCRIBE |
| // Are ignored. |
| OpenFlagNodeReference uint32 = 0x00400000 |
| // TODO(ZX-1723): Unimplemented. |
| // Binary OR of OPEN_FLAG_DIRECTORY, OPEN_FLAG_NOT_DIRECTORY, OPEN_FLAG_DESCRIBE, and |
| // OPEN_FLAG_NODE_REFERENCE. Flags used when opening a node reference must fall within this mask. |
| OpenFlagsAllowedWithNodeReference uint32 = 0x02c80000 |
| // Requests that an "OnOpen" event is sent, with |
| // a non-null NodeInfo (if the open is successful). |
| OpenFlagDescribe uint32 = 0x00800000 |
| // TODO(ZX-1723): Unimplemented. |
| // Specify this flag to request POSIX-compatibility. Currently, it affects permission handling. |
| // During Open: |
| // - If the target path is a directory, the rights on the new connection expands to include |
| // OPEN_RIGHT_WRITABLE if and only if the current connection and all intermediate mount points |
| // are writable. |
| // - Otherwise, this flag is ignored. It is an access denied error to request more rights |
| // than those on the current connection, or any intermediate mount points. |
| // |
| // If the posix compatibility flag is not specified, opening always uses the requested rights, |
| // failing the operation with access denied error if requested rights exceeds the rights attached |
| // to the current connection. |
| // |
| // If the requesting connection is read-only and the requested rights are read-only, the flag |
| // may be ignored by the server, and is not forwarded downstream. This is an implementation detail, |
| // necessary to enforce hierarchical permissions across mount points, and should have no effect |
| // on the expected behavior for clients. |
| OpenFlagPosix uint32 = 0x01000000 |
| // TODO(ZX-1723): Unimplemented. |
| // Assert that the object to be opened is not a directory. |
| // Return an error if the target object is a directory. |
| OpenFlagNotDirectory uint32 = 0x02000000 |
| // TODO(ZX-1723): Unimplemented. |
| // When used during clone, the new connection inherits the rights on the source connection, |
| // regardless if it is a file or directory. Otherwise, clone attempts to use the requested rights. |
| // It is invalid to pass any of the OPEN_RIGHT_* flags together with CLONE_FLAGS_SAME_RIGHTS. |
| CloneFlagSameRights uint32 = 0x04000000 |
| // Bits reserved for posix protections. Native fuchsia filesystems |
| // are not required to set bits contained within MODE_PROTECTION_MASK, |
| // but filesystems that wish to do so may refer to sys/stat.h for their |
| // definitions. |
| ModeProtectionMask uint32 = 0x00FFF |
| // Bits indicating node type. The canonical mechanism to check |
| // for a node type is to take 'mode', bitwise AND it with the |
| // MODE_TYPE_MASK, and check exact equality against a mode type. |
| ModeTypeMask uint32 = 0xFF000 |
| ModeTypeDirectory uint32 = 0x04000 |
| ModeTypeBlockDevice uint32 = 0x06000 |
| ModeTypeFile uint32 = 0x08000 |
| ModeTypeSocket uint32 = 0x0C000 |
| ModeTypeService uint32 = 0x10000 |
| MaxIoctlHandles uint64 = 2 |
| // The maximal buffer size which can be transmitted for buffered operations. |
| // This capacity is currently set somewhat arbitrarily. |
| MaxBuf uint64 = 8192 |
| // The maximum length, in bytes, of a filesystem string. |
| MaxPath uint64 = 4096 |
| // The maximum length, in bytes, of a single filesystem component. |
| MaxFilename uint64 = 255 |
| // The fields of 'attributes' which are used to update the Node are indicated |
| // by the 'flags' argument. |
| NodeAttributeFlagCreationTime uint32 = 0x00000001 |
| NodeAttributeFlagModificationTime uint32 = 0x00000002 |
| // Requests that the VMO be readable. |
| VmoFlagRead uint32 = 0x00000001 |
| // Requests that the VMO be writable. |
| VmoFlagWrite uint32 = 0x00000002 |
| // Requests that the VMO be executable. |
| VmoFlagExec uint32 = 0x00000004 |
| // Require a copy-on-write clone of the underlying VMO. |
| // The request should fail if the VMO is not cloned. |
| // May not be supplied with fuchsia_io_VMO_FLAG_EXACT. |
| VmoFlagPrivate uint32 = 0x00010000 |
| // Require an exact (non-cloned) handle to the underlying VMO. |
| // The request should fail if a handle to the exact VMO is not returned. |
| // May not be supplied with VMO_FLAG_PRIVATE. |
| VmoFlagExact uint32 = 0x00020000 |
| // A dirent with an unknown type. |
| DirentTypeUnknown uint8 = 0 |
| // A dirent representing a directory object. |
| DirentTypeDirectory uint8 = 4 |
| // A dirent representing a block device object. |
| DirentTypeBlockDevice uint8 = 6 |
| // A dirent representing a file object. |
| DirentTypeFile uint8 = 8 |
| // A dirent representing a socket object. |
| DirentTypeSocket uint8 = 12 |
| // A dirent representing a service object. |
| DirentTypeService uint8 = 16 |
| // Nodes which do not have ino values should return this value |
| // from Readdir and GetAttr. |
| InoUnknown uint64 = 0xFFFFFFFFFFFFFFFF |
| // Indicates the directory being watched has been deleted. |
| WatchEventDeleted uint8 = 0 |
| // Indicates a node has been created (either new or moved) into a directory. |
| WatchEventAdded uint8 = 1 |
| // Identifies a node has been removed (either deleted or moved) from the directory. |
| WatchEventRemoved uint8 = 2 |
| // Identifies a node already existed in the directory when watching started. |
| WatchEventExisting uint8 = 3 |
| // Identifies that no more WATCH_EVENT_EXISTING events will be sent. |
| WatchEventIdle uint8 = 4 |
| // Used by Directory::Watch. Requests transmission of WATCH_EVENT_DELETED. |
| WatchMaskDeleted uint32 = 0x00000001 |
| // Used by Directory::Watch. Requests transmission of WATCH_EVENT_ADDED. |
| WatchMaskAdded uint32 = 0x00000002 |
| // Used by Directory::Watch. Requests transmission of WATCH_EVENT_REMOVED. |
| WatchMaskRemoved uint32 = 0x00000004 |
| // Used by Directory::Watch. Requests transmission of WATCH_EVENT_EXISTING. |
| WatchMaskExisting uint32 = 0x00000008 |
| // Used by Directory::Watch. Requests transmission of WATCH_EVENT_IDLE. |
| WatchMaskIdle uint32 = 0x00000010 |
| // Used by Directory::Watch. Requests transmission of all watcher events. |
| WatchMaskAll uint32 = 0x0000001F |
| MountCreateFlagReplace uint32 = 0x00000001 |
| MaxFsNameBuffer uint64 = 32 |
| ) |
| |
| // Update the Seek offset. |
| type SeekOrigin uint32 |
| |
| const ( |
| SeekOriginStart SeekOrigin = 0 |
| SeekOriginCurrent SeekOrigin = 1 |
| SeekOriginEnd SeekOrigin = 2 |
| ) |
| |
| func (x SeekOrigin) String() string { |
| switch x { |
| case 0: |
| return "Start" |
| case 1: |
| return "Current" |
| case 2: |
| return "End" |
| } |
| return "Unknown" |
| } |
| |
| // The default protocol, interface information must be acquired some |
| // other way. |
| type Service struct { |
| _ struct{} `fidl2:"s,1,1"` |
| } |
| |
| var _mService = _bindings.CreateLazyMarshaler(Service{}) |
| |
| func (msg *Service) Marshaler() _bindings.Marshaler { |
| return _mService |
| } |
| |
| // Implements Payload. |
| func (_ *Service) InlineAlignment() int { |
| return 1 |
| } |
| |
| // Implements Payload. |
| func (_ *Service) InlineSize() int { |
| return 1 |
| } |
| |
| // The object may be cast to interface 'File'. |
| type FileObject struct { |
| _ struct{} `fidl2:"s,4,4"` |
| // An optional event which transmits information about an object's readability |
| // or writability. This event relays information about the underlying object, not |
| // the capability granted to client: this event may be signalled "readable" on a |
| // connection that does not have the capability to read. |
| // |
| // The "FILE_SIGNAL_" values may be observed on this event. |
| Event _zx.Event `fidl:"*" fidl2:"1"` |
| } |
| |
| var _mFileObject = _bindings.CreateLazyMarshaler(FileObject{}) |
| |
| func (msg *FileObject) Marshaler() _bindings.Marshaler { |
| return _mFileObject |
| } |
| |
| // Implements Payload. |
| func (_ *FileObject) InlineAlignment() int { |
| return 4 |
| } |
| |
| // Implements Payload. |
| func (_ *FileObject) InlineSize() int { |
| return 4 |
| } |
| |
| // The object may be cast to interface 'Directory'. |
| type DirectoryObject struct { |
| _ struct{} `fidl2:"s,1,1"` |
| } |
| |
| var _mDirectoryObject = _bindings.CreateLazyMarshaler(DirectoryObject{}) |
| |
| func (msg *DirectoryObject) Marshaler() _bindings.Marshaler { |
| return _mDirectoryObject |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryObject) InlineAlignment() int { |
| return 1 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryObject) InlineSize() int { |
| return 1 |
| } |
| |
| // The object is accompanied by a pipe. |
| type Pipe struct { |
| _ struct{} `fidl2:"s,4,4"` |
| Socket _zx.Socket `fidl2:"0"` |
| } |
| |
| var _mPipe = _bindings.CreateLazyMarshaler(Pipe{}) |
| |
| func (msg *Pipe) Marshaler() _bindings.Marshaler { |
| return _mPipe |
| } |
| |
| // Implements Payload. |
| func (_ *Pipe) InlineAlignment() int { |
| return 4 |
| } |
| |
| // Implements Payload. |
| func (_ *Pipe) InlineSize() int { |
| return 4 |
| } |
| |
| // The object is a file which is represented as an immutable VMO. |
| // Although a VMO is returned as a part of this structure, this underlying object |
| // may represent multiple Vmofiles. To identify the logical portion of the VMO |
| // that represents the single file, an offset and length parameter are also supplied. |
| type Vmofile struct { |
| _ struct{} `fidl2:"s,24,8"` |
| // The VMO which backs this file. |
| Vmo _zx.VMO `fidl2:"0"` |
| // The index into |vmo| which represents the first byte of the file. |
| Offset uint64 |
| // The number of bytes, starting at |offset|, which may be used to represent this file. |
| Length uint64 |
| } |
| |
| var _mVmofile = _bindings.CreateLazyMarshaler(Vmofile{}) |
| |
| func (msg *Vmofile) Marshaler() _bindings.Marshaler { |
| return _mVmofile |
| } |
| |
| // Implements Payload. |
| func (_ *Vmofile) InlineAlignment() int { |
| return 8 |
| } |
| |
| // Implements Payload. |
| func (_ *Vmofile) InlineSize() int { |
| return 24 |
| } |
| |
| // The object may be cast to interface 'Device'. |
| type Device struct { |
| _ struct{} `fidl2:"s,4,4"` |
| // An optional event which transmits information about a device's state. |
| // |
| // The "DEVICE_SIGNAL_" values may be observed on this event. |
| Event _zx.Event `fidl:"*" fidl2:"1"` |
| } |
| |
| var _mDevice = _bindings.CreateLazyMarshaler(Device{}) |
| |
| func (msg *Device) Marshaler() _bindings.Marshaler { |
| return _mDevice |
| } |
| |
| // Implements Payload. |
| func (_ *Device) InlineAlignment() int { |
| return 4 |
| } |
| |
| // Implements Payload. |
| func (_ *Device) InlineSize() int { |
| return 4 |
| } |
| |
| // The object may be cast to interface 'Tty' |
| type Tty struct { |
| _ struct{} `fidl2:"s,4,4"` |
| Event _zx.Event `fidl:"*" fidl2:"1"` |
| } |
| |
| var _mTty = _bindings.CreateLazyMarshaler(Tty{}) |
| |
| func (msg *Tty) Marshaler() _bindings.Marshaler { |
| return _mTty |
| } |
| |
| // Implements Payload. |
| func (_ *Tty) InlineAlignment() int { |
| return 4 |
| } |
| |
| // Implements Payload. |
| func (_ *Tty) InlineSize() int { |
| return 4 |
| } |
| |
| // NodeAttributes defines generic information about a filesystem node. |
| type NodeAttributes struct { |
| _ struct{} `fidl2:"s,56,8"` |
| // Protection bits and node type information describe in 'mode'. |
| Mode uint32 |
| // A filesystem-unique ID. |
| Id uint64 |
| // Node size, in bytes. |
| ContentSize uint64 |
| // Space needed to store node (possibly larger than size), in bytes. |
| StorageSize uint64 |
| // Hard link count. |
| LinkCount uint64 |
| // Time of creation (may be updated manually after creation) in ns since Unix epoch, UTC. |
| CreationTime uint64 |
| // Time of last modification in ns since Unix epoch, UTC. |
| ModificationTime uint64 |
| } |
| |
| var _mNodeAttributes = _bindings.CreateLazyMarshaler(NodeAttributes{}) |
| |
| func (msg *NodeAttributes) Marshaler() _bindings.Marshaler { |
| return _mNodeAttributes |
| } |
| |
| // Implements Payload. |
| func (_ *NodeAttributes) InlineAlignment() int { |
| return 8 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeAttributes) InlineSize() int { |
| return 56 |
| } |
| |
| // TODO(ZX-2645): Unused. |
| // |
| // WatchedEvent describes events returned from a DirectoryWatcher. |
| type WatchedEvent struct { |
| _ struct{} `fidl2:"s,24,8"` |
| Event uint8 |
| Len uint8 |
| Name []uint8 `fidl:"255" fidl2:"255"` |
| } |
| |
| var _mWatchedEvent = _bindings.CreateLazyMarshaler(WatchedEvent{}) |
| |
| func (msg *WatchedEvent) Marshaler() _bindings.Marshaler { |
| return _mWatchedEvent |
| } |
| |
| // Implements Payload. |
| func (_ *WatchedEvent) InlineAlignment() int { |
| return 8 |
| } |
| |
| // Implements Payload. |
| func (_ *WatchedEvent) InlineSize() int { |
| return 24 |
| } |
| |
| type FilesystemInfo struct { |
| _ struct{} `fidl2:"s,96,8"` |
| // The number of data bytes which may be stored in a filesystem. |
| TotalBytes uint64 |
| // The number of data bytes which are in use by the filesystem. |
| UsedBytes uint64 |
| // The number of nodes which may be stored in the filesystem. |
| TotalNodes uint64 |
| // The number of nodes used by the filesystem. |
| UsedNodes uint64 |
| // The amount of space which may be allocated from the underlying |
| // volume manager. If unsupported, this will be zero. |
| FreeSharedPoolBytes uint64 |
| // A unique identifier for this filesystem instance. Will not be preserved |
| // across reboots. |
| FsId uint64 |
| // The size of a single filesystem block. |
| BlockSize uint32 |
| // The maximum length of a filesystem name. |
| MaxFilenameSize uint32 |
| // A unique identifier for the type of the underlying filesystem. |
| FsType uint32 |
| Padding uint32 |
| // TODO(smklein): Replace this field with a string when supported |
| // by the "Simple" interface. At the moment, name is a fixed-size, |
| // null-terminated buffer. |
| Name [32]int8 |
| } |
| |
| var _mFilesystemInfo = _bindings.CreateLazyMarshaler(FilesystemInfo{}) |
| |
| func (msg *FilesystemInfo) Marshaler() _bindings.Marshaler { |
| return _mFilesystemInfo |
| } |
| |
| // Implements Payload. |
| func (_ *FilesystemInfo) InlineAlignment() int { |
| return 8 |
| } |
| |
| // Implements Payload. |
| func (_ *FilesystemInfo) InlineSize() int { |
| return 96 |
| } |
| |
| type NodeInfoTag uint32 |
| |
| const ( |
| _ NodeInfoTag = iota |
| NodeInfoService |
| NodeInfoFile |
| NodeInfoDirectory |
| NodeInfoPipe |
| NodeInfoVmofile |
| NodeInfoDevice |
| NodeInfoTty |
| ) |
| |
| // Describes how the connection to an should be handled, as well as |
| // how to interpret the optional handle. |
| // |
| // Refer to |Node::Describe()| and |Node::OnOpen()| for usage. |
| type NodeInfo struct { |
| NodeInfoTag `fidl:"tag" fidl2:"u,32,8"` |
| Service Service |
| File FileObject |
| Directory DirectoryObject |
| Pipe Pipe |
| Vmofile Vmofile |
| Device Device |
| Tty Tty |
| } |
| |
| // Implements Payload. |
| func (_ *NodeInfo) InlineAlignment() int { |
| return 8 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeInfo) InlineSize() int { |
| return 32 |
| } |
| |
| func (u *NodeInfo) Which() NodeInfoTag { |
| return u.NodeInfoTag |
| } |
| |
| func (u *NodeInfo) SetService(service Service) { |
| u.NodeInfoTag = NodeInfoService |
| u.Service = service |
| } |
| |
| func (u *NodeInfo) SetFile(file FileObject) { |
| u.NodeInfoTag = NodeInfoFile |
| u.File = file |
| } |
| |
| func (u *NodeInfo) SetDirectory(directory DirectoryObject) { |
| u.NodeInfoTag = NodeInfoDirectory |
| u.Directory = directory |
| } |
| |
| func (u *NodeInfo) SetPipe(pipe Pipe) { |
| u.NodeInfoTag = NodeInfoPipe |
| u.Pipe = pipe |
| } |
| |
| func (u *NodeInfo) SetVmofile(vmofile Vmofile) { |
| u.NodeInfoTag = NodeInfoVmofile |
| u.Vmofile = vmofile |
| } |
| |
| func (u *NodeInfo) SetDevice(device Device) { |
| u.NodeInfoTag = NodeInfoDevice |
| u.Device = device |
| } |
| |
| func (u *NodeInfo) SetTty(tty Tty) { |
| u.NodeInfoTag = NodeInfoTty |
| u.Tty = tty |
| } |
| |
| const ( |
| NodeCloneOrdinal uint32 = 402549324 |
| NodeCloneGenOrdinal uint32 = 402549324 |
| NodeCloseOrdinal uint32 = 1387878023 |
| NodeCloseGenOrdinal uint32 = 1387878023 |
| NodeDescribeOrdinal uint32 = 526573406 |
| NodeDescribeGenOrdinal uint32 = 526573406 |
| NodeOnOpenOrdinal uint32 = 1191225277 |
| NodeOnOpenGenOrdinal uint32 = 1191225277 |
| NodeSyncOrdinal uint32 = 1648508842 |
| NodeSyncGenOrdinal uint32 = 1648508842 |
| NodeGetAttrOrdinal uint32 = 1166403528 |
| NodeGetAttrGenOrdinal uint32 = 1166403528 |
| NodeSetAttrOrdinal uint32 = 198530458 |
| NodeSetAttrGenOrdinal uint32 = 198530458 |
| NodeIoctlOrdinal uint32 = 905161895 |
| NodeIoctlGenOrdinal uint32 = 905161895 |
| ) |
| |
| type nodeCloneRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| Flags uint32 |
| Object NodeInterfaceRequest `fidl2:"0"` |
| } |
| |
| var _mnodeCloneRequest = _bindings.CreateLazyMarshaler(nodeCloneRequest{}) |
| |
| func (msg *nodeCloneRequest) Marshaler() _bindings.Marshaler { |
| return _mnodeCloneRequest |
| } |
| |
| // Implements Payload. |
| func (_ *nodeCloneRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeCloneRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type nodeCloseResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mnodeCloseResponse = _bindings.CreateLazyMarshaler(nodeCloseResponse{}) |
| |
| func (msg *nodeCloseResponse) Marshaler() _bindings.Marshaler { |
| return _mnodeCloseResponse |
| } |
| |
| // Implements Payload. |
| func (_ *nodeCloseResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeCloseResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type nodeDescribeResponse struct { |
| _ struct{} `fidl2:"s,32,0"` |
| Info NodeInfo |
| } |
| |
| var _mnodeDescribeResponse = _bindings.CreateLazyMarshaler(nodeDescribeResponse{}) |
| |
| func (msg *nodeDescribeResponse) Marshaler() _bindings.Marshaler { |
| return _mnodeDescribeResponse |
| } |
| |
| // Implements Payload. |
| func (_ *nodeDescribeResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeDescribeResponse) InlineSize() int { |
| return 32 |
| } |
| |
| type nodeOnOpenResponse struct { |
| _ struct{} `fidl2:"s,16,0"` |
| S int32 |
| Info *NodeInfo |
| } |
| |
| var _mnodeOnOpenResponse = _bindings.CreateLazyMarshaler(nodeOnOpenResponse{}) |
| |
| func (msg *nodeOnOpenResponse) Marshaler() _bindings.Marshaler { |
| return _mnodeOnOpenResponse |
| } |
| |
| // Implements Payload. |
| func (_ *nodeOnOpenResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeOnOpenResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type nodeSyncResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mnodeSyncResponse = _bindings.CreateLazyMarshaler(nodeSyncResponse{}) |
| |
| func (msg *nodeSyncResponse) Marshaler() _bindings.Marshaler { |
| return _mnodeSyncResponse |
| } |
| |
| // Implements Payload. |
| func (_ *nodeSyncResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeSyncResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type nodeGetAttrResponse struct { |
| _ struct{} `fidl2:"s,64,0"` |
| S int32 |
| Attributes NodeAttributes |
| } |
| |
| var _mnodeGetAttrResponse = _bindings.CreateLazyMarshaler(nodeGetAttrResponse{}) |
| |
| func (msg *nodeGetAttrResponse) Marshaler() _bindings.Marshaler { |
| return _mnodeGetAttrResponse |
| } |
| |
| // Implements Payload. |
| func (_ *nodeGetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeGetAttrResponse) InlineSize() int { |
| return 64 |
| } |
| |
| type nodeSetAttrRequest struct { |
| _ struct{} `fidl2:"s,64,0"` |
| Flags uint32 |
| Attributes NodeAttributes |
| } |
| |
| var _mnodeSetAttrRequest = _bindings.CreateLazyMarshaler(nodeSetAttrRequest{}) |
| |
| func (msg *nodeSetAttrRequest) Marshaler() _bindings.Marshaler { |
| return _mnodeSetAttrRequest |
| } |
| |
| // Implements Payload. |
| func (_ *nodeSetAttrRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeSetAttrRequest) InlineSize() int { |
| return 64 |
| } |
| |
| type nodeSetAttrResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mnodeSetAttrResponse = _bindings.CreateLazyMarshaler(nodeSetAttrResponse{}) |
| |
| func (msg *nodeSetAttrResponse) Marshaler() _bindings.Marshaler { |
| return _mnodeSetAttrResponse |
| } |
| |
| // Implements Payload. |
| func (_ *nodeSetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeSetAttrResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type nodeIoctlRequest struct { |
| _ struct{} `fidl2:"s,48,0"` |
| Opcode uint32 |
| MaxOut uint64 |
| Handles []_zx.Handle `fidl:"2" fidl2:"2,0"` |
| In []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mnodeIoctlRequest = _bindings.CreateLazyMarshaler(nodeIoctlRequest{}) |
| |
| func (msg *nodeIoctlRequest) Marshaler() _bindings.Marshaler { |
| return _mnodeIoctlRequest |
| } |
| |
| // Implements Payload. |
| func (_ *nodeIoctlRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeIoctlRequest) InlineSize() int { |
| return 48 |
| } |
| |
| type nodeIoctlResponse struct { |
| _ struct{} `fidl2:"s,40,0"` |
| S int32 |
| Handles []_zx.Handle `fidl:"2" fidl2:"2,0"` |
| Out []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mnodeIoctlResponse = _bindings.CreateLazyMarshaler(nodeIoctlResponse{}) |
| |
| func (msg *nodeIoctlResponse) Marshaler() _bindings.Marshaler { |
| return _mnodeIoctlResponse |
| } |
| |
| // Implements Payload. |
| func (_ *nodeIoctlResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *nodeIoctlResponse) InlineSize() int { |
| return 40 |
| } |
| |
| type NodeInterface _bindings.ChannelProxy |
| |
| // Create another connection to the same remote object. |
| // |
| // |flags| may be any of: |
| // - OPEN_RIGHT_* |
| // - OPEN_FLAG_APPEND |
| // - OPEN_FLAG_NO_REMOTE |
| // - OPEN_FLAG_DESCRIBE |
| // |
| // All other flags are ignored. |
| // |
| // The cloned object must have rights less than or equal to the original object. |
| // |
| // TODO: Currently, ulib/fs ignores OPEN_RIGHT_*, and uses the rights of the original |
| // connection. This is a bug. |
| func (p *NodeInterface) Clone(flags uint32, object NodeInterfaceRequest) error { |
| req_ := &nodeCloneRequest{ |
| Flags: flags, |
| Object: object, |
| } |
| err := ((*_bindings.ChannelProxy)(p)).Send(NodeCloneOrdinal, req_) |
| return err |
| } |
| |
| // Terminates connection with object. |
| // |
| // This method does not require any rights. |
| func (p *NodeInterface) Close() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &nodeCloseResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(NodeCloseOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Returns extra information about the type of the object. |
| // If the |Describe| operation fails, the connection is closed. |
| // |
| // This method does not require any rights. |
| func (p *NodeInterface) Describe() (NodeInfo, error) { |
| var req_ _bindings.Payload |
| resp_ := &nodeDescribeResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(NodeDescribeOrdinal, req_, resp_) |
| return resp_.Info, err |
| } |
| |
| // An event produced eagerly by a FIDL server if requested by |OPEN_FLAG_DESCRIBE|. |
| // |
| // Indicates the success or failure of the open operation, and optionally describes the |
| // object. If the status is |ZX_OK|, |info| contains descriptive information about the object |
| // (the same as would be returned by |Describe|). |
| func (p *NodeInterface) ExpectOnOpen() (int32, *NodeInfo, error) { |
| resp_ := &nodeOnOpenResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Recv(NodeOnOpenOrdinal, resp_) |
| return resp_.S, resp_.Info, err |
| } |
| |
| // Synchronizes updates to the node to the underlying media, if it exists. |
| func (p *NodeInterface) Sync() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &nodeSyncResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(NodeSyncOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Acquires information about the node. |
| // |
| // This method does not require any rights. |
| func (p *NodeInterface) GetAttr() (int32, NodeAttributes, error) { |
| var req_ _bindings.Payload |
| resp_ := &nodeGetAttrResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(NodeGetAttrOrdinal, req_, resp_) |
| return resp_.S, resp_.Attributes, err |
| } |
| |
| // Updates information about the node. |
| // |flags| may be any of NODE_ATTRIBUTE_FLAG_*. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| // TODO(ZX-1262): This access restriction is not implemented in ulib/fs. |
| func (p *NodeInterface) SetAttr(flags uint32, attributes NodeAttributes) (int32, error) { |
| req_ := &nodeSetAttrRequest{ |
| Flags: flags, |
| Attributes: attributes, |
| } |
| resp_ := &nodeSetAttrResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(NodeSetAttrOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Deprecated. Only for use with compatibility with devhost. |
| func (p *NodeInterface) Ioctl(opcode uint32, maxOut uint64, handles []_zx.Handle, in []uint8) (int32, []_zx.Handle, []uint8, error) { |
| req_ := &nodeIoctlRequest{ |
| Opcode: opcode, |
| MaxOut: maxOut, |
| Handles: handles, |
| In: in, |
| } |
| resp_ := &nodeIoctlResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(NodeIoctlOrdinal, req_, resp_) |
| return resp_.S, resp_.Handles, resp_.Out, err |
| } |
| |
| // Node defines the minimal interface for entities which can be accessed in a filesystem. |
| type Node interface { |
| // Create another connection to the same remote object. |
| // |
| // |flags| may be any of: |
| // - OPEN_RIGHT_* |
| // - OPEN_FLAG_APPEND |
| // - OPEN_FLAG_NO_REMOTE |
| // - OPEN_FLAG_DESCRIBE |
| // |
| // All other flags are ignored. |
| // |
| // The cloned object must have rights less than or equal to the original object. |
| // |
| // TODO: Currently, ulib/fs ignores OPEN_RIGHT_*, and uses the rights of the original |
| // connection. This is a bug. |
| Clone(flags uint32, object NodeInterfaceRequest) error |
| // Terminates connection with object. |
| // |
| // This method does not require any rights. |
| Close() (int32, error) |
| // Returns extra information about the type of the object. |
| // If the |Describe| operation fails, the connection is closed. |
| // |
| // This method does not require any rights. |
| Describe() (NodeInfo, error) |
| // An event produced eagerly by a FIDL server if requested by |OPEN_FLAG_DESCRIBE|. |
| // |
| // Indicates the success or failure of the open operation, and optionally describes the |
| // object. If the status is |ZX_OK|, |info| contains descriptive information about the object |
| // (the same as would be returned by |Describe|). |
| // Synchronizes updates to the node to the underlying media, if it exists. |
| Sync() (int32, error) |
| // Acquires information about the node. |
| // |
| // This method does not require any rights. |
| GetAttr() (int32, NodeAttributes, error) |
| // Updates information about the node. |
| // |flags| may be any of NODE_ATTRIBUTE_FLAG_*. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| // TODO(ZX-1262): This access restriction is not implemented in ulib/fs. |
| SetAttr(flags uint32, attributes NodeAttributes) (int32, error) |
| // Deprecated. Only for use with compatibility with devhost. |
| Ioctl(opcode uint32, maxOut uint64, handles []_zx.Handle, in []uint8) (int32, []_zx.Handle, []uint8, error) |
| } |
| |
| type NodeTransitionalBase struct{} |
| |
| type NodeInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewNodeInterfaceRequest() (NodeInterfaceRequest, *NodeInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return NodeInterfaceRequest(req), (*NodeInterface)(cli), err |
| } |
| |
| type NodeStub struct { |
| Impl Node |
| } |
| |
| func (s *NodeStub) Dispatch(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Payload, error) { |
| return s.DispatchNew(ord, b_, h_) |
| } |
| |
| func (s *NodeStub) DispatchNew(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Message, error) { |
| switch ord { |
| case NodeCloneOrdinal: |
| in_ := nodeCloneRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Clone(in_.Flags, in_.Object) |
| return nil, err_ |
| case NodeCloseOrdinal: |
| s, err_ := s.Impl.Close() |
| out_ := nodeCloseResponse{} |
| out_.S = s |
| return &out_, err_ |
| case NodeDescribeOrdinal: |
| info, err_ := s.Impl.Describe() |
| out_ := nodeDescribeResponse{} |
| out_.Info = info |
| return &out_, err_ |
| case NodeSyncOrdinal: |
| s, err_ := s.Impl.Sync() |
| out_ := nodeSyncResponse{} |
| out_.S = s |
| return &out_, err_ |
| case NodeGetAttrOrdinal: |
| s, attributes, err_ := s.Impl.GetAttr() |
| out_ := nodeGetAttrResponse{} |
| out_.S = s |
| out_.Attributes = attributes |
| return &out_, err_ |
| case NodeSetAttrOrdinal: |
| in_ := nodeSetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.SetAttr(in_.Flags, in_.Attributes) |
| out_ := nodeSetAttrResponse{} |
| out_.S = s |
| return &out_, err_ |
| case NodeIoctlOrdinal: |
| in_ := nodeIoctlRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, handles, out, err_ := s.Impl.Ioctl(in_.Opcode, in_.MaxOut, in_.Handles, in_.In) |
| out_ := nodeIoctlResponse{} |
| out_.S = s |
| out_.Handles = handles |
| out_.Out = out |
| return &out_, err_ |
| } |
| return nil, _bindings.ErrUnknownOrdinal |
| } |
| |
| type NodeService struct { |
| _bindings.BindingSet |
| } |
| |
| func (s *NodeService) Add(impl Node, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) { |
| return s.BindingSet.Add(&NodeStub{Impl: impl}, c, onError) |
| } |
| |
| func (s *NodeService) EventProxyFor(key _bindings.BindingKey) (*NodeEventProxy, bool) { |
| pxy, err := s.BindingSet.ProxyFor(key) |
| return (*NodeEventProxy)(pxy), err |
| } |
| |
| type NodeEventProxy _bindings.ChannelProxy |
| |
| func (p *NodeEventProxy) OnOpen(s int32, info *NodeInfo) error { |
| event_ := &nodeOnOpenResponse{ |
| S: s, |
| Info: info, |
| } |
| return ((*_bindings.ChannelProxy)(p)).Send(NodeOnOpenOrdinal, event_) |
| } |
| |
| const ( |
| FileCloneOrdinal uint32 = 402549324 |
| FileCloneGenOrdinal uint32 = 402549324 |
| FileCloseOrdinal uint32 = 1387878023 |
| FileCloseGenOrdinal uint32 = 1387878023 |
| FileDescribeOrdinal uint32 = 526573406 |
| FileDescribeGenOrdinal uint32 = 526573406 |
| FileOnOpenOrdinal uint32 = 1191225277 |
| FileOnOpenGenOrdinal uint32 = 1191225277 |
| FileSyncOrdinal uint32 = 1648508842 |
| FileSyncGenOrdinal uint32 = 1648508842 |
| FileGetAttrOrdinal uint32 = 1166403528 |
| FileGetAttrGenOrdinal uint32 = 1166403528 |
| FileSetAttrOrdinal uint32 = 198530458 |
| FileSetAttrGenOrdinal uint32 = 198530458 |
| FileIoctlOrdinal uint32 = 905161895 |
| FileIoctlGenOrdinal uint32 = 905161895 |
| FileReadOrdinal uint32 = 636961156 |
| FileReadGenOrdinal uint32 = 636961156 |
| FileReadAtOrdinal uint32 = 2087865796 |
| FileReadAtGenOrdinal uint32 = 2087865796 |
| FileWriteOrdinal uint32 = 85125024 |
| FileWriteGenOrdinal uint32 = 85125024 |
| FileWriteAtOrdinal uint32 = 1045766885 |
| FileWriteAtGenOrdinal uint32 = 1045766885 |
| FileSeekOrdinal uint32 = 2016048965 |
| FileSeekGenOrdinal uint32 = 2016048965 |
| FileTruncateOrdinal uint32 = 1118517818 |
| FileTruncateGenOrdinal uint32 = 1118517818 |
| FileGetFlagsOrdinal uint32 = 1679205366 |
| FileGetFlagsGenOrdinal uint32 = 1679205366 |
| FileSetFlagsOrdinal uint32 = 1059310710 |
| FileSetFlagsGenOrdinal uint32 = 1059310710 |
| FileGetBufferOrdinal uint32 = 1958938995 |
| FileGetBufferGenOrdinal uint32 = 1958938995 |
| ) |
| |
| type fileCloneRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| Flags uint32 |
| Object NodeInterfaceRequest `fidl2:"0"` |
| } |
| |
| var _mfileCloneRequest = _bindings.CreateLazyMarshaler(fileCloneRequest{}) |
| |
| func (msg *fileCloneRequest) Marshaler() _bindings.Marshaler { |
| return _mfileCloneRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileCloneRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileCloneRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type fileCloseResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mfileCloseResponse = _bindings.CreateLazyMarshaler(fileCloseResponse{}) |
| |
| func (msg *fileCloseResponse) Marshaler() _bindings.Marshaler { |
| return _mfileCloseResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileCloseResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileCloseResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type fileDescribeResponse struct { |
| _ struct{} `fidl2:"s,32,0"` |
| Info NodeInfo |
| } |
| |
| var _mfileDescribeResponse = _bindings.CreateLazyMarshaler(fileDescribeResponse{}) |
| |
| func (msg *fileDescribeResponse) Marshaler() _bindings.Marshaler { |
| return _mfileDescribeResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileDescribeResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileDescribeResponse) InlineSize() int { |
| return 32 |
| } |
| |
| type fileOnOpenResponse struct { |
| _ struct{} `fidl2:"s,16,0"` |
| S int32 |
| Info *NodeInfo |
| } |
| |
| var _mfileOnOpenResponse = _bindings.CreateLazyMarshaler(fileOnOpenResponse{}) |
| |
| func (msg *fileOnOpenResponse) Marshaler() _bindings.Marshaler { |
| return _mfileOnOpenResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileOnOpenResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileOnOpenResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type fileSyncResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mfileSyncResponse = _bindings.CreateLazyMarshaler(fileSyncResponse{}) |
| |
| func (msg *fileSyncResponse) Marshaler() _bindings.Marshaler { |
| return _mfileSyncResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileSyncResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileSyncResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type fileGetAttrResponse struct { |
| _ struct{} `fidl2:"s,64,0"` |
| S int32 |
| Attributes NodeAttributes |
| } |
| |
| var _mfileGetAttrResponse = _bindings.CreateLazyMarshaler(fileGetAttrResponse{}) |
| |
| func (msg *fileGetAttrResponse) Marshaler() _bindings.Marshaler { |
| return _mfileGetAttrResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileGetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileGetAttrResponse) InlineSize() int { |
| return 64 |
| } |
| |
| type fileSetAttrRequest struct { |
| _ struct{} `fidl2:"s,64,0"` |
| Flags uint32 |
| Attributes NodeAttributes |
| } |
| |
| var _mfileSetAttrRequest = _bindings.CreateLazyMarshaler(fileSetAttrRequest{}) |
| |
| func (msg *fileSetAttrRequest) Marshaler() _bindings.Marshaler { |
| return _mfileSetAttrRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileSetAttrRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileSetAttrRequest) InlineSize() int { |
| return 64 |
| } |
| |
| type fileSetAttrResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mfileSetAttrResponse = _bindings.CreateLazyMarshaler(fileSetAttrResponse{}) |
| |
| func (msg *fileSetAttrResponse) Marshaler() _bindings.Marshaler { |
| return _mfileSetAttrResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileSetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileSetAttrResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type fileIoctlRequest struct { |
| _ struct{} `fidl2:"s,48,0"` |
| Opcode uint32 |
| MaxOut uint64 |
| Handles []_zx.Handle `fidl:"2" fidl2:"2,0"` |
| In []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mfileIoctlRequest = _bindings.CreateLazyMarshaler(fileIoctlRequest{}) |
| |
| func (msg *fileIoctlRequest) Marshaler() _bindings.Marshaler { |
| return _mfileIoctlRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileIoctlRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileIoctlRequest) InlineSize() int { |
| return 48 |
| } |
| |
| type fileIoctlResponse struct { |
| _ struct{} `fidl2:"s,40,0"` |
| S int32 |
| Handles []_zx.Handle `fidl:"2" fidl2:"2,0"` |
| Out []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mfileIoctlResponse = _bindings.CreateLazyMarshaler(fileIoctlResponse{}) |
| |
| func (msg *fileIoctlResponse) Marshaler() _bindings.Marshaler { |
| return _mfileIoctlResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileIoctlResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileIoctlResponse) InlineSize() int { |
| return 40 |
| } |
| |
| type fileReadRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| Count uint64 |
| } |
| |
| var _mfileReadRequest = _bindings.CreateLazyMarshaler(fileReadRequest{}) |
| |
| func (msg *fileReadRequest) Marshaler() _bindings.Marshaler { |
| return _mfileReadRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileReadRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileReadRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type fileReadResponse struct { |
| _ struct{} `fidl2:"s,24,0"` |
| S int32 |
| Data []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mfileReadResponse = _bindings.CreateLazyMarshaler(fileReadResponse{}) |
| |
| func (msg *fileReadResponse) Marshaler() _bindings.Marshaler { |
| return _mfileReadResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileReadResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileReadResponse) InlineSize() int { |
| return 24 |
| } |
| |
| type fileReadAtRequest struct { |
| _ struct{} `fidl2:"s,16,0"` |
| Count uint64 |
| Offset uint64 |
| } |
| |
| var _mfileReadAtRequest = _bindings.CreateLazyMarshaler(fileReadAtRequest{}) |
| |
| func (msg *fileReadAtRequest) Marshaler() _bindings.Marshaler { |
| return _mfileReadAtRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileReadAtRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileReadAtRequest) InlineSize() int { |
| return 16 |
| } |
| |
| type fileReadAtResponse struct { |
| _ struct{} `fidl2:"s,24,0"` |
| S int32 |
| Data []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mfileReadAtResponse = _bindings.CreateLazyMarshaler(fileReadAtResponse{}) |
| |
| func (msg *fileReadAtResponse) Marshaler() _bindings.Marshaler { |
| return _mfileReadAtResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileReadAtResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileReadAtResponse) InlineSize() int { |
| return 24 |
| } |
| |
| type fileWriteRequest struct { |
| _ struct{} `fidl2:"s,16,0"` |
| Data []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mfileWriteRequest = _bindings.CreateLazyMarshaler(fileWriteRequest{}) |
| |
| func (msg *fileWriteRequest) Marshaler() _bindings.Marshaler { |
| return _mfileWriteRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileWriteRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileWriteRequest) InlineSize() int { |
| return 16 |
| } |
| |
| type fileWriteResponse struct { |
| _ struct{} `fidl2:"s,16,0"` |
| S int32 |
| Actual uint64 |
| } |
| |
| var _mfileWriteResponse = _bindings.CreateLazyMarshaler(fileWriteResponse{}) |
| |
| func (msg *fileWriteResponse) Marshaler() _bindings.Marshaler { |
| return _mfileWriteResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileWriteResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileWriteResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type fileWriteAtRequest struct { |
| _ struct{} `fidl2:"s,24,0"` |
| Data []uint8 `fidl:"8192" fidl2:"8192"` |
| Offset uint64 |
| } |
| |
| var _mfileWriteAtRequest = _bindings.CreateLazyMarshaler(fileWriteAtRequest{}) |
| |
| func (msg *fileWriteAtRequest) Marshaler() _bindings.Marshaler { |
| return _mfileWriteAtRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileWriteAtRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileWriteAtRequest) InlineSize() int { |
| return 24 |
| } |
| |
| type fileWriteAtResponse struct { |
| _ struct{} `fidl2:"s,16,0"` |
| S int32 |
| Actual uint64 |
| } |
| |
| var _mfileWriteAtResponse = _bindings.CreateLazyMarshaler(fileWriteAtResponse{}) |
| |
| func (msg *fileWriteAtResponse) Marshaler() _bindings.Marshaler { |
| return _mfileWriteAtResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileWriteAtResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileWriteAtResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type fileSeekRequest struct { |
| _ struct{} `fidl2:"s,16,0"` |
| Offset int64 |
| Start SeekOrigin |
| } |
| |
| var _mfileSeekRequest = _bindings.CreateLazyMarshaler(fileSeekRequest{}) |
| |
| func (msg *fileSeekRequest) Marshaler() _bindings.Marshaler { |
| return _mfileSeekRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileSeekRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileSeekRequest) InlineSize() int { |
| return 16 |
| } |
| |
| type fileSeekResponse struct { |
| _ struct{} `fidl2:"s,16,0"` |
| S int32 |
| Offset uint64 |
| } |
| |
| var _mfileSeekResponse = _bindings.CreateLazyMarshaler(fileSeekResponse{}) |
| |
| func (msg *fileSeekResponse) Marshaler() _bindings.Marshaler { |
| return _mfileSeekResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileSeekResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileSeekResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type fileTruncateRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| Length uint64 |
| } |
| |
| var _mfileTruncateRequest = _bindings.CreateLazyMarshaler(fileTruncateRequest{}) |
| |
| func (msg *fileTruncateRequest) Marshaler() _bindings.Marshaler { |
| return _mfileTruncateRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileTruncateRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileTruncateRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type fileTruncateResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mfileTruncateResponse = _bindings.CreateLazyMarshaler(fileTruncateResponse{}) |
| |
| func (msg *fileTruncateResponse) Marshaler() _bindings.Marshaler { |
| return _mfileTruncateResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileTruncateResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileTruncateResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type fileGetFlagsResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| Flags uint32 |
| } |
| |
| var _mfileGetFlagsResponse = _bindings.CreateLazyMarshaler(fileGetFlagsResponse{}) |
| |
| func (msg *fileGetFlagsResponse) Marshaler() _bindings.Marshaler { |
| return _mfileGetFlagsResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileGetFlagsResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileGetFlagsResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type fileSetFlagsRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| Flags uint32 |
| } |
| |
| var _mfileSetFlagsRequest = _bindings.CreateLazyMarshaler(fileSetFlagsRequest{}) |
| |
| func (msg *fileSetFlagsRequest) Marshaler() _bindings.Marshaler { |
| return _mfileSetFlagsRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileSetFlagsRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileSetFlagsRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type fileSetFlagsResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mfileSetFlagsResponse = _bindings.CreateLazyMarshaler(fileSetFlagsResponse{}) |
| |
| func (msg *fileSetFlagsResponse) Marshaler() _bindings.Marshaler { |
| return _mfileSetFlagsResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileSetFlagsResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileSetFlagsResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type fileGetBufferRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| Flags uint32 |
| } |
| |
| var _mfileGetBufferRequest = _bindings.CreateLazyMarshaler(fileGetBufferRequest{}) |
| |
| func (msg *fileGetBufferRequest) Marshaler() _bindings.Marshaler { |
| return _mfileGetBufferRequest |
| } |
| |
| // Implements Payload. |
| func (_ *fileGetBufferRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileGetBufferRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type fileGetBufferResponse struct { |
| _ struct{} `fidl2:"s,16,0"` |
| S int32 |
| Buffer *fuchsiamem.Buffer |
| } |
| |
| var _mfileGetBufferResponse = _bindings.CreateLazyMarshaler(fileGetBufferResponse{}) |
| |
| func (msg *fileGetBufferResponse) Marshaler() _bindings.Marshaler { |
| return _mfileGetBufferResponse |
| } |
| |
| // Implements Payload. |
| func (_ *fileGetBufferResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *fileGetBufferResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type FileInterface _bindings.ChannelProxy |
| |
| // Create another connection to the same remote object. |
| // |
| // |flags| may be any of: |
| // - OPEN_RIGHT_* |
| // - OPEN_FLAG_APPEND |
| // - OPEN_FLAG_NO_REMOTE |
| // - OPEN_FLAG_DESCRIBE |
| // |
| // All other flags are ignored. |
| // |
| // The cloned object must have rights less than or equal to the original object. |
| // |
| // TODO: Currently, ulib/fs ignores OPEN_RIGHT_*, and uses the rights of the original |
| // connection. This is a bug. |
| func (p *FileInterface) Clone(flags uint32, object NodeInterfaceRequest) error { |
| req_ := &fileCloneRequest{ |
| Flags: flags, |
| Object: object, |
| } |
| err := ((*_bindings.ChannelProxy)(p)).Send(FileCloneOrdinal, req_) |
| return err |
| } |
| |
| // Terminates connection with object. |
| // |
| // This method does not require any rights. |
| func (p *FileInterface) Close() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &fileCloseResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileCloseOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Returns extra information about the type of the object. |
| // If the |Describe| operation fails, the connection is closed. |
| // |
| // This method does not require any rights. |
| func (p *FileInterface) Describe() (NodeInfo, error) { |
| var req_ _bindings.Payload |
| resp_ := &fileDescribeResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileDescribeOrdinal, req_, resp_) |
| return resp_.Info, err |
| } |
| |
| // An event produced eagerly by a FIDL server if requested by |OPEN_FLAG_DESCRIBE|. |
| // |
| // Indicates the success or failure of the open operation, and optionally describes the |
| // object. If the status is |ZX_OK|, |info| contains descriptive information about the object |
| // (the same as would be returned by |Describe|). |
| func (p *FileInterface) ExpectOnOpen() (int32, *NodeInfo, error) { |
| resp_ := &fileOnOpenResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Recv(FileOnOpenOrdinal, resp_) |
| return resp_.S, resp_.Info, err |
| } |
| |
| // Synchronizes updates to the node to the underlying media, if it exists. |
| func (p *FileInterface) Sync() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &fileSyncResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileSyncOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Acquires information about the node. |
| // |
| // This method does not require any rights. |
| func (p *FileInterface) GetAttr() (int32, NodeAttributes, error) { |
| var req_ _bindings.Payload |
| resp_ := &fileGetAttrResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileGetAttrOrdinal, req_, resp_) |
| return resp_.S, resp_.Attributes, err |
| } |
| |
| // Updates information about the node. |
| // |flags| may be any of NODE_ATTRIBUTE_FLAG_*. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| // TODO(ZX-1262): This access restriction is not implemented in ulib/fs. |
| func (p *FileInterface) SetAttr(flags uint32, attributes NodeAttributes) (int32, error) { |
| req_ := &fileSetAttrRequest{ |
| Flags: flags, |
| Attributes: attributes, |
| } |
| resp_ := &fileSetAttrResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileSetAttrOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Deprecated. Only for use with compatibility with devhost. |
| func (p *FileInterface) Ioctl(opcode uint32, maxOut uint64, handles []_zx.Handle, in []uint8) (int32, []_zx.Handle, []uint8, error) { |
| req_ := &fileIoctlRequest{ |
| Opcode: opcode, |
| MaxOut: maxOut, |
| Handles: handles, |
| In: in, |
| } |
| resp_ := &fileIoctlResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileIoctlOrdinal, req_, resp_) |
| return resp_.S, resp_.Handles, resp_.Out, err |
| } |
| |
| // Reads 'count' bytes at the seek offset. |
| // The seek offset is moved forward by the number of bytes read. |
| // |
| // This method requires following rights: OPEN_RIGHT_READABLE. |
| func (p *FileInterface) Read(count uint64) (int32, []uint8, error) { |
| req_ := &fileReadRequest{ |
| Count: count, |
| } |
| resp_ := &fileReadResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileReadOrdinal, req_, resp_) |
| return resp_.S, resp_.Data, err |
| } |
| |
| // Reads 'count' bytes at the provided offset. |
| // Does not affect the seek offset. |
| // |
| // This method requires following rights: OPEN_RIGHT_READABLE. |
| func (p *FileInterface) ReadAt(count uint64, offset uint64) (int32, []uint8, error) { |
| req_ := &fileReadAtRequest{ |
| Count: count, |
| Offset: offset, |
| } |
| resp_ := &fileReadAtResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileReadAtOrdinal, req_, resp_) |
| return resp_.S, resp_.Data, err |
| } |
| |
| // Writes data at the seek offset. |
| // The seek offset is moved forward by the number of bytes written. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| func (p *FileInterface) Write(data []uint8) (int32, uint64, error) { |
| req_ := &fileWriteRequest{ |
| Data: data, |
| } |
| resp_ := &fileWriteResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileWriteOrdinal, req_, resp_) |
| return resp_.S, resp_.Actual, err |
| } |
| |
| // Writes data to the provided offset. |
| // Does not affect the seek offset. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| func (p *FileInterface) WriteAt(data []uint8, offset uint64) (int32, uint64, error) { |
| req_ := &fileWriteAtRequest{ |
| Data: data, |
| Offset: offset, |
| } |
| resp_ := &fileWriteAtResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileWriteAtOrdinal, req_, resp_) |
| return resp_.S, resp_.Actual, err |
| } |
| |
| // Moves the offset at which the next invocation of |Read()| or |Write()| will |
| // occur. |
| // |
| // This method does not require any rights. |
| func (p *FileInterface) Seek(offset int64, start SeekOrigin) (int32, uint64, error) { |
| req_ := &fileSeekRequest{ |
| Offset: offset, |
| Start: start, |
| } |
| resp_ := &fileSeekResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileSeekOrdinal, req_, resp_) |
| return resp_.S, resp_.Offset, err |
| } |
| |
| // Shrinks the file size to 'length' bytes. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| func (p *FileInterface) Truncate(length uint64) (int32, error) { |
| req_ := &fileTruncateRequest{ |
| Length: length, |
| } |
| resp_ := &fileTruncateResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileTruncateOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Acquires the Directory::Open rights and flags used to access this file. |
| // |
| // This method does not require any rights. |
| func (p *FileInterface) GetFlags() (int32, uint32, error) { |
| var req_ _bindings.Payload |
| resp_ := &fileGetFlagsResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileGetFlagsOrdinal, req_, resp_) |
| return resp_.S, resp_.Flags, err |
| } |
| |
| // Changes the Directory::Open flags used to access the file. |
| // Supported flags which can be turned on / off: |
| // - OPEN_FLAG_APPEND |
| // |
| // This method does not require any rights. |
| func (p *FileInterface) SetFlags(flags uint32) (int32, error) { |
| req_ := &fileSetFlagsRequest{ |
| Flags: flags, |
| } |
| resp_ := &fileSetFlagsResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileSetFlagsOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Acquires a buffer representing this file, if there is one, with the |
| // requested access rights. |
| // |
| // |flags| may be any of VMO_FLAG_*. |
| // |
| // This method requires following rights: |
| // - OPEN_RIGHT_WRITABLE if |flags| includes VMO_FLAG_WRITE. |
| // - OPEN_RIGHT_READABLE if |flags| includes VMO_FLAG_READ or VMO_FLAG_EXEC. |
| func (p *FileInterface) GetBuffer(flags uint32) (int32, *fuchsiamem.Buffer, error) { |
| req_ := &fileGetBufferRequest{ |
| Flags: flags, |
| } |
| resp_ := &fileGetBufferResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(FileGetBufferOrdinal, req_, resp_) |
| return resp_.S, resp_.Buffer, err |
| } |
| |
| // File defines the interface of a node which contains a flat layout of data. |
| type File interface { |
| // Create another connection to the same remote object. |
| // |
| // |flags| may be any of: |
| // - OPEN_RIGHT_* |
| // - OPEN_FLAG_APPEND |
| // - OPEN_FLAG_NO_REMOTE |
| // - OPEN_FLAG_DESCRIBE |
| // |
| // All other flags are ignored. |
| // |
| // The cloned object must have rights less than or equal to the original object. |
| // |
| // TODO: Currently, ulib/fs ignores OPEN_RIGHT_*, and uses the rights of the original |
| // connection. This is a bug. |
| Clone(flags uint32, object NodeInterfaceRequest) error |
| // Terminates connection with object. |
| // |
| // This method does not require any rights. |
| Close() (int32, error) |
| // Returns extra information about the type of the object. |
| // If the |Describe| operation fails, the connection is closed. |
| // |
| // This method does not require any rights. |
| Describe() (NodeInfo, error) |
| // An event produced eagerly by a FIDL server if requested by |OPEN_FLAG_DESCRIBE|. |
| // |
| // Indicates the success or failure of the open operation, and optionally describes the |
| // object. If the status is |ZX_OK|, |info| contains descriptive information about the object |
| // (the same as would be returned by |Describe|). |
| // Synchronizes updates to the node to the underlying media, if it exists. |
| Sync() (int32, error) |
| // Acquires information about the node. |
| // |
| // This method does not require any rights. |
| GetAttr() (int32, NodeAttributes, error) |
| // Updates information about the node. |
| // |flags| may be any of NODE_ATTRIBUTE_FLAG_*. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| // TODO(ZX-1262): This access restriction is not implemented in ulib/fs. |
| SetAttr(flags uint32, attributes NodeAttributes) (int32, error) |
| // Deprecated. Only for use with compatibility with devhost. |
| Ioctl(opcode uint32, maxOut uint64, handles []_zx.Handle, in []uint8) (int32, []_zx.Handle, []uint8, error) |
| // Reads 'count' bytes at the seek offset. |
| // The seek offset is moved forward by the number of bytes read. |
| // |
| // This method requires following rights: OPEN_RIGHT_READABLE. |
| Read(count uint64) (int32, []uint8, error) |
| // Reads 'count' bytes at the provided offset. |
| // Does not affect the seek offset. |
| // |
| // This method requires following rights: OPEN_RIGHT_READABLE. |
| ReadAt(count uint64, offset uint64) (int32, []uint8, error) |
| // Writes data at the seek offset. |
| // The seek offset is moved forward by the number of bytes written. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| Write(data []uint8) (int32, uint64, error) |
| // Writes data to the provided offset. |
| // Does not affect the seek offset. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| WriteAt(data []uint8, offset uint64) (int32, uint64, error) |
| // Moves the offset at which the next invocation of |Read()| or |Write()| will |
| // occur. |
| // |
| // This method does not require any rights. |
| Seek(offset int64, start SeekOrigin) (int32, uint64, error) |
| // Shrinks the file size to 'length' bytes. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| Truncate(length uint64) (int32, error) |
| // Acquires the Directory::Open rights and flags used to access this file. |
| // |
| // This method does not require any rights. |
| GetFlags() (int32, uint32, error) |
| // Changes the Directory::Open flags used to access the file. |
| // Supported flags which can be turned on / off: |
| // - OPEN_FLAG_APPEND |
| // |
| // This method does not require any rights. |
| SetFlags(flags uint32) (int32, error) |
| // Acquires a buffer representing this file, if there is one, with the |
| // requested access rights. |
| // |
| // |flags| may be any of VMO_FLAG_*. |
| // |
| // This method requires following rights: |
| // - OPEN_RIGHT_WRITABLE if |flags| includes VMO_FLAG_WRITE. |
| // - OPEN_RIGHT_READABLE if |flags| includes VMO_FLAG_READ or VMO_FLAG_EXEC. |
| GetBuffer(flags uint32) (int32, *fuchsiamem.Buffer, error) |
| } |
| |
| type FileTransitionalBase struct{} |
| |
| type FileInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewFileInterfaceRequest() (FileInterfaceRequest, *FileInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return FileInterfaceRequest(req), (*FileInterface)(cli), err |
| } |
| |
| type FileStub struct { |
| Impl File |
| } |
| |
| func (s *FileStub) Dispatch(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Payload, error) { |
| return s.DispatchNew(ord, b_, h_) |
| } |
| |
| func (s *FileStub) DispatchNew(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Message, error) { |
| switch ord { |
| case FileCloneOrdinal: |
| in_ := fileCloneRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Clone(in_.Flags, in_.Object) |
| return nil, err_ |
| case FileCloseOrdinal: |
| s, err_ := s.Impl.Close() |
| out_ := fileCloseResponse{} |
| out_.S = s |
| return &out_, err_ |
| case FileDescribeOrdinal: |
| info, err_ := s.Impl.Describe() |
| out_ := fileDescribeResponse{} |
| out_.Info = info |
| return &out_, err_ |
| case FileSyncOrdinal: |
| s, err_ := s.Impl.Sync() |
| out_ := fileSyncResponse{} |
| out_.S = s |
| return &out_, err_ |
| case FileGetAttrOrdinal: |
| s, attributes, err_ := s.Impl.GetAttr() |
| out_ := fileGetAttrResponse{} |
| out_.S = s |
| out_.Attributes = attributes |
| return &out_, err_ |
| case FileSetAttrOrdinal: |
| in_ := fileSetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.SetAttr(in_.Flags, in_.Attributes) |
| out_ := fileSetAttrResponse{} |
| out_.S = s |
| return &out_, err_ |
| case FileIoctlOrdinal: |
| in_ := fileIoctlRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, handles, out, err_ := s.Impl.Ioctl(in_.Opcode, in_.MaxOut, in_.Handles, in_.In) |
| out_ := fileIoctlResponse{} |
| out_.S = s |
| out_.Handles = handles |
| out_.Out = out |
| return &out_, err_ |
| case FileReadOrdinal: |
| in_ := fileReadRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, data, err_ := s.Impl.Read(in_.Count) |
| out_ := fileReadResponse{} |
| out_.S = s |
| out_.Data = data |
| return &out_, err_ |
| case FileReadAtOrdinal: |
| in_ := fileReadAtRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, data, err_ := s.Impl.ReadAt(in_.Count, in_.Offset) |
| out_ := fileReadAtResponse{} |
| out_.S = s |
| out_.Data = data |
| return &out_, err_ |
| case FileWriteOrdinal: |
| in_ := fileWriteRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, actual, err_ := s.Impl.Write(in_.Data) |
| out_ := fileWriteResponse{} |
| out_.S = s |
| out_.Actual = actual |
| return &out_, err_ |
| case FileWriteAtOrdinal: |
| in_ := fileWriteAtRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, actual, err_ := s.Impl.WriteAt(in_.Data, in_.Offset) |
| out_ := fileWriteAtResponse{} |
| out_.S = s |
| out_.Actual = actual |
| return &out_, err_ |
| case FileSeekOrdinal: |
| in_ := fileSeekRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, offset, err_ := s.Impl.Seek(in_.Offset, in_.Start) |
| out_ := fileSeekResponse{} |
| out_.S = s |
| out_.Offset = offset |
| return &out_, err_ |
| case FileTruncateOrdinal: |
| in_ := fileTruncateRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Truncate(in_.Length) |
| out_ := fileTruncateResponse{} |
| out_.S = s |
| return &out_, err_ |
| case FileGetFlagsOrdinal: |
| s, flags, err_ := s.Impl.GetFlags() |
| out_ := fileGetFlagsResponse{} |
| out_.S = s |
| out_.Flags = flags |
| return &out_, err_ |
| case FileSetFlagsOrdinal: |
| in_ := fileSetFlagsRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.SetFlags(in_.Flags) |
| out_ := fileSetFlagsResponse{} |
| out_.S = s |
| return &out_, err_ |
| case FileGetBufferOrdinal: |
| in_ := fileGetBufferRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, buffer, err_ := s.Impl.GetBuffer(in_.Flags) |
| out_ := fileGetBufferResponse{} |
| out_.S = s |
| out_.Buffer = buffer |
| return &out_, err_ |
| } |
| return nil, _bindings.ErrUnknownOrdinal |
| } |
| |
| type FileService struct { |
| _bindings.BindingSet |
| } |
| |
| func (s *FileService) Add(impl File, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) { |
| return s.BindingSet.Add(&FileStub{Impl: impl}, c, onError) |
| } |
| |
| func (s *FileService) EventProxyFor(key _bindings.BindingKey) (*FileEventProxy, bool) { |
| pxy, err := s.BindingSet.ProxyFor(key) |
| return (*FileEventProxy)(pxy), err |
| } |
| |
| type FileEventProxy _bindings.ChannelProxy |
| |
| func (p *FileEventProxy) OnOpen(s int32, info *NodeInfo) error { |
| event_ := &fileOnOpenResponse{ |
| S: s, |
| Info: info, |
| } |
| return ((*_bindings.ChannelProxy)(p)).Send(FileOnOpenOrdinal, event_) |
| } |
| |
| const ( |
| DirectoryWatcherOnEventOrdinal uint32 = 546032797 |
| DirectoryWatcherOnEventGenOrdinal uint32 = 546032797 |
| ) |
| |
| type directoryWatcherOnEventRequest struct { |
| _ struct{} `fidl2:"s,16,0"` |
| Events []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mdirectoryWatcherOnEventRequest = _bindings.CreateLazyMarshaler(directoryWatcherOnEventRequest{}) |
| |
| func (msg *directoryWatcherOnEventRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryWatcherOnEventRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryWatcherOnEventRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryWatcherOnEventRequest) InlineSize() int { |
| return 16 |
| } |
| |
| type DirectoryWatcherInterface _bindings.ChannelProxy |
| |
| // TODO(smklein): Convert this to a vector of WatchedEvents, when possible. |
| func (p *DirectoryWatcherInterface) OnEvent(events []uint8) error { |
| req_ := &directoryWatcherOnEventRequest{ |
| Events: events, |
| } |
| err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryWatcherOnEventOrdinal, req_) |
| return err |
| } |
| |
| // TODO(ZX-2645): Unused. |
| // |
| // DirectoryWatcher transmits messages from a filesystem server |
| // about events happening in the filesystem. Clients can register |
| // new watchers using the Directory "Watch" method, where they can |
| // filter which events they want to receive notifications for. |
| type DirectoryWatcher interface { |
| // TODO(smklein): Convert this to a vector of WatchedEvents, when possible. |
| OnEvent(events []uint8) error |
| } |
| |
| type DirectoryWatcherTransitionalBase struct{} |
| |
| type DirectoryWatcherInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewDirectoryWatcherInterfaceRequest() (DirectoryWatcherInterfaceRequest, *DirectoryWatcherInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return DirectoryWatcherInterfaceRequest(req), (*DirectoryWatcherInterface)(cli), err |
| } |
| |
| type DirectoryWatcherStub struct { |
| Impl DirectoryWatcher |
| } |
| |
| func (s *DirectoryWatcherStub) Dispatch(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Payload, error) { |
| return s.DispatchNew(ord, b_, h_) |
| } |
| |
| func (s *DirectoryWatcherStub) DispatchNew(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Message, error) { |
| switch ord { |
| case DirectoryWatcherOnEventOrdinal: |
| in_ := directoryWatcherOnEventRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.OnEvent(in_.Events) |
| return nil, err_ |
| } |
| return nil, _bindings.ErrUnknownOrdinal |
| } |
| |
| type DirectoryWatcherService struct { |
| _bindings.BindingSet |
| } |
| |
| func (s *DirectoryWatcherService) Add(impl DirectoryWatcher, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) { |
| return s.BindingSet.Add(&DirectoryWatcherStub{Impl: impl}, c, onError) |
| } |
| |
| func (s *DirectoryWatcherService) EventProxyFor(key _bindings.BindingKey) (*DirectoryWatcherEventProxy, bool) { |
| pxy, err := s.BindingSet.ProxyFor(key) |
| return (*DirectoryWatcherEventProxy)(pxy), err |
| } |
| |
| type DirectoryWatcherEventProxy _bindings.ChannelProxy |
| |
| const ( |
| DirectoryCloneOrdinal uint32 = 402549324 |
| DirectoryCloneGenOrdinal uint32 = 402549324 |
| DirectoryCloseOrdinal uint32 = 1387878023 |
| DirectoryCloseGenOrdinal uint32 = 1387878023 |
| DirectoryDescribeOrdinal uint32 = 526573406 |
| DirectoryDescribeGenOrdinal uint32 = 526573406 |
| DirectoryOnOpenOrdinal uint32 = 1191225277 |
| DirectoryOnOpenGenOrdinal uint32 = 1191225277 |
| DirectorySyncOrdinal uint32 = 1648508842 |
| DirectorySyncGenOrdinal uint32 = 1648508842 |
| DirectoryGetAttrOrdinal uint32 = 1166403528 |
| DirectoryGetAttrGenOrdinal uint32 = 1166403528 |
| DirectorySetAttrOrdinal uint32 = 198530458 |
| DirectorySetAttrGenOrdinal uint32 = 198530458 |
| DirectoryIoctlOrdinal uint32 = 905161895 |
| DirectoryIoctlGenOrdinal uint32 = 905161895 |
| DirectoryOpenOrdinal uint32 = 2011483371 |
| DirectoryOpenGenOrdinal uint32 = 2011483371 |
| DirectoryUnlinkOrdinal uint32 = 750443289 |
| DirectoryUnlinkGenOrdinal uint32 = 750443289 |
| DirectoryReadDirentsOrdinal uint32 = 782580781 |
| DirectoryReadDirentsGenOrdinal uint32 = 782580781 |
| DirectoryRewindOrdinal uint32 = 1886584199 |
| DirectoryRewindGenOrdinal uint32 = 1886584199 |
| DirectoryGetTokenOrdinal uint32 = 840416493 |
| DirectoryGetTokenGenOrdinal uint32 = 840416493 |
| DirectoryRenameOrdinal uint32 = 1251258540 |
| DirectoryRenameGenOrdinal uint32 = 1251258540 |
| DirectoryLinkOrdinal uint32 = 462052964 |
| DirectoryLinkGenOrdinal uint32 = 462052964 |
| DirectoryWatchOrdinal uint32 = 1522700084 |
| DirectoryWatchGenOrdinal uint32 = 1522700084 |
| ) |
| |
| type directoryCloneRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| Flags uint32 |
| Object NodeInterfaceRequest `fidl2:"0"` |
| } |
| |
| var _mdirectoryCloneRequest = _bindings.CreateLazyMarshaler(directoryCloneRequest{}) |
| |
| func (msg *directoryCloneRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryCloneRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryCloneRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryCloneRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryCloseResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryCloseResponse = _bindings.CreateLazyMarshaler(directoryCloseResponse{}) |
| |
| func (msg *directoryCloseResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryCloseResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryCloseResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryCloseResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryDescribeResponse struct { |
| _ struct{} `fidl2:"s,32,0"` |
| Info NodeInfo |
| } |
| |
| var _mdirectoryDescribeResponse = _bindings.CreateLazyMarshaler(directoryDescribeResponse{}) |
| |
| func (msg *directoryDescribeResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryDescribeResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryDescribeResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryDescribeResponse) InlineSize() int { |
| return 32 |
| } |
| |
| type directoryOnOpenResponse struct { |
| _ struct{} `fidl2:"s,16,0"` |
| S int32 |
| Info *NodeInfo |
| } |
| |
| var _mdirectoryOnOpenResponse = _bindings.CreateLazyMarshaler(directoryOnOpenResponse{}) |
| |
| func (msg *directoryOnOpenResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryOnOpenResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryOnOpenResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryOnOpenResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type directorySyncResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectorySyncResponse = _bindings.CreateLazyMarshaler(directorySyncResponse{}) |
| |
| func (msg *directorySyncResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectorySyncResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directorySyncResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directorySyncResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryGetAttrResponse struct { |
| _ struct{} `fidl2:"s,64,0"` |
| S int32 |
| Attributes NodeAttributes |
| } |
| |
| var _mdirectoryGetAttrResponse = _bindings.CreateLazyMarshaler(directoryGetAttrResponse{}) |
| |
| func (msg *directoryGetAttrResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryGetAttrResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryGetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryGetAttrResponse) InlineSize() int { |
| return 64 |
| } |
| |
| type directorySetAttrRequest struct { |
| _ struct{} `fidl2:"s,64,0"` |
| Flags uint32 |
| Attributes NodeAttributes |
| } |
| |
| var _mdirectorySetAttrRequest = _bindings.CreateLazyMarshaler(directorySetAttrRequest{}) |
| |
| func (msg *directorySetAttrRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectorySetAttrRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directorySetAttrRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directorySetAttrRequest) InlineSize() int { |
| return 64 |
| } |
| |
| type directorySetAttrResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectorySetAttrResponse = _bindings.CreateLazyMarshaler(directorySetAttrResponse{}) |
| |
| func (msg *directorySetAttrResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectorySetAttrResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directorySetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directorySetAttrResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryIoctlRequest struct { |
| _ struct{} `fidl2:"s,48,0"` |
| Opcode uint32 |
| MaxOut uint64 |
| Handles []_zx.Handle `fidl:"2" fidl2:"2,0"` |
| In []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mdirectoryIoctlRequest = _bindings.CreateLazyMarshaler(directoryIoctlRequest{}) |
| |
| func (msg *directoryIoctlRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryIoctlRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryIoctlRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryIoctlRequest) InlineSize() int { |
| return 48 |
| } |
| |
| type directoryIoctlResponse struct { |
| _ struct{} `fidl2:"s,40,0"` |
| S int32 |
| Handles []_zx.Handle `fidl:"2" fidl2:"2,0"` |
| Out []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mdirectoryIoctlResponse = _bindings.CreateLazyMarshaler(directoryIoctlResponse{}) |
| |
| func (msg *directoryIoctlResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryIoctlResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryIoctlResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryIoctlResponse) InlineSize() int { |
| return 40 |
| } |
| |
| type directoryOpenRequest struct { |
| _ struct{} `fidl2:"s,32,0"` |
| Flags uint32 |
| Mode uint32 |
| Path string `fidl:"4096" fidl2:"4096"` |
| Object NodeInterfaceRequest `fidl2:"0"` |
| } |
| |
| var _mdirectoryOpenRequest = _bindings.CreateLazyMarshaler(directoryOpenRequest{}) |
| |
| func (msg *directoryOpenRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryOpenRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryOpenRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryOpenRequest) InlineSize() int { |
| return 32 |
| } |
| |
| type directoryUnlinkRequest struct { |
| _ struct{} `fidl2:"s,16,0"` |
| Path string `fidl:"4096" fidl2:"4096"` |
| } |
| |
| var _mdirectoryUnlinkRequest = _bindings.CreateLazyMarshaler(directoryUnlinkRequest{}) |
| |
| func (msg *directoryUnlinkRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryUnlinkRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryUnlinkRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryUnlinkRequest) InlineSize() int { |
| return 16 |
| } |
| |
| type directoryUnlinkResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryUnlinkResponse = _bindings.CreateLazyMarshaler(directoryUnlinkResponse{}) |
| |
| func (msg *directoryUnlinkResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryUnlinkResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryUnlinkResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryUnlinkResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryReadDirentsRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| MaxBytes uint64 |
| } |
| |
| var _mdirectoryReadDirentsRequest = _bindings.CreateLazyMarshaler(directoryReadDirentsRequest{}) |
| |
| func (msg *directoryReadDirentsRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryReadDirentsRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryReadDirentsRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryReadDirentsRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryReadDirentsResponse struct { |
| _ struct{} `fidl2:"s,24,0"` |
| S int32 |
| Dirents []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mdirectoryReadDirentsResponse = _bindings.CreateLazyMarshaler(directoryReadDirentsResponse{}) |
| |
| func (msg *directoryReadDirentsResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryReadDirentsResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryReadDirentsResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryReadDirentsResponse) InlineSize() int { |
| return 24 |
| } |
| |
| type directoryRewindResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryRewindResponse = _bindings.CreateLazyMarshaler(directoryRewindResponse{}) |
| |
| func (msg *directoryRewindResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryRewindResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryRewindResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryRewindResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryGetTokenResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| Token _zx.Handle `fidl:"*" fidl2:"1"` |
| } |
| |
| var _mdirectoryGetTokenResponse = _bindings.CreateLazyMarshaler(directoryGetTokenResponse{}) |
| |
| func (msg *directoryGetTokenResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryGetTokenResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryGetTokenResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryGetTokenResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryRenameRequest struct { |
| _ struct{} `fidl2:"s,40,0"` |
| Src string `fidl:"4096" fidl2:"4096"` |
| DstParentToken _zx.Handle `fidl2:"0"` |
| Dst string `fidl:"4096" fidl2:"4096"` |
| } |
| |
| var _mdirectoryRenameRequest = _bindings.CreateLazyMarshaler(directoryRenameRequest{}) |
| |
| func (msg *directoryRenameRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryRenameRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryRenameRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryRenameRequest) InlineSize() int { |
| return 40 |
| } |
| |
| type directoryRenameResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryRenameResponse = _bindings.CreateLazyMarshaler(directoryRenameResponse{}) |
| |
| func (msg *directoryRenameResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryRenameResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryRenameResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryRenameResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryLinkRequest struct { |
| _ struct{} `fidl2:"s,40,0"` |
| Src string `fidl:"4096" fidl2:"4096"` |
| DstParentToken _zx.Handle `fidl2:"0"` |
| Dst string `fidl:"4096" fidl2:"4096"` |
| } |
| |
| var _mdirectoryLinkRequest = _bindings.CreateLazyMarshaler(directoryLinkRequest{}) |
| |
| func (msg *directoryLinkRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryLinkRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryLinkRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryLinkRequest) InlineSize() int { |
| return 40 |
| } |
| |
| type directoryLinkResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryLinkResponse = _bindings.CreateLazyMarshaler(directoryLinkResponse{}) |
| |
| func (msg *directoryLinkResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryLinkResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryLinkResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryLinkResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryWatchRequest struct { |
| _ struct{} `fidl2:"s,16,0"` |
| Mask uint32 |
| Options uint32 |
| Watcher _zx.Channel `fidl2:"0"` |
| } |
| |
| var _mdirectoryWatchRequest = _bindings.CreateLazyMarshaler(directoryWatchRequest{}) |
| |
| func (msg *directoryWatchRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryWatchRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryWatchRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryWatchRequest) InlineSize() int { |
| return 16 |
| } |
| |
| type directoryWatchResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryWatchResponse = _bindings.CreateLazyMarshaler(directoryWatchResponse{}) |
| |
| func (msg *directoryWatchResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryWatchResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryWatchResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryWatchResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type DirectoryInterface _bindings.ChannelProxy |
| |
| // Create another connection to the same remote object. |
| // |
| // |flags| may be any of: |
| // - OPEN_RIGHT_* |
| // - OPEN_FLAG_APPEND |
| // - OPEN_FLAG_NO_REMOTE |
| // - OPEN_FLAG_DESCRIBE |
| // |
| // All other flags are ignored. |
| // |
| // The cloned object must have rights less than or equal to the original object. |
| // |
| // TODO: Currently, ulib/fs ignores OPEN_RIGHT_*, and uses the rights of the original |
| // connection. This is a bug. |
| func (p *DirectoryInterface) Clone(flags uint32, object NodeInterfaceRequest) error { |
| req_ := &directoryCloneRequest{ |
| Flags: flags, |
| Object: object, |
| } |
| err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryCloneOrdinal, req_) |
| return err |
| } |
| |
| // Terminates connection with object. |
| // |
| // This method does not require any rights. |
| func (p *DirectoryInterface) Close() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryCloseResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryCloseOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Returns extra information about the type of the object. |
| // If the |Describe| operation fails, the connection is closed. |
| // |
| // This method does not require any rights. |
| func (p *DirectoryInterface) Describe() (NodeInfo, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryDescribeResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryDescribeOrdinal, req_, resp_) |
| return resp_.Info, err |
| } |
| |
| // An event produced eagerly by a FIDL server if requested by |OPEN_FLAG_DESCRIBE|. |
| // |
| // Indicates the success or failure of the open operation, and optionally describes the |
| // object. If the status is |ZX_OK|, |info| contains descriptive information about the object |
| // (the same as would be returned by |Describe|). |
| func (p *DirectoryInterface) ExpectOnOpen() (int32, *NodeInfo, error) { |
| resp_ := &directoryOnOpenResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Recv(DirectoryOnOpenOrdinal, resp_) |
| return resp_.S, resp_.Info, err |
| } |
| |
| // Synchronizes updates to the node to the underlying media, if it exists. |
| func (p *DirectoryInterface) Sync() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &directorySyncResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectorySyncOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Acquires information about the node. |
| // |
| // This method does not require any rights. |
| func (p *DirectoryInterface) GetAttr() (int32, NodeAttributes, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryGetAttrResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetAttrOrdinal, req_, resp_) |
| return resp_.S, resp_.Attributes, err |
| } |
| |
| // Updates information about the node. |
| // |flags| may be any of NODE_ATTRIBUTE_FLAG_*. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| // TODO(ZX-1262): This access restriction is not implemented in ulib/fs. |
| func (p *DirectoryInterface) SetAttr(flags uint32, attributes NodeAttributes) (int32, error) { |
| req_ := &directorySetAttrRequest{ |
| Flags: flags, |
| Attributes: attributes, |
| } |
| resp_ := &directorySetAttrResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectorySetAttrOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Deprecated. Only for use with compatibility with devhost. |
| func (p *DirectoryInterface) Ioctl(opcode uint32, maxOut uint64, handles []_zx.Handle, in []uint8) (int32, []_zx.Handle, []uint8, error) { |
| req_ := &directoryIoctlRequest{ |
| Opcode: opcode, |
| MaxOut: maxOut, |
| Handles: handles, |
| In: in, |
| } |
| resp_ := &directoryIoctlResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryIoctlOrdinal, req_, resp_) |
| return resp_.S, resp_.Handles, resp_.Out, err |
| } |
| |
| // Opens a new object relative to this directory object. |
| // |
| // Flags may be any of the OPEN_FLAG_* and OPEN_RIGHT_* values, bitwise ORed together. |
| // The OPEN_FLAG_DESCRIBE flag may cause an |OnOpen| event to be transmitted |
| // on the |object| handle, indicating the type of object opened. |
| // |
| // If an unknown value is sent for either flags or mode, the connection should |
| // be closed. |
| func (p *DirectoryInterface) Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error { |
| req_ := &directoryOpenRequest{ |
| Flags: flags, |
| Mode: mode, |
| Path: path, |
| Object: object, |
| } |
| err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryOpenOrdinal, req_) |
| return err |
| } |
| |
| // Detaches an object from this directory object. |
| // |
| // The underlying object may or may not be deleted after this method |
| // completes: although the link will be removed from the containing directory, |
| // objects with multiple references (such as files which are still open) |
| // will not actually be destroyed until all references are removed. |
| // |
| // If a directory is unlinked while it still has an open reference, |
| // it must become read-only, preventing new entries from being created |
| // until all references close and the directory is destroyed. |
| // |
| // |path| identifies the file which should be detached. |
| // If |path| contains multiple segments, separated by "/" characters, |
| // then the directory is traversed, one segment at a time, relative to the |
| // originally accessed Directory. |
| // |
| // Returns: |
| // ZX_ERR_ACCESS_DENIED if the connection (or the underlying filesystem) does not |
| // allow writable access. |
| // ZX_ERR_INVALID_ARGS if |path| contains ".." segments. |
| // ZX_ERR_NOT_EMPTY if |path| refers to a non-empty directory. |
| // ZX_ERR_UNAVAILABLE if |path| refers to a mount point, containing a remote channel. |
| // ZX_ERR_UNAVAILABLE if |path| is ".". |
| // |
| // Other errors may be returned for filesystem-specific reasons. |
| func (p *DirectoryInterface) Unlink(path string) (int32, error) { |
| req_ := &directoryUnlinkRequest{ |
| Path: path, |
| } |
| resp_ := &directoryUnlinkResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryUnlinkOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Reads a collection of variably sized dirents into a buffer. |
| // The number of dirents in a directory may be very large: akin to |
| // calling read multiple times on a file, directories have a seek |
| // offset which is updated on subsequent calls to ReadDirents. |
| // |
| // These dirents are of the form: |
| // struct dirent { |
| // // Describes the inode of the entry. |
| // uint64 ino; |
| // // Describes the length of the dirent name. |
| // uint8 size; |
| // // Describes the type of the entry. Aligned with the |
| // /// POSIX d_type values. Use DIRENT_TYPE_* constants. |
| // uint8 type; |
| // // Unterminated name of entry. |
| // char name[0]; |
| // } |
| // |
| func (p *DirectoryInterface) ReadDirents(maxBytes uint64) (int32, []uint8, error) { |
| req_ := &directoryReadDirentsRequest{ |
| MaxBytes: maxBytes, |
| } |
| resp_ := &directoryReadDirentsResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryReadDirentsOrdinal, req_, resp_) |
| return resp_.S, resp_.Dirents, err |
| } |
| |
| // Resets the directory seek offset. |
| func (p *DirectoryInterface) Rewind() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryRewindResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryRewindOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Acquires a token to a Directory which can be used to identify |
| // access to it at a later point in time. |
| func (p *DirectoryInterface) GetToken() (int32, _zx.Handle, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryGetTokenResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetTokenOrdinal, req_, resp_) |
| return resp_.S, resp_.Token, err |
| } |
| |
| // Renames an object named src to the name dst, in a directory represented by token. |
| func (p *DirectoryInterface) Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error) { |
| req_ := &directoryRenameRequest{ |
| Src: src, |
| DstParentToken: dstParentToken, |
| Dst: dst, |
| } |
| resp_ := &directoryRenameResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryRenameOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Creates a link to an object named src by the name dst, within a directory represented by |
| // token. |
| func (p *DirectoryInterface) Link(src string, dstParentToken _zx.Handle, dst string) (int32, error) { |
| req_ := &directoryLinkRequest{ |
| Src: src, |
| DstParentToken: dstParentToken, |
| Dst: dst, |
| } |
| resp_ := &directoryLinkResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryLinkOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Watches a directory, receiving events of added messages on the |
| // watcher request channel. |
| // |
| // The "watcher" handle will send messages of the form: |
| // struct { |
| // uint8 event; |
| // uint8 len; |
| // char name[]; |
| // }; |
| // Where names are NOT null-terminated. |
| // |
| // TODO: This API is unstable; in the future, watcher will be a "DirectoryWatcher" client. |
| // |
| // Mask specifies a bitmask of events to observe. |
| // Options must be zero; it is reserved. |
| func (p *DirectoryInterface) Watch(mask uint32, options uint32, watcher _zx.Channel) (int32, error) { |
| req_ := &directoryWatchRequest{ |
| Mask: mask, |
| Options: options, |
| Watcher: watcher, |
| } |
| resp_ := &directoryWatchResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryWatchOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Directory defines a node which is capable of containing other Objects. |
| type Directory interface { |
| // Create another connection to the same remote object. |
| // |
| // |flags| may be any of: |
| // - OPEN_RIGHT_* |
| // - OPEN_FLAG_APPEND |
| // - OPEN_FLAG_NO_REMOTE |
| // - OPEN_FLAG_DESCRIBE |
| // |
| // All other flags are ignored. |
| // |
| // The cloned object must have rights less than or equal to the original object. |
| // |
| // TODO: Currently, ulib/fs ignores OPEN_RIGHT_*, and uses the rights of the original |
| // connection. This is a bug. |
| Clone(flags uint32, object NodeInterfaceRequest) error |
| // Terminates connection with object. |
| // |
| // This method does not require any rights. |
| Close() (int32, error) |
| // Returns extra information about the type of the object. |
| // If the |Describe| operation fails, the connection is closed. |
| // |
| // This method does not require any rights. |
| Describe() (NodeInfo, error) |
| // An event produced eagerly by a FIDL server if requested by |OPEN_FLAG_DESCRIBE|. |
| // |
| // Indicates the success or failure of the open operation, and optionally describes the |
| // object. If the status is |ZX_OK|, |info| contains descriptive information about the object |
| // (the same as would be returned by |Describe|). |
| // Synchronizes updates to the node to the underlying media, if it exists. |
| Sync() (int32, error) |
| // Acquires information about the node. |
| // |
| // This method does not require any rights. |
| GetAttr() (int32, NodeAttributes, error) |
| // Updates information about the node. |
| // |flags| may be any of NODE_ATTRIBUTE_FLAG_*. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| // TODO(ZX-1262): This access restriction is not implemented in ulib/fs. |
| SetAttr(flags uint32, attributes NodeAttributes) (int32, error) |
| // Deprecated. Only for use with compatibility with devhost. |
| Ioctl(opcode uint32, maxOut uint64, handles []_zx.Handle, in []uint8) (int32, []_zx.Handle, []uint8, error) |
| // Opens a new object relative to this directory object. |
| // |
| // Flags may be any of the OPEN_FLAG_* and OPEN_RIGHT_* values, bitwise ORed together. |
| // The OPEN_FLAG_DESCRIBE flag may cause an |OnOpen| event to be transmitted |
| // on the |object| handle, indicating the type of object opened. |
| // |
| // If an unknown value is sent for either flags or mode, the connection should |
| // be closed. |
| Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error |
| // Detaches an object from this directory object. |
| // |
| // The underlying object may or may not be deleted after this method |
| // completes: although the link will be removed from the containing directory, |
| // objects with multiple references (such as files which are still open) |
| // will not actually be destroyed until all references are removed. |
| // |
| // If a directory is unlinked while it still has an open reference, |
| // it must become read-only, preventing new entries from being created |
| // until all references close and the directory is destroyed. |
| // |
| // |path| identifies the file which should be detached. |
| // If |path| contains multiple segments, separated by "/" characters, |
| // then the directory is traversed, one segment at a time, relative to the |
| // originally accessed Directory. |
| // |
| // Returns: |
| // ZX_ERR_ACCESS_DENIED if the connection (or the underlying filesystem) does not |
| // allow writable access. |
| // ZX_ERR_INVALID_ARGS if |path| contains ".." segments. |
| // ZX_ERR_NOT_EMPTY if |path| refers to a non-empty directory. |
| // ZX_ERR_UNAVAILABLE if |path| refers to a mount point, containing a remote channel. |
| // ZX_ERR_UNAVAILABLE if |path| is ".". |
| // |
| // Other errors may be returned for filesystem-specific reasons. |
| Unlink(path string) (int32, error) |
| // Reads a collection of variably sized dirents into a buffer. |
| // The number of dirents in a directory may be very large: akin to |
| // calling read multiple times on a file, directories have a seek |
| // offset which is updated on subsequent calls to ReadDirents. |
| // |
| // These dirents are of the form: |
| // struct dirent { |
| // // Describes the inode of the entry. |
| // uint64 ino; |
| // // Describes the length of the dirent name. |
| // uint8 size; |
| // // Describes the type of the entry. Aligned with the |
| // /// POSIX d_type values. Use DIRENT_TYPE_* constants. |
| // uint8 type; |
| // // Unterminated name of entry. |
| // char name[0]; |
| // } |
| // |
| ReadDirents(maxBytes uint64) (int32, []uint8, error) |
| // Resets the directory seek offset. |
| Rewind() (int32, error) |
| // Acquires a token to a Directory which can be used to identify |
| // access to it at a later point in time. |
| GetToken() (int32, _zx.Handle, error) |
| // Renames an object named src to the name dst, in a directory represented by token. |
| Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error) |
| // Creates a link to an object named src by the name dst, within a directory represented by |
| // token. |
| Link(src string, dstParentToken _zx.Handle, dst string) (int32, error) |
| // Watches a directory, receiving events of added messages on the |
| // watcher request channel. |
| // |
| // The "watcher" handle will send messages of the form: |
| // struct { |
| // uint8 event; |
| // uint8 len; |
| // char name[]; |
| // }; |
| // Where names are NOT null-terminated. |
| // |
| // TODO: This API is unstable; in the future, watcher will be a "DirectoryWatcher" client. |
| // |
| // Mask specifies a bitmask of events to observe. |
| // Options must be zero; it is reserved. |
| Watch(mask uint32, options uint32, watcher _zx.Channel) (int32, error) |
| } |
| |
| type DirectoryTransitionalBase struct{} |
| |
| type DirectoryInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewDirectoryInterfaceRequest() (DirectoryInterfaceRequest, *DirectoryInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return DirectoryInterfaceRequest(req), (*DirectoryInterface)(cli), err |
| } |
| |
| type DirectoryStub struct { |
| Impl Directory |
| } |
| |
| func (s *DirectoryStub) Dispatch(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Payload, error) { |
| return s.DispatchNew(ord, b_, h_) |
| } |
| |
| func (s *DirectoryStub) DispatchNew(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Message, error) { |
| switch ord { |
| case DirectoryCloneOrdinal: |
| in_ := directoryCloneRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Clone(in_.Flags, in_.Object) |
| return nil, err_ |
| case DirectoryCloseOrdinal: |
| s, err_ := s.Impl.Close() |
| out_ := directoryCloseResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryDescribeOrdinal: |
| info, err_ := s.Impl.Describe() |
| out_ := directoryDescribeResponse{} |
| out_.Info = info |
| return &out_, err_ |
| case DirectorySyncOrdinal: |
| s, err_ := s.Impl.Sync() |
| out_ := directorySyncResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryGetAttrOrdinal: |
| s, attributes, err_ := s.Impl.GetAttr() |
| out_ := directoryGetAttrResponse{} |
| out_.S = s |
| out_.Attributes = attributes |
| return &out_, err_ |
| case DirectorySetAttrOrdinal: |
| in_ := directorySetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.SetAttr(in_.Flags, in_.Attributes) |
| out_ := directorySetAttrResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryIoctlOrdinal: |
| in_ := directoryIoctlRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, handles, out, err_ := s.Impl.Ioctl(in_.Opcode, in_.MaxOut, in_.Handles, in_.In) |
| out_ := directoryIoctlResponse{} |
| out_.S = s |
| out_.Handles = handles |
| out_.Out = out |
| return &out_, err_ |
| case DirectoryOpenOrdinal: |
| in_ := directoryOpenRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Open(in_.Flags, in_.Mode, in_.Path, in_.Object) |
| return nil, err_ |
| case DirectoryUnlinkOrdinal: |
| in_ := directoryUnlinkRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Unlink(in_.Path) |
| out_ := directoryUnlinkResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryReadDirentsOrdinal: |
| in_ := directoryReadDirentsRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, dirents, err_ := s.Impl.ReadDirents(in_.MaxBytes) |
| out_ := directoryReadDirentsResponse{} |
| out_.S = s |
| out_.Dirents = dirents |
| return &out_, err_ |
| case DirectoryRewindOrdinal: |
| s, err_ := s.Impl.Rewind() |
| out_ := directoryRewindResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryGetTokenOrdinal: |
| s, token, err_ := s.Impl.GetToken() |
| out_ := directoryGetTokenResponse{} |
| out_.S = s |
| out_.Token = token |
| return &out_, err_ |
| case DirectoryRenameOrdinal: |
| in_ := directoryRenameRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Rename(in_.Src, in_.DstParentToken, in_.Dst) |
| out_ := directoryRenameResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryLinkOrdinal: |
| in_ := directoryLinkRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Link(in_.Src, in_.DstParentToken, in_.Dst) |
| out_ := directoryLinkResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryWatchOrdinal: |
| in_ := directoryWatchRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Watch(in_.Mask, in_.Options, in_.Watcher) |
| out_ := directoryWatchResponse{} |
| out_.S = s |
| return &out_, err_ |
| } |
| return nil, _bindings.ErrUnknownOrdinal |
| } |
| |
| type DirectoryService struct { |
| _bindings.BindingSet |
| } |
| |
| func (s *DirectoryService) Add(impl Directory, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) { |
| return s.BindingSet.Add(&DirectoryStub{Impl: impl}, c, onError) |
| } |
| |
| func (s *DirectoryService) EventProxyFor(key _bindings.BindingKey) (*DirectoryEventProxy, bool) { |
| pxy, err := s.BindingSet.ProxyFor(key) |
| return (*DirectoryEventProxy)(pxy), err |
| } |
| |
| type DirectoryEventProxy _bindings.ChannelProxy |
| |
| func (p *DirectoryEventProxy) OnOpen(s int32, info *NodeInfo) error { |
| event_ := &directoryOnOpenResponse{ |
| S: s, |
| Info: info, |
| } |
| return ((*_bindings.ChannelProxy)(p)).Send(DirectoryOnOpenOrdinal, event_) |
| } |
| |
| const ( |
| DirectoryAdminCloneOrdinal uint32 = 402549324 |
| DirectoryAdminCloneGenOrdinal uint32 = 402549324 |
| DirectoryAdminCloseOrdinal uint32 = 1387878023 |
| DirectoryAdminCloseGenOrdinal uint32 = 1387878023 |
| DirectoryAdminDescribeOrdinal uint32 = 526573406 |
| DirectoryAdminDescribeGenOrdinal uint32 = 526573406 |
| DirectoryAdminOnOpenOrdinal uint32 = 1191225277 |
| DirectoryAdminOnOpenGenOrdinal uint32 = 1191225277 |
| DirectoryAdminSyncOrdinal uint32 = 1648508842 |
| DirectoryAdminSyncGenOrdinal uint32 = 1648508842 |
| DirectoryAdminGetAttrOrdinal uint32 = 1166403528 |
| DirectoryAdminGetAttrGenOrdinal uint32 = 1166403528 |
| DirectoryAdminSetAttrOrdinal uint32 = 198530458 |
| DirectoryAdminSetAttrGenOrdinal uint32 = 198530458 |
| DirectoryAdminIoctlOrdinal uint32 = 905161895 |
| DirectoryAdminIoctlGenOrdinal uint32 = 905161895 |
| DirectoryAdminOpenOrdinal uint32 = 2011483371 |
| DirectoryAdminOpenGenOrdinal uint32 = 2011483371 |
| DirectoryAdminUnlinkOrdinal uint32 = 750443289 |
| DirectoryAdminUnlinkGenOrdinal uint32 = 750443289 |
| DirectoryAdminReadDirentsOrdinal uint32 = 782580781 |
| DirectoryAdminReadDirentsGenOrdinal uint32 = 782580781 |
| DirectoryAdminRewindOrdinal uint32 = 1886584199 |
| DirectoryAdminRewindGenOrdinal uint32 = 1886584199 |
| DirectoryAdminGetTokenOrdinal uint32 = 840416493 |
| DirectoryAdminGetTokenGenOrdinal uint32 = 840416493 |
| DirectoryAdminRenameOrdinal uint32 = 1251258540 |
| DirectoryAdminRenameGenOrdinal uint32 = 1251258540 |
| DirectoryAdminLinkOrdinal uint32 = 462052964 |
| DirectoryAdminLinkGenOrdinal uint32 = 462052964 |
| DirectoryAdminWatchOrdinal uint32 = 1522700084 |
| DirectoryAdminWatchGenOrdinal uint32 = 1522700084 |
| DirectoryAdminMountOrdinal uint32 = 2120159974 |
| DirectoryAdminMountGenOrdinal uint32 = 2120159974 |
| DirectoryAdminMountAndCreateOrdinal uint32 = 841348753 |
| DirectoryAdminMountAndCreateGenOrdinal uint32 = 841348753 |
| DirectoryAdminUnmountOrdinal uint32 = 620898132 |
| DirectoryAdminUnmountGenOrdinal uint32 = 620898132 |
| DirectoryAdminUnmountNodeOrdinal uint32 = 383400103 |
| DirectoryAdminUnmountNodeGenOrdinal uint32 = 383400103 |
| DirectoryAdminQueryFilesystemOrdinal uint32 = 1713999250 |
| DirectoryAdminQueryFilesystemGenOrdinal uint32 = 1713999250 |
| DirectoryAdminGetDevicePathOrdinal uint32 = 787943096 |
| DirectoryAdminGetDevicePathGenOrdinal uint32 = 787943096 |
| ) |
| |
| type directoryAdminCloneRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| Flags uint32 |
| Object NodeInterfaceRequest `fidl2:"0"` |
| } |
| |
| var _mdirectoryAdminCloneRequest = _bindings.CreateLazyMarshaler(directoryAdminCloneRequest{}) |
| |
| func (msg *directoryAdminCloneRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminCloneRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminCloneRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminCloneRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminCloseResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminCloseResponse = _bindings.CreateLazyMarshaler(directoryAdminCloseResponse{}) |
| |
| func (msg *directoryAdminCloseResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminCloseResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminCloseResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminCloseResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminDescribeResponse struct { |
| _ struct{} `fidl2:"s,32,0"` |
| Info NodeInfo |
| } |
| |
| var _mdirectoryAdminDescribeResponse = _bindings.CreateLazyMarshaler(directoryAdminDescribeResponse{}) |
| |
| func (msg *directoryAdminDescribeResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminDescribeResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminDescribeResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminDescribeResponse) InlineSize() int { |
| return 32 |
| } |
| |
| type directoryAdminOnOpenResponse struct { |
| _ struct{} `fidl2:"s,16,0"` |
| S int32 |
| Info *NodeInfo |
| } |
| |
| var _mdirectoryAdminOnOpenResponse = _bindings.CreateLazyMarshaler(directoryAdminOnOpenResponse{}) |
| |
| func (msg *directoryAdminOnOpenResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminOnOpenResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminOnOpenResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminOnOpenResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type directoryAdminSyncResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminSyncResponse = _bindings.CreateLazyMarshaler(directoryAdminSyncResponse{}) |
| |
| func (msg *directoryAdminSyncResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminSyncResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminSyncResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminSyncResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminGetAttrResponse struct { |
| _ struct{} `fidl2:"s,64,0"` |
| S int32 |
| Attributes NodeAttributes |
| } |
| |
| var _mdirectoryAdminGetAttrResponse = _bindings.CreateLazyMarshaler(directoryAdminGetAttrResponse{}) |
| |
| func (msg *directoryAdminGetAttrResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminGetAttrResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminGetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminGetAttrResponse) InlineSize() int { |
| return 64 |
| } |
| |
| type directoryAdminSetAttrRequest struct { |
| _ struct{} `fidl2:"s,64,0"` |
| Flags uint32 |
| Attributes NodeAttributes |
| } |
| |
| var _mdirectoryAdminSetAttrRequest = _bindings.CreateLazyMarshaler(directoryAdminSetAttrRequest{}) |
| |
| func (msg *directoryAdminSetAttrRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminSetAttrRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminSetAttrRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminSetAttrRequest) InlineSize() int { |
| return 64 |
| } |
| |
| type directoryAdminSetAttrResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminSetAttrResponse = _bindings.CreateLazyMarshaler(directoryAdminSetAttrResponse{}) |
| |
| func (msg *directoryAdminSetAttrResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminSetAttrResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminSetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminSetAttrResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminIoctlRequest struct { |
| _ struct{} `fidl2:"s,48,0"` |
| Opcode uint32 |
| MaxOut uint64 |
| Handles []_zx.Handle `fidl:"2" fidl2:"2,0"` |
| In []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mdirectoryAdminIoctlRequest = _bindings.CreateLazyMarshaler(directoryAdminIoctlRequest{}) |
| |
| func (msg *directoryAdminIoctlRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminIoctlRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminIoctlRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminIoctlRequest) InlineSize() int { |
| return 48 |
| } |
| |
| type directoryAdminIoctlResponse struct { |
| _ struct{} `fidl2:"s,40,0"` |
| S int32 |
| Handles []_zx.Handle `fidl:"2" fidl2:"2,0"` |
| Out []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mdirectoryAdminIoctlResponse = _bindings.CreateLazyMarshaler(directoryAdminIoctlResponse{}) |
| |
| func (msg *directoryAdminIoctlResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminIoctlResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminIoctlResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminIoctlResponse) InlineSize() int { |
| return 40 |
| } |
| |
| type directoryAdminOpenRequest struct { |
| _ struct{} `fidl2:"s,32,0"` |
| Flags uint32 |
| Mode uint32 |
| Path string `fidl:"4096" fidl2:"4096"` |
| Object NodeInterfaceRequest `fidl2:"0"` |
| } |
| |
| var _mdirectoryAdminOpenRequest = _bindings.CreateLazyMarshaler(directoryAdminOpenRequest{}) |
| |
| func (msg *directoryAdminOpenRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminOpenRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminOpenRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminOpenRequest) InlineSize() int { |
| return 32 |
| } |
| |
| type directoryAdminUnlinkRequest struct { |
| _ struct{} `fidl2:"s,16,0"` |
| Path string `fidl:"4096" fidl2:"4096"` |
| } |
| |
| var _mdirectoryAdminUnlinkRequest = _bindings.CreateLazyMarshaler(directoryAdminUnlinkRequest{}) |
| |
| func (msg *directoryAdminUnlinkRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminUnlinkRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminUnlinkRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminUnlinkRequest) InlineSize() int { |
| return 16 |
| } |
| |
| type directoryAdminUnlinkResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminUnlinkResponse = _bindings.CreateLazyMarshaler(directoryAdminUnlinkResponse{}) |
| |
| func (msg *directoryAdminUnlinkResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminUnlinkResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminUnlinkResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminUnlinkResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminReadDirentsRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| MaxBytes uint64 |
| } |
| |
| var _mdirectoryAdminReadDirentsRequest = _bindings.CreateLazyMarshaler(directoryAdminReadDirentsRequest{}) |
| |
| func (msg *directoryAdminReadDirentsRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminReadDirentsRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminReadDirentsRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminReadDirentsRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminReadDirentsResponse struct { |
| _ struct{} `fidl2:"s,24,0"` |
| S int32 |
| Dirents []uint8 `fidl:"8192" fidl2:"8192"` |
| } |
| |
| var _mdirectoryAdminReadDirentsResponse = _bindings.CreateLazyMarshaler(directoryAdminReadDirentsResponse{}) |
| |
| func (msg *directoryAdminReadDirentsResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminReadDirentsResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminReadDirentsResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminReadDirentsResponse) InlineSize() int { |
| return 24 |
| } |
| |
| type directoryAdminRewindResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminRewindResponse = _bindings.CreateLazyMarshaler(directoryAdminRewindResponse{}) |
| |
| func (msg *directoryAdminRewindResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminRewindResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminRewindResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminRewindResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminGetTokenResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| Token _zx.Handle `fidl:"*" fidl2:"1"` |
| } |
| |
| var _mdirectoryAdminGetTokenResponse = _bindings.CreateLazyMarshaler(directoryAdminGetTokenResponse{}) |
| |
| func (msg *directoryAdminGetTokenResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminGetTokenResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminGetTokenResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminGetTokenResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminRenameRequest struct { |
| _ struct{} `fidl2:"s,40,0"` |
| Src string `fidl:"4096" fidl2:"4096"` |
| DstParentToken _zx.Handle `fidl2:"0"` |
| Dst string `fidl:"4096" fidl2:"4096"` |
| } |
| |
| var _mdirectoryAdminRenameRequest = _bindings.CreateLazyMarshaler(directoryAdminRenameRequest{}) |
| |
| func (msg *directoryAdminRenameRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminRenameRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminRenameRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminRenameRequest) InlineSize() int { |
| return 40 |
| } |
| |
| type directoryAdminRenameResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminRenameResponse = _bindings.CreateLazyMarshaler(directoryAdminRenameResponse{}) |
| |
| func (msg *directoryAdminRenameResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminRenameResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminRenameResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminRenameResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminLinkRequest struct { |
| _ struct{} `fidl2:"s,40,0"` |
| Src string `fidl:"4096" fidl2:"4096"` |
| DstParentToken _zx.Handle `fidl2:"0"` |
| Dst string `fidl:"4096" fidl2:"4096"` |
| } |
| |
| var _mdirectoryAdminLinkRequest = _bindings.CreateLazyMarshaler(directoryAdminLinkRequest{}) |
| |
| func (msg *directoryAdminLinkRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminLinkRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminLinkRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminLinkRequest) InlineSize() int { |
| return 40 |
| } |
| |
| type directoryAdminLinkResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminLinkResponse = _bindings.CreateLazyMarshaler(directoryAdminLinkResponse{}) |
| |
| func (msg *directoryAdminLinkResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminLinkResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminLinkResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminLinkResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminWatchRequest struct { |
| _ struct{} `fidl2:"s,16,0"` |
| Mask uint32 |
| Options uint32 |
| Watcher _zx.Channel `fidl2:"0"` |
| } |
| |
| var _mdirectoryAdminWatchRequest = _bindings.CreateLazyMarshaler(directoryAdminWatchRequest{}) |
| |
| func (msg *directoryAdminWatchRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminWatchRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminWatchRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminWatchRequest) InlineSize() int { |
| return 16 |
| } |
| |
| type directoryAdminWatchResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminWatchResponse = _bindings.CreateLazyMarshaler(directoryAdminWatchResponse{}) |
| |
| func (msg *directoryAdminWatchResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminWatchResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminWatchResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminWatchResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminMountRequest struct { |
| _ struct{} `fidl2:"s,8,0"` |
| Remote DirectoryInterface |
| } |
| |
| var _mdirectoryAdminMountRequest = _bindings.CreateLazyMarshaler(directoryAdminMountRequest{}) |
| |
| func (msg *directoryAdminMountRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminMountRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminMountRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminMountRequest) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminMountResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminMountResponse = _bindings.CreateLazyMarshaler(directoryAdminMountResponse{}) |
| |
| func (msg *directoryAdminMountResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminMountResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminMountResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminMountResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminMountAndCreateRequest struct { |
| _ struct{} `fidl2:"s,32,0"` |
| Remote DirectoryInterface |
| Name string `fidl:"255" fidl2:"255"` |
| Flags uint32 |
| } |
| |
| var _mdirectoryAdminMountAndCreateRequest = _bindings.CreateLazyMarshaler(directoryAdminMountAndCreateRequest{}) |
| |
| func (msg *directoryAdminMountAndCreateRequest) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminMountAndCreateRequest |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminMountAndCreateRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminMountAndCreateRequest) InlineSize() int { |
| return 32 |
| } |
| |
| type directoryAdminMountAndCreateResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminMountAndCreateResponse = _bindings.CreateLazyMarshaler(directoryAdminMountAndCreateResponse{}) |
| |
| func (msg *directoryAdminMountAndCreateResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminMountAndCreateResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminMountAndCreateResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminMountAndCreateResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminUnmountResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| } |
| |
| var _mdirectoryAdminUnmountResponse = _bindings.CreateLazyMarshaler(directoryAdminUnmountResponse{}) |
| |
| func (msg *directoryAdminUnmountResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminUnmountResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminUnmountResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminUnmountResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminUnmountNodeResponse struct { |
| _ struct{} `fidl2:"s,8,0"` |
| S int32 |
| Remote DirectoryInterface `fidl:"*"` |
| } |
| |
| var _mdirectoryAdminUnmountNodeResponse = _bindings.CreateLazyMarshaler(directoryAdminUnmountNodeResponse{}) |
| |
| func (msg *directoryAdminUnmountNodeResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminUnmountNodeResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminUnmountNodeResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminUnmountNodeResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type directoryAdminQueryFilesystemResponse struct { |
| _ struct{} `fidl2:"s,16,0"` |
| S int32 |
| Info *FilesystemInfo |
| } |
| |
| var _mdirectoryAdminQueryFilesystemResponse = _bindings.CreateLazyMarshaler(directoryAdminQueryFilesystemResponse{}) |
| |
| func (msg *directoryAdminQueryFilesystemResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminQueryFilesystemResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminQueryFilesystemResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminQueryFilesystemResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type directoryAdminGetDevicePathResponse struct { |
| _ struct{} `fidl2:"s,24,0"` |
| S int32 |
| Path *string `fidl:"4096" fidl2:"4096"` |
| } |
| |
| var _mdirectoryAdminGetDevicePathResponse = _bindings.CreateLazyMarshaler(directoryAdminGetDevicePathResponse{}) |
| |
| func (msg *directoryAdminGetDevicePathResponse) Marshaler() _bindings.Marshaler { |
| return _mdirectoryAdminGetDevicePathResponse |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminGetDevicePathResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *directoryAdminGetDevicePathResponse) InlineSize() int { |
| return 24 |
| } |
| |
| type DirectoryAdminInterface _bindings.ChannelProxy |
| |
| // Create another connection to the same remote object. |
| // |
| // |flags| may be any of: |
| // - OPEN_RIGHT_* |
| // - OPEN_FLAG_APPEND |
| // - OPEN_FLAG_NO_REMOTE |
| // - OPEN_FLAG_DESCRIBE |
| // |
| // All other flags are ignored. |
| // |
| // The cloned object must have rights less than or equal to the original object. |
| // |
| // TODO: Currently, ulib/fs ignores OPEN_RIGHT_*, and uses the rights of the original |
| // connection. This is a bug. |
| func (p *DirectoryAdminInterface) Clone(flags uint32, object NodeInterfaceRequest) error { |
| req_ := &directoryAdminCloneRequest{ |
| Flags: flags, |
| Object: object, |
| } |
| err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryAdminCloneOrdinal, req_) |
| return err |
| } |
| |
| // Terminates connection with object. |
| // |
| // This method does not require any rights. |
| func (p *DirectoryAdminInterface) Close() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminCloseResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminCloseOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Returns extra information about the type of the object. |
| // If the |Describe| operation fails, the connection is closed. |
| // |
| // This method does not require any rights. |
| func (p *DirectoryAdminInterface) Describe() (NodeInfo, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminDescribeResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminDescribeOrdinal, req_, resp_) |
| return resp_.Info, err |
| } |
| |
| // An event produced eagerly by a FIDL server if requested by |OPEN_FLAG_DESCRIBE|. |
| // |
| // Indicates the success or failure of the open operation, and optionally describes the |
| // object. If the status is |ZX_OK|, |info| contains descriptive information about the object |
| // (the same as would be returned by |Describe|). |
| func (p *DirectoryAdminInterface) ExpectOnOpen() (int32, *NodeInfo, error) { |
| resp_ := &directoryAdminOnOpenResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Recv(DirectoryAdminOnOpenOrdinal, resp_) |
| return resp_.S, resp_.Info, err |
| } |
| |
| // Synchronizes updates to the node to the underlying media, if it exists. |
| func (p *DirectoryAdminInterface) Sync() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminSyncResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminSyncOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Acquires information about the node. |
| // |
| // This method does not require any rights. |
| func (p *DirectoryAdminInterface) GetAttr() (int32, NodeAttributes, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminGetAttrResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminGetAttrOrdinal, req_, resp_) |
| return resp_.S, resp_.Attributes, err |
| } |
| |
| // Updates information about the node. |
| // |flags| may be any of NODE_ATTRIBUTE_FLAG_*. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| // TODO(ZX-1262): This access restriction is not implemented in ulib/fs. |
| func (p *DirectoryAdminInterface) SetAttr(flags uint32, attributes NodeAttributes) (int32, error) { |
| req_ := &directoryAdminSetAttrRequest{ |
| Flags: flags, |
| Attributes: attributes, |
| } |
| resp_ := &directoryAdminSetAttrResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminSetAttrOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Deprecated. Only for use with compatibility with devhost. |
| func (p *DirectoryAdminInterface) Ioctl(opcode uint32, maxOut uint64, handles []_zx.Handle, in []uint8) (int32, []_zx.Handle, []uint8, error) { |
| req_ := &directoryAdminIoctlRequest{ |
| Opcode: opcode, |
| MaxOut: maxOut, |
| Handles: handles, |
| In: in, |
| } |
| resp_ := &directoryAdminIoctlResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminIoctlOrdinal, req_, resp_) |
| return resp_.S, resp_.Handles, resp_.Out, err |
| } |
| |
| // Opens a new object relative to this directory object. |
| // |
| // Flags may be any of the OPEN_FLAG_* and OPEN_RIGHT_* values, bitwise ORed together. |
| // The OPEN_FLAG_DESCRIBE flag may cause an |OnOpen| event to be transmitted |
| // on the |object| handle, indicating the type of object opened. |
| // |
| // If an unknown value is sent for either flags or mode, the connection should |
| // be closed. |
| func (p *DirectoryAdminInterface) Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error { |
| req_ := &directoryAdminOpenRequest{ |
| Flags: flags, |
| Mode: mode, |
| Path: path, |
| Object: object, |
| } |
| err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryAdminOpenOrdinal, req_) |
| return err |
| } |
| |
| // Detaches an object from this directory object. |
| // |
| // The underlying object may or may not be deleted after this method |
| // completes: although the link will be removed from the containing directory, |
| // objects with multiple references (such as files which are still open) |
| // will not actually be destroyed until all references are removed. |
| // |
| // If a directory is unlinked while it still has an open reference, |
| // it must become read-only, preventing new entries from being created |
| // until all references close and the directory is destroyed. |
| // |
| // |path| identifies the file which should be detached. |
| // If |path| contains multiple segments, separated by "/" characters, |
| // then the directory is traversed, one segment at a time, relative to the |
| // originally accessed Directory. |
| // |
| // Returns: |
| // ZX_ERR_ACCESS_DENIED if the connection (or the underlying filesystem) does not |
| // allow writable access. |
| // ZX_ERR_INVALID_ARGS if |path| contains ".." segments. |
| // ZX_ERR_NOT_EMPTY if |path| refers to a non-empty directory. |
| // ZX_ERR_UNAVAILABLE if |path| refers to a mount point, containing a remote channel. |
| // ZX_ERR_UNAVAILABLE if |path| is ".". |
| // |
| // Other errors may be returned for filesystem-specific reasons. |
| func (p *DirectoryAdminInterface) Unlink(path string) (int32, error) { |
| req_ := &directoryAdminUnlinkRequest{ |
| Path: path, |
| } |
| resp_ := &directoryAdminUnlinkResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminUnlinkOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Reads a collection of variably sized dirents into a buffer. |
| // The number of dirents in a directory may be very large: akin to |
| // calling read multiple times on a file, directories have a seek |
| // offset which is updated on subsequent calls to ReadDirents. |
| // |
| // These dirents are of the form: |
| // struct dirent { |
| // // Describes the inode of the entry. |
| // uint64 ino; |
| // // Describes the length of the dirent name. |
| // uint8 size; |
| // // Describes the type of the entry. Aligned with the |
| // /// POSIX d_type values. Use DIRENT_TYPE_* constants. |
| // uint8 type; |
| // // Unterminated name of entry. |
| // char name[0]; |
| // } |
| // |
| func (p *DirectoryAdminInterface) ReadDirents(maxBytes uint64) (int32, []uint8, error) { |
| req_ := &directoryAdminReadDirentsRequest{ |
| MaxBytes: maxBytes, |
| } |
| resp_ := &directoryAdminReadDirentsResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminReadDirentsOrdinal, req_, resp_) |
| return resp_.S, resp_.Dirents, err |
| } |
| |
| // Resets the directory seek offset. |
| func (p *DirectoryAdminInterface) Rewind() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminRewindResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminRewindOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Acquires a token to a Directory which can be used to identify |
| // access to it at a later point in time. |
| func (p *DirectoryAdminInterface) GetToken() (int32, _zx.Handle, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminGetTokenResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminGetTokenOrdinal, req_, resp_) |
| return resp_.S, resp_.Token, err |
| } |
| |
| // Renames an object named src to the name dst, in a directory represented by token. |
| func (p *DirectoryAdminInterface) Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error) { |
| req_ := &directoryAdminRenameRequest{ |
| Src: src, |
| DstParentToken: dstParentToken, |
| Dst: dst, |
| } |
| resp_ := &directoryAdminRenameResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminRenameOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Creates a link to an object named src by the name dst, within a directory represented by |
| // token. |
| func (p *DirectoryAdminInterface) Link(src string, dstParentToken _zx.Handle, dst string) (int32, error) { |
| req_ := &directoryAdminLinkRequest{ |
| Src: src, |
| DstParentToken: dstParentToken, |
| Dst: dst, |
| } |
| resp_ := &directoryAdminLinkResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminLinkOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Watches a directory, receiving events of added messages on the |
| // watcher request channel. |
| // |
| // The "watcher" handle will send messages of the form: |
| // struct { |
| // uint8 event; |
| // uint8 len; |
| // char name[]; |
| // }; |
| // Where names are NOT null-terminated. |
| // |
| // TODO: This API is unstable; in the future, watcher will be a "DirectoryWatcher" client. |
| // |
| // Mask specifies a bitmask of events to observe. |
| // Options must be zero; it is reserved. |
| func (p *DirectoryAdminInterface) Watch(mask uint32, options uint32, watcher _zx.Channel) (int32, error) { |
| req_ := &directoryAdminWatchRequest{ |
| Mask: mask, |
| Options: options, |
| Watcher: watcher, |
| } |
| resp_ := &directoryAdminWatchResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminWatchOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Mount a channel representing a remote filesystem onto this directory. |
| // All future requests to this node will be forwarded to the remote filesystem. |
| // To re-open a node without forwarding to the remote target, the node |
| // should be opened with OPEN_FLAG_NO_REMOTE. |
| func (p *DirectoryAdminInterface) Mount(remote DirectoryInterface) (int32, error) { |
| req_ := &directoryAdminMountRequest{ |
| Remote: remote, |
| } |
| resp_ := &directoryAdminMountResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminMountOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Atomically create a directory with a provided path, and mount the |
| // remote handle to the newly created directory. |
| func (p *DirectoryAdminInterface) MountAndCreate(remote DirectoryInterface, name string, flags uint32) (int32, error) { |
| req_ := &directoryAdminMountAndCreateRequest{ |
| Remote: remote, |
| Name: name, |
| Flags: flags, |
| } |
| resp_ := &directoryAdminMountAndCreateResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminMountAndCreateOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Unmount this filesystem. After this function returns successfully, |
| // all connections to the filesystem will be terminated. |
| func (p *DirectoryAdminInterface) Unmount() (int32, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminUnmountResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminUnmountOrdinal, req_, resp_) |
| return resp_.S, err |
| } |
| |
| // Detach a node which was previously attached to this directory |
| // with Mount. |
| func (p *DirectoryAdminInterface) UnmountNode() (int32, DirectoryInterface, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminUnmountNodeResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminUnmountNodeOrdinal, req_, resp_) |
| return resp_.S, resp_.Remote, err |
| } |
| |
| // Query the filesystem for filesystem-specific information. |
| func (p *DirectoryAdminInterface) QueryFilesystem() (int32, *FilesystemInfo, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminQueryFilesystemResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminQueryFilesystemOrdinal, req_, resp_) |
| return resp_.S, resp_.Info, err |
| } |
| |
| // Acquire the path to the device backing this filesystem, if there is one. |
| func (p *DirectoryAdminInterface) GetDevicePath() (int32, *string, error) { |
| var req_ _bindings.Payload |
| resp_ := &directoryAdminGetDevicePathResponse{} |
| err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminGetDevicePathOrdinal, req_, resp_) |
| return resp_.S, resp_.Path, err |
| } |
| |
| // DirectoryAdmin defines a directory which is capable of handling |
| // administrator tasks within the filesystem. |
| type DirectoryAdmin interface { |
| // Create another connection to the same remote object. |
| // |
| // |flags| may be any of: |
| // - OPEN_RIGHT_* |
| // - OPEN_FLAG_APPEND |
| // - OPEN_FLAG_NO_REMOTE |
| // - OPEN_FLAG_DESCRIBE |
| // |
| // All other flags are ignored. |
| // |
| // The cloned object must have rights less than or equal to the original object. |
| // |
| // TODO: Currently, ulib/fs ignores OPEN_RIGHT_*, and uses the rights of the original |
| // connection. This is a bug. |
| Clone(flags uint32, object NodeInterfaceRequest) error |
| // Terminates connection with object. |
| // |
| // This method does not require any rights. |
| Close() (int32, error) |
| // Returns extra information about the type of the object. |
| // If the |Describe| operation fails, the connection is closed. |
| // |
| // This method does not require any rights. |
| Describe() (NodeInfo, error) |
| // An event produced eagerly by a FIDL server if requested by |OPEN_FLAG_DESCRIBE|. |
| // |
| // Indicates the success or failure of the open operation, and optionally describes the |
| // object. If the status is |ZX_OK|, |info| contains descriptive information about the object |
| // (the same as would be returned by |Describe|). |
| // Synchronizes updates to the node to the underlying media, if it exists. |
| Sync() (int32, error) |
| // Acquires information about the node. |
| // |
| // This method does not require any rights. |
| GetAttr() (int32, NodeAttributes, error) |
| // Updates information about the node. |
| // |flags| may be any of NODE_ATTRIBUTE_FLAG_*. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| // TODO(ZX-1262): This access restriction is not implemented in ulib/fs. |
| SetAttr(flags uint32, attributes NodeAttributes) (int32, error) |
| // Deprecated. Only for use with compatibility with devhost. |
| Ioctl(opcode uint32, maxOut uint64, handles []_zx.Handle, in []uint8) (int32, []_zx.Handle, []uint8, error) |
| // Opens a new object relative to this directory object. |
| // |
| // Flags may be any of the OPEN_FLAG_* and OPEN_RIGHT_* values, bitwise ORed together. |
| // The OPEN_FLAG_DESCRIBE flag may cause an |OnOpen| event to be transmitted |
| // on the |object| handle, indicating the type of object opened. |
| // |
| // If an unknown value is sent for either flags or mode, the connection should |
| // be closed. |
| Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error |
| // Detaches an object from this directory object. |
| // |
| // The underlying object may or may not be deleted after this method |
| // completes: although the link will be removed from the containing directory, |
| // objects with multiple references (such as files which are still open) |
| // will not actually be destroyed until all references are removed. |
| // |
| // If a directory is unlinked while it still has an open reference, |
| // it must become read-only, preventing new entries from being created |
| // until all references close and the directory is destroyed. |
| // |
| // |path| identifies the file which should be detached. |
| // If |path| contains multiple segments, separated by "/" characters, |
| // then the directory is traversed, one segment at a time, relative to the |
| // originally accessed Directory. |
| // |
| // Returns: |
| // ZX_ERR_ACCESS_DENIED if the connection (or the underlying filesystem) does not |
| // allow writable access. |
| // ZX_ERR_INVALID_ARGS if |path| contains ".." segments. |
| // ZX_ERR_NOT_EMPTY if |path| refers to a non-empty directory. |
| // ZX_ERR_UNAVAILABLE if |path| refers to a mount point, containing a remote channel. |
| // ZX_ERR_UNAVAILABLE if |path| is ".". |
| // |
| // Other errors may be returned for filesystem-specific reasons. |
| Unlink(path string) (int32, error) |
| // Reads a collection of variably sized dirents into a buffer. |
| // The number of dirents in a directory may be very large: akin to |
| // calling read multiple times on a file, directories have a seek |
| // offset which is updated on subsequent calls to ReadDirents. |
| // |
| // These dirents are of the form: |
| // struct dirent { |
| // // Describes the inode of the entry. |
| // uint64 ino; |
| // // Describes the length of the dirent name. |
| // uint8 size; |
| // // Describes the type of the entry. Aligned with the |
| // /// POSIX d_type values. Use DIRENT_TYPE_* constants. |
| // uint8 type; |
| // // Unterminated name of entry. |
| // char name[0]; |
| // } |
| // |
| ReadDirents(maxBytes uint64) (int32, []uint8, error) |
| // Resets the directory seek offset. |
| Rewind() (int32, error) |
| // Acquires a token to a Directory which can be used to identify |
| // access to it at a later point in time. |
| GetToken() (int32, _zx.Handle, error) |
| // Renames an object named src to the name dst, in a directory represented by token. |
| Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error) |
| // Creates a link to an object named src by the name dst, within a directory represented by |
| // token. |
| Link(src string, dstParentToken _zx.Handle, dst string) (int32, error) |
| // Watches a directory, receiving events of added messages on the |
| // watcher request channel. |
| // |
| // The "watcher" handle will send messages of the form: |
| // struct { |
| // uint8 event; |
| // uint8 len; |
| // char name[]; |
| // }; |
| // Where names are NOT null-terminated. |
| // |
| // TODO: This API is unstable; in the future, watcher will be a "DirectoryWatcher" client. |
| // |
| // Mask specifies a bitmask of events to observe. |
| // Options must be zero; it is reserved. |
| Watch(mask uint32, options uint32, watcher _zx.Channel) (int32, error) |
| // Mount a channel representing a remote filesystem onto this directory. |
| // All future requests to this node will be forwarded to the remote filesystem. |
| // To re-open a node without forwarding to the remote target, the node |
| // should be opened with OPEN_FLAG_NO_REMOTE. |
| Mount(remote DirectoryInterface) (int32, error) |
| // Atomically create a directory with a provided path, and mount the |
| // remote handle to the newly created directory. |
| MountAndCreate(remote DirectoryInterface, name string, flags uint32) (int32, error) |
| // Unmount this filesystem. After this function returns successfully, |
| // all connections to the filesystem will be terminated. |
| Unmount() (int32, error) |
| // Detach a node which was previously attached to this directory |
| // with Mount. |
| UnmountNode() (int32, DirectoryInterface, error) |
| // Query the filesystem for filesystem-specific information. |
| QueryFilesystem() (int32, *FilesystemInfo, error) |
| // Acquire the path to the device backing this filesystem, if there is one. |
| GetDevicePath() (int32, *string, error) |
| } |
| |
| type DirectoryAdminTransitionalBase struct{} |
| |
| type DirectoryAdminInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewDirectoryAdminInterfaceRequest() (DirectoryAdminInterfaceRequest, *DirectoryAdminInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return DirectoryAdminInterfaceRequest(req), (*DirectoryAdminInterface)(cli), err |
| } |
| |
| type DirectoryAdminStub struct { |
| Impl DirectoryAdmin |
| } |
| |
| func (s *DirectoryAdminStub) Dispatch(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Payload, error) { |
| return s.DispatchNew(ord, b_, h_) |
| } |
| |
| func (s *DirectoryAdminStub) DispatchNew(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Message, error) { |
| switch ord { |
| case DirectoryAdminCloneOrdinal: |
| in_ := directoryAdminCloneRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Clone(in_.Flags, in_.Object) |
| return nil, err_ |
| case DirectoryAdminCloseOrdinal: |
| s, err_ := s.Impl.Close() |
| out_ := directoryAdminCloseResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminDescribeOrdinal: |
| info, err_ := s.Impl.Describe() |
| out_ := directoryAdminDescribeResponse{} |
| out_.Info = info |
| return &out_, err_ |
| case DirectoryAdminSyncOrdinal: |
| s, err_ := s.Impl.Sync() |
| out_ := directoryAdminSyncResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminGetAttrOrdinal: |
| s, attributes, err_ := s.Impl.GetAttr() |
| out_ := directoryAdminGetAttrResponse{} |
| out_.S = s |
| out_.Attributes = attributes |
| return &out_, err_ |
| case DirectoryAdminSetAttrOrdinal: |
| in_ := directoryAdminSetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.SetAttr(in_.Flags, in_.Attributes) |
| out_ := directoryAdminSetAttrResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminIoctlOrdinal: |
| in_ := directoryAdminIoctlRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, handles, out, err_ := s.Impl.Ioctl(in_.Opcode, in_.MaxOut, in_.Handles, in_.In) |
| out_ := directoryAdminIoctlResponse{} |
| out_.S = s |
| out_.Handles = handles |
| out_.Out = out |
| return &out_, err_ |
| case DirectoryAdminOpenOrdinal: |
| in_ := directoryAdminOpenRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Open(in_.Flags, in_.Mode, in_.Path, in_.Object) |
| return nil, err_ |
| case DirectoryAdminUnlinkOrdinal: |
| in_ := directoryAdminUnlinkRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Unlink(in_.Path) |
| out_ := directoryAdminUnlinkResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminReadDirentsOrdinal: |
| in_ := directoryAdminReadDirentsRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, dirents, err_ := s.Impl.ReadDirents(in_.MaxBytes) |
| out_ := directoryAdminReadDirentsResponse{} |
| out_.S = s |
| out_.Dirents = dirents |
| return &out_, err_ |
| case DirectoryAdminRewindOrdinal: |
| s, err_ := s.Impl.Rewind() |
| out_ := directoryAdminRewindResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminGetTokenOrdinal: |
| s, token, err_ := s.Impl.GetToken() |
| out_ := directoryAdminGetTokenResponse{} |
| out_.S = s |
| out_.Token = token |
| return &out_, err_ |
| case DirectoryAdminRenameOrdinal: |
| in_ := directoryAdminRenameRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Rename(in_.Src, in_.DstParentToken, in_.Dst) |
| out_ := directoryAdminRenameResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminLinkOrdinal: |
| in_ := directoryAdminLinkRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Link(in_.Src, in_.DstParentToken, in_.Dst) |
| out_ := directoryAdminLinkResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminWatchOrdinal: |
| in_ := directoryAdminWatchRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Watch(in_.Mask, in_.Options, in_.Watcher) |
| out_ := directoryAdminWatchResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminMountOrdinal: |
| in_ := directoryAdminMountRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.Mount(in_.Remote) |
| out_ := directoryAdminMountResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminMountAndCreateOrdinal: |
| in_ := directoryAdminMountAndCreateRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| s, err_ := s.Impl.MountAndCreate(in_.Remote, in_.Name, in_.Flags) |
| out_ := directoryAdminMountAndCreateResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminUnmountOrdinal: |
| s, err_ := s.Impl.Unmount() |
| out_ := directoryAdminUnmountResponse{} |
| out_.S = s |
| return &out_, err_ |
| case DirectoryAdminUnmountNodeOrdinal: |
| s, remote, err_ := s.Impl.UnmountNode() |
| out_ := directoryAdminUnmountNodeResponse{} |
| out_.S = s |
| out_.Remote = remote |
| return &out_, err_ |
| case DirectoryAdminQueryFilesystemOrdinal: |
| s, info, err_ := s.Impl.QueryFilesystem() |
| out_ := directoryAdminQueryFilesystemResponse{} |
| out_.S = s |
| out_.Info = info |
| return &out_, err_ |
| case DirectoryAdminGetDevicePathOrdinal: |
| s, path, err_ := s.Impl.GetDevicePath() |
| out_ := directoryAdminGetDevicePathResponse{} |
| out_.S = s |
| out_.Path = path |
| return &out_, err_ |
| } |
| return nil, _bindings.ErrUnknownOrdinal |
| } |
| |
| type DirectoryAdminService struct { |
| _bindings.BindingSet |
| } |
| |
| func (s *DirectoryAdminService) Add(impl DirectoryAdmin, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) { |
| return s.BindingSet.Add(&DirectoryAdminStub{Impl: impl}, c, onError) |
| } |
| |
| func (s *DirectoryAdminService) EventProxyFor(key _bindings.BindingKey) (*DirectoryAdminEventProxy, bool) { |
| pxy, err := s.BindingSet.ProxyFor(key) |
| return (*DirectoryAdminEventProxy)(pxy), err |
| } |
| |
| type DirectoryAdminEventProxy _bindings.ChannelProxy |
| |
| func (p *DirectoryAdminEventProxy) OnOpen(s int32, info *NodeInfo) error { |
| event_ := &directoryAdminOnOpenResponse{ |
| S: s, |
| Info: info, |
| } |
| return ((*_bindings.ChannelProxy)(p)).Send(DirectoryAdminOnOpenOrdinal, event_) |
| } |