This document describes how to extend bufdump. When you have completed this chapter you will know how to:
Write a packet definition file
Write a packet body formatting plugin
Packet definition files extend the set of packet ids that are recognized by the bufdump program. When bufdump encounters a recognized packet id, it can do some elementary formatting that identifies the packet contents.
You need to supply a packet definition file if your program uses packet ids that are not in the registered packet id set, and you either have not used the production readout skeleton, or you have, but have not used the CDocumentedPacket class to manage your packets.
A packet definition file is just a text file. By convention, packet definition files have the .def extension. Each line of the text file defines a packet id, and consists of the following fields separated by whitespace:
Packet short name. This should be a short one word description of the data in the packet.
Packet id. This is a number that can be expressed in any form normally recognized by C/C++ or Tcl.
Packet long name. This is a phrase that more fully describes the packet. This phrase is not currently usedb by bufdump, but may be in the future. The phrase should be quoted in any way acceptable to tcl (e.g. curly braces or double quotes).
Packet version. This is a string that represents the version of the packet. This is not currently used by the bufdump program.
The text below shows an annotated line, from a packet definition file.
s8000x5800
{S800 Spectrograph}
1.0
![]()