File: MacOsNetworkInterfaceMarshal.cs

package info (click to toggle)
mono 2.6.7-5.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 327,344 kB
  • ctags: 413,649
  • sloc: cs: 2,471,883; xml: 1,768,594; ansic: 350,665; sh: 13,644; makefile: 8,640; perl: 1,784; asm: 717; cpp: 209; python: 146; sql: 81; sed: 16
file content (73 lines) | stat: -rw-r--r-- 1,408 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#if NET_2_0
using System;
using System.Runtime.InteropServices;

namespace System.Net.NetworkInformation {
	namespace MacOsStructs {
		internal struct ifaddrs
		{
			public IntPtr  ifa_next;
			public string  ifa_name;
			public uint    ifa_flags;
			public IntPtr  ifa_addr;
			public IntPtr  ifa_netmask;
			public IntPtr  ifa_dstaddr;
			public IntPtr  ifa_data;
		}

		internal struct sockaddr
		{
			public byte  sa_len;
			public byte  sa_family;
		}

		internal struct sockaddr_in
		{
			public byte   sin_len;
			public byte   sin_family;
			public ushort sin_port;
			public uint   sin_addr;
		}

		internal struct in6_addr
		{
			[MarshalAs (UnmanagedType.ByValArray, SizeConst=16)]
			public byte[] u6_addr8;
		}

		internal struct sockaddr_in6
		{
			public byte     sin6_len;
			public byte     sin6_family;
			public ushort   sin6_port;
			public uint     sin6_flowinfo;
			public in6_addr sin6_addr;
			public uint     sin6_scope_id;
		}

		internal struct sockaddr_dl
		{
			public byte   sdl_len;
			public byte   sdl_family;
			public ushort sdl_index;
			public byte   sdl_type;
			public byte   sdl_nlen;
			public byte   sdl_alen;
			public byte   sdl_slen;

			[MarshalAs (UnmanagedType.ByValArray, SizeConst=12)]
			public byte[] sdl_data;
		}

	}

	internal enum MacOsArpHardware {
		ETHER = 0x6,
		ATM = 0x25,
		SLIP = 0x1c,
		PPP = 0x17,
		LOOPBACK = 0x18,
		FDDI = 0xf
	}
}
#endif