[Mono-dev] Mono C# + IOCTL

Alex rdynm at yahoo.com
Thu Dec 11 22:26:47 EST 2008

Just tried it out, it produced an exception.

Unhandled Exception: System.Net.Sockets.SocketException: Bad address
 Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Ggp);
 s.IOControl(0x8933, null, null);

my goal was to reproduce this pseudo C code snapshot

socket(PF_PACKET, SOCK_RAW, 768)
bind(5, {sa_family=AF_PACKET, proto=0x03, if9, pkttype=PACKET_HOST, addr(0)={0, }, 20)
setsockopt(5, SOL_PACKET, PACKET_ADD_MEMBERSHIP, "\t\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 16)

From: Gonzalo Paniagua Javier <gonzalo.mono at gmail.com>
To: Alex <rdynm at yahoo.com>
Cc: mono-devel-list at lists.ximian.com
Sent: Thursday, December 4, 2008 9:34:35 PM
Subject: Re: [Mono-dev] Mono C# + IOCTL

On Thu, 2008-12-04 at 17:31 -0800, Alex wrote: 
> Hello, 
> I know IOCTL is a very OS dependent call and that's the reason it's
> not included as part of mono. However I do have a more specific
> question in regards to using SIOCGIFINDEX. I'd like to know if there
> is a way to use it in C# mono, linux. 

Try using Socket.IOControl with 0x8933 and see what happens.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20081211/eceb0876/attachment-0001.html 

More information about the Mono-devel-list mailing list