From ee37b30a2166f15f606b022c2cccf7e0236837e8 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Fri, 28 Jul 2017 21:33:44 +0530 Subject: [PATCH 1/6] Update README.rst --- README.rst | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index b5d1546..e4221cd 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -iwlib - interface with wireless tools in Linux +# iwlib - interface with wireless tools in Linux ============================================== iwlib is a package for interfacing with iwlib, providing an implementation to @@ -15,16 +15,16 @@ back from a device. http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html -Installation +## Installation ------------ Installation requires the Python developer tools, and wireless_tools package for compilation. If Python.h and iwlib.h exist on your system, you should be good to go. - $ pip install iwlib +`$ pip install iwlib` -Change History +## Change History -------------- 1.5 (1st October 2014) @@ -46,3 +46,27 @@ Change History 1.2.1 (21st March 2013) - Initial release of code, as it was when I inherited it. + +## Usage +-------------- +run following command in a shell to see the available wireless interfaces +`$ iwconfig ` +'wlan0' is very common, so that is what we will use for this quick guide + +The output is very similar to +`$ iwconfig interface ` + +`>>import iwlib` +`>>interface = 'wlan0'` +`>>iwlib.get_iwconfig(interface)` +`>> {'BitRate': b'72.2 Mb/s', 'ESSID': b'AP_SSID', 'Access Point': b'AP_MAC', 'stats': {'quality': 45, 'noise': 0, 'updated': 75, 'level': 191}, 'Frequency': b'2.422 GHz', 'Mode': b'Managed'}` + +The dict's values are byte strings. You can use b'xyz'.decode('utf-8') to decode them into python strings. + +Finally, here's the docstring for the function +`>> print(iwlib.get_iwconfig.__doc__) +Retrieve the current configuration of an interface. + +Arguments: + - device to work on (e.g. eth1, wlan0). +` From 51c515990c2288ca69a7c473e8d54e211609f739 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Fri, 28 Jul 2017 21:35:44 +0530 Subject: [PATCH 2/6] Create README.md --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ + From f9fdc6a2e0b8bb4df5116d729a474ad70cd203ed Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Fri, 28 Jul 2017 21:44:01 +0530 Subject: [PATCH 3/6] Update README.md --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/README.md b/README.md index 8b13789..9684838 100644 --- a/README.md +++ b/README.md @@ -1 +1,73 @@ +# iwlib - interface with wireless tools in Linux +iwlib is a package for interfacing with iwlib, providing an implementation to +the wireless tools in Linux. + +While very incomplete at the moment, it aims to eventually become a complete +implementation, as features become necessary. If you find some functionality +missing, feel free to contribute to the project, or create an issue on the bug +tracker. + +Currently it provides what I consider the bare minimum to become useful - +scanning, setting the ESSID of a device, and getting the current configuration +back from a device. + +http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html + +## Installation +------------ + +Installation requires the Python developer tools, and wireless_tools package +for compilation. If Python.h and iwlib.h exist on your system, you should be +good to go. + +`$ pip install iwlib` + +Depending on your linux distro, the package name may change. But this is tested on Ubuntu 17 +`$ sudo apt-get install libiw-dev` + + +## Change History +-------------- + +1.5 (1st October 2014) + - Added support for Python 3 + +1.4 (12th June 2014) + - Fixed incompatibility with wireless_tools version 30.pre9 + - Fixed build error that resulted in iwconfig and iwlist not being built. + - Minor cleanups + - Feels "snappier" + +1.3.1 (2nd April 2013) + - Fixed packaging issue involving missing header files. + +1.3 (24th March 2013) + - Added ``iwlib.utils module``. See documentation for details. + - Added ``iwlib.iwlist module``. See documentation for details. + - Added function ``set_essid``, to ``iwlib.iwconfig``. + +1.2.1 (21st March 2013) + - Initial release of code, as it was when I inherited it. + +## Quick Guide +-------------- +Run following command in a shell to see the available wireless interfaces +`$ iwconfig ` + +('wlan0' is very common, so that is what we will use for this quick guide) + +In the python Shell, +`>> import iwlib` +`>> interface = 'wlan0'` +`>> iwlib.get_iwconfig(interface)` +` {'BitRate': b'72.2 Mb/s', 'ESSID': b'AP_SSID', 'Access Point': b'AP_MAC', 'stats': {'quality': 45, 'noise': 0, 'updated': 75, 'level': 191}, 'Frequency': b'2.422 GHz', 'Mode': b'Managed'}` + +The dict's values are byte strings. You can use `b'xyz'.decode('utf-8')` to decode them into python strings. + +Finally, here's the docstring for the function +`>> print(iwlib.get_iwconfig.__doc__)` +` Retrieve the current configuration of an interface. ` +` Arguments:` +` - device to work on (e.g. eth1, wlan0). ` +` From 4b616202efff2cd282e7de65a08af7152454a692 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Fri, 28 Jul 2017 21:45:08 +0530 Subject: [PATCH 4/6] Delete README.rst --- README.rst | 72 ------------------------------------------------------ 1 file changed, 72 deletions(-) delete mode 100644 README.rst diff --git a/README.rst b/README.rst deleted file mode 100644 index e4221cd..0000000 --- a/README.rst +++ /dev/null @@ -1,72 +0,0 @@ -# iwlib - interface with wireless tools in Linux -============================================== - -iwlib is a package for interfacing with iwlib, providing an implementation to -the wireless tools in Linux. - -While very incomplete at the moment, it aims to eventually become a complete -implementation, as features become necessary. If you find some functionality -missing, feel free to contribute to the project, or create an issue on the bug -tracker. - -Currently it provides what I consider the bare minimum to become useful - -scanning, setting the ESSID of a device, and getting the current configuration -back from a device. - -http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html - -## Installation ------------- - -Installation requires the Python developer tools, and wireless_tools package -for compilation. If Python.h and iwlib.h exist on your system, you should be -good to go. - -`$ pip install iwlib` - -## Change History --------------- - -1.5 (1st October 2014) - - Added support for Python 3 - -1.4 (12th June 2014) - - Fixed incompatibility with wireless_tools version 30.pre9 - - Fixed build error that resulted in iwconfig and iwlist not being built. - - Minor cleanups - - Feels "snappier" - -1.3.1 (2nd April 2013) - - Fixed packaging issue involving missing header files. - -1.3 (24th March 2013) - - Added ``iwlib.utils module``. See documentation for details. - - Added ``iwlib.iwlist module``. See documentation for details. - - Added function ``set_essid``, to ``iwlib.iwconfig``. - -1.2.1 (21st March 2013) - - Initial release of code, as it was when I inherited it. - -## Usage --------------- -run following command in a shell to see the available wireless interfaces -`$ iwconfig ` -'wlan0' is very common, so that is what we will use for this quick guide - -The output is very similar to -`$ iwconfig interface ` - -`>>import iwlib` -`>>interface = 'wlan0'` -`>>iwlib.get_iwconfig(interface)` -`>> {'BitRate': b'72.2 Mb/s', 'ESSID': b'AP_SSID', 'Access Point': b'AP_MAC', 'stats': {'quality': 45, 'noise': 0, 'updated': 75, 'level': 191}, 'Frequency': b'2.422 GHz', 'Mode': b'Managed'}` - -The dict's values are byte strings. You can use b'xyz'.decode('utf-8') to decode them into python strings. - -Finally, here's the docstring for the function -`>> print(iwlib.get_iwconfig.__doc__) -Retrieve the current configuration of an interface. - -Arguments: - - device to work on (e.g. eth1, wlan0). -` From 94198a56ebaa3b077c11efa0b2933a982aecde39 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Fri, 28 Jul 2017 21:45:25 +0530 Subject: [PATCH 5/6] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 9684838..f74694d 100644 --- a/README.md +++ b/README.md @@ -70,4 +70,3 @@ Finally, here's the docstring for the function ` Retrieve the current configuration of an interface. ` ` Arguments:` ` - device to work on (e.g. eth1, wlan0). ` -` From c6a15a84d28ac474763371acaa47a367b2a54910 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Fri, 28 Jul 2017 21:46:07 +0530 Subject: [PATCH 6/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f74694d..b4331f3 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,12 @@ Depending on your linux distro, the package name may change. But this is tested ## Quick Guide -------------- -Run following command in a shell to see the available wireless interfaces +Run following command in a bash shell to see the available wireless interfaces `$ iwconfig ` ('wlan0' is very common, so that is what we will use for this quick guide) -In the python Shell, +Now in the python interactive Shell, `>> import iwlib` `>> interface = 'wlan0'` `>> iwlib.get_iwconfig(interface)`