Mercury
Classes | Macros | Typedefs | Enumerations | Functions
na.h File Reference
#include "na_config.h"
#include <limits.h>
Include dependency graph for na.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  na_segment
 
struct  na_cb_info_lookup
 
struct  na_cb_info_recv_unexpected
 
struct  na_cb_info
 

Macros

#define NA_ADDR_NULL   ((na_addr_t)0)
 
#define NA_OP_ID_NULL   ((na_op_id_t)0)
 
#define NA_OP_ID_IGNORE   ((na_op_id_t *)1)
 
#define NA_MEM_HANDLE_NULL   ((na_mem_handle_t)0)
 
#define NA_MAX_IDLE_TIME   (3600*1000)
 
#define NA_TAG_UB   UINT_MAX
 
#define NA_MAX_ADDR_LEN   256
 
#define NA_MEM_READWRITE   0x00
 
#define NA_MEM_READ_ONLY   0x01
 

Typedefs

typedef struct na_class na_class_t
 
typedef struct na_context na_context_t
 
typedef void * na_addr_t
 
typedef na_uint64_t na_size_t
 
typedef na_uint32_t na_tag_t
 
typedef void * na_op_id_t
 
typedef void * na_mem_handle_t
 
typedef na_uint64_t na_offset_t
 
typedef enum na_return na_return_t
 
typedef enum na_cb_type na_cb_type_t
 
typedef na_return_t(* na_cb_t )(const struct na_cb_info *callback_info)
 

Enumerations

enum  na_return {
  NA_SUCCESS, NA_CANCELED, NA_TIMEOUT, NA_INVALID_PARAM,
  NA_SIZE_ERROR, NA_ALIGNMENT_ERROR, NA_PERMISSION_ERROR, NA_NOMEM_ERROR,
  NA_PROTOCOL_ERROR
}
 
enum  na_cb_type {
  NA_CB_LOOKUP, NA_CB_SEND_UNEXPECTED, NA_CB_RECV_UNEXPECTED, NA_CB_SEND_EXPECTED,
  NA_CB_RECV_EXPECTED, NA_CB_PUT, NA_CB_GET
}
 

Functions

NA_EXPORT na_class_tNA_Initialize (const char *info_string, na_bool_t listen) NA_WARN_UNUSED_RESULT
 Initialize the network abstraction layer. More...
 
NA_EXPORT na_return_t NA_Finalize (na_class_t *na_class)
 Finalize the network abstraction layer. More...
 
NA_EXPORT na_context_tNA_Context_create (na_class_t *na_class)
 Create a new context. More...
 
NA_EXPORT na_return_t NA_Context_destroy (na_class_t *na_class, na_context_t *context)
 Destroy a context created by using NA_Context_create(). More...
 
NA_EXPORT na_return_t NA_Addr_lookup (na_class_t *na_class, na_context_t *context, na_cb_t callback, void *arg, const char *name, na_op_id_t *op_id)
 Lookup an addr from a peer address/name. More...
 
NA_EXPORT na_return_t NA_Addr_lookup_wait (na_class_t *na_class, const char *name, na_addr_t *addr)
 For compatibility, temporarily provide this routine, which waits until addr is returned. More...
 
NA_EXPORT na_return_t NA_Addr_free (na_class_t *na_class, na_addr_t addr)
 Free the addr from the list of peers. More...
 
NA_EXPORT na_return_t NA_Addr_self (na_class_t *na_class, na_addr_t *addr)
 Access self address. More...
 
NA_EXPORT na_return_t NA_Addr_dup (na_class_t *na_class, na_addr_t addr, na_addr_t *new_addr)
 Duplicate an existing NA abstract address. More...
 
NA_EXPORT na_bool_t NA_Addr_is_self (na_class_t *na_class, na_addr_t addr)
 Test whether address is self or not. More...
 
NA_EXPORT na_return_t NA_Addr_to_string (na_class_t *na_class, char *buf, na_size_t buf_size, na_addr_t addr)
 Convert an addr to a string (returned string includes the terminating null byte '\0'). More...
 
