| // Copyright 2019 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. |
| // |
| // Code generated by tools/fidl/gidl-conformance-suite/regen.sh; DO NOT EDIT. |
| |
| // +build fuchsia |
| |
| // |
| // Code generated by fidlgen; DO NOT EDIT. |
| |
| package conformance |
| |
| import ( |
| _zx "syscall/zx" |
| _bindings "syscall/zx/fidl" |
| ) |
| |
| type Int64Struct struct { |
| _ struct{} `fidl2:"s,8,8"` |
| X int64 |
| } |
| |
| var _mInt64Struct = _bindings.CreateLazyMarshaler(Int64Struct{}) |
| |
| func (msg *Int64Struct) Marshaler() _bindings.Marshaler { |
| return _mInt64Struct |
| } |
| |
| type TestInlineXUnionInStruct struct { |
| _ struct{} `fidl2:"s,56,8"` |
| Before string |
| Xu SampleXUnion |
| After string |
| } |
| |
| var _mTestInlineXUnionInStruct = _bindings.CreateLazyMarshaler(TestInlineXUnionInStruct{}) |
| |
| func (msg *TestInlineXUnionInStruct) Marshaler() _bindings.Marshaler { |
| return _mTestInlineXUnionInStruct |
| } |
| |
| type TestOptionalXUnionInStruct struct { |
| _ struct{} `fidl2:"s,56,8"` |
| Before string |
| Xu *SampleXUnion |
| After string |
| } |
| |
| var _mTestOptionalXUnionInStruct = _bindings.CreateLazyMarshaler(TestOptionalXUnionInStruct{}) |
| |
| func (msg *TestOptionalXUnionInStruct) Marshaler() _bindings.Marshaler { |
| return _mTestOptionalXUnionInStruct |
| } |
| |
| type Length2StringWrapper struct { |
| _ struct{} `fidl2:"s,16,8"` |
| Length2String string `fidl:"2" fidl2:"2"` |
| } |
| |
| var _mLength2StringWrapper = _bindings.CreateLazyMarshaler(Length2StringWrapper{}) |
| |
| func (msg *Length2StringWrapper) Marshaler() _bindings.Marshaler { |
| return _mLength2StringWrapper |
| } |
| |
| type StringWrapper struct { |
| _ struct{} `fidl2:"s,16,8"` |
| Str string |
| } |
| |
| var _mStringWrapper = _bindings.CreateLazyMarshaler(StringWrapper{}) |
| |
| func (msg *StringWrapper) Marshaler() _bindings.Marshaler { |
| return _mStringWrapper |
| } |
| |
| type StructWithOptionals struct { |
| _ struct{} `fidl2:"s,104,8"` |
| S EmptyStruct |
| S2 *EmptyStruct |
| T TableWithEmptyStruct |
| Xu XUnionWithEmptyStruct |
| Xu2 *XUnionWithEmptyStruct |
| U UnionWithEmptyStruct |
| U2 *UnionWithEmptyStruct |
| } |
| |
| var _mStructWithOptionals = _bindings.CreateLazyMarshaler(StructWithOptionals{}) |
| |
| func (msg *StructWithOptionals) Marshaler() _bindings.Marshaler { |
| return _mStructWithOptionals |
| } |
| |
| type TestXUnionInTable struct { |
| _ struct{} `fidl2:"s,16,8"` |
| Value XUnionInTable |
| } |
| |
| var _mTestXUnionInTable = _bindings.CreateLazyMarshaler(TestXUnionInTable{}) |
| |
| func (msg *TestXUnionInTable) Marshaler() _bindings.Marshaler { |
| return _mTestXUnionInTable |
| } |
| |
| type InterfaceConfig struct { |
| _ struct{} `fidl2:"s,48,8"` |
| Name string |
| IpAddressConfig IpAddressConfig |
| } |
| |
| var _mInterfaceConfig = _bindings.CreateLazyMarshaler(InterfaceConfig{}) |
| |
| func (msg *InterfaceConfig) Marshaler() _bindings.Marshaler { |
| return _mInterfaceConfig |
| } |
| |
| type TestAddEthernetDeviceRequest struct { |
| _ struct{} `fidl2:"s,72,8"` |
| TopologicalPath string |
| Config InterfaceConfig |
| ThisShouldBeAHandle uint32 |
| } |
| |
| var _mTestAddEthernetDeviceRequest = _bindings.CreateLazyMarshaler(TestAddEthernetDeviceRequest{}) |
| |
| func (msg *TestAddEthernetDeviceRequest) Marshaler() _bindings.Marshaler { |
| return _mTestAddEthernetDeviceRequest |
| } |
| |
| type NodeAttributes struct { |
| _ struct{} `fidl2:"s,56,8"` |
| Mode uint32 |
| Id uint64 |
| ContentSize uint64 |
| StorageSize uint64 |
| LinkCount uint64 |
| CreationTime uint64 |
| ModificationTime uint64 |
| } |
| |
| var _mNodeAttributes = _bindings.CreateLazyMarshaler(NodeAttributes{}) |
| |
| func (msg *NodeAttributes) Marshaler() _bindings.Marshaler { |
| return _mNodeAttributes |
| } |
| |
| type FileGetAttrResponse struct { |
| _ struct{} `fidl2:"s,64,8"` |
| S int32 |
| Attributes NodeAttributes |
| } |
| |
| var _mFileGetAttrResponse = _bindings.CreateLazyMarshaler(FileGetAttrResponse{}) |
| |
| func (msg *FileGetAttrResponse) Marshaler() _bindings.Marshaler { |
| return _mFileGetAttrResponse |
| } |
| |
| type EmptyStruct struct { |
| _ struct{} `fidl2:"s,1,1"` |
| } |
| |
| var _mEmptyStruct = _bindings.CreateLazyMarshaler(EmptyStruct{}) |
| |
| func (msg *EmptyStruct) Marshaler() _bindings.Marshaler { |
| return _mEmptyStruct |
| } |
| |
| type EmptyStructSandwich struct { |
| _ struct{} `fidl2:"s,40,8"` |
| Before string |
| Es EmptyStruct |
| After string |
| } |
| |
| var _mEmptyStructSandwich = _bindings.CreateLazyMarshaler(EmptyStructSandwich{}) |
| |
| func (msg *EmptyStructSandwich) Marshaler() _bindings.Marshaler { |
| return _mEmptyStructSandwich |
| } |
| |
| type Uint8Uint16Uint32Uint64 struct { |
| _ struct{} `fidl2:"s,16,8"` |
| F1 uint8 |
| F2 uint16 |
| F3 uint32 |
| F4 uint64 |
| } |
| |
| var _mUint8Uint16Uint32Uint64 = _bindings.CreateLazyMarshaler(Uint8Uint16Uint32Uint64{}) |
| |
| func (msg *Uint8Uint16Uint32Uint64) Marshaler() _bindings.Marshaler { |
| return _mUint8Uint16Uint32Uint64 |
| } |
| |
| type Uint64Uint32Uint16Uint8 struct { |
| _ struct{} `fidl2:"s,16,8"` |
| F1 uint64 |
| F2 uint32 |
| F3 uint16 |
| F4 uint8 |
| } |
| |
| var _mUint64Uint32Uint16Uint8 = _bindings.CreateLazyMarshaler(Uint64Uint32Uint16Uint8{}) |
| |
| func (msg *Uint64Uint32Uint16Uint8) Marshaler() _bindings.Marshaler { |
| return _mUint64Uint32Uint16Uint8 |
| } |
| |
| type StructOfSimpleTable struct { |
| _ struct{} `fidl2:"s,16,8"` |
| Table SimpleTable |
| } |
| |
| var _mStructOfSimpleTable = _bindings.CreateLazyMarshaler(StructOfSimpleTable{}) |
| |
| func (msg *StructOfSimpleTable) Marshaler() _bindings.Marshaler { |
| return _mStructOfSimpleTable |
| } |
| |
| type SimpleTableThenUint64 struct { |
| _ struct{} `fidl2:"s,24,8"` |
| Table SimpleTable |
| Number uint64 |
| } |
| |
| var _mSimpleTableThenUint64 = _bindings.CreateLazyMarshaler(SimpleTableThenUint64{}) |
| |
| func (msg *SimpleTableThenUint64) Marshaler() _bindings.Marshaler { |
| return _mSimpleTableThenUint64 |
| } |
| |
| type StructOfTableWithStringAndVector struct { |
| _ struct{} `fidl2:"s,16,8"` |
| Table TableWithStringAndVector |
| } |
| |
| var _mStructOfTableWithStringAndVector = _bindings.CreateLazyMarshaler(StructOfTableWithStringAndVector{}) |
| |
| func (msg *StructOfTableWithStringAndVector) Marshaler() _bindings.Marshaler { |
| return _mStructOfTableWithStringAndVector |
| } |
| |
| type SimpleUnionTag uint32 |
| |
| const ( |
| _ SimpleUnionTag = iota |
| SimpleUnionI32 |
| SimpleUnionI64 |
| SimpleUnionS |
| SimpleUnionOs |
| SimpleUnionStr |
| ) |
| |
| type SimpleUnion struct { |
| SimpleUnionTag `fidl:"tag" fidl2:"u,24,8"` |
| I32 int32 |
| I64 int64 |
| S Int64Struct |
| Os *Int64Struct |
| Str string |
| } |
| |
| func (u *SimpleUnion) Which() SimpleUnionTag { |
| return u.SimpleUnionTag |
| } |
| |
| func (u *SimpleUnion) SetI32(i32 int32) { |
| u.SimpleUnionTag = SimpleUnionI32 |
| u.I32 = i32 |
| } |
| |
| func (u *SimpleUnion) SetI64(i64 int64) { |
| u.SimpleUnionTag = SimpleUnionI64 |
| u.I64 = i64 |
| } |
| |
| func (u *SimpleUnion) SetS(s Int64Struct) { |
| u.SimpleUnionTag = SimpleUnionS |
| u.S = s |
| } |
| |
| func (u *SimpleUnion) SetOs(os *Int64Struct) { |
| u.SimpleUnionTag = SimpleUnionOs |
| u.Os = os |
| } |
| |
| func (u *SimpleUnion) SetStr(str string) { |
| u.SimpleUnionTag = SimpleUnionStr |
| u.Str = str |
| } |
| |
| type UnionWithEmptyStructTag uint32 |
| |
| const ( |
| _ UnionWithEmptyStructTag = iota |
| UnionWithEmptyStructS |
| UnionWithEmptyStructS2 |
| ) |
| |
| type UnionWithEmptyStruct struct { |
| UnionWithEmptyStructTag `fidl:"tag" fidl2:"u,16,8"` |
| S EmptyStruct |
| S2 *EmptyStruct |
| } |
| |
| func (u *UnionWithEmptyStruct) Which() UnionWithEmptyStructTag { |
| return u.UnionWithEmptyStructTag |
| } |
| |
| func (u *UnionWithEmptyStruct) SetS(s EmptyStruct) { |
| u.UnionWithEmptyStructTag = UnionWithEmptyStructS |
| u.S = s |
| } |
| |
| func (u *UnionWithEmptyStruct) SetS2(s2 *EmptyStruct) { |
| u.UnionWithEmptyStructTag = UnionWithEmptyStructS2 |
| u.S2 = s2 |
| } |
| |
| type IpAddressConfigTag uint32 |
| |
| const ( |
| _ IpAddressConfigTag = iota |
| IpAddressConfigPaddingSize24Align4 |
| IpAddressConfigDhcp |
| ) |
| |
| type IpAddressConfig struct { |
| IpAddressConfigTag `fidl:"tag" fidl2:"u,28,4"` |
| PaddingSize24Align4 [6]uint32 |
| Dhcp bool |
| } |
| |
| func (u *IpAddressConfig) Which() IpAddressConfigTag { |
| return u.IpAddressConfigTag |
| } |
| |
| func (u *IpAddressConfig) SetPaddingSize24Align4(paddingSize24Align4 [6]uint32) { |
| u.IpAddressConfigTag = IpAddressConfigPaddingSize24Align4 |
| u.PaddingSize24Align4 = paddingSize24Align4 |
| } |
| |
| func (u *IpAddressConfig) SetDhcp(dhcp bool) { |
| u.IpAddressConfigTag = IpAddressConfigDhcp |
| u.Dhcp = dhcp |
| } |
| |
| type SampleXUnionTag uint32 |
| |
| const ( |
| SampleXUnion_unknownData = 0 // 0x00000000 |
| SampleXUnionU = 949769906 // 0x389c56b2 |
| SampleXUnionSu = 2033143581 // 0x792f4f1d |
| SampleXUnionSt = 35514581 // 0x021de8d5 |
| ) |
| |
| type SampleXUnion struct { |
| SampleXUnionTag `fidl2:"x,24,8"` |
| I_unknownData []byte |
| U uint32 `fidl:"949769906" fidl2:"949769906"` |
| Su SimpleUnion `fidl:"2033143581" fidl2:"2033143581"` |
| St SimpleTable `fidl:"35514581" fidl2:"35514581"` |
| } |
| |
| func (_m *SampleXUnion) Which() SampleXUnionTag { |
| switch _m.SampleXUnionTag { |
| case 949769906: |
| return SampleXUnionU |
| case 2033143581: |
| return SampleXUnionSu |
| case 35514581: |
| return SampleXUnionSt |
| default: |
| return SampleXUnion_unknownData |
| } |
| } |
| |
| func (_m *SampleXUnion) Ordinal() uint32 { |
| return uint32(_m.SampleXUnionTag) |
| } |
| |
| func (_m *SampleXUnion) SetU(u uint32) { |
| _m.SampleXUnionTag = SampleXUnionU |
| _m.U = u |
| } |
| |
| func (_m *SampleXUnion) SetSu(su SimpleUnion) { |
| _m.SampleXUnionTag = SampleXUnionSu |
| _m.Su = su |
| } |
| |
| func (_m *SampleXUnion) SetSt(st SimpleTable) { |
| _m.SampleXUnionTag = SampleXUnionSt |
| _m.St = st |
| } |
| |
| type XUnionWithEmptyStructTag uint32 |
| |
| const ( |
| XUnionWithEmptyStruct_unknownData = 0 // 0x00000000 |
| XUnionWithEmptyStructS = 1956241662 // 0x7499e0fe |
| ) |
| |
| type XUnionWithEmptyStruct struct { |
| XUnionWithEmptyStructTag `fidl2:"x,24,8"` |
| I_unknownData []byte |
| S EmptyStruct `fidl:"1956241662" fidl2:"1956241662"` |
| } |
| |
| func (_m *XUnionWithEmptyStruct) Which() XUnionWithEmptyStructTag { |
| switch _m.XUnionWithEmptyStructTag { |
| case 1956241662: |
| return XUnionWithEmptyStructS |
| default: |
| return XUnionWithEmptyStruct_unknownData |
| } |
| } |
| |
| func (_m *XUnionWithEmptyStruct) Ordinal() uint32 { |
| return uint32(_m.XUnionWithEmptyStructTag) |
| } |
| |
| func (_m *XUnionWithEmptyStruct) SetS(s EmptyStruct) { |
| _m.XUnionWithEmptyStructTag = XUnionWithEmptyStructS |
| _m.S = s |
| } |
| |
| type TableWithEmptyStruct struct { |
| _ struct{} `fidl2:"t,16,8"` |
| S EmptyStruct `fidl:"1" fidl2:"1"` |
| SPresent bool |
| } |
| |
| func (u *TableWithEmptyStruct) SetS(s EmptyStruct) { |
| u.S = s |
| u.SPresent = true |
| } |
| |
| func (u *TableWithEmptyStruct) GetS() EmptyStruct { |
| return u.S |
| } |
| |
| func (u *TableWithEmptyStruct) GetSWithDefault(_default EmptyStruct) EmptyStruct { |
| if !u.HasS() { |
| return _default |
| } |
| return u.S |
| } |
| |
| func (u *TableWithEmptyStruct) HasS() bool { |
| return u.SPresent |
| } |
| |
| func (u *TableWithEmptyStruct) ClearS() { |
| u.SPresent = false |
| } |
| |
| type XUnionInTable struct { |
| _ struct{} `fidl2:"t,16,8"` |
| Before string `fidl:",1" fidl2:"1,"` |
| BeforePresent bool |
| Xu SampleXUnion `fidl:"2" fidl2:"2"` |
| XuPresent bool |
| After string `fidl:",3" fidl2:"3,"` |
| AfterPresent bool |
| } |
| |
| func (u *XUnionInTable) SetBefore(before string) { |
| u.Before = before |
| u.BeforePresent = true |
| } |
| |
| func (u *XUnionInTable) GetBefore() string { |
| return u.Before |
| } |
| |
| func (u *XUnionInTable) GetBeforeWithDefault(_default string) string { |
| if !u.HasBefore() { |
| return _default |
| } |
| return u.Before |
| } |
| |
| func (u *XUnionInTable) HasBefore() bool { |
| return u.BeforePresent |
| } |
| |
| func (u *XUnionInTable) ClearBefore() { |
| u.BeforePresent = false |
| } |
| |
| func (u *XUnionInTable) SetXu(xu SampleXUnion) { |
| u.Xu = xu |
| u.XuPresent = true |
| } |
| |
| func (u *XUnionInTable) GetXu() SampleXUnion { |
| return u.Xu |
| } |
| |
| func (u *XUnionInTable) GetXuWithDefault(_default SampleXUnion) SampleXUnion { |
| if !u.HasXu() { |
| return _default |
| } |
| return u.Xu |
| } |
| |
| func (u *XUnionInTable) HasXu() bool { |
| return u.XuPresent |
| } |
| |
| func (u *XUnionInTable) ClearXu() { |
| u.XuPresent = false |
| } |
| |
| func (u *XUnionInTable) SetAfter(after string) { |
| u.After = after |
| u.AfterPresent = true |
| } |
| |
| func (u *XUnionInTable) GetAfter() string { |
| return u.After |
| } |
| |
| func (u *XUnionInTable) GetAfterWithDefault(_default string) string { |
| if !u.HasAfter() { |
| return _default |
| } |
| return u.After |
| } |
| |
| func (u *XUnionInTable) HasAfter() bool { |
| return u.AfterPresent |
| } |
| |
| func (u *XUnionInTable) ClearAfter() { |
| u.AfterPresent = false |
| } |
| |
| type SimpleTable struct { |
| _ struct{} `fidl2:"t,16,8"` |
| X int64 `fidl:"1" fidl2:"1"` |
| XPresent bool |
| Y int64 `fidl:"5" fidl2:"5"` |
| YPresent bool |
| } |
| |
| func (u *SimpleTable) SetX(x int64) { |
| u.X = x |
| u.XPresent = true |
| } |
| |
| func (u *SimpleTable) GetX() int64 { |
| return u.X |
| } |
| |
| func (u *SimpleTable) GetXWithDefault(_default int64) int64 { |
| if !u.HasX() { |
| return _default |
| } |
| return u.X |
| } |
| |
| func (u *SimpleTable) HasX() bool { |
| return u.XPresent |
| } |
| |
| func (u *SimpleTable) ClearX() { |
| u.XPresent = false |
| } |
| |
| func (u *SimpleTable) SetY(y int64) { |
| u.Y = y |
| u.YPresent = true |
| } |
| |
| func (u *SimpleTable) GetY() int64 { |
| return u.Y |
| } |
| |
| func (u *SimpleTable) GetYWithDefault(_default int64) int64 { |
| if !u.HasY() { |
| return _default |
| } |
| return u.Y |
| } |
| |
| func (u *SimpleTable) HasY() bool { |
| return u.YPresent |
| } |
| |
| func (u *SimpleTable) ClearY() { |
| u.YPresent = false |
| } |
| |
| type TableWithStringAndVector struct { |
| _ struct{} `fidl2:"t,16,8"` |
| Foo string `fidl:",1" fidl2:"1,"` |
| FooPresent bool |
| Bar int32 `fidl:"2" fidl2:"2"` |
| BarPresent bool |
| Baz []uint8 `fidl:",3" fidl2:"3,"` |
| BazPresent bool |
| } |
| |
| func (u *TableWithStringAndVector) SetFoo(foo string) { |
| u.Foo = foo |
| u.FooPresent = true |
| } |
| |
| func (u *TableWithStringAndVector) GetFoo() string { |
| return u.Foo |
| } |
| |
| func (u *TableWithStringAndVector) GetFooWithDefault(_default string) string { |
| if !u.HasFoo() { |
| return _default |
| } |
| return u.Foo |
| } |
| |
| func (u *TableWithStringAndVector) HasFoo() bool { |
| return u.FooPresent |
| } |
| |
| func (u *TableWithStringAndVector) ClearFoo() { |
| u.FooPresent = false |
| } |
| |
| func (u *TableWithStringAndVector) SetBar(bar int32) { |
| u.Bar = bar |
| u.BarPresent = true |
| } |
| |
| func (u *TableWithStringAndVector) GetBar() int32 { |
| return u.Bar |
| } |
| |
| func (u *TableWithStringAndVector) GetBarWithDefault(_default int32) int32 { |
| if !u.HasBar() { |
| return _default |
| } |
| return u.Bar |
| } |
| |
| func (u *TableWithStringAndVector) HasBar() bool { |
| return u.BarPresent |
| } |
| |
| func (u *TableWithStringAndVector) ClearBar() { |
| u.BarPresent = false |
| } |
| |
| func (u *TableWithStringAndVector) SetBaz(baz []uint8) { |
| u.Baz = baz |
| u.BazPresent = true |
| } |
| |
| func (u *TableWithStringAndVector) GetBaz() []uint8 { |
| return u.Baz |
| } |
| |
| func (u *TableWithStringAndVector) GetBazWithDefault(_default []uint8) []uint8 { |
| if !u.HasBaz() { |
| return _default |
| } |
| return u.Baz |
| } |
| |
| func (u *TableWithStringAndVector) HasBaz() bool { |
| return u.BazPresent |
| } |
| |
| func (u *TableWithStringAndVector) ClearBaz() { |
| u.BazPresent = false |
| } |
| |
| type EthernetDeviceInterface _bindings.ChannelProxy |
| |
| type EthernetDevice interface { |
| } |
| |
| type EthernetDeviceTransitionalBase struct{} |
| |
| type EthernetDeviceInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewEthernetDeviceInterfaceRequest() (EthernetDeviceInterfaceRequest, *EthernetDeviceInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return EthernetDeviceInterfaceRequest(req), (*EthernetDeviceInterface)(cli), err |
| } |
| |
| type EthernetDeviceStub struct { |
| Impl EthernetDevice |
| } |
| |
| func (s_ *EthernetDeviceStub) Dispatch(ordinal_ uint64, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, error) { |
| switch ordinal_ { |
| } |
| return nil, _bindings.ErrUnknownOrdinal |
| } |
| |
| type EthernetDeviceService struct { |
| _bindings.BindingSet |
| } |
| |
| func (s *EthernetDeviceService) Add(impl EthernetDevice, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) { |
| return s.BindingSet.Add(&EthernetDeviceStub{Impl: impl}, c, onError) |
| } |
| |
| func (s *EthernetDeviceService) EventProxyFor(key _bindings.BindingKey) (*EthernetDeviceEventProxy, bool) { |
| pxy, err := s.BindingSet.ProxyFor(key) |
| return (*EthernetDeviceEventProxy)(pxy), err |
| } |
| |
| type EthernetDeviceEventProxy _bindings.ChannelProxy |