Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <netdb.h>
Link against: libc.lib

_PATH_SERVICES

Interface status: externallyDefinedApi

_PATH_SERVICES "\\resource\\services"

Description

Defines the services path.

[Top]


h_errno

Interface status: externallyDefinedApi

h_errno errno

Description

defines errno

[Top]


NETDB_INTERNAL

Interface status: externallyDefinedApi

NETDB_INTERNAL -1

Description

Error return codes from gethostbyname(const char *)gethostbyname(const char *) and gethostbyaddr(const char *,int,int)gethostbyaddr(const char *,int,int). see errno.

[Top]


NETDB_SUCCESS

Interface status: externallyDefinedApi

NETDB_SUCCESS 0

Description

Error return codes from gethostbyname(const char *)gethostbyname(const char *) and gethostbyaddr(const char *,int,int)gethostbyaddr(const char *,int,int). No Problem.

[Top]


HOST_NOT_FOUND

Interface status: externallyDefinedApi

HOST_NOT_FOUND ENOENT

Description

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.

[Top]


TRY_AGAIN

Interface status: externallyDefinedApi

TRY_AGAIN ETIMEDOUT

Description

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

[Top]


NO_RECOVERY

Interface status: externallyDefinedApi

NO_RECOVERY ECOMM

Description

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

[Top]


NO_DATA

Interface status: externallyDefinedApi

NO_DATA 4

Description

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

[Top]


NO_ADDRESS

Interface status: externallyDefinedApi

NO_ADDRESS NO_DATA

Description

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

[Top]


EAI_AGAIN

Interface status: externallyDefinedApi

EAI_AGAIN 2

Description

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

[Top]


EAI_BADFLAGS

Interface status: externallyDefinedApi

EAI_BADFLAGS 3

Description

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

[Top]


EAI_FAIL

Interface status: externallyDefinedApi

EAI_FAIL 4

Description

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

[Top]


EAI_FAMILY

Interface status: externallyDefinedApi

EAI_FAMILY 5

Description

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

[Top]


EAI_MEMORY

Interface status: externallyDefinedApi

EAI_MEMORY 6

Description

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 .

[Top]


EAI_NONAME

Interface status: externallyDefinedApi

EAI_NONAME 8

Description

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.

[Top]


EAI_SERVICE

Interface status: externallyDefinedApi

EAI_SERVICE 9

Description

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.

[Top]


EAI_SOCKTYPE

Interface status: externallyDefinedApi

EAI_SOCKTYPE 10

Description

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

[Top]


EAI_SYSTEM

Interface status: externallyDefinedApi

EAI_SYSTEM 11

Description

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.

[Top]


EAI_BADHINTS

Interface status: externallyDefinedApi

EAI_BADHINTS 12

Description

Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **).

[Top]


EAI_PROTOCOL

Interface status: externallyDefinedApi

EAI_PROTOCOL 13

Description

Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **).

[Top]


EAI_MAX

Interface status: externallyDefinedApi

EAI_MAX 14

Description

Error return codes from getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **).

[Top]


AI_PASSIVE

Interface status: externallyDefinedApi

AI_PASSIVE 0x00000001

Description

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

[Top]


AI_CANONNAME

Interface status: externallyDefinedApi

AI_CANONNAME 0x00000002

Description

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

[Top]


AI_NUMERICHOST

Interface status: externallyDefinedApi

AI_NUMERICHOST 0x00000004

Description

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

[Top]


AI_NUMERICSERV

Interface status: externallyDefinedApi

AI_NUMERICSERV 0x00000008

Description

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

[Top]


AI_MASK

Interface status: externallyDefinedApi

AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \
    AI_ADDRCONFIG)

Description

valid flags for addrinfo (not a standard def, apps should not use it)

[Top]


AI_ALL

Interface status: externallyDefinedApi

AI_ALL 0x00000100

Description

IPv6 and IPv4-mapped (with AI_V4MAPPED)

[Top]


AI_V4MAPPED_CFG

Interface status: externallyDefinedApi

AI_V4MAPPED_CFG 0x00000200

Description

accept IPv4-mapped if kernel supports

[Top]


AI_ADDRCONFIG

Interface status: externallyDefinedApi

AI_ADDRCONFIG 0x00000400

Description

only if any address is assigned

[Top]


AI_V4MAPPED

Interface status: externallyDefinedApi

AI_V4MAPPED 0x00000800

Description

accept IPv4-mapped IPv6 address

[Top]


AI_DEFAULT

Interface status: externallyDefinedApi

AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG)

Description

special recommended flags for getipnodebyname

[Top]


NI_MAXHOST

Interface status: externallyDefinedApi

NI_MAXHOST 1025

Description

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)

[Top]


NI_MAXSERV

Interface status: externallyDefinedApi

NI_MAXSERV 32

Description

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)

[Top]


NI_NOFQDN

Interface status: externallyDefinedApi

NI_NOFQDN 0x00000001

Description

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.

[Top]


NI_NUMERICHOST

Interface status: externallyDefinedApi

NI_NUMERICHOST 0x00000002

