dect
/
libpcap
Archived
13
0
Fork 0

Combine documentation for allocate and free routines.

Pull the documentation for pcap_freealldevs() into the
pcap_findalldevs() man page, and pull the documentation for
pcap_free_datalinks() into the pcap_list_datalinks() man page.
This commit is contained in:
Guy Harris 2010-08-22 14:54:10 -07:00
parent bc8209b71e
commit 57935bef89
5 changed files with 25 additions and 92 deletions

View File

@ -176,9 +176,7 @@ MAN3PCAP_NOEXPAND = \
pcap_file.3pcap \
pcap_fileno.3pcap \
pcap_findalldevs.3pcap \
pcap_freealldevs.3pcap \
pcap_freecode.3pcap \
pcap_free_datalinks.3pcap \
pcap_get_selectable_fd.3pcap \
pcap_geterr.3pcap \
pcap_inject.3pcap \
@ -551,12 +549,18 @@ install: install-shared install-archive pcap-config
rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \
$(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap
ln $(DESTDIR)$(mandir)/man3/pcap_findalldevs.3pcap \
$(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \
$(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \
$(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap
ln $(DESTDIR)$(mandir)/man3/pcap_list_datalinks.3pcap \
$(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \
$(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
@ -640,8 +644,10 @@ uninstall: uninstall-shared
rm -f $(DESTDIR)$(mandir)/man3/$$i; done
rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap

View File

@ -21,7 +21,8 @@
.\"
.TH PCAP_FINDALLDEVS 3PCAP "5 April 2008"
.SH NAME
pcap_findalldevs \- get a list of capture devices
pcap_findalldevs, pcap_freealldevs \- get a list of capture devices, and
free that list
.SH SYNOPSIS
.nf
.ft B
@ -35,6 +36,7 @@ char errbuf[PCAP_ERRBUF_SIZE];
.LP
.ft B
int pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf);
void pcap_freealldevs(pcap_if_t *alldevs);
.ft
.fi
.SH DESCRIPTION
@ -140,7 +142,9 @@ member of the
before interpreting the contents of the address.
.PP
The list of devices must be freed with
.BR pcap_freealldevs() .
.BR pcap_freealldevs() ,
whch frees the list pointed to by
.IR alldevs .
.SH RETURN VALUE
.B pcap_findalldevs()
returns 0 on success and \-1 on failure.
@ -153,4 +157,4 @@ is assumed to be able to hold at least
chars.
.SH SEE ALSO
pcap(3PCAP), pcap_create(3PCAP), pcap_activate(3PCAP),
pcap_open_live(3PCAP), pcap_freealldevs(3PCAP)
pcap_open_live(3PCAP)

View File

@ -1,41 +0,0 @@
.\" @(#) $Header: /tcpdump/master/libpcap/pcap_free_datalinks.3pcap,v 1.1 2008-05-26 19:58:06 guy Exp $
.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that: (1) source code distributions
.\" retain the above copyright notice and this paragraph in its entirety, (2)
.\" distributions including binary code include the above copyright notice and
.\" this paragraph in its entirety in the documentation or other materials
.\" provided with the distribution, and (3) all advertising materials mentioning
.\" features or use of this software display the following acknowledgement:
.\" ``This product includes software developed by the University of California,
.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
.\" the University nor the names of its contributors may be used to endorse
.\" or promote products derived from this software without specific prior
.\" written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.TH PCAP_FREE_DATALINKS 3PCAP "26 May 2008"
.SH NAME
pcap_free_datalinks \- free a list of link-layer header types from
pcap_get_datalinks()
.SH SYNOPSIS
.nf
.ft B
#include <pcap/pcap.h>
.ft
.LP
.ft B
void pcap_free_datalinks(int *dlt_list);
.ft
.fi
.SH DESCRIPTION
.B pcap_free_datalinks()
is used to free a list of supported data link types returned by
.BR pcap_list_datalinks() .
.SH SEE ALSO
pcap(3PCAP), pcap_list_datalinks(3PCAP)

View File

@ -1,40 +0,0 @@
.\" @(#) $Header: /tcpdump/master/libpcap/pcap_freealldevs.3pcap,v 1.3 2008-04-06 02:53:22 guy Exp $
.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that: (1) source code distributions
.\" retain the above copyright notice and this paragraph in its entirety, (2)
.\" distributions including binary code include the above copyright notice and
.\" this paragraph in its entirety in the documentation or other materials
.\" provided with the distribution, and (3) all advertising materials mentioning
.\" features or use of this software display the following acknowledgement:
.\" ``This product includes software developed by the University of California,
.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
.\" the University nor the names of its contributors may be used to endorse
.\" or promote products derived from this software without specific prior
.\" written permission.
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.TH PCAP_FREEALLDEVS 3PCAP "5 April 2008"
.SH NAME
pcap_freealldevs \- free a list of capture devices
.SH SYNOPSIS
.nf
.ft B
#include <pcap/pcap.h>
.ft
.LP
.ft B
void pcap_freealldevs(pcap_if_t *alldevs);
.ft
.fi
.SH DESCRIPTION
.B pcap_freealldevs()
is used to free a list allocated by
.BR pcap_findalldevs() .
.SH SEE ALSO
pcap(3PCAP), pcap_findalldevs(3PCAP)

View File

@ -21,8 +21,8 @@
.\"
.TH PCAP_LIST_DATALINKS 3PCAP "5 April 2008"
.SH NAME
pcap_list_datalinks \- get a list of link-layer header types supported
by a capture device
pcap_list_datalinks, pcap_free_datalinks \- get a list of link-layer header
types supported by a capture device, and free that list
.SH SYNOPSIS
.nf
.ft B
@ -31,6 +31,7 @@ by a capture device
.LP
.ft B
int pcap_list_datalinks(pcap_t *p, int **dlt_buf);
void pcap_free_datalinks(int *dlt_list);
.ft
.fi
.SH DESCRIPTION
@ -39,9 +40,13 @@ is used to get a list of the supported data link types of the interface
associated with the pcap descriptor.
.B pcap_list_datalinks()
allocates an array to hold the list and sets
.IR *dlt_buf .
.IR *dlt_buf
to point to that array.
.LP
The caller is responsible for freeing the array with
.BR pcap_free_datalinks (3PCAP).
.BR pcap_free_datalinks() ,
which frees the list of data links pointed to by
.IR dlt_list .
.SH RETURN VALUE
.B pcap_list_datalinks()
returns the number of data link types in the array on success and \-1
@ -54,5 +59,4 @@ may be called with
.I p
as an argument to fetch or display the error text.
.SH SEE ALSO
pcap(3PCAP), pcap_geterr(3PCAP), pcap_free_datalinks(3PCAP),
pcap-linktype(@MAN_MISC_INFO@)
pcap(3PCAP), pcap_geterr(3PCAP), pcap-linktype(@MAN_MISC_INFO@)