JP Abgrall | 511eca3 | 2014-02-12 13:46:45 -0800 | [diff] [blame] | 1 | .\" |
| 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 Huang | ee759ce | 2021-01-05 21:34:29 -0800 | [diff] [blame] | 21 | .TH PCAP_SET_TSTAMP_TYPE 3PCAP "8 September 2019" |
JP Abgrall | 511eca3 | 2014-02-12 13:46:45 -0800 | [diff] [blame] | 22 | .SH NAME |
| 23 | pcap_set_tstamp_type \- set the time stamp type to be used by a |
| 24 | capture device |
| 25 | .SH SYNOPSIS |
| 26 | .nf |
| 27 | .ft B |
| 28 | #include <pcap/pcap.h> |
| 29 | .ft |
| 30 | .LP |
| 31 | .ft B |
| 32 | int pcap_set_tstamp_type(pcap_t *p, int tstamp_type); |
| 33 | .ft |
| 34 | .fi |
| 35 | .SH DESCRIPTION |
Haibo Huang | ee759ce | 2021-01-05 21:34:29 -0800 | [diff] [blame] | 36 | .BR pcap_set_tstamp_type () |
Haibo Huang | 165065a | 2018-07-23 17:26:52 -0700 | [diff] [blame] | 37 | sets the type of time stamp desired for packets captured on the pcap |
JP Abgrall | 511eca3 | 2014-02-12 13:46:45 -0800 | [diff] [blame] | 38 | descriptor to the type specified by |
| 39 | .IR tstamp_type . |
| 40 | It must be called on a pcap descriptor created by |
Haibo Huang | ee759ce | 2021-01-05 21:34:29 -0800 | [diff] [blame] | 41 | .BR pcap_create (3PCAP) |
JP Abgrall | 511eca3 | 2014-02-12 13:46:45 -0800 | [diff] [blame] | 42 | that has not yet been activated by |
Haibo Huang | ee759ce | 2021-01-05 21:34:29 -0800 | [diff] [blame] | 43 | .BR pcap_activate (3PCAP). |
| 44 | .BR pcap_list_tstamp_types (3PCAP) |
JP Abgrall | 511eca3 | 2014-02-12 13:46:45 -0800 | [diff] [blame] | 45 | will give a list of the time stamp types supported by a given capture |
| 46 | device. |
| 47 | See |
| 48 | .BR pcap-tstamp (@MAN_MISC_INFO@) |
| 49 | for a list of all the time stamp types. |
| 50 | .SH RETURN VALUE |
Haibo Huang | ee759ce | 2021-01-05 21:34:29 -0800 | [diff] [blame] | 51 | .BR pcap_set_tstamp_type () |
| 52 | returns |
| 53 | .B 0 |
| 54 | on success if the specified time stamp type is expected to be |
JP Abgrall | 511eca3 | 2014-02-12 13:46:45 -0800 | [diff] [blame] | 55 | supported by the capture device, |
| 56 | .B PCAP_WARNING_TSTAMP_TYPE_NOTSUP |
Elliott Hughes | d8845d7 | 2015-10-19 18:07:04 -0700 | [diff] [blame] | 57 | if the specified time stamp type is not supported by the |
JP Abgrall | 511eca3 | 2014-02-12 13:46:45 -0800 | [diff] [blame] | 58 | capture device, |
| 59 | .B PCAP_ERROR_ACTIVATED |
| 60 | if called on a capture handle that has been activated, and |
| 61 | .B PCAP_ERROR_CANTSET_TSTAMP_TYPE |
Haibo Huang | 4ccd683 | 2020-04-23 18:03:48 -0700 | [diff] [blame] | 62 | if the capture device doesn't support setting the time stamp type (only |
| 63 | older versions of libpcap will return that; newer versions will always |
| 64 | allow the time stamp type to be set to the default type). |
| 65 | .SH BACKWARD COMPATIBILITY |
| 66 | .PP |
| 67 | This function became available in libpcap release 1.2.1. In previous |
| 68 | releases, the time stamp type cannot be set; only the default time stamp |
| 69 | type offered by a capture source is available. |
JP Abgrall | 511eca3 | 2014-02-12 13:46:45 -0800 | [diff] [blame] | 70 | .SH SEE ALSO |
Haibo Huang | ee759ce | 2021-01-05 21:34:29 -0800 | [diff] [blame] | 71 | .BR pcap (3PCAP), |
| 72 | .BR pcap_tstamp_type_name_to_val (3PCAP) |