| INET6_GETSCOPEID(3) | Library Functions Manual | INET6_GETSCOPEID(3) | 
inet6_getscopeid,
  inet6_putscopeid —
#include <netinet/in.h>
void
  
  inet6_getscopeid(struct
    sockaddr_in6 *sin6, int
    flags);
void
  
  inet6_putscopeid(struct
    sockaddr_in6 *sin6, int
    flags);
Typically those two bytes are 0 for these
    kinds of addresses. The scope id is stored in network byte order.
The inet6_getscopeid() function retrieves
    the scope id from the 3rd and the 4th address bytes (from the
    sin6_addr member of sin6), and
    sets the sin6_scope_id from them. It then clears the
    two address bytes.
The inet6putscopeid() function stores the
    scope id found in sin6_scope_id into the 3rd and 4th
    byte of the address (into the sin6_addr member of
    sin6). It then clears the
    sin6_scope_id member of
  sin6.
The flags argument controls for which addresses this action is performed. It can be a combination of:
| October 31, 2013 | NetBSD 9.4 |