| // Copyright 2018 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| // +build fuchsia |
| |
| package io |
| |
| import ( |
| _bindings "syscall/zx/fidl" |
| _zx "syscall/zx" |
| ) |
| |
| const ( |
| KOpenRightReadable uint32 = 0x00000001 |
| KOpenRightWritable uint32 = 0x00000002 |
| KOpenRightAdmin uint32 = 0x00000004 |
| KOpenFlagCreate uint32 = 0x00010000 |
| KOpenFlagCreateIfAbsent uint32 = 0x00020000 |
| KOpenFlagTruncate uint32 = 0x00040000 |
| KOpenFlagDirectory uint32 = 0x00080000 |
| KOpenFlagAppend uint32 = 0x00100000 |
| KOpenFlagNoRemote uint32 = 0x00200000 |
| KOpenFlagNodeReference uint32 = 0x00400000 |
| KOpenFlagDescribe uint32 = 0x00800000 |
| KOpenFlagStatus uint32 = 0x01000000 |
| KModeProtectionMask uint32 = 0x00FFF |
| KModeTypeMask uint32 = 0xFF000 |
| KModeTypeDirectory uint32 = 0x04000 |
| KModeTypeBlockDevice uint32 = 0x06000 |
| KModeTypeFile uint32 = 0x08000 |
| KModeTypeSocket uint32 = 0x0C000 |
| KModeTypeService uint32 = 0x10000 |
| KMaxIoctlHandles uint64 = 2 |
| KMaxBuf uint64 = 8192 |
| KNodeAttributeFlagCreationTime uint32 = 0x00000001 |
| KNodeAttributeFlagModificationTime uint32 = 0x00000002 |
| KVmoFlagRead uint32 = 0x00000001 |
| KVmoFlagWrite uint32 = 0x00000002 |
| KVmoFlagExec uint32 = 0x00000004 |
| KVmoFlagPrivate uint32 = 0x00010000 |
| KDirentTypeUnknown uint32 = 0 |
| KDirentTypeDirectory uint32 = 4 |
| KDirentTypeBlockDevice uint32 = 6 |
| KDirentTypeFile uint32 = 8 |
| KDirentTypeSocket uint32 = 12 |
| KDirentTypeService uint32 = 16 |
| ) |
| |
| type SeekOrigin uint32 |
| const ( |
| SeekOriginStart SeekOrigin = 0 |
| SeekOriginCurrent SeekOrigin = 1 |
| SeekOriginEnd SeekOrigin = 2 |
| ) |
| type Service struct { |
| Reserved uint8 |
| } |
| |
| // Implements Payload. |
| func (_ *Service) InlineAlignment() int { |
| return 1 |
| } |
| |
| // Implements Payload. |
| func (_ *Service) InlineSize() int { |
| return 1 |
| } |
| type FileObject struct { |
| Event _zx.Event `fidl:"*"` |
| } |
| |
| // Implements Payload. |
| func (_ *FileObject) InlineAlignment() int { |
| return 4 |
| } |
| |
| // Implements Payload. |
| func (_ *FileObject) InlineSize() int { |
| return 4 |
| } |
| type DirectoryObject struct { |
| Reserved uint8 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryObject) InlineAlignment() int { |
| return 1 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryObject) InlineSize() int { |
| return 1 |
| } |
| type Pipe struct { |
| Socket _zx.Socket |
| } |
| |
| // Implements Payload. |
| func (_ *Pipe) InlineAlignment() int { |
| return 4 |
| } |
| |
| // Implements Payload. |
| func (_ *Pipe) InlineSize() int { |
| return 4 |
| } |
| type Vmofile struct { |
| Vmo _zx.VMO |
| Offset uint64 |
| Length uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *Vmofile) InlineAlignment() int { |
| return 8 |
| } |
| |
| // Implements Payload. |
| func (_ *Vmofile) InlineSize() int { |
| return 24 |
| } |
| type Device struct { |
| Event _zx.Event `fidl:"*"` |
| } |
| |
| // Implements Payload. |
| func (_ *Device) InlineAlignment() int { |
| return 4 |
| } |
| |
| // Implements Payload. |
| func (_ *Device) InlineSize() int { |
| return 4 |
| } |
| type NodeAttributes struct { |
| Mode uint32 |
| Id uint64 |
| ContentSize uint64 |
| StorageSize uint64 |
| LinkCount uint64 |
| CreationTime uint64 |
| ModificationTime uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeAttributes) InlineAlignment() int { |
| return 8 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeAttributes) InlineSize() int { |
| return 56 |
| } |
| type ObjectInfoTag uint32 |
| const ( |
| ObjectInfoService ObjectInfoTag = iota |
| ObjectInfoFile ObjectInfoTag = iota |
| ObjectInfoDirectory ObjectInfoTag = iota |
| ObjectInfoPipe ObjectInfoTag = iota |
| ObjectInfoVmofile ObjectInfoTag = iota |
| ObjectInfoDevice ObjectInfoTag = iota |
| ) |
| |
| // ObjectInfo is a FIDL union. |
| type ObjectInfo struct { |
| ObjectInfoTag `fidl:"tag"` |
| Service Service |
| File FileObject |
| Directory DirectoryObject |
| Pipe Pipe |
| Vmofile Vmofile |
| Device Device |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectInfo) InlineAlignment() int { |
| return 8 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectInfo) InlineSize() int { |
| return 32 |
| } |
| |
| func (u *ObjectInfo) Which() ObjectInfoTag { |
| return u.ObjectInfoTag |
| } |
| |
| func (u *ObjectInfo) SetService(service Service) { |
| u.ObjectInfoTag = ObjectInfoService |
| u.Service = service |
| } |
| |
| func (u *ObjectInfo) SetFile(file FileObject) { |
| u.ObjectInfoTag = ObjectInfoFile |
| u.File = file |
| } |
| |
| func (u *ObjectInfo) SetDirectory(directory DirectoryObject) { |
| u.ObjectInfoTag = ObjectInfoDirectory |
| u.Directory = directory |
| } |
| |
| func (u *ObjectInfo) SetPipe(pipe Pipe) { |
| u.ObjectInfoTag = ObjectInfoPipe |
| u.Pipe = pipe |
| } |
| |
| func (u *ObjectInfo) SetVmofile(vmofile Vmofile) { |
| u.ObjectInfoTag = ObjectInfoVmofile |
| u.Vmofile = vmofile |
| } |
| |
| func (u *ObjectInfo) SetDevice(device Device) { |
| u.ObjectInfoTag = ObjectInfoDevice |
| u.Device = device |
| } |
| |
| // Request for Clone. |
| type ObjectCloneRequest struct { |
| Flags uint32 |
| Object ObjectInterfaceRequest |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectCloneRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectCloneRequest) InlineSize() int { |
| return 8 |
| } |
| // Clone has no response. |
| // Request for Close. |
| type ObjectCloseRequest struct { |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectCloseRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectCloseRequest) InlineSize() int { |
| return 0 |
| } |
| // Response for Close. |
| type ObjectCloseResponse struct { |
| S _zx.Status |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectCloseResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectCloseResponse) InlineSize() int { |
| return 4 |
| } |
| // Request for ListInterfaces. |
| type ObjectListInterfacesRequest struct { |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectListInterfacesRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectListInterfacesRequest) InlineSize() int { |
| return 0 |
| } |
| // Response for ListInterfaces. |
| type ObjectListInterfacesResponse struct { |
| Interfaces []string |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectListInterfacesResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectListInterfacesResponse) InlineSize() int { |
| return 16 |
| } |
| // Request for Bind. |
| type ObjectBindRequest struct { |
| Iface string |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectBindRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectBindRequest) InlineSize() int { |
| return 16 |
| } |
| // Bind has no response. |
| // Request for Describe. |
| type ObjectDescribeRequest struct { |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectDescribeRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectDescribeRequest) InlineSize() int { |
| return 0 |
| } |
| // Response for Describe. |
| type ObjectDescribeResponse struct { |
| Info ObjectInfo |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectDescribeResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectDescribeResponse) InlineSize() int { |
| return 32 |
| } |
| // Request for OnOpen. |
| // OnOpen has no request. |
| // Response for OnOpen. |
| type ObjectOnOpenResponse struct { |
| S _zx.Status |
| Info *ObjectInfo |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectOnOpenResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *ObjectOnOpenResponse) InlineSize() int { |
| return 16 |
| } |
| |
| type ObjectInterface _bindings.Proxy |
| |
| func (p *ObjectInterface) Clone(flags uint32,object ObjectInterfaceRequest) error { |
| req_ := ObjectCloneRequest{ |
| Flags: flags, |
| Object: object, |
| } |
| err := ((*_bindings.Proxy)(p)).Send(2147483649, &req_) |
| return err |
| } |
| func (p *ObjectInterface) Close() (_zx.Status, error) { |
| req_ := ObjectCloseRequest{ |
| } |
| resp_ := ObjectCloseResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2147483650, &req_, &resp_) |
| return resp_.S, err |
| } |
| func (p *ObjectInterface) ListInterfaces() ([]string, error) { |
| req_ := ObjectListInterfacesRequest{ |
| } |
| resp_ := ObjectListInterfacesResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2147483652, &req_, &resp_) |
| return resp_.Interfaces, err |
| } |
| func (p *ObjectInterface) Bind(iface string) error { |
| req_ := ObjectBindRequest{ |
| Iface: iface, |
| } |
| err := ((*_bindings.Proxy)(p)).Send(2147483653, &req_) |
| return err |
| } |
| func (p *ObjectInterface) Describe() (ObjectInfo, error) { |
| req_ := ObjectDescribeRequest{ |
| } |
| resp_ := ObjectDescribeResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2147483654, &req_, &resp_) |
| return resp_.Info, err |
| } |
| func (p *ObjectInterface) ExpectOnOpen() (_zx.Status, *ObjectInfo, error) { |
| resp_ := ObjectOnOpenResponse{} |
| err := ((*_bindings.Proxy)(p)).Recv(2147483655, &resp_) |
| return resp_.S, resp_.Info, err |
| } |
| |
| // Object server interface. |
| type Object interface { |
| Clone(flags uint32,object ObjectInterfaceRequest) error |
| Close() (_zx.Status, error) |
| ListInterfaces() ([]string, error) |
| Bind(iface string) error |
| Describe() (ObjectInfo, error) |
| } |
| |
| type ObjectInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewObjectInterfaceRequest() (ObjectInterfaceRequest, *ObjectInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return ObjectInterfaceRequest(req), (*ObjectInterface)(cli), err |
| } |
| |
| type ObjectStub struct { |
| Impl Object |
| } |
| |
| func (s *ObjectStub) Dispatch(ord uint32, b_ []byte, h_ []_zx.Handle) (_bindings.Payload, error) { |
| switch ord { |
| case 2147483649: |
| in_ := ObjectCloneRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Clone(in_.Flags,in_.Object) |
| return nil, err_ |
| case 2147483650: |
| in_ := ObjectCloseRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectCloseResponse{} |
| s, err_ := s.Impl.Close() |
| out_.S = s |
| return &out_, err_ |
| case 2147483652: |
| in_ := ObjectListInterfacesRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectListInterfacesResponse{} |
| interfaces, err_ := s.Impl.ListInterfaces() |
| out_.Interfaces = interfaces |
| return &out_, err_ |
| case 2147483653: |
| in_ := ObjectBindRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Bind(in_.Iface) |
| return nil, err_ |
| case 2147483654: |
| in_ := ObjectDescribeRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectDescribeResponse{} |
| info, err_ := s.Impl.Describe() |
| out_.Info = info |
| return &out_, err_ |
| } |
| return nil, _bindings.ErrUnknownOrdinal |
| } |
| |
| type ObjectService struct { |
| _bindings.BindingSet |
| } |
| |
| func (s *ObjectService) Add(impl Object, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) { |
| return s.BindingSet.Add(&ObjectStub{Impl: impl}, c, onError) |
| } |
| |
| func (s *ObjectService) EventProxyFor(key _bindings.BindingKey) (*ObjectEventProxy, bool) { |
| pxy, err := s.BindingSet.ProxyFor(key) |
| return (*ObjectEventProxy)(pxy), err |
| } |
| |
| type ObjectEventProxy _bindings.Proxy |
| |
| func (p *ObjectEventProxy) OnOpen(s _zx.Status,info *ObjectInfo) error { |
| event_ := ObjectOnOpenResponse{ |
| S: s, |
| Info: info, |
| } |
| return ((*_bindings.Proxy)(p)).Send(2147483655, &event_) |
| } |
| |
| |
| |
| // Request for Sync. |
| type NodeSyncRequest struct { |
| } |
| |
| // Implements Payload. |
| func (_ *NodeSyncRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeSyncRequest) InlineSize() int { |
| return 0 |
| } |
| // Response for Sync. |
| type NodeSyncResponse struct { |
| S _zx.Status |
| } |
| |
| // Implements Payload. |
| func (_ *NodeSyncResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeSyncResponse) InlineSize() int { |
| return 4 |
| } |
| // Request for GetAttr. |
| type NodeGetAttrRequest struct { |
| } |
| |
| // Implements Payload. |
| func (_ *NodeGetAttrRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeGetAttrRequest) InlineSize() int { |
| return 0 |
| } |
| // Response for GetAttr. |
| type NodeGetAttrResponse struct { |
| S _zx.Status |
| Attributes NodeAttributes |
| } |
| |
| // Implements Payload. |
| func (_ *NodeGetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeGetAttrResponse) InlineSize() int { |
| return 64 |
| } |
| // Request for SetAttr. |
| type NodeSetAttrRequest struct { |
| Flags uint32 |
| Attributes NodeAttributes |
| } |
| |
| // Implements Payload. |
| func (_ *NodeSetAttrRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeSetAttrRequest) InlineSize() int { |
| return 64 |
| } |
| // Response for SetAttr. |
| type NodeSetAttrResponse struct { |
| S _zx.Status |
| } |
| |
| // Implements Payload. |
| func (_ *NodeSetAttrResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeSetAttrResponse) InlineSize() int { |
| return 4 |
| } |
| // Request for Ioctl. |
| type NodeIoctlRequest struct { |
| Opcode uint32 |
| MaxOut uint64 |
| Handles []_zx.Handle `fidl:"2"` |
| In []uint8 `fidl:"8192"` |
| } |
| |
| // Implements Payload. |
| func (_ *NodeIoctlRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeIoctlRequest) InlineSize() int { |
| return 48 |
| } |
| // Response for Ioctl. |
| type NodeIoctlResponse struct { |
| S _zx.Status |
| Handles []_zx.Handle `fidl:"2"` |
| Out []uint8 `fidl:"8192"` |
| } |
| |
| // Implements Payload. |
| func (_ *NodeIoctlResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *NodeIoctlResponse) InlineSize() int { |
| return 40 |
| } |
| |
| type NodeInterface _bindings.Proxy |
| |
| func (p *NodeInterface) Sync() (_zx.Status, error) { |
| req_ := NodeSyncRequest{ |
| } |
| resp_ := NodeSyncResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2164260865, &req_, &resp_) |
| return resp_.S, err |
| } |
| func (p *NodeInterface) GetAttr() (_zx.Status, NodeAttributes, error) { |
| req_ := NodeGetAttrRequest{ |
| } |
| resp_ := NodeGetAttrResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2164260866, &req_, &resp_) |
| return resp_.S, resp_.Attributes, err |
| } |
| func (p *NodeInterface) SetAttr(flags uint32,attributes NodeAttributes) (_zx.Status, error) { |
| req_ := NodeSetAttrRequest{ |
| Flags: flags, |
| Attributes: attributes, |
| } |
| resp_ := NodeSetAttrResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2164260867, &req_, &resp_) |
| return resp_.S, err |
| } |
| func (p *NodeInterface) Ioctl(opcode uint32,maxOut uint64,handles []_zx.Handle,in []uint8) (_zx.Status, []_zx.Handle, []uint8, error) { |
| req_ := NodeIoctlRequest{ |
| Opcode: opcode, |
| MaxOut: maxOut, |
| Handles: handles, |
| In: in, |
| } |
| resp_ := NodeIoctlResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2164260868, &req_, &resp_) |
| return resp_.S, resp_.Handles, resp_.Out, err |
| } |
| |
| // Node server interface. |
| type Node interface { |
| Clone(flags uint32,object ObjectInterfaceRequest) error |
| Close() (_zx.Status, error) |
| ListInterfaces() ([]string, error) |
| Bind(iface string) error |
| Describe() (ObjectInfo, error) |
| Sync() (_zx.Status, error) |
| GetAttr() (_zx.Status, NodeAttributes, error) |
| SetAttr(flags uint32,attributes NodeAttributes) (_zx.Status, error) |
| Ioctl(opcode uint32,maxOut uint64,handles []_zx.Handle,in []uint8) (_zx.Status, []_zx.Handle, []uint8, error) |
| } |
| |
| 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 2147483649: |
| in_ := ObjectCloneRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Clone(in_.Flags,in_.Object) |
| return nil, err_ |
| case 2147483650: |
| in_ := ObjectCloseRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectCloseResponse{} |
| s, err_ := s.Impl.Close() |
| out_.S = s |
| return &out_, err_ |
| case 2147483652: |
| in_ := ObjectListInterfacesRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectListInterfacesResponse{} |
| interfaces, err_ := s.Impl.ListInterfaces() |
| out_.Interfaces = interfaces |
| return &out_, err_ |
| case 2147483653: |
| in_ := ObjectBindRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Bind(in_.Iface) |
| return nil, err_ |
| case 2147483654: |
| in_ := ObjectDescribeRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectDescribeResponse{} |
| info, err_ := s.Impl.Describe() |
| out_.Info = info |
| return &out_, err_ |
| case 2164260865: |
| in_ := NodeSyncRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeSyncResponse{} |
| s, err_ := s.Impl.Sync() |
| out_.S = s |
| return &out_, err_ |
| case 2164260866: |
| in_ := NodeGetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeGetAttrResponse{} |
| s, attributes, err_ := s.Impl.GetAttr() |
| out_.S = s |
| out_.Attributes = attributes |
| return &out_, err_ |
| case 2164260867: |
| in_ := NodeSetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeSetAttrResponse{} |
| s, err_ := s.Impl.SetAttr(in_.Flags,in_.Attributes) |
| out_.S = s |
| return &out_, err_ |
| case 2164260868: |
| in_ := NodeIoctlRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeIoctlResponse{} |
| s, handles, out, err_ := s.Impl.Ioctl(in_.Opcode,in_.MaxOut,in_.Handles,in_.In) |
| 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.Proxy |
| |
| func (p *NodeEventProxy) OnOpen(s _zx.Status,info *ObjectInfo) error { |
| event_ := ObjectOnOpenResponse{ |
| S: s, |
| Info: info, |
| } |
| return ((*_bindings.Proxy)(p)).Send(2147483655, &event_) |
| } |
| |
| |
| |
| // Request for Read. |
| type FileReadRequest struct { |
| Count uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *FileReadRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileReadRequest) InlineSize() int { |
| return 8 |
| } |
| // Response for Read. |
| type FileReadResponse struct { |
| S _zx.Status |
| Data []uint8 `fidl:"8192"` |
| } |
| |
| // Implements Payload. |
| func (_ *FileReadResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileReadResponse) InlineSize() int { |
| return 24 |
| } |
| // Request for ReadAt. |
| type FileReadAtRequest struct { |
| Count uint64 |
| Offset uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *FileReadAtRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileReadAtRequest) InlineSize() int { |
| return 16 |
| } |
| // Response for ReadAt. |
| type FileReadAtResponse struct { |
| S _zx.Status |
| Data []uint8 `fidl:"8192"` |
| } |
| |
| // Implements Payload. |
| func (_ *FileReadAtResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileReadAtResponse) InlineSize() int { |
| return 24 |
| } |
| // Request for Write. |
| type FileWriteRequest struct { |
| Data []uint8 `fidl:"8192"` |
| } |
| |
| // Implements Payload. |
| func (_ *FileWriteRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileWriteRequest) InlineSize() int { |
| return 16 |
| } |
| // Response for Write. |
| type FileWriteResponse struct { |
| S _zx.Status |
| Actual uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *FileWriteResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileWriteResponse) InlineSize() int { |
| return 16 |
| } |
| // Request for WriteAt. |
| type FileWriteAtRequest struct { |
| Data []uint8 `fidl:"8192"` |
| Offset uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *FileWriteAtRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileWriteAtRequest) InlineSize() int { |
| return 24 |
| } |
| // Response for WriteAt. |
| type FileWriteAtResponse struct { |
| S _zx.Status |
| Actual uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *FileWriteAtResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileWriteAtResponse) InlineSize() int { |
| return 16 |
| } |
| // Request for Seek. |
| type FileSeekRequest struct { |
| Offset int64 |
| Start SeekOrigin |
| } |
| |
| // Implements Payload. |
| func (_ *FileSeekRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileSeekRequest) InlineSize() int { |
| return 16 |
| } |
| // Response for Seek. |
| type FileSeekResponse struct { |
| S _zx.Status |
| Offset uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *FileSeekResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileSeekResponse) InlineSize() int { |
| return 16 |
| } |
| // Request for Truncate. |
| type FileTruncateRequest struct { |
| Length uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *FileTruncateRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileTruncateRequest) InlineSize() int { |
| return 8 |
| } |
| // Response for Truncate. |
| type FileTruncateResponse struct { |
| S _zx.Status |
| } |
| |
| // Implements Payload. |
| func (_ *FileTruncateResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileTruncateResponse) InlineSize() int { |
| return 4 |
| } |
| // Request for GetFlags. |
| type FileGetFlagsRequest struct { |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetFlagsRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetFlagsRequest) InlineSize() int { |
| return 0 |
| } |
| // Response for GetFlags. |
| type FileGetFlagsResponse struct { |
| S _zx.Status |
| Flags uint32 |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetFlagsResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetFlagsResponse) InlineSize() int { |
| return 8 |
| } |
| // Request for SetFlags. |
| type FileSetFlagsRequest struct { |
| Flags uint32 |
| } |
| |
| // Implements Payload. |
| func (_ *FileSetFlagsRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileSetFlagsRequest) InlineSize() int { |
| return 4 |
| } |
| // Response for SetFlags. |
| type FileSetFlagsResponse struct { |
| S _zx.Status |
| } |
| |
| // Implements Payload. |
| func (_ *FileSetFlagsResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileSetFlagsResponse) InlineSize() int { |
| return 4 |
| } |
| // Request for GetVmo. |
| type FileGetVmoRequest struct { |
| Flags uint32 |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetVmoRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetVmoRequest) InlineSize() int { |
| return 4 |
| } |
| // Response for GetVmo. |
| type FileGetVmoResponse struct { |
| S _zx.Status |
| Vmo _zx.VMO |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetVmoResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetVmoResponse) InlineSize() int { |
| return 8 |
| } |
| // Request for GetVmoAt. |
| type FileGetVmoAtRequest struct { |
| Flags uint32 |
| Offset uint64 |
| Length uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetVmoAtRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetVmoAtRequest) InlineSize() int { |
| return 24 |
| } |
| // Response for GetVmoAt. |
| type FileGetVmoAtResponse struct { |
| S _zx.Status |
| Vmo _zx.VMO |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetVmoAtResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *FileGetVmoAtResponse) InlineSize() int { |
| return 8 |
| } |
| |
| type FileInterface _bindings.Proxy |
| |
| func (p *FileInterface) Read(count uint64) (_zx.Status, []uint8, error) { |
| req_ := FileReadRequest{ |
| Count: count, |
| } |
| resp_ := FileReadResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038081, &req_, &resp_) |
| return resp_.S, resp_.Data, err |
| } |
| func (p *FileInterface) ReadAt(count uint64,offset uint64) (_zx.Status, []uint8, error) { |
| req_ := FileReadAtRequest{ |
| Count: count, |
| Offset: offset, |
| } |
| resp_ := FileReadAtResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038082, &req_, &resp_) |
| return resp_.S, resp_.Data, err |
| } |
| func (p *FileInterface) Write(data []uint8) (_zx.Status, uint64, error) { |
| req_ := FileWriteRequest{ |
| Data: data, |
| } |
| resp_ := FileWriteResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038083, &req_, &resp_) |
| return resp_.S, resp_.Actual, err |
| } |
| func (p *FileInterface) WriteAt(data []uint8,offset uint64) (_zx.Status, uint64, error) { |
| req_ := FileWriteAtRequest{ |
| Data: data, |
| Offset: offset, |
| } |
| resp_ := FileWriteAtResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038084, &req_, &resp_) |
| return resp_.S, resp_.Actual, err |
| } |
| func (p *FileInterface) Seek(offset int64,start SeekOrigin) (_zx.Status, uint64, error) { |
| req_ := FileSeekRequest{ |
| Offset: offset, |
| Start: start, |
| } |
| resp_ := FileSeekResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038085, &req_, &resp_) |
| return resp_.S, resp_.Offset, err |
| } |
| func (p *FileInterface) Truncate(length uint64) (_zx.Status, error) { |
| req_ := FileTruncateRequest{ |
| Length: length, |
| } |
| resp_ := FileTruncateResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038086, &req_, &resp_) |
| return resp_.S, err |
| } |
| func (p *FileInterface) GetFlags() (_zx.Status, uint32, error) { |
| req_ := FileGetFlagsRequest{ |
| } |
| resp_ := FileGetFlagsResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038087, &req_, &resp_) |
| return resp_.S, resp_.Flags, err |
| } |
| func (p *FileInterface) SetFlags(flags uint32) (_zx.Status, error) { |
| req_ := FileSetFlagsRequest{ |
| Flags: flags, |
| } |
| resp_ := FileSetFlagsResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038088, &req_, &resp_) |
| return resp_.S, err |
| } |
| func (p *FileInterface) GetVmo(flags uint32) (_zx.Status, _zx.VMO, error) { |
| req_ := FileGetVmoRequest{ |
| Flags: flags, |
| } |
| resp_ := FileGetVmoResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038089, &req_, &resp_) |
| return resp_.S, resp_.Vmo, err |
| } |
| func (p *FileInterface) GetVmoAt(flags uint32,offset uint64,length uint64) (_zx.Status, _zx.VMO, error) { |
| req_ := FileGetVmoAtRequest{ |
| Flags: flags, |
| Offset: offset, |
| Length: length, |
| } |
| resp_ := FileGetVmoAtResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2181038090, &req_, &resp_) |
| return resp_.S, resp_.Vmo, err |
| } |
| |
| // File server interface. |
| type File interface { |
| Clone(flags uint32,object ObjectInterfaceRequest) error |
| Close() (_zx.Status, error) |
| ListInterfaces() ([]string, error) |
| Bind(iface string) error |
| Describe() (ObjectInfo, error) |
| Sync() (_zx.Status, error) |
| GetAttr() (_zx.Status, NodeAttributes, error) |
| SetAttr(flags uint32,attributes NodeAttributes) (_zx.Status, error) |
| Ioctl(opcode uint32,maxOut uint64,handles []_zx.Handle,in []uint8) (_zx.Status, []_zx.Handle, []uint8, error) |
| Read(count uint64) (_zx.Status, []uint8, error) |
| ReadAt(count uint64,offset uint64) (_zx.Status, []uint8, error) |
| Write(data []uint8) (_zx.Status, uint64, error) |
| WriteAt(data []uint8,offset uint64) (_zx.Status, uint64, error) |
| Seek(offset int64,start SeekOrigin) (_zx.Status, uint64, error) |
| Truncate(length uint64) (_zx.Status, error) |
| GetFlags() (_zx.Status, uint32, error) |
| SetFlags(flags uint32) (_zx.Status, error) |
| GetVmo(flags uint32) (_zx.Status, _zx.VMO, error) |
| GetVmoAt(flags uint32,offset uint64,length uint64) (_zx.Status, _zx.VMO, error) |
| } |
| |
| 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 2147483649: |
| in_ := ObjectCloneRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Clone(in_.Flags,in_.Object) |
| return nil, err_ |
| case 2147483650: |
| in_ := ObjectCloseRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectCloseResponse{} |
| s, err_ := s.Impl.Close() |
| out_.S = s |
| return &out_, err_ |
| case 2147483652: |
| in_ := ObjectListInterfacesRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectListInterfacesResponse{} |
| interfaces, err_ := s.Impl.ListInterfaces() |
| out_.Interfaces = interfaces |
| return &out_, err_ |
| case 2147483653: |
| in_ := ObjectBindRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Bind(in_.Iface) |
| return nil, err_ |
| case 2147483654: |
| in_ := ObjectDescribeRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectDescribeResponse{} |
| info, err_ := s.Impl.Describe() |
| out_.Info = info |
| return &out_, err_ |
| case 2164260865: |
| in_ := NodeSyncRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeSyncResponse{} |
| s, err_ := s.Impl.Sync() |
| out_.S = s |
| return &out_, err_ |
| case 2164260866: |
| in_ := NodeGetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeGetAttrResponse{} |
| s, attributes, err_ := s.Impl.GetAttr() |
| out_.S = s |
| out_.Attributes = attributes |
| return &out_, err_ |
| case 2164260867: |
| in_ := NodeSetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeSetAttrResponse{} |
| s, err_ := s.Impl.SetAttr(in_.Flags,in_.Attributes) |
| out_.S = s |
| return &out_, err_ |
| case 2164260868: |
| in_ := NodeIoctlRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeIoctlResponse{} |
| s, handles, out, err_ := s.Impl.Ioctl(in_.Opcode,in_.MaxOut,in_.Handles,in_.In) |
| out_.S = s |
| out_.Handles = handles |
| out_.Out = out |
| return &out_, err_ |
| case 2181038081: |
| in_ := FileReadRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileReadResponse{} |
| s, data, err_ := s.Impl.Read(in_.Count) |
| out_.S = s |
| out_.Data = data |
| return &out_, err_ |
| case 2181038082: |
| in_ := FileReadAtRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileReadAtResponse{} |
| s, data, err_ := s.Impl.ReadAt(in_.Count,in_.Offset) |
| out_.S = s |
| out_.Data = data |
| return &out_, err_ |
| case 2181038083: |
| in_ := FileWriteRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileWriteResponse{} |
| s, actual, err_ := s.Impl.Write(in_.Data) |
| out_.S = s |
| out_.Actual = actual |
| return &out_, err_ |
| case 2181038084: |
| in_ := FileWriteAtRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileWriteAtResponse{} |
| s, actual, err_ := s.Impl.WriteAt(in_.Data,in_.Offset) |
| out_.S = s |
| out_.Actual = actual |
| return &out_, err_ |
| case 2181038085: |
| in_ := FileSeekRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileSeekResponse{} |
| s, offset, err_ := s.Impl.Seek(in_.Offset,in_.Start) |
| out_.S = s |
| out_.Offset = offset |
| return &out_, err_ |
| case 2181038086: |
| in_ := FileTruncateRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileTruncateResponse{} |
| s, err_ := s.Impl.Truncate(in_.Length) |
| out_.S = s |
| return &out_, err_ |
| case 2181038087: |
| in_ := FileGetFlagsRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileGetFlagsResponse{} |
| s, flags, err_ := s.Impl.GetFlags() |
| out_.S = s |
| out_.Flags = flags |
| return &out_, err_ |
| case 2181038088: |
| in_ := FileSetFlagsRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileSetFlagsResponse{} |
| s, err_ := s.Impl.SetFlags(in_.Flags) |
| out_.S = s |
| return &out_, err_ |
| case 2181038089: |
| in_ := FileGetVmoRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileGetVmoResponse{} |
| s, vmo, err_ := s.Impl.GetVmo(in_.Flags) |
| out_.S = s |
| out_.Vmo = vmo |
| return &out_, err_ |
| case 2181038090: |
| in_ := FileGetVmoAtRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := FileGetVmoAtResponse{} |
| s, vmo, err_ := s.Impl.GetVmoAt(in_.Flags,in_.Offset,in_.Length) |
| out_.S = s |
| out_.Vmo = vmo |
| 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.Proxy |
| |
| func (p *FileEventProxy) OnOpen(s _zx.Status,info *ObjectInfo) error { |
| event_ := ObjectOnOpenResponse{ |
| S: s, |
| Info: info, |
| } |
| return ((*_bindings.Proxy)(p)).Send(2147483655, &event_) |
| } |
| |
| |
| |
| // Request for Open. |
| type DirectoryOpenRequest struct { |
| Flags uint32 |
| Mode uint32 |
| Path string |
| Object ObjectInterfaceRequest |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryOpenRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryOpenRequest) InlineSize() int { |
| return 32 |
| } |
| // Open has no response. |
| // Request for Unlink. |
| type DirectoryUnlinkRequest struct { |
| Path string |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryUnlinkRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryUnlinkRequest) InlineSize() int { |
| return 16 |
| } |
| // Response for Unlink. |
| type DirectoryUnlinkResponse struct { |
| S _zx.Status |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryUnlinkResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryUnlinkResponse) InlineSize() int { |
| return 4 |
| } |
| // Request for ReadDirents. |
| type DirectoryReadDirentsRequest struct { |
| MaxOut uint64 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryReadDirentsRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryReadDirentsRequest) InlineSize() int { |
| return 8 |
| } |
| // Response for ReadDirents. |
| type DirectoryReadDirentsResponse struct { |
| S _zx.Status |
| Dirents []uint8 `fidl:"8192"` |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryReadDirentsResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryReadDirentsResponse) InlineSize() int { |
| return 24 |
| } |
| // Request for Rewind. |
| type DirectoryRewindRequest struct { |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryRewindRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryRewindRequest) InlineSize() int { |
| return 0 |
| } |
| // Response for Rewind. |
| type DirectoryRewindResponse struct { |
| S _zx.Status |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryRewindResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryRewindResponse) InlineSize() int { |
| return 4 |
| } |
| // Request for GetToken. |
| type DirectoryGetTokenRequest struct { |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryGetTokenRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryGetTokenRequest) InlineSize() int { |
| return 0 |
| } |
| // Response for GetToken. |
| type DirectoryGetTokenResponse struct { |
| S _zx.Status |
| Token _zx.Handle |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryGetTokenResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryGetTokenResponse) InlineSize() int { |
| return 8 |
| } |
| // Request for Rename. |
| type DirectoryRenameRequest struct { |
| Src string |
| DstParentToken _zx.Handle |
| Dst string |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryRenameRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryRenameRequest) InlineSize() int { |
| return 40 |
| } |
| // Response for Rename. |
| type DirectoryRenameResponse struct { |
| S _zx.Status |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryRenameResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryRenameResponse) InlineSize() int { |
| return 4 |
| } |
| // Request for Link. |
| type DirectoryLinkRequest struct { |
| Src string |
| DstParentToken _zx.Handle |
| Dst string |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryLinkRequest) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryLinkRequest) InlineSize() int { |
| return 40 |
| } |
| // Response for Link. |
| type DirectoryLinkResponse struct { |
| S _zx.Status |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryLinkResponse) InlineAlignment() int { |
| return 0 |
| } |
| |
| // Implements Payload. |
| func (_ *DirectoryLinkResponse) InlineSize() int { |
| return 4 |
| } |
| |
| type DirectoryInterface _bindings.Proxy |
| |
| func (p *DirectoryInterface) Open(flags uint32,mode uint32,path string,object ObjectInterfaceRequest) error { |
| req_ := DirectoryOpenRequest{ |
| Flags: flags, |
| Mode: mode, |
| Path: path, |
| Object: object, |
| } |
| err := ((*_bindings.Proxy)(p)).Send(2197815297, &req_) |
| return err |
| } |
| func (p *DirectoryInterface) Unlink(path string) (_zx.Status, error) { |
| req_ := DirectoryUnlinkRequest{ |
| Path: path, |
| } |
| resp_ := DirectoryUnlinkResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2197815298, &req_, &resp_) |
| return resp_.S, err |
| } |
| func (p *DirectoryInterface) ReadDirents(maxOut uint64) (_zx.Status, []uint8, error) { |
| req_ := DirectoryReadDirentsRequest{ |
| MaxOut: maxOut, |
| } |
| resp_ := DirectoryReadDirentsResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2197815299, &req_, &resp_) |
| return resp_.S, resp_.Dirents, err |
| } |
| func (p *DirectoryInterface) Rewind() (_zx.Status, error) { |
| req_ := DirectoryRewindRequest{ |
| } |
| resp_ := DirectoryRewindResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2197815300, &req_, &resp_) |
| return resp_.S, err |
| } |
| func (p *DirectoryInterface) GetToken() (_zx.Status, _zx.Handle, error) { |
| req_ := DirectoryGetTokenRequest{ |
| } |
| resp_ := DirectoryGetTokenResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2197815301, &req_, &resp_) |
| return resp_.S, resp_.Token, err |
| } |
| func (p *DirectoryInterface) Rename(src string,dstParentToken _zx.Handle,dst string) (_zx.Status, error) { |
| req_ := DirectoryRenameRequest{ |
| Src: src, |
| DstParentToken: dstParentToken, |
| Dst: dst, |
| } |
| resp_ := DirectoryRenameResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2197815302, &req_, &resp_) |
| return resp_.S, err |
| } |
| func (p *DirectoryInterface) Link(src string,dstParentToken _zx.Handle,dst string) (_zx.Status, error) { |
| req_ := DirectoryLinkRequest{ |
| Src: src, |
| DstParentToken: dstParentToken, |
| Dst: dst, |
| } |
| resp_ := DirectoryLinkResponse{} |
| err := ((*_bindings.Proxy)(p)).Call(2197815303, &req_, &resp_) |
| return resp_.S, err |
| } |
| |
| // Directory server interface. |
| type Directory interface { |
| Clone(flags uint32,object ObjectInterfaceRequest) error |
| Close() (_zx.Status, error) |
| ListInterfaces() ([]string, error) |
| Bind(iface string) error |
| Describe() (ObjectInfo, error) |
| Sync() (_zx.Status, error) |
| GetAttr() (_zx.Status, NodeAttributes, error) |
| SetAttr(flags uint32,attributes NodeAttributes) (_zx.Status, error) |
| Ioctl(opcode uint32,maxOut uint64,handles []_zx.Handle,in []uint8) (_zx.Status, []_zx.Handle, []uint8, error) |
| Open(flags uint32,mode uint32,path string,object ObjectInterfaceRequest) error |
| Unlink(path string) (_zx.Status, error) |
| ReadDirents(maxOut uint64) (_zx.Status, []uint8, error) |
| Rewind() (_zx.Status, error) |
| GetToken() (_zx.Status, _zx.Handle, error) |
| Rename(src string,dstParentToken _zx.Handle,dst string) (_zx.Status, error) |
| Link(src string,dstParentToken _zx.Handle,dst string) (_zx.Status, error) |
| } |
| |
| 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 2147483649: |
| in_ := ObjectCloneRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Clone(in_.Flags,in_.Object) |
| return nil, err_ |
| case 2147483650: |
| in_ := ObjectCloseRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectCloseResponse{} |
| s, err_ := s.Impl.Close() |
| out_.S = s |
| return &out_, err_ |
| case 2147483652: |
| in_ := ObjectListInterfacesRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectListInterfacesResponse{} |
| interfaces, err_ := s.Impl.ListInterfaces() |
| out_.Interfaces = interfaces |
| return &out_, err_ |
| case 2147483653: |
| in_ := ObjectBindRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| err_ := s.Impl.Bind(in_.Iface) |
| return nil, err_ |
| case 2147483654: |
| in_ := ObjectDescribeRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := ObjectDescribeResponse{} |
| info, err_ := s.Impl.Describe() |
| out_.Info = info |
| return &out_, err_ |
| case 2164260865: |
| in_ := NodeSyncRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeSyncResponse{} |
| s, err_ := s.Impl.Sync() |
| out_.S = s |
| return &out_, err_ |
| case 2164260866: |
| in_ := NodeGetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeGetAttrResponse{} |
| s, attributes, err_ := s.Impl.GetAttr() |
| out_.S = s |
| out_.Attributes = attributes |
| return &out_, err_ |
| case 2164260867: |
| in_ := NodeSetAttrRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeSetAttrResponse{} |
| s, err_ := s.Impl.SetAttr(in_.Flags,in_.Attributes) |
| out_.S = s |
| return &out_, err_ |
| case 2164260868: |
| in_ := NodeIoctlRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := NodeIoctlResponse{} |
| s, handles, out, err_ := s.Impl.Ioctl(in_.Opcode,in_.MaxOut,in_.Handles,in_.In) |
| out_.S = s |
| out_.Handles = handles |
| out_.Out = out |
| return &out_, err_ |
| case 2197815297: |
| 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 2197815298: |
| in_ := DirectoryUnlinkRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := DirectoryUnlinkResponse{} |
| s, err_ := s.Impl.Unlink(in_.Path) |
| out_.S = s |
| return &out_, err_ |
| case 2197815299: |
| in_ := DirectoryReadDirentsRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := DirectoryReadDirentsResponse{} |
| s, dirents, err_ := s.Impl.ReadDirents(in_.MaxOut) |
| out_.S = s |
| out_.Dirents = dirents |
| return &out_, err_ |
| case 2197815300: |
| in_ := DirectoryRewindRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := DirectoryRewindResponse{} |
| s, err_ := s.Impl.Rewind() |
| out_.S = s |
| return &out_, err_ |
| case 2197815301: |
| in_ := DirectoryGetTokenRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := DirectoryGetTokenResponse{} |
| s, token, err_ := s.Impl.GetToken() |
| out_.S = s |
| out_.Token = token |
| return &out_, err_ |
| case 2197815302: |
| in_ := DirectoryRenameRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := DirectoryRenameResponse{} |
| s, err_ := s.Impl.Rename(in_.Src,in_.DstParentToken,in_.Dst) |
| out_.S = s |
| return &out_, err_ |
| case 2197815303: |
| in_ := DirectoryLinkRequest{} |
| if err_ := _bindings.Unmarshal(b_, h_, &in_); err_ != nil { |
| return nil, err_ |
| } |
| out_ := DirectoryLinkResponse{} |
| s, err_ := s.Impl.Link(in_.Src,in_.DstParentToken,in_.Dst) |
| 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.Proxy |
| |
| func (p *DirectoryEventProxy) OnOpen(s _zx.Status,info *ObjectInfo) error { |
| event_ := ObjectOnOpenResponse{ |
| S: s, |
| Info: info, |
| } |
| return ((*_bindings.Proxy)(p)).Send(2147483655, &event_) |
| } |
| |