|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Macros | |
| #define | NPF_TCP_SRC_PORT_MATCH(_name, _port) |
| Statically define a "TCP source port match" packet filter condition. | |
| #define | NPF_TCP_DST_PORT_MATCH(_name, _port) |
| Statically define a "TCP destination port match" packet filter condition. | |
| #define | NPF_TCP_FLAGS_MATCH(_name, _mask, _flags) |
| Statically define a "TCP flags match" packet filter condition. | |
TCP header flags | |
Flags for the mask and the flags of NPF_TCP_FLAGS_MATCH(). | |
| #define | NPF_TCP_FLAG_FIN BIT(0) |
| No more data from the sender. | |
| #define | NPF_TCP_FLAG_SYN BIT(1) |
| Synchronize the sequence numbers. | |
| #define | NPF_TCP_FLAG_RST BIT(2) |
| Reset the connection. | |
| #define | NPF_TCP_FLAG_PSH BIT(3) |
| Push the data to the application. | |
| #define | NPF_TCP_FLAG_ACK BIT(4) |
| The acknowledgment number is valid. | |
| #define | NPF_TCP_FLAG_URG BIT(5) |
| The urgent pointer is valid. | |
| #define | NPF_TCP_FLAG_ECE BIT(6) |
| Explicit congestion notification echo. | |
| #define | NPF_TCP_FLAG_CWR BIT(7) |
| Congestion window reduced. | |
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.
| #define NPF_TCP_DST_PORT_MATCH | ( | _name, | |
| _port ) |
#include <zephyr/net/net_pkt_filter.h>
Statically define a "TCP destination port match" packet filter condition.
This tests if the packet is a TCP segment with the given destination port.
| _name | Name of the condition |
| _port | Destination port to match |
| #define NPF_TCP_FLAG_ACK BIT(4) |
#include <zephyr/net/net_pkt_filter.h>
The acknowledgment number is valid.
| #define NPF_TCP_FLAG_CWR BIT(7) |
#include <zephyr/net/net_pkt_filter.h>
Congestion window reduced.
| #define NPF_TCP_FLAG_ECE BIT(6) |
#include <zephyr/net/net_pkt_filter.h>
Explicit congestion notification echo.
| #define NPF_TCP_FLAG_FIN BIT(0) |
#include <zephyr/net/net_pkt_filter.h>
No more data from the sender.
| #define NPF_TCP_FLAG_PSH BIT(3) |
#include <zephyr/net/net_pkt_filter.h>
Push the data to the application.
| #define NPF_TCP_FLAG_RST BIT(2) |
#include <zephyr/net/net_pkt_filter.h>
Reset the connection.
| #define NPF_TCP_FLAG_SYN BIT(1) |
#include <zephyr/net/net_pkt_filter.h>
Synchronize the sequence numbers.
| #define NPF_TCP_FLAG_URG BIT(5) |
#include <zephyr/net/net_pkt_filter.h>
The urgent pointer is valid.
| #define NPF_TCP_FLAGS_MATCH | ( | _name, | |
| _mask, | |||
| _flags ) |
#include <zephyr/net/net_pkt_filter.h>
Statically define a "TCP flags match" packet filter condition.
This tests if the packet is a TCP segment in which, of the flags in _mask, exactly the ones in _flags are set. The flags that are not in _mask are not tested.
For example, the mask NPF_TCP_FLAG_SYN | NPF_TCP_FLAG_ACK with the flags NPF_TCP_FLAG_SYN matches the segment that requests a connection, but neither the answer to it nor any later segment.
| _name | Name of the condition |
| _mask | Flags to test, a combination of the NPF_TCP_FLAG values |
| _flags | Flags that have to be set, the other flags of _mask have to be clear. A flag that is not in _mask is a build error. |
| #define NPF_TCP_SRC_PORT_MATCH | ( | _name, | |
| _port ) |
#include <zephyr/net/net_pkt_filter.h>
Statically define a "TCP source port match" packet filter condition.
This tests if the packet is a TCP segment with the given source port.
| _name | Name of the condition |
| _port | Source port to match |