Skip to content

Commit

Permalink
Add tcp process detection with ebpf
Browse files Browse the repository at this point in the history
  • Loading branch information
vlabo committed Jun 7, 2023
1 parent efe8cd2 commit 0caa3e7
Show file tree
Hide file tree
Showing 16 changed files with 127,082 additions and 5 deletions.
133 changes: 133 additions & 0 deletions firewall/interception/ebpf/bpf_bpfeb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 133 additions & 0 deletions firewall/interception/ebpf/bpf_bpfel.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions firewall/interception/ebpf/packet.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//go:build linux

package ebpf

import (
pmpacket "github.com/safing/portmaster/network/packet"
)

// packet implements the packet.Packet interface.
type infoPacket struct {
pmpacket.Base
}

// LoadPacketData does nothing on Linux, as data is always fully parsed.
func (pkt *infoPacket) LoadPacketData() error {
return nil // fmt.Errorf("can't load data info only packet")
}

func (pkt *infoPacket) Accept() error {
return nil // fmt.Errorf("can't accept info only packet")
}

func (pkt *infoPacket) Block() error {
return nil // fmt.Errorf("can't block info only packet")
}

func (pkt *infoPacket) Drop() error {
return nil // fmt.Errorf("can't block info only packet")
}

func (pkt *infoPacket) PermanentAccept() error {
return pkt.Accept()
}

func (pkt *infoPacket) PermanentBlock() error {
return pkt.Block()
}

func (pkt *infoPacket) PermanentDrop() error {
return nil // fmt.Errorf("can't drop info only packet")
}

func (pkt *infoPacket) RerouteToNameserver() error {
return nil // fmt.Errorf("can't reroute info only packet")
}

func (pkt *infoPacket) RerouteToTunnel() error {
return nil // fmt.Errorf("can't reroute info only packet")
}
Loading

0 comments on commit 0caa3e7

Please sign in to comment.