lichat-protocol
1.4The independent protocol part of Lichat.
About Lichat-Protocol
This system specifies and implements the protocol of the Lichat chat system. It offers both verbal and programmatical descriptions of the protocol. If you are working with a Common Lisp system, you can use this system straight-away to process Lichat messages.
Protocol Specification
1. Wire Format
The wire format is based on UTF-8 character streams on which objects are serialised in a secure, simplified s-expression format. The format is as follows:
WIREABLE ::= OBJECT | STRING | SYMBOL | NUMBER
OBJECT ::= '(' WHITE* SYMBOL (WHITE+ KEYWORD WHITE+ EXPR)* WHITE* ')'
EXPR ::= STRING | LIST | SYMBOL | NUMBER
STRING ::= '"' ('\' ANY | !('"' | NULL))* '"'
LIST ::= '(' WHITE* (EXPR (WHITE+ EXPR)*)? WHITE* ')'
SYMBOL ::= KEYWORD | '#' ':' NAME | NAME ':' NAME
KEYWORD ::= ':' NAME
NUMBER ::= '0..9'+ ( '.' '0..9'*)? | '.' '0..9'*
NAME ::= (('\' ANY) | !(TERMINAL | NULL))+
TERMINAL ::= ('0..9' | ':' | ' ' | '"' | '.' | '(' | ')')
WHITE ::= U+0009 | U+000A | U+000B | U+000C | U+000D | U+0020
NULL ::= U+0000
ANY ::= !NULL
1.1 Symbols
Special care must be taken when reading and printing symbols. Symbols that come from the lichat-protocol
package must be printed without the package name prefix. Symbols from the keyword
package must be printed by their name only prefixed by a :
. Symbols without a package must be printed by their name only and prefixed by a #:
. Every other symbol must be prefixed by the symbol's package's name followed by a :
. When a symbol is read, it is checked whether it exists in the corresponding package laid out by the previous rules. If it does not exist, the expression is not valid and an error must be generated, but only after the expression has been read to completion.
1.2 Objects
Only Common Lisp objects of type wireable
can be serialised to the wire format. Special care must also be taken when wire-object
s are read from the wire. An error must be generated if the object is malformed by either a non-symbol in the first place of its list, imbalanced key/value pairs in the tail, or non-keywords in the key position. An error must also be generated if the symbol at the first position does not name a class that is a subclass of wire-object
. If it is a subclass of update
, the keys (and values) named :id
and :clock
must also be present, lest an error be generated.
1.3 Null Characters
Null characters (U+0000
) must not appear anywhere within a wireable. If a string were to contain null characters, they must be filtered out. If a symbol were to contain null characters, the message may not be put to the wire.
2. Server Objects
The server must keep track of a number of objects that are related to the current state of the chat system. The client may also keep track of some of these objects for its own convenience.
2.1 Connection
Each client is connected to the server through a connection
object. Each connection in turn is tied to a user object. A user may have up to an implementation-dependant number of connections at the same time.
2.2 User
user
s represent participants on the chat network. A user has a globally unique name and a number of connections that can act as the user. Each user can be active in a number of channels, the maximal number of which is implementation-dependant. A user must always inhabit the primary channel. A user may have a profile object associated with it. When such a profile exists, the user is considered to be "registered." The server itself must also have an associated user object, the name of which is up to the specific server instance.
2.2.1 User Name Constraints
A user's name must be between 1 and 32 characters long, where each character must be from the Unicode general categories Letter, Mark, Number, Punctuation, and Symbol, or be a Space (U+0020
). The name must not begin or end with
with Spaces (U+0020
).
2.3 Profile
The profile
primarily exists to allow end-users to log in to a user through a password and thus secure the username from being taken by others. A profile has a maximal lifetime. If the user associated with the profile has not been used for longer than the profile's lifetime, the profile is deleted.
2.3.1 Password Constraints
A profile's password must be at least 6 characters long. It may contain any kind of character that is not Null (U+0000
).
2.4 Channel
channel
s represent communication channels for users over which they can send messages to each other. A channel has a set of permission rules that constrain what kind of updates may be performed on the channel by whom. There are three types of channels that only differ in their naming scheme and their permissions.
2.4.1 Primary Channels
Exactly one of these must exist on any server, and it must be named the same as the server's user. All users that are currently connected to the server must inhabit this channel. The channel may not be used for sending messages by anyone except for system administrators or the server itself. The primary channel is also used for updates that are "channel-less," to check them for permissions.
2.4.2 Anonymous Channels
Anonymous channels must have a random name that is prefixed with an @
. Their permissions must prevent users that are not already part of the channel from sending join
, channels
, users
, or any other kind of update to it, thus essentially making it invisible safe for specially invited users.
2.4.3 Regular Channels
Any other channel is considered a "regular channel".
2.4.4 Channel Name Constraints
The names of channels are constrained in the same way as user names. See §2.2.1.
2.5 Permission Rules
A permission rule specifies the restrictions of an update type on who is allowed to perform the update on the channel. The structure is as follows:
RULE ::= (type EXPR*)
EXPR ::= COMPOUND | username | t | nil
COMPOUND ::= (not EXPR) | (or EXPR*) | (and EXPR*)
Where type
is the name of an update class, and username
is the name of a user object. t
is the CL symbol T
and indicates "anyone". nil
is the CL symbol NIL
and indicates "no one". The compound operators combine the expressions logically as sensible. The expressions within the rule are combined as by an or
compound.
3. General Interaction
The client and the server communicate through update
objects over a connection. Each such object that is issued from the client must contain a unique id
. This is important as the ID is reused by the server in order to communicate replies. The client can then compare the ID of the incoming updates to find the response to an earlier request, as responses may be reordered or delayed. The server does not check the ID in any way-- uniqueness and avoidance of clashing is the responsibility of the client. Each update must also contain a clock
slot that specifies the time of sending. This is used to calculate latency and potential connection problems.
When an update is sent to a channel, it is distributed to all the users currently in the channel. When an update is sent to a user, it is distributed to all the connections of the user. When an update is sent to a connection, it is serialised to the wire according to the above wire format specification. The actual underlying mechanism that transfers the characters of the wire format to the remote host is implementation-dependant.
3.1 Null Termination of Updates
Following each update that is put on the wire has to be a single null character (U+0000
). This character can be used to distinguish individual updates on the wire and may serve as a marker to attempt and stabilise the stream in case of malformed updates or other problems that might occur on the lower level.
4. Connection
4.1 Connection Establishment
After the connection between a client and a server has been established through some implementation-dependant means, the client must send a connect
update. The update will attempt to register the user on the server, as follows:
- If the server cannot sustain more connections, a
too-many-connections
update is returned and the connection is closed. - If the update's
version
denotes a version that is not compatible to the version of the protocol on the server, anincompatible-version
update is returned and the connection is closed. - If the update's
from
field contains an invalid name, abad-name
update is returned and the connection is closed. - If the update does not contain a
password
, and thefrom
field denotes a username that is already taken by an active user or a registered user, anusername-taken
update is returned and the connection is closed. - If the update does contain a
password
, and thefrom
field denotes a username that is not registered, ano-such-profile
update is returned and the connection is closed. - If the update does contain a
password
, and thefrom
field denotes a username that is registered, but whose password does not match the given one, aninvalid-password
update is returned and the connection is closed. - If the server cannot sustain more connections for the requested user, a
too-many-connections
update is returned and the connection is closed. - A user corresponding in name to the
from
field is created if it does not yet exist. - The connection is tied to its corresponding user object.
- The server responds with a
connect
update of the same id as the one the client sent. Thefrom
field must correspond to the server's user object's name. - If the user already existed, the server responds with
join
updates for each of the channels the user is currently inhabiting. - If the user did not already exist, it is joined to the primary channel.
4.2 Connection Maintenance
If the clock
of an update diverges too much from the one known by the server, the server may drop the connection after replying with a connection-unstable
update.
The server must receive an update on a connection within at least a certain implementation-dependant interval that must be larger than 100 seconds. If this does not happen, the server may assume a disconnection and drop the client after replying with a connection-unstable
update. If the server does not receive an update from the client within an interval of up to 60 seconds, the server must send a ping
update to the client, to which the client must respond with a pong
update. This is to ensure the stability of the connection.
If the client sends too many updates in too short a time interval, the server may start dropping updates, as long as it responds with a too-many-updates
update when it starts doing so. This throttling may be sustained for an implementation-dependant length of time. The client might send occasional ping
requests to figure out if the throttling has been lifted. The server may also close the connection if it deems the flooding too severe.
4.3 Connection Closure
A connection may be closed either due to a disconnect
update request from the client, or due to problems on the server side. When the connection is closed, the server must act as follows:
- The server responds with a
disconnect
update, if it still can. - The underlying connection between the client and the server is closed.
- The connection object is removed from the associated user object.
- If the user does not have any remaining connections, the user leaves all channels it inhabited.
The exceptional situation being during connection establishment. If the server decides to close the connection then, it may do so without responding with a disconnect
update and may immediately close the underlying connection.
5. Client Interaction
5.1 General Update Checks
An update is always checked as follows:
- If the update is not at all recognisable and cannot be parsed, a
malformed-update
update is sent back and the request is dropped. - If the update is too long (contains too many characters), a
update-too-long
update is sent back and the request is dropped. - If the class of the update is not known or not a subclass of
wire-object
, aninvalid-update
update is sent back and the request is dropped. - If the
from
,channel
, ortarget
fields contain an invalid name, abad-name
update is sent back and the request is dropped. - If the
from
field does not match the name known to the server by the user associated to the connection, ausername-mismatch
update is sent back and the request is dropped. - If the
channel
field denotes a channel that does not exist, but must, ano-such-channel
update is sent back and the request is dropped. - If the
target
field denotes a user that does not exist, ano-such-user
update is sent back and the request is dropped. - If the update is an operation that is not permitted on its target channel, or the primary channel if no target channel is applicable, an
insufficient-permissions
update is sent back and the request is dropped.
5.2 Profile Registration
When a user sends a register
update, the server must act as follows:
- If the server disagrees with the attempted registration, a
registration-rejected
update is sent back and the request is dropped. - If the profile does not yet exist, it is created.
- The password of the profile associated to the user is changed to match the one from the update.
- The profile must stay live until at least 30 days after the user associated with the profile has existed on the server.
Note that the server does not need to store the password verbatim, and is instead advised to only store and compare a hash of it.
5.3 Channel Creation & Management
Since a channel has only two bits of information associated with it, the management of channels is rather simple. Creating a new channel happens with the create
update:
- The update is checked for permissions by the primary channel.
- If a channel of the
channel
name in the update already exists, the server responds with achannelname-taken
update and drops the request. - If the
channel
field isNIL
, an anonymous channel is created, otherwise a regular channel is created. - The user is automatically joined to the channel.
- The server responds with a
join
update to the user with theid
being the same as the id of the create update.
From there on out the channel's permissions can be viewed or changed with the permissions
update, if the channel allows you to do so. Note that the server must only update the channel's permissions, if the update's permissions
field is not NIL
.
See §2.5 for an explanation of the proper syntax of the permissions.
5.4 Channel Interaction
A user can interact with a channel in several ways.
5.4.1 Joining a Channel
Joining a channel happens with the join
update, after which the server acts as follows:
- If the user is already in the named channel, an
already-in-channel
update is sent back and the request is dropped. - The user is added to the channel's list of users.
- The user's
join
update is distributed to all users in the channel.
5.4.2 Leaving a Channel
Leaving a channel again happens with the leave
update, after which the server acts as follows:
- If the user is not in the named channel, a
not-in-channel
update is sent back and the request is dropped. - The user's
leave
update is distributed to all users in the channel. - The user is removed from the channel's list of users.
5.4.3 Pulling a User
Another user can be pulled into the channel by the pull
update, after which the server acts as follows:
- If the user is not in the named channel, a
not-in-channel
update is sent back and the request is dropped. - If the target user is already in the named channel, an
already-in-channel
update is sent back and the request is dropped. - The target user is added to the channel's list of users.
- A
join
update for the target user with the sameid
as thepull
update is distributed to all users in the channel.
5.4.4 Kicking a User
Another user can be kicked from a channel by the kick
update, after which the server acts as follows:
- If the user is not in the named channel, a
not-in-channel
update is sent back and the request is dropped. - If the target user is not in the named channel, a
not-in-channel
update is sent back and the request is dropped. - The user's
kick
update is distributed to all users in the channel. - A
leave
update for the target user is distributed to all users in the channel. - The target user is removed from the channel's list of users.
5.4.5 Sending a Message
Finally, a user can send a message to all other users in a channel with the message
update, after which the server acts as follows:
- If the user is not in the named channel, a
not-in-channel
update is sent back and the request is dropped. - The user's
message
update is distributed to all users in the channel.
5.5 Server Information Retrieval
The server can provide a client with several pieces of information about its current state.
5.5.1 Listing Public Channels
Retrieving a list of channels can be done with the channels
update, after which the server acts as follows:
- For each channel known to the server, the server checks the update against the channel's permissions.
- If the permissions allow the update, the channel's name is recorded.
- A
channels
update with the sameid
as the request is sent back with thechannels
field set to the list of names of channels that were recorded.
5.5.2 Listing All Users of a Channel
The list of users currently in a channel can be retrieved by the users
update, after which the server acts as follows:
- A list of the users in the channel is recorded.
- A
users
update with the sameid
as the request is sent back with theusers
field set to the list of names of users that were recorded.
5.5.3 Requesting Information About a User
Finally, information about a particular user can be retrieved by the user-info
update, after which the server acts as follows:
- A
user-info
update with the sameid
as the request is sent back with theconnections
field set to the number of connections the user object has associated with it and with theregistered
field set toT
if the user has a profile associated with it.
6. Protocol Extension
A server or client may provide extensions to the protocol in the following manners:
- Additional Update Types -- If such an update is sent to a client that does not recognise it, it should be ignored. If such an update is sent to a server that does not recognise it, the server will respond with an
invalid-update
. - Additional Update Fields -- A client or server may extend the existing update classes with additional, optional fields to provide further information or other kinds of behaviour. The server or client is not allowed to introduce additional required fields. When an update with unknown initargs is received, the unknown initargs are to be ignored.
Each extension to the protocol should receive a unique name of the form producer-name
where producer
is an identifier for who wrote up the extension's protocol, and name
should be a name for the extension itself. For each extension that a server and client support, they must include the unique name of it as a string in the connect
update's extensions
list.
7. Protocol Extensions
The extensions outlined in this section are not mandatory and a server or client may choose not to implement them.
7.1 Backfill (shirakumo-backfill)
A new update type called backfill
is introduced, which is a channel-update
. If the server receives such an update from a connection, it reacts as follows:
- If the user is not in the named channel, a
not-in-channel
update is sent back and the request is dropped. - Following this, updates are sent back to the connection the update came from. These updates should include all updates that were distributed to users in the channel, spanning from now to an arbitrary point in time that is at most when the user of this connection last joined the channel. The fields of the updates must be the equal to the first time the update was sent out. The initial event of the user that requested the backfill joining the channel cannot be sent back.
The purpose of this extension is to allow users to catch up with the contents of a channel should they initiate a new connection which does not currently have access to all the past updates of the channel. In order to facilitate this, the server is forced to keep copies of the updates. The server is allowed to only keep updates for a certain duration, or only a certain number of total updates. In order to avoid spying, the server must not distribute updates that the user did not already receive previously through another connection. The server does not have to make any guarantee about the order in which the updates are sent back to the connection. The client on the other side is responsible for ordering them as appropriate according to the clock.
7.2 Data (shirakumo-data)
A new update type called data
is introduced, which is a channel-update
. Additionally, a new failure
type called bad-content-type
is introduced, which is an update-failure
. If the server receives a data
update from a connection, it reacts as follows:
- If the user is not in the named channel, a
not-in-channel
update is sent back and the request is dropped. - If the update's
content-type
is not accepted by the server, abad-content-type
update is sent back and the request is dropped. - The user's
data
update is distributed to all users in the channel.
The data
update contains three slots, with the following intentions:
content-type
A string representing the content type of the payload data contained in the update.filename
A string representing an arbitrary name given to the payload data.payload
A base-64 encoded string of binary data payload.
The purpose of this extension is to allow users to send binary data over channels. Particularly, the intention is to allow embedding of images, audio, video, and other media.
7.3 Emotes (shirakumo-emotes)
Two new update types called emotes
and emote
are introduced. If the server receives an emotes
update from a connection, it reacts as follows:
- The server computes a set difference between the known emote names, and the names listed in the event's
names
slot. Emote names are case-insensitive. - For each emote in the calculated set, the server sends back an
emote
update, where thename
is set to the emote's name, and thepayload
is set to the base-64 encoded image representing the emote. Thecontent-type
must be set accordingly.
When the client receives an emote
update from the server, it reacts as follows:
- The
payload
andcontent-type
are associated with thename
and persisted on the client. When the client sends anemotes
event it to the server it should include the name of this emote in thenames
list.
The emotes
update contains one slot, with the following intentions:
names
This contains a list of strings denoting the names of emotes the client knows about.
The emote
update contains three slots, with the following intentions:
content-type
A string representing the content type of the emote image contained in the update.name
A string representing the name of the emote.payload
A base-64 encoded string of binary data payload.
When the client sees a message
update, every match of the regex :([^:]+):
in the text
where the group matched by the regex is the name of an emote from the known list of emotes, then the match of the regex should be displayed to the user by an image of the emote's image.
The purpose of this extension is to allow the server manager to configure emote images for the users to use, similar in functionality to what is often found on forums and other platforms.
7.4 Edit (shirakumo-edit)
A new update type called edit
is introduced, which is a message
. If the server receives an edit
update it acts in the same way as a regular message
event. No additional support from the server is required outside of recognising and accepting the type.
When the client sees an edit
update, it should change the text
of the message
update with the same from
and id
fields to the one from the edit
update. Ideally a user interface for Lichat should also include an indication that the previous message event has been changed, including perhaps even a history of all the potential edits of a message.
If the client receives an edit
update whose id
and from
fields do not refer to any previous message
update, the client should simply ignore the update.
See Also
- lichat-serverlib An agnostic implementation of the server-side protocol.
- lichat-tcp-server A basic, threaded, TCP-based implementation of a Lichat server.
- lichat-tcp-client A basic, threaded, TCP-based implementation of a Lichat client.
- LionChat A Qt GUI client for a TCP server.
System Information
Definition Index
-
LICHAT-PROTOCOL
- ORG.SHIRAKUMO.LICHAT.PROTOCOL
No documentation provided.-
EXTERNAL SPECIAL-VARIABLE *DEFAULT-ANONYMOUS-CHANNEL-PERMISSIONS*
Default permissions for anonymous channels.
-
EXTERNAL SPECIAL-VARIABLE *DEFAULT-CHANNEL-LIFETIME*
The default lifetime for a new channel in seconds. Should equal to one standard month (30 days).
-
EXTERNAL SPECIAL-VARIABLE *DEFAULT-PRIMARY-CHANNEL-PERMISSIONS*
Default permissions for primary/server channels.
-
EXTERNAL SPECIAL-VARIABLE *DEFAULT-PROFILE-LIFETIME*
The default lifetime for a registered profile in seconds. Should equal to one non-leap year.
-
EXTERNAL SPECIAL-VARIABLE *DEFAULT-REGULAR-CHANNEL-PERMISSIONS*
Default permissions for non-primary, non-anonymous channels.
-
EXTERNAL SPECIAL-VARIABLE *ID-COUNTER*
Counter variables for update IDs. Starts at a random integer between 0 and the current universal-time. This is done to make the clashing of IDs less likely to occur between users of the protocol library. See NEXT-ID
-
EXTERNAL CLASS ALREADY-IN-CHANNEL
Update in response to a JOIN/PULL request for a user that is already in the specified channel. See UPDATE-FAILURE
-
EXTERNAL CLASS BACKFILL
Update to represent a backfill request. Possible responses: See NOT-IN-CHANNEL See CHANNEL-UPDATE
-
EXTERNAL CLASS BAD-CONTENT-TYPE
Update in response to a DATA update with a content-type the server does not support. See UPDATE-FAILURE See ALLOWED-CONTENT-TYPES
-
EXTERNAL CLASS BAD-NAME
Update in response to any named request with a name that is not valid. Relevant are the FROM, TARGET, and CHANNEL fields. See UPDATE-FAILURE
-
EXTERNAL CLASS CHANNEL
Class to represent a channel. See NAMED-OBJECT See SERVER-OBJECT See PERMISSIONS See LIFETIME See USERS See *DEFAULT-CHANNEL-LIFETIME*
-
EXTERNAL CLASS CHANNEL-UPDATE
-
EXTERNAL CLASS CHANNELNAME-TAKEN
Update in response to a CREATE request for a channel that already exists. See UPDATE-FAILURE
-
EXTERNAL CLASS CHANNELS
Update to represent a channels listing request. Possible responses: See CHANNELS See BAD-NAME See USERNAME-MISMATCH See CHANNELS See UPDATE
-
EXTERNAL CLASS CONNECT
Update to represent a connection request. This update must be the first thing sent by the client upon connection establishment. Possible responses: See CONNECT See BAD-NAME See INVALID-PASSWORD See USERNAME-TAKEN See NO-SUCH-PROFILE See INCOMPATIBLE-VERSION See PASSWORD See VERSION See UPDATE
-
EXTERNAL CLASS CONNECTION
Class to represent a connection of a user. See SERVER-OBJECT See USER
-
EXTERNAL CLASS CONNECTION-UNSTABLE
Update in response to an unstable or slow connection. See FAILURE
-
EXTERNAL CLASS CREATE
Update to represent a channel creation request. The channel may be NIL, in which case an anonymous channel is constructed. You can obtain the name of the anonymous channel by reading it out of the JOIN response. Possible responses: See JOIN See BAD-NAME See USERNAME-MISMATCH See CHANNELNAME-TAKEN See BAD-NAME See INSUFFICIENT-PERMISSIONS See CHANNEL-UPDATE
-
EXTERNAL CLASS DATA
Update to represent a raw data message. Possible responses: See NOT-IN-CHANNEL See BAD-CONTENT-TYPE See DATA See CONTENT-TYPE See FILENAME See PAYLOAD See CHANNEL-UPDATE
-
EXTERNAL CLASS DISCONNECT
Update to represent a disconnection request. Possible responses: See DISCONNECT See USERNAME-MISMATCH See UPDATE
-
EXTERNAL CLASS EDIT
Update to represent a change to an existing message. See MESSAGE
-
EXTERNAL CLASS EMOTE
Update to represent an emote entity. This should only be sent by the server. See CONTENT-TYPE See NAME See PAYLOAD See UPDATE
-
EXTERNAL CLASS EMOTES
-
EXTERNAL CLASS FAILURE
Superclass for all failure response updates. See TEXT-UDPATE
-
EXTERNAL CLASS INCOMPATIBLE-VERSION
Update in response to a connection attempt with an incompatible protocol version. See COMPATIBLE-VERSIONS See UPDATE-FAILURE
-
EXTERNAL CLASS INSUFFICIENT-PERMISSIONS
Update in response to a request that is not permitted on the current or primary channel. See UPDATE-FAILURE
-
EXTERNAL CLASS INVALID-PASSWORD
Update in response to a connection attempt with an invalid password for the profile. See UPDATE-FAILURE
-
EXTERNAL CLASS INVALID-PERMISSIONS
Update in response to a PERMISSIONS request that attempted to set malformed permissions. See UPDATE-FAILURE
-
EXTERNAL CLASS INVALID-UPDATE
Update in response to an update of invalid type. See UPDATE-FAILURE
-
EXTERNAL CLASS JOIN
Update to represent a channel join request. Possible responses: See JOIN See BAD-NAME See USERNAME-MISMATCH See ALREADY-IN-CHANNEL See NO-SUCH-CHANNEL See INSUFFICIENT-PERMISSIONS See CHANNEL-UDPATE
-
EXTERNAL CLASS KICK
Update to represent a user kick request. Possible responses: See KICK See BAD-NAME See USERNAME-MISMATCH See NOT-IN-CHANNEL See NO-SUCH-USER See NO-SUCH-CHANNEL See INSUFFICIENT-PERMISSIONS See TARGET-UPDATE See CHANNEL-UPDATE
-
EXTERNAL CLASS LEAVE
Update to represent a channel leave request. Possible responses: See LEAVE See BAD-NAME See USERNAME-MISMATCH See NOT-IN-CHANNEL See NO-SUCH-CHANNEL See INSUFFICIENT-PERMISSIONS See CHANNEL-UDPATE
-
EXTERNAL CLASS MALFORMED-UPDATE
Update in response to a malformed update. See FAILURE
-
EXTERNAL CLASS MESSAGE
Update to represent a channel message request. Possible responses: See MESSAGE See BAD-NAME See USERNAME-MISMATCH See NO-SUCH-CHANNEL See INSUFFICIENT-PERMISSIONS See CHANNEL-UPDATE See TEXT-UPDATE
-
EXTERNAL CLASS NAMED-OBJECT
Superclass for all objects that are named. See NAME
-
EXTERNAL CLASS NO-SUCH-CHANNEL
Update in response to a CHANNEL-UPDATE for a channel that does not exist. See UPDATE-FAILURE
-
EXTERNAL CLASS NO-SUCH-PROFILE
Update in response to a connection attempt with a password for an inexistent profile. See UPDATE-FAILURE
-
EXTERNAL CLASS NO-SUCH-USER
Update in response to a TARGET-UPDATE request that refers to user that does not exist. See UPDATE-FAILURE
-
EXTERNAL CLASS NOT-IN-CHANNEL
Update in response to a LEAVE/KICK request for a user that is not in the specified channel. See UPDATE-FAILURE
-
EXTERNAL CLASS PERMISSIONS
Update to represent a channel permissions view or change request. If PERMISSIONS is NIL, the permissions are not changed. Possible responses: See PERMISSIONS See BAD-NAME See USERNAME-MISMATCH See NO-SUCH-CHANNEL See INSUFFICIENT-PERMISSIONS See PERMISSIONS See CHANNEL-UPDATE
-
EXTERNAL CLASS PING
Update to represent a ping request. The recipient must reply with a PONG update. Possible responses: PONG See UPDATE
-
EXTERNAL CLASS PONG
-
EXTERNAL CLASS PROFILE
Class to represent user profiles. Only registered users have a profile. See NAMED-OBJECT See SERVER-OBJECT See NAME See PASSWORD See LIFETIME See *DEFAULT-PROFILE-LIFETIME*
-
EXTERNAL CLASS PULL
Update to represent a user pull request. The user will be automatically joined to the channel. Possible responses: See JOIN See BAD-NAME See USERNAME-MISMATCH See ALREADY-IN-CHANNEL See NO-SUCH-USER See NO-SUCH-CHANNEL See INSUFFICIENT-PERMISSIONS See TARGET-UPDATE See CHANNEL-UPDATE
-
EXTERNAL CLASS REGISTER
Update to represent a registration request. Possible responses: See REGISTRATION-REJECTED See REGISTER See BAD-NAME See USERNAME-MISMATCH See INSUFFICIENT-PERMISSIONS See UPDATE
-
EXTERNAL CLASS REGISTRATION-REJECTED
Update in response to a REGISTER request that the server rejected. See UPDATE-FAILURE
-
EXTERNAL CLASS SERVER-OBJECT
Superclass for all objects that exist on the server-side.
-
EXTERNAL CLASS TARGET-UPDATE
-
EXTERNAL CLASS TEXT-UPDATE
-
EXTERNAL CLASS TOO-MANY-CONNECTIONS
Update in response to too many connections being requested on the server globally, or for a single user. See FAILURE
-
EXTERNAL CLASS TOO-MANY-UPDATES
Update in response to a flooding of the server. When this update is sent, any number of future updates that are received may be dropped instead. See UPDATE-FAILURE
-
EXTERNAL CLASS UPDATE
Base class for all updates. See WIRE-OBJECT See ID See CLOCK See FROM See NEXT-ID
-
EXTERNAL CLASS UPDATE-FAILURE
-
EXTERNAL CLASS UPDATE-TOO-LONG
Update in response to an update that contained too many characters. See FAILURE
-
EXTERNAL CLASS USER
Class to represent a user. Anything that can communicate with the server must have a user obuject. See NAMED-OBJECT See SERVER-OBJECT See CONNECTIONS See CHANNELS
-
EXTERNAL CLASS USER-INFO
Update to represent a user information request. Possible responses: See USER-INFO See BAD-NAME See USERNAME-MISMATCH See NO-SUCH-USER See REGISTERED See CONNECTIONS See TARGET-UPDATE
-
EXTERNAL CLASS USERNAME-MISMATCH
Update in response to a mismatch between the known username and the one in the FROM field. See UPDATE-FAILURE
-
EXTERNAL CLASS USERNAME-TAKEN
Update in response to a connection attempt with a username that is already taken. See UPDATE-FAILURE
-
EXTERNAL CLASS USERS
Update to represent a channel users listing request. Possible responses: USERS BAD-NAME USERNAME-MISMATCH NO-SUCH-CHANNEL INSUFFICIENT-PERMISSIONS See CHANNEL-UPDATE See USERS
-
EXTERNAL CLASS WIRE-OBJECT
Superclass for all classes that can be put onto the wire.
-
EXTERNAL CONDITION INCOMPATIBLE-VALUE-TYPE-FOR-SLOT
-
EXTERNAL CONDITION INCOMPLETE-TOKEN
Condition signalled when a token is not complete on the wire and thus can't be read fully.
-
EXTERNAL CONDITION MALFORMED-WIRE-OBJECT
Condition signalled when an object is found on the wire but is malformed and can't be parsed. See UPDATE
-
EXTERNAL CONDITION MISSING-CLOCK
Condition signalled when the CLOCK field is missing from an update.
-
EXTERNAL CONDITION MISSING-ID
Condition signalled when the ID field is missing from an update.
-
EXTERNAL CONDITION MISSING-UPDATE-ARGUMENT
Superclass for all conditions relating to missing required arguments in updates. See MISSING-ID See MISSING-CLOCK See UPDATE
-
EXTERNAL CONDITION NULL-IN-SYMBOL-DESIGNATOR
Condition signalled when a symbol is attempted to be put to the wire whose designator contains NULL characters. See SYMBOL-DESIGNATOR
-
EXTERNAL CONDITION PRINTER-CONDITION
Superclass for all conditions relating to printing to the wire. See UNPRINTABLE-OBJECT
-
EXTERNAL CONDITION PROTOCOL-CONDITION
Superclass for all conditions relating to the protocol. See WIRE-CONDITION See INCOMPATIBLE-VALUE-TYPE-FOR-SLOT
-
EXTERNAL CONDITION READ-LIMIT-HIT
No documentation provided. -
EXTERNAL CONDITION READER-CONDITION
Superclass for all conditions relating to reading from the wire. See INCOMPLETE-TOKEN See UNKNOWN-SYMBOL
-
EXTERNAL CONDITION STRAY-NULL-FOUND
Condition signalled when a null character was found in the middle of an update. See READER-CONDITION
-
EXTERNAL CONDITION UNKNOWN-SYMBOL
Condition signalled when an unknown symbol is found on the wire. See SYMBOL-DESIGNATOR
-
EXTERNAL CONDITION UNKNOWN-WIRE-OBJECT
Condition signalled when an object is found on the wire that has an unknown type. See UPDATE
-
EXTERNAL CONDITION UNPRINTABLE-OBJECT
Condition signalled when an unprintable object is attempted to be put onto the wire. See OBJECT
-
EXTERNAL CONDITION WIRE-CONDITION
Superclass for all conditions relating to the wire format. See PRINTER-CONDITION See READER-CONDITION See MISSING-UPDATE-ARGUMENT See UNKNOWN-WIRE-OBJECT See MALFORMED-WIRE-OBJECT
-
EXTERNAL TYPE-DEFINITION CHANNELNAME
Type that is satisfied for all channelname strings. See CHANNELNAME-P
-
EXTERNAL TYPE-DEFINITION ID
Type that is satisfied for all ID objects. See ID-P
-
EXTERNAL TYPE-DEFINITION PASSWORD
Type that is satisfied for all password strings. See PASSWORD-P
-
EXTERNAL TYPE-DEFINITION USERNAME
Type that is satisfied for all username strings. See USERNAME-P
-
EXTERNAL TYPE-DEFINITION WIREABLE
Type for all objects that are permitted to appear on the wire. Should be the union of REAL STRING CONS SYMBOL WIRE-OBJECT
-
EXTERNAL FUNCTION CHANNELNAME-P
- NAME
Returns true if the given name is a valid name for channels. See USERNAME-P
-
EXTERNAL FUNCTION CHECK-UPDATE-OPTIONS
- SEXPR
Checks the given sexpr for conformity to use as initargs for an update. The items after the first symbol in the list are checked as follows: they must be balanced pairs of KEYWORD to atom. If this is not the case, an error of type MALFORMED-WIRE-OBJECT is signalled. If no key :ID is found, an error of type MISSING-ID is signalled. If no key :CLOCK is found, an error of type MISSING-CLOCK is signalled. See FROM-WIRE See MISSING-ID See MISSING-CLOCK See MALFORMED-WIRE-OBJECT
-
EXTERNAL FUNCTION FROM-WIRE
- STREAM
- &OPTIONAL
- LIMIT
Read a wire object from the stream. First an object is read from stream by READ-SEXPR. If the returned object is not a cons, it is returned immediately. Otherwise, the procedure is as follows: The first element must be a symbol. If it isn't, an error of type MALFORMED-WIRE-OBJECT is signalled. If the symbol does not designate a class, or designates a class that is not a subclass of WIRE-OBJECT, an error of type UNKNOWN-WIRE-OBJECT is signalled. If the class is a subclass of UPDATE, the rest of the items in the list are checked by CHECK-UPDATE-OPTIONS. Finally MAKE-INSTANCE is called with the full expression as arguments. If the class is a subclass of wire-object, MAKE-INSTANCE is called with the full expression as arguments immediately. See READ-SEXPR See MALFORMED-WIRE-OBJECT See UNKNOWN-WIRE-OBJECT See CHECK-UPDATE-OPTIONS
-
EXTERNAL FUNCTION ID-P
- ID
Returns true if the given object is a valid ID.
-
EXTERNAL FUNCTION NEXT-ID
Returns a fresh ID. See *ID-COUNTER*
-
EXTERNAL FUNCTION PASSWORD-P
- PASS
Returns true if the given object is a string of at least six characters.
-
EXTERNAL FUNCTION PRINT-SEXPR
- SEXPR
- STREAM
Print an s-expression to the stream. Only the following types are allowed: LIST STRING REAL SYMBOL Any other type will signal an error of type UNPRINTABLE-OBJECT. See PRINT-SEXPR-LIST See PRINT-SEXPR-STRING See PRINT-SEXPR-NUMBER See PRINT-SEXPR-SYMBOL See UNPRINTABLE-OBJECT
-
EXTERNAL FUNCTION PROTOCOL-VERSION
Returns the version string for the protocol.
-
EXTERNAL FUNCTION READ-SEXPR
- STREAM
Reads an s-expression from the stream. Skips all the whitespace at the beginning. Depending on the character following, the reading is dispatched as follows: ( => READ-SEXPR-LIST ) => Signals an INCOMPLETE-TOKEN error " => READ-SEXPR-STIRNG 012345689. => READ-SEXPR-NUMBER : => READ-SEXPR-KEYWORD otherwise => READ-SEXPR-SYMBOL See READ-SEXPR-LIST See READ-SEXPR-STRING See READ-SEXPR-NUMBER See READ-SEXPR-KEYWORD See READ-SEXPR-SYMBOL
-
EXTERNAL FUNCTION TO-WIRE
- WIREABLE
- STREAM
Print the wireable object to the stream. Only handles objects of type WIRE-OBJECT and WIREABLE. WIRE-OBJECTS are printed as a list in the following format: a list of the object's type symbol followed by pairs of keyword to value of the object's slots that have an initarg. Slots without an initarg are not printed. The output is forced once written fully. See PRINT-SEXPR See FORCE-OUTPUT
-
EXTERNAL FUNCTION USERNAME-P
- NAME
Returns true if the given name is a valid name for users. That is to say, the name must be a string in [1,32] of length and each character must be in the allowed unicode regions. The name must also not begin or end with a space. See VALID-NAME-CHAR-P
-
EXTERNAL FUNCTION WHITESPACE-P
- CHAR
Returns T if the character is considered to be whitespace. See *WHITESPACE*
-
EXTERNAL GENERIC-FUNCTION ALLOWED-CONTENT-TYPES
- OBJECT
Returns a list of allowed content-type identifiers that the server supports. See BAD-CONTENT-TYPE
-
EXTERNAL GENERIC-FUNCTION (SETF ALLOWED-CONTENT-TYPES)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION CHANNEL
- OBJECT
Accessor to the name of the channel the update relates to. See CHANNEL-UPDATE
-
EXTERNAL GENERIC-FUNCTION (SETF CHANNEL)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION CHANNELS
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF CHANNELS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION CLOCK
- OBJECT
Accessor to the clock of the update. Must be a universal-time timestamp set at the time the update was constructed. See UPDATE
-
EXTERNAL GENERIC-FUNCTION (SETF CLOCK)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION CONNECTIONS
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF CONNECTIONS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION CONTENT-TYPE
- OBJECT
Returns the content-type of the encoded data payload. See DATA
-
EXTERNAL GENERIC-FUNCTION (SETF CONTENT-TYPE)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION EXTENSIONS
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION (SETF EXTENSIONS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION FILENAME
- OBJECT
Returns the file name of the file sent by the data payload. See DATA
-
EXTERNAL GENERIC-FUNCTION (SETF FILENAME)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION FROM
- OBJECT
Accessor to the sender of the update. Must be a username string identifying the user that sent it. See UPDATE
-
EXTERNAL GENERIC-FUNCTION (SETF FROM)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION ID
- OBJECT
Accessor to the ID of the update. IDs should be connection-unique, meaning the same ID should not appear on different connections at the same time. See UPDATE
-
EXTERNAL GENERIC-FUNCTION (SETF ID)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION LIFETIME
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF LIFETIME)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION NAME
- OBJECT
Accessor to the object's name string. See NAMED-OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF NAME)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION NAMES
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION (SETF NAMES)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION OBJECT
- CONDITION
The object related to the condition. See UNPRINTABLE-OBJECT See INCOMPATIBLE-VALUE-TYPE-FOR-SLOT
-
EXTERNAL GENERIC-FUNCTION PASSWORD
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF PASSWORD)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION PAYLOAD
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF PAYLOAD)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION PERMISSIONS
- OBJECT
Accessor to the permissions list of the object. See CHANNEL See PERMISSIONS
-
EXTERNAL GENERIC-FUNCTION (SETF PERMISSIONS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION REGISTERED
- OBJECT
Accessor to whether the user is registered or not. See USER-INFO
-
EXTERNAL GENERIC-FUNCTION (SETF REGISTERED)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION SYMBOL-DESIGNATOR
- CONDITION
A symbol designator. Returns a CONS of two strings for the package- and symbol-name respectively. See NULL-IN-SYMBOL-DESIGNATOR See UNKNOWN-SYMBOL
-
EXTERNAL GENERIC-FUNCTION TARGET
- OBJECT
Accessor to the name of the user being targeted. See TARGET-UPDATE
-
EXTERNAL GENERIC-FUNCTION (SETF TARGET)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION TEXT
- OBJECT
Accessor to the text string carried by the update. See TEXT-UPDATE
-
EXTERNAL GENERIC-FUNCTION (SETF TEXT)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION UPDATE
- CONDITION
The update object that relates to the condition. See MISSING-UPDATE-ARGUMENT See UNKNOWN-WIRE-OBJECT
-
EXTERNAL GENERIC-FUNCTION UPDATE-ID
- OBJECT
Accessor to the ID of the update that failed to be completed. See UPDATE-FAILURE
-
EXTERNAL GENERIC-FUNCTION (SETF UPDATE-ID)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION USER
- OBJECT
Accessor to the user tied to the connection. See CONNECTION See USER
-
EXTERNAL GENERIC-FUNCTION (SETF USER)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION USERS
- OBJECT
-
EXTERNAL GENERIC-FUNCTION (SETF USERS)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL GENERIC-FUNCTION VERSION
- OBJECT
Accessor to the version of the connection update. See CONNECT
-
EXTERNAL GENERIC-FUNCTION (SETF VERSION)
- NEW-VALUE
- OBJECT
No documentation provided. -
EXTERNAL MACRO DEFINE-PROTOCOL-CLASS
- NAME
- DIRECT-SUPERCLASSES
- DIRECT-SLOTS
- &REST
- OPTIONS
Defines a new protocol class. See DEFINE-TYPED-CLASS