mirror of
https://github.com/dndx/phantun.git
synced 2025-10-17 19:16:12 +08:00
Some adaption and alligned to the source code from dndx
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "fake-tcp"
|
||||
version = "0.5.0"
|
||||
version = "0.5.5"
|
||||
edition = "2021"
|
||||
authors = ["Datong Sun <dndx@idndx.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
@@ -16,10 +16,10 @@ benchmark = []
|
||||
|
||||
[dependencies]
|
||||
bytes = "1.4.0"
|
||||
pnet = "0.33.0"
|
||||
pnet = "0.34.0"
|
||||
tokio = { version = "1.28.0", features = ["full"] }
|
||||
rand = { version = "0.8.5", features = ["small_rng"] }
|
||||
log = "0.4.17"
|
||||
internet-checksum = "0.2.1"
|
||||
tokio-tun = "0.7"
|
||||
flume = "0.10.14"
|
||||
tokio-tun = "0.9.1"
|
||||
flume ="0.11.0"
|
||||
|
@@ -146,7 +146,7 @@ impl Socket {
|
||||
)
|
||||
}
|
||||
|
||||
fn build_tcp_packet(&self, flags: u16, payload: Option<&[u8]>) -> Bytes {
|
||||
fn build_tcp_packet(&self, flags: u8, payload: Option<&[u8]>) -> Bytes {
|
||||
let ack = self.ack.load(Ordering::Relaxed);
|
||||
self.last_ack.store(ack, Ordering::Relaxed);
|
||||
|
||||
|
@@ -36,7 +36,7 @@ pub fn build_tcp_packet(
|
||||
remote_addr: SocketAddr,
|
||||
seq: u32,
|
||||
ack: u32,
|
||||
flags: u16,
|
||||
flags: u8,
|
||||
payload: Option<&[u8]>,
|
||||
) -> Bytes {
|
||||
let ip_header_len = match local_addr {
|
||||
|
Reference in New Issue
Block a user