Made small changes to incorporate the new notify feature.

This commit is contained in:
Michael O'Connell
2010-09-06 10:45:14 +08:00
committed by Kenneth Reitz
parent dd26fa8982
commit 51a4f97184
4 changed files with 14 additions and 11 deletions
+2 -1
View File
@@ -3,4 +3,5 @@
import cli
import core
import interfaces
import generator
import generator
import log
+10 -8
View File
@@ -5,30 +5,32 @@ import opster
import macspoof
spoof_options = [
('a', 'airport', False, 'treat interface as airport card'),
]
@opster.command(usage='INTERFACE <mac>', options=spoof_options)
@opster.command(usage='INTERFACE <mac>', options=spoof_options)
def spoof(interface, mac=None, **opts):
"""spoofs mac address of given interface
"""
if interface in macspoof.interfaces.list():
message = macspoof.core.spoof(interface, mac)
print message
else:
print('Please specify a valid interface.')
@opster.command(name='list|l|ls', usage='fukit')
@opster.command(name='list|l|ls', usage='fukit')
def list(**opts):
"""lists avaiable network interfaces"""
_interfaces = macspoof.interfaces.fetch()
for iface in _interfaces:
print '%s (%s)' % (iface.id, iface.mac)
def start():
opster.dispatch()
+1 -1
View File
@@ -14,4 +14,4 @@ def spoof(interface, mac_address=None):
interface = macspoof.interfaces.Interface(interface)
interface.spoof(mac_address)
macspoof.log.notify(interface.spoof(mac_address))
+1 -1
View File
@@ -49,7 +49,7 @@ class Interface(object):
_status = os.system('sudo ifconfig %s ether %s' % (self.id, mac))
print 'Interface %s (%s) => (%s)' % (self.id, self.mac, mac)
return 'Interface %s (%s) => (%s)' % (self.id, self.mac, mac)