The L-BUS Protocol
Copyright James A. McQuillan (
jam@Ltsp.org), 2006
Revision history
Abstract
LTSP needs a method of communicating local device information between the client and one or more servers that a user is logged into.
As devices are plugged into the thin client, event messages need to be generated and sent to the server(s), so that icons appear on the desktop.
The message passing between
lbussd and
lbuscd should be flexibile, so that we can easily add new message types, and add new fields to existing message types. The messages will not be very frequent, nor very large, so we don't need to worry too much about efficiency in size. At least for prototyping, we should keep it simple.
Message Types:
| Message Type | Originated by | Notes |
| Register | Server | Tells the client that the server is interested in getting device events |
| AddBlockDevice | Client | Tells the server that a new block device has been added |
| RemoveDevice | Client | Tells the server that a device has been removed |
| EnumerateDevices | Server | Asks the client for a list of devices currently available |
| GroupBegin | Client | Begins a set of Add Device messages |
| GroupEnd | Client | Terminates a set of Add Device messages |
| Eject | Server | Tells the client to eject the cdrom tray |
Register
| Fld Num | Field Name | Description |
| 1. | MessageType | "Register" A session running on the server is registering itself to the client |
| 2. | MessageID | Sequence number for this message |
| 3. | UserID | The Linux User ID of the user running the session on the server |
| 4. | UserName | The username of the user running the session on the server |
Example:
Register|10|501|jam
AddBlockDevice
When a new block device is inserted, the
lbuscd will send a message to all registered servers.
| Fld Num | Field Name | Description |
| 1. | MessageType | "AddBlockDevice" A new block device has been added to the client |
| 2. | MessageID | Sequence number for this message. Each time a new device is inserted, this number is incremented. If this message is sent as part of the reply to an EnumerateDevices request, then all messages in the reply will have the same MessageID number. |
| 3. | DevID | Unique ID number for each device, generated by lbuscd |
| 4. | ShareName | The name that the server should use when mounting the device |
| 5. | RemoveableMedia | Boolean indicating whether the device supports removeable media. *0*=No, *1*=Yes |
| 6. | Size | The size of the device, in KB |
| 7. | Description | A Description of the device |
Example:
AddBlockDevice|11|1|usb0|0|131072|Minicruiser 128mb usb stick
RemoveDevice
| Fld Num | Field Name | Description |
| 1. | MessageType | "RemoveDevice" A device has been removed, the server should un-mount it and remove the icon |
| 2. | MessageID | Sequence number for this message |
| 3. | DevID | The ID of the device that has been removed |
Example:
RemoveDevice|12|1
EnumerateDevices
The server can ask the client for a list of devices that are currently available. The client will then send back a group of AddDevice messages preceded by a GroupBegin message, and terminated by a GroupEnd message.
| Fld Num | Field Name | Description |
| 1. | MessageType | "EnumerateDevices" A session running on the server has requested a list of devices |
| 2. | MessageID | Unique ID for the message. This should be returned in the GroupBegin message. |
Example:
EnumerateDevices|13
When the client receives the
EnumerateDevices message, it will respond with a
GroupBegin message, followed by zero or more
AddDevice messages and terminated by a
GroupEnd message.
GroupBegin
| Fld Num | Field Name | Description |
| 1. | MessageType | "GroupBegin" Begins a response to the 'EnumerateDevices' request |
| 2. | MessageID | Unique ID for the response. Each record of this group will have the same ResponseID. |
| 3. | RequestID | The MessageID of the EnumerateDevices message that requested this list of devices |
GroupEnd
| Fld Num | Field Name | Description |
| 1. | MessageType | "GroupEnd" Ends a response to the 'EnumerateDevices' request |
| 2. | MessageID | Unique ID for the response. Each record of this group will have the same MessageID. |
Example:
The server sends a EnumerateDevices request like this:
EnumerateDevices|23
The client responds with the following group of messages:
GroupBegin|7|23
AddBlockDevice|7|1|usb0|0|131072|Mini-Cruiser 128mb memory stick
AddBlockDevice|7|2|usb1|0|262144|Mini-Cruiser 256mb memory stick
AddBlockDevice|7|3|floppy|1|1536|Floppy disk 1.44mb
AddBlockDevice|7|4|cdrom0|1|700000|Ubuntu 5.04 i386
GroupEnd|7
Eject
| Fld Num | Field Name | Description |
| 1. | MessageType | "Eject" The server is asking the workstation to eject the media from the drive |
| 2. | MessageID | Unique ID for the message. |
| 3. | DevID | The ID of the drive that is being asked to eject the media |
Example:
Eject|8|4
Because we poll for cdrom media, we don't add a cdrom device until we actually have media. Which means, when the media is ejected, the client should do a RemoveDevice, so the device icon should dissappear from the desktop.
--
JimMcQuillan - 18 Mar 2006