summaryrefslogtreecommitdiffstats
path: root/package/kismet/patches/100-remove_sources.patch
blob: 8bae67ba4945b087e6ee571739f6c1ffc0bf56a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
diff -urN kismet-2005-04-R1.old/kismet_drone.cc kismet-2005-04-R1.dev/kismet_drone.cc
--- kismet-2005-04-R1.old/kismet_drone.cc	2005-04-03 07:33:42.000000000 +0200
+++ kismet-2005-04-R1.dev/kismet_drone.cc	2005-04-27 17:10:22.000000000 +0200
@@ -32,11 +32,8 @@
 #include "packet.h"
 
 #include "packetsource.h"
-#include "prism2source.h"
 #include "pcapsource.h"
 #include "wtapfilesource.h"
-#include "wsp100source.h"
-#include "vihasource.h"
 #include "dronesource.h"
 #include "packetsourcetracker.h"
 #include "kis_packsources.h"
diff -urN kismet-2005-04-R1.old/kismet_server.cc kismet-2005-04-R1.dev/kismet_server.cc
--- kismet-2005-04-R1.old/kismet_server.cc	2005-04-03 07:33:42.000000000 +0200
+++ kismet-2005-04-R1.dev/kismet_server.cc	2005-04-27 17:10:35.000000000 +0200
@@ -37,11 +37,8 @@
 #include "packet.h"
 
 #include "packetsource.h"
-#include "prism2source.h"
 #include "pcapsource.h"
 #include "wtapfilesource.h"
-#include "wsp100source.h"
-#include "vihasource.h"
 #include "dronesource.h"
 #include "packetsourcetracker.h"
 #include "kis_packsources.h"
diff -urN kismet-2005-04-R1.old/kis_packsources.cc kismet-2005-04-R1.dev/kis_packsources.cc
--- kismet-2005-04-R1.old/kis_packsources.cc	2005-04-03 07:33:42.000000000 +0200
+++ kismet-2005-04-R1.dev/kis_packsources.cc	2005-04-27 17:11:22.000000000 +0200
@@ -58,15 +58,10 @@
     REG_EMPTY_CARD(sourcetracker, "pcapfile");
 #endif
 
+    REG_EMPTY_CARD(sourcetracker, "cisco");
+    REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
 #if defined(HAVE_LIBPCAP) && defined(HAVE_LINUX_WIRELESS)
     // Linux wext-driven cards
