diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-03-04 22:33:04 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-03-04 22:33:04 +0000 |
commit | e6886d90ce0ff33ee80acf3c2ea570333d8d5a23 (patch) | |
tree | ace42d9a6e93e75bc092472896430d4bbb32fa34 /pcapio.h | |
parent | a8b8b3d9ff8b0c57008f109d7246ddb60cb31965 (diff) |
When capturing, we only support writing to libpcap files. Given that,
bypass Wiretap; that means we don't have to run the packet through
wtap_process_pcap_packet() and then undo that conversion in Wiretap if
we're just going to write it out, shortening the code path.
svn path=/trunk/; revision=17461
Diffstat (limited to 'pcapio.h')
-rw-r--r-- | pcapio.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/pcapio.h b/pcapio.h new file mode 100644 index 0000000000..801a563e49 --- /dev/null +++ b/pcapio.h @@ -0,0 +1,44 @@ +/* pcapio.h + * Declarations of our own routins for writing libpcap files. + * + * $Id$ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * Derived from code in the Wiretap Library + * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* Returns a FILE * to write to on success, NULL on failure; sets "*err" to + an error code, or 0 for a short write, on failure */ +extern FILE * +libpcap_fdopen(int fd, int linktype, int snaplen, long *bytes_written, + int *err); + +/* Write a record for a packet to a dump file. + Returns TRUE on success, FALSE on failure. */ +extern gboolean +libpcap_write_packet(FILE *fp, const struct pcap_pkthdr *phdr, const u_char *pd, + long *bytes_written, int *err); + +extern gboolean +libpcap_dump_flush(FILE *pd, int *err); + +extern gboolean +libpcap_dump_close(FILE *pd, int *err); |