mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
impl: tcp fin
This commit is contained in:
parent
61ecbab312
commit
c30f28741f
3 changed files with 77 additions and 5 deletions
|
|
@ -14,7 +14,7 @@ lazy_static! {
|
|||
pub(crate) trait Writer {
|
||||
fn write(&mut self, packet: &CapturePacket, data: &[u8]) -> GDResult<()>;
|
||||
fn new_connect(&mut self, packet: &CapturePacket) -> GDResult<()>;
|
||||
//TODO: Close connection
|
||||
fn close_connection(&mut self, packet: &CapturePacket) -> GDResult<()>;
|
||||
}
|
||||
|
||||
impl<W: Write> Writer for Pcap<W> {
|
||||
|
|
@ -36,4 +36,14 @@ impl<W: Write> Writer for Pcap<W> {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn close_connection(&mut self, packet: &CapturePacket) -> GDResult<()> {
|
||||
match packet.protocol {
|
||||
Protocol::TCP => {
|
||||
self.send_tcp_fin(packet);
|
||||
}
|
||||
Protocol::UDP => {}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue