5 Commits
Author SHA1 Message Date
Johan Lorensson 99729bc0b3 Restructure NetworkInformation classes to avoid full AOT compile errors. (#9432)
When doing full AOT of System.dll on Windows and other platforms building
runtime without HOST_DARWIN or HOST_BSD we will get an ugly error,
but compilation will still succeed leaving the user confused around the result.

The following error is printed:

--------------------------------------

cant resolve internal call to
"System.Net.NetworkInformation.MacOsIPInterfaceProperties::ParseRouteInfo_internal"
(tested without signature also)

Your mono runtime and class libraries are out of sync.
The out of sync library is: C:\github\mono\msvc\build\fullaot\winaot\system.dll

When you update one from git you need to update, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably related
and you need to fix your mono install first.
cant resolve internal call to
"System.Net.NetworkInformation.MacOsIPInterfaceProperties::ParseRouteInfo_internal"
(tested without signature also)

Your mono runtime and class libraries are out of sync.
The out of sync library is: C:\github\mono\msvc\build\fullaot\winaot\system.dll

When you update one from git you need to update, compile and install
the other too.
Do not report this as a bug unless you're sure you have updated correctly:
you probably have a broken mono install.
If you see other errors or faults after this message they are probably related
and you need to fix your mono install first.

--------------------------------------

The problem is that MacOs/BSD specific NetworkInformation classes are build into
System.dll on all platforms. One way to solve this is to start splitting the different
platforms specific implementations into different source files so we could start to
include/exclude sources per platform and profile in a nicer way instead of just
ifdef:ing inside current source files. This strategy also matches how corefx have
structured their NetworkInformation sources making it easier in the future to bring
mono’s NetworkInformation implementation closer to corefx. This PR implements this strategy.

Due to the fact that we don’t have platform specific configs for all profiles
(like basic and build) we can’t exclude all platform specific sources from
common.sources in System and move them to platform specific profiles. Ones we
have that full capability we could drop the #if WIN_PLATFORM in all the Win32*
files and exclude them from common.sources and only include them in the corresponding
win32 specific profiles. The same strategy could then be applied for other platform
specific profiles as well.

For Windows specific profiles, like win32_net_4_x_System.dll and winaot_System.dll we
use the .exclude.sources to remove the unix/linux/macos NetworkInformation sources,
so with this commit we will get a System.dll that only includes the Win32 specific
NetworkInformation classes and none of the unix/linux/macos, this will make sure the
compile error during full AOT won’t happen since there is no classes left including
the icall not available on a Windows mono runtime.

Other platforms will have the same classes in System.dll as before for now
but the source code is now structured making it possible to include/exclude platform
specific source files for other platforms as well, when needed.
2018-07-07 02:04:50 +02:00
Marek Habersack 303e42b130 Implement the Mono side of Android support for NetworkInterface.GetAllNetworkInterfaces ()
Added code to call Xamarin.Android internal implementation of getifaddrs/freeifaddrs to provide us
with the required information to fulfill the request.

Added a handful of Linux ARP hardware IDs which are considered to be tunnel devices and which may occur
on Android devices.

Part of fix for https://bugzilla.xamarin.com/show_bug.cgi?id=1969
2014-07-30 18:22:33 -04:00
Miguel de Icaza f48ceb9860 [System] Removal of the NET_2_0 in the source code
Modulo the GUID in the assembly and the GUID embedded in some
field initializers that use the assembly GUID for their name, the
assemblies are idential before and after the patch.
2012-06-02 13:16:40 -04:00
Zoltan Varga 31bf33fc66 2009-09-24 Zoltan Varga <[email protected]>
* LinuxNetworkInterfaceMarshal.cs: Add StructLayout attribute to structures, so
	the aot compiler can generate PtrToStructure wrappers for them.

svn path=/trunk/mcs/; revision=142578
2009-09-24 14:34:43 +00:00
Marek Habersack 8d78815a10 2008-07-14 Marek Habersack <[email protected]>
* NetworkInterface.cs: implemented support for Linux. Parts
	contributed by Eric Butler ([email protected]), thanks!

	* GatewayIPAddressInformationCollection.cs,
	IPInterfaceProperties.cs, IPAddressInformationCollection.cs: added
	support for Linux. Patch contributed by Eric Butler
	([email protected]), thanks!

	* IPv4InterfaceProperties.cs: implemented support for Linux.

	* LinuxNetworkInterfaceMarshal.cs: added. Contains a set of
	Linux-specific structures required for accessing the network
	information. Patch contributed by Eric Butler
	([email protected]), thanks!

	* MulticastIPAddressInformation.cs: added support for Linux
	multicast information. Patch contributed by Eric Butler
	([email protected]), thanks!

	* IPv4InterfaceStatistics.cs: use the parent IfacePath to get the
	path to the interface description file.

	* UnicastIPAddressInformation.cs: added stubs for
	LinuxUnicastIPAddressInformation. Patch contributed by Eric Butler
	([email protected]), thanks!

	* Ping.cs: Use /bin/ping when running as non-root user
	(implementation by Jackson Harper <[email protected]>) or use
	raw sockets if running as root or if the current process has the
	CAP_NET_RAW Linux capability set while running as an unprivileged
	user.


svn path=/trunk/mcs/; revision=107890
2008-07-14 15:37:21 +00:00