iovisor/bcc

helper for memmem()

Open

#471 建立於 2016年3月31日

在 GitHub 查看
 (6 留言) (0 反應) (0 負責人)C (4,051 fork)batch import
enhancementhelp wantedprio:medium

倉庫指標

Star
 (22,409 star)
PR 合併指標
 (平均合併 12天 6小時) (30 天內合併 12 個 PR)

描述

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

貢獻者指南