Add packet injector test frame

This commit is contained in:
luwenpeng
2024-05-15 11:40:00 +08:00
parent cda77c6f6f
commit b33dafff53
31 changed files with 458 additions and 140 deletions

View File

@@ -339,12 +339,12 @@ static int parse_cmdline(int argc, char **argv, struct inject_rule *rule)
printf("invalid count\n");
return -1;
}
printf("load inject rule:\n");
printf(" host : %s\n", host);
printf(" port : %d\n", ntohs(rule->port));
printf(" type : %s\n", type);
printf(" condition : %s\n", condition);
printf(" count : %lu\n\n", rule->count_num);
printf("%s load inject rule:\n", argv[0]);
printf(" host : %s\n", host);
printf(" port : %d\n", ntohs(rule->port));
printf(" type : %s\n", type);
printf(" condition : %s\n", condition);
printf(" count : %lu\n\n", rule->count_num);
return 0;
}
@@ -368,7 +368,6 @@ int main(int argc, char **argv)
STELLAR_LOG_ERROR("unable to init log");
goto error_out;
}
STELLAR_LOG_STATE("start stellar (version: %s)\n %s", __stellar_version, logo_str);
if (stellar_load_config(stellar_config_file, config) != 0)
{
@@ -427,6 +426,11 @@ int main(int argc, char **argv)
stellar_stat_output(runtime->stat);
}
usleep(1000); // 1ms
if (packet_io_wait_exit(runtime->packet_io))
{
ATOMIC_SET(&runtime->need_exit, 1);
}
}
error_out: