Commit graph

14 commits

Author SHA1 Message Date
bunnie
8d30c5bfc5 format services/net 2024-01-14 22:31:48 +08:00
bunnie
5e411f3562 clean up warnings, fix icmp init 2023-09-29 06:36:27 +08:00
bunnie
f815ed85b5 fix rust 1.64.0 rkyv warning regressions on unused enum types
rkyv-derived enums throw warnings that they are unused.
Not sure how to get rid of them; I've tried surrounding them in
`#[allow(dead_code)]` directives, and also explicitly creating
each enum variant that I'm aware of through some dummy code and
some log prints of the dummy code calls to ensure the results are
used, and the warnings still persist.

Significantly, the warnings only happen for enums that take
a value. Simple rkyv enums do not throw a warning.

These warnings overwhelm the build logs, so they need to be isolated
in order for us to ensure that the build is clean of other more
important warnings.

The method chosen to isolate them is to take the enums that are
problematic, carve them into their own special file, and add
a file-wide `#![allow(dead_code)]` directive. This only happens
in 7 service crates, and this change commits all of the modifications
in a single big commit that could be undone later if this turns out
to be a compiler regression or something similar.

I also opened an issue with the rkyv maintainer to see what his
opinion is on the situation.

https://github.com/rkyv/rkyv/issues/318
2022-10-09 17:17:20 +08:00
bunnie
b7adbcff52 remove no longer used UDP API stubs 2022-04-05 18:43:16 +08:00
bunnie
925d53f646 TCP listener is "working"
Good enough so that if you type `net server` and you hit the IP
address of the device, it'll respond with something like

Hello from Precursor!
I have been up for 86087 ms.

There's still all kinds of bugs, I'm sure. But ... I'm also not
sure /why/ you would want a web server on Precursor. This is more
just to make sure that the TCP stack isn't totally broken.

The "web server" as it may be is quite broken and doesn't parse
any headers and probably sends a bogus amount of data because
I can't figure out if the content length includes some new lines
or not. But really, this just isn't in scope. Works with Chrome,
Firefox shows the status page and then says "connection reset" and hides
all the information. Whatever, browser compatibility is well beyond
my pay grade!
2022-02-01 18:54:07 +08:00
bunnie
4690075c40 clean build, but...much testing to do. 2022-01-31 04:03:31 +08:00
bunnie
9b1c5e3f0c checkpoint to try something else 2022-01-30 15:30:21 +08:00
bunnie
2b7e428340 checkpoint, need to fix something else 2022-01-29 16:09:59 +08:00
bunnie
8592224af2 checkpoint partial TCP progress
server-side impl done, inter-crate API half-complete, now working on lib
2022-01-29 00:57:36 +08:00
bunnie
72ffee7f13 cleanup of debug chatter, clarify some comments 2021-10-28 05:12:03 +08:00
bunnie
765519ff32 major refactor of ping implementation
- moved most ping state into the Net crate proper, since the smoltcp
implementation assumes a tightly bound set of objects and lifetimes
in its icmp abstraction

- created various convenience abstractions for handling single and
multiple pings, blocking and non-blocking.

- refactored the "net" command to use the new form

Initial testing indicates there are still some bugs (seems to be
with the way we are handling timestamping and doing pong retirement)
but at least we're not getting tons of async callback errors like
we were before, and we're not shuttling obscene amounts of state
using Arc-Mutex between the input and output of the ping operations.
2021-10-27 04:38:09 +08:00
bunnie
f1fe850820 ping was surprisingly hard.
not fully working yet, but the architecture is there and it builds.
smoltcp's ping implementation (or at least its demo code) was not
very amenable to splitting into modules, had to recode most of it.

the ipv6 is still a hack.
2021-10-21 06:28:11 +08:00
bunnie
0cbca7fbe1 add UDP send and test routines 2021-10-19 01:41:22 +08:00
bunnie
84a8bf05f8 re-org api so each protocol has its own file 2021-10-18 17:33:20 +08:00