December 10, 2012
In C, if I want to parse a UDP packet, I need to build my own offsets into data based off constants in:
net/ethernet.h
netinet/udp.h

Things like:

#define PACKET_DATA_OFFSET_DEFAULT (
     ETHER_HDR_LEN + sizeof(struct iphdr) + \
     sizeof(struct udphdr))

That would be easy to port to D, if I had access to those structs and defines, but it doesn't seem like these have been ported over. Am I missing something obvious?

Thanks.

-- 
Matthew Caron, Software Build Engineer
Sixnet, a Red Lion business | www.sixnet.com
+1 (518) 877-5173 x138 office
December 10, 2012
On 10-12-2012 21:22, Matthew Caron wrote:
> In C, if I want to parse a UDP packet, I need to build my own offsets
> into data based off constants in:
> net/ethernet.h
> netinet/udp.h
>
> Things like:
>
> #define PACKET_DATA_OFFSET_DEFAULT (
>       ETHER_HDR_LEN + sizeof(struct iphdr) + \
>       sizeof(struct udphdr))
>
> That would be easy to port to D, if I had access to those structs and
> defines, but it doesn't seem like these have been ported over. Am I
> missing something obvious?
>
> Thanks.
>

We haven't bound all C/POSIX headers in druntime yet. There's no particular reason it isn't done other than nobody having gotten around to it.

-- 
Alex Rønne Petersen
alex@lycus.org
http://lycus.org