aboutsummaryrefslogtreecommitdiffstats
path: root/src/wireguard/tests.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-21 00:17:31 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-21 00:17:31 +0100
commitaabefa50436af8d614520bb219d675953eeba6eb (patch)
tree9186ef07b94f12e75040d5163477ef1e549cee14 /src/wireguard/tests.rs
parentConstant renamed to be consistent with kernel WG (diff)
downloadwireguard-rs-aabefa50436af8d614520bb219d675953eeba6eb.tar.xz
wireguard-rs-aabefa50436af8d614520bb219d675953eeba6eb.zip
Remove unused test code.
- make naming consistent with the kernel module. - better distribution of functionality from src/wireguard.rs - more consistent "import pattern" throughout the project. - remove unused test code.
Diffstat (limited to 'src/wireguard/tests.rs')
-rw-r--r--src/wireguard/tests.rs16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/wireguard/tests.rs b/src/wireguard/tests.rs
index 3cccb42..f71576a 100644
--- a/src/wireguard/tests.rs
+++ b/src/wireguard/tests.rs
@@ -14,20 +14,6 @@ use x25519_dalek::{PublicKey, StaticSecret};
use pnet::packet::ipv4::MutableIpv4Packet;
use pnet::packet::ipv6::MutableIpv6Packet;
-pub fn make_packet_src(size: usize, src: IpAddr, id: u64) -> Vec<u8> {
- match src {
- IpAddr::V4(_) => make_packet(size, src, "127.0.0.1".parse().unwrap(), id),
- IpAddr::V6(_) => make_packet(size, src, "::1".parse().unwrap(), id),
- }
-}
-
-pub fn make_packet_dst(size: usize, dst: IpAddr, id: u64) -> Vec<u8> {
- match dst {
- IpAddr::V4(_) => make_packet(size, "127.0.0.1".parse().unwrap(), dst, id),
- IpAddr::V6(_) => make_packet(size, "::1".parse().unwrap(), dst, id),
- }
-}
-
pub fn make_packet(size: usize, src: IpAddr, dst: IpAddr, id: u64) -> Vec<u8> {
// expand pseudo random payload
let mut rng: _ = ChaCha8Rng::seed_from_u64(id);
@@ -104,7 +90,7 @@ fn test_pure_wireguard() {
wg1.add_udp_reader(bind_reader1);
wg2.add_udp_reader(bind_reader2);
- // generate (public, pivate) key pairs
+ // generate (public, private) key pairs
let sk1 = StaticSecret::from([
0x3f, 0x69, 0x86, 0xd1, 0xc0, 0xec, 0x25, 0xa0, 0x9c, 0x8e, 0x56, 0xb5, 0x1d, 0xb7, 0x3c,