pcap_open_dead.3pcap.in 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. .\" Copyright (c) 1994, 1996, 1997
  2. .\" The Regents of the University of California. All rights reserved.
  3. .\"
  4. .\" Redistribution and use in source and binary forms, with or without
  5. .\" modification, are permitted provided that: (1) source code distributions
  6. .\" retain the above copyright notice and this paragraph in its entirety, (2)
  7. .\" distributions including binary code include the above copyright notice and
  8. .\" this paragraph in its entirety in the documentation or other materials
  9. .\" provided with the distribution, and (3) all advertising materials mentioning
  10. .\" features or use of this software display the following acknowledgement:
  11. .\" ``This product includes software developed by the University of California,
  12. .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
  13. .\" the University nor the names of its contributors may be used to endorse
  14. .\" or promote products derived from this software without specific prior
  15. .\" written permission.
  16. .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  17. .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  18. .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  19. .\"
  20. .TH PCAP_OPEN_DEAD 3PCAP "3 January 2014"
  21. .SH NAME
  22. pcap_open_dead, pcap_open_dead_with_tstamp_precision \- open a fake
  23. pcap_t for compiling filters or opening a capture for output
  24. .SH SYNOPSIS
  25. .nf
  26. .ft B
  27. #include <pcap/pcap.h>
  28. .ft
  29. .LP
  30. .ft B
  31. pcap_t *pcap_open_dead(int linktype, int snaplen);
  32. pcap_t *pcap_open_dead_with_tstamp_precision(int linktype, int snaplen,
  33. u_int precision);
  34. .ft
  35. .fi
  36. .SH DESCRIPTION
  37. .PP
  38. .B pcap_open_dead()
  39. and
  40. .B pcap_open_dead_with_tstamp_precision()
  41. are used for creating a
  42. .B pcap_t
  43. structure to use when calling the other functions in libpcap. It is
  44. typically used when just using libpcap for compiling BPF code; it can
  45. also be used if using
  46. .BR pcap_dump_open() ,
  47. .BR pcap_dump() ,
  48. and
  49. .B pcap_dump_close()
  50. to write a savefile if there is no
  51. .B pcap_t
  52. that supplies the packets to be written.
  53. .PP
  54. .I linktype
  55. specifies the link-layer type for the
  56. .BR pcap_t .
  57. .PP
  58. .I snaplen
  59. specifies the snapshot length for the
  60. .BR pcap_t .
  61. .PP
  62. When
  63. .BR pcap_open_dead_with_tstamp_precision() ,
  64. is used to create a
  65. .B pcap_t
  66. for use with
  67. .BR pcap_dump_open() ,
  68. .I precision
  69. specifies the time stamp precision for packets;
  70. .B PCAP_TSTAMP_PRECISION_MICRO
  71. should be specified if the packets to be written have time stamps in
  72. seconds and microseconds, and
  73. .B PCAP_TSTAMP_PRECISION_NANO
  74. should be specified if the packets to be written have time stamps in
  75. seconds and nanoseconds. Its value does not affect
  76. .BR pcap_compile() .
  77. .SH SEE ALSO
  78. pcap(3PCAP), pcap_compile(3PCAP), pcap_dump_open(3PCAP),
  79. \%pcap-linktype(@MAN_MISC_INFO@)