]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-ebpf: simplify function declarations
authorEric Leblond <eric@regit.org>
Mon, 4 Mar 2019 21:37:50 +0000 (22:37 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 18 Jun 2019 05:07:02 +0000 (07:07 +0200)
src/util-ebpf.c

index 431aceea51684e7310cb799226507e3624b18f1e..31685b8fb9455d82d93cf8d77cbac059b5541b3f 100644 (file)
@@ -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);