NDN-DPDK
High-Speed Named Data Networking Forwarder
Loading...
Searching...
No Matches
rxmatch.h
Go to the documentation of this file.
1#ifndef NDNDPDK_ETHFACE_RXMATCH_H
2#define NDNDPDK_ETHFACE_RXMATCH_H
3
5
6#include "locator.h"
7
16
18typedef enum __rte_packed_begin EthRxMatchResult {
19 EthRxMatchResultHit = RTE_BIT32(1),
20 EthRxMatchResultGtp = RTE_BIT32(2),
22
23typedef struct EthRxMatch EthRxMatch;
24typedef EthRxMatchResult (*EthRxMatch_MatchFunc)(const EthRxMatch* match, const struct rte_mbuf* m);
26
28struct EthRxMatch {
30 uint8_t len;
31 uint8_t l2len;
32 uint8_t l3matchOff;
33 uint8_t l3matchLen;
34 uint8_t udpOff;
36};
37
39__attribute__((nonnull)) void
40EthRxMatch_Prepare(EthRxMatch* match, const EthLocator* loc);
41
46__attribute__((nonnull)) static inline EthRxMatchResult
47EthRxMatch_Match(const EthRxMatch* match, const struct rte_mbuf* m) {
48 if (m->data_len < match->len) {
49 return 0;
50 }
51 return EthRxMatch_MatchJmp[match->act](match, m);
52}
53
59__attribute__((nonnull)) EthRxMatchResult
60EthRxMatch_MatchGtpInner(const EthRxMatch* match, const struct rte_mbuf* m);
61
62#endif // NDNDPDK_ETHFACE_RXMATCH_H
struct __rte_packed_begin vlanhdr __rte_packed_end
@ EthLocator_MaxHdrLen
EthLocator derived header buffer length.
Definition locator.h:52
const EthRxMatch_MatchFunc EthRxMatch_MatchJmp[]
Definition rxmatch.c:108
EthRxMatchResultHit
fully matched
Definition rxmatch.h:19
EthRxMatchActUdp
Definition rxmatch.h:12
EthRxMatchResult EthRxMatch_MatchGtpInner(const EthRxMatch *match, const struct rte_mbuf *m)
Check GTP-U inner headers only.
Definition rxmatch.c:102
enum __rte_packed_begin EthRxMatchAct EthRxMatchAct
Definition rxmatch.h:8
EthRxMatchActVxlan
Definition rxmatch.h:13
EthRxMatchActEtherUnicast
Definition rxmatch.h:10
EthRxMatchActAlways
Definition rxmatch.h:9
EthRxMatchResultGtp
GTP-U tunnel matched.
Definition rxmatch.h:20
EthRxMatchActGtp
Definition rxmatch.h:14
void EthRxMatch_Prepare(EthRxMatch *match, const EthLocator *loc)
Prepare RX matcher from locator.
Definition rxmatch.c:118
EthRxMatchActEtherMulticast
Definition rxmatch.h:11
EthRxMatchResult(* EthRxMatch_MatchFunc)(const EthRxMatch *match, const struct rte_mbuf *m)
Definition rxmatch.h:24
enum __rte_packed_begin EthRxMatchResult EthRxMatchResult
Bit flags in EthRxMatch_Match return value.
Definition rxmatch.h:18
EthFace address information.
Definition locator.h:10
EthFace RX matcher.
Definition rxmatch.h:28
uint8_t len
total header length
Definition rxmatch.h:30
uint8_t l3matchOff
offset of outer IPv4/IPv6 src
Definition rxmatch.h:32
EthRxMatchAct act
EthRxMatch_MatchJmp index.
Definition rxmatch.h:29
uint8_t udpOff
offset of outer UDP header
Definition rxmatch.h:34
uint8_t buf[EthLocator_MaxHdrLen]
Definition rxmatch.h:35
uint8_t l3matchLen
length of IP src+dst, plus UDP src+dst if checked
Definition rxmatch.h:33
uint8_t l2len
outer Ethernet+VLAN length
Definition rxmatch.h:31