Next: posix socket networks, Previous: posix socket protocols, Up: posix socket [Index]
Scheme level representation of struct servent. It has the
following fields:
s_nameBytevector, the ASCII coding of the official service name.
s_aliasesNull or list of bytevectors, the ASCII codings of service name aliases.
s_portFixnum, the port number.
s_protoBytevector, ASCII coding of the associated protocol name.
Build and return an instance of struct-servent.
Accessors for the fields of struct-servent.
Interface to the C function getservbyname(), (libc)getservbyname. Given the strings or bytevectors name
and protocol holding the ASCII coding of a network service name
and protocol, query the network services database and build an instance
of struct-servent mirroring the resulting struct servent
entry. If successful return the data structure, else raise an
exception.
(px.getservbyname "smtp" "tcp")
⇒ #["struct-servent"
s_name="smtp"
s_aliases=(mail)
s_port=25
s_proto=tcp]
(px.getservbyname "ntp" "udp")
⇒ #["struct-servent"
s_name="ntp"
s_aliases=()
s_port=123
s_proto=udp]
Interface to the C function getservbynumber(), (libc)getservbynumber. Given a fixnum port and a string or
bytevector protocol being the port number and protocol name of a
network service, query the network services database and build an
instance of struct-servent mirroring the resulting struct
servent entry. If successful return the data structure, else raise an
exception.
(px.getservbyport 80 "tcp")
⇒ #["struct-servent"
s_name="http"
s_aliases=(www-http www)
s_port=80
s_proto=tcp]
Interface to the C functions setservent(), getservent() and
endservent(), (libc)setservent. Scan the
network service database and build a list of struct-servent
mirroring the resulting struct servent entries. Return the list
of structures.
Next: posix socket networks, Previous: posix socket protocols, Up: posix socket [Index]