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()
317 struct fou *fou = fou_from_sock(sk); in gue_gro_receive() local
379 !!(fou->flags & in gue_gro_receive()
489 static bool fou_cfg_cmp(struct fou *fou, struct fou_cfg *cfg) in fou_cfg_cmp() argument
491 struct sock *sk = fou->sock->sk; in fou_cfg_cmp()
494 if (fou->family != udp_cfg->family || in fou_cfg_cmp()
495 fou->port != udp_cfg->local_udp_port || in fou_cfg_cmp()
500 if (fou->family == AF_INET) { in fou_cfg_cmp()
519 static int fou_add_to_port_list(struct net *net, struct fou *fou, in fou_add_to_port_list() argument
523 struct fou *fout; in fou_add_to_port_list()
533 list_add(&fou->list, &fn->fou_list); in fou_add_to_port_list()
539 static void fou_release(struct fou *fou) in fou_release() argument
541 struct socket *sock = fou->sock; in fou_release()
543 list_del(&fou->list); in fou_release()
546 kfree_rcu(fou, rcu); in fou_release()
553 struct fou *fou = NULL; in fou_create() local
564 fou = kzalloc(sizeof(*fou), GFP_KERNEL); in fou_create()
565 if (!fou) { in fou_create()
572 fou->port = cfg->udp_config.local_udp_port; in fou_create()
573 fou->family = cfg->udp_config.family; in fou_create()
574 fou->flags = cfg->flags; in fou_create()
575 fou->type = cfg->type; in fou_create()
576 fou->sock = sock; in fou_create()
580 tunnel_cfg.sk_user_data = fou; in fou_create()
589 fou->protocol = cfg->protocol; in fou_create()
605 err = fou_add_to_port_list(net, fou, cfg); in fou_create()
615 kfree(fou); in fou_create()
626 struct fou *fou; in fou_destroy() local
629 list_for_each_entry(fou, &fn->fou_list, list) { in fou_destroy()
630 if (fou_cfg_cmp(fou, cfg)) { in fou_destroy()
631 fou_release(fou); in fou_destroy()
774 static int fou_fill_info(struct fou *fou, struct sk_buff *msg) in fou_fill_info() argument
776 struct sock *sk = fou->sock->sk; in fou_fill_info()
778 if (nla_put_u8(msg, FOU_ATTR_AF, fou->sock->sk->sk_family) || in fou_fill_info()
779 nla_put_be16(msg, FOU_ATTR_PORT, fou->port) || in fou_fill_info()
781 nla_put_u8(msg, FOU_ATTR_IPPROTO, fou->protocol) || in fou_fill_info()
782 nla_put_u8(msg, FOU_ATTR_TYPE, fou->type) || in fou_fill_info()
786 if (fou->flags & FOU_F_REMCSUM_NOPARTIAL) in fou_fill_info()
790 if (fou->sock->sk->sk_family == AF_INET) { in fou_fill_info()
810 static int fou_dump_info(struct fou *fou, u32 portid, u32 seq, in fou_dump_info() argument
819 if (fou_fill_info(fou, skb) < 0) in fou_dump_info()
836 struct fou *fout; in fou_nl_cmd_get_port()
881 struct fou *fout; in fou_nl_dump()
1244 struct fou *fou, *next; in fou_exit_net() local
1248 list_for_each_entry_safe(fou, next, &fn->fou_list, list) in fou_exit_net()
1249 fou_release(fou); in fou_exit_net()