xref: /iperf/src/net.h (revision b915645a)
17d375156SJon Dugan /*
29d7d60acSBruce A. Mah  * iperf, Copyright (c) 2014, 2017, The Regents of the University of
3da9f046fSBruce A. Mah  * California, through Lawrence Berkeley National Laboratory (subject
4da9f046fSBruce A. Mah  * to receipt of any required approvals from the U.S. Dept. of
5da9f046fSBruce A. Mah  * Energy).  All rights reserved.
67d375156SJon Dugan  *
7da9f046fSBruce A. Mah  * If you have questions about your rights to use or distribute this
8da9f046fSBruce A. Mah  * software, please contact Berkeley Lab's Technology Transfer
9da9f046fSBruce A. Mah  * Department at [email protected].
10da9f046fSBruce A. Mah  *
11da9f046fSBruce A. Mah  * NOTICE.  This software is owned by the U.S. Department of Energy.
12da9f046fSBruce A. Mah  * As such, the U.S. Government has been granted for itself and others
13da9f046fSBruce A. Mah  * acting on its behalf a paid-up, nonexclusive, irrevocable,
14da9f046fSBruce A. Mah  * worldwide license in the Software to reproduce, prepare derivative
15da9f046fSBruce A. Mah  * works, and perform publicly and display publicly.  Beginning five
16da9f046fSBruce A. Mah  * (5) years after the date permission to assert copyright is obtained
17da9f046fSBruce A. Mah  * from the U.S. Department of Energy, and subject to any subsequent
18da9f046fSBruce A. Mah  * five (5) year renewals, the U.S. Government is granted for itself
19da9f046fSBruce A. Mah  * and others acting on its behalf a paid-up, nonexclusive,
20da9f046fSBruce A. Mah  * irrevocable, worldwide license in the Software to reproduce,
21da9f046fSBruce A. Mah  * prepare derivative works, distribute copies to the public, perform
22da9f046fSBruce A. Mah  * publicly and display publicly, and to permit others to do so.
23da9f046fSBruce A. Mah  *
24da9f046fSBruce A. Mah  * This code is distributed under a BSD style license, see the LICENSE
25da9f046fSBruce A. Mah  * file for complete information.
267d375156SJon Dugan  */
27fd10304cSsethdelliott #ifndef __NET_H
28fd10304cSsethdelliott #define __NET_H
29a951c980SBrian Tierney 
309d7d60acSBruce A. Mah int timeout_connect(int s, const struct sockaddr *name, socklen_t namelen, int timeout);
31*b915645aSShuo Chen int create_socket(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out);
3221581a72SBruce A. Mah int netdial(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, int timeout);
3321581a72SBruce A. Mah int netannounce(int domain, int proto, const char *local, const char *bind_dev, int port);
34987b4323SJef Poskanzer int Nread(int fd, char *buf, size_t count, int prot);
35987b4323SJef Poskanzer int Nwrite(int fd, const char *buf, size_t count, int prot) /* __attribute__((hot)) */;
36987b4323SJef Poskanzer int has_sendfile(void);
37987b4323SJef Poskanzer int Nsendfile(int fromfd, int tofd, const char *buf, size_t count) /* __attribute__((hot)) */;
380f53b154SJef Poskanzer int setnonblocking(int fd, int nonblocking);
39a6b3f26bSJef Poskanzer int getsockdomain(int sock);
4097c95c3bSDave Täht int parse_qos(const char *tos);
41a951c980SBrian Tierney 
4243929b36SJef Poskanzer #define NET_SOFTERROR -1
4343929b36SJef Poskanzer #define NET_HARDERROR -2
4443929b36SJef Poskanzer 
45cfed9382SBruce A. Mah #endif /* __NET_H */
46