feat: added basic structure around packet transfer
This commit is contained in:
@@ -600,7 +600,12 @@ impl TCPPacketBuilder {
|
||||
let seqnumber = self.seqnumber.unwrap();
|
||||
let window = self.window.unwrap();
|
||||
|
||||
let len: u8 = (self.options.len() / 4 + 5).try_into().unwrap();
|
||||
let mut options = self.options;
|
||||
while options.len() % 4 != 0 {
|
||||
options.push(0);
|
||||
}
|
||||
|
||||
let len: u8 = (options.len() / 4 + 5).try_into().unwrap();
|
||||
let len = len << 4;
|
||||
|
||||
let mut bytes = [
|
||||
@@ -617,7 +622,7 @@ impl TCPPacketBuilder {
|
||||
&window.to_be_bytes(),
|
||||
&[0, 0],
|
||||
&self.urgent_ptr.to_be_bytes(),
|
||||
&self.options,
|
||||
&options,
|
||||
&data,
|
||||
]
|
||||
.concat();
|
||||
|
||||
Reference in New Issue
Block a user