"FtpRequestCommand",
"FtpStateValues",
"FtpDataStateValues",
+ "HTTP2TransactionState",
"SCSigTableAppLiteElmt",
"SCTransformTableElmt",
"DataRepType",
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_has_frametype(
+pub unsafe extern "C" fn SCHttp2TxHasFrametype(
tx: *mut std::os::raw::c_void, direction: u8, value: u8,
) -> std::os::raw::c_int {
let tx = cast_pointer!(tx, HTTP2Transaction);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_parse_frametype(
+pub unsafe extern "C" fn SCHttp2ParseFrametype(
str: *const std::os::raw::c_char,
) -> std::os::raw::c_int {
let ft_name: &CStr = CStr::from_ptr(str); //unsafe
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_has_errorcode(
+pub unsafe extern "C" fn SCHttp2TxHasErrorCode(
tx: *mut std::os::raw::c_void, direction: u8, code: u32,
) -> std::os::raw::c_int {
let tx = cast_pointer!(tx, HTTP2Transaction);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_parse_errorcode(
+pub unsafe extern "C" fn SCHttp2ParseErrorCode(
str: *const std::os::raw::c_char,
) -> std::os::raw::c_int {
let ft_name: &CStr = CStr::from_ptr(str); //unsafe
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_next_priority(
+pub unsafe extern "C" fn SCHttp2TxGetNextPriority(
tx: *mut std::os::raw::c_void, direction: u8, nb: u32,
) -> std::os::raw::c_int {
let tx = cast_pointer!(tx, HTTP2Transaction);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_next_window(
+pub unsafe extern "C" fn SCHttp2TxGetNextWindow(
tx: *mut std::os::raw::c_void, direction: u8, nb: u32,
) -> std::os::raw::c_int {
let tx = cast_pointer!(tx, HTTP2Transaction);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_detect_settingsctx_parse(
+pub unsafe extern "C" fn SCHttp2DetectSettingsCtxParse(
str: *const std::os::raw::c_char,
) -> *mut std::os::raw::c_void {
let ft_name: &CStr = CStr::from_ptr(str); //unsafe
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_detect_settingsctx_free(ctx: *mut std::os::raw::c_void) {
+pub unsafe extern "C" fn SCHttp2DetectSettingsCtxFree(ctx: *mut std::os::raw::c_void) {
// Just unbox...
std::mem::drop(Box::from_raw(ctx as *mut parser::DetectHTTP2settingsSigCtx));
}
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_detect_settingsctx_match(
+pub unsafe extern "C" fn SCHttp2DetectSettingsCtxMatch(
ctx: *const std::os::raw::c_void, tx: *mut std::os::raw::c_void, direction: u8,
) -> std::os::raw::c_int {
let ctx = cast_pointer!(ctx, parser::DetectHTTP2settingsSigCtx);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_detect_sizeupdatectx_match(
+pub unsafe extern "C" fn SCHttp2DetectSizeUpdateCtxMatch(
ctx: *const std::os::raw::c_void, tx: *mut std::os::raw::c_void, direction: u8,
) -> std::os::raw::c_int {
let ctx = cast_pointer!(ctx, DetectUintData<u64>);
return http2_detect_sizeupdatectx_match(ctx, tx, direction.into());
}
-//TODOask better syntax between rs_http2_tx_get_header_name in argument
-// and rs_http2_detect_sizeupdatectx_match explicitly casting
+//TODOask better syntax between SCHttp2TxGetHeaderName in argument
+// and SCHttp2DetectSizeUpdateCtxMatch explicitly casting
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_header_name(
+pub unsafe extern "C" fn SCHttp2TxGetHeaderName(
_de: *mut DetectEngineThreadCtx, tx: *const c_void, direction: u8, nb: u32,
buffer: *mut *const u8, buffer_len: *mut u32,
) -> bool {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_request_line(
+pub unsafe extern "C" fn SCHttp2TxGetRequestLine(
tx: &mut HTTP2Transaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
http2_tx_get_req_line(tx);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_response_line(
+pub unsafe extern "C" fn SCHttp2TxGetResponseLine(
tx: &mut HTTP2Transaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
http2_tx_get_resp_line(tx);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_uri(
+pub unsafe extern "C" fn SCHttp2TxGetUri(
tx: &mut HTTP2Transaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Ok(value) = http2_frames_get_header_firstvalue(tx, Direction::ToServer, ":path") {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_method(
+pub unsafe extern "C" fn SCHttp2TxGetMethod(
tx: &mut HTTP2Transaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Ok(value) = http2_frames_get_header_firstvalue(tx, Direction::ToServer, ":method") {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_host(
+pub unsafe extern "C" fn SCHttp2TxGetHost(
tx: &mut HTTP2Transaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Ok(value) = http2_frames_get_header_value(tx, Direction::ToServer, ":authority") {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_host_norm(
+pub unsafe extern "C" fn SCHttp2TxGetHostNorm(
tx: &mut HTTP2Transaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Ok(value) = http2_frames_get_header_value(tx, Direction::ToServer, ":authority") {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_useragent(
+pub unsafe extern "C" fn SCHttp2TxGetUserAgent(
tx: &mut HTTP2Transaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Ok(value) = http2_frames_get_header_value(tx, Direction::ToServer, "user-agent") {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_status(
+pub unsafe extern "C" fn SCHttp2TxGetStatus(
tx: &mut HTTP2Transaction, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if let Ok(value) = http2_frames_get_header_firstvalue(tx, Direction::ToClient, ":status") {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_cookie(
+pub unsafe extern "C" fn SCHttp2TxGetCookie(
tx: &mut HTTP2Transaction, direction: u8, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
if direction == u8::from(Direction::ToServer) {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_header_value(
+pub unsafe extern "C" fn SCHttp2TxGetHeaderValue(
tx: &mut HTTP2Transaction, direction: u8, strname: *const std::os::raw::c_char,
buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_header_names(
+pub unsafe extern "C" fn SCHttp2TxGetHeaderNames(
tx: &mut HTTP2Transaction, direction: u8, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
let mut vec = vec![b'\r', b'\n'];
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_headers(
+pub unsafe extern "C" fn SCHttp2TxGetHeaders(
tx: &mut HTTP2Transaction, direction: u8, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
let mut vec = Vec::new();
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_headers_raw(
+pub unsafe extern "C" fn SCHttp2TxGetHeadersRaw(
tx: &mut HTTP2Transaction, direction: u8, buffer: *mut *const u8, buffer_len: *mut u32,
) -> u8 {
let mut vec = Vec::new();
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_header(
+pub unsafe extern "C" fn SCHttp2TxGetHeader(
_de: *mut DetectEngineThreadCtx, tx: *const c_void, direction: u8, nb: u32,
buffer: *mut *const u8, buffer_len: *mut u32,
) -> bool {
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_set_method(
+pub unsafe extern "C" fn SCHttp2TxSetMethod(
state: &mut HTTP2State, buffer: *const u8, buffer_len: u32,
) {
let slice = build_slice!(buffer, buffer_len as usize);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_set_uri(
+pub unsafe extern "C" fn SCHttp2TxSetUri(
state: &mut HTTP2State, buffer: *const u8, buffer_len: u32,
) {
let slice = build_slice!(buffer, buffer_len as usize);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_add_header(
+pub unsafe extern "C" fn SCHttp2TxAddHeader(
state: &mut HTTP2State, name: *const u8, name_len: u32, value: *const u8, value_len: u32,
) {
let slice_name = build_slice!(name, name_len as usize);
pub static mut SURICATA_HTTP2_FILE_CONFIG: Option<&'static SuricataFileContext> = None;
#[no_mangle]
-pub extern "C" fn rs_http2_init(context: &'static mut SuricataFileContext) {
+pub extern "C" fn SCHttp2Init(context: &'static mut SuricataFileContext) {
unsafe {
SURICATA_HTTP2_FILE_CONFIG = Some(context);
}
export_state_data_get!(http2_get_state_data, HTTP2State);
/// C entry point for a probing parser.
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_probing_parser_tc(
+unsafe extern "C" fn http2_probing_parser_tc(
_flow: *const Flow, _direction: u8, input: *const u8, input_len: u32, _rdir: *mut u8,
) -> AppProto {
if !input.is_null() {
// Suppress the unsafe warning here as creating a state for an app-layer
// is typically not unsafe.
-#[no_mangle]
#[allow(clippy::not_unsafe_ptr_arg_deref)]
-pub extern "C" fn rs_http2_state_new(
+extern "C" fn http2_state_new(
orig_state: *mut std::os::raw::c_void, _orig_proto: AppProto,
) -> *mut std::os::raw::c_void {
let state = HTTP2State::new();
return r;
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_state_free(state: *mut std::os::raw::c_void) {
+unsafe extern "C" fn http2_state_free(state: *mut std::os::raw::c_void) {
let mut state: Box<HTTP2State> = Box::from_raw(state as _);
state.free();
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_state_tx_free(state: *mut std::os::raw::c_void, tx_id: u64) {
+unsafe extern "C" fn http2_state_tx_free(state: *mut std::os::raw::c_void, tx_id: u64) {
let state = cast_pointer!(state, HTTP2State);
state.free_tx(tx_id);
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_parse_ts(
+unsafe extern "C" fn http2_parse_ts(
flow: *const Flow, state: *mut std::os::raw::c_void, _pstate: *mut std::os::raw::c_void,
stream_slice: StreamSlice, _data: *const std::os::raw::c_void,
) -> AppLayerResult {
return state.parse_ts(flow, stream_slice);
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_parse_tc(
+unsafe extern "C" fn http2_parse_tc(
flow: *const Flow, state: *mut std::os::raw::c_void, _pstate: *mut std::os::raw::c_void,
stream_slice: StreamSlice, _data: *const std::os::raw::c_void,
) -> AppLayerResult {
return state.parse_tc(flow, stream_slice);
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_state_get_tx(
+unsafe extern "C" fn http2_state_get_tx(
state: *mut std::os::raw::c_void, tx_id: u64,
) -> *mut std::os::raw::c_void {
let state = cast_pointer!(state, HTTP2State);
}
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_state_get_tx_count(state: *mut std::os::raw::c_void) -> u64 {
+unsafe extern "C" fn http2_state_get_tx_count(state: *mut std::os::raw::c_void) -> u64 {
let state = cast_pointer!(state, HTTP2State);
return state.tx_id;
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_state(
+unsafe extern "C" fn http2_tx_get_state(
tx: *mut std::os::raw::c_void,
) -> HTTP2TransactionState {
let tx = cast_pointer!(tx, HTTP2Transaction);
return tx.state;
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_tx_get_alstate_progress(
+unsafe extern "C" fn http2_tx_get_alstate_progress(
tx: *mut std::os::raw::c_void, _direction: u8,
) -> std::os::raw::c_int {
- return rs_http2_tx_get_state(tx) as i32;
+ return http2_tx_get_state(tx) as i32;
}
-#[no_mangle]
-pub unsafe extern "C" fn rs_http2_getfiles(
+unsafe extern "C" fn http2_getfiles(
tx: *mut std::os::raw::c_void, direction: u8,
) -> AppLayerGetFileState {
let tx = cast_pointer!(tx, HTTP2Transaction);
const PARSER_NAME: &[u8] = b"http2\0";
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_register_parser() {
+pub unsafe extern "C" fn SCRegisterHttp2Parser() {
let default_port = CString::new("[80]").unwrap();
let mut parser = RustParser {
name: PARSER_NAME.as_ptr() as *const std::os::raw::c_char,
default_port: default_port.as_ptr(),
ipproto: IPPROTO_TCP,
probe_ts: None, // big magic string should be enough
- probe_tc: Some(rs_http2_probing_parser_tc),
+ probe_tc: Some(http2_probing_parser_tc),
min_depth: HTTP2_FRAME_HEADER_LEN as u16,
max_depth: HTTP2_MAGIC_LEN as u16,
- state_new: rs_http2_state_new,
- state_free: rs_http2_state_free,
- tx_free: rs_http2_state_tx_free,
- parse_ts: rs_http2_parse_ts,
- parse_tc: rs_http2_parse_tc,
- get_tx_count: rs_http2_state_get_tx_count,
- get_tx: rs_http2_state_get_tx,
+ state_new: http2_state_new,
+ state_free: http2_state_free,
+ tx_free: http2_state_tx_free,
+ parse_ts: http2_parse_ts,
+ parse_tc: http2_parse_tc,
+ get_tx_count: http2_state_get_tx_count,
+ get_tx: http2_state_get_tx,
tx_comp_st_ts: HTTP2TransactionState::HTTP2StateClosed as i32,
tx_comp_st_tc: HTTP2TransactionState::HTTP2StateClosed as i32,
- tx_get_progress: rs_http2_tx_get_alstate_progress,
+ tx_get_progress: http2_tx_get_alstate_progress,
get_eventinfo: Some(HTTP2Event::get_event_info),
get_eventinfo_byid: Some(HTTP2Event::get_event_info_by_id),
localstorage_new: None,
localstorage_free: None,
- get_tx_files: Some(rs_http2_getfiles),
+ get_tx_files: Some(http2_getfiles),
get_tx_iterator: Some(applayer::state_get_tx_iterator::<HTTP2State, HTTP2Transaction>),
get_tx_data: http2_get_tx_data,
get_state_data: http2_get_state_data,
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http2_log_json(
+pub unsafe extern "C" fn SCHttp2LogJson(
tx: *mut std::os::raw::c_void, js: &mut JsonBuilder,
) -> bool {
let tx = cast_pointer!(tx, HTTP2Transaction);
}
#[no_mangle]
-pub unsafe extern "C" fn rs_http_parse_content_range(
+pub unsafe extern "C" fn SCHttpParseContentRange(
cr: &mut HTTPContentRange, buffer: *const u8, buffer_len: u32,
) -> std::os::raw::c_int {
let slice = build_slice!(buffer, buffer_len as usize);
int HTPParseContentRange(const bstr *rawvalue, HTTPContentRange *range)
{
uint32_t len = (uint32_t)bstr_len(rawvalue);
- return rs_http_parse_content_range(range, bstr_ptr(rawvalue), len);
+ return SCHttpParseContentRange(range, bstr_ptr(rawvalue), len);
}
/**
if (HTTP2RegisterPatternsForProtocolDetection() < 0)
return;
- rs_http2_init(&sfc);
- rs_http2_register_parser();
+ SCHttp2Init(&sfc);
+ SCRegisterHttp2Parser();
}
#ifdef UNITTESTS
return;
}
// else
- rs_http2_tx_set_method(h2s, bstr_ptr(htp_tx_request_method(h1tx)),
+ SCHttp2TxSetMethod(h2s, bstr_ptr(htp_tx_request_method(h1tx)),
(uint32_t)bstr_len(htp_tx_request_method(h1tx)));
if (htp_tx_request_uri(h1tx) != NULL) {
// A request line without spaces gets interpreted as a request_method
// and has request_uri=NULL
- rs_http2_tx_set_uri(h2s, bstr_ptr(htp_tx_request_uri(h1tx)),
+ SCHttp2TxSetUri(h2s, bstr_ptr(htp_tx_request_uri(h1tx)),
(uint32_t)bstr_len(htp_tx_request_uri(h1tx)));
}
size_t nbheaders = htp_tx_request_headers_size(h1tx);
for (size_t i = 0; i < nbheaders; i++) {
const htp_header_t *h = htp_tx_request_header_index(h1tx, i);
- rs_http2_tx_add_header(h2s, htp_header_name_ptr(h), (uint32_t)htp_header_name_len(h),
+ SCHttp2TxAddHeader(h2s, htp_header_name_ptr(h), (uint32_t)htp_header_name_len(h),
htp_header_value_ptr(h), (uint32_t)htp_header_value_len(h));
}
}
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_cookie(txv, STREAM_TOSERVER, &b, &b_len) != 1)
+ if (SCHttp2TxGetCookie(txv, STREAM_TOSERVER, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_cookie(txv, STREAM_TOCLIENT, &b, &b_len) != 1)
+ if (SCHttp2TxGetCookie(txv, STREAM_TOCLIENT, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_header_names(txv, flow_flags, &b, &b_len) != 1)
+ if (SCHttp2TxGetHeaderNames(txv, flow_flags, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_headers(txv, flow_flags, &b, &b_len) != 1)
+ if (SCHttp2TxGetHeaders(txv, flow_flags, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
SIGMATCH_NOOPT | SIGMATCH_INFO_STICKY_BUFFER;
DetectAppLayerMultiRegister("http_request_header", ALPROTO_HTTP2, SIG_FLAG_TOSERVER,
- HTTP2StateOpen, rs_http2_tx_get_header, 2);
+ HTTP2StateOpen, SCHttp2TxGetHeader, 2);
DetectAppLayerMultiRegister("http_request_header", ALPROTO_HTTP1, SIG_FLAG_TOSERVER,
HTP_REQUEST_PROGRESS_HEADERS, GetHttp1HeaderData, 2);
SIGMATCH_NOOPT | SIGMATCH_INFO_STICKY_BUFFER;
DetectAppLayerMultiRegister("http_response_header", ALPROTO_HTTP2, SIG_FLAG_TOCLIENT,
- HTTP2StateOpen, rs_http2_tx_get_header, 2);
+ HTTP2StateOpen, SCHttp2TxGetHeader, 2);
DetectAppLayerMultiRegister("http_response_header", ALPROTO_HTTP1, SIG_FLAG_TOCLIENT,
HTP_RESPONSE_PROGRESS_HEADERS, GetHttp1HeaderData, 2);
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_header_value(txv, STREAM_TOSERVER, HEADER_NAME, &b, &b_len) != 1)
+ if (SCHttp2TxGetHeaderValue(txv, STREAM_TOSERVER, HEADER_NAME, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_header_value(txv, STREAM_TOCLIENT, HEADER_NAME, &b, &b_len) != 1)
+ if (SCHttp2TxGetHeaderValue(txv, STREAM_TOCLIENT, HEADER_NAME, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_host_norm(txv, &b, &b_len) != 1)
+ if (SCHttp2TxGetHostNorm(txv, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_host(txv, &b, &b_len) != 1)
+ if (SCHttp2TxGetHost(txv, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_method(txv, &b, &b_len) != 1)
+ if (SCHttp2TxGetMethod(txv, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_headers_raw(txv, flow_flags, &b, &b_len) != 1)
+ if (SCHttp2TxGetHeadersRaw(txv, flow_flags, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_request_line(txv, &b, &b_len) != 1)
+ if (SCHttp2TxGetRequestLine(txv, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_response_line(txv, &b, &b_len) != 1)
+ if (SCHttp2TxGetResponseLine(txv, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_status(txv, &b, &b_len) != 1)
+ if (SCHttp2TxGetStatus(txv, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_useragent(txv, &b, &b_len) != 1)
+ if (SCHttp2TxGetUserAgent(txv, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
uint32_t b_len = 0;
const uint8_t *b = NULL;
- if (rs_http2_tx_get_uri(txv, &b, &b_len) != 1)
+ if (SCHttp2TxGetUri(txv, &b, &b_len) != 1)
return NULL;
if (b == NULL || b_len == 0)
return NULL;
sigmatch_table[DETECT_HTTP2_HEADERNAME].flags |= SIGMATCH_NOOPT | SIGMATCH_INFO_STICKY_BUFFER;
DetectAppLayerMultiRegister("http2_header_name", ALPROTO_HTTP2, SIG_FLAG_TOCLIENT,
- HTTP2StateOpen, rs_http2_tx_get_header_name, 2);
+ HTTP2StateOpen, SCHttp2TxGetHeaderName, 2);
DetectAppLayerMultiRegister("http2_header_name", ALPROTO_HTTP2, SIG_FLAG_TOSERVER,
- HTTP2StateOpen, rs_http2_tx_get_header_name, 2);
+ HTTP2StateOpen, SCHttp2TxGetHeaderName, 2);
DetectBufferTypeSupportsMultiInstance("http2_header_name");
DetectBufferTypeSetDescriptionByName("http2_header_name",
{
uint8_t *detect = (uint8_t *)ctx;
- return rs_http2_tx_has_frametype(txv, flags, *detect);
+ return SCHttp2TxHasFrametype(txv, flags, *detect);
}
static int DetectHTTP2FuncParseFrameType(const char *str, uint8_t *ft)
}
// it it failed so far, parse string value from enumeration
- int r = rs_http2_parse_frametype(str);
+ int r = SCHttp2ParseFrametype(str);
if (r >= 0 && r <= UINT8_MAX) {
*ft = (uint8_t)r;
return 1;
{
uint32_t *detect = (uint32_t *)ctx;
- return rs_http2_tx_has_errorcode(txv, flags, *detect);
+ return SCHttp2TxHasErrorCode(txv, flags, *detect);
//TODOask handle negation rules
}
}
// it it failed so far, parse string value from enumeration
- int r = rs_http2_parse_errorcode(str);
+ int r = SCHttp2ParseErrorCode(str);
if (r >= 0) {
*ec = r;
return 1;
{
uint32_t nb = 0;
- int value = rs_http2_tx_get_next_priority(txv, flags, nb);
+ int value = SCHttp2TxGetNextPriority(txv, flags, nb);
const DetectU8Data *du8 = (const DetectU8Data *)ctx;
while (value >= 0) {
if (DetectU8Match((uint8_t)value, du8)) {
return 1;
}
nb++;
- value = rs_http2_tx_get_next_priority(txv, flags, nb);
+ value = SCHttp2TxGetNextPriority(txv, flags, nb);
}
return 0;
}
{
uint32_t nb = 0;
- int value = rs_http2_tx_get_next_window(txv, flags, nb);
+ int value = SCHttp2TxGetNextWindow(txv, flags, nb);
const DetectU32Data *du32 = (const DetectU32Data *)ctx;
while (value >= 0) {
if (DetectU32Match(value, du32)) {
return 1;
}
nb++;
- value = rs_http2_tx_get_next_window(txv, flags, nb);
+ value = SCHttp2TxGetNextWindow(txv, flags, nb);
}
return 0;
}
const SigMatchCtx *ctx)
{
- return rs_http2_detect_sizeupdatectx_match(ctx, txv, flags);
+ return SCHttp2DetectSizeUpdateCtxMatch(ctx, txv, flags);
}
/**
const SigMatchCtx *ctx)
{
- return rs_http2_detect_settingsctx_match(ctx, txv, flags);
+ return SCHttp2DetectSettingsCtxMatch(ctx, txv, flags);
}
/**
if (DetectSignatureSetAppProto(s, ALPROTO_HTTP2) != 0)
return -1;
- void *http2set = rs_http2_detect_settingsctx_parse(str);
+ void *http2set = SCHttp2DetectSettingsCtxParse(str);
if (http2set == NULL)
return -1;
*/
void DetectHTTP2settingsFree(DetectEngineCtx *de_ctx, void *ptr)
{
- rs_http2_detect_settingsctx_free(ptr);
+ SCHttp2DetectSettingsCtxFree(ptr);
}
static int DetectHTTP2headerNameSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
SCJbGetMark(js, &mark);
// first log HTTP2 part
- bool r = rs_http2_log_json(txptr, js);
+ bool r = SCHttp2LogJson(txptr, js);
if (!r) {
SCJbRestoreMark(js, &mark);
}
SCJbGetMark(jb, &mark);
// first log HTTP2 part
- bool r = rs_http2_log_json(txptr, jb);
+ bool r = SCHttp2LogJson(txptr, jb);
if (!r) {
SCJbRestoreMark(jb, &mark);
}
ALPROTO_TEMPLATE, (EveJsonSimpleTxLogFunc)rs_template_logger_log, NULL);
RegisterSimpleJsonApplayerLogger(ALPROTO_RDP, (EveJsonSimpleTxLogFunc)SCRdpToJson, NULL);
// special case : http2 is logged in http object
- RegisterSimpleJsonApplayerLogger(
- ALPROTO_HTTP2, (EveJsonSimpleTxLogFunc)rs_http2_log_json, "http");
+ RegisterSimpleJsonApplayerLogger(ALPROTO_HTTP2, (EveJsonSimpleTxLogFunc)SCHttp2LogJson, "http");
// underscore instead of dash for bittorrent_dht
RegisterSimpleJsonApplayerLogger(ALPROTO_BITTORRENT_DHT,
(EveJsonSimpleTxLogFunc)SCBittorrentDhtLogger, "bittorrent_dht");