Various compile fixes after rebase with master

pull/802/head
Victor Julien 11 years ago
parent 18458a14fb
commit 4874d5abbb

@ -38,7 +38,7 @@
#include "util-debug.h" #include "util-debug.h"
#include "util-mem.h" #include "util-mem.h"
#include "app-layer-parser.h"
#include "output.h" #include "output.h"
#include "output-dnslog.h" #include "output-dnslog.h"
#include "app-layer-dns-udp.h" #include "app-layer-dns-udp.h"
@ -212,20 +212,20 @@ static TmEcode DnsJsonIPWrapper(ThreadVars *tv, Packet *p, void *data,
/* check if we have DNS state or not */ /* check if we have DNS state or not */
FLOWLOCK_WRLOCK(p->flow); /* WRITE lock before we updated flow logged id */ FLOWLOCK_WRLOCK(p->flow); /* WRITE lock before we updated flow logged id */
uint16_t proto = AppLayerGetProtoFromPacket(p); uint16_t proto = FlowGetAppProtocol(p->flow);
if (proto != ALPROTO_DNS_UDP && proto != ALPROTO_DNS_TCP) { if (proto != ALPROTO_DNS) {
SCLogDebug("proto not ALPROTO_DNS_UDP: %u", proto); SCLogDebug("proto not ALPROTO_DNS: %u", proto);
goto end; goto end;
} }
DNSState *dns_state = (DNSState *)AppLayerGetProtoStateFromPacket(p); DNSState *dns_state = (DNSState *)FlowGetAppState(p->flow);
if (dns_state == NULL) { if (dns_state == NULL) {
SCLogDebug("no dns state, so no request logging"); SCLogDebug("no dns state, so no request logging");
goto end; goto end;
} }
uint64_t total_txs = AppLayerGetTxCnt(proto, dns_state); uint64_t total_txs = AppLayerParserGetTxCnt(p->proto, proto, dns_state);
uint64_t tx_id = AppLayerTransactionGetLogId(p->flow); uint64_t tx_id = AppLayerParserGetTransactionLogId(p->flow->alparser);
//int tx_progress_done_value_ts = AppLayerGetAlstateProgressCompletionStatus(proto, 0); //int tx_progress_done_value_ts = AppLayerGetAlstateProgressCompletionStatus(proto, 0);
//int tx_progress_done_value_tc = AppLayerGetAlstateProgressCompletionStatus(proto, 1); //int tx_progress_done_value_tc = AppLayerGetAlstateProgressCompletionStatus(proto, 1);
@ -248,7 +248,7 @@ static TmEcode DnsJsonIPWrapper(ThreadVars *tv, Packet *p, void *data,
DNSTransaction *tx = NULL; DNSTransaction *tx = NULL;
for (; tx_id < total_txs; tx_id++) for (; tx_id < total_txs; tx_id++)
{ {
tx = AppLayerGetTx(proto, dns_state, tx_id); tx = AppLayerParserGetTx(p->proto, proto, dns_state, tx_id);
if (tx == NULL) if (tx == NULL)
continue; continue;
@ -260,7 +260,7 @@ static TmEcode DnsJsonIPWrapper(ThreadVars *tv, Packet *p, void *data,
LogAnswers(aft, js, tx); LogAnswers(aft, js, tx);
SCLogDebug("calling AppLayerTransactionUpdateLoggedId"); SCLogDebug("calling AppLayerTransactionUpdateLoggedId");
AppLayerTransactionUpdateLogId(ALPROTO_DNS_UDP, p->flow); AppLayerParserSetTransactionLogId(p->flow->alparser);
} }
} }
json_decref(js); json_decref(js);

@ -240,20 +240,20 @@ static TmEcode HttpJsonIPWrapper(ThreadVars *tv, Packet *p, void *data)
/* check if we have HTTP state or not */ /* check if we have HTTP state or not */
FLOWLOCK_WRLOCK(p->flow); /* WRITE lock before we updated flow logged id */ FLOWLOCK_WRLOCK(p->flow); /* WRITE lock before we updated flow logged id */
uint16_t proto = AppLayerGetProtoFromPacket(p); uint16_t proto = FlowGetAppProtocol(p->flow);
if (proto != ALPROTO_HTTP) if (proto != ALPROTO_HTTP)
goto end; goto end;
htp_state = (HtpState *)AppLayerGetProtoStateFromPacket(p); htp_state = (HtpState *)FlowGetAppState(p->flow);
if (htp_state == NULL) { if (htp_state == NULL) {
SCLogDebug("no http state, so no request logging"); SCLogDebug("no http state, so no request logging");
goto end; goto end;
} }
total_txs = AppLayerParserGetTxCnt(IPPROTO_TCP, ALPROTO_HTTP, htp_state); total_txs = AppLayerParserGetTxCnt(IPPROTO_TCP, ALPROTO_HTTP, htp_state);
tx_id = AppLayerTransactionGetLogId(p->flow); tx_id = AppLayerParserGetTransactionLogId(p->flow->alparser);
tx_progress_done_value_ts = AppLayerGetAlstateProgressCompletionStatus(ALPROTO_HTTP, 0); tx_progress_done_value_ts = AppLayerParserGetStateProgressCompletionStatus(p->proto, ALPROTO_HTTP, 0);
tx_progress_done_value_tc = AppLayerGetAlstateProgressCompletionStatus(ALPROTO_HTTP, 1); tx_progress_done_value_tc = AppLayerParserGetStateProgressCompletionStatus(p->proto, ALPROTO_HTTP, 1);
json_t *js = CreateJSONHeader(p, 1); json_t *js = CreateJSONHeader(p, 1);
if (unlikely(js == NULL)) if (unlikely(js == NULL))
@ -267,12 +267,12 @@ static TmEcode HttpJsonIPWrapper(ThreadVars *tv, Packet *p, void *data)
continue; continue;
} }
if (!(((AppLayerParserStateStore *)p->flow->alparser)->id_flags & APP_LAYER_TRANSACTION_EOF)) { if (!(AppLayerParserStateIssetFlag(p->flow->alparser, APP_LAYER_PARSER_EOF))) {
tx_progress = AppLayerGetAlstateProgress(ALPROTO_HTTP, tx, 0); tx_progress = AppLayerParserGetStateProgress(p->proto, ALPROTO_HTTP, tx, 0);
if (tx_progress < tx_progress_done_value_ts) if (tx_progress < tx_progress_done_value_ts)
break; break;
tx_progress = AppLayerGetAlstateProgress(ALPROTO_HTTP, tx, 1); tx_progress = AppLayerParserGetStateProgress(p->proto, ALPROTO_HTTP, tx, 1);
if (tx_progress < tx_progress_done_value_tc) if (tx_progress < tx_progress_done_value_tc)
break; break;
} }
@ -295,7 +295,7 @@ static TmEcode HttpJsonIPWrapper(ThreadVars *tv, Packet *p, void *data)
OutputJSON(js, aft, &aft->http_cnt); OutputJSON(js, aft, &aft->http_cnt);
json_object_del(js, "http"); json_object_del(js, "http");
AppLayerTransactionUpdateLogId(ALPROTO_HTTP, p->flow); AppLayerParserSetTransactionLogId(p->flow->alparser);
} }
json_object_clear(js); json_object_clear(js);
json_decref(js); json_decref(js);

