diff -r mbuffer-20010622/CHANGES mbuffer-20010624/CHANGES 0a1,7 > 20010624: > - added experimental networking code > - bugfix for multivolume-code which might have caused > problems on devices which have a size which is > no multiple of Blocksize > - docu update > diff -r mbuffer-20010622/README mbuffer-20010624/README 45,46d44 < (currently no experimental code is included - < coming soon: networking code) 48,49c46,53 < In this version there is no experimental code. Soon networking < stuff will be added here... --- > > NETWORKING (EXPERIMENTAL): > ========================== > The included networking code is based on TCP and should > therefore be fairly stable out of the box. To use it > you should know the basics of TCP/IP. Use only > on a trusted LAN, as there is no builtin security > up to now. diff -r mbuffer-20010622/configure mbuffer-20010624/configure 601c601 < echo "configure:602: checking target system type" >&5 --- > echo "configure:586: checking target system type" >&5 648c648 < VERSION=20010622 --- > VERSION=20010624 670c670 < echo "configure:671: checking for $ac_word" >&5 --- > echo "configure:655: checking for $ac_word" >&5 700c700 < echo "configure:701: checking for $ac_word" >&5 --- > echo "configure:685: checking for $ac_word" >&5 751c751 < echo "configure:752: checking for $ac_word" >&5 --- > echo "configure:736: checking for $ac_word" >&5 794c794 < #line 795 "configure" --- > #line 779 "configure" 799c799 < if { (eval echo configure:800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then --- > if { (eval echo configure:784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 825c825 < echo "configure:826: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 --- > echo "configure:810: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 830c830 < echo "configure:831: checking whether we are using GNU C" >&5 --- > echo "configure:815: checking whether we are using GNU C" >&5 858c858 < echo "configure:859: checking whether ${CC-cc} accepts -g" >&5 --- > echo "configure:843: checking whether ${CC-cc} accepts -g" >&5 957c957 < echo "configure:958: checking for $ac_word" >&5 --- > echo "configure:942: checking for $ac_word" >&5 1075c1075 < echo "configure:1076: checking for library containing sem_init" >&5 --- > echo "configure:1044: checking for library containing sem_init" >&5 1082c1082 < #line 1083 "configure" --- > #line 1051 "configure" 1201c1201 < echo "configure:1202: checking how to run the C preprocessor" >&5 --- > echo "configure:1170: checking how to run the C preprocessor" >&5 1256c1256 < { (eval echo configure:1257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } --- > { (eval echo configure:1225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1323c1323 < echo "configure:1324: checking for $ac_func" >&5 --- > echo "configure:1292: checking for $ac_func" >&5 1328c1328 < #line 1329 "configure" --- > #line 1297 "configure" 1376c1376 < echo "configure:1377: checking for working mmap" >&5 --- > echo "configure:1345: checking for working mmap" >&5 1384c1384 < #line 1385 "configure" --- > #line 1353 "configure" 1582c1582 < echo "configure:1583: checking for ANSI C header files" >&5 --- > echo "configure:1551: checking for ANSI C header files" >&5 1587c1587 < #line 1588 "configure" --- > #line 1556 "configure" 1595c1595 < { (eval echo configure:1596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } --- > { (eval echo configure:1564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1651c1651 < #line 1652 "configure" --- > #line 1620 "configure" 1786c1786 < #line 1787 "configure" --- > #line 1755 "configure" diff -r mbuffer-20010622/configure.in mbuffer-20010624/configure.in 12c12 < VERSION=20010622 --- > VERSION=20010624 diff -r mbuffer-20010622/mbuffer.1.in mbuffer-20010624/mbuffer.1.in 16a17,19 > \fB\-I\fR <\fIport\fP> > use network port \fIport\fP as input instead of the standard input > .TP 20a24,26 > \fB\-O\fR <\fIhostname:port\fP> > write output to \fIhostname:port\fP instead of the standard output > .TP 77c83 < Using mbuffer with 3 tapes for input and extracting the contents in the current work directory (EXPERIMENTAL): --- > Using mbuffer with 3 tapes for input and extracting the contents in the current work directory: 83a90,95 > .LP > Making a backup via network (EXPERIMENTAL): > .LP > \fItape server: \fPmbuffer -I 8000 -o $TAPE > .LP > \fIbackup client: \fPtar zcf - /home | mbuffer -O tapeserver:8000 diff -r mbuffer-20010622/mbuffer.c mbuffer-20010624/mbuffer.c 16a17,25 > #ifdef EXPERIMENTAL > #include > #include > #include > #include > #include > > int Sock = 0; > #endif 105a115,118 > #ifdef EXPERIMENTAL > if (Sock) > close(Sock); > #endif 215c228,230 < errormsg("\ninputThread: error reading: %s\n",strerror(errno)); --- > errormsg("inputThread: error reading: %s\n",strerror(errno)); > sem_post(&Buf2Dev); > sem_post(&Percentage); 216a232 > infomsg("inputThread: exiting...\n"); 297c313,314 < err = write(Out,Buffer[at] + num, Outsize > rest ? Outsize : rest ); --- > /* use Outsize which is the blocksize of the device */ > err = write(Out,Buffer[at] + num, rest > Outsize ? Outsize : rest ); 329a347,413 > #ifdef EXPERIMENTAL > > void openNetworkInput(unsigned short port) > { > struct sockaddr_in saddr, caddr; > socklen_t clen; > > infomsg("creating socket for network input...\n"); > Sock = socket(AF_INET, SOCK_STREAM, 6); > if (0 > Sock) > fatal("could not crate socket for network input: %s\n",strerror(errno)); > bzero(&saddr, sizeof(saddr)); > saddr.sin_family = AF_INET; > saddr.sin_addr.s_addr = htonl(INADDR_ANY); > saddr.sin_port = htons(port); > infomsg("binding socket...\n"); > if (0 > bind(Sock, (struct sockaddr *) &saddr, sizeof(saddr))) > fatal("could not bind to socket for network input: %s\n",strerror(errno)); > infomsg("listening on socket...\n"); > if (0 > listen(Sock,1)) /* accept only 1 incoming connection */ > fatal("could not listen on socket for network input: %s\n",strerror(errno)); > infomsg("waiting to accept connection...\n"); > In = accept(Sock, (struct sockaddr *) &caddr, &clen); > if (0 > In) > fatal("could not accept connection for network input: %s\n",strerror(errno)); > } > > void openNetworkOutput(const char *host, unsigned short port) > { > struct sockaddr_in saddr; > > infomsg("creating socket for network output...\n"); > Out = socket(AF_INET, SOCK_STREAM, 6); > if (0 > Out) > fatal("could not crate socket for network output: %s\n",strerror(errno)); > bzero(&saddr, sizeof(saddr)); > saddr.sin_family = AF_INET; > saddr.sin_port = htons(port); > infomsg("resolving server host...\n"); > if (0 > inet_pton(AF_INET, host, &saddr.sin_addr)) > fatal("could not resolve server hostname: %s\n",strerror(errno)); > infomsg("connecting to server (%x)...\n",saddr.sin_addr); > if (0 > connect(Out, (struct sockaddr *) &saddr, sizeof(saddr))) > fatal("could not connect to server: %s\n",strerror(errno)); > } > > void getNetVars(const char **argv, int *c, const char **server, unsigned short *port) > { > char *tmpserv; > > tmpserv = malloc(strlen(argv[*c] + 1)); > if (0 == tmpserv) > fatal("out of memory in getNetVars(...)\n"); > if (1 < sscanf(argv[*c],"%[0-9a-zA-Z.]:%hu",tmpserv,port)) { > *server = tmpserv; > return; > } > free((void *) tmpserv); > *server = argv[*c]; > (*c)++; > *port = atoi(argv[*c]); > if (*port) > (*c)++; > } > > #endif > 351a436,438 > #ifdef EXPERIMENTAL > "-I : use network port as input\n" > #endif 368c455 < unsigned long long calcint(char **argv, int c, unsigned long long d) --- > unsigned long long calcint(const char **argv, int c, unsigned long long d) 395c482 < int argcheck(const char *opt, char **argv, int *c) --- > int argcheck(const char *opt, const char **argv, int *c) 406c493 < int main(int argc, char **argv) --- > int main(int argc, const char **argv) 412a500,504 > #ifdef EXPERIMENTAL > unsigned short netPortIn = 0; > const char *server = 0; > unsigned short netPortOut = 0; > #endif 443a536,540 > #ifdef EXPERIMENTAL > } else if (!argcheck("-I",argv,&c)) { > netPortIn = (atoi(argv[c])) ? (atoi(argv[c])): 0; > debugmsg("Network input set to port %hu\n",netPortIn); > #endif 446a544,548 > #ifdef EXPERIMENTAL > } else if (!argcheck("-O",argv,&c)) { > getNetVars(argv,&c,&server,&netPortOut); > debugmsg("Output: server = %s, port = %hu\n",server,netPortOut); > #endif 448c550,553 < Tmpfile = argv[c]; --- > Tmpfile = malloc(strlen(argv[c]) + 1); > if (!Tmpfile) > fatal("out of memory"); > strcpy(Tmpfile, argv[c]); 497a603,609 > #ifdef EXPERIMENTAL > if (Infile && netPortIn) > fatal("Setting both network input port and input file doesn't make sense!"); > if ((netPortOut == 0) ^ (server == 0)) > fatal("When sending data to a server, both servername and port must be set!\n"); > #endif > 552a665,668 > #ifdef EXPERIMENTAL > } else if (netPortIn) { > openNetworkInput(netPortIn); > #endif 557a674,677 > #ifdef EXPERIMENTAL > } else if (netPortOut) { > openNetworkOutput(server,netPortOut); > #endif 569c689 < if (Blocksize != st.st_blksize) { --- > if (Blocksize != st.st_blksize) 571,572c691 < Outsize = st.st_blksize; < } --- > Outsize = st.st_blksize;