MCPcopy Create free account
hub / github.com/F-Stack/f-stack / l2fwd_crypto_parse_timer_period

Function l2fwd_crypto_parse_timer_period

dpdk/examples/l2fwd-crypto/main.c:1445–1467  ·  view source on GitHub ↗

Parse timer period */

Source from the content-addressed store, hash-verified

1443
1444/** Parse timer period */
1445static int
1446l2fwd_crypto_parse_timer_period(struct l2fwd_crypto_options *options,
1447 const char *q_arg)
1448{
1449 char *end = NULL;
1450 unsigned long n;
1451
1452 /* parse number string */
1453 n = (unsigned)strtol(q_arg, &end, 10);
1454 if ((q_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
1455 n = 0;
1456
1457 if (n >= MAX_TIMER_PERIOD) {
1458 printf("Warning refresh period specified %lu is greater than "
1459 "max value %lu! using max value",
1460 n, MAX_TIMER_PERIOD);
1461 n = MAX_TIMER_PERIOD;
1462 }
1463
1464 options->refresh_period = n * 1000 * TIMER_MILLISECOND;
1465
1466 return 0;
1467}
1468
1469/** Generate default options for application */
1470static void

Callers 1

l2fwd_crypto_parse_argsFunction · 0.85

Calls 2

strtolFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected