diff --git a/tuic/src/model/packet.rs b/tuic/src/model/packet.rs index ded42db..b41d523 100644 --- a/tuic/src/model/packet.rs +++ b/tuic/src/model/packet.rs @@ -51,6 +51,12 @@ impl Packet { tx.assoc_id } + /// Returns the packet ID + pub fn pkt_id(&self) -> u16 { + let Side::Tx(tx) = &self.inner else { unreachable!() }; + tx.pkt_id + } + /// Returns the address pub fn addr(&self) -> &Address { let Side::Tx(tx) = &self.inner else { unreachable!() }; @@ -129,6 +135,24 @@ where rx.assoc_id } + /// Returns the packet ID + pub fn pkt_id(&self) -> u16 { + let Side::Rx(rx) = &self.inner else { unreachable!() }; + rx.pkt_id + } + + /// Returns the fragment ID + pub fn frag_id(&self) -> u8 { + let Side::Rx(rx) = &self.inner else { unreachable!() }; + rx.frag_id + } + + /// Returns the total number of fragments + pub fn frag_total(&self) -> u8 { + let Side::Rx(rx) = &self.inner else { unreachable!() }; + rx.frag_total + } + /// Returns the address pub fn addr(&self) -> &Address { let Side::Rx(rx) = &self.inner else { unreachable!() };