pub apply_tx_config: Option<ApplyTxConfigFn>,
pub flags: u32,
+
+ /// Function to handle the end of data coming on one of the sides
+ /// due to the stream reaching its 'depth' limit.
+ pub truncate: Option<TruncateFn>,
}
/// Create a slice, given a buffer and a length
-> AppLayerGetTxIterTuple;
pub type GetTxDataFn = unsafe extern "C" fn(*mut c_void) -> *mut AppLayerTxData;
pub type ApplyTxConfigFn = unsafe extern "C" fn (*mut c_void, *mut c_void, c_int, AppLayerTxConfig);
+pub type TruncateFn = unsafe extern "C" fn (*mut c_void, u8);
+
// Defined in app-layer-register.h
extern {
get_tx_data: rs_template_get_tx_data,
apply_tx_config: None,
flags: APP_LAYER_PARSER_OPT_ACCEPT_GAPS,
+ truncate: None,
};
let ip_proto_str = CString::new("tcp").unwrap();
get_tx_data : rs_dhcp_get_tx_data,
apply_tx_config : None,
flags : 0,
+ truncate : None,
};
let ip_proto_str = CString::new("udp").unwrap();
get_tx_data: rs_dns_state_get_tx_data,
apply_tx_config: Some(rs_dns_apply_tx_config),
flags: APP_LAYER_PARSER_OPT_UNIDIR_TXS,
+ truncate: None,
};
let ip_proto_str = CString::new("udp").unwrap();
get_tx_data: rs_dns_state_get_tx_data,
apply_tx_config: Some(rs_dns_apply_tx_config),
flags: APP_LAYER_PARSER_OPT_ACCEPT_GAPS | APP_LAYER_PARSER_OPT_UNIDIR_TXS,
+ truncate: None,
};
let ip_proto_str = CString::new("tcp").unwrap();
get_tx_data: rs_http2_get_tx_data,
apply_tx_config: None,
flags: 0,
+ truncate: None,
};
let ip_proto_str = CString::new("tcp").unwrap();
get_tx_data : rs_ikev2_get_tx_data,
apply_tx_config : None,
flags : 0,
+ truncate : None,
};
let ip_proto_str = CString::new("udp").unwrap();
get_tx_data : rs_krb5_get_tx_data,
apply_tx_config : None,
flags : 0,
+ truncate : None,
};
// register UDP parser
let ip_proto_str = CString::new("udp").unwrap();
get_tx_data: rs_mqtt_get_tx_data,
apply_tx_config: None,
flags: 0,
+ truncate: None,
};
let ip_proto_str = CString::new("tcp").unwrap();
get_tx_data : rs_ntp_get_tx_data,
apply_tx_config : None,
flags : 0,
+ truncate : None,
};
let ip_proto_str = CString::new("udp").unwrap();
get_tx_data: rs_rdp_get_tx_data,
apply_tx_config: None,
flags: 0,
+ truncate: None,
};
let ip_proto_str = std::ffi::CString::new("tcp").unwrap();
get_tx_data: rs_rfb_get_tx_data,
apply_tx_config: None,
flags: 0,
+ truncate: None,
};
let ip_proto_str = CString::new("tcp").unwrap();
get_tx_data: rs_sip_get_tx_data,
apply_tx_config: None,
flags: 0,
+ truncate: None,
};
let ip_proto_str = CString::new("udp").unwrap();
get_tx_data : rs_snmp_get_tx_data,
apply_tx_config : None,
flags : 0,
+ truncate : None,
};
let ip_proto_str = CString::new("udp").unwrap();
if AppLayerProtoDetectConfProtoDetectionEnabled(ip_proto_str.as_ptr(), parser.name) != 0 {
get_tx_data: rs_ssh_get_tx_data,
apply_tx_config: None,
flags: 0,
+ truncate: None,
};
let ip_proto_str = CString::new("tcp").unwrap();
}
+ if (p->Truncate) {
+ AppLayerParserRegisterTruncateFunc(p->ip_proto, alproto, p->Truncate);
+ }
+
return 0;
}
bool (*ApplyTxConfig)(void *state, void *tx, int mode, AppLayerTxConfig);
uint32_t flags;
+
+ void (*Truncate)(void *state, uint8_t direction);
+
} AppLayerParser;
/**