Revert "include/sys/socket.h: Add SOCK_CTRL to socket type"

This reverts commit abba05a934.
This commit is contained in:
Masayuki Ishikawa
2023-02-08 22:41:15 +09:00
committed by Alin Jerpelea
parent 916fa4d759
commit 3f3e090716
11 changed files with 47 additions and 74 deletions
+36 -8
View File
@@ -104,24 +104,52 @@
#define NET_SOCK_PROTOCOL 0
/* SOCK_CTRL is the preferred socket type to use when we just want a
* socket for performing driver ioctls.
/* SOCK_DGRAM is the preferred socket type to use when we just want a
* socket for performing driver ioctls. However, we can't use SOCK_DRAM
* if UDP is disabled.
*
* Pick a socket type (and perhaps protocol) compatible with the currently
* selected address family.
*/
#define NET_SOCK_TYPE SOCK_CTRL
#if NET_SOCK_FAMILY == AF_INET
# if !defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_TCP) && \
defined(CONFIG_NET_ICMP_SOCKET)
# if defined(CONFIG_NET_UDP)
# define NET_SOCK_TYPE SOCK_DGRAM
# elif defined(CONFIG_NET_TCP)
# define NET_SOCK_TYPE SOCK_STREAM
# elif defined(CONFIG_NET_ICMP_SOCKET)
# define NET_SOCK_TYPE SOCK_DGRAM
# undef NET_SOCK_PROTOCOL
# define NET_SOCK_PROTOCOL IPPROTO_ICMP
# endif
#elif NET_SOCK_FAMILY == AF_INET6
# if !defined(CONFIG_NET_UDP) && !defined(CONFIG_NET_TCP) && \
defined(CONFIG_NET_ICMPv6_SOCKET)
# if defined(CONFIG_NET_UDP)
# define NET_SOCK_TYPE SOCK_DGRAM
# elif defined(CONFIG_NET_TCP)
# define NET_SOCK_TYPE SOCK_STREAM
# elif defined(CONFIG_NET_ICMPv6_SOCKET)
# define NET_SOCK_TYPE SOCK_DGRAM
# undef NET_SOCK_PROTOCOL
# define NET_SOCK_PROTOCOL IPPROTO_ICMP6
# endif
#elif NET_SOCK_FAMILY == AF_LOCAL
# if defined(CONFIG_NET_LOCAL_DGRAM)
# define NET_SOCK_TYPE SOCK_DGRAM
# elif defined(CONFIG_NET_LOCAL_STREAM)
# define NET_SOCK_TYPE SOCK_STREAM
# endif
#elif NET_SOCK_FAMILY == AF_PACKET
# define NET_SOCK_TYPE SOCK_RAW
#elif NET_SOCK_FAMILY == AF_CAN
# define NET_SOCK_TYPE SOCK_RAW
#elif NET_SOCK_FAMILY == AF_IEEE802154
# define NET_SOCK_TYPE SOCK_DGRAM
#elif NET_SOCK_FAMILY == AF_BLUETOOTH
# define NET_SOCK_TYPE SOCK_RAW
#elif NET_SOCK_FAMILY == AF_NETLINK
# define NET_SOCK_TYPE SOCK_DGRAM
#elif NET_SOCK_FAMILY == AF_RPMSG
# define NET_SOCK_TYPE SOCK_STREAM
#endif
/* Eliminate dependencies on other header files. This should not harm
-4
View File
@@ -92,10 +92,6 @@
* required to read an entire packet with each read
* system call.
*/
#define SOCK_CTRL 6 /* SOCK_CTRL is the preferred socket type to use
* when we just want a socket for performing driver
* ioctls. This definition is not POSIX compliant.
*/
#define SOCK_PACKET 10 /* Obsolete and should not be used in new programs */
#define SOCK_CLOEXEC 02000000 /* Atomically set close-on-exec flag for the new