Embedded TCP/IP stack  4.7.0
fnet_bench_cln.h
1 /**************************************************************************
2 *
3 * Copyright 2018 by Andrey Butok. FNET Community.
4 *
5 ***************************************************************************
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ***************************************************************************
20 *
21 * FNET benchmark client API.
22 *
23 ***************************************************************************/
24 
25 #ifndef _FNET_BENCH_CLN_H_
26 
27 #define _FNET_BENCH_CLN_H_
28 
29 #if FNET_CFG_BENCH_CLN || defined(__DOXYGEN__)
30 
56 /**************************************************************************/
60 typedef void *fnet_bench_cln_desc_t;
61 
62 /**************************************************************************/
66 typedef struct
67 {
72 
73 /**************************************************************************/
82 typedef void(*fnet_bench_cln_callback_session_end_t)(fnet_bench_cln_desc_t bench_cln_desc, const fnet_bench_cln_result_t *bench_cln_result, void *cookie);
83 
84 /**************************************************************************/
87 typedef struct
88 {
89  struct fnet_sockaddr address;
97  void *cookie;
101 
102 #if defined(__cplusplus)
103 extern "C" {
104 #endif
105 
106 /***************************************************************************/
133 
134 /***************************************************************************/
152 
153 /***************************************************************************/
169 
170 #if defined(__cplusplus)
171 }
172 #endif
173 
176 #endif /* FNET_CFG_BENCH_CLN */
177 
178 #endif /* _FNET_BENCH_CLN_H_ */
Initialization parameters for the fnet_bench_cln_init() function.
fnet_bench_cln_callback_session_end_t callback
Pointer to the callback function defined by fnet_bench_cln_callback_session_end_t. It is called when the benchmark session is finished.
fnet_bool_t fnet_bench_cln_is_enabled(fnet_bench_cln_desc_t desc)
Detects if the Benchmark client service is enabled or disabled.
fnet_bench_cln_desc_t fnet_bench_cln_init(fnet_bench_cln_params_t *params)
Initializes the Benchmark client service and starts the benchmark session.
fnet_uint32_t fnet_time_t
Unsigned integer type representing time uinits. It can be seconds or milliseconds.
Definition: fnet_timer.h:64
fnet_size_t bytes
Number of transmitted bytes, in addition to megabytes, during the benchmark session.
fnet_time_t time_ms
Benchmark session lifetime in milliseconds.
void * fnet_bench_cln_desc_t
Benchmark client descriptor.
fnet_index_t message_number
Number of messages to send.
fnet_size_t message_size
Size of one message to send. Its value must be less than FNET_CFG_BENCH_CLN_BUFFER_SIZE.
unsigned long fnet_size_t
Unsigned integer type representing the size in bytes.
Definition: fnet_stdlib.h:55
void(* fnet_bench_cln_callback_session_end_t)(fnet_bench_cln_desc_t bench_cln_desc, const fnet_bench_cln_result_t *bench_cln_result, void *cookie)
Benchmark client event handler callback function prototype, that is called when the benchmark client ...
fnet_bool_t
Boolean type.
Definition: fnet_stdlib.h:80
void * cookie
Optional application-specific parameter. It's passed to the callback function as input parameter...
fnet_socket_type_t
Socket types.
Definition: fnet_socket.h:317
fnet_size_t megabytes
Number of transmitted megabytes during the benchmark session.
unsigned int fnet_index_t
Unsigned integer type representing the index.
Definition: fnet_stdlib.h:70
fnet_socket_type_t type
Protocol type. It can be SOCK_STREAM (TCP) or SOCK_DGRAM (UDP).
void fnet_bench_cln_release(fnet_bench_cln_desc_t desc)
Aborts the benchmark session and releases the benchmark client service.
Benchmark client result passed to the "session end" event handler callback.
Socket address structure.
Definition: fnet_socket.h:268

© 2005-2020 by Andrej Butok. http://fnet.sourceforge.net