CSP ID

Functions

void csp_id_prepend(csp_packet_t *packet)
[source]

Prepend CSP header fields into the packet’s data buffer.

This function encodes the CSP ID header into the packet and adjusts the data offset.

Parameters:
  • packet – Pointer to the packet to modify.

int csp_id_strip(csp_packet_t *packet)
[source]

Strip CSP header fields from the packet’s data buffer.

This function decodes the CSP ID header from the packet and adjusts the data offset.

Parameters:
  • packet – Pointer to the packet to modify.

Returns:

0 on success, -1 on failure.

int csp_id_setup_rx(csp_packet_t *packet)
[source]

Setup reception information from CSP ID header.

Typically called after stripping the header to configure addressing fields.

Parameters:
  • packet – Pointer to the received packet.

Returns:

0 on success, -1 on failure.

unsigned int csp_id_get_host_bits(void)
[source]

Get number of bits allocated for the host part of the address.

Returns:

Number of bits used for the host ID.

unsigned int csp_id_get_max_nodeid(void)
[source]

Get maximum allowed node ID.

Returns:

Maximum node ID based on current configuration.

unsigned int csp_id_get_max_port(void)
[source]

Get maximum allowed port number.

Returns:

Maximum port number.

int csp_id_is_broadcast(uint16_t addr, csp_iface_t *iface)
[source]

Check whether a given address is a broadcast address.

Parameters:
  • addr – The address to test.

  • iface – Interface to use for context (netmask, etc.).

Returns:

1 if broadcast, 0 otherwise.

Fixup Functions for ZMQ CSP v1 little-endian

static inline void csp_id_prepend_fixup_cspv1(csp_packet_t *packet)
[source]

Wrapper for csp_id_prepend when no fixup is required.

static inline int csp_id_strip_fixup_cspv1(csp_packet_t *packet)
[source]

Wrapper for csp_id_strip when no fixup is required.