mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp: index peers by packet src ip and provided port instead of peer_id
This commit is contained in:
parent
df13ae9399
commit
0eaa4475e2
4 changed files with 27 additions and 27 deletions
|
|
@ -5,7 +5,7 @@ pub use aquatic_peer_id::{PeerClient, PeerId};
|
|||
use zerocopy::network_endian::{I32, I64, U16, U32};
|
||||
use zerocopy::{AsBytes, FromBytes, FromZeroes};
|
||||
|
||||
pub trait Ip: Clone + Copy + Debug + PartialEq + Eq + AsBytes {}
|
||||
pub trait Ip: Clone + Copy + Debug + PartialEq + Eq + std::hash::Hash + AsBytes {}
|
||||
|
||||
#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug, AsBytes, FromBytes, FromZeroes)]
|
||||
#[repr(transparent)]
|
||||
|
|
@ -91,7 +91,7 @@ impl PeerKey {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Copy, Debug, AsBytes, FromBytes, FromZeroes)]
|
||||
#[derive(PartialEq, Eq, Clone, Copy, Debug, Hash, AsBytes, FromBytes, FromZeroes)]
|
||||
#[repr(C, packed)]
|
||||
pub struct ResponsePeer<I: Ip> {
|
||||
pub ip_address: I,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue