]> The Tcpdump Group git mirrors - libpcap/blob - pcap.3
Add support for Frame Relay as a link-layer type; the header is the
[libpcap] / pcap.3
1 .\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.33 2002-07-11 08:12:34 guy Exp $
2 .\"
3 .\" Copyright (c) 1994, 1996, 1997
4 .\" The Regents of the University of California. All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that: (1) source code distributions
8 .\" retain the above copyright notice and this paragraph in its entirety, (2)
9 .\" distributions including binary code include the above copyright notice and
10 .\" this paragraph in its entirety in the documentation or other materials
11 .\" provided with the distribution, and (3) all advertising materials mentioning
12 .\" features or use of this software display the following acknowledgement:
13 .\" ``This product includes software developed by the University of California,
14 .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
15 .\" the University nor the names of its contributors may be used to endorse
16 .\" or promote products derived from this software without specific prior
17 .\" written permission.
18 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
19 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
20 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 .\"
22 .TH PCAP 3 "3 January 2001"
23 .SH NAME
24 pcap \- Packet Capture library
25 .SH SYNOPSIS
26 .nf
27 .ft B
28 #include <pcap.h>
29 .ft
30 .LP
31 .nf
32 .ft B
33 char errbuf[PCAP_ERRBUF_SIZE];
34 .ft
35 .LP
36 .ft B
37 pcap_t *pcap_open_live(char *device, int snaplen,
38 .ti +8
39 int promisc, int to_ms, char *errbuf)
40 pcap_t *pcap_open_dead(int linktype, int snaplen)
41 pcap_t *pcap_open_offline(char *fname, char *errbuf)
42 pcap_dumper_t *pcap_dump_open(pcap_t *p, char *fname)
43 .ft
44 .LP
45 .ft B
46 int pcap_setnonblock(pcap_t *p, int nonblock, char *errbuf);
47 int pcap_getnonblock(pcap_t *p, char *errbuf);
48 .ft
49 .LP
50 .ft B
51 int pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
52 void pcap_freealldevs(pcap_if_t *)
53 char *pcap_lookupdev(char *errbuf)
54 int pcap_lookupnet(char *device, bpf_u_int32 *netp,
55 .ti +8
56 bpf_u_int32 *maskp, char *errbuf)
57 .ft
58 .LP
59 .ft B
60 int pcap_dispatch(pcap_t *p, int cnt,
61 .ti +8
62 pcap_handler callback, u_char *user)
63 int pcap_loop(pcap_t *p, int cnt,
64 .ti +8
65 pcap_handler callback, u_char *user)
66 void pcap_dump(u_char *user, struct pcap_pkthdr *h,
67 .ti +8
68 u_char *sp)
69 .ft
70 .LP
71 .ft B
72 int pcap_compile(pcap_t *p, struct bpf_program *fp,
73 .ti +8
74 char *str, int optimize, bpf_u_int32 netmask)
75 int pcap_setfilter(pcap_t *p, struct bpf_program *fp)
76 void pcap_freecode(struct bpf_program *);
77 .ft
78 .LP
79 .ft B
80 u_char *pcap_next(pcap_t *p, struct pcap_pkthdr *h)
81 .ft
82 .LP
83 .ft B
84 int pcap_datalink(pcap_t *p)
85 int pcap_snapshot(pcap_t *p)
86 int pcap_is_swapped(pcap_t *p)
87 int pcap_major_version(pcap_t *p)
88 int pcap_minor_version(pcap_t *p)
89 int pcap_stats(pcap_t *p, struct pcap_stat *ps)
90 FILE *pcap_file(pcap_t *p)
91 int pcap_fileno(pcap_t *p)
92 void pcap_perror(pcap_t *p, char *prefix)
93 char *pcap_geterr(pcap_t *p)
94 char *pcap_strerror(int error)
95 .ft
96 .LP
97 .ft B
98 void pcap_close(pcap_t *p)
99 void pcap_dump_close(pcap_dumper_t *p)
100 .ft
101 .fi
102 .SH DESCRIPTION
103 The Packet Capture library
104 provides a high level interface to packet capture systems. All packets
105 on the network, even those destined for other hosts, are accessible
106 through this mechanism.
107 .PP
108 .SH ROUTINES
109 NOTE:
110 .I errbuf
111 in
112 .BR pcap_open_live() ,
113 .BR pcap_open_dead() ,
114 .BR pcap_open_offline() ,
115 .BR pcap_setnonblock() ,
116 .BR pcap_getnonblock() ,
117 .BR pcap_findalldevs() ,
118 .BR pcap_lookupdev() ,
119 and
120 .B pcap_lookupnet()
121 is assumed to be able to hold at least
122 .B PCAP_ERRBUF_SIZE
123 chars.
124 .PP
125 .B pcap_open_live()
126 is used to obtain a packet capture descriptor to look
127 at packets on the network.
128 .I device
129 is a string that specifies the network device to open; on Linux systems
130 with 2.2 or later kernels, a
131 .I device
132 argument of "any" or
133 .B NULL
134 can be used to capture packets from all interfaces.
135 .I snaplen
136 specifies the maximum number of bytes to capture.
137 .I promisc
138 specifies if the interface is to be put into promiscuous mode.
139 (Note that even if this parameter is false, the interface
140 could well be in promiscuous mode for some other reason.) For now, this
141 doesn't work on the "any" device; if an argument of "any" or NULL is
142 supplied, the
143 .I promisc
144 flag is ignored.
145 .I to_ms
146 specifies the read timeout in milliseconds. The read timeout is used to
147 arrange that the read not necessarily return immediately when a packet
148 is seen, but that it wait for some amount of time to allow more packets
149 to arrive and to read multiple packets from the OS kernel in one
150 operation. Not all platforms support a read timeout; on platforms that
151 don't, the read timeout is ignored.
152 .I errbuf
153 is used to return error or warning text. It will be set to error text when
154 .B pcap_open_live()
155 fails and returns
156 .BR NULL .
157 .I errbuf
158 may also be set to warning text when
159 .B pcap_open_live()
160 succeds; to detect this case the caller should store a zero-length string in
161 .I errbuf
162 before calling
163 .B pcap_open_live()
164 and display the warning to the user if
165 .I errbuf
166 is no longer a zero-length string.
167 .PP
168 .B pcap_open_dead()
169 is used for creating a
170 .B pcap_t
171 structure to use when calling the other functions in libpcap. It is
172 typically used when just using libpcap for compiling BPF code.
173 .PP
174 .B pcap_open_offline()
175 is called to open a ``savefile'' for reading.
176 .I fname
177 specifies the name of the file to open. The file has
178 the same format as those used by
179 .B tcpdump(1)
180 and
181 .BR tcpslice(1) .
182 The name "-" in a synonym for
183 .BR stdin .
184 .I errbuf
185 is used to return error text and is only set when
186 .B pcap_open_offline()
187 fails and returns
188 .BR NULL .
189 .PP
190 .B pcap_dump_open()
191 is called to open a ``savefile'' for writing. The name "-" in a synonym
192 for
193 .BR stdout .
194 .B NULL
195 is returned on failure.
196 .I p
197 is a
198 .I pcap
199 struct as returned by
200 .B pcap_open_offline()
201 or
202 .BR pcap_open_live() .
203 .I fname
204 specifies the name of the file to open.
205 If
206 .B NULL
207 is returned,
208 .B pcap_geterr()
209 can be used to get the error text.
210 .PP
211 .B pcap_setnonblock()
212 puts a capture descriptor, opened with
213 .BR pcap_open_live() ,
214 into ``non-blocking'' mode, or takes it out of ``non-blocking'' mode,
215 depending on whether the
216 .I nonblock
217 argument is non-zero or zero. It has no effect on ``savefiles''.
218 If there is an error, \-1 is returned and
219 .I errbuf
220 is filled in with an appropriate error message; otherwise, 0 is
221 returned.
222 In
223 ``non-blocking'' mode, an attempt to read from the capture descriptor
224 with
225 .B pcap_dispatch()
226 will, if no packets are currently available to be read, return 0
227 immediately rather than blocking waiting for packets to arrive.
228 .B pcap_loop()
229 and
230 .B pcap_next()
231 will not work in ``non-blocking'' mode.
232 .PP
233 .B pcap_getnonblock()
234 returns the current ``non-blocking'' state of the capture descriptor; it
235 always returns 0 on ``savefiles''.
236 If there is an error, \-1 is returned and
237 .I errbuf
238 is filled in with an appropriate error message.
239 .PP
240 .B pcap_findalldevs()
241 constructs a list of network devices that can be opened with
242 .BR pcap_open_live() .
243 (Note that there may be network devices that cannot be opened with
244 .BR pcap_open_live()
245 by the
246 process calling
247 .BR pcap_findalldevs() ,
248 because, for example, that process might not have sufficient privileges
249 to open them for capturing; if so, those devices will not appear on the
250 list.)
251 .I alldevsp
252 is set to point to the first element of the list; each element of the
253 list is of type
254 .BR pcap_if_t ,
255 and has the following members:
256 .RS
257 .TP
258 .B next
259 if not
260 .BR NULL ,
261 a pointer to the next element in the list;
262 .B NULL
263 for the last element of the list
264 .TP
265 .B name
266 a pointer to a string giving a name for the device to pass to
267 .B pcap_open_live()
268 .TP
269 .B description
270 if not
271 .BR NULL ,
272 a pointer to a string giving a human-readable description of the device
273 .TP
274 .B addresses
275 a pointer to the first element of a list of addresses for the interface
276 .TP
277 .B flags
278 interface flags:
279 .RS
280 .TP
281 .B PCAP_IF_LOOPBACK
282 set if the interface is a loopback interface
283 .RE
284 .RE
285 .PP
286 Each element of the list of addresses is of type
287 .BR pcap_addr_t ,
288 and has the following members:
289 .RS
290 .TP
291 .B next
292 if not
293 .BR NULL ,
294 a pointer to the next element in the list;
295 .B NULL
296 for the last element of the list
297 .TP
298 .B addr
299 a pointer to a
300 .B "struct sockaddr"
301 containing an address
302 .TP
303 .B netmask
304 if not
305 .BR NULL ,
306 a pointer to a
307 .B "struct sockaddr"
308 that contains the netmask corresponding to the address pointed to by
309 .B addr
310 .TP
311 .B broadaddr
312 if not
313 .BR NULL ,
314 a pointer to a
315 .B "struct sockaddr"
316 that contains the broadcast address corresponding to the address pointed
317 to by
318 .BR addr ;
319 may be null if the interface doesn't support broadcasts
320 .TP
321 .B dstaddr
322 if not
323 .BR NULL ,
324 a pointer to a
325 .B "struct sockaddr"
326 that contains the destination address corresponding to the address pointed
327 to by
328 .BR addr ;
329 may be null if the interface isn't a point-to-point interface
330 .RE
331 .PP
332 .B pcap_freealldevs()
333 is used to free a list allocated by
334 .BR pcap_findalldevs() .
335 .PP
336 .B pcap_lookupdev()
337 returns a pointer to a network device suitable for use with
338 .B pcap_open_live()
339 and
340 .BR pcap_lookupnet() .
341 If there is an error,
342 .B NULL
343 is returned and
344 .I errbuf
345 is filled in with an appropriate error message.
346 .PP
347 .B pcap_lookupnet()
348 is used to determine the network number and mask
349 associated with the network device
350 .BR device .
351 Both
352 .I netp
353 and
354 .I maskp
355 are
356 .I bpf_u_int32
357 pointers.
358 A return of \-1 indicates an error in which case
359 .I errbuf
360 is filled in with an appropriate error message.
361 .PP
362 .B pcap_dispatch()
363 is used to collect and process packets.
364 .I cnt
365 specifies the maximum number of packets to process before returning.
366 This is not a minimum number; when reading a live capture, only one
367 bufferful of packets is read at a time, so fewer than
368 .I cnt
369 packets may be processed. A
370 .I cnt
371 of \-1 processes all the packets received in one buffer when reading a
372 live capture, or all the packets in the file when reading a
373 ``savefile''.
374 .I callback
375 specifies a routine to be called with three arguments:
376 a
377 .I u_char
378 pointer which is passed in from
379 .BR pcap_dispatch() ,
380 a
381 .I const struct pcap_pkthdr
382 pointer to a structure with the following members:
383 .RS
384 .TP
385 .B ts
386 a
387 .I struct timeval
388 containing the time when the packet was captured
389 .TP
390 .B caplen
391 a
392 .I bpf_u_int32
393 giving the number of bytes of the packet that are available from the
394 capture
395 .TP
396 .B len
397 a
398 .I bpf_u_int32
399 giving the length of the packet, in bytes (which might be more than the
400 number of bytes available from the capture, if the length of the packet
401 is larger than the maximum number of bytes to capture)
402 .RE
403 .PP
404 and a
405 .I const u_char
406 pointer to the packet data.
407 .PP
408 The number of packets read is returned.
409 0 is returned if no packets were read from a live capture (if, for
410 example, they were discarded because they didn't pass the packet filter,
411 or if, on platforms that support a read timeout that starts before any
412 packets arrive, the timeout expires before any packets arrive, or if the
413 file descriptor for the capture device is in non-blocking mode and no
414 packets were available to be read) or if no more packets are available
415 in a ``savefile.'' A return of \-1 indicates
416 an error in which case
417 .B pcap_perror()
418 or
419 .B pcap_geterr()
420 may be used to display the error text.
421 .PP
422 .BR NOTE :
423 when reading a live capture,
424 .B pcap_dispatch()
425 will not necessarily return when the read times out; on some platforms,
426 the read timeout isn't supported, and, on other platforms, the timer
427 doesn't start until at least one packet arrives. This means that the
428 read timeout should
429 .B NOT
430 be used in, for example, an interactive application, to allow the packet
431 capture loop to ``poll'' for user input periodically, as there's no
432 guarantee that
433 .B pcap_dispatch()
434 will return after the timeout expires.
435 .PP
436 .B pcap_loop()
437 is similar to
438 .B pcap_dispatch()
439 except it keeps reading packets until
440 .I cnt
441 packets are processed or an error occurs.
442 It does
443 .B not
444 return when live read timeouts occur.
445 Rather, specifying a non-zero read timeout to
446 .B pcap_open_live()
447 and then calling
448 .B pcap_dispatch()
449 allows the reception and processing of any packets that arrive when the
450 timeout occurs.
451 A negative
452 .I cnt
453 causes
454 .B pcap_loop()
455 to loop forever (or at least until an error occurs). A negative number
456 is returned on an error; 0 is returned if
457 .I cnt
458 is exhausted.
459 .PP
460 .B pcap_next()
461 reads the next packet (by calling
462 .B pcap_dispatch()
463 with a
464 .I cnt
465 of 1) and returns a
466 .I u_char
467 pointer to the data in that packet. (The
468 .I pcap_pkthdr
469 struct for that packet is not supplied.)
470 .PP
471 .B pcap_dump()
472 outputs a packet to the ``savefile'' opened with
473 .BR pcap_dump_open() .
474 Note that its calling arguments are suitable for use with
475 .B pcap_dispatch()
476 or
477 .BR pcap_loop() .
478 If called directly, the
479 .I user
480 parameter is of type
481 .I pcap_dumper_t
482 as returned by
483 .BR pcap_dump_open() .
484 .PP
485 .B pcap_compile()
486 is used to compile the string
487 .I str
488 into a filter program.
489 .I program
490 is a pointer to a
491 .I bpf_program
492 struct and is filled in by
493 .BR pcap_compile() .
494 .I optimize
495 controls whether optimization on the resulting code is performed.
496 .I netmask
497 specifies the netmask of the local net.
498 A return of \-1 indicates an error in which case
499 .BR pcap_geterr()
500 may be used to display the error text.
501 .PP
502 .B pcap_compile_nopcap()
503 is similar to
504 .B pcap_compile()
505 except that instead of passing a pcap structure, one passes the
506 snaplen and linktype explicitly. It is intended to be used for
507 compiling filters for direct BPF usage, without necessarily having
508 called
509 .BR pcap_open() .
510 A return of \-1 indicates an error; the error text is unavailable.
511 .RB ( pcap_compile_nopcap()
512 is a wrapper around
513 .BR pcap_open_dead() ,
514 .BR pcap_compile() ,
515 and
516 .BR pcap_close() ;
517 the latter three routines can be used directly in order to get the error
518 text for a compilation error.)
519 .B
520 .PP
521 .B pcap_setfilter()
522 is used to specify a filter program.
523 .I fp
524 is a pointer to a
525 .I bpf_program
526 struct, usually the result of a call to
527 .BR pcap_compile() .
528 .B \-1
529 is returned on failure, in which case
530 .BR pcap_geterr()
531 may be used to display the error text;
532 .B 0
533 is returned on success.
534 .PP
535 .B pcap_freecode()
536 is used to free up allocated memory pointed to by a
537 .I bpf_program
538 struct generated by
539 .B pcap_compile()
540 when that BPF program is no longer needed, for example after it
541 has been made the filter program for a pcap structure by a call to
542 .BR pcap_setfilter() .
543 .PP
544 .B pcap_datalink()
545 returns the link layer type; link layer types it can return include:
546 .PP
547 .RS 5
548 .TP 5
549 .B DLT_NULL
550 BSD loopback encapsulation; the link layer header is a 4-byte field, in
551 .I host
552 byte order, containing a PF_ value from
553 .B socket.h
554 for the network-layer protocol of the packet
555 .IP
556 Note that ``host byte order'' is the byte order of the machine on which
557 the packets are captured, and the PF_ values are for the OS of the
558 machine on which the packets are captured; if a live capture is being
559 done, ``host byte order'' is the byte order of the machine capturing the
560 packets, and the PF_ values are those of the OS of the machine capturing
561 the packets, but if a ``savefile'' is being read, the byte order and PF_
562 values are
563 .I not
564 necessarily those of the machine reading the capture file.
565 .TP 5
566 .B DLT_EN10MB
567 Ethernet (10Mb, 100Mb, 1000Mb, and up)
568 .TP 5
569 .B DLT_IEEE802
570 IEEE 802.5 Token Ring
571 .TP 5
572 .B DLT_ARCNET
573 ARCNET
574 .TP 5
575 .B DLT_SLIP
576 SLIP; the link layer header contains, in order:
577 .RS 10
578 .LP
579 a 1-byte flag, which is 0 for packets received by the machine and 1 for
580 packets sent by the machine;
581 .LP
582 a 1-byte field, the upper 4 bits of which indicate the type of packet,
583 as per RFC 1144:
584 .RS 5
585 .TP 5
586 0x40
587 an unmodified IP datagram (TYPE_IP);
588 .TP 5
589 0x70
590 an uncompressed-TCP IP datagram (UNCOMPRESSED_TCP), with that byte being
591 the first byte of the raw IP header on the wire, containing the
592 connection number in the protocol field;
593 .TP 5
594 0x80
595 a compressed-TCP IP datagram (COMPRESSED_TCP), with that byte being the
596 first byte of the compressed TCP/IP datagram header;
597 .RE
598 .LP
599 for UNCOMPRESSED_TCP, the rest of the modified IP header, and for
600 COMPRESSED_TCP, the compressed TCP/IP datagram header;
601 .RE
602 .RS 5
603 .LP
604 for a total of 16 bytes; the uncompressed IP datagram follows the header
605 .RE
606 .TP 5
607 .B DLT_PPP
608 PPP; if the first 2 bytes are 0xff and 0x03, it's PPP in HDLC-like
609 framing, with the PPP header following those two bytes, otherwise it's
610 PPP without framing, and the packet begins with the PPP header
611 .TP 5
612 .B DLT_FDDI
613 FDDI
614 .TP 5
615 .B DLT_ATM_RFC1483
616 RFC 1483 LLC/SNAP-encapsulated ATM; the packet begins with an IEEE 802.2
617 LLC header
618 .TP 5
619 .B DLT_RAW
620 raw IP; the packet begins with an IP header
621 .TP 5
622 .B DLT_PPP_SERIAL
623 PPP in HDLC-like framing, as per RFC 1662, or Cisco PPP with HDLC
624 framing, as per section 4.3.1 of RFC 1547; the first byte will be 0xFF
625 for PPP in HDLC-like framing, and will be 0x0F or 0x8F for Cisco PPP
626 with HDLC framing
627 .TP 5
628 .B DLT_PPP_ETHER
629 PPPoE; the packet begins with a PPPoE header, as per RFC 2516
630 .TP 5
631 .B DLT_C_HDLC
632 Cisco PPP with HDLC framing, as per section 4.3.1 of RFC 1547
633 .TP 5
634 .B DLT_IEEE802_11
635 IEEE 802.11 wireless LAN
636 .TP 5
637 .B DLT_FRELAY
638 Frame Relay
639 .TP 5
640 .B DLT_LOOP
641 OpenBSD loopback encapsulation; the link layer header is a 4-byte field, in
642 .I network
643 byte order, containing a PF_ value from OpenBSD's
644 .B socket.h
645 for the network-layer protocol of the packet
646 .IP
647 Note that, if a ``savefile'' is being read, those PF_ values are
648 .I not
649 necessarily those of the machine reading the capture file.
650 .TP 5
651 .B DLT_LINUX_SLL
652 Linux "cooked" capture encapsulation; the link layer header contains, in
653 order:
654 .RS 10
655 .LP
656 a 2-byte "packet type", in network byte order, which is one of:
657 .RS 5
658 .TP 5
659 0
660 packet was sent to us by somebody else
661 .TP 5
662 1
663 packet was broadcast by somebody else
664 .TP 5
665 2
666 packet was multicast, but not broadcast, by somebody else
667 .TP 5
668 3
669 packet was sent by somebody else to somebody else
670 .TP 5
671 4
672 packet was sent by us
673 .RE
674 .LP
675 a 2-byte field, in network byte order, containing a Linux ARPHRD_ value
676 for the link layer device type;
677 .LP
678 a 2-byte field, in network byte order, containing the length of the
679 link layer address of the sender of the packet (which could be 0);
680 .LP
681 an 8-byte field containing that number of bytes of the link layer header
682 (if there are more than 8 bytes, only the first 8 are present);
683 .LP
684 a 2-byte field containing an Ethernet protocol type, in network byte
685 order, or containing 1 for Novell 802.3 frames without an 802.2 LLC
686 header or 4 for frames beginning with an 802.2 LLC header.
687 .RE
688 .TP 5
689 .B DLT_LTALK
690 Apple LocalTalk; the packet begins with an AppleTalk LLAP header
691 .RE
692 .PP
693 .B pcap_snapshot()
694 returns the snapshot length specified when
695 .B pcap_open_live
696 was called.
697 .PP
698 .B pcap_is_swapped()
699 returns true if the current ``savefile'' uses a different byte order
700 than the current system.
701 .PP
702 .B pcap_major_version()
703 returns the major number of the version of the pcap used to write the
704 savefile.
705 .PP
706 .B pcap_minor_version()
707 returns the minor number of the version of the pcap used to write the
708 savefile.
709 .PP
710 .B pcap_file()
711 returns the standard I/O stream of the ``savefile,'' if a ``savefile''
712 was opened with
713 .BR pcap_open_offline() ,
714 or NULL, if a network device was opened with
715 .BR pcap_open_live() .
716 .PP
717 .B pcap_stats()
718 returns 0 and fills in a
719 .B pcap_stat
720 struct. The values represent packet statistics from the start of the
721 run to the time of the call. If there is an error or the underlying
722 packet capture doesn't support packet statistics, \-1 is returned and
723 the error text can be obtained with
724 .B pcap_perror()
725 or
726 .BR pcap_geterr() .
727 .B pcap_stats()
728 is supported only on live captures, not on ``savefiles''; no statistics
729 are stored in ``savefiles'', so no statistics are available when reading
730 from a ``savefile''.
731 .PP
732 .B pcap_fileno()
733 returns the file descriptor number from which captured packets are read,
734 if a network device was opened with
735 .BR pcap_open_live() ,
736 or \-1, if a ``savefile'' was opened with
737 .BR pcap_open_offline() .
738 .PP
739 .B pcap_perror()
740 prints the text of the last pcap library error on
741 .BR stderr ,
742 prefixed by
743 .IR prefix .
744 .PP
745 .B pcap_geterr()
746 returns the error text pertaining to the last pcap library error.
747 .BR NOTE :
748 the pointer it returns will no longer point to a valid error message
749 string after the
750 .B pcap_t
751 passed to it is closed; you must use or copy the string before closing
752 the
753 .BR pcap_t .
754 .PP
755 .B pcap_strerror()
756 is provided in case
757 .BR strerror (1)
758 isn't available.
759 .PP
760 .B pcap_close()
761 closes the files associated with
762 .I p
763 and deallocates resources.
764 .PP
765 .B pcap_dump_close()
766 closes the ``savefile.''
767 .PP
768 .SH SEE ALSO
769 tcpdump(1), tcpslice(1)
770 .SH AUTHORS
771 The original authors are:
772 .LP
773 Van Jacobson,
774 Craig Leres and
775 Steven McCanne, all of the
776 Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
777 .LP
778 The current version is available from "The Tcpdump Group"'s Web site at
779 .LP
780 .RS
781 .I http://www.tcpdump.org/
782 .RE
783 .SH BUGS
784 Please send problems, bugs, questions, desirable enhancements, etc. to:
785 .LP
786 .RS
787 tcpdump-workers@tcpdump.org
788 .RE
789 .LP
790 Please send source code contributions, etc. to:
791 .LP
792 .RS
793 patches@tcpdump.org
794 .RE