ProtoCore v0.0.2
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
rawl2.h File Reference

Raw Layer-2 Ethernet frame codec (PC_ENABLE_RAWL2). More...

#include "protocore_config.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

Raw Layer-2 Ethernet frame codec (PC_ENABLE_RAWL2).

The host-testable core of raw-L2 frame TX/RX: build and parse Ethernet II frames (and 802.1Q VLAN-tagged frames) so the app can inject/receive arbitrary L2 frames - the basis for the raw-L2 industrial protocols (PROFINET DCP, IEC 61850 GOOSE, POWERLINK, SERCOS) and for custom management / proprietary MAC framing. On device the bytes go out through the vendor L2 transmit path (wired or Wi-Fi); the MAC normally appends the FCS, so the builder emits the frame without it and pc_eth_fcs is provided for the cases that need it.

Ethernet II: [dst MAC 6][src MAC 6][ethertype 2][payload] 802.1Q: [dst 6][src 6][0x8100][TCI 2][ethertype 2][payload]

Pure, zero heap, no stdlib, host-testable.

Definition in file rawl2.h.