Next: posix socket addresses rep, Previous: posix socket addresses in, Up: posix socket addresses [Index]
Instances of struct sockaddr_in6
can be handled at the Scheme
level as follows:
#!vicare (import (vicare) (prefix (vicare posix) px.)) (define sockaddr (px.make-sockaddr_in6 '#vu16b(1 2 3 4 5 6 7 8) 88)) (px.sockaddr_in6.in6_addr sockaddr) ⇒ #vu16b(1 2 3 4 5 6 7 8) (px.sockaddr_in6.in6_port sockaddr) ⇒ 88
care must be taken when handling such raw values.
Given a bytevector host-address holding a struct in6_addr
and a fixnum port representing a network port number, build and
return a bytevector holding a struct sockaddr_in6
initialised
with this data.
Given a bytevector socket-address holding a struct
sockaddr_in6
, extract the in6_addr
and in6_port
fields
and return them as bytevector holding the corresponding struct
in6_addr
and as fixnum. If the data in socket_address is
invalid: an exception is raised.
Internally convert the port number to host byte order using
ntohs()
after the extraction of the value from the data structure.
Build and return a bytevector holding the constant structures of type
struct in6_addr
defined by in6addr_loopback
and
in6addr_any
.