Skip to content

Conversation

ususdei
Copy link

@ususdei ususdei commented Nov 24, 2024

Hi everyone!

I'm currently working on a rust library for a protocol which runs on plain ethernet using a custom ethertype (TECMP on 0x99FE).
It also uses an additional IP-based protocol for discovery and configuration.

I would also like to use this library on some STM32, so I tried to port it from native linux sockets to the smoltcp stack.

Thus I started to implement some basic support for raw ethernet sockets.
This is still a work in progress but the basic functionality already works on an STM32F7.
It is still missing support for Metadata and the send API could be more convenient
but I would like to get this out there and gather some early feedback as to whether you would even consider merging something like this.

So just some initial questions:

  • Is this feature even in scope for the smoltcp project?
  • Do you agree with my overall design?
  • Do you already have any other initial feedback?

Thank you all for your feedback and your great contribution to the embedded rust ecosystem!

@ususdei ususdei force-pushed the ethernet_socket branch 2 times, most recently from 7b7b67f to 682e851 Compare November 24, 2024 21:03
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

❌ Patch coverage is 64.40129% with 110 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.18%. Comparing base (cfbfeae) to head (833d319).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/socket/eth.rs 66.66% 87 Missing ⚠️
src/iface/interface/mod.rs 45.00% 22 Missing ⚠️
src/socket/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1013      +/-   ##
==========================================
- Coverage   80.34%   80.18%   -0.17%     
==========================================
  Files          81       82       +1     
  Lines       24335    24627     +292     
==========================================
+ Hits        19552    19746     +194     
- Misses       4783     4881      +98     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ususdei ususdei changed the title WIP: Add new socket type for raw ethernet protocols Add new socket type for raw ethernet protocols Apr 13, 2025
@nikvoid
Copy link

nikvoid commented Jul 16, 2025

I missed this PR and made similar thing, so... +1 for raw ethernet sockets

@i404788
Copy link

i404788 commented Sep 24, 2025

We nearly did the same as @nikvoid (hey btw), +1. Also should link #942 to help the next person

@not-Ryan
Copy link

not-Ryan commented Sep 24, 2025

Something you might want to add the socket-eth feature to is the compile error on lib.rs:122

Right now I'm getting the compile error:

compile_error!("If you enable the socket feature, you must enable at least one of the following features: socket-raw, socket-udp, socket-tcp, socket-icmp, socket-dhcpv4, socket-dns");

@ususdei
Copy link
Author

ususdei commented Sep 28, 2025

It's cool to hear that others would like to use this lib in similar ways as we do.

But I'm not sure if it's really worth investing more time into polishing this PR.
There hasn't been any feedback to this in almost a year now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants