Lines Matching refs:u8
72 pub struct Packet<T: AsRef<[u8]>> {
90 pub const fn OPTIONS(length: u8) -> Field { in OPTIONS()
104 pub const OPT_END: u8 = 0x00;
105 pub const OPT_NOP: u8 = 0x01;
106 pub const OPT_MSS: u8 = 0x02;
107 pub const OPT_WS: u8 = 0x03;
108 pub const OPT_SACKPERM: u8 = 0x04;
109 pub const OPT_SACKRNG: u8 = 0x05;
114 impl<T: AsRef<[u8]>> Packet<T> {
259 pub fn header_len(&self) -> u8 { in header_len() argument
262 ((raw >> 12) * 4) as u8 in header_len()
350 impl<'a, T: AsRef<[u8]> + ?Sized> Packet<&'a T> {
353 pub fn options(&self) -> &'a [u8] { in options() argument
361 pub fn payload(&self) -> &'a [u8] { in payload() argument
368 impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T> {
525 pub fn set_header_len(&mut self, value: u8) { in set_header_len() argument
572 pub fn options_mut(&mut self) -> &mut [u8] { in options_mut() argument
580 pub fn payload_mut(&mut self) -> &mut [u8] { in payload_mut() argument
587 impl<T: AsRef<[u8]>> AsRef<[u8]> for Packet<T> {
588 fn as_ref(&self) -> &[u8] { in as_ref() argument
600 WindowScale(u8),
603 Unknown { kind: u8, data: &'a [u8] },
607 pub fn parse(buffer: &'a [u8]) -> Result<(&'a [u8], TcpOption<'a>)> { in parse() argument
685 pub fn emit<'b>(&self, buffer: &'b mut [u8]) -> &'b mut [u8] { in emit() argument
701 buffer[1] = length as u8; in emit()
782 pub window_scale: Option<u8>,
786 pub payload: &'a [u8],
798 T: AsRef<[u8]> + ?Sized, in parse()
922 T: AsRef<[u8]> + AsMut<[u8]> + ?Sized, in emit()
929 packet.set_header_len(self.header_len() as u8); in emit()
988 impl<'a, T: AsRef<[u8]> + ?Sized> fmt::Display for Packet<&'a T> {
1069 impl<T: AsRef<[u8]>> PrettyPrint for Packet<T> {
1071 buffer: &dyn AsRef<[u8]>, in pretty_print() argument
1094 static PACKET_BYTES: [u8; 28] = [
1100 static OPTION_BYTES: [u8; 4] = [0x03, 0x03, 0x0c, 0x01];
1103 static PAYLOAD_BYTES: [u8; 4] = [0xaa, 0x00, 0x00, 0xff];
1170 static SYN_PACKET_BYTES: [u8; 24] = [