Remove offset argument as it was unused.
#[no_mangle]
pub extern "C" fn rs_dhcp_probing_parser(_flow: *const Flow,
input: *const libc::uint8_t,
- input_len: u32,
- _offset: *const u32) -> AppProto {
+ input_len: u32) -> AppProto {
if input_len < DHCP_MIN_FRAME_LEN {
return ALPROTO_UNKNOWN;
}
static mut ALPROTO_IKEV2 : AppProto = ALPROTO_UNKNOWN;
#[no_mangle]
-pub extern "C" fn rs_ikev2_probing_parser(_flow: *const Flow, input:*const libc::uint8_t, input_len: u32, _offset: *const u32) -> AppProto {
+pub extern "C" fn rs_ikev2_probing_parser(_flow: *const Flow, input:*const libc::uint8_t, input_len: u32) -> AppProto {
let slice = build_slice!(input,input_len as usize);
let alproto = unsafe{ ALPROTO_IKEV2 };
match parse_ikev2_header(slice) {
static mut ALPROTO_KRB5 : AppProto = ALPROTO_UNKNOWN;
#[no_mangle]
-pub extern "C" fn rs_krb5_probing_parser(_flow: *const Flow, input:*const libc::uint8_t, input_len: u32, _offset: *const u32) -> AppProto {
+pub extern "C" fn rs_krb5_probing_parser(_flow: *const Flow, input:*const libc::uint8_t, input_len: u32) -> AppProto {
let slice = build_slice!(input,input_len as usize);
let alproto = unsafe{ ALPROTO_KRB5 };
if slice.len() <= 10 { return unsafe{ALPROTO_FAILED}; }
}
#[no_mangle]
-pub extern "C" fn rs_krb5_probing_parser_tcp(_flow: *const Flow, input:*const libc::uint8_t, input_len: u32, _offset: *const u32) -> AppProto {
+pub extern "C" fn rs_krb5_probing_parser_tcp(_flow: *const Flow, input:*const libc::uint8_t, input_len: u32) -> AppProto {
let slice = build_slice!(input,input_len as usize);
if slice.len() <= 14 { return unsafe{ALPROTO_FAILED}; }
match be_u32(slice) {
IResult::Done(rem, record_mark) => {
if record_mark != rem.len() as u32 { return unsafe{ALPROTO_FAILED}; }
- return rs_krb5_probing_parser(_flow, rem.as_ptr(), rem.len() as u32, _offset);
+ return rs_krb5_probing_parser(_flow, rem.as_ptr(), rem.len() as u32);
},
IResult::Incomplete(_) => {
return ALPROTO_UNKNOWN;
static mut ALPROTO_NTP : AppProto = ALPROTO_UNKNOWN;
#[no_mangle]
-pub extern "C" fn ntp_probing_parser(_flow: *const Flow, input:*const u8, input_len: u32, _offset: *const u32) -> AppProto {
+pub extern "C" fn ntp_probing_parser(_flow: *const Flow, input:*const u8, input_len: u32) -> AppProto {
let slice: &[u8] = unsafe { std::slice::from_raw_parts(input as *mut u8, input_len as usize) };
let alproto = unsafe{ ALPROTO_NTP };
match parse_ntp(slice) {
input_len: u32,
data: *const c_void,
flags: u8) -> i8;
-pub type ProbeFn = extern "C" fn (flow: *const Flow,input:*const u8, input_len: u32, offset: *const u32) -> AppProto;
+pub type ProbeFn = extern "C" fn (flow: *const Flow,input:*const u8, input_len: u32) -> AppProto;
pub type StateAllocFn = extern "C" fn () -> *mut c_void;
pub type StateFreeFn = extern "C" fn (*mut c_void);
pub type StateTxFreeFn = extern "C" fn (*mut c_void, u64);
}
if (direction & STREAM_TOSERVER && pe->ProbingParserTs != NULL) {
- alproto = pe->ProbingParserTs(f, buf, buflen, NULL);
+ alproto = pe->ProbingParserTs(f, buf, buflen);
} else if (pe->ProbingParserTc != NULL) {
- alproto = pe->ProbingParserTc(f, buf, buflen, NULL);
+ alproto = pe->ProbingParserTc(f, buf, buflen);
}
if (alproto != ALPROTO_UNKNOWN && alproto != ALPROTO_FAILED)
goto end;
}
if (direction & STREAM_TOSERVER && pe->ProbingParserTs != NULL) {
- alproto = pe->ProbingParserTs(f, buf, buflen, NULL);
+ alproto = pe->ProbingParserTs(f, buf, buflen);
} else if (pe->ProbingParserTc != NULL) {
- alproto = pe->ProbingParserTc(f, buf, buflen, NULL);
+ alproto = pe->ProbingParserTc(f, buf, buflen);
}
if (alproto != ALPROTO_UNKNOWN && alproto != ALPROTO_FAILED)
goto end;
static uint16_t ProbingParserDummyForTesting(Flow *f,
uint8_t *input,
- uint32_t input_len,
- uint32_t *offset)
+ uint32_t input_len)
{
return 0;
}
typedef struct AppLayerProtoDetectThreadCtx_ AppLayerProtoDetectThreadCtx;
typedef AppProto (*ProbingParserFPtr)(Flow *f,
- uint8_t *input, uint32_t input_len,
- uint32_t *offset);
+ uint8_t *input, uint32_t input_len);
/***** Protocol Retrieval *****/
/**
* \brief DNP3 probing parser.
*/
-static uint16_t DNP3ProbingParser(Flow *f, uint8_t *input, uint32_t len,
- uint32_t *offset)
+static uint16_t DNP3ProbingParser(Flow *f, uint8_t *input, uint32_t len)
{
DNP3LinkHeader *hdr = (DNP3LinkHeader *)input;
};
/* Valid frame. */
- FAIL_IF(DNP3ProbingParser(NULL, pkt, sizeof(pkt), NULL) != ALPROTO_DNP3);
+ FAIL_IF(DNP3ProbingParser(NULL, pkt, sizeof(pkt)) != ALPROTO_DNP3);
/* Send too little bytes. */
- FAIL_IF(DNP3ProbingParser(NULL, pkt, sizeof(DNP3LinkHeader) - 1, NULL) != ALPROTO_UNKNOWN);
+ FAIL_IF(DNP3ProbingParser(NULL, pkt, sizeof(DNP3LinkHeader) - 1) != ALPROTO_UNKNOWN);
/* Bad start bytes. */
pkt[0] = 0x06;
- FAIL_IF(DNP3ProbingParser(NULL, pkt, sizeof(pkt), NULL) != ALPROTO_FAILED);
+ FAIL_IF(DNP3ProbingParser(NULL, pkt, sizeof(pkt)) != ALPROTO_FAILED);
/* Restore start byte. */
pkt[0] = 0x05;
/* Set the length to a value less than the minimum length of 5. */
pkt[2] = 0x03;
- FAIL_IF(DNP3ProbingParser(NULL, pkt, sizeof(pkt), NULL) != ALPROTO_FAILED);
+ FAIL_IF(DNP3ProbingParser(NULL, pkt, sizeof(pkt)) != ALPROTO_FAILED);
/* Send a banner. */
char mybanner[] = "Welcome to DNP3 SCADA.";
- FAIL_IF(DNP3ProbingParser(NULL, (uint8_t *)mybanner, sizeof(mybanner), NULL) != ALPROTO_DNP3);
+ FAIL_IF(DNP3ProbingParser(NULL, (uint8_t *)mybanner, sizeof(mybanner)) != ALPROTO_DNP3);
PASS;
}
local_data);
}
-static uint16_t RustDNSTCPProbe(Flow *f, uint8_t *input, uint32_t len,
- uint32_t *offset)
+static uint16_t RustDNSTCPProbe(Flow *f, uint8_t *input, uint32_t len)
{
SCLogDebug("RustDNSTCPProbe");
if (len == 0 || len < sizeof(DNSHeader)) {
} __attribute__((__packed__));
typedef struct DNSTcpHeader_ DNSTcpHeader;
-static uint16_t DNSTcpProbingParser(Flow *f, uint8_t *input, uint32_t ilen,
- uint32_t *offset);
+static uint16_t DNSTcpProbingParser(Flow *f, uint8_t *input, uint32_t ilen);
/** \internal
* \param input_len at least enough for the DNSTcpHeader
/* Clear gap state. */
if (dns_state->gap_ts) {
- if (DNSTcpProbingParser(f, input, input_len, NULL) == ALPROTO_DNS) {
+ if (DNSTcpProbingParser(f, input, input_len) == ALPROTO_DNS) {
SCLogDebug("New data probed as DNS, clearing gap state.");
BufferReset(dns_state);
dns_state->gap_ts = 0;
/* Clear gap state. */
if (dns_state->gap_tc) {
- if (DNSTcpProbingParser(f, input, input_len, NULL) == ALPROTO_DNS) {
+ if (DNSTcpProbingParser(f, input, input_len) == ALPROTO_DNS) {
SCLogDebug("New data probed as DNS, clearing gap state.");
BufferReset(dns_state);
dns_state->gap_tc = 0;
SCReturnInt(-1);
}
-static uint16_t DNSTcpProbingParser(Flow *f, uint8_t *input, uint32_t ilen,
- uint32_t *offset)
+static uint16_t DNSTcpProbingParser(Flow *f, uint8_t *input, uint32_t ilen)
{
if (ilen == 0 || ilen < sizeof(DNSTcpHeader)) {
SCLogDebug("ilen too small, hoped for at least %"PRIuMAX, (uintmax_t)sizeof(DNSTcpHeader));
* This is a minimal parser that just checks that the input contains enough
* data for a TCP DNS response.
*/
-static uint16_t DNSTcpProbeResponse(Flow *f, uint8_t *input, uint32_t len,
- uint32_t *offset)
+static uint16_t DNSTcpProbeResponse(Flow *f, uint8_t *input, uint32_t len)
{
if (len == 0 || len < sizeof(DNSTcpHeader)) {
return ALPROTO_UNKNOWN;
local_data);
}
-static uint16_t DNSUDPProbe(Flow *f, uint8_t *input, uint32_t len,
- uint32_t *offset)
+static uint16_t DNSUDPProbe(Flow *f, uint8_t *input, uint32_t len)
{
if (len == 0 || len < sizeof(DNSHeader)) {
return ALPROTO_UNKNOWN;
SCReturnInt(-1);
}
-static uint16_t DNSUdpProbingParser(Flow *f, uint8_t *input, uint32_t ilen,
- uint32_t *offset)
+static uint16_t DNSUdpProbingParser(Flow *f, uint8_t *input, uint32_t ilen)
{
if (ilen == 0 || ilen < sizeof(DNSHeader)) {
SCLogDebug("ilen too small, hoped for at least %"PRIuMAX, (uintmax_t)sizeof(DNSHeader));
-static uint16_t ENIPProbingParser(Flow *f, uint8_t *input, uint32_t input_len,
- uint32_t *offset)
+static uint16_t ENIPProbingParser(Flow *f, uint8_t *input, uint32_t input_len)
{
// SCLogDebug("ENIPProbingParser %d", input_len);
if (input_len < sizeof(ENIPEncapHdr))
static uint16_t ModbusProbingParser(Flow *f,
uint8_t *input,
- uint32_t input_len,
- uint32_t *offset)
+ uint32_t input_len)
{
ModbusHeader *header = (ModbusHeader *) input;
* \retval ALPROTO_NFS if it looks like echo, otherwise
* ALPROTO_UNKNOWN.
*/
-static AppProto NFSTCPProbingParserTS(Flow *f, uint8_t *input, uint32_t input_len,
- uint32_t *offset)
+static AppProto NFSTCPProbingParserTS(Flow *f, uint8_t *input, uint32_t input_len)
{
if (input_len < NFSTCP_MIN_FRAME_LEN) {
return ALPROTO_UNKNOWN;
return ALPROTO_UNKNOWN;
}
-static AppProto NFSTCPProbingParserTC(Flow *f, uint8_t *input, uint32_t input_len,
- uint32_t *offset)
+static AppProto NFSTCPProbingParserTC(Flow *f, uint8_t *input, uint32_t input_len)
{
if (input_len < NFSTCP_MIN_FRAME_LEN) {
return ALPROTO_UNKNOWN;
* \retval ALPROTO_NFS if it looks like echo, otherwise
* ALPROTO_UNKNOWN.
*/
-static AppProto NFSProbingParserTS(Flow *f, uint8_t *input, uint32_t input_len,
- uint32_t *offset)
+static AppProto NFSProbingParserTS(Flow *f, uint8_t *input, uint32_t input_len)
{
SCLogDebug("probing");
if (input_len < NFS_MIN_FRAME_LEN) {
return ALPROTO_UNKNOWN;
}
-static AppProto NFSProbingParserTC(Flow *f, uint8_t *input, uint32_t input_len,
- uint32_t *offset)
+static AppProto NFSProbingParserTC(Flow *f, uint8_t *input, uint32_t input_len)
{
SCLogDebug("probing");
if (input_len < NFS_MIN_FRAME_LEN) {
}
static uint16_t RustSMBTCPProbe(Flow *f,
- uint8_t *input, uint32_t len, uint32_t *offset)
+ uint8_t *input, uint32_t len)
{
SCLogDebug("RustSMBTCPProbe");
#define SMB_PROBING_PARSER_MIN_DEPTH 8
-static uint16_t SMBProbingParser(Flow *f, uint8_t *input, uint32_t ilen,
- uint32_t *offset)
+static uint16_t SMBProbingParser(Flow *f, uint8_t *input, uint32_t ilen)
{
int32_t len;
int32_t input_len = ilen;
/* do nothing */
}
-static uint16_t SSLProbingParser(Flow *f, uint8_t *input, uint32_t ilen,
- uint32_t *offset)
+static uint16_t SSLProbingParser(Flow *f, uint8_t *input, uint32_t ilen)
{
/* probably a rst/fin sending an eof */
if (ilen == 0)
* \retval ALPROTO_TEMPLATE if it looks like echo, otherwise
* ALPROTO_UNKNOWN.
*/
-static AppProto TemplateProbingParser(Flow *f, uint8_t *input, uint32_t input_len,
- uint32_t *offset)
+static AppProto TemplateProbingParser(Flow *f, uint8_t *input, uint32_t input_len)
{
/* Very simple test - if there is input, this is echo. */
if (input_len >= TEMPLATE_MIN_FRAME_LEN) {
* \retval ALPROTO_TFTP if it looks like echo, otherwise
* ALPROTO_UNKNOWN.
*/
-static AppProto TFTPProbingParser(Flow *f, uint8_t *input, uint32_t input_len,
- uint32_t *offset)
+static AppProto TFTPProbingParser(Flow *f, uint8_t *input, uint32_t input_len)
{
/* Very simple test - if there is input, this is tftp.
* Also check if it's starting by a zero */