SolarCapture C Bindings User Guide  SF-115721-CD
Issue 3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sc_packed_packet Struct Reference

A packed-stream packet. More...

#include <packed_stream.h>

Data Fields

uint16_t ps_next_offset
 
uint8_t ps_pkt_start_offset
 
uint8_t ps_flags
 
uint16_t ps_cap_len
 
uint16_t ps_orig_len
 
uint32_t ps_ts_sec
 
uint32_t ps_ts_nsec
 

Detailed Description

A packed-stream packet.

Packed-stream is an encapsulation that encodes multiple packets or other data in a buffer. Each packet is represented by an sc_packed_packet header which gives information about the packet stored and the offset to the next packet in the buffer.

The offset of the last packet in the buffer must generate a pointer that lies beyond the end of the buffer containing packed-stream data.

The following example code shows how to iterate over the set of packets stored in an sc_packet that contains packed-stream packets:

void do_something_to_each(struct sc_packet* pkt)
{
struct sc_packed_packet* ps_end = sc_packet_packed_end(pkt);
for( ; ps_pkt < ps_end; ps_pkt = sc_packed_packet_next(ps_pkt) )
do_something(sc_packed_packet_payload(ps_pkt), ps_pkt->ps_cap_len);
}

Field Documentation

uint16_t ps_cap_len

Number of bytes of packet payload stored.

uint8_t ps_flags

SC_PS_FLAG_* flags.

uint16_t ps_next_offset

Offset of next packet from start of this struct.

uint16_t ps_orig_len

Original length of the frame.

uint8_t ps_pkt_start_offset

Offset of packet payload from start of this struct.

uint32_t ps_ts_nsec

Timestamp (nanoseconds).

uint32_t ps_ts_sec

Timestamp (seconds).


The documentation for this struct was generated from the following file: