improve enum_routes and enum_net_interfaces for simulator
This commit is contained in:
parent
2e15b3edfa
commit
37063afd5c
|
@ -511,7 +511,10 @@ int _System __libsocket_sysctl(int* mib, u_int namelen, void *oldp, size_t *oldl
|
||||||
{
|
{
|
||||||
ip_interface wan;
|
ip_interface wan;
|
||||||
wan.interface_address = ip;
|
wan.interface_address = ip;
|
||||||
wan.netmask = address_v4::from_string("255.255.255.255");
|
if (ip.is_v4())
|
||||||
|
wan.netmask = address_v4::from_string("255.0.0.0");
|
||||||
|
else
|
||||||
|
wan.netmask = address_v6::from_string("ffff::");
|
||||||
std::strcpy(wan.name, "eth0");
|
std::strcpy(wan.name, "eth0");
|
||||||
std::strcpy(wan.friendly_name, "Ethernet");
|
std::strcpy(wan.friendly_name, "Ethernet");
|
||||||
std::strcpy(wan.description, "Simulator Ethernet Adapter");
|
std::strcpy(wan.description, "Simulator Ethernet Adapter");
|
||||||
|
@ -803,7 +806,7 @@ int _System __libsocket_sysctl(int* mib, u_int namelen, void *oldp, size_t *oldl
|
||||||
if (ip.is_v4())
|
if (ip.is_v4())
|
||||||
{
|
{
|
||||||
r.destination = address_v4();
|
r.destination = address_v4();
|
||||||
r.netmask = address_v4::from_string("255.255.255.0");
|
r.netmask = address_v4::from_string("255.0.0.0");
|
||||||
address_v4::bytes_type b = ip.to_v4().to_bytes();
|
address_v4::bytes_type b = ip.to_v4().to_bytes();
|
||||||
b[3] = 1;
|
b[3] = 1;
|
||||||
r.gateway = address_v4(b);
|
r.gateway = address_v4(b);
|
||||||
|
@ -811,7 +814,7 @@ int _System __libsocket_sysctl(int* mib, u_int namelen, void *oldp, size_t *oldl
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
r.destination = address_v6();
|
r.destination = address_v6();
|
||||||
r.netmask = address_v6::from_string("FFFF:FFFF:FFFF:FFFF::0");
|
r.netmask = address_v6::from_string("ffff:ffff:ffff:ffff::0");
|
||||||
address_v6::bytes_type b = ip.to_v6().to_bytes();
|
address_v6::bytes_type b = ip.to_v6().to_bytes();
|
||||||
b[14] = 1;
|
b[14] = 1;
|
||||||
r.gateway = address_v6(b);
|
r.gateway = address_v6(b);
|
||||||
|
|
Loading…
Reference in New Issue