File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ cfg_if! {
38
38
mod net_route;
39
39
pub use net_route:: AgentRouting ;
40
40
}
41
- else if #[ cfg( any( target_os = "ios" ) ) ] {
41
+ else if #[ cfg( any( target_os = "ios" , target_os = "android" ) ) ] {
42
42
mod network_listener;
43
43
pub use network_listener:: AgentRouting ;
44
44
}
Original file line number Diff line number Diff line change @@ -622,6 +622,41 @@ pub struct NetworkChange {
622
622
pub dns_server : * const c_char , // DNS server, NULL if not available
623
623
}
624
624
625
+ #[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
626
+ #[ unsafe( no_mangle) ]
627
+ pub extern "C" fn drasyl_agent_network_change_ips ( change : * const NetworkChange ) -> * const c_char {
628
+ if change. is_null ( ) {
629
+ return std:: ptr:: null ( ) ;
630
+ }
631
+
632
+ unsafe { ( * change) . ips }
633
+ }
634
+
635
+ #[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
636
+ #[ unsafe( no_mangle) ]
637
+ pub extern "C" fn drasyl_agent_network_change_routes (
638
+ change : * const NetworkChange ,
639
+ ) -> * const c_char {
640
+ if change. is_null ( ) {
641
+ return std:: ptr:: null ( ) ;
642
+ }
643
+
644
+ unsafe { ( * change) . routes }
645
+ }
646
+
647
+ #[ cfg( feature = "dns" ) ]
648
+ #[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
649
+ #[ unsafe( no_mangle) ]
650
+ pub extern "C" fn drasyl_agent_network_change_dns_server (
651
+ change : * const NetworkChange ,
652
+ ) -> * const c_char {
653
+ if change. is_null ( ) {
654
+ return std:: ptr:: null ( ) ;
655
+ }
656
+
657
+ unsafe { ( * change) . dns_server }
658
+ }
659
+
625
660
#[ allow( clippy:: not_unsafe_ptr_arg_deref) ]
626
661
#[ unsafe( no_mangle) ]
627
662
pub extern "C" fn drasyl_agent_start (
You can’t perform that action at this time.
0 commit comments