op_sar_bitrange_print()
Abstract
Sends the contents of a bit-range to the standard output device in human readable form.
Syntax
op_sar_bitrange_print (bit_range)
| Argument | Type | Description |
|---|---|---|
bit_range |
Sar_Bitrange* |
bit-range to print |
Return Type
void
No return value.
Example
segpk_ptr = op_sar_srcbuf_seg_remove (transmit_buf, MTU_SIZE);
/* retrieve a list of bit ranges from a SAR segment */
/* and print this bitrange information out for */
/* debugging purposes. */
bitrange_list_ptr = op_sar_seg_bitrange_list_get (segpk_ptr);
if (debug_mode)
{
for (i = 0; i < op_prg_list_size (bitrange_list_ptr); i++)
{
bitrange_ptr = (Sar_Bitrange *) op_prg_list_access (bitrange_list_ptr, i);
printf ("bitrange #%d:\n", i);
op_sar_bitrange_print (bitrange_ptr);
}
}
Details
This KP is primarily useful for debugging purposes. It sends the starting bit’s location in the original packet, the number of bits in the bit-range, the original packet’s size, and the original packet’s label to the standard output device.
Purpose
Provides a mechanism to view the contents of a bit-range on the standard output device.
Errors
- No errors are trapped.
Reference
- Use the KP op_sar_bitrange_create() to create new bit-ranges
- Use the KP op_sar_bitrange_destroy() to deallocate the memory associated with a bit-range
- Use the KP op_sar_bitrange_info_get() to read information contained in a bit-range
- Use the KP op_sar_seg_bitrange_list_get() to get a list of bit-ranges inside a segment