ctdb-common: Move ctdb_sys_send_tcp() to ctdb_socket.[ch]
authorMartin Schwenke <martin@meltin.net>
Thu, 28 Jun 2018 11:06:58 +0000 (21:06 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 2 Jul 2018 06:51:21 +0000 (08:51 +0200)
commiteafcc98b03f59e242d0bb004f765005a35190b6d
treec761b975b71f8b12052855c57f4e07db99684e1d
parent9c51b278b1700cd5f3e2addc19b7c711cc2ea10b
ctdb-common: Move ctdb_sys_send_tcp() to ctdb_socket.[ch]

The system_<os>.c files contain a lot of duplication, making
maintenance difficult.  These functions are being merged into
system_socket.c and system.c.

Bring across tcp_checksum(), renamed to ip_checksum().
uint16_checksum() becomes static.

Use the BSD struct tcphdr field names for portability.  See the
comment in the code for more details about how we get this to compile
on older glibc versions.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/system.h
ctdb/common/system_aix.c
ctdb/common/system_freebsd.c
ctdb/common/system_gnu.c
ctdb/common/system_kfreebsd.c
ctdb/common/system_linux.c
ctdb/common/system_socket.c
ctdb/common/system_socket.h
ctdb/tools/ctdb_killtcp.c