Lines Matching refs:fou

24 struct fou {  struct
51 static inline struct fou *fou_from_sock(struct sock *sk) in fou_from_sock() argument
56 static int fou_recv_pull(struct sk_buff *skb, struct fou *fou, size_t len) in fou_recv_pull() argument
61 if (fou->family == AF_INET) in fou_recv_pull()
75 struct fou *fou = fou_from_sock(sk); in fou_udp_recv() local
77 if (!fou) in fou_udp_recv()
80 if (fou_recv_pull(skb, fou, sizeof(struct udphdr))) in fou_udp_recv()
83 return -fou->protocol; in fou_udp_recv()
122 struct fou *fou = fou_from_sock(sk); in gue_udp_recv() local
129 if (!fou) in gue_udp_recv()
158 if (fou_recv_pull(skb, fou, sizeof(struct udphdr))) in gue_udp_recv()
182 if (fou->family == AF_INET) in gue_udp_recv()
203 !!(fou->flags & in gue_udp_recv()
248 struct fou *fou = fou_from_sock(sk); in fou_gro_receive() local
252 if (!fou) in fou_gro_receive()
266 ops = fou_gro_ops(sk, fou->protocol); in fou_gro_receive()
279 struct fou *fou = fou_from_sock(sk); in fou_gro_complete() local
283 if (!fou) { in fou_gro_complete()
288 ops = fou_gro_ops(sk, fou->protocol); in fou_gro_complete()
337 struct fou *fou = fou_from_sock(sk); in gue_gro_receive() local
343 if (!fou) in gue_gro_receive()
402 !!(fou->flags & in gue_gro_receive()
509 static bool fou_cfg_cmp(struct fou *fou, struct fou_cfg *cfg) in fou_cfg_cmp() argument
511 struct sock *sk = fou->sock->sk; in fou_cfg_cmp()
514 if (fou->family != udp_cfg->family || in fou_cfg_cmp()
515 fou->port != udp_cfg->local_udp_port || in fou_cfg_cmp()
520 if (fou->family == AF_INET) { in fou_cfg_cmp()
539 static int fou_add_to_port_list(struct net *net, struct fou *fou, in fou_add_to_port_list() argument
543 struct fou *fout; in fou_add_to_port_list()
553 list_add(&fou->list, &fn->fou_list); in fou_add_to_port_list()
559 static void fou_release(struct fou *fou) in fou_release() argument
561 struct socket *sock = fou->sock; in fou_release()
563 list_del(&fou->list); in fou_release()
566 kfree_rcu(fou, rcu); in fou_release()
573 struct fou *fou = NULL; in fou_create() local
584 fou = kzalloc_obj(*fou); in fou_create()
585 if (!fou) { in fou_create()
592 fou->port = cfg->udp_config.local_udp_port; in fou_create()
593 fou->family = cfg->udp_config.family; in fou_create()
594 fou->flags = cfg->flags; in fou_create()
595 fou->type = cfg->type; in fou_create()
596 fou->sock = sock; in fou_create()
600 tunnel_cfg.sk_user_data = fou; in fou_create()
609 fou->protocol = cfg->protocol; in fou_create()
625 err = fou_add_to_port_list(net, fou, cfg); in fou_create()
635 kfree(fou); in fou_create()
646 struct fou *fou; in fou_destroy() local
649 list_for_each_entry(fou, &fn->fou_list, list) { in fou_destroy()
650 if (fou_cfg_cmp(fou, cfg)) { in fou_destroy()
651 fou_release(fou); in fou_destroy()
780 static int fou_fill_info(struct fou *fou, struct sk_buff *msg) in fou_fill_info() argument
782 struct sock *sk = fou->sock->sk; in fou_fill_info()
784 if (nla_put_u8(msg, FOU_ATTR_AF, fou->sock->sk->sk_family) || in fou_fill_info()
785 nla_put_be16(msg, FOU_ATTR_PORT, fou->port) || in fou_fill_info()
787 nla_put_u8(msg, FOU_ATTR_IPPROTO, fou->protocol) || in fou_fill_info()
788 nla_put_u8(msg, FOU_ATTR_TYPE, fou->type) || in fou_fill_info()
792 if (fou->flags & FOU_F_REMCSUM_NOPARTIAL) in fou_fill_info()
796 if (fou->sock->sk->sk_family == AF_INET) { in fou_fill_info()
816 static int fou_dump_info(struct fou *fou, u32 portid, u32 seq, in fou_dump_info() argument
825 if (fou_fill_info(fou, skb) < 0) in fou_dump_info()
842 struct fou *fout; in fou_nl_get_doit()
887 struct fou *fout; in fou_nl_get_dumpit()
1229 struct fou *fou, *next; in fou_exit_net() local
1233 list_for_each_entry_safe(fou, next, &fn->fou_list, list) in fou_exit_net()
1234 fou_release(fou); in fou_exit_net()