diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2002-06-10 15:45:30 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2002-06-10 15:45:30 +0000 |
commit | 87e011637cf99dcc57c2aefd4b6185fea10c3aee (patch) | |
tree | 7419c2dbcf0566cce9587a5410a8b64101c3298d /wiretap/libpcap.c | |
parent | 4754a67c1208d4c8214c84ed23fc61dbbd3890c5 (diff) |
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
Diffstat (limited to 'wiretap/libpcap.c')
-rw-r--r-- | wiretap/libpcap.c | 25 |
1 files changed, 13 insertions, 12 deletions
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 <gram@alumni.rice.edu> @@ -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; |