Apply Partial RELRO
[platform/upstream/libpcap.git] / pcap_list_tstamp_types.3pcap.in
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 .\"
21 .TH PCAP_LIST_TSTAMP_TYPES 3PCAP "22 August 2018"
22 .SH NAME
23 pcap_list_tstamp_types, pcap_free_tstamp_types \- get a list of time
24 stamp types supported by a capture device, and free that list
25 .SH SYNOPSIS
26 .nf
27 .ft B
28 #include <pcap/pcap.h>
29 .ft
30 .LP
31 .ft B
32 int pcap_list_tstamp_types(pcap_t *p, int **tstamp_typesp);
33 void pcap_free_tstamp_types(int *tstamp_types);
34 .ft
35 .fi
36 .SH DESCRIPTION
37 .B pcap_list_tstamp_types()
38 is used to get a list of the supported time stamp types of the interface
39 associated with the pcap descriptor.
40 .B pcap_list_tstamp_types()
41 allocates an array to hold the list and sets
42 .I *tstamp_typesp
43 to point to the array.
44 See
45 .BR pcap-tstamp (@MAN_MISC_INFO@)
46 for a list of all the time stamp types.
47 .PP
48 The caller is responsible for freeing the array with
49 .BR pcap_free_tstamp_types() ,
50 which frees the list pointed to by
51 .IR tstamp_types .
52 .SH RETURN VALUE
53 .B pcap_list_tstamp_types()
54 returns the number of time stamp types in the array on success and
55 .B PCAP_ERROR
56 on failure.
57 A return value of one means that the only time stamp type supported is
58 the one in the list, which is the capture device's default time stamp
59 type.  A return value of zero means that the only time stamp type
60 supported is
61 .BR PCAP_TSTAMP_HOST ,
62 which is the capture device's default time stamp type (only older
63 versions of libpcap will return that; newer versions will always return
64 one or more types).
65 If
66 .B PCAP_ERROR
67 is returned,
68 .B pcap_geterr(3PCAP)
69 or
70 .B pcap_perror(3PCAP)
71 may be called with
72 .I p
73 as an argument to fetch or display the error text.
74 .SH BACKWARD COMPATIBILITY
75 .PP
76 These functions became available in libpcap release 1.2.1.  In previous
77 releases, the time stamp type cannot be set; only the default time stamp
78 type offered by a capture source is available.
79 .SH SEE ALSO
80 pcap(3PCAP), pcap_tstamp_type_val_to_name(3PCAP),
81 pcap-tstamp(@MAN_MISC_INFO@)