tcp: ULP infrastructure
authorDave Watson <davejwatson@fb.com>
Wed, 14 Jun 2017 18:37:14 +0000 (11:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Jun 2017 16:12:40 +0000 (12:12 -0400)
commit734942cc4ea6478eed125af258da1bdbb4afe578
treea6b0b27cb551055a7c5d5756c40d737543323df1
parent206f60e1451b4b90cb7f3a803d1c440602a458e0
tcp: ULP infrastructure

Add the infrustructure for attaching Upper Layer Protocols (ULPs) over TCP
sockets. Based on a similar infrastructure in tcp_cong.  The idea is that any
ULP can add its own logic by changing the TCP proto_ops structure to its own
methods.

Example usage:

setsockopt(sock, SOL_TCP, TCP_ULP, "tls", sizeof("tls"));

modules will call:
tcp_register_ulp(&tcp_tls_ulp_ops);

to register/unregister their ulp, with an init function and name.

A list of registered ulps will be returned by tcp_get_available_ulp, which is
hooked up to /proc.  Example:

$ cat /proc/sys/net/ipv4/tcp_available_ulp
tls

There is currently no functionality to remove or chain ULPs, but
it should be possible to add these in the future if needed.

Signed-off-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_connection_sock.h
include/net/tcp.h
include/uapi/linux/tcp.h
net/ipv4/Makefile
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_ulp.c [new file with mode: 0644]