pub id: u64,
pub request: Option<DNSRequest>,
pub response: Option<DNSResponse>,
+ detect_flags_ts: u64,
+ detect_flags_tc: u64,
pub logged: LoggerFlags,
pub de_state: Option<*mut core::DetectEngineState>,
pub events: *mut core::AppLayerDecoderEvents,
id: 0,
request: None,
response: None,
+ detect_flags_ts: 0,
+ detect_flags_tc: 0,
logged: LoggerFlags::new(),
de_state: None,
events: std::ptr::null_mut(),
return 1;
}
+#[no_mangle]
+pub extern "C" fn rs_dns_tx_set_detect_flags(tx: &mut DNSTransaction,
+ dir: libc::uint8_t,
+ flags: libc::uint64_t)
+{
+ if dir & core::STREAM_TOSERVER != 0 {
+ tx.detect_flags_ts = flags as u64;
+ } else {
+ tx.detect_flags_tc = flags as u64;
+ }
+}
+
+#[no_mangle]
+pub extern "C" fn rs_dns_tx_get_detect_flags(tx: &mut DNSTransaction,
+ dir: libc::uint8_t)
+ -> libc::uint64_t
+{
+ if dir & core::STREAM_TOSERVER != 0 {
+ return tx.detect_flags_ts as libc::uint64_t;
+ } else {
+ return tx.detect_flags_tc as libc::uint64_t;
+ }
+}
+
#[no_mangle]
pub extern "C" fn rs_dns_tx_set_logged(_state: &mut DNSState,
tx: &mut DNSTransaction,
return 0;
}
+static void RustDNSSetDetectFlags(void *tx, uint8_t dir, uint64_t flags)
+{
+ rs_dns_tx_set_detect_flags(tx, dir, flags);
+}
+
+static uint64_t RustDNSGetDetectFlags(void *tx, uint8_t dir)
+{
+ return rs_dns_tx_get_detect_flags(tx, dir);
+}
+
+
static int RustDNSHasEvents(void *state)
{
return rs_dns_state_has_events(state);
AppLayerParserRegisterDetectStateFuncs(IPPROTO_UDP, ALPROTO_DNS,
RustDNSStateHasTxDetectState, RustDNSGetTxDetectState,
RustDNSSetTxDetectState);
+ AppLayerParserRegisterDetectFlagsFuncs(IPPROTO_UDP, ALPROTO_DNS,
+ RustDNSGetDetectFlags, RustDNSSetDetectFlags);
AppLayerParserRegisterGetTx(IPPROTO_UDP, ALPROTO_DNS, RustDNSGetTx);
AppLayerParserRegisterGetTxCnt(IPPROTO_UDP, ALPROTO_DNS,