blob: 57c4ea301cf3971ee39f0edbf4d10ddae01beff2 [file] [log] [blame]
JP Abgrall511eca32014-02-12 13:46:45 -08001.\"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
Elliott Hughes965a4b52017-05-15 10:37:39 -070022.TH PCAP_SET_TSTAMP_PRECISION 3PCAP "5 February 2015"
JP Abgrall511eca32014-02-12 13:46:45 -080023.SH NAME
24pcap_set_tstamp_precision \- set the time stamp precision returned in
25captures
26.SH SYNOPSIS
27.nf
28.ft B
29#include <pcap/pcap.h>
30.ft
31.LP
32.ft B
33int pcap_set_tstamp_precision(pcap_t *p, int tstamp_precision);
34.ft
35.fi
36.SH DESCRIPTION
37.B pcap_set_tstamp_precision()
38sets the precision of the time stamp desired for packets captured on the pcap
39descriptor to the type specified by
40.IR tstamp_precision .
41It must be called on a pcap descriptor created by
42.B pcap_create()
43that has not yet been activated by
44.BR pcap_activate() .
45Two time stamp precisions are supported, microseconds and nanoseconds. One can
46use options
47.B PCAP_TSTAMP_PRECISION_MICRO and
48.B PCAP_TSTAMP_PRECISION_NANO
49to request desired precision. By default, time stamps are in microseconds.
50.SH RETURN VALUE
Elliott Hughesd8845d72015-10-19 18:07:04 -070051.B pcap_set_tstamp_precision()
JP Abgrall511eca32014-02-12 13:46:45 -080052returns 0 on success if the specified time stamp precision is expected to be
53supported by the operating system,
54.B PCAP_ERROR_TSTAMP_PRECISION_NOTSUP
55if operating system does not support requested time stamp precision,
56.B PCAP_ERROR_ACTIVATED
57if called on a capture handle that has been activated.
58.SH SEE ALSO
59pcap(3PCAP),
60pcap_get_tstamp_precision(3PCAP),
61pcap-tstamp(@MAN_MISC_INFO@)