]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode: rename ExtraDataJsonList
authorEric Leblond <el@stamus-networks.com>
Mon, 9 Jun 2025 08:14:27 +0000 (10:14 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 11 Jun 2025 18:49:18 +0000 (20:49 +0200)
src/decode.c
src/decode.h
src/detect-engine-alert.c
src/output-json-alert.c

index 164985930c015bd467746ddab2a897690d137eeb..ce8726d2a89aae4fd6d959cd0352f54190022bd3 100644 (file)
@@ -150,9 +150,9 @@ void PacketAlertRecycle(PacketAlert *pa_array)
     if (pa_array != NULL) {
         for (int i = 0; i < packet_alert_max; i++) {
             if (pa_array[i].json_info.next != NULL) {
-                struct ExtraDataJsonList *current_json = pa_array[i].json_info.next;
+                struct PacketContextData *current_json = pa_array[i].json_info.next;
                 while (current_json) {
-                    struct ExtraDataJsonList *next_json = current_json->next;
+                    struct PacketContextData *next_json = current_json->next;
                     SCFree(current_json);
                     current_json = next_json;
                 }
@@ -169,9 +169,9 @@ void PacketAlertFree(PacketAlert *pa)
         for (int i = 0; i < packet_alert_max; i++) {
             /* first item is not allocated so start at second one */
             if (pa[i].json_info.next != NULL) {
-                struct ExtraDataJsonList *allocated_json = pa[i].json_info.next;
+                struct PacketContextData *allocated_json = pa[i].json_info.next;
                 while (allocated_json) {
-                    struct ExtraDataJsonList *next_json = allocated_json->next;
+                    struct PacketContextData *next_json = allocated_json->next;
                     SCFree(allocated_json);
                     allocated_json = next_json;
                 }
index dccd3f48fcb57eedcc32efd396e4ae207794a54c..d5f8472e8b2d468adc1e358c42db56a60c4f7695 100644 (file)
@@ -238,9 +238,9 @@ typedef uint16_t Port;
 #define PKT_IS_TOSERVER(p)  (((p)->flowflags & FLOW_PKT_TOSERVER))
 #define PKT_IS_TOCLIENT(p)  (((p)->flowflags & FLOW_PKT_TOCLIENT))
 
-struct ExtraDataJsonList {
+struct PacketContextData {
     char *json_string;
-    struct ExtraDataJsonList *next;
+    struct PacketContextData *next;
 };
 
 /* structure to store the sids/gids/etc the detection engine
@@ -252,7 +252,7 @@ typedef struct PacketAlert_ {
     const struct Signature_ *s;
     uint64_t tx_id; /* Used for sorting */
     int64_t frame_id;
-    struct ExtraDataJsonList json_info;
+    struct PacketContextData json_info;
 } PacketAlert;
 
 /**
index e3d67ae3b5151f6e36a90b094bca3240695f41d5..82bdcff59da6e8d95f68046c70c90e0ad8dc6525 100644 (file)
@@ -302,12 +302,12 @@ static inline PacketAlert PacketAlertSet(
     if (det_ctx->json_content_len) {
         /* We have some JSON attached in the current detection so let's try
            to see if some need to be used for current signature. */
-        struct ExtraDataJsonList *current_json = &pa.json_info;
+        struct PacketContextData *current_json = &pa.json_info;
         for (size_t i = 0; i < det_ctx->json_content_len; i++) {
             if (s == det_ctx->json_content[i].id) {
                 if (current_json->json_string != NULL) {
-                    struct ExtraDataJsonList *next_json =
-                            SCCalloc(1, sizeof(struct ExtraDataJsonList));
+                    struct PacketContextData *next_json =
+                            SCCalloc(1, sizeof(struct PacketContextData));
                     if (next_json) {
                         current_json->next = next_json;
                         current_json = next_json;
index 597e2f99b8f8a506a3e01dbf39eccb8470496599..a89c3b075cc17cba27fc64ab6203327d8f5ade40 100644 (file)
@@ -255,7 +255,7 @@ void AlertJsonHeader(const Packet *p, const PacketAlert *pa, SCJsonBuilder *js,
 
     if (pa->json_info.json_string != NULL) {
         SCJbOpenObject(js, "context");
-        const struct ExtraDataJsonList *json_info = &pa->json_info;
+        const struct PacketContextData *json_info = &pa->json_info;
         while (json_info) {
             SCJbSetFormatted(js, json_info->json_string);
             json_info = json_info->next;