This commit is contained in:
Dominik Maier 2020-12-08 17:41:23 +01:00
parent 4a65e25def
commit 6f25fabe07
5 changed files with 243 additions and 515 deletions

View File

@ -33,5 +33,4 @@ num = "*"
xxhash-rust = { version = "0.8.0", features = ["xxh3"] } # xxh3 hashing for rust xxhash-rust = { version = "0.8.0", features = ["xxh3"] } # xxh3 hashing for rust
serde = { version = "1.0", default-features = false, features = ["alloc"] } # serialization lib serde = { version = "1.0", default-features = false, features = ["alloc"] } # serialization lib
erased-serde = "0.3.12" erased-serde = "0.3.12"
postcard = "0.5.1" # no_std compatible serde serialization fromat postcard = "0.5.1" # no_std compatible serde serialization fromat
memoffset = "0.6" # for offset_of support

View File

@ -1,5 +1,4 @@
use core::marker::PhantomData; use core::marker::PhantomData;
use core::ptr;
use std::{ffi::c_void, io::Read, io::Write, net::TcpListener}; use std::{ffi::c_void, io::Read, io::Write, net::TcpListener};
use crate::{ use crate::{
@ -7,11 +6,12 @@ use crate::{
}; };
use super::{ use super::{
llmp_translated::{LlmpBroker, LlmpClient, LlmpClientloopFn, LlmpMsgHookFn}, llmp_translated::{LlmpBroker, LlmpClient, LlmpMsgHookFn},
Event, EventManager, Event, EventManager,
}; };
pub unsafe fn llmp_tcp_server_clientloop(client: *mut LlmpClient, _data: *mut c_void) -> ! { /*
pub unsafe fn llmp_tcp_server_clientloop(client: &mut LlmpClient, _data: *mut c_void) -> ! {
// Later in the execution, after the initial map filled up, // Later in the execution, after the initial map filled up,
// the current broacast map will will point to a different map. // the current broacast map will will point to a different map.
// However, the original map is (as of now) never freed, new clients will start // However, the original map is (as of now) never freed, new clients will start
@ -57,6 +57,7 @@ pub unsafe fn llmp_tcp_server_clientloop(client: *mut LlmpClient, _data: *mut c_
} }
} }
} }
*/
/// Eventmanager for multi-processed application /// Eventmanager for multi-processed application
#[cfg(feature = "std")] #[cfg(feature = "std")]
@ -126,6 +127,7 @@ where
} }
} }
/*
#[cfg(feature = "std")] #[cfg(feature = "std")]
impl<S, C, E, I, R> LLMPEventManager<S, C, E, I, R> impl<S, C, E, I, R> LLMPEventManager<S, C, E, I, R>
where where
@ -141,20 +143,5 @@ where
broker_message_hook: LlmpMsgHookFn, broker_message_hook: LlmpMsgHookFn,
clientloops: LlmpClientloopFn, clientloops: LlmpClientloopFn,
) -> ! { ) -> ! {
unsafe {
let mut broker = LlmpBroker::new().expect("Failed to create llmp");
for i in 0..process_count - 1 {
println!("Adding client {}", i);
broker
.register_childprocess_clientloop(clientloops, ptr::null_mut())
.expect("could not add child clientloop");
}
println!("Spawning broker");
broker.add_message_hook(broker_message_hook, ptr::null_mut());
broker.run();
}
} }
} }*/

File diff suppressed because it is too large Load Diff

View File

@ -94,8 +94,8 @@ impl AflShmem {
Ok(ret) Ok(ret)
} else { } else {
Err(AflError::Unknown(format!( Err(AflError::Unknown(format!(
"Could not allocate map with id {:?}", "Could not allocate map with id {:?} and size {}",
shm_str shm_str, map_size
))) )))
} }
} }

View File

@ -3,10 +3,6 @@
#[macro_use] #[macro_use]
extern crate alloc; extern crate alloc;
#[cfg_attr(feature = "std")]
#[macro_use]
extern crate memoffset; // for offset_of
pub mod corpus; pub mod corpus;
pub mod engines; pub mod engines;
pub mod events; pub mod events;