Skip to content

Commit 45ee1cb

Browse files
committed
Auto merge of #3267 - spencercw:android-timestamping, r=JohnTitor
Add socket timestamping for Android
2 parents f171596 + a2e303f commit 45ee1cb

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

libc-test/semver/android.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,6 +2055,7 @@ SCHED_RR
20552055
SCM_CREDENTIALS
20562056
SCM_RIGHTS
20572057
SCM_TIMESTAMP
2058+
SCM_TIMESTAMPING
20582059

20592060
SECCOMP_FILTER_FLAG_LOG
20602061
SECCOMP_FILTER_FLAG_NEW_LISTENER
@@ -2182,6 +2183,21 @@ SOCK_RAW
21822183
SOCK_RDM
21832184
SOCK_SEQPACKET
21842185
SOCK_STREAM
2186+
SOF_TIMESTAMPING_RAW_HARDWARE
2187+
SOF_TIMESTAMPING_RX_HARDWARE
2188+
SOF_TIMESTAMPING_RX_SOFTWARE
2189+
SOF_TIMESTAMPING_SOFTWARE
2190+
SOF_TIMESTAMPING_SYS_HARDWARE
2191+
SOF_TIMESTAMPING_TX_HARDWARE
2192+
SOF_TIMESTAMPING_TX_SOFTWARE
2193+
SOF_TIMESTAMPING_OPT_ID
2194+
SOF_TIMESTAMPING_TX_SCHED
2195+
SOF_TIMESTAMPING_TX_ACK
2196+
SOF_TIMESTAMPING_OPT_CMSG
2197+
SOF_TIMESTAMPING_OPT_TSONLY
2198+
SOF_TIMESTAMPING_OPT_STATS
2199+
SOF_TIMESTAMPING_OPT_PKTINFO
2200+
SOF_TIMESTAMPING_OPT_TX_SWHW
21852201
SOL_AAL
21862202
SOL_ALG
21872203
SOL_ATALK
@@ -2249,6 +2265,7 @@ SO_SNDBUFFORCE
22492265
SO_SNDLOWAT
22502266
SO_SNDTIMEO
22512267
SO_TIMESTAMP
2268+
SO_TIMESTAMPING
22522269
SO_TYPE
22532270
SPLICE_F_GIFT
22542271
SPLICE_F_MORE

src/unix/linux_like/android/mod.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,12 +1441,26 @@ pub const SO_PEERSEC: ::c_int = 31;
14411441
pub const SO_SNDBUFFORCE: ::c_int = 32;
14421442
pub const SO_RCVBUFFORCE: ::c_int = 33;
14431443
pub const SO_PASSSEC: ::c_int = 34;
1444+
pub const SO_TIMESTAMPNS: ::c_int = 35;
1445+
// pub const SO_TIMESTAMPNS_OLD: ::c_int = 35;
14441446
pub const SO_MARK: ::c_int = 36;
1447+
pub const SO_TIMESTAMPING: ::c_int = 37;
1448+
// pub const SO_TIMESTAMPING_OLD: ::c_int = 37;
14451449
pub const SO_PROTOCOL: ::c_int = 38;
14461450
pub const SO_DOMAIN: ::c_int = 39;
14471451
pub const SO_RXQ_OVFL: ::c_int = 40;
14481452
pub const SO_PEEK_OFF: ::c_int = 42;
14491453
pub const SO_BUSY_POLL: ::c_int = 46;
1454+
pub const SCM_TIMESTAMPING_OPT_STATS: ::c_int = 54;
1455+
pub const SCM_TIMESTAMPING_PKTINFO: ::c_int = 58;
1456+
pub const SO_TIMESTAMP_NEW: ::c_int = 63;
1457+
pub const SO_TIMESTAMPNS_NEW: ::c_int = 64;
1458+
pub const SO_TIMESTAMPING_NEW: ::c_int = 65;
1459+
1460+
// Defined in unix/linux_like/mod.rs
1461+
// pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
1462+
pub const SCM_TIMESTAMPNS: ::c_int = SO_TIMESTAMPNS;
1463+
pub const SCM_TIMESTAMPING: ::c_int = SO_TIMESTAMPING;
14501464

14511465
pub const IPTOS_ECN_NOTECT: u8 = 0x00;
14521466

@@ -2608,6 +2622,23 @@ pub const SIOCSIFMAP: ::c_ulong = 0x00008971;
26082622
pub const MODULE_INIT_IGNORE_MODVERSIONS: ::c_uint = 0x0001;
26092623
pub const MODULE_INIT_IGNORE_VERMAGIC: ::c_uint = 0x0002;
26102624

2625+
// linux/net_tstamp.h
2626+
pub const SOF_TIMESTAMPING_TX_HARDWARE: ::c_uint = 1 << 0;
2627+
pub const SOF_TIMESTAMPING_TX_SOFTWARE: ::c_uint = 1 << 1;
2628+
pub const SOF_TIMESTAMPING_RX_HARDWARE: ::c_uint = 1 << 2;
2629+
pub const SOF_TIMESTAMPING_RX_SOFTWARE: ::c_uint = 1 << 3;
2630+
pub const SOF_TIMESTAMPING_SOFTWARE: ::c_uint = 1 << 4;
2631+
pub const SOF_TIMESTAMPING_SYS_HARDWARE: ::c_uint = 1 << 5;
2632+
pub const SOF_TIMESTAMPING_RAW_HARDWARE: ::c_uint = 1 << 6;
2633+
pub const SOF_TIMESTAMPING_OPT_ID: ::c_uint = 1 << 7;
2634+
pub const SOF_TIMESTAMPING_TX_SCHED: ::c_uint = 1 << 8;
2635+
pub const SOF_TIMESTAMPING_TX_ACK: ::c_uint = 1 << 9;
2636+
pub const SOF_TIMESTAMPING_OPT_CMSG: ::c_uint = 1 << 10;
2637+
pub const SOF_TIMESTAMPING_OPT_TSONLY: ::c_uint = 1 << 11;
2638+
pub const SOF_TIMESTAMPING_OPT_STATS: ::c_uint = 1 << 12;
2639+
pub const SOF_TIMESTAMPING_OPT_PKTINFO: ::c_uint = 1 << 13;
2640+
pub const SOF_TIMESTAMPING_OPT_TX_SWHW: ::c_uint = 1 << 14;
2641+
26112642
#[deprecated(
26122643
since = "0.2.55",
26132644
note = "ENOATTR is not available on Android; use ENODATA instead"

0 commit comments

Comments
 (0)