indexfile

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 12 Imported by: 45

Documentation

Overview

Package indexfile provides methods for querying stenotype indexes to find the blockfile positions of packets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockfilePathFromIndexPath

func BlockfilePathFromIndexPath(p string) string

BlockfilePathFromIndexPath returns the path to a block file based on the path to an index file.

func IndexPathFromBlockfilePath

func IndexPathFromBlockfilePath(p string) string

IndexPathFromBlockfilePath returns the path to an index file based on the path to a block file.

Types

type IndexFile

type IndexFile struct {
	// contains filtered or unexported fields
}

IndexFile wraps a stenotype index, allowing it to be queried.

func NewIndexFile

func NewIndexFile(filename string, fc *filecache.Cache) (*IndexFile, error)

NewIndexFile returns a new handle to the named index file.

func (*IndexFile) Close

func (i *IndexFile) Close() error

Close the indexfile.

func (*IndexFile) Dump

func (i *IndexFile) Dump(out io.Writer, start, finish []byte)

Dump writes out a debug version of the entire index to the given writer.

func (*IndexFile) IPPositions

func (i *IndexFile) IPPositions(ctx context.Context, from, to net.IP) (base.Positions, error)

IPPositions returns the positions in the block file of all packets with IPs between the given ranges. Both IPs must be 4 or 16 bytes long, both must be the same length, and from must be <= to.

func (*IndexFile) MPLSPositions

func (i *IndexFile) MPLSPositions(ctx context.Context, mpls uint32) (base.Positions, error)

MPLSPositions returns the positions in the block file of all packets with the given MPLS number.

func (*IndexFile) Name

func (i *IndexFile) Name() string

Name returns the name of the file underlying this index.

func (*IndexFile) PortPositions

func (i *IndexFile) PortPositions(ctx context.Context, port uint16) (base.Positions, error)

PortPositions returns the positions in the block file of all packets with the give port number (TCP or UDP).

func (*IndexFile) ProtoPositions

func (i *IndexFile) ProtoPositions(ctx context.Context, proto byte) (base.Positions, error)

ProtoPositions returns the positions in the block file of all packets with the give IP protocol number.

func (*IndexFile) VLANPositions

func (i *IndexFile) VLANPositions(ctx context.Context, port uint16) (base.Positions, error)

VLANPositions returns the positions in the block file of all packets with the given VLAN number.

Jump to

Keyboard shortcuts

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