#include <arpa/inet.h>
#include <netinet/in.h>
+#define XLAT_MACROS_ONLY
+#include "xlat/sock_options.h"
+#undef XLAT_MACROS_ONLY
#include "xlat/msg_flags.h"
#include "xlat/scmvals.h"
#include "xlat/ip_cmsg_types.h"
[SCM_RIGHTS] = { print_scm_rights, sizeof(int) },
[SCM_CREDENTIALS] = { print_scm_creds, sizeof(struct ucred) },
[SCM_SECURITY] = { print_scm_security, 1 },
- [SCM_TIMESTAMP] = { print_scm_timestamp, 1 },
- [SCM_TIMESTAMPNS] = { print_scm_timestampns, 1 },
- [SCM_TIMESTAMPING] = { print_scm_timestamping, 1 }
+ [SO_TIMESTAMP] = { print_scm_timestamp, 1 },
+ [SO_TIMESTAMPNS] = { print_scm_timestampns, 1 },
+ [SO_TIMESTAMPING] = { print_scm_timestamping, 1 }
}, cmsg_ip_printers[] = {
[IP_PKTINFO] = { print_cmsg_ip_pktinfo, sizeof(struct in_pktinfo) },
[IP_TTL] = { print_cmsg_uint, sizeof(unsigned int) },
#include <arpa/inet.h>
#include "xlat.h"
+#define XLAT_MACROS_ONLY
+#include "xlat/sock_options.h"
#include "xlat/scmvals.h"
+#undef XLAT_MACROS_ONLY
#ifndef SOL_IP
# define SOL_IP 0
# define SOL_TCP 6
#endif
-#ifndef SCM_SECURITY
-# define SCM_SECURITY 3
-#endif
-
#define MIN_SIZE_OF(type, member) \
(offsetof(type, member) + sizeof(((type *) 0)->member))
cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval));
cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_TIMESTAMP;
+ cmsg->cmsg_type = SO_TIMESTAMP;
struct timeval *tv = (struct timeval *) CMSG_DATA(cmsg);
tv->tv_sec = 123456789;
tv->tv_usec = 987654;
int rc = sendmsg(-1, mh, 0);
printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL"
", msg_iovlen=0, msg_control=[{cmsg_len=%u"
- ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_TIMESTAMP"
+ ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP"
", cmsg_data={tv_sec=%lld, tv_usec=%llu}}]"
", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n",
(unsigned) cmsg->cmsg_len,
cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval) - sizeof(long));
cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_TIMESTAMP;
+ cmsg->cmsg_type = SO_TIMESTAMP;
mh->msg_control = cmsg;
mh->msg_controllen = len;
rc = sendmsg(-1, mh, 0);
printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL"
", msg_iovlen=0, msg_control=[{cmsg_len=%u"
- ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_TIMESTAMP, cmsg_data=?}]"
+ ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP, cmsg_data=?}]"
", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n",
(unsigned) cmsg->cmsg_len,
(unsigned long) len, rc, errno2name());
cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec));
cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_TIMESTAMPNS;
+ cmsg->cmsg_type = SO_TIMESTAMPNS;
struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg);
ts->tv_sec = 123456789;
ts->tv_nsec = 987654321;
int rc = sendmsg(-1, mh, 0);
printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL"
", msg_iovlen=0, msg_control=[{cmsg_len=%u"
- ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_TIMESTAMPNS"
+ ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS"
", cmsg_data={tv_sec=%lld, tv_nsec=%llu}}]"
", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n",
(unsigned) cmsg->cmsg_len,
cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec) - sizeof(long));
cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_TIMESTAMPNS;
+ cmsg->cmsg_type = SO_TIMESTAMPNS;
mh->msg_control = cmsg;
mh->msg_controllen = len;
rc = sendmsg(-1, mh, 0);
printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL"
", msg_iovlen=0, msg_control=[{cmsg_len=%u"
- ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_TIMESTAMPNS"
+ ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS"
", cmsg_data=?}]"
", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n",
(unsigned) cmsg->cmsg_len,
cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec));
cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_TIMESTAMPING;
+ cmsg->cmsg_type = SO_TIMESTAMPING;
struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg);
ts[0].tv_sec = 123456789;
ts[0].tv_nsec = 987654321;
int rc = sendmsg(-1, mh, 0);
printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL"
", msg_iovlen=0, msg_control=[{cmsg_len=%u"
- ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_TIMESTAMPING"
+ ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING"
", cmsg_data=[{tv_sec=%lld, tv_nsec=%llu}"
", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu}]}]"
", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n",
cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec) - sizeof(long));
cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_TIMESTAMPING;
+ cmsg->cmsg_type = SO_TIMESTAMPING;
mh->msg_control = cmsg;
mh->msg_controllen = len;
rc = sendmsg(-1, mh, 0);
printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL"
", msg_iovlen=0, msg_control=[{cmsg_len=%u"
- ", cmsg_level=SOL_SOCKET, cmsg_type=SCM_TIMESTAMPING"
+ ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING"
", cmsg_data=?}]"
", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n",
(unsigned) cmsg->cmsg_len,
SCM_CREDENTIALS 2
SCM_SECURITY 3
-#ifndef SCM_TIMESTAMP
-# if defined HPPA
-# define SCM_TIMESTAMP 0x4012
-# elif defined SPARC || defined SPARC64
-# define SCM_TIMESTAMP 0x001d
-# else
-# define SCM_TIMESTAMP 29
-# endif
-#endif
-SCM_TIMESTAMP
-
-#ifndef SCM_TIMESTAMPNS
-# if defined HPPA
-# define SCM_TIMESTAMPNS 0x4013
-# elif defined SPARC || defined SPARC64
-# define SCM_TIMESTAMPNS 0x0021
-# else
-# define SCM_TIMESTAMPNS 35
-# endif
-#endif
-SCM_TIMESTAMPNS
-
-#ifndef SCM_TIMESTAMPING
-# if defined HPPA
-# define SCM_TIMESTAMPING 0x4020
-# elif defined SPARC || defined SPARC64
-# define SCM_TIMESTAMPING 0x0023
-# else
-# define SCM_TIMESTAMPING 37
-# endif
-#endif
-SCM_TIMESTAMPING
-
-#ifndef SCM_WIFI_STATUS
-# if defined HPPA
-# define SCM_WIFI_STATUS 0x4022
-# elif defined SPARC || defined SPARC64
-# define SCM_WIFI_STATUS 0x0025
-# else
-# define SCM_WIFI_STATUS 41
-# endif
-#endif
-SCM_WIFI_STATUS
+SO_WIFI_STATUS
+SO_TXTIME
+SO_TIMESTAMP
+SO_TIMESTAMPNS
+SO_TIMESTAMPING
-#ifndef SCM_TIMESTAMPING_OPT_STATS
-# if defined HPPA
-# define SCM_TIMESTAMPING_OPT_STATS 0x402f
-# elif defined SPARC || defined SPARC64
-# define SCM_TIMESTAMPING_OPT_STATS 0x0038
-# else
-# define SCM_TIMESTAMPING_OPT_STATS 54
-# endif
+/* Generated by maint/gen_xlat_defs.sh -f '#x' -p 'SCM_TIMESTAMPING_' -c 'asm-generic/socket.h' -a 'asm/socket.h' */
+#if defined __sparc__
+SCM_TIMESTAMPING_OPT_STATS 0x38
+#elif defined __hppa__
+SCM_TIMESTAMPING_OPT_STATS 0x402f
+#else
+SCM_TIMESTAMPING_OPT_STATS 0x36
#endif
-SCM_TIMESTAMPING_OPT_STATS
-
-#ifndef SCM_TIMESTAMPING_PKTINFO
-# if defined HPPA
-# define SCM_TIMESTAMPING_PKTINFO 0x4033
-# elif defined SPARC || defined SPARC64
-# define SCM_TIMESTAMPING_PKTINFO 0x003c
-# else
-# define SCM_TIMESTAMPING_PKTINFO 58
-# endif
+#if defined __sparc__
+SCM_TIMESTAMPING_PKTINFO 0x3c
+#elif defined __hppa__
+SCM_TIMESTAMPING_PKTINFO 0x4033
+#else
+SCM_TIMESTAMPING_PKTINFO 0x3a
#endif
-SCM_TIMESTAMPING_PKTINFO