Home
last modified time | relevance | path

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

12

/smoltcp-0.9.1/src/iface/
Dsocket_set.rs12 pub struct SocketStorage<'a> {
13 inner: Option<Item<'a>>,
16 impl<'a> SocketStorage<'a> {
22 pub(crate) struct Item<'a> {
24 pub(crate) socket: Socket<'a>,
42 pub struct SocketSet<'a> {
43 sockets: ManagedSlice<'a, SocketStorage<'a>>,
46 impl<'a> SocketSet<'a> {
48 pub fn new<SocketsT>(sockets: SocketsT) -> SocketSet<'a> in new() argument
50 SocketsT: Into<ManagedSlice<'a, SocketStorage<'a>>>, in new() argument
[all …]
/smoltcp-0.9.1/src/socket/
Dmod.rs59 pub enum Socket<'a> {
61 Raw(raw::Socket<'a>),
63 Icmp(icmp::Socket<'a>),
65 Udp(udp::Socket<'a>),
67 Tcp(tcp::Socket<'a>),
69 Dhcpv4(dhcpv4::Socket<'a>),
71 Dns(dns::Socket<'a>),
74 impl<'a> Socket<'a> {
94 pub trait AnySocket<'a> {
95 fn upcast(self) -> Socket<'a>; in upcast() argument
[all …]
Ddns.rs114 pub struct Socket<'a> {
116 queries: ManagedSlice<'a, Option<DnsQuery>>,
122 impl<'a> Socket<'a> {
128 pub fn new<Q>(servers: &[IpAddress], queries: Q) -> Socket<'a> in new()
130 Q: Into<ManagedSlice<'a, Option<DnsQuery>>>, in new() argument
631 fn eq_names<'a>( in eq_names()
632 mut a: impl Iterator<Item = wire::Result<&'a [u8]>>, in eq_names()
633 mut b: impl Iterator<Item = wire::Result<&'a [u8]>>, in eq_names()
636 match (a.next(), b.next()) { in eq_names()
658 fn copy_name<'a, const N: usize>( in copy_name() argument
[all …]
/smoltcp-0.9.1/src/phy/
Dfuzz_injector.rs49 type RxToken<'a> = RxToken<'a, D::RxToken<'a>, FRx>
51 Self: 'a;
52 type TxToken<'a> = TxToken<'a, D::TxToken<'a>, FTx>
54 Self: 'a;
87 pub struct RxToken<'a, Rx: phy::RxToken, F: Fuzzer + 'a> {
88 fuzzer: &'a F,
92 impl<'a, Rx: phy::RxToken, FRx: Fuzzer> phy::RxToken for RxToken<'a, Rx, FRx> {
105 pub struct TxToken<'a, Tx: phy::TxToken, F: Fuzzer + 'a> {
106 fuzzer: &'a F,
110 impl<'a, Tx: phy::TxToken, FTx: Fuzzer> phy::TxToken for TxToken<'a, Tx, FTx> {
Dpcap_writer.rs168 type RxToken<'a> = RxToken<'a, D::RxToken<'a>, S>
170 Self: 'a;
171 type TxToken<'a> = TxToken<'a, D::TxToken<'a>, S>
173 Self: 'a;
214 pub struct RxToken<'a, Rx: phy::RxToken, S: PcapSink> {
216 sink: &'a RefCell<S>,
221 impl<'a, Rx: phy::RxToken, S: PcapSink> phy::RxToken for RxToken<'a, Rx, S> {
237 pub struct TxToken<'a, Tx: phy::TxToken, S: PcapSink> {
239 sink: &'a RefCell<S>,
244 impl<'a, Tx: phy::TxToken, S: PcapSink> phy::TxToken for TxToken<'a, Tx, S> {
Dfault_injector.rs197 type RxToken<'a> = RxToken<'a>
199 Self: 'a;
200 type TxToken<'a> = TxToken<'a, D::TxToken<'a>>
202 Self: 'a;
266 pub struct RxToken<'a> {
267 buf: &'a mut [u8],
270 impl<'a> phy::RxToken for RxToken<'a> {
280 pub struct TxToken<'a, Tx: phy::TxToken> {
281 state: &'a mut State,
288 impl<'a, Tx: phy::TxToken> phy::TxToken for TxToken<'a, Tx> {
Dtracer.rs45 type RxToken<'a> = RxToken<D::RxToken<'a>>
47 Self: 'a;
48 type TxToken<'a> = TxToken<D::TxToken<'a>>
50 Self: 'a;
141 pub struct Packet<'a> {
142 buffer: &'a [u8],
147 impl<'a> fmt::Display for Packet<'a> {
Dloopback.rs29 type RxToken<'a> = RxToken;
30 type TxToken<'a> = TxToken<'a>;
73 pub struct TxToken<'a> {
74 queue: &'a mut VecDeque<Vec<u8>>,
77 impl<'a> phy::TxToken for TxToken<'a> {
Draw_socket.rs57 type RxToken<'a> = RxToken
59 Self: 'a;
60 type TxToken<'a> = TxToken
62 Self: 'a;
/smoltcp-0.9.1/src/wire/
Dicmp.rs8 pub enum Repr<'a> {
10 Ipv4(icmpv4::Repr<'a>),
12 Ipv6(icmpv6::Repr<'a>),
15 impl<'a> From<icmpv4::Repr<'a>> for Repr<'a> {
16 fn from(s: icmpv4::Repr<'a>) -> Self { in from()
21 impl<'a> From<icmpv6::Repr<'a>> for Repr<'a> {
22 fn from(s: icmpv6::Repr<'a>) -> Self { in from()
Dpretty_print.rs94 pub struct PrettyPrinter<'a, T: PrettyPrint> {
96 buffer: &'a dyn AsRef<[u8]>,
100 impl<'a, T: PrettyPrint> PrettyPrinter<'a, T> {
102 pub fn new(prefix: &'static str, buffer: &'a dyn AsRef<[u8]>) -> PrettyPrinter<'a, T> { in new() argument
111 impl<'a, T: PrettyPrint + AsRef<[u8]>> PrettyPrinter<'a, T> {
113 pub fn print(printable: &'a T) -> PrettyPrinter<'a, T> { in print() argument
122 impl<'a, T: PrettyPrint> fmt::Display for PrettyPrinter<'a, T> {
Ddns.rs164 pub fn parse_name<'a>(&'a self, mut bytes: &'a [u8]) -> impl Iterator<Item = Result<&'a [u8]>> { in parse_name()
260 fn parse_name_part<'a>( in parse_name_part()
261 mut bytes: &'a [u8], in parse_name_part()
262 mut f: impl FnMut(&'a [u8]), in parse_name_part()
263 ) -> Result<(&'a [u8], Option<usize>)> { in parse_name_part()
289 pub struct Question<'a> {
290 pub name: &'a [u8],
294 impl<'a> Question<'a> {
295 pub fn parse(buffer: &'a [u8]) -> Result<(&'a [u8], Question<'a>)> { in parse() argument
329 pub struct Record<'a> {
[all …]
Dipv6option.rs159 impl<'a, T: AsRef<[u8]> + ?Sized> Ipv6Option<&'a T> {
165 pub fn data(&self) -> &'a [u8] { in data()
191 impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Ipv6Option<&'a mut T> {
204 impl<'a, T: AsRef<[u8]> + ?Sized> fmt::Display for Ipv6Option<&'a T> {
220 pub enum Repr<'a> {
226 data: &'a [u8],
230 impl<'a> Repr<'a> {
232 pub fn parse<T>(opt: &Ipv6Option<&'a T>) -> Result<Repr<'a>> in parse()
257 pub fn emit<T: AsRef<[u8]> + AsMut<[u8]> + ?Sized>(&self, opt: &mut Ipv6Option<&'a mut T>) { in emit()
284 pub struct Ipv6OptionsIterator<'a> {
[all …]
Dipv6hopbyhop.rs111 impl<'a, T: AsRef<[u8]> + ?Sized> Header<&'a T> {
114 pub fn options(&self) -> &'a [u8] { in options()
137 impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Header<&'a mut T> {
147 impl<'a, T: AsRef<[u8]> + ?Sized> fmt::Display for Header<&'a T> {
162 pub struct Repr<'a> {
168 pub options: &'a [u8],
171 impl<'a> Repr<'a> {
173 pub fn parse<T>(header: &Header<&'a T>) -> Result<Repr<'a>> in parse()
203 impl<'a> fmt::Display for Repr<'a> {
Dicmpv4.rs287 impl<'a, T: AsRef<[u8]> + ?Sized> Packet<&'a T> {
290 pub fn data(&self) -> &'a [u8] { in data()
349 impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Packet<&'a mut T> {
369 pub enum Repr<'a> {
373 data: &'a [u8],
378 data: &'a [u8],
383 data: &'a [u8],
388 data: &'a [u8],
392 impl<'a> Repr<'a> {
396 packet: &Packet<&'a T>, in parse()
[all …]
Dndiscoption.rs273 impl<'a, T: AsRef<[u8]> + ?Sized> NdiscOption<&'a T> {
276 pub fn data(&self) -> &'a [u8] { in data()
373 impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> NdiscOption<&'a mut T> {
383 impl<'a, T: AsRef<[u8]> + ?Sized> fmt::Display for NdiscOption<&'a T> {
407 pub struct RedirectedHeader<'a> {
409 pub data: &'a [u8],
415 pub enum Repr<'a> {
419 RedirectedHeader(RedirectedHeader<'a>),
424 data: &'a [u8],
428 impl<'a> Repr<'a> {
[all …]
Dicmpv6.rs371 impl<'a, T: AsRef<[u8]> + ?Sized> Packet<&'a T> {
374 pub fn payload(&self) -> &'a [u8] { in payload()
503 pub enum Repr<'a> {
507 data: &'a [u8],
512 data: &'a [u8],
517 data: &'a [u8],
523 data: &'a [u8],
528 data: &'a [u8],
533 data: &'a [u8],
536 Ndisc(NdiscRepr<'a>),
[all …]
Dmld.rs241 impl<'a, T: AsRef<[u8]> + ?Sized> AddressRecord<&'a T> {
244 pub fn payload(&self) -> &'a [u8] { in payload()
300 pub enum Repr<'a> {
308 data: &'a [u8],
312 data: &'a [u8],
316 impl<'a> Repr<'a> {
318 pub fn parse<T>(packet: &Packet<&'a T>) -> Result<Repr<'a>> in parse()
422 fn create_repr<'a>(ty: Message) -> Icmpv6Repr<'a> { in create_repr() argument
Dipv6routing.rs385 impl<'a, T: AsRef<[u8]> + ?Sized> fmt::Display for Header<&'a T> {
401 pub enum Repr<'a> {
427 addresses: &'a [u8],
431 impl<'a> Repr<'a> {
433 pub fn parse<T>(header: &'a Header<&'a T>) -> Result<Repr<'a>> in parse()
505 impl<'a> fmt::Display for Repr<'a> {
Dipv4.rs472 impl<'a, T: AsRef<[u8]> + ?Sized> Packet<&'a T> {
475 pub fn payload(&self) -> &'a [u8] { in payload()
703 impl<'a, T: AsRef<[u8]> + ?Sized> fmt::Display for Packet<&'a T> {
985 for addr in inside_subnet.iter().map(|a| Address::from_bytes(a)) { in test_cidr()
989 for addr in outside_subnet.iter().map(|a| Address::from_bytes(a)) { in test_cidr()
995 .map(|&(a, p)| Cidr::new(Address::new(a[0], a[1], a[2], a[3]), p)) in test_cidr()
1002 .map(|&(a, p)| Cidr::new(Address::new(a[0], a[1], a[2], a[3]), p)) in test_cidr()
Dndisc.rs194 pub enum Repr<'a> {
221 redirected_hdr: Option<NdiscRedirectedHeader<'a>>,
225 impl<'a> Repr<'a> {
229 pub fn parse<T>(packet: &Packet<&'a T>) -> Result<Repr<'a>> in parse()
233 fn foreach_option<'a>( in parse()
234 payload: &'a [u8], in parse()
235 mut f: impl FnMut(NdiscOptionRepr<'a>) -> Result<()>, in parse()
518 fn create_repr<'a>() -> Icmpv6Repr<'a> { in create_repr() argument
Ddhcpv4.rs63 pub struct DhcpOptionWriter<'a> {
65 buffer: &'a mut [u8],
68 impl<'a> DhcpOptionWriter<'a> {
69 pub fn new(buffer: &'a mut [u8]) -> Self { in new()
108 pub struct DhcpOption<'a> {
110 pub data: &'a [u8],
534 impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Packet<&'a mut T> {
588 pub struct Repr<'a> {
647 pub parameter_request_list: Option<&'a [u8]>,
661 pub additional_options: &'a [DhcpOption<'a>],
[all …]
/smoltcp-0.9.1/
DREADME.md8 _smoltcp_ is a standalone, event-driven TCP/IP stack that is designed for bare-metal,
34 * ARP requests are sent at a rate not exceeding one per second.
51 * Routing outgoing IPv4 packets is supported, through a default gateway or a CIDR route table.
58 * Routing outgoing IPv6 packets is supported, through a default gateway or a CIDR route table.
83 a given IPv4 identifier field.
107 * In response to a packet arriving at a port without a listening socket,
119 * Keep-alive packets may be sent at a configurable interval.
121 * Time-wait timeout has a fixed interval of 10 s.
122 * User timeout has a configurable interval.
142 The default configuration assumes a hosted environment, for ease of evaluation.
[all …]
/smoltcp-0.9.1/src/storage/
Dring_buffer.rs27 pub struct RingBuffer<'a, T: 'a> {
28 storage: ManagedSlice<'a, T>,
33 impl<'a, T: 'a> RingBuffer<'a, T> {
37 pub fn new<S>(storage: S) -> RingBuffer<'a, T> in new() argument
39 S: Into<ManagedSlice<'a, T>>, in new() argument
116 impl<'a, T: 'a> RingBuffer<'a, T> {
174 impl<'a, T: 'a> RingBuffer<'a, T> {
293 impl<'a, T: 'a> RingBuffer<'a, T> {
404 impl<'a, T: 'a> From<ManagedSlice<'a, T>> for RingBuffer<'a, T> {
405 fn from(slice: ManagedSlice<'a, T>) -> RingBuffer<'a, T> { in from() argument
Dpacket_buffer.rs43 pub struct PacketBuffer<'a, H: 'a> {
44 metadata_ring: RingBuffer<'a, PacketMetadata<H>>,
45 payload_ring: RingBuffer<'a, u8>,
48 impl<'a, H> PacketBuffer<'a, H> {
53 pub fn new<MS, PS>(metadata_storage: MS, payload_storage: PS) -> PacketBuffer<'a, H> in new() argument
55 MS: Into<ManagedSlice<'a, PacketMetadata<H>>>, in new() argument
56 PS: Into<ManagedSlice<'a, u8>>, in new() argument

12