Lines Matching refs:freq

376 fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq,  in fl_create()  argument
384 olen = optlen - CMSG_ALIGN(sizeof(*freq)); in fl_create()
408 CMSG_ALIGN(sizeof(*freq)), olen)) in fl_create()
430 err = fl6_renew(fl, freq->flr_linger, freq->flr_expires); in fl_create()
433 fl->share = freq->flr_share; in fl_create()
434 addr_type = ipv6_addr_type(&freq->flr_dst); in fl_create()
440 fl->dst = freq->flr_dst; in fl_create()
505 int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq, in ipv6_flowlabel_opt_get() argument
512 freq->flr_label = np->rcv_flowinfo & IPV6_FLOWLABEL_MASK; in ipv6_flowlabel_opt_get()
517 freq->flr_label = np->flow_label; in ipv6_flowlabel_opt_get()
526 freq->flr_label = sfl->fl->label; in ipv6_flowlabel_opt_get()
527 freq->flr_dst = sfl->fl->dst; in ipv6_flowlabel_opt_get()
528 freq->flr_share = sfl->fl->share; in ipv6_flowlabel_opt_get()
529 freq->flr_expires = (sfl->fl->expires - jiffies) / HZ; in ipv6_flowlabel_opt_get()
530 freq->flr_linger = sfl->fl->linger / HZ; in ipv6_flowlabel_opt_get()
545 static int ipv6_flowlabel_put(struct sock *sk, struct in6_flowlabel_req *freq) in ipv6_flowlabel_put() argument
551 if (freq->flr_flags & IPV6_FL_F_REFLECT) { in ipv6_flowlabel_put()
565 if (sfl->fl->label == freq->flr_label) in ipv6_flowlabel_put()
571 if (freq->flr_label == (np->flow_label & IPV6_FLOWLABEL_MASK)) in ipv6_flowlabel_put()
580 static int ipv6_flowlabel_renew(struct sock *sk, struct in6_flowlabel_req *freq) in ipv6_flowlabel_renew() argument
589 if (sfl->fl->label == freq->flr_label) { in ipv6_flowlabel_renew()
590 err = fl6_renew(sfl->fl, freq->flr_linger, in ipv6_flowlabel_renew()
591 freq->flr_expires); in ipv6_flowlabel_renew()
598 if (freq->flr_share == IPV6_FL_S_NONE && in ipv6_flowlabel_renew()
600 struct ip6_flowlabel *fl = fl_lookup(net, freq->flr_label); in ipv6_flowlabel_renew()
603 err = fl6_renew(fl, freq->flr_linger, in ipv6_flowlabel_renew()
604 freq->flr_expires); in ipv6_flowlabel_renew()
612 static int ipv6_flowlabel_get(struct sock *sk, struct in6_flowlabel_req *freq, in ipv6_flowlabel_get() argument
621 if (freq->flr_flags & IPV6_FL_F_REFLECT) { in ipv6_flowlabel_get()
633 if (freq->flr_label & ~IPV6_FLOWLABEL_MASK) in ipv6_flowlabel_get()
636 (freq->flr_label & IPV6_FLOWLABEL_STATELESS_FLAG)) in ipv6_flowlabel_get()
639 fl = fl_create(net, sk, freq, optval, optlen, &err); in ipv6_flowlabel_get()
645 if (freq->flr_label) { in ipv6_flowlabel_get()
649 if (sfl->fl->label == freq->flr_label) { in ipv6_flowlabel_get()
650 if (freq->flr_flags & IPV6_FL_F_EXCL) { in ipv6_flowlabel_get()
663 fl1 = fl_lookup(net, freq->flr_label); in ipv6_flowlabel_get()
667 if (freq->flr_flags&IPV6_FL_F_EXCL) in ipv6_flowlabel_get()
695 if (!(freq->flr_flags & IPV6_FL_F_CREATE)) in ipv6_flowlabel_get()
706 fl1 = fl_intern(net, fl, freq->flr_label); in ipv6_flowlabel_get()
710 if (!freq->flr_label) { in ipv6_flowlabel_get()
729 struct in6_flowlabel_req freq; in ipv6_flowlabel_opt() local
731 if (optlen < sizeof(freq)) in ipv6_flowlabel_opt()
733 if (copy_from_sockptr(&freq, optval, sizeof(freq))) in ipv6_flowlabel_opt()
736 switch (freq.flr_action) { in ipv6_flowlabel_opt()
738 return ipv6_flowlabel_put(sk, &freq); in ipv6_flowlabel_opt()
740 return ipv6_flowlabel_renew(sk, &freq); in ipv6_flowlabel_opt()
742 return ipv6_flowlabel_get(sk, &freq, optval, optlen); in ipv6_flowlabel_opt()