mirror of
https://git.disroot.org/pranav/pybatmesh.git
synced 2025-01-09 08:23:58 +05:30
improved README.md
And added a new argument (not implemented) in scripts.py
This commit is contained in:
parent
fb4b11b9fd
commit
a798ac8051
41
README.md
41
README.md
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
**naxalnet** is a program to create a wireless mesh network for
|
**naxalnet** is a program to create a wireless mesh network for
|
||||||
communicating with each other. It can be useful during an
|
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
|
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.
|
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
|
## How it works
|
||||||
|
|
||||||
The program naxalnet copies some `systemd-networkd` configuration files
|
naxalnet uses iwd to start an ad-hoc network and configures
|
||||||
into networkd's runtime configuration directory. It uses iwd to start
|
systemd-networkd to setup a BATMAN Advanced network.
|
||||||
an ad-hoc network named "HelloWorld". See the
|
Read the code to learn the details.
|
||||||
[systemd-networkd](systemd-networkd) directory
|
See [systemd-networkd](systemd-networkd) to see how systemd-networkd
|
||||||
to see how systemd-networkd configures the network. You can use
|
configures the network.
|
||||||
services like [IPFS][], [Jami][], [Secure Scuttlebutt][ssb]
|
|
||||||
|
## 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.
|
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
|
## Uninstalling
|
||||||
|
|
||||||
@ -198,13 +214,12 @@ available, consider using them instead of naxalnet.
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This program is [free/libre/swatantra][free-sw] software: you can redistribute it and/or modify
|
naxalnet is [free/libre/swatantra][free-sw] software: you can
|
||||||
it under the terms of the GNU General Public License as published by
|
redistribute it and/or modify it under the terms of the GNU General
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
Public License as published by the Free Software Foundation, either
|
||||||
(at your option) any later version.
|
version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
See [LICENSE](LICENSE) for the complete version of the
|
See [LICENSE](LICENSE) for the complete version of the license.
|
||||||
license.
|
|
||||||
|
|
||||||
[batman-adv]: https://www.open-mesh.org/projects/batman-adv/wiki
|
[batman-adv]: https://www.open-mesh.org/projects/batman-adv/wiki
|
||||||
[internet shutdown]: https://internetshutdowns.in
|
[internet shutdown]: https://internetshutdowns.in
|
||||||
|
@ -23,8 +23,8 @@ with systemd-networkd and iwd
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from shutil import copy
|
from shutil import copy
|
||||||
from dasbus.error import DBusError
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
from dasbus.error import DBusError
|
||||||
from naxalnet.iwd import IWD, Device, Adapter
|
from naxalnet.iwd import IWD, Device, Adapter
|
||||||
|
|
||||||
NETWORKD_CONFIGS = "/usr/share/naxalnet/networkd"
|
NETWORKD_CONFIGS = "/usr/share/naxalnet/networkd"
|
||||||
@ -56,6 +56,11 @@ def copy_files():
|
|||||||
|
|
||||||
|
|
||||||
def setup_devices(args):
|
def setup_devices(args):
|
||||||
|
"""
|
||||||
|
Setup wifi interfaces using iwd
|
||||||
|
This function should be called every time an interface
|
||||||
|
is connected or removed
|
||||||
|
"""
|
||||||
iwd = IWD()
|
iwd = IWD()
|
||||||
devices = iwd.get_devices()
|
devices = iwd.get_devices()
|
||||||
adhoc_devices = []
|
adhoc_devices = []
|
||||||
@ -148,7 +153,14 @@ def parse_args():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--adhoc-name", "-a", type=str, default=ADHOC_NAME, help="name of adhoc network"
|
"--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(
|
parser.add_argument(
|
||||||
"-v",
|
"-v",
|
||||||
"--verbose",
|
"--verbose",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user