From 7a832a8a0edbdd5a705c1fe03fca0790a535ab11 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 21 May 2024 15:57:03 +1000 Subject: flow: Properly type callbacks to protocol specific handlers The flow dispatches deferred and timer handling for flows centrally, but needs to call into protocol specific code for the handling of individual flows. Currently this passes a general union flow *. It makes more sense to pass the specific relevant flow type structure. That brings the check on the flow type adjacent to casting to the union variant which it tags. Arguably, this is a slight abstraction violation since it involves the generic flow code using protocol specific types. It's already calling into protocol specific functions, so I don't think this really makes any difference. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- icmp_flow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'icmp_flow.h') diff --git a/icmp_flow.h b/icmp_flow.h index 5a2eed9..c9847ea 100644 --- a/icmp_flow.h +++ b/icmp_flow.h @@ -25,7 +25,7 @@ struct icmp_ping_flow { uint16_t id; }; -bool icmp_ping_timer(const struct ctx *c, union flow *flow, +bool icmp_ping_timer(const struct ctx *c, const struct icmp_ping_flow *pingf, const struct timespec *now); #endif /* ICMP_FLOW_H */ -- cgit v1.2.3