ADDRESS-EQUAL-P (ADDR1 ADDR2 &OPTIONAL (FAMILY INTERNET))
Returns T if both arguments are designators for the same socket 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.
Returns T if ADDRESS is an object of class ADDRESS. Does not return T for other low-level address representations.
Convert a colon-separated IPv6 address to a (SIMPLE-ARRAY (UNSIGNED-BYTE 16) 8).
Convert a dotted IPv4 address to an (UNSIGNED-BYTE 32).
Convert a dotted IPv4 address to a (SIMPLE-ARRAY (UNSIGNED-BYTE 8) 4).
ENSURE-ADDRESS (ADDRESS &KEY (FAMILY INTERNET) ABSTRACT (ERRORP T))
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.
ENSURE-HOSTNAME (ADDRESS &KEY (IPV6 *IPV6*) (ERRORP T))
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.
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.
FD-READY-P (FD &OPTIONAL (EVENT-TYPE INPUT))
Tests file-descriptor `FD' for I/O readiness. `EVENT-TYPE' must be either :INPUT, :OUTPUT or :IO .
Returns T if ADDRESS is an Inet address object.
Convert an (UNSIGNED-BYTE 32) IPv4 address to a dotted string.
Convert a 32-bit unsigned integer to a vector.
Return the OS index of a network interface.
Return the name of an network interface.
Returns T if ADDRESS is an IPv4 address object.
Returns T if ADDRESS is an IPv6 address object.
Returns T if ADDRESS is a admin-local multicast IPv6 address.
Returns T if ADDRESS is a global multicast IPv6 address.
Returns T if ADDRESS is an global unicasst IPv6 address.
Returns T if ADDRESS is an interface-local IPv6 address.
Returns T if ADDRESS is an IPv6 address representing an IPv4 mapped address.
Returns the multicast type of ADDRESS or NIL if it's not a multicast address.
Returns T if ADDRESS is an organization-local multicast IPv6 address.
Returns T if ADDRESS is a reserved multicast IPv6 address.
Returns T if ADDRESS is an site-local multicast IPv6 address.
Returns T if ADDRESS is an site-local unicast IPv6 address.
Returns T if ADDRESS is a solicited-node multicast IPv6 address.
Returns T if ADDRESS is a transient multicast IPv6 address.
Returns T if ADDRESS is an unassigned multicast IPv6 address.
Returns the unicast type of ADDRESS or NIL if it's not a unicast address.
Returns a list of network interfaces currently available.
Returns T if ADDRESS is a local address object.
LOOKUP-HOSTNAME (HOST &KEY (IPV6 *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
Lookup an interface by name or index. UNKNOWN-INTERFACE is signalled if an interface is not found.
Lookup a protocol by name or number. Signals an UNKNOWN-PROTOCOL error if no protocol is found.
LOOKUP-SERVICE (SERVICE &OPTIONAL (PROTOCOL TCP))
Lookup a service by port or name. PROTOCOL should be one of :TCP, :UDP or :ANY.
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.
MAKE-INTERFACE (NAME INDEX)
Constructor for INTERFACE objects.
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).
Returns an IPv6 address by mapping ADDRESS onto it.
Extracts the IPv4 part of an IPv6-mapped IPv4 address. Signals an error if ADDRESS is not an IPv6-mapped IPv4 address.
Return T if SOCKET is an AF_INET6 socket.
Convert a string address (dotted or colon-separated) to a vector address. If the string is not a valid address, return NIL.
VECTOR-TO-COLON-SEPARATED (VECTOR &OPTIONAL (CASE DOWNCASE))
Convert an (SIMPLE-ARRAY (UNSIGNED-BYTE 16) 8) to a colon-separated IPv6 address. CASE may be :DOWNCASE or :UPCASE.
Convert an 4-element vector to a dotted string.
Convert a vector to a 32-bit unsigned integer.
WAIT-UNTIL-FD-READY (FILE-DESCRIPTOR EVENT-TYPE &OPTIONAL TIMEOUT ERRORP)
Poll file descriptor `FILE-DESCRIPTOR' for I/O readiness. `EVENT-TYPE' must be either :INPUT, :OUTPUT or :IO. `TIMEOUT' must be either a non-negative integer measured in seconds, or `NIL' meaning no timeout at all. If `ERRORP' is not NIL and a timeout occurs, then a condition of type `POLL-TIMEOUT' is signaled. Returns two boolean values indicating readability and writeability of `FILE-DESCRIPTOR'.
IPV6-SOCKET-P (&REST ARGS)
LOOKUP-HOST (&REST ARGS)
READ-SEQUENCE* (STREAM SEQUENCE &KEY (START 0) END)
WRITE-SEQUENCE* (STREAM SEQUENCE &KEY (START 0) END)
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.
WITH-EVENT-BASE ((VAR &REST INITARGS) &BODY BODY)
Binds VAR to a new EVENT-BASE, instantiated with INITARGS, within the extent of BODY. Closes VAR.
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.
ACCEPT-CONNECTION (PASSIVE-SOCKET &KEY (WAIT T) OUTPUT-BUFFER-SIZE INPUT-BUFFER-SIZE EXTERNAL-FORMAT &ALLOW-OTHER-KEYS)
Extracts the first connection from the queue of pending connections on SOCKET. WAIT specifies how long to wait for a connection: NIL means "return immediately", a non-negative real specifies a timeout in seconds and T means "wait forever". 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. If a connection is received, returns two values: the newly created socket and the remote host address.
Returns a textual presentation of 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.
ADDRESS= (ADDR1 ADDR2)
Returns T if both arguments are the same socket address.
BIND-ADDRESS (SOCKET ADDRESS &KEY (REUSE-ADDRESS T) (PORT 0) &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.
CONNECT (SOCKET ADDRESS &KEY (WAIT T) (PORT 0) &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. WAIT specifies how long to wait for a connection: NIL means "return immediately", a non-negative real specifies a timeout in seconds and T means "wait forever".
Returns a copy of ADDRESS which is ADDRESS= to the original.
Disassociates SOCKET from any remote address. Works only on DATAGRAM sockets.
DRAIN-INPUT-BUFFER (STREAM SEQUENCE &KEY START END (START 0))
SETFEXTERNAL-FORMAT-OF (EXTERNAL-FORMAT STREAM)
INET-ADDRESS-HOST-PORTION (ADDRESS NETMASK)
Apply network netmask NETMASK to ADDRESS in order to calculate the host part of ADDRESS.
INET-ADDRESS-IN-NETWORK-P (ADDRESS NETWORK)
Return T if ADDRESS is part of the subnet specified by NETWORK.
Returns T if ADDRESS is a loopback internet address.
Returns T if ADDRESS is an multicast internet address.
Return the network class of ADDRESS: one of :A, :B, :C, :D or :E .
INET-ADDRESS-NETWORK-PORTION (ADDRESS NETMASK)
Apply network netmask NETMASK to ADDRESS in order to calculate the network part of 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.
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.
Returns T if ADDRESS is an unicast internet address.
Returns T if ADDR is an "unspecified" internet address.
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.
IPV4-NETWORK= (NET1 NET2)
Returns T if the addresses and the netmasks of the two arguments are respectively ADDRESS=.
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.
Returns the local filename of SOCKET. Works only on LOCAL sockets.
Returns the local host of SOCKET. Works only on INTERNET sockets.
For INTERNET sockets, returns two values: the local host and the local port. For LOCAL sockets, returns the local filename.
Returns the local port of SOCKET - an (UNSIGNED-BYTE 16). Works only on INTERNET sockets.
MAKE-SOCKET (&KEY ADDRESS-FAMILY TYPE CONNECT IPV6 EXTERNAL-FORMAT (ADDRESS-FAMILY INTERNET) (TYPE STREAM) (CONNECT ACTIVE) (IPV6 *IPV6*) (EXTERNAL-FORMAT DEFAULT) &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
MAKE-SOCKET-FROM-FD (FD &KEY CONNECT EXTERNAL-FORMAT INPUT-BUFFER-SIZE OUTPUT-BUFFER-SIZE (CONNECT ACTIVE) (EXTERNAL-FORMAT DEFAULT))
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.
MAKE-SOCKET-PAIR (&KEY TYPE PROTOCOL EXTERNAL-FORMAT INPUT-BUFFER-SIZE OUTPUT-BUFFER-SIZE (TYPE STREAM) (PROTOCOL DEFAULT) (EXTERNAL-FORMAT DEFAULT))
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.
Receive a file descriptor as ancillary data through SOCKET.
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.
Returns the remote filename of SOCKET. Works only on LOCAL sockets.
Returns the remote host of SOCKET. Works only on INTERNET sockets.
For INTERNET sockets, returns two values: the remote host and the remote port. For REMOTE sockets, returns the remote filename.
Returns the remote port of SOCKET - an (UNSIGNED-BYTE 16). Works only on INTERNET sockets.
Return the datum that caused the signalling of a RESOLVER-ERROR condition.
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.
SEND-TO (SOCKET BUFFER &REST ARGS &KEY (START 0) END REMOTE-FILENAME FLAGS REMOTE-HOST (REMOTE-PORT 0) (IPV6 *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.
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.
Returns a boolean specifying whether or not SOCKET is connected.
Returns a boolean indicating whether or not the file descriptor of SOCKET is open.
SOCKET-OPTION (SOCKET OPTION-NAME)
Returns the value(s) of OS option OPTION-NAME on SOCKET. For a complete list of supported options see src/sockets/socket-options.lisp.
Returns the OS file descriptor of SOCKET.
Returns the socket type of SOCKET - :STREAM or :DATAGRAM.
Return the datum that caused the signalling of an UNKNOWN-INTERFACE condition.
Return the datum that caused the signalling of an UNKNOWN-PROTOCOL condition.
Return the datum that caused the signalling of an UNKNOWN-SERVICE condition.
ADD-TIMER (EVENT-BASE FUNCTION TIMEOUT &KEY ONE-SHOT)
EVENT-DISPATCH (EVENT-BASE &KEY ONE-SHOT TIMEOUT MIN-STEP MAX-STEP)
EXIT-EVENT-LOOP (EVENT-BASE &KEY DELAY (DELAY 0))
SETFFD-NON-BLOCKING (MODE FD-MIXIN)
REMOVE-FD-HANDLERS (EVENT-BASE FD &KEY READ WRITE ERROR)
REMOVE-TIMER (EVENT-BASE TIMER)
SET-ERROR-HANDLER (EVENT-BASE FD FUNCTION)
SET-IO-HANDLER (EVENT-BASE FD EVENT-TYPE FUNCTION &KEY TIMEOUT ONE-SHOT)
SETFFD-OF (NEW-VALUE OBJECT)
SETFSOCKET-ADDRESS-FAMILY (NEW-VALUE OBJECT)
SETFSOCKET-PROTOCOL (NEW-VALUE OBJECT)
An alist of (PRIORITY . MULTIPLEXER). Smaller values mean higher priority.
Default length of the pending connections queue (soft limit).
Default linger timeout when enabling SO_LINGER option on a socket.
The default multiplexer for the current OS.
The current machine's domain.
List of the DNS nameservers to use.
A domain name to be appended to the name to be searched when the latter does not contain dots.
Specifies the default behaviour with respect to IPv6: - nil : Only IPv4 addresses are used. - :ipv6 : Only IPv6 addresses are used. - t : If both IPv4 and IPv6 addresses are found they are returned in the best order possible (see RFC 3484). Default value is NIL.
Mixin class for active(client) sockets.
Base class for all socket address classes.
Mixin for sockets of type SOCK_DGRAM.
Base class for IPv4 and IPv6 addresses.
Mixin for sockets of domain AF_INET or AF_INET6.
IPv4 address. Its low-level representation can be accessed as vector of type IPV4-ARRAY through the ADDRESS-NAME reader.
IPv4 network: an address plus a netmask.
IPv6 address. Its low-level representation can be accessed as vector of type IPV6-ARRAY through the ADDRESS-NAME reader.
UNIX socket address.
Mixin for sockets of domain AF_LOCAL.
Base class for I/O multiplexers.
Mixin class for PASSIVE(server) sockets.
Base class for sockets.
Class representing active sockets of type SOCK_DGRAM and domain AF_INET or AF_INET6.
Class representing active sockets of type SOCK_DGRAM and domain AF_LOCAL.
Class representing active sockets of type SOCK_STREAM and domain AF_INET or AF_INET6.
Class representing passive sockets of type SOCK_STREAM and domain AF_INET or AF_INET6.
Class representing active sockets of type SOCK_STREAM and domain AF_LOCAL.
Class representing passive sockets of type SOCK_STREAM and domain AF_LOCAL.
Mixin for sockets of type SOCK_STREAM.
Condition signaled when the underlying device of a stream is closed by the remote end while writing to it.
Condition signaled when UNREAD-CHAR is called on a stream either: 1) without having been preceded by a READ-CHAR, or 2) after a PEEK-CHAR
Signaled when an error occurs while polling for I/O readiness of a file descriptor.
Signaled when a timeout occurs while polling for I/O readiness of a file descriptor.
Condition signaled when a temporary failure occurred.
Signaled when an error occurs while trying to resolve an address.
Condition signaled when a non-recoverable error occurred.
Condition signaled when a host or service was not found.
Condition signaled when an unknown error is signaled while resolving an address.
Address already in use
Cannot assign requested address
Transport endpoint is already connected
Software caused connection abort
Connection reset by peer
Connection timed out
Cannot send after transport endpoint shutdown
Host is down
No route to host
Network is down
Network dropped connection on reset
Network is unreachable
No buffer space available
Machine is not on the network
Transport endpoint is not connected
Operation not supported
Protocol not available
Condition raised when a network interface is not found.
Condition raised when a network protocol is not found.
Condition raised when a network service is not found.
Loopback IPv4 address. (127.0.0.1)
Unspecified IPv4 address. (0.0.0.0)
Interface local all nodes address. (ff01::1)
Interface local all routers address. (ff01::2)
Loopback IPv6 address. (::1)
Site local all routers address. (ff05::2)
Unspecified IPv6 address. (::)
Integer denoting 255.255.255.255