Amiga Developer Site by i n n o i d e a | MorphOS | Amiga Developers | Compilers | Documents | Dev-HardFile v1.11 for UAE / real Amiga - readme - shot) | Unique/All Visitors: 77257/570053
Search manual for function in the   
AmiTCP/gethostbyname - GeekGadgets/gethostbyname
  bsdsocket.guide/gethostbyname()
  
  




gethostbyname(), gethostbyaddr()
================================

NAME
     gethostbyname, gethostbyaddr -- get network host entry

SYNOPSIS
     #include <netdb.h>
     extern struct h_errno;

     struct hostent * gethostbyname(char * name)
     D0                                    A0

     struct hostent * gethostbyaddr(char * addr, int len, int type)
     D0                                    A0        D0       D1

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.
     This structure contains either the information obtained from the
     name server, named or broken-out fields from a line in /etc/hosts.
     If the local name server is not running these routines do a lookup
     in /etc/hosts.
     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 zero terminated array of alternate names for the host.

    h_addrtype
          The type of address being returned; currently always AF_INET.

    h_length
          The length, in bytes, of the address.

    h_addr_list
          A zero 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
          (source) compatiblity.

DIAGNOSTICS
     Error return status from gethostbyname() and gethostbyaddr() is
     indicated by return of a null pointer.  The library integer
     h_errno (see SocketBaseTagList()) may then be checked to
     see whether this is a temporary failure or an invalid or unknown
     host.  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 library variable h_errno can have the following values:
    HOST_NOT_FOUND
          No such host is known.

    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.

    NO_DATA
          The requested name is valid but does not have an IP address;
          this is not a temporary error.  This means that the name is
          known to the name server but there is no address associated
          with this name.  Another type of request to the name server
          using this domain name will result in an answer; for example,
          a mail-forwarder may be registered for this domain.

SEE ALSO
     AMITCP/IP configuration

HISTORY
     The herror() function appeared in 4.3BSD.  gethostbyaddr() and
     gethostbyname() functions appeared in 4.2BSD.

BUGS
     These functions use static data storage; if the data is needed for
     future use, it should be copied before any subsequent calls
     overwrite it.  Only the Internet address format is currently
     understood.






Logo by Emeric/SH
AmiTCP/gethostbyname

No examples found...


Functions with "g":
generating_xdr_routines
get_file_attributes
get_filesystem_attributes
get_filesystem_root
get_myaddress
getcredentials
getdtablesize
getgrent
getgroups
gethostbyname
gethostid
gethostname
getlastlog
getlogin
getnetbyname
getopt
getopt.h
getpass
getpeername
getpid
getprotobyname
getpwent
getrpcbyname
getrpcbynumber
getrpcent
getrpcport
getservbyname
getsocketevents
getsockname
getsockopt
getspgrp
gettimeofday
getuid
getumask
getutent
group
grp.h
gst
gst.h

Last 15 uploaded Examples:

20071229151342 AmiSSL/X509_STORE_CTX_cleanup
20070708011052 GeekGadgets/getlogin
20060705053954 AmigaOS/OpenWorkbenchObjectA
20050801035639 SDL/SDL_Surface
20050727092732 BlitzBasic/LSL
20050718102843 SDL/SDL_WarpMouse
20050718072844 GeekGadgets/fread
20050714051528 SDL/SDL_ActiveEvent
20050714051514 SDL/SDL_ActiveEvent
20050701171401 GeekGadgets/errno
20050701171347 GeekGadgets/errno
20050627101951 SDL/SDL_FreeSurface
20050623152729 GeekGadgets/fork
20050619153102 GeekGadgets/tcdrain
20050615182849 AmigaOS/OpenScreen

Last 25 posts:

20050613235812 SDL/SDL_SetGammaRamp
20050526065000 AmiTCP/unistd.h
20050413041558 AmiSSL/X509_STORE_set_default_paths
20050409155750 AmigaDOS/Status
20050129230614 MUI/Calendar.mcc
20050128185620 GeekGadgets/hstrerror
20041126154558 BlitzBasic/LoadBank
20041123170704 GeekGadgets/gcvt
20041105222909 AmigaOS/CheckSignal
20040712190839 SDL/SDL_SetVideoMode
20040627090529 SDL/SDL_Init
20040519133228 GeekGadgets/fork
20040407124555 AmigaOS/AllocMem
20040403101120 GeekGadgets/inet_ntoa
20040327172814 GeekGadgets/random
20040327172714 GeekGadgets/srandom
20040313211937 BlitzBasic/ANALYZEDISK
20040303135237 GeekGadgets/mktemp
20040301131355 GeekGadgets/realpath
20040301123615 GeekGadgets/gcvt
20040301114000 GeekGadgets/htonl
20040301100209 GeekGadgets/realpath
20040229095437 GeekGadgets/time
20040211132618 GeekGadgets/getpid
20040209102818 AmigaOS/OpenWindow




Amiga.sf
AMIGIFT

Locations of visitors to this page

Page took 0.778437 seconds to load.