From 3af5e9fdba4cbff1389e507489578f81d21a5181 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 29 Feb 2024 15:15:32 +1100 Subject: icmp: Store ping socket information in flow table Currently icmp_id_map[][] stores information about ping sockets in a bespoke structure. Move the same information into new types of flow in the flow table. To match that change, replace the existing ICMP timer with a flow-based timer for expiring ping sockets. This has the advantage that we only need to scan the active flows, not all possible ids. We convert icmp_id_map[][] to point to the flow table entries, rather than containing its own information. We do still use that array for locating the right ping flows, rather than using a "flow native" form of lookup for the time being. Signed-off-by: David Gibson [sbrivio: Update id_sock description in comment to icmp_ping_new()] Signed-off-by: Stefano Brivio --- icmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'icmp.h') diff --git a/icmp.h b/icmp.h index 263101d..4f695da 100644 --- a/icmp.h +++ b/icmp.h @@ -9,12 +9,12 @@ #define ICMP_TIMER_INTERVAL 10000 /* ms */ struct ctx; +struct icmp_ping_flow; void icmp_sock_handler(const struct ctx *c, sa_family_t af, union epoll_ref ref); int icmp_tap_handler(const struct ctx *c, uint8_t pif, sa_family_t af, const void *saddr, const void *daddr, const struct pool *p, const struct timespec *now); -void icmp_timer(const struct ctx *c, const struct timespec *now); void icmp_init(void); /** -- cgit v1.2.3