Help us shape the future of Go! Take the 2026 Go Developer Survey

tetheroffload

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionIOffloadInitOffload            = binder.FirstCallTransaction + 0
	TransactionIOffloadStopOffload            = binder.FirstCallTransaction + 1
	TransactionIOffloadSetLocalPrefixes       = binder.FirstCallTransaction + 2
	TransactionIOffloadGetForwardedStats      = binder.FirstCallTransaction + 3
	TransactionIOffloadSetDataWarningAndLimit = binder.FirstCallTransaction + 4
	TransactionIOffloadSetUpstreamParameters  = binder.FirstCallTransaction + 5
	TransactionIOffloadAddDownstream          = binder.FirstCallTransaction + 6
	TransactionIOffloadRemoveDownstream       = binder.FirstCallTransaction + 7
)
View Source
const (
	MethodIOffloadInitOffload            = "initOffload"
	MethodIOffloadStopOffload            = "stopOffload"
	MethodIOffloadSetLocalPrefixes       = "setLocalPrefixes"
	MethodIOffloadGetForwardedStats      = "getForwardedStats"
	MethodIOffloadSetDataWarningAndLimit = "setDataWarningAndLimit"
	MethodIOffloadSetUpstreamParameters  = "setUpstreamParameters"
	MethodIOffloadAddDownstream          = "addDownstream"
	MethodIOffloadRemoveDownstream       = "removeDownstream"
)
View Source
const (
	TransactionITetheringOffloadCallbackOnEvent       = binder.FirstCallTransaction + 0
	TransactionITetheringOffloadCallbackUpdateTimeout = binder.FirstCallTransaction + 1
)
View Source
const (
	MethodITetheringOffloadCallbackOnEvent       = "onEvent"
	MethodITetheringOffloadCallbackUpdateTimeout = "updateTimeout"
)
View Source
const DescriptorIOffload = "android.hardware.tetheroffload.IOffload"
View Source
const DescriptorITetheringOffloadCallback = "android.hardware.tetheroffload.ITetheringOffloadCallback"
View Source
const (
	IOffloadErrorCodeUnused int32 = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ForwardedStats

type ForwardedStats struct {
	RxBytes int64
	TxBytes int64
}

func (*ForwardedStats) MarshalParcel

func (s *ForwardedStats) MarshalParcel(
	p *parcel.Parcel,
) error

func (*ForwardedStats) UnmarshalParcel

func (s *ForwardedStats) UnmarshalParcel(
	p *parcel.Parcel,
) error

type IOffload

type IOffload interface {
	AsBinder() binder.IBinder
	InitOffload(ctx context.Context, fd1 int32, fd2 int32, cb ITetheringOffloadCallback) error
	StopOffload(ctx context.Context) error
	SetLocalPrefixes(ctx context.Context, prefixes []string) error
	GetForwardedStats(ctx context.Context, upstream string) (ForwardedStats, error)
	SetDataWarningAndLimit(ctx context.Context, upstream string, warningBytes int64, limitBytes int64) error
	SetUpstreamParameters(ctx context.Context, iface string, v4Addr string, v4Gw string, v6Gws []string) error
	AddDownstream(ctx context.Context, iface string, prefix string) error
	RemoveDownstream(ctx context.Context, iface string, prefix string) error
}

func NewOffloadStub

func NewOffloadStub(
	impl IOffloadServer,
) IOffload

NewOffloadStub creates a server-side IOffload wrapping the given server implementation. The returned value satisfies IOffload and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type IOffloadServer

type IOffloadServer interface {
	InitOffload(ctx context.Context, fd1 int32, fd2 int32, cb ITetheringOffloadCallback) error
	StopOffload(ctx context.Context) error
	SetLocalPrefixes(ctx context.Context, prefixes []string) error
	GetForwardedStats(ctx context.Context, upstream string) (ForwardedStats, error)
	SetDataWarningAndLimit(ctx context.Context, upstream string, warningBytes int64, limitBytes int64) error
	SetUpstreamParameters(ctx context.Context, iface string, v4Addr string, v4Gw string, v6Gws []string) error
	AddDownstream(ctx context.Context, iface string, prefix string) error
	RemoveDownstream(ctx context.Context, iface string, prefix string) error
}

IOffloadServer is the server-side interface that user implementations provide to NewOffloadStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type IPv4AddrPortPair

type IPv4AddrPortPair struct {
	Addr string
	Port int32
}

func (*IPv4AddrPortPair) MarshalParcel

func (s *IPv4AddrPortPair) MarshalParcel(
	p *parcel.Parcel,
) error

func (*IPv4AddrPortPair) UnmarshalParcel

func (s *IPv4AddrPortPair) UnmarshalParcel(
	p *parcel.Parcel,
) error

type ITetheringOffloadCallback

type ITetheringOffloadCallback interface {
	AsBinder() binder.IBinder
	OnEvent(ctx context.Context, event OffloadCallbackEvent) error
	UpdateTimeout(ctx context.Context, params NatTimeoutUpdate) error
}

func NewTetheringOffloadCallbackStub

func NewTetheringOffloadCallbackStub(
	impl ITetheringOffloadCallbackServer,
) ITetheringOffloadCallback

NewTetheringOffloadCallbackStub creates a server-side ITetheringOffloadCallback wrapping the given server implementation. The returned value satisfies ITetheringOffloadCallback and can be passed to proxy methods; its AsBinder() returns a *binder.StubBinder that is auto-registered with the binder driver on first use.

type ITetheringOffloadCallbackServer

type ITetheringOffloadCallbackServer interface {
	OnEvent(ctx context.Context, event OffloadCallbackEvent) error
	UpdateTimeout(ctx context.Context, params NatTimeoutUpdate) error
}

ITetheringOffloadCallbackServer is the server-side interface that user implementations provide to NewTetheringOffloadCallbackStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).

