comparison tango/tango/stdc/posix/arpa/inet.d @ 132:1700239cab2e trunk

[svn r136] MAJOR UNSTABLE UPDATE!!! Initial commit after moving to Tango instead of Phobos. Lots of bugfixes... This build is not suitable for most things.
author lindquist
date Fri, 11 Jan 2008 17:57:40 +0100
parents
children
comparison
equal deleted inserted replaced
131:5825d48b27d1 132:1700239cab2e
1 /**
2 * D header file for POSIX.
3 *
4 * Copyright: Public Domain
5 * License: Public Domain
6 * Authors: Sean Kelly
7 * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8 */
9 module tango.stdc.posix.arpa.inet;
10
11 private import tango.stdc.posix.config;
12 public import tango.stdc.inttypes : uint32_t, uint16_t;
13 public import tango.stdc.posix.sys.socket : socklen_t;
14
15 extern (C):
16
17 //
18 // Required
19 //
20 /*
21 in_port_t // from tango.stdc.posix.netinet.in_
22 in_addr_t // from tango.stdc.posix.netinet.in_
23
24 struct in_addr // from tango.stdc.posix.netinet.in_
25 INET_ADDRSTRLEN // from tango.stdc.posix.netinet.in_
26
27 uint32_t // from tango.stdc.inttypes
28 uint16_t // from tango.stdc.inttypes
29
30 uint32_t htonl(uint32_t);
31 uint16_t htons(uint16_t);
32 uint32_t ntohl(uint32_t);
33 uint16_t ntohs(uint16_t);
34
35 in_addr_t inet_addr(char*);
36 char* inet_ntoa(in_addr);
37 char* inet_ntop(int, void*, char*, socklen_t);
38 int inet_pton(int, char*, void*);
39 */
40
41 version( linux )
42 {
43 alias uint16_t in_port_t;
44 alias uint32_t in_addr_t;
45
46 struct in_addr
47 {
48 in_addr_t s_addr;;
49 }
50
51 const INET_ADDRSTRLEN = 16;
52
53 uint32_t htonl(uint32_t);
54 uint16_t htons(uint16_t);
55 uint32_t ntohl(uint32_t);
56 uint16_t ntohs(uint16_t);
57
58 in_addr_t inet_addr(char*);
59 char* inet_ntoa(in_addr);
60 char* inet_ntop(int, void*, char*, socklen_t);
61 int inet_pton(int, char*, void*);
62 }
63 else version( darwin )
64 {
65
66 }
67
68
69 //
70 // IPV6 (IP6)
71 //
72 /*
73 INET6_ADDRSTRLEN // from tango.stdc.posix.netinet.in_
74 */
75
76 version( linux )
77 {
78 const INET6_ADDRSTRLEN = 46;
79 }
80 else version( darwin )
81 {
82
83 }