nm_rpc_private.h
Go to the documentation of this file.
96 assert((void*)&p_reqs[0]->request == (void*)p_reqs[0]); /* nm_sr_request_t must be the first field in nm_rpc_req_s */
145 assert(nm_datav_size(&p_token->bodyv) == 0); /* all headers must be unpacked before body chunks */
146 const nm_len_t peek_offset = nm_datav_size(&p_token->headerv); /* compute size of headers so far */
151 int rc = nm_sr_recv_peek_offset(p_token->p_service->p_session, &p_token->request, &datav, peek_offset, peek_size);
167static inline void nm_rpc_irecv_body_data(struct nm_rpc_token_s*p_token, struct nm_data_s*p_body)
static void nm_datav_uncommit(struct nm_datav_s *p_datav)
'uncommit' a datav: explicitely declare that nm_data pointing to this datav has been destroyed.
Definition nm_data.h:875
static nm_len_t nm_datav_size(struct nm_datav_s *p_datav)
get the size (number of bytes) of data contained in the datav
Definition nm_data.h:864
static void nm_datav_add_chunk_data(struct nm_datav_s *p_datav, const struct nm_data_s *p_data)
add a chunk of data to datav; given p_data content is copied.
Definition nm_data.h:829
static nm_len_t nm_data_size(const struct nm_data_s *p_data)
returns the amount of data contained in the descriptor
Definition nm_data.h:673
nm_status_t nm_cond_status_t
status with synchronization (wait/signal)
Definition nm_core_interface.h:155
void(* nm_rpc_handler_t)(nm_rpc_token_t p_token)
a RPC handler called upon request invocation
Definition nm_rpc_interface.h:79
nm_rpc_req_t nm_rpc_isend(nm_rpc_service_t p_service, nm_gate_t p_gate, nm_tag_t tag, void *hptr, nm_len_t hlen, struct nm_data_s *p_body)
Legacy function to send an rpc request with one header and one nm_data body; non-blocking.
void(* nm_rpc_req_notifier_t)(nm_rpc_req_t p_req, void *ref)
a RPC req notifier, called when the request send operation is completed
Definition nm_rpc_interface.h:85
void(* nm_rpc_finalizer_t)(nm_rpc_token_t p_token)
a RPC finalizer, called when all data has been received
Definition nm_rpc_interface.h:82
static nm_gate_t nm_sr_request_get_gate(nm_sr_request_t *p_request)
static nm_tag_t nm_sr_request_get_tag(nm_sr_request_t *p_request)
Retrieve the tag from a sendrecv request.
static void nm_sr_request_wait_all(nm_sr_request_t **p_requests, int n)
wait for completion of an array of requests
assert(p_data->ops.p_traversal !=NULL)
static void nm_data_contiguous_build(struct nm_data_s *p_data, void *ptr, nm_len_t len)
Definition nm_data.h:560
static void nm_data_datav_build(struct nm_data_s *p_datav_data, struct nm_datav_s *p_datav)
frontend to build a nm_data from a datav
Definition nm_data.h:598
Basic primitives to display info & warnings.
static void nm_rpc_req_set_priority(nm_rpc_req_t p_req, nm_prio_t priority)
Definition nm_rpc_private.h:83
static nm_rpc_service_t nm_rpc_get_service(struct nm_rpc_token_s *p_token)
Definition nm_rpc_private.h:123
static void nm_rpc_recv_header(nm_rpc_token_t p_token, void *hptr, nm_len_t hlen)
Definition nm_rpc_private.h:160
void nm_rpc_req_delete(nm_rpc_req_t p_rpc_req)
static void * nm_rpc_service_get_ref(struct nm_rpc_service_s *p_service)
Definition nm_rpc_private.h:106
PUK_LIST_DECLARE_TYPE(nm_rpc_token)
static void nm_rpc_token_set_ref(struct nm_rpc_token_s *p_token, void *ref)
Definition nm_rpc_private.h:133
static void nm_rpc_send(nm_rpc_service_t p_service, nm_gate_t p_gate, nm_tag_t tag, void *hptr, nm_len_t hlen, struct nm_data_s *p_body)
Definition nm_rpc_private.h:76
static void nm_rpc_irecv_body(nm_rpc_token_t p_token, void *ptr, nm_len_t len)
Definition nm_rpc_private.h:172
PUK_LIST_CREATE_FUNCS(nm_rpc_token)
static nm_tag_t nm_rpc_get_tag(struct nm_rpc_token_s *p_token)
Definition nm_rpc_private.h:117
static void * nm_rpc_token_get_ref(struct nm_rpc_token_s *p_token)
Definition nm_rpc_private.h:128
static void nm_rpc_recv_header_data(nm_rpc_token_t p_token, struct nm_data_s *p_header)
Definition nm_rpc_private.h:143
static void nm_rpc_irecv_body_data(struct nm_rpc_token_s *p_token, struct nm_data_s *p_body)
Definition nm_rpc_private.h:167
static void nm_rpc_req_wait_all(nm_rpc_req_t *p_reqs, int n)
Definition nm_rpc_private.h:94
static nm_gate_t nm_rpc_get_source(struct nm_rpc_token_s *p_token)
Definition nm_rpc_private.h:111
static void nm_rpc_token_delay(struct nm_rpc_token_s *p_token)
Definition nm_rpc_private.h:138
static int nm_sr_swait(nm_session_t p_session, nm_sr_request_t *p_request)
Wait for the completion of a non blocking send request.
static void nm_sr_recv_offset(nm_session_t p_session, nm_sr_request_t *p_request, nm_len_t offset)
set offset of data to receive; data before offset will be discarded
static int nm_sr_recv_peek_offset(nm_session_t p_session, nm_sr_request_t *p_request, const struct nm_data_s *p_data, nm_len_t peek_offset, nm_len_t peek_len)
peek for already received (unexpected) data, with offset and explicit len
a data descriptor, used to pack/unpack data from app layout to/from contiguous buffers
Definition nm_data.h:199
nm_rpc_req_notifier_t p_notifier
notification function to call uppon req completion
Definition nm_rpc_private.h:36
nm_rpc_finalizer_t p_finalizer
user-supplied function, called upon data body arrival
Definition nm_rpc_private.h:64
nm_rpc_handler_t p_handler
user-supplied function, called upon header arrival
Definition nm_rpc_private.h:63
PUK_LIST_LINK(nm_rpc_token)
Definition nm_session_private.h:24
Definition nm_core_interface.h:1012