You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/API.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,14 +27,15 @@ struct wolfIP_ll_dev {
27
27
uint8_t mac[6]; // Device MAC address
28
28
char ifname[16]; // Interface name
29
29
uint8_t non_ethernet; // L3-only link (no Ethernet header/ARP when set)
30
-
uint32_t mtu; // Optional max frame size, defaults to LINK_MTU
30
+
uint32_t mtu; // Optional internal frame budget, defaults to LINK_MTU
31
31
int (*poll)(struct wolfIP_ll_dev *ll, void *buf, uint32_t len); // Receive function
32
32
int (*send)(struct wolfIP_ll_dev *ll, void *buf, uint32_t len); // Transmit function
33
33
};
34
34
```
35
35
wolfIP maintains an array of these descriptors sized by `WOLFIP_MAX_INTERFACES` (default `1`). Call `wolfIP_getdev_ex()` to access a specific slot; the legacy `wolfIP_getdev()` helper targets the first hardware slot (index `0` normally, or `1` when the optional loopback interface is enabled).
36
36
37
37
When `non_ethernet` is set, the interface is treated as L3-only point-to-point: the stack skips ARP/neighbor resolution, omits Ethernet headers on transmit, and expects receive buffers to begin at the IP header.
38
+
The `mtu` field still describes wolfIP's internal frame budget including Ethernet headroom, so on non-Ethernet links the payload passed to `ll->send()` is effectively capped at `mtu - ETH_HEADER_LEN` on Ethernet-enabled builds.
38
39
39
40
### IP Configuration
40
41
```c
@@ -209,6 +210,7 @@ int wolfIP_mtu_get(struct wolfIP *s, unsigned int if_idx, uint32_t *mtu);
209
210
```
210
211
Access the link-layer descriptor(s) that should be wired to hardware drivers. `_ex` returns `NULL` if `if_idx` exceeds `WOLFIP_MAX_INTERFACES`.
211
212
`wolfIP_mtu_set()` updates the effective per-interface MTU, treating `0` as the default `LINK_MTU` and clamping to `[LINK_MTU_MIN, LINK_MTU]`. `wolfIP_mtu_get()` returns the effective MTU currently used by the stack.
213
+
For `non_ethernet` devices this value remains the internal frame budget; the maximum IP bytes handed to the driver are reduced by `ETH_HEADER_LEN` when Ethernet support is compiled in.
0 commit comments