But these offsets are not magic : they come from C struct definitions:
````c
/* man 7 ip */
           struct sockaddr_in {
               sa_family_t    sin_family;   /* AF_INET */
               in_port_t      sin_port;      /* port number */
               struct in_addr sin_addr;   /* internet address */
           };

           struct in_addr {
               uint32_t       s_addr;
           };
````
and 
````c
/* man 7 ipv6 */
           struct sockaddr_in6 {
               sa_family_t     sin6_family;   /* AF_INET6 */
               in_port_t       sin6_port      /* port number */;
               uint32_t        sin6_flowinfo; /* flow information */
               struct in6_addr sin6_addr;     /* IPv6 adress */
               uint32_t        sin6_scope_id; /* Scope ID */
           };

           struct in6_addr {
               unsigned char   s6_addr[16];
           };
````