From 87e011637cf99dcc57c2aefd4b6185fea10c3aee Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Mon, 10 Jun 2002 15:45:30 +0000 Subject: Add #define HAVE_PCAP_H 1 to config.h.win32. In libpcap.c, move wtap_pcap_encap_to_wtap_encap before libpcap_open so that if HAVE_PCAP_H is not true, the file will still compile. svn path=/trunk/; revision=5660 --- wiretap/libpcap.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'wiretap/libpcap.c') diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index afd419121c..2e2cfe65cf 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -1,6 +1,6 @@ /* libpcap.c * - * $Id: libpcap.c,v 1.76 2002/06/07 21:11:24 guy Exp $ + * $Id: libpcap.c,v 1.77 2002/06/10 15:45:30 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez @@ -390,6 +390,18 @@ static const struct { }; #define NUM_PCAP_ENCAPS (sizeof pcap_to_wtap_map / sizeof pcap_to_wtap_map[0]) +int wtap_pcap_encap_to_wtap_encap(int encap) +{ + unsigned int i; + + for (i = 0; i < NUM_PCAP_ENCAPS; i++) { + if (pcap_to_wtap_map[i].dlt_value == encap) + return pcap_to_wtap_map[i].wtap_encap_value; + } + return WTAP_ENCAP_UNKNOWN; +} + + int libpcap_open(wtap *wth, int *err) { int bytes_read; @@ -1140,17 +1152,6 @@ libpcap_close(wtap *wth) g_free(wth->capture.pcap); } -int wtap_pcap_encap_to_wtap_encap(int encap) -{ - unsigned int i; - - for (i = 0; i < NUM_PCAP_ENCAPS; i++) { - if (pcap_to_wtap_map[i].dlt_value == encap) - return pcap_to_wtap_map[i].wtap_encap_value; - } - return WTAP_ENCAP_UNKNOWN; -} - static int wtap_wtap_encap_to_pcap_encap(int encap) { unsigned int i; -- cgit v1.2.3