| 1 | // SPDX-License-Identifier: BSD-2-Clausecxx . . $ `<file>/src/mirror.c`/ |
| 2 | /* |
| 3 | * Copyright (C) 2020-2025 Linutronix GmbH |
| 4 | * Author Kurt Kanzenbach <[email protected]> |
| 5 | */ |
| 6 | |
| 7 | #include <stdio.h> |
| 8 | #include <stdlib.h> |
| 9 | |
| 10 | #include <getopt.h> |
| 11 | #include <signal.h> |
| 12 | #include <stdio.h> |
| 13 | #include <stdlib.h> |
| 14 | |
| 15 | #include <sys/mman.h> |
| 16 | |
| 17 | #include "app_config.h"cxx . . $ `<file>/build/app_config.h`/ |
| 18 | #include "config.h"cxx . . $ `<file>/src/config.h`/ |
| 19 | #include "dcp_thread.h"cxx . . $ `<file>/src/dcp_thread.h`/ |
| 20 | #include "layer2_thread.h"cxx . . $ `<file>/src/layer2_thread.h`/ |
| 21 | #include "lldp_thread.h"cxx . . $ `<file>/src/lldp_thread.h`/ |
| 22 | #include "log.h"cxx . . $ `<file>/src/log.h`/ |
| 23 | #include "log_json.h"cxx . . $ `<file>/src/log_json.h`/ |
| 24 | #include "log_mqtt.h"cxx . . $ `<file>/src/log_mqtt.h`/ |
| 25 | #include "print.h"cxx . . $ `<file>/src/print.h`/ |
| 26 | #include "rta_thread.h"cxx . . $ `<file>/src/rta_thread.h`/ |
| 27 | #include "rtc_thread.h"cxx . . $ `<file>/src/rtc_thread.h`/ |
| 28 | #include "stat.h"cxx . . $ `<file>/src/stat.h`/ |
| 29 | #include "thread.h"cxx . . $ `<file>/src/thread.h`/ |
| 30 | #include "tsn_thread.h"cxx . . $ `<file>/src/tsn_thread.h`/ |
| 31 | #include "udp_thread.h"cxx . . $ `<file>/src/udp_thread.h`/ |
| 32 | #include "utils.h"cxx . . $ `<file>/src/utils.h`/ |
| 33 | |
| 34 | static struct optioncxx . . $ option# long_optionscxx . . $ long_options.[] = { |
| 35 | {"config", optional_argumentcxx . . $ `<external>/1746263805473775960/getopt_ext.h:64:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 'c'}, |
| 36 | {"help", no_argumentcxx . . $ `<external>/1746263805473775960/getopt_ext.h:62:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 'h'}, |
| 37 | {"version", no_argumentcxx . . $ `<external>/1746263805473775960/getopt_ext.h:62:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 'V'}, |
| 38 | {NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!}, |
| 39 | }; |
| 40 | |
| 41 | static struct log_mqtt_thread_contextcxx . . $ log_mqtt_thread_context# *log_mqtt_threadcxx . . $ log_mqtt_thread.; |
| 42 | static struct log_json_thread_contextcxx . . $ log_json_thread_context# *log_json_threadcxx . . $ log_json_thread.; |
| 43 | static struct log_thread_contextcxx . . $ log_thread_context# *log_threadcxx . . $ log_thread.; |
| 44 | static struct thread_contextcxx . . $ thread_context# *g2_threadscxx . . $ g2_threads.; |
| 45 | static struct thread_contextcxx . . $ thread_context# *threadscxx . . $ threads.; |
| 46 | |
| 47 | static void term_handlercxx . . $ term_handler(d4f767463ce0a6b3).(int sig) |
| 48 | { |
| 49 | int i; |
| 50 | |
| 51 | printfcxx . . $ printf(581fddd72a8db8fc).("Stopping all application threads...\n"); |
| 52 | |
| 53 | print_stopcxx . . $ print_stop. = 1; |
| 54 | |
| 55 | if (log_mqtt_threadcxx . . $ log_mqtt_thread.) |
| 56 | log_mqtt_threadcxx . . $ log_mqtt_thread.->stopcxx . . $ log_mqtt_thread_context#stop. = 1; |
| 57 | |
| 58 | if (log_json_threadcxx . . $ log_json_thread.) |
| 59 | log_json_threadcxx . . $ log_json_thread.->stopcxx . . $ log_json_thread_context#stop. = 1; |
| 60 | |
| 61 | if (log_threadcxx . . $ log_thread.) |
| 62 | log_threadcxx . . $ log_thread.->stopcxx . . $ log_thread_context#stop. = 1; |
| 63 | |
| 64 | if (g2_threadscxx . . $ g2_threads.) |
| 65 | g2_threadscxx . . $ g2_threads.->stopcxx . . $ thread_context#stop. = 1; |
| 66 | |
| 67 | if (threadscxx . . $ threads.) |
| 68 | for (i = 0; i < NUM_PN_THREAD_TYPEScxx . . $ NUM_PN_THREAD_TYPES.; i++) |
| 69 | threadscxx . . $ threads.[i].stopcxx . . $ thread_context#stop. = 1; |
| 70 | } |
| 71 | |
| 72 | static void reset_stats_handlercxx . . $ reset_stats_handler(d4f767463ce0a6b3).(int sig) |
| 73 | { |
| 74 | reset_statscxx . . $ reset_stats. = 1; |
| 75 | } |
| 76 | |
| 77 | static void setup_signalscxx . . $ setup_signals(49f6e7a06ebc5aa8).(void) |
| 78 | { |
| 79 | struct sigactioncxx . . $ sigaction# sa1, sa2; |
| 80 | |
| 81 | sigemptysetcxx . . $ sigemptyset(f9c066a8ff75ee9d).(&sa1.sa_maskcxx . . $ sigaction#sa_mask.); |
| 82 | sa1.sa_handlercxx . . $ `<external>/16635209305659446502/sigaction.h:39:10`! = term_handlercxx . . $ term_handler(d4f767463ce0a6b3).; |
| 83 | sa1.sa_flagscxx . . $ sigaction#sa_flags. = 0; |
| 84 | |
| 85 | sigemptysetcxx . . $ sigemptyset(f9c066a8ff75ee9d).(&sa2.sa_maskcxx . . $ sigaction#sa_mask.); |
| 86 | sa2.sa_handlercxx . . $ `<external>/16635209305659446502/sigaction.h:39:10`! = reset_stats_handlercxx . . $ reset_stats_handler(d4f767463ce0a6b3).; |
| 87 | sa2.sa_flagscxx . . $ sigaction#sa_flags. = 0; |
| 88 | |
| 89 | if (sigactioncxx . . $ sigaction(53aba09fe16b06c7).(SIGTERMcxx . . $ `<external>/11773118241360591791/signum-generic.h:53:9`!, &sa1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 90 | perrorcxx . . $ perror(85c52e162fed56f9).("sigaction() failed"); |
| 91 | if (sigactioncxx . . $ sigaction(53aba09fe16b06c7).(SIGINTcxx . . $ `<external>/11773118241360591791/signum-generic.h:48:9`!, &sa1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 92 | perrorcxx . . $ perror(85c52e162fed56f9).("sigaction() failed"); |
| 93 | if (sigactioncxx . . $ sigaction(53aba09fe16b06c7).(SIGUSR1cxx . . $ `<external>/1457673850468744829/signum-arch.h:49:9`!, &sa2, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) |
| 94 | perrorcxx . . $ perror(85c52e162fed56f9).("sigaction() failed"); |
| 95 | } |
| 96 | |
| 97 | static void print_usage_and_diecxx . . $ print_usage_and_die(49f6e7a06ebc5aa8).(void) |
| 98 | { |
| 99 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "usage: mirror [options]\n"); |
| 100 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, " options:\n"); |
| 101 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, " -h, --help: Print this help text\n"); |
| 102 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, " -V, --version: Print version\n"); |
| 103 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, " -c, --config: Path to config file\n"); |
| 104 | |
| 105 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_SUCCESScxx . . $ `<external>/10696550936717951914/stdlib.h:93:9`!); |
| 106 | } |
| 107 | |
| 108 | static void print_version_and_diecxx . . $ print_version_and_die(49f6e7a06ebc5aa8).(void) |
| 109 | { |
| 110 | printfcxx . . $ printf(581fddd72a8db8fc).("mirror: version \"%s\"\n", VERSIONcxx . . $ `build/app_config.h:10:9`!); |
| 111 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_SUCCESScxx . . $ `<external>/10696550936717951914/stdlib.h:93:9`!); |
| 112 | } |
| 113 | |
| 114 | int maincxx . . $ main(afcd3168fc1188a4).(int argc, char *argv[]) |
| 115 | { |
| 116 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! enable_tx_latency_logging = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; |
| 117 | const char *config_file = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 118 | int c, ret; |
| 119 | |
| 120 | while ((c = getopt_longcxx . . $ getopt_long(41f665c090816971).(argc, argv, "c:hV", long_optionscxx . . $ long_options., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)) != -1) { |
| 121 | switch (c) { |
| 122 | case 'V': |
| 123 | print_version_and_diecxx . . $ print_version_and_die(49f6e7a06ebc5aa8).(); |
| 124 | break; |
| 125 | case 'c': |
| 126 | config_file = optargcxx . . $ optarg.; |
| 127 | break; |
| 128 | case 'h': |
| 129 | default: |
| 130 | print_usage_and_diecxx . . $ print_usage_and_die(49f6e7a06ebc5aa8).(); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | /* |
| 135 | * The "mirror" application only mirrors traffic and never generate frames itself. Make |
| 136 | * sure, the corresponding options are set. |
| 137 | * |
| 138 | * Note: The user cannot override this. |
| 139 | */ |
| 140 | ret = config_set_defaultscxx . . $ config_set_defaults(73da94e76e6bd037).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!); |
| 141 | if (ret) { |
| 142 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to set default config values!\n"); |
| 143 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 144 | } |
| 145 | |
| 146 | if (!config_file) { |
| 147 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Specifying an configuration file is mandatory. See tests/ " |
| 148 | "directory for examples!\n"); |
| 149 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 150 | } |
| 151 | |
| 152 | ret = config_read_from_filecxx . . $ config_read_from_file(5c4306d8553b3696).(config_file); |
| 153 | if (ret) { |
| 154 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to parse configuration file!\n"); |
| 155 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 156 | } |
| 157 | |
| 158 | config_print_valuescxx . . $ config_print_values(49f6e7a06ebc5aa8).(); |
| 159 | |
| 160 | if (!config_sanity_checkcxx . . $ config_sanity_check(c9857a73d68e59ba).()) { |
| 161 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Configuration failed sanity checks!\n"); |
| 162 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 163 | } |
| 164 | |
| 165 | if (mlockallcxx . . $ mlockall(7864480464b09eea).(MCL_CURRENTcxx . . $ `<external>/17226767460805440860/mman-linux.h:131:10`! | MCL_FUTUREcxx . . $ `<external>/17226767460805440860/mman-linux.h:132:10`!)) { |
| 166 | perrorcxx . . $ perror(85c52e162fed56f9).("mlockall() failed"); |
| 167 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 168 | } |
| 169 | |
| 170 | configure_cpu_latencycxx . . $ configure_cpu_latency(49f6e7a06ebc5aa8).(); |
| 171 | |
| 172 | setup_signalscxx . . $ setup_signals(49f6e7a06ebc5aa8).(); |
| 173 | |
| 174 | ret = log_initcxx . . $ log_init(b126dc7c1de90089).(); |
| 175 | if (ret) { |
| 176 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to initialize logging!\n"); |
| 177 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 178 | } |
| 179 | |
| 180 | for (int i = 0; i < NUM_FRAME_TYPEScxx . . $ NUM_FRAME_TYPES.; i++) { |
| 181 | if (app_configcxx . . $ app_config..classescxx . . $ application_config#classes.[i].tx_hwtstamp_enabledcxx . . $ traffic_class_config#tx_hwtstamp_enabled.) { |
| 182 | enable_tx_latency_logging = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 183 | break; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | if (enable_tx_latency_logging) { |
| 188 | ret = stat_initcxx . . $ stat_init(227e9c8ece8b273d).(LOG_TX_TIMESTAMPScxx . . $ LOG_TX_TIMESTAMPS.); |
| 189 | } else { |
| 190 | ret = stat_initcxx . . $ stat_init(227e9c8ece8b273d).(LOG_MIRRORcxx . . $ LOG_MIRROR.); |
| 191 | } |
| 192 | |
| 193 | if (ret) { |
| 194 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to initialize statistics!\n"); |
| 195 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 196 | } |
| 197 | |
| 198 | log_threadcxx . . $ log_thread. = log_thread_createcxx . . $ log_thread_create(3ed95045a9d7f639).(); |
| 199 | if (!log_threadcxx . . $ log_thread.) { |
| 200 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start Log Thread!\n"); |
| 201 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 202 | } |
| 203 | |
| 204 | log_mqtt_threadcxx . . $ log_mqtt_thread. = log_mqtt_thread_createcxx . . $ log_mqtt_thread_create(d1742bcb97fb8079).(); |
| 205 | if (!log_mqtt_threadcxx . . $ log_mqtt_thread. && app_configcxx . . $ app_config..log_mqttcxx . . $ application_config#log_mqtt.) { |
| 206 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start Log via MQTT Thread!\n"); |
| 207 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 208 | } |
| 209 | |
| 210 | log_json_threadcxx . . $ log_json_thread. = log_json_thread_createcxx . . $ log_json_thread_create(28a00b00e83b43e2).(); |
| 211 | if (!log_json_threadcxx . . $ log_json_thread. && app_configcxx . . $ app_config..log_jsoncxx . . $ application_config#log_json.) { |
| 212 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start Log via JSON Thread!\n"); |
| 213 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 214 | } |
| 215 | |
| 216 | g2_threadscxx . . $ g2_threads. = generic_l2_threads_createcxx . . $ generic_l2_threads_create(cd031c27c2e2a5f2).(); |
| 217 | if (!g2_threadscxx . . $ g2_threads.) { |
| 218 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start Generic L2 Threads!\n"); |
| 219 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 220 | } |
| 221 | |
| 222 | threadscxx . . $ threads. = calloccxx . . $ calloc(63a7bf2941bfcd7a).(NUM_PN_THREAD_TYPEScxx . . $ NUM_PN_THREAD_TYPES., sizeof(struct thread_contextcxx . . $ thread_context#)); |
| 223 | if (!threadscxx . . $ threads.) { |
| 224 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to allocate PN threads!\n"); |
| 225 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 226 | } |
| 227 | |
| 228 | if (link_pn_threadscxx . . $ link_pn_threads(8542e1c024f3ff56).(threadscxx . . $ threads.)) { |
| 229 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to determine PN traffic classes order!\n"); |
| 230 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 231 | } |
| 232 | |
| 233 | ret = udp_low_threads_createcxx . . $ udp_low_threads_create(8542e1c024f3ff56).(&threadscxx . . $ threads.[UDP_LOW_THREADcxx . . $ UDP_LOW_THREAD.]); |
| 234 | if (ret) { |
| 235 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start UDP Low Threads!\n"); |
| 236 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 237 | } |
| 238 | |
| 239 | ret = udp_high_threads_createcxx . . $ udp_high_threads_create(8542e1c024f3ff56).(&threadscxx . . $ threads.[UDP_HIGH_THREADcxx . . $ UDP_HIGH_THREAD.]); |
| 240 | if (ret) { |
| 241 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start UDP High Threads!\n"); |
| 242 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 243 | } |
| 244 | |
| 245 | ret = lldp_threads_createcxx . . $ lldp_threads_create(8542e1c024f3ff56).(&threadscxx . . $ threads.[LLDP_THREADcxx . . $ LLDP_THREAD.]); |
| 246 | if (ret) { |
| 247 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start LLDP Threads!\n"); |
| 248 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 249 | } |
| 250 | |
| 251 | ret = dcp_threads_createcxx . . $ dcp_threads_create(8542e1c024f3ff56).(&threadscxx . . $ threads.[DCP_THREADcxx . . $ DCP_THREAD.]); |
| 252 | if (ret) { |
| 253 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start DCP Threads!\n"); |
| 254 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 255 | } |
| 256 | |
| 257 | ret = rta_threads_createcxx . . $ rta_threads_create(8542e1c024f3ff56).(&threadscxx . . $ threads.[RTA_THREADcxx . . $ RTA_THREAD.]); |
| 258 | if (ret) { |
| 259 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start RTA Threads!\n"); |
| 260 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 261 | } |
| 262 | |
| 263 | ret = rtc_threads_createcxx . . $ rtc_threads_create(8542e1c024f3ff56).(&threadscxx . . $ threads.[RTC_THREADcxx . . $ RTC_THREAD.]); |
| 264 | if (ret) { |
| 265 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start RTC Threads!\n"); |
| 266 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 267 | } |
| 268 | |
| 269 | ret = tsn_low_threads_createcxx . . $ tsn_low_threads_create(8542e1c024f3ff56).(&threadscxx . . $ threads.[TSN_LOW_THREADcxx . . $ TSN_LOW_THREAD.]); |
| 270 | if (ret) { |
| 271 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start TSN Low Threads!\n"); |
| 272 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 273 | } |
| 274 | |
| 275 | ret = tsn_high_threads_createcxx . . $ tsn_high_threads_create(8542e1c024f3ff56).(&threadscxx . . $ threads.[TSN_HIGH_THREADcxx . . $ TSN_HIGH_THREAD.]); |
| 276 | if (ret) { |
| 277 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Failed to create and start TSN High Threads!\n"); |
| 278 | exitcxx . . $ exit(3ca292c338df9bb3).(EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!); |
| 279 | } |
| 280 | |
| 281 | print_statscxx . . $ print_stats(49f6e7a06ebc5aa8).(); |
| 282 | |
| 283 | tsn_high_threads_wait_for_finishcxx . . $ tsn_high_threads_wait_for_finish(f7c2ab51214b7176).(&threadscxx . . $ threads.[TSN_HIGH_THREADcxx . . $ TSN_HIGH_THREAD.]); |
| 284 | tsn_low_threads_wait_for_finishcxx . . $ tsn_low_threads_wait_for_finish(f7c2ab51214b7176).(&threadscxx . . $ threads.[TSN_LOW_THREADcxx . . $ TSN_LOW_THREAD.]); |
| 285 | rtc_threads_wait_for_finishcxx . . $ rtc_threads_wait_for_finish(f7c2ab51214b7176).(&threadscxx . . $ threads.[RTC_THREADcxx . . $ RTC_THREAD.]); |
| 286 | rta_threads_wait_for_finishcxx . . $ rta_threads_wait_for_finish(f7c2ab51214b7176).(&threadscxx . . $ threads.[RTA_THREADcxx . . $ RTA_THREAD.]); |
| 287 | dcp_threads_wait_for_finishcxx . . $ dcp_threads_wait_for_finish(f7c2ab51214b7176).(&threadscxx . . $ threads.[DCP_THREADcxx . . $ DCP_THREAD.]); |
| 288 | lldp_threads_wait_for_finishcxx . . $ lldp_threads_wait_for_finish(f7c2ab51214b7176).(&threadscxx . . $ threads.[LLDP_THREADcxx . . $ LLDP_THREAD.]); |
| 289 | udp_high_threads_wait_for_finishcxx . . $ udp_high_threads_wait_for_finish(f7c2ab51214b7176).(&threadscxx . . $ threads.[UDP_HIGH_THREADcxx . . $ UDP_HIGH_THREAD.]); |
| 290 | udp_low_threads_wait_for_finishcxx . . $ udp_low_threads_wait_for_finish(f7c2ab51214b7176).(&threadscxx . . $ threads.[UDP_LOW_THREADcxx . . $ UDP_LOW_THREAD.]); |
| 291 | generic_l2_threads_wait_for_finishcxx . . $ generic_l2_threads_wait_for_finish(f7c2ab51214b7176).(g2_threadscxx . . $ g2_threads.); |
| 292 | log_mqtt_thread_wait_for_finishcxx . . $ log_mqtt_thread_wait_for_finish(a4813b9bbab39343).(log_mqtt_threadcxx . . $ log_mqtt_thread.); |
| 293 | log_json_thread_wait_for_finishcxx . . $ log_json_thread_wait_for_finish(804bb534ff7495b0).(log_json_threadcxx . . $ log_json_thread.); |
| 294 | log_thread_wait_for_finishcxx . . $ log_thread_wait_for_finish(5f50a2fc789db767).(log_threadcxx . . $ log_thread.); |
| 295 | |
| 296 | tsn_high_threads_freecxx . . $ tsn_high_threads_free(f7c2ab51214b7176).(&threadscxx . . $ threads.[TSN_HIGH_THREADcxx . . $ TSN_HIGH_THREAD.]); |
| 297 | tsn_low_threads_freecxx . . $ tsn_low_threads_free(f7c2ab51214b7176).(&threadscxx . . $ threads.[TSN_LOW_THREADcxx . . $ TSN_LOW_THREAD.]); |
| 298 | rtc_threads_freecxx . . $ rtc_threads_free(f7c2ab51214b7176).(&threadscxx . . $ threads.[RTC_THREADcxx . . $ RTC_THREAD.]); |
| 299 | rta_threads_freecxx . . $ rta_threads_free(f7c2ab51214b7176).(&threadscxx . . $ threads.[RTA_THREADcxx . . $ RTA_THREAD.]); |
| 300 | dcp_threads_freecxx . . $ dcp_threads_free(f7c2ab51214b7176).(&threadscxx . . $ threads.[DCP_THREADcxx . . $ DCP_THREAD.]); |
| 301 | lldp_threads_freecxx . . $ lldp_threads_free(f7c2ab51214b7176).(&threadscxx . . $ threads.[LLDP_THREADcxx . . $ LLDP_THREAD.]); |
| 302 | udp_high_threads_freecxx . . $ udp_high_threads_free(f7c2ab51214b7176).(&threadscxx . . $ threads.[UDP_HIGH_THREADcxx . . $ UDP_HIGH_THREAD.]); |
| 303 | udp_low_threads_freecxx . . $ udp_low_threads_free(f7c2ab51214b7176).(&threadscxx . . $ threads.[UDP_LOW_THREADcxx . . $ UDP_LOW_THREAD.]); |
| 304 | generic_l2_threads_freecxx . . $ generic_l2_threads_free(f7c2ab51214b7176).(g2_threadscxx . . $ g2_threads.); |
| 305 | log_mqtt_thread_freecxx . . $ log_mqtt_thread_free(a4813b9bbab39343).(log_mqtt_threadcxx . . $ log_mqtt_thread.); |
| 306 | log_json_thread_freecxx . . $ log_json_thread_free(804bb534ff7495b0).(log_json_threadcxx . . $ log_json_thread.); |
| 307 | log_thread_freecxx . . $ log_thread_free(5f50a2fc789db767).(log_threadcxx . . $ log_thread.); |
| 308 | |
| 309 | stat_freecxx . . $ stat_free(49f6e7a06ebc5aa8).(); |
| 310 | log_freecxx . . $ log_free(49f6e7a06ebc5aa8).(); |
| 311 | config_freecxx . . $ config_free(49f6e7a06ebc5aa8).(); |
| 312 | freecxx . . $ free(5d22bdacc48458e8).(threadscxx . . $ threads.); |
| 313 | |
| 314 | restore_cpu_latencycxx . . $ restore_cpu_latency(49f6e7a06ebc5aa8).(); |
| 315 | |
| 316 | return EXIT_SUCCESScxx . . $ `<external>/10696550936717951914/stdlib.h:93:9`!; |
| 317 | } |