mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
* Replace unsupported network functions for android * Refactor default/android net addresses processing * Add default connection values, Refactor netenv * Fix compilation error * Combine network change default/android functions
23 lines
475 B
Go
23 lines
475 B
Go
package netenv
|
|
|
|
import (
|
|
"github.com/safing/portmaster-android/go/app_interface"
|
|
"net"
|
|
)
|
|
|
|
func osGetInterfaceAddrs() ([]net.Addr, error) {
|
|
list, err := app_interface.GetNetworkAddresses()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
var netList []net.Addr
|
|
for _, addr := range list {
|
|
netList = append(netList, addr.ToIPNet())
|
|
}
|
|
|
|
return netList, nil
|
|
}
|
|
|
|
func osGetNetworkInterfaces() ([]app_interface.NetworkInterface, error) {
|
|
return app_interface.GetNetworkInterfaces()
|
|
}
|