NA_EXPORT na_size_t NA_Msg_get_max_expected_size (na_class_t *na_class) NA_WARN_UNUSED_RESULT
 Get the maximum size of messages supported by expected send/recv. More...
 
NA_EXPORT na_size_t NA_Msg_get_max_unexpected_size (na_class_t *na_class) NA_WARN_UNUSED_RESULT
 Get the maximum size of messages supported by unexpected send/recv. More...
 
NA_EXPORT na_tag_t NA_Msg_get_max_tag (na_class_t *na_class) NA_WARN_UNUSED_RESULT
 Get the maximum tag value that can be used by send/recv. More...
 
NA_EXPORT na_return_t NA_Msg_send_unexpected (na_class_t *na_class, na_context_t *context, na_cb_t callback, void *arg, const void *buf, na_size_t buf_size, na_addr_t dest, na_tag_t tag, na_op_id_t *op_id)
 Send an unexpected message to dest. More...
 
NA_EXPORT na_return_t NA_Msg_recv_unexpected (na_class_t *na_class, na_context_t *context, na_cb_t callback, void *arg, void *buf, na_size_t buf_size, na_op_id_t *op_id)
 Receive an unexpected message. More...
 
NA_EXPORT na_return_t NA_Msg_send_expected (na_class_t *na_class, na_context_t *context, na_cb_t callback, void *arg, const void *buf, na_size_t buf_size, na_addr_t dest, na_tag_t tag, na_op_id_t *op_id)
 Send an expected message to dest. More...
 
NA_EXPORT na_return_t NA_Msg_recv_expected (na_class_t *na_class, na_context_t *context, na_cb_t callback, void *arg, void *buf, na_size_t buf_size, na_addr_t source, na_tag_t tag, na_op_id_t *op_id)
 Receive an expected message from source. More...
 
NA_EXPORT na_return_t NA_Mem_handle_create (na_class_t *na_class, void *buf, na_size_t buf_size, unsigned long flags, na_mem_handle_t *mem_handle)
 Create memory handle for RMA operations. More...
 
NA_EXPORT na_return_t NA_Mem_handle_create_segments (na_class_t *na_class, struct na_segment *segments, na_size_t segment_count, unsigned long flags, na_mem_handle_t *mem_handle)
 Create memory handle for RMA operations. More...
 
NA_EXPORT na_return_t NA_Mem_handle_free (na_class_t *na_class, na_mem_handle_t mem_handle)
 Free memory handle. More...
 
NA_EXPORT na_return_t NA_Mem_register (na_class_t *na_class, na_mem_handle_t mem_handle)
 Register memory for RMA operations. More...
 
NA_EXPORT na_return_t NA_Mem_deregister (na_class_t *na_class, na_mem_handle_t mem_handle)
 Unregister memory. More...
 
NA_EXPORT na_size_t NA_Mem_handle_get_serialize_size (na_class_t *na_class, na_mem_handle_t mem_handle) NA_WARN_UNUSED_RESULT
 Get size required to serialize handle. More...
 
NA_EXPORT na_return_t NA_Mem_handle_serialize (na_class_t *na_class, void *buf, na_size_t buf_size, na_mem_handle_t mem_handle)
 Serialize memory handle into a buffer. More...
 
NA_EXPORT na_return_t NA_Mem_handle_deserialize (na_class_t *na_class, na_mem_handle_t *mem_handle, const void *buf, na_size_t buf_size)
 Deserialize memory handle from buffer. More...
 
NA_EXPORT na_return_t NA_Put (na_class_t *na_class, na_context_t *context, na_cb_t callback, void *arg, na_mem_handle_t local_mem_handle, na_offset_t local_offset, na_mem_handle_t remote_mem_handle, na_offset_t remote_offset, na_size_t data_size, na_addr_t remote_addr, na_op_id_t *op_id)
 Put data to remote target. More...
 
NA_EXPORT na_return_t NA_Get (na_class_t *na_class, na_context_t *context, na_cb_t callback, void *arg, na_mem_handle_t local_mem_handle, na_offset_t local_offset, na_mem_handle_t remote_mem_handle, na_offset_t remote_offset, na_size_t data_size, na_addr_t remote_addr, na_op_id_t *op_id)
 Get data from remote target. More...
 
