Skip to content

Commit

Permalink
v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wraith-wireless committed Jun 5, 2016
1 parent 029c026 commit 41aeffa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
Binary file modified docs/PyRIC.pdf
Binary file not shown.
28 changes: 23 additions & 5 deletions docs/PyRIC.tex
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ \subsection{Additional Tools}
In the utils directory, PyRIC includes channels.py, hardware.py, rfkill.py and
ouifetch.py. These provide a port of rfkill, channel/frequency enumeration and
device chipset, driver retrieval as well as some mac address functions. More
information can be found in the Appendices.
information can be found in the Appendices and in README.md.

\subsection{Interacting with the Kernel: libnl.py and libio.py}
The kernel interfaces, libnl.py and libio.py are located in the lib directory.
Expand Down Expand Up @@ -741,6 +741,9 @@ \subsection{Functions}
\item up(card,[iosock]) (ifconfig card.<dev> up), type: ioctl, bring card up
\item down(card,[iosock]): (ifconfig card.<dev> down), type: ioctl, bring card
down
\item block(card): (rfkill block <rfkill\_idx>) type: N/A, soft blocks card
\item unblock(card): (rfkill unblock <rfkill\_idx>) type: N/A, removes the soft
block on card
\item inetget(card,[iosock]): (ifconfig card.<dev>), type: ioctl, get ip4 address,
netmask and broadcast address of card
\item inetset(card,ipaddr,netmask,broadcast,[iosock]): (ifconfig card/<dev> <ipaddr>
Expand Down Expand Up @@ -837,8 +840,9 @@ \subsection{Functions}
\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.
\section{API: hardware.py}\label{sec:deviceapi}
Hardware related: driver, chipset, manufacturer and mac address utility functions
can be found in device.py.

\subsection{Constants}
\begin{enumerate}
Expand All @@ -848,20 +852,34 @@ \subsection{Constants}

\subsection{Functions}
\begin{enumerate}
\item parseoui(path): reads and stores oui data from optional <path> into a dict
\item oui(mac): returns the oui portion of address <mac>
\item ulm(mac): returns the ulm portion of address <mac>
\item manufacturer(ouis,mac): returns the manufacturer name of <mac> given the
dict of <ouis>
\item randhw(ouis): returns a random mac address given a dict of <ouis>
\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: ouifetch.py}
The file ouifetch.py retrieves and saves a tab seperated file of oui to
manufacturer name for use by hardware.py functions. From a command line, type: \\

\texttt{python ouifetch.py}\\

Optional arguments path and verbose can also be specified.

\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
\item \textbf{RFKILL\_STATE}: list of boolean values corresponding to blocked,
unblocked
\end{enumerate}

\subsection{Functions}
Expand Down

0 comments on commit 41aeffa

Please sign in to comment.