CLEANUP: socket: replace SOL_IP/IPV6/TCP with IPPROTO_IP/IPV6/TCP

Historically we've used SOL_IP/SOL_IPV6/SOL_TCP everywhere as the socket
level value in getsockopt() and setsockopt() but as we've seen over time
it regularly broke the build and required to have them defined to their
IPPROTO_* equivalent. The Linux ip(7) man page says:

   Using the SOL_IP socket options level isn't portable; BSD-based
   stacks use the IPPROTO_IP level.

And it indeed looks like a pure linuxism inherited from old examples and
documentation. strace also reports SOL_* instead of IPPROTO_*, which does
not help... A check to linux/in.h shows they have the same values. Only
SOL_SOCKET and other non-IP values make sense since there is no IPPROTO
equivalent.

Let's get rid of this annoying confusion by removing all redefinitions of
SOL_IP/IPV6/TCP and using IPPROTO_* instead, just like any other operating
system. This also removes duplicated tests for the same value.

Note that this should not result in exposing syscalls to other OSes
as the only ones that were still conditionned to SOL_IPV6 were for
IPV6_UNICAST_HOPS which already had an IPPROTO_IPV6 equivalent, and
IPV6_TRANSPARENT which is Linux-specific.
diff --git a/contrib/tcploop/tcploop.c b/contrib/tcploop/tcploop.c
index 7786494..0571a6d 100644
--- a/contrib/tcploop/tcploop.c
+++ b/contrib/tcploop/tcploop.c
@@ -50,10 +50,6 @@
 #include <time.h>
 #include <unistd.h>
 
-#ifndef SOL_TCP
-#define SOL_TCP IPPROTO_TCP
-#endif
-
 #ifndef MSG_MORE
 #define MSG_MORE 0
 #endif
@@ -316,7 +312,7 @@
 
 int tcp_set_nodelay(int sock, const char *arg)
 {
-	return setsockopt(sock, SOL_TCP, TCP_NODELAY, &one, sizeof(one));
+	return setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one));
 }
 
 int tcp_set_nolinger(int sock, const char *arg)
@@ -328,7 +324,7 @@
 {
 #ifdef TCP_QUICKACK
 	/* warning: do not use during connect if nothing is to be sent! */
-	return setsockopt(sock, SOL_TCP, TCP_QUICKACK, &zero, sizeof(zero));
+	return setsockopt(sock, IPPROTO_TCP, TCP_QUICKACK, &zero, sizeof(zero));
 #else
 	return 0;
 #endif