From 36c6a62954858e0ccb04c381ace018e17f6cd5d9 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Mon, 4 Mar 2019 22:37:50 +0100 Subject: [PATCH] util-ebpf: simplify function declarations --- src/util-ebpf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util-ebpf.c b/src/util-ebpf.c index 431aceea51..31685b8fb9 100644 --- a/src/util-ebpf.c +++ b/src/util-ebpf.c @@ -516,6 +516,10 @@ static int EBPFUpdateFlowForKey(struct flows_stats *flowstats, FlowKey *flow_key } } +typedef int (*OpFlowForKey)(struct flows_stats *flowstats, FlowKey *flow_key, + uint32_t hash, struct timespec *ctime, + uint64_t pkts_cnt, uint64_t bytes_cnt); + /** * Bypassed flows cleaning for IPv4 * @@ -526,7 +530,7 @@ static int EBPFForEachFlowV4Table(LiveDevice *dev, const char *name, struct flows_stats *flowstats, struct timespec *ctime, struct ebpf_timeout_config *tcfg, - int (*EBPFOpFlowForKey)(struct flows_stats *flowstats, FlowKey *flow_key, uint32_t hash, struct timespec *ctime, uint64_t pkts_cnt, uint64_t bytes_cnt) + OpFlowForKey EBPFOpFlowForKey ) { int mapfd = EBPFGetMapFDByName(dev->dev, name); @@ -614,7 +618,7 @@ static int EBPFForEachFlowV6Table(LiveDevice *dev, const char *name, struct flows_stats *flowstats, struct timespec *ctime, struct ebpf_timeout_config *tcfg, - int (*EBPFOpFlowForKey)(struct flows_stats *flowstats, FlowKey *flow_key, uint32_t hash, struct timespec *ctime, uint64_t pkts_cnt, uint64_t bytes_cnt) + OpFlowForKey EBPFOpFlowForKey ) { int mapfd = EBPFGetMapFDByName(dev->dev, name);