Commit graph

877 commits

Author SHA1 Message Date
bunnie
2962d4ffc3 add a wifi retry to the oqc test 2021-10-29 05:25:40 +08:00
bunnie
060aa4fee2 remove a warning that crept in 2021-10-28 18:50:07 +08:00
bunnie
db454603ee improve resilience to ping flood attack
much better, but still eventually the stack can fall over eventually.
also, the stack doesn't behave well when you try to initiate new
commands in the middle of a flood, because the back-pressure mechanisms
are primarily in-stack at the moment.

I think i have an idea on how to fix that but this will have to be later.
2021-10-28 18:38:02 +08:00
bunnie
81edf6a9c0 fix net ping description and help info 2021-10-28 18:37:48 +08:00
bunnie
72ffee7f13 cleanup of debug chatter, clarify some comments 2021-10-28 05:12:03 +08:00
bunnie
10a333eace parse raw IP addresses when passed to the DNS lookup 2021-10-28 05:11:22 +08:00
bunnie
2c7a35a36c fix various bugs in ping. behaves much more "as expected" now. 2021-10-28 04:30:44 +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
3a4bbdd71a fix permissions. windows likes to make all files executable! world writeable! 2021-10-23 18:37:39 +08:00
bunnie
dc527a3619 Rust 1.56 results in a bigger loader. Presumably because "optimization".
This causes the font maps to shift down. Allocate some "room to grow"
as Rust gets more "optimal".
2021-10-23 18:36:31 +08:00
bunnie
7de925d3f1 add maintenance notes around the fix for https://github.com/rust-lang/rust/issues/90195 2021-10-23 17:50:33 +08:00
bunnie
c245e78255 Merge remote-tracking branch 'origin/main' into bunnie-dev 2021-10-23 17:45:24 +08:00
Sean Cross
adccb61e43 services: llio: work around rkyv bug in rust 1.56
A bug in the type system appeared that prevents using constants in rkyv
arrays. Hardcode the value instead.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-10-23 17:25:41 +08:00
bunnie
ec538025a8 changes to bring us up to date with rust 1.56. still not building. 2021-10-23 17:08:48 +08:00
bunnie
daebf17a5e Merge branch 'bunnie-dev' into main
Probably about time to push some of this net stuff into main, even
though it's got a ways to go. This adds UDP/ICMP/DNS to the net stack,
but the ping probably needs to be refactored a bit to be *much simpler*
and more reliable, and there's some corner cases to chase.
2021-10-22 04:10:33 +08:00
bunnie
f53c57ba3f fix up a number of issues in ping
Now that I understand how smoltcp does ping better I have regrets.
The demo example in smoltcp uses a funky macro that was a bit
misleading. I have gotten rid of that but I probably would have made
different decisions in implementing this had I understood the API better.

Anyways. It works, but has some trouble handling the cases of timeouts
sometimes.
2021-10-22 04:08:43 +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
3d1c216706 make interrupt events a try_send type, so they don't cause deadlock
this will help mitigate interrupt storms, e.g. if someone tries a
ping flood attack.
2021-10-21 00:03:08 +08:00
bunnie
cee4e83746 add a DNS parser. that was fun. :-|
yes, i know there is some fancy way to code this with iterators.
i don't like that way. this ways is easier for me to understand
and verify. It works now.

Sometimes, Rust sucks a bit. It's ok, you can cry.
2021-10-20 20:06:08 +08:00
bunnie
1a77f0afae add formatter for net crate ip address 2021-10-20 14:10:31 +08:00
bunnie
643e9a7d62 dns. needs more work, but it is at least minimally functional. 2021-10-20 05:18:54 +08:00
bunnie
60b0e3df87 handle the expected error from the disconnect call
When disconnecting from a remote server that was destroyed, we
would expect (and get) a ServerNotFound error.
2021-10-19 15:01:36 +08:00
bunnie
2885890ee2 fix typo 2021-10-19 05:06:05 +08:00
bunnie
afeae79d45 add quit opcode to Net 2021-10-19 05:02:00 +08:00
bunnie
ab3e05764e add some status and help message embellishments 2021-10-19 04:43:55 +08:00
bunnie
40771fbba7 flesh out UDP API...as much as we can
Multicast/Broadcast is not supported by smoltcp it seems, so those
calls are just unimplemented. But we are able to clone UdpSocket,
for the sick puppies who like to do that sort of thing.
2021-10-19 04:42:06 +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
bunnie
98bbe848fc cleanup Udp Bind API
version for Xous internal use, and a version for integration into libstd.
2021-10-18 17:04:16 +08:00
bunnie
a8c6e8047f simple end-to-end demo of receiving UDP packets asynchronously 2021-10-18 05:55:42 +08:00
bunnie
e6643e725d implement UDP rx 2021-10-18 04:02:55 +08:00
bunnie
3cf1cbaeb6 add visible warnings around COM timeouts 2021-10-17 21:43:39 +08:00
bunnie
4a2445483d scoping. I heard that's a thing in Rust. 2021-10-17 16:47:08 +08:00
bunnie
a7d8a4c1e0 clear ARP cache on DHCP renew (AP change edge case) 2021-10-17 15:29:45 +08:00
bunnie
665d7d7713 only update net config if it's changed since the last renewal 2021-10-16 00:15:23 +08:00
bunnie
f1296d0dfd convert route table to use heap not static memory, since we have heap 2021-10-15 15:44:16 +08:00
bunnie
da8987e531 restore power management 2021-10-13 02:10:18 +08:00
bunnie
ef70daf7bb fix hosted mode build config 2021-10-13 02:07:55 +08:00
bunnie
df9bdce6dc fix some cosmetic issues 2021-10-13 02:03:12 +08:00
bunnie
ec34b01bd9 pings working with smoltcp (can originate and respond) 2021-10-13 01:57:00 +08:00
bunnie
b93109cad2 cleaning up net event loop, still figuring out APIs and integration
currently there is some issue with ARPs not sure where it's breaking,
suspect issue on EC side...
2021-10-11 05:21:01 +08:00
bunnie
26069c023a intermediate commit trying to trace down how this receive process works. 2021-10-10 21:12:09 +08:00
bunnie
e06d946bcd simplify error handling code
confirmed that ignoring the error on a write is probably what we want --
it will truncate the string
2021-10-10 20:55:54 +08:00
bunnie
5fa8f2a6a3 discard errors on log write
this at least removes a panic that crashes processes. it does
mean that some log messages can get silently lost, but this is
better than crashing if the arguments to the logger can't be
parsed for some reason?
2021-10-10 18:32:00 +08:00
bunnie
7a724a15cf fix permissions 2021-10-10 02:26:31 +08:00
bunnie
61e21cce19 would be helpful to add the devices.rs file 2021-10-10 02:26:15 +08:00
bunnie
c8decc85c2 std::time doesn't exist, make a wrapper around Ticktimer for smoltcp 2021-10-10 02:20:01 +08:00
bunnie
74a3c6df44 disastrous first draft of figuring out how to integrate smoltcp using a ping example. 2021-10-10 01:57:31 +08:00
bunnie
560c6e4197 something packet-oid is coming out of the serial port now? 2021-10-09 02:12:12 +08:00
bunnie
b43eb56346 add some skeleton for a net crate; testing COM interrupts 2021-10-08 20:01:13 +08:00