4. Commands and Formats
4.1 Packet Format
LDP commands are enclosed in RDP transport messages. An RDP message may contain more than one command, but each command must fit entirely within a single message. Network packets containing LDP commands have the format shown in Figure 5.
+----------------+
| Local Network |
| Header(s) |
+----------------+
| IP Header |
+----------------+
| RDP Header |
+----------------+ +-+
| LDP Command | |
| Header | |
+----------------+ |
| Optional | |
. LDP . | LDP Command
. Data . | Format
| | |
+----------------+ |
| LDP Padding | |
+----------------+ +-+
| Additional |
. LDP .
. Commands .
. .
+----------------+
Network Packet Format
Figure 5
4.2 Command Format
LDP commands consist of a standard two-word header followed optionally by additional data. To facilitate parsing of multi-command messages, all commands contain an even number of octets. Commands that contain an odd number of data octets must be padded with a null octet.
The commands defined by the LDP specification are intended to be of universal application to provide a common basis for all implementations. Command class and type codes from 0 to 63. are reserved by the protocol. Codes above 63. are available for the implementation of target-specific commands.
4.2.1 Command Header
LDP commands begin with a fixed length header. The header specifies the type of command and its length in octets.
0 0 0 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+---------------+---------------+
0 | Command Length (octets) |
+---------------+---------------+
1 | Command Class | Command Type |
+---------------+---------------+
LDP Command Header Format
Figure 6
HEADER FIELDS:
Command Length
The command length gives the total number of octets in the command, including the length field and data, and excluding padding.
Command Class Command Type
The command class and type together specify a particular command. The class selects one of six command categories, and the type gives the command within that category. All codes are decimal. The symbols given in Figures 7 and 8 for command classes and types are used in the remainder of this document for reference.
The command classes that have been defined are:
Command Class | Symbol
----------------+-----------
1 | PROTOCOL
2 | DATA_TRANSFER
3 | CONTROL
4 | MANAGEMENT
5 | BREAKPOINT
6 | CONDITION
7 - 63 | <reserved>
Command Classes
Figure 7
Command type codes are assigned in order of expected frequency of use. Commands and their responses/replies are numbered sequentially. The command types, ordered by command class, are:
Command Class | Command Type | Symbol
----------------+---------------+----------
PROTOCOL | 1 | HELLO
| 2 | HELLO_REPLY
| 3 | SYNCH
| 4 | SYNCH_REPLY
| 5 | ERROR
| 6 | ERRACK
| 7 | ABORT
| 8 | ABORT_DONE
| 9 - 63 | <reserved>
| |
DATA_TRANSFER | 1 | WRITE
| 2 | READ
| 3 | READ_DONE
| 4 | READ_DATA
| 5 | MOVE
| 6 | MOVE_DONE
| 7 | MOVE_DATA
| 8 | REPEAT_DATA
| 9 | BREAKPOINT_DATA
| 10 | WRITE_MASK
| 11 - 63 | <reserved>
| |
CONTROL | 1 | START
| 2 | STOP
| 3 | CONTINUE
| 4 | STEP
| 5 | REPORT
| 6 | STATUS
| 7 | EXCEPTION
| 8 - 63 | <reserved>
| |
MANAGEMENT | 1 | CREATE
| 2 | CREATE_DONE
| 3 | DELETE
| 4 | DELETE_DONE
| 5 | LIST_ADDRESSES
| 6 | ADDRESS_LIST
| 7 | GET_PHYS_ADDRESS
| 8 | GOT_PHYS_ADDRESS
| 9 | GET_OBJECT
| 10 | GOT_OBJECT
| 11 | LIST_BREAKPOINTS
| 12 | BREAKPOINT_LIST
| 13 | LIST_NAMES
| 14 | NAME_LIST
| 15 | LIST_PROCESSES
| 16 | PROCESS_LIST
| 17 - 63 | <reserved>
| |
BREAKPOINT | 1 | INCREMENT
| 2 | INC_COUNT
| 3 | OR
| 4 | SET_PTR
| 5 | SET_STATE
| 6 - 63 | <reserved>
| |
CONDITION | 1 | CHANGED
| 2 | COMPARE
| 3 | COUNT_EQ
| 4 | COUNT_GT
| 5 | COUNT_LT
| 6 | TEST
| 7 - 63 | <reserved>
Command Types
Figure 8