mirror of
https://github.com/apache/nuttx.git
synced 2026-06-09 02:44:53 +08:00
udp: Add support for SO_TIMESTAMP
Adds support for timestamping received UDP packets, either in hardware or in kernel. Builds on the existing support of SO_TIMESTAMP for SocketCAN. Implementation uses CLOCK_REALTIME for timestamping to match the behavior of Linux. This could be made configurable in future if needed.
This commit is contained in:
committed by
Xiang Xiao
parent
ce654a6148
commit
cb161940c2
@@ -442,6 +442,18 @@ struct net_driver_s
|
||||
struct netdev_statistics_s d_statistics;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NET_TIMESTAMP)
|
||||
/* Reception timestamp of packet being currently processed.
|
||||
* If CONFIG_ARCH_HAVE_NETDEV_TIMESTAMP is true, the timestamp is provided
|
||||
* by hardware driver. Otherwise it is filled in by kernel when packet
|
||||
* enters ipv4_input or ipv6_input.
|
||||
*
|
||||
* The timestamp is in CLOCK_REALTIME.
|
||||
*/
|
||||
|
||||
struct timespec d_rxtime;
|
||||
#endif
|
||||
|
||||
/* Application callbacks:
|
||||
*
|
||||
* Network device event handlers are retained in a 'list' and are called
|
||||
|
||||
Reference in New Issue
Block a user