Lines Matching refs:fou
20 struct fou { struct
47 static inline struct fou *fou_from_sock(struct sock *sk) in fou_from_sock() argument
52 static int fou_recv_pull(struct sk_buff *skb, struct fou *fou, size_t len) in fou_recv_pull() argument
57 if (fou->family == AF_INET) in fou_recv_pull()
71 struct fou *fou = fou_from_sock(sk); in fou_udp_recv() local
73 if (!fou) in fou_udp_recv()
76 if (fou_recv_pull(skb, fou, sizeof(struct udphdr))) in fou_udp_recv()
79 return -fou->protocol; in fou_udp_recv()
118 struct fou *fou = fou_from_sock(sk); in gue_udp_recv() local
124 if (!fou) in gue_udp_recv()
153 if (fou_recv_pull(skb, fou, sizeof(struct udphdr))) in gue_udp_recv()
179 if (fou->family == AF_INET) in gue_udp_recv()
200 !!(fou->flags & in gue_udp_recv()
321 struct fou *fou = fou_from_sock(sk); in gue_gro_receive() local
386 !!(fou->flags & in gue_gro_receive()
501 static int fou_add_to_port_list(struct net *net, struct fou *fou) in fou_add_to_port_list() argument
504 struct fou *fout; in fou_add_to_port_list()
508 if (fou->port == fout->port && in fou_add_to_port_list()
509 fou->family == fout->family) { in fou_add_to_port_list()
515 list_add(&fou->list, &fn->fou_list); in fou_add_to_port_list()
521 static void fou_release(struct fou *fou) in fou_release() argument
523 struct socket *sock = fou->sock; in fou_release()
525 list_del(&fou->list); in fou_release()
528 kfree_rcu(fou, rcu); in fou_release()
535 struct fou *fou = NULL; in fou_create() local
546 fou = kzalloc(sizeof(*fou), GFP_KERNEL); in fou_create()
547 if (!fou) { in fou_create()
554 fou->port = cfg->udp_config.local_udp_port; in fou_create()
555 fou->family = cfg->udp_config.family; in fou_create()
556 fou->flags = cfg->flags; in fou_create()
557 fou->type = cfg->type; in fou_create()
558 fou->sock = sock; in fou_create()
562 tunnel_cfg.sk_user_data = fou; in fou_create()
571 fou->protocol = cfg->protocol; in fou_create()
587 err = fou_add_to_port_list(net, fou); in fou_create()
597 kfree(fou); in fou_create()
610 struct fou *fou; in fou_destroy() local
613 list_for_each_entry(fou, &fn->fou_list, list) { in fou_destroy()
614 if (fou->port == port && fou->family == family) { in fou_destroy()
615 fou_release(fou); in fou_destroy()
702 static int fou_fill_info(struct fou *fou, struct sk_buff *msg) in fou_fill_info() argument
704 if (nla_put_u8(msg, FOU_ATTR_AF, fou->sock->sk->sk_family) || in fou_fill_info()
705 nla_put_be16(msg, FOU_ATTR_PORT, fou->port) || in fou_fill_info()
706 nla_put_u8(msg, FOU_ATTR_IPPROTO, fou->protocol) || in fou_fill_info()
707 nla_put_u8(msg, FOU_ATTR_TYPE, fou->type)) in fou_fill_info()
710 if (fou->flags & FOU_F_REMCSUM_NOPARTIAL) in fou_fill_info()
716 static int fou_dump_info(struct fou *fou, u32 portid, u32 seq, in fou_dump_info() argument
725 if (fou_fill_info(fou, skb) < 0) in fou_dump_info()
742 struct fou *fout; in fou_nl_cmd_get_port()
787 struct fou *fout; in fou_nl_dump()
1068 struct fou *fou, *next; in fou_exit_net() local
1072 list_for_each_entry_safe(fou, next, &fn->fou_list, list) in fou_exit_net()
1073 fou_release(fou); in fou_exit_net()