Commit graph

17 commits

Author SHA1 Message Date
Thomas Kolb 04399c0022 Fix byte order in TUN packet header
All checks were successful
/ build-hamnet70 (push) Successful in 39s
/ build-doc (push) Successful in 31s
/ deploy-doc (push) Has been skipped
2024-12-18 21:01:14 +01:00
Thomas Kolb d77f4d4498 Multiple fixes in packet handling
All checks were successful
/ build-hamnet70 (push) Successful in 33s
/ build-doc (push) Successful in 19s
/ deploy-doc (push) Has been skipped
- add and handle layer 2 packet type correctly in data packets
- don't produce garbage packets if a packet could not be decoded or was not a
  data packet
- handle beacon/connection request/connection parameters handshake
- digipeater cycle timeout does not reset beacon timer anymore. This prevented
  any beacon transmission.
- Reset the connection timeout when empty packets are received
2024-12-15 22:29:47 +01:00
Thomas Kolb 559283d87f connection: process beacons and send connection requests
Some checks failed
/ build-hamnet70 (push) Failing after 17s
/ build-doc (push) Successful in 17s
/ deploy-doc (push) Has been skipped
2024-12-12 19:44:07 +01:00
Thomas Kolb fefacc69c3 Fixed all warnings 2024-12-12 19:44:07 +01:00
Thomas Kolb a0ccf9699a layer2: Remove event callbacks
Instead, connection and digipeater now update a event code passed by reference
to the maintain() function. This was the only place where the callback was
called before.

Minor side effect: maintain must be called multiple times if multiple events
trigger at the same time.
2024-12-12 19:44:07 +01:00
Thomas Kolb 49dacffde1 digipeater: remove empty packet from current connection after burst 2024-12-12 19:44:07 +01:00
Thomas Kolb f376bd7db3 Remove data callbacks in connection and digipeater modules 2024-12-12 19:44:07 +01:00
Thomas Kolb e4961bf519 WIP: handle packets from the TUN device in digipeater
This is only a backup commit.
2024-12-12 19:44:07 +01:00
Thomas Kolb 774f5c0420 l2udptest_client: fix compilation 2024-12-12 19:44:07 +01:00
Thomas Kolb 01edbb1db1 WIP: managing multiple connections
Working towards handling multiple connections. A lot is still missing.
2024-12-12 19:44:07 +01:00
Thomas Kolb a0623668a7 Do all time calculations in uint64_t
This prevents loss of precision that occurs with double-precision floats if
timestamps become very large. Timestamps are already large if they contain a
UNIX time value (requires 60 bits; double has 53 bit resolution).
2024-12-12 19:44:07 +01:00
Thomas Kolb ec9e893c73 l2udptest: replace by two programs: client and digipeater
Both are identical so far, this is just an infrastructure commit.
2024-12-12 19:44:07 +01:00
Thomas Kolb 227837623c Remove empty packet from queue after burst was transmitted 2024-12-12 19:44:07 +01:00
Thomas Kolb 547a39508b Handle received packets 2024-12-12 19:44:07 +01:00
Thomas Kolb 729d61feb7 l2udp: Use the new layer2 connection module 2024-12-12 19:44:07 +01:00
Thomas Kolb 3189aac2ab Pass received packets to layer 2 processing 2024-12-12 19:44:07 +01:00
Thomas Kolb 3c7caeda1b Basic infrastructure for layer2-over-udp test 2024-12-12 19:44:07 +01:00