filter

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package filter contains the Retina filter plugin. It utilizes eBPF to filter packets based on IP addresses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterMap

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

func Init

func Init() (*FilterMap, error)

func (*FilterMap) Add

func (f *FilterMap) Add(ips []net.IP) error

func (*FilterMap) Close

func (f *FilterMap) Close()

func (*FilterMap) Delete

func (f *FilterMap) Delete(ips []net.IP) error

type IEbpfMap

type IEbpfMap interface {
	BatchUpdate(keys, values interface{}, opts *ebpf.BatchOptions) (int, error)
	BatchDelete(keys interface{}, opts *ebpf.BatchOptions) (int, error)
	Put(key, value interface{}) error
	Delete(key interface{}) error
	Close() error
}

Interface for eBPF map. Added for UTs.

type IFilterMap

type IFilterMap interface {
	Add([]net.IP) error
	Delete([]net.IP) error
	Close()
}

A thin wrapper around the eBPF map that allows adding and deleting IPv4 addresses. Adding this separately here because: - C code uses the lib for generation/compilation - Plugins import retina_filter.c to use lookup function

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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