Project

General

Profile

Actions

Bug #1641

closed

Suricata won't build with --disable-unix-socket when libjansson is enabled

Added by Andreas Herz about 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Low
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

I could reproduce the following issue with 3.0RC2 on archlinux, debian, centos7.

As soon as libjansson support is set to yes and ./configure with --disable-unix-socket the build process will end here:

  CC       output-json-alert.o
In file included from output-json-alert.c:54:0:
output-json.h:35:23: error: unknown type name ‘json_t’
 void CreateJSONFlowId(json_t *js, const Flow *f);
                       ^
output-json.h:36:34: error: unknown type name ‘json_t’
 void JsonTcpFlags(uint8_t flags, json_t *js);
                                  ^
output-json.h:37:1: error: unknown type name ‘json_t’
 json_t *CreateJSONHeader(Packet *p, int direction_sensative, char *event_type);
 ^
output-json.h:38:1: error: unknown type name ‘json_t’
 json_t *CreateJSONHeaderWithTxId(Packet *p, int direction_sensitive, char *event_type, uint32_t tx_id);
 ^
output-json.h:39:20: error: unknown type name ‘json_t’
 TmEcode OutputJSON(json_t *js, void *data, uint64_t *count);
                    ^
output-json.h:40:22: error: unknown type name ‘json_t’
 int OutputJSONBuffer(json_t *js, LogFileCtx *file_ctx, MemBuffer *buffer);
                      ^
In file included from output-json-alert.c:55:0:
output-json-http.h:30:27: error: unknown type name ‘json_t’
 void JsonHttpLogJSONBasic(json_t *js, htp_tx_t *tx);
                           ^
output-json-http.h:31:30: error: unknown type name ‘json_t’
 void JsonHttpLogJSONExtended(json_t *js, htp_tx_t *tx);
                              ^
output-json-http.h:32:1: error: unknown type name ‘json_t’
 json_t *JsonHttpAddMetadata(const Flow *f, uint64_t tx_id);
 ^
In file included from output-json-alert.c:56:0:
output-json-tls.h:32:26: error: unknown type name ‘json_t’
 void JsonTlsLogJSONBasic(json_t *js, SSLState *ssl_state);
                          ^
output-json-tls.h:33:29: error: unknown type name ‘json_t’
 void JsonTlsLogJSONExtended(json_t *js, SSLState *ssl_state);
                             ^
In file included from output-json-alert.c:57:0:
output-json-ssh.h:32:21: error: unknown type name ‘json_t’
 void JsonSshLogJSON(json_t *js, SshState *tx);
                     ^
In file included from output-json-alert.c:58:0:
output-json-smtp.h:29:1: error: unknown type name ‘json_t’
 json_t *JsonSMTPAddMetadata(const Flow *f, uint64_t tx_id);
 ^
In file included from output-json-alert.c:59:0:
output-json-email-common.h:40:51: error: unknown type name ‘json_t’
 TmEcode JsonEmailLogJson(JsonEmailLogThread *aft, json_t *js, const Packet *p, Flow *f, void *state, void *vtx, uint64_t tx_id);
                                                   ^
In file included from output-json-alert.c:59:0:
output-json-email-common.h:41:1: error: unknown type name ‘json_t’
 json_t *JsonEmailAddMetadata(const Flow *f, uint32_t tx_id);
 ^
output-json-alert.c:107:41: error: unknown type name ‘json_t’
 static void AlertJsonTls(const Flow *f, json_t *js)
                                         ^
output-json-alert.c:124:41: error: unknown type name ‘json_t’
 static void AlertJsonSsh(const Flow *f, json_t *js)
                                         ^
output-json-alert.c:140:62: error: unknown type name ‘json_t’
 void AlertJsonHeader(const Packet *p, const PacketAlert *pa, json_t *js)
                                                              ^
output-json-alert.c: In function ‘AlertJson’:
output-json-alert.c:181:5: error: unknown type name ‘json_t’
     json_t *hjs = NULL;
     ^
output-json-alert.c:188:5: error: unknown type name ‘json_t’
     json_t *js = CreateJSONHeader((Packet *)p, 0, "alert");
     ^
output-json-alert.c:201:9: error: implicit declaration of function ‘AlertJsonHeader’ [-Werror=implicit-function-declaration]
         AlertJsonHeader(p, pa, js);
         ^
output-json-alert.c:212:25: error: implicit declaration of function ‘json_object_set_new’ [-Werror=implicit-function-declaration]
                         json_object_set_new(js, "http", hjs);
                         ^
output-json-alert.c:226:21: error: implicit declaration of function ‘AlertJsonTls’ [-Werror=implicit-function-declaration]
                     AlertJsonTls(p->flow, js);
                     ^
output-json-alert.c:239:21: error: implicit declaration of function ‘AlertJsonSsh’ [-Werror=implicit-function-declaration]
                     AlertJsonSsh(p->flow, js);
                     ^
output-json-alert.c:299:56: error: implicit declaration of function ‘json_string’ [-Werror=implicit-function-declaration]
                     json_object_set_new(js, "payload", json_string((char *)encoded));
                                                        ^
output-json-alert.c:330:47: error: implicit declaration of function ‘json_integer’ [-Werror=implicit-function-declaration]
             json_object_set_new(js, "stream", json_integer(stream));
                                               ^
output-json-alert.c:364:25: error: implicit declaration of function ‘json_object_set’ [-Werror=implicit-function-declaration]
                         json_object_set(js, "dest_ip", json_string(buffer));
                         ^
output-json-alert.c:372:9: error: implicit declaration of function ‘OutputJSONBuffer’ [-Werror=implicit-function-declaration]
         OutputJSONBuffer(js, aft->file_ctx, aft->json_buffer);
         ^
output-json-alert.c:373:9: error: implicit declaration of function ‘json_object_del’ [-Werror=implicit-function-declaration]
         json_object_del(js, "alert");
         ^
output-json-alert.c:375:5: error: implicit declaration of function ‘json_object_clear’ [-Werror=implicit-function-declaration]
     json_object_clear(js);
     ^
output-json-alert.c:376:5: error: implicit declaration of function ‘json_decref’ [-Werror=implicit-function-declaration]
     json_decref(js);
     ^
output-json-alert.c: In function ‘AlertJsonDecoderEvent’:
output-json-alert.c:386:5: error: unknown type name ‘json_t’
     json_t *js;
     ^
output-json-alert.c:411:14: error: implicit declaration of function ‘json_object’ [-Werror=implicit-function-declaration]
         js = json_object();
              ^
output-json-alert.c:411:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
         js = json_object();
            ^
output-json-alert.c:415:9: error: unknown type name ‘json_t’
         json_t *ajs = json_object();
         ^
output-json-alert.c:415:23: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
         json_t *ajs = json_object();
                       ^
cc1: some warnings being treated as errors
Makefile:1503: recipe for target 'output-json-alert.o' failed

Actions #1

Updated by Andreas Herz about 9 years ago

  • Target version changed from 3.0RC2 to 70
Actions #2

Updated by Victor Julien about 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Andreas Herz
  • Priority changed from Normal to Low
Actions #3

Updated by Andreas Herz almost 9 years ago

Adding

#include <jansson.h>

after
#ifdef HAVE_LIBJANSSON

At several output-json files and util-debug.c would fix this, does anyone else have a better idea or any reason why not to extend the includes?

Actions #4

Updated by Victor Julien almost 9 years ago

Seems to make sense :)

Actions #6

Updated by Victor Julien almost 9 years ago

  • Target version changed from 70 to 3.0.1RC1
Actions

Also available in: Atom PDF