projects
/
wifihood
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
261dee8
)
Add channel hop capabilities
author
Javier Palacios
<javiplx@gmail.com>
Mon, 23 Jul 2012 08:20:41 +0000
(10:20 +0200)
committer
Javier Palacios
<javiplx@gmail.com>
Mon, 23 Jul 2012 08:20:41 +0000
(10:20 +0200)
wifisniffer/wifilogger.py
patch
|
blob
|
history
diff --git
a/wifisniffer/wifilogger.py
b/wifisniffer/wifilogger.py
index
6163e9d
..
34c6c2f
100755
(executable)
--- a/
wifisniffer/wifilogger.py
+++ b/
wifisniffer/wifilogger.py
@@
-20,6
+20,19
@@
read_timeout = 100 # in milliseconds
pc = pcapy.open_live(iface, max_bytes, promiscuous, read_timeout)
pc = pcapy.open_live(iface, max_bytes, promiscuous, read_timeout)
+channel_hop = [ 30.0 , False ]
+
+def channel_change ( ) :
+ try :
+ wlan["channel"] = ( wlan["channel"] ) % 12 + 1
+ except pyiw.error, error:
+ print "PYIW error : %s" % error
+ else :
+ if channel_hop[0] :
+ channel_hop[1] = threading.Timer( channel_hop[0] , channel_change )
+ channel_hop[1].start()
+
+
def parse_radiotap( radiotap , it_present ) :
fields = []
def parse_radiotap( radiotap , it_present ) :
fields = []
@@
-183,9
+196,15
@@
def dealWithPacket ( hdr , data ) :
curtime = time.time()
if curtime - tstamp > max_time :
curtime = time.time()
if curtime - tstamp > max_time :
+ channel_hop[0] = 0
raise CaptureEnd( "Neighborhoud scan completed" )
raise CaptureEnd( "Neighborhoud scan completed" )
+if channel_hop[0] :
+ channel_hop[1] = threading.Timer( channel_hop[0] , channel_change )
+ channel_hop[1].start()
+
+
packet_limit = -1 # infinite
try :
pc.loop( packet_limit , dealWithPacket )
packet_limit = -1 # infinite
try :
pc.loop( packet_limit , dealWithPacket )