* 5 tuple swap forwarding mode: Swap the source and the destination of layers * 2,3,4. Swaps source and destination for MAC, IPv4/IPv6, UDP/TCP. * Parses each layer and swaps it. When the next layer doesn't match it stops. */
| 26 | * Parses each layer and swaps it. When the next layer doesn't match it stops. |
| 27 | */ |
| 28 | static bool |
| 29 | pkt_burst_5tuple_swap(struct fwd_stream *fs) |
| 30 | { |
| 31 | struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; |
| 32 | uint16_t nb_rx; |
| 33 | |
| 34 | /* |
| 35 | * Receive a burst of packets and forward them. |
| 36 | */ |
| 37 | nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst); |
| 38 | if (unlikely(nb_rx == 0)) |
| 39 | return false; |
| 40 | |
| 41 | do_5tswap(pkts_burst, nb_rx, fs); |
| 42 | |
| 43 | common_fwd_stream_transmit(fs, pkts_burst, nb_rx); |
| 44 | |
| 45 | return true; |
| 46 | } |
| 47 | |
| 48 | struct fwd_engine five_tuple_swap_fwd_engine = { |
| 49 | .fwd_mode_name = "5tswap", |
nothing calls this directly
no test coverage detected