Lines Matching refs:fou
22 struct fou { struct
49 static inline struct fou *fou_from_sock(struct sock *sk) in fou_from_sock() argument
54 static int fou_recv_pull(struct sk_buff *skb, struct fou *fou, size_t len) in fou_recv_pull() argument
59 if (fou->family == AF_INET) in fou_recv_pull()
73 struct fou *fou = fou_from_sock(sk); in fou_udp_recv() local
75 if (!fou) in fou_udp_recv()
78 if (fou_recv_pull(skb, fou, sizeof(struct udphdr))) in fou_udp_recv()
81 return -fou->protocol; in fou_udp_recv()
120 struct fou *fou = fou_from_sock(sk); in gue_udp_recv() local
127 if (!fou) in gue_udp_recv()
156 if (fou_recv_pull(skb, fou, sizeof(struct udphdr))) in gue_udp_recv()
180 if (fou->family == AF_INET) in gue_udp_recv()
201 !!(fou->flags & in gue_udp_recv()
323 struct fou *fou = fou_from_sock(sk); in gue_gro_receive() local
388 !!(fou->flags & in gue_gro_receive()
503 static bool fou_cfg_cmp(struct fou *fou, struct fou_cfg *cfg) in fou_cfg_cmp() argument
505 struct sock *sk = fou->sock->sk; in fou_cfg_cmp()
508 if (fou->family != udp_cfg->family || in fou_cfg_cmp()
509 fou->port != udp_cfg->local_udp_port || in fou_cfg_cmp()
514 if (fou->family == AF_INET) { in fou_cfg_cmp()
533 static int fou_add_to_port_list(struct net *net, struct fou *fou, in fou_add_to_port_list() argument
537 struct fou *fout; in fou_add_to_port_list()
547 list_add(&fou->list, &fn->fou_list); in fou_add_to_port_list()
553 static void fou_release(struct fou *fou) in fou_release() argument
555 struct socket *sock = fou->sock; in fou_release()
557 list_del(&fou->list); in fou_release()
560 kfree_rcu(fou, rcu); in fou_release()
567 struct fou *fou = NULL; in fou_create() local
578 fou = kzalloc(sizeof(*fou), GFP_KERNEL); in fou_create()
579 if (!fou) { in fou_create()
586 fou->port = cfg->udp_config.local_udp_port; in fou_create()
587 fou->family = cfg->udp_config.family; in fou_create()
588 fou->flags = cfg->flags; in fou_create()
589 fou->type = cfg->type; in fou_create()
590 fou->sock = sock; in fou_create()
594 tunnel_cfg.sk_user_data = fou; in fou_create()
603 fou->protocol = cfg->protocol; in fou_create()
619 err = fou_add_to_port_list(net, fou, cfg); in fou_create()
629 kfree(fou); in fou_create()
640 struct fou *fou; in fou_destroy() local
643 list_for_each_entry(fou, &fn->fou_list, list) { in fou_destroy()
644 if (fou_cfg_cmp(fou, cfg)) { in fou_destroy()
645 fou_release(fou); in fou_destroy()
788 static int fou_fill_info(struct fou *fou, struct sk_buff *msg) in fou_fill_info() argument
790 struct sock *sk = fou->sock->sk; in fou_fill_info()
792 if (nla_put_u8(msg, FOU_ATTR_AF, fou->sock->sk->sk_family) || in fou_fill_info()
793 nla_put_be16(msg, FOU_ATTR_PORT, fou->port) || in fou_fill_info()
795 nla_put_u8(msg, FOU_ATTR_IPPROTO, fou->protocol) || in fou_fill_info()
796 nla_put_u8(msg, FOU_ATTR_TYPE, fou->type) || in fou_fill_info()
800 if (fou->flags & FOU_F_REMCSUM_NOPARTIAL) in fou_fill_info()
804 if (fou->sock->sk->sk_family == AF_INET) { in fou_fill_info()
824 static int fou_dump_info(struct fou *fou, u32 portid, u32 seq, in fou_dump_info() argument
833 if (fou_fill_info(fou, skb) < 0) in fou_dump_info()
850 struct fou *fout; in fou_nl_cmd_get_port()
895 struct fou *fout; in fou_nl_dump()
1257 struct fou *fou, *next; in fou_exit_net() local
1261 list_for_each_entry_safe(fou, next, &fn->fou_list, list) in fou_exit_net()
1262 fou_release(fou); in fou_exit_net()