Home
last modified time | relevance | path

Searched refs:cx (Results 1 – 9 of 9) sorted by relevance

/smoltcp-0.9.1/src/socket/
Draw.rs291 pub(crate) fn process(&mut self, cx: &mut Context, ip_repr: &IpRepr, payload: &[u8]) { in process()
306 ip_repr.emit(&mut buf[..header_len], &cx.checksum_caps()); in process()
320 pub(crate) fn dispatch<F, E>(&mut self, cx: &mut Context, emit: F) -> Result<(), E> in dispatch()
326 let _checksum_caps = &cx.checksum_caps(); in dispatch()
359 emit(cx, (IpRepr::Ipv4(ipv4_repr), packet.payload())) in dispatch()
384 emit(cx, (IpRepr::Ipv6(ipv6_repr), packet.payload())) in dispatch()
511 let mut cx = Context::mock(); localVariable
515 socket.dispatch(&mut cx, |_, _| unreachable!()),
524 socket.dispatch(&mut cx, |_, (ip_repr, ip_payload)| {
534 socket.dispatch(&mut cx, |_, (ip_repr, ip_payload)| {
[all …]
Dudp.rs390 cx: &mut Context, in process()
395 debug_assert!(self.accepts(cx, ip_repr, repr)); in process()
424 pub(crate) fn dispatch<F, E>(&mut self, cx: &mut Context, emit: F) -> Result<(), E> in dispatch()
434 None => match cx.get_source_address(remote_endpoint.addr) { in dispatch()
465 emit(cx, (ip_repr, repr, payload_buf)) in dispatch()
632 let mut cx = Context::mock(); in test_send_dispatch() localVariable
638 socket.dispatch(&mut cx, |_, _| unreachable!()), in test_send_dispatch()
650 socket.dispatch(&mut cx, |_, (ip_repr, udp_repr, payload)| { in test_send_dispatch()
661 socket.dispatch(&mut cx, |_, (ip_repr, udp_repr, payload)| { in test_send_dispatch()
675 let mut cx = Context::mock(); in test_recv_process() localVariable
[all …]
Dicmp.rs372 pub(crate) fn accepts(&self, cx: &mut Context, ip_repr: &IpRepr, icmp_repr: &IcmpRepr) -> bool { in accepts()
391 &cx.checksum_caps(), in accepts()
410 &cx.checksum_caps(), in accepts()
483 pub(crate) fn dispatch<F, E>(&mut self, cx: &mut Context, emit: F) -> Result<(), E> in dispatch()
497 let src_addr = match cx.get_source_address_ipv4(dst_addr) { in dispatch()
525 emit(cx, (ip_repr, IcmpRepr::Ipv4(repr))) in dispatch()
529 let src_addr = match cx.get_source_address_ipv6(dst_addr) { in dispatch()
562 emit(cx, (ip_repr, IcmpRepr::Ipv6(repr))) in dispatch()
660 let mut cx = Context::mock(); in test_send_dispatch() localVariable
664 socket.dispatch(&mut cx, |_, _| unreachable!()), in test_send_dispatch()
[all …]
Dmod.rs75 pub(crate) fn poll_at(&self, cx: &mut Context) -> PollAt { in poll_at()
78 Socket::Raw(s) => s.poll_at(cx), in poll_at()
80 Socket::Icmp(s) => s.poll_at(cx), in poll_at()
82 Socket::Udp(s) => s.poll_at(cx), in poll_at()
84 Socket::Tcp(s) => s.poll_at(cx), in poll_at()
86 Socket::Dhcpv4(s) => s.poll_at(cx), in poll_at()
88 Socket::Dns(s) => s.poll_at(cx), in poll_at()
Ddhcpv4.rs278 cx: &mut Context, in process()
303 let Some(HardwareAddress::Ethernet(ethernet_addr)) = cx.hardware_addr() else { in process()
346 retry_at: cx.now(), in process()
357 Self::parse_ack(cx.now(), &dhcp_repr, self.max_lease_duration, state.server) in process()
374 cx.now(), in process()
491 fn random_transaction_id(cx: &mut Context) -> u32 { in random_transaction_id()
492 cx.rand().rand_u32() in random_transaction_id()
500 pub(crate) fn dispatch<F, E>(&mut self, cx: &mut Context, emit: F) -> Result<(), E> in dispatch()
506 let Some(HardwareAddress::Ethernet(ethernet_addr)) = cx.hardware_addr() else { in dispatch()
516 let next_transaction_id = Self::random_transaction_id(cx); in dispatch()
[all …]
Dtcp.rs764 cx: &mut Context, in connect()
794 None => cx in connect()
812 let seq = Self::random_seq_no(cx); in connect()
824 fn random_seq_no(cx: &mut Context) -> TcpSeqNumber { in random_seq_no()
825 TcpSeqNumber(cx.rand().rand_u32() as i32) in random_seq_no()
1267 cx: &mut Context, in challenge_ack_reply()
1271 if cx.now() < self.challenge_ack_timer { in challenge_ack_reply()
1276 self.challenge_ack_timer = cx.now() + Duration::from_secs(1); in challenge_ack_reply()
1311 cx: &mut Context, in process()
1315 debug_assert!(self.accepts(cx, ip_repr, repr)); in process()
[all …]
Ddns.rs200 cx: &mut Context, in start_query()
249 self.start_query_raw(cx, &raw_name, query_type, mdns) in start_query()
258 cx: &mut Context, in start_query_raw()
269 txid: cx.rand().rand_u16(), in start_query_raw()
270 port: cx.rand().rand_source_port(), in start_query_raw()
503 pub(crate) fn dispatch<F, E>(&mut self, cx: &mut Context, emit: F) -> Result<(), E> in dispatch()
528 let v = cx.now() + RETRANSMIT_TIMEOUT; in dispatch()
534 if timeout < cx.now() { in dispatch()
536 pq.timeout_at = Some(cx.now() + RETRANSMIT_TIMEOUT); in dispatch()
557 if pq.retransmit_at > cx.now() { in dispatch()
[all …]
/smoltcp-0.9.1/examples/
Dhttpclient.rs79 let cx = iface.context(); in main() localVariable
86 .connect(cx, (address, url.port().unwrap_or(80)), local_port) in main()
Dloopback.rs147 let cx = iface.context(); in main() localVariable
152 .connect(cx, (IpAddress::v4(127, 0, 0, 1), 1234), 65000) in main()