C constants and types
Common Device constants, status values, callbacks, and storage descriptors.
CORELIB_VERSION_MAJOR
#define CORELIB_VERSION_MAJOR 1uCorelib semantic major version.
CORELIB_VERSION_MINOR
#define CORELIB_VERSION_MINOR 0uCorelib semantic minor version.
CORELIB_VERSION_PATCH
#define CORELIB_VERSION_PATCH 0uCorelib semantic patch version.
CORELIB_PFP_VERSION
#define CORELIB_PFP_VERSION 1uSupported PFP version.
CORELIB_TRANSACTION_VERSION
#define CORELIB_TRANSACTION_VERSION 2uSupported Transaction Protocol version.
CORELIB_FRAME_SIZE
#define CORELIB_FRAME_SIZE 64uComplete encoded PFP frame bytes.
CORELIB_FRAME_PAYLOAD_SIZE
#define CORELIB_FRAME_PAYLOAD_SIZE 40uPFP payload bytes per frame.
CORELIB_MAX_MESSAGE_SIZE
#define CORELIB_MAX_MESSAGE_SIZE 10200uProtocol maximum complete message bytes.
CORELIB_MIN_TRANSACTION_DATA_SIZE
#define CORELIB_MIN_TRANSACTION_DATA_SIZE 64uMinimum supported opaque transaction payload bytes.
CORELIB_CAPABILITY_GATEWAY
#define CORELIB_CAPABILITY_GATEWAY 0x00000001uCapability bit identifying a gateway node.
CORELIB_CONTEXT_STORAGE_SIZE
#define CORELIB_CONTEXT_STORAGE_SIZE 2048uConservative portable storage bytes for an endpoint context.
CORELIB_PENDING_REQUEST_STORAGE_SIZE
#define CORELIB_PENDING_REQUEST_STORAGE_SIZE 64uConservative storage bytes for one pending request.
corelib_status_t
typedef enum { ... } corelib_status_t;Result of a Corelib operation.
Values: CORELIB_OK, CORELIB_INVALID_ARGUMENT, CORELIB_INVALID_STATE, CORELIB_INVALID_FRAME, CORELIB_UNSUPPORTED, CORELIB_CAPACITY_EXCEEDED, CORELIB_BUSY, CORELIB_NOT_FOUND, CORELIB_EXPIRED, CORELIB_REENTRANT.
corelib_send_result_t
typedef enum { ... } corelib_send_result_t;Result returned by the application's non-blocking frame sender.
Values: CORELIB_SEND_ACCEPTED, CORELIB_SEND_BUSY, CORELIB_SEND_FAILED.
corelib_action_t
typedef enum { ... } corelib_action_t;Generic Transaction Protocol operation delivered to the application.
Values: CORELIB_ACTION_COMMON_REQUEST, CORELIB_ACTION_COMMON_PUBLISH, CORELIB_ACTION_COMMON_RESPONSE, CORELIB_ACTION_SHARE_REQUEST, CORELIB_ACTION_SHARE_PUBLISH, CORELIB_ACTION_SHARE_RESPONSE.
corelib_transaction_result_t
typedef enum { ... } corelib_transaction_result_t;Application-level result encoded in a transaction response.
Values: CORELIB_RESULT_SUCCESS, CORELIB_RESULT_UNSUPPORTED, CORELIB_RESULT_BUSY, CORELIB_RESULT_INVALID_REQUEST, CORELIB_RESULT_INTERNAL_ERROR.
corelib_session_state_t
typedef enum { ... } corelib_session_state_t;Current PFP session lifecycle state.
Values: CORELIB_SESSION_INACTIVE, CORELIB_SESSION_ACTIVE, CORELIB_SESSION_STALE.
corelib_diagnostic_t
typedef enum { ... } corelib_diagnostic_t;Diagnostic category reported to the application.
Values: CORELIB_DIAGNOSTIC_INVALID_FRAME, CORELIB_DIAGNOSTIC_INVALID_MESSAGE, CORELIB_DIAGNOSTIC_RESOURCE_LIMIT, CORELIB_DIAGNOSTIC_SEND_FAILED, CORELIB_DIAGNOSTIC_REQUEST_EXPIRED, CORELIB_DIAGNOSTIC_TIME_REVERSED.
corelib_context_t
typedef struct corelib_context corelib_context_t;Opaque state for one independently serialized Corelib endpoint.
corelib_link_id_t
typedef uint16_t corelib_link_id_t;Application-defined identifier for a registered physical link.
corelib_send_callback_t
typedef corelib_send_result_t(* corelib_send_callback_t) (void *user, corelib_link_id_t link_id, void *transport_context, const uint8_t frame[CORELIB_FRAME_SIZE]);Attempts to enqueue one complete PFP frame without blocking.
corelib_transaction_callback_t
typedef void(* corelib_transaction_callback_t) (void *user, const corelib_transaction_t *transaction);Delivers one decoded generic transaction with borrowed payload bytes.
corelib_session_callback_t
typedef void(* corelib_session_callback_t) (void *user, corelib_session_state_t state, uint32_t session_id, uint16_t local_address);Reports a local session lifecycle change.
corelib_node_callback_t
typedef void(* corelib_node_callback_t) (void *user, const uint8_t node_uuid[16], bool reachable, uint16_t local_address);Reports local node reachability and address changes.
corelib_diagnostic_callback_t
typedef void(* corelib_diagnostic_callback_t) (void *user, corelib_diagnostic_t diagnostic, corelib_status_t status);Reports a recoverable Corelib diagnostic.
corelib_transaction_id_t
typedef struct { ... } corelib_transaction_id_t;Stable correlation identity for one application transaction.
Fields: token, share_id, action.
corelib_transaction_t
typedef struct { ... } corelib_transaction_t;Borrowed application transaction delivered during a callback.
Fields: id, data, data_size.
corelib_version_t
typedef struct { ... } corelib_version_t;Corelib and supported wire-protocol versions.
Fields: major, minor, patch, pfp_version, transaction_version.
corelib_bootstrap_assignment_t
typedef struct { ... } corelib_bootstrap_assignment_t;Profile-delivered assignment for a node that is not yet PFP-addressable.
Fields: node_uuid, session_id, transaction_id, heartbeat_interval_ms, node_address, parent_address, link_id.
corelib_usage_t
typedef struct { ... } corelib_usage_t;Snapshot of currently occupied endpoint resources.
Fields: active_reassemblies, queued_frames, pending_requests, reassembly_bytes.
corelib_limits_t
typedef struct { ... } corelib_limits_t;Fixed capacities configured for an endpoint context.
Fields: maximum_message_size, maximum_transaction_data_size, reassembly_slots, outbound_frames, pending_requests.
corelib_reassembly_storage_t
typedef struct { ... } corelib_reassembly_storage_t;Caller-owned storage used for fragmented-message reassembly.
Fields: message, received, headers.
corelib_frame_storage_t
typedef struct { ... } corelib_frame_storage_t;Caller-owned queue storage for complete PFP frames.
Fields: frames, capacity.
corelib_entry_storage_t
typedef struct { ... } corelib_entry_storage_t;Generic caller-owned fixed-entry storage description.
Fields: entries, capacity, entry_size.
corelib_storage_t
typedef struct { ... } corelib_storage_t;Complete caller-owned memory configuration for an endpoint.
Fields: reassembly, reassembly_slot_count, maximum_message_size, transaction_scratch, outbound, pending_requests.
corelib_callbacks_t
typedef struct { ... } corelib_callbacks_t;Application callback table invoked synchronously by Corelib operations.
Fields: send_frame, transaction, session_changed, node_changed, diagnostic, user.
corelib_config_t
typedef struct { ... } corelib_config_t;Immutable endpoint configuration copied during initialisation.
Fields: node_uuid, capabilities, heartbeat_interval_ms, application_response_timeout_ms, maximum_transaction_data_size, callbacks, storage.
