Add rude, an UDP traffic generator and its collector crude.

It's capable of accurate measuring of traffic.

PR:		ports/53671
Submitted by:	Janos Mohacsi <janos.mohacsi@bsd.hu>
This commit is contained in:
Pav Lucistnik 2003-12-21 23:12:25 +00:00
parent eb095c12f1
commit 377f5c8f06
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=96364
11 changed files with 169 additions and 0 deletions

View file

@ -622,6 +622,7 @@
SUBDIR += ruby-spread
SUBDIR += ruby-tcpsocketpipe
SUBDIR += ruby-tserver
SUBDIR += rude
SUBDIR += rwhois
SUBDIR += samba
SUBDIR += samba-devel

41
net/rude/Makefile Normal file
View file

@ -0,0 +1,41 @@
# New ports collection makefile for: rude
# Date created: rude
# Whom: Janos.Mohacsi@bsd.hu
#
# $FreeBSD$
#
PORTNAME= rude
PORTVERSION= 0.70
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
MAINTAINER= Janos.Mohacsi@bsd.hu
COMMENT= Rude is a Real-time UDP Data Emitter and Collector (crude)
RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Tk.pm:${PORTSDIR}/x11-toolkits/p5-Tk \
${SITE_PERL}/File/Temp.pm:${PORTSDIR}/devel/p5-File-Temp
HAS_CONFIGURE= yes
CONFIGURE_ENV= --with-debug-lvl=3
WRKSRC= ${WRKDIR}/${PORTNAME}
MAN8= rude.8 crude.8
DOC_FILES= README README.rude README.crude TODO example.cfg
EXAMPLE_FILES= crude_jitter.pl crude_parse.pl dump2trace.pl
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/grude/grude ${PREFIX}/bin
.ifndef(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for FILE in ${DOC_FILES}
@${INSTALL_DATA} ${WRKSRC}/DOC/${FILE} ${DOCSDIR}
.endfor
.for FILE in ${EXAMPLE_FILES}
@${INSTALL_DATA} ${WRKSRC}/scripts/${FILE} ${DOCSDIR}
.endfor
.endif
.include <bsd.port.mk>

1
net/rude/distinfo Normal file
View file

@ -0,0 +1 @@
MD5 (rude-0.70.tar.gz) = 04f3206da3aada5aba04cc0ffe0113b4

View file

@ -0,0 +1,11 @@
--- crude/Makefile.in.orig Tue Jun 24 11:26:39 2003
+++ crude/Makefile.in Tue Jun 24 11:26:57 2003
@@ -19,7 +19,7 @@
sbindir = @sbindir@
srcdir = @srcdir@
-INSTALL = @INSTALL@ -o root -g root -m 0755
+INSTALL = @INSTALL@ -o root -g wheel -m 0755
VPATH = @srcdir@
CC = @CC@

View file

@ -0,0 +1,33 @@
--- crude/main.c.orig Thu Jun 13 14:15:21 2002
+++ crude/main.c Mon Jun 23 17:49:02 2003
@@ -294,9 +294,7 @@
*/
if((user_id == 0) && (priority > 0)){
/* Try to lock the memory to avoid paging delays */
- if(mlockall(MCL_CURRENT | MCL_FUTURE) < 0){
- RUDEBUG1("crude: memory lock failed: %s\n", strerror(errno));
- }
+ RUDEBUG1("crude: memory lock unsupported\n");
/* Switch to Round-Robin-Real-Time Scheduling */
p.sched_priority = priority;
@@ -346,8 +344,6 @@
RUDEBUG7("crude: program priority restored\n");
}
- /* Release the locked memory */
- munlockall();
}
if(ps_flag){ print_stats(); }
@@ -663,8 +659,8 @@
/* print average delay as sign and absolute value */
if ( (sec < 0) || (usec < 0) ) {
- sec = llabs( sec );
- usec = llabs( usec );
+ sec = -1*( sec );
+ usec = -1*( usec );
printf("Delay: average = -%lld.%06llu ", sec, usec);
} else {
printf("Delay: average = %lld.%06llu ", sec, usec);

View file

@ -0,0 +1,11 @@
--- grude/grude.orig Tue Jun 24 11:38:38 2003
+++ grude/grude Tue Jun 24 11:39:18 2003
@@ -1418,7 +1418,7 @@
$erro = 'Can\'t save file components';
goto ERRO;
}
- if (system('tar c * | gzip -c > archive') != 0) {
+ if (system('tar cf - * | gzip -c > archive') != 0) {
$erro = 'Can\'t create compressed file';
goto ERRO;
}

View file

@ -0,0 +1,10 @@
--- include/rude.h.orig Mon Jun 23 17:35:23 2003
+++ include/rude.h Mon Jun 23 17:35:42 2003
@@ -24,6 +24,7 @@
#ifndef _RUDE_H
#define _RUDE_H
+#include <sys/types.h>
#include <netinet/in.h> /* for struct sockaddr_in */
#include <sys/time.h> /* for struct timeval */

View file

@ -0,0 +1,11 @@
--- rude/Makefile.in.orig Thu Jun 13 14:15:21 2002
+++ rude/Makefile.in Tue Jun 24 11:26:06 2003
@@ -19,7 +19,7 @@
sbindir = @sbindir@
srcdir = @srcdir@
-INSTALL = @INSTALL@ -o root -g root -m 0755
+INSTALL = @INSTALL@ -o root -g wheel -m 0755
VPATH = @srcdir@
CC = @CC@

View file

@ -0,0 +1,30 @@
--- rude/main.c.orig Mon Jun 23 17:38:44 2003
+++ rude/main.c Mon Jun 23 17:40:18 2003
@@ -204,9 +204,7 @@
*/
if((user_id == 0) && (priority > 0)){
/* Try to lock the memory to avoid paging delays */
- if(mlockall(MCL_CURRENT | MCL_FUTURE) < 0){
- RUDEBUG1("rude: memory lock failed: %s\n", strerror(errno));
- }
+ RUDEBUG1("rude: memory lock unsupported\n");
/* Switch to Round-Robin-Real-Time Scheduling */
p.sched_priority = priority;
@@ -242,8 +240,6 @@
RUDEBUG7("rude: program priority restored\n");
}
- /* Release the locked memory */
- munlockall();
}
rude_exit1:
@@ -275,7 +271,6 @@
}
}
- munlockall();
clean_up();
exit(ret_val);
} /* main() */

8
net/rude/pkg-descr Normal file
View file

@ -0,0 +1,8 @@
RUDE stands for Real-time UDP Data Emitter and CRUDE for Collector for RUDE.
RUDE is a small and flexible program that generates traffic to the network,
which can be received and logged on the other side of the network with the
CRUDE. Currently these programs can generate and measure only UDP traffic.
Actually these tools were designed and coded bacause of the accuracy
limitations in the MGEN program.
WWW: http://rude.sourceforge.net/

12
net/rude/pkg-plist Normal file
View file

@ -0,0 +1,12 @@
bin/crude
bin/grude
bin/rude
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/README.crude
%%PORTDOCS%%%%DOCSDIR%%/README.rude
%%PORTDOCS%%%%DOCSDIR%%/TODO
%%PORTDOCS%%%%DOCSDIR%%/example.cfg
%%PORTDOCS%%%%DOCSDIR%%/crude_jitter.pl
%%PORTDOCS%%%%DOCSDIR%%/crude_parse.pl
%%PORTDOCS%%%%DOCSDIR%%/dump2trace.pl
%%PORTDOCS%%@dirrm %%DOCSDIR%%