-    sourcetracker->RegisterPacketsource("cisco", 1, "IEEE80211b", 6,
-                                       pcapsource_wext_registrant,
-                                       monitor_cisco, unmonitor_cisco, 
-                                       chancontrol_wext, 1);
-    sourcetracker->RegisterPacketsource("cisco_wifix", 1, "IEEE80211b", 6,
-                                       pcapsource_ciscowifix_registrant,
-                                       monitor_cisco_wifix, NULL, NULL, 1);
     sourcetracker->RegisterPacketsource("hostap", 1, "IEEE80211b", 6,
                                        pcapsource_wext_registrant,
                                        monitor_hostap, unmonitor_hostap, 
@@ -142,8 +137,6 @@
 
 #else
     // Register the linuxwireless pcap stuff as null
-    REG_EMPTY_CARD(sourcetracker, "cisco");
-    REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
     REG_EMPTY_CARD(sourcetracker, "hostap");
     REG_EMPTY_CARD(sourcetracker, "orinoco");
     REG_EMPTY_CARD(sourcetracker, "acx100");
@@ -179,14 +172,7 @@
     REG_EMPTY_CARD(sourcetracker, "wrt54g");
 #endif
 
-#if defined(SYS_LINUX) && defined(HAVE_LINUX_NETLINK)
-    sourcetracker->RegisterPacketsource("wlanng_legacy", 1, "IEEE80211b", 6,
-                                        prism2source_registrant,
-                                        monitor_wlanng_legacy, NULL,
-                                        chancontrol_wlanng_legacy, 1);
-#else
     REG_EMPTY_CARD(sourcetracker, "wlanng_legacy");
-#endif
 
 #if defined(HAVE_LIBPCAP) && defined(SYS_OPENBSD)
     sourcetracker->RegisterPacketsource("cisco_openbsd", 1, "IEEE80211b", 6,
@@ -228,21 +214,8 @@
     REG_EMPTY_CARD(sourcetracker, "wtapfile");
 #endif
 
-#if defined(HAVE_WSP100)
-    sourcetracker->RegisterPacketsource("wsp100", 0, "IEEE80211b", 6,
-                                        wsp100source_registrant,
-                                        monitor_wsp100, NULL, chancontrol_wsp100, 0);
-#else
     REG_EMPTY_CARD(sourcetracker, "wsp100");
-#endif
-
-#if defined(HAVE_VIHAHEADERS)
-    sourcetracker->RegisterPacketsource("viha", 1, "IEEE80211b", 6,
-                                        vihasource_registrant,
-                                        NULL, NULL, chancontrol_viha, 0);
-#else
     REG_EMPTY_CARD(sourcetracker, "viha");
-#endif
 
     return 1;
 }
diff -urN kismet-2005-04-R1.old/kis_packsources.h kismet-2005-04-R1.dev/kis_packsources.h
--- kismet-2005-04-R1.old/kis_packsources.h	2005-04-03 07:33:42.000000000 +0200
+++ kismet-2005-04-R1.dev/kis_packsources.h	2005-04-27 17:10:43.000000000 +0200
@@ -22,11 +22,8 @@
 #include "config.h"
 
 #include "packetsource.h"
-#include "prism2source.h"
 #include "pcapsource.h"
 #include "wtapfilesource.h"
-#include "wsp100source.h"
-#include "vihasource.h"
 #include "dronesource.h"
 #include "packetsourcetracker.h"
 
diff -urN kismet-2005-04-R1.old/Makefile.in kismet-2005-04-R1.dev/Makefile.in
--- kismet-2005-04-R1.old/Makefile.in	2005-04-03 07:33:42.000000000 +0200
+++ kismet-2005-04-R1.dev/Makefile.in	2005-04-27 17:10:09.000000000 +0200
@@ -40,8 +40,8 @@
 
 # Objects
 PSO	= util.o ringbuf.o configfile.o speech.o ifcontrol.o iwcontrol.o packet.o \
-		pcapsource.o prism2source.o wtapfilesource.o wsp100source.o \
-		dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
+		pcapsource.o wtapfilesource.o \
+		dronesource.o packetsourcetracker.o kis_packsources.o \
 		wtapdump.o wtaplocaldump.o gpsdump.o airsnortdump.o fifodump.o \
 		gpsd.o manuf.o \
 		packetracker.o timetracker.o alertracker.o finitestate.o \
@@ -50,8 +50,8 @@
 PS	= kismet_server
 
 DRONEO = util.o ringbuf.o configfile.o getopt.o ifcontrol.o iwcontrol.o packet.o \
-		tcpstreamer.o prism2source.o pcapsource.o wtapfilesource.o wsp100source.o \
-		dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
+		tcpstreamer.o pcapsource.o wtapfilesource.o \
+		dronesource.o packetsourcetracker.o kis_packsources.o \
 		timetracker.o gpsd.o server_globals.o kismet_drone.o
 DRONE = kismet_drone
 
diff -urN kismet-2005-04-R1.old/pcapsource.cc kismet-2005-04-R1.dev/pcapsource.cc
--- kismet-2005-04-R1.old/pcapsource.cc	2005-04-03 07:33:42.000000000 +0200
+++ kismet-2005-04-R1.dev/pcapsource.cc	2005-04-27 16:58:10.000000000 +0200
@@ -282,8 +282,6 @@
 
     if (datalink_type == DLT_PRISM_HEADER) {
         ret = Prism2KisPack(packet, data, moddata);
-    } else if (datalink_type == KDLT_BSD802_11) {
-        ret = BSD2KisPack(packet, data, moddata);
 #ifdef HAVE_RADIOTAP
     } else if (datalink_type == DLT_IEEE802_11_RADIO) {
         ret = Radiotap2KisPack(packet, data, moddata);
@@ -418,46 +416,6 @@
 
 }
 
-int PcapSource::BSD2KisPack(kis_packet *packet, uint8_t *data, uint8_t *moddata) {
-    int callback_offset = 0;
-
-    // Process our hacked in BSD type
-    if (callback_header.caplen < sizeof(bsd_80211_header)) {
-        snprintf(errstr, 1024, "pcap bsd converter saw undersized capture frame for bsd header.");
-        packet->len = 0;
-        packet->caplen = 0;
-        return 0;
-    }
-
-    packet->caplen = kismin(callback_header.caplen - sizeof(bsd_80211_header), 
-                            (uint32_t) MAX_PACKET_LEN);
-    packet->len = packet->caplen;
-
-    bsd_80211_header *bsdhead = (bsd_80211_header *) callback_data;
-
-    packet->signal = bsdhead->wi_signal;
-    packet->noise = bsdhead->wi_silence;
-
-    // Set our offset
-    callback_offset = sizeof(bsd_80211_header);
-    memcpy(packet->data, callback_data + callback_offset, 24);
-
-    // Adjust for driver appended headers
-    if (packet->data[0] > 0x08) {
-        packet->len -= 22;
-        packet->caplen -= 22;
-        memcpy(packet->data + 24, callback_data + callback_offset + 46, 
-               packet->caplen - 2);
-    } else {
-        packet->len -= 30;
-        packet->caplen -= 30;
-        memcpy(packet->data + 24, callback_data + callback_offset + 46, 
-               packet->caplen - 2);
-    }
-
-    return 1;
-}
-
 #ifdef HAVE_RADIOTAP
 /*
  * Convert MHz frequency to IEEE channel number.
@@ -949,17 +907,6 @@
     return new PcapSourceWextFCS(in_name, in_device);
 }
 
-KisPacketSource *pcapsource_ciscowifix_registrant(string in_name, string in_device, char *in_err) {
-    vector<string> devbits = StrTokenize(in_device, ":");
-
-    if (devbits.size() < 2) {
-        snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'", in_device.c_str());
-        return NULL;
-    }
-
-    return new PcapSourceWext(in_name, devbits[1]);
-}
-
 KisPacketSource *pcapsource_11g_registrant(string in_name, string in_device,
                                            char *in_err) {
     return new PcapSource11G(in_name, in_device);
@@ -1004,132 +951,6 @@
 
 // Monitor commands
 #ifdef HAVE_LINUX_WIRELESS
-// Cisco uses its own config file in /proc to control modes
-int monitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
-    FILE *cisco_config;
-    char cisco_path[128];
-
-    linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
-    (*in_if) = ifparm;
-
-    if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
-        return -1;
-    }
-
-    if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
-        return -1;
-
-    if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
-        return -1;
-
-    if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
-        return -1;
-
-    if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
-        return -1;
-
-    // Try the iwpriv
-    if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 1, 0, in_err) >= 0) {
-        return 0;
-    }
-
-    // Zero the ssid - nonfatal
-    Iwconfig_Set_SSID(in_dev, in_err, NULL);
-   
-    // Build the proc control path
-    snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", in_dev);
-
-    if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
-        snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
-                 cisco_path, errno, strerror(errno));
-        return -1;
-    }
-
-    fprintf(cisco_config, "Mode: r\n");
-    fprintf(cisco_config, "Mode: y\n");
-    fprintf(cisco_config, "XmitPower: 1\n");
-
-    fclose(cisco_config);
-
-    // Channel can't be set on cisco with these drivers.
-
-    return 0;
-}
-
-int unmonitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
-    linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
-    int ret = -1;
-
-    // Try the iwpriv
-    if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 0, 0, in_err) >= 0) {
-        // If we're the new drivers, unmonitor
-        if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
-            return -1;
-        }
-
-        // Reset the SSID since monitor mode nukes it
-        if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
-            return -1;
-
-        if (ifparm->channel > 0) {
-            if (Iwconfig_Set_Channel(in_dev, ifparm->channel, in_err) < 0)
-                return -1;
-        }
-
-        ret = 1;
-    }
-
-    free(ifparm);
-
-    return ret;
-}
-
-// Cisco uses its own config file in /proc to control modes
-//
-// I was doing this with ioctls but that seems to cause lockups while
-// this method doesn't.  I don't think I like these drivers.
-int monitor_cisco_wifix(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
-    FILE *cisco_config;
-    char cisco_path[128];
-    vector<string> devbits = StrTokenize(in_dev, ":");
-
-    if (devbits.size() < 2) {
-        snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'", in_dev);
-        return -1;
-    }
-
-    // Bring the device up, zero its ip, and set promisc
-    if (Ifconfig_Delta_Flags(devbits[0].c_str(), in_err, 
-                             IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
-        return -1;
-    if (Ifconfig_Delta_Flags(devbits[1].c_str(), in_err, 
-                             IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
-        return -1;
-
-    // Zero the ssid, nonfatally
-    Iwconfig_Set_SSID(devbits[0].c_str(), in_err, NULL);
-    Iwconfig_Set_SSID(devbits[1].c_str(), in_err, NULL);
-    
-    // Build the proc control path
-    snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", devbits[0].c_str());
-
-    if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
-        snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
-                 cisco_path, errno, strerror(errno));
-        return -1;
-    }
-
-    fprintf(cisco_config, "Mode: r\n");
-    fprintf(cisco_config, "Mode: y\n");
-    fprintf(cisco_config, "XmitPower: 1\n");
-
-    fclose(cisco_config);
-
-    // Channel can't be set on cisco with these drivers.
-
-    return 0;
-}
-
 // Hostap uses iwpriv and iwcontrol settings to control monitor mode
 int monitor_hostap(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
     int ret;