|
Motr
M0
|
|
Data Structures | |
| struct | m0_net_test_cmd_done |
| struct | m0_net_test_cmd_init |
| struct | m0_net_test_cmd_status_data |
| struct | m0_net_test_cmd |
| struct | m0_net_test_cmd_buf_status |
| struct | m0_net_test_cmd_ctx |
Typedefs | |
| typedef void(* | m0_net_test_commands_send_cb_t) (struct m0_net_test_cmd_ctx *ctx, size_t ep_index, int buf_status) |
Functions | |
| int | m0_net_test_commands_init (struct m0_net_test_cmd_ctx *ctx, const char *cmd_ep, m0_time_t send_timeout, m0_net_test_commands_send_cb_t send_cb, struct m0_net_test_slist *ep_list) |
| void | m0_net_test_commands_fini (struct m0_net_test_cmd_ctx *ctx) |
| bool | m0_net_test_commands_invariant (struct m0_net_test_cmd_ctx *ctx) |
| int | m0_net_test_commands_send (struct m0_net_test_cmd_ctx *ctx, struct m0_net_test_cmd *cmd) |
| void | m0_net_test_commands_send_wait_all (struct m0_net_test_cmd_ctx *ctx) |
| int | m0_net_test_commands_recv (struct m0_net_test_cmd_ctx *ctx, struct m0_net_test_cmd *cmd, m0_time_t deadline) |
| int | m0_net_test_commands_recv_enqueue (struct m0_net_test_cmd_ctx *ctx, size_t buf_index) |
| void | m0_net_test_commands_received_free (struct m0_net_test_cmd *cmd) |
Variables | |
| enum { ... } | M0_XCA_DOMAIN |
| typedef void(* m0_net_test_commands_send_cb_t) (struct m0_net_test_cmd_ctx *ctx, size_t ep_index, int buf_status) |
'Command sent' callback.
Definition at line 238 of file commands.h.
| anonymous enum |
Definition at line 45 of file commands.h.
| enum m0_net_test_cmd_type |
Command type.
Definition at line 78 of file commands.h.
| enum m0_net_test_role |
Test node role - node can be test client or test server.
| Enumerator | |
|---|---|
| M0_NET_TEST_ROLE_CLIENT | |
| M0_NET_TEST_ROLE_SERVER | |
Definition at line 59 of file commands.h.
| enum m0_net_test_type |
Test type - can be ping test or bulk test. M0_NET_TEST_TYPE_STUB used in UTs.
| Enumerator | |
|---|---|
| M0_NET_TEST_TYPE_PING | |
| M0_NET_TEST_TYPE_BULK | |
| M0_NET_TEST_TYPE_STUB | |
Definition at line 68 of file commands.h.
| void m0_net_test_commands_fini | ( | struct m0_net_test_cmd_ctx * | ctx | ) |
Definition at line 451 of file commands.c.


| int m0_net_test_commands_init | ( | struct m0_net_test_cmd_ctx * | ctx, |
| const char * | cmd_ep, | ||
| m0_time_t | send_timeout, | ||
| m0_net_test_commands_send_cb_t | send_cb, | ||
| struct m0_net_test_slist * | ep_list | ||
| ) |
Initialize commands context.
| ctx | commands context. |
| cmd_ep | endpoint for commands context. |
| send_timeout | timeout for message sending. |
| send_cb | 'Command sent' callback. Can be NULL. |
| ep_list | endpoints list. Commands will be sent to/will be expected from endpoints from this list. |
Definition at line 441 of file commands.c.


| bool m0_net_test_commands_invariant | ( | struct m0_net_test_cmd_ctx * | ctx | ) |
Invariant for m0_net_test_cmd_ctx. Time complexity is O(1).
Definition at line 583 of file commands.c.

| void m0_net_test_commands_received_free | ( | struct m0_net_test_cmd * | cmd | ) |
Free received command resources.
Definition at line 578 of file commands.c.


| int m0_net_test_commands_recv | ( | struct m0_net_test_cmd_ctx * | ctx, |
| struct m0_net_test_cmd * | cmd, | ||
| m0_time_t | deadline | ||
| ) |
Receive command.
| ctx | Commands context. |
| cmd | Received buffer will be deserialized to this structure. m0_net_test_received_free() should be called for cmd to free resources that can be allocated while decoding. |
| deadline | Functon will wait until deadline reached. Absolute time. |
Definition at line 511 of file commands.c.


| int m0_net_test_commands_recv_enqueue | ( | struct m0_net_test_cmd_ctx * | ctx, |
| size_t | buf_index | ||
| ) |
Add commands context buffer to commands receive queue.
Definition at line 570 of file commands.c.


| int m0_net_test_commands_send | ( | struct m0_net_test_cmd_ctx * | ctx, |
| struct m0_net_test_cmd * | cmd | ||
| ) |
Send command.
| ctx | Commands context. |
| cmd | Command to send. cmd->ntc_ep_index should be set to valid endpoint index in the commands context. |
Definition at line 457 of file commands.c.


| void m0_net_test_commands_send_wait_all | ( | struct m0_net_test_cmd_ctx * | ctx | ) |
Wait until all 'command send' callbacks executed for every sent command.
Definition at line 490 of file commands.c.


| enum { ... } M0_XCA_DOMAIN |