September 19, 2014
I just started doing D networking today, so I may just be doing
something wrong / stupid.... but I can not find the "ip_mreq"
struct anywhere.

I ended up just making my own in my module

struct ip_mreq
{
          in_addr imr_multiaddr;
          in_addr imr_interface;
}

And then I was able to continue and successfully process
multicast.

The ipv6 things seem to be available.

I was hoping it would be picked up by import std.c.linux.socket;

In /usr/include/dmd , running
      find . -type f -exec grep -Hi "ip_mreq" {} \;
returns no results.

Am I doing something wrong or is this just an oversight somehow?

DMD v2.065
September 19, 2014
On 9/18/14 10:55 PM, james wrote:
> I just started doing D networking today, so I may just be doing
> something wrong / stupid.... but I can not find the "ip_mreq"
> struct anywhere.
>
> I ended up just making my own in my module
>
> struct ip_mreq
> {
>            in_addr imr_multiaddr;
>            in_addr imr_interface;
> }
>
> And then I was able to continue and successfully process
> multicast.
>
> The ipv6 things seem to be available.
>
> I was hoping it would be picked up by import std.c.linux.socket;
>
> In /usr/include/dmd , running
>        find . -type f -exec grep -Hi "ip_mreq" {} \;
> returns no results.
>
> Am I doing something wrong or is this just an oversight somehow?
>
> DMD v2.065

The vast amount of C declarations that could be done on D simply aren't done until someone needs them. So no, you aren't doing anything wrong, no it's not an oversight :)

If you like it to be part of the main library, submit a pull request, and I'll be happy to review.

One thing -- you should extern(C) the struct so the symbol is not mangled (extern(C): is probably already done at the top of the file, so you may not need to do this if you add it to std.c.linux.socket)

-Steve