package sniffer
import "gvisor.dev/gvisor/tools/ioctl_sniffer/sniffer"
Package sniffer parses the output of the ioctl hook.
Index ¶
- func Init() error
- type Connection
- func (c Connection) ReadHookOutput(ctx context.Context) *Results
- func (c *Connection) ReadIoctlProto(ctx context.Context) (*pb.Ioctl, error)
- type Ioctl
- func ParseIoctlOutput(ioctl *pb.Ioctl) (Ioctl, error)
- func (i Ioctl) IsSupported() bool
- func (i Ioctl) String() string
- type Results
- func NewResults() *Results
- func (r *Results) AddUnsupportedIoctl(ioctl Ioctl)
- func (r *Results) HasUnsupportedIoctl() bool
- func (r *Results) Merge(other *Results)
- func (r *Results) String() string
- type Server
Functions ¶
func Init ¶
func Init() error
Init reads from nvproxy and sets up the supported ioctl maps.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection is a connection to the sniffer hook.
func (Connection) ReadHookOutput ¶
func (c Connection) ReadHookOutput(ctx context.Context) *Results
ReadHookOutput reads the output of the ioctl hook until an EOF is reached.
func (*Connection) ReadIoctlProto ¶
ReadIoctlProto reads a single ioctl proto from this connection. Our format is:
- 8 byte little endian uint64 containing the size of the proto.
- The proto bytes.
This should match the format in sniffer_bridge.h.
type Ioctl ¶
type Ioctl struct {
// contains filtered or unexported fields
}
Ioctl contains the parsed ioctl protobuf information.
func ParseIoctlOutput ¶
ParseIoctlOutput parses an ioctl protobuf from the ioctl hook.
func (Ioctl) IsSupported ¶
IsSupported returns true if the ioctl is supported by nvproxy.
func (Ioctl) String ¶
type Results ¶
type Results struct {
// contains filtered or unexported fields
}
Results contains the list of unsupported ioctls.
func NewResults ¶
func NewResults() *Results
NewResults creates a new Results object.
func (*Results) AddUnsupportedIoctl ¶
AddUnsupportedIoctl adds an unsupported ioctl to the results.
func (*Results) HasUnsupportedIoctl ¶
HasUnsupportedIoctl returns true if there are any unsupported ioctls.
func (*Results) Merge ¶
Merge merges the results from another Results object into this one.
func (*Results) String ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a server that accepts connections from the sniffer hook. It reads ioctl protos from each connection and sends them to the results channel.
func NewServer ¶
func NewServer() *Server
NewServer creates a new Server.
func (*Server) Addr ¶
Addr returns the address of the socket.
func (*Server) AllResults ¶
AllResults blocks until all connections have closed and returns an aggregate of all the results.
func (*Server) Listen ¶
Listen opens a new socket server.
func (*Server) Serve ¶
Serve opens a new socket server, continually accepts connections from the socket and reads ioctl protos from each connection. It blocks until the context is cancelled.
Source Files ¶
sniffer.go sniffer_bridge.go
- Version
- v0.0.0-20250618232322-85c27ad0efac (latest)
- Published
- Jun 18, 2025
- Platform
- linux/amd64
- Imports
- 18 packages
- Last checked
- 7 hours ago –
Tools for package owners.