Next: glibc net, Previous: glibc sync, Up: glibc [Index]
The following bindings are exported by the (vicare glibc)
library.
Interface to the C function if_nametoindex()
, (libc)if_nametoindex. Convert the string name representing a
network interface to the corresponding internal index. Return a fixnum
representing the index or false if name is invalid.
(import (vicare) (prefix (vicare glibc) glibc.)) (glibc.if-indextoname 0) ⇒ #f (glibc.if-indextoname 1) ⇒ "lo" (glibc.if-indextoname 2) ⇒ "eth0"
Interface to the C function if_indextoname()
, (libc)if_indextoname. Convert the fixnum index associated to
an interface to the corresponding string name. Return a string holding
the name or false if index is invalid.
(import (vicare) (prefix (vicare glibc) glibc.)) (glibc.if-nametoindex "lo") ⇒ 1 (glibc.if-nametoindex "eth0") ⇒ 2
Interface to the C function if_nameindex()
, (libc)if_nameindex. Build and return an association list having
fixnums as keys and strings as values; the fixnums are the interface
indexes, the strings are the corresponding interface names.
(import (vicare) (prefix (vicare glibc) glibc.)) (glibc.if-nameindex) ⇒ ((4 . "wlan0") (2 . "eth0") (1 . "lo"))
Interface to the C function gethostbyname2()
, (libc)gethostbyname2. Like gethostbyname
but allows the selection of
the address type with the parameter addrtype which must be
AF_INET
or AF_INET6
.