blob: 5bff554d32c731fa8fe33d07d26dfdc719a29313 [file] [log] [blame]
// 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.
package network
import (
_zx "syscall/zx"
_bindings "syscall/zx/fidl"
fuchsianet "syscall/zx/net"
)
const (
// Maximum numbers of supported frame types for rx or tx.
MaxFrameTypes uint32 = 4
// Maximum length of session label.
MaxSessionName uint32 = 64
// 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
// 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 chained descriptors that describe a single frame.
MaxDescriptorChain uint8 = 4
// The maximum number of status samples that can be buffered by a [`StatusWatcher`].
MaxStatusBuffer uint32 = 50
// The maximum number of ports attached to a device at a given time.
MaxPorts uint8 = 32
)
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
default:
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
default:
return true
}
}
func (x InfoType) String() string {
switch x {
case 0:
return "NoInfo"
}
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
default:
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
default:
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.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
default:
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 = DeviceClass(0)
// Network device class.
type DeviceClass uint16
const (
DeviceClassUnknown DeviceClass = 0
DeviceClassEthernet DeviceClass = 1
DeviceClassWlan DeviceClass = 2
DeviceClassPpp DeviceClass = 3
DeviceClassBridge DeviceClass = 4
)
func (_ DeviceClass) I_EnumValues() []DeviceClass {
return []DeviceClass{
DeviceClassUnknown,
DeviceClassEthernet,
DeviceClassWlan,
DeviceClassPpp,
DeviceClassBridge,
}
}
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
default:
return true
}
}
func (x DeviceClass) String() string {
switch x {
case 0:
return "Unknown"
case 1:
return "Ethernet"
case 2:
return "Wlan"
case 3:
return "Ppp"
case 4:
return "Bridge"
}
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 {
switch x {
case 1:
return "Raw"
case 2:
return "EthernetIi"
case 4:
return "E8021Q"
case 8:
return "E8021QInQ"
case 16:
return "E8023LlcSnap"
}
return "Unknown"
}
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 {
switch x {
case 1:
return "RxAccel0"
case 2:
return "RxAccel1"
case 4:
return "RxAccel2"
case 8:
return "RxAccel3"
case 16:
return "RxAccel4"
case 32:
return "RxAccel5"
case 64:
return "RxAccel6"
case 128:
return "RxAccel7"
case 256:
return "RxAccel8"
case 512:
return "RxAccel9"
case 1024:
return "RxAccel10"
case 2048:
return "RxAccel11"
case 4096:
return "RxAccel12"
case 8192:
return "RxAccel13"
case 16384:
return "RxAccel14"
case 32768:
return "RxAccel15"
case 536870912:
return "RxOverrun"
case 1073741824:
return "RxValidationError"
case 2147483648:
return "RxEchoedTx"
}
return "Unknown"
}
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 {
switch x {
case 1:
return "TxAccel0"
case 2:
return "TxAccel1"
case 4:
return "TxAccel2"
case 8:
return "TxAccel3"
case 16:
return "TxAccel4"
case 32:
return "TxAccel5"
case 64:
return "TxAccel6"
case 128:
return "TxAccel7"
case 256:
return "TxAccel8"
case 512:
return "TxAccel9"
case 1024:
return "TxAccel10"
case 2048:
return "TxAccel11"
case 4096:
return "TxAccel12"
case 8192:
return "TxAccel13"
case 16384:
return "TxAccel14"
case 32768:
return "TxAccel15"
}
return "Unknown"
}
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 {
switch x {
case 1:
return "TxRetNotSupported"
case 2:
return "TxRetOutOfResources"
case 4:
return "TxRetNotAvailable"
case 2147483648:
return "TxRetError"
}
return "Unknown"
}
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 {
switch x {
case 1:
return "Online"
}
return "Unknown"
}
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 {
switch x {
case 1:
return "Primary"
case 2:
return "ListenTx"
case 4:
return "ReportInvalidRx"
}
return "Unknown"
}
type DeviceOpenSessionResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"12" fidl_alignment_v1:"4" fidl_size_v2:"12" fidl_alignment_v2:"4"`
Session SessionWithCtxInterface `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4"`
Fifos Fifos `fidl_offset_v1:"4" 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_v1:"1" fidl_alignment_v1:"1" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mEmpty = _bindings.CreateLazyMarshaler(Empty{})
func (msg *Empty) Marshaler() _bindings.Marshaler {
return _mEmpty
}
// 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_v1:"12" fidl_alignment_v1:"4" fidl_size_v2:"12" fidl_alignment_v2:"4"`
// The frame type this support entry refers to.
Type FrameType `fidl_offset_v1:"0" fidl_offset_v2:"0"`
// The frame type-specific features supported.
Features uint32 `fidl_offset_v1:"4" fidl_offset_v2:"4"`
// The flags supported for the given frame type.
SupportedFlags TxFlags `fidl_offset_v1:"8" fidl_offset_v2:"8"`
}
var _mFrameTypeSupport = _bindings.CreateLazyMarshaler(FrameTypeSupport{})
func (msg *FrameTypeSupport) Marshaler() _bindings.Marshaler {
return _mFrameTypeSupport
}
type SessionAttachResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"1" fidl_alignment_v1:"1" 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_v1:"1" fidl_alignment_v1:"1" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mSessionDetachResponse = _bindings.CreateLazyMarshaler(SessionDetachResponse{})
func (msg *SessionDetachResponse) Marshaler() _bindings.Marshaler {
return _mSessionDetachResponse
}
// Data-plane FIFOs.
type Fifos struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"4" 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_v1:"0" 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_v1:"4" 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
}
type deviceWithCtxGetInfoResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Info DeviceInfo `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mdeviceWithCtxGetInfoResponse = _bindings.CreateLazyMarshaler(deviceWithCtxGetInfoResponse{})
func (msg *deviceWithCtxGetInfoResponse) Marshaler() _bindings.Marshaler {
return _mdeviceWithCtxGetInfoResponse
}
type deviceWithCtxOpenSessionRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"32" fidl_alignment_v1:"8" fidl_size_v2:"32" fidl_alignment_v2:"8"`
SessionName string `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_bounds:"64"`
SessionInfo SessionInfo `fidl_offset_v1:"16" fidl_offset_v2:"16"`
}
var _mdeviceWithCtxOpenSessionRequest = _bindings.CreateLazyMarshaler(deviceWithCtxOpenSessionRequest{})
func (msg *deviceWithCtxOpenSessionRequest) Marshaler() _bindings.Marshaler {
return _mdeviceWithCtxOpenSessionRequest
}
type deviceWithCtxOpenSessionResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Result DeviceOpenSessionResult `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mdeviceWithCtxOpenSessionResponse = _bindings.CreateLazyMarshaler(deviceWithCtxOpenSessionResponse{})
func (msg *deviceWithCtxOpenSessionResponse) Marshaler() _bindings.Marshaler {
return _mdeviceWithCtxOpenSessionResponse
}
type deviceWithCtxGetPortRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Id uint8 `fidl_offset_v1:"0" fidl_offset_v2:"0"`
Port PortWithCtxInterfaceRequest `fidl_offset_v1:"4" fidl_offset_v2:"4" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mdeviceWithCtxGetPortRequest = _bindings.CreateLazyMarshaler(deviceWithCtxGetPortRequest{})
func (msg *deviceWithCtxGetPortRequest) Marshaler() _bindings.Marshaler {
return _mdeviceWithCtxGetPortRequest
}
type deviceWithCtxGetPortWatcherRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Watcher PortWatcherWithCtxInterfaceRequest `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mdeviceWithCtxGetPortWatcherRequest = _bindings.CreateLazyMarshaler(deviceWithCtxGetPortWatcherRequest{})
func (msg *deviceWithCtxGetPortWatcherRequest) Marshaler() _bindings.Marshaler {
return _mdeviceWithCtxGetPortWatcherRequest
}
type portWatcherWithCtxWatchResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Event DevicePortEvent `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mportWatcherWithCtxWatchResponse = _bindings.CreateLazyMarshaler(portWatcherWithCtxWatchResponse{})
func (msg *portWatcherWithCtxWatchResponse) Marshaler() _bindings.Marshaler {
return _mportWatcherWithCtxWatchResponse
}
type deviceInstanceWithCtxGetDeviceRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Device DeviceWithCtxInterfaceRequest `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mdeviceInstanceWithCtxGetDeviceRequest = _bindings.CreateLazyMarshaler(deviceInstanceWithCtxGetDeviceRequest{})
func (msg *deviceInstanceWithCtxGetDeviceRequest) Marshaler() _bindings.Marshaler {
return _mdeviceInstanceWithCtxGetDeviceRequest
}
type macAddressingWithCtxGetUnicastAddressResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Address fuchsianet.MacAddress `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mmacAddressingWithCtxGetUnicastAddressResponse = _bindings.CreateLazyMarshaler(macAddressingWithCtxGetUnicastAddressResponse{})
func (msg *macAddressingWithCtxGetUnicastAddressResponse) Marshaler() _bindings.Marshaler {
return _mmacAddressingWithCtxGetUnicastAddressResponse
}
type macAddressingWithCtxSetModeRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Mode MacFilterMode `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mmacAddressingWithCtxSetModeRequest = _bindings.CreateLazyMarshaler(macAddressingWithCtxSetModeRequest{})
func (msg *macAddressingWithCtxSetModeRequest) Marshaler() _bindings.Marshaler {
return _mmacAddressingWithCtxSetModeRequest
}
type macAddressingWithCtxSetModeResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Status int32 `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mmacAddressingWithCtxSetModeResponse = _bindings.CreateLazyMarshaler(macAddressingWithCtxSetModeResponse{})
func (msg *macAddressingWithCtxSetModeResponse) Marshaler() _bindings.Marshaler {
return _mmacAddressingWithCtxSetModeResponse
}
type macAddressingWithCtxAddMulticastAddressRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Address fuchsianet.MacAddress `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mmacAddressingWithCtxAddMulticastAddressRequest = _bindings.CreateLazyMarshaler(macAddressingWithCtxAddMulticastAddressRequest{})
func (msg *macAddressingWithCtxAddMulticastAddressRequest) Marshaler() _bindings.Marshaler {
return _mmacAddressingWithCtxAddMulticastAddressRequest
}
type macAddressingWithCtxAddMulticastAddressResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Status int32 `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mmacAddressingWithCtxAddMulticastAddressResponse = _bindings.CreateLazyMarshaler(macAddressingWithCtxAddMulticastAddressResponse{})
func (msg *macAddressingWithCtxAddMulticastAddressResponse) Marshaler() _bindings.Marshaler {
return _mmacAddressingWithCtxAddMulticastAddressResponse
}
type macAddressingWithCtxRemoveMulticastAddressRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Address fuchsianet.MacAddress `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mmacAddressingWithCtxRemoveMulticastAddressRequest = _bindings.CreateLazyMarshaler(macAddressingWithCtxRemoveMulticastAddressRequest{})
func (msg *macAddressingWithCtxRemoveMulticastAddressRequest) Marshaler() _bindings.Marshaler {
return _mmacAddressingWithCtxRemoveMulticastAddressRequest
}
type macAddressingWithCtxRemoveMulticastAddressResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Status int32 `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mmacAddressingWithCtxRemoveMulticastAddressResponse = _bindings.CreateLazyMarshaler(macAddressingWithCtxRemoveMulticastAddressResponse{})
func (msg *macAddressingWithCtxRemoveMulticastAddressResponse) Marshaler() _bindings.Marshaler {
return _mmacAddressingWithCtxRemoveMulticastAddressResponse
}
type statusWatcherWithCtxWatchStatusResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
PortStatus PortStatus `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mstatusWatcherWithCtxWatchStatusResponse = _bindings.CreateLazyMarshaler(statusWatcherWithCtxWatchStatusResponse{})
func (msg *statusWatcherWithCtxWatchStatusResponse) Marshaler() _bindings.Marshaler {
return _mstatusWatcherWithCtxWatchStatusResponse
}
type portWithCtxGetInfoResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Info PortInfo `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mportWithCtxGetInfoResponse = _bindings.CreateLazyMarshaler(portWithCtxGetInfoResponse{})
func (msg *portWithCtxGetInfoResponse) Marshaler() _bindings.Marshaler {
return _mportWithCtxGetInfoResponse
}
type portWithCtxGetStatusResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Status PortStatus `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mportWithCtxGetStatusResponse = _bindings.CreateLazyMarshaler(portWithCtxGetStatusResponse{})
func (msg *portWithCtxGetStatusResponse) Marshaler() _bindings.Marshaler {
return _mportWithCtxGetStatusResponse
}
type portWithCtxGetStatusWatcherRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Watcher StatusWatcherWithCtxInterfaceRequest `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"`
Buffer uint32 `fidl_offset_v1:"4" fidl_offset_v2:"4"`
}
var _mportWithCtxGetStatusWatcherRequest = _bindings.CreateLazyMarshaler(portWithCtxGetStatusWatcherRequest{})
func (msg *portWithCtxGetStatusWatcherRequest) Marshaler() _bindings.Marshaler {
return _mportWithCtxGetStatusWatcherRequest
}
type portWithCtxGetMacRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Mac MacAddressingWithCtxInterfaceRequest `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mportWithCtxGetMacRequest = _bindings.CreateLazyMarshaler(portWithCtxGetMacRequest{})
func (msg *portWithCtxGetMacRequest) Marshaler() _bindings.Marshaler {
return _mportWithCtxGetMacRequest
}
type sessionWithCtxAttachRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"24" fidl_alignment_v2:"8"`
Port uint8 `fidl_offset_v1:"0" fidl_offset_v2:"0"`
RxFrames []FrameType `fidl_offset_v1:"8" fidl_offset_v2:"8" fidl_bounds:"4"`
}
var _msessionWithCtxAttachRequest = _bindings.CreateLazyMarshaler(sessionWithCtxAttachRequest{})
func (msg *sessionWithCtxAttachRequest) Marshaler() _bindings.Marshaler {
return _msessionWithCtxAttachRequest
}
type sessionWithCtxAttachResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Result SessionAttachResult `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _msessionWithCtxAttachResponse = _bindings.CreateLazyMarshaler(sessionWithCtxAttachResponse{})
func (msg *sessionWithCtxAttachResponse) Marshaler() _bindings.Marshaler {
return _msessionWithCtxAttachResponse
}
type sessionWithCtxDetachRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Port uint8 `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _msessionWithCtxDetachRequest = _bindings.CreateLazyMarshaler(sessionWithCtxDetachRequest{})
func (msg *sessionWithCtxDetachRequest) Marshaler() _bindings.Marshaler {
return _msessionWithCtxDetachRequest
}
type sessionWithCtxDetachResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Result SessionDetachResult `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _msessionWithCtxDetachResponse = _bindings.CreateLazyMarshaler(sessionWithCtxDetachResponse{})
func (msg *sessionWithCtxDetachResponse) Marshaler() _bindings.Marshaler {
return _msessionWithCtxDetachResponse
}
type I_deviceOpenSessionResultTag uint64
const (
DeviceOpenSessionResultResponse = 1 // 0x00000001
DeviceOpenSessionResultErr = 2 // 0x00000002
)
type DeviceOpenSessionResult struct {
I_deviceOpenSessionResultTag `fidl:"x!" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"`
Response DeviceOpenSessionResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
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_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_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
// Port existed when watcher was created.
Existing uint8 `fidl_ordinal:"1"`
// New port was added to device.
Added uint8 `fidl_ordinal:"2"`
// Port was removed from the device.
Removed uint8 `fidl_ordinal:"3"`
// Exhausted list of existing ports.
Idle Empty `fidl_ordinal:"4"`
}
func (_m *DevicePortEvent) reset() {
switch _m.I_devicePortEventTag {
case 1:
var _zeroed uint8
_m.Existing = _zeroed
case 2:
var _zeroed uint8
_m.Added = _zeroed
case 3:
var _zeroed uint8
_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 uint8) {
_m.reset()
_m.I_devicePortEventTag = DevicePortEventExisting
_m.Existing = existing
}
func DevicePortEventWithExisting(existing uint8) DevicePortEvent {
var _u DevicePortEvent
_u.SetExisting(existing)
return _u
}
func (_m *DevicePortEvent) SetAdded(added uint8) {
_m.reset()
_m.I_devicePortEventTag = DevicePortEventAdded
_m.Added = added
}
func DevicePortEventWithAdded(added uint8) DevicePortEvent {
var _u DevicePortEvent
_u.SetAdded(added)
return _u
}
func (_m *DevicePortEvent) SetRemoved(removed uint8) {
_m.reset()
_m.I_devicePortEventTag = DevicePortEventRemoved
_m.Removed = removed
}
func DevicePortEventWithRemoved(removed uint8) 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_sessionAttachResultTag uint64
const (
SessionAttachResultResponse = 1 // 0x00000001
SessionAttachResultErr = 2 // 0x00000002
)
type SessionAttachResult struct {
I_sessionAttachResultTag `fidl:"x!" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response SessionAttachResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
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_v1:"24" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response SessionDetachResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
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 information.
type DeviceInfo struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" 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
// 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:"3"`
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:"4"`
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:"5"`
BufferAlignmentPresent bool
// Maximum supported length of buffers in the data VMO, in bytes. Required.
MaxBufferLength uint32 `fidl_ordinal:"6"`
MaxBufferLengthPresent bool
// The minimum rx buffer length required for device. Required.
MinRxBufferLength uint32 `fidl_ordinal:"7"`
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:"8"`
MinTxBufferLengthPresent bool
// The number of bytes the device requests be free as `head` space in a tx buffer. Required.
MinTxBufferHead uint16 `fidl_ordinal:"9"`
MinTxBufferHeadPresent bool
// The amount of bytes the device requests be free as `tail` space in a tx buffer. Required.
MinTxBufferTail uint16 `fidl_ordinal:"10"`
MinTxBufferTailPresent bool
// Maximum descriptor chain length accepted by the device. Required.
MaxBufferParts uint8 `fidl_ordinal:"11"`
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:"12"`
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:"13"`
TxAccelPresent bool
}
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) SetRxDepth(rxDepth uint16) {
u.RxDepth = rxDepth
u.RxDepthPresent = true
}
func (u *DeviceInfo) GetRxDepth() uint16 {
return u.RxDepth
}
func (u *DeviceInfo) GetRxDepthWithDefault(_default uint16) uint16 {
if !u.HasRxDepth() {
return _default
}
return u.RxDepth
}
func (u *DeviceInfo) HasRxDepth() bool {
return u.RxDepthPresent
}
func (u *DeviceInfo) ClearRxDepth() {
u.RxDepthPresent = false
}
func (u *DeviceInfo) SetTxDepth(txDepth uint16) {
u.TxDepth = txDepth
u.TxDepthPresent = true
}
func (u *DeviceInfo) GetTxDepth() uint16 {
return u.TxDepth
}
func (u *DeviceInfo) GetTxDepthWithDefault(_default uint16) uint16 {
if !u.HasTxDepth() {
return _default
}
return u.TxDepth
}
func (u *DeviceInfo) HasTxDepth() bool {
return u.TxDepthPresent
}
func (u *DeviceInfo) ClearTxDepth() {
u.TxDepthPresent = false
}
func (u *DeviceInfo) SetBufferAlignment(bufferAlignment uint32) {
u.BufferAlignment = bufferAlignment
u.BufferAlignmentPresent = true
}
func (u *DeviceInfo) GetBufferAlignment() uint32 {
return u.BufferAlignment
}
func (u *DeviceInfo) GetBufferAlignmentWithDefault(_default uint32) uint32 {
if !u.HasBufferAlignment() {
return _default
}
return u.BufferAlignment
}
func (u *DeviceInfo) HasBufferAlignment() bool {
return u.BufferAlignmentPresent
}
func (u *DeviceInfo) ClearBufferAlignment() {
u.BufferAlignmentPresent = false
}
func (u *DeviceInfo) SetMaxBufferLength(maxBufferLength uint32) {
u.MaxBufferLength = maxBufferLength
u.MaxBufferLengthPresent = true
}
func (u *DeviceInfo) GetMaxBufferLength() uint32 {
return u.MaxBufferLength
}
func (u *DeviceInfo) GetMaxBufferLengthWithDefault(_default uint32) uint32 {
if !u.HasMaxBufferLength() {
return _default
}
return u.MaxBufferLength
}
func (u *DeviceInfo) HasMaxBufferLength() bool {
return u.MaxBufferLengthPresent
}
func (u *DeviceInfo) ClearMaxBufferLength() {
u.MaxBufferLengthPresent = false
}
func (u *DeviceInfo) SetMinRxBufferLength(minRxBufferLength uint32) {
u.MinRxBufferLength = minRxBufferLength
u.MinRxBufferLengthPresent = true
}
func (u *DeviceInfo) GetMinRxBufferLength() uint32 {
return u.MinRxBufferLength
}
func (u *DeviceInfo) GetMinRxBufferLengthWithDefault(_default uint32) uint32 {
if !u.HasMinRxBufferLength() {
return _default
}
return u.MinRxBufferLength
}
func (u *DeviceInfo) HasMinRxBufferLength() bool {
return u.MinRxBufferLengthPresent
}
func (u *DeviceInfo) ClearMinRxBufferLength() {
u.MinRxBufferLengthPresent = false
}
func (u *DeviceInfo) SetMinTxBufferLength(minTxBufferLength uint32) {
u.MinTxBufferLength = minTxBufferLength
u.MinTxBufferLengthPresent = true
}
func (u *DeviceInfo) GetMinTxBufferLength() uint32 {
return u.MinTxBufferLength
}
func (u *DeviceInfo) GetMinTxBufferLengthWithDefault(_default uint32) uint32 {
if !u.HasMinTxBufferLength() {
return _default
}
return u.MinTxBufferLength
}
func (u *DeviceInfo) HasMinTxBufferLength() bool {
return u.MinTxBufferLengthPresent
}
func (u *DeviceInfo) ClearMinTxBufferLength() {
u.MinTxBufferLengthPresent = false
}
func (u *DeviceInfo) SetMinTxBufferHead(minTxBufferHead uint16) {
u.MinTxBufferHead = minTxBufferHead
u.MinTxBufferHeadPresent = true
}
func (u *DeviceInfo) GetMinTxBufferHead() uint16 {
return u.MinTxBufferHead
}
func (u *DeviceInfo) GetMinTxBufferHeadWithDefault(_default uint16) uint16 {
if !u.HasMinTxBufferHead() {
return _default
}
return u.MinTxBufferHead
}
func (u *DeviceInfo) HasMinTxBufferHead() bool {
return u.MinTxBufferHeadPresent
}
func (u *DeviceInfo) ClearMinTxBufferHead() {
u.MinTxBufferHeadPresent = false
}
func (u *DeviceInfo) SetMinTxBufferTail(minTxBufferTail uint16) {
u.MinTxBufferTail = minTxBufferTail
u.MinTxBufferTailPresent = true
}
func (u *DeviceInfo) GetMinTxBufferTail() uint16 {
return u.MinTxBufferTail
}
func (u *DeviceInfo) GetMinTxBufferTailWithDefault(_default uint16) uint16 {
if !u.HasMinTxBufferTail() {
return _default
}
return u.MinTxBufferTail
}
func (u *DeviceInfo) HasMinTxBufferTail() bool {
return u.MinTxBufferTailPresent
}
func (u *DeviceInfo) ClearMinTxBufferTail() {
u.MinTxBufferTailPresent = false
}
func (u *DeviceInfo) SetMaxBufferParts(maxBufferParts uint8) {
u.MaxBufferParts = maxBufferParts
u.MaxBufferPartsPresent = true
}
func (u *DeviceInfo) GetMaxBufferParts() uint8 {
return u.MaxBufferParts
}
func (u *DeviceInfo) GetMaxBufferPartsWithDefault(_default uint8) uint8 {
if !u.HasMaxBufferParts() {
return _default
}
return u.MaxBufferParts
}
func (u *DeviceInfo) HasMaxBufferParts() bool {
return u.MaxBufferPartsPresent
}
func (u *DeviceInfo) ClearMaxBufferParts() {
u.MaxBufferPartsPresent = false
}
func (u *DeviceInfo) SetRxAccel(rxAccel []RxAcceleration) {
u.RxAccel = rxAccel
u.RxAccelPresent = true
}
func (u *DeviceInfo) GetRxAccel() []RxAcceleration {
return u.RxAccel
}
func (u *DeviceInfo) GetRxAccelWithDefault(_default []RxAcceleration) []RxAcceleration {
if !u.HasRxAccel() {
return _default
}
return u.RxAccel
}
func (u *DeviceInfo) HasRxAccel() bool {
return u.RxAccelPresent
}
func (u *DeviceInfo) ClearRxAccel() {
u.RxAccelPresent = false
}
func (u *DeviceInfo) SetTxAccel(txAccel []TxAcceleration) {
u.TxAccel = txAccel
u.TxAccelPresent = true
}
func (u *DeviceInfo) GetTxAccel() []TxAcceleration {
return u.TxAccel
}
func (u *DeviceInfo) GetTxAccelWithDefault(_default []TxAcceleration) []TxAcceleration {
if !u.HasTxAccel() {
return _default
}
return u.TxAccel
}
func (u *DeviceInfo) HasTxAccel() bool {
return u.TxAccelPresent
}
func (u *DeviceInfo) ClearTxAccel() {
u.TxAccelPresent = 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)
}
// Dynamic port information.
type PortStatus struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" 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
}
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)
}
// Logical port information.
type PortInfo struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Port's identifier. Required.
Id uint8 `fidl_ordinal:"1"`
IdPresent bool
// Port's class. Required.
Class DeviceClass `fidl_ordinal:"2"`
ClassPresent 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:"3"`
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:"4"`
TxTypesPresent bool
}
func (u *PortInfo) SetId(id uint8) {
u.Id = id
u.IdPresent = true
}
func (u *PortInfo) GetId() uint8 {
return u.Id
}
func (u *PortInfo) GetIdWithDefault(_default uint8) uint8 {
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) SetClass(class DeviceClass) {
u.Class = class
u.ClassPresent = true
}
func (u *PortInfo) GetClass() DeviceClass {
return u.Class
}
func (u *PortInfo) GetClassWithDefault(_default DeviceClass) DeviceClass {
if !u.HasClass() {
return _default
}
return u.Class
}
func (u *PortInfo) HasClass() bool {
return u.ClassPresent
}
func (u *PortInfo) ClearClass() {
u.ClassPresent = false
}
func (u *PortInfo) SetRxTypes(rxTypes []FrameType) {
u.RxTypes = rxTypes
u.RxTypesPresent = true
}
func (u *PortInfo) GetRxTypes() []FrameType {
return u.RxTypes
}
func (u *PortInfo) GetRxTypesWithDefault(_default []FrameType) []FrameType {
if !u.HasRxTypes() {
return _default
}
return u.RxTypes
}
func (u *PortInfo) HasRxTypes() bool {
return u.RxTypesPresent
}
func (u *PortInfo) ClearRxTypes() {
u.RxTypesPresent = false
}
func (u *PortInfo) SetTxTypes(txTypes []FrameTypeSupport) {
u.TxTypes = txTypes
u.TxTypesPresent = true
}
func (u *PortInfo) GetTxTypes() []FrameTypeSupport {
return u.TxTypes
}
func (u *PortInfo) GetTxTypesWithDefault(_default []FrameTypeSupport) []FrameTypeSupport {
if !u.HasTxTypes() {
return _default
}
return u.TxTypes
}
func (u *PortInfo) HasTxTypes() bool {
return u.TxTypesPresent
}
func (u *PortInfo) ClearTxTypes() {
u.TxTypesPresent = 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)
}
// Session configuration.
type SessionInfo struct {
_ struct{} `fidl:"t" fidl_size_v1:"16" fidl_alignment_v1:"8" 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
}
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
)
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_ := &deviceWithCtxGetInfoResponse{}
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.
func (p *DeviceWithCtxInterface) OpenSession(ctx_ _bindings.Context, sessionName string, sessionInfo SessionInfo) (DeviceOpenSessionResult, error) {
req_ := &deviceWithCtxOpenSessionRequest{
SessionName: sessionName,
SessionInfo: sessionInfo,
}
resp_ := &deviceWithCtxOpenSessionResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DeviceOpenSessionOrdinal, req_, resp_)
return resp_.Result, 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 uint8, port PortWithCtxInterfaceRequest) error {
req_ := &deviceWithCtxGetPortRequest{
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_ := &deviceWithCtxGetPortWatcherRequest{
Watcher: watcher,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(DeviceGetPortWatcherOrdinal, 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.
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 uint8, port PortWithCtxInterfaceRequest) error
// Connects a [`PortWatcher`] to this device.
//
// + request `watcher` server end of watcher channel.
GetPortWatcher(ctx_ _bindings.Context, watcher PortWatcherWithCtxInterfaceRequest) 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_ := deviceWithCtxGetInfoResponse{}
out_.Info = info
return &out_, true, err_
case DeviceOpenSessionOrdinal:
in_ := deviceWithCtxOpenSessionRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
result, err_ := s_.Impl.OpenSession(args_.Ctx, in_.SessionName, in_.SessionInfo)
out_ := deviceWithCtxOpenSessionResponse{}
out_.Result = result
return &out_, true, err_
case DeviceGetPortOrdinal:
in_ := deviceWithCtxGetPortRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(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_ := deviceWithCtxGetPortWatcherRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.GetPortWatcher(args_.Ctx, in_.Watcher)
return nil, false, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type DeviceEventProxy _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_ := &portWatcherWithCtxWatchResponse{}
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_ := portWatcherWithCtxWatchResponse{}
out_.Event = event
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type PortWatcherEventProxy _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_ := &deviceInstanceWithCtxGetDeviceRequest{
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_ := deviceInstanceWithCtxGetDeviceRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(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 (
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_ := &macAddressingWithCtxGetUnicastAddressResponse{}
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_ := &macAddressingWithCtxSetModeRequest{
Mode: mode,
}
resp_ := &macAddressingWithCtxSetModeResponse{}
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_ := &macAddressingWithCtxAddMulticastAddressRequest{
Address: address,
}
resp_ := &macAddressingWithCtxAddMulticastAddressResponse{}
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_ := &macAddressingWithCtxRemoveMulticastAddressRequest{
Address: address,
}
resp_ := &macAddressingWithCtxRemoveMulticastAddressResponse{}
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_ := macAddressingWithCtxGetUnicastAddressResponse{}
out_.Address = address
return &out_, true, err_
case MacAddressingSetModeOrdinal:
in_ := macAddressingWithCtxSetModeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
status, err_ := s_.Impl.SetMode(args_.Ctx, in_.Mode)
out_ := macAddressingWithCtxSetModeResponse{}
out_.Status = status
return &out_, true, err_
case MacAddressingAddMulticastAddressOrdinal:
in_ := macAddressingWithCtxAddMulticastAddressRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
status, err_ := s_.Impl.AddMulticastAddress(args_.Ctx, in_.Address)
out_ := macAddressingWithCtxAddMulticastAddressResponse{}
out_.Status = status
return &out_, true, err_
case MacAddressingRemoveMulticastAddressOrdinal:
in_ := macAddressingWithCtxRemoveMulticastAddressRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
status, err_ := s_.Impl.RemoveMulticastAddress(args_.Ctx, in_.Address)
out_ := macAddressingWithCtxRemoveMulticastAddressResponse{}
out_.Status = status
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type MacAddressingEventProxy _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_ := &statusWatcherWithCtxWatchStatusResponse{}
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_ := statusWatcherWithCtxWatchStatusResponse{}
out_.PortStatus = portStatus
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type StatusWatcherEventProxy _bindings.ChannelProxy
const (
PortGetInfoOrdinal uint64 = 0x276cf65feb554ebd
PortGetStatusOrdinal uint64 = 0x4235650aacca60b2
PortGetStatusWatcherOrdinal uint64 = 0x65511ab81c1bd8d4
PortGetMacOrdinal uint64 = 0x2c6ec2988aefc0f6
)
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_ := &portWithCtxGetInfoResponse{}
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_ := &portWithCtxGetStatusResponse{}
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_ := &portWithCtxGetStatusWatcherRequest{
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_ := &portWithCtxGetMacRequest{
Mac: mac,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(PortGetMacOrdinal, 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
}
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_ := portWithCtxGetInfoResponse{}
out_.Info = info
return &out_, true, err_
case PortGetStatusOrdinal:
status, err_ := s_.Impl.GetStatus(args_.Ctx)
out_ := portWithCtxGetStatusResponse{}
out_.Status = status
return &out_, true, err_
case PortGetStatusWatcherOrdinal:
in_ := portWithCtxGetStatusWatcherRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(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_ := portWithCtxGetMacRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.GetMac(args_.Ctx, in_.Mac)
return nil, false, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type PortEventProxy _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 `fx_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 uint8, rxFrames []FrameType) (SessionAttachResult, error) {
req_ := &sessionWithCtxAttachRequest{
Port: port,
RxFrames: rxFrames,
}
resp_ := &sessionWithCtxAttachResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SessionAttachOrdinal, req_, resp_)
return resp_.Result, 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 uint8) (SessionDetachResult, error) {
req_ := &sessionWithCtxDetachRequest{
Port: port,
}
resp_ := &sessionWithCtxDetachResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SessionDetachOrdinal, req_, resp_)
return resp_.Result, 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.
//
// 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 `fx_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 uint8, 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 uint8) (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_ := sessionWithCtxAttachRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
result, err_ := s_.Impl.Attach(args_.Ctx, in_.Port, in_.RxFrames)
out_ := sessionWithCtxAttachResponse{}
out_.Result = result
return &out_, true, err_
case SessionDetachOrdinal:
in_ := sessionWithCtxDetachRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
result, err_ := s_.Impl.Detach(args_.Ctx, in_.Port)
out_ := sessionWithCtxDetachResponse{}
out_.Result = result
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