ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
<re_irc> <firefrommoonlight> Ie, is it useful?
<re_irc> <firefrommoonlight> Trying to get a grasp on this stuff, ie when to use this, vice the STM32 register interface, vs smoltcp
<re_irc> <dirbaio> it's just a C "trait"
<re_irc> <firefrommoonlight> (Smoltcp looks quite interesting btw, and even though it has TCP in the name, the docs clearly imply it can go lower level than that)
<re_irc> <firefrommoonlight> Also of note, I'm dissapointed to find that there's no good low-level networking lib in Rust
<re_irc> <dirbaio> a header file that specifies an API
<re_irc> <dirbaio> dunno if there are impls of it
<re_irc> <firefrommoonlight> Have to use scapy in Python instead since there's nothing in Rust on that level. See also Django
<re_irc> <firefrommoonlight> Oh gotcha! The EH comparison makes sense. so, pass!
<re_irc> <dirbaio> by "low level" you mean for parsing/forging arbitrary packets?
<re_irc> <dirbaio> it's quite rare to need that
<re_irc> <firefrommoonlight> *Re scapy and low-level networking Rust lib. I need to clarify; for desktop that is
<re_irc> <firefrommoonlight> Yes, correct
<re_irc> <firefrommoonlight> The "socket2" lib looks like it might be able to, but I can't tell since its docs and examples are sparse
<re_irc> <firefrommoonlight> While scapy is very well documented
<re_irc> <firefrommoonlight> So, I gather smoltcp can do it on MCUs, and maybe with some work socket2 for desktops, but on desktops at least, scapy seems leaps and bounds ahead
<re_irc> <dirbaio> smoltcp's "wire" module can do it (it focuses on the features smoltcp needs though, instead of aiming to support every protocol and feature)
<re_irc> <dirbaio> you can use it on desktops with the tuntap phy. check the examples, they all do that
<re_irc> <dirbaio> what do you want to do exactly?
<re_irc> <firefrommoonlight> oh neat!
<re_irc> <firefrommoonlight> Send and receive arbitrary packets. IP spoofing. Mac spoofing. Port scanning and host discovery
<re_irc> <firefrommoonlight> "Hello world" will be a syn scan
<re_irc> <dirbaio> huh so lowlevel indeed:D
<re_irc> <dirbaio> * indeed :D
<re_irc> <firefrommoonlight> I had some code typed up with std::net, and tokio::net, before realizing they don't let you do anything at the level of TCP header or below
<re_irc> <dirbaio> you can probably do it with smoltcp "wire" + tuntap, yes
<re_irc> <dirbaio> but if you don't need max performance, scapy will be easier I guess
<re_irc> <firefrommoonlight> bonus of working on MCUs too!
<re_irc> <dirbaio> lol
<re_irc> <firefrommoonlight> I'm typing up an stm32h7 ethernet lib too
<re_irc> <dirbaio> portscan-in-a-dongle
<re_irc> <firefrommoonlight> Going to start from the RM, then compare to stm32h7xx hal
<re_irc> <firefrommoonlight> exactly!
<re_irc> <firefrommoonlight> *Mainly thought to look at MCUs when I realized the OS was getting in the way on desktop lol
starblue has quit [Ping timeout: 276 seconds]
starblue has joined #rust-embedded
emerent has quit [Ping timeout: 258 seconds]
emerent has joined #rust-embedded
<re_irc> <Lachlan> I was about to say that std::net has udp sockets, but it turns out tcp isn’t built on top of udp. Always thought it was
<re_irc> <firefrommoonlight> Yep! They're at the same layer
<re_irc> <firefrommoonlight> And of note, whenever you use "std::net" for TCP, it makes the full handshake for you... Useful for most practical means, but not great for building a hacking toolbox
<re_irc> <Lachlan> Yeah, std::net just uses the networking support provided by the platform
bjc has left #rust-embedded [ERC 5.4 (IRC client for GNU Emacs 28.1)]
<re_irc> <firefrommoonlight> Got scapy working... It really does make quick work of this sort of thing. The API's a bit... loose, compared to what you might write in Rust. let's just say there will be lots of runtime trial-and-error
dc740 has joined #rust-embedded
aspe has joined #rust-embedded
explore has joined #rust-embedded
<re_irc> <nihal.pasham> got a new m1 mac (finally), tried installing the "arm-toolchain" but I guess its not the right one.
<re_irc> Would anyone happen to know how to get the right toolchain.
<re_irc> brew install armmbed/formulae/arm-none-eabi-gcc
<re_irc> ==> Auto-updated Homebrew!
<re_irc> <9names (@9names:matrix.org)> if you aren't keen on building it yourself, there is a prebuilt xpack toolchain for macos arm64.
<re_irc> you can install them via xpm (see this gist (https://gist.github.com/mandrean/0194f6a05727161db74da1d6fffc075b)), or just download them from github (https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/tag/v10.3.1-2.3), (grab the darwin-arm64 one), extract it, and add it to your path.
<re_irc> <nihal.pasham> thanks, just found the first link. can confirm it works
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
explore has quit [Quit: Connection closed for inactivity]
causal has joined #rust-embedded
aspe has quit [Quit: aspe]
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
dequbed has quit [Quit: bye!]
dequbed has joined #rust-embedded
Rahix has quit [Quit: ZNC - https://znc.in]
Rahix has joined #rust-embedded
dc740 has quit [Remote host closed the connection]