December 10, 2012 Why the lack of networky bits in the standard library | ||||
---|---|---|---|---|
| ||||
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 Re: Why the lack of networky bits in the standard library | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Caron | 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 |
Copyright © 1999-2021 by the D Language Foundation