This is an overview of the v2 XML icb protocol. It's a quick hack to make icbd compatable with a flash-based icb client used for other applications than icb historically has been used. It's also a proof of concept for using the icb system with an XML protocol.
Future real development will re-address the idea of the actual XML structure and DTD.
The basic unit ICB clients and server communicate with is a packet with the following layout:
<PACKET PROTO="2" TYPE="type">
<DATA TYPE="DTYPE">VALUE</DATA>
<DATA TYPE="DTYPE">VALUE 2</DATA>
...
<DATA TYPE="DTYPE">VALUE N</DATA>
</PACKET>
Thus the ICB Login Packet has the following layout:
<PACKET PROTO="2" TYPE="LOGIN"> <DATA TYPE="recipient">server</DATA> <DATA TYPE="param">Loginid</DATA> <DATA TYPE="param">Nickname</DATA> <DATA TYPE="param">DefaultGroup</DATA> <DATA TYPE="param">Command</DATA> <DATA TYPE="param">Password</DATA> <DATA TYPE="param">GroupStatus</DATA> </PACKET>
None, the server response is sent as a LOGINOK packet.
None, the client request is sent using a LOGIN packet.
Thus the ICB Login OK Packet has the following layout:
<PACKET PROTO="2" TYPE="LOGINOK"> <DATA TYPE="SENDER">Server</DATA> <DATA TYPE="data">result-code</DATA> </PACKET>
Thus the ICB Open Packet has the following layout:
<PACKET PROTO="2" TYPE="OPEN"> <DATA TYPE="DATA">MessageText</DATA> </PACKET>
Thus the ICB Open Packet has the following layout:
<PACKET PROTO="2" TYPE="OPEN"> <DATA TYPE="SENDER">Nickname</DATA> <DATA TYPE="DATA">MessageText</DATA> </PACKET>
Not valid. Clients cannot send servers Personal Message packets.
Thus the ICB Personal Message Packet has the following layout:
<PACKET PROTO="2" TYPE="PERSONAL"> <DATA TYPE="SENDER">Nickname</DATA> <DATA TYPE="DATA">MessageText</DATA> </PACKET>
Not valid. Clients cannot send servers Status Message packets.
Thus the ICB Status Message Packet has the following layout:
<PACKET PROTO="2" TYPE="STATUS"> <DATA TYPE="PARAM">Category</DATA> <DATA TYPE="DATA">MessageText</DATA> </PACKET>
Not valid. Clients cannot send servers Error Message packets.
Thus the ICB Error Message Packet has the following layout:
<PACKET PROTO="2" TYPE="ERROR"> <DATA TYPE="PARAM">Category</DATA> <DATA TYPE="DATA">ErrorText</DATA> </PACKET>
Not valid. Clients cannot send servers Important Message packets.
Thus the ICB Important Message Packet has the following layout:
<PACKET PROTO="2" TYPE="IMPORTANT"> <DATA TYPE="PARAM">Category</DATA> <DATA TYPE="DATA">MessageText</DATA> </PACKET>
Not valid. Clients cannot send servers Exit Message packets.
Thus the ICB Exit Message Packet has the following layout:
<PACKET PROTO="2" TYPE="EXIT"> <DATA TYPE="DATA">ReasonText</DATA> </PACKET>
Thus the ICB Command Packet has the following layout:
<PACKET PROTO="2" TYPE="COMMAND"> <DATA TYPE="RECIPIENT">Nickname</DATA> <DATA TYPE="PARAM">Command</DATA> <DATA TYPE="PARAM">Optional Command Arg 1</DATA> ... <DATA TYPE="PARAM">Optional Command Arg N</DATA> <DATA TYPE="DATA">Optional Data 0</DATA> ... <DATA TYPE="DATA">Optional Data N</DATA> </PACKET>
Not valid. Servers cannot send clients Command packets.
Not valid. Clients cannot send servers Command Output packets.
Thus the ICB Command Output Packet has the following layout:
<PACKET PROTO="2" TYPE="CMDOUT"> <DATA TYPE="SENDER">Nickname</DATA> <DATA TYPE="PARAM">OutputType</DATA> <DATA TYPE="PARAM">Optional Arg 1</DATA> ... <DATA TYPE="PARAM">Optional Arg N</DATA> <DATA TYPE="DATA">Optional Output 0</DATA> ... <DATA TYPE="DATA">Optional Output N</DATA> </PACKET>
Thus the ICB Protocol Packet has the following layout:
<PACKET PROTO="2" TYPE="PROTOCOL"> <DATA TYPE="PARAM">ProtoLevel</DATA> <DATA TYPE="PARAM">HostID</DATA> <DATA TYPE="PARAM">ClientVersionID</DATA> </PACKET>
Thus the ICB Protocol Packet has the following layout:
<PACKET PROTO="2" TYPE="PROTOCOL"> <DATA TYPE="PARAM">ProtoLevel</DATA> <DATA TYPE="PARAM">HostID</DATA> <DATA TYPE="PARAM">ServerVersionID</DATA> </PACKET>
Not valid. Clients cannot send servers Beep packets.
Thus the ICB Beep Packet has the following layout:
<PACKET PROTO="2" TYPE="BEEP"> <DATA TYPE="SENDER">Nickname</DATA> </PACKET>
Note; the user of a client sends ping requests as a sub-command of packet type COMMAND. A client to server PING packet is handled by the client itself in response to a server PING packet.
Thus the ICB Ping Packet has the following layout:
<PACKET PROTO="2" TYPE="PING"></PACKET>
Thus the ICB Ping Packet has the following layout:
<PACKET PROTO="2" TYPE="PING"></PACKET>
Thus the ICB Pong Packet has the following layout:
<PACKET PROTO="2" TYPE="PONG"></PACKET>
Thus the ICB NOOP has the following layout:
<PACKET PROTO="2" TYPE="NOOP"></PACKET>
Thus the ICB USERS packet has the following layout:
<PACKET PROTO="2" TYPE="USERS"> <DATA TYPE="PARAM">.</DATA> </PACKET>
Thus the ICB USERS packet has the following layout:
<PACKET PROTO="2" TYPE="USERS"> <DATA TYPE="DATA">10</DATA> </PACKET>
Packet Type: WHO (Proto v2 or later required)
Thus the ICB WHO packet has the following layout:
<PACKET PROTO="2" TYPE="WHO"> <DATA TYPE="PARAM">user</DATA> <DATA TYPE="PARAM">.</DATA> </PACKET>
Thus the ICB WHO has the following layout:
<PACKET PROTO="2" TYPE="WHO"> <DATA TYPE="PARAM">user</DATA> <DATA TYPE="DATA"> <USER IDLE="sec" LOGIN="time_t" USER="loginID" SITE="siteID" REGISTERED="Yes" AWAY="No" GROUP="groupName" ARRIVAL="time_t in this group">Nickname</USER> </DATA> ... <DATA TYPE="DATA"> <USER IDLE="sec" LOGIN="time_t" USER="loginID" SITE="siteID" REGISTERED="Yes" AWAY="No" GROUP="groupName" ARRIVAL="time_t in this group">Nickname N</USER> </DATA> </PACKET>
The following packet types have been migrated from sub-command types to full packet types. The ones listed below haven't been full migrated yet and are included as a listing that I can update as I make my way through. Eventually, this text will disappear. See "COMMAND and CMDOUT Packet Types" below for further information.
These already exist as top-level packet command types, but need to be updated to reflect their client to server communication.
These need to be migrated entirely.
The steps a typical ICB session goes thru is as follows:
The client can send one and only one Login Packet to the server.
If the client sends the server a packet that contains an ID type, all output sent from the server to the client in response to that Command should place the same Message ID in the Command output packet. This is not yet supported.
A client can ping another user to see if their client is active. Clients use the Ping sub-command of a COMMAND packet, the server then sends a PING packet to the other user. That user's client processes the PING packet and returns a PONG packet. The server computes the elapsed time and sends a summary back to the original user. Note that some clients can be paused in "page" mode waiting for the user to continue to the next page. In some clients this may cause a PING request to not be processed until the user has caught up on reading their ICB output and the client becomes active again.
Protocol version 1 implemented about 30 sub-commands as part of the COMMAND packet type. This may have been a result of using single-character identifiers for each packet type, but it's hard to know at this point. Regardless, protocol version 2 (and up) takes these sub-command types and moves them up into the main protocol where they can be more clearly defined and used. the COMMAND and CMDOUT packet types remain for now, and likely will be renamed to LOCAL_COMMAND or somesuch to allow for server-specific extensions that don't require a client to be updated and recompiled.
This is how it used to work and is included since in some cases all of the functionality migration hasn't been finished:
There are various Command Output Types. The ones currently defined are:
Thus the "wl" Command Output packet has the following layout:
<PACKET PROTO="2" TYPE="CMDOUT"> <DATA TYPE="PARAM">wl</DATA> <DATA TYPE="DATA">Mod</DATA> <DATA TYPE="DATA">Nickname</DATA> <DATA TYPE="DATA">Nickname</DATA> <DATA TYPE="DATA">Resp</DATA> <DATA TYPE="DATA">LoginTime</DATA> <DATA TYPE="DATA">UserID</DATA> <DATA TYPE="DATA">HostID</DATA> <DATA TYPE="DATA">RegisterInfo</DATA> </PACKET>
Thus the "wg" Command Output packet has the following layout:
<PACKET PROTO="2" TYPE="CMDOUT"> <DATA TYPE="PARAM">wg</DATA> <DATA TYPE="DATA">GroupName</DATA> <DATA TYPE="DATA">GroupTopic</DATA> </PACKET>
Note: the server seems to only accept this from the client and returns a standard who listing for the requested group.
There is currently no way for the client and server to negotiate a protocol level. A proposed method for implementing it will be added here at a later date.