net: introduce a network packet filter framework
This provides the infrastructure to create network packet filter rules and to apply them to the RX and TX packet paths. Rules are made of simple condition tests that can be linked together, creating a facility similarly to the Linux iptables functionality. A couple of generic and Ethernet-specific condition tests are also provided. Additional tests can be easily created on top of this. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
parent
44585b7fc5
commit
faa0b2a848
17 changed files with 1186 additions and 1 deletions
|
@ -333,6 +333,12 @@ void net_process_tx_packet(struct net_pkt *pkt)
|
|||
|
||||
void net_if_queue_tx(struct net_if *iface, struct net_pkt *pkt)
|
||||
{
|
||||
if (!net_pkt_filter_send_ok(pkt)) {
|
||||
/* silently drop the packet */
|
||||
net_pkt_unref(pkt);
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t prio = net_pkt_priority(pkt);
|
||||
uint8_t tc = net_tx_priority2tc(prio);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue