@@ -32,7 +32,9 @@ use alloc::{
32
32
use async_lock:: Mutex ;
33
33
use core:: {
34
34
fmt:: { self , Write as _} ,
35
- future, iter, mem, ops, pin, str,
35
+ future, iter, mem,
36
+ net:: { IpAddr , Ipv4Addr , Ipv6Addr } ,
37
+ ops, pin, str,
36
38
sync:: atomic:: { AtomicU32 , AtomicU64 , Ordering } ,
37
39
task,
38
40
time:: Duration ,
@@ -314,36 +316,36 @@ impl smoldot_light::platform::PlatformRef for PlatformRef {
314
316
315
317
let encoded_address: Vec < u8 > = match address {
316
318
smoldot_light:: platform:: Address :: TcpIp {
317
- ip : smoldot_light :: platform :: IpAddr :: V4 ( ip) ,
319
+ ip : IpAddr :: V4 ( ip) ,
318
320
port,
319
321
} => iter:: once ( 0u8 )
320
322
. chain ( port. to_be_bytes ( ) )
321
- . chain ( no_std_net :: Ipv4Addr :: from ( ip) . to_string ( ) . bytes ( ) )
323
+ . chain ( Ipv4Addr :: from ( ip) . to_string ( ) . bytes ( ) )
322
324
. collect ( ) ,
323
325
smoldot_light:: platform:: Address :: TcpIp {
324
- ip : smoldot_light :: platform :: IpAddr :: V6 ( ip) ,
326
+ ip : IpAddr :: V6 ( ip) ,
325
327
port,
326
328
} => iter:: once ( 1u8 )
327
329
. chain ( port. to_be_bytes ( ) )
328
- . chain ( no_std_net :: Ipv6Addr :: from ( ip) . to_string ( ) . bytes ( ) )
330
+ . chain ( Ipv6Addr :: from ( ip) . to_string ( ) . bytes ( ) )
329
331
. collect ( ) ,
330
332
smoldot_light:: platform:: Address :: TcpDns { hostname, port } => iter:: once ( 2u8 )
331
333
. chain ( port. to_be_bytes ( ) )
332
334
. chain ( hostname. as_bytes ( ) . iter ( ) . copied ( ) )
333
335
. collect ( ) ,
334
336
smoldot_light:: platform:: Address :: WebSocketIp {
335
- ip : smoldot_light :: platform :: IpAddr :: V4 ( ip) ,
337
+ ip : IpAddr :: V4 ( ip) ,
336
338
port,
337
339
} => iter:: once ( 4u8 )
338
340
. chain ( port. to_be_bytes ( ) )
339
- . chain ( no_std_net :: Ipv4Addr :: from ( ip) . to_string ( ) . bytes ( ) )
341
+ . chain ( Ipv4Addr :: from ( ip) . to_string ( ) . bytes ( ) )
340
342
. collect ( ) ,
341
343
smoldot_light:: platform:: Address :: WebSocketIp {
342
- ip : smoldot_light :: platform :: IpAddr :: V6 ( ip) ,
344
+ ip : IpAddr :: V6 ( ip) ,
343
345
port,
344
346
} => iter:: once ( 5u8 )
345
347
. chain ( port. to_be_bytes ( ) )
346
- . chain ( no_std_net :: Ipv6Addr :: from ( ip) . to_string ( ) . bytes ( ) )
348
+ . chain ( Ipv6Addr :: from ( ip) . to_string ( ) . bytes ( ) )
347
349
. collect ( ) ,
348
350
smoldot_light:: platform:: Address :: WebSocketDns {
349
351
hostname,
@@ -423,22 +425,22 @@ impl smoldot_light::platform::PlatformRef for PlatformRef {
423
425
424
426
let encoded_address: Vec < u8 > = match address {
425
427
smoldot_light:: platform:: MultiStreamAddress :: WebRtc {
426
- ip : smoldot_light :: platform :: IpAddr :: V4 ( ip) ,
428
+ ip : IpAddr :: V4 ( ip) ,
427
429
port,
428
430
remote_certificate_sha256,
429
431
} => iter:: once ( 16u8 )
430
432
. chain ( port. to_be_bytes ( ) )
431
433
. chain ( remote_certificate_sha256. iter ( ) . copied ( ) )
432
- . chain ( no_std_net :: Ipv4Addr :: from ( ip) . to_string ( ) . bytes ( ) )
434
+ . chain ( Ipv4Addr :: from ( ip) . to_string ( ) . bytes ( ) )
433
435
. collect ( ) ,
434
436
smoldot_light:: platform:: MultiStreamAddress :: WebRtc {
435
- ip : smoldot_light :: platform :: IpAddr :: V6 ( ip) ,
437
+ ip : IpAddr :: V6 ( ip) ,
436
438
port,
437
439
remote_certificate_sha256,
438
440
} => iter:: once ( 17u8 )
439
441
. chain ( port. to_be_bytes ( ) )
440
442
. chain ( remote_certificate_sha256. iter ( ) . copied ( ) )
441
- . chain ( no_std_net :: Ipv6Addr :: from ( ip) . to_string ( ) . bytes ( ) )
443
+ . chain ( Ipv6Addr :: from ( ip) . to_string ( ) . bytes ( ) )
442
444
. collect ( ) ,
443
445
} ;
444
446
0 commit comments