a45a7e9798
This implements the first steps of tracking UDP packets with the flow table rather than its own (buggy) set of port maps. Specifically we create flow table entries for datagrams received from a socket (PIF_HOST or PIF_SPLICE). When splitting datagrams from sockets into batches, we group by the flow as well as splicesrc. This may result in smaller batches, but makes things easier down the line. We can re-optimise this later if necessary. For now we don't do anything else with the flow, not even match reply packets to the same flow. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
25 lines
543 B
C
25 lines
543 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright Red Hat
|
|
* Author: David Gibson <david@gibson.dropbear.id.au>
|
|
*
|
|
* UDP flow tracking data structures
|
|
*/
|
|
#ifndef UDP_FLOW_H
|
|
#define UDP_FLOW_H
|
|
|
|
/**
|
|
* struct udp - Descriptor for a flow of UDP packets
|
|
* @f: Generic flow information
|
|
* @ts: Activity timestamp
|
|
*/
|
|
struct udp_flow {
|
|
/* Must be first element */
|
|
struct flow_common f;
|
|
|
|
time_t ts;
|
|
};
|
|
|
|
bool udp_flow_timer(const struct ctx *c, const struct udp_flow *uflow,
|
|
const struct timespec *now);
|
|
|
|
#endif /* UDP_FLOW_H */
|