]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output-json: constify API 1900/head
authorVictor Julien <victor@inliniac.net>
Tue, 1 Mar 2016 16:31:33 +0000 (17:31 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 3 Mar 2016 12:12:16 +0000 (13:12 +0100)
src/output-json.c
src/output-json.h

index 89311bdd92cf56ad0209bd5baeb03be8952a1e22..658ac473d700f927ad8c3218396230b5ac75880e 100644 (file)
@@ -175,7 +175,8 @@ void CreateJSONFlowId(json_t *js, const Flow *f)
     json_object_set_new(js, "flow_id", json_integer(addr));
 }
 
-json_t *CreateJSONHeader(Packet *p, int direction_sensitive, char *event_type)
+json_t *CreateJSONHeader(const Packet *p, int direction_sensitive,
+                         const char *event_type)
 {
     char timebuf[64];
     char srcip[46], dstip[46];
@@ -321,7 +322,8 @@ json_t *CreateJSONHeader(Packet *p, int direction_sensitive, char *event_type)
     return js;
 }
 
-json_t *CreateJSONHeaderWithTxId(Packet *p, int direction_sensitive, char *event_type, uint32_t tx_id)
+json_t *CreateJSONHeaderWithTxId(const Packet *p, int direction_sensitive,
+                                 const char *event_type, uint64_t tx_id)
 {
     json_t *js = CreateJSONHeader(p, direction_sensitive, event_type);
     if (unlikely(js == NULL))
index d6b16fd64114d4a2aeece3d468055d94399cd5ba..467062db33dbbb97669f2d49322c235264b6f53d 100644 (file)
@@ -41,8 +41,8 @@ int OutputJSONMemBufferCallback(const char *str, size_t size, void *data);
 
 void CreateJSONFlowId(json_t *js, const Flow *f);
 void JsonTcpFlags(uint8_t flags, json_t *js);
-json_t *CreateJSONHeader(Packet *p, int direction_sensative, char *event_type);
-json_t *CreateJSONHeaderWithTxId(Packet *p, int direction_sensitive, char *event_type, uint32_t tx_id);
+json_t *CreateJSONHeader(const Packet *p, int direction_sensative, const char *event_type);
+json_t *CreateJSONHeaderWithTxId(const Packet *p, int direction_sensitive, const char *event_type, uint64_t tx_id);
 TmEcode OutputJSON(json_t *js, void *data, uint64_t *count);
 int OutputJSONBuffer(json_t *js, LogFileCtx *file_ctx, MemBuffer **buffer);
 OutputCtx *OutputJsonInitCtx(ConfNode *);