// written by Pierre Chifflier <chifflier@wzdftpd.net>
-use libc;
use snmp::snmp::SNMPTransaction;
#[no_mangle]
pub extern "C" fn rs_snmp_tx_get_version(tx: &mut SNMPTransaction,
- version: *mut libc::uint32_t)
+ version: *mut u32)
{
debug_assert!(tx.version != 0, "SNMP version is 0");
unsafe {
- *version = tx.version as libc::uint32_t;
+ *version = tx.version as u32;
}
}
#[no_mangle]
pub extern "C" fn rs_snmp_tx_get_community(tx: &mut SNMPTransaction,
- buf: *mut *const libc::uint8_t,
- len: *mut libc::uint32_t)
+ buf: *mut *const u8,
+ len: *mut u32)
{
match tx.community {
Some(ref c) => {
unsafe {
*buf = (&c).as_ptr();
- *len = c.len() as libc::uint32_t;
+ *len = c.len() as u32;
}
},
None => ()
#[no_mangle]
pub extern "C" fn rs_snmp_tx_get_pdu_type(tx: &mut SNMPTransaction,
- pdu_type: *mut libc::uint32_t)
+ pdu_type: *mut u32)
{
unsafe {
match tx.info {
Some(ref info) => {
- *pdu_type = info.pdu_type.0 as libc::uint32_t;
+ *pdu_type = info.pdu_type.0 as u32;
},
None => {
*pdu_type = 0xffffffff;
pub extern "C" fn rs_snmp_parse_request(_flow: *const core::Flow,
state: *mut libc::c_void,
_pstate: *mut libc::c_void,
- input: *const libc::uint8_t,
+ input: *const u8,
input_len: u32,
_data: *const libc::c_void,
_flags: u8) -> i32 {
pub extern "C" fn rs_snmp_parse_response(_flow: *const core::Flow,
state: *mut libc::c_void,
_pstate: *mut libc::c_void,
- input: *const libc::uint8_t,
+ input: *const u8,
input_len: u32,
_data: *const libc::c_void,
_flags: u8) -> i32 {
#[no_mangle]
pub extern "C" fn rs_snmp_state_get_tx(state: *mut libc::c_void,
- tx_id: libc::uint64_t)
+ tx_id: u64)
-> *mut libc::c_void
{
let state = cast_pointer!(state,SNMPState);
#[no_mangle]
pub extern "C" fn rs_snmp_state_get_tx_count(state: *mut libc::c_void)
- -> libc::uint64_t
+ -> u64
{
let state = cast_pointer!(state,SNMPState);
state.tx_id
#[no_mangle]
pub extern "C" fn rs_snmp_state_tx_free(state: *mut libc::c_void,
- tx_id: libc::uint64_t)
+ tx_id: u64)
{
let state = cast_pointer!(state,SNMPState);
state.free_tx(tx_id);
#[no_mangle]
pub extern "C" fn rs_snmp_state_progress_completion_status(
- _direction: libc::uint8_t)
+ _direction: u8)
-> libc::c_int
{
return 1;
#[no_mangle]
pub extern "C" fn rs_snmp_tx_get_alstate_progress(_tx: *mut libc::c_void,
- _direction: libc::uint8_t)
+ _direction: u8)
-> libc::c_int
{
1
#[no_mangle]
pub extern "C" fn rs_snmp_tx_set_logged(_state: *mut libc::c_void,
tx: *mut libc::c_void,
- logged: libc::uint32_t)
+ logged: u32)
{
let tx = cast_pointer!(tx,SNMPTransaction);
tx.logged.set(logged);
#[no_mangle]
pub extern "C" fn rs_snmp_state_get_events(state: *mut libc::c_void,
- tx_id: libc::uint64_t)
+ tx_id: u64)
-> *mut core::AppLayerDecoderEvents
{
let state = cast_pointer!(state,SNMPState);
#[no_mangle]
pub extern "C" fn rs_snmp_state_get_tx_iterator(
state: &mut SNMPState,
- min_tx_id: libc::uint64_t,
- istate: &mut libc::uint64_t)
+ min_tx_id: u64,
+ istate: &mut u64)
-> applayer::AppLayerGetTxIterTuple
{
match state.get_tx_iterator(min_tx_id, istate) {
#[no_mangle]
pub extern "C" fn rs_snmp_probing_parser(_flow: *const Flow,
_direction: u8,
- input:*const libc::uint8_t,
+ input:*const u8,
input_len: u32,
_rdir: *mut u8) -> AppProto {
let slice = build_slice!(input,input_len as usize);