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()
319 struct fou *fou = fou_from_sock(sk); in gue_gro_receive() local
381 !!(fou->flags & in gue_gro_receive()
491 static bool fou_cfg_cmp(struct fou *fou, struct fou_cfg *cfg) in fou_cfg_cmp() argument
493 struct sock *sk = fou->sock->sk; in fou_cfg_cmp()
496 if (fou->family != udp_cfg->family || in fou_cfg_cmp()
497 fou->port != udp_cfg->local_udp_port || in fou_cfg_cmp()
502 if (fou->family == AF_INET) { in fou_cfg_cmp()
521 static int fou_add_to_port_list(struct net *net, struct fou *fou, in fou_add_to_port_list() argument
525 struct fou *fout; in fou_add_to_port_list()
535 list_add(&fou->list, &fn->fou_list); in fou_add_to_port_list()
541 static void fou_release(struct fou *fou) in fou_release() argument
543 struct socket *sock = fou->sock; in fou_release()
545 list_del(&fou->list); in fou_release()
548 kfree_rcu(fou, rcu); in fou_release()
555 struct fou *fou = NULL; in fou_create() local
566 fou = kzalloc(sizeof(*fou), GFP_KERNEL); in fou_create()
567 if (!fou) { in fou_create()
574 fou->port = cfg->udp_config.local_udp_port; in fou_create()
575 fou->family = cfg->udp_config.family; in fou_create()
576 fou->flags = cfg->flags; in fou_create()
577 fou->type = cfg->type; in fou_create()
578 fou->sock = sock; in fou_create()
582 tunnel_cfg.sk_user_data = fou; in fou_create()
591 fou->protocol = cfg->protocol; in fou_create()
607 err = fou_add_to_port_list(net, fou, cfg); in fou_create()
617 kfree(fou); in fou_create()
628 struct fou *fou; in fou_destroy() local
631 list_for_each_entry(fou, &fn->fou_list, list) { in fou_destroy()
632 if (fou_cfg_cmp(fou, cfg)) { in fou_destroy()
633 fou_release(fou); in fou_destroy()
762 static int fou_fill_info(struct fou *fou, struct sk_buff *msg) in fou_fill_info() argument
764 struct sock *sk = fou->sock->sk; in fou_fill_info()
766 if (nla_put_u8(msg, FOU_ATTR_AF, fou->sock->sk->sk_family) || in fou_fill_info()
767 nla_put_be16(msg, FOU_ATTR_PORT, fou->port) || in fou_fill_info()
769 nla_put_u8(msg, FOU_ATTR_IPPROTO, fou->protocol) || in fou_fill_info()
770 nla_put_u8(msg, FOU_ATTR_TYPE, fou->type) || in fou_fill_info()
774 if (fou->flags & FOU_F_REMCSUM_NOPARTIAL) in fou_fill_info()
778 if (fou->sock->sk->sk_family == AF_INET) { in fou_fill_info()
798 static int fou_dump_info(struct fou *fou, u32 portid, u32 seq, in fou_dump_info() argument
807 if (fou_fill_info(fou, skb) < 0) in fou_dump_info()
824 struct fou *fout; in fou_nl_get_doit()
869 struct fou *fout; in fou_nl_get_dumpit()
1211 struct fou *fou, *next; in fou_exit_net() local
1215 list_for_each_entry_safe(fou, next, &fn->fou_list, list) in fou_exit_net()
1216 fou_release(fou); in fou_exit_net()