debug messages for both incoming and outgoing SYNs
This commit is contained in:
parent
b0032c534c
commit
8bff4c79d9
|
@ -282,6 +282,7 @@ proc accept*(puncher: TcpSyniPuncher, srcPort: Port, dstIp: IpAddress,
|
|||
tcpPortSrc: attempt.srcPort, tcpPortDst: dstPort,
|
||||
tcpSeqNumber: rand(uint32), tcpAckNumber: 0,
|
||||
tcpFlags: {SYN}, tcpWindowSize: 1452 * 10)
|
||||
echo &"[{synOut.ipAddrSrc}:{synOut.tcpPortSrc} -> {synOut.ipAddrDst}:{synOut.tcpPortDst}, SEQ {synOut.tcpSeqNumber}] injecting outgoing SYN"
|
||||
await rawFd.injectTcpPacket(synOut)
|
||||
for seqNum in attempt.seqNums:
|
||||
let synIn = IpPacket(protocol: tcp, ipAddrSrc: attempt.dstIp,
|
||||
|
@ -290,7 +291,7 @@ proc accept*(puncher: TcpSyniPuncher, srcPort: Port, dstIp: IpAddress,
|
|||
tcpPortDst: attempt.srcPort,
|
||||
tcpSeqNumber: seqNum, tcpAckNumber: 0,
|
||||
tcpFlags: {SYN}, tcpWindowSize: 1452 * 10)
|
||||
echo &"[{synIn.ipAddrSrc}:{synIn.tcpPortSrc} -> {synIn.ipAddrDst}:{synIn.tcpPortDst}, SEQ {synIn.tcpSeqNumber}] injecting SYN"
|
||||
echo &"[{synIn.ipAddrSrc}:{synIn.tcpPortSrc} -> {synIn.ipAddrDst}:{synIn.tcpPortDst}, SEQ {synIn.tcpSeqNumber}] injecting incoming SYN"
|
||||
await rawFd.injectTcpPacket(synIn)
|
||||
closeSocket(rawFd)
|
||||
await attempt.future or sleepAsync(Timeout)
|
||||
|
|
Loading…
Reference in New Issue