|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Ethernet filter description. More...
#include <zephyr/net/ethernet.h>
Data Fields | |
| enum ethernet_filter_type | type |
| Type of filter. | |
| struct net_eth_addr | mac_address |
| MAC address to filter. | |
| bool | set |
| Set (true) or unset (false) the filter. | |
Ethernet filter description.
The Ethernet L2 keeps track of the multicast addresses that the upper layers have joined, so a driver is told to set a given address only when the first user joins the group and to unset it only when the last user leaves. A driver therefore does not need to count how many times an address was registered.
A driver may also treat the request as a hint that the set of multicast addresses changed and reprogram its receive filter from scratch by iterating the addresses with net_eth_mcast_addr_foreach(). This is the preferred approach for devices that filter by a hash of the address, as such a device cannot tell from a single address whether some other address still needs the same hash bucket.
The multicast destination addresses given to NET_REQUEST_ETHERNET_SET_MAC_FILTER share the same accounting, so the guarantee holds for them too. Source addresses and unicast destination addresses are not tracked and are passed to the driver as they are.
The number of multicast addresses an interface can track is limited, so joining a group fails with -ENOMEM once the interface is out of room, and unsetting a multicast address that was never set fails with -ENOENT.
| struct net_eth_addr ethernet_filter::mac_address |
MAC address to filter.
| bool ethernet_filter::set |
Set (true) or unset (false) the filter.
| enum ethernet_filter_type ethernet_filter::type |
Type of filter.