project/unetd.git
2 years agounet-cli: pass host object to set_host()
Felix Fietkau [Thu, 25 Aug 2022 10:40:17 +0000 (12:40 +0200)]
unet-cli: pass host object to set_host()

Avoids accessing global net_data from within the function

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agounet-cli: pass service object to set_service()
Felix Fietkau [Thu, 25 Aug 2022 10:37:24 +0000 (12:37 +0200)]
unet-cli: pass service object to set_service()

Avoids accessing global net_data from within the function

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agounet-cli: use modern module imports
Jo-Philipp Wich [Wed, 24 Aug 2022 22:49:10 +0000 (00:49 +0200)]
unet-cli: use modern module imports

Instead of loading the entire `fs` module space using `require()`, utilize
the `import` statement to load the fs function we actually use.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agounet-cli: use modern ucode syntax
Jo-Philipp Wich [Wed, 24 Aug 2022 22:43:07 +0000 (00:43 +0200)]
unet-cli: use modern ucode syntax

Refactor various places in the script to use modern syntax, such as
template strings or `in` lookups.

Also introduce a simple `assert()` helper function to deal with the
repeated `if (!cond) { warn(msg); exit(1) }` pattern.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agofix build errors when built against glibc
Felix Fietkau [Thu, 25 Aug 2022 10:16:31 +0000 (12:16 +0200)]
fix build errors when built against glibc

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobuild.sh: add libbpf
Felix Fietkau [Thu, 25 Aug 2022 10:16:07 +0000 (12:16 +0200)]
build.sh: add libbpf

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobuild: explicitly link in libelf and zlib
Felix Fietkau [Thu, 25 Aug 2022 10:15:40 +0000 (12:15 +0200)]
build: explicitly link in libelf and zlib

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agonetwork: add support for specifying a host gateway
Felix Fietkau [Wed, 24 Aug 2022 12:02:48 +0000 (14:02 +0200)]
network: add support for specifying a host gateway

A host will only use its gateway as a peer, and connections from
other hosts will be routed through the gateway host

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agounet-cli: bring up interface on ssh add
Felix Fietkau [Wed, 24 Aug 2022 08:58:49 +0000 (10:58 +0200)]
unet-cli: bring up interface on ssh add

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agounet-cli: allow editing remote host domain
Felix Fietkau [Tue, 23 Aug 2022 21:42:59 +0000 (23:42 +0200)]
unet-cli: allow editing remote host domain

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agonetwork: fix writing domain suffix to hosts file
Felix Fietkau [Tue, 23 Aug 2022 21:37:27 +0000 (23:37 +0200)]
network: fix writing domain suffix to hosts file

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoadd network json editor written in ucode
Felix Fietkau [Mon, 22 Aug 2022 20:14:32 +0000 (22:14 +0200)]
add network json editor written in ucode

reformat example json to match its output

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agohost: deal with host/peer null pointers in debug messages
Felix Fietkau [Tue, 23 Aug 2022 21:11:28 +0000 (23:11 +0200)]
host: deal with host/peer null pointers in debug messages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agopex: remove connected check in pex_msg_send
Felix Fietkau [Tue, 23 Aug 2022 21:06:09 +0000 (23:06 +0200)]
pex: remove connected check in pex_msg_send

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agopex: remove extra newline in debug message
Felix Fietkau [Tue, 16 Aug 2022 20:49:58 +0000 (22:49 +0200)]
pex: remove extra newline in debug message

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agohost: avoid running connect timer if the network is not up
Felix Fietkau [Tue, 16 Aug 2022 18:31:16 +0000 (20:31 +0200)]
host: avoid running connect timer if the network is not up

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agonetwork: fix potential use-after-free
Felix Fietkau [Tue, 16 Aug 2022 18:30:49 +0000 (20:30 +0200)]
network: fix potential use-after-free

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agonetwork: check for empty string arguments
Felix Fietkau [Tue, 16 Aug 2022 15:48:07 +0000 (17:48 +0200)]
network: check for empty string arguments

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoadd protocol for exchanging signed network data
Felix Fietkau [Sat, 13 Aug 2022 12:57:43 +0000 (14:57 +0200)]
add protocol for exchanging signed network data

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agopex: fix null pointer check
Felix Fietkau [Tue, 23 Aug 2022 20:35:54 +0000 (22:35 +0200)]
pex: fix null pointer check

