]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
example/plugin: Use ThreadId
authorJeff Lucovsky <jlucovsky@oisf.net>
Sun, 7 Jan 2024 14:34:45 +0000 (09:34 -0500)
committerVictor Julien <victor@inliniac.net>
Sat, 16 Mar 2024 08:29:34 +0000 (09:29 +0100)
examples/plugins/c-json-filetype/filetype.c

index 9c81d7f0326767176d4586744ecc198f2a195a2a..cf8ca64d28b9f52a56a4ae9c47a65d4f03ff6bcb 100644 (file)
@@ -22,7 +22,7 @@
 
 #define FILETYPE_NAME "json-filetype-plugin"
 
-static int FiletypeThreadInit(void *ctx, int thread_id, void **thread_data);
+static int FiletypeThreadInit(void *ctx, ThreadId thread_id, void **thread_data);
 static int FiletypeThreadDeinit(void *ctx, void *thread_data);
 
 /**
@@ -30,7 +30,7 @@ static int FiletypeThreadDeinit(void *ctx, void *thread_data);
  */
 typedef struct ThreadData_ {
     /** The thread ID, for demonstration purposes only. */
-    int thread_id;
+    ThreadId thread_id;
 
     /** The number of records logged on this thread. */
     uint64_t count;
@@ -143,7 +143,7 @@ static void FiletypeDeinit(void *data)
  * Suricata, but instead this plugin chooses to use this method to create a
  * default (single) thread context.
  */
-static int FiletypeThreadInit(void *ctx, int thread_id, void **thread_data)
+static int FiletypeThreadInit(void *ctx, ThreadId thread_id, void **thread_data)
 {
     ThreadData *tdata = SCCalloc(1, sizeof(ThreadData));
     if (tdata == NULL) {