Add brutecopy, an application that pushes data using UDP protocol through rotten,

overloaded and otherwise disgusting lines. It should work well even on lines
on which TCP completely chokes. The transmission is performed at
user-preprogrammed fixed data rate with no flow control, only with lost-packet
retransmits. Brutalcopy always transfers the file without error, even on
erroneous lines. It uses a CRC-32 checksum algorithm together with the checksum
in the UDP packets.

PR:		ports/76239
Submitted by:	Radim Kolar <hsn@netmag.cz>
This commit is contained in:
Pav Lucistnik 2005-01-15 17:23:23 +00:00
parent 5852605e2b
commit 1454562dcc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=126508
7 changed files with 194 additions and 0 deletions

View file

@ -49,6 +49,7 @@
SUBDIR += boclient
SUBDIR += boinc-client
SUBDIR += bounce
SUBDIR += brutecopy
SUBDIR += bsdproxy
SUBDIR += btqueue
SUBDIR += c3270

38
net/brutecopy/Makefile Normal file
View file

@ -0,0 +1,38 @@
# New ports collection makefile for: brutecopy
# Date created: 11 Jan 2005
# Whom: x
#
# $FreeBSD$
#
PORTNAME= brutecopy
PORTVERSION= 20011229
CATEGORIES= net
MASTER_SITES= ftp://atrey.karlin.mff.cuni.cz/pub/local/clock/bcp/
DISTNAME= bcp-${PORTVERSION}
EXTRACT_SUFX= .tgz
MAINTAINER= ports@FreeBSD.org
COMMENT= Transferring files over Internet via UDP
PLIST_FILES= bin/bcpc bin/bcps
MAN1= bcp.1
MANCOMPRESSED= yes
.if defined(WITH_OPTIMIZED_CFLAGS)
CFLAGS+= -O3 -Wall -fomit-frame-pointer -falign-functions=0
.endif
do-install:
${MKDIR} ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/bcps ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/bcpc ${PREFIX}/bin
${MKDIR} ${MAN1PREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/bcp.1.gz ${MAN1PREFIX}/man/man1
pre-everything::
.ifndef WITH_OPTIMIZED_CFLAGS
@${ECHO} "Define WITH_OPTIMIZED_CFLAGS for compiling with -O3"
.endif
.include <bsd.port.mk>

2
net/brutecopy/distinfo Normal file
View file

@ -0,0 +1,2 @@
MD5 (bcp-20011229.tgz) = 2ecd273d34455d43d23cdd03db40b9ab
SIZE (bcp-20011229.tgz) = 21711

View file

@ -0,0 +1,54 @@
--- bcpc.c.orig Sat Dec 29 15:03:13 2001
+++ bcpc.c Tue Jan 11 18:49:25 2005
@@ -80,24 +80,23 @@
void
print_help(void)
{
- fprintf(stderr,"bcpc -- a Brutalcopy client half
-Brutalcopy (c) 2000 Karel Kulhavy, Clocksoft
-
-Brutalcopy is a program for transferring rather large files by means of UDP
-protocol in order to bypass TCP tendency to screw up on bad lines. Brutalcopy is
-based on manual flow control.
-
-Usage: bcpc -l <server hostname> -p <server port> [-h] [-i
-<filename>] [-s <payload_size>] [-r <sot_retransmit_time>] [-b <bytes_per_sec>]
-
--l <server> DNS name or IP address (in dot notation) of the server.
--p <dist_port> Port must be some high number (>=1024). Default is 1235.
--h Prints out help and ends.
--i <filename> File to dump the received data from. Default is bcp.dat.
--s <payload> Number of bytes as a data payload in a single packet.
--r <srt> Number of microsecond after which is SOT retransmitted.
--b <Bps> Bytes of payload per second
-");
+ fprintf(stderr,"bcpc -- a Brutalcopy client half\n"
+"Brutalcopy (c) 2000 Karel Kulhavy, Clocksoft\n"
+"\n"
+"Brutalcopy is a program for transferring rather large files by means of UDP\n"
+"protocol in order to bypass TCP tendency to screw up on bad lines. Brutalcopy is\n"
+"based on manual flow control.\n"
+"\n"
+"Usage: bcpc -l <server hostname> -p <server port> [-h] [-i\n"
+"<filename>] [-s <payload_size>] [-r <sot_retransmit_time>] [-b <bytes_per_sec>]\n"
+"-l <server> DNS name or IP address (in dot notation) of the server.\n"
+"-p <dist_port> Port must be some high number (>=1024). Default is 1235.\n"
+"-h Prints out help and ends.\n"
+"-i <filename> File to dump the received data from. Default is bcp.dat.\n"
+"-s <payload> Number of bytes as a data payload in a single packet.\n"
+"-r <srt> Number of microsecond after which is SOT retransmitted.\n"
+"-b <Bps> Bytes of payload per second\n"
+"\n");
}
void
@@ -289,8 +288,7 @@
if (n>=n_packets)
{
- fprintf(stderr,"Invalid packet seq# of %u from %lu came! It means data are
-corrupted. Quitting immediately.\n",n,n_packets);
+ fprintf(stderr,"Invalid packet seq# of %u from %lu came! It means data are\ncorrupted. Quitting immediately.\n",n,n_packets);
die();
}
if ((bitmap[byte]>>bit)&1) return;

View file

@ -0,0 +1,32 @@
--- Makefile.orig Sat Dec 29 15:03:13 2001
+++ Makefile Tue Jan 11 18:55:19 2005
@@ -1,5 +1,4 @@
-CFLAGS= -O3 -Wall -fomit-frame-pointer -malign-functions=0
-LDFLAGS= -s
+CFLAGS?=-O3 -Wall -fomit-frame-pointer -falign-functions=0
all: bcps bcpc
@@ -7,18 +6,18 @@
rm -f *.o bcps bcpc
bcps.o: bcps.c def.h crc32.c
- gcc -c $(CFLAGS) bcps.c -o bcps.o
+ $(CC) -c $(CFLAGS) bcps.c -o bcps.o
bcpc.o: bcpc.c def.h crc32.c
- gcc -c $(CFLAGS) bcpc.c -o bcpc.o
+ $(CC) -c $(CFLAGS) bcpc.c -o bcpc.o
crc32.o: crc32.c
bcps: bcps.o crc32.o
- gcc $(LDFLAGS) bcps.o crc32.o -o bcps
+ $(CC) $(LDFLAGS) bcps.o crc32.o -o bcps
bcpc: bcpc.o crc32.o
- gcc $(LDFLAGS) bcpc.o crc32.o -o bcpc
+ $(CC) $(LDFLAGS) bcpc.o crc32.o -o bcpc
install: all
install -o root -g root -m 755 bcpc $(DESTDIR)/usr/bin

View file

@ -0,0 +1,53 @@
--- bcps.c.orig Sat Dec 29 15:03:13 2001
+++ bcps.c Tue Jan 11 18:44:43 2005
@@ -99,28 +99,28 @@
void
print_help(void)
{
- fprintf(stderr,"bcps -- a Brutalcopy server half
-Brutalcopy (c) 2000 Karel Kulhavy, Clocksoft
-
-Brutalcopy is a program for transferring rather large files by means of UDP
-protocol in order to bypass TCP tendency to screw up on bad lines. Brutalcopy
-is based on manual flow control.
-
-Usage: bcps -p <number_of_port_to_listen on> [-h] [-o
-<filename>] [-s] [-e <number_of_eots>] [-r <eot_period>] [-1] [-2]
-[-q <info_retransmit_timeout>]
-
--p <port> Port must be some high number. Default is 1235.
--h Prints out help and ends.
--o <filename> File to dump the received data to. Default is bcp.dat.
--s Print tickers
--e <n_eots> Number of EOT packets sent at the end. Default is 3.
--r <eot_p> Time distance between consecutive EOT packets in microseconds.
- Default is 100,000.
--q Info packet retransmit timeout in usec.
--1 Do not print tickers
--2 Print nothing
-");
+ fprintf(stderr,"bcps -- a Brutalcopy server half\n"
+"Brutalcopy (c) 2000 Karel Kulhavy, Clocksoft\n"
+"\n"
+"Brutalcopy is a program for transferring rather large files by means of UDP\n"
+"protocol in order to bypass TCP tendency to screw up on bad lines. Brutalcopy\n"
+"is based on manual flow control.\n"
+"\n"
+"Usage: bcps -p <number_of_port_to_listen on> [-h] [-o\n"
+"<filename>] [-s] [-e <number_of_eots>] [-r <eot_period>] [-1] [-2]\n"
+"[-q <info_retransmit_timeout>]\n"
+"\n"
+"-p <port> Port must be some high number. Default is 1235.\n"
+"-h Prints out help and ends.\n"
+"-o <filename> File to dump the received data to. Default is bcp.dat.\n"
+"-s Print tickers\n"
+"-e <n_eots> Number of EOT packets sent at the end. Default is 3.\n"
+"-r <eot_p> Time distance between consecutive EOT packets in microseconds.\n"
+" Default is 100,000.\n"
+"-q Info packet retransmit timeout in usec.\n"
+"-1 Do not print tickers\n"
+"-2 Print nothing\n"
+"\n");
}
void

14
net/brutecopy/pkg-descr Normal file
View file

@ -0,0 +1,14 @@
It's an application that pushes data using UDP protocol through rotten,
overloaded and otherwise disgusting lines. It should work well even on lines
on which TCP completely chokes. The transmission is performed at
user-preprogrammed fixed data rate with no flow control, only with lost-packet
retransmits. Brutalcopy always transfers the file without error, even on
erroneous lines. It uses a CRC-32 checksum algorithm together with the checksum
in the UDP packets.
Warning: using this utility can cause total line congestion. Don't use it on
with high transfer rates unless you know what you do. On some routers, the
UDP is artificially throttled in order to prevent such practices. Use
FSP for more user and bandwidth friendly file transfers.
WWW: http://atrey.karlin.mff.cuni.cz/~clock/twibright/bcp/