summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHanhui <sylixos@gmail.com>2019-03-11 12:20:07 (GMT)
committer Hanhui <sylixos@gmail.com>2019-03-11 12:20:07 (GMT)
commita83134c23dcc66ad1b1a7f2d6529e6c12ae473f3 (patch)
treedb57145cd6a23e2c294ea277a08dc42f92ef12b2
parent65cf2697a3efec00f2a0ae6168c9a3d5db05f302 (diff)
downloadlibpcap-a83134c23dcc66ad1b1a7f2d6529e6c12ae473f3.zip
libpcap-a83134c23dcc66ad1b1a7f2d6529e6c12ae473f3.tar.gz
libpcap-a83134c23dcc66ad1b1a7f2d6529e6c12ae473f3.tar.bz2
Add SylixOS WiFi interface support.
-rw-r--r--libpcap/pcap-linux.c6
-rw-r--r--libpcap/pcap.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/libpcap/pcap-linux.c b/libpcap/pcap-linux.c
index 627f5b7..653f090 100644
--- a/libpcap/pcap-linux.c
+++ b/libpcap/pcap-linux.c
@@ -2842,6 +2842,12 @@ _U_
char errbuf[PCAP_ERRBUF_SIZE];
#endif
+#ifdef SYLIXOS
+ /* SylixOS WiFi Interface */
+ if (strncmp(device, "wl", 2) == 0) {
+ return 1;
+ }
+#endif
/*
* See if there's a sysfs wireless directory for it.
* If so, it's a wireless interface.
diff --git a/libpcap/pcap.c b/libpcap/pcap.c
index 77a709f..34bc269 100644
--- a/libpcap/pcap.c
+++ b/libpcap/pcap.c
@@ -991,6 +991,14 @@ pcap_set_datalink(pcap_t *p, int dlt)
if (dlt < 0)
goto unsupported;
+#ifdef SYLIXOS
+ /* WiFi cap IEEE802_11_RADIO */
+ if (p->dlt_count == 0 &&
+ dlt == DLT_IEEE802_11_RADIO) {
+ p->linktype = dlt;
+ return (0);
+ }
+#endif
if (p->dlt_count == 0 || p->set_datalink_op == NULL) {
/*
* We couldn't fetch the list of DLTs, or we don't