Set gateway mode automatically #18

Merged
pranav merged 23 commits from gateway into master 2021-10-09 11:57:53 +02:00

23 Commits

Author SHA1 Message Date
Pranav Jerry de63113098
ready to merge
Updated __version__ to 0.4.0a6
2021-10-09 15:20:57 +05:30
Pranav Jerry e56ff40495
improved documentation 2021-10-08 22:28:01 +05:30
Pranav Jerry 3b3644e107
updated install guide for Fedora in README.md
systemd-resolved is used by default, so there is no need to install it
in rawhide.
2021-10-06 19:27:32 +05:30
Pranav Jerry 65e1906753
added Makefile rule to build rpm
And updated README with the details. There is probably something missing
in the Fedora installation section
2021-10-05 15:04:19 +05:30
Pranav Jerry 6acd7084f2
made README better
Added info on how to check requirements
2021-10-05 12:06:50 +05:30
Pranav Jerry 61a96ea3b3
updated documentation and some other changes
Made messages printed in Makefile more understandable. Removed full path
of naxalnet from the systemd service. Now you can start naxalnet even if
it is installed in /usr/local/bin, if systemd allows (I have not tested
it). Many comments were made to respect the 80 chars per line rule.
And, of course, added some political commentary to insult the global
superpower (superpower in terms of money, military and something else I
forgot). And removed MANIFEST.in, which probably haven't changed anything.
2021-10-02 14:13:53 +05:30
Pranav Jerry a7304a986b
turn off all wifi devices at exit
This makes things easier to maintain, or so I hope.

Added more comments in files in systemd-networkd, made CHANGELOG.md
better, and updated the README.
2021-09-29 15:14:13 +05:30
Pranav Jerry 32e9559e6e
fixed bug in main()
For some days I've been testing this program without realising that
gateway_mode was set to off every time. Remove dependencies from install
in Makefile, which we don't need anyway, since it builds twice when
installing from the AUR PKGBUILD.
2021-09-29 08:37:59 +05:30
Pranav Jerry a061852a59
commented out a line causing trouble
And added a  bit more logging
2021-09-28 15:58:31 +05:30
Pranav Jerry 5bde1faeba
temporary hack to fix #19
Probably s/temporary/permanent/ if someone doesn't take over this
"project" soon.
2021-09-28 12:37:11 +05:30
Pranav Jerry 87612fac2c
delete interface during cleanup
Read the previous commit for some unhelpful remarks.
2021-09-27 22:48:13 +05:30
Pranav Jerry 2e4c3a70a4
cleanup before exit
This was previously done by the systemd service. But since we allowed
changing the name of bat0 and bridge0, we can't expect systemd to still
do that job. Commented out some lines in the systemd service and made it
send SIGINT instead of the default SIGTERM to kill naxalnet. I
accidentally used to increment a2, a3, a4, ... in the __version__
instead of dev1, dev2, &c. a few commits back. Removed some print()
lines lurking somewhere in the code. The cleanup is still not completed.
We still have to delete the interfaces bridge0 and bat0, or whatever
name the user gives it. Just out of boredom, I added some description to
some network configuration, though so I doubt if anyone will understand
it more because of that.
2021-09-27 22:30:07 +05:30
Pranav Jerry d0389e5638
set gateway mode automatically
Added arg and config option to manually set gw_mode.
When gateway_mode is auto, a temporary config will be added, and after a
ten sec delay, naxalnet will check if systemd-networkd shows a
'routable' connection. If the connection is routable, gw_mode will be
set to server; or client otherwise.
2021-09-27 12:43:09 +05:30
Pranav Jerry 8ba8d6af6c
cleaned up code 2021-09-27 11:43:50 +05:30
Pranav Jerry 761618aff4
added new args and config options
This will allow changing name of batman and bridge interface.
But deleting them after stopping naxalnet will not work at the moment.
2021-09-27 11:27:44 +05:30
Pranav Jerry 798cd3e988
fixed bug in previous commit
Added function to get glob as sorted list. This fixes the errors
reported by systemd-networkd
2021-09-27 11:03:27 +05:30
Pranav Jerry a81449b898
changed how network config is done
We now use NetworkD() to configure systemd-networkd.
Path.glob doesn't return things in alphabetical order, which is needed
to configure networkd without any error. Need a fix for that.
2021-09-27 10:00:59 +05:30
Pranav Jerry ab3252683a
added func for parsing and writing networkd config 2021-09-26 13:57:40 +05:30
Pranav Jerry 8f905ed970
prepared *.net{work,dev} files to work with str.format() 2021-09-26 13:31:36 +05:30
Pranav Jerry 25ac54dfad
removed arguments added in previous commit
Too much configs and args make debugging harder. The class networkd will
be used to add config files to the networkd runtime dir after formatting
the file with str.format().
2021-09-26 13:25:35 +05:30
Pranav Jerry 25a5bdee30
added network.py and some other changes
This will be used to control systemd-networkd via d-bus and runtime
configs and make things easier in implementing B.A.T.M.A.N. gateway support
2021-09-25 15:04:29 +05:30
Pranav Jerry 9171b942db
added temporary network config file
This will be used to check if the machine has internet access.
2021-09-24 12:42:13 +05:30
Pranav Jerry ea283a3247
Duplicate mesh.07-bridge.network history in check.01-eth.network history. 2021-09-24 12:38:46 +05:30