@ -52,7 +52,7 @@
#include "output-droplog.h" #include "output-droplog.h"
#include "output-httplog.h" #include "output-httplog.h"
#include "output-tlslog.h" #include "output-tlslog.h"
#include "output-file.h" #include "output-json-file.h"
#include "output-json.h" #include "output-json.h"
#include "util-byte.h" #include "util-byte.h"
@ -662,8 +662,8 @@ OutputCtx *OutputJsonInitCtx(ConfNode *conf)
} }
if (strcmp(output->val, "dns") == 0) { if (strcmp(output->val, "dns") == 0) {
SCLogDebug("Enabling DNS output"); SCLogDebug("Enabling DNS output");
AppLayerRegisterLogger(ALPROTO_DNS_UDP); AppLayerParserRegisterLogger(IPPROTO_TCP,ALPROTO_DNS);
AppLayerRegisterLogger(ALPROTO_DNS_TCP); AppLayerParserRegisterLogger(IPPROTO_UDP,ALPROTO_DNS);
output_flags |= OUTPUT_DNS; output_flags |= OUTPUT_DNS;
continue; continue;
} }
@ -683,7 +683,7 @@ OutputCtx *OutputJsonInitCtx(ConfNode *conf)
SCLogDebug("Enabling HTTP output"); SCLogDebug("Enabling HTTP output");
ConfNode *child = ConfNodeLookupChild(output, "http"); ConfNode *child = ConfNodeLookupChild(output, "http");
json_ctx->http_ctx = OutputHttpLogInit(child); json_ctx->http_ctx = OutputHttpLogInit(child);
AppLayerRegisterLogger(ALPROTO_HTTP); AppLayerParserRegisterLogger(IPPROTO_TCP,ALPROTO_HTTP);
output_flags |= OUTPUT_HTTP; output_flags |= OUTPUT_HTTP;
continue; continue;
} }
@ -691,7 +691,7 @@ OutputCtx *OutputJsonInitCtx(ConfNode *conf)
SCLogDebug("Enabling TLS output"); SCLogDebug("Enabling TLS output");
ConfNode *child = ConfNodeLookupChild(output, "tls"); ConfNode *child = ConfNodeLookupChild(output, "tls");
json_ctx->tls_ctx = OutputTlsLogInit(child); json_ctx->tls_ctx = OutputTlsLogInit(child);
AppLayerRegisterLogger(ALPROTO_TLS); AppLayerParserRegisterLogger(IPPROTO_TCP,ALPROTO_TLS);
output_flags |= OUTPUT_TLS; output_flags |= OUTPUT_TLS;
continue; continue;
} }

