Table of Contents ***************** IOLib 1 Overview 2 Networking 2.1 Overview 2.2 Sockets 2.2.1 Socket Classes 2.2.2 Socket Operators and Macros 2.2.3 Socket Accessors 2.2.4 Socket Predicates 2.2.5 Socket Options 2.3 Socket Addresses 2.3.1 Address Objects 2.3.1.1 Classes 2.3.1.2 Functions 2.3.1.3 Constants 2.3.2 Address Predicates 2.3.3 Address Arithmetic 2.3.4 Low-level Address Manipulation 2.4 DNS 2.4.1 Functions 2.4.2 Conditions 2.5 Services 2.6 Protocols 2.7 Network Interfaces Index IOLib ***** Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 1 Overview ********** Describe IOLib here. 2 Networking ************ 2.1 Overview ============ Describe networking here. 2.2 Sockets =========== 2.2.1 Socket Classes -------------------- -- Class: sockets:socket Class precedence list: `socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, t' Base class for sockets. -- Class: sockets:stream-socket Class precedence list: `stream-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, t' Mixin for sockets of type SOCK_STREAM. -- Class: sockets:datagram-socket Class precedence list: `datagram-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, t' Mixin for sockets of type SOCK_DGRAM. -- Class: sockets:internet-socket Class precedence list: `internet-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, t' Mixin for sockets of domain AF_INET or AF_INET6. -- Class: sockets:local-socket Class precedence list: `local-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, t' Mixin for sockets of domain AF_LOCAL. -- Class: sockets:active-socket Class precedence list: `active-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, t' Mixin class for active(client) sockets. -- Class: sockets:passive-socket Class precedence list: `passive-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, t' Mixin class for PASSIVE(server) sockets. -- Class: sockets:socket-stream-internet-active Class precedence list: `socket-stream-internet-active, active-socket, stream-socket, internet-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, t' Class representing active sockets of type SOCK_STREAM and domain AF_INET or AF_INET6. -- Class: sockets:socket-stream-internet-passive Class precedence list: `socket-stream-internet-passive, passive-socket, stream-socket, internet-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, t' Class representing passive sockets of type SOCK_STREAM and domain AF_INET or AF_INET6. -- Class: sockets:socket-stream-local-active Class precedence list: `socket-stream-local-active, active-socket, stream-socket, local-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, t' Class representing active sockets of type SOCK_STREAM and domain AF_LOCAL. -- Class: sockets:socket-stream-local-passive Class precedence list: `socket-stream-local-passive, passive-socket, stream-socket, local-socket, socket, dual-channel-single-fd-mixin, dual-channel-fd-mixin, standard-object, t' Class representing passive sockets of type SOCK_STREAM and domain AF_LOCAL. -- Class: sockets:socket-datagram-internet-active Class precedence list: `socket-datagram-internet-active, active-socket, datagram-socket, internet-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, t' Class representing active sockets of type SOCK_DGRAM and domain AF_INET or AF_INET6. -- Class: sockets:socket-datagram-local-active Class precedence list: `socket-datagram-local-active, active-socket, datagram-socket, local-socket, socket, dual-channel-single-fd-mixin, dual-channel-gray-stream, trivial-gray-stream-mixin, dual-channel-fd-mixin, fundamental-binary-input-stream, fundamental-binary-output-stream, fundamental-character-input-stream, fundamental-input-stream, fundamental-character-output-stream, fundamental-output-stream, fundamental-character-stream, fundamental-binary-stream, fundamental-stream, standard-object, stream, t' Class representing active sockets of type SOCK_DGRAM and domain AF_LOCAL. 2.2.2 Socket Operators and Macros --------------------------------- -- Generic Function: sockets:make-socket &key address-family type connect ipv6 external-format address-family type connect ipv6 external-format &allow-other-keys Create an instance of a subclass of `socket'. `address-family', `type', `connect' and IPV6 are used to specify the kind of socket to create. * `address-family' `-' `:internet' or `:local' (or `:file' as synonim) * `type' `-' `:stream' or `:datagram' * `connect' `-' `:active' or `:passive' * IPV6 `-' if `nil', create an IPv4 socket, otherwise an IPv6 socket. To initialize the socket, the following keyword arguments can be used depending on `address-family', `type' and `connect:' * :local-host `-' a hostname designator or `nil'. If non-null the socket will be bound to this address * :local-port `-' a port designator or `nil'. If `local-host' is non-null, bind the socket to this port. If `nil', choose a random port * :remote-host `-' a hostname designator or `nil'. If non-null the socket will be connected to this address * :remote-port `-' a port designator. If `remote-host' is non-null, connect the socket to this port * :local-filename `-' a string or `nil'. If non-null the socket will be bound to this file * :remote-filename `-' a string or `nil'. If non-null the socket will be connected to this file * :backlog `-' a positive integer or `nil'. Specifies the length of the incomming connection queue and can't be larger than `+max-backlog-size+'. If `nil', default is `*default-backlog-size*' * :reuse-address: a boolean(default T). set option SO_REUSEADDR if `local-host' is non-null * :keepalive `-' a boolean. set option SO_KEEPALIVE * :nodelay `-' a boolean. set option SO_NODELAY * :interface `-' a string. set option SO_BINDTODEVICE to this interface * :input-buffer-size `-' a positive integer. Create the stream input buffer of this size * :output-buffer-size `-' a positive integer. Create the stream output buffer of this size Glossary: * hostname designator: an instance of `inet-address' or any object accepted by `lookup-host'. IPV6 is passed to `lookup-host' as is * port designator: any object accepted by `lookup-service' :address-family `:internet' :type `:stream' :connect `:active' * Valid keyword args: `:local-host', `:local-port', `:remote-host', `:remote-port', `:reuse-address', `:keepalive', `:nodelay', `:input-buffer-size' and `:output-buffer-size' :address-family `:internet' :type `:stream' :connect `:passive' * Valid keyword args: `:local-host', `:local-port', `:backlog', `:reuse-address', `:interface' and `:nodelay' :address-family `:internet' :type `:stream' :connect `:active' * Valid keyword args: `:local-filename', `:remote-filename', `:input-buffer-size' and `:output-buffer-size' :address-family `:internet' :type `:stream' :connect `:passive' * Valid keyword args: `:local-filename', `:remote-filename', `:backlog' and `:reuse-address' :address-family `:internet' :type `:datagram' * Valid keyword args: `:local-host', `:local-port', `:remote-host', `:remote-port', `:reuse-address', `:interface' and `:broadcast' :address-family `:local' :type `:datagram' * Valid keyword args: `:local-filename' and `:remote-filename' -- Macro: sockets:with-open-socket (var &rest args) &body body Bind `var' to a socket created by passing `args' to `make-socket' and execute `body' as implicit `progn'. The socket is automatically closed upon exit. -- Generic Function: sockets:make-socket-from-fd fd &key connect external-format input-buffer-size output-buffer-size connect external-format Create a socket instance of the appropriate subclass of `socket' using `fd'. The connection type of the socket must be specified `-' `:active' or `:passive'. The address family and type of the socket are automatically discovered using `os' functions. Buffer sizes for the new socket can also be specified using `input-buffer-size' and `output-buffer-size'. -- Generic Function: sockets:make-socket-pair &key type protocol external-format input-buffer-size output-buffer-size type protocol external-format Create a pair of sockets connected to each other. The socket type must be either `:stream' or `:datagram'. Currently OSes can only create `:local' sockets this way. Buffer sizes for the new sockets can also be specified using `input-buffer-size' and `output-buffer-size'. -- Generic Function: sockets:send-to socket buffer &rest args &key start end remote-filename flags remote-host remote-port ipv6 &allow-other-keys Send the contents of `buffer' to `socket'. `buffer' must be a vector that can be coerced to a (SIMPLE-ARRAY (UNSIGNED-BYTE 8) (*)). `start' and `end' are used a bounding index on `buffer'. For disconnected datagram sockets, `remote-host' and `remote-port' or `remote-filename' are used as destination for the data. Some flags can also be passed to sendto(2): * `:out-of-band' for receiving out-of-band data `-' only for stream sockets * `:dont-wait' for making only the current call non-blocking * `:dont-route' for sending only to hosts on directly connected networks, not using gateways * `:confirm' for signalling progress on the link layer `-' only available on Linux and only with `datagram' sockets * `:more' for telling the kernel that there is more data to send `-' only available on Linux Returns the number of bytes sent. -- Generic Function: sockets:receive-from socket &rest args &key flags end start buffer size &allow-other-keys Receives data from `socket'. If `buffer' is specified `start' and `end' are used as bounding index. In that case `buffer' must be an array and its `array-element-type' be either (UNSIGNED-BYTE 8) or `t'. If `buffer' is not specified an (UNSIGNED-BYTE 8) buffer of size `size' will be allocated. Some flags can also be passed to recvfrom(2): * `:out-of-band' for receiving out-of-band data `-' only for `stream' sockets * `:peek' for keeping the returned data in the kernel buffers * `:wait-all' for waiting until the entire buffer can be filled * `:dont-wait' for making only the current call non-blocking The first two values returned are the buffer and the number of elements that have been copied into the buffer. For `internet' `datagram' sockets, two additional values are returned: the host and port of the remote peer from which the data was received. For `local' `datagram' sockets, one additional values is returned: the filename of the remote peer from which the data was received. -- Generic Function: sockets:bind-address socket address &key reuse-address port &allow-other-keys Sets the local address of `socket' to ADDRESS(and `port' for `internet' sockets). `reuse-address' sets the SO_REUSEADDR socket option on `socket'. -- Generic Function: sockets:listen-on socket &key backlog &allow-other-keys Start allowing incoming connections on `socket'. `backlog' specifies the maximum length of the queue of pending connections. -- Generic Function: sockets:accept-connection passive-socket &key timeout wait output-buffer-size input-buffer-size external-format &allow-other-keys Returns one connection from the queue of pending connections on `socket'. If `wait' is true, waits until a connection is received or `timeout' expires in which case returns `nil'. If `wait' is false and there are no pending connections return `nil'. `external-format' optionally specifies the external format of the new socket `-' the default being that of `socket'. Buffer sizes for the new socket can also be specified using `input-buffer-size' and `output-buffer-size'. -- Macro: sockets:with-accept-connection (var passive-socket &rest args) &body body Bind `var' to a socket created by passing `passive-socket' and `args' to `accept-connection' and execute `body' as implicit `progn'. The socket is automatically closed upon exit. -- Generic Function: sockets:connect socket address &key port wait timeout &allow-other-keys Connects `socket' to `address'. For `internet' sockets you can specify the port to connect to using keyword argument `port'. The default value of `port' is 0, which usually means letting the `os' choose a random port to connect to. For `internet' sockets, if `wait' is true and a connection cannot be established within `timeout' seconds signal `iomux:poll-timeout', but it works only with non-blocking sockets. -- Generic Function: sockets:disconnect socket Disassociates `socket' from any remote address. Works only on `datagram' sockets. -- Generic Function: sockets:shutdown socket &key read write Shut down all or part of a connection. If `read' it non-NIL, further receptions are disallowed; if `write' is non-NIL, further transmissions are disallowed. `close' must still be called on `socket' in order to release `os' resources. -- Generic Function: sockets:send-file-descriptor socket file-descriptor Send `file-descriptor' through `socket'. The receiving process must use `receive-file-descriptor' to receive the file descriptor in order for it to be valid in the receiving process. -- Generic Function: sockets:receive-file-descriptor socket Receive a file descriptor as ancillary data through `socket'. 2.2.3 Socket Accessors ---------------------- -- Generic Function: sockets:socket-os-fd socket Returns the `os' file descriptor of `socket'. -- Generic Function: sockets:socket-type socket Returns the socket type of `socket' `-' `:stream' or `:datagram'. -- Generic Function: sockets:socket-protocol object Return the protocol of a socket. -- Generic Function: sockets:socket-address-family object Return the address family of a socket. -- Generic Function: sockets:local-name socket For `internet' sockets, returns two values: the local host and the local port. For `local' sockets, returns the local filename. -- Generic Function: sockets:local-host socket Returns the local host of `socket'. Works only on `internet' sockets. -- Generic Function: sockets:local-port socket Returns the local port of `socket' `-' an (UNSIGNED-BYTE 16). Works only on `internet' sockets. -- Generic Function: sockets:local-filename socket Returns the local filename of `socket'. Works only on `local' sockets. -- Generic Function: sockets:remote-name socket For `internet' sockets, returns two values: the remote host and the remote port. For `remote' sockets, returns the remote filename. -- Generic Function: sockets:remote-host socket Returns the remote host of `socket'. Works only on `internet' sockets. -- Generic Function: sockets:remote-port socket Returns the remote port of `socket' `-' an (UNSIGNED-BYTE 16). Works only on `internet' sockets. -- Generic Function: sockets:remote-filename socket Returns the remote filename of `socket'. Works only on `local' sockets. 2.2.4 Socket Predicates ----------------------- -- Generic Function: sockets:socket-open-p socket Returns a boolean indicating whether or not the file descriptor of `socket' is open. -- Generic Function: sockets:socket-connected-p socket Returns a boolean specifying whether or not `socket' is connected. -- Function: sockets:socket-ipv6-p socket Return `t' if `socket' is an AF_INET6 socket. 2.2.5 Socket Options -------------------- 2.3 Socket Addresses ==================== 2.3.1 Address Objects --------------------- 2.3.1.1 Classes ............... -- Class: sockets:address Class precedence list: `address, standard-object, t' Base class for all socket address classes. -- Class: sockets:inet-address Class precedence list: `inet-address, address, standard-object, t' Base class for IPv4 and IPv6 addresses. -- Class: sockets:ipv4-address Class precedence list: `ipv4-address, inet-address, address, standard-object, t' IPv4 address. Its low-level representation can be accessed as vector of type IPV4-ARRAY through the `address-name' reader. -- Class: sockets:ipv6-address Class precedence list: `ipv6-address, inet-address, address, standard-object, t' IPv6 address. Its low-level representation can be accessed as vector of type IPV6-ARRAY through the `address-name' reader. -- Class: sockets:local-address Class precedence list: `local-address, address, standard-object, t' `unix' socket address. 2.3.1.2 Functions ................. -- Function: sockets:make-address name Constructs an `address' object. `name' should be of type IPV4-ARRAY, IPV6-ARRAY or `string' in which case an instance of IPV4-ADDRESS, IPV6-ADDRESS or `local-address', respectively, will be created. Otherwise, a `type-error' is signalled. See also `ensure-address'. -- Generic Function: sockets:copy-address address Returns a copy of `address' which is ADDRESS= to the original. -- Function: sockets:ensure-address address &key family abstract errorp If `family' is `:local', a `local-address' is instantiated with `address' as its `name' slot. If `family' is `:internet', an appropriate subtype of `inet-address' is instantiated after guessing the address type through `address-to-vector'. If the address is invalid and `errorp' is not `nil', then a `cl:parse-error' is signalled, otherwise `nil' is returned. When `address' is already an instance of the `address' class, a check is made to see if it matches the `family' argument and it is returned unmodified. -- Generic Function: sockets:address-to-string address Returns a textual presentation of `address'. -- Function: sockets:address-to-vector address Convert any representation of an internet address to a vector. Allowed inputs are: unsigned 32-bit integers, strings, vectors and `inet-address' objects. If the address is valid, two values are returned: the vector and the address type (:IPV4 or IPV6), otherwise `nil' is returned. 2.3.1.3 Constants ................. -- Constant: sockets:+ipv4-loopback+ Loopback IPv4 address. (127.0.0.1) -- Constant: sockets:+ipv4-unspecified+ Unspecified IPv4 address. (0.0.0.0) -- Constant: sockets:+ipv6-interface-local-all-nodes+ Interface local all nodes address. (ff01::1) -- Constant: sockets:+ipv6-interface-local-all-routers+ Interface local all routers address. (ff01::2) -- Constant: sockets:+ipv6-link-local-all-nodes+ Link local all nodes address. (ff02::1) -- Constant: sockets:+ipv6-link-local-all-routers+ Link local all routers address. (ff02::2) -- Constant: sockets:+ipv6-loopback+ Loopback IPv6 address. (::1) -- Constant: sockets:+ipv6-site-local-all-routers+ Site local all routers address. (ff05::2) -- Constant: sockets:+ipv6-unspecified+ Unspecified IPv6 address. (::) 2.3.2 Address Predicates ------------------------ -- Function: sockets:addressp address Returns `t' if `address' is an object of class `address'. Does not return `t' for other low-level address representations. -- Generic Function: sockets:address= addr1 addr2 Returns `t' if both arguments are the same socket address. -- Function: sockets:address-equal-p addr1 addr2 &optional family Returns `t' if both arguments are designators for the same socket address. -- Function: sockets:ipv4-address-p address Returns `t' if `address' is an IPv4 address object. -- Function: sockets:ipv6-address-p address Returns `t' if `address' is an IPv6 address object. -- Function: sockets:local-address-p address Returns `t' if `address' is a local address object. -- Generic Function: sockets:abstract-address-p object Return `t' if `address' is a `local-address' that lives in the abstract namespace. -- Generic Function: sockets:address-type address Returns a keyword symbol denoting the kind of `address' (:IPV4, :IPV6 or :LOCAL). If `address' is not a known address object, `nil' is returned. -- Generic Function: sockets:inet-address-loopback-p address Returns `t' if `address' is a loopback internet address. -- Generic Function: sockets:inet-address-multicast-p address Returns `t' if `address' is an multicast internet address. -- Generic Function: sockets:inet-address-type address Returns the address type of `address' as 2 values: * protocol, one of :IPV4 or :IPV6 * kind, one of `:unspecified', `:loopback', `:multicast' or `:unicast' For unicast or multicast IPv6 addresses, a third value is returned which corresponds to the return value of IPV6-UNICAST-TYPE or IPV6-MULTICAST-TYPE, respectively. -- Generic Function: sockets:inet-address-unicast-p address Returns `t' if `address' is an unicast internet address. -- Generic Function: sockets:inet-address-unspecified-p addr Returns `t' if `addr' is an "unspecified" internet address. -- Function: sockets:ipv6-admin-local-multicast-p address Returns `t' if `address' is a admin-local multicast IPv6 address. -- Function: sockets:ipv6-global-multicast-p address Returns `t' if `address' is a global multicast IPv6 address. -- Function: sockets:ipv6-global-unicast-p address Returns `t' if `address' is an global unicasst IPv6 address. -- Function: sockets:ipv6-interface-local-multicast-p address Returns `t' if `address' is an interface-local IPv6 address. -- Function: sockets:ipv6-ipv4-mapped-p address Returns `t' if `address' is an IPv6 address representing an IPv4 mapped address. -- Function: sockets:ipv6-link-local-multicast-p address Returns `t' if `address' is a link-local IPv6 address. -- Function: sockets:ipv6-link-local-unicast-p address Returns `t' if `address' is an link-local unicast IPv6 address. -- Function: sockets:ipv6-multicast-type address Returns the multicast type of `address' or `nil' if it's not a multicast address. -- Function: sockets:ipv6-organization-local-multicast-p address Returns `t' if `address' is an organization-local multicast IPv6 address. -- Function: sockets:ipv6-reserved-multicast-p address Returns `t' if `address' is a reserved multicast IPv6 address. -- Function: sockets:ipv6-site-local-multicast-p address Returns `t' if `address' is an site-local multicast IPv6 address. -- Function: sockets:ipv6-site-local-unicast-p address Returns `t' if `address' is an site-local unicast IPv6 address. -- Function: sockets:ipv6-solicited-node-multicast-p address Returns `t' if `address' is a solicited-node multicast IPv6 address. -- Function: sockets:ipv6-transient-multicast-p address Returns `t' if `address' is a transient multicast IPv6 address. -- Function: sockets:ipv6-unassigned-multicast-p address Returns `t' if `address' is an unassigned multicast IPv6 address. -- Function: sockets:ipv6-unicast-type address Returns the unicast type of `address' or `nil' if it's not a unicast address. 2.3.3 Address Arithmetic ------------------------ -- Function: sockets:make-netmask &key cidr class Create a subnet mask by specifying either its class(:A, `:b' or :C) or a `cidr' suffix(a number between 0 and 32). -- Function: sockets:ensure-netmask thing If `thing' is of type IPV4-ADDRESS it is returned as is; if keyword it must be one of `:a', `:b' or `:c' otherwise it's treated as a `cidr' suffix. -- Generic Function: sockets:inet-address-network-portion address netmask Apply network netmask `netmask' to `address' in order to calculate the network part of `address'. -- Generic Function: sockets:inet-address-host-portion address netmask Apply network netmask `netmask' to `address' in order to calculate the host part of `address'. -- Generic Function: sockets:inet-address-in-network-p address network Return `t' if `address' is part of the subnet specified by `network'. -- Generic Function: sockets:inet-addresses-in-same-network-p address1 address2 network Return `t' if ADDRESS1 and ADDRESS2 are both part part of the subnet specified by `network'. -- Generic Function: sockets:inet-address-network-class address Return the network class of `address:' one of `:a', `:b', `:c', `:d' or `:e' . -- Generic Function: sockets:inet-address-private-p address Returns `t' if `address' is in a private network range. Private IPv4 networks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. See http://en.wikipedia.org/wiki/Private_network for details. 2.3.4 Low-level Address Manipulation ------------------------------------ -- Constant: sockets:+max-ipv4-value+ Integer denoting 255.255.255.255 -- Function: sockets:dotted-to-integer address Convert a dotted IPv4 address to an (UNSIGNED-BYTE 32). -- Function: sockets:integer-to-dotted integer Convert an (UNSIGNED-BYTE 32) IPv4 address to a dotted string. -- Function: sockets:vector-to-integer vector Convert a vector to a 32-bit unsigned integer. -- Function: sockets:integer-to-vector ipaddr Convert a 32-bit unsigned integer to a vector. -- Function: sockets:dotted-to-vector address Convert a dotted IPv4 address to a (SIMPLE-ARRAY (UNSIGNED-BYTE 8) 4). -- Function: sockets:vector-to-dotted vector Convert an 4-element vector to a dotted string. -- Function: sockets:colon-separated-to-vector string Convert a colon-separated IPv6 address to a (SIMPLE-ARRAY (UNSIGNED-BYTE 16) 8). -- Function: sockets:vector-to-colon-separated vector &optional case Convert an (SIMPLE-ARRAY (UNSIGNED-BYTE 16) 8) to a colon-separated IPv6 address. `case' may be `:downcase' or `:upcase'. -- Function: sockets:string-address-to-vector address Convert a string address (dotted or colon-separated) to a vector address. If the string is not a valid address, return `nil'. -- Function: sockets:map-ipv4-address-to-ipv6 address Returns an IPv6 address by mapping `address' onto it. -- Function: sockets:map-ipv6-address-to-ipv4 address Extracts the IPv4 part of an IPv6-mapped IPv4 address. Signals an error if `address' is not an IPv6-mapped IPv4 address. 2.4 DNS ======= 2.4.1 Functions --------------- -- Function: sockets:lookup-hostname host &key ipv6 Looks up a host by name or address. IPV6 determines the IPv6 behaviour, defaults to *IPV6*. Returns 4 values: * an address * a list of additional addresses(if existent) * the canonical name of the host * an alist of all the host's names with their respective addresses -- Function: sockets:ensure-hostname address &key ipv6 errorp If `address' is an inet-address designator, it is converted, if necessary, to an `inet-address' object and returned. Otherwise it is assumed to be a host name which is then looked up in order to return its primary address as the first return value and the remaining address list as the second return value. 2.4.2 Conditions ---------------- -- Condition: sockets:resolver-error Class precedence list: `resolver-error, condition, t' Signaled when an error occurs while trying to resolve an address. -- Generic Function: sockets:resolver-error-datum condition Return the datum that caused the signalling of a `resolver-error' condition. -- Condition: sockets:resolver-again-error Class precedence list: `resolver-again-error, resolver-error, condition, t' Condition signaled when a temporary failure occurred. -- Condition: sockets:resolver-fail-error Class precedence list: `resolver-fail-error, resolver-error, condition, t' Condition signaled when a non-recoverable error occurred. -- Condition: sockets:resolver-no-name-error Class precedence list: `resolver-no-name-error, resolver-error, condition, t' Condition signaled when a host or service was not found. -- Condition: sockets:resolver-unknown-error Class precedence list: `resolver-unknown-error, resolver-error, condition, t' Condition signaled when an unknown error is signaled while resolving an address. 2.5 Services ============ -- Function: sockets:lookup-service service &optional protocol Lookup a service by port or name. `protocol' should be one of `:tcp', `:udp' or `:any'. -- Condition: sockets:unknown-service Class precedence list: `unknown-service, condition, t' Condition raised when a network service is not found. -- Generic Function: sockets:unknown-service-datum condition Return the datum that caused the signalling of an `unknown-service' condition. 2.6 Protocols ============= -- Function: sockets:lookup-protocol protocol Lookup a protocol by name or number. Signals an `unknown-protocol' error if no protocol is found. -- Condition: sockets:unknown-protocol Class precedence list: `unknown-protocol, condition, t' Condition raised when a network protocol is not found. -- Generic Function: sockets:unknown-protocol-datum condition Return the datum that caused the signalling of an `unknown-protocol' condition. 2.7 Network Interfaces ====================== -- Function: sockets:interface-index interface Return the `os' index of a network interface. -- Function: sockets:interface-name interface Return the name of an network interface. -- Function: sockets:make-interface name index Constructor for `interface' objects. -- Function: sockets:lookup-interface interface Lookup an interface by name or index. `unknown-interface' is signalled if an interface is not found. -- Function: sockets:list-network-interfaces Returns a list of network interfaces currently available. -- Condition: sockets:unknown-interface Class precedence list: `unknown-interface, enxio, syscall-error, iolib-error, error, serious-condition, iolib-condition, condition, t' Condition raised when a network interface is not found. -- Generic Function: sockets:unknown-interface-datum condition Return the datum that caused the signalling of an `unknown-interface' condition. Index ***** sockets:abstract-address-p: See 2.3.2. (line 619) sockets:accept-connection: See 2.2.2. (line 384) sockets:active-socket: See 2.2.1. (line 108) sockets:address: See 2.3.1.1. (line 502) sockets:address-equal-p: See 2.3.2. (line 606) sockets:address-to-string: See 2.3.1.2. (line 556) sockets:address-to-vector: See 2.3.1.2. (line 559) sockets:address-type: See 2.3.2. (line 623) sockets:address=: See 2.3.2. (line 603) sockets:addressp: See 2.3.2. (line 599) sockets:bind-address: See 2.2.2. (line 372) sockets:colon-separated-to-vector: See 2.3.4. (line 769) sockets:connect: See 2.2.2. (line 401) sockets:copy-address: See 2.3.1.2. (line 541) sockets:datagram-socket: See 2.2.1. (line 87) sockets:disconnect: See 2.2.2. (line 410) sockets:dotted-to-integer: See 2.3.4. (line 750) sockets:dotted-to-vector: See 2.3.4. (line 762) sockets:ensure-address: See 2.3.1.2. (line 544) sockets:ensure-hostname: See 2.4.1. (line 807) sockets:ensure-netmask: See 2.3.3. (line 712) sockets:inet-address: See 2.3.1.1. (line 507) sockets:inet-address-host-portion: See 2.3.3. (line 722) sockets:inet-address-in-network-p: See 2.3.3. (line 726) sockets:inet-address-loopback-p: See 2.3.2. (line 628) sockets:inet-address-multicast-p: See 2.3.2. (line 631) sockets:inet-address-network-class: See 2.3.3. (line 735) sockets:inet-address-network-portion: See 2.3.3. (line 718) sockets:inet-address-private-p: See 2.3.3. (line 739) sockets:inet-address-type: See 2.3.2. (line 634) sockets:inet-address-unicast-p: See 2.3.2. (line 646) sockets:inet-address-unspecified-p: See 2.3.2. (line 649) sockets:inet-addresses-in-same-network-p: See 2.3.3. (line 731) sockets:integer-to-dotted: See 2.3.4. (line 753) sockets:integer-to-vector: See 2.3.4. (line 759) sockets:interface-index: See 2.7. (line 886) sockets:interface-name: See 2.7. (line 889) sockets:internet-socket: See 2.2.1. (line 94) sockets:ipv4-address: See 2.3.1.1. (line 512) sockets:ipv4-address-p: See 2.3.2. (line 610) sockets:ipv6-address: See 2.3.1.1. (line 519) sockets:ipv6-address-p: See 2.3.2. (line 613) sockets:ipv6-admin-local-multicast-p: See 2.3.2. (line 652) sockets:ipv6-global-multicast-p: See 2.3.2. (line 655) sockets:ipv6-global-unicast-p: See 2.3.2. (line 658) sockets:ipv6-interface-local-multicast-p: See 2.3.2. (line 661) sockets:ipv6-ipv4-mapped-p: See 2.3.2. (line 664) sockets:ipv6-link-local-multicast-p: See 2.3.2. (line 668) sockets:ipv6-link-local-unicast-p: See 2.3.2. (line 671) sockets:ipv6-multicast-type: See 2.3.2. (line 674) sockets:ipv6-organization-local-multicast-p: See 2.3.2. (line 678) sockets:ipv6-reserved-multicast-p: See 2.3.2. (line 682) sockets:ipv6-site-local-multicast-p: See 2.3.2. (line 685) sockets:ipv6-site-local-unicast-p: See 2.3.2. (line 688) sockets:ipv6-solicited-node-multicast-p: See 2.3.2. (line 691) sockets:ipv6-transient-multicast-p: See 2.3.2. (line 695) sockets:ipv6-unassigned-multicast-p: See 2.3.2. (line 698) sockets:ipv6-unicast-type: See 2.3.2. (line 701) sockets:list-network-interfaces: See 2.7. (line 899) sockets:listen-on: See 2.2.2. (line 378) sockets:local-address: See 2.3.1.1. (line 526) sockets:local-address-p: See 2.3.2. (line 616) sockets:local-filename: See 2.2.3. (line 456) sockets:local-host: See 2.2.3. (line 448) sockets:local-name: See 2.2.3. (line 444) sockets:local-port: See 2.2.3. (line 452) sockets:local-socket: See 2.2.1. (line 101) sockets:lookup-hostname: See 2.4.1. (line 795) sockets:lookup-interface: See 2.7. (line 895) sockets:lookup-protocol: See 2.6. (line 870) sockets:lookup-service: See 2.5. (line 854) sockets:make-address: See 2.3.1.2. (line 534) sockets:make-interface: See 2.7. (line 892) sockets:make-netmask: See 2.3.3. (line 708) sockets:make-socket: See 2.2.2. (line 206) sockets:make-socket-from-fd: See 2.2.2. (line 303) sockets:make-socket-pair: See 2.2.2. (line 313) sockets:map-ipv4-address-to-ipv6: See 2.3.4. (line 782) sockets:map-ipv6-address-to-ipv4: See 2.3.4. (line 785) sockets:passive-socket: See 2.2.1. (line 120) sockets:receive-file-descriptor: See 2.2.2. (line 426) sockets:receive-from: See 2.2.2. (line 347) sockets:remote-filename: See 2.2.3. (line 473) sockets:remote-host: See 2.2.3. (line 465) sockets:remote-name: See 2.2.3. (line 460) sockets:remote-port: See 2.2.3. (line 469) sockets:resolver-again-error: See 2.4.2. (line 826) sockets:resolver-error: See 2.4.2. (line 817) sockets:resolver-error-datum: See 2.4.2. (line 822) sockets:resolver-fail-error: See 2.4.2. (line 832) sockets:resolver-no-name-error: See 2.4.2. (line 838) sockets:resolver-unknown-error: See 2.4.2. (line 844) sockets:send-file-descriptor: See 2.2.2. (line 421) sockets:send-to: See 2.2.2. (line 322) sockets:shutdown: See 2.2.2. (line 414) sockets:socket: See 2.2.1. (line 74) sockets:socket-address-family: See 2.2.3. (line 441) sockets:socket-connected-p: See 2.2.4. (line 484) sockets:socket-datagram-internet-active: See 2.2.1. (line 173) sockets:socket-datagram-local-active: See 2.2.1. (line 187) sockets:socket-ipv6-p: See 2.2.4. (line 487) sockets:socket-open-p: See 2.2.4. (line 480) sockets:socket-os-fd: See 2.2.3. (line 432) sockets:socket-protocol: See 2.2.3. (line 438) sockets:socket-stream-internet-active: See 2.2.1. (line 127) sockets:socket-stream-internet-passive: See 2.2.1. (line 141) sockets:socket-stream-local-active: See 2.2.1. (line 150) sockets:socket-stream-local-passive: See 2.2.1. (line 164) sockets:socket-type: See 2.2.3. (line 435) sockets:stream-socket: See 2.2.1. (line 80) sockets:string-address-to-vector: See 2.3.4. (line 778) sockets:unknown-interface: See 2.7. (line 902) sockets:unknown-interface-datum: See 2.7. (line 909) sockets:unknown-protocol: See 2.6. (line 874) sockets:unknown-protocol-datum: See 2.6. (line 879) sockets:unknown-service: See 2.5. (line 858) sockets:unknown-service-datum: See 2.5. (line 863) sockets:vector-to-colon-separated: See 2.3.4. (line 773) sockets:vector-to-dotted: See 2.3.4. (line 766) sockets:vector-to-integer: See 2.3.4. (line 756) sockets:with-accept-connection: See 2.2.2. (line 395) sockets:with-open-socket: See 2.2.2. (line 296)