Elliott Hughes | 965a4b5 | 2017-05-15 10:37:39 -0700 | [diff] [blame] | 1 | .\"Copyright (c) 2013, Michal Sekletar |
| 2 | .\"All rights reserved. |
| 3 | .\" |
| 4 | .\"Redistribution and use in source and binary forms, with or without |
| 5 | .\"modification, are permitted provided that the following conditions |
| 6 | .\"are met: |
| 7 | .\" |
| 8 | .\" 1. Redistributions of source code must retain the above copyright |
| 9 | .\" notice, this list of conditions and the following disclaimer. |
| 10 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 11 | .\" notice, this list of conditions and the following disclaimer in |
| 12 | .\" the documentation and/or other materials provided with the |
| 13 | .\" distribution. |
| 14 | .\" 3. The names of the authors may not be used to endorse or promote |
| 15 | .\" products derived from this software without specific prior |
| 16 | .\" written permission. |
| 17 | .\" |
| 18 | .\"THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
| 19 | .\"IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
| 20 | .\"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 21 | |
| 22 | .TH PCAP_SET_TSTAMP_PRECISION 3PCAP "5 February 2015" |
| 23 | .SH NAME |
| 24 | pcap_set_tstamp_precision \- set the time stamp precision returned in |
| 25 | captures |
| 26 | .SH SYNOPSIS |
| 27 | .nf |
| 28 | .ft B |
| 29 | #include <pcap/pcap.h> |
| 30 | .ft |
| 31 | .LP |
| 32 | .ft B |
| 33 | int pcap_set_tstamp_precision(pcap_t *p, int tstamp_precision); |
| 34 | .ft |
| 35 | .fi |
| 36 | .SH DESCRIPTION |
| 37 | .B pcap_set_tstamp_precision() |
| 38 | sets the precision of the time stamp desired for packets captured on the pcap |
| 39 | descriptor to the type specified by |
| 40 | .IR tstamp_precision . |
| 41 | It must be called on a pcap descriptor created by |
| 42 | .B pcap_create() |
| 43 | that has not yet been activated by |
| 44 | .BR pcap_activate() . |
| 45 | Two time stamp precisions are supported, microseconds and nanoseconds. One can |
| 46 | use options |
| 47 | .B PCAP_TSTAMP_PRECISION_MICRO and |
| 48 | .B PCAP_TSTAMP_PRECISION_NANO |
| 49 | to request desired precision. By default, time stamps are in microseconds. |
| 50 | .SH RETURN VALUE |
| 51 | .B pcap_set_tstamp_precision() |
| 52 | returns 0 on success if the specified time stamp precision is expected to be |
| 53 | supported by the operating system, |
| 54 | .B PCAP_ERROR_TSTAMP_PRECISION_NOTSUP |
| 55 | if operating system does not support requested time stamp precision, |
| 56 | .B PCAP_ERROR_ACTIVATED |
| 57 | if called on a capture handle that has been activated. |
| 58 | .SH SEE ALSO |
| 59 | pcap(3PCAP), |
| 60 | pcap_get_tstamp_precision(3PCAP), |
| 61 | pcap-tstamp(7) |