DeviceFilter returns eBPF device filter program and its license string
(devices []specs.LinuxDeviceCgroup)
| 43 | |
| 44 | // DeviceFilter returns eBPF device filter program and its license string |
| 45 | func DeviceFilter(devices []specs.LinuxDeviceCgroup) (asm.Instructions, string, error) { |
| 46 | p := &program{} |
| 47 | p.init() |
| 48 | for i := len(devices) - 1; i >= 0; i-- { |
| 49 | if err := p.appendDevice(devices[i]); err != nil { |
| 50 | return nil, "", err |
| 51 | } |
| 52 | } |
| 53 | insts, err := p.finalize() |
| 54 | return insts, license, err |
| 55 | } |
| 56 | |
| 57 | type program struct { |
| 58 | insts asm.Instructions |
searching dependent graphs…