| // Copyright 2020 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 third_party/go/regen-fidl; DO NOT EDIT. |
| |
| // WARNING: This file is machine generated by fidlgen. |
| |
| package network |
| |
| import ( |
| _strings "strings" |
| _zx "syscall/zx" |
| _bindings "syscall/zx/fidl" |
| fuchsianet "syscall/zx/net" |
| ) |
| |
| const ( |
| // Blanket definition for raw frames. |
| // |
| // Devices that do not perform any sort of parsing of outbound traffic should |
| // define `FRAME_FEATURES_RAW` in the [`FrameTypeSupport`] entry. |
| FrameFeaturesRaw uint32 = 1 |
| // Maximum number of acceleration flags. |
| // |
| // Each descriptor has 16 bits of space for acceleration flags ([`RxFlags`] and |
| // [`TxFlags`]) thus the maximum number of reported accelerations is 16. Each |
| // descriptor reports which accelerations were applied (`RxFlags`) or are |
| // requested (`TxFlags`) by mapping indexes in the vector of supported |
| // accelerations ([`Info.rx_accel`] and ([`Info.tx_accel`]) to bits in the |
| // respective acceleration flags bitfield. |
| MaxAccelFlags uint32 = 16 |
| // Maximum number of chained descriptors that describe a single frame. |
| MaxDescriptorChain uint8 = 4 |
| // Maximum numbers of supported frame types for rx or tx. |
| MaxFrameTypes uint32 = 4 |
| // The maximum number of ports attached to a device at a given time. |
| MaxPorts uint8 = 32 |
| // Maximum length of session label. |
| MaxSessionName_ uint32 = 64 |
| // The maximum number of status samples that can be buffered by a |
| // [`StatusWatcher`]. |
| MaxStatusBuffer uint32 = 50 |
| ) |
| |
| type BasePortId = uint8 |
| type PortClass = DeviceClass |
| |
| var _ _bindings.Enum = DeviceClass(0) |
| |
| // Network device class. |
| // |
| // *Note*: Device implementers are encouraged to propose additions to this |
| // enumeration to avoid using ill-fitting variants if there's not a good match |
| // available. |
| type DeviceClass uint16 |
| |
| const ( |
| DeviceClassVirtual DeviceClass = 0 |
| DeviceClassEthernet DeviceClass = 1 |
| DeviceClassWlan DeviceClass = 2 |
| DeviceClassPpp DeviceClass = 3 |
| DeviceClassBridge DeviceClass = 4 |
| DeviceClassWlanAp DeviceClass = 5 |
| ) |
| |
| func (_ DeviceClass) I_EnumValues() []DeviceClass { |
| return []DeviceClass{ |
| DeviceClassVirtual, |
| DeviceClassEthernet, |
| DeviceClassWlan, |
| DeviceClassPpp, |
| DeviceClassBridge, |
| DeviceClassWlanAp, |
| } |
| } |
| |
| func (_ DeviceClass) I_EnumIsStrict() bool { |
| return true |
| } |
| |
| func (x DeviceClass) IsUnknown() bool { |
| switch x { |
| case 0: |
| return false |
| case 1: |
| return false |
| case 2: |
| return false |
| case 3: |
| return false |
| case 4: |
| return false |
| case 5: |
| return false |
| } |
| return true |
| } |
| |
| func (x DeviceClass) String() string { |
| switch x { |
| case 0: |
| return "Virtual" |
| case 1: |
| return "Ethernet" |
| case 2: |
| return "Wlan" |
| case 3: |
| return "Ppp" |
| case 4: |
| return "Bridge" |
| case 5: |
| return "WlanAp" |
| } |
| return "Unknown" |
| } |
| |
| var _ _bindings.Enum = FrameType(0) |
| |
| // Types of frames. |
| type FrameType uint8 |
| |
| const ( |
| FrameTypeEthernet FrameType = 1 |
| FrameTypeIpv4 FrameType = 2 |
| FrameTypeIpv6 FrameType = 3 |
| ) |
| |
| func (_ FrameType) I_EnumValues() []FrameType { |
| return []FrameType{ |
| FrameTypeEthernet, |
| FrameTypeIpv4, |
| FrameTypeIpv6, |
| } |
| } |
| |
| func (_ FrameType) I_EnumIsStrict() bool { |
| return true |
| } |
| |
| func (x FrameType) IsUnknown() bool { |
| switch x { |
| case 1: |
| return false |
| case 2: |
| return false |
| case 3: |
| return false |
| } |
| return true |
| } |
| |
| func (x FrameType) String() string { |
| switch x { |
| case 1: |
| return "Ethernet" |
| case 2: |
| return "Ipv4" |
| case 3: |
| return "Ipv6" |
| } |
| return "Unknown" |
| } |
| |
| var _ _bindings.Enum = InfoType(0) |
| |
| // The type of metadata information appended to a frame. |
| type InfoType uint32 |
| |
| const ( |
| |
| // No extra information is available. |
| InfoTypeNoInfo InfoType = 0 |
| ) |
| |
| func (_ InfoType) I_EnumValues() []InfoType { |
| return []InfoType{ |
| InfoTypeNoInfo, |
| } |
| } |
| |
| func (_ InfoType) I_EnumIsStrict() bool { |
| return true |
| } |
| |
| func (x InfoType) IsUnknown() bool { |
| switch x { |
| case 0: |
| return false |
| } |
| return true |
| } |
| |
| func (x InfoType) String() string { |
| switch x { |
| case 0: |
| return "NoInfo" |
| } |
| return "Unknown" |
| } |
| |
| var _ _bindings.Enum = MacFilterMode(0) |
| |
| // The address filtering mode supported by MAC devices. |
| type MacFilterMode uint32 |
| |
| const ( |
| |
| // Device accepts only unicast frames addressed to its own unicast address, |
| // or multicast frames that are part of the multicast address filter list. |
| MacFilterModeMulticastFilter MacFilterMode = 0 |
| |
| // Device accepts unicast frames addressed to its own unicast address, or |
| // any multicast frames. |
| MacFilterModeMulticastPromiscuous MacFilterMode = 1 |
| |
| // Device accepts all frames. |
| MacFilterModePromiscuous MacFilterMode = 2 |
| ) |
| |
| func (_ MacFilterMode) I_EnumValues() []MacFilterMode { |
| return []MacFilterMode{ |
| MacFilterModeMulticastFilter, |
| MacFilterModeMulticastPromiscuous, |
| MacFilterModePromiscuous, |
| } |
| } |
| |
| func (_ MacFilterMode) I_EnumIsStrict() bool { |
| return true |
| } |
| |
| func (x MacFilterMode) IsUnknown() bool { |
| switch x { |
| case 0: |
| return false |
| case 1: |
| return false |
| case 2: |
| return false |
| } |
| return true |
| } |
| |
| func (x MacFilterMode) String() string { |
| switch x { |
| case 0: |
| return "MulticastFilter" |
| case 1: |
| return "MulticastPromiscuous" |
| case 2: |
| return "Promiscuous" |
| } |
| return "Unknown" |
| } |
| |
| var _ _bindings.Enum = RxAcceleration(0) |
| |
| // Available rx acceleration features. |
| // |
| // Features are mapped to the `RX_ACCEL_*` bits in descriptors by the available |
| // values reported in [`Info.rx_accel`]. |
| type RxAcceleration uint8 |
| |
| const ( |
| |
| // Inbound rx frame validated the Ethernet Frame Check Sequence. |
| RxAccelerationValidatedEthernetFcs RxAcceleration = 0 |
| |
| // Inbound rx frame validated the IPv4 checksum. |
| RxAccelerationValidatedIpv4Checksum RxAcceleration = 1 |
| |
| // Inbound rx frame validated the TCP checksum. |
| RxAccelerationValidatedTcpChecksum RxAcceleration = 2 |
| |
| // Inbound rx frame validated the UDP checksum. |
| RxAccelerationValidatedUdpChecksum RxAcceleration = 3 |
| ) |
| |
| func (_ RxAcceleration) I_EnumValues() []RxAcceleration { |
| return []RxAcceleration{ |
| RxAccelerationValidatedEthernetFcs, |
| RxAccelerationValidatedIpv4Checksum, |
| RxAccelerationValidatedTcpChecksum, |
| RxAccelerationValidatedUdpChecksum, |
| } |
| } |
| |
| func (_ RxAcceleration) I_EnumIsStrict() bool { |
| return true |
| } |
| |
| func (x RxAcceleration) IsUnknown() bool { |
| switch x { |
| case 0: |
| return false |
| case 1: |
| return false |
| case 2: |
| return false |
| case 3: |
| return false |
| } |
| return true |
| } |
| |
| func (x RxAcceleration) String() string { |
| switch x { |
| case 0: |
| return "ValidatedEthernetFcs" |
| case 1: |
| return "ValidatedIpv4Checksum" |
| case 2: |
| return "ValidatedTcpChecksum" |
| case 3: |
| return "ValidatedUdpChecksum" |
| } |
| return "Unknown" |
| } |
| |
| var _ _bindings.Enum = TxAcceleration(0) |
| |
| // Available tx acceleration features. |
| // |
| // Features are mapped to the `TX_ACCEL_*` bits in descriptors by the available |
| // values reported in [`Info.tx_accel`]. |
| type TxAcceleration uint8 |
| |
| const ( |
| |
| // Request that device calculate the Ethernet Frame Check Sequence and |
| // write it in place. |
| TxAccelerationComputeEthernetFcs TxAcceleration = 0 |
| |
| // Request that the device calculate the IPv4 checksum and write it in |
| // place. |
| TxAccelerationComputeIpv4Checksum TxAcceleration = 1 |
| |
| // Request that the device calculate the TCP checksum and write it in |
| // place. |
| TxAccelerationComputeTcpChecksum TxAcceleration = 2 |
| |
| // Request that the device calculate the UDP checksum and write it in |
| // place. |
| TxAccelerationComputeUdpChecksum TxAcceleration = 3 |
| ) |
| |
| func (_ TxAcceleration) I_EnumValues() []TxAcceleration { |
| return []TxAcceleration{ |
| TxAccelerationComputeEthernetFcs, |
| TxAccelerationComputeIpv4Checksum, |
| TxAccelerationComputeTcpChecksum, |
| TxAccelerationComputeUdpChecksum, |
| } |
| } |
| |
| func (_ TxAcceleration) I_EnumIsStrict() bool { |
| return true |
| } |
| |
| func (x TxAcceleration) IsUnknown() bool { |
| switch x { |
| case 0: |
| return false |
| case 1: |
| return false |
| case 2: |
| return false |
| case 3: |
| return false |
| } |
| return true |
| } |
| |
| func (x TxAcceleration) String() string { |
| switch x { |
| case 0: |
| return "ComputeEthernetFcs" |
| case 1: |
| return "ComputeIpv4Checksum" |
| case 2: |
| return "ComputeTcpChecksum" |
| case 3: |
| return "ComputeUdpChecksum" |
| } |
| return "Unknown" |
| } |
| |
| var _ _bindings.Bits = EthernetFeatures(0) |
| |
| // Ethernet frame sub-types and features. |
| type EthernetFeatures uint32 |
| |
| const ( |
| EthernetFeaturesRaw EthernetFeatures = 1 |
| EthernetFeaturesEthernetIi EthernetFeatures = 2 |
| EthernetFeaturesE8021Q EthernetFeatures = 4 |
| EthernetFeaturesE8021QInQ EthernetFeatures = 8 |
| EthernetFeaturesE8023LlcSnap EthernetFeatures = 16 |
| EthernetFeatures_Mask EthernetFeatures = 31 |
| ) |
| |
| func (_ EthernetFeatures) I_BitsMask() EthernetFeatures { |
| return EthernetFeatures_Mask |
| } |
| |
| func (_ EthernetFeatures) I_BitsIsStrict() bool { |
| return true |
| } |
| |
| func (x EthernetFeatures) HasUnknownBits() bool { |
| return x.GetUnknownBits() != 0 |
| } |
| |
| func (x EthernetFeatures) GetUnknownBits() uint64 { |
| return uint64(^EthernetFeatures_Mask & x) |
| } |
| |
| func (x EthernetFeatures) InvertBits() EthernetFeatures { |
| return EthernetFeatures_Mask & ^x |
| } |
| |
| // HasBits validates that all flipped bits in the mask are set. |
| func (x EthernetFeatures) HasBits(mask EthernetFeatures) bool { |
| return mask|x == x |
| } |
| |
| // ClearBits ensures all flipped bits in the mask are unset. |
| func (x EthernetFeatures) ClearBits(mask EthernetFeatures) EthernetFeatures { |
| return ^mask & x |
| } |
| |
| func (x EthernetFeatures) String() string { |
| var buf _strings.Builder |
| if 1&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("Raw") |
| } |
| if 2&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("EthernetIi") |
| } |
| if 4&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("E8021Q") |
| } |
| if 8&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("E8021QInQ") |
| } |
| if 16&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("E8023LlcSnap") |
| } |
| if buf.Len() == 0 { |
| buf.WriteString("<empty bits>") |
| } |
| return buf.String() |
| } |
| |
| var _ _bindings.Bits = RxFlags(0) |
| |
| // Flags set by a Device when handing a buffer to a client on the rx path. |
| // |
| // Set by devices on the `inbound_flags` field of an rx descriptor. |
| type RxFlags uint32 |
| |
| const ( |
| RxFlagsRxAccel0 RxFlags = 1 |
| RxFlagsRxAccel1 RxFlags = 2 |
| RxFlagsRxAccel2 RxFlags = 4 |
| RxFlagsRxAccel3 RxFlags = 8 |
| RxFlagsRxAccel4 RxFlags = 16 |
| RxFlagsRxAccel5 RxFlags = 32 |
| RxFlagsRxAccel6 RxFlags = 64 |
| RxFlagsRxAccel7 RxFlags = 128 |
| RxFlagsRxAccel8 RxFlags = 256 |
| RxFlagsRxAccel9 RxFlags = 512 |
| RxFlagsRxAccel10 RxFlags = 1024 |
| RxFlagsRxAccel11 RxFlags = 2048 |
| RxFlagsRxAccel12 RxFlags = 4096 |
| RxFlagsRxAccel13 RxFlags = 8192 |
| RxFlagsRxAccel14 RxFlags = 16384 |
| RxFlagsRxAccel15 RxFlags = 32768 |
| RxFlagsRxOverrun RxFlags = 536870912 |
| RxFlagsRxValidationError RxFlags = 1073741824 |
| RxFlagsRxEchoedTx RxFlags = 2147483648 |
| RxFlags_Mask RxFlags = 3758161919 |
| ) |
| |
| func (_ RxFlags) I_BitsMask() RxFlags { |
| return RxFlags_Mask |
| } |
| |
| func (_ RxFlags) I_BitsIsStrict() bool { |
| return true |
| } |
| |
| func (x RxFlags) HasUnknownBits() bool { |
| return x.GetUnknownBits() != 0 |
| } |
| |
| func (x RxFlags) GetUnknownBits() uint64 { |
| return uint64(^RxFlags_Mask & x) |
| } |
| |
| func (x RxFlags) InvertBits() RxFlags { |
| return RxFlags_Mask & ^x |
| } |
| |
| // HasBits validates that all flipped bits in the mask are set. |
| func (x RxFlags) HasBits(mask RxFlags) bool { |
| return mask|x == x |
| } |
| |
| // ClearBits ensures all flipped bits in the mask are unset. |
| func (x RxFlags) ClearBits(mask RxFlags) RxFlags { |
| return ^mask & x |
| } |
| |
| func (x RxFlags) String() string { |
| var buf _strings.Builder |
| if 1&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel0") |
| } |
| if 2&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel1") |
| } |
| if 4&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel2") |
| } |
| if 8&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel3") |
| } |
| if 16&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel4") |
| } |
| if 32&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel5") |
| } |
| if 64&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel6") |
| } |
| if 128&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel7") |
| } |
| if 256&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel8") |
| } |
| if 512&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel9") |
| } |
| if 1024&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel10") |
| } |
| if 2048&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel11") |
| } |
| if 4096&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel12") |
| } |
| if 8192&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel13") |
| } |
| if 16384&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel14") |
| } |
| if 32768&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxAccel15") |
| } |
| if 536870912&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxOverrun") |
| } |
| if 1073741824&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxValidationError") |
| } |
| if 2147483648&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("RxEchoedTx") |
| } |
| if buf.Len() == 0 { |
| buf.WriteString("<empty bits>") |
| } |
| return buf.String() |
| } |
| |
| var _ _bindings.Bits = SessionFlags(0) |
| |
| // Additional session options. |
| type SessionFlags uint16 |
| |
| const ( |
| SessionFlagsPrimary SessionFlags = 1 |
| SessionFlagsListenTx SessionFlags = 2 |
| SessionFlagsReportInvalidRx SessionFlags = 4 |
| SessionFlags_Mask SessionFlags = 7 |
| ) |
| |
| func (_ SessionFlags) I_BitsMask() SessionFlags { |
| return SessionFlags_Mask |
| } |
| |
| func (_ SessionFlags) I_BitsIsStrict() bool { |
| return true |
| } |
| |
| func (x SessionFlags) HasUnknownBits() bool { |
| return x.GetUnknownBits() != 0 |
| } |
| |
| func (x SessionFlags) GetUnknownBits() uint64 { |
| return uint64(^SessionFlags_Mask & x) |
| } |
| |
| func (x SessionFlags) InvertBits() SessionFlags { |
| return SessionFlags_Mask & ^x |
| } |
| |
| // HasBits validates that all flipped bits in the mask are set. |
| func (x SessionFlags) HasBits(mask SessionFlags) bool { |
| return mask|x == x |
| } |
| |
| // ClearBits ensures all flipped bits in the mask are unset. |
| func (x SessionFlags) ClearBits(mask SessionFlags) SessionFlags { |
| return ^mask & x |
| } |
| |
| func (x SessionFlags) String() string { |
| var buf _strings.Builder |
| if 1&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("Primary") |
| } |
| if 2&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("ListenTx") |
| } |
| if 4&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("ReportInvalidRx") |
| } |
| if buf.Len() == 0 { |
| buf.WriteString("<empty bits>") |
| } |
| return buf.String() |
| } |
| |
| var _ _bindings.Bits = StatusFlags(0) |
| |
| // Port status bits, reported in [`PortStatus.flags`]. |
| type StatusFlags uint32 |
| |
| const ( |
| StatusFlagsOnline StatusFlags = 1 |
| StatusFlags_Mask StatusFlags = 1 |
| ) |
| |
| func (_ StatusFlags) I_BitsMask() StatusFlags { |
| return StatusFlags_Mask |
| } |
| |
| func (_ StatusFlags) I_BitsIsStrict() bool { |
| return true |
| } |
| |
| func (x StatusFlags) HasUnknownBits() bool { |
| return x.GetUnknownBits() != 0 |
| } |
| |
| func (x StatusFlags) GetUnknownBits() uint64 { |
| return uint64(^StatusFlags_Mask & x) |
| } |
| |
| func (x StatusFlags) InvertBits() StatusFlags { |
| return StatusFlags_Mask & ^x |
| } |
| |
| // HasBits validates that all flipped bits in the mask are set. |
| func (x StatusFlags) HasBits(mask StatusFlags) bool { |
| return mask|x == x |
| } |
| |
| // ClearBits ensures all flipped bits in the mask are unset. |
| func (x StatusFlags) ClearBits(mask StatusFlags) StatusFlags { |
| return ^mask & x |
| } |
| |
| func (x StatusFlags) String() string { |
| var buf _strings.Builder |
| if 1&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("Online") |
| } |
| if buf.Len() == 0 { |
| buf.WriteString("<empty bits>") |
| } |
| return buf.String() |
| } |
| |
| var _ _bindings.Bits = TxFlags(0) |
| |
| // Flags set by a Client when handing a buffer to a client on the tx path. |
| // |
| // Set by Clients on the `inbound_flags` field of a tx descriptor. |
| type TxFlags uint32 |
| |
| const ( |
| TxFlagsTxAccel0 TxFlags = 1 |
| TxFlagsTxAccel1 TxFlags = 2 |
| TxFlagsTxAccel2 TxFlags = 4 |
| TxFlagsTxAccel3 TxFlags = 8 |
| TxFlagsTxAccel4 TxFlags = 16 |
| TxFlagsTxAccel5 TxFlags = 32 |
| TxFlagsTxAccel6 TxFlags = 64 |
| TxFlagsTxAccel7 TxFlags = 128 |
| TxFlagsTxAccel8 TxFlags = 256 |
| TxFlagsTxAccel9 TxFlags = 512 |
| TxFlagsTxAccel10 TxFlags = 1024 |
| TxFlagsTxAccel11 TxFlags = 2048 |
| TxFlagsTxAccel12 TxFlags = 4096 |
| TxFlagsTxAccel13 TxFlags = 8192 |
| TxFlagsTxAccel14 TxFlags = 16384 |
| TxFlagsTxAccel15 TxFlags = 32768 |
| TxFlags_Mask TxFlags = 65535 |
| ) |
| |
| func (_ TxFlags) I_BitsMask() TxFlags { |
| return TxFlags_Mask |
| } |
| |
| func (_ TxFlags) I_BitsIsStrict() bool { |
| return true |
| } |
| |
| func (x TxFlags) HasUnknownBits() bool { |
| return x.GetUnknownBits() != 0 |
| } |
| |
| func (x TxFlags) GetUnknownBits() uint64 { |
| return uint64(^TxFlags_Mask & x) |
| } |
| |
| func (x TxFlags) InvertBits() TxFlags { |
| return TxFlags_Mask & ^x |
| } |
| |
| // HasBits validates that all flipped bits in the mask are set. |
| func (x TxFlags) HasBits(mask TxFlags) bool { |
| return mask|x == x |
| } |
| |
| // ClearBits ensures all flipped bits in the mask are unset. |
| func (x TxFlags) ClearBits(mask TxFlags) TxFlags { |
| return ^mask & x |
| } |
| |
| func (x TxFlags) String() string { |
| var buf _strings.Builder |
| if 1&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel0") |
| } |
| if 2&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel1") |
| } |
| if 4&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel2") |
| } |
| if 8&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel3") |
| } |
| if 16&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel4") |
| } |
| if 32&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel5") |
| } |
| if 64&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel6") |
| } |
| if 128&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel7") |
| } |
| if 256&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel8") |
| } |
| if 512&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel9") |
| } |
| if 1024&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel10") |
| } |
| if 2048&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel11") |
| } |
| if 4096&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel12") |
| } |
| if 8192&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel13") |
| } |
| if 16384&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel14") |
| } |
| if 32768&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxAccel15") |
| } |
| if buf.Len() == 0 { |
| buf.WriteString("<empty bits>") |
| } |
| return buf.String() |
| } |
| |
| var _ _bindings.Bits = TxReturnFlags(0) |
| |
| // Flags set by a Device when returning a tx buffer back to a client. |
| // |
| // Set by Devices on the `return_flags` field of a tx descriptor. |
| type TxReturnFlags uint32 |
| |
| const ( |
| TxReturnFlagsTxRetNotSupported TxReturnFlags = 1 |
| TxReturnFlagsTxRetOutOfResources TxReturnFlags = 2 |
| TxReturnFlagsTxRetNotAvailable TxReturnFlags = 4 |
| TxReturnFlagsTxRetError TxReturnFlags = 2147483648 |
| TxReturnFlags_Mask TxReturnFlags = 2147483655 |
| ) |
| |
| func (_ TxReturnFlags) I_BitsMask() TxReturnFlags { |
| return TxReturnFlags_Mask |
| } |
| |
| func (_ TxReturnFlags) I_BitsIsStrict() bool { |
| return true |
| } |
| |
| func (x TxReturnFlags) HasUnknownBits() bool { |
| return x.GetUnknownBits() != 0 |
| } |
| |
| func (x TxReturnFlags) GetUnknownBits() uint64 { |
| return uint64(^TxReturnFlags_Mask & x) |
| } |
| |
| func (x TxReturnFlags) InvertBits() TxReturnFlags { |
| return TxReturnFlags_Mask & ^x |
| } |
| |
| // HasBits validates that all flipped bits in the mask are set. |
| func (x TxReturnFlags) HasBits(mask TxReturnFlags) bool { |
| return mask|x == x |
| } |
| |
| // ClearBits ensures all flipped bits in the mask are unset. |
| func (x TxReturnFlags) ClearBits(mask TxReturnFlags) TxReturnFlags { |
| return ^mask & x |
| } |
| |
| func (x TxReturnFlags) String() string { |
| var buf _strings.Builder |
| if 1&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxRetNotSupported") |
| } |
| if 2&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxRetOutOfResources") |
| } |
| if 4&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxRetNotAvailable") |
| } |
| if 2147483648&x != 0 { |
| if buf.Len() != 0 { |
| buf.WriteRune('|') |
| } |
| buf.WriteString("TxRetError") |
| } |
| if buf.Len() == 0 { |
| buf.WriteString("<empty bits>") |
| } |
| return buf.String() |
| } |
| |
| type DeviceCloneRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Device DeviceWithCtxInterfaceRequest `fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"` |
| } |
| |
| var _mDeviceCloneRequest = _bindings.CreateLazyMarshaler(DeviceCloneRequest{}) |
| |
| func (msg *DeviceCloneRequest) Marshaler() _bindings.Marshaler { |
| return _mDeviceCloneRequest |
| } |
| |
| type DeviceGetInfoResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| Info DeviceInfo `fidl_offset_v2:"0"` |
| } |
| |
| var _mDeviceGetInfoResponse = _bindings.CreateLazyMarshaler(DeviceGetInfoResponse{}) |
| |
| func (msg *DeviceGetInfoResponse) Marshaler() _bindings.Marshaler { |
| return _mDeviceGetInfoResponse |
| } |
| |
| type DeviceGetPortRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| Id PortId `fidl_offset_v2:"0"` |
| Port PortWithCtxInterfaceRequest `fidl_offset_v2:"4" fidl_handle_subtype:"4" fidl_bounds:"0"` |
| } |
| |
| var _mDeviceGetPortRequest = _bindings.CreateLazyMarshaler(DeviceGetPortRequest{}) |
| |
| func (msg *DeviceGetPortRequest) Marshaler() _bindings.Marshaler { |
| return _mDeviceGetPortRequest |
| } |
| |
| type DeviceGetPortWatcherRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Watcher PortWatcherWithCtxInterfaceRequest `fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"` |
| } |
| |
| var _mDeviceGetPortWatcherRequest = _bindings.CreateLazyMarshaler(DeviceGetPortWatcherRequest{}) |
| |
| func (msg *DeviceGetPortWatcherRequest) Marshaler() _bindings.Marshaler { |
| return _mDeviceGetPortWatcherRequest |
| } |
| |
| type DeviceInstanceGetDeviceRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Device DeviceWithCtxInterfaceRequest `fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"` |
| } |
| |
| var _mDeviceInstanceGetDeviceRequest = _bindings.CreateLazyMarshaler(DeviceInstanceGetDeviceRequest{}) |
| |
| func (msg *DeviceInstanceGetDeviceRequest) Marshaler() _bindings.Marshaler { |
| return _mDeviceInstanceGetDeviceRequest |
| } |
| |
| type DeviceOpenSessionRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"32" fidl_alignment_v2:"8"` |
| SessionName string `fidl_offset_v2:"0" fidl_bounds:"64"` |
| SessionInfo SessionInfo `fidl_offset_v2:"16"` |
| } |
| |
| var _mDeviceOpenSessionRequest = _bindings.CreateLazyMarshaler(DeviceOpenSessionRequest{}) |
| |
| func (msg *DeviceOpenSessionRequest) Marshaler() _bindings.Marshaler { |
| return _mDeviceOpenSessionRequest |
| } |
| |
| type DeviceOpenSessionResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"12" fidl_alignment_v2:"4"` |
| Session SessionWithCtxInterface `fidl_offset_v2:"0" fidl_handle_subtype:"4"` |
| Fifos Fifos `fidl_offset_v2:"4"` |
| } |
| |
| var _mDeviceOpenSessionResponse = _bindings.CreateLazyMarshaler(DeviceOpenSessionResponse{}) |
| |
| func (msg *DeviceOpenSessionResponse) Marshaler() _bindings.Marshaler { |
| return _mDeviceOpenSessionResponse |
| } |
| |
| type Empty struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"` |
| } |
| |
| var _mEmpty = _bindings.CreateLazyMarshaler(Empty{}) |
| |
| func (msg *Empty) Marshaler() _bindings.Marshaler { |
| return _mEmpty |
| } |
| |
| // Data-plane FIFOs. |
| type Fifos struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| // Handle for the rx FIFO. |
| // |
| // Clients must write 16-bit descriptor indexes to this FIFO to be able to |
| // receive frames. |
| Rx _zx.Handle `fidl_offset_v2:"0" fidl_handle_subtype:"19" fidl_handle_rights:"2147483648" fidl_bounds:"0"` |
| // Handle for the tx FIFO. |
| // |
| // Clients write 16-bit descriptor indexes to this FIFO to enqueue outgoing |
| // frames. |
| Tx _zx.Handle `fidl_offset_v2:"4" fidl_handle_subtype:"19" fidl_handle_rights:"2147483648" fidl_bounds:"0"` |
| } |
| |
| var _mFifos = _bindings.CreateLazyMarshaler(Fifos{}) |
| |
| func (msg *Fifos) Marshaler() _bindings.Marshaler { |
| return _mFifos |
| } |
| |
| // Specifies a frame type and features and supported flags associated with that |
| // type. |
| // |
| // This is used by clients to read the supported frames on the tx path for a |
| // given Network Device. |
| // |
| // Some Network Devices may parse outgoing frames to perform frame |
| // transformation or specific hardware support. Each frame type has an |
| // associated [`FrameTypeSupport.features`] bits enumeration that lists |
| // FrameType-specific features that may or may not be supported. Devices that |
| // do not perform parsing are encouraged to just use the [`FRAME_FEATURES_RAW`] |
| // bit in `features`, which informs the client that all frame features are |
| // allowed. |
| type FrameTypeSupport struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"12" fidl_alignment_v2:"4"` |
| // The frame type this support entry refers to. |
| Type FrameType `fidl_offset_v2:"0"` |
| // The frame type-specific features supported. |
| Features uint32 `fidl_offset_v2:"4"` |
| // The flags supported for the given frame type. |
| SupportedFlags TxFlags `fidl_offset_v2:"8"` |
| } |
| |
| var _mFrameTypeSupport = _bindings.CreateLazyMarshaler(FrameTypeSupport{}) |
| |
| func (msg *FrameTypeSupport) Marshaler() _bindings.Marshaler { |
| return _mFrameTypeSupport |
| } |
| |
| type MacAddressingAddMulticastAddressRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"6" fidl_alignment_v2:"1"` |
| Address fuchsianet.MacAddress `fidl_offset_v2:"0"` |
| } |
| |
| var _mMacAddressingAddMulticastAddressRequest = _bindings.CreateLazyMarshaler(MacAddressingAddMulticastAddressRequest{}) |
| |
| func (msg *MacAddressingAddMulticastAddressRequest) Marshaler() _bindings.Marshaler { |
| return _mMacAddressingAddMulticastAddressRequest |
| } |
| |
| type MacAddressingAddMulticastAddressResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Status int32 `fidl_offset_v2:"0"` |
| } |
| |
| var _mMacAddressingAddMulticastAddressResponse = _bindings.CreateLazyMarshaler(MacAddressingAddMulticastAddressResponse{}) |
| |
| func (msg *MacAddressingAddMulticastAddressResponse) Marshaler() _bindings.Marshaler { |
| return _mMacAddressingAddMulticastAddressResponse |
| } |
| |
| type MacAddressingGetUnicastAddressResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"6" fidl_alignment_v2:"1"` |
| Address fuchsianet.MacAddress `fidl_offset_v2:"0"` |
| } |
| |
| var _mMacAddressingGetUnicastAddressResponse = _bindings.CreateLazyMarshaler(MacAddressingGetUnicastAddressResponse{}) |
| |
| func (msg *MacAddressingGetUnicastAddressResponse) Marshaler() _bindings.Marshaler { |
| return _mMacAddressingGetUnicastAddressResponse |
| } |
| |
| type MacAddressingRemoveMulticastAddressRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"6" fidl_alignment_v2:"1"` |
| Address fuchsianet.MacAddress `fidl_offset_v2:"0"` |
| } |
| |
| var _mMacAddressingRemoveMulticastAddressRequest = _bindings.CreateLazyMarshaler(MacAddressingRemoveMulticastAddressRequest{}) |
| |
| func (msg *MacAddressingRemoveMulticastAddressRequest) Marshaler() _bindings.Marshaler { |
| return _mMacAddressingRemoveMulticastAddressRequest |
| } |
| |
| type MacAddressingRemoveMulticastAddressResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Status int32 `fidl_offset_v2:"0"` |
| } |
| |
| var _mMacAddressingRemoveMulticastAddressResponse = _bindings.CreateLazyMarshaler(MacAddressingRemoveMulticastAddressResponse{}) |
| |
| func (msg *MacAddressingRemoveMulticastAddressResponse) Marshaler() _bindings.Marshaler { |
| return _mMacAddressingRemoveMulticastAddressResponse |
| } |
| |
| type MacAddressingSetModeRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Mode MacFilterMode `fidl_offset_v2:"0"` |
| } |
| |
| var _mMacAddressingSetModeRequest = _bindings.CreateLazyMarshaler(MacAddressingSetModeRequest{}) |
| |
| func (msg *MacAddressingSetModeRequest) Marshaler() _bindings.Marshaler { |
| return _mMacAddressingSetModeRequest |
| } |
| |
| type MacAddressingSetModeResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Status int32 `fidl_offset_v2:"0"` |
| } |
| |
| var _mMacAddressingSetModeResponse = _bindings.CreateLazyMarshaler(MacAddressingSetModeResponse{}) |
| |
| func (msg *MacAddressingSetModeResponse) Marshaler() _bindings.Marshaler { |
| return _mMacAddressingSetModeResponse |
| } |
| |
| type PortCloneRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Port PortWithCtxInterfaceRequest `fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"` |
| } |
| |
| var _mPortCloneRequest = _bindings.CreateLazyMarshaler(PortCloneRequest{}) |
| |
| func (msg *PortCloneRequest) Marshaler() _bindings.Marshaler { |
| return _mPortCloneRequest |
| } |
| |
| type PortGetDeviceRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Device DeviceWithCtxInterfaceRequest `fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"` |
| } |
| |
| var _mPortGetDeviceRequest = _bindings.CreateLazyMarshaler(PortGetDeviceRequest{}) |
| |
| func (msg *PortGetDeviceRequest) Marshaler() _bindings.Marshaler { |
| return _mPortGetDeviceRequest |
| } |
| |
| type PortGetDiagnosticsRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Diagnostics DiagnosticsWithCtxInterfaceRequest `fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"` |
| } |
| |
| var _mPortGetDiagnosticsRequest = _bindings.CreateLazyMarshaler(PortGetDiagnosticsRequest{}) |
| |
| func (msg *PortGetDiagnosticsRequest) Marshaler() _bindings.Marshaler { |
| return _mPortGetDiagnosticsRequest |
| } |
| |
| type PortGetInfoResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| Info PortInfo `fidl_offset_v2:"0"` |
| } |
| |
| var _mPortGetInfoResponse = _bindings.CreateLazyMarshaler(PortGetInfoResponse{}) |
| |
| func (msg *PortGetInfoResponse) Marshaler() _bindings.Marshaler { |
| return _mPortGetInfoResponse |
| } |
| |
| type PortGetMacRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Mac MacAddressingWithCtxInterfaceRequest `fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"` |
| } |
| |
| var _mPortGetMacRequest = _bindings.CreateLazyMarshaler(PortGetMacRequest{}) |
| |
| func (msg *PortGetMacRequest) Marshaler() _bindings.Marshaler { |
| return _mPortGetMacRequest |
| } |
| |
| type PortGetStatusResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| Status PortStatus `fidl_offset_v2:"0"` |
| } |
| |
| var _mPortGetStatusResponse = _bindings.CreateLazyMarshaler(PortGetStatusResponse{}) |
| |
| func (msg *PortGetStatusResponse) Marshaler() _bindings.Marshaler { |
| return _mPortGetStatusResponse |
| } |
| |
| type PortGetStatusWatcherRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"` |
| Watcher StatusWatcherWithCtxInterfaceRequest `fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"` |
| Buffer uint32 `fidl_offset_v2:"4"` |
| } |
| |
| var _mPortGetStatusWatcherRequest = _bindings.CreateLazyMarshaler(PortGetStatusWatcherRequest{}) |
| |
| func (msg *PortGetStatusWatcherRequest) Marshaler() _bindings.Marshaler { |
| return _mPortGetStatusWatcherRequest |
| } |
| |
| // A device port identifier. |
| type PortId struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"2" fidl_alignment_v2:"1"` |
| // The base identifier for the port. |
| // |
| // Generally identifies a port instance in hardware. |
| Base uint8 `fidl_offset_v2:"0"` |
| // An implementation-defined identifier that is guaranteed to change on |
| // every instantiation of the identified port. |
| Salt uint8 `fidl_offset_v2:"1"` |
| } |
| |
| var _mPortId = _bindings.CreateLazyMarshaler(PortId{}) |
| |
| func (msg *PortId) Marshaler() _bindings.Marshaler { |
| return _mPortId |
| } |
| |
| type PortWatcherWatchResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| Event DevicePortEvent `fidl_offset_v2:"0"` |
| } |
| |
| var _mPortWatcherWatchResponse = _bindings.CreateLazyMarshaler(PortWatcherWatchResponse{}) |
| |
| func (msg *PortWatcherWatchResponse) Marshaler() _bindings.Marshaler { |
| return _mPortWatcherWatchResponse |
| } |
| |
| type SessionAttachRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"` |
| Port PortId `fidl_offset_v2:"0"` |
| RxFrames []FrameType `fidl_offset_v2:"8" fidl_bounds:"4"` |
| } |
| |
| var _mSessionAttachRequest = _bindings.CreateLazyMarshaler(SessionAttachRequest{}) |
| |
| func (msg *SessionAttachRequest) Marshaler() _bindings.Marshaler { |
| return _mSessionAttachRequest |
| } |
| |
| type SessionDetachRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"2" fidl_alignment_v2:"1"` |
| Port PortId `fidl_offset_v2:"0"` |
| } |
| |
| var _mSessionDetachRequest = _bindings.CreateLazyMarshaler(SessionDetachRequest{}) |
| |
| func (msg *SessionDetachRequest) Marshaler() _bindings.Marshaler { |
| return _mSessionDetachRequest |
| } |
| |
| type SessionAttachResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"` |
| } |
| |
| var _mSessionAttachResponse = _bindings.CreateLazyMarshaler(SessionAttachResponse{}) |
| |
| func (msg *SessionAttachResponse) Marshaler() _bindings.Marshaler { |
| return _mSessionAttachResponse |
| } |
| |
| type SessionDetachResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"` |
| } |
| |
| var _mSessionDetachResponse = _bindings.CreateLazyMarshaler(SessionDetachResponse{}) |
| |
| func (msg *SessionDetachResponse) Marshaler() _bindings.Marshaler { |
| return _mSessionDetachResponse |
| } |
| |
| type StatusWatcherWatchStatusResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| PortStatus PortStatus `fidl_offset_v2:"0"` |
| } |
| |
| var _mStatusWatcherWatchStatusResponse = _bindings.CreateLazyMarshaler(StatusWatcherWatchStatusResponse{}) |
| |
| func (msg *StatusWatcherWatchStatusResponse) Marshaler() _bindings.Marshaler { |
| return _mStatusWatcherWatchStatusResponse |
| } |
| |
| type I_devicePortEventTag uint64 |
| |
| const ( |
| DevicePortEventExisting = 1 // 0x00000001 |
| DevicePortEventAdded = 2 // 0x00000002 |
| DevicePortEventRemoved = 3 // 0x00000003 |
| DevicePortEventIdle = 4 // 0x00000004 |
| ) |
| |
| // Port creation and destruction events. |
| type DevicePortEvent struct { |
| I_devicePortEventTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| // Port existed when watcher was created. |
| Existing PortId `fidl_ordinal:"1"` |
| // New port was added to device. |
| Added PortId `fidl_ordinal:"2"` |
| // Port was removed from the device. |
| Removed PortId `fidl_ordinal:"3"` |
| // Exhausted list of existing ports. |
| Idle Empty `fidl_ordinal:"4"` |
| } |
| |
| var _mDevicePortEvent = _bindings.CreateLazyMarshaler(DevicePortEvent{}) |
| |
| func (msg *DevicePortEvent) Marshaler() _bindings.Marshaler { |
| return _mDevicePortEvent |
| } |
| |
| func (_m *DevicePortEvent) reset() { |
| switch _m.I_devicePortEventTag { |
| case 1: |
| var _zeroed PortId |
| _m.Existing = _zeroed |
| case 2: |
| var _zeroed PortId |
| _m.Added = _zeroed |
| case 3: |
| var _zeroed PortId |
| _m.Removed = _zeroed |
| case 4: |
| var _zeroed Empty |
| _m.Idle = _zeroed |
| } |
| } |
| |
| func (_m *DevicePortEvent) Which() I_devicePortEventTag { |
| return _m.I_devicePortEventTag |
| } |
| |
| func (_m *DevicePortEvent) Ordinal() uint64 { |
| return uint64(_m.I_devicePortEventTag) |
| } |
| |
| func (_m *DevicePortEvent) SetExisting(existing PortId) { |
| _m.reset() |
| _m.I_devicePortEventTag = DevicePortEventExisting |
| _m.Existing = existing |
| } |
| |
| func DevicePortEventWithExisting(existing PortId) DevicePortEvent { |
| var _u DevicePortEvent |
| _u.SetExisting(existing) |
| return _u |
| } |
| |
| func (_m *DevicePortEvent) SetAdded(added PortId) { |
| _m.reset() |
| _m.I_devicePortEventTag = DevicePortEventAdded |
| _m.Added = added |
| } |
| |
| func DevicePortEventWithAdded(added PortId) DevicePortEvent { |
| var _u DevicePortEvent |
| _u.SetAdded(added) |
| return _u |
| } |
| |
| func (_m *DevicePortEvent) SetRemoved(removed PortId) { |
| _m.reset() |
| _m.I_devicePortEventTag = DevicePortEventRemoved |
| _m.Removed = removed |
| } |
| |
| func DevicePortEventWithRemoved(removed PortId) DevicePortEvent { |
| var _u DevicePortEvent |
| _u.SetRemoved(removed) |
| return _u |
| } |
| |
| func (_m *DevicePortEvent) SetIdle(idle Empty) { |
| _m.reset() |
| _m.I_devicePortEventTag = DevicePortEventIdle |
| _m.Idle = idle |
| } |
| |
| func DevicePortEventWithIdle(idle Empty) DevicePortEvent { |
| var _u DevicePortEvent |
| _u.SetIdle(idle) |
| return _u |
| } |
| |
| type I_deviceOpenSessionResultTag uint64 |
| |
| const ( |
| DeviceOpenSessionResultResponse = 1 // 0x00000001 |
| DeviceOpenSessionResultErr = 2 // 0x00000002 |
| ) |
| |
| type DeviceOpenSessionResult struct { |
| I_deviceOpenSessionResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"` |
| Response DeviceOpenSessionResponse `fidl_ordinal:"1"` |
| Err int32 `fidl_ordinal:"2"` |
| } |
| |
| var _mDeviceOpenSessionResult = _bindings.CreateLazyMarshaler(DeviceOpenSessionResult{}) |
| |
| func (msg *DeviceOpenSessionResult) Marshaler() _bindings.Marshaler { |
| return _mDeviceOpenSessionResult |
| } |
| |
| func (_m *DeviceOpenSessionResult) reset() { |
| switch _m.I_deviceOpenSessionResultTag { |
| case 1: |
| var _zeroed DeviceOpenSessionResponse |
| _m.Response = _zeroed |
| case 2: |
| var _zeroed int32 |
| _m.Err = _zeroed |
| } |
| } |
| |
| func (_m *DeviceOpenSessionResult) Which() I_deviceOpenSessionResultTag { |
| return _m.I_deviceOpenSessionResultTag |
| } |
| |
| func (_m *DeviceOpenSessionResult) Ordinal() uint64 { |
| return uint64(_m.I_deviceOpenSessionResultTag) |
| } |
| |
| func (_m *DeviceOpenSessionResult) SetResponse(response DeviceOpenSessionResponse) { |
| _m.reset() |
| _m.I_deviceOpenSessionResultTag = DeviceOpenSessionResultResponse |
| _m.Response = response |
| } |
| |
| func DeviceOpenSessionResultWithResponse(response DeviceOpenSessionResponse) DeviceOpenSessionResult { |
| var _u DeviceOpenSessionResult |
| _u.SetResponse(response) |
| return _u |
| } |
| |
| func (_m *DeviceOpenSessionResult) SetErr(err int32) { |
| _m.reset() |
| _m.I_deviceOpenSessionResultTag = DeviceOpenSessionResultErr |
| _m.Err = err |
| } |
| |
| func DeviceOpenSessionResultWithErr(err int32) DeviceOpenSessionResult { |
| var _u DeviceOpenSessionResult |
| _u.SetErr(err) |
| return _u |
| } |
| |
| type I_sessionAttachResultTag uint64 |
| |
| const ( |
| SessionAttachResultResponse = 1 // 0x00000001 |
| SessionAttachResultErr = 2 // 0x00000002 |
| ) |
| |
| type SessionAttachResult struct { |
| I_sessionAttachResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| Response SessionAttachResponse `fidl_ordinal:"1"` |
| Err int32 `fidl_ordinal:"2"` |
| } |
| |
| var _mSessionAttachResult = _bindings.CreateLazyMarshaler(SessionAttachResult{}) |
| |
| func (msg *SessionAttachResult) Marshaler() _bindings.Marshaler { |
| return _mSessionAttachResult |
| } |
| |
| func (_m *SessionAttachResult) reset() { |
| switch _m.I_sessionAttachResultTag { |
| case 1: |
| var _zeroed SessionAttachResponse |
| _m.Response = _zeroed |
| case 2: |
| var _zeroed int32 |
| _m.Err = _zeroed |
| } |
| } |
| |
| func (_m *SessionAttachResult) Which() I_sessionAttachResultTag { |
| return _m.I_sessionAttachResultTag |
| } |
| |
| func (_m *SessionAttachResult) Ordinal() uint64 { |
| return uint64(_m.I_sessionAttachResultTag) |
| } |
| |
| func (_m *SessionAttachResult) SetResponse(response SessionAttachResponse) { |
| _m.reset() |
| _m.I_sessionAttachResultTag = SessionAttachResultResponse |
| _m.Response = response |
| } |
| |
| func SessionAttachResultWithResponse(response SessionAttachResponse) SessionAttachResult { |
| var _u SessionAttachResult |
| _u.SetResponse(response) |
| return _u |
| } |
| |
| func (_m *SessionAttachResult) SetErr(err int32) { |
| _m.reset() |
| _m.I_sessionAttachResultTag = SessionAttachResultErr |
| _m.Err = err |
| } |
| |
| func SessionAttachResultWithErr(err int32) SessionAttachResult { |
| var _u SessionAttachResult |
| _u.SetErr(err) |
| return _u |
| } |
| |
| type I_sessionDetachResultTag uint64 |
| |
| const ( |
| SessionDetachResultResponse = 1 // 0x00000001 |
| SessionDetachResultErr = 2 // 0x00000002 |
| ) |
| |
| type SessionDetachResult struct { |
| I_sessionDetachResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| Response SessionDetachResponse `fidl_ordinal:"1"` |
| Err int32 `fidl_ordinal:"2"` |
| } |
| |
| var _mSessionDetachResult = _bindings.CreateLazyMarshaler(SessionDetachResult{}) |
| |
| func (msg *SessionDetachResult) Marshaler() _bindings.Marshaler { |
| return _mSessionDetachResult |
| } |
| |
| func (_m *SessionDetachResult) reset() { |
| switch _m.I_sessionDetachResultTag { |
| case 1: |
| var _zeroed SessionDetachResponse |
| _m.Response = _zeroed |
| case 2: |
| var _zeroed int32 |
| _m.Err = _zeroed |
| } |
| } |
| |
| func (_m *SessionDetachResult) Which() I_sessionDetachResultTag { |
| return _m.I_sessionDetachResultTag |
| } |
| |
| func (_m *SessionDetachResult) Ordinal() uint64 { |
| return uint64(_m.I_sessionDetachResultTag) |
| } |
| |
| func (_m *SessionDetachResult) SetResponse(response SessionDetachResponse) { |
| _m.reset() |
| _m.I_sessionDetachResultTag = SessionDetachResultResponse |
| _m.Response = response |
| } |
| |
| func SessionDetachResultWithResponse(response SessionDetachResponse) SessionDetachResult { |
| var _u SessionDetachResult |
| _u.SetResponse(response) |
| return _u |
| } |
| |
| func (_m *SessionDetachResult) SetErr(err int32) { |
| _m.reset() |
| _m.I_sessionDetachResultTag = SessionDetachResultErr |
| _m.Err = err |
| } |
| |
| func SessionDetachResultWithErr(err int32) SessionDetachResult { |
| var _u SessionDetachResult |
| _u.SetErr(err) |
| return _u |
| } |
| |
| // Network device base info. |
| type DeviceBaseInfo struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| // Maximum number of items in rx FIFO (per session). Required. |
| // |
| // `rx_depth` is calculated based on the size of the actual backing |
| // hardware rx queue. |
| RxDepth uint16 `fidl_ordinal:"1"` |
| RxDepthPresent bool |
| // Maximum number of items in tx FIFO (per session). Required. |
| // |
| // `tx_depth` is calculated based on the size of the actual backing |
| // hardware tx queue. |
| TxDepth uint16 `fidl_ordinal:"2"` |
| TxDepthPresent bool |
| // Alignment requirement for buffers in the data VMO. |
| // |
| // All buffers in the data VMO *must* be aligned to `buffer_alignment` |
| // relative to the start of the VMO. `buffer_alignment == 0` is never |
| // reported. Required. |
| BufferAlignment uint32 `fidl_ordinal:"3"` |
| BufferAlignmentPresent bool |
| // Maximum supported length of buffers in the data VMO, in bytes. |
| // |
| // Absent if no maximum buffer length is defined. Must be nonzero. |
| MaxBufferLength uint32 `fidl_ordinal:"4"` |
| MaxBufferLengthPresent bool |
| // The minimum rx buffer length required for device. Required. |
| MinRxBufferLength uint32 `fidl_ordinal:"5"` |
| MinRxBufferLengthPresent bool |
| // The minimum tx buffer length required for the device. Required. |
| // |
| // This value accounts only for tx payload length, `min_tx_buffer_head` and |
| // `min_tx_buffer_tail` are not part of this value. |
| // |
| // Clients must zero pad outgoing frames to meet the required minimum |
| // length. |
| MinTxBufferLength uint32 `fidl_ordinal:"6"` |
| MinTxBufferLengthPresent bool |
| // The number of bytes the device requests be free as `head` space in a tx |
| // buffer. Required. |
| MinTxBufferHead uint16 `fidl_ordinal:"7"` |
| MinTxBufferHeadPresent bool |
| // The amount of bytes the device requests be free as `tail` space in a tx |
| // buffer. Required. |
| MinTxBufferTail uint16 `fidl_ordinal:"8"` |
| MinTxBufferTailPresent bool |
| // Maximum descriptor chain length accepted by the device. Required. |
| MaxBufferParts uint8 `fidl_ordinal:"9"` |
| MaxBufferPartsPresent bool |
| // Available rx acceleration flags for this device. |
| // |
| // `rx_accel` maps the `RX_ACCEL_*` flags in the frame descriptors with |
| // semantic acceleration features described by [`RxAcceleration`]. Position |
| // `n` of `rx_accel` conveys the meaning of the `RX_ACCEL_n` flag. |
| // |
| // Interpreted as empty if not provided. |
| RxAccel []RxAcceleration `fidl_bounds:"16" fidl_ordinal:"10"` |
| RxAccelPresent bool |
| // Available tx acceleration flags for this device. |
| // |
| // `tx_accel` maps the `TX_ACCEL_*` flags in the frame descriptors with |
| // semantic acceleration features described by [`TxAcceleration`]. Position |
| // `n` of `tx_accel` conveys the meaning of the `TX_ACCEL_n` flag. |
| // |
| // Interpreted as empty if not provided. |
| TxAccel []TxAcceleration `fidl_bounds:"16" fidl_ordinal:"11"` |
| TxAccelPresent bool |
| } |
| |
| var _mDeviceBaseInfo = _bindings.CreateLazyMarshaler(DeviceBaseInfo{}) |
| |
| func (msg *DeviceBaseInfo) Marshaler() _bindings.Marshaler { |
| return _mDeviceBaseInfo |
| } |
| |
| func (u *DeviceBaseInfo) SetRxDepth(rxDepth uint16) { |
| u.RxDepth = rxDepth |
| u.RxDepthPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetRxDepth() uint16 { |
| return u.RxDepth |
| } |
| |
| func (u *DeviceBaseInfo) GetRxDepthWithDefault(_default uint16) uint16 { |
| if !u.HasRxDepth() { |
| return _default |
| } |
| return u.RxDepth |
| } |
| |
| func (u *DeviceBaseInfo) HasRxDepth() bool { |
| return u.RxDepthPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearRxDepth() { |
| u.RxDepthPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetTxDepth(txDepth uint16) { |
| u.TxDepth = txDepth |
| u.TxDepthPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetTxDepth() uint16 { |
| return u.TxDepth |
| } |
| |
| func (u *DeviceBaseInfo) GetTxDepthWithDefault(_default uint16) uint16 { |
| if !u.HasTxDepth() { |
| return _default |
| } |
| return u.TxDepth |
| } |
| |
| func (u *DeviceBaseInfo) HasTxDepth() bool { |
| return u.TxDepthPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearTxDepth() { |
| u.TxDepthPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetBufferAlignment(bufferAlignment uint32) { |
| u.BufferAlignment = bufferAlignment |
| u.BufferAlignmentPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetBufferAlignment() uint32 { |
| return u.BufferAlignment |
| } |
| |
| func (u *DeviceBaseInfo) GetBufferAlignmentWithDefault(_default uint32) uint32 { |
| if !u.HasBufferAlignment() { |
| return _default |
| } |
| return u.BufferAlignment |
| } |
| |
| func (u *DeviceBaseInfo) HasBufferAlignment() bool { |
| return u.BufferAlignmentPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearBufferAlignment() { |
| u.BufferAlignmentPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetMaxBufferLength(maxBufferLength uint32) { |
| u.MaxBufferLength = maxBufferLength |
| u.MaxBufferLengthPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetMaxBufferLength() uint32 { |
| return u.MaxBufferLength |
| } |
| |
| func (u *DeviceBaseInfo) GetMaxBufferLengthWithDefault(_default uint32) uint32 { |
| if !u.HasMaxBufferLength() { |
| return _default |
| } |
| return u.MaxBufferLength |
| } |
| |
| func (u *DeviceBaseInfo) HasMaxBufferLength() bool { |
| return u.MaxBufferLengthPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearMaxBufferLength() { |
| u.MaxBufferLengthPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetMinRxBufferLength(minRxBufferLength uint32) { |
| u.MinRxBufferLength = minRxBufferLength |
| u.MinRxBufferLengthPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetMinRxBufferLength() uint32 { |
| return u.MinRxBufferLength |
| } |
| |
| func (u *DeviceBaseInfo) GetMinRxBufferLengthWithDefault(_default uint32) uint32 { |
| if !u.HasMinRxBufferLength() { |
| return _default |
| } |
| return u.MinRxBufferLength |
| } |
| |
| func (u *DeviceBaseInfo) HasMinRxBufferLength() bool { |
| return u.MinRxBufferLengthPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearMinRxBufferLength() { |
| u.MinRxBufferLengthPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetMinTxBufferLength(minTxBufferLength uint32) { |
| u.MinTxBufferLength = minTxBufferLength |
| u.MinTxBufferLengthPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetMinTxBufferLength() uint32 { |
| return u.MinTxBufferLength |
| } |
| |
| func (u *DeviceBaseInfo) GetMinTxBufferLengthWithDefault(_default uint32) uint32 { |
| if !u.HasMinTxBufferLength() { |
| return _default |
| } |
| return u.MinTxBufferLength |
| } |
| |
| func (u *DeviceBaseInfo) HasMinTxBufferLength() bool { |
| return u.MinTxBufferLengthPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearMinTxBufferLength() { |
| u.MinTxBufferLengthPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetMinTxBufferHead(minTxBufferHead uint16) { |
| u.MinTxBufferHead = minTxBufferHead |
| u.MinTxBufferHeadPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetMinTxBufferHead() uint16 { |
| return u.MinTxBufferHead |
| } |
| |
| func (u *DeviceBaseInfo) GetMinTxBufferHeadWithDefault(_default uint16) uint16 { |
| if !u.HasMinTxBufferHead() { |
| return _default |
| } |
| return u.MinTxBufferHead |
| } |
| |
| func (u *DeviceBaseInfo) HasMinTxBufferHead() bool { |
| return u.MinTxBufferHeadPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearMinTxBufferHead() { |
| u.MinTxBufferHeadPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetMinTxBufferTail(minTxBufferTail uint16) { |
| u.MinTxBufferTail = minTxBufferTail |
| u.MinTxBufferTailPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetMinTxBufferTail() uint16 { |
| return u.MinTxBufferTail |
| } |
| |
| func (u *DeviceBaseInfo) GetMinTxBufferTailWithDefault(_default uint16) uint16 { |
| if !u.HasMinTxBufferTail() { |
| return _default |
| } |
| return u.MinTxBufferTail |
| } |
| |
| func (u *DeviceBaseInfo) HasMinTxBufferTail() bool { |
| return u.MinTxBufferTailPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearMinTxBufferTail() { |
| u.MinTxBufferTailPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetMaxBufferParts(maxBufferParts uint8) { |
| u.MaxBufferParts = maxBufferParts |
| u.MaxBufferPartsPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetMaxBufferParts() uint8 { |
| return u.MaxBufferParts |
| } |
| |
| func (u *DeviceBaseInfo) GetMaxBufferPartsWithDefault(_default uint8) uint8 { |
| if !u.HasMaxBufferParts() { |
| return _default |
| } |
| return u.MaxBufferParts |
| } |
| |
| func (u *DeviceBaseInfo) HasMaxBufferParts() bool { |
| return u.MaxBufferPartsPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearMaxBufferParts() { |
| u.MaxBufferPartsPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetRxAccel(rxAccel []RxAcceleration) { |
| u.RxAccel = rxAccel |
| u.RxAccelPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetRxAccel() []RxAcceleration { |
| return u.RxAccel |
| } |
| |
| func (u *DeviceBaseInfo) GetRxAccelWithDefault(_default []RxAcceleration) []RxAcceleration { |
| if !u.HasRxAccel() { |
| return _default |
| } |
| return u.RxAccel |
| } |
| |
| func (u *DeviceBaseInfo) HasRxAccel() bool { |
| return u.RxAccelPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearRxAccel() { |
| u.RxAccelPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) SetTxAccel(txAccel []TxAcceleration) { |
| u.TxAccel = txAccel |
| u.TxAccelPresent = true |
| } |
| |
| func (u *DeviceBaseInfo) GetTxAccel() []TxAcceleration { |
| return u.TxAccel |
| } |
| |
| func (u *DeviceBaseInfo) GetTxAccelWithDefault(_default []TxAcceleration) []TxAcceleration { |
| if !u.HasTxAccel() { |
| return _default |
| } |
| return u.TxAccel |
| } |
| |
| func (u *DeviceBaseInfo) HasTxAccel() bool { |
| return u.TxAccelPresent |
| } |
| |
| func (u *DeviceBaseInfo) ClearTxAccel() { |
| u.TxAccelPresent = false |
| } |
| |
| func (u *DeviceBaseInfo) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *DeviceBaseInfo) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |
| |
| // Network device information. |
| type DeviceInfo struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| // Minimum descriptor length, in 64-bit words. Required. |
| // |
| // The minimum length that each buffer descriptor must have for correct |
| // operation with this device. Devices that support extra frame metadata |
| // inform larger minimum descriptor lengths that reflect the minimum space |
| // needed to be able to store frame metadata. |
| MinDescriptorLength uint8 `fidl_ordinal:"1"` |
| MinDescriptorLengthPresent bool |
| // Accepted descriptor version. Required. |
| DescriptorVersion uint8 `fidl_ordinal:"2"` |
| DescriptorVersionPresent bool |
| // Device base info. Required. |
| BaseInfo DeviceBaseInfo `fidl_ordinal:"3"` |
| BaseInfoPresent bool |
| } |
| |
| var _mDeviceInfo = _bindings.CreateLazyMarshaler(DeviceInfo{}) |
| |
| func (msg *DeviceInfo) Marshaler() _bindings.Marshaler { |
| return _mDeviceInfo |
| } |
| |
| func (u *DeviceInfo) SetMinDescriptorLength(minDescriptorLength uint8) { |
| u.MinDescriptorLength = minDescriptorLength |
| u.MinDescriptorLengthPresent = true |
| } |
| |
| func (u *DeviceInfo) GetMinDescriptorLength() uint8 { |
| return u.MinDescriptorLength |
| } |
| |
| func (u *DeviceInfo) GetMinDescriptorLengthWithDefault(_default uint8) uint8 { |
| if !u.HasMinDescriptorLength() { |
| return _default |
| } |
| return u.MinDescriptorLength |
| } |
| |
| func (u *DeviceInfo) HasMinDescriptorLength() bool { |
| return u.MinDescriptorLengthPresent |
| } |
| |
| func (u *DeviceInfo) ClearMinDescriptorLength() { |
| u.MinDescriptorLengthPresent = false |
| } |
| |
| func (u *DeviceInfo) SetDescriptorVersion(descriptorVersion uint8) { |
| u.DescriptorVersion = descriptorVersion |
| u.DescriptorVersionPresent = true |
| } |
| |
| func (u *DeviceInfo) GetDescriptorVersion() uint8 { |
| return u.DescriptorVersion |
| } |
| |
| func (u *DeviceInfo) GetDescriptorVersionWithDefault(_default uint8) uint8 { |
| if !u.HasDescriptorVersion() { |
| return _default |
| } |
| return u.DescriptorVersion |
| } |
| |
| func (u *DeviceInfo) HasDescriptorVersion() bool { |
| return u.DescriptorVersionPresent |
| } |
| |
| func (u *DeviceInfo) ClearDescriptorVersion() { |
| u.DescriptorVersionPresent = false |
| } |
| |
| func (u *DeviceInfo) SetBaseInfo(baseInfo DeviceBaseInfo) { |
| u.BaseInfo = baseInfo |
| u.BaseInfoPresent = true |
| } |
| |
| func (u *DeviceInfo) GetBaseInfo() DeviceBaseInfo { |
| return u.BaseInfo |
| } |
| |
| func (u *DeviceInfo) GetBaseInfoWithDefault(_default DeviceBaseInfo) DeviceBaseInfo { |
| if !u.HasBaseInfo() { |
| return _default |
| } |
| return u.BaseInfo |
| } |
| |
| func (u *DeviceInfo) HasBaseInfo() bool { |
| return u.BaseInfoPresent |
| } |
| |
| func (u *DeviceInfo) ClearBaseInfo() { |
| u.BaseInfoPresent = false |
| } |
| |
| func (u *DeviceInfo) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *DeviceInfo) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |
| |
| // Port base info. |
| type PortBaseInfo struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| // Port's class. Required. |
| PortClass DeviceClass `fidl_ordinal:"1"` |
| PortClassPresent bool |
| // Supported rx frame types on this port. Required. |
| // |
| // Clients may open sessions subscribing to a subset of `rx_types` frame |
| // types on this port. |
| RxTypes []FrameType `fidl_bounds:"4" fidl_ordinal:"2"` |
| RxTypesPresent bool |
| // Supported tx frame types on this port. Required. |
| // |
| // Frames destined to this port whose frame type is not in `tx_types` are |
| // returned with an error. |
| // |
| // Some network devices may need to perform partial frame parsing and |
| // serialization and, for that reason, `tx_types` is a vector of |
| // [`FrameTypeSupport`] which includes specific features per frame type. |
| // For example, a device that supports Ethernet frames but needs to convert |
| // the Ethernet header may only support standard Ethernet II frames, and |
| // not any "raw" Ethernet frame. |
| TxTypes []FrameTypeSupport `fidl_bounds:"4" fidl_ordinal:"3"` |
| TxTypesPresent bool |
| } |
| |
| var _mPortBaseInfo = _bindings.CreateLazyMarshaler(PortBaseInfo{}) |
| |
| func (msg *PortBaseInfo) Marshaler() _bindings.Marshaler { |
| return _mPortBaseInfo |
| } |
| |
| func (u *PortBaseInfo) SetPortClass(portClass DeviceClass) { |
| u.PortClass = portClass |
| u.PortClassPresent = true |
| } |
| |
| func (u *PortBaseInfo) GetPortClass() DeviceClass { |
| return u.PortClass |
| } |
| |
| func (u *PortBaseInfo) GetPortClassWithDefault(_default DeviceClass) DeviceClass { |
| if !u.HasPortClass() { |
| return _default |
| } |
| return u.PortClass |
| } |
| |
| func (u *PortBaseInfo) HasPortClass() bool { |
| return u.PortClassPresent |
| } |
| |
| func (u *PortBaseInfo) ClearPortClass() { |
| u.PortClassPresent = false |
| } |
| |
| func (u *PortBaseInfo) SetRxTypes(rxTypes []FrameType) { |
| u.RxTypes = rxTypes |
| u.RxTypesPresent = true |
| } |
| |
| func (u *PortBaseInfo) GetRxTypes() []FrameType { |
| return u.RxTypes |
| } |
| |
| func (u *PortBaseInfo) GetRxTypesWithDefault(_default []FrameType) []FrameType { |
| if !u.HasRxTypes() { |
| return _default |
| } |
| return u.RxTypes |
| } |
| |
| func (u *PortBaseInfo) HasRxTypes() bool { |
| return u.RxTypesPresent |
| } |
| |
| func (u *PortBaseInfo) ClearRxTypes() { |
| u.RxTypesPresent = false |
| } |
| |
| func (u *PortBaseInfo) SetTxTypes(txTypes []FrameTypeSupport) { |
| u.TxTypes = txTypes |
| u.TxTypesPresent = true |
| } |
| |
| func (u *PortBaseInfo) GetTxTypes() []FrameTypeSupport { |
| return u.TxTypes |
| } |
| |
| func (u *PortBaseInfo) GetTxTypesWithDefault(_default []FrameTypeSupport) []FrameTypeSupport { |
| if !u.HasTxTypes() { |
| return _default |
| } |
| return u.TxTypes |
| } |
| |
| func (u *PortBaseInfo) HasTxTypes() bool { |
| return u.TxTypesPresent |
| } |
| |
| func (u *PortBaseInfo) ClearTxTypes() { |
| u.TxTypesPresent = false |
| } |
| |
| func (u *PortBaseInfo) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *PortBaseInfo) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |
| |
| type PortGetCountersResponse struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| // The total number of ingress frames on this port. |
| RxFrames uint64 `fidl_ordinal:"1"` |
| RxFramesPresent bool |
| // The total number of ingress bytes on this port. |
| RxBytes uint64 `fidl_ordinal:"2"` |
| RxBytesPresent bool |
| // The total number of egress frames on this port. |
| TxFrames uint64 `fidl_ordinal:"3"` |
| TxFramesPresent bool |
| // The total number of egress bytes on this port. |
| TxBytes uint64 `fidl_ordinal:"4"` |
| TxBytesPresent bool |
| } |
| |
| var _mPortGetCountersResponse = _bindings.CreateLazyMarshaler(PortGetCountersResponse{}) |
| |
| func (msg *PortGetCountersResponse) Marshaler() _bindings.Marshaler { |
| return _mPortGetCountersResponse |
| } |
| |
| func (u *PortGetCountersResponse) SetRxFrames(rxFrames uint64) { |
| u.RxFrames = rxFrames |
| u.RxFramesPresent = true |
| } |
| |
| func (u *PortGetCountersResponse) GetRxFrames() uint64 { |
| return u.RxFrames |
| } |
| |
| func (u *PortGetCountersResponse) GetRxFramesWithDefault(_default uint64) uint64 { |
| if !u.HasRxFrames() { |
| return _default |
| } |
| return u.RxFrames |
| } |
| |
| func (u *PortGetCountersResponse) HasRxFrames() bool { |
| return u.RxFramesPresent |
| } |
| |
| func (u *PortGetCountersResponse) ClearRxFrames() { |
| u.RxFramesPresent = false |
| } |
| |
| func (u *PortGetCountersResponse) SetRxBytes(rxBytes uint64) { |
| u.RxBytes = rxBytes |
| u.RxBytesPresent = true |
| } |
| |
| func (u *PortGetCountersResponse) GetRxBytes() uint64 { |
| return u.RxBytes |
| } |
| |
| func (u *PortGetCountersResponse) GetRxBytesWithDefault(_default uint64) uint64 { |
| if !u.HasRxBytes() { |
| return _default |
| } |
| return u.RxBytes |
| } |
| |
| func (u *PortGetCountersResponse) HasRxBytes() bool { |
| return u.RxBytesPresent |
| } |
| |
| func (u *PortGetCountersResponse) ClearRxBytes() { |
| u.RxBytesPresent = false |
| } |
| |
| func (u *PortGetCountersResponse) SetTxFrames(txFrames uint64) { |
| u.TxFrames = txFrames |
| u.TxFramesPresent = true |
| } |
| |
| func (u *PortGetCountersResponse) GetTxFrames() uint64 { |
| return u.TxFrames |
| } |
| |
| func (u *PortGetCountersResponse) GetTxFramesWithDefault(_default uint64) uint64 { |
| if !u.HasTxFrames() { |
| return _default |
| } |
| return u.TxFrames |
| } |
| |
| func (u *PortGetCountersResponse) HasTxFrames() bool { |
| return u.TxFramesPresent |
| } |
| |
| func (u *PortGetCountersResponse) ClearTxFrames() { |
| u.TxFramesPresent = false |
| } |
| |
| func (u *PortGetCountersResponse) SetTxBytes(txBytes uint64) { |
| u.TxBytes = txBytes |
| u.TxBytesPresent = true |
| } |
| |
| func (u *PortGetCountersResponse) GetTxBytes() uint64 { |
| return u.TxBytes |
| } |
| |
| func (u *PortGetCountersResponse) GetTxBytesWithDefault(_default uint64) uint64 { |
| if !u.HasTxBytes() { |
| return _default |
| } |
| return u.TxBytes |
| } |
| |
| func (u *PortGetCountersResponse) HasTxBytes() bool { |
| return u.TxBytesPresent |
| } |
| |
| func (u *PortGetCountersResponse) ClearTxBytes() { |
| u.TxBytesPresent = false |
| } |
| |
| func (u *PortGetCountersResponse) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *PortGetCountersResponse) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |
| |
| // Logical port information. |
| type PortInfo struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| // Port's identifier. Required. |
| Id PortId `fidl_ordinal:"1"` |
| IdPresent bool |
| BaseInfo PortBaseInfo `fidl_ordinal:"2"` |
| BaseInfoPresent bool |
| } |
| |
| var _mPortInfo = _bindings.CreateLazyMarshaler(PortInfo{}) |
| |
| func (msg *PortInfo) Marshaler() _bindings.Marshaler { |
| return _mPortInfo |
| } |
| |
| func (u *PortInfo) SetId(id PortId) { |
| u.Id = id |
| u.IdPresent = true |
| } |
| |
| func (u *PortInfo) GetId() PortId { |
| return u.Id |
| } |
| |
| func (u *PortInfo) GetIdWithDefault(_default PortId) PortId { |
| if !u.HasId() { |
| return _default |
| } |
| return u.Id |
| } |
| |
| func (u *PortInfo) HasId() bool { |
| return u.IdPresent |
| } |
| |
| func (u *PortInfo) ClearId() { |
| u.IdPresent = false |
| } |
| |
| func (u *PortInfo) SetBaseInfo(baseInfo PortBaseInfo) { |
| u.BaseInfo = baseInfo |
| u.BaseInfoPresent = true |
| } |
| |
| func (u *PortInfo) GetBaseInfo() PortBaseInfo { |
| return u.BaseInfo |
| } |
| |
| func (u *PortInfo) GetBaseInfoWithDefault(_default PortBaseInfo) PortBaseInfo { |
| if !u.HasBaseInfo() { |
| return _default |
| } |
| return u.BaseInfo |
| } |
| |
| func (u *PortInfo) HasBaseInfo() bool { |
| return u.BaseInfoPresent |
| } |
| |
| func (u *PortInfo) ClearBaseInfo() { |
| u.BaseInfoPresent = false |
| } |
| |
| func (u *PortInfo) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *PortInfo) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |
| |
| // Dynamic port information. |
| type PortStatus struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| I_unknownData interface{} |
| // Port status flags. |
| Flags StatusFlags `fidl_ordinal:"1"` |
| FlagsPresent bool |
| // Maximum transmit unit for this port, in bytes. |
| // |
| // The reported MTU is the size of an entire frame, including any header |
| // and trailer bytes for whatever protocols this port supports. |
| Mtu uint32 `fidl_ordinal:"2"` |
| MtuPresent bool |
| } |
| |
| var _mPortStatus = _bindings.CreateLazyMarshaler(PortStatus{}) |
| |
| func (msg *PortStatus) Marshaler() _bindings.Marshaler { |
| return _mPortStatus |
| } |
| |
| func (u *PortStatus) SetFlags(flags StatusFlags) { |
| u.Flags = flags |
| u.FlagsPresent = true |
| } |
| |
| func (u *PortStatus) GetFlags() StatusFlags { |
| return u.Flags |
| } |
| |
| func (u *PortStatus) GetFlagsWithDefault(_default StatusFlags) StatusFlags { |
| if !u.HasFlags() { |
| return _default |
| } |
| return u.Flags |
| } |
| |
| func (u *PortStatus) HasFlags() bool { |
| return u.FlagsPresent |
| } |
| |
| func (u *PortStatus) ClearFlags() { |
| u.FlagsPresent = false |
| } |
| |
| func (u *PortStatus) SetMtu(mtu uint32) { |
| u.Mtu = mtu |
| u.MtuPresent = true |
| } |
| |
| func (u *PortStatus) GetMtu() uint32 { |
| return u.Mtu |
| } |
| |
| func (u *PortStatus) GetMtuWithDefault(_default uint32) uint32 { |
| if !u.HasMtu() { |
| return _default |
| } |
| return u.Mtu |
| } |
| |
| func (u *PortStatus) HasMtu() bool { |
| return u.MtuPresent |
| } |
| |
| func (u *PortStatus) ClearMtu() { |
| u.MtuPresent = false |
| } |
| |
| func (u *PortStatus) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *PortStatus) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |
| |
| // Session configuration. |
| type SessionInfo struct { |
| _ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"` |
| I_unknownData interface{} |
| // VMO containing the descriptors. Required. |
| // |
| // 16-bit indices transmitted over the FIFOs index a descriptor in this VMO |
| // (byte offset = descriptor_length * 8 * index). |
| Descriptors _zx.VMO `fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:"0" fidl_ordinal:"1"` |
| DescriptorsPresent bool |
| // VMO containing frame data. Required. |
| // |
| // Descriptors contain byte-offsets that are used to index arbitrary |
| // regions in `data`. |
| Data _zx.VMO `fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:"0" fidl_ordinal:"2"` |
| DataPresent bool |
| // Requested descriptor version. Required. |
| // |
| // If the network device does not support the requested descriptor version, |
| // [`Device.OpenSession`] fails with `ZX_ERR_NOT_SUPPORTED`. |
| DescriptorVersion uint8 `fidl_ordinal:"3"` |
| DescriptorVersionPresent bool |
| // Descriptor length, in 64-bit words. Required. |
| // |
| // The length of each descriptor in the `descriptors` VMO. This is used as |
| // a multiplier to find byte offsets in `descriptors` given a descriptor |
| // index passed through the rx or tx FIFOs. |
| DescriptorLength uint8 `fidl_ordinal:"4"` |
| DescriptorLengthPresent bool |
| // Total number of descriptors that can be used by this session. Required. |
| // |
| // Descriptor indices transferred through either the rx or tx FIFO must be |
| // in the range [0, `descriptor_count`). |
| DescriptorCount uint16 `fidl_ordinal:"5"` |
| DescriptorCountPresent bool |
| // Extra options. Interpreted as empty bitmask if absent. |
| Options SessionFlags `fidl_ordinal:"6"` |
| OptionsPresent bool |
| } |
| |
| var _mSessionInfo = _bindings.CreateLazyMarshaler(SessionInfo{}) |
| |
| func (msg *SessionInfo) Marshaler() _bindings.Marshaler { |
| return _mSessionInfo |
| } |
| |
| func (u *SessionInfo) SetDescriptors(descriptors _zx.VMO) { |
| u.Descriptors = descriptors |
| u.DescriptorsPresent = true |
| } |
| |
| func (u *SessionInfo) GetDescriptors() _zx.VMO { |
| return u.Descriptors |
| } |
| |
| func (u *SessionInfo) GetDescriptorsWithDefault(_default _zx.VMO) _zx.VMO { |
| if !u.HasDescriptors() { |
| return _default |
| } |
| return u.Descriptors |
| } |
| |
| func (u *SessionInfo) HasDescriptors() bool { |
| return u.DescriptorsPresent |
| } |
| |
| func (u *SessionInfo) ClearDescriptors() { |
| u.DescriptorsPresent = false |
| } |
| |
| func (u *SessionInfo) SetData(data _zx.VMO) { |
| u.Data = data |
| u.DataPresent = true |
| } |
| |
| func (u *SessionInfo) GetData() _zx.VMO { |
| return u.Data |
| } |
| |
| func (u *SessionInfo) GetDataWithDefault(_default _zx.VMO) _zx.VMO { |
| if !u.HasData() { |
| return _default |
| } |
| return u.Data |
| } |
| |
| func (u *SessionInfo) HasData() bool { |
| return u.DataPresent |
| } |
| |
| func (u *SessionInfo) ClearData() { |
| u.DataPresent = false |
| } |
| |
| func (u *SessionInfo) SetDescriptorVersion(descriptorVersion uint8) { |
| u.DescriptorVersion = descriptorVersion |
| u.DescriptorVersionPresent = true |
| } |
| |
| func (u *SessionInfo) GetDescriptorVersion() uint8 { |
| return u.DescriptorVersion |
| } |
| |
| func (u *SessionInfo) GetDescriptorVersionWithDefault(_default uint8) uint8 { |
| if !u.HasDescriptorVersion() { |
| return _default |
| } |
| return u.DescriptorVersion |
| } |
| |
| func (u *SessionInfo) HasDescriptorVersion() bool { |
| return u.DescriptorVersionPresent |
| } |
| |
| func (u *SessionInfo) ClearDescriptorVersion() { |
| u.DescriptorVersionPresent = false |
| } |
| |
| func (u *SessionInfo) SetDescriptorLength(descriptorLength uint8) { |
| u.DescriptorLength = descriptorLength |
| u.DescriptorLengthPresent = true |
| } |
| |
| func (u *SessionInfo) GetDescriptorLength() uint8 { |
| return u.DescriptorLength |
| } |
| |
| func (u *SessionInfo) GetDescriptorLengthWithDefault(_default uint8) uint8 { |
| if !u.HasDescriptorLength() { |
| return _default |
| } |
| return u.DescriptorLength |
| } |
| |
| func (u *SessionInfo) HasDescriptorLength() bool { |
| return u.DescriptorLengthPresent |
| } |
| |
| func (u *SessionInfo) ClearDescriptorLength() { |
| u.DescriptorLengthPresent = false |
| } |
| |
| func (u *SessionInfo) SetDescriptorCount(descriptorCount uint16) { |
| u.DescriptorCount = descriptorCount |
| u.DescriptorCountPresent = true |
| } |
| |
| func (u *SessionInfo) GetDescriptorCount() uint16 { |
| return u.DescriptorCount |
| } |
| |
| func (u *SessionInfo) GetDescriptorCountWithDefault(_default uint16) uint16 { |
| if !u.HasDescriptorCount() { |
| return _default |
| } |
| return u.DescriptorCount |
| } |
| |
| func (u *SessionInfo) HasDescriptorCount() bool { |
| return u.DescriptorCountPresent |
| } |
| |
| func (u *SessionInfo) ClearDescriptorCount() { |
| u.DescriptorCountPresent = false |
| } |
| |
| func (u *SessionInfo) SetOptions(options SessionFlags) { |
| u.Options = options |
| u.OptionsPresent = true |
| } |
| |
| func (u *SessionInfo) GetOptions() SessionFlags { |
| return u.Options |
| } |
| |
| func (u *SessionInfo) GetOptionsWithDefault(_default SessionFlags) SessionFlags { |
| if !u.HasOptions() { |
| return _default |
| } |
| return u.Options |
| } |
| |
| func (u *SessionInfo) HasOptions() bool { |
| return u.OptionsPresent |
| } |
| |
| func (u *SessionInfo) ClearOptions() { |
| u.OptionsPresent = false |
| } |
| |
| func (u *SessionInfo) HasUnknownData() bool { |
| return u.I_unknownData != nil |
| } |
| |
| func (u *SessionInfo) GetUnknownData() map[uint64]_bindings.UnknownData { |
| return u.I_unknownData.(map[uint64]_bindings.UnknownData) |
| } |
| |
| const ( |
| DeviceGetInfoOrdinal uint64 = 0x3c500ca9341e8f56 |
| DeviceOpenSessionOrdinal uint64 = 0x25940b82146dcf67 |
| DeviceGetPortOrdinal uint64 = 0x340a852c955ba2a6 |
| DeviceGetPortWatcherOrdinal uint64 = 0x104f43c937c39f0c |
| DeviceCloneOrdinal uint64 = 0x5882ea09b3809af4 |
| ) |
| |
| type DeviceWithCtxInterface _bindings.ChannelProxy |
| |
| // Obtain information about device |
| // |
| // - response `info` device information. |
| func (p *DeviceWithCtxInterface) GetInfo(ctx_ _bindings.Context) (DeviceInfo, error) { |
| var req_ _bindings.Message |
| resp_ := &DeviceGetInfoResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(DeviceGetInfoOrdinal, req_, resp_) |
| return (*resp_).Info, err_ |
| } |
| |
| // Opens a new session with the network device. |
| // |
| // + request `session_name` is used as a debugging label attached to this |
| // session. |
| // + request `session_info` contains the necessary information to setup the |
| // session's data exchange. |
| // - response `session` a handle to control the session. |
| // - response `fifos` data-plane FIFOs attached to the session. |
| // * error `ZX_ERR_NOT_SUPPORTED` if `session_info` contains not supported |
| // frame types or descriptors set up. |
| // * error `ZX_ERR_INVALID_ARGS` if `session_info` is missing fields or |
| // contains invalid information. |
| // * error `ZX_ERR_INTERNAL` if the data VMO is rejected by the underlying |
| // device. |
| func (p *DeviceWithCtxInterface) OpenSession(ctx_ _bindings.Context, sessionName string, sessionInfo SessionInfo) (DeviceOpenSessionResult, error) { |
| req_ := &DeviceOpenSessionRequest{SessionName: sessionName, SessionInfo: sessionInfo} |
| resp_ := &DeviceOpenSessionResult{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(DeviceOpenSessionOrdinal, req_, resp_) |
| return (*resp_), err_ |
| } |
| |
| // Connects to a port the given `id`. |
| // |
| // + request `id` port to connect to. |
| // + request `port` server end of port channel. |
| // |
| // `port` is closed with a `ZX_ERR_NOT_FOUND` epitaph if no port with `id` |
| // exists. |
| func (p *DeviceWithCtxInterface) GetPort(ctx_ _bindings.Context, id PortId, port PortWithCtxInterfaceRequest) error { |
| req_ := &DeviceGetPortRequest{Id: id, Port: port} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(DeviceGetPortOrdinal, req_) |
| return err_ |
| } |
| |
| // Connects a [`PortWatcher`] to this device. |
| // |
| // + request `watcher` server end of watcher channel. |
| func (p *DeviceWithCtxInterface) GetPortWatcher(ctx_ _bindings.Context, watcher PortWatcherWithCtxInterfaceRequest) error { |
| req_ := &DeviceGetPortWatcherRequest{Watcher: watcher} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(DeviceGetPortWatcherOrdinal, req_) |
| return err_ |
| } |
| |
| // Establishes a new connection to this device. |
| // |
| // + request `device` the server end for the new connection. |
| func (p *DeviceWithCtxInterface) Clone(ctx_ _bindings.Context, device DeviceWithCtxInterfaceRequest) error { |
| req_ := &DeviceCloneRequest{Device: device} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(DeviceCloneOrdinal, req_) |
| return err_ |
| } |
| |
| // A Network Device. |
| type DeviceWithCtx interface { |
| // Obtain information about device |
| // |
| // - response `info` device information. |
| GetInfo(ctx_ _bindings.Context) (DeviceInfo, error) |
| // Opens a new session with the network device. |
| // |
| // + request `session_name` is used as a debugging label attached to this |
| // session. |
| // + request `session_info` contains the necessary information to setup the |
| // session's data exchange. |
| // - response `session` a handle to control the session. |
| // - response `fifos` data-plane FIFOs attached to the session. |
| // * error `ZX_ERR_NOT_SUPPORTED` if `session_info` contains not supported |
| // frame types or descriptors set up. |
| // * error `ZX_ERR_INVALID_ARGS` if `session_info` is missing fields or |
| // contains invalid information. |
| // * error `ZX_ERR_INTERNAL` if the data VMO is rejected by the underlying |
| // device. |
| OpenSession(ctx_ _bindings.Context, sessionName string, sessionInfo SessionInfo) (DeviceOpenSessionResult, error) |
| // Connects to a port the given `id`. |
| // |
| // + request `id` port to connect to. |
| // + request `port` server end of port channel. |
| // |
| // `port` is closed with a `ZX_ERR_NOT_FOUND` epitaph if no port with `id` |
| // exists. |
| GetPort(ctx_ _bindings.Context, id PortId, port PortWithCtxInterfaceRequest) error |
| // Connects a [`PortWatcher`] to this device. |
| // |
| // + request `watcher` server end of watcher channel. |
| GetPortWatcher(ctx_ _bindings.Context, watcher PortWatcherWithCtxInterfaceRequest) error |
| // Establishes a new connection to this device. |
| // |
| // + request `device` the server end for the new connection. |
| Clone(ctx_ _bindings.Context, device DeviceWithCtxInterfaceRequest) error |
| } |
| |
| type DeviceWithCtxTransitionalBase struct{} |
| |
| type DeviceWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewDeviceWithCtxInterfaceRequest() (DeviceWithCtxInterfaceRequest, *DeviceWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return DeviceWithCtxInterfaceRequest(req), (*DeviceWithCtxInterface)(cli), err |
| } |
| |
| type DeviceWithCtxStub struct { |
| Impl DeviceWithCtx |
| } |
| |
| func (s_ *DeviceWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case DeviceGetInfoOrdinal: |
| info, err_ := s_.Impl.GetInfo(args_.Ctx) |
| out_ := &DeviceGetInfoResponse{Info: info} |
| return out_, true, err_ |
| case DeviceOpenSessionOrdinal: |
| in_ := &DeviceOpenSessionRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| payload, err_ := s_.Impl.OpenSession(args_.Ctx, (*in_).SessionName, (*in_).SessionInfo) |
| out_ := &payload |
| return out_, true, err_ |
| case DeviceGetPortOrdinal: |
| in_ := &DeviceGetPortRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| err_ := s_.Impl.GetPort(args_.Ctx, (*in_).Id, (*in_).Port) |
| return nil, false, err_ |
| case DeviceGetPortWatcherOrdinal: |
| in_ := &DeviceGetPortWatcherRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| err_ := s_.Impl.GetPortWatcher(args_.Ctx, (*in_).Watcher) |
| return nil, false, err_ |
| case DeviceCloneOrdinal: |
| in_ := &DeviceCloneRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| err_ := s_.Impl.Clone(args_.Ctx, (*in_).Device) |
| return nil, false, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type DeviceEventProxy _bindings.ChannelProxy |
| |
| const ( |
| DeviceInstanceGetDeviceOrdinal uint64 = 0x775270585575cef7 |
| ) |
| |
| type DeviceInstanceWithCtxInterface _bindings.ChannelProxy |
| |
| // Connects to the [`Device`] implementation. |
| // |
| // + request `device` device handle. |
| func (p *DeviceInstanceWithCtxInterface) GetDevice(ctx_ _bindings.Context, device DeviceWithCtxInterfaceRequest) error { |
| req_ := &DeviceInstanceGetDeviceRequest{Device: device} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(DeviceInstanceGetDeviceOrdinal, req_) |
| return err_ |
| } |
| |
| // An instance of a network device exposed on devfs. |
| type DeviceInstanceWithCtx interface { |
| // Connects to the [`Device`] implementation. |
| // |
| // + request `device` device handle. |
| GetDevice(ctx_ _bindings.Context, device DeviceWithCtxInterfaceRequest) error |
| } |
| |
| type DeviceInstanceWithCtxTransitionalBase struct{} |
| |
| type DeviceInstanceWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewDeviceInstanceWithCtxInterfaceRequest() (DeviceInstanceWithCtxInterfaceRequest, *DeviceInstanceWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return DeviceInstanceWithCtxInterfaceRequest(req), (*DeviceInstanceWithCtxInterface)(cli), err |
| } |
| |
| type DeviceInstanceWithCtxStub struct { |
| Impl DeviceInstanceWithCtx |
| } |
| |
| func (s_ *DeviceInstanceWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case DeviceInstanceGetDeviceOrdinal: |
| in_ := &DeviceInstanceGetDeviceRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| err_ := s_.Impl.GetDevice(args_.Ctx, (*in_).Device) |
| return nil, false, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type DeviceInstanceEventProxy _bindings.ChannelProxy |
| |
| const ( |
| DiagnosticsLogDebugInfoToSyslogOrdinal uint64 = 0x4222897dfe1f4b4a |
| ) |
| |
| type DiagnosticsWithCtxInterface _bindings.ChannelProxy |
| |
| // Requests that the device produces debugging information in the system |
| // logs. |
| // |
| // The call returns once device debug information has been produced. |
| func (p *DiagnosticsWithCtxInterface) LogDebugInfoToSyslog(ctx_ _bindings.Context) error { |
| var req_ _bindings.Message |
| var resp_ _bindings.Message |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(DiagnosticsLogDebugInfoToSyslogOrdinal, req_, resp_) |
| return err_ |
| } |
| |
| // Provides two way communications between device and upper layers to exchange |
| // device health information. |
| type DiagnosticsWithCtx interface { |
| // Requests that the device produces debugging information in the system |
| // logs. |
| // |
| // The call returns once device debug information has been produced. |
| LogDebugInfoToSyslog(ctx_ _bindings.Context) error |
| } |
| |
| type DiagnosticsWithCtxTransitionalBase struct{} |
| |
| type DiagnosticsWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewDiagnosticsWithCtxInterfaceRequest() (DiagnosticsWithCtxInterfaceRequest, *DiagnosticsWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return DiagnosticsWithCtxInterfaceRequest(req), (*DiagnosticsWithCtxInterface)(cli), err |
| } |
| |
| type DiagnosticsWithCtxStub struct { |
| Impl DiagnosticsWithCtx |
| } |
| |
| func (s_ *DiagnosticsWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case DiagnosticsLogDebugInfoToSyslogOrdinal: |
| err_ := s_.Impl.LogDebugInfoToSyslog(args_.Ctx) |
| return nil, true, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type DiagnosticsEventProxy _bindings.ChannelProxy |
| |
| const ( |
| MacAddressingGetUnicastAddressOrdinal uint64 = 0x2c60b82a4ecfaebe |
| MacAddressingSetModeOrdinal uint64 = 0x6297b8dbf03c58c |
| MacAddressingAddMulticastAddressOrdinal uint64 = 0xf5637ff11cf0c25 |
| MacAddressingRemoveMulticastAddressOrdinal uint64 = 0x5dddf4e3ba4e2560 |
| ) |
| |
| type MacAddressingWithCtxInterface _bindings.ChannelProxy |
| |
| // Gets the Device's current unicast MAC address. |
| // |
| // Implementers of this API do not need to return a uniquely identifiable |
| // MAC; the unicast address returned is the one that is *currently* in use |
| // to filter unicast frames, or that identifies the device on a link it's |
| // *currently* on. Users of this API must not rely on the stability or |
| // uniqueness of the returned value to identify or disambiguate device |
| // instances. |
| // |
| // - response `address` device's unicast MAC address. |
| func (p *MacAddressingWithCtxInterface) GetUnicastAddress(ctx_ _bindings.Context) (fuchsianet.MacAddress, error) { |
| var req_ _bindings.Message |
| resp_ := &MacAddressingGetUnicastAddressResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MacAddressingGetUnicastAddressOrdinal, req_, resp_) |
| return (*resp_).Address, err_ |
| } |
| |
| // Sets requested operating mode of this device to `mode`. |
| // |
| // The requested mode is attached to the current client connection to the |
| // device. Because multiple clients can be attached to the same device at |
| // once, the mode with the least restrictions is the one actively put into |
| // effect into the underlying device implementation. |
| // |
| // If the device does not support the requested mode, but supports a mode |
| // that is more open than the requested one, `SetMode` succeeds regardless. |
| // Otherwise, if the device only supports *more restrictive* modes than the |
| // one requested, `SetMode` returns `ZX_ERR_NOT_SUPPORTED`. |
| // |
| // Clients must be aware that the resource being accessed is shared, and |
| // that the device may be effectively operating at a more open level than |
| // the one that was requested (although never at one more restrictive). |
| // |
| // + request `mode` request mode to attach to. |
| // - response `status` `ZX_ERR_NOT_SUPPORTED` it the device only supports |
| // mode more restrictive than the one requested. |
| func (p *MacAddressingWithCtxInterface) SetMode(ctx_ _bindings.Context, mode MacFilterMode) (int32, error) { |
| req_ := &MacAddressingSetModeRequest{Mode: mode} |
| resp_ := &MacAddressingSetModeResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MacAddressingSetModeOrdinal, req_, resp_) |
| return (*resp_).Status, err_ |
| } |
| |
| // Adds multicast address to the list of multicast groups. |
| // |
| // The list of multicast addresses kept is untouched by calls to `SetMode`. |
| // If the device's mode is not `MULTICAST_FILTER`, the list of multicast |
| // addresses is ignored. |
| // |
| // + request `address` multicast address to add to the list. |
| // - response `status` `ZX_ERR_INVALID_ARGS` if `address` is not a |
| // multicast address. |
| func (p *MacAddressingWithCtxInterface) AddMulticastAddress(ctx_ _bindings.Context, address fuchsianet.MacAddress) (int32, error) { |
| req_ := &MacAddressingAddMulticastAddressRequest{Address: address} |
| resp_ := &MacAddressingAddMulticastAddressResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MacAddressingAddMulticastAddressOrdinal, req_, resp_) |
| return (*resp_).Status, err_ |
| } |
| |
| // Removes multicast address from the list of multicast groups. |
| // |
| // + request `address` multicast address to remove from the list. |
| // - response `status` `ZX_ERR_INVALID_ARGS` if `address` is not a |
| // multicast address. |
| func (p *MacAddressingWithCtxInterface) RemoveMulticastAddress(ctx_ _bindings.Context, address fuchsianet.MacAddress) (int32, error) { |
| req_ := &MacAddressingRemoveMulticastAddressRequest{Address: address} |
| resp_ := &MacAddressingRemoveMulticastAddressResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(MacAddressingRemoveMulticastAddressOrdinal, req_, resp_) |
| return (*resp_).Status, err_ |
| } |
| |
| type MacAddressingWithCtx interface { |
| // Gets the Device's current unicast MAC address. |
| // |
| // Implementers of this API do not need to return a uniquely identifiable |
| // MAC; the unicast address returned is the one that is *currently* in use |
| // to filter unicast frames, or that identifies the device on a link it's |
| // *currently* on. Users of this API must not rely on the stability or |
| // uniqueness of the returned value to identify or disambiguate device |
| // instances. |
| // |
| // - response `address` device's unicast MAC address. |
| GetUnicastAddress(ctx_ _bindings.Context) (fuchsianet.MacAddress, error) |
| // Sets requested operating mode of this device to `mode`. |
| // |
| // The requested mode is attached to the current client connection to the |
| // device. Because multiple clients can be attached to the same device at |
| // once, the mode with the least restrictions is the one actively put into |
| // effect into the underlying device implementation. |
| // |
| // If the device does not support the requested mode, but supports a mode |
| // that is more open than the requested one, `SetMode` succeeds regardless. |
| // Otherwise, if the device only supports *more restrictive* modes than the |
| // one requested, `SetMode` returns `ZX_ERR_NOT_SUPPORTED`. |
| // |
| // Clients must be aware that the resource being accessed is shared, and |
| // that the device may be effectively operating at a more open level than |
| // the one that was requested (although never at one more restrictive). |
| // |
| // + request `mode` request mode to attach to. |
| // - response `status` `ZX_ERR_NOT_SUPPORTED` it the device only supports |
| // mode more restrictive than the one requested. |
| SetMode(ctx_ _bindings.Context, mode MacFilterMode) (int32, error) |
| // Adds multicast address to the list of multicast groups. |
| // |
| // The list of multicast addresses kept is untouched by calls to `SetMode`. |
| // If the device's mode is not `MULTICAST_FILTER`, the list of multicast |
| // addresses is ignored. |
| // |
| // + request `address` multicast address to add to the list. |
| // - response `status` `ZX_ERR_INVALID_ARGS` if `address` is not a |
| // multicast address. |
| AddMulticastAddress(ctx_ _bindings.Context, address fuchsianet.MacAddress) (int32, error) |
| // Removes multicast address from the list of multicast groups. |
| // |
| // + request `address` multicast address to remove from the list. |
| // - response `status` `ZX_ERR_INVALID_ARGS` if `address` is not a |
| // multicast address. |
| RemoveMulticastAddress(ctx_ _bindings.Context, address fuchsianet.MacAddress) (int32, error) |
| } |
| |
| type MacAddressingWithCtxTransitionalBase struct{} |
| |
| type MacAddressingWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewMacAddressingWithCtxInterfaceRequest() (MacAddressingWithCtxInterfaceRequest, *MacAddressingWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return MacAddressingWithCtxInterfaceRequest(req), (*MacAddressingWithCtxInterface)(cli), err |
| } |
| |
| type MacAddressingWithCtxStub struct { |
| Impl MacAddressingWithCtx |
| } |
| |
| func (s_ *MacAddressingWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case MacAddressingGetUnicastAddressOrdinal: |
| address, err_ := s_.Impl.GetUnicastAddress(args_.Ctx) |
| out_ := &MacAddressingGetUnicastAddressResponse{Address: address} |
| return out_, true, err_ |
| case MacAddressingSetModeOrdinal: |
| in_ := &MacAddressingSetModeRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| status, err_ := s_.Impl.SetMode(args_.Ctx, (*in_).Mode) |
| out_ := &MacAddressingSetModeResponse{Status: status} |
| return out_, true, err_ |
| case MacAddressingAddMulticastAddressOrdinal: |
| in_ := &MacAddressingAddMulticastAddressRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| status, err_ := s_.Impl.AddMulticastAddress(args_.Ctx, (*in_).Address) |
| out_ := &MacAddressingAddMulticastAddressResponse{Status: status} |
| return out_, true, err_ |
| case MacAddressingRemoveMulticastAddressOrdinal: |
| in_ := &MacAddressingRemoveMulticastAddressRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| status, err_ := s_.Impl.RemoveMulticastAddress(args_.Ctx, (*in_).Address) |
| out_ := &MacAddressingRemoveMulticastAddressResponse{Status: status} |
| return out_, true, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type MacAddressingEventProxy _bindings.ChannelProxy |
| |
| const ( |
| PortGetInfoOrdinal uint64 = 0x276cf65feb554ebd |
| PortGetStatusOrdinal uint64 = 0x4235650aacca60b2 |
| PortGetStatusWatcherOrdinal uint64 = 0x65511ab81c1bd8d4 |
| PortGetMacOrdinal uint64 = 0x2c6ec2988aefc0f6 |
| PortGetDeviceOrdinal uint64 = 0x7de34747235d2d80 |
| PortCloneOrdinal uint64 = 0x4e4764150b4942d3 |
| PortGetCountersOrdinal uint64 = 0x6a213b03c4fcbbac |
| PortGetDiagnosticsOrdinal uint64 = 0x381faa4ed75e399c |
| ) |
| |
| type PortWithCtxInterface _bindings.ChannelProxy |
| |
| // Obtain information about port. |
| // |
| // - response `info` port information. |
| func (p *PortWithCtxInterface) GetInfo(ctx_ _bindings.Context) (PortInfo, error) { |
| var req_ _bindings.Message |
| resp_ := &PortGetInfoResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(PortGetInfoOrdinal, req_, resp_) |
| return (*resp_).Info, err_ |
| } |
| |
| // Obtain the operating port status. |
| // |
| // - response `status` snapshot of port's current status. |
| func (p *PortWithCtxInterface) GetStatus(ctx_ _bindings.Context) (PortStatus, error) { |
| var req_ _bindings.Message |
| resp_ := &PortGetStatusResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(PortGetStatusOrdinal, req_, resp_) |
| return (*resp_).Status, err_ |
| } |
| |
| // Connects to a [`StatusWatcher`] to observe port status changes. |
| // |
| // + request `watcher` handle to the status watcher. |
| // + request `buffer` the number of status changes that the client requests |
| // to be stored by `StatusWatcher`. Values are capped at |
| // [`MAX_STATUS_BUFFER`]. A value of 0 or 1 causes the `StatusWatcher` to |
| // not keep any buffers on status changed. Clients that need to observe all |
| // changes to status (as opposed to only the current state) are encouraged |
| // to set a buffer value larger than 1, so that all edges can be observed. |
| // If `StatusWatcher`'s internal queue is filled and new status changes |
| // occur, the oldest samples will be dropped to make room for new ones. |
| func (p *PortWithCtxInterface) GetStatusWatcher(ctx_ _bindings.Context, watcher StatusWatcherWithCtxInterfaceRequest, buffer uint32) error { |
| req_ := &PortGetStatusWatcherRequest{Watcher: watcher, Buffer: buffer} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(PortGetStatusWatcherOrdinal, req_) |
| return err_ |
| } |
| |
| // Connects to a [`MacAddressing`] associated with the port. |
| // |
| // + request `mac` mac handle. Closed with `ZX_ERR_NOT_SUPPORTED` if this |
| // port does not support mac addressing. |
| func (p *PortWithCtxInterface) GetMac(ctx_ _bindings.Context, mac MacAddressingWithCtxInterfaceRequest) error { |
| req_ := &PortGetMacRequest{Mac: mac} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(PortGetMacOrdinal, req_) |
| return err_ |
| } |
| |
| // Connects to the [`Device`] this port belongs to. |
| // |
| // + request `device` grants access to the parent device. |
| func (p *PortWithCtxInterface) GetDevice(ctx_ _bindings.Context, device DeviceWithCtxInterfaceRequest) error { |
| req_ := &PortGetDeviceRequest{Device: device} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(PortGetDeviceOrdinal, req_) |
| return err_ |
| } |
| |
| // Establishes a new connection to this port. |
| // |
| // + request `port` the server end for the new connection. |
| func (p *PortWithCtxInterface) Clone(ctx_ _bindings.Context, port PortWithCtxInterfaceRequest) error { |
| req_ := &PortCloneRequest{Port: port} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(PortCloneOrdinal, req_) |
| return err_ |
| } |
| |
| // Retrieves a snapshot of traffic counters on this port. |
| func (p *PortWithCtxInterface) GetCounters(ctx_ _bindings.Context) (PortGetCountersResponse, error) { |
| var req_ _bindings.Message |
| resp_ := &PortGetCountersResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(PortGetCountersOrdinal, req_, resp_) |
| return (*resp_), err_ |
| } |
| |
| // Grants access to [`Diagnostics`] for this port. |
| // |
| // + request `diagnostics` grants access to diagnostics information. |
| func (p *PortWithCtxInterface) GetDiagnostics(ctx_ _bindings.Context, diagnostics DiagnosticsWithCtxInterfaceRequest) error { |
| req_ := &PortGetDiagnosticsRequest{Diagnostics: diagnostics} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(PortGetDiagnosticsOrdinal, req_) |
| return err_ |
| } |
| |
| // A logical port belonging to a [`Device`]. |
| type PortWithCtx interface { |
| // Obtain information about port. |
| // |
| // - response `info` port information. |
| GetInfo(ctx_ _bindings.Context) (PortInfo, error) |
| // Obtain the operating port status. |
| // |
| // - response `status` snapshot of port's current status. |
| GetStatus(ctx_ _bindings.Context) (PortStatus, error) |
| // Connects to a [`StatusWatcher`] to observe port status changes. |
| // |
| // + request `watcher` handle to the status watcher. |
| // + request `buffer` the number of status changes that the client requests |
| // to be stored by `StatusWatcher`. Values are capped at |
| // [`MAX_STATUS_BUFFER`]. A value of 0 or 1 causes the `StatusWatcher` to |
| // not keep any buffers on status changed. Clients that need to observe all |
| // changes to status (as opposed to only the current state) are encouraged |
| // to set a buffer value larger than 1, so that all edges can be observed. |
| // If `StatusWatcher`'s internal queue is filled and new status changes |
| // occur, the oldest samples will be dropped to make room for new ones. |
| GetStatusWatcher(ctx_ _bindings.Context, watcher StatusWatcherWithCtxInterfaceRequest, buffer uint32) error |
| // Connects to a [`MacAddressing`] associated with the port. |
| // |
| // + request `mac` mac handle. Closed with `ZX_ERR_NOT_SUPPORTED` if this |
| // port does not support mac addressing. |
| GetMac(ctx_ _bindings.Context, mac MacAddressingWithCtxInterfaceRequest) error |
| // Connects to the [`Device`] this port belongs to. |
| // |
| // + request `device` grants access to the parent device. |
| GetDevice(ctx_ _bindings.Context, device DeviceWithCtxInterfaceRequest) error |
| // Establishes a new connection to this port. |
| // |
| // + request `port` the server end for the new connection. |
| Clone(ctx_ _bindings.Context, port PortWithCtxInterfaceRequest) error |
| // Retrieves a snapshot of traffic counters on this port. |
| GetCounters(ctx_ _bindings.Context) (PortGetCountersResponse, error) |
| // Grants access to [`Diagnostics`] for this port. |
| // |
| // + request `diagnostics` grants access to diagnostics information. |
| GetDiagnostics(ctx_ _bindings.Context, diagnostics DiagnosticsWithCtxInterfaceRequest) error |
| } |
| |
| type PortWithCtxTransitionalBase struct{} |
| |
| type PortWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewPortWithCtxInterfaceRequest() (PortWithCtxInterfaceRequest, *PortWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return PortWithCtxInterfaceRequest(req), (*PortWithCtxInterface)(cli), err |
| } |
| |
| type PortWithCtxStub struct { |
| Impl PortWithCtx |
| } |
| |
| func (s_ *PortWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case PortGetInfoOrdinal: |
| info, err_ := s_.Impl.GetInfo(args_.Ctx) |
| out_ := &PortGetInfoResponse{Info: info} |
| return out_, true, err_ |
| case PortGetStatusOrdinal: |
| status, err_ := s_.Impl.GetStatus(args_.Ctx) |
| out_ := &PortGetStatusResponse{Status: status} |
| return out_, true, err_ |
| case PortGetStatusWatcherOrdinal: |
| in_ := &PortGetStatusWatcherRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| err_ := s_.Impl.GetStatusWatcher(args_.Ctx, (*in_).Watcher, (*in_).Buffer) |
| return nil, false, err_ |
| case PortGetMacOrdinal: |
| in_ := &PortGetMacRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| err_ := s_.Impl.GetMac(args_.Ctx, (*in_).Mac) |
| return nil, false, err_ |
| case PortGetDeviceOrdinal: |
| in_ := &PortGetDeviceRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| err_ := s_.Impl.GetDevice(args_.Ctx, (*in_).Device) |
| return nil, false, err_ |
| case PortCloneOrdinal: |
| in_ := &PortCloneRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| err_ := s_.Impl.Clone(args_.Ctx, (*in_).Port) |
| return nil, false, err_ |
| case PortGetCountersOrdinal: |
| payload, err_ := s_.Impl.GetCounters(args_.Ctx) |
| out_ := &payload |
| return out_, true, err_ |
| case PortGetDiagnosticsOrdinal: |
| in_ := &PortGetDiagnosticsRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| err_ := s_.Impl.GetDiagnostics(args_.Ctx, (*in_).Diagnostics) |
| return nil, false, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type PortEventProxy _bindings.ChannelProxy |
| |
| const ( |
| PortWatcherWatchOrdinal uint64 = 0x3e87244b74fff55e |
| ) |
| |
| type PortWatcherWithCtxInterface _bindings.ChannelProxy |
| |
| // Get the next port event. |
| // |
| // The first N calls return [`DevicePortEvent.existing`] where N is the |
| // number of ports present on the device at the time of the watcher's |
| // creation. The next call returns [`DevicePortEvent.idle`] to indicate the |
| // end of existing ports. Subsequent calls block until a port is added |
| // ([`DevicePortEvent.added`]) or removed ([`DevicePortEvent.removed`]). |
| // |
| // The server closes the `PortWatcher` channel with `ZX_ERR_CANCELED` if |
| // the number of unread events reaches a server-selected limit that is at |
| // least two times [`MAX_PORTS`]. Clients are encouraged to maintain a |
| // hanging call to `Watch` at all times to avoid triggering this condition. |
| // |
| // - response `event` next port event. |
| func (p *PortWatcherWithCtxInterface) Watch(ctx_ _bindings.Context) (DevicePortEvent, error) { |
| var req_ _bindings.Message |
| resp_ := &PortWatcherWatchResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(PortWatcherWatchOrdinal, req_, resp_) |
| return (*resp_).Event, err_ |
| } |
| |
| // Provides iteration over and updates for ports attached to a device. |
| type PortWatcherWithCtx interface { |
| // Get the next port event. |
| // |
| // The first N calls return [`DevicePortEvent.existing`] where N is the |
| // number of ports present on the device at the time of the watcher's |
| // creation. The next call returns [`DevicePortEvent.idle`] to indicate the |
| // end of existing ports. Subsequent calls block until a port is added |
| // ([`DevicePortEvent.added`]) or removed ([`DevicePortEvent.removed`]). |
| // |
| // The server closes the `PortWatcher` channel with `ZX_ERR_CANCELED` if |
| // the number of unread events reaches a server-selected limit that is at |
| // least two times [`MAX_PORTS`]. Clients are encouraged to maintain a |
| // hanging call to `Watch` at all times to avoid triggering this condition. |
| // |
| // - response `event` next port event. |
| Watch(ctx_ _bindings.Context) (DevicePortEvent, error) |
| } |
| |
| type PortWatcherWithCtxTransitionalBase struct{} |
| |
| type PortWatcherWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewPortWatcherWithCtxInterfaceRequest() (PortWatcherWithCtxInterfaceRequest, *PortWatcherWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return PortWatcherWithCtxInterfaceRequest(req), (*PortWatcherWithCtxInterface)(cli), err |
| } |
| |
| type PortWatcherWithCtxStub struct { |
| Impl PortWatcherWithCtx |
| } |
| |
| func (s_ *PortWatcherWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case PortWatcherWatchOrdinal: |
| event, err_ := s_.Impl.Watch(args_.Ctx) |
| out_ := &PortWatcherWatchResponse{Event: event} |
| return out_, true, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type PortWatcherEventProxy _bindings.ChannelProxy |
| |
| const ( |
| SessionAttachOrdinal uint64 = 0x1e89c9013e201379 |
| SessionDetachOrdinal uint64 = 0x68c40cf8fb549867 |
| SessionCloseOrdinal uint64 = 0x393d5070394a92f6 |
| ) |
| |
| type SessionWithCtxInterface _bindings.ChannelProxy |
| |
| // Attaches the session to `port`. |
| // |
| // Once attached, the session starts to receive the subscribed frames over |
| // the data FIFOs and it may send frames destined to the specified `port`. |
| // |
| // + request `port` port to subscribe to. |
| // + request `rx_frames` Frame types of interest on the port. |
| // * error `ZX_ERR_NOT_FOUND` if `port` is not valid. |
| // * error `ZX_ERR_INVALID_ARGS` if `rx_frames` is not a subset of the |
| // port's supported frames. |
| // * error `ZX_ERR_ALREADY_BOUND` if `port` is already attached. |
| func (p *SessionWithCtxInterface) Attach(ctx_ _bindings.Context, port PortId, rxFrames []FrameType) (SessionAttachResult, error) { |
| req_ := &SessionAttachRequest{Port: port, RxFrames: rxFrames} |
| resp_ := &SessionAttachResult{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(SessionAttachOrdinal, req_, resp_) |
| return (*resp_), err_ |
| } |
| |
| // Detaches the session from `port`. |
| // |
| // Once detached, the session stops receiving frames from `port`. Frames |
| // sent to a detached port may be returned with an error. It is not |
| // necessary to call `Detach` on ports that are removed from the device, |
| // doing so causes `ZX_ERR_NOT_FOUND` to be returned. |
| // |
| // + request `port` port to subscribe to. |
| // * error `ZX_ERR_NOT_FOUND` if the session is not currently attached to |
| // the port. |
| func (p *SessionWithCtxInterface) Detach(ctx_ _bindings.Context, port PortId) (SessionDetachResult, error) { |
| req_ := &SessionDetachRequest{Port: port} |
| resp_ := &SessionDetachResult{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(SessionDetachOrdinal, req_, resp_) |
| return (*resp_), err_ |
| } |
| |
| // Cleanly closes a session. |
| // |
| // This will cause the session to send a `ZX_ERR_CANCELLED` epitaph and |
| // proceed to close the Session channel. Clients may only assume that they |
| // own all the buffers that are currently owned by the session (sent over |
| // either the rx or tx FIFOs) once the epitaph is received. Closing the rx |
| // or tx FIFO is equivalent to calling `Close`. |
| func (p *SessionWithCtxInterface) Close(ctx_ _bindings.Context) error { |
| var req_ _bindings.Message |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(SessionCloseOrdinal, req_) |
| return err_ |
| } |
| |
| // Represents a session with a Network device. |
| // |
| // A session has a data plane and a control plane. The `Session` protocol |
| // represents the control plane of the session and the FIFOs and VMOs exchanged |
| // during the [`Device.OpenSession`] call are the data plane. Lifetime of the |
| // session is controlled by a `Session` protocol handle. |
| // |
| // Sessions must attach to ports of interest to start receiving and sending |
| // data. Sessions are always created with no ports attached. |
| // |
| // If a port is destroyed from the underlying device, it is automatically |
| // detached from the session. |
| // |
| // Inbound traffic is dispatched to all open sessions. Devices typically |
| // operate with a single primary session, see [`SessionFlags.PRIMARY`]. Each |
| // additional open session to the same device causes data copy overhead on the |
| // device's data path. |
| // |
| // The session is closed with an error epitaph if an invalid buffer descriptor |
| // is sent over either the tx or rx FIFOs. Invalid descriptors include: |
| // - Descriptor index larger than [`SessionInfo.descriptor_count`]. |
| // - Descriptor chains larger than [`MAX_DESCRIPTOR_CHAIN`]. |
| // - rx buffers smaller than [`Info.min_rx_buffer_length`]. |
| // - tx buffers smaller than [`Info.min_tx_buffer_length`]. |
| // - tx buffers not respecting [`Info.min_tx_buffer_head`] or |
| // [`Info.min_tx_buffer_tail`]. |
| type SessionWithCtx interface { |
| // Attaches the session to `port`. |
| // |
| // Once attached, the session starts to receive the subscribed frames over |
| // the data FIFOs and it may send frames destined to the specified `port`. |
| // |
| // + request `port` port to subscribe to. |
| // + request `rx_frames` Frame types of interest on the port. |
| // * error `ZX_ERR_NOT_FOUND` if `port` is not valid. |
| // * error `ZX_ERR_INVALID_ARGS` if `rx_frames` is not a subset of the |
| // port's supported frames. |
| // * error `ZX_ERR_ALREADY_BOUND` if `port` is already attached. |
| Attach(ctx_ _bindings.Context, port PortId, rxFrames []FrameType) (SessionAttachResult, error) |
| // Detaches the session from `port`. |
| // |
| // Once detached, the session stops receiving frames from `port`. Frames |
| // sent to a detached port may be returned with an error. It is not |
| // necessary to call `Detach` on ports that are removed from the device, |
| // doing so causes `ZX_ERR_NOT_FOUND` to be returned. |
| // |
| // + request `port` port to subscribe to. |
| // * error `ZX_ERR_NOT_FOUND` if the session is not currently attached to |
| // the port. |
| Detach(ctx_ _bindings.Context, port PortId) (SessionDetachResult, error) |
| // Cleanly closes a session. |
| // |
| // This will cause the session to send a `ZX_ERR_CANCELLED` epitaph and |
| // proceed to close the Session channel. Clients may only assume that they |
| // own all the buffers that are currently owned by the session (sent over |
| // either the rx or tx FIFOs) once the epitaph is received. Closing the rx |
| // or tx FIFO is equivalent to calling `Close`. |
| Close(ctx_ _bindings.Context) error |
| } |
| |
| type SessionWithCtxTransitionalBase struct{} |
| |
| type SessionWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewSessionWithCtxInterfaceRequest() (SessionWithCtxInterfaceRequest, *SessionWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return SessionWithCtxInterfaceRequest(req), (*SessionWithCtxInterface)(cli), err |
| } |
| |
| type SessionWithCtxStub struct { |
| Impl SessionWithCtx |
| } |
| |
| func (s_ *SessionWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case SessionAttachOrdinal: |
| in_ := &SessionAttachRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| payload, err_ := s_.Impl.Attach(args_.Ctx, (*in_).Port, (*in_).RxFrames) |
| out_ := &payload |
| return out_, true, err_ |
| case SessionDetachOrdinal: |
| in_ := &SessionDetachRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil { |
| return nil, false, err_ |
| } |
| payload, err_ := s_.Impl.Detach(args_.Ctx, (*in_).Port) |
| out_ := &payload |
| return out_, true, err_ |
| case SessionCloseOrdinal: |
| err_ := s_.Impl.Close(args_.Ctx) |
| return nil, false, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type SessionEventProxy _bindings.ChannelProxy |
| |
| const ( |
| StatusWatcherWatchStatusOrdinal uint64 = 0x1369a8125c0862b9 |
| ) |
| |
| type StatusWatcherWithCtxInterface _bindings.ChannelProxy |
| |
| // `WatchStatus` blocks until the port's status has changed. |
| // |
| // The first call to `WatchStatus` returns immediately with the current |
| // port status, subsequent calls complete when the port status differs from |
| // the last one that was returned through this `StatusWatcher`. |
| // |
| // If `StatusWatcher` was created with a buffer value larger than 1, |
| // `WatchStatus` may return a queued status change, depending on how many |
| // status changed happened since the last call to `WatchStatus`. |
| // |
| // - response `device_status` the most recent port status. |
| func (p *StatusWatcherWithCtxInterface) WatchStatus(ctx_ _bindings.Context) (PortStatus, error) { |
| var req_ _bindings.Message |
| resp_ := &StatusWatcherWatchStatusResponse{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(StatusWatcherWatchStatusOrdinal, req_, resp_) |
| return (*resp_).PortStatus, err_ |
| } |
| |
| // Provides a way to receive updates on port status changes. |
| type StatusWatcherWithCtx interface { |
| // `WatchStatus` blocks until the port's status has changed. |
| // |
| // The first call to `WatchStatus` returns immediately with the current |
| // port status, subsequent calls complete when the port status differs from |
| // the last one that was returned through this `StatusWatcher`. |
| // |
| // If `StatusWatcher` was created with a buffer value larger than 1, |
| // `WatchStatus` may return a queued status change, depending on how many |
| // status changed happened since the last call to `WatchStatus`. |
| // |
| // - response `device_status` the most recent port status. |
| WatchStatus(ctx_ _bindings.Context) (PortStatus, error) |
| } |
| |
| type StatusWatcherWithCtxTransitionalBase struct{} |
| |
| type StatusWatcherWithCtxInterfaceRequest _bindings.InterfaceRequest |
| |
| func NewStatusWatcherWithCtxInterfaceRequest() (StatusWatcherWithCtxInterfaceRequest, *StatusWatcherWithCtxInterface, error) { |
| req, cli, err := _bindings.NewInterfaceRequest() |
| return StatusWatcherWithCtxInterfaceRequest(req), (*StatusWatcherWithCtxInterface)(cli), err |
| } |
| |
| type StatusWatcherWithCtxStub struct { |
| Impl StatusWatcherWithCtx |
| } |
| |
| func (s_ *StatusWatcherWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) { |
| switch args_.Ordinal { |
| case StatusWatcherWatchStatusOrdinal: |
| portStatus, err_ := s_.Impl.WatchStatus(args_.Ctx) |
| out_ := &StatusWatcherWatchStatusResponse{PortStatus: portStatus} |
| return out_, true, err_ |
| } |
| return nil, false, _bindings.ErrUnknownOrdinal |
| } |
| |
| type StatusWatcherEventProxy _bindings.ChannelProxy |