iovisor/bcc

helper for memmem()

Open

#471 aperta il 31 mar 2016

Vedi su GitHub
 (6 commenti) (0 reazioni) (0 assegnatari)C (4051 fork)batch import
enhancementhelp wantedprio:medium

Metriche repository

Star
 (22.409 star)
Metriche merge PR
 (Merge medio 12g 6h) (12 PR mergiate in 30 g)

Descrizione

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).

Guida contributor