From 6f6e85c9c6992e9a99358bedc8900488a497d84a Mon Sep 17 00:00:00 2001 From: Rafay Ghafoor Date: Sat, 2 Sep 2017 00:21:04 +0500 Subject: [PATCH 1/3] Update README.md --- README.md | 80 +++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 0d24bbd..216c46c 100755 --- a/README.md +++ b/README.md @@ -16,26 +16,36 @@ A PTCL-Router API. # Usage: ``` -usage: ptcl.py [-h] [-b [BLOCK]] [-sb] [-u [UNBLOCK]] [-a] [-r] [-sd] +Usage: ptcl.py [-h] [-b [BLOCK]] [-sb] [-u [UNBLOCK]] [-a] [-r] [-sd] [-s SHOW_ACTIVE] [-c] [-q [QUIET]] Control PTCL router from command-line. -optional arguments: +Options: + -h, --help show this help message and exit + -b [BLOCK], --block [BLOCK] Block device. + -sb, --blocked_dev Display blocked devices. + -u [UNBLOCK], --unblock [UNBLOCK] Unblock device. + -a, --active-devices Gets number of devices connected to the router. + -r, --restart Restart Router. + -sd, --show-dhcp Show DHCP Info. + -s SHOW_ACTIVE, --show-active SHOW_ACTIVE Show Active Devices. - -c, --configure Configure router settings. - -q [QUIET], --quiet [QUIET] - Quite mode. + + --configure Configure router settings. + + -c [CLI], --cli [CLI] + CLI mode (used in conjunction with -u or -b). ``` # Examples: @@ -43,53 +53,41 @@ optional arguments: **Shows devices connected to the router.** ```python ->>> python ptcl.py -``` - -**Shows currently active devices and provides an option to block device from the display.** - -```python ->>> python ptcl.py -b -``` - -**Shows DHCP info for all devices connected in a day.** - -```python ->>> python ptcl.py -sd -``` - -**Reboots the router.** - -```python ->>> python ptcl.py -r +>>> python ptcl.py --configure # Configure router gateway, username and password +>>> python ptcl.py # Shows currently active devices. +>>> python ptcl.py -sa # Set custom aliases for mac addresses. +>>> python ptcl.py -b USER # Block user from custom defined alias. +>>> python ptcl.py -ub USER # Unblock user from custom defined alias. +>>> python ptcl.py -b -c # Block devices from the active devices display. +>>> python ptcl.py -sb # Show blocked users. +>>> python ptcl.py -sd # Show DHCP info. +>>> python ptcl.py -r # Reboots router. ``` # TODO: -- [ ] Writing documentation for API usage. -- [ ] Organizing TODO in sections. +- [X] Writing documentation for API usage. - [ ] Port-Forwarding from command line. - [ ] Parsing router logs. +- [X] Display number of active devices. +- [X] Optimize Regular Expressions. - [ ] Obtaining Pin-Code of the router and changing it. - [ ] Displaying current password of the SSID. +- [X] Setting up custom hostname for specific device (mac address). - [ ] Changing router username and password from the command-line. -- [ ] Changing SSID-Name. -- [ ] Adding a method to change router password. -- [ ] Add CLI MODE for unblocking devices. +- [ ] Changing Router SSID-Name. +- [X] Add CLI MODE for unblocking devices. - [ ] Option to change frequency 2.4 Ghz or 5 Ghz. +- [X] Testing on other routers from the same vendor. - [ ] Option to change router transmission power. -- [ ] Improving display for blocked devices. -- [ ] Exclude android devices from station info and dhcp info (Optional). +- [X] Improving display for blocked devices. - [ ] Time restriction for user (by specifying or choosing from station info) device mac address or hostname. - [ ] Adding URL to block unnecessary use for a website, also time limit for a site usage. -- [ ] Monitor devices connection info i.e., when they connect to the router and disconnect. Also devices uptime of the day. -- [ ] Block devices who remain connected to the router for x time (6 hours). Unblock them after 6 hours. -- [ ] Searching suspected users in the station info (Currently Active Devices) when speed is slow. -- [ ] Getting device connection info in a nice CSV file. -- [ ] Uploading CSV on cloud everyday. -- [X] Setting up custom hostname for specific device (mac address). -- [X] Optimize Regular Expressions. -- [X] CLI MODE and SILENT MODE for blocking devices. -- [X] Testing on other routers from the same vendor. - [X] Reboot router from script. -- [X] Display number of active devices. +- [ ] Getting devices connection info in a nice CSV file. +- [X] CLI MODE and SILENT MODE for blocking devices. + + + + + From 44d7362364a79ae30d4869ef436197cd18e1f005 Mon Sep 17 00:00:00 2001 From: Rafay Ghafoor Date: Sat, 2 Sep 2017 00:26:46 +0500 Subject: [PATCH 2/3] Update README.md --- README.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 216c46c..2c2b298 100755 --- a/README.md +++ b/README.md @@ -1,17 +1,6 @@ -# PTCL-Router: +# PTCL-Router-API: -A PTCL-Router API. - -# Current-Features: - -- Obtain station information, showing their hostnames alongside for better readability (devices currently connected to the router). -- Obtain DHCP information. -- Block and unblock devices using their mac addresses. -- Block and unblock devices using their predefined aliases. -- Reboot router. -- Over-ride hostnames associated to the mac address with custom hostnames. -- Display blocked devices. -- Added two modes for blocking users ( CLI-MODE and SILENT-MODE (Default) ). +A PTCL-Router API to interact with default router interface. # Usage: @@ -50,8 +39,6 @@ Options: # Examples: -**Shows devices connected to the router.** - ```python >>> python ptcl.py --configure # Configure router gateway, username and password >>> python ptcl.py # Shows currently active devices. @@ -64,6 +51,17 @@ Options: >>> python ptcl.py -r # Reboots router. ``` +# Current-Features: + +- Obtain station information, showing their hostnames alongside for better readability (devices currently connected to the router). +- Obtain DHCP information. +- Block and unblock devices using their mac addresses. +- Block and unblock devices using their predefined aliases. +- Reboot router. +- Over-ride hostnames associated to the mac address with custom hostnames. +- Display blocked devices. +- Added two modes for blocking users ( CLI-MODE and SILENT-MODE (Default) ). + # TODO: - [X] Writing documentation for API usage. From 5158a6d98a14829f0919494c8bd1481c45befaaf Mon Sep 17 00:00:00 2001 From: Rafay Ghafoor Date: Sat, 2 Sep 2017 00:28:07 +0500 Subject: [PATCH 3/3] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c2b298..06685ab 100755 --- a/README.md +++ b/README.md @@ -39,15 +39,23 @@ Options: # Examples: -```python +``` >>> python ptcl.py --configure # Configure router gateway, username and password + >>> python ptcl.py # Shows currently active devices. + >>> python ptcl.py -sa # Set custom aliases for mac addresses. + >>> python ptcl.py -b USER # Block user from custom defined alias. + >>> python ptcl.py -ub USER # Unblock user from custom defined alias. + >>> python ptcl.py -b -c # Block devices from the active devices display. + >>> python ptcl.py -sb # Show blocked users. + >>> python ptcl.py -sd # Show DHCP info. + >>> python ptcl.py -r # Reboots router. ```