Embedded TCP/IP stack: fnet_bench_srv.h Source File

FNET

fnet_bench_srv.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 server API.
22 *
23 ***************************************************************************/
24 
25 #ifndef _FNET_BENCH_SRV_H_
26 
27 #define _FNET_BENCH_SRV_H_
28 
29 #if FNET_CFG_BENCH_SRV || defined(__DOXYGEN__)
30 
48 /**************************************************************************/
52 typedef void* fnet_bench_srv_desc_t;
53 
54 /**************************************************************************/
58 {
64 };
65 
66 /**************************************************************************/
71 {
75 };
76 
77 /**************************************************************************/
89 
90 /**************************************************************************/
101 typedef void(*fnet_bench_srv_callback_session_end_t)(fnet_bench_srv_desc_t desc, const struct fnet_bench_srv_result *bench_srv_result, void *cookie);
102 
103 #if defined(__cplusplus)
104 extern "C" {
105 #endif
106 
107 /***************************************************************************/
129 
130 /***************************************************************************/
145 
146 /***************************************************************************/
165 
166 /***************************************************************************/
185 
186 /***************************************************************************/
202 
203 #if defined(__cplusplus)
204 }
205 #endif
206 
209 #endif /* FNET_CFG_BENCH_SRV */
210 
211 #endif /* _FNET_BENCH_SRV_H_ */
void fnet_bench_srv_set_callback_session_begin(fnet_bench_srv_desc_t desc, fnet_bench_srv_callback_session_begin_t callback_session_begin, void *cookie)
Registers the "session begin" event handler callback.
fnet_bench_srv_desc_t fnet_bench_srv_init(struct fnet_bench_srv_params *params)
Initializes the Benchmark server service.
struct fnet_sockaddr address
Server socket address. If server IP address and Scope ID are set to 0s, the server will listen to a...
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_srv_release(fnet_bench_srv_desc_t desc)
Releases the Benchmark server service.
fnet_bool_t fnet_bench_srv_is_enabled(fnet_bench_srv_desc_t desc)
Detects if the Benchmark server service is enabled or disabled.
void * fnet_bench_srv_desc_t
Benchmark server descriptor.
void(* fnet_bench_srv_callback_session_end_t)(fnet_bench_srv_desc_t desc, const struct fnet_bench_srv_result *bench_srv_result, void *cookie)
Benchmark server event handler callback function prototype, that is called when the benchmark server ...
void fnet_bench_srv_set_callback_session_end(fnet_bench_srv_desc_t desc, fnet_bench_srv_callback_session_end_t callback_session_end, void *cookie)
Registers the "session end" event handler callback.
fnet_time_t time_ms
Benchmark session lifetime in milliseconds.
unsigned long fnet_size_t
Unsigned integer type representing the size in bytes.
Definition: fnet_stdlib.h:56
fnet_size_t megabytes
Number of received megabytes during the benchmark session.
fnet_bool_t
Boolean type.
Definition: fnet_stdlib.h:81
fnet_size_t bytes
Number of received bytes, in addition to megabytes, during the benchmark session. ...
Benchmark server result passed to the "session end" event handler callback.
fnet_socket_type_t
Socket types.
Definition: fnet_socket.h:319
Initialization parameters for the fnet_bench_srv_init() function.
fnet_socket_type_t type
Protocol type. It can be SOCK_STREAM (TCP) or SOCK_DGRAM (UDP).
void(* fnet_bench_srv_callback_session_begin_t)(fnet_bench_srv_desc_t desc, struct fnet_sockaddr address, void *cookie)
Benchmark server event handler callback function prototype, that is called when the benchmark server ...
Socket address structure.
Definition: fnet_socket.h:270

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