MCPcopy Create free account
hub / github.com/dreadl0ck/netcap / init

Function init

decoder/stream/stream.go:118–135  ·  view source on GitHub ↗

package level init.

()

Source from the content-addressed store, hash-verified

116
117// package level init.
118func init() {
119 // build sorted port list for deterministic iteration
120 for port := range DefaultStreamDecoders {
121 SortedDecoderPorts = append(SortedDecoderPorts, port)
122 }
123 sort.Slice(SortedDecoderPorts, func(i, j int) bool {
124 return SortedDecoderPorts[i] < SortedDecoderPorts[j]
125 })
126
127 // collect all names for stream decoders on startup
128 for _, d := range DefaultStreamDecoders {
129 decoderutils.AllDecoderNames[d.GetName()] = struct{}{}
130 }
131 // also collect UDP-specific stream decoders
132 for _, d := range UDPStreamDecoders {
133 decoderutils.AllDecoderNames[d.GetName()] = struct{}{}
134 }
135}
136
137// ApplyActionToStreamDecoders can be used to run custom code for all stream decoders.
138func ApplyActionToStreamDecoders(action func(api core.StreamDecoderAPI)) {

Callers

nothing calls this directly

Calls 1

GetNameMethod · 0.65

Tested by

no test coverage detected