diff options
| author | David S. Miller <davem@davemloft.net> | 2016-08-28 23:32:58 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-08-28 23:32:58 -0400 |
| commit | c6f04e93cb5993a5d3aaea28c50e297856b8d24c (patch) | |
| tree | 09a988530d4c5e17bf47f16f2c624bc93ac14018 /include/linux/net.h | |
| parent | e19ac1578fd8eb3f7c93f2be2657deb2ccefffd7 (diff) | |
| parent | 96a59083478d1ea66684c59c073424a9d4e6ac6d (diff) | |
Merge branch 'strp-generalization'
Tom Herbert says:
====================
strp: Generalize stream parser to work with other socket types
Add a read_sock protocol operation function that allows something like
tcp_read_sock to be called for other protocol types.
Specific changes in this patch set:
- Add read_sock function to proto_ops. This has the same signature as
tcp_read_sock. sk_read_actor_t is also defined in net.h.
- Set peek_len and read_sock proto_op functions for TCPv4 and TCPv6
stream ops.
- Remove references to tcp in strparser.
- Call peek_len and read_sock operations from strparser instead of
calling TCP specific functions.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/net.h')
| -rw-r--r-- | include/linux/net.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index b9f0ff4d489c..cd0c8bd0a1de 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -25,6 +25,7 @@ #include <linux/kmemcheck.h> #include <linux/rcupdate.h> #include <linux/once.h> +#include <linux/fs.h> #include <uapi/linux/net.h> @@ -128,6 +129,9 @@ struct page; struct sockaddr; struct msghdr; struct module; +struct sk_buff; +typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, + unsigned int, size_t); struct proto_ops { int family; @@ -186,6 +190,8 @@ struct proto_ops { struct pipe_inode_info *pipe, size_t len, unsigned int flags); int (*set_peek_off)(struct sock *sk, int val); int (*peek_len)(struct socket *sock); + int (*read_sock)(struct sock *sk, read_descriptor_t *desc, + sk_read_actor_t recv_actor); }; #define DECLARE_SOCKADDR(type, dst, src) \ |
