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 ¶
- func GetFirstMapEntryByID(nextKey uintptr, mapID int) error
- func GetIDFromFD(mapFD int) (int, error)
- func GetMapEntryByID(key, value uintptr, mapID int) error
- func GetNextMapEntryByID(key, nextKey uintptr, mapID int) error
- type BpfMap
- func (m *BpfMap) BulkDeleteMapEntry(keyvalue map[uintptr]uintptr) error
- func (m *BpfMap) BulkRefreshMapEntries(newMapContents map[string][]byte) error
- func (m *BpfMap) BulkUpdateMapEntry(keyvalue map[string][]byte) error
- func (m *BpfMap) CreateBPFMap(MapMetaData CreateEBPFMapInput) (BpfMap, error)
- func (m *BpfMap) CreateMapEntry(key, value uintptr) error
- func (m *BpfMap) CreateUpdateMapEntry(key, value uintptr, updateFlags uint64) error
- func (m *BpfMap) DeleteMapEntry(key uintptr) error
- func (m *BpfMap) GetAllMapKeys() ([]string, error)
- func (m *BpfMap) GetBPFmapInfo(mapFD uint32) (BpfMapInfo, error)
- func (m *BpfMap) GetFirstMapEntry(nextKey uintptr) error
- func (m *BpfMap) GetMapEntry(key, value uintptr) error
- func (m *BpfMap) GetMapFromPinPath(pinPath string) (BpfMapInfo, error)
- func (m *BpfMap) GetNextMapEntry(key, nextKey uintptr) error
- func (m *BpfMap) PinMap(pinPath string, pinType uint32) error
- func (m *BpfMap) UnPinMap(pinPath string) error
- func (m *BpfMap) UpdateMapEntry(key, value uintptr) error
- type BpfMapAPIs
- type BpfMapDef
- type BpfMapInfo
- type BpfMapPinOptions
- type BpfMapShowAttr
- type BpfObjGet
- type BpfObjGetInfo
- type CreateEBPFMapInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFirstMapEntryByID ¶
func GetIDFromFD ¶
func GetMapEntryByID ¶
func GetNextMapEntryByID ¶
Types ¶
type BpfMap ¶
type BpfMap struct {
MapFD uint32
MapID uint32
MapMetaData CreateEBPFMapInput
}
func (*BpfMap) BulkDeleteMapEntry ¶
func (*BpfMap) BulkRefreshMapEntries ¶
func (*BpfMap) BulkUpdateMapEntry ¶
func (*BpfMap) CreateBPFMap ¶
func (m *BpfMap) CreateBPFMap(MapMetaData CreateEBPFMapInput) (BpfMap, error)
func (*BpfMap) CreateMapEntry ¶
func (*BpfMap) CreateUpdateMapEntry ¶
func (*BpfMap) DeleteMapEntry ¶
func (*BpfMap) GetAllMapKeys ¶
func (*BpfMap) GetBPFmapInfo ¶ added in v1.0.11
func (m *BpfMap) GetBPFmapInfo(mapFD uint32) (BpfMapInfo, error)
func (*BpfMap) GetFirstMapEntry ¶
To get the first entry pass key as `nil`
func (*BpfMap) GetMapEntry ¶
func (*BpfMap) GetMapFromPinPath ¶
func (m *BpfMap) GetMapFromPinPath(pinPath string) (BpfMapInfo, error)
func (*BpfMap) GetNextMapEntry ¶
func (*BpfMap) UpdateMapEntry ¶
type BpfMapAPIs ¶
type BpfMapAPIs interface {
// Wrapper for BPF_MAP_CREATE API
CreateBPFMap(mapMetaData CreateEBPFMapInput) (BpfMap, error)
// Pin map to the passed pinPath
PinMap(pinPath string, pinType uint32) error
// Delete pinPath
UnPinMap(pinPath string) error
// Add an entry to map, if the entry exists, we error out
CreateMapEntry(key, value uintptr) error
// Update an entry in map, if the entry exists, we update
UpdateMapEntry(key, value uintptr) error
// Wrapper to call create or update
CreateUpdateMapEntry(key, value uintptr, updateFlags uint64) error
// Delete a map entry
DeleteMapEntry(key uintptr) error
// Map iterator helper - Get the first map entry
GetFirstMapEntry(nextKey uintptr) error
// Map iterator helper - Get next map entry
GetNextMapEntry(key, nextKey uintptr) error
// Get map value
GetMapEntry(key, value uintptr) error
// Update multiple map entries
BulkUpdateMapEntry(keyvalue map[string][]byte) error
// Delete multiple map entries
BulkDeleteMapEntry(keyvalue map[uintptr]uintptr) error
// Wrapper for delete and update map entries
BulkRefreshMapEntries(newMapContents map[string][]byte) error
// Retrieve map info from pin path
GetMapFromPinPath(pinPath string) (BpfMapInfo, error)
// Retrieve map info without pin path
GetBPFmapInfo(mapFD uint32) (BpfMapInfo, error)
}
type BpfMapInfo ¶
type BpfMapInfo struct {
Type uint32
Id uint32
KeySize uint32
ValueSize uint32
MaxEntries uint32
MapFlags uint32
Name [constdef.BPFObjNameLen]byte
IfIndex uint32
BtfVmLinuxValueTypeId uint32
NetnsDev uint64
NetnsIno uint64
BTFID uint32
BTFKeyTypeID uint32
BTFValueTypeId uint32
Pad uint32
MapExtra uint64
}
func BpfGetAllMapInfo ¶
func BpfGetAllMapInfo() ([]BpfMapInfo, error)
func GetBPFmapInfo ¶
func GetBPFmapInfo(mapFD int) (BpfMapInfo, error)
type BpfMapPinOptions ¶
type BpfMapShowAttr ¶
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 ¶
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) BpfGetMapInfoForFD ¶
func (objattr *BpfObjGetInfo) BpfGetMapInfoForFD() error