1 |
commit: 736680b96c87f1c12b91b0f010b7ce569a96dc1a |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 8 08:16:36 2020 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 8 08:18:23 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=736680b9 |
7 |
|
8 |
net-analyzer/ethloop: EAPI=7, fix more compiler warnings |
9 |
|
10 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
11 |
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org> |
12 |
|
13 |
net-analyzer/ethloop/ethloop-10-r4.ebuild | 27 ++++++++++ |
14 |
net-analyzer/ethloop/files/ethloop-10-misc.patch | 65 ++++++++++++++++++++++++ |
15 |
2 files changed, 92 insertions(+) |
16 |
|
17 |
diff --git a/net-analyzer/ethloop/ethloop-10-r4.ebuild b/net-analyzer/ethloop/ethloop-10-r4.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..4067bea8c94 |
20 |
--- /dev/null |
21 |
+++ b/net-analyzer/ethloop/ethloop-10-r4.ebuild |
22 |
@@ -0,0 +1,27 @@ |
23 |
+# Copyright 1999-2020 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=7 |
27 |
+inherit toolchain-funcs |
28 |
+ |
29 |
+DESCRIPTION="Local simulator for testing Linux QoS disciplines" |
30 |
+HOMEPAGE="http://luxik.cdi.cz/~devik/qos/ethloop/" |
31 |
+SRC_URI="http://luxik.cdi.cz/~devik/qos/${PN}/${PN}${PV}.tgz" |
32 |
+ |
33 |
+LICENSE="all-rights-reserved" |
34 |
+SLOT="0" |
35 |
+KEYWORDS="~amd64 ~ppc ~x86" |
36 |
+RESTRICT="mirror bindist" |
37 |
+ |
38 |
+S=${WORKDIR}/${PN} |
39 |
+PATCHES=( |
40 |
+ "${FILESDIR}"/${P}-misc.patch |
41 |
+) |
42 |
+ |
43 |
+src_compile() { |
44 |
+ emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" |
45 |
+} |
46 |
+ |
47 |
+src_install() { |
48 |
+ dosbin ethloop |
49 |
+} |
50 |
|
51 |
diff --git a/net-analyzer/ethloop/files/ethloop-10-misc.patch b/net-analyzer/ethloop/files/ethloop-10-misc.patch |
52 |
new file mode 100644 |
53 |
index 00000000000..a866386a700 |
54 |
--- /dev/null |
55 |
+++ b/net-analyzer/ethloop/files/ethloop-10-misc.patch |
56 |
@@ -0,0 +1,65 @@ |
57 |
+--- a/ethloop.c |
58 |
++++ b/ethloop.c |
59 |
+@@ -1,5 +1,7 @@ |
60 |
+ /* vim: cin sw=4 ts=4 |
61 |
+ */ |
62 |
++#include <arpa/inet.h> /* htons() */ |
63 |
++#include <sys/types.h> /* recv() */ |
64 |
+ #include <sys/socket.h> |
65 |
+ #include <sys/ioctl.h> |
66 |
+ #include <sys/poll.h> |
67 |
+@@ -13,6 +15,7 @@ |
68 |
+ #include <stdlib.h> |
69 |
+ #include <sys/time.h> |
70 |
+ #include <signal.h> |
71 |
++#include <string.h> |
72 |
+ |
73 |
+ int sock; |
74 |
+ |
75 |
+@@ -133,11 +136,11 @@ |
76 |
+ int recv_raw(int tmo) |
77 |
+ { |
78 |
+ struct pollfd pf = {sock,POLLIN,0}; |
79 |
+- int r; unsigned short proto; |
80 |
++ ssize_t r; |
81 |
+ if(poll(&pf,1,tmo) <= 0) return 0; |
82 |
+- r = recv(sock,&buf,1550,0); |
83 |
++ r = recv(sock,&buf,sizeof(buf),0); |
84 |
+ if (r <= 0) { |
85 |
+- printf("error recv (%d)\n",r); |
86 |
++ printf("error recv (%ld)\n",r); |
87 |
+ return 0; |
88 |
+ } |
89 |
+ if (ntohs(buf.proto) != ETH_P_CUST) { |
90 |
+@@ -239,10 +242,10 @@ |
91 |
+ } |
92 |
+ } |
93 |
+ |
94 |
+-main(int c,char *av[]) |
95 |
++int main(int c,char *av[]) |
96 |
+ { |
97 |
+- unsigned long av_k1=0,av_k2=0,t_k1=0,t_k2=0; |
98 |
+- unsigned long av_k3=0,av_k4=0,t_k3=0,t_k4=0; |
99 |
++ unsigned long av_k1=0,av_k2=0; |
100 |
++ unsigned long av_k3=0,av_k4=0; |
101 |
+ int x,tmo,flow,diff,lcheck = 0,lwrite = 0,i,n; |
102 |
+ struct flowtab *fp; |
103 |
+ sock = socket(PF_PACKET,SOCK_RAW,htons(ETH_P_ALL)); |
104 |
+@@ -309,7 +312,7 @@ |
105 |
+ /* write stats every .5 second */ |
106 |
+ if (us - ALIGN(lwrite,LOGTIME) < LOGTIME) continue; |
107 |
+ lwrite = us; |
108 |
+- fprintf(stderr,"store %d at %d ms\n",slog_cnt,us/1000); |
109 |
++ fprintf(stderr,"store %d at %ld ms\n",slog_cnt,us/1000); |
110 |
+ for (fp = ftab,i=0;i<FLOWS;fp++,i++) { |
111 |
+ stp = slog + slog_cnt; |
112 |
+ stp->av_delay[i] = fp->av_delay/EWMAC; |
113 |
+@@ -338,7 +341,7 @@ |
114 |
+ printf("%d.%d",(i+1)/2,(i&1)?0:5); |
115 |
+ for (flow = 0; flow <= maxflow; flow++) { |
116 |
+ fp = ftab + flow; |
117 |
+- printf(" %d %d %d %d",stp->av_wrate[flow], |
118 |
++ printf(" %ld %ld %ld %ld",stp->av_wrate[flow], |
119 |
+ stp->av_rate[flow], stp->av_delay[flow]/1000, |
120 |
+ stp->av_jitter[flow]); |
121 |
+ } |