Embedded TCP/IP stack: fnet_bench_cln.h Source File

FNET

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 /**************************************************************************/
67 {
71 };
72 
73 /**************************************************************************/
82 typedef void(*fnet_bench_cln_callback_session_end_t)(fnet_bench_cln_desc_t bench_cln_desc, const struct fnet_bench_cln_result *bench_cln_result, void *cookie);
83 
84 /**************************************************************************/
88 {
89  struct fnet_sockaddr address;
96  void *cookie;
99 };
100 
101 #if defined(__cplusplus)
102 extern "C" {
103 #endif
104 
105 /***************************************************************************/
132 
133 /***************************************************************************/
151 
152 /***************************************************************************/
168 
169 #if defined(__cplusplus)
170 }
171 #endif
172 
175 #endif /* FNET_CFG_BENCH_CLN */
176 
177 #endif /* _FNET_BENCH_CLN_H_ */
fnet_size_t bytes
Number of transmitted bytes, in addition to megabytes, during the benchmark session.
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.
Benchmark client result passed to the "session end" event handler callback.
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_uint32_t fnet_time_t
Unsigned integer type representing time uinits. It can be ticks, seconds or milliseconds.
Definition: fnet_timer.h:66
void * fnet_bench_cln_desc_t
Benchmark client descriptor.
fnet_bench_cln_desc_t fnet_bench_cln_init(struct fnet_bench_cln_params *params)
Initializes the Benchmark client service and starts the benchmark session.
unsigned long fnet_size_t
Unsigned integer type representing the size in bytes.
Definition: fnet_stdlib.h:56
fnet_size_t megabytes
Number of transmitted megabytes during the benchmark session.
fnet_bool_t
Boolean type.
Definition: fnet_stdlib.h:81
fnet_size_t message_size
Size of one message to send. Its value must be less than FNET_CFG_BENCH_CLN_BUFFER_SIZE.
fnet_time_t time_ms
Benchmark session lifetime in milliseconds.
fnet_socket_type_t
Socket types.
Definition: fnet_socket.h:319
fnet_index_t message_number
Number of messages to send.
unsigned int fnet_index_t
Unsigned integer type representing the index.
Definition: fnet_stdlib.h:71
void fnet_bench_cln_release(fnet_bench_cln_desc_t desc)
Aborts the benchmark session and releases the benchmark client service.
fnet_socket_type_t type
Protocol type. It can be SOCK_STREAM (TCP) or SOCK_DGRAM (UDP).
void * cookie
Optional application-specific parameter. It's passed to the callback function as input parameter...
Initialization parameters for the fnet_bench_cln_init() function.
Socket address structure.
Definition: fnet_socket.h:270
void(* fnet_bench_cln_callback_session_end_t)(fnet_bench_cln_desc_t bench_cln_desc, const struct fnet_bench_cln_result *bench_cln_result, void *cookie)
Benchmark client event handler callback function prototype, that is called when the benchmark client ...

© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net