/smoltcp-0.9.1/src/wire/ |
D | mld.rs | 185 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 186 packet.check_len()?; in new_checked() 187 Ok(packet) in new_checked() 318 pub fn parse<T>(packet: &Packet<&'a T>) -> Result<Repr<'a>> in parse() 322 match packet.msg_type() { in parse() 324 max_resp_code: packet.max_resp_code(), in parse() 325 mcast_addr: packet.mcast_addr(), in parse() 326 s_flag: packet.s_flag(), in parse() 327 qrv: packet.qrv(), in parse() 328 qqic: packet.qqic(), in parse() [all …]
|
D | udp.rs | 45 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 46 packet.check_len()?; in new_checked() 47 Ok(packet) in new_checked() 220 packet: &Packet<&T>, in parse() 229 if packet.dst_port() == 0 { in parse() 233 if checksum_caps.udp.rx() && !packet.verify_checksum(src_addr, dst_addr) { in parse() 237 (&IpAddress::Ipv4(_), &IpAddress::Ipv4(_)) if packet.checksum() == 0 => (), in parse() 243 src_port: packet.src_port(), in parse() 244 dst_port: packet.dst_port(), in parse() 258 pub(crate) fn emit_header<T: ?Sized>(&self, packet: &mut Packet<&mut T>, payload_len: usize) in emit_header() [all …]
|
D | ndisc.rs | 229 pub fn parse<T>(packet: &Packet<&'a T>) -> Result<Repr<'a>> in parse() 255 match packet.msg_type() { in parse() 258 foreach_option(packet.payload(), |opt| { in parse() 269 foreach_option(packet.payload(), |opt| { in parse() 279 hop_limit: packet.current_hop_limit(), in parse() 280 flags: packet.router_flags(), in parse() 281 router_lifetime: packet.router_lifetime(), in parse() 282 reachable_time: packet.reachable_time(), in parse() 283 retrans_time: packet.retrans_time(), in parse() 291 foreach_option(packet.payload(), |opt| { in parse() [all …]
|
D | icmpv6.rs | 259 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 260 packet.check_len()?; in new_checked() 261 Ok(packet) in new_checked() 546 packet: &Packet<&'a T>, in parse() 552 fn create_packet_from_payload<'a, T>(packet: &Packet<&'a T>) -> Result<(&'a [u8], Ipv6Repr)> in parse() 556 let ip_packet = Ipv6Packet::new_checked(packet.payload())?; in parse() 558 let payload = &packet.payload()[ip_packet.header_len()..]; in parse() 572 if checksum_caps.icmpv6.rx() && !packet.verify_checksum(src_addr, dst_addr) { in parse() 576 match (packet.msg_type(), packet.msg_code()) { in parse() 578 let (payload, repr) = create_packet_from_payload(packet)?; in parse() [all …]
|
D | igmp.rs | 66 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 67 packet.check_len()?; in new_checked() 68 Ok(packet) in new_checked() 204 pub fn parse<T>(packet: &Packet<&T>) -> Result<Repr> in parse() 209 let addr = packet.group_addr(); in parse() 215 match packet.msg_type() { in parse() 217 let max_resp_time = max_resp_code_to_duration(packet.max_resp_code()); in parse() 219 let version = if packet.max_resp_code() == 0 { in parse() 231 group_addr: packet.group_addr(), in parse() 235 group_addr: packet.group_addr(), in parse() [all …]
|
D | arp.rs | 77 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 78 packet.check_len()?; in new_checked() 79 Ok(packet) in new_checked() 273 pub fn parse<T: AsRef<[u8]>>(packet: &Packet<T>) -> Result<Repr> { in parse() 275 packet.hardware_type(), in parse() 276 packet.protocol_type(), in parse() 277 packet.hardware_len(), in parse() 278 packet.protocol_len(), in parse() 281 operation: packet.operation(), in parse() 282 source_hardware_addr: EthernetAddress::from_bytes(packet.source_hardware_addr()), in parse() [all …]
|
D | icmpv4.rs | 196 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 197 packet.check_len()?; in new_checked() 198 Ok(packet) in new_checked() 396 packet: &Packet<&'a T>, in parse() 403 if checksum_caps.icmpv4.rx() && !packet.verify_checksum() { in parse() 407 match (packet.msg_type(), packet.msg_code()) { in parse() 409 ident: packet.echo_ident(), in parse() 410 seq_no: packet.echo_seq_no(), in parse() 411 data: packet.data(), in parse() 415 ident: packet.echo_ident(), in parse() [all …]
|
D | dns.rs | 95 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 96 packet.check_len()?; in new_checked() 97 Ok(packet) in new_checked() 165 let mut packet = self.buffer.as_ref(); in parse_name() localVariable 188 if packet.len() <= ptr { in parse_name() 204 bytes = &packet[ptr..]; in parse_name() 205 packet = &packet[..ptr]; in parse_name() 319 pub fn emit(&self, packet: &mut [u8]) { in emit() 320 packet[..self.name.len()].copy_from_slice(self.name); in emit() 321 let rest = &mut packet[self.name.len()..]; in emit() [all …]
|
D | dhcpv4.rs | 245 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 246 packet.check_len()?; in new_checked() 247 Ok(packet) in new_checked() 706 pub fn parse<T>(packet: &'a Packet<&'a T>) -> Result<Self> in parse() 710 let transaction_id = packet.transaction_id(); in parse() 711 let client_hardware_address = packet.client_hardware_address(); in parse() 712 let client_ip = packet.client_ip(); in parse() 713 let your_ip = packet.your_ip(); in parse() 714 let server_ip = packet.server_ip(); in parse() 715 let relay_agent_ip = packet.relay_agent_ip(); in parse() [all …]
|
D | sixlowpan.rs | 280 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 281 packet.check_len()?; in new_checked() 283 let dispatch = packet.dispatch(); in new_checked() 289 Ok(packet) in new_checked() 416 pub fn parse<T: AsRef<[u8]>>(packet: &Packet<T>) -> Result<Self> { in parse() 417 let size = packet.datagram_size(); in parse() 418 let tag = packet.datagram_tag(); in parse() 420 match packet.dispatch() { in parse() 425 offset: packet.datagram_offset(), in parse() 440 pub fn emit<T: AsRef<[u8]> + AsMut<[u8]>>(&self, packet: &mut Packet<T>) { in emit() [all …]
|
D | ipv6.rs | 455 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 456 packet.check_len()?; in new_checked() 457 Ok(packet) in new_checked() 674 pub fn parse<T: AsRef<[u8]> + ?Sized>(packet: &Packet<&T>) -> Result<Repr> { in parse() 676 packet.check_len()?; in parse() 677 if packet.version() != 6 { in parse() 681 src_addr: packet.src_addr(), in parse() 682 dst_addr: packet.dst_addr(), in parse() 683 next_header: packet.next_header(), in parse() 684 payload_len: packet.payload_len() as usize, in parse() [all …]
|
D | ipv4.rs | 316 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 317 packet.check_len()?; in new_checked() 318 Ok(packet) in new_checked() 633 packet: &Packet<&T>, in parse() 637 if packet.version() != 4 { in parse() 641 if checksum_caps.ipv4.rx() && !packet.verify_checksum() { in parse() 647 if packet.more_frags() || packet.frag_offset() != 0 { in parse() 651 let payload_len = packet.total_len() as usize - packet.header_len() as usize; in parse() 657 src_addr: packet.src_addr(), in parse() 658 dst_addr: packet.dst_addr(), in parse() [all …]
|
D | tcp.rs | 125 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 126 packet.check_len()?; in new_checked() 127 Ok(packet) in new_checked() 792 packet: &Packet<&'a T>, in parse() 801 if packet.src_port() == 0 { in parse() 804 if packet.dst_port() == 0 { in parse() 808 if checksum_caps.tcp.rx() && !packet.verify_checksum(src_addr, dst_addr) { in parse() 812 let control = match (packet.syn(), packet.fin(), packet.rst(), packet.psh()) { in parse() 820 let ack_number = match packet.ack() { in parse() 821 true => Some(packet.ack_number()), in parse() [all …]
|
D | ieee802154.rs | 243 let packet = Self::new_unchecked(buffer); in new_checked() localVariable 244 packet.check_len()?; in new_checked() 246 if matches!(packet.dst_addressing_mode(), AddressingMode::Unknown(_)) { in new_checked() 250 if matches!(packet.src_addressing_mode(), AddressingMode::Unknown(_)) { in new_checked() 254 Ok(packet) in new_checked() 773 pub fn parse<T: AsRef<[u8]> + ?Sized>(packet: &Frame<&T>) -> Result<Repr> { in parse() 775 packet.check_len()?; in parse() 778 frame_type: packet.frame_type(), in parse() 779 security_enabled: packet.security_enabled(), in parse() 780 frame_pending: packet.frame_pending(), in parse() [all …]
|
/smoltcp-0.9.1/src/socket/ |
D | icmp.rs | 386 let packet = UdpPacket::new_unchecked(data); in accepts() localVariable 388 &packet, in accepts() 405 let packet = UdpPacket::new_unchecked(data); in accepts() localVariable 407 &packet, in accepts() 507 let packet = Icmpv4Packet::new_unchecked(&*packet_buf); in dispatch() localVariable 508 let repr = match Icmpv4Repr::parse(&packet, &ChecksumCapabilities::ignored()) { in dispatch() 539 let packet = Icmpv6Packet::new_unchecked(&*packet_buf); in dispatch() localVariable 543 &packet, in dispatch() 676 let mut packet = Icmpv4Packet::new_unchecked(&mut bytes); in test_send_dispatch() localVariable 677 ECHOV4_REPR.emit(&mut packet, &checksum); in test_send_dispatch() [all …]
|
D | raw.rs | 331 let mut packet = match Ipv4Packet::new_checked(buffer) { in dispatch() localVariable 338 if packet.next_header() != ip_protocol { in dispatch() 343 packet.fill_checksum(); in dispatch() 347 packet.set_checksum(0); in dispatch() 350 let packet = Ipv4Packet::new_unchecked(&*packet.into_inner()); in dispatch() localVariable 351 let ipv4_repr = match Ipv4Repr::parse(&packet, _checksum_caps) { in dispatch() 359 emit(cx, (IpRepr::Ipv4(ipv4_repr), packet.payload())) in dispatch() 363 let packet = match Ipv6Packet::new_checked(buffer) { in dispatch() localVariable 370 if packet.next_header() != ip_protocol { in dispatch() 374 let packet = Ipv6Packet::new_unchecked(&*packet.into_inner()); in dispatch() localVariable [all …]
|
/smoltcp-0.9.1/benches/ |
D | bench.rs | 49 let mut packet = TcpPacket::new_unchecked(&mut bytes); in bench_emit_tcp() localVariable 51 &mut packet, in bench_emit_tcp() 70 let mut packet = UdpPacket::new_unchecked(&mut bytes); in bench_emit_udp() localVariable 72 &mut packet, in bench_emit_udp() 95 let mut packet = Ipv4Packet::new_unchecked(&mut bytes); in bench_emit_ipv4() localVariable 96 repr.emit(&mut packet, &ChecksumCapabilities::default()); in bench_emit_ipv4() 113 let mut packet = Ipv6Packet::new_unchecked(&mut bytes); in bench_emit_ipv6() localVariable 114 repr.emit(&mut packet); in bench_emit_ipv6()
|
/smoltcp-0.9.1/fuzz/fuzz_targets/ |
D | sixlowpan_packet.rs | 167 let mut packet = UdpPacket::new_unchecked(&mut buffer[..]); localVariable 169 &mut packet, 183 let mut packet = Ipv6RoutingHeader::new(&mut buffer[..]); localVariable 184 repr.emit(&mut packet); 199 if let Ok(packet) = Icmpv6Packet::new_checked(payload) { 203 &packet, 207 let mut packet = localVariable 212 &mut packet, 220 if let Ok(packet) = Ipv6Option::new_checked(payload) { 221 if let Ok(repr) = Ipv6OptionRepr::parse(&packet) { [all …]
|
D | dhcp_header.rs | 7 Ok(packet) => match DhcpRepr::parse(packet) {
|
/smoltcp-0.9.1/utils/ |
D | packet2pcap.rs | 16 let mut packet = Vec::new(); in convert() localVariable 17 packet_file.read_to_end(&mut packet)?; in convert() 21 PcapSink::packet(&mut pcap_file, Instant::from_millis(0), &packet[..]); in convert()
|
/smoltcp-0.9.1/src/phy/ |
D | pcap_writer.rs | 87 fn packet(&mut self, timestamp: Instant, packet: &[u8]) { in packet() method 88 self.packet_header(timestamp, packet.len()); in packet() 89 self.write(packet); in packet() 228 .packet(self.timestamp, buffer.as_ref()), in consume() 253 self.sink.borrow_mut().packet(self.timestamp, buffer) in consume()
|
/smoltcp-0.9.1/src/iface/interface/ |
D | ipv4.rs | 374 let mut packet = in dispatch_ipv4_frag() localVariable 376 frag.ipv4.repr.emit(&mut packet, &caps.checksum); in dispatch_ipv4_frag() 377 packet.set_ident(frag.ipv4.ident); in dispatch_ipv4_frag() 378 packet.set_more_frags(more_frags); in dispatch_ipv4_frag() 379 packet.set_dont_frag(false); in dispatch_ipv4_frag() 380 packet.set_frag_offset(frag.ipv4.frag_offset); in dispatch_ipv4_frag() 383 packet.fill_checksum(); in dispatch_ipv4_frag()
|
D | tests.rs | 435 let mut packet = UdpPacket::new_unchecked(&mut udp_bytes); in test_handle_udp_broadcast() localVariable 473 &mut packet, in test_handle_udp_broadcast() 489 packet.into_inner(), in test_handle_udp_broadcast() 601 let mut packet = UdpPacket::new_unchecked(&mut bytes[..]); in test_icmp_reply_size() localVariable 603 &mut packet, in test_icmp_reply_size() 626 let payload = packet.into_inner(); in test_icmp_reply_size() 721 let mut packet = ArpPacket::new_unchecked(frame.payload_mut()); in test_handle_valid_arp_request() localVariable 722 repr.emit(&mut packet); in test_handle_valid_arp_request() 845 let mut packet = ArpPacket::new_unchecked(frame.payload_mut()); in test_handle_other_arp_request() localVariable 846 repr.emit(&mut packet); in test_handle_other_arp_request() [all …]
|
D | mod.rs | 843 if let Some(packet) = in socket_ingress() 848 self.inner.dispatch(tx_token, packet, &mut self.fragmenter) in socket_ingress() 856 if let Some(packet) = in socket_ingress() 861 .dispatch_ip(tx_token, packet, &mut self.fragmenter) in socket_ingress() 869 if let Some(packet) = in socket_ingress() 875 .dispatch_ip(tx_token, packet, &mut self.fragmenter) in socket_ingress() 1458 packet: EthernetPacket, in dispatch() 1464 match packet { in dispatch() 1478 let mut packet = ArpPacket::new_unchecked(frame.payload_mut()); in dispatch() localVariable 1479 arp_repr.emit(&mut packet); in dispatch() [all …]
|
D | sixlowpan.rs | 265 packet: IpPacket, in dispatch_ieee802154() 273 let ip_repr = packet.ip_repr(); in dispatch_ieee802154() 305 next_header: match &packet { in dispatch_ieee802154() 330 match packet { in dispatch_ieee802154() 382 match packet { in dispatch_ieee802154() 427 pkt.sixlowpan.datagram_size = (packet.ip_repr().payload_len() + 40) as u16; in dispatch_ieee802154() 496 match packet { in dispatch_ieee802154()
|