Skip to content

Commit

Permalink
renames
Browse files Browse the repository at this point in the history
  • Loading branch information
yanivagman committed Jan 19, 2025
1 parent c8e2c7b commit f5f0967
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions pkg/policy/ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,16 +298,16 @@ func (pm *PolicyManager) computeScopeFiltersConfig(eventID events.ID) scopeFilte
return cfg
}

// updateUIntFilterBPF updates the BPF maps for the given uint RuleBitmaps.
// updateUIntFilterBPF updates the BPF maps for the given uint filter map.
func (pm *PolicyManager) updateUIntFilterBPF(
bpfModule *bpf.Module,
ruleBitmaps map[filterVersionKey]map[uint64]ruleBitmap,
filterMap map[filterVersionKey]map[uint64]ruleBitmap,
innerMapName string,
outerMapName string,
) error {
for fvKey, rBitmaps := range ruleBitmaps {
for fvKey, innerFilterMap := range filterMap {
// Skip if no rules exist for this version/event
if len(rBitmaps) == 0 {
if len(innerFilterMap) == 0 {
continue
}

Expand All @@ -318,7 +318,7 @@ func (pm *PolicyManager) updateUIntFilterBPF(
fvKey.Version, fvKey.EventID, err)
}

for k, v := range rBitmaps {
for k, v := range innerFilterMap {
// Inner map type: u32 (key) -> eq_t (value)
// where eq_t is { uint64_t equals_in_rules, uint64_t key_used_in_rules }
u32Key := uint32(k)
Expand All @@ -339,16 +339,16 @@ func (pm *PolicyManager) updateUIntFilterBPF(
return nil
}

// updateStringFilterBPF updates the BPF maps for the given string RuleBitmaps.
// updateStringFilterBPF updates the BPF maps for the given string filter map.
func (pm *PolicyManager) updateStringFilterBPF(
bpfModule *bpf.Module,
ruleBitmaps map[filterVersionKey]map[string]ruleBitmap,
filterMap map[filterVersionKey]map[string]ruleBitmap,
innerMapName string,
outerMapName string,
) error {
for fvKey, rBitmaps := range ruleBitmaps {
for fvKey, innerFilterMap := range filterMap {
// Skip if no rules exist for this version/event
if len(rBitmaps) == 0 {
if len(innerFilterMap) == 0 {
continue
}

Expand All @@ -359,7 +359,7 @@ func (pm *PolicyManager) updateStringFilterBPF(
fvKey.Version, fvKey.EventID, err)
}

for k, v := range rBitmaps {
for k, v := range innerFilterMap {
// Inner map type: string_filter_t (key) -> eq_t (value)
// where string_filter_t is a fixed size char array
// and eq_t is { uint64_t equals_in_rules, uint64_t key_used_in_rules }
Expand All @@ -382,16 +382,16 @@ func (pm *PolicyManager) updateStringFilterBPF(
return nil
}

// updateBinaryFilterBPF updates the BPF maps for the given binary RuleBitmaps.
// updateBinaryFilterBPF updates the BPF maps for the given binary filter map.
func (pm *PolicyManager) updateBinaryFilterBPF(
bpfModule *bpf.Module,
ruleBitmaps map[filterVersionKey]map[filters.NSBinary]ruleBitmap,
filterMap map[filterVersionKey]map[filters.NSBinary]ruleBitmap,
innerMapName string,
outerMapName string,
) error {
for fvKey, rBitmaps := range ruleBitmaps {
for fvKey, innerFilterMap := range filterMap {
// Skip if no rules exist for this version/event
if len(rBitmaps) == 0 {
if len(innerFilterMap) == 0 {
continue
}

Expand All @@ -402,7 +402,7 @@ func (pm *PolicyManager) updateBinaryFilterBPF(
fvKey.Version, fvKey.EventID, err)
}

for k, v := range rBitmaps {
for k, v := range innerFilterMap {
if len(k.Path) > maxBpfBinPathSize {
return filters.InvalidValue(k.Path)
}
Expand Down Expand Up @@ -436,16 +436,16 @@ func (pm *PolicyManager) updateBinaryFilterBPF(
return nil
}

// updateStringDataFilterLPMBPF updates the BPF maps for the given kernel data LPM RuleBitmaps.
// updateStringDataFilterLPMBPF updates the BPF maps for the given kernel data LPM filter map.
func (pm *PolicyManager) updateStringDataFilterLPMBPF(
bpfModule *bpf.Module,
ruleBitmaps map[filterVersionKey]map[string]ruleBitmap,
filterMap map[filterVersionKey]map[string]ruleBitmap,
innerMapName string,
outerMapName string,
) error {
for fvKey, rBitmaps := range ruleBitmaps {
for fvKey, innerFilterMap := range filterMap {
// Skip if no rules exist for this version/event
if len(rBitmaps) == 0 {
if len(innerFilterMap) == 0 {
continue
}

Expand All @@ -456,7 +456,7 @@ func (pm *PolicyManager) updateStringDataFilterLPMBPF(
fvKey.Version, fvKey.EventID, err)
}

for k, v := range rBitmaps {
for k, v := range innerFilterMap {
// Ensure the string length is within the maximum allowed limit,
// excluding the NULL terminator.
if len(k) > maxBpfDataFilterStrSize-1 {
Expand Down Expand Up @@ -491,16 +491,16 @@ func (pm *PolicyManager) updateStringDataFilterLPMBPF(
return nil
}

// updateStringDataFilterBPF updates the BPF maps for the given kernel data RuleBitmaps.
// updateStringDataFilterBPF updates the BPF maps for the given kernel data filter map.
func (pm *PolicyManager) updateStringDataFilterBPF(
bpfModule *bpf.Module,
ruleBitmaps map[filterVersionKey]map[string]ruleBitmap,
filterMap map[filterVersionKey]map[string]ruleBitmap,
innerMapName string,
outerMapName string,
) error {
for fvKey, rBitmaps := range ruleBitmaps {
for fvKey, innerFilterMap := range filterMap {
// Skip if no rules exist for this version/event
if len(rBitmaps) == 0 {
if len(innerFilterMap) == 0 {
continue
}

Expand All @@ -511,7 +511,7 @@ func (pm *PolicyManager) updateStringDataFilterBPF(
fvKey.Version, fvKey.EventID, err)
}

for k, v := range rBitmaps {
for k, v := range innerFilterMap {
// Ensure the string length is within the maximum allowed limit,
// excluding the NULL terminator
if len(k) > maxBpfDataFilterStrSize-1 {
Expand Down

0 comments on commit f5f0967

Please sign in to comment.