improved README.md

And added a new argument (not implemented) in scripts.py
This commit is contained in:
Pranav Jerry 2021-08-09 12:54:41 +05:30
parent fb4b11b9fd
commit a798ac8051
Signed by: pranav
GPG Key ID: F1DCDC4FED0A0C5B
2 changed files with 42 additions and 15 deletions

View File

@ -2,7 +2,9 @@
**naxalnet** is a program to create a wireless mesh network for
communicating with each other. It can be useful during an
[internet shutdown][], or to join online classes with a group of laptops.
[internet shutdown](#internet-shutdown), or to join
[online classes](#online-class-in-remote-areas) with a group
of laptops.
It uses [B.A.T.M.A.N. Advanced][batman-adv], an implementation
of the B.A.T.M.A.N. routing protocol to communicate with peers.
@ -163,13 +165,27 @@ sudo systemctl start NetworkManager.service
## How it works
The program naxalnet copies some `systemd-networkd` configuration files
into networkd's runtime configuration directory. It uses iwd to start
an ad-hoc network named "HelloWorld". See the
[systemd-networkd](systemd-networkd) directory
to see how systemd-networkd configures the network. You can use
services like [IPFS][], [Jami][], [Secure Scuttlebutt][ssb]
naxalnet uses iwd to start an ad-hoc network and configures
systemd-networkd to setup a BATMAN Advanced network.
Read the code to learn the details.
See [systemd-networkd](systemd-networkd) to see how systemd-networkd
configures the network.
## Use cases
### Online class in remote areas
naxalnet can be used to share connections in remote areas.
You need atleast one device with internet access.
### Internet shutdown
You can communicate with neighbouring devices running naxalnet,
using services like [IPFS][], [Jami][], [Secure Scuttlebutt][ssb]
and others which can work on an intranet.
They need to be installed on your device _before_ your friendly
totalitarian administration orders an [internet shutdown][], since you
cannot download and install them during a shutdown.
## Uninstalling
@ -198,13 +214,12 @@ available, consider using them instead of naxalnet.
## License
This program is [free/libre/swatantra][free-sw] software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
naxalnet is [free/libre/swatantra][free-sw] software: you can
redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation, either
version 3 of the License, or (at your option) any later version.
See [LICENSE](LICENSE) for the complete version of the
license.
See [LICENSE](LICENSE) for the complete version of the license.
[batman-adv]: https://www.open-mesh.org/projects/batman-adv/wiki
[internet shutdown]: https://internetshutdowns.in

View File

@ -23,8 +23,8 @@ with systemd-networkd and iwd
import sys
from pathlib import Path
from shutil import copy
from dasbus.error import DBusError
from argparse import ArgumentParser
from dasbus.error import DBusError
from naxalnet.iwd import IWD, Device, Adapter
NETWORKD_CONFIGS = "/usr/share/naxalnet/networkd"
@ -56,6 +56,11 @@ def copy_files():
def setup_devices(args):
"""
Setup wifi interfaces using iwd
This function should be called every time an interface
is connected or removed
"""
iwd = IWD()
devices = iwd.get_devices()
adhoc_devices = []
@ -148,7 +153,14 @@ def parse_args():
parser.add_argument(
"--adhoc-name", "-a", type=str, default=ADHOC_NAME, help="name of adhoc network"
)
# TODO: implement verbose
# TODO: print info about wifi network from config and args
parser.add_argument(
"--print-wifi",
action="store_true",
default=False,
help="prints the ssid and password of the WiFi network and exit",
)
# TODO: implement --verbose
parser.add_argument(
"-v",
"--verbose",