# KABII Protocol

## Rik Hemsley <rik@kde.org>

### 20th August 1999

#### NOTES:

This is a binary protocol - you can't talk to it with telnet !

All size/length values are sent as 4 octets, which represent a single 32 bit value. The values are converted like this:

    number = (byte[0] << 24) | (byte[1] << 16) | (byte[2] << 8) | byte[3];

A value called 'type of entity' is one octet, which may be 'e' or 'g'

There are no spaces - those shown in the syntax are for clarity only.

#### Command set

Name | Command | Return value | Notes
Quit | q | Nothing | Signals that all transactions are complete. The connection will be terminated.
Find entity | f [total] [key] | [total] [entity] | [total] will be 0 if not found.
Search | s [total] [size of val] [name] [val] | [length of list] [[size of key] [key]]* | [length of list] will be 0 if not found
Add entity | a [total] [type of entity] [entity] | On success: '0' On failure: '1' |
Erase entity | e [total] [key] | On success: '0' On failure: '1' |
Replace entity | r [total] [size of entity] [key] [entity] | On success: '0' On failure: '1' |
List all keys | l | [length of list] [[size of key] [key]]* | [length of list] will be 0 if there are no keys.