package level init.
()
| 116 | |
| 117 | // package level init. |
| 118 | func 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. |
| 138 | func ApplyActionToStreamDecoders(action func(api core.StreamDecoderAPI)) { |