|
|
|
@ -13,7 +13,7 @@ const MULTICAST_TUNNELS: u32 = 5;
|
|
|
|
|
pub struct IronForce { |
|
|
|
|
transport: Transport, |
|
|
|
|
tunnels: Vec<Tunnel>, |
|
|
|
|
key_pack: Keys, |
|
|
|
|
pub key_pack: Keys, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
impl IronForce { |
|
|
|
@ -26,7 +26,7 @@ impl IronForce {
|
|
|
|
|
msg.verify() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fn new_message(&self, msg_type: MsgType, body: &Vec<u8>) -> Message { |
|
|
|
|
pub fn new_message(&self, msg_type: MsgType, body: &Vec<u8>) -> Message { |
|
|
|
|
Message::new(msg_type, body.clone(), &self.key_pack) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -76,10 +76,14 @@ impl IronForce {
|
|
|
|
|
self.service_msg(&msg.content.body) |
|
|
|
|
} |
|
|
|
|
MsgType::MultiCast => { |
|
|
|
|
// todo
|
|
|
|
|
self.multicast(msg); |
|
|
|
|
} |
|
|
|
|
MsgType::UniCast(target) => { |
|
|
|
|
// todo
|
|
|
|
|
let tunnel = match &msg.tunnel { |
|
|
|
|
crate::message::MsgTunnel::Tunnel(t) => t, |
|
|
|
|
crate::message::MsgTunnel::NoTunnel => panic!() |
|
|
|
|
} ; |
|
|
|
|
self.send_through_tunnel_to(msg, tunnel, target) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|