progs

package
v0.0.0-...-3b46a80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

http://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BpfGetMapInfoFromProgInfo

func BpfGetMapInfoFromProgInfo(progFD int, numMaps uint32) ([]ebpf_maps.BpfMapInfo, []int, error)

func MountBpfFS

func MountBpfFS() error

Types

type BpfObjGet

type BpfObjGet struct {
	// contains filtered or unexported fields
}

* struct { anonymous struct used by BPF_OBJ_* commands * __aligned_u64 pathname; * __u32 bpf_fd; * __u32 file_flags; * };

func (*BpfObjGet) BpfGetObject

func (attr *BpfObjGet) BpfGetObject() (int, error)

type BpfObjGetInfo

type BpfObjGetInfo struct {
	// contains filtered or unexported fields
}
  • struct { anonymous struct used by BPF_OBJ_GET_INFO_BY_FD
  • __u32 bpf_fd;
  • __u32 info_len;
  • __aligned_u64 info;
  • } info;

*

func (*BpfObjGetInfo) BpfGetProgramInfoForFD

func (objattr *BpfObjGetInfo) BpfGetProgramInfoForFD() error

type BpfProgAPIs

type BpfProgAPIs interface {
	PinProg(progFD uint32, pinPath string) error
	UnPinProg(pinPath string) error
	LoadProg(progMetaData CreateEBPFProgInput) (int, error)
	GetProgFromPinPath(pinPath string) (BpfProgInfo, int, error)
	GetBPFProgAssociatedMapsIDs(progFD int) ([]uint32, error)
}

type BpfProgAttr

type BpfProgAttr struct {
	// contains filtered or unexported fields
}

func (*BpfProgAttr) BpfProgGetFDbyID

func (attr *BpfProgAttr) BpfProgGetFDbyID() (int, error)

type BpfProgInfo

type BpfProgInfo struct {
	Type                 uint32
	ID                   uint32
	Tag                  [constdef.BPFTagSize]byte
	JitedProgLen         uint32
	XlatedProgLen        uint32
	JitedProgInsns       uint64
	XlatedProgInsns      uint64
	LoadTime             int64
	CreatedByUID         uint32
	NrMapIDs             uint32
	MapIDs               uint64
	Name                 [constdef.BPFObjNameLen]byte
	IfIndex              uint32
	GPLCompatible        uint32 `strcut:"bitfield"`
	Pad                  uint32 `strcut:"pad"`
	NetnsDev             uint64
	NetnsIno             uint64
	NrJitedKsyms         uint32
	NrJitedFuncLens      uint32
	JitedKsyms           uint64
	JitedFuncLens        uint64
	BTFID                uint32
	FuncInfoRecSize      uint32
	FuncInfo             uint64
	NrFuncInfo           uint32
	NrLineInfo           uint32
	LineInfo             uint64
	JitedLineInfo        uint64
	NrJitedLineInfo      uint32
	LineInfoRecSize      uint32
	JitedLineInfoRecSize uint32
	NrProgTags           uint32
	ProgTags             uint64
	RunTimeNS            uint64
	RunCnt               uint64
}

func BpfGetAllProgramInfo

func BpfGetAllProgramInfo() ([]BpfProgInfo, error)

func GetBPFprogInfo

func GetBPFprogInfo(progFD int) (BpfProgInfo, error)

type BpfProgram

type BpfProgram struct {
	// return program name, prog FD and pinPath
	ProgID      int
	ProgFD      int
	PinPath     string
	ProgType    string
	SubSystem   string
	SubProgType string
}

func (*BpfProgram) GetBPFProgAssociatedMapsIDs

func (m *BpfProgram) GetBPFProgAssociatedMapsIDs(progFD int) ([]uint32, error)

func (*BpfProgram) GetProgFromPinPath

func (m *BpfProgram) GetProgFromPinPath(pinPath string) (BpfProgInfo, int, error)

func (*BpfProgram) LoadProg

func (m *BpfProgram) LoadProg(progMetaData CreateEBPFProgInput) (int, error)

func (*BpfProgram) PinProg

func (m *BpfProgram) PinProg(progFD uint32, pinPath string) error

func (*BpfProgram) UnPinProg

func (m *BpfProgram) UnPinProg(pinPath string) error

type CreateEBPFProgInput

type CreateEBPFProgInput struct {
	ProgType       string
	SubSystem      string
	SubProgType    string
	ProgData       []byte
	LicenseStr     string
	PinPath        string
	InsDefSize     int
	AssociatedMaps map[int]string
}

Directories

Path Synopsis
Package mock_progs is a generated GoMock package.
Package mock_progs is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL