Set gateway mode automatically #18

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

This is a wok-in-progress fix to issue #15

This is a wok-in-progress fix to issue #15
pranav added the
enhancement
label 2021-09-24 05:33:01 +02:00
pranav added 2 commits 2021-09-24 09:13:43 +02:00
pranav added 1 commit 2021-09-25 11:36:26 +02:00
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
pranav added 2 commits 2021-09-26 10:03:24 +02:00
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().
pranav added 1 commit 2021-09-26 10:29:45 +02:00
pranav added 1 commit 2021-09-27 06:34:30 +02:00
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.
pranav added 1 commit 2021-09-27 07:35:59 +02:00
798cd3e988
fixed bug in previous commit
Added function to get glob as sorted list. This fixes the errors
reported by systemd-networkd
pranav added 1 commit 2021-09-27 07:59:38 +02:00
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.
pranav added 1 commit 2021-09-27 08:14:14 +02:00
pranav added 1 commit 2021-09-27 09:18:48 +02:00
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.
pranav added 1 commit 2021-09-27 19:08:31 +02:00
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.
pranav added 1 commit 2021-09-27 19:19:22 +02:00
87612fac2c
delete interface during cleanup
Read the previous commit for some unhelpful remarks.
pranav added 1 commit 2021-09-28 09:08:43 +02:00
5bde1faeba
temporary hack to fix #19
Probably s/temporary/permanent/ if someone doesn't take over this
"project" soon.
pranav added 1 commit 2021-09-28 12:29:54 +02:00
a061852a59
commented out a line causing trouble
And added a  bit more logging
pranav added 1 commit 2021-09-29 05:11:01 +02:00
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.
pranav added 1 commit 2021-09-29 11:46:37 +02:00
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.
pranav added 1 commit 2021-10-02 10:51:40 +02:00
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.
pranav added a new dependency 2021-10-03 07:16:21 +02:00
pranav added a new dependency 2021-10-03 07:17:44 +02:00
pranav added 1 commit 2021-10-05 08:39:04 +02:00
6acd7084f2
made README better
Added info on how to check requirements
pranav added 1 commit 2021-10-05 11:35:44 +02:00
65e1906753
added Makefile rule to build rpm
And updated README with the details. There is probably something missing
in the Fedora installation section
pranav added 1 commit 2021-10-06 15:59:13 +02:00
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.
pranav added 1 commit 2021-10-08 19:01:05 +02:00
pranav added 1 commit 2021-10-09 11:52:43 +02:00
de63113098
ready to merge
Updated __version__ to 0.4.0a6
pranav changed title from WIP: Set gateway automatically to Set gateway mode automatically 2021-10-09 11:53:28 +02:00
Author
Owner

The supreme commander-in-chief (me) is merging this into master. This will close issues #15 and #19.

The supreme commander-in-chief (me) is merging this into master. This will close issues #15 and #19.
pranav merged commit a6f5b07310 into master 2021-10-09 11:57:52 +02:00
pranav deleted branch gateway 2021-10-09 11:57:55 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: pranav/pybatmesh#18
No description provided.