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

Function parse_rt_6

dpdk/app/test-fib/main.c:505–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505static int
506parse_rt_6(FILE *f)
507{
508 int ret, i, j = 0;
509 char *s, *sp, *in[RT_NUM];
510 static const char *dlm = " \t\n";
511 int string_tok_nb = RTE_DIM(in);
512 struct rt_rule_6 *rt;
513
514 rt = (struct rt_rule_6 *)config.rt;
515
516 while (fgets(line, sizeof(line), f) != NULL) {
517 s = line;
518 for (i = 0; i != string_tok_nb; i++) {
519 in[i] = strtok_r(s, dlm, &sp);
520 if (in[i] == NULL)
521 return -EINVAL;
522 s = NULL;
523 }
524
525 ret = _inet_net_pton(AF_INET6, in[RT_PREFIX], rt[j].addr);
526 if (ret < 0)
527 return ret;
528
529 rt[j].depth = ret;
530 config.nb_routes_per_depth[ret]++;
531 GET_CB_FIELD(in[RT_NEXTHOP], rt[j].nh, 0,
532 UINT32_MAX, 0);
533 j++;
534 }
535
536 return 0;
537}
538
539static int
540parse_lookup(FILE *f, int af)

Callers 1

mainFunction · 0.85

Calls 1

_inet_net_ptonFunction · 0.85

Tested by

no test coverage detected