go.mod: github.com/opencontainers/runc v1.1.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
59
vendor/github.com/cilium/ebpf/internal/syscall.go
generated
vendored
59
vendor/github.com/cilium/ebpf/internal/syscall.go
generated
vendored
@@ -1,6 +1,7 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
@@ -68,6 +69,48 @@ func BPF(cmd BPFCmd, attr unsafe.Pointer, size uintptr) (uintptr, error) {
|
||||
return r1, err
|
||||
}
|
||||
|
||||
type BPFProgLoadAttr struct {
|
||||
ProgType uint32
|
||||
InsCount uint32
|
||||
Instructions Pointer
|
||||
License Pointer
|
||||
LogLevel uint32
|
||||
LogSize uint32
|
||||
LogBuf Pointer
|
||||
KernelVersion uint32 // since 4.1 2541517c32be
|
||||
ProgFlags uint32 // since 4.11 e07b98d9bffe
|
||||
ProgName BPFObjName // since 4.15 067cae47771c
|
||||
ProgIfIndex uint32 // since 4.15 1f6f4cb7ba21
|
||||
ExpectedAttachType uint32 // since 4.17 5e43f899b03a
|
||||
ProgBTFFd uint32
|
||||
FuncInfoRecSize uint32
|
||||
FuncInfo Pointer
|
||||
FuncInfoCnt uint32
|
||||
LineInfoRecSize uint32
|
||||
LineInfo Pointer
|
||||
LineInfoCnt uint32
|
||||
AttachBTFID uint32
|
||||
AttachProgFd uint32
|
||||
}
|
||||
|
||||
// BPFProgLoad wraps BPF_PROG_LOAD.
|
||||
func BPFProgLoad(attr *BPFProgLoadAttr) (*FD, error) {
|
||||
for {
|
||||
fd, err := BPF(BPF_PROG_LOAD, unsafe.Pointer(attr), unsafe.Sizeof(*attr))
|
||||
// As of ~4.20 the verifier can be interrupted by a signal,
|
||||
// and returns EAGAIN in that case.
|
||||
if errors.Is(err, unix.EAGAIN) {
|
||||
continue
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return NewFD(uint32(fd)), nil
|
||||
}
|
||||
}
|
||||
|
||||
type BPFProgAttachAttr struct {
|
||||
TargetFd uint32
|
||||
AttachBpfFd uint32
|
||||
@@ -180,6 +223,22 @@ func BPFObjGetInfoByFD(fd *FD, info unsafe.Pointer, size uintptr) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type bpfGetFDByIDAttr struct {
|
||||
id uint32
|
||||
next uint32
|
||||
}
|
||||
|
||||
// BPFObjGetInfoByFD wraps BPF_*_GET_FD_BY_ID.
|
||||
//
|
||||
// Available from 4.13.
|
||||
func BPFObjGetFDByID(cmd BPFCmd, id uint32) (*FD, error) {
|
||||
attr := bpfGetFDByIDAttr{
|
||||
id: id,
|
||||
}
|
||||
ptr, err := BPF(cmd, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
|
||||
return NewFD(uint32(ptr)), err
|
||||
}
|
||||
|
||||
// BPFObjName is a null-terminated string made up of
|
||||
// 'A-Za-z0-9_' characters.
|
||||
type BPFObjName [unix.BPF_OBJ_NAME_LEN]byte
|
||||
|
Reference in New Issue
Block a user