Control operations are used to perform arbitrary operations on
protocols and sessions, via the xControlProtl and
xControlSessn operations described in Sections
and
. xControlProtl and
xControlSessn return an integer that indicates the length in bytes of
the information which was written into the buffer, or -1 to indicate
an error.
All implementations of control operations should check the length field before reading or writing the buffer, returning -1 if the buffer is too small. The checkLen( actualLength, expectedLength) macro can be used for this.
The opcode field in the control operations specifies the operation to be performed on the protocol or session. There are two ``classes'' of operations: standard ones that may be implemented by more than one protocol, and protocol-specific ones.