To reduce code duplication move socket defines to the MI path.

MFC after:	1 week
This commit is contained in:
dchagin 2017-03-18 18:23:30 +00:00
parent f99d0df31b
commit 82392d7947
4 changed files with 33 additions and 106 deletions

View File

@ -383,50 +383,6 @@ union l_semun {
l_uintptr_t __pad;
};
/*
* Socket defines
*/
#define LINUX_SOL_SOCKET 1
#define LINUX_SOL_IP 0
#define LINUX_SOL_IPX 256
#define LINUX_SOL_AX25 257
#define LINUX_SOL_TCP 6
#define LINUX_SOL_UDP 17
#define LINUX_SO_DEBUG 1
#define LINUX_SO_REUSEADDR 2
#define LINUX_SO_TYPE 3
#define LINUX_SO_ERROR 4
#define LINUX_SO_DONTROUTE 5
#define LINUX_SO_BROADCAST 6
#define LINUX_SO_SNDBUF 7
#define LINUX_SO_RCVBUF 8
#define LINUX_SO_KEEPALIVE 9
#define LINUX_SO_OOBINLINE 10
#define LINUX_SO_NO_CHECK 11
#define LINUX_SO_PRIORITY 12
#define LINUX_SO_LINGER 13
#define LINUX_SO_PASSCRED 16
#define LINUX_SO_PEERCRED 17
#define LINUX_SO_RCVLOWAT 18
#define LINUX_SO_SNDLOWAT 19
#define LINUX_SO_RCVTIMEO 20
#define LINUX_SO_SNDTIMEO 21
#define LINUX_SO_TIMESTAMP 29
#define LINUX_SO_ACCEPTCONN 30
#define LINUX_IP_TOS 1
#define LINUX_IP_TTL 2
#define LINUX_IP_HDRINCL 3
#define LINUX_IP_OPTIONS 4
#define LINUX_IP_MULTICAST_IF 32
#define LINUX_IP_MULTICAST_TTL 33
#define LINUX_IP_MULTICAST_LOOP 34
#define LINUX_IP_ADD_MEMBERSHIP 35
#define LINUX_IP_DROP_MEMBERSHIP 36
struct l_sockaddr {
l_ushort sa_family;
char sa_data[14];

View File

@ -474,37 +474,6 @@ union l_semun {
l_uintptr_t __pad;
} __packed;
/*
* Socket defines
*/
#define LINUX_SOL_SOCKET 1
#define LINUX_SOL_IP 0
#define LINUX_SOL_IPX 256
#define LINUX_SOL_AX25 257
#define LINUX_SOL_TCP 6
#define LINUX_SOL_UDP 17
#define LINUX_SO_DEBUG 1
#define LINUX_SO_REUSEADDR 2
#define LINUX_SO_TYPE 3
#define LINUX_SO_ERROR 4
#define LINUX_SO_DONTROUTE 5
#define LINUX_SO_BROADCAST 6
#define LINUX_SO_SNDBUF 7
#define LINUX_SO_RCVBUF 8
#define LINUX_SO_KEEPALIVE 9
#define LINUX_SO_OOBINLINE 10
#define LINUX_SO_NO_CHECK 11
#define LINUX_SO_PRIORITY 12
#define LINUX_SO_LINGER 13
#define LINUX_SO_PEERCRED 17
#define LINUX_SO_RCVLOWAT 18
#define LINUX_SO_SNDLOWAT 19
#define LINUX_SO_RCVTIMEO 20
#define LINUX_SO_SNDTIMEO 21
#define LINUX_SO_TIMESTAMP 29
#define LINUX_SO_ACCEPTCONN 30
struct l_sockaddr {
l_ushort sa_family;
char sa_data[14];

View File

@ -172,6 +172,39 @@ int linux_accept(struct thread *td, struct linux_accept_args *args);
#define LINUX_SENDMMSG 20
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
/* Socket defines */
#define LINUX_SOL_SOCKET 1
#define LINUX_SOL_IP 0
#define LINUX_SOL_TCP 6
#define LINUX_SOL_UDP 17
#define LINUX_SOL_IPV6 41
#define LINUX_SOL_IPX 256
#define LINUX_SOL_AX25 257
#define LINUX_SO_DEBUG 1
#define LINUX_SO_REUSEADDR 2
#define LINUX_SO_TYPE 3
#define LINUX_SO_ERROR 4
#define LINUX_SO_DONTROUTE 5
#define LINUX_SO_BROADCAST 6
#define LINUX_SO_SNDBUF 7
#define LINUX_SO_RCVBUF 8
#define LINUX_SO_KEEPALIVE 9
#define LINUX_SO_OOBINLINE 10
#define LINUX_SO_NO_CHECK 11
#define LINUX_SO_PRIORITY 12
#define LINUX_SO_LINGER 13
#ifndef LINUX_SO_PASSCRED /* powerpc differs */
#define LINUX_SO_PASSCRED 16
#define LINUX_SO_PEERCRED 17
#define LINUX_SO_RCVLOWAT 18
#define LINUX_SO_SNDLOWAT 19
#define LINUX_SO_RCVTIMEO 20
#define LINUX_SO_SNDTIMEO 21
#endif
#define LINUX_SO_TIMESTAMP 29
#define LINUX_SO_ACCEPTCONN 30
/* Socket options */
#define LINUX_IP_TOS 1
#define LINUX_IP_TTL 2

View File

@ -453,37 +453,6 @@ union l_semun {
void *__pad;
};
/*
* Socket defines
*/
#define LINUX_SOL_SOCKET 1
#define LINUX_SOL_IP 0
#define LINUX_SOL_IPX 256
#define LINUX_SOL_AX25 257
#define LINUX_SOL_TCP 6
#define LINUX_SOL_UDP 17
#define LINUX_SO_DEBUG 1
#define LINUX_SO_REUSEADDR 2
#define LINUX_SO_TYPE 3
#define LINUX_SO_ERROR 4
#define LINUX_SO_DONTROUTE 5
#define LINUX_SO_BROADCAST 6
#define LINUX_SO_SNDBUF 7
#define LINUX_SO_RCVBUF 8
#define LINUX_SO_KEEPALIVE 9
#define LINUX_SO_OOBINLINE 10
#define LINUX_SO_NO_CHECK 11
#define LINUX_SO_PRIORITY 12
#define LINUX_SO_LINGER 13
#define LINUX_SO_PEERCRED 17
#define LINUX_SO_RCVLOWAT 18
#define LINUX_SO_SNDLOWAT 19
#define LINUX_SO_RCVTIMEO 20
#define LINUX_SO_SNDTIMEO 21
#define LINUX_SO_TIMESTAMP 29
#define LINUX_SO_ACCEPTCONN 30
struct l_sockaddr {
l_ushort sa_family;
char sa_data[14];