Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rust/src/krb/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// written by Pierre Chifflier <chifflier@wzdftpd.net>

use crate::jsonbuilder::{JsonBuilder, JsonError};
use crate::krb::krb5::{KRB5State,KRB5Transaction,test_weak_encryption};
use crate::krb::krb5::{KRB5Transaction,test_weak_encryption};

fn krb5_log_response(jsb: &mut JsonBuilder, tx: &mut KRB5Transaction) -> Result<(), JsonError>
{
Expand Down Expand Up @@ -68,7 +68,7 @@ fn krb5_log_response(jsb: &mut JsonBuilder, tx: &mut KRB5Transaction) -> Result<
}

#[no_mangle]
pub extern "C" fn rs_krb5_log_json_response(jsb: &mut JsonBuilder, _state: &mut KRB5State, tx: &mut KRB5Transaction) -> bool
pub extern "C" fn rs_krb5_log_json_response(jsb: &mut JsonBuilder, tx: &mut KRB5Transaction) -> bool
{
krb5_log_response(jsb, tx).is_ok()
}
4 changes: 2 additions & 2 deletions rust/src/mqtt/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

// written by Sascha Steinbiss <sascha@steinbiss.name>

use super::mqtt::{MQTTState, MQTTTransaction};
use super::mqtt::MQTTTransaction;
use crate::jsonbuilder::{JsonBuilder, JsonError};
use crate::mqtt::mqtt_message::{MQTTOperation, MQTTSubscribeTopicData};
use crate::mqtt::parser::FixedHeader;
Expand Down Expand Up @@ -298,7 +298,7 @@ fn log_mqtt(tx: &MQTTTransaction, flags: u32, js: &mut JsonBuilder) -> Result<()

