Documentation
¶
Index ¶
- Constants
- type IInterceptor
- type IInterceptorServer
- type InterceptedSocket
- type InterceptorProxy
- func (p *InterceptorProxy) AsBinder() binder.IBinder
- func (p *InterceptorProxy) CloseSocket(ctx context.Context, handle InterceptedSocket) error
- func (p *InterceptorProxy) CreateSocket(ctx context.Context, nlFamily int32, clientNlPid int32, clientName string) (InterceptedSocket, error)
- func (p *InterceptorProxy) SubscribeGroup(ctx context.Context, handle InterceptedSocket, nlGroup int32) error
- func (p *InterceptorProxy) UnsubscribeGroup(ctx context.Context, handle InterceptedSocket, nlGroup int32) error
- type InterceptorStub
Constants ¶
View Source
const ( TransactionIInterceptorCreateSocket = binder.FirstCallTransaction + 0 TransactionIInterceptorCloseSocket = binder.FirstCallTransaction + 1 TransactionIInterceptorSubscribeGroup = binder.FirstCallTransaction + 2 TransactionIInterceptorUnsubscribeGroup = binder.FirstCallTransaction + 3 )
View Source
const ( MethodIInterceptorCreateSocket = "createSocket" MethodIInterceptorCloseSocket = "closeSocket" MethodIInterceptorSubscribeGroup = "subscribeGroup" MethodIInterceptorUnsubscribeGroup = "unsubscribeGroup" )
View Source
const DescriptorIInterceptor = "android.hardware.net.nlinterceptor.IInterceptor"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IInterceptor ¶
type IInterceptor interface {
AsBinder() binder.IBinder
CreateSocket(ctx context.Context, nlFamily int32, clientNlPid int32, clientName string) (InterceptedSocket, error)
CloseSocket(ctx context.Context, handle InterceptedSocket) error
SubscribeGroup(ctx context.Context, handle InterceptedSocket, nlGroup int32) error
UnsubscribeGroup(ctx context.Context, handle InterceptedSocket, nlGroup int32) error
}
func NewInterceptorStub ¶
func NewInterceptorStub( impl IInterceptorServer, ) IInterceptor
NewInterceptorStub creates a server-side IInterceptor wrapping the given server implementation. The returned value satisfies IInterceptor 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 IInterceptorServer ¶
type IInterceptorServer interface {
CreateSocket(ctx context.Context, nlFamily int32, clientNlPid int32, clientName string) (InterceptedSocket, error)
CloseSocket(ctx context.Context, handle InterceptedSocket) error
SubscribeGroup(ctx context.Context, handle InterceptedSocket, nlGroup int32) error
UnsubscribeGroup(ctx context.Context, handle InterceptedSocket, nlGroup int32) error
}
IInterceptorServer is the server-side interface that user implementations provide to NewInterceptorStub. It contains only the business methods, without AsBinder (which is provided by the stub itself).
type InterceptedSocket ¶
func (*InterceptedSocket) MarshalParcel ¶
func (s *InterceptedSocket) MarshalParcel( p *parcel.Parcel, ) error
func (*InterceptedSocket) UnmarshalParcel ¶
func (s *InterceptedSocket) UnmarshalParcel( p *parcel.Parcel, ) error
type InterceptorProxy ¶
func NewInterceptorProxy ¶
func NewInterceptorProxy( remote binder.IBinder, ) *InterceptorProxy
func (*InterceptorProxy) AsBinder ¶
func (p *InterceptorProxy) AsBinder() binder.IBinder
func (*InterceptorProxy) CloseSocket ¶
func (p *InterceptorProxy) CloseSocket( ctx context.Context, handle InterceptedSocket, ) error
func (*InterceptorProxy) CreateSocket ¶
func (p *InterceptorProxy) CreateSocket( ctx context.Context, nlFamily int32, clientNlPid int32, clientName string, ) (InterceptedSocket, error)
func (*InterceptorProxy) SubscribeGroup ¶
func (p *InterceptorProxy) SubscribeGroup( ctx context.Context, handle InterceptedSocket, nlGroup int32, ) error
func (*InterceptorProxy) UnsubscribeGroup ¶
func (p *InterceptorProxy) UnsubscribeGroup( ctx context.Context, handle InterceptedSocket, nlGroup int32, ) error
type InterceptorStub ¶
type InterceptorStub struct {
Impl IInterceptor
Transport binder.VersionAwareTransport
}
InterceptorStub dispatches incoming binder transactions to a typed IInterceptor implementation.
func (*InterceptorStub) Descriptor ¶
func (s *InterceptorStub) Descriptor() string
func (*InterceptorStub) OnTransaction ¶
func (s *InterceptorStub) OnTransaction( ctx context.Context, code binder.TransactionCode, _data *parcel.Parcel, ) (*parcel.Parcel, error)
Click to show internal directories.
Click to hide internal directories.