|
@@ -100,7 +100,6 @@ impl<'a, T: AsRef<[u8]> + ?Sized> Packet<&'a T> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
impl<T: AsRef<[u8]>> AsRef<[u8]> for Packet<T> {
|
|
impl<T: AsRef<[u8]>> AsRef<[u8]> for Packet<T> {
|
|
fn as_ref(&self) -> &[u8] {
|
|
fn as_ref(&self) -> &[u8] {
|
|
self.buffer.as_ref()
|
|
self.buffer.as_ref()
|
|
@@ -117,4 +116,14 @@ impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T> {
|
|
let data = self.buffer.as_mut();
|
|
let data = self.buffer.as_mut();
|
|
data[field::PAYLOAD_LEN] = value
|
|
data[field::PAYLOAD_LEN] = value
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+
|
|
|
|
+ fn set_security_parameters_index(&mut self, value: u32) {
|
|
|
|
+ let data = self.buffer.as_mut();
|
|
|
|
+ NetworkEndian::write_u32(&mut data[field::SPI], value)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fn set_sequence_number(&mut self, value: u32) {
|
|
|
|
+ let data = self.buffer.as_mut();
|
|
|
|
+ NetworkEndian::write_u32(&mut data[field::SEQUENCE_NUMBER], value)
|
|
|
|
+ }
|
|
|
|
+}
|