#[no_mangle]
pub unsafe extern "C" fn rs_mqtt_logger_log(
_state: &mut MQTTState, tx: *mut std::os::raw::c_void, flags: u32, js: &mut JsonBuilder,
tx: *mut std::os::raw::c_void, flags: u32, js: &mut JsonBuilder,
) -> bool {
let tx = cast_pointer!(tx, MQTTTransaction);
log_mqtt(tx, flags, js).is_ok()
Expand Down
5 changes: 2 additions & 3 deletions rust/src/rfb/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use std;
use std::fmt::Write;
use super::rfb::{RFBState, RFBTransaction};
use super::rfb::RFBTransaction;
use crate::jsonbuilder::{JsonBuilder, JsonError};

fn log_rfb(tx: &RFBTransaction, js: &mut JsonBuilder) -> Result<(), JsonError> {
Expand Down Expand Up @@ -113,8 +113,7 @@ fn log_rfb(tx: &RFBTransaction, js: &mut JsonBuilder) -> Result<(), JsonError> {
}

#[no_mangle]
pub unsafe extern "C" fn rs_rfb_logger_log(_state: &mut RFBState,
tx: *mut std::os::raw::c_void,
pub unsafe extern "C" fn rs_rfb_logger_log(tx: *mut std::os::raw::c_void,
js: &mut JsonBuilder) -> bool {
let tx = cast_pointer!(tx, RFBTransaction);
log_rfb(tx, js).is_ok()
Expand Down
4 changes: 2 additions & 2 deletions src/output-json-alert.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ static void AlertJsonDns(const Flow *f, const uint64_t tx_id, JsonBuilder *js)
dns_state, tx_id);
if (txptr) {
jb_open_object(js, "dns");
JsonBuilder *qjs = JsonDNSLogQuery(txptr, tx_id);
JsonBuilder *qjs = JsonDNSLogQuery(txptr);
if (qjs != NULL) {
jb_set_object(js, "query", qjs);
jb_free(qjs);
}
JsonBuilder *ajs = JsonDNSLogAnswer(txptr, tx_id);
JsonBuilder *ajs = JsonDNSLogAnswer(txptr);
if (ajs != NULL) {
jb_set_object(js, "answer", ajs);
jb_free(ajs);
Expand Down
4 changes: 2 additions & 2 deletions src/output-json-dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ typedef struct LogDnsLogThread_ {
OutputJsonThreadCtx *ctx;
} LogDnsLogThread;

JsonBuilder *JsonDNSLogQuery(void *txptr, uint64_t tx_id)
JsonBuilder *JsonDNSLogQuery(void *txptr)
{
JsonBuilder *queryjb = jb_new_array();
if (queryjb == NULL) {
Expand Down Expand Up @@ -292,7 +292,7 @@ JsonBuilder *JsonDNSLogQuery(void *txptr, uint64_t tx_id)
return queryjb;
}

JsonBuilder *JsonDNSLogAnswer(void *txptr, uint64_t tx_id)
JsonBuilder *JsonDNSLogAnswer(void *txptr)
{
if (!rs_dns_do_log_answer(txptr, LOG_ALL_RRTYPES)) {
return NULL;
Expand Down
4 changes: 2 additions & 2 deletions src/output-json-dns.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

void JsonDnsLogRegister(void);

JsonBuilder *JsonDNSLogQuery(void *txptr, uint64_t tx_id) __attribute__((nonnull));
JsonBuilder *JsonDNSLogAnswer(void *txptr, uint64_t tx_id) __attribute__((nonnull));
JsonBuilder *JsonDNSLogQuery(void *txptr) __attribute__((nonnull));
JsonBuilder *JsonDNSLogAnswer(void *txptr) __attribute__((nonnull));

#endif /* __OUTPUT_JSON_DNS_H__ */
4 changes: 2 additions & 2 deletions src/output-json-ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include "app-layer-ftp.h"
#include "output-json-ftp.h"

static void EveFTPLogCommand(Flow *f, FTPTransaction *tx, JsonBuilder *jb)
static void EveFTPLogCommand(FTPTransaction *tx, JsonBuilder *jb)
{
/* Preallocate array objects to simplify failure case */
JsonBuilder *js_resplist = NULL;
Expand Down Expand Up @@ -173,7 +173,7 @@ static int JsonFTPLogger(ThreadVars *tv, void *thread_data,
if (f->alproto == ALPROTO_FTPDATA) {
EveFTPDataAddMetadata(f, jb);
} else {
EveFTPLogCommand(f, tx, jb);
EveFTPLogCommand(tx, jb);
}

if (!jb_close(jb)) {
Expand Down
2 changes: 1 addition & 1 deletion src/output-json-krb5.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static int JsonKRB5Logger(ThreadVars *tv, void *thread_data,
}

jb_open_object(jb, "krb5");
if (!rs_krb5_log_json_response(jb, state, krb5tx)) {
if (!rs_krb5_log_json_response(jb, krb5tx)) {
goto error;
}
jb_close(jb);
Expand Down
4 changes: 2 additions & 2 deletions src/output-json-mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bool JsonMQTTAddMetadata(const Flow *f, uint64_t tx_id, JsonBuilder *js)
if (state) {
MQTTTransaction *tx = AppLayerParserGetTx(f->proto, ALPROTO_MQTT, state, tx_id);
if (tx) {
return rs_mqtt_logger_log(state, tx, MQTT_DEFAULTS, js);
return rs_mqtt_logger_log(tx, MQTT_DEFAULTS, js);
}
}

Expand All @@ -89,7 +89,7 @@ static int JsonMQTTLogger(ThreadVars *tv, void *thread_data,
return TM_ECODE_FAILED;
}

if (!rs_mqtt_logger_log(state, tx, thread->mqttlog_ctx->flags, js))
if (!rs_mqtt_logger_log(tx, thread->mqttlog_ctx->flags, js))
goto error;

OutputJsonBuilderBuffer(js, thread->ctx);
Expand Down
6 changes: 3 additions & 3 deletions src/output-json-rfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@

bool JsonRFBAddMetadata(const Flow *f, uint64_t tx_id, JsonBuilder *js)
{
RFBState *state = FlowGetAppState(f);
void *state = FlowGetAppState(f);
if (state) {
RFBTransaction *tx = AppLayerParserGetTx(f->proto, ALPROTO_RFB, state, tx_id);
if (tx) {
return rs_rfb_logger_log(state, tx, js);
return rs_rfb_logger_log(tx, js);
}
}

Expand All @@ -69,7 +69,7 @@ static int JsonRFBLogger(ThreadVars *tv, void *thread_data,
return TM_ECODE_FAILED;
}

if (!rs_rfb_logger_log(NULL, tx, js)) {
if (!rs_rfb_logger_log(tx, js)) {
goto error;
}

Expand Down
6 changes: 3 additions & 3 deletions src/output-json-smtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include "output-json-smtp.h"
#include "output-json-email-common.h"

static void EveSmtpDataLogger(const Flow *f, void *state, void *vtx, uint64_t tx_id, JsonBuilder *js)
static void EveSmtpDataLogger(void *state, void *vtx, JsonBuilder *js)
{
SMTPTransaction *tx = vtx;
SMTPString *rcptto_str;
Expand Down Expand Up @@ -81,7 +81,7 @@ static int JsonSmtpLogger(ThreadVars *tv, void *thread_data, const Packet *p, Fl
return TM_ECODE_OK;

jb_open_object(jb, "smtp");
EveSmtpDataLogger(f, state, tx, tx_id, jb);
EveSmtpDataLogger(state, tx, jb);
jb_close(jb);

EveEmailLogJson(jhl, jb, p, f, state, tx, tx_id);
Expand All @@ -99,7 +99,7 @@ bool EveSMTPAddMetadata(const Flow *f, uint64_t tx_id, JsonBuilder *js)
if (smtp_state) {
SMTPTransaction *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_SMTP, smtp_state, tx_id);
if (tx) {
EveSmtpDataLogger(f, smtp_state, tx, tx_id, js);
EveSmtpDataLogger(smtp_state, tx, js);
return true;
}
}
Expand Down