Commit Graph

3 Commits

Author SHA1 Message Date
Brenden Blanco 809f74071b Fix 32bit warnings in bpf_linux.go
The underlying struct type is still u64 regardless of architecture, but
the local cast should be to uintptr_t to squelch the warning.
2016-03-18 11:13:40 -07:00
Brenden Blanco 719d8ca65a Skip test if bpf syscall is unavailable 2016-02-28 23:52:26 -08:00
Brenden Blanco 6f0327edfd Add BPF TcAction support to U32 filter
Current U32 filter only supports redirect action, but the U32 can
support a lot more. Refactor a bit the action generating/parsing logic
to be more generic and add BPF action support.

When creating a U32 filter, one can supply an array of Actions, which
will be executed by the U32 filter in order:
* The new MirredAction implements the same functionality as RedirIndex
  field in the U32 filter, with that static field kept in the struct for
  backwards compatibility.
* A new BpfAction type is added which allows a program with an open bpf
  file descriptor (implementation is out of scope of this patch) to be
  added as well.

Add a test for the above use case which includes one of each type of
action.
2016-02-28 23:12:34 -08:00