20class TCOptions :
public CompilerOptions {
23 std::filesystem::path outputFolder;
26 bool emitTraceMessages =
false;
28 enum XDP2TC xdp2tcMode = XDP2TC_META;
29 unsigned timerProfiles = 4;
33 "-o",
"output Directory",
34 [
this](
const char *arg) {
38 "Write pipeline template, introspection json and C output to given directory");
41 [
this](
const char *) {
45 "Generates debug information");
48 [
this](
const char *) {
49 emitTraceMessages =
true;
52 "Generate tracing messages of packet processing");
55 [
this](
const char *arg) {
56 if (!strcmp(arg,
"meta")) {
57 xdp2tcMode = XDP2TC_META;
58 }
else if (!strcmp(arg,
"head")) {
59 xdp2tcMode = XDP2TC_HEAD;
60 }
else if (!strcmp(arg,
"cpumap")) {
61 xdp2tcMode = XDP2TC_CPUMAP;
64 "Unknown --xdp2tc mode '%1%'; expected one of: meta, head, "
71 "Select the mode used to pass metadata from XDP to TC "
72 "(possible values: meta, head, cpumap).");
74 "--num-timer-profiles",
"profiles",
75 [
this](
const char *arg) {
77 long value = strtol(arg, &end, 0);
78 if (*end != 0 || value <= 0 ||
79 static_cast<unsigned long>(value) >
80 static_cast<unsigned long>(std::numeric_limits<unsigned>::max())) {
82 "--num-timer-profiles expects a positive integer, got '%1%'", arg);
85 timerProfiles =
static_cast<unsigned>(value);
88 "Defines the number of timer profiles. Default is 4.");
Definition parser_options.h:174
void error(const char *format, Args &&...args)
Report an error with the given message.
Definition lib/error.h:48