Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Ethernet Filter Conditions

Macros

#define NPF_ETH_SRC_ADDR_MATCH(_name, _addr_array)
 Statically define a "source address match" packet filter condition.
 
#define NPF_ETH_SRC_ADDR_UNMATCH(_name, _addr_array)
 Statically define a "source address unmatch" packet filter condition.
 
#define NPF_ETH_DST_ADDR_MATCH(_name, _addr_array)
 Statically define a "destination address match" packet filter condition.
 
#define NPF_ETH_DST_ADDR_UNMATCH(_name, _addr_array)
 Statically define a "destination address unmatch" packet filter condition.
 
#define NPF_ETH_SRC_ADDR_MASK_MATCH(_name, _addr_array, ...)
 Statically define a "source address match with mask" packet filter condition.
 
#define NPF_ETH_DST_ADDR_MASK_MATCH(_name, _addr_array, ...)
 Statically define a "destination address match with mask" packet filter condition.
 
#define NPF_ETH_TYPE_MATCH(_name, _type)
 Statically define an "Ethernet type match" packet filter condition.
 
#define NPF_ETH_TYPE_UNMATCH(_name, _type)
 Statically define an "Ethernet type unmatch" packet filter condition.
 

Detailed Description

Macro Definition Documentation

◆ NPF_ETH_DST_ADDR_MASK_MATCH

#define NPF_ETH_DST_ADDR_MASK_MATCH (   _name,
  _addr_array,
  ... 
)

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_addr _name = { \
.addresses = (_addr_array), \
.nb_addresses = ARRAY_SIZE(_addr_array), \
.mask.addr = { __VA_ARGS__ }, \
.test.fn = npf_eth_dst_addr_match, \
}
#define ARRAY_SIZE(array)
Number of elements in the given array.
Definition: util.h:127

Statically define a "destination address match with mask" packet filter condition.

This tests if the packet destination address matches any of the Ethernet addresses contained in the provided set after applying specified mask.

Parameters
_nameName of the condition
_addr_arrayArray of struct net_eth_addr items to test against
...up to 6 mask bytes

◆ NPF_ETH_DST_ADDR_MATCH

#define NPF_ETH_DST_ADDR_MATCH (   _name,
  _addr_array 
)

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_addr _name = { \
.addresses = (_addr_array), \
.nb_addresses = ARRAY_SIZE(_addr_array), \
.test.fn = npf_eth_dst_addr_match, \
.mask.addr = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, \
}

Statically define a "destination address match" packet filter condition.

This tests if the packet destination address matches any of the Ethernet addresses contained in the provided set.

Parameters
_nameName of the condition
_addr_arrayArray of struct net_eth_addr items to test against

◆ NPF_ETH_DST_ADDR_UNMATCH

#define NPF_ETH_DST_ADDR_UNMATCH (   _name,
  _addr_array 
)

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_addr _name = { \
.addresses = (_addr_array), \
.nb_addresses = ARRAY_SIZE(_addr_array), \
.test.fn = npf_eth_dst_addr_unmatch, \
.mask.addr = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, \
}

Statically define a "destination address unmatch" packet filter condition.

This tests if the packet destination address matches none of the Ethernet addresses contained in the provided set.

Parameters
_nameName of the condition
_addr_arrayArray of struct net_eth_addr items to test against

◆ NPF_ETH_SRC_ADDR_MASK_MATCH

#define NPF_ETH_SRC_ADDR_MASK_MATCH (   _name,
  _addr_array,
  ... 
)

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_addr _name = { \
.addresses = (_addr_array), \
.nb_addresses = ARRAY_SIZE(_addr_array), \
.mask.addr = { __VA_ARGS__ }, \
.test.fn = npf_eth_src_addr_match, \
}

Statically define a "source address match with mask" packet filter condition.

This tests if the packet source address matches any of the Ethernet addresses contained in the provided set after applying specified mask.

Parameters
_nameName of the condition
_addr_arrayArray of struct net_eth_addr items to test against
...up to 6 mask bytes

◆ NPF_ETH_SRC_ADDR_MATCH

#define NPF_ETH_SRC_ADDR_MATCH (   _name,
  _addr_array 
)

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_addr _name = { \
.addresses = (_addr_array), \
.nb_addresses = ARRAY_SIZE(_addr_array), \
.test.fn = npf_eth_src_addr_match, \
.mask.addr = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, \
}

Statically define a "source address match" packet filter condition.

This tests if the packet source address matches any of the Ethernet addresses contained in the provided set.

Parameters
_nameName of the condition
_addr_arrayArray of struct net_eth_addr items to test against

◆ NPF_ETH_SRC_ADDR_UNMATCH

#define NPF_ETH_SRC_ADDR_UNMATCH (   _name,
  _addr_array 
)

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_addr _name = { \
.addresses = (_addr_array), \
.nb_addresses = ARRAY_SIZE(_addr_array), \
.test.fn = npf_eth_src_addr_unmatch, \
.mask.addr = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }, \
}

Statically define a "source address unmatch" packet filter condition.

This tests if the packet source address matches none of the Ethernet addresses contained in the provided set.

Parameters
_nameName of the condition
_addr_arrayArray of struct net_eth_addr items to test against

◆ NPF_ETH_TYPE_MATCH

#define NPF_ETH_TYPE_MATCH (   _name,
  _type 
)

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_type _name = { \
.type = htons(_type), \
.test.fn = npf_eth_type_match, \
}
#define htons(x)
Convert 16-bit value from host to network byte order.
Definition: net_ip.h:120

Statically define an "Ethernet type match" packet filter condition.

Parameters
_nameName of the condition
_typeEthernet type to match

◆ NPF_ETH_TYPE_UNMATCH

#define NPF_ETH_TYPE_UNMATCH (   _name,
  _type 
)

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_type _name = { \
.type = htons(_type), \
.test.fn = npf_eth_type_unmatch, \
}

Statically define an "Ethernet type unmatch" packet filter condition.

Parameters
_nameName of the condition
_typeEthernet type to exclude