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

Macros

#define NPF_UDP_SRC_PORT_MATCH(_name, _port)
 Statically define a "UDP source port match" packet filter condition.
#define NPF_UDP_DST_PORT_MATCH(_name, _port)
 Statically define a "UDP destination port match" packet filter condition.

Detailed Description

Since
4.6
Version
0.1.0

These conditions are for the rules of npf_local_in_recv_rules. They rely on what the IP input stores in a packet while it processes the IP headers, so their result is not defined in the other rule lists.

Macro Definition Documentation

◆ NPF_UDP_DST_PORT_MATCH

#define NPF_UDP_DST_PORT_MATCH ( _name,
_port )

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_port _name = { \
.proto = NET_IPPROTO_UDP, \
.port = net_htons(_port), \
.test.fn = npf_dst_port_match, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "udp dst port", \
.test.type = NPF_TEST_TYPE_UDP_DST_PORT_MATCH,)) \
}
#define net_htons(x)
Convert 16-bit value from host to network byte order.
Definition net_ip.h:125
@ NET_IPPROTO_UDP
UDP protocol.
Definition net_ip.h:71

Statically define a "UDP destination port match" packet filter condition.

This tests if the packet is a UDP datagram with the given destination port.

Parameters
_nameName of the condition
_portDestination port to match

◆ NPF_UDP_SRC_PORT_MATCH

#define NPF_UDP_SRC_PORT_MATCH ( _name,
_port )

#include <zephyr/net/net_pkt_filter.h>

Value:
struct npf_test_port _name = { \
.proto = NET_IPPROTO_UDP, \
.port = net_htons(_port), \
.test.fn = npf_src_port_match, \
IF_ENABLED(NPF_TEST_ENABLE_NAME, \
(.test.name = "udp src port", \
.test.type = NPF_TEST_TYPE_UDP_SRC_PORT_MATCH,)) \
}

Statically define a "UDP source port match" packet filter condition.

This tests if the packet is a UDP datagram with the given source port.

Parameters
_nameName of the condition
_portSource port to match