Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

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.
#define NPF_ETH_VLAN_TYPE_MATCH(_name, _type)
 Statically define an "Ethernet VLAN header type match" packet filter condition.
#define NPF_ETH_VLAN_TYPE_UNMATCH(_name, _type)
 Statically define an "Ethernet VLAN header type unmatch" packet filter condition.

Detailed Description

Since
3.0
Version
0.8.0

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, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "eth dst mask", \
.test.type = NPF_TEST_TYPE_ETH_DST_ADDR_MASK_MATCH,)) \
}
#define ARRAY_SIZE(array)
Number of elements in the given array.
Definition util.h:106

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 }, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "eth dst", \
.test.type = NPF_TEST_TYPE_ETH_DST_ADDR_MATCH,)) \
}

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 }, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "!eth dst", \
.test.type = NPF_TEST_TYPE_ETH_DST_ADDR_UNMATCH,)) \
}

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, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "eth src mask", \
.test.type = NPF_TEST_TYPE_ETH_SRC_ADDR_MASK_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 }, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "eth src", \
.test.type = NPF_TEST_TYPE_ETH_SRC_ADDR_MATCH,)) \
}

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 }, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "!eth src", \
.test.type = NPF_TEST_TYPE_ETH_SRC_ADDR_UNMATCH,)) \
}

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 = net_htons(_type), \
.test.fn = npf_eth_type_match, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "eth type", \
.test.type = NPF_TEST_TYPE_ETH_TYPE_MATCH,)) \
}
#define net_htons(x)
Convert 16-bit value from host to network byte order.
Definition net_ip.h:125

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 = net_htons(_type), \
.test.fn = npf_eth_type_unmatch, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "!eth type", \
.test.type = NPF_TEST_TYPE_ETH_TYPE_UNMATCH,)) \
}

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

Parameters
_nameName of the condition
_typeEthernet type to exclude

◆ NPF_ETH_VLAN_TYPE_MATCH

#define NPF_ETH_VLAN_TYPE_MATCH ( _name,
_type )

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_type _name = { \
.type = net_htons(_type), \
.test.fn = npf_eth_vlan_type_match, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "eth vlan type", \
.test.type = NPF_TEST_TYPE_ETH_VLAN_TYPE_MATCH,)) \
}

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

Parameters
_nameName of the condition
_typeEthernet VLAN header type to match

◆ NPF_ETH_VLAN_TYPE_UNMATCH

#define NPF_ETH_VLAN_TYPE_UNMATCH ( _name,
_type )

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_eth_type _name = { \
.type = net_htons(_type), \
.test.fn = npf_eth_vlan_type_unmatch, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "!eth vlan type", \
.test.type = NPF_TEST_TYPE_ETH_VLAN_TYPE_UNMATCH,)) \
}

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

Parameters
_nameName of the condition
_typeEthernet VLAN header type to exclude