type NatTimeoutUpdate

type NatTimeoutUpdate struct {
	Src   IPv4AddrPortPair
	Dst   IPv4AddrPortPair
	Proto NetworkProtocol
}

func (*NatTimeoutUpdate) MarshalParcel

func (s *NatTimeoutUpdate) MarshalParcel(
	p *parcel.Parcel,
) error

func (*NatTimeoutUpdate) UnmarshalParcel

func (s *NatTimeoutUpdate) UnmarshalParcel(
	p *parcel.Parcel,
) error

type NetworkProtocol

type NetworkProtocol int32
const (
	NetworkProtocolTCP NetworkProtocol = 6
	NetworkProtocolUDP NetworkProtocol = 17
)

type OffloadCallbackEvent

type OffloadCallbackEvent int32
const (
	OffloadCallbackEventOffloadStarted             OffloadCallbackEvent = 1
	OffloadCallbackEventOffloadStoppedError        OffloadCallbackEvent = 2
	OffloadCallbackEventOffloadStoppedUnsupported  OffloadCallbackEvent = 3
	OffloadCallbackEventOffloadSupportAvailable    OffloadCallbackEvent = 4
	OffloadCallbackEventOffloadStoppedLimitReached OffloadCallbackEvent = 5
	OffloadCallbackEventOffloadWarningReached      OffloadCallbackEvent = 6
)

type OffloadProxy

type OffloadProxy struct {
	Remote binder.IBinder
}

func NewOffloadProxy

func NewOffloadProxy(
	remote binder.IBinder,
) *OffloadProxy

func (*OffloadProxy) AddDownstream

func (p *OffloadProxy) AddDownstream(
	ctx context.Context,
	iface string,
	prefix string,
) error

func (*OffloadProxy) AsBinder

func (p *OffloadProxy) AsBinder() binder.IBinder

func (*OffloadProxy) GetForwardedStats

func (p *OffloadProxy) GetForwardedStats(
	ctx context.Context,
	upstream string,
) (ForwardedStats, error)

func (*OffloadProxy) InitOffload

func (p *OffloadProxy) InitOffload(
	ctx context.Context,
	fd1 int32,
	fd2 int32,
	cb ITetheringOffloadCallback,
) error

func (*OffloadProxy) RemoveDownstream

func (p *OffloadProxy) RemoveDownstream(
	ctx context.Context,
	iface string,
	prefix string,
) error

func (*OffloadProxy) SetDataWarningAndLimit

func (p *OffloadProxy) SetDataWarningAndLimit(
	ctx context.Context,
	upstream string,
	warningBytes int64,
	limitBytes int64,
) error

func (*OffloadProxy) SetLocalPrefixes

func (p *OffloadProxy) SetLocalPrefixes(
	ctx context.Context,
	prefixes []string,
) error

func (*OffloadProxy) SetUpstreamParameters

func (p *OffloadProxy) SetUpstreamParameters(
	ctx context.Context,
	iface string,
	v4Addr string,
	v4Gw string,
	v6Gws []string,
) error

func (*OffloadProxy) StopOffload

func (p *OffloadProxy) StopOffload(
	ctx context.Context,
) error

type OffloadStub

type OffloadStub struct {
	Impl      IOffload
	Transport binder.VersionAwareTransport
}

OffloadStub dispatches incoming binder transactions to a typed IOffload implementation.

func (*OffloadStub) Descriptor

func (s *OffloadStub) Descriptor() string

func (*OffloadStub) OnTransaction

func (s *OffloadStub) OnTransaction(
	ctx context.Context,
	code binder.TransactionCode,
	_data *parcel.Parcel,
) (*parcel.Parcel, error)

type TetheringOffloadCallbackProxy

type TetheringOffloadCallbackProxy struct {
	Remote binder.IBinder
}

func NewTetheringOffloadCallbackProxy

func NewTetheringOffloadCallbackProxy(
	remote binder.IBinder,
) *TetheringOffloadCallbackProxy

func (*TetheringOffloadCallbackProxy) AsBinder

func (*TetheringOffloadCallbackProxy) OnEvent

func (*TetheringOffloadCallbackProxy) UpdateTimeout

func (p *TetheringOffloadCallbackProxy) UpdateTimeout(
	ctx context.Context,
	params NatTimeoutUpdate,
) error

type TetheringOffloadCallbackStub

type TetheringOffloadCallbackStub struct {
	Impl      ITetheringOffloadCallback
	Transport binder.VersionAwareTransport
}

TetheringOffloadCallbackStub dispatches incoming binder transactions to a typed ITetheringOffloadCallback implementation.

func (*TetheringOffloadCallbackStub) Descriptor

func (s *TetheringOffloadCallbackStub) Descriptor() string

func (*TetheringOffloadCallbackStub) OnTransaction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL