• Home
  • Raw
  • Download

Lines Matching refs:attrs

267 struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, struct nlattr *attrs[],  in dn_fib_create_info()  argument
281 if (attrs[RTA_MULTIPATH] && in dn_fib_create_info()
282 (nhs = dn_fib_count_nhs(attrs[RTA_MULTIPATH])) == 0) in dn_fib_create_info()
294 if (attrs[RTA_PRIORITY]) in dn_fib_create_info()
295 fi->fib_priority = nla_get_u32(attrs[RTA_PRIORITY]); in dn_fib_create_info()
297 if (attrs[RTA_METRICS]) { in dn_fib_create_info()
301 nla_for_each_nested(attr, attrs[RTA_METRICS], rem) { in dn_fib_create_info()
314 if (attrs[RTA_PREFSRC]) in dn_fib_create_info()
315 fi->fib_prefsrc = nla_get_le16(attrs[RTA_PREFSRC]); in dn_fib_create_info()
317 if (attrs[RTA_MULTIPATH]) { in dn_fib_create_info()
318 if ((err = dn_fib_get_nhs(fi, attrs[RTA_MULTIPATH], r)) != 0) in dn_fib_create_info()
321 if (attrs[RTA_OIF] && in dn_fib_create_info()
322 fi->fib_nh->nh_oif != nla_get_u32(attrs[RTA_OIF])) in dn_fib_create_info()
325 if (attrs[RTA_GATEWAY] && in dn_fib_create_info()
326 fi->fib_nh->nh_gw != nla_get_le16(attrs[RTA_GATEWAY])) in dn_fib_create_info()
331 if (attrs[RTA_OIF]) in dn_fib_create_info()
332 nh->nh_oif = nla_get_u32(attrs[RTA_OIF]); in dn_fib_create_info()
334 if (attrs[RTA_GATEWAY]) in dn_fib_create_info()
335 nh->nh_gw = nla_get_le16(attrs[RTA_GATEWAY]); in dn_fib_create_info()
342 if (!attrs[RTA_GATEWAY] || nhs != 1 || attrs[RTA_OIF]) in dn_fib_create_info()
345 fi->fib_nh->nh_gw = nla_get_le16(attrs[RTA_GATEWAY]); in dn_fib_create_info()
350 if (attrs[RTA_GATEWAY] || attrs[RTA_OIF] || attrs[RTA_MULTIPATH]) in dn_fib_create_info()
378 if (r->rtm_type != RTN_LOCAL || !attrs[RTA_DST] || in dn_fib_create_info()
379 fi->fib_prefsrc != nla_get_le16(attrs[RTA_DST])) in dn_fib_create_info()
497 static inline u32 rtm_get_table(struct nlattr *attrs[], u8 table) in rtm_get_table() argument
499 if (attrs[RTA_TABLE]) in rtm_get_table()
500 table = nla_get_u32(attrs[RTA_TABLE]); in rtm_get_table()
511 struct nlattr *attrs[RTA_MAX+1]; in dn_fib_rtm_delroute() local
520 err = nlmsg_parse(nlh, sizeof(*r), attrs, RTA_MAX, rtm_dn_policy, in dn_fib_rtm_delroute()
525 tb = dn_fib_get_table(rtm_get_table(attrs, r->rtm_table), 0); in dn_fib_rtm_delroute()
529 return tb->delete(tb, r, attrs, nlh, &NETLINK_CB(skb)); in dn_fib_rtm_delroute()
538 struct nlattr *attrs[RTA_MAX+1]; in dn_fib_rtm_newroute() local
547 err = nlmsg_parse(nlh, sizeof(*r), attrs, RTA_MAX, rtm_dn_policy, in dn_fib_rtm_newroute()
552 tb = dn_fib_get_table(rtm_get_table(attrs, r->rtm_table), 1); in dn_fib_rtm_newroute()
556 return tb->insert(tb, r, attrs, nlh, &NETLINK_CB(skb)); in dn_fib_rtm_newroute()
584 struct nlattr *attrs[RTA_MAX+1] = { in fib_magic() local
613 tb->insert(tb, &req.rtm, attrs, &req.nlh, NULL); in fib_magic()
615 tb->delete(tb, &req.rtm, attrs, &req.nlh, NULL); in fib_magic()