NA_EXPORT na_return_t NA_Progress (na_class_t *na_class, na_context_t *context, unsigned int timeout)
 Try to progress communication for at most timeout until timeout reached or any completion has occurred. More...
 
NA_EXPORT na_return_t NA_Trigger (na_context_t *context, unsigned int timeout, unsigned int max_count, unsigned int *actual_count)
 Execute at most max_count callbacks. More...
 
NA_EXPORT na_return_t NA_Cancel (na_class_t *na_class, na_context_t *context, na_op_id_t op_id)
 Cancel an ongoing operation. More...
 
NA_EXPORT const char * NA_Error_to_string (na_return_t errnum) NA_WARN_UNUSED_RESULT
 Convert error return code to string (null terminated). More...
 

Macro Definition Documentation

#define NA_ADDR_NULL   ((na_addr_t)0)

Definition at line 35 of file na.h.

#define NA_OP_ID_NULL   ((na_op_id_t)0)

Definition at line 36 of file na.h.

#define NA_OP_ID_IGNORE   ((na_op_id_t *)1)

Definition at line 37 of file na.h.

#define NA_MEM_HANDLE_NULL   ((na_mem_handle_t)0)

Definition at line 38 of file na.h.

#define NA_MAX_IDLE_TIME   (3600*1000)

Definition at line 41 of file na.h.

#define NA_TAG_UB   UINT_MAX

Definition at line 45 of file na.h.

#define NA_MAX_ADDR_LEN   256

Definition at line 48 of file na.h.

#define NA_MEM_READWRITE   0x00

Definition at line 52 of file na.h.

#define NA_MEM_READ_ONLY   0x01

Definition at line 53 of file na.h.

Typedef Documentation

typedef struct na_class na_class_t

Definition at line 18 of file na.h.

typedef struct na_context na_context_t

Definition at line 19 of file na.h.

typedef void* na_addr_t

Definition at line 20 of file na.h.

typedef na_uint64_t na_size_t

Definition at line 21 of file na.h.

typedef na_uint32_t na_tag_t

Definition at line 22 of file na.h.

typedef void* na_op_id_t

Definition at line 23 of file na.h.

typedef void* na_mem_handle_t

Definition at line 25 of file na.h.

typedef na_uint64_t na_offset_t

Definition at line 26 of file na.h.

typedef enum na_return na_return_t
typedef enum na_cb_type na_cb_type_t
typedef na_return_t(* na_cb_t)(const struct na_cb_info *callback_info)

Definition at line 103 of file na.h.

Enumeration Type Documentation

enum na_return
Enumerator
NA_SUCCESS 
NA_CANCELED 
NA_TIMEOUT 
NA_INVALID_PARAM 
NA_SIZE_ERROR 
NA_ALIGNMENT_ERROR 
NA_PERMISSION_ERROR 
NA_NOMEM_ERROR 
NA_PROTOCOL_ERROR 

Definition at line 57 of file na.h.

enum na_cb_type
Enumerator
NA_CB_LOOKUP 
NA_CB_SEND_UNEXPECTED 
NA_CB_RECV_UNEXPECTED 
NA_CB_SEND_EXPECTED 
NA_CB_RECV_EXPECTED 
NA_CB_PUT 
NA_CB_GET 

Definition at line 70 of file na.h.

Function Documentation

NA_EXPORT na_class_t* NA_Initialize ( const char *  info_string,
na_bool_t  listen 
)

Initialize the network abstraction layer.

Parameters
info_string[IN] host address with port number (e.g., "tcp://localhost:3344" or "bmi+tcp://localhost:3344")
listen[IN] listen for incoming connections
Returns
Pointer to NA class or NULL in case of failure
NA_EXPORT na_return_t NA_Finalize ( na_class_t na_class)

Finalize the network abstraction layer.

Parameters
na_class[IN] pointer to NA class
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_context_t* NA_Context_create ( na_class_t na_class)

Create a new context.

