blob: e19d6e5fb31c22e82d94c088ca10e2a13e446fa7 [file] [log] [blame]
JP Abgrall511eca32014-02-12 13:46:45 -08001.\"
2.\" Copyright (c) 1994, 1996, 1997
3.\" The Regents of the University of California. All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that: (1) source code distributions
7.\" retain the above copyright notice and this paragraph in its entirety, (2)
8.\" distributions including binary code include the above copyright notice and
9.\" this paragraph in its entirety in the documentation or other materials
10.\" provided with the distribution, and (3) all advertising materials mentioning
11.\" features or use of this software display the following acknowledgement:
12.\" ``This product includes software developed by the University of California,
13.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14.\" the University nor the names of its contributors may be used to endorse
15.\" or promote products derived from this software without specific prior
16.\" written permission.
17.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20.\"
Haibo Huangee759ce2021-01-05 21:34:29 -080021.TH PCAP_SET_TSTAMP_TYPE 3PCAP "8 September 2019"
JP Abgrall511eca32014-02-12 13:46:45 -080022.SH NAME
23pcap_set_tstamp_type \- set the time stamp type to be used by a
24capture device
25.SH SYNOPSIS
26.nf
27.ft B
28#include <pcap/pcap.h>
29.ft
30.LP
31.ft B
32int pcap_set_tstamp_type(pcap_t *p, int tstamp_type);
33.ft
34.fi
35.SH DESCRIPTION
Haibo Huangee759ce2021-01-05 21:34:29 -080036.BR pcap_set_tstamp_type ()
Haibo Huang165065a2018-07-23 17:26:52 -070037sets the type of time stamp desired for packets captured on the pcap
JP Abgrall511eca32014-02-12 13:46:45 -080038descriptor to the type specified by
39.IR tstamp_type .
40It must be called on a pcap descriptor created by
Haibo Huangee759ce2021-01-05 21:34:29 -080041.BR pcap_create (3PCAP)
JP Abgrall511eca32014-02-12 13:46:45 -080042that has not yet been activated by
Haibo Huangee759ce2021-01-05 21:34:29 -080043.BR pcap_activate (3PCAP).
44.BR pcap_list_tstamp_types (3PCAP)
JP Abgrall511eca32014-02-12 13:46:45 -080045will give a list of the time stamp types supported by a given capture
46device.
47See
48.BR pcap-tstamp (@MAN_MISC_INFO@)
49for a list of all the time stamp types.
50.SH RETURN VALUE
Haibo Huangee759ce2021-01-05 21:34:29 -080051.BR pcap_set_tstamp_type ()
52returns
53.B 0
54on success if the specified time stamp type is expected to be
JP Abgrall511eca32014-02-12 13:46:45 -080055supported by the capture device,
56.B PCAP_WARNING_TSTAMP_TYPE_NOTSUP
Elliott Hughesd8845d72015-10-19 18:07:04 -070057if the specified time stamp type is not supported by the
JP Abgrall511eca32014-02-12 13:46:45 -080058capture device,
59.B PCAP_ERROR_ACTIVATED
60if called on a capture handle that has been activated, and
61.B PCAP_ERROR_CANTSET_TSTAMP_TYPE
Haibo Huang4ccd6832020-04-23 18:03:48 -070062if the capture device doesn't support setting the time stamp type (only
63older versions of libpcap will return that; newer versions will always
64allow the time stamp type to be set to the default type).
65.SH BACKWARD COMPATIBILITY
66.PP
67This function became available in libpcap release 1.2.1. In previous
68releases, the time stamp type cannot be set; only the default time stamp
69type offered by a capture source is available.
JP Abgrall511eca32014-02-12 13:46:45 -080070.SH SEE ALSO
Haibo Huangee759ce2021-01-05 21:34:29 -080071.BR pcap (3PCAP),
72.BR pcap_tstamp_type_name_to_val (3PCAP)