Teensy 4.1 - Raw ethernet frames parsing/access

Hello everyone,

I am using Teensy 4.1 development board with the native ethernet chip and an external Wiznet W5500 ethernet chip.

As the W5500 chip is concerned, I figured out that the ioLibrary allows me to access RAW ethernet frames so that I can add a security protocol like IPSec on a specific incoming packet.

The problem is that I haven't find yet a library for the native ethernet chip which to allow the same thing. I looked after QNEthernet but the documentation specificallt mentions this:
"There is support for sending and receiving raw Ethernet frames. See the EthernetFrame API, above.
This API doesn't receive any known Ethernet frame types. These include:
  1. IPv4 (0x0800)
  2. ARP (0x0806)
  3. IPv6 (0x86DD) (if enabled)"
Is anyone who has done this before? Or has a solution in mind? I mention that it is not mandatory for me to add that IPSec protocol, the use case may be for packet sniffing etc. everything which needs to have access to the raw ethernet frames in order to modify/reconstruct etc. (eventually permitting ARP requests / PINGs)

Thank you!
 
Try setting LWIP_IPV4 to 0 in lwipopts.h.

The relevant code that determines what gets sent to LWIP_HOOK_UNKNOWN_ETH_PROTOCOL (ending up in unknown_eth_protocol() in EthernetFrameClass) is in src/netif/ethernet.c:
C:
  switch (type) {
#if LWIP_IPV4 && LWIP_ARP

This will disable the IP portion of the stack and allow you to access all raw frames.
 
Last edited:
Back
Top