SolarCapture C Bindings User Guide  SF-115721-CD
Issue 3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
packed_stream.h File Reference

sc_packed_packet: The packed-stream encapsulation. More...

Data Structures

struct  sc_packed_packet
 A packed-stream packet. More...
 

Macros

#define SC_PS_FLAG_CLOCK_SET   0x1
 
#define SC_PS_FLAG_CLOCK_IN_SYNC   0x2
 
#define SC_PS_FLAG_BAD_FCS   0x4
 
#define SC_PS_FLAG_BAD_L4_CSUM   0x8
 
#define SC_PS_FLAG_BAD_L3_CSUM   0x10
 

Functions

struct sc_packed_packet __attribute__ ((packed))
 
static struct sc_packed_packetsc_packed_packet_next (const struct sc_packed_packet *ps_pkt)
 Iterate from one packed-stream header to the next. More...
 
static void * sc_packed_packet_payload (const struct sc_packed_packet *ps_pkt)
 Return a pointer to the packet payload. More...
 
static struct sc_packed_packetsc_packet_packed_first (struct sc_packet *pkt)
 Return the first packet header in a packed-stream buffer. More...
 
static struct sc_packed_packetsc_packet_packed_end (struct sc_packet *pkt)
 Return a pointer to the end of a packed-stream buffer. More...
 
static struct sc_packed_packetsc_packet_iov_packed_first (struct sc_packet *pkt, unsigned iov_i)
 
static struct sc_packed_packetsc_packet_iov_packed_end (struct sc_packet *pkt, unsigned iov_i)
 

Variables

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

sc_packed_packet: The packed-stream encapsulation.

Macro Definition Documentation

#define SC_PS_FLAG_BAD_FCS   0x4

Mask for sc_packed_packet flags, bad FCS

#define SC_PS_FLAG_BAD_L3_CSUM   0x10

Mask for sc_packed_packet flags, bad layer 3 checksum

#define SC_PS_FLAG_BAD_L4_CSUM   0x8

Mask for sc_packed_packet flags, bad layer 4 checksum

#define SC_PS_FLAG_CLOCK_IN_SYNC   0x2

Mask for sc_packed_packet flags, clock in sync

#define SC_PS_FLAG_CLOCK_SET   0x1

Mask for sc_packed_packet flags, clock set

Function Documentation

static struct sc_packed_packet* sc_packed_packet_next ( const struct sc_packed_packet ps_pkt)
static

Iterate from one packed-stream header to the next.

Parameters
ps_pktA packed-stream packet header
Returns
The next packed-stream packet in the buffer.
static void* sc_packed_packet_payload ( const struct sc_packed_packet ps_pkt)
inlinestatic

Return a pointer to the packet payload.

Parameters
ps_pktA packed-stream packet header
Returns
The start of the packet payload.
static struct sc_packed_packet* sc_packet_packed_end ( struct sc_packet pkt)
static

Return a pointer to the end of a packed-stream buffer.

Parameters
pktAn sc_packet containing packed-stream encoded packets
Returns
A pointer to the end of the buffer. This can be compared with the pointer returned by sc_packed_packet_next() to determine whether the last packet has been consumed.
static struct sc_packed_packet* sc_packet_packed_first ( struct sc_packet pkt)
static

Return the first packet header in a packed-stream buffer.

Parameters
pktAn sc_packet containing packed-stream encoded packets
Returns
The sc_packed_packet header for the first packet.

Variable 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).