Artistics

Embed Size (px)

Citation preview

  • 7/30/2019 Artistics

    1/3

    This header file contains definitions to allow for the porting of BSD programs.

    must usually be included before other socket-related header files; referto the individual header file descriptions that follow for the specific dependency.

    This header file declares the following typedef names for use as abbreviations for

    three commonly used types:

    typedef unsigned u_char;

    u_char;

    typedef unsigned u_short;

    u_short;

    typedef unsigned u_long;

    u_long; .

    The following typedef name is commonly used for buffer pointers:

    typedef char * caddr_t;

    This header file also defines the FD_SET , FD_ZERO , FD_CLR, FD_ISSET ,

    and FD_SETSIZE macros used by select to manipulate socket descriptors

    This header file contains definitions for the macro identifiers that name system error

    status conditions. When a SAS/C Library function sets an error status by assigning a

    nonzero value to errno , the calling program can check for a particular value by using

    the name defined in. The following table lists all the errno values normally

    associated with the socket library functions:

    This header file contains macro definitions related to the creation of sockets, for

    example, the type of socket (stream, datagram, or raw), the options supported, and the

  • 7/30/2019 Artistics

    2/3

    address family. (AF_UNIX is supported if integrated sockets are used.) The SAS/C

    Compiler only supports the TCP/IP and theAF_INET Internet address family.

    This header file contains structures returned by the network database library. Internet

    addresses and port numbers are stored in network byte order, identical to IBM 370

    byte order. Other quantities, including network numbers, are stored in host byte order.

    Despite the fact that network byte order and host byte order are identical on the IBM

    System/370, a portable program must distinguish between the two. The structures in

    theheader file are described in the following sections.

    hostent

    This structure contains host information.

    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

    header file before this header file. The structures in

    theheader file are described in the following sections.

    in_addr

    This structure contains the Internet address in network byte order, which is the same

    as host byte order on the IBM System/370.

    struct in_addr {u_long s_addr;

    };

    sockaddr_in

  • 7/30/2019 Artistics

    3/3

    This structure contains the socket address, which includes the host's Internet address

    and a port number. This is the specific address structure used for a socket address

    when the transport mechanism is TCP/IP.

    struct sockaddr_in {

    short sin_family;u_short sin_port;struct in_addr sin_addr;char sin_zero[8];

    };