iovisor/bcc

helper for memmem()

Open

#471 aberto em 31 de mar. de 2016

Ver no GitHub
 (6 comments) (0 reactions) (0 assignees)C (4.051 forks)batch import
enhancementhelp wantedprio:medium

Métricas do repositório

Stars
 (22.409 stars)
Métricas de merge de PR
 (Mesclagem média 12d 6h) (12 fundiu PRs em 30d)

Description

Protocol such as DNS or IPv6 are hard to filter with cBPF because important parts are relative to floating offset, since BPF disallows loops and has relatively narrow registers, we have to unroll them and scan message with a lot of branches, burning the instruction limit.

Proposal

Provide kernel helper such as memmem(off_from, off_to, pattern) where offsets (R0, R1) are relative to packet payload, and pattern (R2) is a b/h/w/dw, and returned value would be offset in packet where the match occured or packet length (no occurence).

Guia do colaborador