pcap_set_tstamp_precision.3pcap 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. .TH PCAP_SET_TSTAMP_PRECISION 3PCAP "5 February 2015"
  22. .SH NAME
  23. pcap_set_tstamp_precision \- set the time stamp precision returned in
  24. captures
  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_precision(pcap_t *p, int tstamp_precision);
  33. .ft
  34. .fi
  35. .SH DESCRIPTION
  36. .B pcap_set_tstamp_precision()
  37. sets the precision of the time stamp desired for packets captured on the pcap
  38. descriptor to the type specified by
  39. .IR tstamp_precision .
  40. It must be called on a pcap descriptor created by
  41. .B pcap_create()
  42. that has not yet been activated by
  43. .BR pcap_activate() .
  44. Two time stamp precisions are supported, microseconds and nanoseconds. One can
  45. use options
  46. .B PCAP_TSTAMP_PRECISION_MICRO and
  47. .B PCAP_TSTAMP_PRECISION_NANO
  48. to request desired precision. By default, time stamps are in microseconds.
  49. .SH RETURN VALUE
  50. .B pcap_set_tstamp_precision()
  51. returns 0 on success if the specified time stamp precision is expected to be
  52. supported by the operating system,
  53. .B PCAP_ERROR_TSTAMP_PRECISION_NOTSUP
  54. if operating system does not support requested time stamp precision,
  55. .B PCAP_ERROR_ACTIVATED
  56. if called on a capture handle that has been activated.
  57. .SH SEE ALSO
  58. pcap(3PCAP),
  59. pcap_get_tstamp_precision(3PCAP),
  60. pcap-tstamp(7)