Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
net_tstamp.h
Go to the documentation of this file.
1 /*
2  * Userspace API for hardware time stamping of network packets
3  *
4  * Copyright (C) 2008,2009 Intel Corporation
5  * Author: Patrick Ohly <[email protected]>
6  *
7  */
8 
9 #ifndef _NET_TIMESTAMPING_H
10 #define _NET_TIMESTAMPING_H
11 
12 #include <linux/socket.h> /* for SO_TIMESTAMPING */
13 
14 /* SO_TIMESTAMPING gets an integer bit field comprised of these values */
15 enum {
26 };
27 
42  int flags;
43  int tx_type;
44  int rx_filter;
45 };
46 
47 /* possible values for hwtstamp_config->tx_type */
49  /*
50  * No outgoing packet will need hardware time stamping;
51  * should a packet arrive which asks for it, no hardware
52  * time stamping will be done.
53  */
55 
56  /*
57  * Enables hardware time stamping for outgoing packets;
58  * the sender of the packet decides which are to be
59  * time stamped by setting %SOF_TIMESTAMPING_TX_SOFTWARE
60  * before sending the packet.
61  */
63 
64  /*
65  * Enables time stamping for outgoing packets just as
66  * HWTSTAMP_TX_ON does, but also enables time stamp insertion
67  * directly into Sync packets. In this case, transmitted Sync
68  * packets will not received a time stamp via the socket error
69  * queue.
70  */
72 };
73 
74 /* possible values for hwtstamp_config->rx_filter */
76  /* time stamp no incoming packet at all */
78 
79  /* time stamp any incoming packet */
81 
82  /* return value: time stamp all packets requested plus some others */
84 
85  /* PTP v1, UDP, any kind of event packet */
87  /* PTP v1, UDP, Sync packet */
89  /* PTP v1, UDP, Delay_req packet */
91  /* PTP v2, UDP, any kind of event packet */
93  /* PTP v2, UDP, Sync packet */
95  /* PTP v2, UDP, Delay_req packet */
97 
98  /* 802.AS1, Ethernet, any kind of event packet */
100  /* 802.AS1, Ethernet, Sync packet */
102  /* 802.AS1, Ethernet, Delay_req packet */
104 
105  /* PTP v2/802.AS1, any layer, any kind of event packet */
107  /* PTP v2/802.AS1, any layer, Sync packet */
109  /* PTP v2/802.AS1, any layer, Delay_req packet */
111 };
112 
113 #endif /* _NET_TIMESTAMPING_H */