Parameters
na_class[IN] pointer to NA class
Returns
Pointer to NA context or NULL in case of failure
NA_EXPORT na_return_t NA_Context_destroy ( na_class_t na_class,
na_context_t context 
)

Destroy a context created by using NA_Context_create().

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Addr_lookup ( na_class_t na_class,
na_context_t context,
na_cb_t  callback,
void *  arg,
const char *  name,
na_op_id_t op_id 
)

Lookup an addr from a peer address/name.

Addresses need to be freed by calling NA_Addr_free. Callback will be called with pointer to na_addr_t that contains addr na_cb_info_lookup

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
callback[IN] pointer to function callback
arg[IN] pointer to data passed to callback
name[IN] lookup name
op_id[OUT] pointer to returned operation ID
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Addr_lookup_wait ( na_class_t na_class,
const char *  name,
na_addr_t addr 
)

For compatibility, temporarily provide this routine, which waits until addr is returned.

Parameters
na_class[IN] pointer to NA class
name[IN] lookup name
addr[OUT] pointer to abstract address
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Addr_free ( na_class_t na_class,
na_addr_t  addr 
)

Free the addr from the list of peers.

Parameters
na_class[IN] pointer to NA class
addr[IN] abstract address
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Addr_self ( na_class_t na_class,
na_addr_t addr 
)

Access self address.

Parameters
na_class[IN] pointer to NA class
addr[OUT] pointer to abstract address
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Addr_dup ( na_class_t na_class,
na_addr_t  addr,
na_addr_t new_addr 
)

Duplicate an existing NA abstract address.

The duplicated address can be stored for later use and the origin address be freed safely. The duplicated address must be freed with NA_Addr_free.

Parameters
na_class[IN] pointer to NA class
addr[IN] abstract address
new_addr[OUT] pointer to abstract address
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_bool_t NA_Addr_is_self ( na_class_t na_class,
na_addr_t  addr 
)

Test whether address is self or not.

Parameters
na_class[IN] pointer to NA class
addr[IN] abstract address
Returns
NA_TRUE if self or NA_FALSE if not
NA_EXPORT na_return_t NA_Addr_to_string ( na_class_t na_class,
char *  buf,
na_size_t  buf_size,
na_addr_t  addr 
)

Convert an addr to a string (returned string includes the terminating null byte '\0').

Parameters
na_class[IN] pointer to NA class
buf[IN/OUT] pointer to destination buffer
buf_size[IN] buffer size (max string length is defined by NA_MAX_ADDR_LEN)
addr[IN] abstract address
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_size_t NA_Msg_get_max_expected_size ( na_class_t na_class)

Get the maximum size of messages supported by expected send/recv.

Small message size that may differ from the unexpected message size.

Parameters
na_class[IN] pointer to NA class
Returns
Non-negative value
NA_EXPORT na_size_t NA_Msg_get_max_unexpected_size ( na_class_t na_class)

Get the maximum size of messages supported by unexpected send/recv.

Small message size.

Parameters
na_class[IN] pointer to NA class
Returns
Non-negative value
NA_EXPORT na_tag_t NA_Msg_get_max_tag ( na_class_t na_class)

Get the maximum tag value that can be used by send/recv.

(both expected and unexpected)

Parameters
na_class[IN] pointer to NA class
Returns
Non-negative value
NA_EXPORT na_return_t NA_Msg_send_unexpected ( na_class_t na_class,
na_context_t context,
na_cb_t  callback,
void *  arg,
const void *  buf,
na_size_t  buf_size,
na_addr_t  dest,
na_tag_t  tag,
na_op_id_t op_id 
)

Send an unexpected message to dest.

Unexpected sends do not require a matching receive to complete. Note also that unexpected messages do not require an unexpected receive to be posted at the destination before sending the message and the destination is allowed to drop the message without notification.

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
callback[IN] pointer to function callback
arg[IN] pointer to data passed to callback
buf[IN] pointer to send buffer
buf_size[IN] buffer size
dest[IN] abstract address of destination
tag[IN] tag attached to message
op_id[OUT] pointer to returned operation ID
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Msg_recv_unexpected ( na_class_t na_class,
na_context_t context,
na_cb_t  callback,
void *  arg,
void *  buf,
na_size_t  buf_size,
na_op_id_t op_id 
)

