diff --git a/.gitignore b/.gitignore
index dd2f702..677c41a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,25 @@
+# modified from https://github.com/github/gitignore/blob/master/Python.gitignore
+#Copyright (c) 2016 GitHub, Inc.
+#
+#Permission is hereby granted, free of charge, to any person obtaining a
+#copy of this software and associated documentation files (the "Software"),
+#to deal in the Software without restriction, including without limitation
+#the rights to use, copy, modify, merge, publish, distribute, sublicense,
+#and/or sell copies of the Software, and to permit persons to whom the
+#Software is furnished to do so, subject to the following conditions:
+#
+#The above copyright notice and this permission notice shall be included in
+#all copies or substantial portions of the Software.
+#
+#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+#FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+#
+#DEALINGS IN THE SOFTWARE.
+
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
diff --git a/LICENSE b/LICENSE
index aff0830..80fa603 100644
--- a/LICENSE
+++ b/LICENSE
@@ -37,4 +37,4 @@ software in furtherance of or with intent to commit any fraudulent or other ille
activities, or otherwise in violation of any applicable law, regulation or legal
agreement.
-See for a copy of the GNU General Public License.
\ No newline at end of file
+See for a copy of the GNU General Public License.
diff --git a/MANIFEST.in b/MANIFEST.in
index 1ab476e..68fde43 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,7 +1,10 @@
-# Include license, README, channels, device, pyw and user guide
-include LICENSE README.md __init__.py channels.py device.py pyw.py PyRIC.pdf TODO RFI
+# Include license, README, channels, device, rfkill, pyw and user guide
+include LICENSE README.md __init__.py channels.py device.py rfkill.py pyw.py PyRIC.pdf TODO RFI
# Include subdirectories
-# NOTE: we do not include test folder in installation
-recursive-include lib net examples docs
-recursive-include docs *.help
\ No newline at end of file
+# device_details.py was not being included without the below recursive include
+recursive-include lib net examples docs tests guide
+recursive-include examples *.py
+recursive-include docs *.help
+recursive-include tests *.py
+recursive-include guide *.tex *.bib *.png
\ No newline at end of file
diff --git a/PyRIC.pdf b/PyRIC.pdf
index 1fe4aa4..017a61b 100644
Binary files a/PyRIC.pdf and b/PyRIC.pdf differ
diff --git a/README.md b/README.md
index 9c6e164..2ef0741 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ uses netlink (or ioctl) sockets to communicate directly with the kernel.
about iw updates and rewriting your parsers.
* Easy: If you can use iw, you can use PyRIC
-Python is primarliy and originally a port of a subset of iw but has evolved in
+PyRIC is primarliy and originally a port of a subset of iw but has evolved in
an attempt to meet the needs of wireless pentesting as it relates to wireless
network cards. In addition to providing iw related functions, PyRIC implements:
* ifconfig functionality such as mac address, ip address, netmask and broadcast
@@ -61,8 +61,7 @@ commands although an understanding of libnl(.py) is helpful especially, if for
example, the code is to be extended to handle multicast or callbacks.
### b. Additions to iw
-In addition to providing some ifconfig functionality, I have also added several
-"extensions" to iw:
+Several "extensions" have been added to iw:
* Persistent sockets: pyw provides the caller with functions & ability to pass
their own netlink (or ioctl socket) to pyw functions;
* One-time request for the nl80211 family id: pyw stores the family id in a
@@ -71,7 +70,7 @@ global variable
(Cards are tuples t=(dev,phy #,ifindex)
These are minimal changes but they can improve the performance of any progams
-that need to access the wireless nic repeatedly as shown in the table below.
+that needs to access the wireless nic repeatedly as shown in the table below.
| chset | Total | Avg | Longest | Shortest |
|------------|----------|--------|-----------|----------|
@@ -88,8 +87,8 @@ persistent netlink sockets are used with the total time and average hop time nea
halved.
### c. Current State
-ATT, PyRIC accomplish my core needs but it is still a work in progress. It provides
-the following:
+ATT, PyRIC accomplishes my core needs but it is still a work in progress. It
+currently provides the following:
* enumerate interfaces and wireless interfaces
* identify a cards chipset and driver
* get/set hardware address
@@ -104,7 +103,7 @@ the following:
* get/set mode
* add/delete interfaces
* enumerate ISM and UNII channels
-* block/unblock rfkill devices (still working on it)
+* block/unblock rfkill devices
It also provides limited help functionality concerning nl80211 commands/attributes
(for those who wish to add additional commands). However, it pulls directly from
@@ -116,10 +115,10 @@ To avoid confusion, PyRIC is the system as a whole, including all header files
and "libraries" that are required to communicate with the kernel. pyw is a
interface to these libraries providing specific funtions.
-What it does - defines programmatic access to a small subset of iw and ifconfig.
-
-What it does not do - handle multicast messages, callbacks or dumps or non nl80211
-funtionality.
+What it does - defines programmatic access to a subset of iw, ifconfig and iwconfig.
+In short, PyRIC provides Python wireless pentesters the ability to work with
+wireless cards directly from Python without having to use command line tools
+through Popen.
## 2. INSTALLING/USING:
@@ -130,16 +129,13 @@ installation.
### a. Requirements
PyRIC has only two requirements: Linux and Python. There has been very little
-testing (on my side) on kernel 4.x and Python 3 but working out the small bugs
-continues on Python 2.7 and kernel 3.13.x.
+testing (on my side) on kernel 4.x and Python 3 but unit testing confirms
+functionality on Python 2.7 and kernel 3.13.x.
### b. Install from Package Manager
Obviously, the easiest way to install PyRIC is through PyPI:
- sudo pip install --pre PyRIC
-
-Note the use of the '--pre' flag. Without it, pip will not install PyRIC since
-it is still in the developmental stage.
+ sudo pip install PyRIC
### c. Install from Source
The PyRIC source (tarball) can be downloaded from https://pypi.python.org/pypi/PyRIC
@@ -366,6 +362,9 @@ Extending PyRIC is fun and easy too, see the user guide PyRIC.pdf.
+ device_details.py display device information
- tests test folder
+ pyw.unittest.py unit test for pyw functions
+ - guide User Guide resources
+ + PyRIC.tex User Guide LaTex
+ + PyRIC.bib User Guide bibliography
- setup.py install file
- setup.cfg used by setup.py
- MANIFEST.in used by setup.py
@@ -400,7 +399,4 @@ Extending PyRIC is fun and easy too, see the user guide PyRIC.pdf.
+ docs netlinke documentation/help
* nlhelp.py nl80211 search
* commands.help nl80211 commands help data
- * attributes.help nl80211 attributes help data
- * res User Guide resources
- - PyRIC.tex User Guide LaTex
- - PyRIC.bib User Guide bibliography
+ * attributes.help nl80211 attributes help data
\ No newline at end of file
diff --git a/RFI b/RFI
index f611442..be5f3a4 100644
--- a/RFI
+++ b/RFI
@@ -114,3 +114,4 @@ dev set txpower []
phy set txpower []
Specify transmit power level and setting type.
+
diff --git a/TODO b/TODO
index 531fe12..9be6027 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,6 @@
1) overall
o make a cli as well
+ o determine if rfkill issue is related only to ubuntu
2) libnl.py
o see (1) in RFI
4) pyw
diff --git a/__init__.py b/__init__.py
index 98ed3e0..0321a1a 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1 +1,3 @@
-# root Distribution directory
+# PyRIC root Distribution directory
+# Do not import from this directory i.e from PyRIC import foobar
+# use pip to install or import from pyric
diff --git a/examples/device_details.py b/examples/device_details.py
index 613c41d..a115b40 100644
--- a/examples/device_details.py
+++ b/examples/device_details.py
@@ -1,7 +1,8 @@
#!/usr/bin/env python
-""" device_details.py
+""" details.py
Example for displaying device details
+
"""
import argparse as ap
@@ -67,7 +68,7 @@ def execute(dev):
try:
dev = args.dev
if dev is None:
- print "usage: python device_details.py -d "
+ print "usage: python details.py -d "
else:
execute(dev)
except pyric.error as e:
diff --git a/examples/pentest.py b/examples/pentest.py
index 3a8c99e..422f0ca 100644
--- a/examples/pentest.py
+++ b/examples/pentest.py
@@ -2,6 +2,7 @@
""" pentest.py
Example for setting up a wireless environment - must be done as root
+
"""
import argparse as ap
diff --git a/pyric/docs/res/PyRIC.bib b/guide/PyRIC.bib
similarity index 99%
rename from pyric/docs/res/PyRIC.bib
rename to guide/PyRIC.bib
index d4b702d..d159770 100644
--- a/pyric/docs/res/PyRIC.bib
+++ b/guide/PyRIC.bib
@@ -1,3 +1,4 @@
+
@Misc{libnl,
Title = {Netlink Library (libnl)},
Author = {Thomas Graf},
@@ -44,4 +45,4 @@ @Misc{gplv3
Shorthand = {GPL},
Url = {http://www.gnu.org/licenses/gpl.html},
Version = {3}
-}
\ No newline at end of file
+}
diff --git a/pyric/docs/res/PyRIC.tex b/guide/PyRIC.tex
similarity index 86%
rename from pyric/docs/res/PyRIC.tex
rename to guide/PyRIC.tex
index 918e325..e6009a3 100644
--- a/pyric/docs/res/PyRIC.tex
+++ b/guide/PyRIC.tex
@@ -19,12 +19,12 @@
%
% __name__ = 'User Guide'
%__license__ = 'GPLv3'
-%__version__ = '0.0.2'
-%__date__ = 'May 2016'
+%__version__ = '0.0.3'
+%__date__ = 'June 2016'
%__author__ = 'Dale Patterson'
%__maintainer__ = 'Dale Patterson'
%__email__ = 'wraith.wireless@yandex.com'
-%__status__ = 'Development'
+%__status__ = 'Production'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt]{article}
@@ -72,7 +72,7 @@
basicstyle=\footnotesize
}
-\title{PyRIC v0.0.8: User Manual}
+\title{PyRIC v0.1.0: User Manual}
\author{Dale V. Patterson\\ wraith.wireless@yandex.com}
\begin{document}
@@ -80,20 +80,41 @@
\tableofcontents
\section{About PyRIC}\label{sec:About}
-PyRIC is a python port of (a subset of) iw and by extension a python port of
-Netlink\cite{spae} (w.r.t nl80211 functions). The goal of PyRIC is to provide
-a simple interface to the underlying nl80211 kernel support that handles the
-complex operations of Netlink seamlessy while maintaining a minimum of "code
-walking" to understand, modify and extend. PyRIC will only work on Linux
-with Netlink support.\\
-
-While users can utilize libnl(.py) and libio(.py) to communicate directly with
-the kernel, the true utility of PyRIC is pyw(.py). Like iw, pyw provides an
-interface/buffer between the caller and the kernel, handling all message
-construction, parsing and transfer transparently and without requiring any
-Netlink knowledge or experience. \\
-
-At this time, PyRIC (through pyw functions) can:
+PyRIC provides wireless pentesters the ability to manipulate, identify and
+enumerate your system's wireless cards programmatically in Python. PyRIC provides
+functionality offered by command line tools like iw, ifconfig, iwconfig and rfkill.
+Why use subprocess.Popen, regular expressions and str.find to interact with your
+wireless cards? PyRIC is:
+\begin{enumerate}
+\item \textbf{Pythonic}: No ctypes, SWIG etc. PyRIC redefines C header files as
+Python and uses sockets to communicate with kernel.
+\item \textbf{Self-sufficient}: No third-party files used, PyRIC is completely self-
+contained
+\item \textbf{Fast}: (relatively speaking) PyRIC is faster than using iw through
+subprocess.Popen
+\item \textbf{Parseless}: Get the output you without parsing output from iw. Never
+worry about iw updates and rewriting your parsers.
+\item \textbf{Easy}: If you can use iw, you can use PyRIC
+\end{enumerate}
+
+At it's heart, PyRIC is a python port of (a subset of) iw and by extension a
+python port of Netlink\cite{spae} (w.r.t nl80211 functions). The original goal
+of PyRIC was to provide a simple interface to the underlying nl80211 kernel
+support, handling the complex operations of Netlink seamlessy while maintaining
+a minimum of "code walking" to understand, modify and extend. PyRIC will only work
+on Linux with Netlink support.\\
+
+While users can utilize libnl(.py) to communicate directly with the kernel, the
+true utility of PyRIC is pyw(.py). Like iw, pyw provides an interface/buffer
+between the caller and the kernel, handling all message construction, parsing
+and transfer transparently and without requiring any Netlink knowledge or
+experience. \\
+
+PyRIC does more though, via fcntl it implements rfkill, allowing users to list,
+block and unblock devices as well as implement libio(.py) for ioctl communication
+with the kernel providing users the ability to turn cards on/off and set addresses.
+
+At this time, PyRIC (through pyw, rfkill and device) can:
\begin{itemize}
\item enumerate interfaces and wireless interfaces,
\item get/set regulatory domain,
@@ -105,8 +126,9 @@ \section{About PyRIC}\label{sec:About}
\item get supported commands,
\item get supported modes,
\item get dev/phy info on device,
-\item get/set mode, and
-\item add/delete interfaces.
+\item get/set mode,
+\item add/delete interfaces, and
+\item block/unblock devices through rfkill.
\end{itemize}
It also provides users with the ability, through libnl(.py) to extend the above
functionality by creating additional commands.\\
@@ -114,21 +136,6 @@ \section{About PyRIC}\label{sec:About}
Currently, PyRIC does handle multicast messages i.e. events or dumps although
plans for future versions include adding the ability to process dumps. \\
-There are other Python implementations but many have not been maintained and most
-attempt to provide a full implementation of Netlink with nl80211 functionality
-as a side-project. Unlike those, PyRIC is:
-\begin{itemize}
-\item Pythonic: No ctypes, SWIG etc. PyRIC redefines C header files as Python and
-uses sockets to communicate directly with the kernel,
-\item Self-sufficient: No third-party files used, PyRIC is completely self-contained,
-\item Fast: (relatively speaking) PyRIC is faster than using iw through
-subprocess.Popen,
-\item Small: PyRIC is roughly 420kB,
-\item Parseless: Get the output you want without parsing output from iw. Never worry
-about iw updates and rewriting your parsers, and
-\item Easy: If you can use iw, you can use PyRIC.
-\end{itemize}
-
\subsection{Naming Conventions}
The terms interface, device and radio are all used interchangeably throughout to
refer to a network interface card (NIC). The following terms will always have one
@@ -162,11 +169,11 @@ \subsection{Cards}
created and two messages have to be sent, received and parsed in order to execute
the command. With Cards, the ifindex is requested for only once. \\
-Keep in mind that any identifier (phy,dev,ifindex) can be invalidated outside of
-your control. Another program can rename your interface, that is change the dev
-without your knowledge. Depending on what functions are being used this may not
-be noticed right away as the phy will remain the same. Also, usb devices (if the
-usb is disconnected and reconnected) will have the same dev but the phy and
+Keep in mind that any identifier (phy, dev, ifindex) can be invalidated outside
+of your control. Another program can rename your interface, that is change the
+dev without your knowledge. Depending on what functions are being used this may
+not be noticed right away as the phy will remain the same. Also, usb devices (if
+the usb is disconnected and reconnected) will have the same dev but the phy and
ifindex will be different.
\subsection{Benchmarks}
@@ -198,8 +205,8 @@ \subsection{Benchmarks}
\label{tab:benchmark}
\end{table}
-While small, these change improve the performance of any programs using pyw.
-Table 1 shows benchmarks for hop time on a Alfa AWUS036NH conducted 10000 times.
+While small, these changes can improve the performance of any programs using pyw.
+Table 1 shows benchmarks for hop time on an Alfa AWUS036NH conducted 10000 times.
Note that we are not implying that PyRIC is faster than iw. Rather, the table
shows that PyRIC is faster than using Popen to execute iw. Using one-time sockets,
there is a difference of 28 seconds over Popen and iw with a small decrease in
@@ -207,73 +214,6 @@ \subsection{Benchmarks}
dramatically when persistent netlink sockets are used with the total time and
average hop time nearly halved.
-\subsection{Hierarchy/Architecture}
-PyRIC's hierarchy is briefly discussed next.
-
-\begin{enumerate}
-\item \textbf{\_\_init\_\_.py}: Initialize PyRIC, the root distribution directory
-use for PyPI packaging
-\item \textbf{README.md}: self-descriptive
-\item \textbf{setup.py}: install file
-\item \textbf{setup.cfg}: used by setup.py
-\item \textbf{MANIFEST.in}: used by setup.py
-\item \textbf{LICENSE}: GPLv3 License
-\item \textbf{PyRIC.pdf}: this file
-\item \textbf{TODO}: lists any outstanding TODOs, ideas for future revisions
-\item \textbf{RFI}: comments and observations about netlinks, nl80211 etc
-\item \textbf{examples}: examples directory
-\begin{enumerate}
-\item \textbf{pentest.py}: create wireless pentest environment
-\item \textbf{device\_details.py}: display device information
-\end{enumerate}
-\item \textbf{tests}: test directory
-\begin{enumerate}
-\item \textbf{pyw.unittest.py}: pyw unittesting
-\end{enumerate}
-\item \textbf{pyric} package directory
-\begin{enumerate}
-\item \textbf{\_\_init\_\_.py}: Initialize pyric defines the EUNDEF error code
-(PyRIC uses errno for all errorcodes adding EUNDEF) and the common exception
-class, 'error' - all submodules use this class for any exceptions.
-\item \textbf{channels.py}: ISM and UNII frequencies and channels, with conversion
-functions
-\item \textbf{device.py}: device and chipset utility functions
-\item \textbf{pyw.py}: this is the interface, providing wireless interface
-manipulation functions
-\item \textbf{lib}: lib subpackage
-\begin{enumerate}
-\item \textbf{\_\_init\_\_.py}: initialize lib subpackage
-\item \textbf{libnl.py}: netlink API
-\item \textbf{libio.py}: ioctl API
-\end{enumerate}
-\item \textbf{net}: net subpackage
-\begin{enumerate}
-\item \textbf{\_\_init\_\_.py}: initialize net subpackage
-\item \textbf{if\_h.py}: inet/ifreq definition
-\item \textbf{sockios\_h.py}: socket-level I/O control call flags
-\item \textbf{netlink\_h.py}: port of netlink.h
-\item \textbf{genetlink\_h.py}: port of genetlink.h
-\item \textbf{policy.py}: defines attribute datatypes
-\item \textbf{wireless}: wireless subpackage
-\begin{enumerate}
-\item \textbf{\_\_init\_\_.py}: initialize lib subpackage
-\item \textbf{nl80211\_h.py}: port of nl80211 (commands \& attributes)
-\item \textbf{nl80211\_c.py}: nl80211 attribute datatypes/policies
-\end{enumerate}
-\end{enumerate}
-\item \textbf{docs}: docs subpackage
-\item \textbf{\_\_init\_\_.py}: initialize docs subpackage
-\item \textbf{nlhelp.py}: functions to search display nl80211 constants
-\item \textbf{commands.help}: nl80211 commands help data (json)
-\item \textbf{attributes.help}: nl80211 attributes help data (json)
-\item \textbf{res}:resource subpackage
-\begin{enumerate}
-\item \textbf{PyRIC.tex}: LaTeX for user guide
-\item \textbf{PyRIC.bib}: bibliography for user guide
-\end{enumerate}
-\end{enumerate}
-\end{enumerate}
-
\section{Installing PyRIC}\label{sec:installing}
Starting with version 0.0.6, the structure (see Section \ref{sec:About} has
changed to facilitate packaging on PyPI. This restructing has of course led
@@ -282,10 +222,7 @@ \section{Installing PyRIC}\label{sec:installing}
Obviously, the easiest way to install PyRIC is through PyPI:\\
- \texttt{sudo pip install --pre PyRIC}\\
-
-Note the use of the '--pre' flag. Without it, pip will not install PyRIC since
-it is still in the developmental stage.\\
+ \texttt{sudo pip install PyRIC}\\
You can also install PyRIC from source. The tarball can be downloaded from:
@@ -338,16 +275,12 @@ \section{Installing PyRIC}\label{sec:installing}
\section{Using PyRIC}\label{sec:using}
As stated previously, PyRIC provides a set of functions to interact with your
system's radio(s) and the ability to interact directly with the kernel through
-netlink and ioctl sockets. \\
-
-It is helpful if the reader has a basic knowledge of netlinks. For a review, see
-"Communicating between the kernel and user-space in Linux using Netlink Sockets"
-\cite{spae}.
+netlink and ioctl sockets.
\subsection{Interacting with the Wireless Core and Wireless NICs: pyw.py}
-If you can use iw, you can use pyw.py. The easist way to explain how to use pyw
-is with an example. Imagine your wireless network is on ch 6 has been experiencing
-difficulites lately and you want to capture some traffic to analyse it. Listing
+If you can use iw, you can use pyw. The easist way to explain how to use pyw is
+with an example. Imagine your wireless network, on ch 6, has been experiencing
+difficulties lately and you want to capture some traffic to analyse it. Listing
\ref{lst:pentest} shows how to set up a wireless pentest environment. \\
\begin{lstlisting}[caption={Setting up a Wireless Pentest Environment},
@@ -517,8 +450,12 @@ \subsubsection{One-time vs Persistent Sockets}
modes. \\
Use Python's built in help features on pyw functions or see Appendex \ref{sec:pywapi}
-to determine what type of
-socket is needed.
+to determine what type of socket is needed.
+
+\subsection{Additional Tools: channels.py, device.py and rfkill.py}
+In addition to ifconfig and iw related functions found in pyw.py, PyRIC provides
+a port of rfkill, channel/frequency enumeration and device chipset, driver
+retrieval. More information can be found in the Appendices.
\subsection{Interacting with the Kernel: libnl.py and libio.py}
The kernel interfaces, libnl.py and libio.py are located in the lib directory.
@@ -530,7 +467,11 @@ \subsection{Interacting with the Kernel: libnl.py and libio.py}
\section{Extending PyRIC}\label{sec:extending}
You may find that pyw does not offer some of the functionality you need. Using
-libnl.py and/or libnl.io, additional functionality can be added to your program.
+libnl.py and/or libnl.io, additional functionality can be added to your program.\\
+
+It is helpful if the reader has a basic knowledge of netlinks. For a review, see
+"Communicating between the kernel and user-space in Linux using Netlink Sockets"
+\cite{spae}.
\subsection{Porting C}
All Python ports of C header files can be found in the net directory. C Enums
@@ -712,6 +653,51 @@ \subsection{Netlink and nl80211}
Everything else is handled behind the scenes by libnl.py.
\begin{appendices}
+\section{Hierarchy/Architecture}
+PyRIC's hierarchy is briefly discussed next.
+
+\begin{enumerate}
+\item \textbf{pyric} package directory
+\begin{enumerate}
+\item \textbf{\_\_init\_\_.py}: Initialize pyric defines the EUNDEF error code
+(PyRIC uses errno for all errorcodes adding EUNDEF) and the common exception
+class, 'error' - all submodules use this class for any exceptions.
+\item \textbf{pyw.py}: this is the interface, providing wireless interface
+manipulation functions
+\item \textbf{channels.py}: ISM and UNII frequencies and channels, with conversion
+functions
+\item \textbf{device.py}: device and chipset utility functions
+\item \textbf{rfkill.py}: Python port of command line tool rfkill
+\item \textbf{lib}: lib subpackage
+\begin{enumerate}
+\item \textbf{\_\_init\_\_.py}: initialize lib subpackage
+\item \textbf{libnl.py}: netlink API
+\item \textbf{libio.py}: ioctl API
+\end{enumerate}
+\item \textbf{net}: net subpackage
+\begin{enumerate}
+\item \textbf{\_\_init\_\_.py}: initialize net subpackage
+\item \textbf{if\_h.py}: inet/ifreq definition
+\item \textbf{sockios\_h.py}: socket-level I/O control call flags
+\item \textbf{netlink\_h.py}: port of netlink.h
+\item \textbf{genetlink\_h.py}: port of genetlink.h
+\item \textbf{policy.py}: defines attribute datatypes
+\item \textbf{wireless}: wireless subpackage
+\begin{enumerate}
+\item \textbf{\_\_init\_\_.py}: initialize lib subpackage
+\item \textbf{nl80211\_h.py}: port of nl80211 (commands \& attributes)
+\item \textbf{nl80211\_c.py}: nl80211 attribute datatypes/policies
+\end{enumerate}
+\end{enumerate}
+\item \textbf{docs}: docs subpackage
+\item \textbf{\_\_init\_\_.py}: initialize docs subpackage
+\item \textbf{nlhelp.py}: functions to search display nl80211 constants
+\item \textbf{commands.help}: nl80211 commands help data (json)
+\item \textbf{attributes.help}: nl80211 attributes help data (json)
+\item \textbf{res}:resource subpackage
+\end{enumerate}
+\end{enumerate}
+
\section{API: pyw.py}\label{sec:pywapi}
\subsection{Constants}
@@ -840,6 +826,78 @@ \subsection{Functions}
\end{itemize}
\end{itemize}
+\section{API: channels.py}\label{sec:channels.api}
+Channel, Frequency enumeration and conversions can be found in channels.py.
+
+\subsection{Constants}
+\begin{enumerate}
+\item \textbf{CHWIDTHS}: imported channel widths from nl80211\_h
+\item \textbf{ISM\_24\_C2F}: Dict containing ISM channel (key) to frequency (value)
+pairs
+\item \textbf{ISM\_24\_F2C}: Dict containing ISM frequency (key) to channel (value)
+pairs
+\item \textbf{UNII\_5\_C2F}: Dict containing UNII 5Ghz channel (key) to frequency
+(value) pairs
+\item \textbf{UNII\_5\_F2C}: Dict containing UNII 5Ghz frequency (key) to channel
+(value) pairs
+\item \textbf{UNII\_4\_C2F}: Dict containing UNII upper 4Ghz channel (key) to
+frequency (value) pairs
+\item \textbf{UNII\_4\_F2C}: Dict containing UNII upper 4Ghz frequency (key) to
+channel (value) pairs
+\end{enumerate}
+
+\subsection{Functions}
+\begin{enumerate}
+\item channels(): returns a list of all channels
+\item freqs(): returns a list of all frequencies
+\item ch2rf(c): convert channel c to frequency
+\item rf2ch(f): convert frequency f to channel
+\end{enumerate}
+
+\section{API: device.py}\label{sec:deviceapi}
+Retrieval of the driver and chipset of a given card is found in device.py.
+
+\subsection{Constants}
+\begin{enumerate}
+\item \textbf{dpath}: path to system device details
+\item \textbf{drvpath}: path to device drivers
+\end{enumerate}
+
+\subsection{Functions}
+\begin{enumerate}
+\item ifcard(dev): returns the device driver and chipset
+\item ifdriver(dev): returns the device driver
+\item ifchipset(driver): returns the chipset associated with driver
+\end{enumerate}
+
+\section{API: rfkill.py}\label{sec:rfkillapi}
+A port of the command line tool rfkill, rfkill.py writes and reads rfkill\_event
+structures to /dev/rfkill using fcntl provding functionality to block and unblock
+devices.
+
+\subsection{Constants}
+\begin{enumerate}
+\item \textbf{RFKILL\_TYPES}: list of strings corresponding to the types of devices
+supported by rfkill
+\end{enumerate}
+
+\subsection{Functions}
+\begin{enumerate}
+\item rfkill\_list(): corresponds to rkill list, returns a dict of dicts name ->
+\{idx, type, soft, hard\}. If type is 'wireless', then name will be of the form
+phy such that n is the physical index of the wireless card
+\item rfkill\_block(idx): soft blocks the device at rfkill index idx
+\item rfkill\_blockby(rtype): soft blocks all devices of type rtype
+\item rfkill\_unblock(idx): turns off the soft block at rfkill index idx
+\item rfkill\_unblockby(rtype): turns off the soft blocks of all devices of type
+rtype
+\item soft\_blocked{idx}: determines soft block state of device at rfkill index idx
+\item hard\_blocked{idx}: determines hard block state of device at rfkill index idx
+\item getidx(phy): returns the rfkill index of the device with physical index phy
+\item getname(idx): returns the name of the device at rfkill index idx
+\item gettype(idx): returns the type of the device at rfkill index idx
+\end{enumerate}
+
\section{API: libnl.py}\label{sec:libnlapi}
Providing libnl similar functionality, libnl.py provides the interface between
pyw and the underlying nl80211 core. It relates similarily to libnl by providing
@@ -977,8 +1035,20 @@ \subsection{Functions}\label{sec:libnlfct}
\end{itemize}
\end{itemize}
+\section{API: libio.py}\label{sec:libioapi}
+A very basic interface to ioctl, libio provides socket creation, deletion and
+transfer.
+
+\subsection{Functions}
+\begin{enumerate}
+\item io\_socket\_alloc(): returns an ioctl socket
+\item io\_socket\_free(iosock): closes the ioctl socket iosock
+\item io\_transfer\_(iosock,flag,ifreq): sends the ifreq structure with sockios
+control call flag to the kernel and returns the received ifreq structure
+\end{enumerate}
+
\section{Copyright and License}\label{sec:copy}
-PYRIC: Python Radio Interface Controller v0.0.5\\
+PYRIC: Python Radio Interface Controller v0.1.0\\
Copyright (C) 2016 Dale V. Patterson (wraith.wireless@yandex.com)\\
diff --git a/guide/nlsend.png b/guide/nlsend.png
new file mode 100644
index 0000000..c31e5b6
Binary files /dev/null and b/guide/nlsend.png differ
diff --git a/guide/nlsock.png b/guide/nlsock.png
new file mode 100644
index 0000000..1eef030
Binary files /dev/null and b/guide/nlsock.png differ
diff --git a/pyric/__init__.py b/pyric/__init__.py
index 669d409..f191fa5 100644
--- a/pyric/__init__.py
+++ b/pyric/__init__.py
@@ -119,12 +119,12 @@
__name__ = 'pyric'
__license__ = 'GPLv3'
-__version__ = '0.0.8'
-__date__ = 'April 2016'
+__version__ = '0.1.0'
+__date__ = 'June 2016'
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
from os import strerror
diff --git a/pyric/channels.py b/pyric/channels.py
index 7357e82..91e443b 100644
--- a/pyric/channels.py
+++ b/pyric/channels.py
@@ -22,6 +22,8 @@
Defines ISM 2.4Ghz,UNII 5Ghz and 4.9GHz frequencies and channels
+Need to define 3GHz channels/freqs
+
"""
__name__ = 'channels'
@@ -78,7 +80,6 @@ def freqs():
def ch2rf(c):
"""
channel to frequency conversion
-
:param c:channel
:returns:frequency in MHz corresponding to channel
"""
@@ -89,7 +90,6 @@ def ch2rf(c):
def rf2ch(f):
"""
frequency to channel conversion
-
:param f:frequency (in MHz)
:returns:channel number corresponding to frequency
"""
diff --git a/pyric/device.py b/pyric/device.py
index f5a6f7a..5400c60 100644
--- a/pyric/device.py
+++ b/pyric/device.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+
""" device.py: utility functions
Copyright (C) 2016 Dale V. Patterson (wraith.wireless@yandex.com)
@@ -37,7 +38,7 @@
dpath = '/proc/net/dev' # system device details
drvpath = '/sys/class/net/{0}/device/driver/module/drivers' # format w/ device name
-phypath = '/sys/class/ieee80211/{0}' # format w/ phyiscal name
+#phypath = '/sys/class/ieee80211/{0}' # format w/ phyiscal name
# NOTE phypath + index contains the ifindex (sometimes)
def ifcard(dev):
diff --git a/pyric/docs/__init__.py b/pyric/docs/__init__.py
index 22e810e..2c7bfe1 100644
--- a/pyric/docs/__init__.py
+++ b/pyric/docs/__init__.py
@@ -35,4 +35,4 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
\ No newline at end of file
+__status__ = 'Production'
\ No newline at end of file
diff --git a/pyric/docs/attributes.help b/pyric/docs/attributes.help
index f05b4f1..aeab1c5 100644
--- a/pyric/docs/attributes.help
+++ b/pyric/docs/attributes.help
@@ -1,5 +1,5 @@
-# attributes.help (stored json format)
-# Automatically generated 2016-04-17T11:06:58.35097
+# attributes.help (stored in json format)
+# Automatically generated 2016-04-17T11:06:58.35097 from nl80211.h
{"@NL80211_ATTR_PMKID": {"cmds": [], "type": "unspec", "desc": "PMK material for PMKSA caching"}, "@NL80211_ATTR_WIPHY": {"cmds": [], "type": "unspec", "desc": "index of wiphy to operate on /sys/class/ieee80211//index"}, "@NL80211_ATTR_SCAN_SUPP_RATES": {"cmds": [], "type": "unspec", "desc": "rates per to be advertised as supported in scan nested array attribute containing an entry for each band, with the entry being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but without the length restriction (at most %NL80211_MAX_SUPP_RATES)."}, "@NL80211_ATTR_AKM_SUITES": {"cmds": [], "type": "unspec", "desc": "Used with CONNECT indicate which key management algorithm(s) to use (an array of u32)."}, "@NL80211_ATTR_SCAN_FLAGS": {"cmds": [], "type": "unspec", "desc": "scan request control flags "}, "@NL80211_ATTR_IFTYPE": {"cmds": [], "type": "unspec", "desc": "type of virtual interface"}, "@NL80211_ATTR_MAX_SCAN_IE_LEN": {"cmds": [], "type": "unspec", "desc": "maximum length of information elements that can be added to a scan request"}, "@NL80211_ATTR_FREQ_BEFORE": {"cmds": [], "type": "unspec", "desc": "A channel which has suffered a regulatory change due to considerations from a beacon hint. This attribute reflects the state of the channel _before_ the beacon hint processing. This attributes consists of a nested attribute containing NL80211_FREQUENCY_ATTR_*"}, "@NL80211_ATTR_P2P_OPPPS": {"cmds": [], "type": "unspec", "desc": "P2P GO opportunistic PS START_AP and SET_BSS commands. This can have the values 0 or 1; if not given in START_AP 0 is assumed, if not given in SET_BSS no change is made."}, "@NL80211_ATTR_IE_ASSOC_RESP": {"cmds": ["%NL80211_CMD_NEW_BEACON", "%NL80211_CMD_SET_BEACON"], "type": "unspec", "desc": "Information element Response frames. This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into (Re)Association Response frames when the driver (or firmware) replies to (Re)Association Request frames."}, "@NL80211_ATTR_MPATH_NEXT_HOP": {"cmds": [], "type": "unspec", "desc": "MAC address of the next hop for a mesh path"}, "@NL80211_ATTR_RXMGMT_FLAGS": {"cmds": [], "type": "unspec", "desc": "flags for nl80211_send_mgmt As specified in the &enum nl80211_rxmgmt_flags."}, "@NL80211_ATTR_MAX_CRIT_PROT_DURATION": {"cmds": [], "type": "unspec", "desc": "duration in milliseconds in which the connection should have increased reliability (u16)."}, "@NL80211_ATTR_STA_LISTEN_INTERVAL": {"cmds": [], "type": "unspec", "desc": "listen interval as defined by IEEE 802.11 7.3.1.6 (u16)."}, "@NL80211_ATTR_FRAME_TYPE": {"cmds": [], "type": "unspec", "desc": "A u16 indicating the frame type @NL80211_CMD_REGISTER_FRAME command."}, "@NL80211_ATTR_REG_RULES": {"cmds": [], "type": "unspec", "desc": "a nested array of regulatory domain regulatory rules."}, "@NL80211_ATTR_STATUS_CODE": {"cmds": [], "type": "unspec", "desc": "StatusCode for the event (u16)"}, "@NL80211_ATTR_VHT_CAPABILITY": {"cmds": [], "type": "unspec", "desc": "VHT Capability information element association request when used with NL80211_CMD_NEW_STATION)"}, "@NL80211_ATTR_CRIT_PROT_ID": {"cmds": [], "type": "unspec", "desc": "critical protocol identifier requiring increased reliability, see &enum nl80211_crit_proto_id (u16)."}, "@NL80211_ATTR_TDLS_ACTION": {"cmds": [], "type": "unspec", "desc": "Low level TDLS action code request, link setup confirm, link teardown, etc.). Values are described in the TDLS (802.11z) specification."}, "@NL80211_ATTR_RESP_IE": {"cmds": [], "type": "unspec", "desc": " sent by peer, for ROAM and successful CONNECT events."}, "@NL80211_ATTR_WDEV": {"cmds": [], "type": "unspec", "desc": "wireless device identifier that don't have a netdev (u64)"}, "@NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS": {"cmds": [], "type": "unspec", "desc": "number of SSIDs you can scan with a single scheduled scan request, a wiphy attribute."}, "@NL80211_ATTR_CONTROL_PORT_ETHERTYPE": {"cmds": [], "type": "unspec", "desc": "A 16 ethertype that will be used for key negotiation. It can be specified with the associate and connect commands. If it is not specified, the value defaults to 0x888E (PAE, 802.1X). This attribute is also used as a flag in the wiphy information to indicate that protocols other than PAE are supported."}, "@NL80211_ATTR_KEY_TYPE": {"cmds": [], "type": "unspec", "desc": "Key Type"}, "@NL80211_ATTR_ROAM_SUPPORT": {"cmds": [], "type": "unspec", "desc": "Indicates whether the firmware is capable of roaming to another AP in the same ESS if the signal lever is low."}, "@NL80211_ATTR_TX_NO_CCK_RATE": {"cmds": ["%NL80211_CMD_TRIGGER_SCAN", "%NL80211_CMD_FRAME"], "type": "unspec", "desc": "Indicates whether to use CCK rate or not for management frames transmission. In order to avoid p2p probe/action frames are being transmitted at CCK rate in 2GHz band, the user space applications use this attribute. This attribute is used with %NL80211_CMD_TRIGGER_SCAN and %NL80211_CMD_FRAME commands."}, "@NL80211_ATTR_MGMT_SUBTYPE": {"cmds": ["%NL80211_CMD_SET_MGMT_EXTRA_IE"], "type": "unspec", "desc": "Management frame subtype for %NL80211_CMD_SET_MGMT_EXTRA_IE."}, "@NL80211_ATTR_RX_FRAME_TYPES": {"cmds": [], "type": "unspec", "desc": "wiphy capability attribute nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing information about which frame types can be registered for RX."}, "@NL80211_ATTR_BSS_BASIC_RATES": {"cmds": [], "type": "unspec", "desc": "basic rates rates in format defined by IEEE 802.11 7.3.2.2 but without the length restriction (at most %NL80211_MAX_SUPP_RATES)."}, "@NL80211_ATTR_IE_PROBE_RESP": {"cmds": ["%NL80211_CMD_NEW_BEACON", "%NL80211_CMD_SET_BEACON"], "type": "unspec", "desc": "Information element This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the driver (or firmware) replies to Probe Request frames."}, "@NL80211_ATTR_SUPPORTED_IFTYPES": {"cmds": [], "type": "unspec", "desc": "nested attribute containing all supported interface types, each a flag attribute with the number of the interface mode."}, "@NL80211_ATTR_IFINDEX": {"cmds": [], "type": "unspec", "desc": "network interface index of the device to operate on"}, "@NL80211_ATTR_EXT_CAPA_MASK": {"cmds": [], "type": "unspec", "desc": "Extended capabilities that the kernel driver has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields."}, "@NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION": {"cmds": [], "type": "unspec", "desc": "Device attribute that specifies the maximum duration that can be requested with the remain-on-channel operation, in milliseconds, u32."}, "@NL80211_ATTR_REQ_IE": {"cmds": [], "type": "unspec", "desc": " sent out by the card, for ROAM and successful CONNECT events."}, "@NL80211_ATTR_REKEY_DATA": {"cmds": [], "type": "unspec", "desc": "nested attribute containing the information necessary for GTK rekeying in the device, see &enum nl80211_rekey_data."}, "@NL80211_ATTR_HT_CAPABILITY": {"cmds": [], "type": "unspec", "desc": "HT Capability information element association request when used with NL80211_CMD_NEW_STATION)"}, "@NL80211_ATTR_KEY_DATA": {"cmds": [], "type": "unspec", "desc": " 16 bytes encryption key followed by 8 bytes each for TX and RX MIC keys"}, "@NL80211_ATTR_KEY_DEFAULT": {"cmds": [], "type": "unspec", "desc": "Flag attribute indicating the key is default key"}, "@NL80211_ATTR_MESH_SETUP": {"cmds": [], "type": "unspec", "desc": "Optional mesh setup parameters changed once the mesh is active."}, "@NL80211_ATTR_PMKSA_CANDIDATE": {"cmds": [], "type": "unspec", "desc": "Nested attribute containing the PMKSA caching candidate information, see &enum nl80211_pmksa_candidate_attr."}, "@NL80211_ATTR_WIPHY_RTS_THRESHOLD": {"cmds": [], "type": "unspec", "desc": "RTS threshold larger than or equal to this use RTS/CTS handshake); allowed range: 0..65536, disable with (u32)-1; dot11RTSThreshold; u32"}, "@NL80211_ATTR_DTIM_PERIOD": {"cmds": [], "type": "unspec", "desc": "DTIM period for beaconing"}, "@NL80211_ATTR_MAX_NUM_SCAN_SSIDS": {"cmds": [], "type": "unspec", "desc": "number of SSIDs you can scan with a single scan request, a wiphy attribute."}, "@NL80211_ATTR_MESH_CONFIG": {"cmds": [], "type": "unspec", "desc": "Mesh configuration parameters containing attributes from &enum nl80211_meshconf_params."}, "@NL80211_ATTR_COOKIE": {"cmds": [], "type": "unspec", "desc": "Generic 64"}, "@NL80211_ATTR_MAX_MATCH_SETS": {"cmds": [], "type": "unspec", "desc": "maximum number of sets that can be used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute."}, "@NL80211_ATTR_CH_SWITCH_COUNT": {"cmds": [], "type": "unspec", "desc": "u32 attribute specifying the number of TBTT until the channel switch event."}, "@NL80211_ATTR_OFFCHANNEL_TX_OK": {"cmds": [], "type": "unspec", "desc": "For management frame TX transmitted on another channel when the channel given doesn't match the current channel. If the current channel doesn't match and this flag isn't set, the frame will be rejected. This is also used as an nl80211 capability flag."}, "@NL80211_ATTR_SUPPORT_MESH_AUTH": {"cmds": [], "type": "unspec", "desc": "Currently allows auth frames in a mesh to be passed to userspace for processing via the @NL80211_MESH_SETUP_USERSPACE_AUTH flag."}, "@NL80211_ATTR_REASON_CODE": {"cmds": ["%NL80211_CMD_DISASSOCIATE"], "type": "unspec", "desc": "ReasonCode for %NL80211_CMD_DISASSOCIATE, u16"}, "@NL80211_ATTR_STA_WME": {"cmds": [], "type": "unspec", "desc": "Nested attribute containing the wme configuration of the station, see &enum nl80211_sta_wme_attr."}, "@NL80211_ATTR_AP_ISOLATE": {"cmds": [], "type": "unspec", "desc": " connected to this BSS."}, "@NL80211_ATTR_TESTDATA": {"cmds": [], "type": "unspec", "desc": "Testmode data blob We recommend using nested, driver-specific attributes within this."}, "@NL80211_ATTR_CIPHER_SUITES_PAIRWISE": {"cmds": [], "type": "unspec", "desc": "For crypto settings for connect or other commands, indicates which pairwise cipher suites are used"}, "@NL80211_ATTR_BSS_CTS_PROT": {"cmds": [], "type": "unspec", "desc": "whether CTS protection is enabled "}, "@NL80211_ATTR_BSS_SHORT_SLOT_TIME": {"cmds": [], "type": "unspec", "desc": "whether short slot time enabled (u8, 0 or 1)"}, "@NL80211_ATTR_PEER_AID": {"cmds": [], "type": "unspec", "desc": "Association ID for the peer TDLS station This is similar to @NL80211_ATTR_STA_AID but with a difference of being allowed to be used with the first @NL80211_CMD_SET_STATION command to update a TDLS peer STA entry."}, "@NL80211_ATTR_SPLIT_WIPHY_DUMP": {"cmds": [], "type": "unspec", "desc": "flag attribute receiving the data for a single wiphy split across multiple messages, given with wiphy dump message"}, "@NL80211_ATTR_SUPPORT_IBSS_RSN": {"cmds": [], "type": "unspec", "desc": "The device supports IBSS RSN means support for per-station GTKs."}, "@NL80211_ATTR_IE": {"cmds": ["%NL80211_CMD_SET_MGMT_EXTRA_IE"], "type": "unspec", "desc": "Information element %NL80211_CMD_SET_MGMT_EXTRA_IE)."}, "@NL80211_ATTR_AUTH_TYPE": {"cmds": [], "type": "unspec", "desc": "AuthenticationType represented as a u32"}, "@NL80211_ATTR_BSS": {"cmds": [], "type": "unspec", "desc": "scan result BSS"}, "@NL80211_ATTR_PROBE_RESP_OFFLOAD": {"cmds": [], "type": "unspec", "desc": "Indicates that the HW responds to probe requests while operating in AP-mode. This attribute holds a bitmap of the supported protocols for offloading (see &enum nl80211_probe_resp_offload_support_attr)."}, "@NL80211_ATTR_STA_SUPPORTED_CHANNELS": {"cmds": [], "type": "unspec", "desc": "array of supported channels"}, "@NL80211_ATTR_KEY_SEQ": {"cmds": [], "type": "unspec", "desc": "transmit key sequence number CCMP keys, each six bytes in little endian"}, "@NL80211_ATTR_4ADDR": {"cmds": [], "type": "unspec", "desc": "Use 4"}, "@NL80211_ATTR_TIMED_OUT": {"cmds": ["%NL80211_CMD_AUTHENTICATE"], "type": "unspec", "desc": "a flag indicating than an operation timed out is used, e.g., with %NL80211_CMD_AUTHENTICATE event"}, "@NL80211_ATTR_UNSPEC": {"cmds": [], "type": "unspec", "desc": "unspecified attribute to catch errors"}, "@NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT": {"cmds": [], "type": "unspec", "desc": "When included along with %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom ethertype frames used for key negotiation must not be encrypted."}, "@NL80211_ATTR_BEACON_TAIL": {"cmds": [], "type": "unspec", "desc": "portion of the beacon after the TIM IE"}, "@NL80211_ATTR_REG_INITIATOR": {"cmds": [], "type": "unspec", "desc": "indicates who requested the regulatory domain currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*"}, "@NL80211_ATTR_WIPHY_TX_POWER_LEVEL": {"cmds": [], "type": "unspec", "desc": "Transmit power level in signed mBm units This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING for non-automatic settings."}, "@NL80211_ATTR_ACL_POLICY": {"cmds": [], "type": "unspec", "desc": "ACL policy carried in a u32 attribute"}, "@NL80211_ATTR_SAE_DATA": {"cmds": [], "type": "unspec", "desc": "SAE elements in Authentication frames with the Authentication transaction sequence number field."}, "@NL80211_ATTR_WIPHY_RETRY_LONG": {"cmds": [], "type": "unspec", "desc": "TX retry limit for frames whose length is greater than the RTS threshold; allowed range: 1..255; dot11ShortLongLimit; u8"}, "@NL80211_ATTR_INTERFACE_COMBINATIONS": {"cmds": [], "type": "unspec", "desc": "Nested attribute listing the supported interface combinations. In each nested item, it contains attributes defined in &enum nl80211_if_combination_attrs."}, "@NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX": {"cmds": [], "type": "unspec", "desc": "Bitmap of antennas which are available for configuration as TX antennas via the above parameters."}, "@NL80211_ATTR_KEY_DEFAULT_MGMT": {"cmds": [], "type": "unspec", "desc": "Flag attribute indicating the key is the default management key"}, "@NL80211_ATTR_BSS_HT_OPMODE": {"cmds": [], "type": "unspec", "desc": "HT operation mode "}, "@NL80211_ATTR_BEACON_HEAD": {"cmds": [], "type": "unspec", "desc": "portion of the beacon before the TIM IE"}, "@NL80211_ATTR_KEYS": {"cmds": [], "type": "unspec", "desc": "array of keys for static WEP keys for connect and join_ibss(), key information is in a nested attribute each with %NL80211_KEY_* sub-attributes"}, "@NL80211_ATTR_MDID": {"cmds": [], "type": "unspec", "desc": "Mobility Domain Identifier"}, "@NL80211_ATTR_STA_PLINK_ACTION": {"cmds": [], "type": "unspec", "desc": "action to perform on the mesh peer link (see &enum nl80211_plink_action)."}, "@NL80211_ATTR_ACK": {"cmds": [], "type": "unspec", "desc": "Flag attribute indicating that the frame was acknowledged by the recipient."}, "@NL80211_ATTR_WIPHY_FREQ": {"cmds": [], "type": "unspec", "desc": "frequency of the selected channel in MHz defines the channel together with the (deprecated) %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1 and %NL80211_ATTR_CENTER_FREQ2"}, "@NL80211_ATTR_WPA_VERSIONS": {"cmds": [], "type": "unspec", "desc": "Used with CONNECT indicate which WPA version(s) the AP we want to associate with is using (a u32 with flags from &enum nl80211_wpa_versions)."}, "@NL80211_ATTR_SUPPORT_AP_UAPSD": {"cmds": [], "type": "unspec", "desc": "the device supports uapsd when working as AP."}, "@NL80211_ATTR_SCHED_SCAN_MATCH": {"cmds": [], "type": "unspec", "desc": "Nested attribute with one or more sets of attributes to match during scheduled scans. Only BSSs that match any of the sets will be reported. These are pass-thru filter rules. For a match to succeed, the BSS must match all attributes of a set. Since not every hardware supports matching all types of attributes, there is no guarantee that the reported BSSs are fully complying with the match sets and userspace needs to be able to ignore them by itself. Thus, the implementation is somewhat hardware-dependent, but this is only an optimization and the userspace application needs to handle all the non-filtered results anyway. If the match attributes don't make sense when combined with the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID is included in the probe request, but the match attributes will never let it go through), -EINVAL may be returned. If ommited, no filtering is done."}, "@NL80211_ATTR_LOCAL_MESH_POWER_MODE": {"cmds": [], "type": "unspec", "desc": "local mesh STA link defined in &enum nl80211_mesh_power_mode."}, "@NL80211_ATTR_SCHED_SCAN_INTERVAL": {"cmds": [], "type": "unspec", "desc": "Interval between scheduled scan cycles, in msecs."}, "@NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED": {"cmds": [], "type": "unspec", "desc": "indicates capabilities, the supported WoWLAN triggers"}, "@NL80211_ATTR_REG_TYPE": {"cmds": [], "type": "unspec", "desc": "indicates the type of the regulatory domain currently set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)"}, "@NL80211_ATTR_SUPPORTED_COMMANDS": {"cmds": [], "type": "unspec", "desc": "wiphy attribute that specifies an array of command numbers (i.e. a mapping index to command number) that the driver for the given wiphy supports."}, "@NL80211_ATTR_SCAN_FREQUENCIES": {"cmds": [], "type": "unspec", "desc": "nested attribute with frequencies "}, "@NL80211_ATTR_IFNAME": {"cmds": [], "type": "unspec", "desc": "network interface name"}, "@NL80211_ATTR_CSA_IES": {"cmds": [], "type": "unspec", "desc": "Nested set of attributes containing the IE information for the time while performing a channel switch."}, "@NL80211_ATTR_CONTROL_PORT": {"cmds": ["%NL80211_CMD_ASSOCIATE"], "type": "unspec", "desc": "A flag indicating whether user space controls IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in station mode. If the flag is included in %NL80211_CMD_ASSOCIATE request, the driver will assume that the port is unauthorized until authorized by user space. Otherwise, port is marked authorized by default in station mode."}, "@NL80211_ATTR_CSA_C_OFF_PRESP": {"cmds": [], "type": "unspec", "desc": "Offset of the channel switch counter field in the probe response (%NL80211_ATTR_PROBE_RESP)."}, "@NL80211_ATTR_CIPHERS_PAIRWISE": {"cmds": [], "type": "unspec", "desc": "Used with CONNECT to indicate which unicast key ciphers will be used with the connection (an array of u32)."}, "@NL80211_ATTR_WIPHY_ANTENNA_RX": {"cmds": [], "type": "unspec", "desc": "Bitmap of allowed antennas for receiving This can be used to mask out antennas which are not attached or should not be used for receiving. If an antenna is not selected in this bitmap the hardware should not be configured to receive on this antenna. For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX."}, "@NL80211_ATTR_DISCONNECTED_BY_AP": {"cmds": [], "type": "unspec", "desc": "A flag indicating that the DISCONNECT event was due to the AP disconnecting the station, and not due to a local disconnect request."}, "@NL80211_ATTR_INACTIVITY_TIMEOUT": {"cmds": [], "type": "unspec", "desc": "timeout value in seconds used by the drivers which has MLME in firmware and does not have support to report per station tx/rx activity to free up the staion entry from the list. This needs to be used when the driver advertises the capability to timeout the stations."}, "@NL80211_ATTR_TDLS_SUPPORT": {"cmds": [], "type": "unspec", "desc": "A flag indicating the device can operate as a TDLS peer sta."}, "@NL80211_ATTR_CENTER_FREQ2": {"cmds": [], "type": "unspec", "desc": "Center frequency of the second part of the channel, used only for 80+80 MHz bandwidth"}, "@NL80211_ATTR_STA_EXT_CAPABILITY": {"cmds": [], "type": "unspec", "desc": "Station extended capabilities are advertised to the driver, e.g., to enable TDLS off channel operations and PU-APSD."}, "@NL80211_ATTR_STA_PLINK_STATE": {"cmds": [], "type": "unspec", "desc": "The state of a mesh peer link as defined in &enum nl80211_plink_state. Used when userspace is driving the peer link management state machine. @NL80211_MESH_SETUP_USERSPACE_AMPE or @NL80211_MESH_SETUP_USERSPACE_MPM must be enabled."}, "@NL80211_ATTR_MAC": {"cmds": [], "type": "unspec", "desc": "MAC address "}, "@NL80211_ATTR_CSA_C_OFF_BEACON": {"cmds": [], "type": "unspec", "desc": "Offset of the channel switch counter field in the beacons tail (%NL80211_ATTR_BEACON_TAIL)."}, "@NL80211_ATTR_WIPHY_NAME": {"cmds": [], "type": "unspec", "desc": "wiphy name "}, "@NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX": {"cmds": [], "type": "unspec", "desc": "Bitmap of antennas which are available for configuration as RX antennas via the above parameters."}, "@NL80211_ATTR_CONN_FAILED_REASON": {"cmds": [], "type": "unspec", "desc": "The reason for which AP has rejected the connection request from a station. nl80211_connect_failed_reason enum has different reasons of connection failure."}, "@NL80211_ATTR_CENTER_FREQ1": {"cmds": [], "type": "unspec", "desc": "Center frequency of the first part of the channel, used for anything but 20 MHz bandwidth"}, "@NL80211_ATTR_FRAME": {"cmds": [], "type": "unspec", "desc": "frame data and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and NL80211_CMD_ASSOCIATE events"}, "@NL80211_ATTR_SOFTWARE_IFTYPES": {"cmds": [], "type": "unspec", "desc": "Nested attribute %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that are managed in software: interfaces of these types aren't subject to any restrictions in their number or combinations."}, "@NL80211_ATTR_PID": {"cmds": [], "type": "unspec", "desc": "Process ID of a network namespace"}, "@NL80211_ATTR_USE_MFP": {"cmds": ["%NL80211_CMD_ASSOCIATE", "%NL80211_CMD_CONNECT"], "type": "unspec", "desc": "Whether management frame protection used for the association (&enum nl80211_mfp, represented as a u32); this attribute can be used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests"}, "@NL80211_ATTR_PS_STATE": {"cmds": [], "type": "unspec", "desc": "powersave state"}, "@NL80211_ATTR_PREV_BSSID": {"cmds": [], "type": "unspec", "desc": "previous BSSID commands to specify using a reassociate frame"}, "@NL80211_ATTR_DISABLE_HT": {"cmds": [], "type": "unspec", "desc": " Force HT capable interfaces to disable this feature. Currently, only supported in mac80211 drivers."}, "@NL80211_ATTR_TX_RATES": {"cmds": ["%NL80211_CMD_SET_TX_BITRATE_MASK"], "type": "unspec", "desc": "Nested set of attributes (enum nl80211_tx_rate_attributes) describing TX rates per band. The enum nl80211_band value is used as the index (nla_type() of the nested data. If a band is not included, it will be configured to allow all rates based on negotiated supported rates information. This attribute is used with %NL80211_CMD_SET_TX_BITRATE_MASK."}, "@NL80211_ATTR_MAC_ADDRS": {"cmds": [], "type": "unspec", "desc": "Array of nested MAC addresses"}, "@NL80211_ATTR_COALESCE_RULE": {"cmds": [], "type": "unspec", "desc": "Coalesce rule information"}, "@NL80211_ATTR_RADAR_EVENT": {"cmds": [], "type": "unspec", "desc": "Type of radar event for notification to userspace contains a value of enum nl80211_radar_event (u32)."}, "@NL80211_ATTR_STA_SUPPORTED_RATES": {"cmds": [], "type": "unspec", "desc": "supported rates rates as defined by IEEE 802.11 7.3.2.2 but without the length restriction (at most %NL80211_MAX_SUPP_RATES)."}, "@NL80211_ATTR_IE_RIC": {"cmds": [], "type": "unspec", "desc": "Resource Information Container Information element"}, "@NL80211_ATTR_STA_FLAGS2": {"cmds": [], "type": "unspec", "desc": "Attribute containing a &struct nl80211_sta_flag_update."}, "@NL80211_ATTR_PRIVACY": {"cmds": [], "type": "unspec", "desc": "Flag attribute that protected APs should be used. This is also used with NEW_BEACON to indicate that the BSS is to use protection."}, "@NL80211_ATTR_WIPHY_COVERAGE_CLASS": {"cmds": [], "type": "unspec", "desc": "Coverage Class as defined by IEEE 802 section 7.3.2.9; dot11CoverageClass; u8"}, "@NL80211_ATTR_BSS_SHORT_PREAMBLE": {"cmds": [], "type": "unspec", "desc": "whether short preamble is enabled (u8, 0 or 1)"}, "@NL80211_ATTR_MCAST_RATE": {"cmds": [], "type": "unspec", "desc": "Multicast tx rate "}, "@NL80211_ATTR_WIPHY_CHANNEL_TYPE": {"cmds": [], "type": "unspec", "desc": "included with NL80211_ATTR_WIPHY_FREQ if HT20 or HT40 are to be used (i.e., HT disabled if not included): NL80211_CHAN_NO_HT = HT not allowed (same as not including) NL80211_CHAN_HT20 = HT20 only NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel This attribute is now deprecated."}, "@NL80211_ATTR_PROBE_RESP": {"cmds": [], "type": "unspec", "desc": "Probe Response template data probe-response frame. The DA field in the 802.11 header is zero-ed out, to be filled by the FW."}, "@NL80211_ATTR_CQM": {"cmds": [], "type": "unspec", "desc": "connection quality monitor configuration in a nested attribute with %NL80211_ATTR_CQM_* sub-attributes."}, "@NL80211_ATTR_DONT_WAIT_FOR_ACK": {"cmds": [], "type": "unspec", "desc": "Used with the driver to not wait for an acknowledgement. Note that due to this, it will also not give a status callback nor return a cookie. This is mostly useful for probe responses to save airtime."}, "@NL80211_ATTR_STA_VLAN": {"cmds": [], "type": "unspec", "desc": "interface index of VLAN interface to move station to, or the AP interface the station was originally added to to."}, "@NL80211_ATTR_FREQ_AFTER": {"cmds": [], "type": "unspec", "desc": "A channel which has suffered a regulatory change due to considerations from a beacon hint. This attribute reflects the state of the channel _after_ the beacon hint processing. This attributes consists of a nested attribute containing NL80211_FREQUENCY_ATTR_*"}, "@NL80211_ATTR_MESH_ID": {"cmds": [], "type": "unspec", "desc": "mesh id "}, "@NL80211_ATTR_DFS_REGION": {"cmds": [], "type": "unspec", "desc": "region for regulatory rules which this country abides to when initiating radiation on DFS channels. A country maps to one DFS region."}, "@NL80211_ATTR_MNTR_FLAGS": {"cmds": [], "type": "unspec", "desc": "flags &enum nl80211_mntr_flags."}, "@NL80211_ATTR_WIPHY_FRAG_THRESHOLD": {"cmds": [], "type": "unspec", "desc": "fragmentation threshold length in octets for frames; allowed range: 256..8000, disable fragmentation with (u32)-1; dot11FragmentationThreshold; u32"}, "@NL80211_ATTR_KEY_CIPHER": {"cmds": [], "type": "unspec", "desc": "key cipher suite section 7.3.2.25.1, e.g. 0x000FAC04)"}, "@NL80211_ATTR_KEY_IDX": {"cmds": [], "type": "unspec", "desc": "key ID "}, "@NL80211_ATTR_P2P_CTWINDOW": {"cmds": [], "type": "unspec", "desc": "P2P GO Client Traffic Window the START_AP and SET_BSS commands"}, "@NL80211_ATTR_TDLS_EXTERNAL_SETUP": {"cmds": ["%NL80211_CMD_TDLS_MGMT", "%NL80211_CMD_TDLS_OPER"], "type": "unspec", "desc": "The TDLS discovery procedures should be performed by sending TDLS packets via %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be used for asking the driver to perform a TDLS operation."}, "@NL80211_ATTR_PROTOCOL_FEATURES": {"cmds": [], "type": "unspec", "desc": "global nl80211 feature flags &enum nl80211_protocol_features, the attribute is a u32."}, "@NL80211_ATTR_MPATH_INFO": {"cmds": ["%NL80211_CMD_GET_MPATH"], "type": "unspec", "desc": "information about a mesh_path info given for %NL80211_CMD_GET_MPATH, nested attribute described at &enum nl80211_mpath_info."}, "@NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN": {"cmds": [], "type": "unspec", "desc": "maximum length of information elements that can be added to a scheduled scan request"}, "@NL80211_ATTR_TDLS_OPERATION": {"cmds": [], "type": "unspec", "desc": "High level TDLS operation &enum nl80211_tdls_operation, represented as a u8."}, "@NL80211_ATTR_FREQ_FIXED": {"cmds": [], "type": "unspec", "desc": "a flag indicating the IBSS should not try to look for other networks on different channels"}, "@NL80211_ATTR_STA_FLAGS": {"cmds": [], "type": "unspec", "desc": "flags &enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2)"}, "@NL80211_ATTR_MAX_NUM_PMKIDS": {"cmds": [], "type": "unspec", "desc": "maximum number of PMKIDs a firmware can cache, a wiphy attribute."}, "@NL80211_ATTR_MAC_ACL_MAX": {"cmds": [], "type": "unspec", "desc": "u32 attribute to advertise the maximum number of MAC addresses that a device can support for MAC ACL"}, "@NL80211_ATTR_STA_AID": {"cmds": [], "type": "unspec", "desc": "Association ID for the station "}, "@NL80211_ATTR_KEY": {"cmds": [], "type": "unspec", "desc": "key information in a nested attribute with %NL80211_KEY_* sub-attributes"}, "@NL80211_ATTR_STA_CAPABILITY": {"cmds": [], "type": "unspec", "desc": "Station capabilities the driver, e.g., to enable TDLS power save (PU-APSD)."}, "@NL80211_ATTR_DEVICE_AP_SME": {"cmds": [], "type": "unspec", "desc": "This u32 attribute may be listed for devices that have AP support to indicate that they have the AP SME integrated with support for the features listed in this attribute, see &enum nl80211_ap_sme_features."}, "@NL80211_ATTR_HIDDEN_SSID": {"cmds": [], "type": "unspec", "desc": "indicates whether SSID is to be hidden from Beacon and Probe Response (when response to wildcard Probe Request); see &enum nl80211_hidden_ssid, represented as a u32"}, "@NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES": {"cmds": [], "type": "unspec", "desc": "array of supported supported operating classes."}, "@NL80211_ATTR_FRAME_MATCH": {"cmds": [], "type": "unspec", "desc": "A binary attribute which typically must contain at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME."}, "@NL80211_ATTR_STA_INFO": {"cmds": ["%NL80211_CMD_GET_STATION"], "type": "unspec", "desc": "information about a station given for %NL80211_CMD_GET_STATION, nested attribute containing info as possible, see &enum nl80211_sta_info."}, "@NL80211_ATTR_GENERATION": {"cmds": [], "type": "unspec", "desc": "Used to indicate consistent snapshots for dumps. This number increases whenever the object list being dumped changes, and as such userspace can verify that it has obtained a complete and consistent snapshot by verifying that all dump messages contain the same generation number. If it changed then the list changed and the dump should be repeated completely from scratch."}, "@NL80211_ATTR_WIPHY_RETRY_SHORT": {"cmds": [], "type": "unspec", "desc": "TX retry limit for frames whose length is less than or equal to the RTS threshold; allowed range: 1..255; dot11ShortRetryLimit; u8"}, "@NL80211_ATTR_CIPHER_GROUP": {"cmds": [], "type": "unspec", "desc": "Used with CONNECT indicate which group key cipher will be used with the connection, a u32"}, "@NL80211_ATTR_DURATION": {"cmds": [], "type": "unspec", "desc": "Duration of an operation in milliseconds"}, "@NL80211_ATTR_BG_SCAN_PERIOD": {"cmds": [], "type": "unspec", "desc": "Background scan period in seconds or 0 to disable background scan."}, "@NL80211_ATTR_WIPHY_BANDS": {"cmds": [], "type": "unspec", "desc": "Information about an operating bands consisting of a nested array."}, "@NL80211_ATTR_CIPHER_SUITES": {"cmds": [], "type": "unspec", "desc": "a set of u32 values indicating the supported cipher suites"}, "@NL80211_ATTR_TDLS_DIALOG_TOKEN": {"cmds": [], "type": "unspec", "desc": "Non TDLS conversation between two devices."}, "@NL80211_ATTR_REG_ALPHA2": {"cmds": [], "type": "unspec", "desc": "an ISO current regulatory domain should be set to or is already set to. For example, 'CR', for Costa Rica. This attribute is used by the kernel to query the CRDA to retrieve one regulatory domain. This attribute can also be used by userspace to query the kernel for the currently set regulatory domain. We chose an alpha2 as that is also used by the IEEE-802.11 country information element to identify a country. Users can also simply ask the wireless core to set regulatory domain to a specific alpha2."}, "@NL80211_ATTR_LOCAL_STATE_CHANGE": {"cmds": [], "type": "unspec", "desc": "Flag attribute to indicate that a command is requesting a local authentication/association state change without invoking actual management frame exchange. This can be used with NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE, NL80211_CMD_DISASSOCIATE."}, "@NL80211_ATTR_USER_REG_HINT_TYPE": {"cmds": [], "type": "unspec", "desc": "type of regulatory hint passed from userspace. If unset it is assumed the hint comes directly from a user. If set code could specify exactly what type of source was used to provide the hint. For the different types of allowed user regulatory hints see nl80211_user_reg_hint_type."}, "@NL80211_ATTR_BEACON_INTERVAL": {"cmds": [], "type": "unspec", "desc": "beacon interval in TU"}, "@NL80211_ATTR_EXT_CAPA": {"cmds": [], "type": "unspec", "desc": "802 has and handles. The format is the same as the IE contents. See 802.11-2012 8.4.2.29 for more information."}, "@NL80211_ATTR_CH_SWITCH_BLOCK_TX": {"cmds": [], "type": "unspec", "desc": "flag attribute specifying that transmission must be blocked on the current channel (before the channel switch operation)."}, "@NL80211_ATTR_WIPHY_TXQ_PARAMS": {"cmds": [], "type": "unspec", "desc": "a nested array of TX queue parameters"}, "@NL80211_ATTR_WOWLAN_TRIGGERS": {"cmds": ["%NL80211_CMD_GET_WOWLAN"], "type": "unspec", "desc": "used by indicate which WoW triggers should be enabled. This is also used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN triggers."}, "@NL80211_ATTR_HT_CAPABILITY_MASK": {"cmds": [], "type": "unspec", "desc": "Specify which bits of the ATTR_HT_CAPABILITY to which attention should be paid. Currently, only mac80211 NICs support this feature. The values that may be configured are: MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40 AMPDU density and AMPDU factor. All values are treated as suggestions and may be ignored by the driver as required. The actual values may be seen in the station debugfs ht_caps file."}, "@NL80211_ATTR_TX_FRAME_TYPES": {"cmds": ["%NL80211_CMD_FRAME"], "type": "unspec", "desc": "wiphy capability attribute nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing information about which frame types can be transmitted with %NL80211_CMD_FRAME."}, "@NL80211_ATTR_CIPHER_SUITE_GROUP": {"cmds": [], "type": "unspec", "desc": "For crypto settings for connect or other commands, indicates which group cipher suite is used"}, "@NL80211_ATTR_RX_SIGNAL_DBM": {"cmds": ["%NL80211_CMD_FRAME"], "type": "unspec", "desc": "signal strength in dBm this attribute is (depending on the driver capabilities) added to received frames indicated with %NL80211_CMD_FRAME."}, "@NL80211_ATTR_SSID": {"cmds": [], "type": "unspec", "desc": "SSID "}, "@NL80211_ATTR_KEY_DEFAULT_TYPES": {"cmds": [], "type": "unspec", "desc": "A nested attribute containing flags attributes, specifying what a key should be set as default as. See &enum nl80211_key_default_types."}, "@NL80211_ATTR_SURVEY_INFO": {"cmds": ["%NL80211_CMD_GET_SURVEY"], "type": "unspec", "desc": "survey information about a channel the survey response for %NL80211_CMD_GET_SURVEY, nested attribute containing info as possible, see &enum survey_info."}, "@NL80211_ATTR_WIPHY_TX_POWER_SETTING": {"cmds": [], "type": "unspec", "desc": "Transmit power setting type &enum nl80211_tx_power_setting for possible values."}, "@NL80211_ATTR_WIPHY_ANTENNA_TX": {"cmds": [], "type": "unspec", "desc": "Bitmap of allowed antennas for transmitting This can be used to mask out antennas which are not attached or should not be used for transmitting. If an antenna is not selected in this bitmap the hardware is not allowed to transmit on this antenna. Each bit represents one antenna, starting with antenna 1 at the first bit. Depending on which antennas are selected in the bitmap, 802.11n drivers can derive which chainmasks to use (if all antennas belonging to a particular chain are disabled this chain should be disabled) and if a chain has diversity antennas wether diversity should be used or not. HT capabilities (STBC, TX Beamforming, Antenna selection) can be derived from the available chains after applying the antenna mask. Non-802.11n drivers can derive wether to use diversity or not. Drivers may reject configurations or RX/TX mask combinations they cannot support by returning -EINVAL."}, "@NL80211_ATTR_CHANNEL_WIDTH": {"cmds": [], "type": "unspec", "desc": "u32 attribute containing one of the values of &enum nl80211_chan_width, describing the channel width. See the documentation of the enum for more information."}, "@NL80211_ATTR_NOACK_MAP": {"cmds": [], "type": "unspec", "desc": "This u16 bitmap contains the No Ack Policy of up to 16 TIDs."}, "@NL80211_ATTR_SCAN_SSIDS": {"cmds": [], "type": "unspec", "desc": "nested attribute with SSIDs scanning and include a zero-length SSID (wildcard) for wildcard scan"}, "@NL80211_ATTR_FEATURE_FLAGS": {"cmds": [], "type": "unspec", "desc": "This u32 attribute contains flags from &enum nl80211_feature_flags and is advertised in wiphy information."}, "@NL80211_ATTR_HANDLE_DFS": {"cmds": ["%NL80211_CMD_JOIN_IBSS"], "type": "unspec", "desc": "A flag indicating whether user space controls DFS operation in IBSS mode. If the flag is included in %NL80211_CMD_JOIN_IBSS request, the driver will allow use of DFS channels and reports radar events to userspace. Userspace is required to react to radar events, e.g. initiate a channel switch or leave the IBSS network."}}
{"0": ["@NL80211_ATTR_UNSPEC"], "1": ["@NL80211_ATTR_WIPHY"], "2": ["@NL80211_ATTR_WIPHY_NAME"], "3": ["@NL80211_ATTR_IFINDEX"], "4": ["@NL80211_ATTR_IFNAME"], "5": ["@NL80211_ATTR_IFTYPE"], "6": ["@NL80211_ATTR_MAC"], "7": ["@NL80211_ATTR_KEY_DATA"], "8": ["@NL80211_ATTR_KEY_IDX"], "9": ["@NL80211_ATTR_KEY_CIPHER"], "10": ["@NL80211_ATTR_KEY_SEQ"], "11": ["@NL80211_ATTR_KEY_DEFAULT"], "12": ["@NL80211_ATTR_BEACON_INTERVAL"], "13": ["@NL80211_ATTR_DTIM_PERIOD"], "14": ["@NL80211_ATTR_BEACON_HEAD"], "15": ["@NL80211_ATTR_BEACON_TAIL"], "16": ["@NL80211_ATTR_STA_AID"], "17": ["@NL80211_ATTR_STA_FLAGS"], "18": ["@NL80211_ATTR_STA_LISTEN_INTERVAL"], "19": ["@NL80211_ATTR_STA_SUPPORTED_RATES"], "20": ["@NL80211_ATTR_STA_VLAN"], "21": ["@NL80211_ATTR_STA_INFO"], "22": ["@NL80211_ATTR_WIPHY_BANDS"], "23": ["@NL80211_ATTR_MNTR_FLAGS"], "24": ["@NL80211_ATTR_MESH_ID"], "25": ["@NL80211_ATTR_STA_PLINK_ACTION"], "26": ["@NL80211_ATTR_MPATH_NEXT_HOP"], "27": ["@NL80211_ATTR_MPATH_INFO"], "28": ["@NL80211_ATTR_BSS_CTS_PROT"], "29": ["@NL80211_ATTR_BSS_SHORT_PREAMBLE"], "30": ["@NL80211_ATTR_BSS_SHORT_SLOT_TIME"], "31": ["@NL80211_ATTR_HT_CAPABILITY"], "32": ["@NL80211_ATTR_SUPPORTED_IFTYPES"], "33": ["@NL80211_ATTR_REG_ALPHA2"], "34": ["@NL80211_ATTR_REG_RULES"], "35": ["@NL80211_ATTR_MESH_CONFIG"], "36": ["@NL80211_ATTR_BSS_BASIC_RATES"], "37": ["@NL80211_ATTR_WIPHY_TXQ_PARAMS"], "38": ["@NL80211_ATTR_WIPHY_FREQ"], "39": ["@NL80211_ATTR_WIPHY_CHANNEL_TYPE"], "40": ["@NL80211_ATTR_KEY_DEFAULT_MGMT"], "41": ["@NL80211_ATTR_MGMT_SUBTYPE"], "42": ["@NL80211_ATTR_IE"], "43": ["@NL80211_ATTR_MAX_NUM_SCAN_SSIDS"], "44": ["@NL80211_ATTR_SCAN_FREQUENCIES"], "45": ["@NL80211_ATTR_SCAN_SSIDS"], "46": ["@NL80211_ATTR_GENERATION"], "47": ["@NL80211_ATTR_BSS"], "48": ["@NL80211_ATTR_REG_INITIATOR"], "49": ["@NL80211_ATTR_REG_TYPE"], "50": ["@NL80211_ATTR_SUPPORTED_COMMANDS"], "51": ["@NL80211_ATTR_FRAME"], "52": ["@NL80211_ATTR_SSID"], "53": ["@NL80211_ATTR_AUTH_TYPE"], "54": ["@NL80211_ATTR_REASON_CODE"], "55": ["@NL80211_ATTR_KEY_TYPE"], "56": ["@NL80211_ATTR_MAX_SCAN_IE_LEN"], "57": ["@NL80211_ATTR_CIPHER_SUITES"], "58": ["@NL80211_ATTR_FREQ_BEFORE"], "59": ["@NL80211_ATTR_FREQ_AFTER"], "60": ["@NL80211_ATTR_FREQ_FIXED"], "61": ["@NL80211_ATTR_WIPHY_RETRY_SHORT"], "62": ["@NL80211_ATTR_WIPHY_RETRY_LONG"], "63": ["@NL80211_ATTR_WIPHY_FRAG_THRESHOLD"], "64": ["@NL80211_ATTR_WIPHY_RTS_THRESHOLD"], "65": ["@NL80211_ATTR_TIMED_OUT"], "66": ["@NL80211_ATTR_USE_MFP"], "67": ["@NL80211_ATTR_STA_FLAGS2"], "68": ["@NL80211_ATTR_CONTROL_PORT"], "69": ["@NL80211_ATTR_TESTDATA"], "70": ["@NL80211_ATTR_PRIVACY"], "71": ["@NL80211_ATTR_DISCONNECTED_BY_AP"], "72": ["@NL80211_ATTR_STATUS_CODE"], "73": ["@NL80211_ATTR_CIPHER_SUITES_PAIRWISE"], "74": ["@NL80211_ATTR_CIPHER_SUITE_GROUP"], "75": ["@NL80211_ATTR_WPA_VERSIONS"], "76": ["@NL80211_ATTR_AKM_SUITES"], "77": ["@NL80211_ATTR_REQ_IE"], "78": ["@NL80211_ATTR_RESP_IE"], "79": ["@NL80211_ATTR_PREV_BSSID"], "80": ["@NL80211_ATTR_KEY"], "81": ["@NL80211_ATTR_KEYS"], "82": ["@NL80211_ATTR_PID"], "83": ["@NL80211_ATTR_4ADDR"], "84": ["@NL80211_ATTR_SURVEY_INFO"], "85": ["@NL80211_ATTR_PMKID"], "86": ["@NL80211_ATTR_MAX_NUM_PMKIDS"], "87": ["@NL80211_ATTR_DURATION"], "88": ["@NL80211_ATTR_COOKIE"], "89": ["@NL80211_ATTR_WIPHY_COVERAGE_CLASS"], "90": ["@NL80211_ATTR_TX_RATES"], "91": ["@NL80211_ATTR_FRAME_MATCH"], "92": ["@NL80211_ATTR_ACK"], "93": ["@NL80211_ATTR_PS_STATE"], "94": ["@NL80211_ATTR_CQM"], "95": ["@NL80211_ATTR_LOCAL_STATE_CHANGE"], "96": ["@NL80211_ATTR_AP_ISOLATE"], "97": ["@NL80211_ATTR_WIPHY_TX_POWER_SETTING"], "98": ["@NL80211_ATTR_WIPHY_TX_POWER_LEVEL"], "99": ["@NL80211_ATTR_TX_FRAME_TYPES"], "100": ["@NL80211_ATTR_RX_FRAME_TYPES"], "101": ["@NL80211_ATTR_FRAME_TYPE"], "102": ["@NL80211_ATTR_CONTROL_PORT_ETHERTYPE"], "103": ["@NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT"], "104": ["@NL80211_ATTR_SUPPORT_IBSS_RSN"], "105": ["@NL80211_ATTR_WIPHY_ANTENNA_TX"], "106": ["@NL80211_ATTR_WIPHY_ANTENNA_RX"], "107": ["@NL80211_ATTR_MCAST_RATE"], "108": ["@NL80211_ATTR_OFFCHANNEL_TX_OK"], "109": ["@NL80211_ATTR_BSS_HT_OPMODE"], "110": ["@NL80211_ATTR_KEY_DEFAULT_TYPES"], "111": ["@NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION"], "112": ["@NL80211_ATTR_MESH_SETUP"], "113": ["@NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX"], "114": ["@NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX"], "115": ["@NL80211_ATTR_SUPPORT_MESH_AUTH"], "116": ["@NL80211_ATTR_STA_PLINK_STATE"], "117": ["@NL80211_ATTR_WOWLAN_TRIGGERS"], "118": ["@NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED"], "119": ["@NL80211_ATTR_SCHED_SCAN_INTERVAL"], "120": ["@NL80211_ATTR_INTERFACE_COMBINATIONS"], "121": ["@NL80211_ATTR_SOFTWARE_IFTYPES"], "122": ["@NL80211_ATTR_REKEY_DATA"], "123": ["@NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS"], "124": ["@NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN"], "125": ["@NL80211_ATTR_SCAN_SUPP_RATES"], "126": ["@NL80211_ATTR_HIDDEN_SSID"], "127": ["@NL80211_ATTR_IE_PROBE_RESP"], "128": ["@NL80211_ATTR_IE_ASSOC_RESP"], "129": ["@NL80211_ATTR_STA_WME"], "130": ["@NL80211_ATTR_SUPPORT_AP_UAPSD"], "131": ["@NL80211_ATTR_ROAM_SUPPORT"], "132": ["@NL80211_ATTR_SCHED_SCAN_MATCH"], "133": ["@NL80211_ATTR_MAX_MATCH_SETS"], "134": ["@NL80211_ATTR_PMKSA_CANDIDATE"], "135": ["@NL80211_ATTR_TX_NO_CCK_RATE"], "136": ["@NL80211_ATTR_TDLS_ACTION"], "137": ["@NL80211_ATTR_TDLS_DIALOG_TOKEN"], "138": ["@NL80211_ATTR_TDLS_OPERATION"], "139": ["@NL80211_ATTR_TDLS_SUPPORT"], "140": ["@NL80211_ATTR_TDLS_EXTERNAL_SETUP"], "141": ["@NL80211_ATTR_DEVICE_AP_SME"], "142": ["@NL80211_ATTR_DONT_WAIT_FOR_ACK"], "143": ["@NL80211_ATTR_FEATURE_FLAGS"], "144": ["@NL80211_ATTR_PROBE_RESP_OFFLOAD"], "145": ["@NL80211_ATTR_PROBE_RESP"], "146": ["@NL80211_ATTR_DFS_REGION"], "147": ["@NL80211_ATTR_DISABLE_HT"], "148": ["@NL80211_ATTR_HT_CAPABILITY_MASK"], "149": ["@NL80211_ATTR_NOACK_MAP"], "150": ["@NL80211_ATTR_INACTIVITY_TIMEOUT"], "151": ["@NL80211_ATTR_RX_SIGNAL_DBM"], "152": ["@NL80211_ATTR_BG_SCAN_PERIOD"], "153": ["@NL80211_ATTR_WDEV"], "154": ["@NL80211_ATTR_USER_REG_HINT_TYPE"], "155": ["@NL80211_ATTR_CONN_FAILED_REASON"], "156": ["@NL80211_ATTR_SAE_DATA"], "157": ["@NL80211_ATTR_VHT_CAPABILITY"], "158": ["@NL80211_ATTR_SCAN_FLAGS"], "159": ["@NL80211_ATTR_CHANNEL_WIDTH"], "160": ["@NL80211_ATTR_CENTER_FREQ1"], "161": ["@NL80211_ATTR_CENTER_FREQ2"], "162": ["@NL80211_ATTR_P2P_CTWINDOW"], "163": ["@NL80211_ATTR_P2P_OPPPS"], "164": ["@NL80211_ATTR_LOCAL_MESH_POWER_MODE"], "165": ["@NL80211_ATTR_ACL_POLICY"], "166": ["@NL80211_ATTR_MAC_ADDRS"], "167": ["@NL80211_ATTR_MAC_ACL_MAX"], "168": ["@NL80211_ATTR_RADAR_EVENT"], "169": ["@NL80211_ATTR_EXT_CAPA"], "170": ["@NL80211_ATTR_EXT_CAPA_MASK"], "171": ["@NL80211_ATTR_STA_CAPABILITY"], "172": ["@NL80211_ATTR_STA_EXT_CAPABILITY"], "173": ["@NL80211_ATTR_PROTOCOL_FEATURES"], "174": ["@NL80211_ATTR_SPLIT_WIPHY_DUMP"], "177": ["@NL80211_ATTR_MDID"], "178": ["@NL80211_ATTR_IE_RIC"], "179": ["@NL80211_ATTR_CRIT_PROT_ID"], "180": ["@NL80211_ATTR_MAX_CRIT_PROT_DURATION"], "181": ["@NL80211_ATTR_PEER_AID"], "182": ["@NL80211_ATTR_COALESCE_RULE"], "183": ["@NL80211_ATTR_CH_SWITCH_COUNT"], "184": ["@NL80211_ATTR_CH_SWITCH_BLOCK_TX"], "185": ["@NL80211_ATTR_CSA_IES"], "186": ["@NL80211_ATTR_CSA_C_OFF_BEACON"], "187": ["@NL80211_ATTR_CSA_C_OFF_PRESP"], "188": ["@NL80211_ATTR_RXMGMT_FLAGS"], "189": ["@NL80211_ATTR_STA_SUPPORTED_CHANNELS"], "190": ["@NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES"], "191": ["@NL80211_ATTR_HANDLE_DFS"]}
diff --git a/pyric/docs/commands.help b/pyric/docs/commands.help
index a1859ba..fd06fd7 100644
--- a/pyric/docs/commands.help
+++ b/pyric/docs/commands.help
@@ -1,5 +1,5 @@
-# commands.help (stored json format)
-# Automatically generated 2016-04-17T11:06:57.694132
+# commands.help (stored in json format)
+# Automatically generated 2016-04-17T11:06:57.694132 from nl80211.h
{"@NL80211_CMD_GET_REG": {"attrs": [], "desc": "ask the wireless core to send us its currently set\tregulatory domain."}, "@NL80211_CMD_STOP_SCHED_SCAN": {"attrs": [], "desc": "stop if scheduled scan is not running."}, "@NL80211_CMD_START_SCHED_SCAN": {"attrs": ["%NL80211_ATTR_SCHED_SCAN_INTERVAL", "%NL80211_ATTR_SCAN_SSIDS", "%NL80211_ATTR_SCAN_FREQUENCIES", "%NL80211_ATTR_IE"], "desc": "start intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL. Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS) are passed, they are used in the probe requests. For broadcast, a broadcast SSID must be passed (ie. an empty string). If no SSID is passed, no probe requests are sent and a passive scan is performed. %NL80211_ATTR_SCAN_FREQUENCIES, if passed, define which channels should be scanned; if not passed, all channels allowed for the current regulatory domain are used. Extra IEs can also be passed from the userspace by using the %NL80211_ATTR_IE attribute."}, "@NL80211_CMD_NEW_SURVEY_RESULTS": {"attrs": [], "desc": "survey NL80211_CMD_GET_SURVEY and on the \"scan\" multicast group)"}, "@NL80211_CMD_SET_INTERFACE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_IFTYPE"], "desc": "Set %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE."}, "@NL80211_CMD_DISASSOCIATE": {"attrs": [], "desc": "disassociation NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives)."}, "@NL80211_CMD_FRAME": {"attrs": ["%NL80211_ATTR_FRAME", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_DURATION", "%NL80211_ATTR_COOKIE", "%NL80211_ATTR_TX_NO_CCK_RATE"], "desc": "Management command is used both as a request to transmit a management frame and as an event indicating reception of a frame that was not processed in kernel code, but is for us (i.e., which may need to be processed in a user space application). %NL80211_ATTR_FRAME is used to specify the frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used to indicate on which channel the frame is to be transmitted or was received. If this channel is not the current channel (remain-on-channel or the operational channel) the device will switch to the given channel and transmit the frame, optionally waiting for a response for the time specified using %NL80211_ATTR_DURATION. When called, this operation returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the TX status event pertaining to the TX request. %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the management frames at CCK rate or not in 2GHz band."}, "@NL80211_CMD_NEW_KEY": {"attrs": ["%NL80211_ATTR_KEY_IDX", "%NL80211_ATTR_MAC", "%NL80211_ATTR_KEY_CIPHER", "%NL80211_ATTR_KEY_SEQ"], "desc": "add %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER, and %NL80211_ATTR_KEY_SEQ attributes."}, "@NL80211_CMD_STOP_AP": {"attrs": [], "desc": "Stop"}, "@NL80211_CMD_DEL_INTERFACE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFINDEX"], "desc": "Virtual %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from userspace to request deletion of a virtual interface, then requires attribute %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_UNEXPECTED_4ADDR_FRAME": {"attrs": ["%NL80211_ATTR_MAC"], "desc": "Sent associated station identified by %NL80211_ATTR_MAC sent a 4addr frame and wasn't already in a 4-addr VLAN. The event will be sent similarly to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener."}, "@NL80211_CMD_SET_MESH_CONFIG": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Set interface identified by %NL80211_ATTR_IFINDEX"}, "@NL80211_CMD_STOP_P2P_DEVICE": {"attrs": ["%NL80211_ATTR_WDEV"], "desc": "Stop its %NL80211_ATTR_WDEV identifier."}, "@NL80211_CMD_START_P2P_DEVICE": {"attrs": ["%NL80211_ATTR_WDEV"], "desc": "Start its %NL80211_ATTR_WDEV identifier. It must have been created with %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the P2P Device can be used for P2P operations, e.g. remain-on-channel and public action frame TX."}, "@NL80211_CMD_SET_COALESCE": {"attrs": [], "desc": "Configure"}, "@NL80211_CMD_DEL_WIPHY": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_WIPHY_NAME"], "desc": "Wiphy %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME."}, "@NL80211_CMD_SET_STATION": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_IFINDEX"], "desc": "Set %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_LEAVE_MESH": {"attrs": [], "desc": "Leave network is determined by the network interface."}, "@NL80211_CMD_GET_KEY": {"attrs": ["%NL80211_ATTR_KEY_IDX", "%NL80211_ATTR_MAC"], "desc": "Get by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC."}, "@NL80211_CMD_GET_SURVEY": {"attrs": [], "desc": "get"}, "@NL80211_CMD_TDLS_MGMT": {"attrs": [], "desc": "Send"}, "@NL80211_CMD_SET_BSS": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Set %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_SET_WOWLAN": {"attrs": ["%NL80211_ATTR_WOWLAN_TRIGGERS"], "desc": "set Since wireless is more complex than wired ethernet, it supports various triggers. These triggers can be configured through this command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For more background information, see http://wireless.kernel.org/en/users/Documentation/WoWLAN. The @NL80211_CMD_SET_WOWLAN command can also be used as a notification from the driver reporting the wakeup reason. In this case, the @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason for the wakeup, if it was caused by wireless. If it is not present in the wakeup notification, the wireless device didn't cause the wakeup but reports that it was woken up."}, "@NL80211_CMD_NEW_STATION": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Add the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_SET_PMKSA": {"attrs": ["%NL80211_ATTR_PMKID"], "desc": "Add (for the BSSID) and %NL80211_ATTR_PMKID."}, "@NL80211_CMD_SET_MPATH": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_IFINDEX"], "desc": " destination %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_DEL_STATION": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Remove or, if no MAC address given, all stations, on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_UNPROT_DISASSOCIATE": {"attrs": [], "desc": "Unprotected notification. This event is used to indicate that an unprotected disassociation frame was dropped when MFP is in use."}, "@NL80211_CMD_CH_SWITCH_NOTIFY": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY_FREQ"], "desc": "An independently of the userspace SME, send this event indicating %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width."}, "@NL80211_CMD_SET_KEY": {"attrs": ["%NL80211_ATTR_KEY_DEFAULT_MGMT", "%NL80211_ATTR_KEY_THRESHOLD"], "desc": "Set %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD."}, "@NL80211_CMD_SET_MAC_ACL": {"attrs": ["%NL80211_ATTR_MAC_ADDRS", "%NL80211_ATTR_ACL_POLICY"], "desc": "sets This is to be used with the drivers advertising the support of MAC address based access control. List of MAC addresses is passed in %NL80211_ATTR_MAC_ADDRS and ACL policy is passed in %NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it is not already done. The new list will replace any existing list. Driver will clear its ACL when the list of MAC addresses passed is empty. This command is used in AP/P2P GO mode. Driver has to make sure to clear its ACL list during %NL80211_CMD_STOP_AP."}, "@NL80211_CMD_GET_WOWLAN": {"attrs": [], "desc": "get"}, "@NL80211_CMD_GET_STATION": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_IFINDEX"], "desc": "Get %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_UNSPEC": {"attrs": [], "desc": "unspecified"}, "@NL80211_CMD_NEW_PEER_CANDIDATE": {"attrs": [], "desc": "Notification beacon or probe response from a compatible mesh peer. This is only sent while no station information (sta_info) exists for the new peer candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH, @NL80211_MESH_SETUP_USERSPACE_AMPE, or @NL80211_MESH_SETUP_USERSPACE_MPM is set. On reception of this notification, userspace may decide to create a new station (@NL80211_CMD_NEW_STATION). To stop this notification from reoccurring, the userspace authentication daemon may want to create the new station with the AUTHENTICATED flag unset and maybe change it later depending on the authentication result."}, "@NL80211_CMD_REGISTER_ACTION": {"attrs": [], "desc": "Alias backward compatibility"}, "@NL80211_CMD_REG_CHANGE": {"attrs": ["%NL80211_ATTR_REG_INITIATOR", "%NL80211_ATTR_REG_ALPHA2", "%NL80211_ATTR_REG_TYPE", "%NL80211_ATTR_REG_ALPHA2"], "desc": "indicates has been changed and provides details of the request information that caused the change such as who initiated the regulatory request (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on to (%NL80211_ATTR_REG_ALPHA2)."}, "@NL80211_CMD_CONN_FAILED": {"attrs": ["%NL80211_ATTR_CONN_FAILED_REASON"], "desc": "connection notify userspace that AP has rejected the connection request from a station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON is used for this."}, "@NL80211_CMD_SCAN_ABORTED": {"attrs": [], "desc": "scan partial scan results may be available"}, "@NL80211_CMD_SET_POWER_SAVE": {"attrs": [], "desc": "Set"}, "@NL80211_CMD_SET_MGMT_EXTRA_IE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_MGMT_SUBTYPE", "%NL80211_ATTR_IE"], "desc": "Set interface is identified with %NL80211_ATTR_IFINDEX and the management frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be added to the end of the specified management frame is specified with %NL80211_ATTR_IE. If the command succeeds, the requested data will be added to all specified management frames generated by kernel/firmware/driver. Note: This command has been removed and it is only reserved at this point to avoid re-using existing command number. The functionality this command was planned for has been provided with cleaner design with the option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN, NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE, NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE."}, "@NL80211_CMD_SET_REKEY_OFFLOAD": {"attrs": ["%NL80211_ATTR_REKEY_DATA"], "desc": "This the necessary information for supporting GTK rekey offload. This feature is typically used during WoWLAN. The configuration data is contained in %NL80211_ATTR_REKEY_DATA (which is nested and contains the data in sub-attributes). After rekeying happened, this command may also be sent by the driver as an MLME event to inform userspace of the new replay counter."}, "@NL80211_CMD_SET_CHANNEL": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Set and the attributes determining channel width) the given interface (identifed by %NL80211_ATTR_IFINDEX) shall operate on. In case multiple channels are supported by the device, the mechanism with which it switches channels is implementation-defined. When a monitor interface is given, it can only switch channel while no other interfaces are operating to avoid disturbing the operation of any other interfaces, and other interfaces will again take precedence when they are used."}, "@NL80211_CMD_START_AP": {"attrs": ["%NL80211_ATTR_BEACON_INTERVAL", "%NL80211_ATTR_DTIM_PERIOD", "%NL80211_ATTR_SSID", "%NL80211_ATTR_HIDDEN_SSID", "%NL80211_ATTR_CIPHERS_PAIRWISE", "%NL80211_ATTR_CIPHER_GROUP", "%NL80211_ATTR_WPA_VERSIONS", "%NL80211_ATTR_AKM_SUITES", "%NL80211_ATTR_PRIVACY", "%NL80211_ATTR_AUTH_TYPE", "%NL80211_ATTR_INACTIVITY_TIMEOUT", "%NL80211_ATTR_ACL_POLICY", "%NL80211_ATTR_MAC_ADDRS", "%NL80211_ATTR_WIPHY_FREQ"], "desc": "Start are like for %NL80211_CMD_SET_BEACON, and additionally parameters that do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID, %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT, %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS. The channel to use can be set on the interface or be given using the %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width."}, "@NL80211_CMD_DEL_PMKSA": {"attrs": ["%NL80211_ATTR_PMKID"], "desc": "Delete (for the BSSID) and %NL80211_ATTR_PMKID."}, "@NL80211_CMD_UNEXPECTED_FRAME": {"attrs": ["%NL80211_ATTR_MAC"], "desc": "Used (or GO) interface (i.e. hostapd) to ask for unexpected frames to implement sending deauth to stations that send unexpected class 3 frames. Also used as the event sent by the kernel when such a frame is received. For the event, the %NL80211_ATTR_MAC attribute carries the TA and other attributes like the interface index are present. If used as the command it must have an interface index and you can only unsubscribe from the event by closing the socket. Subscription is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events."}, "@NL80211_CMD_GET_MPATH": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_IFINDEX"], "desc": "Get destination %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_GET_BEACON": {"attrs": [], "desc": ""}, "@NL80211_CMD_PMKSA_CANDIDATE": {"attrs": [], "desc": "This of PMKSA caching dandidates."}, "@NL80211_CMD_PROBE_CLIENT": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_MAC", "%NL80211_ATTR_COOKIE", "%NL80211_ATTR_ACK"], "desc": "Probe by sending a null data frame to it and reporting when the frame is acknowleged. This is used to allow timing out inactive clients. Uses %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a direct reply with an %NL80211_ATTR_COOKIE that is later used to match up the event with the request. The event includes the same data and has %NL80211_ATTR_ACK set if the frame was ACKed."}, "@NL80211_CMD_NEW_INTERFACE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFTYPE", "%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFTYPE", "%NL80211_ATTR_IFNAME"], "desc": "Newly to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX, %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also be sent from userspace to request creation of a new virtual interface, then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and %NL80211_ATTR_IFNAME."}, "@NL80211_CMD_SET_TX_BITRATE_MASK": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Set rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface and @NL80211_ATTR_TX_RATES the set of allowed rates."}, "@NL80211_CMD_NEW_SCAN_RESULTS": {"attrs": [], "desc": "scan NL80211_CMD_GET_SCAN and on the \"scan\" multicast group)"}, "@NL80211_CMD_GET_WIPHY": {"attrs": [], "desc": "request to get a list of all present wiphys."}, "@NL80211_CMD_SET_NOACK_MAP": {"attrs": [], "desc": "sets No Acknowledgement Policy should be applied."}, "@NL80211_CMD_ACTION": {"attrs": [], "desc": "Alias"}, "@NL80211_CMD_FLUSH_PMKSA": {"attrs": [], "desc": "Flush"}, "@NL80211_CMD_ASSOCIATE": {"attrs": [], "desc": "association NL80211_CMD_AUTHENTICATE but for Association and Reassociation (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request, MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives)."}, "@NL80211_CMD_GET_PROTOCOL_FEATURES": {"attrs": ["%NL80211_ATTR_PROTOCOL_FEATURES"], "desc": "Get i.e. features for the nl80211 protocol rather than device features. Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap."}, "@NL80211_CMD_DEAUTHENTICATE": {"attrs": [], "desc": "deauthentication NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication primitives)."}, "@NL80211_CMD_CRIT_PROTOCOL_STOP": {"attrs": [], "desc": "Indicates return back to normal."}, "@NL80211_CMD_FT_EVENT": {"attrs": [], "desc": "Send to the supplicant. This will carry the target AP's MAC address along with the relevant Information Elements. This event is used to report received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE)."}, "@NL80211_CMD_NEW_WIPHY": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_WIPHY_NAME"], "desc": "Newly or rename notification. Has attributes %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME."}, "@NL80211_CMD_UPDATE_FT_IES": {"attrs": [], "desc": "Pass Information Element to the WLAN driver"}, "@NL80211_CMD_SET_WDS_PEER": {"attrs": [], "desc": "Set"}, "@NL80211_CMD_SCHED_SCAN_STOPPED": {"attrs": [], "desc": "indicates stopped. The driver may issue this event at any time during a scheduled scan. One reason for stopping the scan is if the hardware does not support starting an association or a normal scan while running a scheduled scan. This event is also sent when the %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface is brought down while a scheduled scan was running."}, "@NL80211_CMD_FRAME_TX_STATUS": {"attrs": ["%NL80211_ATTR_COOKIE", "%NL80211_ATTR_FRAME", "%NL80211_ATTR_ACK"], "desc": "Report transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies the TX command and %NL80211_ATTR_FRAME includes the contents of the frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged the frame."}, "@NL80211_CMD_TDLS_OPER": {"attrs": ["%NL80211_ATTR_TDLS_OPERATION", "%NL80211_ATTR_MAC", "%NL80211_ATTR_REASON_CODE"], "desc": "Perform In addition, this can be used as an event to request userspace to take actions on TDLS links (set up a new link or tear down an existing one). In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested operation, %NL80211_ATTR_MAC contains the peer MAC address, and %NL80211_ATTR_REASON_CODE the reason code to be used (only with %NL80211_TDLS_TEARDOWN)."}, "@NL80211_CMD_GET_SCAN": {"attrs": [], "desc": "get"}, "@NL80211_CMD_SET_WIPHY": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY_NAME", "%NL80211_ATTR_WIPHY_TXQ_PARAMS", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_WIPHY_RETRY_SHORT", "%NL80211_ATTR_WIPHY_RETRY_LONG", "%NL80211_ATTR_WIPHY_FRAG_THRESHOLD", "%NL80211_ATTR_WIPHY_RTS_THRESHOLD"], "desc": "set %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the attributes determining the channel width; this is used for setting monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT, %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. However, for setting the channel, see %NL80211_CMD_SET_CHANNEL instead, the support here is for backward compatibility only."}, "@NL80211_CMD_AUTHENTICATE": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_MAC", "%NL80211_ATTR_SSID", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_AUTH_TYPE", "%NL80211_ATTR_IE", "%NL80211_ATTR_FRAME", "%NL80211_ATTR_FRAME", "%NL80211_ATTR_TIMED_OUT", "%NL80211_ATTR_MAC"], "desc": "authentication This command is used both as a command (request to authenticate) and as an event on the \"mlme\" multicast group indicating completion of the authentication process. When used as a command, %NL80211_ATTR_IFINDEX is used to identify the interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify the SSID (mainly for association, but is included in authentication request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ is used to specify the frequence of the channel in MHz. %NL80211_ATTR_AUTH_TYPE is used to specify the authentication type. %NL80211_ATTR_IE is used to define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added to the frame. When used as an event, this reports reception of an Authentication frame in station and IBSS modes when the local MLME processed the frame, i.e., it was for the local STA and was received in correct state. This is similar to MLME-AUTHENTICATE.confirm primitive in the MLME SAP interface (kernel providing MLME, userspace SME). The included %NL80211_ATTR_FRAME attribute contains the management frame (including both the header and frame body, but not FCS). This event is also used to indicate if the authentication attempt timed out. In that case the %NL80211_ATTR_FRAME attribute is replaced with a %NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which pending authentication timed out)."}, "@NL80211_CMD_DEL_PATH": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Remove or, if no MAC address given, all mesh paths, on the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_GET_MESH_CONFIG": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Get interface identified by %NL80211_ATTR_IFINDEX"}, "@NL80211_CMD_NEW_PATH": {"attrs": ["%NL80211_ATTR_IFINDEX"], "desc": "Add the interface identified by %NL80211_ATTR_IFINDEX."}, "@NL80211_CMD_NEW_MPATH": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_MPATH_NEXT_HOP"], "desc": "Create %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP."}, "@NL80211_CMD_MICHAEL_MIC_FAILURE": {"attrs": ["%NL80211_ATTR_MAC", "%NL80211_ATTR_KEY_TYPE", "%NL80211_ATTR_KEY_IDX", "%NL80211_ATTR_KEY_SEQ"], "desc": "notification MIC (part of TKIP) failure; sent on the \"mlme\" multicast group; the event includes %NL80211_ATTR_MAC to describe the source MAC address of the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and %NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this event matches with MLME-MICHAELMICFAILURE.indication() primitive"}, "@NL80211_CMD_SET_WIPHY_NETNS": {"attrs": [], "desc": "Set associated with this wiphy must be down and will follow."}, "@NL80211_CMD_DEL_KEY": {"attrs": ["%NL80211_ATTR_MAC"], "desc": "delete or %NL80211_ATTR_MAC."}, "@NL80211_CMD_SET_CQM": {"attrs": [], "desc": "Connection is used to configure connection quality monitoring notification trigger levels."}, "@NL80211_CMD_REMAIN_ON_CHANNEL": {"attrs": ["%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_DURATION", "%NL80211_ATTR_COOKIE"], "desc": "Request channel for the specified amount of time. This can be used to do off-channel operations like transmit a Public Action frame and wait for a response while being associated to an AP on another channel. %NL80211_ATTR_IFINDEX is used to specify which interface (and thus radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the frequency for the operation. %NL80211_ATTR_DURATION is used to specify the duration in milliseconds to remain on the channel. This command is also used as an event to notify when the requested duration starts (it may take a while for the driver to schedule this time due to other concurrent needs for the radio). When called, this operation returns a cookie (%NL80211_ATTR_COOKIE) that will be included with any events pertaining to this request; the cookie is also used to cancel the request."}, "@NL80211_CMD_JOIN_IBSS": {"attrs": ["%NL80211_ATTR_BEACON_INTERVAL"], "desc": "Join FREQ attribute (for the initial frequency if no peer can be found) and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those should be fixed rather than automatically determined. Can only be executed on a network interface that is UP, and fixed BSSID/FREQ may be rejected. Another optional parameter is the beacon interval, given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not given defaults to 100 TU (102.4ms)."}, "@NL80211_CMD_REG_BEACON_HINT": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_FREQ_BEFORE", "%NL80211_ATTR_FREQ_AFTER"], "desc": "indicates has been found while world roaming thus enabling active scan or any mode of operation that initiates TX (beacons) on a channel where we would not have been able to do either before. As an example if you are world roaming (regulatory domain set to world or if your driver is using a custom world roaming regulatory domain) and while doing a passive scan on the 5 GHz band you find an AP there (if not on a DFS channel) you will now be able to actively scan for that AP or use AP mode on your card on that same channel. Note that this will never be used for channels 1-11 on the 2 GHz band as they are always enabled world wide. This beacon hint is only sent if your device had either disabled active scanning or beaconing on a channel. We send to userspace the wiphy on which we removed a restriction from (%NL80211_ATTR_WIPHY) and the channel on which this occurred before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER) the beacon hint was processed."}, "@NL80211_CMD_CRIT_PROTOCOL_START": {"attrs": [], "desc": "Indicates a critical protocol that needs more reliability in the connection to complete."}, "@NL80211_CMD_UNPROT_DEAUTHENTICATE": {"attrs": [], "desc": "Unprotected notification. This event is used to indicate that an unprotected deauthentication frame was dropped when MFP is in use."}, "@NL80211_CMD_REQ_SET_REG": {"attrs": [], "desc": "ask to the specified ISO/IEC 3166-1 alpha2 country code. The core will store this as a valid request and then query userspace for it."}, "@NL80211_CMD_SCHED_SCAN_RESULTS": {"attrs": [], "desc": "indicates results available."}, "@NL80211_CMD_REGISTER_BEACONS": {"attrs": [], "desc": "Register other BSSes when any interfaces are in AP mode. This helps implement OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME messages. Note that per PHY only one application may register."}, "@NL80211_CMD_NEW_BEACON": {"attrs": [], "desc": "old"}, "@NL80211_CMD_NOTIFY_CQM": {"attrs": [], "desc": "Connection command is used as an event to indicate the that a trigger level was reached."}, "@NL80211_CMD_TRIGGER_SCAN": {"attrs": ["%NL80211_ATTR_TX_NO_CCK_RATE"], "desc": "trigger %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the probe requests at CCK rate or not."}, "@NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFINDEX", "%NL80211_ATTR_COOKIE"], "desc": "This pending remain-on-channel duration if the desired operation has been completed prior to expiration of the originally requested duration. %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the radio. The %NL80211_ATTR_COOKIE attribute must be given as well to uniquely identify the request. This command is also used as an event to notify when a requested remain-on-channel duration has expired."}, "@NL80211_CMD_REGISTER_FRAME": {"attrs": [], "desc": "Register (via @NL80211_CMD_FRAME) for processing in userspace. This command requires an interface index, a frame type attribute (optional for backward compatibility reasons, if not given assumes action frames) and a match attribute containing the first few bytes of the frame that should match, e.g. a single byte for only a category match or four bytes for vendor frames including the OUI. The registration cannot be dropped, but is removed automatically when the netlink socket is closed. Multiple registrations can be made."}, "@NL80211_CMD_CHANNEL_SWITCH": {"attrs": ["%NL80211_ATTR_CH_SWITCH_COUNT", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_CH_SWITCH_BLOCK_TX"], "desc": "Perform the new channel information (Channel Switch Announcement - CSA) in the beacon for some time (as defined in the %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the new channel. Userspace provides the new channel information (using %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform other station that transmission must be blocked until the channel switch is complete."}, "@NL80211_CMD_GET_INTERFACE": {"attrs": ["%NL80211_ATTR_WIPHY", "%NL80211_ATTR_IFINDEX"], "desc": "Request either a dump request on a %NL80211_ATTR_WIPHY or a specific get on an %NL80211_ATTR_IFINDEX is supported."}, "@NL80211_CMD_RADAR_DETECT": {"attrs": ["%NL80211_ATTR_RADAR_EVENT"], "desc": "Start a radar is detected or the channel availability scan (CAC) has finished or was aborted, or a radar was detected, usermode will be notified with this event. This command is also used to notify userspace about radars while operating on this channel. %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the event."}, "@NL80211_CMD_GET_POWER_SAVE": {"attrs": [], "desc": "Get"}, "@NL80211_CMD_DISCONNECT": {"attrs": ["%NL80211_ATTR_DISCONNECTED_BY_AP", "%NL80211_ATTR_REASON_CODE"], "desc": "drop userspace that a connection was dropped by the AP or due to other reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and %NL80211_ATTR_REASON_CODE attributes are used."}, "@NL80211_CMD_CONNECT": {"attrs": ["%NL80211_ATTR_SSID", "%NL80211_ATTR_IE", "%NL80211_ATTR_AUTH_TYPE", "%NL80211_ATTR_USE_MFP", "%NL80211_ATTR_MAC", "%NL80211_ATTR_WIPHY_FREQ", "%NL80211_ATTR_CONTROL_PORT", "%NL80211_ATTR_CONTROL_PORT_ETHERTYPE", "%NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT", "%NL80211_ATTR_BG_SCAN_PERIOD"], "desc": "connection requests to connect to a specified network but without separating auth and assoc steps. For this, you need to specify the SSID in a %NL80211_ATTR_SSID attribute, and can optionally specify the association IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP, %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT, %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT. Background scan period can optionally be specified in %NL80211_ATTR_BG_SCAN_PERIOD, if not specified default background scan configuration in driver is used and if period value is 0, bg scan will be disabled. This attribute is ignored if driver does not support roam scan. It is also sent as an event, with the BSSID and response IEs when the connection is established or failed to be established. This can be determined by the STATUS_CODE attribute."}, "@NL80211_CMD_SET_BEACON": {"attrs": ["%NL80211_ATTR_BEACON_HEAD", "%NL80211_ATTR_BEACON_TAIL", "%NL80211_ATTR_IE", "%NL80211_ATTR_IE_PROBE_RESP", "%NL80211_ATTR_IE_ASSOC_RESP"], "desc": "change using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes. For drivers that generate the beacon and probe responses internally, the following attributes must be provided: %NL80211_ATTR_IE, %NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP."}, "@NL80211_CMD_ACTION_TX_STATUS": {"attrs": [], "desc": "Alias backward compatibility."}, "@NL80211_CMD_JOIN_MESH": {"attrs": [], "desc": "Join mesh config parameters may be given."}, "@NL80211_CMD_ROAM": {"attrs": [], "desc": "request sent as an event when the card/driver roamed by itself."}, "@NL80211_CMD_SET_REG": {"attrs": ["%NL80211_ATTR_REG_ALPHA", "%NL80211_ATTR_REG_RULE_FREQ_", "%NL80211_ATTR_FREQ_RANGE_MAX_BW", "%NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN", "%NL80211_ATTR_REG_RULE_POWER_MAX_EIRP"], "desc": "Set after being queried by the kernel. CRDA replies by sending a regulatory domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our current alpha2 if it found a match. It also provides NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each regulatory rule is a nested set of attributes given by %NL80211_ATTR_REG_RULE_FREQ_[START|END] and %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP."}, "@NL80211_CMD_GET_COALESCE": {"attrs": [], "desc": "Get"}, "@NL80211_CMD_FRAME_WAIT_CANCEL": {"attrs": [], "desc": "When command may be used with the corresponding cookie to cancel the wait time if it is known that it is no longer necessary."}, "@NL80211_CMD_DEL_BEACON": {"attrs": [], "desc": "old"}, "@NL80211_CMD_LEAVE_IBSS": {"attrs": [], "desc": "Leave determined by the network interface."}, "@NL80211_CMD_SET_MCAST_RATE": {"attrs": [], "desc": "Change for IBSS or MESH vif."}, "@NL80211_CMD_TESTMODE": {"attrs": [], "desc": "testmode to identify the device, and the TESTDATA blob attribute to pass through to the driver."}, "@NL80211_CMD_DEL_MPATH": {"attrs": ["%NL80211_ATTR_MAC"], "desc": "Delete %NL80211_ATTR_MAC."}}
{"0": "@NL80211_CMD_UNSPEC", "1": "@NL80211_CMD_GET_WIPHY", "2": "@NL80211_CMD_SET_WIPHY", "3": "@NL80211_CMD_NEW_WIPHY", "4": "@NL80211_CMD_DEL_WIPHY", "5": "@NL80211_CMD_GET_INTERFACE", "6": "@NL80211_CMD_SET_INTERFACE", "7": "@NL80211_CMD_NEW_INTERFACE", "8": "@NL80211_CMD_DEL_INTERFACE", "9": "@NL80211_CMD_GET_KEY", "10": "@NL80211_CMD_SET_KEY", "11": "@NL80211_CMD_NEW_KEY", "12": "@NL80211_CMD_DEL_KEY", "13": "@NL80211_CMD_GET_BEACON", "14": "@NL80211_CMD_SET_BEACON", "15": ["@NL80211_CMD_START_AP", "@NL80211_CMD_NEW_BEACON"], "16": ["@NL80211_CMD_STOP_AP", "@NL80211_CMD_DEL_BEACON"], "17": "@NL80211_CMD_GET_STATION", "18": "@NL80211_CMD_SET_STATION", "19": "@NL80211_CMD_NEW_STATION", "20": "@NL80211_CMD_DEL_STATION", "21": "@NL80211_CMD_GET_MPATH", "22": "@NL80211_CMD_SET_MPATH", "23": "@NL80211_CMD_NEW_MPATH", "24": "@NL80211_CMD_DEL_MPATH", "25": "@NL80211_CMD_SET_BSS", "26": "@NL80211_CMD_SET_REG", "27": "@NL80211_CMD_REQ_SET_REG", "28": "@NL80211_CMD_GET_MESH_CONFIG", "29": "@NL80211_CMD_SET_MESH_CONFIG", "30": "@NL80211_CMD_SET_MGMT_EXTRA_IE", "31": "@NL80211_CMD_GET_REG", "32": "@NL80211_CMD_GET_SCAN", "33": "@NL80211_CMD_TRIGGER_SCAN", "34": "@NL80211_CMD_NEW_SCAN_RESULTS", "35": "@NL80211_CMD_SCAN_ABORTED", "36": "@NL80211_CMD_REG_CHANGE", "37": "@NL80211_CMD_AUTHENTICATE", "38": "@NL80211_CMD_ASSOCIATE", "39": "@NL80211_CMD_DEAUTHENTICATE", "40": "@NL80211_CMD_DISASSOCIATE", "41": "@NL80211_CMD_MICHAEL_MIC_FAILURE", "42": "@NL80211_CMD_REG_BEACON_HINT", "43": "@NL80211_CMD_JOIN_IBSS", "44": "@NL80211_CMD_LEAVE_IBSS", "45": "@NL80211_CMD_TESTMODE", "46": "@NL80211_CMD_CONNECT", "47": "@NL80211_CMD_ROAM", "48": "@NL80211_CMD_DISCONNECT", "49": "@NL80211_CMD_SET_WIPHY_NETNS", "50": "@NL80211_CMD_GET_SURVEY", "51": "@NL80211_CMD_NEW_SURVEY_RESULTS", "52": "@NL80211_CMD_SET_PMKSA", "53": "@NL80211_CMD_DEL_PMKSA", "54": "@NL80211_CMD_FLUSH_PMKSA", "55": "@NL80211_CMD_REMAIN_ON_CHANNEL", "56": "@NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL", "57": "@NL80211_CMD_SET_TX_BITRATE_MASK", "58": ["@NL80211_CMD_REGISTER_ACTION", "@NL80211_CMD_REGISTER_FRAME"], "59": ["@NL80211_CMD_FRAME", "@NL80211_CMD_ACTION"], "60": ["@NL80211_CMD_FRAME_TX_STATUS", "@NL80211_CMD_ACTION_TX_STATUS"], "61": "@NL80211_CMD_SET_POWER_SAVE", "62": "@NL80211_CMD_GET_POWER_SAVE", "63": "@NL80211_CMD_SET_CQM", "64": "@NL80211_CMD_NOTIFY_CQM", "65": "@NL80211_CMD_SET_CHANNEL", "66": "@NL80211_CMD_SET_WDS_PEER", "67": "@NL80211_CMD_FRAME_WAIT_CANCEL", "68": "@NL80211_CMD_JOIN_MESH", "69": "@NL80211_CMD_LEAVE_MESH", "70": "@NL80211_CMD_UNPROT_DEAUTHENTICATE", "71": "@NL80211_CMD_UNPROT_DISASSOCIATE", "72": "@NL80211_CMD_NEW_PEER_CANDIDATE", "73": "@NL80211_CMD_GET_WOWLAN", "74": "@NL80211_CMD_SET_WOWLAN", "75": "@NL80211_CMD_START_SCHED_SCAN", "76": "@NL80211_CMD_STOP_SCHED_SCAN", "77": "@NL80211_CMD_SCHED_SCAN_RESULTS", "78": "@NL80211_CMD_SCHED_SCAN_STOPPED", "79": "@NL80211_CMD_SET_REKEY_OFFLOAD", "80": "@NL80211_CMD_PMKSA_CANDIDATE", "81": "@NL80211_CMD_TDLS_OPER", "82": "@NL80211_CMD_TDLS_MGMT", "83": "@NL80211_CMD_UNEXPECTED_FRAME", "84": "@NL80211_CMD_PROBE_CLIENT", "85": "@NL80211_CMD_REGISTER_BEACONS", "86": "@NL80211_CMD_UNEXPECTED_4ADDR_FRAME", "87": "@NL80211_CMD_SET_NOACK_MAP", "88": "@NL80211_CMD_CH_SWITCH_NOTIFY", "89": "@NL80211_CMD_START_P2P_DEVICE", "90": "@NL80211_CMD_STOP_P2P_DEVICE", "91": "@NL80211_CMD_CONN_FAILED", "92": "@NL80211_CMD_SET_MCAST_RATE", "93": "@NL80211_CMD_SET_MAC_ACL", "94": "@NL80211_CMD_RADAR_DETECT", "95": "@NL80211_CMD_GET_PROTOCOL_FEATURES", "96": "@NL80211_CMD_UPDATE_FT_IES", "97": "@NL80211_CMD_FT_EVENT", "98": "@NL80211_CMD_CRIT_PROTOCOL_START", "99": "@NL80211_CMD_CRIT_PROTOCOL_STOP", "100": "@NL80211_CMD_GET_COALESCE", "101": "@NL80211_CMD_SET_COALESCE", "102": "@NL80211_CMD_CHANNEL_SWITCH"}
\ No newline at end of file
diff --git a/pyric/docs/nlhelp.py b/pyric/docs/nlhelp.py
index 46a8603..356dc4e 100644
--- a/pyric/docs/nlhelp.py
+++ b/pyric/docs/nlhelp.py
@@ -32,7 +32,7 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
import os
import json
diff --git a/pyric/lib/__init__.py b/pyric/lib/__init__.py
index b65ddbc..3f81618 100644
--- a/pyric/lib/__init__.py
+++ b/pyric/lib/__init__.py
@@ -45,4 +45,4 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
\ No newline at end of file
+__status__ = 'Production'
\ No newline at end of file
diff --git a/pyric/lib/libio.py b/pyric/lib/libio.py
index e6224c4..c652211 100644
--- a/pyric/lib/libio.py
+++ b/pyric/lib/libio.py
@@ -31,7 +31,7 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
import socket
import struct
@@ -44,11 +44,11 @@ def io_socket_alloc():
create a socket for ioctl calls
:returns: an io socket
"""
- return socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ return socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
-def io_socket_free(sock):
+def io_socket_free(iosock):
""" close the socket """
- if sock: sock.close()
+ if iosock: iosock.close()
return None
def io_transfer(iosock,flag,ifreq):
diff --git a/pyric/lib/libnl.py b/pyric/lib/libnl.py
index 02e0184..e2b3190 100644
--- a/pyric/lib/libnl.py
+++ b/pyric/lib/libnl.py
@@ -37,7 +37,7 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
from time import time
from os import getpid,strerror
diff --git a/pyric/net/__init__.py b/pyric/net/__init__.py
index 3b2cb56..3f9f2dd 100644
--- a/pyric/net/__init__.py
+++ b/pyric/net/__init__.py
@@ -42,5 +42,5 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
diff --git a/pyric/net/genetlink_h.py b/pyric/net/genetlink_h.py
index be29629..cffdf00 100644
--- a/pyric/net/genetlink_h.py
+++ b/pyric/net/genetlink_h.py
@@ -79,7 +79,6 @@ def genlmsghdr(cmd,vers=1):
GENL_ID_VFS_DQUOT = GENL_ID_CTRL + 1
GENL_ID_PMCRAID = GENL_ID_CTRL + 2
-
#Controller
CTRL_CMD_UNSPEC = 0
CTRL_CMD_NEWFAMILY = 1
diff --git a/pyric/net/if_h.py b/pyric/net/if_h.py
index 1f8f9f2..0dd6318 100644
--- a/pyric/net/if_h.py
+++ b/pyric/net/if_h.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python
-
""" sockios_h.py: definitions for INET interface module
/*
diff --git a/pyric/net/netlink_h.py b/pyric/net/netlink_h.py
index dab9830..c230bc7 100644
--- a/pyric/net/netlink_h.py
+++ b/pyric/net/netlink_h.py
@@ -45,7 +45,7 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
import struct
diff --git a/pyric/net/policy.py b/pyric/net/policy.py
index 67f10ef..8cbd7f1 100644
--- a/pyric/net/policy.py
+++ b/pyric/net/policy.py
@@ -33,7 +33,7 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
import pyric.net.netlink_h as nlh
import pyric.net.genetlink_h as genlh
diff --git a/pyric/net/sockios_h.py b/pyric/net/sockios_h.py
index 40f2125..dd9c901 100644
--- a/pyric/net/sockios_h.py
+++ b/pyric/net/sockios_h.py
@@ -39,7 +39,7 @@
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
-Most of these constants are not used but are left for possible future use.
+Most of these constants are not used but are left as is for possible future use.
"""
diff --git a/pyric/net/wireless/__init__.py b/pyric/net/wireless/__init__.py
index 94c2ff4..5188d3c 100644
--- a/pyric/net/wireless/__init__.py
+++ b/pyric/net/wireless/__init__.py
@@ -33,4 +33,4 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
\ No newline at end of file
+__status__ = 'Production'
\ No newline at end of file
diff --git a/pyric/net/wireless/nl80211_c.py b/pyric/net/wireless/nl80211_c.py
index 6dba580..247d8ca 100644
--- a/pyric/net/wireless/nl80211_c.py
+++ b/pyric/net/wireless/nl80211_c.py
@@ -31,7 +31,7 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
import struct
import pyric.net.netlink_h as nlh
diff --git a/pyric/net/wireless/nl80211_h.py b/pyric/net/wireless/nl80211_h.py
index 141d5ee..62ea596 100644
--- a/pyric/net/wireless/nl80211_h.py
+++ b/pyric/net/wireless/nl80211_h.py
@@ -57,7 +57,7 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
import struct
diff --git a/pyric/pyw.py b/pyric/pyw.py
index 8dbc7e1..95681d5 100644
--- a/pyric/pyw.py
+++ b/pyric/pyw.py
@@ -107,7 +107,7 @@ def _nlstub_(fct,*argv):
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
import struct # ioctl unpacking
import pyric # pyric exception
@@ -613,7 +613,7 @@ def down(card, *argv):
#### INFO RELATED ####
-def devfreqs(card,*argv):
+def devfreqs(card, *argv):
"""
returns card's supported frequencies
:param card: Card object
@@ -623,11 +623,11 @@ def devfreqs(card,*argv):
try:
nlsock = argv[0]
except IndexError:
- return _nlstub_(devfreqs,card)
+ return _nlstub_(devfreqs, card)
- return phyinfo(card,nlsock)['freqs']
+ return phyinfo(card, nlsock)['freqs']
-def devchs(card,*argv):
+def devchs(card, *argv):
"""
returns card's supported channels
:param card: Card object
@@ -637,9 +637,9 @@ def devchs(card,*argv):
try:
nlsock = argv[0]
except IndexError:
- return _nlstub_(devchs,card)
+ return _nlstub_(devchs, card)
- return map(channels.rf2ch,phyinfo(card,nlsock)['freqs'])
+ return map(channels.rf2ch, phyinfo(card, nlsock)['freqs'])
def devstds(card, *argv):
"""
@@ -656,8 +656,8 @@ def devstds(card, *argv):
try:
flag = sioch.SIOCGIWNAME
ret = io.io_transfer(iosock, flag,ifh.ifreq(card.dev, flag))
- stds = ret[ifh.IFNAMELEN:] # get the standards
- stds = stds[:stds.find('\x00')] # remove nulls
+ stds = ret[ifh.IFNAMELEN:] # get the standards
+ stds = stds[:stds.find('\x00')] # remove nulls
stds = stds.replace('IEEE 802.11', '') # remove IEEE 802.11
return [std for std in stds]
except AttributeError as e:
@@ -845,7 +845,7 @@ def chget(card, *argv):
return _nlstub_(chget, card)
return channels.rf2ch(devinfo(card, nlsock)['RF'])
-def chset(card, ch, chw=None, *argv):
+def chset(card, ch, chw, *argv):
"""
REQUIRES ROOT PRIVILEGES
sets current channel on device (iw phy set channel )
diff --git a/pyric/rfkill.py b/pyric/rfkill.py
index 148faba..d886f83 100644
--- a/pyric/rfkill.py
+++ b/pyric/rfkill.py
@@ -40,6 +40,13 @@
Implements userspace program rfkill in Python to query the state of rfkill switches
+NOTE:
+ o rfkill_block will block all devices regardless of index, however, the blocked
+ state will only shown in device that was submitted for blocking - this is the
+ same behavior seen in rfkill block
+ - this may be due to bug in ubuntu and not present in other distros
+ o rfkill does not do sanity checks on the index, rfkill.py will through error
+ if the index does not exist
"""
"""
@@ -60,7 +67,7 @@
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
import os
import struct
@@ -168,6 +175,8 @@ def rfkill_block(idx):
blocks the device at index
:param idx: rkill index
"""
+ if not os.path.exists(os.path.join(spath,"rfkill{0}".format(idx))):
+ raise pyric.error(errno.ENODEV,"No device at {0}".format(idx))
fout = None
try:
rfke = rfkill_event(idx,RFKILL_TYPE_ALL,RFKILL_OP_CHANGE,1,0)
@@ -180,20 +189,99 @@ def rfkill_block(idx):
finally:
if fout: fout.close()
+def rfkill_blockby(rtype):
+ """
+ blocks the device of type
+ :param rtype: rfkill type one of {'all'|'wlan'|'bluetooth'|'uwb'|'wimax'
+ |'wwan'|'gps'|'fm'|'nfc'}
+ """
+ rfks = rfkill_list()
+ for name in rfks:
+ if rfks[name]['type'] == rtype:
+ rfkill_block(rfks[name]['idx'])
+
def rfkill_unblock(idx):
"""
unblocks the device at index
:param idx: rkill index
"""
- pass
+ if not os.path.exists(os.path.join(spath, "rfkill{0}".format(idx))):
+ raise pyric.error(errno.ENODEV, "No device at {0}".format(idx))
+ fout = None
+ try:
+ rfke = rfkill_event(idx,RFKILL_TYPE_ALL,RFKILL_OP_CHANGE,0,0)
+ fout = open(dpath, 'w')
+ fout.write(rfke)
+ except struct.error as e:
+ raise pyric.error(pyric.EUNDEF,"Error packing rfkill event {0}".format(e))
+ except IOError as e:
+ raise pyric.error(e.errno,e.message)
+ finally:
+ if fout: fout.close()
def rfkill_unblockby(rtype):
"""
- blocks the device of type
+ unblocks the device of type
:param rtype: rfkill type one of {'all'|'wlan'|'bluetooth'|'uwb'|'wimax'
|'wwan'|'gps'|'fm'|'nfc'}
"""
- pass
+ if rtype not in RFKILL_TYPES:
+ raise pyric.error(errno.EINVAL,"Type {0} is not valid".format(rtype))
+ rfks = rfkill_list()
+ for name in rfks:
+ if rfks[name]['type'] == rtype:
+ rfkill_unblock(rfks[name]['idx'])
+
+def soft_blocked(idx):
+ """
+ determines soft block state of device
+ :param idx: rkill index
+ :returns: True if device at idx is soft blocked, False otherwise
+ """
+ if not os.path.exists(os.path.join(spath,"rfkill{0}".format(idx))):
+ raise pyric.error(errno.ENODEV,"No device at {0}".format(idx))
+ fin = None
+ try:
+ fin = open(os.path.join(spath,"rfkill{0}".format(idx),'soft'),'r')
+ return int(fin.read().strip()) == 1
+ except IOError:
+ raise pyric.error(errno.ENODEV,"No device at {0}".format(idx))
+ except ValueError:
+ raise pyric.error(pyric.EUNDEF,"Unexpected error")
+ finally:
+ if fin: fin.close()
+
+def hard_blocked(idx):
+ """
+ determines hard block state of device
+ :param idx: rkill index
+ :returns: True if device at idx is hard blocked, False otherwise
+ """
+ if not os.path.exists(os.path.join(spath,"rfkill{0}".format(idx))):
+ raise pyric.error(errno.ENODEV,"No device at {0}".format(idx))
+ fin = None
+ try:
+ fin = open(os.path.join(spath,"rfkill{0}".format(idx),'hard'),'r')
+ return int(fin.read().strip()) == 1
+ except IOError:
+ raise pyric.error(errno.ENODEV,"No device at {0}".format(idx))
+ except ValueError:
+ raise pyric.error(pyric.EUNDEF,"Unexpected error")
+ finally:
+ if fin: fin.close()
+
+def getidx(phy):
+ """
+ returns the rfkill index associated with the physical index
+ :param phy: phyiscal index
+ :returns: the rfkill index
+ """
+ phy = "phy{0}".format(phy)
+ rfks = rfkill_list()
+ try:
+ return rfks["phy{0}".format(phy)]['idx']
+ except KeyError:
+ return None
def getname(idx):
"""
@@ -206,7 +294,7 @@ def getname(idx):
fin = open(os.path.join(spath,"rfkill{0}".format(idx),'name'),'r')
return fin.read().strip()
except IOError:
- raise pyric.error(errno.EINVAL,"No such device")
+ raise pyric.error(errno.EINVAL,"No device at {0}".format(idx))
finally:
if fin: fin.close()
@@ -221,6 +309,6 @@ def gettype(idx):
fin = open(os.path.join(spath,"rfkill{0}".format(idx),'type'),'r')
return fin.read().strip()
except IOError:
- raise pyric.error(errno.EINVAL,"No such device")
+ raise pyric.error(errno.ENODEV,"No device at {0}".format(idx))
finally:
if fin: fin.close()
\ No newline at end of file
diff --git a/setup.cfg b/setup.cfg
index 298f1e6..5e831dd 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,4 @@
+# pip distribution
[bdist_wheel]
universal=1
description-file = README.md
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 223f887..00af85b 100644
--- a/setup.py
+++ b/setup.py
@@ -24,29 +24,28 @@
#__name__ = 'setup'
__license__ = 'GPLv3'
-__version__ = '0.0.2'
-__date__ = 'May 2016'
+__version__ = '0.0.3'
+__date__ = 'June 2016'
__author__ = 'Dale Patterson'
__maintainer__ = 'Dale Patterson'
__email__ = 'wraith.wireless@yandex.com'
-__status__ = 'Development'
+__status__ = 'Production'
from setuptools import setup, find_packages
import pyric
-
long_desc = """
- PyRIC provides the ability to
-manipuate, identify and enumerate your system's wireless cards. It is a pure
-python port of a subset of the functionality provided by iw, ifconfig and iwconfig.
-PyRIC is:
-* Pythonic: No ctypes, SWIG etc. PyRIC redefines C header files as Python and
-uses sockets to communicate with kernel.
-* Self-sufficient: No third-party files used, PyRIC is completely self-contained
-* Fast: (relatively speaking) PyRIC is faster than using iw through subprocess.Popen
-* Parse(less): Get the output you without parsing output from iw. Never worry about
-iw updates and rewriting your parsers.
-* Easy: If you can use iw, you can use PyRIC
+ PyRIC provides the ability to manipuate, identify and enumerate your system's
+ wireless cards. It is a pure python port of a subset of the functionality provided
+ by iw, ifconfig, iwconfig and rfkill.
+ PyRIC is:
+ * Pythonic: No ctypes, SWIG etc. PyRIC redefines C header files as Python and
+ uses sockets to communicate with kernel.
+ * Self-sufficient: No third-party files used, PyRIC is completely self-contained
+ * Fast: (relatively speaking) PyRIC is faster than using iw through subprocess.Popen
+ * Parseless: Get the output you without parsing output from iw. Never worry about
+ iw updates and rewriting your parsers.
+ * Easy: If you can use iw, you can use PyRIC
"""
setup(name='PyRIC',
@@ -60,9 +59,11 @@
maintainer=pyric.__maintainer__,
maintainer_email=pyric.__email__,
license=pyric.__license__,
- classifiers=['Development Status :: 4 - Beta',
+ classifiers=['Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Intended Audience :: Developers',
+ 'Intended Audience :: System Administrators',
+ 'Topic :: Security',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Security',
@@ -72,7 +73,7 @@
'Programming Language :: Python',
'Programming Language :: Python :: 2.7'
],
- keywords='nl80211 iw developement wireless pentest',
+ keywords='nl80211 iw wireless pentest',
packages=find_packages(),
package_data={'pyric':['docs/*.help']}
)
diff --git a/tests/pyw.unittest.py b/tests/pyw.unittest.py
index ba9cac1..11f017e 100644
--- a/tests/pyw.unittest.py
+++ b/tests/pyw.unittest.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
""" pyw.unittest.py: unittest
+
Define unittest functions for pyw
Assumptions: