AF_INET socket addresses in an Internet domain

A socket address in an Internet addressing family is comprised of four fields: The structure of an Internet socket address is defined by the following sockaddr_in structure, which is found in header file IN.H:
struct in_addr
{
        u_long s_addr;
};
struct sockaddr_in
{
        short   sin_family;
        u_short sin_port;
        struct  in_addr sin_addr;
        char    sin_zero[8];
};

The sin_family field is set to AF_INET. The sin_port field is the port used by the application, in network byte order. sin_addr field specifies a 32-bit Internet address. The sin_addr field is the Internet address of the network interface used by the application; it is also in network byte order. The sin_zero field should be set to zeros.