Receive an unexpected message.

Unexpected receives may wait on ANY_TAG and ANY_SOURCE depending on the implementation.

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
callback[IN] pointer to function callback
arg[IN] pointer to data passed to callback
buf[IN] pointer to send buffer
buf_size[IN] buffer size
op_id[OUT] pointer to returned operation ID
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Msg_send_expected ( na_class_t na_class,
na_context_t context,
na_cb_t  callback,
void *  arg,
const void *  buf,
na_size_t  buf_size,
na_addr_t  dest,
na_tag_t  tag,
na_op_id_t op_id 
)

Send an expected message to dest.

Note that expected messages require an expected receive to be posted at the destination before sending the message, otherwise the destination is allowed to drop the message without notification.

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
callback[IN] pointer to function callback
arg[IN] pointer to data passed to callback
buf[IN] pointer to send buffer
buf_size[IN] buffer size
dest[IN] abstract address of destination
tag[IN] tag attached to message
op_id[OUT] pointer to returned operation ID
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Msg_recv_expected ( na_class_t na_class,
na_context_t context,
na_cb_t  callback,
void *  arg,
void *  buf,
na_size_t  buf_size,
na_addr_t  source,
na_tag_t  tag,
na_op_id_t op_id 
)

Receive an expected message from source.

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
callback[IN] pointer to function callback
arg[IN] pointer to data passed to callback
buf[IN] pointer to receive buffer
buf_size[IN] buffer size
source[IN] abstract address of source
tag[IN] matching tag used to receive message
op_id[OUT] pointer to returned operation ID
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Mem_handle_create ( na_class_t na_class,
void *  buf,
na_size_t  buf_size,
unsigned long  flags,
na_mem_handle_t mem_handle 
)

Create memory handle for RMA operations.

For non-contiguous memory, use NA_Mem_handle_create_segments instead.

Note to plugin developers: NA_Mem_handle_create may be called multiple times on the same memory region.

Parameters
na_class[IN] pointer to NA class
buf[IN] pointer to buffer that needs to be registered
buf_size[IN] buffer size
flags[IN] permission flag:
  • NA_MEM_READWRITE
  • NA_MEM_READ_ONLY
mem_handle[OUT] pointer to returned abstract memory handle
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Mem_handle_create_segments ( na_class_t na_class,
struct na_segment segments,
na_size_t  segment_count,
unsigned long  flags,
na_mem_handle_t mem_handle 
)

Create memory handle for RMA operations.

Create_segments can be used to register fragmented pieces and get a single memory handle. Implemented only if the network transport or hardware supports it.

Parameters
na_class[IN] pointer to NA class
segments[IN] pointer to array of segments composed of:
  • address of the segment that needs to be registered
  • size of the segment in bytes
segment_count[IN] segment count
flags[IN] permission flag:
  • NA_MEM_READWRITE
  • NA_MEM_READ_ONLY
mem_handle[OUT] pointer to returned abstract memory handle
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Mem_handle_free ( na_class_t na_class,
na_mem_handle_t  mem_handle 
)

Free memory handle.

Parameters
na_class[IN] pointer to NA class
mem_handle[IN] abstract memory handle
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Mem_register ( na_class_t na_class,
na_mem_handle_t  mem_handle 
)

Register memory for RMA operations.

Memory pieces must be registered before one-sided transfers can be initiated.

Parameters
na_class[IN] pointer to NA class
mem_handle[IN] pointer to abstract memory handle
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Mem_deregister ( na_class_t na_class,
na_mem_handle_t  mem_handle 
)

Unregister memory.

Parameters
na_class[IN] pointer to NA class
mem_handle[IN] abstract memory handle
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_size_t NA_Mem_handle_get_serialize_size ( na_class_t na_class,
na_mem_handle_t  mem_handle 
)

Get size required to serialize handle.

Parameters
na_class[IN] pointer to NA class
mem_handle[IN] abstract memory handle
Returns
Non-negative value
NA_EXPORT na_return_t NA_Mem_handle_serialize ( na_class_t na_class,
void *  buf,
na_size_t  buf_size,
na_mem_handle_t  mem_handle 
)

