Next: , Previous: , Up: glibc   [Index]


5.7 Networking

The following bindings are exported by the (vicare glibc) library.

Function: IN_CLASSA addr
Function: IN_CLASSB addr
Function: IN_CLASSC addr
Function: IN_CLASSD addr
Function: IN_MULTICAST addr
Function: IN_EXPERIMENTAL addr
Function: IN_BADCLASS addr

Return #t if addr is an 32-bit exact integer representing, in native endianness, an IPv4 host address in the specified address class; otherwise return #f.

(import (vicare)
  (prefix (vicare posix) px.)
  (prefix (vicare glibc) glibc.))

(define host-address.class-B '#vu8(128 0 0 1))
(define addr
  (px.sockaddr_in.in_addr.number
   (px.make-sockaddr_in host-address.class-B 88)))
(glibc.IN_CLASSB addr)
⇒ #t
Function: IN6_IS_ADDR_UNSPECIFIED addr
Function: IN6_IS_ADDR_LOOPBACK addr
Function: IN6_IS_ADDR_LINKLOCAL addr
Function: IN6_IS_ADDR_SITELOCAL addr
Function: IN6_IS_ADDR_V4MAPPED addr
Function: IN6_IS_ADDR_V4COMPAT addr
Function: IN6_IS_ADDR_MULTICAST addr
Function: IN6_IS_ADDR_MC_NODELOCAL addr
Function: IN6_IS_ADDR_MC_LINKLOCAL addr
Function: IN6_IS_ADDR_MC_SITELOCAL addr
Function: IN6_IS_ADDR_MC_ORGLOCAL addr
Function: IN6_IS_ADDR_MC_GLOBAL addr

Return #t if addr is a bytevector representing a struct in6_addr of the specified type; otherwise return #f.

Function: IN6_ARE_ADDR_EQUAL addr1 addr2

The arguments addr1 and addr2 must be bytevectors representing two struct in6_addr. Return #t if they represent the same address; otherwise return #f.

Function: bindresvport sock sockaddr-in
Function: bindresvport6 sock sockaddr-in6

Interfaces to the C functions bindresvport() and bindresvport6(), see the manual page (*manpages*)Bind a socket to a privileged IP port. Bind a socket descriptor sock to a privileged anonymous IP port, that is, a port number arbitrarily selected from the range [512, 1023]. If an error occurs: raise an exception.

sockaddr-in must be a bytevector holding a struct sockaddr_in; sockaddr-in6 must be a bytevector holding a struct sockaddr_in6.


Next: , Previous: , Up: glibc   [Index]