diff options
Diffstat (limited to 'Documentation/networking/packet_mmap.txt')
-rw-r--r-- | Documentation/networking/packet_mmap.txt | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index 98f71a5cef00..073894d1c093 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt | |||
@@ -8,7 +8,7 @@ capture network traffic with utilities like tcpdump or any other that needs | |||
8 | raw access to network interface. | 8 | raw access to network interface. |
9 | 9 | ||
10 | You can find the latest version of this document at: | 10 | You can find the latest version of this document at: |
11 | http://pusa.uv.es/~ulisses/packet_mmap/ | 11 | http://wiki.ipxwarzone.com/index.php5?title=Linux_packet_mmap |
12 | 12 | ||
13 | Howto can be found at: | 13 | Howto can be found at: |
14 | http://wiki.gnu-log.net (packet_mmap) | 14 | http://wiki.gnu-log.net (packet_mmap) |
@@ -56,7 +56,7 @@ support for PACKET_MMAP, and also probably the libpcap included in your distribu | |||
56 | 56 | ||
57 | I'm aware of two implementations of PACKET_MMAP in libpcap: | 57 | I'm aware of two implementations of PACKET_MMAP in libpcap: |
58 | 58 | ||
59 | http://pusa.uv.es/~ulisses/packet_mmap/ (by Simon Patarin, based on libpcap 0.6.2) | 59 | http://wiki.ipxwarzone.com/ (by Simon Patarin, based on libpcap 0.6.2) |
60 | http://public.lanl.gov/cpw/ (by Phil Wood, based on lastest libpcap) | 60 | http://public.lanl.gov/cpw/ (by Phil Wood, based on lastest libpcap) |
61 | 61 | ||
62 | The rest of this document is intended for people who want to understand | 62 | The rest of this document is intended for people who want to understand |
@@ -493,6 +493,32 @@ The user can also use poll() to check if a buffer is available: | |||
493 | pfd.events = POLLOUT; | 493 | pfd.events = POLLOUT; |
494 | retval = poll(&pfd, 1, timeout); | 494 | retval = poll(&pfd, 1, timeout); |
495 | 495 | ||
496 | ------------------------------------------------------------------------------- | ||
497 | + PACKET_TIMESTAMP | ||
498 | ------------------------------------------------------------------------------- | ||
499 | |||
500 | The PACKET_TIMESTAMP setting determines the source of the timestamp in | ||
501 | the packet meta information. If your NIC is capable of timestamping | ||
502 | packets in hardware, you can request those hardware timestamps to used. | ||
503 | Note: you may need to enable the generation of hardware timestamps with | ||
504 | SIOCSHWTSTAMP. | ||
505 | |||
506 | PACKET_TIMESTAMP accepts the same integer bit field as | ||
507 | SO_TIMESTAMPING. However, only the SOF_TIMESTAMPING_SYS_HARDWARE | ||
508 | and SOF_TIMESTAMPING_RAW_HARDWARE values are recognized by | ||
509 | PACKET_TIMESTAMP. SOF_TIMESTAMPING_SYS_HARDWARE takes precedence over | ||
510 | SOF_TIMESTAMPING_RAW_HARDWARE if both bits are set. | ||
511 | |||
512 | int req = 0; | ||
513 | req |= SOF_TIMESTAMPING_SYS_HARDWARE; | ||
514 | setsockopt(fd, SOL_PACKET, PACKET_TIMESTAMP, (void *) &req, sizeof(req)) | ||
515 | |||
516 | If PACKET_TIMESTAMP is not set, a software timestamp generated inside | ||
517 | the networking stack is used (the behavior before this setting was added). | ||
518 | |||
519 | See include/linux/net_tstamp.h and Documentation/networking/timestamping | ||
520 | for more information on hardware timestamps. | ||
521 | |||
496 | -------------------------------------------------------------------------------- | 522 | -------------------------------------------------------------------------------- |
497 | + THANKS | 523 | + THANKS |
498 | -------------------------------------------------------------------------------- | 524 | -------------------------------------------------------------------------------- |