Serialize memory handle into a buffer.

One-sided transfers require prior exchange of memory handles between peers, serialization callbacks can be used to "pack" a memory handle and send it across the network. NB. Memory handles can be variable size, therefore the space required to serialize a handle into a buffer can be obtained using NA_Mem_handle_get_serialize_size.

Parameters
na_class[IN] pointer to NA class
buf[IN/OUT] pointer to buffer used for serialization
buf_size[IN] buffer size
mem_handle[IN] abstract memory handle
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Mem_handle_deserialize ( na_class_t na_class,
na_mem_handle_t mem_handle,
const void *  buf,
na_size_t  buf_size 
)

Deserialize memory handle from buffer.

Parameters
na_class[IN] pointer to NA class
mem_handle[OUT] pointer to abstract memory handle
buf[IN] pointer to buffer used for deserialization
buf_size[IN] buffer size
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Put ( na_class_t na_class,
na_context_t context,
na_cb_t  callback,
void *  arg,
na_mem_handle_t  local_mem_handle,
na_offset_t  local_offset,
na_mem_handle_t  remote_mem_handle,
na_offset_t  remote_offset,
na_size_t  data_size,
na_addr_t  remote_addr,
na_op_id_t op_id 
)

Put data to remote target.

Initiate a put or get to/from the registered memory regions with the given offset/size. NB. Memory must be registered and handles exchanged between peers.

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
callback[IN] pointer to function callback
arg[IN] pointer to data passed to callback
local_mem_handle[IN] abstract local memory handle
local_offset[IN] local offset
remote_mem_handle[IN] abstract remote memory handle
remote_offset[IN] remote offset
data_size[IN] size of data that needs to be transferred
remote_addr[IN] abstract address of remote destination
op_id[OUT] pointer to returned operation ID
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Get ( na_class_t na_class,
na_context_t context,
na_cb_t  callback,
void *  arg,
na_mem_handle_t  local_mem_handle,
na_offset_t  local_offset,
na_mem_handle_t  remote_mem_handle,
na_offset_t  remote_offset,
na_size_t  data_size,
na_addr_t  remote_addr,
na_op_id_t op_id 
)

Get data from remote target.

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
callback[IN] pointer to function callback
arg[IN] pointer to data passed to callback
local_mem_handle[IN] abstract local memory handle
local_offset[IN] local offset
remote_mem_handle[IN] abstract remote memory handle
remote_offset[IN] remote offset
data_size[IN] size of data that needs to be transferred
remote_addr[IN] abstract address of remote source
op_id[OUT] pointer to returned operation ID
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Progress ( na_class_t na_class,
na_context_t context,
unsigned int  timeout 
)

Try to progress communication for at most timeout until timeout reached or any completion has occurred.

Progress should not be considered as wait, in the sense that it cannot be assumed that completion of a specific operation will occur only when progress is called.

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
timeout[IN] timeout (in milliseconds)
Returns
NA_SUCCESS if any completion has occurred / NA error code otherwise
NA_EXPORT na_return_t NA_Trigger ( na_context_t context,
unsigned int  timeout,
unsigned int  max_count,
unsigned int *  actual_count 
)

Execute at most max_count callbacks.

If timeout is non-zero, wait up to timeout before returning. Function can return when at least one or more callbacks are triggered (at most max_count).

Parameters
context[IN] pointer to context of execution
timeout[IN] timeout (in milliseconds)
max_count[IN] maximum number of callbacks triggered
actual_count[IN] actual number of callbacks triggered
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT na_return_t NA_Cancel ( na_class_t na_class,
na_context_t context,
na_op_id_t  op_id 
)

Cancel an ongoing operation.

Parameters
na_class[IN] pointer to NA class
context[IN] pointer to context of execution
op_id[IN] operation ID
Returns
NA_SUCCESS or corresponding NA error code
NA_EXPORT const char* NA_Error_to_string ( na_return_t  errnum)

Convert error return code to string (null terminated).

Parameters
errnum[IN] error return code
Returns
String