-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wraith-wireless
committed
May 24, 2016
1 parent
f70f9ea
commit 47e5d47
Showing
33 changed files
with
153 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Include license, README | ||
# Include license, README, channels, device, pyw and user guide | ||
include LICENSE README.md __init__.py channels.py device.py pyw.py PyRIC.pdf | ||
|
||
# Include subdirectories | ||
recursive-include lib net examples docs | ||
recursive-include docs *.help *.pdf | ||
recursive-include docs *.help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
1) overall | ||
o look at iw dev wlan0 link | ||
o look at iw dev | ||
o make a cli as well | ||
2) libnl.py | ||
o see (1) in RFI | ||
o define attr_ops and attr_mcast_groups in nla_policy_attr | ||
4) pyw | ||
o add txget from iw i.e. netlink perspective | ||
o find a better way to find the supported standards of a card | ||
o for now, using ioctl to set ip addresses | ||
- move everything to netlink | ||
o Can we find the current channel of a radio in monitor mode that is actively | ||
scanning? | ||
o parse NL80211_ATTR_WIPHY_BANDS | ||
o parse NL80211_ATTR_WIPHY_BANDS (have workaround currently in place) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# root Distribution directory | ||
# root Distribution directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/usr/bin/env python | ||
""" device.py | ||
Example for displaying device details | ||
""" | ||
|
||
import argparse as ap | ||
import pyric # pyric error (and ecode EUNDEF) | ||
from pyric import pyw # for iw functionality | ||
from pyric import device # for chipset/driver | ||
from pyric.channels import rf2ch # rf to channel conversion | ||
|
||
def execute(dev): | ||
# ensure dev is a wireless interfaces | ||
wifaces = pyw.winterfaces() | ||
if dev not in wifaces: | ||
print "Device {0} is not wireless, use one of {1}".format(dev,wifaces) | ||
|
||
dinfo = pyw.devinfo(dev) | ||
card = dinfo['card'] | ||
pinfo = pyw.phyinfo(card) | ||
driver = device.ifdriver(card.dev) | ||
chipset = device.ifchipset(driver) | ||
|
||
msg = "Device {0}\n".format(dev) | ||
msg += "\tDriver: {0} Chipset: {1}\n".format(driver,chipset) | ||
msg += "\tifindex: {0}\n".format(card.idx) | ||
msg += "\twdev: {0}\n".format(dinfo['wdev']) | ||
msg += "\taddr: {0}\n".format(dinfo['mac']) | ||
msg += "\tmode: {0}\n".format(dinfo['mode']) | ||
msg += "\twiphy: {0}\n".format(card.phy) | ||
if dinfo['mode'] == 'managed': | ||
msg += "\tchannel: {0} (1 MHz), width: {2}, CF: {3}\n".format(rf2ch(dinfo['RF']), | ||
dinfo['RF'], | ||
dinfo['CHW'], | ||
dinfo['CF']) | ||
else: | ||
msg += "\tDevice not associated\n" | ||
print msg | ||
|
||
msg = "Wiphy phy{0}\n".format(card.phy) | ||
msg += "\tGeneration: {0}m Coverage Class: {1}\n".format(pinfo['generation'], | ||
pinfo['cov_class']) | ||
msg += "\tMax # scan SSIDs: {0}\n".format(pinfo['scan_ssids']) | ||
msg += "\tRetry Short: {0}, Long: {1}\n".format(pinfo['retry_short'], | ||
pinfo['retry_long']) | ||
msg += "\tThreshold Frag: {0}, RTS: {1}\n".format(pinfo['frag_thresh'], | ||
pinfo['rts_thresh']) | ||
msg += "\tSupported Modes:\n" | ||
for mode in pinfo['modes']: | ||
msg += "\t * {0}\n".format(mode) | ||
msg += "\tSupported Commands:\n" | ||
for cmd in pinfo['commands']: | ||
msg += "\t * {0}\n".format(cmd) | ||
msg += "\tSupported Frequencies:\n" | ||
for freq in pinfo['freqs']: | ||
msg += "\t * {0}\n".format(freq) | ||
|
||
print msg | ||
|
||
if __name__ == '__main__': | ||
# create arg parser and parse command line args | ||
print "Wireless Device Info Display using PyRIC v{0}".format(pyric.__version__) | ||
argp = ap.ArgumentParser(description="Wireless Device Data") | ||
argp.add_argument('-d','--dev',help="Wireless Device") | ||
args = argp.parse_args() | ||
try: | ||
dev = args.dev | ||
if dev is None: | ||
print "usage: python device.py -d <dev>" | ||
else: | ||
execute(dev) | ||
except pyric.error as e: | ||
print e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.