/usr/lib/gcc-cross/arm-linux-gnueabi/5/include/d/core/sys/posix/arpa/inet.d is in libphobos-5-dev-armel-cross 5.3.1-14ubuntu2cross1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | /**
* D header file for POSIX.
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: Sean Kelly
* Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
*/
/* Copyright Sean Kelly 2005 - 2009.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
module core.sys.posix.arpa.inet;
private import core.sys.posix.config;
public import core.stdc.inttypes; // for uint32_t, uint16_t
public import core.sys.posix.sys.socket; // for socklen_t
version (Posix):
extern (C):
//
// Required
//
/*
NOTE: The following must must be defined in core.sys.posix.arpa.inet to break
a circular import: in_port_t, in_addr_t, struct in_addr, INET_ADDRSTRLEN.
in_port_t // from core.sys.posix.netinet.in_
in_addr_t // from core.sys.posix.netinet.in_
struct in_addr // from core.sys.posix.netinet.in_
INET_ADDRSTRLEN // from core.sys.posix.netinet.in_
uint32_t // from core.stdc.inttypes
uint16_t // from core.stdc.inttypes
uint32_t htonl(uint32_t);
uint16_t htons(uint16_t);
uint32_t ntohl(uint32_t);
uint16_t ntohs(uint16_t);
in_addr_t inet_addr(in char*);
char* inet_ntoa(in_addr);
// per spec: const char* inet_ntop(int, const void*, char*, socklen_t);
char* inet_ntop(int, in void*, char*, socklen_t);
int inet_pton(int, in char*, void*);
*/
version( linux )
{
alias uint16_t in_port_t;
alias uint32_t in_addr_t;
struct in_addr
{
in_addr_t s_addr;
}
enum INET_ADDRSTRLEN = 16;
uint32_t htonl(uint32_t);
uint16_t htons(uint16_t);
uint32_t ntohl(uint32_t);
uint16_t ntohs(uint16_t);
in_addr_t inet_addr(in char*);
char* inet_ntoa(in_addr);
const(char)* inet_ntop(int, in void*, char*, socklen_t);
int inet_pton(int, in char*, void*);
}
else version( OSX )
{
alias uint16_t in_port_t;
alias uint32_t in_addr_t;
struct in_addr
{
in_addr_t s_addr;
}
enum INET_ADDRSTRLEN = 16;
uint32_t htonl(uint32_t);
uint16_t htons(uint16_t);
uint32_t ntohl(uint32_t);
uint16_t ntohs(uint16_t);
in_addr_t inet_addr(in char*);
char* inet_ntoa(in_addr);
const(char)* inet_ntop(int, in void*, char*, socklen_t);
int inet_pton(int, in char*, void*);
}
else version( FreeBSD )
{
alias uint16_t in_port_t;
alias uint32_t in_addr_t;
struct in_addr
{
in_addr_t s_addr;
}
enum INET_ADDRSTRLEN = 16;
uint32_t htonl(uint32_t);
uint16_t htons(uint16_t);
uint32_t ntohl(uint32_t);
uint16_t ntohs(uint16_t);
in_addr_t inet_addr(in char*);
char* inet_ntoa(in_addr);
const(char)* inet_ntop(int, in void*, char*, socklen_t);
int inet_pton(int, in char*, void*);
}
else version( Android )
{
alias uint32_t in_addr_t;
struct in_addr
{
in_addr_t s_addr;
}
enum INET_ADDRSTRLEN = 16;
private
{
extern (D)
{
uint32_t __swap32( uint32_t x )
{
uint32_t byte32_swap = (x & 0xff) << 24 | (x &0xff00) << 8 |
(x & 0xff0000) >> 8 | (x & 0xff000000) >> 24;
return byte32_swap;
}
uint16_t __swap16( uint16_t x )
{
uint16_t byte16_swap = (x & 0xff) << 8 | (x & 0xff00) >> 8;
return byte16_swap;
}
}
}
extern (D)
{
uint32_t htonl(uint32_t x) { return __swap32(x); }
uint16_t htons(uint16_t x) { return __swap16(x); }
uint32_t ntohl(uint32_t x) { return __swap32(x); }
uint16_t ntohs(uint16_t x) { return __swap16(x); }
}
in_addr_t inet_addr(in char*);
char* inet_ntoa(in_addr);
const(char)* inet_ntop(int, in void*, char*, size_t);
int inet_pton(int, in char*, void*);
}
//
// IPV6 (IP6)
//
/*
NOTE: The following must must be defined in core.sys.posix.arpa.inet to break
a circular import: INET6_ADDRSTRLEN.
INET6_ADDRSTRLEN // from core.sys.posix.netinet.in_
*/
version( linux )
{
enum INET6_ADDRSTRLEN = 46;
}
else version( OSX )
{
enum INET6_ADDRSTRLEN = 46;
}
else version( FreeBSD )
{
enum INET6_ADDRSTRLEN = 46;
}
else version( Android )
{
enum INET6_ADDRSTRLEN = 46;
}
|