12#ifndef CDI_PROTOCOL_H__
13#define CDI_PROTOCOL_H__
100#define CDI_RAW_PACKET_HEADER_SIZE_V1 (34)
106#define CDI_RAW_PACKET_HEADER_SIZE_V2 (47)
202#define CDI_RAW_PROBE_HEADER_SIZE_V1 (257)
208#define CDI_RAW_PROBE_HEADER_SIZE_V2 (253)
This file declares the public API data types, structures and functions that comprise the CDI low-leve...
CdiReturnStatus
Values used for API function return codes.
Definition cdi_core_api.h:189
This file declares the public API data types, structures and functions that comprise the CDI Pool Uti...
#define EFA_PROBE_PACKET_DATA_SIZE
Defines the EFA interface probe packet data size.
Definition configuration.h:232
The declarations in this header file correspond to the definitions in payload.c.
CdiPayloadType
Enumeration used to identify packet type.
Definition payload.h:30
#define MAX_CDI_PACKET_EXTRA_DATA
Maximum number of bytes for CDI packet #0 extra data.
Definition private_avm.h:79
void ProtocolVersionSet(const CdiProtocolVersionNumber *remote_version_ptr, CdiProtocolHandle *ret_handle_ptr)
Create a protocol version using the specified remote protocol version. The version is compared agains...
Definition protocol.c:105
int(* VtblProbeHeaderEncode)(const CdiDecodedProbeHeader *state_ptr, CdiRawProbeHeader *dest_header_ptr)
Prototype of function used for protocol version VTable API.
Definition protocol.h:261
void ProtocolVersionSetLegacy(CdiProtocolHandle *ret_handle_ptr)
Create a protocol version using the legacy version 1, which is compatible will all SDK versions.
Definition protocol.c:88
#define CDI_RAW_PACKET_HEADER_SIZE_V1
Define the size of the PacketHeaderUnion structure used in protocol V1. This is done so the size of t...
Definition protocol.h:100
int(* VtblPayloadHeaderInit)(void *header_ptr, int header_buffer_size, const TxPayloadState *payload_state_ptr)
Prototype of function used for protocol version VTable API.
Definition protocol.h:253
struct CdiProtocol * CdiProtocolHandle
Forward reference of structure to create pointers later.
Definition protocol.h:247
CdiReturnStatus ProtocolProbeHeaderDecode(const void *encoded_data_ptr, int encoded_data_size, CdiDecodedProbeHeader *dest_header_ptr)
Decode an encoded raw probe header into a header structure that is protocol version independent.
Definition protocol.c:152
void(* VtblPayloadPacketRxReorderInfo)(const CdiRawPacketHeader *header_ptr, CdiPacketRxReorderInfo *ret_info_ptr)
Prototype of function used for protocol version VTable API.
Definition protocol.h:255
void ProtocolVersionDestroy(CdiProtocolHandle protocol_handle)
Freeup resources used by a protocol.
Definition protocol.c:122
ProbeCommand
This enumeration is used in the ProbePacketHeader structure to indicate a probe command....
Definition protocol.h:146
@ kProbeCommandAck
Packet is an ACK response to a previously sent command.
Definition protocol.h:150
@ kProbeCommandPing
Request to ping the connection.
Definition protocol.h:148
@ kProbeCommandConnected
Notification that connection has been established (probe has completed).
Definition protocol.h:149
@ kProbeCommandReset
Request to reset the connection. Start with 1 so no commands have the value 0.
Definition protocol.h:147
@ kProbeCommandProtocolVersion
Packet contains protocol version of sender.
Definition protocol.h:151
int ProtocolPayloadHeaderInit(CdiProtocolHandle protocol_handle, void *header_ptr, int header_buffer_size, const TxPayloadState *payload_state_ptr)
Initialize raw packet encoded header data using the specified protocol and packet state data.
Definition protocol.c:130
#define CDI_RAW_PROBE_HEADER_SIZE_V2
Define the size of the ProbeHeaderUnion structure used in protocol V2. This is done so the size of th...
Definition protocol.h:208
void ProtocolPayloadPacketRxReorderInfo(CdiProtocolHandle protocol_handle, const CdiRawPacketHeader *header_ptr, CdiPacketRxReorderInfo *ret_info_ptr)
Get Rx reorder information for the specified packet.
Definition protocol.c:144
#define CDI_RAW_PROBE_HEADER_SIZE_V1
Define the size of the ProbeHeaderUnion structure used in protocol V1. This is done so the size of th...
Definition protocol.h:202
#define CDI_RAW_PACKET_HEADER_SIZE_V2
Define the size of the PacketHeaderUnion structure used in protocol V2. This is done so the size of t...
Definition protocol.h:106
int ProtocolProbeHeaderEncode(CdiProtocolHandle protocol_handle, CdiDecodedProbeHeader *src_header_ptr, CdiRawProbeHeader *dest_header_ptr)
Encode raw payload header data using the specified protocol and probe state data.
Definition protocol.c:176
CdiReturnStatus(* VtblProbeHeaderDecode)(const void *encoded_data_ptr, int encoded_data_size, CdiDecodedProbeHeader *dest_header_ptr)
Prototype of function used for protocol version VTable API.
Definition protocol.h:258
void(* VtblPayloadHeaderDecode)(const void *encoded_data_ptr, int encoded_data_size, CdiDecodedPacketHeader *dest_header_ptr)
Prototype of function used for protocol version VTable API.
Definition protocol.h:250
void ProtocolPayloadHeaderDecode(CdiProtocolHandle protocol_handle, void *encoded_data_ptr, int encoded_data_size, CdiDecodedPacketHeader *dest_header_ptr)
Decode an encoded raw header into a header structure that is protocol version independent.
Definition protocol.c:137
Structure definition behind the connection handles shared with the user's application program....
Definition private.h:371
CDI decoded header for payload packets that contains a data offset value (payload type is kPayloadTyp...
Definition protocol.h:53
int payload_data_offset
Current offset of payload data.
Definition protocol.h:54
CDI decoded header for payload packet #0. This packet never uses payload_data_offset,...
Definition protocol.h:61
uint64_t payload_user_data
User data provided by transmitter that is related to the payload.
Definition protocol.h:67
uint64_t tx_start_time_microseconds
Payload Tx start time in microseconds since epoch. NOTE: Only valid for protocols 2 and later.
Definition protocol.h:73
CdiPtpTimestamp origination_ptp_timestamp
Origination RTP timestamp provided by transmitter that is related to the payload.
Definition protocol.h:66
void * extra_data_ptr
Pointer to extra data.
Definition protocol.h:70
int extra_data_size
Size of additional header data in bytes.
Definition protocol.h:69
int total_payload_size
Total size of payload in bytes.
Definition protocol.h:62
uint64_t max_latency_microsecs
Maximum latency payload in microseconds.
Definition protocol.h:63
Control ACK packet that is a response for a transmitted command.
Definition protocol.h:164
uint16_t ack_control_packet_num
Command's control packet number that ACK corresponds to.
Definition protocol.h:166
ProbeCommand ack_command
Command that ACK corresponds to.
Definition protocol.h:165
Probe command packet that is being transmitted.
Definition protocol.h:157
bool requires_ack
A control flag that, when true, indicates the specified command requires ack.
Definition protocol.h:158
Structure used to hold packet data used by Rx packet reordering.
Definition protocol.h:137
int packet_sequence_num
Packet sequence number for the payload.
Definition protocol.h:139
int payload_num
Payload number the packet is associated with.
Definition protocol.h:138
Type used to hold V-table of APIs that must be implemented by payload protocol versions.
Definition protocol.h:266
VtblPayloadHeaderDecode header_decode
Function pointer used to decode a raw packet header.
Definition protocol.h:267
VtblPayloadHeaderInit header_init
Function pointer used to initialize a raw packet header.
Definition protocol.h:268
VtblProbeHeaderDecode probe_decode
Function pointer used to decode a raw probe header.
Definition protocol.h:270
VtblProbeHeaderEncode probe_encode
Function pointer used to encode a raw probe header.
Definition protocol.h:271
VtblPayloadPacketRxReorderInfo rx_reorder_info
Function pointer used to get packet Rx reorder information.
Definition protocol.h:269
CDI header used to identify protocol version number information.
Definition protocol.h:38
uint8_t probe_version_num
CDI probe version number.
Definition protocol.h:41
uint8_t major_version_num
CDI protocol major version number.
Definition protocol.h:40
uint8_t version_num
CDI protocol version number.
Definition protocol.h:39
Structure used to hold negotiated protocol version information.
Definition protocol.h:242
CdiProtocolVersionNumber negotiated_version
Negotiated protocol version number.
Definition protocol.h:243
int payload_num_max
Maximum value for payload number. See CdiDecodedPacketHeader.payload_num.
Definition protocol.h:244
A structure for holding a PTP timestamp defined in seconds and nanoseconds. This PTP time as defined ...
Definition cdi_core_api.h:331
Packet format used by probe when sending probe packets over the EFA interface.
Definition protocol.h:213
uint16_t packet_sequence_num
Probe packet sequence number.
Definition protocol.h:214
This defines a structure that contains all of the state information for sending a single payload.
Definition private.h:141