/smoltcp-0.9.1/src/storage/ |
D | packet_buffer.rs | 254 fn buffer() -> PacketBuffer<'static, ()> { in buffer() function 260 let mut buffer = buffer(); in test_simple() localVariable 261 buffer.enqueue(6, ()).unwrap().copy_from_slice(b"abcdef"); in test_simple() 262 assert_eq!(buffer.enqueue(16, ()), Err(Full)); in test_simple() 263 assert_eq!(buffer.metadata_ring.len(), 1); in test_simple() 264 assert_eq!(buffer.dequeue().unwrap().1, &b"abcdef"[..]); in test_simple() 265 assert_eq!(buffer.dequeue(), Err(Empty)); in test_simple() 270 let mut buffer = buffer(); in test_peek() localVariable 271 assert_eq!(buffer.peek(), Err(Empty)); in test_peek() 272 buffer.enqueue(6, ()).unwrap().copy_from_slice(b"abcdef"); in test_peek() [all …]
|
/smoltcp-0.9.1/fuzz/fuzz_targets/ |
D | sixlowpan_packet.rs | 34 let mut buffer = vec![0; repr.buffer_len()]; localVariable 35 let mut frame = SixlowpanFragPacket::new_unchecked(&mut buffer[..]); 48 let mut buffer = vec![0; iphc_repr.buffer_len()]; localVariable 49 let mut iphc_frame = SixlowpanIphcPacket::new_unchecked(&mut buffer[..]); 63 let mut buffer = vec![0; repr.buffer_len()]; localVariable 66 &mut buffer[..], 81 let mut buffer = vec![ localVariable 88 &mut buffer[..], 107 let mut buffer = vec![0; repr.buffer_len()]; localVariable 109 Ipv6HopByHopHeader::new_unchecked(&mut buffer[..]); [all …]
|
/smoltcp-0.9.1/src/wire/ |
D | sixlowpan.rs | 186 pub fn dispatch(buffer: impl AsRef<[u8]>) -> Result<Self> { in dispatch() 187 let raw = buffer.as_ref(); in dispatch() 251 buffer: T, field 271 pub const fn new_unchecked(buffer: T) -> Self { in new_unchecked() 272 Self { buffer } in new_unchecked() 279 pub fn new_checked(buffer: T) -> Result<Self> { in new_checked() 280 let packet = Self::new_unchecked(buffer); in new_checked() 295 let buffer = self.buffer.as_ref(); in check_len() localVariable 296 if buffer.is_empty() { in check_len() 301 DISPATCH_FIRST_FRAGMENT_HEADER if buffer.len() >= FIRST_FRAGMENT_HEADER_SIZE => { in check_len() [all …]
|
D | tcp.rs | 73 buffer: T, field 116 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() 117 Packet { buffer } in new_unchecked() 124 pub fn new_checked(buffer: T) -> Result<Packet<T>> { in new_checked() 125 let packet = Self::new_unchecked(buffer); in new_checked() 139 let len = self.buffer.as_ref().len(); in check_len() 154 self.buffer in into_inner() 160 let data = self.buffer.as_ref(); in src_port() 167 let data = self.buffer.as_ref(); in dst_port() 174 let data = self.buffer.as_ref(); in seq_number() [all …]
|
D | arp.rs | 27 buffer: T, field 68 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() 69 Packet { buffer } in new_unchecked() 76 pub fn new_checked(buffer: T) -> Result<Packet<T>> { in new_checked() 77 let packet = Self::new_unchecked(buffer); in new_checked() 92 let len = self.buffer.as_ref().len(); in check_len() 104 self.buffer in into_inner() 110 let data = self.buffer.as_ref(); in hardware_type() 118 let data = self.buffer.as_ref(); in protocol_type() 126 let data = self.buffer.as_ref(); in hardware_len() [all …]
|
D | mld.rs | 44 let data = self.buffer.as_ref(); in max_resp_code() 51 let data = self.buffer.as_ref(); in mcast_addr() 58 let data = self.buffer.as_ref(); in s_flag() 65 let data = self.buffer.as_ref(); in qrv() 72 let data = self.buffer.as_ref(); in qqic() 79 let data = self.buffer.as_ref(); in num_srcs() 92 let data = self.buffer.as_ref(); in nr_mcast_addr_rcrds() 105 let data = self.buffer.as_mut(); in set_max_resp_code() 112 let data = self.buffer.as_mut(); in set_mcast_addr() 119 let data = self.buffer.as_mut(); in set_s_flag() [all …]
|
D | ipv6fragment.rs | 12 buffer: T, field 39 pub const fn new_unchecked(buffer: T) -> Header<T> { in new_unchecked() 40 Header { buffer } in new_unchecked() 47 pub fn new_checked(buffer: T) -> Result<Header<T>> { in new_checked() 48 let header = Self::new_unchecked(buffer); in new_checked() 56 let data = self.buffer.as_ref(); in check_len() 68 self.buffer in into_inner() 74 let data = self.buffer.as_ref(); in next_header() 81 let data = self.buffer.as_ref(); in frag_offset() 88 let data = self.buffer.as_ref(); in more_frags() [all …]
|
D | dhcpv4.rs | 65 buffer: &'a mut [u8], field 69 pub fn new(buffer: &'a mut [u8]) -> Self { in new() 70 Self { buffer } in new() 80 if self.buffer.len() < total_len { in emit() 84 let (buf, rest) = core::mem::take(&mut self.buffer).split_at_mut(total_len); in emit() 85 self.buffer = rest; in emit() 95 if self.buffer.is_empty() { in end() 99 self.buffer[0] = field::OPT_END; in end() 100 self.buffer = &mut []; in end() 117 buffer: T, field [all …]
|
D | udp.rs | 13 buffer: T, field 36 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() 37 Packet { buffer } in new_unchecked() 44 pub fn new_checked(buffer: T) -> Result<Packet<T>> { in new_checked() 45 let packet = Self::new_unchecked(buffer); in new_checked() 59 let buffer_len = self.buffer.as_ref().len(); in check_len() 74 self.buffer in into_inner() 80 let data = self.buffer.as_ref(); in src_port() 87 let data = self.buffer.as_ref(); in dst_port() 94 let data = self.buffer.as_ref(); in len() [all …]
|
D | ipv6routing.rs | 56 buffer: T, field 146 pub const fn new(buffer: T) -> Header<T> { in new() 147 Header { buffer } in new() 154 pub fn new_checked(buffer: T) -> Result<Header<T>> { in new_checked() 155 let header = Self::new(buffer); in new_checked() 167 let len = self.buffer.as_ref().len(); in check_len() 188 self.buffer in into_inner() 194 let data = self.buffer.as_ref(); in next_header() 202 let data = self.buffer.as_ref(); in header_len() 209 let data = self.buffer.as_ref(); in routing_type() [all …]
|
D | ndiscoption.rs | 54 buffer: T, field 148 pub const fn new_unchecked(buffer: T) -> NdiscOption<T> { in new_unchecked() 149 NdiscOption { buffer } in new_unchecked() 156 pub fn new_checked(buffer: T) -> Result<NdiscOption<T>> { in new_checked() 157 let opt = Self::new_unchecked(buffer); in new_checked() 175 let data = self.buffer.as_ref(); in check_len() 198 self.buffer in into_inner() 204 let data = self.buffer.as_ref(); in option_type() 211 let data = self.buffer.as_ref(); in data_len() 222 let data = self.buffer.as_ref(); in link_layer_addr() [all …]
|
D | dns.rs | 81 buffer: T, field 86 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() 87 Packet { buffer } in new_unchecked() 94 pub fn new_checked(buffer: T) -> Result<Packet<T>> { in new_checked() 95 let packet = Self::new_unchecked(buffer); in new_checked() 104 let len = self.buffer.as_ref().len(); in check_len() 114 self.buffer in into_inner() 118 &self.buffer.as_ref()[field::HEADER_END..] in payload() 122 let field = &self.buffer.as_ref()[field::ID]; in transaction_id() 127 let field = &self.buffer.as_ref()[field::FLAGS]; in flags() [all …]
|
D | ethernet.rs | 86 buffer: T, field 103 pub const fn new_unchecked(buffer: T) -> Frame<T> { in new_unchecked() 104 Frame { buffer } in new_unchecked() 111 pub fn new_checked(buffer: T) -> Result<Frame<T>> { in new_checked() 112 let packet = Self::new_unchecked(buffer); in new_checked() 120 let len = self.buffer.as_ref().len(); in check_len() 130 self.buffer in into_inner() 147 let data = self.buffer.as_ref(); in dst_addr() 154 let data = self.buffer.as_ref(); in src_addr() 161 let data = self.buffer.as_ref(); in ethertype() [all …]
|
D | ipv4.rs | 285 buffer: T, field 307 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() 308 Packet { buffer } in new_unchecked() 315 pub fn new_checked(buffer: T) -> Result<Packet<T>> { in new_checked() 316 let packet = Self::new_unchecked(buffer); in new_checked() 333 let len = self.buffer.as_ref().len(); in check_len() 349 self.buffer in into_inner() 355 let data = self.buffer.as_ref(); in version() 362 let data = self.buffer.as_ref(); in header_len() 368 let data = self.buffer.as_ref(); in dscp() [all …]
|
D | igmp.rs | 28 buffer: T, field 57 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() 58 Packet { buffer } in new_unchecked() 65 pub fn new_checked(buffer: T) -> Result<Packet<T>> { in new_checked() 66 let packet = Self::new_unchecked(buffer); in new_checked() 74 let len = self.buffer.as_ref().len(); in check_len() 84 self.buffer in into_inner() 90 let data = self.buffer.as_ref(); in msg_type() 100 let data = self.buffer.as_ref(); in max_resp_code() 107 let data = self.buffer.as_ref(); in checksum() [all …]
|
D | ieee802154.rs | 196 buffer: T, field 211 let data = self.buffer.as_ref(); 223 let data = &mut self.buffer.as_mut()[field::FRAMECONTROL]; 234 pub const fn new_unchecked(buffer: T) -> Frame<T> { in new_unchecked() 235 Frame { buffer } in new_unchecked() 242 pub fn new_checked(buffer: T) -> Result<Frame<T>> { in new_checked() 243 let packet = Self::new_unchecked(buffer); in new_checked() 261 if self.buffer.as_ref().len() < 3 { in check_len() 275 if offset > self.buffer.as_ref().len() { in check_len() 284 self.buffer in into_inner() [all …]
|
D | icmpv4.rs | 167 buffer: T, field 187 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() 188 Packet { buffer } in new_unchecked() 195 pub fn new_checked(buffer: T) -> Result<Packet<T>> { in new_checked() 196 let packet = Self::new_unchecked(buffer); in new_checked() 208 let len = self.buffer.as_ref().len(); in check_len() 218 self.buffer in into_inner() 224 let data = self.buffer.as_ref(); in msg_type() 231 let data = self.buffer.as_ref(); in msg_code() 238 let data = self.buffer.as_ref(); in checksum() [all …]
|
D | icmpv6.rs | 189 pub(super) buffer: T, field 250 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() 251 Packet { buffer } in new_unchecked() 258 pub fn new_checked(buffer: T) -> Result<Packet<T>> { in new_checked() 259 let packet = Self::new_unchecked(buffer); in new_checked() 267 let len = self.buffer.as_ref().len(); in check_len() 277 self.buffer in into_inner() 283 let data = self.buffer.as_ref(); in msg_type() 290 let data = self.buffer.as_ref(); in msg_code() 297 let data = self.buffer.as_ref(); in checksum() [all …]
|
/smoltcp-0.9.1/src/socket/ |
D | raw.rs | 244 let buffer = self.recv()?; in recv_slice() localVariable 245 let length = min(data.len(), buffer.len()); in recv_slice() 246 data[..length].copy_from_slice(&buffer[..length]); in recv_slice() 274 let buffer = self.peek()?; in peek_slice() localVariable 275 let length = min(data.len(), buffer.len()); in peek_slice() 276 data[..length].copy_from_slice(&buffer[..length]); in peek_slice() 327 let res = self.tx_buffer.dequeue_with(|&mut (), buffer| { in dispatch() 328 match IpVersion::of_packet(buffer) { in dispatch() 331 let mut packet = match Ipv4Packet::new_checked(buffer) { in dispatch() 363 let packet = match Ipv6Packet::new_checked(buffer) { in dispatch() [all …]
|
D | udp.rs | 334 let (buffer, endpoint) = self.recv().map_err(|_| RecvError::Exhausted)?; in recv_slice() 335 let length = min(data.len(), buffer.len()); in recv_slice() 336 data[..length].copy_from_slice(&buffer[..length]); in recv_slice() 367 let (buffer, endpoint) = self.peek()?; in peek_slice() 368 let length = min(data.len(), buffer.len()); in peek_slice() 369 data[..length].copy_from_slice(&buffer[..length]); in peek_slice() 492 fn buffer(packets: usize) -> PacketBuffer<'static> { in buffer() function 579 let mut socket = socket(buffer(0), buffer(0)); in test_bind_unaddressable() 585 let mut socket = socket(buffer(0), buffer(0)); in test_bind_twice() 593 let mut s = socket(buffer(0), buffer(1)); in test_set_hop_limit_zero() [all …]
|
/smoltcp-0.9.1/ |
D | Cargo.toml | 158 fragmentation-buffer-size-256 = [] 159 fragmentation-buffer-size-512 = [] 160 fragmentation-buffer-size-1024 = [] 161 fragmentation-buffer-size-1500 = [] # Default 162 fragmentation-buffer-size-2048 = [] 163 fragmentation-buffer-size-4096 = [] 164 fragmentation-buffer-size-8192 = [] 165 fragmentation-buffer-size-16384 = [] 166 fragmentation-buffer-size-32768 = [] 167 fragmentation-buffer-size-65536 = [] [all …]
|
/smoltcp-0.9.1/src/phy/ |
D | tracer.rs | 99 self.token.consume(|buffer| { in consume() 103 buffer, in consume() 108 f(buffer) in consume() 126 self.token.consume(len, |buffer| { in consume() 127 let result = f(buffer); in consume() 131 buffer, in consume() 142 buffer: &'a [u8], field 153 &self.buffer, in fmt() 158 Medium::Ip => match crate::wire::IpVersion::of_packet(self.buffer) { in fmt() 162 &self.buffer, in fmt() [all …]
|
D | loopback.rs | 41 self.queue.pop_front().map(move |buffer| { in receive() 42 let rx = RxToken { buffer }; in receive() 59 buffer: Vec<u8>, field 67 f(&mut self.buffer) in consume() 82 let mut buffer = Vec::new(); in consume() localVariable 83 buffer.resize(len, 0); in consume() 84 let result = f(&mut buffer); in consume() 85 self.queue.push_back(buffer); in consume()
|
D | tuntap_interface.rs | 56 let mut buffer = vec![0; self.mtu]; in receive() localVariable 57 match lower.recv(&mut buffer[..]) { in receive() 59 buffer.resize(size, 0); in receive() 60 let rx = RxToken { buffer }; in receive() 80 buffer: Vec<u8>, field 88 f(&mut self.buffer[..]) in consume() 103 let mut buffer = vec![0; len]; in consume() localVariable 104 let result = f(&mut buffer); in consume() 105 match lower.send(&buffer[..]) { in consume()
|
D | raw_socket.rs | 74 let mut buffer = vec![0; self.mtu]; in receive() localVariable 75 match lower.recv(&mut buffer[..]) { in receive() 77 buffer.resize(size, 0); in receive() 78 let rx = RxToken { buffer }; in receive() 98 buffer: Vec<u8>, field 106 f(&mut self.buffer[..]) in consume() 121 let mut buffer = vec![0; len]; in consume() localVariable 122 let result = f(&mut buffer); in consume() 123 match lower.send(&buffer[..]) { in consume()
|