nlinterceptor

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Index

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

type InterceptedSocket struct {
	NlFamily int32
	PortId   int32
}

func (*InterceptedSocket) MarshalParcel

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

func (*InterceptedSocket) UnmarshalParcel

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

type InterceptorProxy

type InterceptorProxy struct {
	Remote binder.IBinder
}

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)

Jump to

Keyboard shortcuts

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