tc_program

package
v1.8.21 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: BSD-2-Clause Imports: 10 Imported by: 0

README

  • 外部パッケージの github.com/vishvananda/netlink が何らか利用できない状態になって、RST パケットがドロップできないとなっても、回避策はある(ref

    $ sudo iptables -A OUTPUT -s 127.0.0.1 -d 127.0.0.1 -p tcp --tcp-flags RST RST -j DROP
    
  • 初回 go generate 前に、以下あたりを確認しておく

Documentation

Index

Constants

View Source
const (
	// ebpfプログラム側と合わせること。ただ、現状のWSL2だと同一mapに複数のkey指定できない?みたいだった
	SUM_COUNT_KEY = uint32(0)
)

Variables

This section is empty.

Functions

func AddClsactQdisc

func AddClsactQdisc(attachTo string) (*netlink.GenericQdisc, error)

func Close

func Close(ebpfProg *tc_programObjects, qdisc *netlink.GenericQdisc, filters ...*netlink.BpfFilter) error

TODO: err即returnではなくすべての処理してからerr返すようにしたほうがいいかも

func InitializeTCProgram

func InitializeTCProgram() (*tc_programObjects, error)

func PrepareAnalyzingIngressPackets

func PrepareAnalyzingIngressPackets(nwInterface string, objs *tc_programObjects) (*netlink.BpfFilter, error)

func PrepareDropingRSTPacket

func PrepareDropingRSTPacket(nwInterface string, objs *tc_programObjects) (*netlink.BpfFilter, error)

Types

type AnalyzedPackets

type AnalyzedPackets struct {
	Sum uint64
}

func GetAnalyzedPackets

func GetAnalyzedPackets(analysisMap *ebpf.Map) (*AnalyzedPackets, error)

Jump to

Keyboard shortcuts

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