Home
last modified time | relevance | path

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

12

/smoltcp-0.9.1/fuzz/fuzz_targets/
Dsixlowpan_packet.rs33 if let Ok(repr) = SixlowpanFragRepr::parse(&frame) {
34 let mut buffer = vec![0; repr.buffer_len()];
36 repr.emit(&mut frame);
61 if let Ok(repr) = SixlowpanExtHeaderRepr::parse(&frame)
63 let mut buffer = vec![0; repr.buffer_len()];
68 repr.emit(&mut ext_header_frame);
76 if let Ok(repr) = SixlowpanUdpNhcRepr::parse(
83 repr.header_len()
90 repr.emit(
106 if let Ok(repr) = Ipv6HopByHopRepr::parse(&frame) {
[all …]
Dieee802154_header.rs7 if let Ok(repr) = Ieee802154Repr::parse(frame) {
10 let mut buffer = vec![0; repr.buffer_len()];
16 repr.emit(&mut frame);
/smoltcp-0.9.1/benches/
Dbench.rs33 let repr = TcpRepr { in bench_emit_tcp() localVariable
46 let mut bytes = vec![0xa5; repr.buffer_len()]; in bench_emit_tcp()
50 repr.emit( in bench_emit_tcp()
63 let repr = UdpRepr { in bench_emit_udp() localVariable
67 let mut bytes = vec![0xa5; repr.header_len() + PAYLOAD_BYTES.len()]; in bench_emit_udp()
71 repr.emit( in bench_emit_udp()
85 let repr = Ipv4Repr { in bench_emit_ipv4() localVariable
92 let mut bytes = vec![0xa5; repr.buffer_len()]; in bench_emit_ipv4()
96 repr.emit(&mut packet, &ChecksumCapabilities::default()); in bench_emit_ipv4()
103 let repr = Ipv6Repr { in bench_emit_ipv6() localVariable
[all …]
/smoltcp-0.9.1/src/wire/
Dip.rs551 fn from(repr: Ipv4Repr) -> Repr { in from()
552 Repr::Ipv4(repr) in from()
558 fn from(repr: Ipv6Repr) -> Repr { in from()
559 Repr::Ipv6(repr) in from()
612 Repr::Ipv4(repr) => Address::Ipv4(repr.src_addr), in src_addr()
614 Repr::Ipv6(repr) => Address::Ipv6(repr.src_addr), in src_addr()
622 Repr::Ipv4(repr) => Address::Ipv4(repr.dst_addr), in dst_addr()
624 Repr::Ipv6(repr) => Address::Ipv6(repr.dst_addr), in dst_addr()
632 Repr::Ipv4(repr) => repr.next_header, in next_header()
634 Repr::Ipv6(repr) => repr.next_header, in next_header()
[all …]
Dipv6hopbyhop.rs150 Ok(repr) => write!(f, "{repr}"), in fmt()
316 let repr = Repr::parse(&header).unwrap(); in test_repr_parse_valid() localVariable
318 repr, in test_repr_parse_valid()
327 let repr = Repr::parse(&header).unwrap(); in test_repr_parse_valid() localVariable
329 repr, in test_repr_parse_valid()
340 let repr = Repr { in test_repr_emit() localVariable
347 repr.emit(&mut header); in test_repr_emit()
350 let repr = Repr { in test_repr_emit() localVariable
357 repr.emit(&mut header); in test_repr_emit()
364 let repr = Repr::parse(&header).unwrap(); in test_buffer_len() localVariable
[all …]
Dipv6fragment.rs151 Ok(repr) => write!(f, "{repr}"), in fmt()
257 let repr = Repr::parse(&header).unwrap(); in test_repr_parse_valid() localVariable
259 repr, in test_repr_parse_valid()
269 let repr = Repr::parse(&header).unwrap(); in test_repr_parse_valid() localVariable
271 repr, in test_repr_parse_valid()
283 let repr = Repr { in test_repr_emit() localVariable
291 repr.emit(&mut header); in test_repr_emit()
294 let repr = Repr { in test_repr_emit() localVariable
302 repr.emit(&mut header); in test_repr_emit()
309 let repr = Repr::parse(&header).unwrap(); in test_buffer_len() localVariable
[all …]
Dicmpv6.rs562 let repr = Ipv6Repr { in parse() localVariable
569 Ok((payload, repr)) in parse()
578 let (payload, repr) = create_packet_from_payload(packet)?; in parse()
581 header: repr, in parse()
586 let (payload, repr) = create_packet_from_payload(packet)?; in parse()
589 header: repr, in parse()
594 let (payload, repr) = create_packet_from_payload(packet)?; in parse()
597 header: repr, in parse()
602 let (payload, repr) = create_packet_from_payload(packet)?; in parse()
606 header: repr, in parse()
[all …]
Dipv6option.rs207 Ok(repr) => write!(f, "{repr}"), in fmt()
319 Ok(repr) => { in next()
320 self.pos += repr.buffer_len(); in next()
321 Some(Ok(repr)) in next()
472 let repr = Repr::Pad1; in test_option_emit() localVariable
475 repr.emit(&mut opt); in test_option_emit()
478 let repr = Repr::PadN(1); in test_option_emit() localVariable
481 repr.emit(&mut opt); in test_option_emit()
485 let repr = Repr::Unknown { in test_option_emit() localVariable
492 repr.emit(&mut opt); in test_option_emit()
Ddhcpv4.rs1201 let repr = Repr::parse(&packet).unwrap(); in test_parse_discover() localVariable
1202 assert_eq!(repr, discover_repr()); in test_parse_discover()
1207 let repr = discover_repr(); in test_emit_discover() localVariable
1208 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_emit_discover()
1210 repr.emit(&mut packet).unwrap(); in test_emit_discover()
1221 let repr = offer_repr(); in test_emit_offer() localVariable
1222 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_emit_offer()
1224 repr.emit(&mut packet).unwrap(); in test_emit_offer()
1229 let repr = { in test_emit_offer_dns() localVariable
1230 let mut repr = offer_repr(); in test_emit_offer_dns() localVariable
[all …]
Dudp.rs423 let repr = Repr::parse( in test_parse() localVariable
430 assert_eq!(repr, packet_repr()); in test_parse()
436 let repr = packet_repr(); in test_emit() localVariable
437 let mut bytes = vec![0xa5; repr.header_len() + PAYLOAD_BYTES.len()]; in test_emit()
439 repr.emit( in test_emit()
454 let repr = Repr::parse( in test_checksum_omitted() localVariable
461 assert_eq!(repr, packet_repr()); in test_checksum_omitted()
Dmld.rs530 let repr = Icmpv6Repr::parse( in test_query_repr_parse() localVariable
536 assert_eq!(repr, Ok(create_repr(Message::MldQuery))); in test_query_repr_parse()
542 let repr = Icmpv6Repr::parse( in test_report_repr_parse() localVariable
548 assert_eq!(repr, Ok(create_repr(Message::MldReport))); in test_report_repr_parse()
555 let repr = create_repr(Message::MldQuery); in test_query_repr_emit() localVariable
556 repr.emit( in test_query_repr_emit()
569 let repr = create_repr(Message::MldReport); in test_report_repr_emit() localVariable
570 repr.emit( in test_report_repr_emit()
Dipv6routing.rs388 Ok(repr) => write!(f, "{repr}"), in fmt()
638 let repr = Repr::parse(&header).unwrap(); in test_repr_parse_valid() localVariable
639 assert_eq!(repr, REPR_TYPE2); in test_repr_parse_valid()
642 let repr = Repr::parse(&header).unwrap(); in test_repr_parse_valid() localVariable
643 assert_eq!(repr, REPR_SRH_FULL); in test_repr_parse_valid()
646 let repr = Repr::parse(&header).unwrap(); in test_repr_parse_valid() localVariable
647 assert_eq!(repr, REPR_SRH_ELIDED); in test_repr_parse_valid()
Dicmpv4.rs559 Ok(repr) => write!(f, "{repr}"), in fmt()
682 let repr = Repr::parse(&packet, &ChecksumCapabilities::default()).unwrap(); in test_echo_parse() localVariable
683 assert_eq!(repr, echo_packet_repr()); in test_echo_parse()
688 let repr = echo_packet_repr(); in test_echo_emit() localVariable
689 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_echo_emit()
691 repr.emit(&mut packet, &ChecksumCapabilities::default()); in test_echo_emit()
Dndiscoption.rs386 Ok(repr) => write!(f, "{repr}"), in fmt()
623 Ok(repr) => { in pretty_print()
731 let repr = Repr::PrefixInformation(PrefixInformation { in test_repr_parse_prefix_info() localVariable
740 Ok(repr) in test_repr_parse_prefix_info()
747 let repr = Repr::PrefixInformation(PrefixInformation { in test_repr_emit_prefix_info() localVariable
755 repr.emit(&mut opt); in test_repr_emit_prefix_info()
Dipv6.rs641 Ok(repr) => write!(f, "{repr}"), in fmt()
1173 let repr = Repr::parse(&packet).unwrap(); in test_repr_parse_valid() localVariable
1174 assert_eq!(repr, packet_repr()); in test_repr_parse_valid()
1209 let repr = packet_repr(); in test_basic_repr_emit() localVariable
1210 let mut bytes = vec![0xff; repr.buffer_len() + REPR_PAYLOAD_BYTES.len()]; in test_basic_repr_emit()
1212 repr.emit(&mut packet); in test_basic_repr_emit()
Dtcp.rs1196 let repr = Repr::parse( in test_parse() localVariable
1203 assert_eq!(repr, packet_repr()); in test_parse()
1209 let repr = packet_repr(); in test_emit() localVariable
1210 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_emit()
1212 repr.emit( in test_emit()
1224 let mut repr = packet_repr(); in test_header_len_multiple_of_4() localVariable
1225 repr.window_scale = Some(0); // This TCP Option needs 3 bytes. in test_header_len_multiple_of_4()
1226 assert_eq!(repr.header_len() % 4, 0); // Should e.g. be 28 instead of 27. in test_header_len_multiple_of_4()
Darp.rs325 Ok(repr) => write!(f, "{repr}"), in fmt()
447 let repr = Repr::parse(&packet).unwrap(); in test_parse() localVariable
448 assert_eq!(repr, packet_repr()); in test_parse()
/smoltcp-0.9.1/src/socket/
Dtcp.rs1168 pub(crate) fn reply(ip_repr: &IpRepr, repr: &TcpRepr) -> (IpRepr, TcpRepr<'static>) { in reply()
1170 src_port: repr.dst_port, in reply()
1171 dst_port: repr.src_port, in reply()
1192 pub(crate) fn rst_reply(ip_repr: &IpRepr, repr: &TcpRepr) -> (IpRepr, TcpRepr<'static>) { in rst_reply()
1193 debug_assert!(repr.control != TcpControl::Rst); in rst_reply()
1195 let (ip_reply_repr, mut reply_repr) = Self::reply(ip_repr, repr); in rst_reply()
1200 reply_repr.seq_number = repr.ack_number.unwrap_or_default(); in rst_reply()
1201 if repr.control == TcpControl::Syn && repr.ack_number.is_none() { in rst_reply()
1202 reply_repr.ack_number = Some(repr.seq_number + repr.segment_len()); in rst_reply()
1208 fn ack_reply(&mut self, ip_repr: &IpRepr, repr: &TcpRepr) -> (IpRepr, TcpRepr<'static>) { in ack_reply()
[all …]
Dudp.rs373 pub(crate) fn accepts(&self, _cx: &mut Context, ip_repr: &IpRepr, repr: &UdpRepr) -> bool { in accepts()
374 if self.endpoint.port != repr.dst_port { in accepts()
392 repr: &UdpRepr, in process()
395 debug_assert!(self.accepts(cx, ip_repr, repr)); in process()
401 port: repr.src_port, in process()
454 let repr = UdpRepr { in dispatch() localVariable
462 repr.header_len() + payload_buf.len(), in dispatch()
465 emit(cx, (ip_repr, repr, payload_buf)) in dispatch()
815 let repr = UdpRepr { in test_process_empty_payload() localVariable
819 socket.process(&mut cx, &REMOTE_IP_REPR, &repr, &[]); in test_process_empty_payload()
Dicmp.rs393 Ok(repr) => endpoint.port == repr.src_port, in accepts()
412 Ok(repr) => endpoint.port == repr.src_port, in accepts()
508 let repr = match Icmpv4Repr::parse(&packet, &ChecksumCapabilities::ignored()) { in dispatch() localVariable
522 payload_len: repr.buffer_len(), in dispatch()
525 emit(cx, (ip_repr, IcmpRepr::Ipv4(repr))) in dispatch()
540 let repr = match Icmpv6Repr::parse( in dispatch() localVariable
559 payload_len: repr.buffer_len(), in dispatch()
562 emit(cx, (ip_repr, IcmpRepr::Ipv6(repr))) in dispatch()
Ddhcpv4.rs280 repr: &UdpRepr, in process()
286 assert!(repr.src_port == self.server_port && repr.dst_port == self.client_port); in process()
796 ($socket:ident, $repr:expr) =>
797 (send!($socket, time 0, $repr));
798 ($socket:ident, time $time:expr, $repr:expr) =>
799 (send(&mut $socket, Instant::from_millis($time), $repr));
/smoltcp-0.9.1/src/iface/interface/
Dipv4.rs337 let ip_len = (frag.packet_len - frag.sent_bytes + frag.ipv4.repr.buffer_len()).min(mtu_max); in dispatch_ipv4_frag()
338 let payload_len = ip_len - frag.ipv4.repr.buffer_len(); in dispatch_ipv4_frag()
341 frag.ipv4.repr.payload_len = payload_len; in dispatch_ipv4_frag()
352 let emit_ethernet = |repr: &IpRepr, tx_buffer: &mut [u8]| { in dispatch_ipv4_frag()
359 match repr.version() { in dispatch_ipv4_frag()
370 emit_ethernet(&IpRepr::Ipv4(frag.ipv4.repr), tx_buffer); in dispatch_ipv4_frag()
375 Ipv4Packet::new_unchecked(&mut tx_buffer[..frag.ipv4.repr.buffer_len()]); in dispatch_ipv4_frag()
376 frag.ipv4.repr.emit(&mut packet, &caps.checksum); in dispatch_ipv4_frag()
386 tx_buffer[frag.ipv4.repr.buffer_len()..][..payload_len].copy_from_slice( in dispatch_ipv4_frag()
387 &frag.buffer[frag.ipv4.frag_offset as usize + frag.ipv4.repr.buffer_len()..] in dispatch_ipv4_frag()
Dipv6.rs157 Icmpv6Repr::Ndisc(repr) if ip_repr.hop_limit() == 0xff => match ip_repr { in process_icmpv6()
158 IpRepr::Ipv6(ipv6_repr) => self.process_ndisc(ipv6_repr, repr), in process_icmpv6()
180 repr: NdiscRepr<'frame>, in process_ndisc()
182 match repr { in process_ndisc()
Dmod.rs95 repr: Ipv4Repr, field
132 repr: Ipv4Repr { in new()
176 self.ipv4.repr = Ipv4Repr { in reset()
1732 let emit_ethernet = |repr: &IpRepr, tx_buffer: &mut [u8]| { in dispatch_ip()
1739 match repr.version() { in dispatch_ip()
1750 let emit_ip = |repr: &IpRepr, mut tx_buffer: &mut [u8]| { in dispatch_ip()
1751 repr.emit(&mut tx_buffer, &self.caps.checksum); in dispatch_ip()
1753 let payload = &mut tx_buffer[repr.header_len()..]; in dispatch_ip()
1754 packet.emit_payload(repr, payload, &caps); in dispatch_ip()
1761 IpRepr::Ipv4(mut repr) => { in dispatch_ip()
[all …]
Dtests.rs154 let repr = IpRepr::Ipv4(Ipv4Repr { in test_no_icmp_no_unicast_ipv4() localVariable
163 repr.emit(&mut bytes, &ChecksumCapabilities::default()); in test_no_icmp_no_unicast_ipv4()
188 let repr = IpRepr::Ipv6(Ipv6Repr { in test_no_icmp_no_unicast_ipv6() localVariable
197 repr.emit(&mut bytes, &ChecksumCapabilities::default()); in test_no_icmp_no_unicast_ipv6()
213 let repr = IpRepr::Ipv4(Ipv4Repr { in test_icmp_error_no_payload() localVariable
222 repr.emit(&mut bytes, &ChecksumCapabilities::default()); in test_icmp_error_no_payload()
709 let repr = ArpRepr::EthernetIpv4 { in test_handle_valid_arp_request() localVariable
722 repr.emit(&mut packet); in test_handle_valid_arp_request()
833 let repr = ArpRepr::EthernetIpv4 { in test_handle_other_arp_request() localVariable
846 repr.emit(&mut packet); in test_handle_other_arp_request()
[all …]

12