check for local_host null pointer before dereferencing it

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agofix SPDX tag
Felix Fietkau [Sat, 6 Aug 2022 13:51:18 +0000 (15:51 +0200)]
fix SPDX tag

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agocurve25519: rely on utils.h
Felix Fietkau [Sat, 6 Aug 2022 06:38:32 +0000 (08:38 +0200)]
curve25519: rely on utils.h

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoadd chacha20 implementation
Felix Fietkau [Fri, 5 Aug 2022 13:32:15 +0000 (15:32 +0200)]
add chacha20 implementation

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agopex: use pubkey directly instead of accessing local_host in pex_msg_init()
Felix Fietkau [Wed, 3 Aug 2022 20:27:01 +0000 (22:27 +0200)]
pex: use pubkey directly instead of accessing local_host in pex_msg_init()

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoadd support for loading signed network files
Felix Fietkau [Mon, 1 Aug 2022 15:57:46 +0000 (17:57 +0200)]
add support for loading signed network files

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoadd cli tool for signing network json files
Felix Fietkau [Sun, 31 Jul 2022 19:56:36 +0000 (21:56 +0200)]
add cli tool for signing network json files

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoadd ed25519 code to libunet
Felix Fietkau [Fri, 29 Jul 2022 11:14:22 +0000 (13:14 +0200)]
add ed25519 code to libunet

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobpf_skb_utils: fix skb parsing on older kernels
Felix Fietkau [Sat, 13 Aug 2022 12:55:02 +0000 (14:55 +0200)]
bpf_skb_utils: fix skb parsing on older kernels

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomss-bpf: remove unused-but-set variable
Felix Fietkau [Tue, 2 Aug 2022 19:05:49 +0000 (21:05 +0200)]
mss-bpf: remove unused-but-set variable

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoutils: free the correct addrinfo
Felix Fietkau [Tue, 2 Aug 2022 18:58:43 +0000 (20:58 +0200)]
utils: free the correct addrinfo

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoremove dummy mode
Felix Fietkau [Mon, 1 Aug 2022 05:48:39 +0000 (07:48 +0200)]
remove dummy mode

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomss-bpf: rework the code to use a common skb parser header file
Felix Fietkau [Sat, 9 Jul 2022 15:44:12 +0000 (17:44 +0200)]
mss-bpf: rework the code to use a common skb parser header file

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoutils: fix memory leak in network_get_endpoint()
Felix Fietkau [Tue, 2 Aug 2022 16:48:52 +0000 (18:48 +0200)]
utils: fix memory leak in network_get_endpoint()

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobpf: ignore errors on program attach
Felix Fietkau [Thu, 30 Jun 2022 15:40:33 +0000 (17:40 +0200)]
bpf: ignore errors on program attach

Fixes issues with old kernels, which return errors for no reason

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobuild: move some code to libunet
Felix Fietkau [Wed, 29 Jun 2022 18:35:29 +0000 (20:35 +0200)]
build: move some code to libunet

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agovxlan: add bpf program to fix up tcp mss values
Felix Fietkau [Wed, 29 Jun 2022 18:12:48 +0000 (20:12 +0200)]
vxlan: add bpf program to fix up tcp mss values

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agovxlan: fix endian of the configured port
Felix Fietkau [Tue, 28 Jun 2022 12:06:30 +0000 (14:06 +0200)]
vxlan: fix endian of the configured port

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agovxlan: add missing options
Felix Fietkau [Mon, 27 Jun 2022 15:55:15 +0000 (17:55 +0200)]
vxlan: add missing options

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoadd some documentation about the PEX protocol
Felix Fietkau [Thu, 23 Jun 2022 11:09:48 +0000 (13:09 +0200)]
add some documentation about the PEX protocol

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoexample: create wireguard and tunnel device
Felix Fietkau [Thu, 23 Jun 2022 08:46:19 +0000 (10:46 +0200)]
example: create wireguard and tunnel device

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoservice: filter out duplicate members
Felix Fietkau [Fri, 17 Jun 2022 12:26:00 +0000 (14:26 +0200)]
service: filter out duplicate members

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoservice: add vxlan tunnel support
Felix Fietkau [Wed, 15 Jun 2022 13:12:25 +0000 (15:12 +0200)]
service: add vxlan tunnel support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoservices: switch to vlist
Felix Fietkau [Tue, 31 May 2022 12:06:07 +0000 (14:06 +0200)]
services: switch to vlist

preparatation for supporting service types

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoadd missing copyright header
Felix Fietkau [Tue, 31 May 2022 10:30:14 +0000 (12:30 +0200)]
add missing copyright header

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoadd script for standalone builds
Felix Fietkau [Mon, 23 May 2022 17:57:30 +0000 (19:57 +0200)]
add script for standalone builds

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomake ubus support optional (enabled by default)
Felix Fietkau [Mon, 23 May 2022 13:04:57 +0000 (15:04 +0200)]
make ubus support optional (enabled by default)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoinitial commit
Felix Fietkau [Thu, 5 May 2022 08:49:46 +0000 (10:49 +0200)]
initial commit

Signed-off-by: Felix Fietkau <nbd@nbd.name>