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()
236 struct fou *fou = fou_from_sock(sk); in fou_gro_receive() local
241 if (!fou) in fou_gro_receive()
244 proto = fou->protocol; in fou_gro_receive()
272 struct fou *fou = fou_from_sock(sk); in fou_gro_complete() local
277 if (!fou) { in fou_gro_complete()
282 proto = fou->protocol; in fou_gro_complete()
335 struct fou *fou = fou_from_sock(sk); in gue_gro_receive() local
341 if (!fou) in gue_gro_receive()
400 !!(fou->flags & in gue_gro_receive()
510 static bool fou_cfg_cmp(struct fou *fou, struct fou_cfg *cfg) in fou_cfg_cmp() argument
512 struct sock *sk = fou->sock->sk; in fou_cfg_cmp()
515 if (fou->family != udp_cfg->family || in fou_cfg_cmp()
516 fou->port != udp_cfg->local_udp_port || in fou_cfg_cmp()
521 if (fou->family == AF_INET) { in fou_cfg_cmp()
540 static int fou_add_to_port_list(struct net *net, struct fou *fou, in fou_add_to_port_list() argument
544 struct fou *fout; in fou_add_to_port_list()
554 list_add(&fou->list, &fn->fou_list); in fou_add_to_port_list()
560 static void fou_release(struct fou *fou) in fou_release() argument
562 struct socket *sock = fou->sock; in fou_release()
564 list_del(&fou->list); in fou_release()
567 kfree_rcu(fou, rcu); in fou_release()
574 struct fou *fou = NULL; in fou_create() local
585 fou = kzalloc(sizeof(*fou), GFP_KERNEL); in fou_create()
586 if (!fou) { in fou_create()
593 fou->port = cfg->udp_config.local_udp_port; in fou_create()
594 fou->family = cfg->udp_config.family; in fou_create()
595 fou->flags = cfg->flags; in fou_create()
596 fou->type = cfg->type; in fou_create()
597 fou->sock = sock; in fou_create()
601 tunnel_cfg.sk_user_data = fou; in fou_create()
610 fou->protocol = cfg->protocol; in fou_create()
626 err = fou_add_to_port_list(net, fou, cfg); in fou_create()
636 kfree(fou); in fou_create()
647 struct fou *fou; in fou_destroy() local
650 list_for_each_entry(fou, &fn->fou_list, list) { in fou_destroy()
651 if (fou_cfg_cmp(fou, cfg)) { in fou_destroy()
652 fou_release(fou); in fou_destroy()
781 static int fou_fill_info(struct fou *fou, struct sk_buff *msg) in fou_fill_info() argument
783 struct sock *sk = fou->sock->sk; in fou_fill_info()
785 if (nla_put_u8(msg, FOU_ATTR_AF, fou->sock->sk->sk_family) || in fou_fill_info()
786 nla_put_be16(msg, FOU_ATTR_PORT, fou->port) || in fou_fill_info()
788 nla_put_u8(msg, FOU_ATTR_IPPROTO, fou->protocol) || in fou_fill_info()
789 nla_put_u8(msg, FOU_ATTR_TYPE, fou->type) || in fou_fill_info()
793 if (fou->flags & FOU_F_REMCSUM_NOPARTIAL) in fou_fill_info()
797 if (fou->sock->sk->sk_family == AF_INET) { in fou_fill_info()
817 static int fou_dump_info(struct fou *fou, u32 portid, u32 seq, in fou_dump_info() argument
826 if (fou_fill_info(fou, skb) < 0) in fou_dump_info()
843 struct fou *fout; in fou_nl_get_doit()
888 struct fou *fout; in fou_nl_get_dumpit()
1230 struct fou *fou, *next; in fou_exit_net() local
1234 list_for_each_entry_safe(fou, next, &fn->fou_list, list) in fou_exit_net()
1235 fou_release(fou); in fou_exit_net()