![Symbian Developer Library](../../../../a_stock/images/mainheading.gif)
![]() |
![]() |
|
Interface status: | externallyDefinedApi |
_PATH_SERVICES "\\resource\\services"
Defines the services path.
Interface status: | externallyDefinedApi |
NETDB_INTERNAL -1
Error return codes from gethostbyname(const char *)
gethostbyname(const char *)
and gethostbyaddr(const char *,int,int)
gethostbyaddr(const char *,int,int)
. see errno.
Interface status: | externallyDefinedApi |
NETDB_SUCCESS 0
Error return codes from gethostbyname(const char *)
gethostbyname(const char *)
and gethostbyaddr(const char *,int,int)
gethostbyaddr(const char *,int,int)
. No Problem.
Interface status: | externallyDefinedApi |
HOST_NOT_FOUND ENOENT
Error return codes from gethostbyname(const char *)
gethostbyname(const char *)
and gethostbyaddr(const char *,int,int)
gethostbyaddr(const char *,int,int)
. Authoritative Answer Host not found.
Interface status: | externallyDefinedApi |
TRY_AGAIN ETIMEDOUT
Error return codes from gethostbyname(const char *)
gethostbyname(const char *)
and gethostbyaddr(const char *,int,int)
gethostbyaddr(const char *,int,int)
. Non-Authoritative Host not found, or SERVERFAIL
Interface status: | externallyDefinedApi |
NO_RECOVERY ECOMM
Error return codes from gethostbyname(const char *)
gethostbyname(const char *)
and gethostbyaddr(const char *,int,int)
gethostbyaddr(const char *,int,int)
. Non recoverable errors, FORMERR, REFUSED, NOTIMP
Interface status: | externallyDefinedApi |
NO_DATA 4
Error return codes from gethostbyname(const char *)
gethostbyname(const char *)
and gethostbyaddr(const char *,int,int)
gethostbyaddr(const char *,int,int)
. Valid name, no data record of requested type
Interface status: | externallyDefinedApi |
NO_ADDRESS NO_DATA
Error return codes from gethostbyname(const char *)
gethostbyname(const char *)
and gethostbyaddr(const char *,int,int)
gethostbyaddr(const char *,int,int)
. no address, look for MX record
Interface status: | externallyDefinedApi |
EAI_AGAIN 2
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. emporary failure in name resolution
Interface status: | externallyDefinedApi |
EAI_BADFLAGS 3
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. invalid value for ai_flags
Interface status: | externallyDefinedApi |
EAI_FAIL 4
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. non-recoverable failure in name resolution
Interface status: | externallyDefinedApi |
EAI_FAMILY 5
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. ai_family not supported
Interface status: | externallyDefinedApi |
EAI_MEMORY 6
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. memory allocation failure .
Interface status: | externallyDefinedApi |
EAI_NONAME 8
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. hostname nor servname provided, or not known.
Interface status: | externallyDefinedApi |
EAI_SERVICE 9
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. servname not supported for ai_socktype.
Interface status: | externallyDefinedApi |
EAI_SOCKTYPE 10
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. ai_socktype not supported
Interface status: | externallyDefinedApi |
EAI_SYSTEM 11
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. system error returned in errno.
Interface status: | externallyDefinedApi |
EAI_BADHINTS 12
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
.
Interface status: | externallyDefinedApi |
EAI_PROTOCOL 13
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
.
Interface status: | externallyDefinedApi |
EAI_MAX 14
Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
.
Interface status: | externallyDefinedApi |
AI_PASSIVE 0x00000001
Flag values for getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. get address to use bind
Interface status: | externallyDefinedApi |
AI_CANONNAME 0x00000002
Flag values for getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. fill ai_canonname
Interface status: | externallyDefinedApi |
AI_NUMERICHOST 0x00000004
Flag values for getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. prevent host name resolution
Interface status: | externallyDefinedApi |
AI_NUMERICSERV 0x00000008
Flag values for getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
. prevent service name resolution
Interface status: | externallyDefinedApi |
AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \
AI_ADDRCONFIG)
valid flags for addrinfo (not a standard def, apps should not use it)
Interface status: | externallyDefinedApi |
AI_ALL 0x00000100
IPv6 and IPv4-mapped (with AI_V4MAPPED)
Interface status: | externallyDefinedApi |
AI_V4MAPPED_CFG 0x00000200
accept IPv4-mapped if kernel supports
Interface status: | externallyDefinedApi |
AI_ADDRCONFIG 0x00000400
only if any address is assigned
Interface status: | externallyDefinedApi |
AI_V4MAPPED 0x00000800
accept IPv4-mapped IPv6 address
Interface status: | externallyDefinedApi |
AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG)
special recommended flags for getipnodebyname
Interface status: | externallyDefinedApi |
NI_MAXHOST 1025
Constants for getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
Interface status: | externallyDefinedApi |
NI_MAXSERV 32
Constants for getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
Interface status: | externallyDefinedApi |
NI_NOFQDN 0x00000001
Flag values for getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
. Only the nodename portion of the FQDN is returned for local hosts.
Interface status: | externallyDefinedApi |
NI_NUMERICHOST 0x00000002
Flag values for getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
. The numeric form of the node's address is returned instead of its name.
Interface status: | externallyDefinedApi |
NI_NAMEREQD 0x00000004
Flag values for getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
. Return an error if the node's name cannot be located in the database.
Interface status: | externallyDefinedApi |
NI_NUMERICSERV 0x00000008
Flag values for getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
. The numeric form of the service address is returned instead of its name.
Interface status: | externallyDefinedApi |
NI_DGRAM 0x00000010
Flag values for getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
. Indicates that the service is a datagram service (SOCK_DGRAM).
Interface status: | externallyDefinedApi |
IMPORT_C void endservent(void);
Refer to getservent(void)
getservent(void)
for the documentation
Interface status: | externallyDefinedApi |
IMPORT_C struct hostent* gethostbyaddr(const char *, int, int);
|
|
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
...getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
...Interface status: | externallyDefinedApi |
IMPORT_C struct hostent* gethostbyname(const char *);
The gethostbyname, and gethostbyaddr functions each return a pointer to an object with the following structure describing an internet host referenced by name or by address, respectively.
The name argument passed to gethostbyname should point to a NUL -terminated hostname. The addr argument passed to gethostbyaddr should point to an address which is len bytes long, in binary form (i.e., not an IP address in human readable ASCII form). The type argument specifies the address family (e.g. AF_INET, etc.) of this address.
The structure returned contains either the information obtained from the name server,
struct hostent {
char *h_name; // official name of host
char **h_aliases; // alias list
int h_addrtype; // host address type
int h_length; // length of address
char **h_addr_list; // list of addresses from name server
};
#define h_addr h_addr_list[0] //address, for backward compatibility
The members of this structure are:
h_name Official name of the host.
h_aliases A NULL -terminated array of alternate names for the host.
h_addrtype The type of address being returned; usually AF_INET.
h_length The length, in bytes, of the address.
h_addr_list A NULL -terminated array of network addresses for the host. Host addresses are returned in network byte order.
h_addr The first address in h_addr_list; this is for backward compatibility.
When using the nameserver, gethostbyname will search for the named host in the current domain and its parents unless the name ends in a dot.
getaddrinfo and getnameinfo functions are preferred over the gethostbyname, and gethostbyaddr functions.
Examples:
#include<stdio.h>
#include<arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
Int main()
{
struct hostent *hp = 0;
char *test_url=www.google.com:
hp = gethostbyname(test_url);
if(hp==NULL)
printf("gethostbyname failed"):
else
printf("gethostbyname passed");
return 0;
}
Output
Gethostbyname passed
#include<stdio.h>
#include<arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
#define urlsize 50
Int main()
{
struct hostent *hp = 0;
char addr[256];
unsigned long test_addr;
strcpy(addr," 147.243.3.83");
test_addr=inet_addr(addr);
struct hostent *hp;
hp=gethostbyaddr((const char *)&test;_addr,sizeof(test_addr),AF_INET);
if(hp)
printf("DNS query resolved");
else
printf("gethostbyaddr failed");
return 0;
}
Diagnostics:
Error return status from gethostbyname and gethostbyaddr is indicated by return of a NULL pointer. The external integer h_errno may then be checked to see whether this is a temporary failure or an invalid or unknown host. The routine If its argument string is non- NULL, it is printed, followed by a colon and a space. The error message is printed with a trailing newline. The variable h_errno can have the following values: TRY_AGAIN This is usually a temporary error and means that the local server did not receive a response from an authoritative server. A retry at some later time may succeed. NO_RECOVERY Some unexpected server failure was encountered. This is a non-recoverable error.
Bugs:
These functions use a thread-specific data storage; if the data is needed for future use it should be copied before any subsequent calls overwrite it. Though these functions are thread-safe the getaddrinfo family of functions is recommended instead. Only the Internet address format is currently understood.
|
|
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
...getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
...Interface status: | externallyDefinedApi |
IMPORT_C struct protoent* getprotobyname(const char *);
The getprotobyname, and getprotobynumber functions each return a pointer to an object with the following structure from the network protocol data base
struct protoent {
char *p_name; /* official name of protocol */
char **p_aliases; /* alias list */
int p_proto; /* protocol number */
};
The members of this structure are:
p_name The official name of the protocol.
p_aliases A zero terminated list of alternate names for the protocol.
p_proto The protocol number.
The getprotobyname function and getprotobynumber sequentially search from the beginning of the database until a matching protocol name or protocol number is found,
Examples:
# 192 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 193 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 194 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 195 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 196 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
Int main()
{
struct protoent *p =0;
char *protoname="tcp";
p=getprotobyname(protoname);
if(p!= 0 )
printf("protocol not supported:");
else
printf("protocol supported");
return 0;
}
Output
Protocol supported/not supported based on the support for protocol
# 216 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 217 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 218 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 219 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 220 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
int main()
{
struct protoent *p =0;
int protonum=6;
p=getprotobynumber(protonum);
if(p!= 0 )
printf("protocol not supported:");
else
printf("protocol supported");
return 0;
}
Output
Protocol supported/not supported based on the support for protocol
The getprotobynumber, getprotobyname, functions appeared in BSD 4.2 .
Bugs:
These functions use a thread-specific data space; if the data is needed for future use it must be copied before any subsequent calls overwrite it. Only the Internet protocols are currently understood.
|
|
Interface status: | externallyDefinedApi |
IMPORT_C struct protoent* getprotobynumber(int);
|
|
Interface status: | externallyDefinedApi |
IMPORT_C struct servent* getservbyname(const char *, const char *);
|
|
Interface status: | externallyDefinedApi |
IMPORT_C struct servent* getservbyport(int, const char *);
|
|
Interface status: | externallyDefinedApi |
IMPORT_C struct servent* getservent(void);
Note: This description also covers the following functions - getservbyname(const char *,const char *)
getservbyname(const char *,const char *)
getservbyport(int,const char *)
getservbyport(int,const char *)
setservent(int)
setservent(int)
endservent(void)
endservent(void)
s_name The official name of the service.
s_aliases
A zero terminated list of alternate names for the service.
s_port The port number at which the service resides.
Port numbers are returned in network byte order.
s_proto The name of the protocol to use when contacting the
service.
The getservent, getservbyname, and getservbyport functions
each return a pointer to an object with the
following structure
containing the broken-out
fields of a line in the network services data base, c:/sys/data/services.
structservent {
char*s_name;/* official name of service */
char**s_aliases;/* alias list */
ints_port;/* port service resides at */
char*s_proto;/* protocol to use */
};
The members of this structure are: s_name The official name of the service. s_aliases A zero terminated list of alternate names for the service. s_port The port number at which the service resides. Port numbers are returned in network byte order. s_proto The name of the protocol to use when contacting the service.
The getservent function reads the next line of the file, opening the file if necessary.
The setservent function opens and rewinds the file.
The endservent function closes the file.
The getservbyname and getservbyport functions sequentially search from the beginning of the file until a matching protocol name or port number (which must be specified in network byte order) is found, or until (-1) is encountered. If a protocol name is also supplied (non- 0 ), searches must also match the protocol.
Examples:
# 345 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 346 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 347 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 348 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 349 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
int main()
{
Char *service="http";
Char *protocol="tcp";
Struct servent *p=0;
P=getservbyname(service,protocol);
if(p!= 0 )
printf("service not supported:");
else
printf("Service supported");
return 0;
}
# 365 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 366 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 367 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 368 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 369 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
int main()
{
struct servent *p;
char *protocol="tcp";
int port;
port=htons(80);
p=(port,protocol);
if(p)
{
Printf("port is assigned");
else
printf("port is not assigned");
}
Output
Port is assigned
# 1 "d:/EPOC/epoc32/include/stdapis/stdio.h" 1
/*-
© Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
Copyright (c) 1990, 1993
The Regents of the University of California. All rights reserved.
This code is derived from software contributed to Berkeley by
Chris Torek.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)stdio.h 8.5 (Berkeley) 4/29/95
$FreeBSD: src/include/stdio.h,v 1.56 2004/06/20 10:01:30 tjr Exp $
© Portions copyright (c) 2005-2006 Nokia Corporation. All rights reserved.
© Portions copyright (c) 2007-2008 Symbian Software Ltd. All rights reserved.
*/
/* !_STDIO_H_ */
# 391 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/netinet/in.h" 1
// © Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
/*-
Copyright (c) 1982, 1986, 1990, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)in.h 8.3 (Berkeley) 1/3/94
$FreeBSD: src/sys/netinet/in.h,v 1.90.2.3 2005/10/02 15:45:47 andre Exp $
*/
/* !_NETINET_IN_H_*/
# 392 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/arpa/inet.h" 1
/*
Copyright (c) 1983, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-
Portions Copyright (c) 1993 by Digital Equipment Corporation.
© Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and that
the name of Digital Equipment Corporation not be used in advertising or
publicity pertaining to distribution of the document or software without
specific, written prior permission.
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
@(#)inet.h 8.1 (Berkeley) 6/2/93
From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
$FreeBSD: src/include/arpa/inet.h,v 1.25 2002/08/21 16:19:56 mike Exp $
*/
/* !_ARPA_INET_H_ */
# 393 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/string.h" 1
/*-
Copyright (c) 1990, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)string.h 8.1 (Berkeley) 6/2/93
$FreeBSD: src/include/string.h,v 1.21.2.1 2005/08/29 18:46:39 andre Exp $
© Portions copyright (c) 2005-2006 Nokia Corporation. All rights reserved.
*/
/* _STRING_H_ */
# 394 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/netdb.h" 1
/* NETDB.H
© Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
Copyright (c) 1980, 1983, 1988, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-
Portions Copyright (c) 1993 by Digital Equipment Corporation.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and that
the name of Digital Equipment Corporation not be used in advertising or
publicity pertaining to distribution of the document or software without
specific, written prior permission.
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
-
--Copyright--
*/
/*
@(#)netdb.h 8.1 (Berkeley) 6/2/93
From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
$FreeBSD: src/include/netdb.h,v 1.38.2.1 2005/07/22 20:17:30 ume Exp $
*/
/* !_NETDB_H_ */
# 395 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
Int main()
{
struct servent *p;
p=getservent();
if(p)
printf("getservent successful");
else
printf("getservent failed");
return 0;
}
Output
Getservent passed
# 1 "d:/EPOC/epoc32/include/stdapis/stdio.h" 1
/*-
© Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
Copyright (c) 1990, 1993
The Regents of the University of California. All rights reserved.
This code is derived from software contributed to Berkeley by
Chris Torek.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)stdio.h 8.5 (Berkeley) 4/29/95
$FreeBSD: src/include/stdio.h,v 1.56 2004/06/20 10:01:30 tjr Exp $
© Portions copyright (c) 2005-2006 Nokia Corporation. All rights reserved.
© Portions copyright (c) 2007-2008 Symbian Software Ltd. All rights reserved.
*/
/* !_STDIO_H_ */
# 414 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/netinet/in.h" 1
// © Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
/*-
Copyright (c) 1982, 1986, 1990, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)in.h 8.3 (Berkeley) 1/3/94
$FreeBSD: src/sys/netinet/in.h,v 1.90.2.3 2005/10/02 15:45:47 andre Exp $
*/
/* !_NETINET_IN_H_*/
# 415 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/arpa/inet.h" 1
/*
Copyright (c) 1983, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-
Portions Copyright (c) 1993 by Digital Equipment Corporation.
© Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and that
the name of Digital Equipment Corporation not be used in advertising or
publicity pertaining to distribution of the document or software without
specific, written prior permission.
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
@(#)inet.h 8.1 (Berkeley) 6/2/93
From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
$FreeBSD: src/include/arpa/inet.h,v 1.25 2002/08/21 16:19:56 mike Exp $
*/
/* !_ARPA_INET_H_ */
# 416 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/string.h" 1
/*-
Copyright (c) 1990, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)string.h 8.1 (Berkeley) 6/2/93
$FreeBSD: src/include/string.h,v 1.21.2.1 2005/08/29 18:46:39 andre Exp $
© Portions copyright (c) 2005-2006 Nokia Corporation. All rights reserved.
*/
/* _STRING_H_ */
# 417 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/netdb.h" 1
/* NETDB.H
© Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
Copyright (c) 1980, 1983, 1988, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-
Portions Copyright (c) 1993 by Digital Equipment Corporation.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and that
the name of Digital Equipment Corporation not be used in advertising or
publicity pertaining to distribution of the document or software without
specific, written prior permission.
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
-
--Copyright--
*/
/*
@(#)netdb.h 8.1 (Berkeley) 6/2/93
From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
$FreeBSD: src/include/netdb.h,v 1.38.2.1 2005/07/22 20:17:30 ume Exp $
*/
/* !_NETDB_H_ */
# 418 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
int main()
{
int stayopen=1;
retservent(stayopen):
return 0;
}
# 1 "d:/EPOC/epoc32/include/stdapis/stdio.h" 1
/*-
© Portions copyright (c) 2006 Symbian Software Ltd. All rights reserved.
Copyright (c) 1990, 1993
The Regents of the University of California. All rights reserved.
This code is derived from software contributed to Berkeley by
Chris Torek.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)stdio.h 8.5 (Berkeley) 4/29/95
$FreeBSD: src/include/stdio.h,v 1.56 2004/06/20 10:01:30 tjr Exp $
© Portions copyright (c) 2005-2006 Nokia Corporation. All rights reserved.
© Portions copyright (c) 2007-2008 Symbian Software Ltd. All rights reserved.
*/
/* !_STDIO_H_ */
# 428 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/netinet/in.h" 1
// © Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
/*-
Copyright (c) 1982, 1986, 1990, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)in.h 8.3 (Berkeley) 1/3/94
$FreeBSD: src/sys/netinet/in.h,v 1.90.2.3 2005/10/02 15:45:47 andre Exp $
*/
/* !_NETINET_IN_H_*/
# 429 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/arpa/inet.h" 1
/*
Copyright (c) 1983, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-
Portions Copyright (c) 1993 by Digital Equipment Corporation.
© Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and that
the name of Digital Equipment Corporation not be used in advertising or
publicity pertaining to distribution of the document or software without
specific, written prior permission.
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
@(#)inet.h 8.1 (Berkeley) 6/2/93
From: Id: inet.h,v 8.5 1997/01/29 08:48:09 vixie Exp $
$FreeBSD: src/include/arpa/inet.h,v 1.25 2002/08/21 16:19:56 mike Exp $
*/
/* !_ARPA_INET_H_ */
# 430 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/string.h" 1
/*-
Copyright (c) 1990, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)string.h 8.1 (Berkeley) 6/2/93
$FreeBSD: src/include/string.h,v 1.21.2.1 2005/08/29 18:46:39 andre Exp $
© Portions copyright (c) 2005-2006 Nokia Corporation. All rights reserved.
*/
/* _STRING_H_ */
# 431 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
# 1 "d:/EPOC/epoc32/include/stdapis/netdb.h" 1
/* NETDB.H
© Portions copyright (c) 2007 Symbian Software Ltd. All rights reserved.
Copyright (c) 1980, 1983, 1988, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
-
Portions Copyright (c) 1993 by Digital Equipment Corporation.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies, and that
the name of Digital Equipment Corporation not be used in advertising or
publicity pertaining to distribution of the document or software without
specific, written prior permission.
THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
-
--Copyright--
*/
/*
@(#)netdb.h 8.1 (Berkeley) 6/2/93
From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
$FreeBSD: src/include/netdb.h,v 1.38.2.1 2005/07/22 20:17:30 ume Exp $
*/
/* !_NETDB_H_ */
# 432 "d:/EPOC/release/9.4/common/generic/openenv/core/include/netdb.dosc" 2
int main()
{
struct servent *p;
p=getservent();
if(p)
endservent();
return 0;
}
Diagnostics: Null pointer (0) returned on (-1) or error. The getservent, getservbyport, getservbyname, setservent, and endservent functions appeared in BSD 4.2.
Bugs:
These functions use a thread-specific data storage. If the data is needed for future use it should be copied before any subsequent calls overwrite it. Expecting port numbers to fit in a 32 bit quantity is probably naive.
|
Interface status: | externallyDefinedApi |
IMPORT_C int getaddrinfo(const char *, const char *, const struct addrinfo *, struct addrinfo **);
The freeaddrinfo(struct addrinfo *)
freeaddrinfo(struct addrinfo *)
function shall free one or more addrinfo structures returned by getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
, along with any additional storage associated with those structures. If the ai_next field of the structure is not null, the
entire list of structures shall be freed. The freeaddrinfo(struct addrinfo *)
freeaddrinfo(struct addrinfo *)
function shall support the freeing of arbitrary sublists of an addrinfo list originally returned by getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
.
The getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
function shall translate the name of a service location (for example, a host name) and//or a service name and shall return
a set of socket addresses and associated information to be used in creating a socket with which to address the specified service.
|
|
Interface status: | externallyDefinedApi |
IMPORT_C int getnameinfo(const struct sockaddr *, socklen_t, char *, size_t, char *, size_t, int);
The getnameinfo function is used to convert a sockaddr structure to a pair of host name and service strings. It is a replacement
for and provides more flexibility than the gethostbyaddr and getservbyport functions and is the converse of the getaddrinfo
function. The sockaddr structure sa should point to sockaddr_in
sockaddr_in
(for IPv4) that is salen bytes long.
The host and service names associated with sa are stored in host and serv which have length parameters hostlen and servlen.
The maximum value for hostlen is NI_MAXHOST and the maximum value for servlen is NI_MAXSERV, as defined by <netdb.h
.> If a length parameter is zero, no string will be stored. Otherwise, enough space must be provided to store the host name
or service string plus a byte for the NUL terminator.
The flags argument is formed by OR ’ing the following values: NI_NOFQDN A fully qualified domain name is not required for local hosts. The local part of the fully qualified domain name is returned instead.
NI_NUMERICHOST Return the address in numeric form, as if calling inet_ntop, instead of a host name.
NI_NAMEREQD A name is required. If the host name cannot be found in DNS and this flag is set, a non-zero error code is returned. If the host name is not found and the flag is not set, the address is returned in numeric form.
NI_NUMERICSERV The service name is returned as a digit string representing the port number.
NI_DGRAM Specifies that the service being looked up is a datagram service, and causes getservbyport to be called with a second argument of "udp" instead of its default of "tcp." This is required for the few ports (512-514) that have different services for UDP and TCP.
Examples:
#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>
int main()
{
struct addrinfo *result;
char hostname[80];
int error;
if (error = getaddrinfo("www.yahoo.com",NULL, NULL, &result;))
{
fprintf(stderr, "error using getaddrinfo: %s
", gai_strerror(error));
}
if (result)
{
if (error = getnameinfo(result->ai_addr, sizeof(struct sockaddr), hostname, sizeof(hostname), NULL,0,0))
{
printf( "error using getnameinfo: %s
", gai_strerror(error));
}
}
return 0;
}
Caveats:
getnameinfo can return both numeric and FQDN forms of the address specified in sa. There is no return value that indicates whether the string returned in host is a result of binary to numeric-text translation (like inet_ntop or is the result of a DNS reverse lookup. Because of this, malicious parties could set up a PTR record as follows:
1.0.0.127.in-addr.arpa. IN PTR 10.1.1.1
and trick the caller of getnameinfo into believing that sa is 10.1.1.1 when it is actually 127.0.0.1. To prevent such attacks, the use of NI_NAMEREQD is recommended when the result of getnameinfo is used for access control purposes:
struct sockaddr *sa;
socklen_t salen;
char addr[NI_MAXHOST];
struct addrinfo hints, *res;
int error;
error = getnameinfo(sa, salen, addr, sizeof(addr),
NULL, 0, NI_NAMEREQD);
if (error == 0) {
memset(&hints;, 0, sizeof(hints));
hints.ai_socktype = SOCK_DGRAM; /*dummy*/
hints.ai_flags = 0x00000004 ;
if (getaddrinfo(addr, "0", &hints;, &res;) == 0) {
/* malicious PTR record */
freeaddrinfo(res);
printf("bogus PTR record
");
return -1;
}
/* addr is FQDN as a result of PTR lookup */
} else {
/* addr is numeric string */
error = getnameinfo(sa, salen, addr, sizeof(addr),
0 , 0, 0x00000002 );
}
Caveats:
getnameinfo can return both numeric and FQDN forms of the address specified in sa. There is no return value that indicates whether the string returned in host is a result of binary to numeric-text translation (like inet_ntop or is the result of a DNS reverse lookup. Because of this, malicious parties could set up a PTR record as follows:
1.0.0.127.in-addr.arpa. IN PTR 10.1.1.1
and trick the caller of getnameinfo into believing that sa is 10.1.1.1 when it is actually 127.0.0.1. To prevent such attacks, the use of 0x00000004 is recommended when the result of getnameinfo is used for access control purposes:
struct sockaddr *sa;
socklen_t salen;
char addr[ 1025 ];
struct addrinfo hints, *res;
int error;
error = getnameinfo(sa, salen, addr, sizeof(addr),
0 , 0, 0x00000004 );
if (error == 0) {
memset(&hints;, 0, sizeof(hints));
hints.ai_socktype = SOCK_DGRAM; /*dummy*/
hints.ai_flags = 0x00000004 ;
if (getaddrinfo(addr, "0", &hints;, &res;) == 0) {
/* malicious PTR record */
freeaddrinfo(res);
printf("bogus PTR record
");
return -1;
}
/* addr is FQDN as a result of PTR lookup */
} else {
/* addr is numeric string */
error = getnameinfo(sa, salen, addr, sizeof(addr),
0 , 0, 0x00000002 );
}
|
|
gai_strerror(int)
gai_strerror(int)
The gai_strerror function returns an error message string corresponding to the e...getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
...Interface status: | externallyDefinedApi |
IMPORT_C void freeaddrinfo(struct addrinfo *);
|
send(int,const void *,size_t,int)
send(int,const void *,size_t,int)
...gai_strerror(int)
gai_strerror(int)
The gai_strerror function returns an error message string corresponding to the e...gethostbyname(const char *)
gethostbyname(const char *)
Get the internet name of the host by name. getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
...getservent(void)
getservent(void)
Note: This description also covers the following functions - getservbyname(const...Interface status: | externallyDefinedApi |
IMPORT_C const char* gai_strerror(int);
EAI_AGAIN temporary failure in name resolution
EAI_BADFLAGS
invalid value for ai_flags
EAI_BADHINTS
invalid value for hints
EAI_FAIL non-recoverable failure in name resolution
EAI_FAMILY ai_family not supported
EAI_MEMORY memory allocation failure
EAI_NONAME hostname or servname not provided, or not known
EAI_PROTOCOL
resolved protocol is unknown
EAI_SERVICE servname not supported for ai_socktype
EAI_SOCKTYPE
ai_socktype not supported
EAI_SYSTEM system error returned in errno
The gai_strerror function returns an error message string corresponding to the error code returned by getaddrinfo or getnameinfo .
The following error codes and their meaning are defined in #include <netdb.h
>
EAI_AGAIN temporary failure in name resolution EAI_BADFLAGS invalid value for ai_flags EAI_BADHINTS invalid value for hints EAI_FAIL non-recoverable failure in name resolution EAI_FAMILY ai_family not supported EAI_MEMORY memory allocation failure EAI_NONAME hostname or servname not provided, or not known EAI_PROTOCOL resolved protocol is unknown EAI_SERVICE servname not supported for ai_socktype EAI_SOCKTYPE ai_socktype not supported EAI_SYSTEM system error returned in errno
Examples:
#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>
int main()
{
struct addrinfo *result;
char hostname[80];
int error;
if (error = getaddrinfo("www.nokia.com",NULL, NULL, &result;))
{
fprintf(stderr, "error using getaddrinfo: %s
", gai_strerror(error));
}
if (result)
{
if (error = getnameinfo(result->ai_addr, sizeof(struct sockaddr), hostname, sizeof(hostname), NULL,0,0))
{
printf( "error using getnameinfo: %s
", gai_strerror(error));
}
}
return 0;
}
|
|
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)
...getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)
...Interface status: | externallyDefinedApi |
IMPORT_C void setservent(int);
|