2 2 2.1 AF_INET6: The Address Family for (Web design software)

2 2 2.1 AF_INET6: The Address Family for IPv6 As we have seen in Chapter 1, on the socket API we use a constant AF_INET to identify IPv4 sockets. Also, to identify IPv4 peers on the socket we have used C structure, called sockaddr_in. To handle IPv6 on the socket API, we use a constant called AF_INET6. The expression is as follows: s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); This could be rewritten as: s = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); to initialize an IPv6 socket into variable s. The following code shows the definition of sockaddr_in and sockaddr_in6: Definition of sockaddr_in: struct sockaddr_in { u_int8_t sin_len; /* length of sockaddr */ u_int8_t sin_family; /* address family */ u_int16_t sin_port; /* TCP/UDP port number */ struct in_addr sin_addr; /* IPv4 address */ int8_t sin_zero[8]; /* padding */ }; Definition of sockaddr_in6: struct sockaddr_in6 { u_int8_t sin6_len; /* length of this struct (socklen_t) */ u_int8_t sin6_family; /* AF_INET6 (sa_family_t) */ u_int16_t sin6_port; /* Transport layer port */ 13
If you are in search for clan hosting account you just came in to right place. We host many clan websites in almost all popular games like Counterstrike, Call Of Duty and other. More details about our offer you can find inside clan web hosting section.

Leave a Reply