CDI SDK
SDK for transporting chunks of data reliably and with low latency using a polled mode network driver.
|
This file contains internal definitions and implementation used for payloads. More...
#include "protocol.h"
#include <stdbool.h>
#include <string.h>
#include "adapter_api.h"
#include "adapter_efa_probe.h"
#include "internal.h"
#include "private.h"
Data Structures | |
struct | CdiProtocolState |
Structure used to hold internal state data used by this module. More... | |
Functions | |
void | ProtocolVersionSet1 (const CdiProtocolVersionNumber *remote_version_ptr, CdiProtocolHandle protocol_handle, CdiProtocolVTableApi **ret_api_ptr) |
Set protocol version to 1. | |
bool | ProtocolVersionSet2 (const CdiProtocolVersionNumber *remote_version_ptr, CdiProtocolHandle protocol_handle, CdiProtocolVTableApi **ret_api_ptr) |
Set protocol version 2 if remote is compatible with it. | |
static void | ProtocolVersionSetInternal (const CdiProtocolVersionNumber *remote_version_ptr, CdiProtocolState *state_ptr) |
void | ProtocolVersionSetLegacy (CdiProtocolHandle *ret_handle_ptr) |
Create a protocol version using the legacy version 1, which is compatible will all SDK versions. | |
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 against the versions in the current SDK and the most recent compatible version is returned. | |
void | ProtocolVersionDestroy (CdiProtocolHandle protocol_handle) |
Freeup resources used by a protocol. | |
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. | |
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. | |
void | ProtocolPayloadPacketRxReorderInfo (CdiProtocolHandle protocol_handle, const CdiRawPacketHeader *header_ptr, CdiPacketRxReorderInfo *ret_info_ptr) |
Get Rx reorder information for the specified packet. | |
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. | |
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. | |
This file contains internal definitions and implementation used for payloads.
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.
protocol_handle | Handle of protocol version. |
encoded_data_ptr | Pointer to encoder header data. |
encoded_data_size | Size of encoded header data in bytes. |
dest_header_ptr | Address where to write decoded header data. |
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.
protocol_handle | Handle of protocol version. |
header_ptr | Address where to write raw packet header. |
header_buffer_size | Size of header buffer in bytes. |
payload_state_ptr | Pointer to TX payload state data. |
void ProtocolPayloadPacketRxReorderInfo | ( | CdiProtocolHandle | protocol_handle, |
const CdiRawPacketHeader * | header_ptr, | ||
CdiPacketRxReorderInfo * | ret_info_ptr ) |
Get Rx reorder information for the specified packet.
protocol_handle | Handle of protocol version. |
header_ptr | Pointer to raw encoded packet header to get Rx reorder information from. |
ret_info_ptr | Address where to write returned Rx reorder info. |
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.
encoded_data_ptr | Pointer to encoder header data. NOTE: The caller must not free this data until done with the decoded version, since some of the decoded values contain pointers to it. |
encoded_data_size | Size of encoded header data in bytes. |
dest_header_ptr | Address where to write decoded header data. |
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.
protocol_handle | Handle of protocol version. |
src_header_ptr | Pointer to source header data. |
dest_header_ptr | Address where to write raw probe header. |
void ProtocolVersionDestroy | ( | CdiProtocolHandle | protocol_handle | ) |
Freeup resources used by a protocol.
protocol_handle | Handle of protocol version. |
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 against the versions in the current SDK and the most recent compatible version is returned.
remote_version_ptr | Pointer to remote's protocol version. |
ret_handle_ptr | Address where to write returned protocol handle. |
|
extern |
Set protocol version to 1.
remote_version_ptr | Pointer to remote's protocol version information. |
protocol_handle | Address where to write protocol version data that is available outside of this module. |
ret_api_ptr | Address where to write protocol version VTable API. |
|
extern |
Set protocol version 2 if remote is compatible with it.
remote_version_ptr | Pointer to remote's protocol version information. |
protocol_handle | Address where to write protocol version data that is available outside of this module. |
ret_api_ptr | Address where to write protocol version VTable API. Only used if true is returned. |
|
static |
Set negotiated protocol version based on remote version and current version of the SDK.
remote_version_ptr | Pointer to remote's protocol version information. |
state_ptr | Address where to write returned protocol state data. |
void ProtocolVersionSetLegacy | ( | CdiProtocolHandle * | ret_handle_ptr | ) |
Create a protocol version using the legacy version 1, which is compatible will all SDK versions.
ret_handle_ptr | Address where to write returned protocol handle. |