github.com/criyle/go-sandbox@v0.10.3/pkg/seccomp/filter_linux.go (about)

     1  // Package seccomp provides a generated filter format for seccomp filter
     2  package seccomp
     3  
     4  import "syscall"
     5  
     6  // Filter is the BPF seccomp filter value
     7  type Filter []syscall.SockFilter
     8  
     9  // SockFprog converts Filter to SockFprog for seccomp syscall
    10  func (f Filter) SockFprog() *syscall.SockFprog {
    11  	b := []syscall.SockFilter(f)
    12  	return &syscall.SockFprog{
    13  		Len:    uint16(len(b)),
    14  		Filter: &b[0],
    15  	}
    16  }