op_sar_buf_print()
Abstract
Prints information about the specified buffer onto the standard output device.
Syntax
op_sar_buf_print (sb_hndl)
| Argument | Type | Description |
|---|---|---|
sb_hndl |
Sbhandle |
handle identifying the buffer-of-interest [This value can identify any of the three Sar buffer types: segmentation, reassembly, or resegmentation. A Sar buffer handle is obtained when a buffer is created via the KP op_sar_buf_create().] |
Return Type
void
No return value.
Example
/* End-of-simulation diagnostics. */
if (op_intrpt_type () == OPC_INTRPT_ENDSIM)
{
/* Print out info. on Sar buffer. */
op_sar_buf_print (seg_sbh);
}
example output as it appears on the standard output device:
* SAR Buffer:
buffer ID (6)
buffer type (segmentation)
buffer option (packet boundary (on))
buffer option (pad segments (off))
creation module (sn1.hub.ipx)
buffer size (685)
Packets contained within buffer:
--------------------------------
packet ID (40510)
SAR label (710)
insertion time (5012.672)
bit count (orig) (256)
bit count (curr) (18)
bit ranges: <...>
Details
This KP prints out the Sar buffer information in standard ODB trace format (see the Example section). The range of information printed partially depends on the type of the specified buffer. Table 18 lists the various components of this KPs output.
Table 18: Sar Buffer Print Components
| All Buffers | Segmentation Buffers | Resegmentation Buffers | Reassembly Buffers |
|---|---|---|---|
| buffer ID buffer type creation module buffer size |
option statuses: packet boundary & segment padding list of source packets: ID label insertion time original bit count current bit count list of bit-ranges |
option statuses: packet boundary & segment padding list of segments: label insertion time bit count list of source packets in segment: - ID - label - bit count - list of bit-ranges |
option statuses: auto & timed flush list of incomplete source packets: ID label insertion time received bit count required bit count list of bit-ranges list of complete source packets: ID insertion time completion time |
The bit-ranges of source packets are printed using the format <from>-<to>, where <from> and <to> are the numeric indices of the bits in the packets, starting with 0 as the first bit of the packet.
Purpose
Provides a mechanism for altering the operational options of a Sar buffer after it has been created. The timed flush option of reassembly buffers can only be set using this KP, so the initialization of reassembly buffers with this option must include an invocation of this KP. The other buffer options can all be set when a buffer is created by op_sar_buf_create(), so op_sar_buf_options_set() is only invoked for these options when they are to be modified. Segmentation & resegmentation buffer options, which deal with the relationship of the source packet and segment bit boundaries, are typically modified when the changing nature of source packet data requires a new form of segmentation (a fairly rare circumstance). Reassembly buffer options, which deal with flushing, are typically modified if buffer sizes approach a monitored upper limit.
Errors
- Standard Sar errors (see Table 15)
- Standard Output Message: packet has nil pointer (due to an invalid packet pointer inside specified buffer’s packet list(s))
Reference
- Use the KP op_sim_debug() to determine if the simulation is running in the “debug mode” of the ODB simulation debugger
- Use the KPs op_prg_odb_trace_active() or op_prg_odb_ltrace_active() to determine if an ODB trace is in effect
- Use the KP op_sar_buf_create() to create a Sar buffer
- Use the KP op_sar_buf_options_set() to set options on a Sar buffer after it has been created
- Use the KP op_sar_buf_size() to determine the number of bits stored in a Sar buffer