| // 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 ( |
| // 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 |
| MaxBuf uint64 = 8192 |
| MaxPath uint64 = 4096 |
| 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 |
| // Dirent type information associated with the results of ReadDirents. |
| DirentTypeUnknown uint8 = 0 |
| DirentTypeDirectory uint8 = 4 |
| DirentTypeBlockDevice uint8 = 6 |
| DirentTypeFile uint8 = 8 |
| DirentTypeSocket uint8 = 12 |
| 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 |
| // The following are bitmasks corresponding to the "watch events". |
| // They may be used as arguments to the Directory Watch method, to |
| // specify which events should receive notifications. |
| WatchMaskDeleted uint32 = 0x00000001 |
| WatchMaskAdded uint32 = 0x00000002 |
| WatchMaskRemoved uint32 = 0x00000004 |
| WatchMaskExisting uint32 = 0x00000008 |
| WatchMaskIdle uint32 = 0x00000010 |
| 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"` |
| Reserved uint8 |
| } |
| |
| 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"` |
| 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"` |
| Reserved uint8 |
| } |
| |
| 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 accompanied by a VMO. |
| type Vmofile struct { |
| _ struct{} `fidl2:"s,24,8"` |
| Vmo _zx.VMO `fidl2:"0"` |
| Offset uint64 |
| 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"` |
| 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 |
| } |
| |
| // 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 |
| } |
| |
| // WARNING(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 |
| ) |
| |
| // 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 |
| } |
| |
| // 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 |
| } |
| |
| 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) { |
| 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 |
| } |
| |
| // Read '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 |
| } |
| |
| // Read '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 |
| } |
| |
| // Write 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 |
| } |
| |
| // Write 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 |
| } |
| |
| // Shrink 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 |
| } |
| |
| // Acquire 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 |
| } |
| |
| // Change 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 |
| } |
| |
| // Acquire a VMO 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) |
| // Read '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) |
| // Read '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) |
| // Write 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) |
| // Write 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) |
| // Shrink the file size to 'length' bytes. |
| // |
| // This method requires following rights: OPEN_RIGHT_WRITABLE. |
| Truncate(length uint64) (int32, error) |
| // Acquire the Directory::Open rights and flags used to access this file. |
| // |
| // This method does not require any rights. |
| GetFlags() (int32, uint32, error) |
| // Change 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) |
| // Acquire a VMO 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) { |
| 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 |
| } |
| |
| // WARNING(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) { |
| 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 |
| } |
| |
| // Open 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. |
| 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 |
| } |
| |
| // Remove an object relative to this directory object. |
| 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 |
| } |
| |
| // Reset 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 |
| } |
| |
| // Acquire 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 |
| } |
| |
| // Within the directory, rename 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 |
| } |
| |
| // Within the directory, create 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. |
| // |
| // 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) |
| // Open 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. |
| Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error |
| // Remove an object relative to this directory object. |
| 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) |
| // Reset the directory seek offset. |
| Rewind() (int32, error) |
| // Acquire 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) |
| // Within the directory, rename an object named src to the name dst, in |
| // a directory represented by token. |
| Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error) |
| // Within the directory, create 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. |
| // |
| // 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) { |
| 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 |
| } |
| |
| // Open 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. |
| 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 |
| } |
| |
| // Remove an object relative to this directory object. |
| 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 |
| } |
| |
| // Reset 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 |
| } |
| |
| // Acquire 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 |
| } |
| |
| // Within the directory, rename 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 |
| } |
| |
| // Within the directory, create 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. |
| // |
| // 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) |
| // Open 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. |
| Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error |
| // Remove an object relative to this directory object. |
| 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) |
| // Reset the directory seek offset. |
| Rewind() (int32, error) |
| // Acquire 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) |
| // Within the directory, rename an object named src to the name dst, in |
| // a directory represented by token. |
| Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error) |
| // Within the directory, create 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. |
| // |
| // 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) { |
| 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_) |
| } |