serial_hi: serial_hi,
objectuuid: match parse_uuid(objectuuid) {
Ok((_, vect)) => assemble_uuid(vect),
- Err(e) => {
- SCLogDebug!("{}", e);
+ Err(_e) => {
+ SCLogDebug!("{}", _e);
vec![0]
},
},
interfaceuuid: match parse_uuid(interfaceuuid) {
Ok((_, vect)) => assemble_uuid(vect),
- Err(e) => {
- SCLogDebug!("{}", e);
+ Err(_e) => {
+ SCLogDebug!("{}", _e);
vec![0]
},
},
activityuuid: match parse_uuid(activityuuid){
Ok((_, vect)) => assemble_uuid(vect),
- Err(e) => {
- SCLogDebug!("{}", e);
+ Err(_e) => {
+ SCLogDebug!("{}", _e);
vec![0]
},
},
self.file_is_truncated = true;
}
- pub fn create(&mut self, name: &[u8], file_size: u64) {
+ pub fn create(&mut self, _name: &[u8], _file_size: u64) {
if self.file_open == true { panic!("close existing file first"); }
- SCLogDebug!("CREATE: name {:?} file_size {}", name, file_size);
+ SCLogDebug!("CREATE: name {:?} file_size {}", _name, _file_size);
}
pub fn new_chunk(&mut self, config: &'static SuricataFileContext,
if self.chunk_is_ooo == false {
loop {
- let offset = self.tracked;
+ let _offset = self.tracked;
match self.chunks.remove(&self.tracked) {
Some(c) => {
let res = files.file_append(&self.track_id, &c.chunk, c.contains_gap);
self.tracked += c.chunk.len() as u64;
self.cur_ooo -= c.chunk.len() as u64;
- SCLogDebug!("STORED OOO CHUNK at offset {}, tracked now {}, stored len {}", offset, self.tracked, c.chunk.len());
+ SCLogDebug!("STORED OOO CHUNK at offset {}, tracked now {}, stored len {}", _offset, self.tracked, c.chunk.len());
},
_ => {
- SCLogDebug!("NO STORED CHUNK found at offset {}", self.tracked);
+ SCLogDebug!("NO STORED CHUNK found at _offset {}", self.tracked);
break;
},
};
return dport;
},
Err(nom::Err::Incomplete(_)) => {
- let buf = unsafe{std::slice::from_raw_parts(input, len as usize)};
SCLogDebug!("pasv incomplete: '{:?}'", String::from_utf8_lossy(buf));
},
Err(_) => {
- let buf = unsafe{std::slice::from_raw_parts(input, len as usize)};
SCLogDebug!("pasv error on '{:?}'", String::from_utf8_lossy(buf));
},
}
return dport;
},
Err(nom::Err::Incomplete(_)) => {
- let buf = unsafe{std::slice::from_raw_parts(input, len as usize)};
SCLogDebug!("epsv incomplete: '{:?}'", String::from_utf8_lossy(buf));
},
Err(_) => {
- let buf = unsafe{std::slice::from_raw_parts(input, len as usize)};
SCLogDebug!("epsv incomplete: '{:?}'", String::from_utf8_lossy(buf));
},
state.ikev2_container.dh_group = kex.dh_group;
}
}
- IkeV2PayloadContent::Nonce(ref n) => {
- SCLogDebug!("Nonce: {:?}", n);
+ IkeV2PayloadContent::Nonce(ref _n) => {
+ SCLogDebug!("Nonce: {:?}", _n);
}
IkeV2PayloadContent::Notify(ref n) => {
SCLogDebug!("Notify: {:?}", n);
}
}
}
- e => {
- SCLogDebug!("parse_ikev2_payload_with_type: {:?}", e);
+ _e => {
+ SCLogDebug!("parse_ikev2_payload_with_type: {:?}", _e);
()
}
}
}
_ => (),
},
- IkeV2Transform::Unknown(tx_type, tx_id) => {
- SCLogDebug!("Unknown proposal: type={:?}, id={}", tx_type, tx_id);
+ IkeV2Transform::Unknown(_tx_type, _tx_id) => {
+ SCLogDebug!("Unknown proposal: type={:?}, id={}", _tx_type, _tx_id);
state.set_event(IkeEvent::UnknownProposal);
}
_ => (),
#[cfg(not(feature = "debug"))]
#[macro_export]
macro_rules!SCLogDebug {
- ($last:expr) => { let _ = &$last; let _ = $crate::log::Level::Debug; };
- ($one:expr, $($arg:tt)*) => { let _ = &$one; SCLogDebug!($($arg)*); };
+ ($($arg:tt)*) => ()
}
/// SCLogMessage wrapper. If the Suricata C context is not registered
if self.ts_gap {
SCLogDebug!("TS trying to catch up after GAP (input {})", cur_i.len());
- let mut cnt = 0;
+ let mut _cnt = 0;
while cur_i.len() > 0 {
- cnt += 1;
+ _cnt += 1;
match nfs_probe(cur_i, STREAM_TOSERVER) {
1 => {
SCLogDebug!("expected data found");
},
0 => {
SCLogDebug!("incomplete, queue and retry with the next block (input {}). Looped {} times.",
- cur_i.len(), cnt);
+ cur_i.len(), _cnt);
return AppLayerResult::incomplete((i.len() - cur_i.len()) as u32, (cur_i.len() + 1) as u32);
},
-1 => {
cur_i = &cur_i[1..];
if cur_i.len() == 0 {
- SCLogDebug!("all post-GAP data in this chunk was bad. Looped {} times.", cnt);
+ SCLogDebug!("all post-GAP data in this chunk was bad. Looped {} times.", _cnt);
}
},
_ => {
if self.tc_gap {
SCLogDebug!("TC trying to catch up after GAP (input {})", cur_i.len());
- let mut cnt = 0;
+ let mut _cnt = 0;
while cur_i.len() > 0 {
- cnt += 1;
+ _cnt += 1;
match nfs_probe(cur_i, STREAM_TOCLIENT) {
1 => {
SCLogDebug!("expected data found");
},
0 => {
SCLogDebug!("incomplete, queue and retry with the next block (input {}). Looped {} times.",
- cur_i.len(), cnt);
+ cur_i.len(), _cnt);
return AppLayerResult::incomplete((i.len() - cur_i.len()) as u32, (cur_i.len() + 1) as u32);
},
-1 => {
cur_i = &cur_i[1..];
if cur_i.len() == 0 {
- SCLogDebug!("all post-GAP data in this chunk was bad. Looped {} times.", cnt);
+ SCLogDebug!("all post-GAP data in this chunk was bad. Looped {} times.", _cnt);
}
},
_ => {
self.commit_v4(r, fh);
}
}
- &Nfs4RequestContent::Close(ref rd) => {
- SCLogDebug!("CLOSEv4: {:?}", rd);
+ &Nfs4RequestContent::Close(ref _rd) => {
+ SCLogDebug!("CLOSEv4: {:?}", _rd);
}
&Nfs4RequestContent::Create(ref rd) => {
SCLogDebug!("CREATEv4: {:?}", rd);
xidmap.file_name = rd.to_vec();
main_opcode = NFSPROC4_REMOVE;
}
- &Nfs4RequestContent::SetClientId(ref rd) => {
+ &Nfs4RequestContent::SetClientId(ref _rd) => {
SCLogDebug!("SETCLIENTIDv4: client id {} r_netid {} r_addr {}",
- String::from_utf8_lossy(&rd.client_id),
- String::from_utf8_lossy(&rd.r_netid),
- String::from_utf8_lossy(&rd.r_addr));
+ String::from_utf8_lossy(&_rd.client_id),
+ String::from_utf8_lossy(&_rd.r_netid),
+ String::from_utf8_lossy(&_rd.r_addr));
}
&_ => { },
}
for c in &cr.commands {
SCLogDebug!("c {:?}", c);
match c {
- &Nfs4ResponseContent::ReadDir(s, ref rd) => {
+ &Nfs4ResponseContent::ReadDir(_s, ref rd) => {
if let &Some(ref rd) = rd {
- SCLogDebug!("READDIRv4: status {} eof {}", s, rd.eof);
+ SCLogDebug!("READDIRv4: status {} eof {}", _s, rd.eof);
for d in &rd.listing {
- if let &Some(ref d) = d {
- SCLogDebug!("READDIRv4: dir {}", String::from_utf8_lossy(&d.name));
+ if let &Some(ref _d) = d {
+ SCLogDebug!("READDIRv4: dir {}", String::from_utf8_lossy(&_d.name));
}
}
self.process_read_record(r, &reply, Some(&xidmap));
}
},
- &Nfs4ResponseContent::Open(s, ref rd) => {
- if let &Some(ref rd) = rd {
- SCLogDebug!("OPENv4: status {} opendata {:?}", s, rd);
+ &Nfs4ResponseContent::Open(_s, ref rd) => {
+ if let &Some(ref _rd) = rd {
+ SCLogDebug!("OPENv4: status {} opendata {:?}", _s, _rd);
insert_filename_with_getfh = true;
}
},
i.iface.to_vec()
};
let uuid_str = uuid::Uuid::from_slice(&x.clone());
- let uuid_str = uuid_str.map(|uuid_str| uuid_str.to_hyphenated().to_string()).unwrap();
+ let _uuid_str = uuid_str.map(|uuid_str| uuid_str.to_hyphenated().to_string()).unwrap();
let d = DCERPCIface::new(x,i.ver,i.ver_min);
SCLogDebug!("UUID {} version {}/{} bytes {:?}",
- uuid_str,
+ _uuid_str,
i.ver, i.ver_min,i.iface);
ifaces.push(d);
}
true
},
- Err(nom::Err::Incomplete(n)) => {
- SCLogDebug!("TRANS2 SET_FILE_INFO DATA DISPOSITION INCOMPLETE {:?}", n);
+ Err(nom::Err::Incomplete(_n)) => {
+ SCLogDebug!("TRANS2 SET_FILE_INFO DATA DISPOSITION INCOMPLETE {:?}", _n);
events.push(SMBEvent::MalformedData);
false
},
- Err(nom::Err::Error(e)) |
- Err(nom::Err::Failure(e)) => {
- SCLogDebug!("TRANS2 SET_FILE_INFO DATA DISPOSITION ERROR {:?}", e);
+ Err(nom::Err::Error(_e)) |
+ Err(nom::Err::Failure(_e)) => {
+ SCLogDebug!("TRANS2 SET_FILE_INFO DATA DISPOSITION ERROR {:?}", _e);
events.push(SMBEvent::MalformedData);
false
},
tx.vercmd.set_smb1_cmd(SMB1_COMMAND_TRANS2);
true
},
- Err(nom::Err::Incomplete(n)) => {
- SCLogDebug!("TRANS2 SET_PATH_INFO DATA RENAME INCOMPLETE {:?}", n);
+ Err(nom::Err::Incomplete(_n)) => {
+ SCLogDebug!("TRANS2 SET_PATH_INFO DATA RENAME INCOMPLETE {:?}", _n);
events.push(SMBEvent::MalformedData);
false
},
- Err(nom::Err::Error(e)) |
- Err(nom::Err::Failure(e)) => {
- SCLogDebug!("TRANS2 SET_PATH_INFO DATA RENAME ERROR {:?}", e);
+ Err(nom::Err::Error(_e)) |
+ Err(nom::Err::Failure(_e)) => {
+ SCLogDebug!("TRANS2 SET_PATH_INFO DATA RENAME ERROR {:?}", _e);
events.push(SMBEvent::MalformedData);
false
},
false
}
},
- Err(nom::Err::Incomplete(n)) => {
- SCLogDebug!("TRANS2 SET_PATH_INFO PARAMS INCOMPLETE {:?}", n);
+ Err(nom::Err::Incomplete(_n)) => {
+ SCLogDebug!("TRANS2 SET_PATH_INFO PARAMS INCOMPLETE {:?}", _n);
events.push(SMBEvent::MalformedData);
false
},
- Err(nom::Err::Error(e)) |
- Err(nom::Err::Failure(e)) => {
- SCLogDebug!("TRANS2 SET_PATH_INFO PARAMS ERROR {:?}", e);
+ Err(nom::Err::Error(_e)) |
+ Err(nom::Err::Failure(_e)) => {
+ SCLogDebug!("TRANS2 SET_PATH_INFO PARAMS ERROR {:?}", _e);
events.push(SMBEvent::MalformedData);
false
},
true
},
- Err(nom::Err::Incomplete(n)) => {
- SCLogDebug!("TRANS2 SET_FILE_INFO DATA DISPOSITION INCOMPLETE {:?}", n);
+ Err(nom::Err::Incomplete(_n)) => {
+ SCLogDebug!("TRANS2 SET_FILE_INFO DATA DISPOSITION INCOMPLETE {:?}", _n);
events.push(SMBEvent::MalformedData);
false
},
- Err(nom::Err::Error(e)) |
- Err(nom::Err::Failure(e)) => {
- SCLogDebug!("TRANS2 SET_FILE_INFO DATA DISPOSITION ERROR {:?}", e);
+ Err(nom::Err::Error(_e)) |
+ Err(nom::Err::Failure(_e)) => {
+ SCLogDebug!("TRANS2 SET_FILE_INFO DATA DISPOSITION ERROR {:?}", _e);
events.push(SMBEvent::MalformedData);
false
},
tx.vercmd.set_smb1_cmd(SMB1_COMMAND_TRANS2);
true
},
- Err(nom::Err::Incomplete(n)) => {
- SCLogDebug!("TRANS2 SET_FILE_INFO DATA RENAME INCOMPLETE {:?}", n);
+ Err(nom::Err::Incomplete(_n)) => {
+ SCLogDebug!("TRANS2 SET_FILE_INFO DATA RENAME INCOMPLETE {:?}", _n);
events.push(SMBEvent::MalformedData);
false
},
- Err(nom::Err::Error(e)) |
- Err(nom::Err::Failure(e)) => {
- SCLogDebug!("TRANS2 SET_FILE_INFO DATA RENAME ERROR {:?}", e);
+ Err(nom::Err::Error(_e)) |
+ Err(nom::Err::Failure(_e)) => {
+ SCLogDebug!("TRANS2 SET_FILE_INFO DATA RENAME ERROR {:?}", _e);
events.push(SMBEvent::MalformedData);
false
},
false
}
},
- Err(nom::Err::Incomplete(n)) => {
- SCLogDebug!("TRANS2 SET_FILE_INFO PARAMS INCOMPLETE {:?}", n);
+ Err(nom::Err::Incomplete(_n)) => {
+ SCLogDebug!("TRANS2 SET_FILE_INFO PARAMS INCOMPLETE {:?}", _n);
events.push(SMBEvent::MalformedData);
false
},
- Err(nom::Err::Error(e)) |
- Err(nom::Err::Failure(e)) => {
- SCLogDebug!("TRANS2 SET_FILE_INFO PARAMS ERROR {:?}", e);
+ Err(nom::Err::Error(_e)) |
+ Err(nom::Err::Failure(_e)) => {
+ SCLogDebug!("TRANS2 SET_FILE_INFO PARAMS ERROR {:?}", _e);
events.push(SMBEvent::MalformedData);
false
},
false
}
},
- Err(nom::Err::Incomplete(n)) => {
- SCLogDebug!("TRANS2 INCOMPLETE {:?}", n);
+ Err(nom::Err::Incomplete(_n)) => {
+ SCLogDebug!("TRANS2 INCOMPLETE {:?}", _n);
events.push(SMBEvent::MalformedData);
false
},
- Err(nom::Err::Error(e)) |
- Err(nom::Err::Failure(e)) => {
- SCLogDebug!("TRANS2 ERROR {:?}", e);
+ Err(nom::Err::Error(_e)) |
+ Err(nom::Err::Failure(_e)) => {
+ SCLogDebug!("TRANS2 ERROR {:?}", _e);
events.push(SMBEvent::MalformedData);
false
},
let mut frankenfid = pipe.fid.to_vec();
frankenfid.extend_from_slice(&u32_as_bytes(r.ssn_id));
- let (filename, is_dcerpc) = match state.get_service_for_guid(&frankenfid) {
+ let (_filename, is_dcerpc) = match state.get_service_for_guid(&frankenfid) {
(n, x) => (n, x),
};
SCLogDebug!("smb1_trans_request_record: name {} is_dcerpc {}",
- filename, is_dcerpc);
+ _filename, is_dcerpc);
pipe_dcerpc = is_dcerpc;
}
let mut frankenfid = fid.to_vec();
frankenfid.extend_from_slice(&u32_as_bytes(r.ssn_id));
- let (filename, is_dcerpc) = match state.get_service_for_guid(&frankenfid) {
+ let (_filename, is_dcerpc) = match state.get_service_for_guid(&frankenfid) {
(n, x) => (n, x),
};
SCLogDebug!("smb1_trans_response_record: name {} is_dcerpc {}",
- filename, is_dcerpc);
+ _filename, is_dcerpc);
// if we get status 'BUFFER_OVERFLOW' this is only a part of
// the data. Store it in the ssn/tree for later use.
if r.nt_status == SMB_NTSTATUS_SUCCESS {
match parse_smb2_response_write(r.data)
{
- Ok((_, wr)) => {
- SCLogDebug!("SMBv2: Write response => {:?}", wr);
+ Ok((_, _wr)) => {
+ SCLogDebug!("SMBv2: Write response => {:?}", _wr);
/* search key-guid map */
let guid_key = SMBCommonHdr::new(SMBHDR_TYPE_GUID,
r.session_id, r.tree_id, r.message_id);
- let guid_vec = match state.ssn2vec_map.remove(&guid_key) {
+ let _guid_vec = match state.ssn2vec_map.remove(&guid_key) {
Some(p) => p,
None => {
SCLogDebug!("SMBv2 response: GUID NOT FOUND");
Vec::new()
},
};
- SCLogDebug!("SMBv2 write response for GUID {:?}", guid_vec);
+ SCLogDebug!("SMBv2 write response for GUID {:?}", _guid_vec);
}
_ => {
events.push(SMBEvent::MalformedData);
use crate::smb::smb2_records::*;
use crate::smb::dcerpc::*;
use crate::smb::events::*;
+#[cfg(feature = "debug")]
use crate::smb::funcs::*;
#[derive(Debug)]
Ok((_rem,SnmpGenericMessage::V1(msg))) |
Ok((_rem,SnmpGenericMessage::V2(msg))) => self.handle_snmp_v12(msg, direction),
Ok((_rem,SnmpGenericMessage::V3(msg))) => self.handle_snmp_v3(msg, direction),
- Err(e) => {
- SCLogDebug!("parse_snmp failed: {:?}", e);
+ Err(_e) => {
+ SCLogDebug!("parse_snmp failed: {:?}", _e);
self.set_event(SNMPEvent::MalformedData);
-1
},
panic!("SSH invalid length record header");
}
}
- Err(e) => {
- SCLogDebug!("SSH invalid record header {}", e);
+ Err(_e) => {
+ SCLogDebug!("SSH invalid record header {}", _e);
self.set_event(SSHEvent::InvalidRecord);
return AppLayerResult::err();
}
}
}
- Err(e) => {
- SCLogDebug!("SSH invalid record {}", e);
+ Err(_e) => {
+ SCLogDebug!("SSH invalid record {}", _e);
self.set_event(SSHEvent::InvalidRecord);
return AppLayerResult::err();
}
Err(nom::Err::Incomplete(_)) => {
return AppLayerResult::incomplete(0 as u32, (input.len() + 1) as u32);
}
- Err(e) => {
- SCLogDebug!("SSH invalid banner {}", e);
+ Err(_e) => {
+ SCLogDebug!("SSH invalid banner {}", _e);
self.set_event(SSHEvent::InvalidBanner);
return AppLayerResult::err();
}
}
}
}
- Err(e) => {
- SCLogDebug!("SSH invalid banner {}", e);
+ Err(_e) => {
+ SCLogDebug!("SSH invalid banner {}", _e);
self.set_event(SSHEvent::InvalidBanner);
return AppLayerResult::err();
}