Lines Matching refs:cfg

351 				 struct fib_config *cfg)
356 memset(cfg, 0, sizeof(*cfg));
357 cfg->fc_nlinfo.nl_net = net;
386 cfg->fc_dst_len = plen;
387 cfg->fc_dst = addr;
390 cfg->fc_nlflags = NLM_F_CREATE;
391 cfg->fc_protocol = RTPROT_BOOT;
395 cfg->fc_priority = rt->rt_metric - 1;
398 cfg->fc_scope = RT_SCOPE_HOST;
399 cfg->fc_type = RTN_UNREACHABLE;
403 cfg->fc_scope = RT_SCOPE_NOWHERE;
404 cfg->fc_type = RTN_UNICAST;
421 cfg->fc_oif = dev->ifindex;
433 cfg->fc_prefsrc = ifa->ifa_local;
439 cfg->fc_gw = addr;
442 cfg->fc_scope = RT_SCOPE_UNIVERSE;
448 if (rt->rt_flags & RTF_GATEWAY && !cfg->fc_gw)
451 if (cfg->fc_scope == RT_SCOPE_NOWHERE)
452 cfg->fc_scope = RT_SCOPE_LINK;
471 cfg->fc_mx = mx;
472 cfg->fc_mx_len = len;
484 struct fib_config cfg;
498 err = rtentry_to_fib_config(net, cmd, &rt, &cfg);
503 tb = fib_get_table(net, cfg.fc_table);
505 err = fib_table_delete(tb, &cfg);
509 tb = fib_new_table(net, cfg.fc_table);
511 err = fib_table_insert(tb, &cfg);
517 kfree(cfg.fc_mx);
540 struct nlmsghdr *nlh, struct fib_config *cfg)
550 memset(cfg, 0, sizeof(*cfg));
553 cfg->fc_dst_len = rtm->rtm_dst_len;
554 cfg->fc_tos = rtm->rtm_tos;
555 cfg->fc_table = rtm->rtm_table;
556 cfg->fc_protocol = rtm->rtm_protocol;
557 cfg->fc_scope = rtm->rtm_scope;
558 cfg->fc_type = rtm->rtm_type;
559 cfg->fc_flags = rtm->rtm_flags;
560 cfg->fc_nlflags = nlh->nlmsg_flags;
562 cfg->fc_nlinfo.portid = NETLINK_CB(skb).portid;
563 cfg->fc_nlinfo.nlh = nlh;
564 cfg->fc_nlinfo.nl_net = net;
566 if (cfg->fc_type > RTN_MAX) {
574 cfg->fc_dst = nla_get_be32(attr);
577 cfg->fc_oif = nla_get_u32(attr);
580 cfg->fc_gw = nla_get_be32(attr);
583 cfg->fc_priority = nla_get_u32(attr);
586 cfg->fc_prefsrc = nla_get_be32(attr);
589 cfg->fc_mx = nla_data(attr);
590 cfg->fc_mx_len = nla_len(attr);
593 cfg->fc_mp = nla_data(attr);
594 cfg->fc_mp_len = nla_len(attr);
597 cfg->fc_flow = nla_get_u32(attr);
600 cfg->fc_table = nla_get_u32(attr);
613 struct fib_config cfg;
617 err = rtm_to_fib_config(net, skb, nlh, &cfg);
621 tb = fib_get_table(net, cfg.fc_table);
627 err = fib_table_delete(tb, &cfg);
635 struct fib_config cfg;
639 err = rtm_to_fib_config(net, skb, nlh, &cfg);
643 tb = fib_new_table(net, cfg.fc_table);
649 err = fib_table_insert(tb, &cfg);
703 struct fib_config cfg = {
724 cfg.fc_table = tb->tb_id;
727 cfg.fc_scope = RT_SCOPE_LINK;
729 cfg.fc_scope = RT_SCOPE_HOST;
732 fib_table_insert(tb, &cfg);
734 fib_table_delete(tb, &cfg);
984 struct netlink_kernel_cfg cfg = {
988 sk = netlink_kernel_create(net, NETLINK_FIB_LOOKUP, &cfg);