MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / Init

Method Init

pkg/config/eventsource.go:153–177  ·  view source on GitHub ↗

Init is an exported method to allow initializing exclusion maps from external modules.

()

Source from the content-addressed store, hash-verified

151
152// Init is an exported method to allow initializing exclusion maps from external modules.
153func (c *EventSourceConfig) Init() {
154 c.excludedImages = make(map[string]bool)
155
156 if c.dropMasks == nil {
157 c.dropMasks = bitmask.New()
158 }
159 for _, name := range c.ExcludedEvents {
160 for _, typ := range event.NameToTypes(name) {
161 if typ != event.UnknownType {
162 c.dropMasks.Set(typ.ID())
163 }
164 }
165 }
166
167 for _, name := range c.ExcludedImages {
168 c.excludedImages[name] = true
169 }
170
171 if c.allMasks == nil {
172 c.allMasks = bitmask.New()
173 }
174 for _, typ := range event.AllWithState() {
175 c.allMasks.Set(typ.ID())
176 }
177}
178
179// SetDropMask inserts the event mask in the bitset to
180// instruct the given event type should be dropped from

Callers 3

TestEventSourceAllEventsFunction · 0.95
testCallstackEnrichmentFunction · 0.95
TestEvasionScannerFunction · 0.95

Calls 5

NewFunction · 0.92
NameToTypesFunction · 0.92
AllWithStateFunction · 0.92
SetMethod · 0.65
IDMethod · 0.45

Tested by 3

TestEventSourceAllEventsFunction · 0.76
testCallstackEnrichmentFunction · 0.76
TestEvasionScannerFunction · 0.76