| 1154 | |
| 1155 | |
| 1156 | static void |
| 1157 | print_usage(const char *prgname) |
| 1158 | { |
| 1159 | uint32_t i, n, rc; |
| 1160 | char buf[PATH_MAX]; |
| 1161 | |
| 1162 | n = 0; |
| 1163 | buf[0] = 0; |
| 1164 | |
| 1165 | for (i = 0; i < RTE_DIM(acl_alg) - 1; i++) { |
| 1166 | rc = snprintf(buf + n, sizeof(buf) - n, "%s|", |
| 1167 | acl_alg[i].name); |
| 1168 | if (rc > sizeof(buf) - n) |
| 1169 | break; |
| 1170 | n += rc; |
| 1171 | } |
| 1172 | |
| 1173 | strlcpy(buf + n, acl_alg[i].name, sizeof(buf) - n); |
| 1174 | |
| 1175 | fprintf(stdout, |
| 1176 | PRINT_USAGE_START |
| 1177 | "--" OPT_RULE_FILE "=<rules set file>\n" |
| 1178 | "[--" OPT_TRACE_FILE "=<input traces file>]\n" |
| 1179 | "[--" OPT_RULE_NUM |
| 1180 | "=<maximum number of rules for ACL context>]\n" |
| 1181 | "[--" OPT_TRACE_NUM |
| 1182 | "=<number of traces to read binary file in>]\n" |
| 1183 | "[--" OPT_TRACE_STEP |
| 1184 | "=<number of traces to classify per one call>]\n" |
| 1185 | "[--" OPT_BLD_CATEGORIES |
| 1186 | "=<number of categories to build with>]\n" |
| 1187 | "[--" OPT_RUN_CATEGORIES |
| 1188 | "=<number of categories to run with> " |
| 1189 | "should be either 1 or multiple of %zu, " |
| 1190 | "but not greater then %u]\n" |
| 1191 | "[--" OPT_MAX_SIZE |
| 1192 | "=<size limit (in bytes) for runtime ACL structures> " |
| 1193 | "leave 0 for default behaviour]\n" |
| 1194 | "[--" OPT_ITER_NUM "=<number of iterations to perform>]\n" |
| 1195 | "[--" OPT_VERBOSE "=<verbose level>]\n" |
| 1196 | "[--" OPT_SEARCH_ALG "=%s]\n" |
| 1197 | "[--" OPT_IPV6 "(=4B | 8B) <IPv6 rules and trace files>]\n", |
| 1198 | prgname, RTE_ACL_RESULTS_MULTIPLIER, |
| 1199 | (uint32_t)RTE_ACL_MAX_CATEGORIES, |
| 1200 | buf); |
| 1201 | } |
| 1202 | |
| 1203 | static void |
| 1204 | dump_config(FILE *f) |
no test coverage detected