@ -37,7 +37,7 @@
#include "util-unittest.h" #include "util-unittest.h"
#include "util-debug.h" #include "util-debug.h"
#include "app-layer-parser.h"
#include "output.h" #include "output.h"
#include "log-tlslog.h" #include "log-tlslog.h"
#include "app-layer-ssl.h" #include "app-layer-ssl.h"
@ -118,11 +118,11 @@ static TmEcode LogTlsLogIPWrapperJSON(ThreadVars *tv, Packet *p, void *data)
/* check if we have TLS state or not */ /* check if we have TLS state or not */
FLOWLOCK_WRLOCK(p->flow); FLOWLOCK_WRLOCK(p->flow);
uint16_t proto = AppLayerGetProtoFromPacket(p); uint16_t proto = FlowGetAppProtocol(p->flow);
if (proto != ALPROTO_TLS) if (proto != ALPROTO_TLS)
goto end; goto end;
SSLState *ssl_state = (SSLState *) AppLayerGetProtoStateFromPacket(p); SSLState *ssl_state = (SSLState *) FlowGetAppState(p->flow);
if (ssl_state == NULL) { if (ssl_state == NULL) {
SCLogDebug("no tls state, so no request logging"); SCLogDebug("no tls state, so no request logging");
goto end; goto end;
@ -131,7 +131,7 @@ static TmEcode LogTlsLogIPWrapperJSON(ThreadVars *tv, Packet *p, void *data)
if (ssl_state->server_connp.cert0_issuerdn == NULL || ssl_state->server_connp.cert0_subject == NULL) if (ssl_state->server_connp.cert0_issuerdn == NULL || ssl_state->server_connp.cert0_subject == NULL)
goto end; goto end;
if (AppLayerTransactionGetLogId(p->flow) != 0) if (AppLayerParserGetTransactionLogId(p->flow->alparser) != 0)
goto end; goto end;
json_t *js = CreateJSONHeader(p, 0); json_t *js = CreateJSONHeader(p, 0);

Loading…
Cancel
Save