Documentation
¶
Index ¶
- Constants
- type ForwardedStats
- type IOffload
- type IOffloadServer
- type IPv4AddrPortPair
- type ITetheringOffloadCallback
- type ITetheringOffloadCallbackServer
- type NatTimeoutUpdate
- type NetworkProtocol
- type OffloadCallbackEvent
- type OffloadProxy
- func (p *OffloadProxy) AddDownstream(ctx context.Context, iface string, prefix string) error
- func (p *OffloadProxy) AsBinder() binder.IBinder
- func (p *OffloadProxy) GetForwardedStats(ctx context.Context, upstream string) (ForwardedStats, error)
- func (p *OffloadProxy) InitOffload(ctx context.Context, fd1 int32, fd2 int32, cb ITetheringOffloadCallback) error
- func (p *OffloadProxy) RemoveDownstream(ctx context.Context, iface string, prefix string) error
- func (p *OffloadProxy) SetDataWarningAndLimit(ctx context.Context, upstream string, warningBytes int64, limitBytes int64) error
- func (p *OffloadProxy) SetLocalPrefixes(ctx context.Context, prefixes []string) error
- func (p *OffloadProxy) SetUpstreamParameters(ctx context.Context, iface string, v4Addr string, v4Gw string, v6Gws []string) error
- func (p *OffloadProxy) StopOffload(ctx context.Context) error
- type OffloadStub
- type TetheringOffloadCallbackProxy
- type TetheringOffloadCallbackStub
Constants ¶
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 )
const ( MethodIOffloadInitOffload = "initOffload" MethodIOffloadStopOffload = "stopOffload" MethodIOffloadSetLocalPrefixes = "setLocalPrefixes" MethodIOffloadGetForwardedStats = "getForwardedStats" MethodIOffloadSetDataWarningAndLimit = "setDataWarningAndLimit" MethodIOffloadSetUpstreamParameters = "setUpstreamParameters" MethodIOffloadAddDownstream = "addDownstream" MethodIOffloadRemoveDownstream = "removeDownstream" )
const ( TransactionITetheringOffloadCallbackOnEvent = binder.FirstCallTransaction + 0 TransactionITetheringOffloadCallbackUpdateTimeout = binder.FirstCallTransaction + 1 )
const ( MethodITetheringOffloadCallbackOnEvent = "onEvent" MethodITetheringOffloadCallbackUpdateTimeout = "updateTimeout" )
const DescriptorIOffload = "android.hardware.tetheroffload.IOffload"
const DescriptorITetheringOffloadCallback = "android.hardware.tetheroffload.ITetheringOffloadCallback"
const (
IOffloadErrorCodeUnused int32 = 0
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ForwardedStats ¶
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 ¶
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 ¶
func NewOffloadProxy ¶
func NewOffloadProxy( remote binder.IBinder, ) *OffloadProxy
func (*OffloadProxy) AddDownstream ¶
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 (*OffloadProxy) SetDataWarningAndLimit ¶
func (*OffloadProxy) SetLocalPrefixes ¶
func (p *OffloadProxy) SetLocalPrefixes( ctx context.Context, prefixes []string, ) error
func (*OffloadProxy) SetUpstreamParameters ¶
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 ¶
func NewTetheringOffloadCallbackProxy ¶
func NewTetheringOffloadCallbackProxy( remote binder.IBinder, ) *TetheringOffloadCallbackProxy
func (*TetheringOffloadCallbackProxy) AsBinder ¶
func (p *TetheringOffloadCallbackProxy) AsBinder() binder.IBinder
func (*TetheringOffloadCallbackProxy) OnEvent ¶
func (p *TetheringOffloadCallbackProxy) OnEvent( ctx context.Context, event OffloadCallbackEvent, ) error
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 ¶
func (s *TetheringOffloadCallbackStub) OnTransaction( ctx context.Context, code binder.TransactionCode, _data *parcel.Parcel, ) (*parcel.Parcel, error)