aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorJef Poskanzer <jef@mail.acme.com>2013-03-04 15:55:16 -0800
committerJef Poskanzer <jef@mail.acme.com>2013-03-04 15:55:16 -0800
commit987b4323164fb83d1f9adcb9a9339ec3495e558c (patch)
treea2f0705223d37619c22f082491a0efde3c27d203 /src/net.h
parent358985eb580b9141808385053da41e12df619de9 (diff)
downloadiperf3-987b4323164fb83d1f9adcb9a9339ec3495e558c.tar.gz
A bunch of changes mixed together in this commit, but the significant
one is the new -Z flag. - Fixed potential bug in net.c's Nread and Nwrite routines. If they had ever needed to loop they would have read/written the wrong address, due to incorrect pointer arithmetic - sizeof(void) is not 1. Fix was to change the type of the buffer pointer to char*, which also meant adding casts to some callers. - Better checking for conflicts between command-line flags - now they should no longer be order-dependent. - Added a new -Z / --zerocopy flag, to use a "zero copy" method of sending data, such as sendfile(2) instead of the usual write(2). - Renumbered error enum to make inserting new ones easier.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/net.h b/src/net.h
index 3023e26..81e45de 100644
--- a/src/net.h
+++ b/src/net.h
@@ -10,12 +10,14 @@
#ifndef __NET_H
#define __NET_H
-int netdial(int, int, char *, char *, int);
-int netannounce(int, int, char *, int);
-int Nwrite(int, void *, int, int) /* __attribute__((hot)) */;
-int Nread(int, void *, int, int);
-int getsock_tcp_mss(int);
-int set_tcp_options(int, int, int);
+int netdial(int domain, int proto, char *local, char *server, int port);
+int netannounce(int domain, int proto, char *local, int port);
+int Nread(int fd, char *buf, size_t count, int prot);
+int Nwrite(int fd, const char *buf, size_t count, int prot) /* __attribute__((hot)) */;
+int has_sendfile(void);
+int Nsendfile(int fromfd, int tofd, const char *buf, size_t count) /* __attribute__((hot)) */;
+int getsock_tcp_mss(int inSock);
+int set_tcp_options(int sock, int no_delay, int mss);
int setnonblocking(int fd);
#define NET_SOFTERROR -1