Home
last modified time | relevance | path

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

/smoltcp-0.9.1/src/wire/
Dipv6hopbyhop.rs46 let bytes = length_field as usize * 8 + 8; in OPTIONS() localVariable
47 2..bytes in OPTIONS()
269 let mut bytes = vec![]; in test_overlong() localVariable
270 bytes.extend(&REPR_PACKET_PAD4[..]); in test_overlong()
271 bytes.push(0); in test_overlong()
274 Header::new_unchecked(&bytes).options().len(), in test_overlong()
278 Header::new_unchecked(&mut bytes).options_mut().len(), in test_overlong()
282 let mut bytes = vec![]; in test_overlong() localVariable
283 bytes.extend(&REPR_PACKET_PAD12[..]); in test_overlong()
284 bytes.push(0); in test_overlong()
[all …]
Ddns.rs164 pub fn parse_name<'a>(&'a self, mut bytes: &'a [u8]) -> impl Iterator<Item = Result<&'a [u8]>> { in parse_name()
168 if bytes.is_empty() { in parse_name()
171 match bytes[0] { in parse_name()
175 if bytes.len() < 1 + len { in parse_name()
178 let label = &bytes[1..1 + len]; in parse_name()
179 bytes = &bytes[1 + len..]; in parse_name()
183 if bytes.len() < 2 { in parse_name()
186 let y = bytes[1]; in parse_name()
204 bytes = &packet[ptr..]; in parse_name()
261 mut bytes: &'a [u8], in parse_name_part()
[all …]
Dipv6.rs106 let mut bytes = [0; ADDR_SIZE]; in from_bytes() localVariable
107 bytes.copy_from_slice(data); in from_bytes()
108 Address(bytes) in from_bytes()
117 let mut bytes = [0; ADDR_SIZE]; in from_parts() localVariable
118 for (word_idx, chunk) in bytes.chunks_mut(2).enumerate() { in from_parts()
121 Address(bytes) in from_parts()
200 let mut bytes = [0u8; ADDR_SIZE]; localVariable
204 bytes[0..idx].copy_from_slice(first);
207 bytes[idx] = part & (!(0xff >> modulus) as u8);
209 bytes
[all …]
Dethernet.rs40 let mut bytes = [0; 6]; in from_bytes() localVariable
41 bytes.copy_from_slice(data); in from_bytes()
42 Address(bytes) in from_bytes()
73 let bytes = self.0; in fmt() localVariable
77 bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5] in fmt()
345 let mut bytes = vec![0xa5; 64]; in test_construct() localVariable
346 let mut frame = Frame::new_unchecked(&mut bytes); in test_construct()
391 let mut bytes = vec![0xa5; 54]; in test_construct() localVariable
392 let mut frame = Frame::new_unchecked(&mut bytes); in test_construct()
Dsixlowpan.rs66 let mut bytes = [0; 16]; in resolve() localVariable
68 let copy_context = |index: usize, bytes: &mut [u8]| -> Result<()> { in resolve()
74 bytes[..ADDRESS_CONTEXT_LENGTH].copy_from_slice(&context.0); in resolve()
83 bytes[0..2].copy_from_slice(&LINK_LOCAL_PREFIX[..]); in resolve()
84 bytes[8..].copy_from_slice(inline); in resolve()
85 Ok(ipv6::Address::from_bytes(&bytes[..])) in resolve()
88 bytes[0..2].copy_from_slice(&LINK_LOCAL_PREFIX[..]); in resolve()
89 bytes[11..13].copy_from_slice(&EUI64_MIDDLE_VALUE[..]); in resolve()
90 bytes[14..].copy_from_slice(inline); in resolve()
91 Ok(ipv6::Address::from_bytes(&bytes[..])) in resolve()
[all …]
Dipv6option.rs362 let bytes = [0u8]; in test_check_len() localVariable
366 Ipv6Option::new_unchecked(&bytes[..0]).check_len() in test_check_len()
415 let bytes: [u8; 2] = [0x1, 0x0]; in test_option_deconstruct() localVariable
416 let opt = Ipv6Option::new_unchecked(&bytes); in test_option_deconstruct()
427 let bytes: [u8; 10] = [0x1, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff]; in test_option_deconstruct() localVariable
428 let opt = Ipv6Option::new_unchecked(&bytes); in test_option_deconstruct()
434 let bytes: [u8; 1] = [0xff]; in test_option_deconstruct() localVariable
435 let opt = Ipv6Option::new_unchecked(&bytes); in test_option_deconstruct()
439 assert_eq!(Ipv6Option::new_checked(&bytes), Err(Error)); in test_option_deconstruct()
473 let mut bytes = [255u8; 1]; // don't assume bytes are initialized to zero in test_option_emit() localVariable
[all …]
Dipv4.rs65 let mut bytes = [0; ADDR_SIZE]; in from_bytes() localVariable
66 bytes.copy_from_slice(data); in from_bytes()
67 Address(bytes) in from_bytes()
129 let bytes = self.0; in fmt() localVariable
130 write!(f, "{}.{}.{}.{}", bytes[0], bytes[1], bytes[2], bytes[3]) in fmt()
831 let mut bytes = vec![0xa5; 30]; in test_construct() localVariable
832 let mut packet = Packet::new_unchecked(&mut bytes); in test_construct()
854 let mut bytes = vec![]; in test_overlong() localVariable
855 bytes.extend(&PACKET_BYTES[..]); in test_overlong()
856 bytes.push(0); in test_overlong()
[all …]
Dieee802154.rs148 let mut bytes = [0; 8]; localVariable
149 bytes.copy_from_slice(&value[..]);
151 bytes[0] ^= 1 << 1;
153 Some(bytes)
161 let mut bytes = [0; 16]; in as_link_local_address() localVariable
162 bytes[0] = 0xfe; in as_link_local_address()
163 bytes[1] = 0x80; in as_link_local_address()
164 bytes[8..].copy_from_slice(&self.as_eui_64()?); in as_link_local_address()
166 Some(Ipv6Address::from_bytes(&bytes)) in as_link_local_address()
174 Self::Short(bytes) => write!(f, "{:02x}-{:02x}", bytes[0], bytes[1]), in fmt()
[all …]
Dndiscoption.rs667 let mut bytes = [0x00; 32]; in test_construct() localVariable
668 let mut opt = NdiscOption::new_unchecked(&mut bytes[..]); in test_construct()
682 let bytes = [0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; in test_short_packet() localVariable
683 assert_eq!(NdiscOption::new_checked(&bytes), Err(Error)); in test_short_packet()
689 let mut bytes = [0x01, 0x01, 0x54, 0x52, 0x00, 0x12, 0x23, 0x34]; in test_repr_parse_link_layer_opt_ethernet() localVariable
693 Repr::parse(&NdiscOption::new_unchecked(&bytes)), in test_repr_parse_link_layer_opt_ethernet()
697 bytes[0] = 0x02; in test_repr_parse_link_layer_opt_ethernet()
700 Repr::parse(&NdiscOption::new_unchecked(&bytes)), in test_repr_parse_link_layer_opt_ethernet()
709 let mut bytes = [ in test_repr_parse_link_layer_opt_ieee802154() localVariable
716 Repr::parse(&NdiscOption::new_unchecked(&bytes)), in test_repr_parse_link_layer_opt_ieee802154()
[all …]
Dudp.rs368 let mut bytes = vec![0xa5; 12]; in test_construct() localVariable
369 let mut packet = Packet::new_unchecked(&mut bytes); in test_construct()
381 let mut bytes = vec![0; 12]; in test_impossible_len() localVariable
382 let mut packet = Packet::new_unchecked(&mut bytes); in test_impossible_len()
390 let mut bytes = vec![0; 8]; in test_zero_checksum() localVariable
391 let mut packet = Packet::new_unchecked(&mut bytes); in test_zero_checksum()
402 let mut bytes = vec![0; 8]; in test_no_checksum() localVariable
403 let mut packet = Packet::new_unchecked(&mut bytes); in test_no_checksum()
437 let mut bytes = vec![0xa5; repr.header_len() + PAYLOAD_BYTES.len()]; in test_emit() localVariable
438 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit()
Dmld.rs463 let mut bytes = vec![0xff; 44]; in test_query_construct() localVariable
464 let mut packet = Packet::new_unchecked(&mut bytes[..]); in test_query_construct()
504 let mut bytes = vec![0xff; 44]; in test_record_construct() localVariable
505 let mut packet = Packet::new_unchecked(&mut bytes[..]); in test_record_construct()
553 let mut bytes = [0x2a; 44]; in test_query_repr_emit() localVariable
554 let mut packet = Packet::new_unchecked(&mut bytes[..]); in test_query_repr_emit()
567 let mut bytes = [0x2a; 44]; in test_report_repr_emit() localVariable
568 let mut packet = Packet::new_unchecked(&mut bytes[..]); in test_report_repr_emit()
Dipv6routing.rs95 let bytes = length_field as usize * 8 + 8; in DATA() localVariable
96 4..bytes in DATA()
652 let mut bytes = [0u8; 24]; in test_repr_emit() localVariable
653 let mut header = Header::new(&mut bytes[..]); in test_repr_emit()
657 let mut bytes = [0u8; 40]; in test_repr_emit() localVariable
658 let mut header = Header::new(&mut bytes[..]); in test_repr_emit()
662 let mut bytes = [0u8; 16]; in test_repr_emit() localVariable
663 let mut header = Header::new(&mut bytes[..]); in test_repr_emit()
Ddhcpv4.rs1087 let mut bytes = vec![0xa5; 276]; in test_construct_discover() localVariable
1088 let mut packet = Packet::new_unchecked(&mut bytes); in test_construct_discover()
1208 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_emit_discover() localVariable
1209 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit_discover()
1222 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_emit_offer() localVariable
1223 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit_offer()
1241 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_emit_offer_dns() localVariable
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()
1269 let mut bytes = vec![0xa5; 5]; in test_emit_dhcp_option() localVariable
[all …]
Dipv6fragment.rs289 let mut bytes = [0u8; 8]; in test_repr_emit() localVariable
290 let mut header = Header::new_unchecked(&mut bytes); in test_repr_emit()
300 let mut bytes = [0u8; 8]; in test_repr_emit() localVariable
301 let mut header = Header::new_unchecked(&mut bytes); in test_repr_emit()
Dicmpv4.rs660 let mut bytes = vec![0xa5; 12]; in test_echo_construct() localVariable
661 let mut packet = Packet::new_unchecked(&mut bytes); in test_echo_construct()
689 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_echo_emit() localVariable
690 let mut packet = Packet::new_unchecked(&mut bytes); in test_echo_emit()
697 let bytes = [0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; in test_check_len() localVariable
699 assert_eq!(Packet::new_checked(&bytes[..4]), Err(Error)); in test_check_len()
700 assert!(Packet::new_checked(&bytes[..]).is_ok()); in test_check_len()
Dicmpv6.rs821 let mut bytes = vec![0xa5; 12]; in test_echo_construct() localVariable
822 let mut packet = Packet::new_unchecked(&mut bytes); in test_echo_construct()
850 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_echo_emit() localVariable
851 let mut packet = Packet::new_unchecked(&mut bytes); in test_echo_emit()
875 let mut bytes = vec![0xa5; 60]; in test_too_big_construct() localVariable
876 let mut packet = Packet::new_unchecked(&mut bytes); in test_too_big_construct()
903 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_too_big_emit() localVariable
904 let mut packet = Packet::new_unchecked(&mut bytes); in test_too_big_emit()
Digmp.rs408 let mut bytes = vec![0xa5; 8]; in test_leave_construct() localVariable
409 let mut packet = Packet::new_unchecked(&mut bytes); in test_leave_construct()
419 let mut bytes = vec![0xa5; 8]; in test_report_construct() localVariable
420 let mut packet = Packet::new_unchecked(&mut bytes); in test_report_construct()
Darp.rs416 let mut bytes = vec![0xa5; 28]; in test_construct() localVariable
417 let mut packet = Packet::new_unchecked(&mut bytes); in test_construct()
453 let mut bytes = vec![0xa5; 28]; in test_emit() localVariable
454 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit()
Dndisc.rs546 let mut bytes = vec![0x0; 24]; in test_router_advert_construct() localVariable
547 let mut packet = Packet::new_unchecked(&mut bytes); in test_router_advert_construct()
579 let mut bytes = vec![0x2a; 24]; in test_router_advert_repr_emit() localVariable
580 let mut packet = Packet::new_unchecked(&mut bytes[..]); in test_router_advert_repr_emit()
Dtcp.rs1131 let mut bytes = vec![0xa5; PACKET_BYTES.len()]; in test_construct() localVariable
1132 let mut packet = Packet::new_unchecked(&mut bytes); in test_construct()
1163 let mut bytes = vec![0; 20]; in test_impossible_len() localVariable
1164 let mut packet = Packet::new_unchecked(&mut bytes); in test_impossible_len()
1210 let mut bytes = vec![0xa5; repr.buffer_len()]; in test_emit() localVariable
1211 let mut packet = Packet::new_unchecked(&mut bytes); in test_emit()
/smoltcp-0.9.1/benches/
Dbench.rs46 let mut bytes = vec![0xa5; repr.buffer_len()]; in bench_emit_tcp() localVariable
49 let mut packet = TcpPacket::new_unchecked(&mut bytes); in bench_emit_tcp()
67 let mut bytes = vec![0xa5; repr.header_len() + PAYLOAD_BYTES.len()]; in bench_emit_udp() localVariable
70 let mut packet = UdpPacket::new_unchecked(&mut bytes); in bench_emit_udp()
92 let mut bytes = vec![0xa5; repr.buffer_len()]; in bench_emit_ipv4() localVariable
95 let mut packet = Ipv4Packet::new_unchecked(&mut bytes); in bench_emit_ipv4()
110 let mut bytes = vec![0xa5; repr.buffer_len()]; in bench_emit_ipv6() localVariable
113 let mut packet = Ipv6Packet::new_unchecked(&mut bytes); in bench_emit_ipv6()
/smoltcp-0.9.1/src/socket/
Dicmp.rs675 let mut bytes = [0xff; 24]; in test_send_dispatch() localVariable
676 let mut packet = Icmpv4Packet::new_unchecked(&mut bytes); in test_send_dispatch()
718 let mut bytes = [0xff; 24]; in test_set_hop_limit_v4() localVariable
719 let mut packet = Icmpv4Packet::new_unchecked(&mut bytes); in test_set_hop_limit_v4()
757 let mut bytes = [0xff; 24]; in test_recv_process() localVariable
758 let mut packet = Icmpv4Packet::new_unchecked(&mut bytes[..]); in test_recv_process()
780 let mut bytes = [0xff; 20]; in test_accept_bad_id() localVariable
781 let mut packet = Icmpv4Packet::new_unchecked(&mut bytes); in test_accept_bad_id()
802 let mut bytes = [0xff; 18]; in test_accepts_udp() localVariable
803 let mut packet = UdpPacket::new_unchecked(&mut bytes); in test_accepts_udp()
[all …]
/smoltcp-0.9.1/src/iface/interface/
Dtests.rs162 let mut bytes = vec![0u8; 54]; in test_no_icmp_no_unicast_ipv4() localVariable
163 repr.emit(&mut bytes, &ChecksumCapabilities::default()); in test_no_icmp_no_unicast_ipv4()
164 let frame = Ipv4Packet::new_unchecked(&bytes); in test_no_icmp_no_unicast_ipv4()
196 let mut bytes = vec![0u8; 54]; in test_no_icmp_no_unicast_ipv6() localVariable
197 repr.emit(&mut bytes, &ChecksumCapabilities::default()); in test_no_icmp_no_unicast_ipv6()
198 let frame = Ipv6Packet::new_unchecked(&bytes); in test_no_icmp_no_unicast_ipv6()
221 let mut bytes = vec![0u8; 34]; in test_icmp_error_no_payload() localVariable
222 repr.emit(&mut bytes, &ChecksumCapabilities::default()); in test_icmp_error_no_payload()
223 let frame = Ipv4Packet::new_unchecked(&bytes); in test_icmp_error_no_payload()
532 let mut bytes = vec![0u8; ipv4_repr.buffer_len() + icmpv4_repr.buffer_len()]; in test_handle_ipv4_broadcast() localVariable
[all …]
/smoltcp-0.9.1/src/phy/
Dpcap_writer.rs44 let mut bytes = [0u8; 2]; in write_u16() localVariable
45 NativeEndian::write_u16(&mut bytes, value); in write_u16()
46 self.write(&bytes[..]) in write_u16()
51 let mut bytes = [0u8; 4]; in write_u32() localVariable
52 NativeEndian::write_u32(&mut bytes, value); in write_u32()
53 self.write(&bytes[..]) in write_u32()
/smoltcp-0.9.1/
DREADME.md423 The TCP socket buffers are limited to 1024 bytes to make packet traces more interesting.
474 Except for the socket on port 6971. the buffers are only 64 bytes long, for convenience