Description

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.

[Top]


NI_NAMEREQD

Interface status: externallyDefinedApi

NI_NAMEREQD 0x00000004

Description

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.

[Top]


NI_NUMERICSERV

Interface status: externallyDefinedApi

NI_NUMERICSERV 0x00000008

Description

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.

[Top]


NI_DGRAM

Interface status: externallyDefinedApi

NI_DGRAM 0x00000010

Description

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).

[Top]


SCOPE_DELIMITER

Interface status: externallyDefinedApi

SCOPE_DELIMITER '%'

Description

Scope delimit character

[Top]


endservent(void)

Interface status: externallyDefinedApi

IMPORT_C void endservent(void);

Description

Refer to getservent(void)getservent(void) for the documentation

[Top]


gethostbyaddr(const char *,int,int)

Interface status: externallyDefinedApi

IMPORT_C struct hostent* gethostbyaddr(const char *, int, int);

Description

Parameters

const char *

int

int

Refer to gethostbyname(const char *)gethostbyname(const char *) for the documentation

Return value

struct hostenthostent *

See also:

[Top]


gethostbyname(const char *)

Interface status: externallyDefinedApi

IMPORT_C struct hostent* gethostbyname(const char *);

Description

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.

Parameters

const char *

Note: This description also covers the following functions - gethostbyaddr(const char *,int,int)gethostbyaddr(const char *,int,int)

Return value

struct hostenthostent *

The gethostbyname and gethostbyaddr functions return NULL if an error occurs or a valid hostent structure otherwise.

See also:

[Top]


getprotobyname(const char *)

Interface status: externallyDefinedApi

IMPORT_C struct protoent* getprotobyname(const char *);

Description

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.

Parameters

const char *

Note: This description also covers the following functions - getprotobynumber(int)getprotobynumber(int)

Return value

struct protoentprotoent *

Null pointer (0) returned on error.

[Top]


getprotobynumber(int)

Interface status: externallyDefinedApi

IMPORT_C struct protoent* getprotobynumber(int);

Description

Parameters

int

Refer to getprotobyname(const char *)getprotobyname(const char *) for the documentation

Return value

struct protoentprotoent *

[Top]


getservbyname(const char *,const char *)

Interface status: externallyDefinedApi

IMPORT_C struct servent* getservbyname(const char *, const char *);

Description

Parameters

const char *

const char *

Refer to getservent(void)getservent(void) for the documentation

Return value

struct serventservent *

[Top]


getservbyport(int,const char *)

Interface status: externallyDefinedApi

IMPORT_C struct servent* getservbyport(int, const char *);

Description

Parameters

int

const char *

Refer to getservent(void)getservent(void) for the documentation

Return value

struct serventservent *

[Top]


getservent(void)

Interface status: externallyDefinedApi

IMPORT_C struct servent* getservent(void);

Description

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.

Return value

struct serventservent *

getservent, getservbyname and getservbyport functions return the servent structure, or a NULL pointer if an error occurs or the end of the file is reached.

[Top]


getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)

Interface status: externallyDefinedApi

IMPORT_C int getaddrinfo(const char *, const char *, const struct addrinfo *, struct addrinfo **);

Description

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.

Parameters

const char *

const char *

const struct addrinfoaddrinfo *

struct addrinfoaddrinfo **

Return value

int

A zero return value for getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **) indicates successful completion; a non-zero return value indicates failure. The possible values for the failures are listed in the ERRORS section. Upon successful return of getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **)getaddrinfo(const char *,const char *,const struct addrinfo *,struct addrinfo **), the location to which res points shall refer to a linked list of addrinfo structures, each of which shall specify a socket address and information for use in creating a socket with which to use that socket address. The list shall include at least one addrinfo structure.

[Top]


getnameinfo(const struct sockaddr *,socklen_t,char *,size_t,char *,size_t,int)

Interface status: externallyDefinedApi

IMPORT_C int getnameinfo(const struct sockaddr *, socklen_t, char *, size_t, char *, size_t, int);

Description

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_insockaddr_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 );
}

Parameters

const struct sockaddrsockaddr *

socklen_tsocklen_t

char *

size_tsize_t

char *

size_tsize_t

int

Return value

int

getnameinfo returns zero on success or one of the error codes listed in gai_strerror if an error occurs.

See also:

[Top]


freeaddrinfo(struct addrinfo *)

Interface status: externallyDefinedApi

IMPORT_C void freeaddrinfo(struct addrinfo *);

Description

Parameters

struct addrinfoaddrinfo *

Refer to t() for the documentation

See also:

[Top]


gai_strerror(int)

Interface status: externallyDefinedApi

IMPORT_C const char* gai_strerror(int);

Description

 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;
}

Parameters

int

Return value

const char *

The gai_strerror function returns a pointer to the error message string corresponding to ecode. If ecode is out of range, an implementation-specific error message string is returned.

See also:

[Top]


setservent(int)

Interface status: externallyDefinedApi

IMPORT_C void setservent(int);

Description

Parameters

int

Refer to getservent(void)getservent(void) for the documentation