Lines Matching refs:freq
373 fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq, in fl_create() argument
381 olen = optlen - CMSG_ALIGN(sizeof(*freq)); in fl_create()
405 CMSG_ALIGN(sizeof(*freq)), olen)) in fl_create()
427 err = fl6_renew(fl, freq->flr_linger, freq->flr_expires); in fl_create()
430 fl->share = freq->flr_share; in fl_create()
431 addr_type = ipv6_addr_type(&freq->flr_dst); in fl_create()
437 fl->dst = freq->flr_dst; in fl_create()
502 int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq, in ipv6_flowlabel_opt_get() argument
509 freq->flr_label = np->rcv_flowinfo & IPV6_FLOWLABEL_MASK; in ipv6_flowlabel_opt_get()
514 freq->flr_label = np->flow_label; in ipv6_flowlabel_opt_get()
523 freq->flr_label = sfl->fl->label; in ipv6_flowlabel_opt_get()
524 freq->flr_dst = sfl->fl->dst; in ipv6_flowlabel_opt_get()
525 freq->flr_share = sfl->fl->share; in ipv6_flowlabel_opt_get()
526 freq->flr_expires = (sfl->fl->expires - jiffies) / HZ; in ipv6_flowlabel_opt_get()
527 freq->flr_linger = sfl->fl->linger / HZ; in ipv6_flowlabel_opt_get()
542 static int ipv6_flowlabel_put(struct sock *sk, struct in6_flowlabel_req *freq) in ipv6_flowlabel_put() argument
548 if (freq->flr_flags & IPV6_FL_F_REFLECT) { in ipv6_flowlabel_put()
562 if (sfl->fl->label == freq->flr_label) in ipv6_flowlabel_put()
568 if (freq->flr_label == (np->flow_label & IPV6_FLOWLABEL_MASK)) in ipv6_flowlabel_put()
577 static int ipv6_flowlabel_renew(struct sock *sk, struct in6_flowlabel_req *freq) in ipv6_flowlabel_renew() argument
586 if (sfl->fl->label == freq->flr_label) { in ipv6_flowlabel_renew()
587 err = fl6_renew(sfl->fl, freq->flr_linger, in ipv6_flowlabel_renew()
588 freq->flr_expires); in ipv6_flowlabel_renew()
595 if (freq->flr_share == IPV6_FL_S_NONE && in ipv6_flowlabel_renew()
597 struct ip6_flowlabel *fl = fl_lookup(net, freq->flr_label); in ipv6_flowlabel_renew()
600 err = fl6_renew(fl, freq->flr_linger, in ipv6_flowlabel_renew()
601 freq->flr_expires); in ipv6_flowlabel_renew()
609 static int ipv6_flowlabel_get(struct sock *sk, struct in6_flowlabel_req *freq, in ipv6_flowlabel_get() argument
618 if (freq->flr_flags & IPV6_FL_F_REFLECT) { in ipv6_flowlabel_get()
630 if (freq->flr_label & ~IPV6_FLOWLABEL_MASK) in ipv6_flowlabel_get()
633 (freq->flr_label & IPV6_FLOWLABEL_STATELESS_FLAG)) in ipv6_flowlabel_get()
636 fl = fl_create(net, sk, freq, optval, optlen, &err); in ipv6_flowlabel_get()
642 if (freq->flr_label) { in ipv6_flowlabel_get()
646 if (sfl->fl->label == freq->flr_label) { in ipv6_flowlabel_get()
647 if (freq->flr_flags & IPV6_FL_F_EXCL) { in ipv6_flowlabel_get()
660 fl1 = fl_lookup(net, freq->flr_label); in ipv6_flowlabel_get()
664 if (freq->flr_flags&IPV6_FL_F_EXCL) in ipv6_flowlabel_get()
692 if (!(freq->flr_flags & IPV6_FL_F_CREATE)) in ipv6_flowlabel_get()
703 fl1 = fl_intern(net, fl, freq->flr_label); in ipv6_flowlabel_get()
707 if (!freq->flr_label) { in ipv6_flowlabel_get()
726 struct in6_flowlabel_req freq; in ipv6_flowlabel_opt() local
728 if (optlen < sizeof(freq)) in ipv6_flowlabel_opt()
730 if (copy_from_sockptr(&freq, optval, sizeof(freq))) in ipv6_flowlabel_opt()
733 switch (freq.flr_action) { in ipv6_flowlabel_opt()
735 return ipv6_flowlabel_put(sk, &freq); in ipv6_flowlabel_opt()
737 return ipv6_flowlabel_renew(sk, &freq); in ipv6_flowlabel_opt()
739 return ipv6_flowlabel_get(sk, &freq, optval, optlen); in ipv6_flowlabel_opt()