From: Eric Leblond Date: Mon, 4 Mar 2019 21:37:50 +0000 (+0100) Subject: util-ebpf: simplify function declarations X-Git-Tag: suricata-5.0.0-rc1~359 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36c6a62954858e0ccb04c381ace018e17f6cd5d9;p=thirdparty%2Fsuricata.git util-ebpf: simplify function declarations --- 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);