xref: /iperf/src/iperf_util.h (revision a57bcc2d)
1 /*
2  * Copyright (c) 2009-2011, 2014, The Regents of the University of California,
3  * through Lawrence Berkeley National Laboratory (subject to receipt of any
4  * required approvals from the U.S. Dept. of Energy).  All rights reserved.
5  *
6  * This code is distributed under a BSD style license, see the LICENSE file
7  * for complete information.
8  */
9 
10 #ifndef __IPERF_UTIL_H
11 #define __IPERF_UTIL_H
12 
13 #include "cjson.h"
14 
15 void make_cookie(char *);
16 
17 int is_closed(int);
18 
19 double timeval_to_double(struct timeval *tv);
20 
21 int timeval_equals(struct timeval *tv0, struct timeval *tv1);
22 
23 double timeval_diff(struct timeval *tv0, struct timeval *tv1);
24 
25 int delay(int64_t ns);
26 
27 void cpu_util(double pcpu[3]);
28 
29 const char* get_system_info(void);
30 
31 const char* get_optional_features(void);
32 
33 cJSON* iperf_json_printf(const char *format, ...);
34 
35 void iperf_dump_fdset(FILE *fp, char *str, int nfds, fd_set *fds);
36 
37 #endif
38