wpcap: Implement pcap_geterr.
[wine.git] / dlls / wpcap / wpcap.c
bloba83c4d5d3147374c7cb5305bbd386efed2279413
1 /*
2 * WPcap.dll Proxy.
4 * Copyright 2011 André Hentschel
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <pcap/pcap.h>
22 #include "wine/debug.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(wpcap);
25 WINE_DECLARE_DEBUG_CHANNEL(winediag);
27 int CDECL wine_pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
29 int ret;
31 TRACE("(%p %p)\n", alldevsp, errbuf);
32 ret = pcap_findalldevs(alldevsp, errbuf);
33 if(alldevsp && !*alldevsp)
34 ERR_(winediag)("Failed to access raw network (pcap), this requires special permissions.\n");
36 return ret;
39 void CDECL wine_pcap_freealldevs(pcap_if_t *alldevs)
41 TRACE("(%p)\n", alldevs);
42 pcap_freealldevs(alldevs);
45 char* CDECL wine_pcap_geterr(pcap_t *p)
47 TRACE("(%p)\n", p);
48 return pcap_geterr(p);
51 const char* CDECL wine_pcap_lib_version(void)
53 const char* ret = pcap_lib_version();
54 TRACE("%s\n", debugstr_a(ret));
55 return ret;
58 int CDECL wine_pcap_major_version(pcap_t *p)
60 TRACE("(%p)\n", p);
61 return pcap_major_version(p);
64 int CDECL wine_pcap_minor_version(pcap_t *p)
66 TRACE("(%p)\n", p);
67 return pcap_minor_version(p);