Home
last modified time | relevance | path

Searched refs:new_unchecked (Results 1 – 25 of 34) sorted by relevance

12

/smoltcp-0.9.1/src/wire/
Dipv6hopbyhop.rs53 pub const fn new_unchecked(buffer: T) -> Header<T> { in new_unchecked() method
62 let header = Self::new_unchecked(buffer); in new_checked()
230 Header::new_unchecked(&REPR_PACKET_PAD4[..0]).check_len() in test_check_len()
235 Header::new_unchecked(&REPR_PACKET_PAD4[..1]).check_len() in test_check_len()
240 Header::new_unchecked(&REPR_PACKET_PAD4[..7]).check_len() in test_check_len()
243 assert_eq!(Ok(()), Header::new_unchecked(&REPR_PACKET_PAD4).check_len()); in test_check_len()
247 Header::new_unchecked(&REPR_PACKET_PAD12).check_len() in test_check_len()
251 assert_eq!(Err(Error), Header::new_unchecked(&header).check_len()); in test_check_len()
256 let header = Header::new_unchecked(&REPR_PACKET_PAD4); in test_header_deconstruct()
261 let header = Header::new_unchecked(&REPR_PACKET_PAD12); in test_header_deconstruct()
[all …]
Dipv6option.rs91 pub const fn new_unchecked(buffer: T) -> Ipv6Option<T> { in new_unchecked() method
100 let opt = Self::new_unchecked(buffer); in new_checked()
366 Ipv6Option::new_unchecked(&bytes[..0]).check_len() in test_check_len()
371 Ipv6Option::new_unchecked(&IPV6OPTION_BYTES_PAD1).check_len() in test_check_len()
377 Ipv6Option::new_unchecked(&IPV6OPTION_BYTES_PADN[..2]).check_len() in test_check_len()
382 Ipv6Option::new_unchecked(&IPV6OPTION_BYTES_PADN).check_len() in test_check_len()
388 Ipv6Option::new_unchecked(&IPV6OPTION_BYTES_UNKNOWN[..4]).check_len() in test_check_len()
392 Ipv6Option::new_unchecked(&IPV6OPTION_BYTES_UNKNOWN[..1]).check_len() in test_check_len()
397 Ipv6Option::new_unchecked(&IPV6OPTION_BYTES_UNKNOWN).check_len() in test_check_len()
404 let opt = Ipv6Option::new_unchecked(&IPV6OPTION_BYTES_PAD1); in test_data_len()
[all …]
Dipv6fragment.rs39 pub const fn new_unchecked(buffer: T) -> Header<T> { in new_unchecked() method
48 let header = Self::new_unchecked(buffer); in new_checked()
230 Header::new_unchecked(&BYTES_HEADER_MORE_FRAG[..7]).check_len() in test_check_len()
235 Header::new_unchecked(&BYTES_HEADER_MORE_FRAG).check_len() in test_check_len()
241 let header = Header::new_unchecked(&BYTES_HEADER_MORE_FRAG); in test_header_deconstruct()
247 let header = Header::new_unchecked(&BYTES_HEADER_LAST_FRAG); in test_header_deconstruct()
256 let header = Header::new_unchecked(&BYTES_HEADER_MORE_FRAG); in test_repr_parse_valid()
268 let header = Header::new_unchecked(&BYTES_HEADER_LAST_FRAG); in test_repr_parse_valid()
290 let mut header = Header::new_unchecked(&mut bytes); in test_repr_emit()
301 let mut header = Header::new_unchecked(&mut bytes); in test_repr_emit()
[all …]
Dmld.rs176 pub const fn new_unchecked(buffer: T) -> Self { in new_unchecked() method
185 let packet = Self::new_unchecked(buffer); in new_checked()
445 let packet = Packet::new_unchecked(&QUERY_PACKET_BYTES[..]); in test_query_deconstruct()
464 let mut packet = Packet::new_unchecked(&mut bytes[..]); in test_query_construct()
486 let packet = Packet::new_unchecked(&REPORT_PACKET_BYTES[..]); in test_record_deconstruct()
491 let addr_rcrd = AddressRecord::new_unchecked(packet.payload()); in test_record_deconstruct()
505 let mut packet = Packet::new_unchecked(&mut bytes[..]); in test_record_construct()
511 let mut addr_rcrd = AddressRecord::new_unchecked(packet.payload_mut()); in test_record_construct()
529 let packet = Packet::new_unchecked(&QUERY_PACKET_BYTES[..]); in test_query_repr_parse()
541 let packet = Packet::new_unchecked(&REPORT_PACKET_BYTES[..]); in test_report_repr_parse()
[all …]
Dudp.rs36 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() method
45 let packet = Self::new_unchecked(buffer); in new_checked()
356 let packet = Packet::new_unchecked(&PACKET_BYTES[..]); in test_deconstruct()
369 let mut packet = Packet::new_unchecked(&mut bytes); in test_construct()
382 let mut packet = Packet::new_unchecked(&mut bytes); in test_impossible_len()
391 let mut packet = Packet::new_unchecked(&mut bytes); in test_zero_checksum()
403 let mut packet = Packet::new_unchecked(&mut bytes); in test_no_checksum()
422 let packet = Packet::new_unchecked(&PACKET_BYTES[..]); in test_parse()
438 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit()
453 let packet = Packet::new_unchecked(&NO_CHECKSUM_PACKET[..]); in test_checksum_omitted()
Dndisc.rs402 let mut opt_pkt = NdiscOption::new_unchecked(packet.payload_mut()); in emit()
426 let mut opt_pkt = NdiscOption::new_unchecked(packet.payload_mut()); in emit()
433 NdiscOption::new_unchecked(&mut packet.payload_mut()[offset..]); in emit()
439 NdiscOption::new_unchecked(&mut packet.payload_mut()[offset..]); in emit()
453 let mut opt_pkt = NdiscOption::new_unchecked(packet.payload_mut()); in emit()
469 let mut opt_pkt = NdiscOption::new_unchecked(packet.payload_mut()); in emit()
487 let mut opt_pkt = NdiscOption::new_unchecked(packet.payload_mut()); in emit()
495 NdiscOption::new_unchecked(&mut packet.payload_mut()[offset..]); in emit()
533 let packet = Packet::new_unchecked(&ROUTER_ADVERT_BYTES[..]); in test_router_advert_deconstruct()
547 let mut packet = Packet::new_unchecked(&mut bytes); in test_router_advert_construct()
[all …]
Dndiscoption.rs148 pub const fn new_unchecked(buffer: T) -> NdiscOption<T> { in new_unchecked() method
157 let opt = Self::new_unchecked(buffer); in new_checked()
470 Ipv6Packet::new_unchecked(&opt.data()[field::REDIRECTED_RESERVED.len()..]); in parse()
559 let mut ip_packet = Ipv6Packet::new_unchecked(&mut packet); in emit()
652 let opt = NdiscOption::new_unchecked(&PREFIX_OPT_BYTES[..]); in test_deconstruct()
668 let mut opt = NdiscOption::new_unchecked(&mut bytes[..]); in test_construct()
693 Repr::parse(&NdiscOption::new_unchecked(&bytes)), in test_repr_parse_link_layer_opt_ethernet()
700 Repr::parse(&NdiscOption::new_unchecked(&bytes)), in test_repr_parse_link_layer_opt_ethernet()
716 Repr::parse(&NdiscOption::new_unchecked(&bytes)), in test_repr_parse_link_layer_opt_ieee802154()
723 Repr::parse(&NdiscOption::new_unchecked(&bytes)), in test_repr_parse_link_layer_opt_ieee802154()
[all …]
Dipv6.rs445 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() method
455 let packet = Self::new_unchecked(buffer); in new_checked()
1090 let packet = Packet::new_unchecked(&REPR_PACKET_BYTES[..]); in test_packet_deconstruction()
1113 let mut packet = Packet::new_unchecked(&mut bytes[..]); in test_packet_construction()
1152 Packet::new_unchecked(&bytes).payload().len(), in test_overlong()
1156 Packet::new_unchecked(&mut bytes).payload_mut().len(), in test_overlong()
1165 Packet::new_unchecked(&mut bytes).set_payload_len(0x80); in test_total_len_overflow()
1172 let packet = Packet::new_unchecked(&REPR_PACKET_BYTES[..]); in test_repr_parse_valid()
1180 let mut packet = Packet::new_unchecked(&mut bytes[..]); in test_repr_parse_bad_version()
1183 let packet = Packet::new_unchecked(&*packet.into_inner()); in test_repr_parse_bad_version()
[all …]
Dethernet.rs103 pub const fn new_unchecked(buffer: T) -> Frame<T> { in new_unchecked() method
112 let packet = Self::new_unchecked(buffer); in new_checked()
330 let frame = Frame::new_unchecked(&FRAME_BYTES[..]); in test_deconstruct()
346 let mut frame = Frame::new_unchecked(&mut bytes); in test_construct()
376 let frame = Frame::new_unchecked(&FRAME_BYTES[..]); in test_deconstruct()
392 let mut frame = Frame::new_unchecked(&mut bytes); in test_construct()
Digmp.rs57 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() method
66 let packet = Self::new_unchecked(buffer); in new_checked()
382 let packet = Packet::new_unchecked(&LEAVE_PACKET_BYTES[..]); in test_leave_group_deconstruct()
395 let packet = Packet::new_unchecked(&REPORT_PACKET_BYTES[..]); in test_report_deconstruct()
409 let mut packet = Packet::new_unchecked(&mut bytes); in test_leave_construct()
420 let mut packet = Packet::new_unchecked(&mut bytes); in test_report_construct()
Dicmpv6.rs250 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() method
259 let packet = Self::new_unchecked(buffer); in new_checked()
657 let mut ip_packet = Ipv6Packet::new_unchecked(buffer); in emit()
808 let packet = Packet::new_unchecked(&ECHO_PACKET_BYTES[..]); in test_echo_deconstruct()
822 let mut packet = Packet::new_unchecked(&mut bytes); in test_echo_construct()
836 let packet = Packet::new_unchecked(&ECHO_PACKET_BYTES[..]); in test_echo_repr_parse()
851 let mut packet = Packet::new_unchecked(&mut bytes); in test_echo_emit()
863 let packet = Packet::new_unchecked(&PKT_TOO_BIG_BYTES[..]); in test_too_big_deconstruct()
876 let mut packet = Packet::new_unchecked(&mut bytes); in test_too_big_construct()
889 let packet = Packet::new_unchecked(&PKT_TOO_BIG_BYTES[..]); in test_too_big_repr_parse()
[all …]
Dicmpv4.rs187 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() method
196 let packet = Self::new_unchecked(buffer); in new_checked()
525 let mut ip_packet = Ipv4Packet::new_unchecked(packet.data_mut()); in emit()
539 let mut ip_packet = Ipv4Packet::new_unchecked(packet.data_mut()); in emit()
648 let packet = Packet::new_unchecked(&ECHO_PACKET_BYTES[..]); in test_echo_deconstruct()
661 let mut packet = Packet::new_unchecked(&mut bytes); in test_echo_construct()
681 let packet = Packet::new_unchecked(&ECHO_PACKET_BYTES[..]); in test_echo_parse()
690 let mut packet = Packet::new_unchecked(&mut bytes); in test_echo_emit()
Darp.rs68 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() method
77 let packet = Self::new_unchecked(buffer); in new_checked()
396 let packet = Packet::new_unchecked(&PACKET_BYTES[..]); in test_deconstruct()
417 let mut packet = Packet::new_unchecked(&mut bytes); in test_construct()
446 let packet = Packet::new_unchecked(&PACKET_BYTES[..]); in test_parse()
454 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit()
Dipv4.rs307 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() method
316 let packet = Self::new_unchecked(buffer); in new_checked()
810 let packet = Packet::new_unchecked(&PACKET_BYTES[..]); in test_deconstruct()
832 let mut packet = Packet::new_unchecked(&mut bytes); in test_construct()
859 Packet::new_unchecked(&bytes).payload().len(), in test_overlong()
863 Packet::new_unchecked(&mut bytes).payload_mut().len(), in test_overlong()
872 Packet::new_unchecked(&mut bytes).set_total_len(128); in test_total_len_overflow()
896 let packet = Packet::new_unchecked(&REPR_PACKET_BYTES[..]); in test_parse()
905 let mut packet = Packet::new_unchecked(&mut bytes); in test_parse_bad_version()
908 let packet = Packet::new_unchecked(&*packet.into_inner()); in test_parse_bad_version()
[all …]
Ddhcpv4.rs236 pub const fn new_unchecked(buffer: T) -> Packet<T> { in new_unchecked() method
245 let packet = Self::new_unchecked(buffer); in new_checked()
1032 let packet = Packet::new_unchecked(DISCOVER_BYTES); in test_deconstruct_discover()
1088 let mut packet = Packet::new_unchecked(&mut bytes); in test_construct_discover()
1200 let packet = Packet::new_unchecked(DISCOVER_BYTES); in test_parse_discover()
1209 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit_discover()
1223 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit_offer()
1242 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit_offer_dns()
1245 let packet = Packet::new_unchecked(&bytes); in test_emit_offer_dns()
1282 let packet = Packet::new_unchecked(ACK_DNS_SERVER_BYTES); in test_parse_ack_dns_servers()
[all …]
Dsixlowpan.rs271 pub const fn new_unchecked(buffer: T) -> Self { in new_unchecked() method
280 let packet = Self::new_unchecked(buffer); in new_checked()
545 pub const fn new_unchecked(buffer: T) -> Self { in new_unchecked() method
554 let packet = Self::new_unchecked(buffer); in new_checked()
1321 let packet = Packet::new_unchecked(bytes); in iphc_fields()
1357 let packet = Packet::new_unchecked(bytes); in iphc_fields()
1515 pub const fn new_unchecked(buffer: T) -> Self { in new_unchecked() method
1524 let packet = Self::new_unchecked(buffer); in new_checked()
1734 pub const fn new_unchecked(buffer: T) -> Self { in new_unchecked() method
1743 let packet = Self::new_unchecked(buffer); in new_checked()
[all …]
/smoltcp-0.9.1/fuzz/fuzz_targets/
Dsixlowpan_packet.rs35 let mut frame = SixlowpanFragPacket::new_unchecked(&mut buffer[..]);
49 let mut iphc_frame = SixlowpanIphcPacket::new_unchecked(&mut buffer[..]);
65 SixlowpanExtHeaderPacket::new_unchecked(
87 SixlowpanUdpNhcPacket::new_unchecked(
109 Ipv6HopByHopHeader::new_unchecked(&mut buffer[..]);
121 Icmpv4Packet::new_unchecked(&mut buffer[..]);
133 let mut frame = IgmpPacket::new_unchecked(&mut buffer[..]);
147 let mut frame = TcpPacket::new_unchecked(&mut buffer[..]);
167 let mut packet = UdpPacket::new_unchecked(&mut buffer[..]);
193 Ipv6FragmentHeader::new_unchecked(&mut buffer[..]);
[all …]
Dtcp_headers.rs68 let eth_frame = EthernetFrame::new_unchecked(&frame_data); in fuzz_packet()
72 Ipv4Packet::new_unchecked(eth_frame.payload()).header_len() as usize in fuzz_packet()
75 Ipv6Packet::new_unchecked(eth_frame.payload()).header_len() as usize in fuzz_packet()
Dieee802154_header.rs15 let mut frame = Ieee802154Frame::new_unchecked(&mut buffer[..]);
/smoltcp-0.9.1/src/iface/interface/
Dsixlowpan.rs221 let mut ipv6_packet = Ipv6Packet::new_unchecked(&mut buffer[..ipv6_repr.buffer_len()]); in decompress_sixlowpan()
240 let mut udp = UdpPacket::new_unchecked( in decompress_sixlowpan()
377 SixlowpanIphcPacket::new_unchecked(&mut pkt.buffer[..iphc_repr.buffer_len()]); in dispatch_ieee802154()
386 let mut udp_packet = SixlowpanUdpNhcPacket::new_unchecked( in dispatch_ieee802154()
400 TcpPacket::new_unchecked(&mut b[..tcp_repr.buffer_len()]); in dispatch_ieee802154()
411 Icmpv6Packet::new_unchecked(&mut b[..icmp_repr.buffer_len()]); in dispatch_ieee802154()
463 let mut ieee_packet = Ieee802154Frame::new_unchecked(&mut tx_buf[..ieee_len]); in dispatch_ieee802154()
468 let mut frag1_packet = SixlowpanFragPacket::new_unchecked(&mut tx_buf); in dispatch_ieee802154()
487 let mut ieee_packet = Ieee802154Frame::new_unchecked(&mut tx_buf[..ieee_len]); in dispatch_ieee802154()
492 SixlowpanIphcPacket::new_unchecked(&mut tx_buf[..iphc_repr.buffer_len()]); in dispatch_ieee802154()
[all …]
Dtests.rs164 let frame = Ipv4Packet::new_unchecked(&bytes); in test_no_icmp_no_unicast_ipv4()
198 let frame = Ipv6Packet::new_unchecked(&bytes); in test_no_icmp_no_unicast_ipv6()
223 let frame = Ipv4Packet::new_unchecked(&bytes); in test_icmp_error_no_payload()
325 let mut packet_unicast = UdpPacket::new_unchecked(&mut udp_bytes_unicast); in test_icmp_error_port_unreachable()
326 let mut packet_broadcast = UdpPacket::new_unchecked(&mut udp_bytes_broadcast); in test_icmp_error_port_unreachable()
435 let mut packet = UdpPacket::new_unchecked(&mut udp_bytes); in test_handle_udp_broadcast()
535 &mut Ipv4Packet::new_unchecked(&mut bytes), in test_handle_ipv4_broadcast()
539 &mut Icmpv4Packet::new_unchecked(&mut bytes[ipv4_repr.buffer_len()..]), in test_handle_ipv4_broadcast()
542 Ipv4Packet::new_unchecked(&bytes) in test_handle_ipv4_broadcast()
601 let mut packet = UdpPacket::new_unchecked(&mut bytes[..]); in test_icmp_reply_size()
[all …]
Dmod.rs366 icmpv4_repr.emit(&mut Icmpv4Packet::new_unchecked(payload), &caps.checksum) in emit_payload()
370 igmp_repr.emit(&mut IgmpPacket::new_unchecked(payload)) in emit_payload()
376 &mut Icmpv6Packet::new_unchecked(payload), in emit_payload()
383 &mut UdpPacket::new_unchecked(payload), in emit_payload()
411 &mut TcpPacket::new_unchecked(payload), in emit_payload()
419 &mut UdpPacket::new_unchecked(payload), in emit_payload()
423 |buf| dhcp_repr.emit(&mut DhcpPacket::new_unchecked(buf)).unwrap(), in emit_payload()
1478 let mut packet = ArpPacket::new_unchecked(frame.payload_mut()); in dispatch()
1618 arp_repr.emit(&mut ArpPacket::new_unchecked(frame.payload_mut())) in lookup_hardware_addr()
1733 let mut frame = EthernetFrame::new_unchecked(tx_buffer); in dispatch_ip()
[all …]
/smoltcp-0.9.1/src/socket/
Dicmp.rs386 let packet = UdpPacket::new_unchecked(data); in accepts()
405 let packet = UdpPacket::new_unchecked(data); in accepts()
453 &mut Icmpv4Packet::new_unchecked(packet_buf), in process()
471 &mut Icmpv6Packet::new_unchecked(packet_buf), in process()
507 let packet = Icmpv4Packet::new_unchecked(&*packet_buf); in dispatch()
539 let packet = Icmpv6Packet::new_unchecked(&*packet_buf); in dispatch()
676 let mut packet = Icmpv4Packet::new_unchecked(&mut bytes); in test_send_dispatch()
719 let mut packet = Icmpv4Packet::new_unchecked(&mut bytes); in test_set_hop_limit_v4()
758 let mut packet = Icmpv4Packet::new_unchecked(&mut bytes[..]); in test_recv_process()
781 let mut packet = Icmpv4Packet::new_unchecked(&mut bytes); in test_accept_bad_id()
[all …]
Draw.rs350 let packet = Ipv4Packet::new_unchecked(&*packet.into_inner()); in dispatch()
374 let packet = Ipv6Packet::new_unchecked(&*packet.into_inner()); in dispatch()
615 Ipv4Packet::new_unchecked(&mut wrong_version).set_version(6); in test_send_illegal()
624 Ipv4Packet::new_unchecked(&mut wrong_protocol).set_next_header(IpProtocol::Tcp); in test_send_illegal()
638 Ipv6Packet::new_unchecked(&mut wrong_version[..]).set_version(4); in test_send_illegal()
647 Ipv6Packet::new_unchecked(&mut wrong_protocol[..]).set_next_header(IpProtocol::Tcp); in test_send_illegal()
666 Ipv4Packet::new_unchecked(&mut cksumd_packet).fill_checksum(); in test_recv_process()
720 Ipv4Packet::new_unchecked(&mut cksumd_packet).fill_checksum(); in test_peek_process()
/smoltcp-0.9.1/benches/
Dbench.rs49 let mut packet = TcpPacket::new_unchecked(&mut bytes); in bench_emit_tcp()
70 let mut packet = UdpPacket::new_unchecked(&mut bytes); in bench_emit_udp()
95 let mut packet = Ipv4Packet::new_unchecked(&mut bytes); in bench_emit_ipv4()
113 let mut packet = Ipv6Packet::new_unchecked(&mut bytes); in bench_emit_ipv6()

12