1 diff -urN kismet.old/kis_packsources.cc kismet.dev/kis_packsources.cc
2 --- kismet.old/kis_packsources.cc 2005-07-25 12:18:47.230369000 +0200
3 +++ kismet.dev/kis_packsources.cc 2005-07-25 12:54:44.654390736 +0200
5 chancontrol_wlanng_avs, 1);
6 sourcetracker->RegisterPacketsource("wrt54g", 1, "na", 0,
7 pcapsource_wrt54g_registrant,
8 - monitor_wrt54g, NULL, NULL, 0);
9 + monitor_wrt54g, NULL, chancontrol_wext, 1);
11 REG_EMPTY_CARD(sourcetracker, "wlanng");
12 REG_EMPTY_CARD(sourcetracker, "wlanng_avs");
13 diff -urN kismet.old/packetsourcetracker.cc kismet.dev/packetsourcetracker.cc
14 --- kismet.old/packetsourcetracker.cc 2005-04-03 07:33:42.000000000 +0200
15 +++ kismet.dev/packetsourcetracker.cc 2005-07-25 13:29:45.698983408 +0200
17 (meta_packsources[chanpak.meta_num]->device.c_str(),
18 chanpak.channel, errstr,
19 (void *) (meta_packsources[chanpak.meta_num]->capsource)) < 0) {
22 meta_packsources[chanpak.meta_num]->consec_errors++;
30 // Otherwise reset the error count
31 meta_packsources[chanpak.meta_num]->consec_errors = 0;
32 diff -urN kismet.old/pcapsource.cc kismet.dev/pcapsource.cc
33 --- kismet.old/pcapsource.cc 2005-07-25 12:18:47.234368000 +0200
34 +++ kismet.dev/pcapsource.cc 2005-07-25 12:51:19.426590104 +0200
41 +int PcapSourceWrt54g::OpenSource() {
46 + char *unconst = strdup("prism0");
48 + pd = pcap_open_live(unconst, MAX_PACKET_LEN, 1, 1000, errstr);
52 + if (strlen(errstr) > 0)
53 + return -1; // Error is already in errstr
61 + if (DatalinkType() < 0)
64 +#ifdef HAVE_PCAP_NONBLOCK
65 + pcap_setnonblock(pd, 1, errstr);
66 +#elif !defined(SYS_OPENBSD)
67 + // do something clever (Thanks to Guy Harris for suggesting this).
68 + int save_mode = fcntl(pcap_get_selectable_fd(pd), F_GETFL, 0);
69 + if (fcntl(pcap_get_selectable_fd(pd), F_SETFL, save_mode | O_NONBLOCK) < 0) {
70 + snprintf(errstr, 1024, "fcntl failed, errno %d (%s)",
71 + errno, strerror(errno));
75 + if (strlen(errstr) > 0)
81 // Datalink, override as appropriate
82 carrier_type PcapSource::IEEE80211Carrier() {
83 int ch = FetchChannel();
85 int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
88 - snprintf(cmdline, 2048, "/usr/sbin/wl monitor 1");
89 + snprintf(cmdline, 2048, "/usr/sbin/iwpriv %s set_monitor 1", in_dev);
90 if (RunSysCmd(cmdline) < 0) {
91 snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
93 diff -urN kismet.old/pcapsource.h kismet.dev/pcapsource.h
94 --- kismet.old/pcapsource.h 2005-04-03 07:33:42.000000000 +0200
95 +++ kismet.dev/pcapsource.h 2005-07-25 12:49:22.089428064 +0200
98 // Override packet fetching logic on this one to discard jumbo corrupt packets
99 // that it likes to generate
100 +// Override OpenSource() to use prism0 as pcap device
101 class PcapSourceWrt54g : public PcapSource {
103 PcapSourceWrt54g(string in_name, string in_dev) : PcapSource(in_name, in_dev) {
107 int FetchPacket(kis_packet *packet, uint8_t *data, uint8_t *moddata);
109 carrier_type IEEE80211Carrier();