rdd-2.0.7004075500000000000000000000000001043501077000110725ustar00rootwheelrdd-2.0.7/test004075500000000000000000000000001043501261200120465ustar00rootwheelrdd-2.0.7/test/ttcpwriter.sh.in010075500000000000000000000000421042173111100152660ustar00rootwheel#!/bin/sh @PYTHON@ ttcpwriter.py rdd-2.0.7/test/twriter.c010064400000000000000000000062771042173111100137770ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "writer.h" #include "rddtest.h" #define ERR_BUFSIZE 256 #define MAX_BUFSIZE 65536 static char *progname; static char *input_file; static unsigned char buf[MAX_BUFSIZE]; static unsigned blocksize = MAX_BUFSIZE; static void command_line(int *argcp, char ***argvp) { int argc = *argcp; char **argv = *argvp; unsigned i = 1; if (argc < 2) { fprintf(stderr, "Usage: %s file ...\n", progname); exit(EXIT_FAILURE); } input_file = argv[i++]; argc -= i; *argcp = argc; argv += i; *argvp = argv; } static void copy_file(char *path, int argc, char **argv) { char errmsg[ERR_BUFSIZE]; size_t n; FILE *fp; RDD_WRITER *writer; int rc; writer = rdd_test_get_writer(argc, argv); if (writer == 0) { fprintf(stderr, "%s: cannot build writer stack\n", progname); exit(EXIT_FAILURE); } if ((fp = fopen(path, "rb")) == NULL) { fprintf(stderr, "%s: cannot open %s\n", progname, path); exit(EXIT_FAILURE); } while (1) { n = fread(buf, sizeof(char), blocksize, fp); if (n == 0) { break; } if ((rc = rdd_writer_write(writer, buf, n)) != RDD_OK) { (void) rdd_strerror(rc, errmsg, sizeof errmsg); fprintf(stderr, "write error: %s\n", errmsg); exit(EXIT_FAILURE); } } (void) fclose(fp); if ((rc = rdd_writer_close(writer)) != RDD_OK) { fprintf(stderr, "%s: cannot close writer\n", progname); exit(EXIT_FAILURE); } } int main(int argc, char **argv) { progname = argv[0]; command_line(&argc, &argv); copy_file(input_file, argc, argv); return 0; } rdd-2.0.7/test/tsafe.c010064400000000000000000000037471042173111100134000ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "rdd.h" #include "writer.h" #include "rddtest.h" RDD_WRITER * rdd_test_get_writer(int argc, char **argv) { RDD_WRITER *writer = 0; char *outfile = argv[0]; int rc; if (argc < 1) return 0; rc = rdd_open_safe_writer(&writer, outfile, RDD_NO_OVERWRITE); if (rc != RDD_OK) { rdd_test_error(rc, "cannot open %s", outfile); } return writer; } rdd-2.0.7/test/trunmd5blockfilter.sh.in010075500000000000000000000040601042173111100167020ustar00rootwheel#!/bin/sh # This script runs the tblockmd5 unit test and verifies the test's output. # The test produces several files with MD5 hash values of # blocks of data. This script runs tblockmd5 and calculates the MD5 hash # values of the output files. These values are checked and when they do not # match the expected values, the script exits with an error. # md5sum seems to exit without an error when the input file # does not exist. PYTHON=@PYTHON@ pyout="python-block-md5.txt" # The output files we expect outfiles="" outfiles="${outfiles} block-md5-bs1572864-chunk1572864.txt" outfiles="${outfiles} block-md5-bs1024-chunk1024.txt" outfiles="${outfiles} block-md5-bs1024-chunk1048576.txt" outfiles="${outfiles} block-md5-bs1024-chunk13373.txt" outfiles="${outfiles} block-md5-bs1024-chunk3382912.txt" outfiles="${outfiles} block-md5-bs13373-chunk1024.txt" outfiles="${outfiles} block-md5-bs13373-chunk1048576.txt" outfiles="${outfiles} block-md5-bs13373-chunk13373.txt" outfiles="${outfiles} block-md5-bs13373-chunk3382912.txt" outfiles="${outfiles} block-md5-bs1048576-chunk1024.txt" outfiles="${outfiles} block-md5-bs1048576-chunk1048576.txt" outfiles="${outfiles} block-md5-bs1048576-chunk13373.txt" outfiles="${outfiles} block-md5-bs1048576-chunk3382912.txt" outfiles="${outfiles} block-md5-bs3382912-chunk1024.txt" outfiles="${outfiles} block-md5-bs3382912-chunk1048576.txt" outfiles="${outfiles} block-md5-bs3382912-chunk13373.txt" outfiles="${outfiles} block-md5-bs3382912-chunk3382912.txt" # Run the unit test ./tmd5blockfilter i=0 for outfile in $outfiles do i=`expr $i + 1` # outfile format: block-md5-bs-chunk.txt bs=`expr $outfile : 'block-md5-bs\([0-9]*\).*\.txt'` $PYTHON blockhash.py image.img $bs > $pyout # Check if the output file exists. if ! [ -e $outfile ]; then echo "ERROR: output file $outfile does not exist" exit 1 fi if ! cmp $outfile $pyout then echo "ERROR: test case $i: errors in output file $outfile" exit 1 fi rm -f $pyout rm -f $outfile echo "File $outfile is OK (removed)"; done rm -f block-md5-bs*.txt rdd-2.0.7/test/tmsgprinter.sh.in010075500000000000000000000005631042173111100154450ustar00rootwheel#!/bin/sh echo "----------Testing the message printer" rm -f msgprinter.log msgprinter-stderr.log #./tmsgprinter msgprinter.log "testing the message printer" U1 U2 U3 R1 R2 R3 2> msgprinter-stderr.log @PYTHON@ tmsgprinter.py msglog.txt stderr_msglog.txt errorcodes.txt rm -f msgprinter.log msgprinter-stderr.log echo "----------Finished testing the message printer" rdd-2.0.7/test/tcompress.c010064400000000000000000000040771042173111100143120ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "rdd.h" #include "writer.h" #include "rddtest.h" RDD_WRITER * rdd_test_get_writer(int argc, char **argv) { RDD_WRITER *fw = 0; RDD_WRITER *zw = 0; char *outfile = argv[0]; int rc; if (argc < 1) return 0; if ((rc = rdd_open_file_writer(&fw, outfile)) != RDD_OK) { rdd_test_error(rc, "cannot open %s", outfile); } if ((rc = rdd_open_zlib_writer(&zw, fw)) != RDD_OK) { rdd_test_error(rc, "cannot open %s", outfile); } return zw; } rdd-2.0.7/test/tmsgprinter.py010064400000000000000000000105001042173111100150430ustar00rootwheel# Copyright (c) 2002 - 2006, Netherlands Forensic Institute # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the Institute nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # A unit test for the rdd message printer. import sys, os, string global logfile global stderr_logfile global configfile def usage(): sys.stderr.write("Usage: python tmsgprinter logfile " \ "stderr-logfile configfile\n") sys.exit(1) def commandLine(): global logfile, stderr_logfile, configfile if len(sys.argv) != 4: usage() logfile, stderr_logfile, configfile = sys.argv[1:4] def readFile(path): fp = file(path, 'rb') buf = fp.read() fp.close() return buf def compareFiles(file1, file2): buf1 = readFile(file1) buf2 = readFile(file2) return buf1 == buf2 def fileReadLine(filename): 'Reads the first line in a file.' fp = file(filename, "r") line = fp.readline() if len(line) == 0: sys.stderr.write("The file %s seems to be too short. " "Problem with reading error code %i\n" % (filename, seq)) sys.exit(1) fp.close() return line def checkCode(cells): global logfile, stderr_logfile, configfile # Clean up; logfiles are read only ec = os.system("rm -f %s %s" %(logfile, stderr_logfile)) # Generate the files with the error messages call = ('./tmsgprinter %s "%s" %s 2>%s' % (logfile, cells[1], cells[0], stderr_logfile)) ec = os.system(call) if ec: sys.stderr.write("Error generating error messages\n") sys.exit(1) # Both files should be the same. # If not, there has been an error. # If so, only one file has to be checked. if not compareFiles(logfile, stderr_logfile): sys.stderr.write("The outputs to the logfile and stderr " "for error code %s do not match\n" %cells[0]) sys.exit(1) # Check the error from RDD code = cells[0].lower() if code[0] == "r": errline = cells[2].strip() # RDD else: errline = os.strerror(int(code[1:])) # Unix line = fileReadLine(logfile) if line.find(errline) == -1: sys.stderr.write('Error string "%s" not found in file %s\n' % (errline, logfile)) sys.exit(1) # Check the error from the unit test errmsg = cells[1].strip() if (line.find(errmsg) == -1): sys.stderr.write('Error string "%s" not found in file %s\n' % (errmsg, stderr_logfile)) sys.exit(-1) # Clean up ec = os.system("rm -f %s %s" %(logfile, stderr_logfile)) def checkCodes(): 'Checks all error codes that are listed in our config file.' global configfile fp = file(configfile, "r") num = 0 while 1: line = fp.readline() if len(line) <= 0: break # reached end of file line = line.strip() if len(line) == 0 or line[0] == '#': continue # skip empty line or comment cells = line.split(",") code = cells[0].lower() if code[0] == "r" or code[0] == "u": num += 1 checkCode(cells) print "Error code ", code, " OK" else: # Unknown error code sys.stderr.write("unknown error code: %s\n" % cells[0]) sys.exit(1) fp.close() def main(): commandLine() checkCodes() if __name__ == "__main__": main() rdd-2.0.7/test/simfile.txt010064400000000000000000000001021042173111100143010ustar00rootwheel8111 0.5 8192 0.999 12342 0.5 22342 0.5 32342 0.5 42342 0.5 0 0.5 rdd-2.0.7/test/tsha1filter.c010064400000000000000000000210231042173111100145070ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* A unit-test for the sha1 stream filter. */ #ifdef HAVE_CONFIG_H #include"config.h" #endif #include #include #include #include #include "rdd.h" #include "writer.h" #include "filter.h" #include "filterset.h" #include "rdd_internals.h" #include "sha1.h" #include "error.h" #include "rddtest.h" /* * Command-line arguments: * 1: file to calculate the SHA-1 hash of * 2: SHA-1 of the file to match with the calculated SHA-1 * * Output to command line: * PASSED * STRING FAILED * FILE FAILED * * Error messages go to stderr. */ typedef struct _TESTCASE { const char *input; unsigned size; const char *sha1; } TESTCASE; static TESTCASE test_cases[] = { { "aa", 2, "e0c9035898dd52fc65c41454cec9c4d2611bfb37" }, { "Listen very carefully, I will say this only once!", 49, "99e149e89b3c39d39371b18468ec6bd1374aeaf0" } }; static void filter_error(char *fmt, ...) { va_list ap; fprintf(stderr, "[tsha1filter] "); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n"); exit(EXIT_FAILURE); } #if 0 static void usage(void) { fprintf(stderr, "Usage: tsha1stream \n"); exit(EXIT_FAILURE); } static void verifyFile(int argc, char **argv) { RDD_FILTER *f = 0; int rc; /* XXX TODO calculate the SHA-1 hash value. */ rc = rdd_new_sha1_streamfilter(&f); /* Read the contents of the file and push all bytes into * the filter. */ if (argc != 3) { usage(); } } #endif /* Calculates the SHA-1 hash of a predefined string and checks * the hash. */ static void verifyStrings(unsigned i, TESTCASE *testcase) { RDD_FILTER *sha1_filter = 0; RDD_FILTERSET fset; char *copy = 0; int rc; unsigned char sha1_digest[SHA_DIGEST_LENGTH]; char sha1string[2*SHA_DIGEST_LENGTH+1]; printf("testing string %u......", i); if ((copy = malloc(testcase->size + 1)) == 0) { filter_error("out of memory"); } /* Set up filter and filter set */ rc = rdd_fset_init(&fset); if (rc != RDD_OK) { filter_error("rdd_fset_init() returned %d instead of RDD_OK", rc); } /* Set up new SHA1 digest stream filter. */ rc = rdd_new_sha1_streamfilter(&sha1_filter); if (rc != RDD_OK) { filter_error("rdd_new_sha1_streamfilter() returned %d " " instead of RDD_OK", rc); } /* Install the filter in the filterset. */ rc = rdd_fset_add(&fset, "SHA-1-filter", sha1_filter); if (rc != RDD_OK) { filter_error("rdd_fset_add() returned %d instead of RDD_OK", rc); } /* Make a copy of the test input so that we can check whether * the input string is modified (it should not be modified). */ strcpy(copy, testcase->input); /* Push the teststring into the filterset. */ rc = rdd_fset_push(&fset, (unsigned char *) copy, testcase->size); if (rc != RDD_OK) { filter_error("rdd_fset_push() returned %d instead of RDD_OK", rc); } /* Close all filters in the filterset; the final SHA-1 digest is * saved. */ if ((rc = rdd_fset_close(&fset)) != RDD_OK) { filter_error("rdd_fset_close() returned %d instead of RDD_OK", rc); } /* Get the SHA-1 digest filter. */ if ((rc = rdd_fset_get(&fset, "SHA-1-filter", &sha1_filter)) != RDD_OK) { filter_error("rdd_fset_get() returned %d instead of RDD_OK", rc); } /* Get the SHA-1 hash from the filter. */ rc = rdd_filter_get_result(sha1_filter, sha1_digest, SHA_DIGEST_LENGTH); if (rc != RDD_OK) { filter_error("rdd_filter_get_result() returned %d instead of RDD_OK", rc); } /* Convert the binary digest buffer to a human-readable hex string. */ rc = rdd_buf2hex(sha1_digest, SHA_DIGEST_LENGTH, sha1string, sizeof sha1string); if (rc != RDD_OK) { filter_error("cannot convert SHA-1 digest"); } if (strcmp(sha1string, testcase->sha1) != 0) { filter_error("incorrect SHA-1 hash value"); } /* Check whether the input buffer has been modified. */ if (strcmp(copy, testcase->input) != 0) { filter_error("someone modified the input buffer"); } if (copy != 0) { free(copy); } printf("OK\n"); } static void testFilters(void) { unsigned char sha1_digest[20]; RDD_FILTER *f = 0; RDD_FILTER *g = 0; RDD_FILTERSET fset; int rc; printf("Testing functions on bad behaviour.\n"); rc = rdd_fset_init(&fset); rc = rdd_fset_get(&fset, "xx", &f); if (rc != RDD_NOTFOUND) { filter_error("rdd_fset_get() should return RDD_NOTFOUND when there are no filters in the filterset"); } rc = rdd_new_sha1_streamfilter(&f); rc = rdd_fset_add(&fset, "", f); if (rc != RDD_BADARG) { filter_error("rdd_fset_add() returned %d instead of RDD_BAD_ARG", rc); } /*forget everything, start with a new filterset*/ rc = rdd_fset_clear(&fset); if (rc != RDD_OK) { filter_error("rdd_fset_clear() returned %d instead of RDD_OK", rc); } rc = rdd_fset_init(&fset); if (rc != RDD_OK) { filter_error("rdd_fset_init() returned %d instead of RDD_OK", rc); } /*build a couple of filters and add them to the filter set*/ rc = rdd_new_sha1_streamfilter(&f); if (rc != RDD_OK) { filter_error("rdd_sha1_stream_filter() returned %d, should return RDD_OK", rc); } rc = rdd_new_sha1_streamfilter(&g); if (rc != RDD_OK) { filter_error("rdd_sha1_stream_filter() returned %d, should return RDD_OK", rc); } rc = rdd_fset_add(&fset, "SHA-1 filter", f); if (rc != RDD_OK) { filter_error("rdd_fset_add() returned %d instead of RDD_OK", rc); } rc = rdd_fset_add(&fset, "SHA-1 filter", g); if (rc != RDD_EEXISTS) { filter_error("rdd_fset_add() accepted an existing filter name"); } rc = rdd_fset_add(&fset, "SHA-1 filter-2", g); f = g = 0; rc = rdd_fset_get(&fset, "xx", &f); if (rc != RDD_NOTFOUND) { filter_error("rdd_fset_get() found non-existing filter."); } /* Get buffers from filters. */ rc = rdd_fset_push(&fset, (unsigned char *) "olla vogala", 12); if (rc != RDD_OK) { filter_error("rdd_fset_push() returned %d instead of RDD_OK", rc); } rc = rdd_fset_close(&fset); if (rc != RDD_OK) { filter_error("rdd_fset_close() returned %d instead of RDD_OK", rc); } rc = rdd_fset_get(&fset, "SHA-1 filter", &f); if (rc != RDD_OK) { filter_error("rdd_fset_get() returned %d instead of RDD_OK", rc); } rc = rdd_filter_get_result(f, sha1_digest, sizeof sha1_digest); if (rc != RDD_OK) { filter_error("rdd_filter_get_result() failed to get SHA-1 result"); } rc = rdd_filter_get_result(f, sha1_digest, 0); if (rc != RDD_ESPACE) { filter_error("undersized (0) SHA-1 buffer was not detected"); } rc = rdd_filter_get_result(f, sha1_digest, 19); if (rc != RDD_ESPACE) { filter_error("undersized (19) SHA-1 buffer was not detected"); } rc = rdd_filter_get_result(f, sha1_digest, 100); if (rc != RDD_OK) { filter_error("rdd_filter_get_result() failed to get SHA-1 result"); } } int main(int argc, char **argv) { unsigned i; printf("------------------Testing SHA-1 routines\n"); for (i = 0; i < (sizeof test_cases) / sizeof(test_cases[0]); i++) { verifyStrings(i+1, &test_cases[i]); } testFilters(); #if 0 verifyFile(argc, argv); #endif printf("------------------Finished testing SHA-1 routines\n"); return 0; } rdd-2.0.7/test/tmd5blockfilter.c010064400000000000000000000105351042173111100153610ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * This is a unit test for the block MD5 handling of rdd. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rdd.h" #include "rdd_internals.h" #include "writer.h" #include "filter.h" #include "filterset.h" #define INPUT_FILE "image.img" static void build_filters(RDD_FILTERSET *fset, rdd_count_t blocklen, char *outfile) { RDD_FILTER *f = 0; int rc; rc = rdd_new_md5_blockfilter(&f, blocklen, outfile, RDD_OVERWRITE); if (rc != RDD_OK) { fprintf(stderr, "could not create new MD5 block filter. " "Returnvalue: %i\n", rc); exit(EXIT_FAILURE); } if ((rc = rdd_fset_init(fset)) != RDD_OK) { fprintf(stderr, "could not create a filter set. Returnvalue: " "%i\n", rc); exit(EXIT_FAILURE); } if ((rc = rdd_fset_add(fset, "MD5-blockfilter", f)) != RDD_OK) { fprintf(stderr, "could not add the MD5 blockfilter to the " "filterset. Returnvalue: %i\n", rc); exit(EXIT_FAILURE); } } static void fill_filters(RDD_FILTERSET *fset, rdd_count_t chunklen) { FILE *infile; unsigned char *buf; size_t nread; int rc; if ((buf = malloc(chunklen)) == 0) { fprintf(stderr, "out of memory\n"); exit(EXIT_FAILURE); } if ((infile = fopen(INPUT_FILE, "rb")) == NULL) { fprintf(stderr, "cannot open input file.\n"); exit(EXIT_FAILURE); } while ((nread = fread(buf, 1, chunklen, infile)) > 0) { rdd_fset_push(fset, buf, nread); } if (feof(infile) == 0) { fprintf(stderr, "An error occurred reading the input file." "Errornumber: %i.\n", ferror(infile)); exit(EXIT_FAILURE); } if ((rc = rdd_fset_close(fset)) != RDD_OK) { fprintf(stderr, "Could not close the filterset. " "Returnvalue: %i.\n", rc); exit(EXIT_FAILURE); } if (fclose(infile) == EOF) { fprintf(stderr, "Cannot close input file.\n"); exit(EXIT_FAILURE); } free(buf); } static void clear_filters(RDD_FILTERSET *fset) { int rc; if ((rc = rdd_fset_clear(fset)) != RDD_OK) { fprintf(stderr, "Cannot clear filter set [%d]\n", rc); exit(EXIT_FAILURE); } } int main(void) { RDD_FILTERSET fset; char outfile[100]; rdd_count_t blocklen[] = {1024, 1048576, 13373, 3382912}; rdd_count_t chunklen[] = {1024, 1048576, 13373, 3382912}; int i, j; /* Read the complete testfile in one chunk and push it * in one chunk into the filter. The filter's block size equals * the file size. */ build_filters(&fset, 1572864, "block-md5-bs1572864-chunk1572864.txt"); fill_filters(&fset, 1572864); clear_filters(&fset); /* Read the testfile in various chunk sizes and use various * block sizes. */ for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { sprintf(outfile, "block-md5-bs%llu-chunk%llu.txt", blocklen[i], chunklen[j]); build_filters(&fset, blocklen[i], outfile); fill_filters(&fset, chunklen[j]); clear_filters(&fset); } } return 0; } rdd-2.0.7/test/tnumparser.c010064400000000000000000000073751042173111100144770ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /** @file * \brief Unit test program for the \c numparser module. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rdd.h" #include "numparser.h" typedef struct _RDD_TEST_BIGNUM { const char *testnum; /**< test string */ unsigned flags; /**< flags to pass to rdd_parse_bignum() */ int errcode; /**< expected return code */ rdd_count_t result; /**< expected return value (number parsed) */ } RDD_TEST_BIGNUM; RDD_TEST_BIGNUM bignums[] = { {"abc", 0, RDD_ESYNTAX, 0}, {" 1", 0, RDD_ESYNTAX, 0}, {"-1", 0, RDD_ESYNTAX, 0}, {"8T", 0, RDD_ESYNTAX, 0}, {"-1", 0, RDD_ESYNTAX, 0}, {"-3k", 0, RDD_ESYNTAX, 0}, {"3.4", 0, RDD_ESYNTAX, 0}, {"11111111111111111111111111111111111111111111111111", 0, RDD_ERANGE, 0}, {"11111111111111111111111111111111111111111111111111G", 0, RDD_ERANGE, 0}, {"0", RDD_POSITIVE, RDD_ERANGE, 0}, {"-10", RDD_POSITIVE, RDD_ESYNTAX, 0}, {"129", RDD_POWER2, RDD_ERANGE, 0}, {"0K", 0, RDD_OK, 0}, {"1024K", 0, RDD_OK, 1048576}, {"0", 0, RDD_OK, 0}, {"1", 0, RDD_OK, 1}, {"1", RDD_POWER2, RDD_OK, 1}, {"1", RDD_POSITIVE|RDD_POWER2, RDD_OK, 1}, {"9c", 0, RDD_OK, 9}, {"18w", 0, RDD_OK, 36}, {"18b", 0, RDD_OK, 18*512}, {"8k", 0, RDD_OK, 8192}, {"1m", 0, RDD_OK, 1048576}, {"0M", 0, RDD_OK, 0}, {"120G", 0, RDD_OK, 120ULL * (1 << 30)}, {"128g", RDD_POWER2, RDD_OK, 128ULL * (1<<30)}, {0, 0, RDD_OK, 0} }; static void run_testcase(RDD_TEST_BIGNUM *testcase) { rdd_count_t num = 0; int rc; printf("running test: %s\n", testcase->testnum); rc = rdd_parse_bignum(testcase->testnum, testcase->flags, &num); if (rc != testcase->errcode) { printf("tnumparser: test failed [%s]: bad error code[%d]\n", testcase->testnum, rc); exit(EXIT_FAILURE); } if (rc == RDD_OK && num != testcase->result) { printf("tnumparser: test failed [%s]: bad result [%llu]\n", testcase->testnum, num); exit(EXIT_FAILURE); } } static void test_bignums(void) { RDD_TEST_BIGNUM *testcase; int i; for (i = 0; ; i++) { testcase = &bignums[i]; if (testcase->testnum == 0) { break; } run_testcase(testcase); } } int main(int argc, char **argv) { test_bignums(); return 0; } rdd-2.0.7/test/tfiledesc.c010064400000000000000000000042361042173111100142320ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "rdd.h" #include "writer.h" #include "rddtest.h" RDD_WRITER * rdd_test_get_writer(int argc, char **argv) { RDD_WRITER *writer = 0; char *outfile = argv[0]; int rc; int fd; if (argc < 1) return 0; if ((fd = open(outfile, O_CREAT|O_WRONLY, 0644)) < 0) { fprintf(stderr, "cannot open %s\n", outfile); exit(EXIT_FAILURE); } if ((rc = rdd_open_fd_writer(&writer, fd)) != RDD_OK) { rdd_test_error(rc, "cannot open %s", outfile); } return writer; } rdd-2.0.7/test/tfile.c010064400000000000000000000036771042173111100134030ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "rdd.h" #include "writer.h" #include "rddtest.h" RDD_WRITER * rdd_test_get_writer(int argc, char **argv) { RDD_WRITER *fw = 0; char *outfile = argv[0]; int rc; if (argc < 1) return 0; if ((rc = rdd_open_file_writer(&fw, outfile)) != RDD_OK) { rdd_test_error(rc, "cannot open %s", outfile); } return fw; } rdd-2.0.7/test/blockhash.py010064400000000000000000000041041042173111100144260ustar00rootwheel# Copyright (c) 2002 - 2006, Netherlands Forensic Institute # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the Institute nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # Important: Python uses its own MD5 implementation. It does # not use the openssl library to implement MD5. import md5 import sys def doFile(path, blocksize): 'Hashes consecutive blocks of blocksize bytes in file path.' blocknum = 0 fp = file(path, 'rb') while 1: buf = fp.read(blocksize) if len(buf) == 0: break md = md5.new() md.update(buf) print '%u\t%s' % (blocknum, md.hexdigest()) blocknum += 1 fp.close() def main(): path, blocksize = sys.argv[1:3] doFile(path, long(blocksize)) sys.exit(0) if __name__ == '__main__': main() rdd-2.0.7/test/errorcodes.txt010064400000000000000000000074641042173111100150420ustar00rootwheel#A list of error codes for the rdd message printer unit test. #Every record consists of: #- A test code. An rdd error starts with 'r', a unix error starts with 'u'; #- An additional error message that should be printed by rdd; #- The expected rdd error message. This item is discarded for unix errors #All records are separated by a comma. #rdd error codes R1,rdd error code 1,out of memory R2,rdd error code 2,bad argument R3,rdd error code 3,compression error R4,rdd error code 4,write error R5,rdd error code 5,close error R6,rdd error code 6,output file already exists R7,rdd error code 7,cannot open file R8,rdd error code 8,cannot connect R9,rdd error code 9,cannot determine current position R10,rdd error code 10,seek error R11,rdd error code 11,read error R12,rdd error code 12,insufficient space in buffer R13,rdd error code 13,syntax error R14,rdd error code 14,number out of range R15,rdd error code 15,try again later R16,rdd error code 16,not found R17,rdd error code 17,operation has been aborted #unix error codes U1,unix error code 1 U2,unix error code 2 U3,unix error code 3 U4,unix error code 4 U5,unix error code 5 U6,unix error code 6 U7,unix error code 7 U8,unix error code 8 U9,unix error code 9 U10,unix error code 10 U11,unix error code 11 U12,unix error code 12 U13,unix error code 13 U14,unix error code 14 U15,unix error code 15 U16,unix error code 16 U17,unix error code 17 U18,unix error code 18 U19,unix error code 19 U20,unix error code 20 U21,unix error code 21 U22,unix error code 22 U23,unix error code 23 U24,unix error code 24 U25,unix error code 25 U26,unix error code 26 U27,unix error code 27 U28,unix error code 28 U29,unix error code 29 U30,unix error code 30 U31,unix error code 31 U32,unix error code 32 U33,unix error code 33 U34,unix error code 34 U35,unix error code 35 U36,unix error code 36 U37,unix error code 37 U38,unix error code 38 U39,unix error code 39 U40,unix error code 40 U41,unix error code 41 U42,unix error code 42 U43,unix error code 43 U44,unix error code 44 U45,unix error code 45 U46,unix error code 46 U47,unix error code 47 U48,unix error code 48 U49,unix error code 49 U50,unix error code 50 U51,unix error code 51 U52,unix error code 52 U53,unix error code 53 U54,unix error code 54 U55,unix error code 55 U56,unix error code 56 U57,unix error code 57 U58,unix error code 58 U59,unix error code 59 U60,unix error code 60 U61,unix error code 61 U62,unix error code 62 U63,unix error code 63 U64,unix error code 64 U65,unix error code 65 U66,unix error code 66 U67,unix error code 67 U68,unix error code 68 U69,unix error code 69 U70,unix error code 70 U71,unix error code 71 U72,unix error code 72 U73,unix error code 73 U74,unix error code 74 U75,unix error code 75 U76,unix error code 76 U77,unix error code 77 U78,unix error code 78 U79,unix error code 79 U80,unix error code 80 U81,unix error code 81 U82,unix error code 82 U83,unix error code 83 U84,unix error code 84 U85,unix error code 85 U86,unix error code 86 U87,unix error code 87 U88,unix error code 88 U89,unix error code 89 U90,unix error code 90 U91,unix error code 91 U92,unix error code 92 U93,unix error code 93 U94,unix error code 94 U95,unix error code 95 U96,unix error code 96 U97,unix error code 97 U98,unix error code 98 U99,unix error code 99 U100,unix error code 100 U101,unix error code 101 U102,unix error code 102 U103,unix error code 103 U104,unix error code 104 U105,unix error code 105 U106,unix error code 106 U107,unix error code 107 U108,unix error code 108 U109,unix error code 109 U110,unix error code 110 U111,unix error code 111 U112,unix error code 112 U113,unix error code 113 U114,unix error code 114 U115,unix error code 115 U116,unix error code 116 U117,unix error code 117 U118,unix error code 118 U119,unix error code 119 U120,unix error code 120 U121,unix error code 121 U122,unix error code 122 U123,unix error code 123 rdd-2.0.7/test/ttcpwriter.c010064400000000000000000000100511042173111100144670ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* A unit test for the TCP writer module. This module is used when rdd is put * in client mode. The module reads a file and writes it to a TCP port. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rdd.h" #include "writer.h" #include "filter.h" #include "filterset.h" #include "rdd_internals.h" #include "reader.h" #include "netio.h" #define INPUT_FILE "image.img" #define OUTPUT_FILE "image-net.img" #define SERVER "localhost" #define PORT 1111 static void build_filterset(RDD_FILTERSET *fset) { int rc; unsigned flags = 0; rdd_count_t size; RDD_WRITER *w = 0; RDD_FILTER *f = 0; rc = rdd_open_tcp_writer(&w, SERVER, 1111); if (rc != RDD_OK){ fprintf(stderr, "could not connect to %s:%u.\n" "Returnvalue: %i\n", SERVER, PORT, rc); exit(-1); } rc = rdd_device_size(INPUT_FILE, &size); if (size == 0){ fprintf(stderr, "Size of input file is 0. Abort\n"); exit(-1); } rc = rdd_send_info(w, OUTPUT_FILE, size, 262144, 12345678901, flags); if (rc != RDD_OK) { fprintf(stderr, "cannot send header to %s:%u", SERVER, PORT); exit(-1); } if ((rc = rdd_fset_init(fset)) != RDD_OK){ fprintf(stderr, "could not create a filter set. Returnvalue: " "%i\n", rc); exit(-1); } if ((rc = rdd_new_write_streamfilter(&f, w)) != RDD_OK){ fprintf(stderr, "cannot build write-stream filter"); exit(-1); } if ((rc = rdd_fset_add(fset, "tcp-writer", f)) != RDD_OK){ fprintf(stderr, "could not add the tcp writer to the " "filterset. Returnvalue: %i\n", rc); exit(-1); } } static void fill_filters(RDD_FILTERSET *fset, rdd_count_t chunklen) { FILE *infile; unsigned char *buf; size_t nread; int rc; if ((buf = malloc(chunklen)) == 0) { fprintf(stderr, "out of memory\n"); exit(-1); } infile = fopen(INPUT_FILE, "rb"); if (infile == NULL){ fprintf(stderr, "could not open input file.\n"); exit(-1); } while ((nread = fread(buf, 1, chunklen, infile)) > 0) { rdd_fset_push(fset, buf, nread); } if (feof(infile) == 0){ fprintf(stderr, "An error occurred reading the input file." "Errornumber: %i.\n", ferror(infile)); exit(-1); } if ((rc = rdd_fset_close(fset)) != RDD_OK){ fprintf(stderr, "Could not close the filterset. " "Returnvalue: %i.\n", rc); exit(-1); } if (fclose(infile) == EOF) { fprintf(stderr, "Cannot close input file.\n"); exit(-1); } free(buf); } int main (int argc, char **argv) { RDD_FILTERSET fset; build_filterset(&fset); fill_filters(&fset, 1048576); return 0; } rdd-2.0.7/test/rddtest.c010064400000000000000000000042771042173111100137460ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "rdd.h" #include "writer.h" #include "rddtest.h" #include "rdd_internals.h" void rdd_test_error(int errcode, char *fmt, ...) { char msg[1024]; va_list ap; int rc; va_start(ap, fmt); fprintf(stderr, "%s: ", "test"); vfprintf(stderr, fmt, ap); fprintf(stderr, ": "); if ((rc = rdd_strerror(errcode, msg, sizeof msg)) != RDD_OK) { fprintf(stderr, "%s", ""); } else { fprintf(stderr, "%s", msg); } fprintf(stderr, "\n"); va_end(ap); exit(EXIT_FAILURE); } rdd-2.0.7/test/tnewwriter.c010064400000000000000000000062751042173111100145070ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "rdd.h" #include "writer.h" static char *progname; static int test_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte); static int test_close(RDD_WRITER *w); static RDD_WRITE_OPS test_writer = { test_write, test_close }; static struct _RDD_WRITER_TEST { RDD_WRITE_OPS *ops; unsigned statesize; int result; } testcases[] = { {&test_writer, 0, RDD_OK}, {0, 0, RDD_BADARG}, #if 0 /* This test case does not always produce RDD_NOMEM * on machines with a lot of memory. */ {&test_writer, ~0, RDD_NOMEM} #endif }; static int test_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte) { return RDD_OK; } static int test_close(RDD_WRITER *w) { return RDD_OK; } static void command_line(int argc, char **argv) { if (argc != 1) { fprintf(stderr, "Usage: %s\n", progname); exit(EXIT_FAILURE); } } static void run_tests(void) { struct _RDD_WRITER_TEST *wt; RDD_WRITER *writer = 0; unsigned i; unsigned n; int rc; n = (sizeof testcases) / sizeof(testcases[0]); for (i = 0; i < n; i++) { wt = &testcases[i]; writer = 0; rc = rdd_new_writer(&writer, wt->ops, wt->statesize); if (rc != wt->result) { printf("test %u: bad return value; " "got %d, expected %d\n", i+1, rc, wt->result); exit(EXIT_FAILURE); } if (rc != RDD_OK) { continue; } rc = rdd_writer_close(writer); if (rc != RDD_OK) { printf("test %u: close failed\n", i+1); exit(EXIT_FAILURE); } } } int main(int argc, char **argv) { progname = argv[0]; command_line(argc, argv); run_tests(); return 0; } rdd-2.0.7/test/Makefile.in010064400000000000000000000523531042173154100142030ustar00rootwheel# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : noinst_PROGRAMS = tbuildtestfile$(EXEEXT) tcompress$(EXEEXT) \ tfile$(EXEEXT) tfiledesc$(EXEEXT) tsafe$(EXEEXT) \ tpart$(EXEEXT) tnumparser$(EXEEXT) talignedbuf$(EXEEXT) \ tnewwriter$(EXEEXT) tsha1filter$(EXEEXT) treader$(EXEEXT) \ tmd5blockfilter$(EXEEXT) ttcpwriter$(EXEEXT) \ tmsgprinter$(EXEEXT) subdir = test DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/tmsgprinter.sh.in $(srcdir)/trunmd5blockfilter.sh.in \ $(srcdir)/ttcpwriter.sh.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = trunmd5blockfilter.sh ttcpwriter.sh \ tmsgprinter.sh PROGRAMS = $(noinst_PROGRAMS) am_talignedbuf_OBJECTS = talignedbuf.$(OBJEXT) talignedbuf_OBJECTS = $(am_talignedbuf_OBJECTS) talignedbuf_DEPENDENCIES = ../src/librdd.a am_tbuildtestfile_OBJECTS = tbuildtestfile.$(OBJEXT) tbuildtestfile_OBJECTS = $(am_tbuildtestfile_OBJECTS) tbuildtestfile_DEPENDENCIES = ../src/librdd.a am__objects_1 = twriter.$(OBJEXT) rddtest.$(OBJEXT) am_tcompress_OBJECTS = $(am__objects_1) tcompress.$(OBJEXT) tcompress_OBJECTS = $(am_tcompress_OBJECTS) tcompress_DEPENDENCIES = ../src/librdd.a am_tfile_OBJECTS = $(am__objects_1) tfile.$(OBJEXT) tfile_OBJECTS = $(am_tfile_OBJECTS) tfile_DEPENDENCIES = ../src/librdd.a am_tfiledesc_OBJECTS = $(am__objects_1) tfiledesc.$(OBJEXT) tfiledesc_OBJECTS = $(am_tfiledesc_OBJECTS) tfiledesc_DEPENDENCIES = ../src/librdd.a am_tmd5blockfilter_OBJECTS = tmd5blockfilter.$(OBJEXT) tmd5blockfilter_OBJECTS = $(am_tmd5blockfilter_OBJECTS) tmd5blockfilter_DEPENDENCIES = ../src/librdd.a am_tmsgprinter_OBJECTS = tmsgprinter.$(OBJEXT) tmsgprinter_OBJECTS = $(am_tmsgprinter_OBJECTS) tmsgprinter_DEPENDENCIES = ../src/librdd.a am_tnewwriter_OBJECTS = tnewwriter.$(OBJEXT) tnewwriter_OBJECTS = $(am_tnewwriter_OBJECTS) tnewwriter_DEPENDENCIES = ../src/librdd.a am_tnumparser_OBJECTS = tnumparser.$(OBJEXT) tnumparser_OBJECTS = $(am_tnumparser_OBJECTS) tnumparser_DEPENDENCIES = ../src/librdd.a am_tpart_OBJECTS = $(am__objects_1) tpart.$(OBJEXT) tpart_OBJECTS = $(am_tpart_OBJECTS) tpart_DEPENDENCIES = ../src/librdd.a am_treader_OBJECTS = treader.$(OBJEXT) treader_OBJECTS = $(am_treader_OBJECTS) treader_DEPENDENCIES = ../src/librdd.a am_tsafe_OBJECTS = $(am__objects_1) tsafe.$(OBJEXT) tsafe_OBJECTS = $(am_tsafe_OBJECTS) tsafe_DEPENDENCIES = ../src/librdd.a am_tsha1filter_OBJECTS = tsha1filter.$(OBJEXT) tsha1filter_OBJECTS = $(am_tsha1filter_OBJECTS) tsha1filter_DEPENDENCIES = ../src/librdd.a am_ttcpwriter_OBJECTS = ttcpwriter.$(OBJEXT) ttcpwriter_OBJECTS = $(am_ttcpwriter_OBJECTS) ttcpwriter_DEPENDENCIES = ../src/librdd.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(talignedbuf_SOURCES) $(tbuildtestfile_SOURCES) \ $(tcompress_SOURCES) $(tfile_SOURCES) $(tfiledesc_SOURCES) \ $(tmd5blockfilter_SOURCES) $(tmsgprinter_SOURCES) \ $(tnewwriter_SOURCES) $(tnumparser_SOURCES) $(tpart_SOURCES) \ $(treader_SOURCES) $(tsafe_SOURCES) $(tsha1filter_SOURCES) \ $(ttcpwriter_SOURCES) DIST_SOURCES = $(talignedbuf_SOURCES) $(tbuildtestfile_SOURCES) \ $(tcompress_SOURCES) $(tfile_SOURCES) $(tfiledesc_SOURCES) \ $(tmd5blockfilter_SOURCES) $(tmsgprinter_SOURCES) \ $(tnewwriter_SOURCES) $(tnumparser_SOURCES) $(tpart_SOURCES) \ $(treader_SOURCES) $(tsafe_SOURCES) $(tsha1filter_SOURCES) \ $(ttcpwriter_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBGLADE_CFLAGS = @LIBGLADE_CFLAGS@ LIBGLADE_LIBS = @LIBGLADE_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RDD_GUI_FALSE = @RDD_GUI_FALSE@ RDD_GUI_TRUE = @RDD_GUI_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ @GCC_COMPILER_FALSE@AM_CFLAGS = @GCC_COMPILER_TRUE@AM_CFLAGS = -W -Wall -Wmissing-prototypes AM_CPPFLAGS = -I../src AM_LDFLAGS = -static TESTS = tbuildtestfile test001 test002 test003 test004 test005 test006 \ tnumparser talignedbuf tnewwriter tsha1filter \ trunmd5blockfilter.sh ttcpwriter.sh tmsgprinter.sh WRITERCORE = twriter.c rddtest.c rddtest.h tcompress_SOURCES = $(WRITERCORE) tcompress.c tcompress_LDADD = ../src/librdd.a tfile_SOURCES = $(WRITERCORE) tfile.c tfile_LDADD = ../src/librdd.a tfiledesc_SOURCES = $(WRITERCORE) tfiledesc.c tfiledesc_LDADD = ../src/librdd.a tsafe_SOURCES = $(WRITERCORE) tsafe.c tsafe_LDADD = ../src/librdd.a tpart_SOURCES = $(WRITERCORE) tpart.c tpart_LDADD = ../src/librdd.a tnumparser_SOURCES = tnumparser.c tnumparser_LDADD = ../src/librdd.a talignedbuf_SOURCES = talignedbuf.c talignedbuf_LDADD = ../src/librdd.a tnewwriter_SOURCES = tnewwriter.c tnewwriter_LDADD = ../src/librdd.a tsha1filter_SOURCES = tsha1filter.c tsha1filter_LDADD = ../src/librdd.a treader_SOURCES = treader.c treader_LDADD = ../src/librdd.a tbuildtestfile_SOURCES = tbuildtestfile.c tbuildtestfile_LDADD = ../src/librdd.a tmd5blockfilter_SOURCES = tmd5blockfilter.c tmd5blockfilter_LDADD = ../src/librdd.a ttcpwriter_SOURCES = ttcpwriter.c ttcpwriter_LDADD = ../src/librdd.a tmsgprinter_SOURCES = tmsgprinter.c tmsgprinter_LDADD = ../src/librdd.a all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh trunmd5blockfilter.sh: $(top_builddir)/config.status $(srcdir)/trunmd5blockfilter.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ ttcpwriter.sh: $(top_builddir)/config.status $(srcdir)/ttcpwriter.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ tmsgprinter.sh: $(top_builddir)/config.status $(srcdir)/tmsgprinter.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) talignedbuf$(EXEEXT): $(talignedbuf_OBJECTS) $(talignedbuf_DEPENDENCIES) @rm -f talignedbuf$(EXEEXT) $(LINK) $(talignedbuf_LDFLAGS) $(talignedbuf_OBJECTS) $(talignedbuf_LDADD) $(LIBS) tbuildtestfile$(EXEEXT): $(tbuildtestfile_OBJECTS) $(tbuildtestfile_DEPENDENCIES) @rm -f tbuildtestfile$(EXEEXT) $(LINK) $(tbuildtestfile_LDFLAGS) $(tbuildtestfile_OBJECTS) $(tbuildtestfile_LDADD) $(LIBS) tcompress$(EXEEXT): $(tcompress_OBJECTS) $(tcompress_DEPENDENCIES) @rm -f tcompress$(EXEEXT) $(LINK) $(tcompress_LDFLAGS) $(tcompress_OBJECTS) $(tcompress_LDADD) $(LIBS) tfile$(EXEEXT): $(tfile_OBJECTS) $(tfile_DEPENDENCIES) @rm -f tfile$(EXEEXT) $(LINK) $(tfile_LDFLAGS) $(tfile_OBJECTS) $(tfile_LDADD) $(LIBS) tfiledesc$(EXEEXT): $(tfiledesc_OBJECTS) $(tfiledesc_DEPENDENCIES) @rm -f tfiledesc$(EXEEXT) $(LINK) $(tfiledesc_LDFLAGS) $(tfiledesc_OBJECTS) $(tfiledesc_LDADD) $(LIBS) tmd5blockfilter$(EXEEXT): $(tmd5blockfilter_OBJECTS) $(tmd5blockfilter_DEPENDENCIES) @rm -f tmd5blockfilter$(EXEEXT) $(LINK) $(tmd5blockfilter_LDFLAGS) $(tmd5blockfilter_OBJECTS) $(tmd5blockfilter_LDADD) $(LIBS) tmsgprinter$(EXEEXT): $(tmsgprinter_OBJECTS) $(tmsgprinter_DEPENDENCIES) @rm -f tmsgprinter$(EXEEXT) $(LINK) $(tmsgprinter_LDFLAGS) $(tmsgprinter_OBJECTS) $(tmsgprinter_LDADD) $(LIBS) tnewwriter$(EXEEXT): $(tnewwriter_OBJECTS) $(tnewwriter_DEPENDENCIES) @rm -f tnewwriter$(EXEEXT) $(LINK) $(tnewwriter_LDFLAGS) $(tnewwriter_OBJECTS) $(tnewwriter_LDADD) $(LIBS) tnumparser$(EXEEXT): $(tnumparser_OBJECTS) $(tnumparser_DEPENDENCIES) @rm -f tnumparser$(EXEEXT) $(LINK) $(tnumparser_LDFLAGS) $(tnumparser_OBJECTS) $(tnumparser_LDADD) $(LIBS) tpart$(EXEEXT): $(tpart_OBJECTS) $(tpart_DEPENDENCIES) @rm -f tpart$(EXEEXT) $(LINK) $(tpart_LDFLAGS) $(tpart_OBJECTS) $(tpart_LDADD) $(LIBS) treader$(EXEEXT): $(treader_OBJECTS) $(treader_DEPENDENCIES) @rm -f treader$(EXEEXT) $(LINK) $(treader_LDFLAGS) $(treader_OBJECTS) $(treader_LDADD) $(LIBS) tsafe$(EXEEXT): $(tsafe_OBJECTS) $(tsafe_DEPENDENCIES) @rm -f tsafe$(EXEEXT) $(LINK) $(tsafe_LDFLAGS) $(tsafe_OBJECTS) $(tsafe_LDADD) $(LIBS) tsha1filter$(EXEEXT): $(tsha1filter_OBJECTS) $(tsha1filter_DEPENDENCIES) @rm -f tsha1filter$(EXEEXT) $(LINK) $(tsha1filter_LDFLAGS) $(tsha1filter_OBJECTS) $(tsha1filter_LDADD) $(LIBS) ttcpwriter$(EXEEXT): $(ttcpwriter_OBJECTS) $(ttcpwriter_DEPENDENCIES) @rm -f ttcpwriter$(EXEEXT) $(LINK) $(ttcpwriter_LDFLAGS) $(ttcpwriter_OBJECTS) $(ttcpwriter_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rddtest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/talignedbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tbuildtestfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcompress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tfiledesc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmd5blockfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmsgprinter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnewwriter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnumparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/treader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsafe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsha1filter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ttcpwriter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twriter.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-generic clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: rdd-2.0.7/test/ttcpwriter.py010064400000000000000000000071701043501261200147100ustar00rootwheel#!/usr/bin/python # Copyright (c) 2002 - 2006, Netherlands Forensic Institute # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the Institute nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # Unit test script for the TCP writer module of rdd. # Copyright Netherlands Forensic Institute, 2004 # This script will fork and run ttcpwriter and netcat (nc) at the same time. ttcpwriter will write data to a TCP port at localhost. nc will read it and save the data to a file. This script will verify the stored data. import sys, os, struct, md5, time, string def usage(): sys.stderr.write('Usage: python ttcpwriter.py\n') sys.exit(1) def conv_net_order(netw_order): # Sizes are sent as two 32-bit integers in network byte order. # The least significant 32 bits are sent first. low = long(struct.unpack('!I', netw_order[:4])[0]) high = long(struct.unpack('!I', netw_order[4:8])[0]) return long((pow(2, 32) * high) + low) def error(msg): sys.stderr.write(msg + '\n') sys.exit(1) def main(): ret = os.fork() if ret == 0: # Child process runs netcat. os.system("nc -l -p 1111 > netcat-dump.img") else: # Parent process runs the ttcpwriter. time.sleep(2) # Wait for child to start up. # Run ttcpwriter. if (os.system("./ttcpwriter") != 0): error('The ttcpwriter program failed. Abort.') # Wait until the netcat child exits. if (os.waitpid(ret, 0)[1] != 0): error('Netcat (nc) exited with an error. Abort') # Read the output file produced by netcat. fp = file("netcat-dump.img", "rb") buf = fp.read() fp.close() if len(buf) == 0: error('no data received by nc. Abort.') flen = conv_net_order(buf[:8]) fsize = conv_net_order(buf[8:16]) blocksize = conv_net_order(buf[16:24]) splitsize = conv_net_order(buf[24:32]) flags = conv_net_order(buf[32:40]) # Verify the MD5 hash value of the file that was transported. m = md5.new() m.update(buf[(flen+40):]) hash = m.hexdigest().lower() md = md5.new() fp = file('image.img', 'rb') while 1: buf = fp.read(65536) if len(buf) == 0: break md.update(buf) fp.close() if (hash != md.hexdigest()): print 'Hash of the transported file is not correct. ' \ 'Abort.' sys.exit(1) else: print 'Hash of the transported file is correct.' sys.exit(0) if __name__=="__main__": main() rdd-2.0.7/test/tmsgprinter.c010064400000000000000000000114471042173111100146500ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* A unit-test for the message printer. */ #ifdef HAVE_CONFIG_H #include"config.h" #endif #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "error.h" #include "msgprinter.h" /* * Command-line arguments: * 1: logfile to print the messages in * 2: formatted string to print * 3: a list of errorcodes. Unix errors start with a 'U', rdd errors start * with an 'A' * * Error messages go to stderr. */ static RDD_MSGPRINTER *the_printer; static void printer_error(char *fmt, ...) { va_list ap; fprintf(stderr, "[tmsgprinter] "); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n"); exit(EXIT_FAILURE); } static void open_printers(char *logfile) { RDD_MSGPRINTER *file_log_printer = 0; RDD_MSGPRINTER *stdio_log_printer = 0; RDD_MSGPRINTER *bcast_printer = 0; RDD_MSGPRINTER *printers[2]; unsigned nprinter = 0; int rc = RDD_OK; /* Build a stdio printer to stderr and stack a log printer * as its child. */ rc = rdd_mp_open_stdio_printer(&stdio_log_printer, stderr); if (rc != RDD_OK) { printer_error("cannot open stdio printer to stderr"); } rc = rdd_mp_open_log_printer(&stdio_log_printer, stdio_log_printer); if (rc != RDD_OK) { printer_error("cannot stack log printer on stdio printer"); } printers[nprinter++] = stdio_log_printer; /* Build a file printer and stack a log printer as its child. */ rc = rdd_mp_open_file_printer(&file_log_printer, logfile); if (rc != RDD_OK) { printer_error("cannot open log file (%s)", logfile); } rc = rdd_mp_open_log_printer(&file_log_printer, file_log_printer); if (rc != RDD_OK) { printer_error("cannot stack log printer"); } printers[nprinter++] = file_log_printer; /* Create a broadcast printer and make it the current printer. */ rc = rdd_mp_open_bcast_printer(&bcast_printer, nprinter, printers); if (rc != RDD_OK) { printer_error("cannot open bcast printer"); } the_printer = bcast_printer; } static void close_printer(void) { int rc; if (the_printer == 0) return; rc = rdd_mp_close(the_printer, RDD_MP_RECURSE|RDD_MP_READONLY); if (rc != RDD_OK) { /* Cannot trust the_printer any more... */ fprintf(stderr, "cannot close message printer\n"); exit(EXIT_FAILURE); } the_printer = 0; } static void report_rdd_error(int rdd_errno, char *fmt, ...) { va_list ap; va_start(ap, fmt); rdd_mp_vrddmsg(the_printer, RDD_MSG_ERROR, rdd_errno, fmt, ap); va_end(ap); } static void report_unix_error(int rdd_errno, char *fmt, ...) { rdd_mp_unixmsg(the_printer, RDD_MSG_ERROR, rdd_errno, fmt); } static void report_error(char *errno, char *fmt, ...) { int n; n = atoi(errno + 1); if (errno[0] == 'U' || errno[0] == 'u') { report_unix_error(n, fmt); } else if (errno[0] == 'R' || errno[0] == 'r') { report_rdd_error(n, fmt); } else { fprintf(stderr, "Unknown errorcode: %s\n" , errno); } } int main(int argc, char **argv) { int i; if (argc < 4){ fprintf(stderr, "missing argument(s)\n"); fprintf(stderr, "usage: tmsgprinter logfile error-message " "error-code [error-code2, ......]\n"); exit(EXIT_FAILURE); } open_printers(argv[1]); for (i = 3; i < argc; i++) { report_error(argv[i], argv[2]); } close_printer(); return 0; } rdd-2.0.7/test/rddtest.h010064400000000000000000000030611042173111100137410ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ rdd-2.0.7/test/test001010075500000000000000000000006671042173111100132560ustar00rootwheel#!/bin/sh set -e echo echo "====== $0 ======" input="$0-input" output="$0-output" cmd="python driver-writer tfiledesc ${input} ${output}" # Empty file touch ${input} eval ${cmd} rm -f ${input} ${output} # 200 Kbyte file, zero-filled dd if=/dev/zero of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} ${output} # 200 Kbyte file, random bytes dd if=/dev/urandom of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} ${output} rdd-2.0.7/test/test002010075500000000000000000000006631042173111100132530ustar00rootwheel#!/bin/sh set -e echo echo "====== $0 ======" input="$0-input" output="$0-output" cmd="python driver-writer tfile ${input} ${output}" # Empty file touch ${input} eval ${cmd} rm -f ${input} ${output} # 200 Kbyte file, zero-filled dd if=/dev/zero of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} ${output} # 200 Kbyte file, random bytes dd if=/dev/urandom of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} ${output} rdd-2.0.7/test/test003010075500000000000000000000006661042173111100132570ustar00rootwheel#!/bin/sh set -e echo echo "====== $0 ======" input="$0-input" output="$0-output" cmd="python driver-writer -r tsafe ${input} ${output}" # Empty file touch ${input} eval ${cmd} rm -f ${input} ${output} # 200 Kbyte file, zero-filled dd if=/dev/zero of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} ${output} # 200 Kbyte file, random bytes dd if=/dev/urandom of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} ${output} rdd-2.0.7/test/test004010075500000000000000000000006721042173111100132550ustar00rootwheel#!/bin/sh set -e echo echo "====== $0 ======" input="$0-input" output="$0-output" cmd="python driver-writer -z tcompress ${input} ${output}" # Empty file touch ${input} eval ${cmd} rm -f ${input} ${output} # 200 Kbyte file, zero-filled dd if=/dev/zero of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} ${output} # 200 Kbyte file, random bytes dd if=/dev/urandom of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} ${output} rdd-2.0.7/test/test005010075500000000000000000000010501042173111100132450ustar00rootwheel#!/bin/sh set -e echo echo "====== $0 ======" input="$0-input" output="$0-output" cmd="python driver-writer -p tpart ${input} ${output}" # Empty file touch ${input} eval ${cmd} rm -f ${input} `dirname ${output}`/[0-9]*-`basename ${output}` # 200 Kbyte file, zero-filled dd if=/dev/zero of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} `dirname ${output}`/[0-9]*-`basename ${output}` # 200 Kbyte file, random bytes dd if=/dev/urandom of=${input} bs=1024 count=200 eval ${cmd} rm -f ${input} `dirname ${output}`/[0-9]*-`basename ${output}` rdd-2.0.7/test/tbuildtestfile.c010064400000000000000000000074261042173111100153170ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* This is a simple program to build a testfile to be used by several * rdd unit tests. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(HAVE_OPENSSL_BLOWFISH_H) #include #else #error OpenSSL Blowfish algorithm not available #endif #include #include #include #include "rdd.h" #define BLOWFISH_BLOCKSIZE 8 /* bytes (64 bits) */ #define NULL_BUFSIZE 524288 static void print_buf(unsigned char *buf, unsigned n) { unsigned i; for (i = 0; i < n; i++){ printf("buffer item %02i = 0x%X\n", i, buf[i]); } } /* Writes some null-butes to a file. */ static void write_null(FILE *outfile) { unsigned char buf[NULL_BUFSIZE]; memset(buf, 0, NULL_BUFSIZE); fwrite(buf, 1, NULL_BUFSIZE, outfile); } /* Writes some printable characters to a file. */ static void write_text(FILE *outfile) { unsigned char buf[] = "Dit is een stukje standaardtekst in het" "Nederlands. De entropie van dit fragment zou niet erg hoog " "mogen zijn. Dat zie je......"; int i; for (i = 0; i < 4096; i++){ fwrite(buf, 1, 128, outfile); } } static void write_encrypted(FILE *outfile) { unsigned char inbuf[BLOWFISH_BLOCKSIZE]; unsigned char outbuf[BLOWFISH_BLOCKSIZE]; const char *keydata = "rdd"; BF_KEY key; int i; /* Write some 'random' data to a file. The random() library function * can be platform or implementation dependent, so we prefer to use * encryption to obtain reproducible random data. * * The user key is "rdd". The initial input is a buffer filled * with null bytes. The output of each encryption round is * used as input for the next round. */ memset(inbuf, 0, sizeof inbuf); memset(outbuf, 1, sizeof outbuf); BF_set_key(&key, strlen(keydata), (unsigned char *) keydata); for (i = 0; i < 65536; i++){ BF_ecb_encrypt(inbuf, outbuf, &key, BF_ENCRYPT); fwrite(outbuf, 1, sizeof outbuf, outfile); memcpy(inbuf, outbuf, sizeof inbuf); } } int main(void) { const char *outpath = "image.img"; FILE *outfile; if ((outfile = fopen(outpath, "wb")) == NULL) { fprintf(stderr, "cannot open output file %s.\n", outpath); exit(EXIT_FAILURE); } write_encrypted(outfile); write_text(outfile); write_null(outfile); (void) fclose(outfile); return 0; } rdd-2.0.7/test/driver-writer010075500000000000000000000067021042173111100146570ustar00rootwheel#!/usr/bin/env python # Copyright (c) 2002 - 2006, Netherlands Forensic Institute # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the Institute nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. import getopt import glob import os, os.path import stat import sys import zlib partitioned = 0 compressed = 0 readonly = 0 def commandline(): opts, args = getopt.getopt(sys.argv[1:], 'prz') for opt, val in opts: if opt == '-p': global partitioned partitioned = 1 elif opt == '-z': global compressed compressed = 1 elif opt == '-r': global readonly readonly = 1 if len(args) != 3: sys.stderr.write('Usage: driver-writer [-r] [-z] prog in out\n') sys.exit(1) return args def error(msg, exitcode=1): sys.stderr.write('error: %s\n' % msg) sys.exit(exitcode) def readfile(path, parts=0): if not parts: fp = file(path, 'rb') buf = fp.read() fp.close() return buf print 'collecting parts...' hd, tl = os.path.split(path) if hd: paths = glob.glob('%s/[0-9]*-%s' % (hd, tl)) else: paths = glob.glob('[0-9]*-%s' % tl) buf = '' paths.sort() # somehow the items in paths were not in #alphabetical order automatically for path in paths: fp = file(path, 'rb') buf += fp.read() fp.close() return buf def run(copyprog, inpath, outpath): status = os.system('./%s "%s" "%s"' % (copyprog, inpath, outpath)) if status: status = (status >> 8) & 0xff sys.exit(status) inbuf = readfile(inpath) outbuf = readfile(outpath, partitioned) if readonly: print 'checking file mode...' statinfo = os.stat(outpath) anywrite = stat.S_IWUSR|stat.S_IWGRP|stat.S_IWOTH if (statinfo.st_mode & anywrite) != 0: error('%s is not read-only' % outpath) if compressed: print 'decompressing...' outbuf = zlib.decompress(outbuf) print 'comparing files...' if inbuf != outbuf: error('output file %s differs from input file %s' \ % (outpath, inpath)) print 'ok' if __name__ == '__main__': try: args = commandline() copyprog, inpath, outpath = args run(copyprog, inpath, outpath) except SystemExit, exn: raise except Exception, exn: error('Exception: %s' % str(exn)) rdd-2.0.7/test/talignedbuf.c010064400000000000000000000065461042173111100145620ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /** @file * \brief Unit test program for the \c alignedbuf module. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "rdd.h" #include "alignedbuf.h" typedef struct _RDD_ALIGNEDBUF_TESTCASE { unsigned size; /**< buffer size */ unsigned alignment; /**< alignment */ int errcode; /**< expected errcode for rdd_new_alignedbuf */ } RDD_ALIGNEDBUF_TESTCASE; static RDD_ALIGNEDBUF_TESTCASE testcases[] = { {0, 0, RDD_BADARG}, {1, 0, RDD_BADARG}, #if 0 /* This test case does not always produce RDD_NOMEM * on machines with a lot of memory. */ {~0, ~0, RDD_NOMEM}, #endif {1024, 0, RDD_BADARG}, {1024, 1, RDD_OK}, {256*1024, 512, RDD_OK}, {8*1024*1024, 512, RDD_OK}, {1024, 13, RDD_OK}, {2, 13, RDD_OK}, {0, 1, RDD_OK} }; static void test(RDD_ALIGNEDBUF_TESTCASE *tc) { RDD_ALIGNEDBUF buf; ptrdiff_t diff; int rc; printf("%u %u %d\n", tc->size, tc->alignment, tc->errcode); rc = rdd_new_alignedbuf(&buf, tc->size, tc->alignment); if (rc != tc->errcode) { printf("unexpected return code [%d]\n", rc); exit(EXIT_FAILURE); } if (rc != RDD_OK && rc != RDD_NOMEM && rc != RDD_BADARG) { printf("bad return code [%d]\n", rc); exit(EXIT_FAILURE); } if (rc != RDD_OK) return; if ((buf.aligned - (unsigned char *)0) % tc->alignment != 0) { printf("buffer not aligned\n"); exit(EXIT_FAILURE); } diff = buf.aligned - buf.unaligned; if (diff < 0 || diff >= (signed) tc->alignment) { printf("aligned, but at wrong position\n"); exit(EXIT_FAILURE); } rc = rdd_free_alignedbuf(&buf); if (rc != RDD_OK) { printf("cannot free aligned buf\n"); exit(EXIT_FAILURE); } } int main(int argc, char **argv) { unsigned i; for (i = 0; i < (sizeof testcases) / (sizeof testcases[0]); i++) { test(&testcases[i]); } return 0; } rdd-2.0.7/test/test006010075500000000000000000000001571042173111100132550ustar00rootwheel#!/bin/sh set -e echo echo "====== $0 ======" rm -f output.img cmd="./treader" eval ${cmd} rm -f output.img rdd-2.0.7/test/treader.c010064400000000000000000000220551042173111100137150ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* A unit test for the reader code of rdd */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "rdd.h" #include "error.h" #include "writer.h" #include "reader.h" #include "filter.h" #include "filterset.h" #include "rdd_internals.h" #include "copier.h" #include "rddtest.h" static char *progname; static char *input_file; static char *output_file; static char *sim_file; static void usage(void) { fprintf(stderr, "Usage: %s \n", progname); exit(EXIT_FAILURE); } static void command_line(int argc, char **argv) { unsigned i = 1; if (argc - i == 0) { /* Just one argument. Set some default values. */ input_file = argv[0]; /* copy this program's binary */ output_file = "output.img"; sim_file = "simfile.txt"; } else if (argc - i != 3) { input_file = argv[i++]; output_file = argv[i++]; sim_file = argv[i++]; } else { usage(); } } static void handle_subst(rdd_count_t offset, unsigned nbyte, void *env){ fprintf(stderr, "input dropped: offset = %llu bytes, " "count = %u bytes\n", offset, nbyte); } static void handle_read_error(rdd_count_t offset, unsigned nbyte, void *env){ fprintf(stderr, "read error: offset = %llu bytes, " "count = %u bytes\n", offset, nbyte); } /* build readers to simulate faults. */ static RDD_READER * build_reader(void) { RDD_READER *reader= 0; RDD_READER *faulty_reader= 0; int rc; rdd_count_t size; rc = rdd_open_file_reader(&reader, input_file, 0); if (rc != RDD_OK) { rdd_error(rc, "cannot open file reader"); } if ((rc = rdd_reader_seek(reader, 0)) != RDD_OK){ rdd_error(rc, "cannot seek to offset 0"); } size = RDD_WHOLE_FILE; if ((rc = rdd_device_size(input_file, &size)) != RDD_OK){ rdd_error(rc, "cannot determine file size of %s", input_file); } printf("file size is %llu\n", size); /* Stack the faulty reader onto the file reader */ if ((rc = rdd_open_faulty_reader(&faulty_reader, reader, sim_file)) != RDD_OK) { rdd_error(rc, "cannot initialize faulty reader"); } return faulty_reader; } /* Build a filter set and put a writer in it. */ static void build_fset(RDD_FILTERSET *fset) { RDD_FILTER *f = 0; RDD_WRITER *writer = 0; int rc; if ((rc = rdd_fset_init(fset)) != RDD_OK){ rdd_error(rc, "cannot initialize filter set"); } if ((rc = rdd_open_safe_writer(&writer, output_file, RDD_OVERWRITE)) != RDD_OK){ rdd_error(rc, "cannot open output file %s", output_file); } if ((rc = rdd_new_write_streamfilter(&f, writer)) != RDD_OK){ rdd_error(rc, "cannot build write-stream filter"); } if ((rc = rdd_fset_add(fset, "writer", f)) != RDD_OK){ rdd_error(rc, "cannot add write filter to filter set"); } } /* Build the robust copier. */ static void copy(RDD_READER *reader, RDD_FILTERSET *fset) { RDD_COPIER *copier = 0; RDD_ROBUST_PARAMS p; RDD_COPIER_RETURN ret; int rc; memset(&p, 0, sizeof(p)); p.minblocklen = 512; p.maxblocklen = 1048576; p.nretry = 4; p.maxsubst = 10000; p.readerrfun = handle_read_error; p.substfun = handle_subst; if ((rc = rdd_new_robust_copier(&copier, 0, RDD_WHOLE_FILE, &p) != RDD_OK)){ rdd_error(rc, "cannot create robust copier"); } if ((rc = rdd_copy_exec(copier, reader, fset, &ret)) != RDD_OK){ rdd_error(rc, "copy error"); } if ((rc = rdd_copy_free(copier)) != RDD_OK) { rdd_error(rc, "cannot free copier"); } } /* Calls some functions with bad arguments. */ static int call_tests(void) { RDD_READER *reader; RDD_READER *faulty_reader= 0; int rc; int errors = 0; printf("Trying to open a file. The path is an empty string.\n"); if ((rc = rdd_open_file_reader(&reader, "", 0)) == RDD_OK){ fprintf(stderr, "COULD OPEN THE FILE. TEST FAILED.\n"); errors++; } printf("Trying to open a non-existing file.\n"); if ((rc = rdd_open_file_reader(&reader, "fajhdgahd", 0)) == RDD_OK){ fprintf(stderr, "COULD OPEN THE FILE. TEST FAILED.\n"); errors++; } if ((rc = rdd_open_file_reader(&reader, input_file, 0)) != RDD_OK){ printf("Could not open input file when it should be no " "problem.\nTEST FAILED"); exit(EXIT_FAILURE); } if ((rc = rdd_reader_seek(reader, 0)) != RDD_OK){ printf("could not seek to location 0.\nTEST FAILED.\n"); errors++; } printf("Trying to seek illegal locations in the reader.\n"); if ((rc = rdd_reader_seek(reader, -1)) == RDD_OK){ printf("COULD SEEK TO LOCATION -1. TEST FAILED.\n"); errors++; } if ((rc = rdd_reader_seek(reader, 22223343)) == RDD_OK){ printf("COULD SEEK TO LOCATION TOO FAR AWAY. TEST FAILED.\n"); errors++; } printf("Trying to open a faulty reader. The path to the simfile " "is an empty string.\n"); if ((rc = rdd_open_faulty_reader(&faulty_reader, reader, "")) == RDD_OK){ printf("COULD OPEN SIMFILE. TEST FAILED.\n"); errors++; } printf("Trying to open a faulty reader. The simfile " "is a non-existing file.\n"); if ((rc = rdd_open_faulty_reader(&faulty_reader, reader, "fasdgfadgj")) == RDD_OK){ printf("COULD OPEN SIMFILE. TEST FAILEd.\n"); errors++; } if ((rc = rdd_open_faulty_reader(&faulty_reader, reader, sim_file)) != RDD_OK){ rdd_error(rc, "cannot open simulation file when it " "should not be a problem\nTEST FAILED"); } return errors; } static int call_robust_copier(void) { /* Some parameters for the robust copier. None of these * sets of parameters should be accepted. */ struct TESTCASE { rdd_count_t offset; rdd_count_t count; unsigned minblocklen; unsigned maxblocklen; unsigned retries; unsigned maxsubst; } testcases[] = { #if 0 {-10, 1024, 512, 512, 4, 10}, /* legal */ { 0, -10, 512, 512, 4, 10}, /* legal */ #endif { 0, 1024, -10, 512, 4, 10}, /* illegal */ #if 0 { 0, 1024, 512, -10, -10, 10}, /* legal */ { 0, 1024, 512, 512, 4, 10}, /* legal */ { 0, 1024, 512, 512, 4, -10}, /* legal */ #endif { 0, 1024, 1024, 512, 4, 10}, /* illegal */ #if 0 { 0, 1024, 1048576, 1048576, 4, 10}, /* legal */ {1048579, 1024, 512, 512, 4, 10}, /* legal */ { 0,1048579, 512, 512, 4, 10}, /* legal */ { 0, 1024, 512, 512, 4, 10}, /* legal */ #endif }; RDD_COPIER *copier = 0; struct TESTCASE *tc; RDD_ROBUST_PARAMS p; int rc; int errors = 0; unsigned i; printf("Trying to make a robust copier with invalid parameters.\n"); for (i = 0; i < sizeof(testcases)/sizeof(testcases[0]); i++){ tc = &testcases[i]; memset(&p, 0, sizeof p); p.minblocklen = tc->minblocklen; p.maxblocklen = tc->maxblocklen; p.nretry = tc->retries; p.maxsubst = tc->maxsubst; rc = rdd_new_robust_copier(&copier, tc->offset, tc->count, &p); if (rc == RDD_OK) { fprintf(stderr, "Could build a copier in run %u.\n" "TEST FAILED.\n", i); errors++; } else { fprintf(stderr, "OK: cannot build illegal copier\n"); } } return errors; } static void close_reader(RDD_READER *reader) { int rc; if ((rc = rdd_reader_close(reader, 1 /* recurse */)) != RDD_OK) { rdd_error(rc, "cannot close reader"); } } int main(int argc, char **argv) { RDD_READER *reader; RDD_FILTERSET fset; progname = argv[0]; set_progname(progname); command_line(argc, argv); printf("input file = %s\n", input_file); printf("output file = %s\n", output_file); printf("sim file = %s\n", sim_file); reader = build_reader(); build_fset(&fset); copy(reader, &fset); close_reader(reader); #if 0 if (call_tests() > 0){ exit(EXIT_FAILURE); } #endif if (call_robust_copier() > 0){ exit(EXIT_FAILURE); } return 0; } rdd-2.0.7/test/Makefile.am010064400000000000000000000032541042173111100141570ustar00rootwheel## Process this file with automake to produce Makefile.in if GCC_COMPILER AM_CFLAGS = -W -Wall -Wmissing-prototypes else AM_CFLAGS = endif AM_CPPFLAGS = -I../src AM_LDFLAGS = -static TESTS= tbuildtestfile TESTS+= test001 TESTS+= test002 TESTS+= test003 TESTS+= test004 TESTS+= test005 TESTS+= test006 TESTS+= tnumparser TESTS+= talignedbuf TESTS+= tnewwriter TESTS+= tsha1filter TESTS+= trunmd5blockfilter.sh TESTS+= ttcpwriter.sh TESTS+= tmsgprinter.sh noinst_PROGRAMS = \ tbuildtestfile tcompress tfile tfiledesc tsafe tpart \ tnumparser talignedbuf \ tnewwriter tsha1filter treader tmd5blockfilter ttcpwriter \ tmsgprinter WRITERCORE = twriter.c rddtest.c rddtest.h tcompress_SOURCES = $(WRITERCORE) tcompress.c tcompress_LDADD = ../src/librdd.a tfile_SOURCES = $(WRITERCORE) tfile.c tfile_LDADD = ../src/librdd.a tfiledesc_SOURCES = $(WRITERCORE) tfiledesc.c tfiledesc_LDADD = ../src/librdd.a tsafe_SOURCES = $(WRITERCORE) tsafe.c tsafe_LDADD = ../src/librdd.a tpart_SOURCES = $(WRITERCORE) tpart.c tpart_LDADD = ../src/librdd.a tnumparser_SOURCES = tnumparser.c tnumparser_LDADD = ../src/librdd.a talignedbuf_SOURCES = talignedbuf.c talignedbuf_LDADD = ../src/librdd.a tnewwriter_SOURCES = tnewwriter.c tnewwriter_LDADD = ../src/librdd.a tsha1filter_SOURCES = tsha1filter.c tsha1filter_LDADD = ../src/librdd.a treader_SOURCES = treader.c treader_LDADD = ../src/librdd.a tbuildtestfile_SOURCES = tbuildtestfile.c tbuildtestfile_LDADD = ../src/librdd.a tmd5blockfilter_SOURCES = tmd5blockfilter.c tmd5blockfilter_LDADD = ../src/librdd.a ttcpwriter_SOURCES = ttcpwriter.c ttcpwriter_LDADD = ../src/librdd.a tmsgprinter_SOURCES = tmsgprinter.c tmsgprinter_LDADD = ../src/librdd.a rdd-2.0.7/test/tpart.c010064400000000000000000000040741042173111100134220ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "rdd.h" #include "writer.h" #include "rddtest.h" RDD_WRITER * rdd_test_get_writer(int argc, char **argv) { RDD_WRITER *fw = 0; char *outfile = argv[0]; rdd_count_t maxlen, splitlen; int rc; if (argc < 1) return 0; maxlen = RDD_WHOLE_FILE; splitlen = 10 * 1024; rc = rdd_open_part_writer(&fw, outfile, maxlen, splitlen, RDD_NO_OVERWRITE); if (rc != RDD_OK) { rdd_test_error(rc, "cannot open %s", outfile); } return fw; } rdd-2.0.7/m4004075500000000000000000000000001042173237400114205ustar00rootwheelrdd-2.0.7/m4/libglade-2.0.m4010064400000000000000000000003521042173111100137620ustar00rootwheelAC_DEFUN([AM_PATH_LIBGLADE_2_0], [ AC_PATH_PROG(PKG_CONFIG, pkg-config, no) LIBGLADE_CFLAGS=`$PKG_CONFIG --cflags libglade-2.0` LIBGLADE_LIBS=`$PKG_CONFIG --libs libglade-2.0` AC_SUBST(LIBGLADE_CFLAGS) AC_SUBST(LIBGLADE_LIBS) ]) rdd-2.0.7/gui004075500000000000000000000000001043501323200116525ustar00rootwheelrdd-2.0.7/gui/pixmaps004075500000000000000000000000001042173237400133455ustar00rootwheelrdd-2.0.7/gui/pixmaps/minjuslogo-200.png010064400000000000000000000233751042173111100166120ustar00rootwheel‰PNG  IHDRÈÈ­X®ž pHYs ï ï}vŠHtIMEÔ ¨ÍžÏ IDATxœíÝ{XSwž?ðw‚ "H( 6ʈƒ7¬¶¶§nѹµvgwªÓÙ:Ýée;ÖÖiY§u¦Ï¶ÝVmŸ^ìØÙŽL»eÊ.U Šà¥x!´* DI Äá–ä„äûûÃ_Î !7Àêçõ<ù#''ßó='yŸó=ç|Ï9Æ!Ä£°é®!×2 !^P@ñ‚BˆB¼ €â„/( „xA!Ä !^P@ñ‚BˆB¼ €L’öövìÙ³ .DXXÂÂÂ0wî\ìÞ½p8†Óéœîª/ÔÝ=ôl6¶lÙ‚ýû÷Ãf³¹}ßüæ7X´hZ[[qçwâöÛo‡P(œ¦Úo( !ÒÞÞŽÆÆF´´´àÈ‘#(..ÆèE+ •J‘˜˜ˆ°°0  cþüùøðñbÅŠi¬=OøtWàÛŽã8=z»wïFSS`µZ݆þð‡¸÷Þ{‘žžŽãpìØ1ü×ý ŒF#äZÅH@œN'3ì'?ù ‰D €ÇWZZ+((`N§sLíííìöÛog………Ó0ÄÔÄ Ð¥K—ðïÿþïxÿý÷áp8<Ž#•JñöÛocÆ ˆŠŠò8NEEd2mA®Q?Y,ÔÔÔ ¡¡jµb±xÜqç΋‡~aaã,tÅò6™>´â§'NàñÇÇàà V¯^Ý»wC*•z7<<|Â?>ãÚFñ“V«…^¯A(â…^À¼yó¦·bdRP@ü¡P‡Ã§Ó‰¢¢"Øl6üíoƒD"™îê‘£í»ŸÿÞn·cÿþýøå/‰ššši¬™ ?Y,ŒŒŒŒ~ðàA<ýôÓP«ÕÓP+2Y( ~Љ‰ñØ-Än·ãøñãx衇pöìÙ1Ÿ;NX­VtttàÈ‘#hhh˜Šê’ Ña^?UUUáŸþéŸ`0<~. qË-· ¬¬ 2™Œn6›±gÏF¨Õjäææâ•W^™ªj“Q@ü488ˆßýîwxï½÷Æí‰‰ÖÖV( ~˜Óéä›fýýýp:˜5kÖ”Ô™ŽšX~ŠŽŽÆÓO?¥K—ŽÛ×étŽ9»Îƒ^¯Ço¼-[¶àèÑ£SQ]$ ˆŸ”J%ÊËËÇm"Ùíö10›Í¨««CZZ¶lÙ‚åË—OEuI( ’ËåX¼x±Û!ßÑ> ‹Å¿OHHÀOúS´¶¶B§ÓaÁ‚SUUÚ ‚ÅbÁÏ~ö3”——Ù‰ˆˆÀSO=…íÛ·»uT†@ €H$SžÍfCKK š››¡V«ÑÚÚŠžž„……A©T"55 ,Àüùó‘’’BÝT¦I‚T*Åoû[8œ:u —/_æ?³ÛíøË_þ‚¨¨(äååaáÂ…ˆ‰‰ADDl6ßÑÑb±àäÉ“¨¬¬Ä±cÇÐÖÖ†®®®1Ó‹ˆˆ€B¡@FF¾ÿýï#;;ÙÙÙt5â$¢-H âË/¿D[[úûûñÎ;ï¸ç‰DX°`ßMÅjµâ{ßûž}öYTWWc÷îÝ8|ø°ß×§K$üæ7¿Á~ð´··C¯×cxxÀ•ð*•J,X°)))J¥ã6Éø( !ƒÓéDoo/î¿ÿ~”••y?-- kÖ¬Á±cÇ ×ëÇ ‡@ @ZZ²³³¡ÕjqáÂØívþŠÅ¨¨(Èårôööºáˆˆˆ@jj*”J%îºë.Ü{ï½HNNÝLߨ‰"B¡ÑÑÑãv®toÏÈÈÀ³Ï>‹™3gâ“O>ñºå`Œá믿FVV}ôQÌ›7gΜÁþýûqþüy áÒ¥K˜1c¡P( “É ±XŒ3f@$¡«« åå娼y3mIü1Õ—0^ïìv;Û´iÓ¸—à._¾œ;vŒ9Næt:½Ž{õ+22’mÚ´‰577³ææföûßÿžedd°û￟°/¾ø‚µµµ1‹ÅÂ8Žcv»ŒŒ0‡Ãáñ’_21jbM‚ßþö·xýõ×݆EGGãž{îÁŽ;ššÊjooÇùóça±XÐÛÛ ½^ÖÖV\¸p&“ f³ÙíB¡ ,À®]»°téR˜ÍfDGG#<<R©ÔëÖ‹øšX“ÀS’7â¹çžÃܹs݆ßtÓM¸é¦›ø÷CCCDgg'Z[[qêÔ)?~çÏŸÇåË—áp8páÂ<üðÃÈÈÈ@XXÁC\\²²²p÷Ýw#++kÒçóF@ !§Ó‰ÎÎN ñÃbbb°yófìܹáá/n±X ±XŒ™3gbáÂ…X·nœN'ÚÛÛqâÄ ¼ÿþû8wîš››ÑÜÜ àÊþORRn½õV,\¸vÄCˆšX!¢V«ñ?ÿó?øì³Ï V«a6›!‹±}ûvlÙ²r¹<$ÓikkC}}=^yåTWWC.—cÆ ذa¾ûÝï†l:ä Ú‚addZ­û÷ïÇîÝ»ÝNîÅÄÄàÑGÅSO=åÓ–ÃWIIIà8·Ýv¾úê+Ü~ûíX»v-’’’²éÿo:|›]¾|™íß¿Ÿ­X±‚͘1Ãíh“@ `O=õëìì ùt ÙwÜÁ¢££&‹Ù¬Y³Ø-·ÜÂüqVSSÃ8Ž ùtoTô÷÷³Gy„ÅÄÄŒ9+‘H؃>Ȇ‡‡C6½¡¡!vðàAöóŸÿÜë]]ÉÍÍeo¾ù&ûòË/ÙåË—éo( ~²Z­ì…^`ÿ ?ÿùÏCºåhoog/¿ü2‹gÀçs&L©T²üü|vîܹÕçFCñƒÃá`/¿ü²Ç-‡P(dk×®ez½>$Ó2 ìµ×^cK—.7Œ¾¼KJJb>ø Û¿? Iýn?´´´°ÔÔTÄÜÜ\VUUô4Yyy9ûñÌ$IÀÁ¸úÆ’““Ù3Ï<ÃNž<ÉG–Èõ⣑‘¶wï^¾¤¤$¦V«ƒj댌0FÃ~ñ‹_0©T²`xÚ¢Èd2¶uëVÖÜÜLû' €øh``€ýë¿þë˜?œT*e¯¿þzÐ岻ロÉd2&‹™P(œ´`"‘ˆåää°0›Í‚%t}¢ó >r:nDW.`z衇°iÓ¦ ÊfŒñb3›Í0›ÍüõZ­ƒÝÝÝèïïG__l6[ÐÏ6ä8õõõxõÕW!‹±fÍš Ê»^Q@|5æÕË–-Ãã?îvÿ«@¾ÿ–«›c ÇÁf³ahh}}}èîîFmm-ª««qôèQ˜Í性ŽM›6á±ÇÃìÙ³ƒªÿumº7aß&555üyˆÅ‹‡d§<v»]ºt‰}ñÅlûöíì¶Ûn›ðüÈÕ/@ÀRSSÙž={XOOÏ´ÌÇ·Ä‹…ååå1ìÍ7ß÷©ëZ©`³ÙXKK {ë­·Xvv6 ó+( ìßþíß($ã €øéÌ™3ì÷L9Çqìµ×^c½½½>—ét:™Íf úЫÝngeeeì§?ý)‹ŠŠò+(999¬²²2¨é_¨7¯Ÿ†‡‡ÑÓÓãv[ÑÑôz=þå_þ}ô½–eµZQQQÆÆFtvv"!!·Ür n½õVÄÆÆT?§Ó £Ñˆ×_ûÛß<ÞÅ“°°0,Z´¯¾ú*V­Z…ˆˆˆ€¦Ý™î„^o8À¢££Yqq±×fÖÙ³gÙ½÷Þ;æ,yTTûÞ÷¾ÇÔjuP[»ÝÎJJJ˜\.÷«‹ÊÌ™3Ùo¼ÁFFFžöõ„bï¾û.ìî»ïöØíÄáp°cÇŽ±eË–±ðððqÏzçää°#G޵/ãp8ØÛo¿Íýjn%%%±}ûö1»ÝÌ¢¸.Ÿþùç§bKu£8}ú4ÊÊÊ ÓéÐÒÒ‚E‹!66B¡øàƒ°uëVp‡U«V¡¿¿6›ÍíºsÆŒF#ÿ…Ù³gcÆŒ~×E  33—/_Fee¥Ïß³Z­8qâFFFpë­·†ôz–oéNèõ¦¨¨ˆßAlÙ²eìü#Û¿?{ì±ÇXll,Àzè!f±XاŸ~Ê~ñ‹_Œ¹¦Äõ’Édì±Ç ªÉsòäɀζ‹ÅböÑGÝÐÍ- Hˆuuu± 6Œù³]½¯qèÐ!þ;DZóçϳ·ß~›ÝvÛmcÂÎxàÖÚÚPÚÚÚî’róÍ7³„hé|ûP@BÌét2•JÅâãã½öƒò´Âqklldýë_ÙâÅ‹Ydd¤ÛÎûý÷ßÏúûûý®“Ñh 8 aaa,//ï†=OB™$_~ù%»óÎ;=Aš3g΄ÍŽãØ… Ø#<Â233ùú»îº‹?Þ¯ºœ8q"à€¸^=öf‘|+Q@&‰Óédjµš-]ºtÌŸíW¿ú•Ïå ²úúzöÎ;ï°;ÅÄİ; Ÿ¾ùòe¶}ûö rÓM7±²²²@Ç·d’]}kQ‘HÄÞ{ï½€Êdü1»ï¾ûØÆÙ±cǼޠÁáp°ÿþïÿfsæÌ : €Ýu×].†o­øøÝÔˆ‹‹s{/‹Ç= ?×íKïºë.455A­VÃétbåÊ•né®tgÿôÓOñì³ÏÂh4\ÆΜ9t9ß6I–””äö~æÌ™c†ùC("..999ÈÉÉ៻ît:Ñ×ׇÞÞ^ôõõáСC8wîܘ‡‰cô#oI‡ˆˆØívWîŲò“““ñ£ýf³*• û÷ïGUUº»»C6 —ñ„á7ÇSL¡P ..€ÜÜÜ ¶ žÌœ9?üá±fÍ\¼x§N‰'PUU…o¾ù&è-IdddÐWN~Q@&Ù¬Y³ËdáÂ…cöB)** ‹-ÂÂ… ±aÃÔÖÖ¢®®*• õõõhmmõ»L±XŒÍ›7ãÉ'Ÿœ„_Û( “,!!111®üÑ.\8%Ó …HLLÄÚµk±víZŒŒŒ ³³UUUP©TP«Õèèè@ww7ìv;ìv;œN'©TŠÄÄD,_¾?ùÉO°jÕªòÞ¿I6cÆ ¾£áüùóqóÍ7OK=ÂÃÑœœŒ 6àÞ{ïEoo/.]º„îîn óÏ …ˆŠŠBll,0gΜú)ºIæzÞp¥yÊô@ ÄÇÇ_u¹ÖÑ“è'YTTf̘°°°1wE!×> È$ …ÈÈÈ€B¡Àm·Ý6ÝÕ!~¢€L2@€9sæ@.—#--mº«CüD™daaaX¼x1RRRB~þƒL>ÚIŸÇÁ`0Àh4¢µµõõõˆ‹‹»!ÏDÛÑ/$›Í†ææf|óÍ7èêê™3gPWW‡ÖÖVtwwƒã8Àw¾óœ?¹¹¹Ó\câ Hjkkñûßÿ:½½½à8Îã¥u:>þøcäää@ LCMI h$HGE{{;8€;v`ÅŠÏ8ŒŒàïÿ;êëë§¡–$P 8NÔ××Ã`0`öìÙØºu+öíÛ‡_ÿú×÷7L&Š‹‹ÇøÀc/`2½( ~ª©©ÁÅ‹Çý¼©© —.]ò¹¼ÄÄDüçþ'ÊÊÊ`2™BQEB?i4þ"(Oôz½ßw/T(Ðétøê«¯‚­ 1 ˆz{{qðàA¯ãtuuA¯×ûUnGGt:ÊÊÊ‚¨™ ?´··C§Óy‡ã8¿Oþét:p‡ššØl¶`ªHBŒâ#»ÝÎ?;ÜÆŠŠŠ|ÞáfŒ¡¸¸Œ1œ={åå塨.  ˆpêÔ)ŸÆmkksëúîÍàà ¿Ï222‚ªª*ÚŠ\C( >êèèÀùóç}·¯¯o¦˜‹ÉdBGGÿ¾¤¤Äc72=( >êììôؽÄÆ***|·©©Éíì{[[jkkª# = ˆT*•[÷ö‰œ={Ö§›3\¸pÁíB«ÁÁAüõ¯¥“†× ˆœN'JKKý:CÞÝÝíS÷‘«Ï™0ÆPSSãÖì"Ó‡â³Ùì÷Hššš|ê¥ë©ï–ÍfßÿügÚŠ\( >8yò¤ß@îììœð„¡Õj÷æuuut4ë@™Çq8tèßß™ð¨WUUÕ¸ý¶êëëigý@™@WW—×ΉÞ477{ý\­VcxxØãgíííøì³Ïš.  Èêêê V«úîÅ‹Ç=’e·Û¡ÑhÆÝñ·Ûí8tè_GÎHèQ@&ÐØØðÅL—.]w+âí3—¯¾ú*àp’Р€xát:qàÀ€oðf6›QSSãñ3ƒÁ0áQ.ŽãðÉ'ŸøÜm…„Ä‹ÞÞ^¨Tª€¿ÏÃÅ‹=6£ºººÐÓÓ3a'Nœ@[[[Àu Á¡€xÑÐлÝTçÎóØEåøñããî ¦ÓépìØ± ê@Gñ"÷ÎÕétc.¥u:>ßá}pp‡º$0/F?¶ P&“iÌÜ]Ï5ô…ÓéÄ矎þþþ ëBüGñB©TB&“UÆàà 4Û°††¿ŽŒõööÒVdšP@¼¸é¦›ðÚk¯A©T\†Ãáp»Öœ1†òòr¿úY9NÁb±\ È6n܈7ß|sæÌ èûŒ1455ñ—êrçsój´úúzºjP@&µk×âóÏ?Ç«¯¾ŠyóæñO‹òÕ×_ͤ¯¯ÏﻞWº­:tˆnt=Å( >JJJ£>Š>ø>ú( …Ç'Ùz" ùg£÷÷÷£¯¯/ :=zÔ§CÃ$t( ~ˆŒŒÄ­·ÞŠ;wB¯×ãÌ™3غu+òòò P(<>]¡P`Û¶müg ~Ýyq´“'OÒÍ妘o«@2†H$Bvv6-Z„®®.\¸pmmmhooÇÀÀœN'bcc±|ùr¬\¹’ÿÞùóçÞ‚@ii)–.] ±XŠÙ  €I,cΜ9>ïÄ×ÕÕÕL*--ÅæÍ›1þü€Ë ¾£&Ö²Z­A?r­­­ÍëÝåIhQ@¦Z­øâ+—ÞÞ^üýïQÈD( S¨µµ5è®ë®;¬Ð3Ö§dŠp‡sçÎ…¤,“É„?þ˜Î‰L Èéééñúu=zÔësJHhP@¦HGG‡ÏÏ/ôÅÑ£GǽZ‘„dŠtvvút¡¯L&>ÿüó•G<£€L•J…ÁÁÁ•g·Ûñá‡R3k’Q@¦ÈçŸôå»W««« ¨ã#ñdŠ455…ü¨ÓÈÈŽ=:áS¯Hà( S¤»»{RÊ=räˆÏÏ-!þ£€L‘É:gQ]]úúúI)›P@¦LJJʤ”Û×ׇÒÒÒI)›P@¦Ì¯~õ+̘1#äår‡’’’!#ÿ‡2E~ö³Ÿ!//oRÊnoo§»žL ÈIKKË/¾ˆììlˆD¢–m·ÛqðàAºwP@¦Pff&víÚ…%K–„¼ìÆÆF´··‡¼Üd ………áþáðÙgŸaÇŽ˜;w.3rm¢€Lƒèèh<ù䓨»w/V®\‰èèè ËÌÈÈ@rrrjGF0º¨`Z9N466âÝwßÅñãÇÑÔÔäW—”ˆˆ¬X±………˜={ö$ÖôÆD¹FX,455¡ªª :hmmE[[›ÇǸ%$$ ==k׮źuë°lÙ²i¨õõrF__,‹Ç-Jtt4är9$É4ÔîÆA!Ä ÚI'Ä !^P@ñ‚BˆB¼ €â„/( „xA!Ä !^P@ñ‚BˆB¼ð; &“ ;vì€V«u^QQ—^z)d#äZàw@ Ôj5Ìf³Ûp‰D‚ÚÚÚUŒkÁ¸®®®FGGär9¤R)233Q[[‹ááa˜L&~<“É­V‹ÚÚZº?¹îŒ»aŒa×®]°X,€;v`xx¹¹¹Ë宄#??Ë—/GVVÖÔÔ˜)䵉¥P(°~ýzdeeA¥R!-- "‘ˆ¿ñYII æÏŸ‰Dâ6œë…Ïû Çaxx‡ÃíÄ®Ç_=œë×€Œ~¦wnn. PQQƒÁ«ÕŠõë×C¥R¡¸¸'OžtÛ7!äz0îMÔj5, är9ÒÓÓZ­R©‹Ç!==ÇA«Õ"==Z­ … …bJg‚ÉBw5!Ä :“NˆB¼ €â„/( „xA!Ä‹q244äñÌøè“‡ßf0|KŽã`2™`2™&ìti2™púôi ù4²²²€ëi±XPYY9¦÷ôhf³F£Ñí5ÙGûúú Óé|×jµ¢¢¢bÜy]ÿ@i4Ÿ~y ˆV«EII‰Ç/¨T*TWW^\\ŒââbògÔ+++QZZŠÂÂB~¼ŠŠ TTT ¸¸ÇÁl6ã­·Þâ‡yRYY‰‚‚ðe×ÖÖ¢¤¤ÅÅÅü‚÷4=׸»vírf2™°uëV·ù¬­­õ¹Ë~~~¾×?­‹ÙlÆsÏ=çS™ãÙµkטëo®¶sçN~œÊÊÊ ÇVmm-vïÞíóøÍC~~>Ôjµ_uÝs#??z½~Ìð@Ës¡¡!¼ÿþû¸ï¾û  a±X`0ø3ë¹¹¹Ø»w«««±~ýz aÏž=¨««Ãûï¿uëÖÁd2¡  Z­ûöíêU«PWW‡Ã‡£¬¬ )))Xµj Æ,¤––”••aÓ¦MP(ÈÏÏÇqxñűtéR¾¾ž¦çª[AAT*•[¹r¹¹¹¹xã7púôiˆD"ÄÇÇ#>>"‘ˆŸo­Vë¶•Ñét°Ùlü0‡Ã£ÑN‡ÎÎN¾gk™‰D"DFFòÓu wýZ­&“ ƒ*•jL¹===nO¯5™Lc®Ç‘Ëå0‹ÅHIIÁ}÷ݹ\Žã Ñh Ñhø-¿«n†þÈèù4›Íüo][[ ƒÁàV×÷ÒÓÓñðÃóËE«Õºýv:&“ ‰‰V«µµµc‚"—Ëa³Ù‹¡¡!ÔÕÕÁjµB­VC£Ñð-×¥&“ ---øõ¯ÚÚZ˜L&¼ð HIIAee%ž~úi~«Õj~¾\—d¸Ê½Á`3Ÿf³ùùù8yò$, òóóùP«T* þ½k¹¹æÉU§’’ÔÖÖÂjµò[ZW8\å{[ËïܹûöíÇqرc×ïà*ǵŮ\ŽqñâE˜L&ttt_³ÙÌ·\õuµ***°oß¾1幌 H__„B!€+k»ÊÊJ,_¾[¶lÁæÍ›\IüÕÍ ™L†––8<ðÀnm`Wp¬V+¿6u ‹Å …8~üÖÚâ°IDAT8xद¦Âd2A¥RA­VC(òe766âÅ_„ÅbP(ä_£×è£Ëv5SSSÇý1þùŸÿ+V¬Àþð¾ k0øÈqJJJpúôitvvB©Tº=ƹ¨¨6› 6› :Ž_‹¦§§ã•W^q[Ù¸™& QWW‡¾¾>~­Ÿ™™‰uëÖñ²½{÷â»ßý.ÒÓÓù2:::pðàAÔÕÕaùòånóá ÏÎ;ù&–J¥ÂêÕ«‘‘‘¶¶6œ>}b±‰‰‰xöÙg!“ÉÆÌgtt4:;;±nÝ:¬Zµ ÃÃÃèèèà·ÄÃÃÃP(ˆ…ÍfÔÔÔ ¨¨J¥}}}xã7ðýï+V¬ÀŸþô'þIXwÜqÖ¬YÿŒ ‹144„¬¬,deeA¡P@¯×Ãl6£¤¤7ß|3 ¤R)?på©\©©©ËåÈÌÌDzz::;;áp8 “É044‘H©Tʯ¸Ñ××çVÞè•´×£Xüu®Íäx\kñGyr¹"‘ÈíO+•JùŽŽ£‡q‡ŠŠ dffâž{îðM6ןM«ÕB¯×ãᇆD"á¿ç*_*•Ž™^dd$ÊËË¡ÕjQXX­Vëq­+‰ðÈ#ð[×|»ÌŸ?O<ñ, ¯Þq÷4ŸãÉÉÉÁ=÷܃]»vÙŸûÝï~ŽãŸŸÏ¯å]󪎫éé騲e ñôÓO‡¤L_Œ Hrr2ÿ£/Z´V«¥¥¥P«Õü¬ÉdBZZÿ׎¶ÉdÂðá‡òßBYY6n܈uëÖA«Õòk÷5kÖàðáÃøâ‹/PSSƒââbTVV"++ O<ñ6nܓɄ·ß~f³(**BJJ d2¿ÆÎÍÍ3½M›6aûöíØ¶mÖ¯_¥R‰•+Wòuv8üC.—㥗^BQQ?ß‘‘‘°Z­üÖR©T¢¥¥_~ù%ýË’%KÐÙÙ‰ääd·?ìèý—ÊÊJ~íd³ÙÐÙÙ 8)•J?~†ß·Q©TX²d þüç?ãâÅ‹nÓ}Ô155éééJ¥ü¥ V«•¯kzžæÓåê:µ´´ ##[·nåëíRQQ?ýéOXµjV®\‰]»vñ-«ÕÊ//×ëêò¯>jzõçZ­‰ÿñÿ›ÍÆ·®>z޾¾>þh¤P(ä÷‡úúúÀqär9ôz=ßTtç©<áóÏ?ÿüèŠDGGãÀ¸óÎ;!‘H‘‘ƒÁÀï7ô÷÷£ººš_Û»Þ… `2™`4‘––†ÜÜ\Ìž=:ÉÉÉÈË˃L&ƒ\.‡Éd¼yóºº:èõzþ0_^^ž[³Äd2A£Ñ µµF£2™ ÙÙÙP*•èììDll,V¯^¤¤¤1Ó …°Z­Ðh4H$HOOÇŒ30›ÍHLL„T*Ebb"±páB$&&B©TÂ`0Àf³aÑ¢EHKKƒR©DCCär9”J%òòòÐÓÓƒ®®.Ìœ9‰‰‰0™L …HKKCoo/’’’››‹††Ìš5 ‰J¥½½½ˆŒŒÄ¼yó`2™Žôôt¬X±‚ßñ–ÉdˆGzz:¿ƒþãÿJ¥’ÿó @*•"%%"‘ÑÑÑÈÈÈ@cc#L&òòò™™ FƒÈÈHÌ™3r¹|Ì| Àáp !!‡ýýýHLLDrr2¿Ã¾víZ˜L&DGGó+ʯ¿þr¹?úÑ““£Ñ«ÕÊ7o{{{ùeÝÓÓƒ„„Ìž=B¡Ð­þ èéé\.‡L&Ã7ß|ƒèèh,^¼:CCCX½z5¿pÕwdd„ÿý†††ÄÄDþ†R©„D"\.GVV Äb1âââŽeË–A.—c``J¥ÆéînµZQ^^Žõë×¹Œ¶¢¢ééé^Ûõ„\/èzB¼ ®&„xA!Ä !^P@ñ‚BˆB¼ €â„/( „xA!Ä !^P@ñ‚BˆB¼ €â„/þ+ZÉ·Xƒ:‘IEND®B`‚rdd-2.0.7/gui/pixmaps/minjuslogo.png010064400000000000000000000250731042173111100163100ustar00rootwheel‰PNG  IHDR,,y}ŽutIMEÔ&;ÈÓuÿ pHYs ð ðB¬4˜)ÚIDATxÚí´Õõ‡E@Q1hbÅÞÀAŒ,Á•("j FMTÔ &–¨¸T4j˜e0"¶X0"(ØAl¨Ø°€ (†"±""jrÿï;ÿœ·æ 3wæÖ¹3÷÷­5ë½wgîÌ™ö{ûì³ÏÞÍr !„HÍ“n€BÄE‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒKXþóŸÿ˜§žzÊœp ¦uëÖ¦Y³fviÕª•éÕ«—y衇̊+’n¦¨sš©jŽX´h‘0`€™8q¢YµjUà6×`î¾ûnÓ¶m[óÙgŸ™ÿþ÷¿fíµ×6k­µVÒ§ ê V³téRó‹_üÂLš4)rÛæÍ››?üáæ{ßûž™:uªùæ›oÌ{ìaÎ=÷\³îºë&}*¢`Õ!K–,1Ÿ~ú©µ’®¾újóðÃÛ.a°¨¾þúkóÝwßÙ¿±®Î;ï*Dê£>2»îºkAßÝÿým7°°ª‹È×u¢\¨K˜ð!9ÒÜu×]6øsË-·4'žx¢ÙqÇcïc½õÖ³1VBÔ*¬ŒðïÿÛŠ£vÀˆÞÏ~ö33lØ0ë—" (p&#|øá‡b„3Æpæ™gš… &Ý°ŽøgŸ}6¯uÆûìFq)ø«ØßÊ•+ÍìÙ³ÍO<Ñ$¢^ˆj¢l ‚,¡t ñ;1 :Njòf…UÊåË—Ûò_“'O¶á3f̰Y}ôѤOWÔ!êf|Lï¼ó޹öÚkÍ?ÿùÏÈíÙîw¿û]àº;î¸Ã†Bl¼ñƦS§NV P=î¸ã’>MQ‡H°2 Öó(È›5mÚ´ÀœVN È¯Åˆâ¾ûîk¶Øb‹¤OMÔ)òae˜­·Þ:Vb½Y³f™W^y%pe½pÌÓ8p Íã.DRÈÂÊ0¤•!ª=Ž¿ià 7´Ô6Ûl¸_¾1üÅAb»°Îø5Åyóæ5NÂ߯È$ ¡ë¬³Ž › Â´aH°2uO;í4;×0 I‡ â'Â+ˆízþùçmÈŽú| –¤ÒÝdéÚµ«µê„ð#ÁÊ8Œò=òÈ#fÔ¨Qæõ×_·ÖNØ-§¾ þ,òº3eá¢"Š«ŠŠÏ„4—õýï¿Éw±æ¦L™b#âÉ 1wî\[I§8Ó‹vÚi'Ó­[7ó£ýÈtïÞݶK`Õ ”§GH¨Ðì¬-²”þ"…xm°Á¦}ûöVL"å»XD7Þx£ýŒ@R„êÊ+¯4O?ýtYS×lºé¦6%ÎÉ'Ÿlç>"€ï½÷ÞjTéF©Ï(¦Šad VA± '*äÆ:ðÀ­èþ§|Ðìµ×^6ëÃ5×\c–-[V‘ö´ºË.»XkVž?n ‹+ VYïÞ½M—.]¬°ªVb¶`Õ1Lj¦ë… ‚€#~Μ9 QÏž=mד®#!ø½hG¡û ñÂ/Få bÆ”]"(¬¡Žadk©èrtÐAæá‡¶ET‹é‚!tDÏãS;âˆ#l=]Õ+®¸ÂvC -ÊŠuÅHã&›lÒ8òHHâwï½÷š¡C‡–ME²ÈªcðGñr“ã*äÇyPÑÕ¢{yôÑGÛîa± xÍŸþô'søá‡Û. â5hÐ ;« C\%"îqÄã˜§íø­˜ïH·Å ¨÷oU¥Î¬:'6/VñZ#FŒ0÷Üsµº~üãÛL»í¶[Ò—M$ˆ«ŽáÖo¾ùæyëb¡P&ìŒ3Î0=zôX-Ä€° 2—b¥a !4 I$Mˆª§‹Èt"¬',8|dXUªH-@‚Uç0ªF€gtù®ºê*ëŠ QîÄ{!X,óçÏ7Ï=÷œ•$,!ÊÁ£€¥’5'¢‡0¢†ÃŸî)]>Q_H°êÊÙ“UÔݾ>}ú˜áÇ[S)~ 1òia!XLzì±ÇÌ»ï¾ÈʱˆtwÓtÃpiœ] >ø`sì±ÇZõ‚Tê„ (ó>$BÈá^ŽpÇ8 ±[,^x¡µœÞzë-„JÐ)V£yXX./œý¤kÆñŽ`k%êYXu–Ö –AŸÞy†ŒÒp Öá]Í)1d‹9r¤yà*ºˆŒ$2‚Hô½¨?$Xu"5nÜ8+ ‹-Z-6‰i88¼ H(€³¬ˆ›ÂêÂÚ"ÿ¼ó㣄šzSçäDæi\C÷.·Ë.»äš7oÎ?¨ÀeðàÁ¹•+W&ÝÜÜܹss]»vµmêÕ«W®ÁúJºI¢F…•a5 Û7vìX[<"Ì/„ÏŠâçž{® ÎL ¦ Ý}÷Ý6ŠžüYX€týpú3JÙ¹sg³çž{šýöÛÏN½õ‡+£P7èqÄ*_$;£n$ù£–ä|;7…†Ð‡|Ö§ý‘Gi'9ûÓ܈l#ÁÊ $ÏÃ1M:™|sè+¦ÙŒ=ÚN}©6„*àW#ià„ lä}ÜÇ‘F ½èÛ·¯ m`Rd V†àV’›ŠÌ¡QÓm«“N:ÉVÌ©ö‹Žˆ¾ÿþû68”IÐäÙ*Ä‹ˆýßüæ7¦_¿~VÈ Ô-Ò+#äþ—š‹iñâÅ‘Û3âF„{9‹®Æïø¨èþ½úê«eß?¾®_ÿú×vФE¶`eòJ‘û +Š}öÙdž/&¦Z,]ºÔNÏ!³QîLÙ©X\t ,åg¦ôˆ ô0¥(ÂÎ>ûìÐpïÒ¡C‡Ü3Ï=ÚDqâDsýõ×[?X9ät›IȼÊ$&€‹Iz˜R”1EC† i¶1bDìáú†—ß.i`ÅŠ¹‘#Gæ:wîœk°ÊêpüñÇçfÏžô)Šdae,æÍq;Ÿ|òÉXÖ–ÊE]d ˜bi¤rÒSzذaæ™gž‰Œð õIµC™1ùµj VFà6â°&…OãÀè\¯^½lÖ^ÖRøæ›o¬ß‰˜+jVÞqǶ`ÝÆr@wšLâPÝÃÚC‚•!œo'®u@|Us^{í5;ÒX(„$*k‡° Ä’9zÔ $d gÏž¶W%­•U«VÙ45X[T܉*ÒF^Ä e´ÊˆÕI÷IErì°ÃvÚÎ=÷ÜSðw) qøá‡‡f``¿:uÊ5ˆbUæí-[¶,wÊ)§Øãš2úµ–,Y’Ä­!H°ê”åË—7NLîÑ£G®¡Kë{8èŸ~úé\ÇŽóVàq s ûôé“ûì³Ï*~N¤Ù9úè£ËæçúšæóÏ?Oúv‰ÿ!ÁªS(¥å¬„‡ Q™°”XÔÄæÝvÛ-7mÚ´ŠH6ts?ÿùÏc‰i\ÑÚgŸ}rüqÒ·Lä$Xu ™ ü/ç¸qãBÃ!¾øâ‹ÜСC…`‹-¶(Ø’éÒ¥KîñǯxŠÂ8V¹º†ûþûï/Ѫ$Xu ¾¿¿§U«V¶û†˜ó_}õ•ípÀbÕ²eKûò²ÝÉ'ŸœÛ|óÍc¿ümÚ´ÉqÆ6-N%ñÆ¥•kÙ~û핹4a4JX§0¢Èe8)hÈLúÓŸþÔæEgNßøñãíÄdÇŽ;îhçý£tÔ$~‰Q:2DÁ4¦¹^©Ô3=ô9üðÃ˾_2»’EU9â"iÅÉ1f̘¼þ(Fƒ|A”´÷ƒÿµ×^Ë5*×»wï܆n˜×Zi­Ü 'œ›7o^EÎí­·ÞªHò?¬Ë«®ºÊv‘Eõ‘`Õ1+W®ÌtÐAgëœ4iRÞý.]º47aÂ;bG73l_tI{öì™ûä“OÊ~n –aÅ2–n°Á¹‹2éÛW—H°êœ Øx¬¸/kCW(–‡tÌbC×ÑZRm´Q`~wDëC±í(g ç™3gVL°XºwïnEQT –°ø^½zÙîNÔ‹ºé¦›ÚÐB@ˆ>üðÃÜØ±c­EÕ®]»Õþ;í´SYËQ£’‚Eû;ì0³¨2š,%ìÄgJqyä‘‘Óhºuëf •Ž|æ6tÍ#ø`ÙŽG<Ö-·Ü’Ûwß}s âe­¬¯É“'—`:þ|›‚ÆTÐÂr ÿX¢:È´iÓÆ4tùB×ްÃ;”íxL”>ñÄm²AŠ@e‚49L<&,¡X˜].K-  Ž5ª*ÇÊÖ |4X<6ûf[l±…yýõ×m ¯rCþv*éÌš5Ë– Cp8Þ9çœcS¾ÄôÊ—^z©¹ñÆm¥žj±í¶ÛÚx5QyT„B4*¢),Ѻ_ŒÜù_|>cJN5á˜íÚµ³Óx\FSFé¶òûŠ+Ê’°O¤9ÝE˜ÛGÍ>?íÛ··VRJA&S²€’å”J7”š¯…9}k­µVÒM¨da‰&0R¸ÕV[ÙêÌ^èžíºë®I7ÏBû.b¹HLÌÕ”)SÌÌ™3mMÃjB}þ}û&}Iê –h‚EñU20xaÄŽ¥VÀÏ…ˆ²ôéÓÇÖd¤Í?þ¸ ‰À _ vß}wså•W&}9ê –h±VA#r;w®éÒWtY>ø`óÇ?þцEL›6ͼñÆæÅ_,{åhFL©¬súé§—\qHÄG‚%š€¯Èÿâü¦–ði±l¾ùæ¶6¥À°¾¨ìC Cº»Œìåþ.m¬ýr °êèöîÝÛ·âC«DLšG‚%šÀ‹éÔÄâ"820€À‚ÿí´ÓN³£ŠÄxay1pîܹ6È”Ï ‹X¹reãw#ºÈ|Ÿd†»ì²‹AF.E2H°Äjl²É&MþæeM«`ùÁBB€YŽ9æûÙwß}g--²°zcª˜:D7¸–»Âõ†K¬†?T€î`–­ „ 3QÛ(K¬†¿Úq9'< Q ,±Ìt9¯5dšŒµ€K¬> {÷î5%ê –X †ïH!\d ¢`‰ÕÀÂr‚EíÂJÕ¢P$Xb5¬ÝvÛÍþN쑵‚K¬Á£L=!ÿ”¦ˆZBqXu òæÍ›gKÌ¿ûî»fÑ¢EfñâÅföìÙ6.©ÚÙ;…ȇ«A^~ùe;¿ŽòZˆ™;IŠçŸ[Çô•$ó` áEE(2ÓNH·Be,)Ä «Š ž,LGÉÇÖ[omÆŽ+_–¨ dae²ï|òäÉ63æòåË J+ü¯ýËæ˜"¼¡ù܅ȇžÀŒCj•gŸ}ÖVl~òÉ'ÍE]dºvíj³Äü¾ûî³Â%DÒH°2Î+¯¼b‹“â‹"“èàÁƒmB;þF¸âd"À×uÓM7©:ŒH V†¡ëGžs@lð_9öØc[ÃoàÀ±Š(P#PV–H V†!Láù矷¿ÓµC¼¼c,de¸ì²ËÌøñãÍQGÕ˜f%ˆ3fX_˜I"ÁÊ0ÄR¶9Îýw¬«ƒ:È\ýõ í‚Xµj•yì±Çšdä¢ÚH°2 bEè‚ãÑG ¬­¿ýío¶|)e‚˜5kV£Å&DH°2 ùÉ©Ùç….!Á¡aP,uÈ!vTП׿³Î:ˆF‘¬ŒòÖ[oY–º…æƒé8½zõ2cÆŒi,[ïå½÷Þ³x!’@‚•Qž~úiëÃò3}úôÈèvDªGæ‘G±£^ÑÂÖ¿óå—_&}Š¢‘`e¿uå@°âvéöÜsOsÅWØé9^(O0ªfu‰j#ÁÊ ”i§î^D»ôÑG±÷E%ån¸Áì»ï¾M>¿à‚ Ì|ô©Š:C‚•Aˆn÷‰zAdH%b³è^xá…Mr»c©1/D5‘`eʱç Äq^LzÆÿ÷¿ÿ½Iºä뮻Φª¢ZH°2~%r]åƒDÒÎÊO~ò3jÔ¨Fѱc^ˆj!ÁÊ8Ô£Bðocaiõë×Ïœzê©6üqdZO1â'D1H°2£ƒäÀÊ¥óçÏ/jÿÕµ×^kN>ùdû;VÖý÷ߟôi‹:A‚•1^zé%;ï/d-Õ÷Dš2>0Õ‡n¢BD5`eBqŒÇy¥@EÛn»Íì³Ï>fÊ”)æHúôE ÁÊ„,Ì™3'Ö¶a¥…@qŠSN9Åú°† Öd¢µ•@‚•!ÈÎ×^hhC}úô1Ç{¬™|óÍ7“¾"ã¨jNFÀouÚi§™[o½5ÖöäÁbŠM«V­J>6µ ÷Úk/;ç`Ò°ô4B”Š,¬Œ€ó{Ò¤I±·'ýL©~,-\iÜ.©Å ÁÊä[/tä¼Wåbï½÷6:t0#GŽLúRˆ #ÁÊ.r!0…'*ÕL\è.A­Ï>û,éË!2Š+(ZŒµDDüŠ+ÊÒ† Ø,Ÿ|ò‰M=#D%`e€eË–Yk©P˜ ]®D|d€À/F91ïË•@‚•pžÓ cdÑŸ÷½Xˆ°wÝK ¯.]º4éË"2ˆ+岸”J6wÞygYÚq÷Ýw7þŽ`Q¤Uˆr#ÁJ9d%a_±¼þúë‘s£ [é ‘ .+*ÅÅ ÁJ9š(¥[‡“¼”ÉA0ÍÇ/zt‹¹"¬”C2¾Rçø¾­R`´g»H•ÜO” VÊ™:ujIßÇQ>vìØ¢¿O÷oâĉ«}ŽÅõàƒ&}yDÆ`¥,¬RApŠ C`JÐO<¸Ž®"x!Ê…+ÅûTlæP/ï¼óNÑÝJbÀæÎ¸Ž®¦²‘Šr"ÁJ1#FŒ°a ¥B·Ž¹ˆÅϱNÛÆWò(¤ VJ!ïñWåˆ('ñ^±)“ßÿý¼ë©XJØ…^$X)….\9üWàªß3:*t+‹¢åšd-ê VJ¡TWTuœB „½?4!Qù¯Ãçž{Îv;…( VJ=ztY'ã8/TéFi“¬•ØO” V !% õËM¡‘édˆˆ;ÉYÎwQ$X)„ê8X-å¦ÐÂ3f̰Iû‬mõ…+…»=®PTÓ¦M‹íLg€ ”¬B€+…”3»—… Vt{û‘äOˆb‘`¥ ¢ÛË•tÏQóq»…ŒRšå¡-ÔŠ‹+e0š·|ùòŠìSÜØ.æ2°"Už,Q ¬AÃäÉ“cWw.¦OŸk[üQÅŒú“U ÿ›¨$X)‚¨qæV ètõ¢@8ÉTZLØ£>jüñŠ^'‘]$X)‚î`©ÙA£ÀeÁ1÷0jaL)¢[XLT½¬USiˆñв²Z-%Ë)ù³¨c(D¡H°RD5"ÅqèGeW`Þa)0M§˜:ŠBH°Dˆ“Â1~´R+;ãt衇’>U‘B$X¢ 8ÒÃ2ˆ¡ q&Øl³Í6?¥¿Â²A0‰¹¹­èz^|ñÅeM‘#²+E¬·ÞzæÏþ³YwÝu+züTa‚UªÿÊ ÑòŸ~úiEÏEd VÊ8ôÐCÍ]wÝeºuëV±c@+…UTÎÐ ªê<õÔS;‘=$X)c5Ö0‡v˜5j”9ðÀM³fÍ*rüXþŠ<L9Ó2ã'ã<Ô-q‘`¥Djçw¶¡·ß~»éÞ½{Ùäx'ºÿV9ašu…ˆƒ+Å´nÝÚôë×ÏÜsÏ=¶2Í–[niZµjU–}c]ù-FõÊ]ý†nç”)STUGÄB‚•rZ¶li6Ûl3sÖYgY‡ø…^höØc³öÚk›-Z½ß¶mÛšæÍ›>óæÍ«È9à“S VF ›¸É&›˜ÁƒÛÔųgÏ6Ç·þ®m·Ý¶ ñZk­µÌÀÍšk®Ùø%éãdr(,¬J%%Ù¢eÒ •aÓM75gžy¦ùÕ¯~efΜiElêÔ©VÈX‚’ïaQuêÔÉôïßßZl^‡>“¢‹-g«GÖb"Œf9 ÑÔ 8̉T'Ó‚ñsÙK]×+mã7^-ªžôÆÇwœM-S ¶Ûn;3aÂûSˆ0ô﬎ ð”¥p¸WJ¬€‘Bºœ,‘ù°D,âæz/…‡~8éÓ5ŽKDÂDåJz!—?XU/,ɬY³*êpw˜ªÄ~", ¹«/^\ñã0WñꫯV¾wŠKDRlÁ‰b@õ.Â`‰¼ûŠ8®j±téRsË-·$}Ú¢F‘`‰¼àlÇé^- =z´œï" –È • Ë‘¹f̘Q–¼ñ"{H°D^˜ÒCT|5!"¿’®Ez‘`‰¼$U(bܸqÓ†„pH°D(”ázûí·96#“/½ôRÒ—@Ô, £Iå©"Û)z„ð"Á¡Lž<9Ѫ6wÞy§œï¢ , žW­Z•Øñña1J)„C‚%B©Æ„ç|0E‡Ú…B8$X"”jŒ†1qâDóÞ{ï%Ý Q#H°D(ÕŽ¿ ‚Ä~Êà ,QÓ|þùç¶þ¢&D `‰P(V ¼ûûÓDm Á¡Pß°@°”ÁA€K„Ò·o_Ó®]»¤›aƒHŸþy%ö,N¿~ýÌî»ïÞ¤>aRPK‘ä~¢¾‘`‰PZµjeþú׿š]wÝ5馘>úȦOõKä¥sçÎfÀ€f£6J´$ö£[(ê –ˆäøã7×]w]âNø%K–˜)S¦$}9D‚H°D$k®¹¦éÝ»·¹æškÌ:묓X;ˆÅzöÙg“¾"A$X"-[¶4ûï¿¿™3gŽ9ÿüóMëÖ­iG- ˆä`‰‚Øpà Í%—\bsUÑEÄ1_-Z´haºwïžô% Ò,‡7Sˆ" +(¹×ï½÷^›·ª’©h°¬¶Þzk›ò¦š")j –(j’ƒý®»î²E+A(7:u27Ýt“í–ŠúE‚%ÊÙIÅ3fŒÍVJQÔrÐ¥KÛ =ꨣ’>E‘0,QvÈ¿lÙ2³`Á뤧òÕ£çÏŸo»ŽüqÞﯿþú¶ûG”}Ïž=M×®]Íf›mfš7—˵ޑ`‰ŠÃ\@ŒT1_~ù¥ùꫯònOEûöí­ƒ¿mÛ¶I7_Ô,!Dj-„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔPVÁ>|¸éر£-]Ä‹/¾hºwïnúöí›ôy !RHYëì³Ï6 . ]ß­[7[S!ŠA]B!Djhg#ºrtó°ŽöÞ{o3lØ0»ð÷¢E‹×ñ{tÝzYYBˆbˆ%Xtå('L„ Ôûï¿oÿFŒ Ô仸´ÆŒc÷aþ-!„ˆ"–`9cŽ9Æ.€Xá·rø-'gY9± ÚF!âR’ë…^È+@Që…¢ätB¤†’ ¼×'åwºû×m#„q)ȇåñø±Î9çë§Â ïÝÿ‚E°(¿»QB!„(†f¹¢6Bˆ¼¡Îéî@”:tè`EËYTXWÎå¾Ï÷Üïn{!„ˆK,ÁBˆZ@Nw!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘bekpò%ãcR³&3ÇÃ;™Ü;IÜ¿®˜ âdye:tèj“ÔãÀ½æûdâ¨Ô4ÓbÚ˜/µ¶ÿÖ.ƒI1÷\úqöAŠñB¯O±Ç­ä9•…\ +×ÐÀ¨Ír /Y®áÁ±?óí‹mø9hР\ÃKÑd½ûŒ…ßýßå3×ïq¢öÛ±·¿^x¡É¹¸uî˜qÛé`]¾ËëÖ][·ïba¿þ6ßñh”D1mäZù¯WÐý©þÙ„>¥œo>xXÊ…÷;'ÿ6•8®—ȧ² À¶g©~ò·k/¨÷»üî^Z·­û®wÛ¨ýÁE÷‹ýq3 =¶[Û²¿|/½C¶ñŸu¥¼„õ$XP‰—¦(T° Ý> ï;×½œÇ‹sܼ>,•æ<ë0ùݹH÷ œiëöç~ºîûóššüîÌ\~zÍ~Öqº/Qû ‚d‚ty|ÇmÏ>Ù·k‹+mæmKX;T¢»…«FÄöQ‰ ½×Ü%Jt¸në½÷#h=ßwÇb?îº.HX;ܾý÷œÏÝ÷Ü>‚öÕF¾ëö_He%÷ ¸ßÝ÷ý×ɵÓ{œ|×Öµ×mÇï.YeÐyy·õ^×|Û?ìÚ°ŽãrmâÞw|ï¶$Ýäà3÷|xÛ箇ۯ+è~÷ž³«ôt]¼ß :îjäSº sEõ[Þm\W* ¿eäß÷¿|ÐòÚ¿ß8x-® ëÂ{ü|í® mˆ²R¼VÇöþWñ[XÞklë¬ ~z¿ë¿'ÎÚs×ÿ=ûæooWÛßvïõ ²`ùÛëpûôÞ“¨6z­Ö°®”ÿ9p]wïyzÛåÜÞvºk鎑ïÚºëà¶uÇð¶Ï{ÞþϽm Û.ßûä½7Þö„Y”aïI¾{ãu?¸çÖ{,/þs ºþ÷ÃïñïÃÿ¨÷&¯…å·R\ÑT¯õáµF «Âk•‹B÷ëÎ)Žc3ξ¸…:Êݱýÿy½íó–Ss–™;ß|¥Öø.Û»ÏùûêýOí©a×Í­óâ6hƒ×ö®j£³–Ýfï¶~¼–‚ûÏíÎÓ_RŽvø¯)Ÿ±,à¨këpÖ²Û¿÷Üh»»–Qçèß.Îûäur»ŸùzAä»7ÏÛ[¡7FÔ;´ÞÿYÔßQÖàº{Þƒúr:³ œ£ aûu&i‰éº‚-‡pr ÿÃŽÍKáŠÕzq×Üÿ’º+N©5ÿKÎõa2.®«_hwÍÛ†|mt÷‹s¢ðn˜[Áµ…{Ì2uêÔÆó:†·«Ö®|×6ˆ1K³fÍ‚»0y¶+ÇûT*´É¥8§;VëT„¢T\Ÿ6È¿Ãó÷­ÝÃÈÏ ‡Ø­Ï·_¯ïËû’ºÏÿï>½’·-AítÛ»Ê×n^>‹z]ZDÁûÑQŠwh< dÚãöá¯î]ø§áü[\³¸–j_a¥\šAÛÝ?« 6mW a@^‹›kϽv•Ük‘¼/»×qéþóø‰Þmø;ì¿7ßó›ûN8œ#Ýû¹×ö¯óÆ(åÛ¯·Zµ×9K›½–˜ûŒmüÕ>s/´[\{ø=îƒé^ïõu×ÜoÙx‹}Zjó,¤zQ±Ýþ°6øÍ:>óv= íö¸'þóÌg-E]Û8p¯¸¿û kwÐvqÞ§J㪳ó¼²zÝ£ˆzÎ ®¢•ËCP˜N1œv8Ó‚b´Â†$3Í¿xŽÎ9ìwû“^gjÔ~Ü“AßqÇsq]Îièwæk§Ã…,„9ÿÃb­Ü ßqé¿æ~'º •pñ9¬÷ÇŽ±¯ {ì}4¼Î_·oìšÿxþïGµÑû¹ç+ˆ¨8#öáÎÍ=»Þëô\ä»¶î<üÏ¡÷yð? îšÄÝ.ßûä¿7ÎAöl]Ÿ¨{ã$ó_?ó¿ïzoûÜ}d½÷¼Ý³âÞÿ»åÚô,×KdÕ| ø ¼]ç\öGb£Ö¬ 2‰ý¥Âþ(e¯Å¶ bQûõöÔoqc!í Ú¯}ÐþYOÛƒ®yØ1ã–Zó/¨ÞãxåÝ¿·l›÷ZzýjA瞯޶„_œû¶ï÷ý×<èÚ]‡ ûæÝε)èXAÛå{Ö‚Žå¿ÖAï·½qïÛÎ]Âî³w;oÇ»?ÿóäŽçÞ… ç R°8 > úÝù§”•ç „A¨.¡"5([ƒ"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5üI¯ÔžËÍ\¹IEND®B`‚rdd-2.0.7/gui/pixmaps/minjuslogo-150.png010064400000000000000000000136051042173111100166110ustar00rootwheel‰PNG  IHDR––<qâ pHYs ï ï}vŠHtIMEÔ;-¨|•&$IDATxœíPÓçÇßáWÀÂB§©MÚ*¡ÞÀ]'Ú®é¦r­;[×±®Wôv…ý1ðn·z×ÍuÒÛZŽkµ–mwp-]Q,³ñLjSL*%L Z4ˆ• $‚øÅgh¾— "ßïóºË%ßï÷yž|žçûþ>Ïó}~Š!Ê l(ü„ ‹¨°( ‹¨°( ‹¨°( ‹¨°(!,Ø< ô÷÷cß¾}èîîÆüùóñÚk¯!)))ØfÍiDBïÒ9uê6nÜ‹ÅÂKLLÄ¿þõ/tvvâG?úžzê© Z87¤°nß¾#GŽÀh4âïÿ;z{{¹kñññxòÉ'ñí·ß¢³³iii8þ¤¨¨ˆX,222BÉŽ;Ã0dtt4ئÏ9%¬?ü„……¹ ‹Å¤¢¢Â«Ÿ?þ˜ k ¢(4›Í¨®®†ÙlÆ¢E‹<®K$äääx-îBBè˳¿BX¿ûÝï°sçN$%%¡¦¦«W¯¶I¼Gbxx8 §§YYYÐétA¶ˆÿBX®EÜÐÐ^}õU|ùå—A´ˆÿBX,˺÷Ýwؼy3>ýôSŸýPüCÂZ±b…ǹ;wîà7¿ùGεwï^lÛ¶ Ï<óÌl™ÇKQy¿}û6–/_ŽÎÎNko½õ>üðCîøÞ½{`Y·nÝÂO<1‹Vò AäX1118xð Ö¯_ïq­»»ÛíøðáÃøÛßþ†>ø`¶Ìã%‚ȱœœ9s+W®„k”†Áõë× ÁG}„_üâHII –©sA ‹eY¼øâ‹8qâ„ÛùŸýìg¨¬¬DTTç.""Âímrppz½'Nœ@kk+§žz «V­ÂO~ò$$$Ìj|f%,¸uëvïÞúúz áܹs B¡Àúõëñýï°Ùlؼy3ðÞ{ïáÀ¸zõ*FGG=‰DX°`ž{î9A.—Ãl6ƒeYˆD",Z´óæÍ Blƒ‡à„ådtt7nÜÀã?>®Xþò—¿`ïÞ½¸té’Çõ¬X±ƒƒƒ¸|ù2ìv; ..±±±°X,p8‰DˆŒŒÄ3Ï<ƒ5kÖàõ×_÷Ú­Ä7;Ð/44ñññ÷VDD~ÿûß#;;¥¥¥^ý;˜Íf¼ñÆøéOŠºº:ìÞ½}}}°ÛíxüñÇñôÓOcñâÅ`QQQ˜7oš››±páBÞÃlŽÜϵâââ088ÈKLLÄ{g_ÿú×€>ú‡‚Õj…ÅbÁÍ›7122âŽL&CUUâââP[[‹¬¬,Á7UZX —Ëa2™`ÂNjBl6nܸ††h4ÔÕÕ¡¯¯Àý"ðµ×^CXX¬V+$ 233ñÒK/á‘G™Õ8=Ìî(‡‡ÑÑQb4Éc=F©TJZ[[ý cxx˜èt:òÊ+¯ððpn|Wtt4yóÍ7ISSaY6@1x¸œ°ìv;©ªª"©©©Ü(R¹\N®_¿>­p/\¸@ɦM›ˆÕj!kç.‚ÖÙ³gÉ /¼@BCC¹ÜE*•’¶¶¶i…»ÿ~²lÙ2"‰H\\Y±bÙ¾};éììœ!Ëç‚Ö_|Aâââ܆$/\¸œ={vJá9rúôiòòË/» ÕõE^yå²wï^2<<<Ã1z¸„°Ž=JÄb±ÛM%µµµS ïÆä¯ý+‰‰‰ñ*(oŸ´´4RQQAz{{g8v'¼–Åbá*èp™ãp8¦Ý†å »ÝNþýï“5kÖŒÛáúyõÕWyW™ç½°!¤¿¿ßëk~[[yçwÆõw÷î]RWWGvïÞMÊËËIKK‹_•í‘‘RVVF’’’&׊+"ò`!aGqq1Yµj•W±ô÷÷“ 6¸å8‘‘‘äí·ß&÷îÝóëþ÷¿ÿù$®G}” †™Š^P´°¶lÙB’’7quttÅ‹“¨¨(¯X¿~½ß MMM$::zRqÅÅŽ^?ÓQu-¬wß}— !!!dãÆäøñãd×®]$>>žDGG“þþ~¢R©<X””ÒÒÒâ×ÿmذÁ§v®yóæ‘ÆÆÆÅzv´°º»»IBBwC]‹½ 6pîÈáÇIVV áÜ,X°€œú(÷ûé§Ÿö{z–H$Â’%K°dÉ ãË/¿ÄÇŒsçÎy·è+su™Ê¹iup®•••5­°¢¢¢““­V‹S§Náí·ßÆc=6¥°6oÞ<-[‚FpKâ‡NÇÕkNŸ>=ãá’––òÁÕ«W±XÔÖÖΤi¼†÷»MïX Ä×ÏŸ?ÏM8-++›1»ø¯…5222é›ßñãÇ'œ©ìšKµ¶¶N*DÊ}x-¬C‡ahhhB7V«f³yÜëmmmÜo–eQ]]=cöñ^ «¾¾~R7‡cÂârl#êž={¦µƒPà­°FGG}n"8sæŒ×ó]]]¹Ù7páÂ…iÛÇwx+¬ÎÎN\¿~Ý'·®Ãi\9{ö,nß¾íq¾¼¼|Z¶ Þ K­VÃn·ûä¶££ÃkCikk«×–ùÇ£¿¿Ú6òÞ Ë—ú•“îîn¯3sÆk±ïèè@ccã”m¼ÖÐÐ<è³{o͇Ãcø²+¥¥¥sr¥½Ù‚—Â2™L¸wïž_~ƶÀ777O8¢¡¾¾žvñL/…5•µ>Ç ºÀ±cÇüþ¡ÀKa%%%!**Ê/?]]]ncâ}ia?pà€ß¶ ^ ká…صk†ñÙ˲ܸ­ÑÑÑIûà¿ÿý/nݺ5e;ù /…yyy8räV®\é“{ò`;]èëëóI0###سgÏ´ìä+¼¬^½'NœÀ矎åË—Oº¦§³-ëêÕ«ñé?jjjü~QÁœß?Û˜L&RRRBž}öYÂ0ŒÇííí„BvîÜé×î|Ùcp&äÂkv»·oßF?†††‰E‹aÞ¼y€7úU1ÏÏÏÇ'Ÿ|(sç$sw½çi†øøx¯Kn³,;nßáxüç?ÿ!ÄïÝ,ø ¯ëXSá›o¾ñ{Zýµk× ÓécÐ… k ß|ó X–õËÃá Ç@…5:¯]Ù·oŸOSÉ„Ö&›µ3½½½Ø¿ÿ [3w¡Âra``W¯^²ÿªªª´fnC…åÂt×h8zô(íây– SÞ¸ß>6Þà@¡A…åÂÀÀÀ´Ã(++£A…åÆüùó§ƹsçÜæ" *,6lØ€ÄÄÄi…188ˆC‡ÍEs*,,X€Ý»w#""bZá”––ÎEs*¬1dggã³Ï>Chhè”Ã0›Í^—¦TXc Á믿ŽÖÖV<ûì³ ™Z ½O…5Ë–-ñcÇPQQçž{ááá>û}þùç±|ùòZ÷ð#ÈñXþb·ÛqòäIÔÔÔàÒ¥KhooÇ­[·ÜFކ‡‡C&“aݺuøÓŸþ‰DD‹ƒ–ŸB`µZ188è¶êLhh(âããñÈ#Ѻ‡*,J@ u,J@ Â¢*,J@ Â¢*,J@ Â¢*,J@ Â¢*,J@ðIXf³Ùm³#›Í†ÊÊÊ€E™ûø$,©Tê&$†a&ÝU‹"l<±Ùl(((€B¡@NN´Z-d2w½¼¼t+[Ê„xäX ÀeYüá@uu5 233b±ééé~-ÃH“…V«Õm‘ gNåïÂaá!,›Í™L‹Å‚ÜÜ\ ®8T*•`Yr¹œ‡”q¡ã±(¶cQ% PaQ% PaQ‚‡°4GÕØs‹†[)Ød2A¯×Ãd2ôz=´Z-X–õpëŠZ­†V«…Íf˲ÐjµÐëõ^ÃàÖ­d³Ù°mÛ6n3%N7áÊÅ^7»t¢ÓéPTT4îõ±˜ÍflÚ´ÉëµêêjTWWÃh4Î袷[¶l™ðºJ¥òú•••>õí:›*++¹ûàk“ÒXwn²X,°X,‹Å0›ÍÐëõ0›ÍÈÌÌt[èB­VC©T¢¶¶&“ ÅÅÅÈÌÌDqq1L&t:’““¡R©<Ü:ikkCll,bccQZZ •J…äädèt:0û»q©T*Î?Ã0Ë娶mX–Ebb"·RŒÁ`àDz, ÷`8ÛÚÚ`³Ù Óé ×ëÝz 'R­V ‹Å‚êêj. “ɋŷµµq7Â…BÁµýéõzÎ&­V‹¶¶6˜L&.m6L&L&4 —VÎô´ÙlÈÎÎv;Àí>I¥RØl6¨ÕjX,αX ±X ‹ÅƒÁàf‹Ùlæâ˜——F…Bääd”——£¨¨ˆ{Èm˜ÎtsÆÅl6s~½ K¯×#==,ËB¥R!## ø)277b±6› R©V«ÀýVúææfÈd2Èd2477{¸u’ššŠçŸÍÍÍÜ·«?×0Y–Å•+WÜú,â*,,ÄÖ­[¹s*• ‰ÍÍÍÐëõغu+ÒÓÓ¹™ÉEEEHMMEee%X–Åûï¿ï– ܽ{jµš»z½‰*• :ÍÍÍHMMånŒZ­Fll¬›m(//‡V«ÅÿøG( tuuA­Vsa°,‹O>ù™™™Øºu+îÞ½‹íÛ·C©Tâ­·ÞìØ±‰ Ã`ÇŽnçÆÞ'à~æ™™ÉùwE"‘   ضm—^ …‚Kƒ¬¬,Fîa[¹r%¤R)T*Äb1JKKÝlÑh4ܽÊÊÊò.,gàW®\Ã0‹ÅÈÍÍõ0eYòóóa0PZZÊ•ÿÙÙÙÐjµhnn†R©t 377999`œÎYXX­V àþSc±X¸J,C¯×Ãh4bdd … à 22ÒMÌNœÂeY–Kl×À”J%>ÿüsèt:°, £Ñˆœœ¤¦¦º·Îß2™ 0™Lhllĺuë¸0år9pß81;‘H$ÈÎÎæ×s±±±÷Éùß®ñr=_–eQXXˆ+W®piåD,sU›ÍƒÁ³ÙÌ…a0¸të×£KG¥R!??Àýl^&“¡ºº\Qd2™¸p>aF£ …8C¤R©W·Àý,Û™XIIIH$0›Í`†{šÆ†ÙÕÕŹu'''sEµóI7›Í‹Åœ¸L&7jÃi“óš3L–eaµZ¡P(¸ë,Ë¢§§‡+æœ×õЮ®.ÈårÎng˜Î—×ø:mH$0ˆŒŒ„L&ãŠy…B³Ù «ÕŠääd.n·G,£§§ÇíœT*årr™LÆ= à§§ÇíÞ8ÓÙ†3Þδ•ÉdÜKTOOgŸÉdâúŽBt¦³3ÍY–åÒ×™´¯h;% PaQ% PaQ% PaQ% PaQ% PaQ% PaQÂÿ"‘ŒžÕ¨ßIEND®B`‚rdd-2.0.7/gui/html004075500000000000000000000000001043501130200126125ustar00rootwheelrdd-2.0.7/gui/html/helpstyle.css010064400000000000000000000022171042173111100154150ustar00rootwheelbody{ margin-left: 5%; background-image: url(minjusnl.gif); background-position: left; background-repeat: no-repeat; background-attachment: fixed; font-family: sans-serif, Helvetica, Geneva, Arial, SunSans-Regular; } h1{ margin-top: 1em; margin-bottom: 1em; } h2{ margin-top: 3em; margin-bottom: 1em; } h3{ margin-top: 3em; margin-bottom: 1em; } h4{ font-size: 100%; margin-top: 2em; margin-bottom: 1em; } h5{ margin-top: 2em; margin-bottom: 1em; } p{ padding-right: 10px; margin-top: 10px; margin-bottom: 5px; } p.title{ padding: 10px; font-size: 24; margin: 0px; } ul.navbar{ list-style-type: none; padding: 0; margin: 0; position: absolute; top: 2em; left: 1em; width: 9em; } ul.navbar li{ background: white; margin: 0.5em 0; padding: 0.3em; border-right: 1em solid black; } ul.navbar a{ text-decoration: none; } a:link{ color: blue; } a:visited{ color: purple; } address{ margin-top: 1em; padding-top: 1em; border-top: thin dotted; } table{ background-color:White; border-color:Black; border-top-style:solid; border-bottom-style:solid; color:Black; font-size:small; } code{ font-family: monospace; } rdd-2.0.7/gui/html/entropy-example.png010064400000000000000000000131731042173111100165340ustar00rootwheel‰PNG  IHDR€à,Ö)PLTEÿÿÿ   ÿÀ€ÿÀÿÀÿ@À@@ÿ€ À€À`€€€@€€À`ÀÀÿ € 0`€@@@@€€€`€`€``€`€Àÿ`@À€` À`À`À €€€` €```ÿÿ @@ @€`€ `€``€€€€@€€€    ÐàÀ À`€ÀàÀ`ÀÀ€À€`ÿ@ÿ@@€Àÿÿ€`ÿ€€À ÀÀÀÀÿÀÿÿÿÿ€ ÿ€ÿÀÀ ÿ``ÿ€ÿ €àà àà ÿ ÀÀÀ    ÿ€ € €@€@ €@€€`À€`ÿ€€ €ÿÀ`€ÀÀÿ€@ÿ @ÿ `ÿ pÿÀ ÿÀÀÿÿÿÿ€ÿÿÀÀ7³bKGDˆH pHYs  ÒÝ~ütIMEÔ  9zlɳØIDATxœíÝ‹’£¸EQÌÿó½~ eJ)ÀÒ1ަöš™.›®8£B¤ð‰eY~}øÃ–÷[ÿ­ÿÿ÷¢Íסó\óÔmÿán¾µ[/¡õñïÿìýøñ'î,ŽÁ#ùK¦Œ?`}ü[rïÞB´ŸŸã}J__ïšùwuq}ÜpµLaø&À ûÿéý£T­AHÙÿ+û·©ê§Ž²¿|ÿ(Sj7 þ6e·Xpö¨qß`Ý â8ù­¸ epuÍ@Aâ‡M_£0qþ¨ƒ±CÀ\Ñ–mÄ'|1€ý Ž71=±/ÊåÎwBNµ§÷1]ÚsÁÛPŒDŸ¦ .SO£"ÐÎ~!nEÕ I%t”€8OÀ¸$Øó­æ±ˆ=ŠNˆMUÀ 2žýF܉¬,Ýßçƒþ”ÔÙ#Æ­ˆJ@Sô¥ƒaÀÙ/Ä­¨ªàRô=™m¥˜È jó,ƒÐ)åñÀº èkäÙïÄ}hRUªãºÚ¥FHPÛ©ÐÍqAL ˆBr.x炤¼(Œ­†g¿÷!† 6¹¦æbuàE5¡Ý´6ùCMÀ”|³®Mž™©@þ`IøúÇnªJ@¿.åìWâF&h²öÞÂÖ"ð¢^¦mûåþ‡y÷üqã&Up*Uð–8¿8esÜüaã.´4Up·&‚0æ˜ìPLpez³ø¡tBÜÂXQÚ :$%`þ³©p{Sg¿w! àö8ÇÑu> zóSÛÜbæSWºÇ³ßŠ»Ð]×¾ ¢"¨‚WßY›ùÐ["_¯@Š®)5¡kèú)À›b¦Ì8MM«Ï¼Pv˜>j܆h}Àí¤^Ï7ù1êÙ/Åm(¨L[Qg+ß&††äª8ÃT2hªà:‰ÀÃW–è †ÿ¨‚º]«½ÏpÐØ+çä̰‹«’uÇÜh ¸ígkÚ2#¦Ód µÁºüùæ_Ȭ¢EaŒ°Sû-Mé÷Ú£º„ÖâÚríi·WœÇe OèüÑã†:!öIPÆU¥Ÿ=¼MW^¦hÖt­¼fãkpð± D¦ìLIpï#€0Ô·êZ£KƒÛþ±àÈq ê3!Ë@ˆbò°ÇwN$ÇŽЗ€'’¨8p܃8€½ öDñ…Ù0ÇE °ÑLÉ?  ›8 dúî}5}Ü¿<Ž™0h\Ô ®',/— Ãló£û¸$€ÕÝ[Lu¯¸°¶u¡ÛÚ‡‚ƒÆ}\Qnïce4®©‚“»(€ù„sÕt¬ L4·k=Œ_½n´âÀqêît‚߯2 †~&Œ_³|ð$/{ $ˆ\À¦D ~êšÚGŠ£Æm\@®ÊDÏeU°]Ø\T3 ƒØUó)º¦ èÒ×ψV5nãú¸â\ð»äª$´÷ >? @´.ª‚†Aìm@ˆB·@åÙKÔ™ ãúRÂ0D1Q¸v‰Þ” œ‹×ˆÞv9nA½@å‰R¢¸z•üç.ó‡»uBNGQrظ‹Áû—ÝÊ@tï }Ó÷ ^J®öRGÞ/øüj½Àf(€öFë‡i#~ˆ-‹KÒ;¦ܽ¤Qþá˜.€‡'á Zc\pVµíÎ]jˆ "º3!õó(yÄå «ÓÞ}º(ÿžŠ;}Û. SNÉ?}Ë`£ `Ú½S0DH8#úùôè¶ L…#­‚£2° ¥à qª¦ƒÙD!iûÃ0æ^]Ó‡Œ;¹¢L=¢NHêÐÏ×R2îDyMã€øØ—Æû3cÇŒ‘žŠ;qïVÁ!ãN„“ª§Us™(8h܇p :µù«kâD/ž´ èËúâ}ošýBÜÊwVFh¤Y!!Q ˜šûÁUùs=dÅã„«äc‚ÁE#¬ KÀ¦ÒMõMârݬ8tÜÁ×VÇzÝÄoÙv™ýN܇°Ü‹¢‹ +¤Â‘ß))U?WÓLLG@E9±Í¡â°qº6àá„hò‡Ö…4ïÞdLÝ“"¦ô#¨WÉ?Z«Òfx‘0TÁ B#rQ0Qþ!D/?¥ˆ>w9Ñhè΄Ô%`Õý}¼—"5á|ÀÃ01 5éuÁÁ5pÍCÅAã>t%`ÔèsY$‚h}³ î,U¤8lÜÅEKô¦•@D”+¤öóGˆŽ/Έî®Öd‚nÃËç @K0âân»þ£*ÇŒQŠKÍ Óërñù˜sqð”mÀµ±VzÁÞ°:ïç+Ý6nÊ4Q½_°y²•ÁÊõ¦Ã 2Zæ'Ýò/X!+@TFÛ€uÜ–€Ý@Ñ‘ã_·¸¶Ü§;o˜åE°ªä±4*£mÀ÷~>^Q ö •€¥à<`˜FáÑãŸ÷­Õ¤÷ägW+@ÔT¬âÖÙBŒŠêÂôín™ëû"¹´•€Ñ<}`#+í³Àª~æ¢$TdRÝ“€'ð¢\¡i†AŒï¬Že6™ÉD aWwZ¤žJˆˆêŽéuœRî“@ôi¸Íók3VE’øÁ“̈N~!"?Øb"Iˆš"€)ù°ŒA¿~P£K3 “ê3¿®,[H *¢0mçy·¤•«?L25I'äõ¨T¶É–€«ÙHüPQ•€k,¿Tõ‡M ˜§Z¹²n5óÈBºù€çV*'p¾»D¯ë{?´¾@Š@ìRÍÜVÀ?, ,Íl˜ô¾ƒÙºÖ›È¢vªßd6³6’6`{"Ζƒ¦–&€¨|õf…öu® Ad?€ÇËǘâ-ùVsTSbu6´ŽKÀe÷=QËÏu>‘Þl÷¯Ë¬.¡Fm2€¶y—ê*8qQŽ·>ÀNˆ>s&Duà¸ÝEIå™É% ö †aJÌšë„ÃjÁQã6xT»_›¶àô°îÐqmÀÃw¤5¨f}g$Õ?L@Wü•Ó¾,ˆ}GUða#±)éÞE`Y#°©—ìÌ©¸£qÀœªº°«®‹#hÈ&#ØÇÄgÉÖˆ6Ï÷OÏ‘@“Ã0Õj§ªàùƒÆ}Ì÷‚_½÷ã’23ó…¢k6€U®\w{&ÀÃ÷¸mô™$€pfÛ€Ï*]¾:|_%Güà'jÌÏžo ÆŽÁ–Ý–ÎT˜W?äñ⇾ÃSqñæú†ék;æ·³V°9î„„›m ض÷l‹Aì àb^hãW5 :Ž/úí$Ðîçƒå‹¾¸ &‚0N̆ÙÝÍçÊ–a¹]+¼Ù^pÀ’³¶Há(oX]Rfž×MBÀ:서8RNpÔQ ª`Bkz6ÌbW]ó…û¹ºy3ÀË^¼Ît“àƒ–ØžŒãº8Ô†¢›·SO·E{“o@8ÊÝ)„+ƒÑ˜Ÿ “RžuО îxÓ°‰ØV‡E à°qÇR{Á[¨\s«ÐŒTÁ¨)Ú€[ŸcõA{½¬#8lÜ…(€)삤zt†*•± ©öM¾Jƒ/U%#% jƒ³aܘþEœEJ@ô(zÁ9]~6L7…@¦¸*®Œ0»Æß¶J[[7›ÝsÁ‡ïH9€M£ŽDd6€Ý†Þ¶-sˆðxBàbce"˜¶[í¶‡Â|@xÓÌÉÊOR `*E Ñ=þyÇóÏ/¸Ûî£DD²Bj¾ÔÈ´ßR)·± PpKUÝIy•|½&inÕe˜)U%`*Ûé*ù;U°+h}Àçêúm. žý*Üæv­Õüç÷K¾üÞX‚0GËÐ6ÍOỌ́ͥ hÛ}k[;O’0¯@¾ ÊØz9¹®ÈüãV4Ìo”©g¨R#$ê„Ô•m²W‰ä:&¿ 7¤†Ù–FØš¯—ªvùCKQ—ò¯4]Ÿ¸œ¼ù^p*e[Žž}š;"ä-isM¼=áštÐLDzOJ즠@D% )M»¯*ø†AD4Æ=±}3 CÑR–€¶Ó›¶‹’Lé £¡lšóæU;âOÒ 6…^=z{Ä`4B¢a˜ÒãM»<á½ù=’šz0l†š«ëVJ@t©VÉ7wñÌ¢Ùl†h—KXÌLÔ´6 kgêÆHÝä–­h øt³¢‡w4Z»;¦'wÖ×0MCª`DÆèªàçFa=k¢ *§n†ÙÝùýÓŽ¶T§â’K$'‚Q´Káæ&#$Û;¡ù‡¢Ü™ŒP•€DÑ5!χÕ܃m ¤&ð$—eºÇ.€¥âëfàE9!Õ°ê€pF!Å•f> q±}Ö†A‡hBªŸú~lÞÁêˆ æºQ>7;º¾.„5Ù½î’àÞÕ˜$É|Àª*^M‰˜òÒïgä–nm˜Òóu½ü31ƒ–èv­É~íР›43û…¸]ŸLlùÓqD…òLH½ `@J@Ôd«ä?åspïg¶IèÎ/šºëê±@7øÁQ ŽÇ™›0„§8R‚W*ßü¢É%óRÑP”€måëÇ^|A8û…¸Õ «m hÏÌ•ó#Ûs_ˆ›Q ÃÔUðZMM-;L~!îE9Á´Í•r‰¢Ou&ÄŸo«:¾í©9àEµD¯íuT3¤}MLü`‰VHÍóO“¯ˆ]瘢¡è§ª¨+}⵩GYº4–©/ùT ñCC\¿VS_8‚É ©Y7€eŒzöûp/Ú>„e]©g¿÷¢`§­GG‘KHŒžïpm6@8Šë‚ë2¯ õ.úô¬Î„<Ì~ nK6Ænª@ô(/JÚ4Œ^¾Àz&` žã¯“^˜¾mË?ê‹ä莠"^š#•InzL~qöëp3âʼnì#ˆcºÛ4D}ßr“šÙ¯ÁMIØMY0%°$mÆiøÆ£±CwŸn9#‡>U¼‹"虿Ya;Ã¥wþƒ¢1»ÖöuÎã´ÙVïOɧñ‡óUp{ßõjˆP“;ú';S^(qà,hâÀPmÉy¦|#€èÑLÉo‘9œBñS߸,“~NûNwÏ Å7'òRüàA1#ºèÇŽA„”ìækeDÚ«ââø1)]×pò‹pO߸0½Á…IèùîÒfñC介™'íòlÏ¢ÎÇ‘b"€k•2¿²Xàìá–gBªÐmL'=º¥9:Ñk¢‚>e ¸7HúF\¡úEß·føMÄ=ªv»ºa¯xSMÉ7lÝTC4m`êAA7†!Í©¸Ü6ÝdÒÍF¥C CpÃêWÜÞOR]šG«Ùx’Ð/³º¼¹·29•ÉVgß\7£{ñC&(ËŸ¾›Ñ$€0D´l}LÖ°ï‹7¬^ã 0dlç –è@ô|#€æ¹iÒûE@À6]ÁE"Ä ÙʾÃ^.LÑÝ-s÷Ò8 C¸2ÂÁÅÁ@@w¯8{y&p’ €íx p–â\ð6áÄBE€§9]Lq‚$€nþÁ{3ÃÎ8C3ÅøáÕt¬6ná|TÀSMÇ:‘.ˆ–hF´òøK´ÜMñCk,€f¯ó3þ ZƒwL/íõ˜Ô²øÔd ¸]–ÞŒ§ÌWÁÏÛW3ã[ÜÏ?Ûµ#GË'i¨4[3” Tº­ÀªNH"t!ºMÃq‰'"ªû„v< "Â*wãG¿¡‹H ˆØ7–è @D. !€ø)ˆŸ"€ø)ˆŸºlˆ@ü”îF5œëÀJ@ü”"€\•ŽaŸÜ)‰…a0Ž*?% ½`Œ ŒŸ"€ø)Îã§ ~Šâ§T7ªI´1‚â§d7ªa#(ñS?EñS²ÒÄáÝ2‰>GŒŸ"€ø)fÃ৸,?õ‹º·ÍûÿíýGÚ€ýçö··þx°zã?ù `ÿŸî¿”ý&#˜]ª··6Ÿ½–ƒéî·s¹è¶õô/ ó—[ö_~ÞC*ø‹­ÍƒÞ×\òºì¾½è7,ÁÎÑçõcyݨhïv °VÁëJÝC8²ÏRJÀÿ€ÿþ[×eÐHܳ¿Æ%],{[Ζ€§ìð«ððÕ£_Üd ˜&KÀ¦ 85üL÷ös 3Vp€Äp—ÄïøùÇÔ{Lî?ùýã=³á]uøβûôÓý'¿@³ûOü/,Ùñãù'S%Øè¤ûx4€‡ìøqì÷_>>þjÿÉïÿ׫àÏuýó³*xäÐÛÇJp KÐæû¯Ýßí:½ãt 4 ÙLVϵ_ï¡*ÐìÿùG´ß?ÖÝß}ÐÄŽ£¿?¿ÿÈGÔß?Àùßßd/xûóó:ÐîŸþþnÿá^øðþþc†wüë¿?0#ŸbèŸzÝÃ_N¼)ŸÍ(ßlj¼D³-xøsJŒ¢Xܤ‡w1åò‘£“ÏË–ÛIZwÊsigc¶$xr%R®Oƒ y)o¶ÕnýxIõ¶œ·-²îcñÇù*Ñ•gåÛ“¬ª1·To‰è?‚â¡i“-§JÀ²¥*@Ûº×hÂYš&]jÚ€¹WµMIæ?%Uù¢ ~í;϶æTÚÚ0IEND®B`‚rdd-2.0.7/gui/html/md5-example.png010064400000000000000000000053521042173111100155210ustar00rootwheel‰PNG  IHDR€à,Ö)PLTEÿÿÿ   ÿÀ€ÿÀÿÀÿ@À@@ÿ€ À€À`€€€@€€À`ÀÀÿ € 0`€@@@@€€€`€`€``€`€Àÿ`@À€` À`À`À €€€` €```ÿÿ @@ @€`€ `€``€€€€@€€€    ÐàÀ À`€ÀàÀ`ÀÀ€À€`ÿ@ÿ@@€Àÿÿ€`ÿ€€À ÀÀÀÀÿÀÿÿÿÿ€ ÿ€ÿÀÀ ÿ``ÿ€ÿ €àà àà ÿ ÀÀÀ    ÿ€ € €@€@ €@€€`À€`ÿ€€ €ÿÀ`€ÀÀÿ€@ÿ @ÿ `ÿ pÿÀ ÿÀÀÿÿÿÿ€ÿÿÀÀ7³bKGDˆH pHYs  ÒÝ~ütIMEÔ  9-ѽôê GIDATxœí݉–šH†Qëøþï<“7´èßåÞ9 ™nJÔ|A m=š”rú}}û)—ßËÊöS.‹RV°Ÿrz˜-?ÿ-/®+ÂC=ïþÊ튗ÿgÃÞá:ºG~Y;ø»;|ý›ò×Ñ=2T9 ~ƒ›ò×Ñ=ÒénÊ;\G÷H§w¸)ïpÝ#œá%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$äøó»É8ž  Ç©@’q<Ú’ä(%@¢H”‰ Q$J€D ¨þË?§åamÑ}á|‹¯‹²²¸[ŒíOCKYYº/œo1v øÓZY]L+¬á—ãPvö€T;\;øs H¥‡àGÓ_³`ê8H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€$y—|’|NYö€d9$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢HÒØÇ4ü +e}q] Œ}PÍOdÓ¯ÅÅ´ÚW”5²,—ÜÊÊ⼬é?¼ìèÊé ‹iÅ]_>̱;iÜêîÏ C³`Ç€ŒÐ,˜Î%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢žXFªM€¬«Ú–¡ˆȺšËÓ5ž‡e$ªî!xè È:³`¢HTåCðÈ&ȺºIÈÐy²N€D (§aˆ2 &J€DU¾a„YUõ.ùƒ 5uŸ"@öR÷9!‚ÙKÕy@¯ˆf/fÁD (¯†!ÊsÁD (åÕ0D™%@¢*Ÿ Ù„YW¹t È>j‚͂م= Qމ2 &J€Dy&„(oPI”‰ Qމ2 &J€Dù ¢LBˆpššØ±;iÌêîÏ cǀǀŒpÚsš3Ày@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (’ä]òIò9!dÙ’å(%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@’Ný %@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (’4½I¾‰8LˆÉ°$Ë1 Q$J€D xUJY] \8_a$À)µÓ¯ÅÅÀ…óÆ÷€åTââbäÂù [XNû¼…Å´Ú ®,Ÿç8’Çt´·¾¼Y –lòì^c“õé¯Y0Uœ$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (%@¢H”‰ Q$J€D (’äcH9žýûòWŽsÿ¾(@võ«:²§GÁ-ô'@5·ÐŸiÔÜ<½òØÁ-…w&@îmÜju7øíþ8¸9~›ppsüt[7ZÜŒ?Í‹7'Àw÷fÁÍ ðí¼wps|yŸÜœ_Îg7'À¸ï nN€›àî÷ˆ7·upVÜŒ‡ n„› nK|Np;ào‚ûC\Ô7(¸ò  î…}b€‚{#ŸàÖÁ)î½c€‚û o à>×K(¸ïñ&ƒë¼>xØ;\ÇÁ ß'¸¾»Øpåz‘ç?íÜ67å-în6]Þå2÷ n››òw·[.¯Œïøz7ýg£>yØ;\ÇG—WΗÙ\ákm`©9ôÛx£p¶| ¼B|™íwªÕ§$çCÓ°ÊÑåvSÕCÏ«µmpq+µÃ^|k‡®Mg>7¶¼þæ3Ø»“2•ë_‡UŽž®ûݘçC¯£Z6¸¸•¦a¯»µÓ]Òº±›a-[\¿5—çnŸ˜«Z¿œoÍtB»jô9¥›1C/{ÀÖ þÚJý°—ÞZ9ü^½ê~œödm¿5—çnž˜ksV;ºÜlª~h¹ùCèé~kÝØåŽm»y}[;ôlí²jÛØuWÛü7÷kýž\žlâæêU™ÿ£¨±ô©%ÀÚQÓw[7VîþØtó÷U÷6•5ß´ëó¹tÓZL{ÙÖõïU£Ú‡vºÞÕ5ì×ú» »®ÓøWÐ3¬û:6jÖôLŠú¦ŠÝ£z&o½s¾¡YpûÙ7ªoXïuRÎÏ(Ý¿oyU§üÙÜÿU]^dTùô0lçür¢r»#¼|oú5}±,|q‡7 à›ÜxúÊõ{÷_\y1ô›½.é°ày/wàý‹e Ï}€³W·•Ûo_›½Sô»ŸÏwhÓ±ßì•7Ç€€¤ÿþE2’´ÎôBIEND®B`‚rdd-2.0.7/gui/html/rddgui.html010064400000000000000000000614121043501113300150400ustar00rootwheel Rddgui Help

Introduction

Rddgui is a Graphical User Interface (GUI) for the Robust Disk Duplicaitor (rdd) imaging software. Rdd used to be a command line utililty. With version 2.0 it comes with a GUI that can be used to avoid typing long command lines. A command line version of rdd is still available.

This help applies to rddgui verision 1.0. It might be useful for later versions too, although some modifications might be made to the user interface. This help might also be useful for the command line version of rdd because it extensively explains all options. The options on the rdd command line version are the same, the only difference is the GUI.

Screens

All screens in the GUI have a Help button. Clinking this button will show this help page.

The screens are connected to each other in a wizard like style. Clicking the Next button will show the next screen while the Previous button will show the previous screen.

Some settings, like e.g. the input file or device settings can be customized to a high level. The regular settings are displayed in the wizard like screen while the less regular and more difficult settings are 'hidden' behind an Advanced button.

Whenever a path to a file or device must be entered, there is a Browse button available. This button will show a file open dialog screen in which the file or device can be selected.

Contents

A listing of screens in alphabetical order:

Image or Verify

The rdd-gui can make an image or verify an image that already has been made. An image is a bitstream copy of all bytes of a device or file.

Network

Rdd can run in 3 modes:

  1. Local mode
  2. Client mode
  3. Server mode

Local mode

Local mode does not use a network in which two versions of rdd are communicating with each oter. In local mode, rdd makes an image of a file or device and stores it either as an image file or on a target device. The file or device must be avialable on the computer rdd is running on. The location can be on a server that is avialable on your network.

Client mode

In client mode, rdd reads the device or file that has to be imaged. The data read from the device or file is transmitted over the network to a computer running rdd in server mode. Because in client mode rdd reads the file or device, the file or device must be accessible by rdd.

Server mode

In server mode, rdd reads the data that is transmitted by another computer running rdd in client mode and stores it as an image file or on a target device. Rdd in server mode is typically run on a server that stores several images.

Profile

By selecting a profile, the GUI sets some default values for the chosen profile. The list of profiles contains several types of media. All settings that are set to default values can be changed in screens that are to come.

Input

The input file or device is the file or device you want to image. You must specify this file or device.

Rdd is designed not to change the input file or device. But, as all software, rdd is not free of bugs. When possible, use a hardware writeblocking device.

Input, advanced

Rdd can read the input file or device from the start to the end.

Rdd can also read any part of the file. The following items can be set:

  • Offset: The number of bytes to skip before starting to read.
  • Read: The number of bytes rdd has to read.
  • Blocksize: the number of bytes rdd must read at a time. In general, the larger the blocksize, the faster rdd will work. From a certain blocksize the gain in speed will be minimal by increasing the blocksize. The default blocksize of rdd is 256 kB. Some special media might use a fixed blocksize and will not respond to other blocksizes.

All values can be specified in bytes, kilobytes (kB), Megabytes (MB) and Gigabytes (GB).

Output

You must specify the output image and the logfile.

The output image can be a file or a device and must be specified.

Rdd logs all its activity to a file. This file must be specified.

Output, advanced

Rdd can write the output image as one piece or rdd can split the output image in files of a specified size. When splitting, rdd will add a sequence number to the names of the output files.

Splitting an ouput image can be useful if you know you will have to burn a large image on a set of cd-recordables.

Some filesystems like FAT12, FAT16, and FAT32 have a maximum file size. These filesystems can not handle files larger than this size.

Integrity

Rdd can calculate MD5 and SHA-1 hash values over the bytes it reads.

Which Algorithm?

We recommend that you use both MD5 and SHA-1. MD5 is widely used, but its one-way hash function has been under attack for a while.

Verification

We recommend that you compare the MD5 or SHA-1 hash value that rdd calculated during imaging with the MD5 or SHA-1 hash values obtained by:

  1. hashing the content of the input device;
  2. hashing the image file rdd produced.

For this check, we recommend you use other software than rdd. Linux md5sum and sha1sum are good options.

When your device reports non reproducable readerrors, the verification hash might not be the same as the hash rdd calculated.

References

  1. MD5 RFC
  2. SHA-1 standard

Integrity, advanced

Besides calculating an MD5 or SHA-1 hash rdd can calculate Adler-32 checksums and CRC-32 checksums over the bytes it reads. Where MD5 and SHA-1 hashes are calculated over the complete input file or device, Adler-32 and CRC-32 checksums are calculated over smaller blocks of data. All Adler-32 checksums are written to one file and all CRC-32 checksums are written to one file.

When you have an rdd image with one of these checksum files, and the hash of the image is different from the hash rdd calculated during imaging, rdd can pinpoint the exact blocknumbers that have been changed.

This screen has boxes for selecting the checksum method, the size of the block to calculate checksums over, and the files in which all checksums are written.

In most cases it is not necessary to calculate both Adler-32 checksums CRC-32 checksums. One checksumming method is enough. Adler-32 is a bit faster than CRC-32. Checksumming can be used in addition to hashing. Checksumming is not implemented in rdd to replace hashing because checksums are much less distinguishing than hashes.

A blocksize of 64 kB is the default value in rdd. You clould select larger blocksizes for large hard disk drives. This will reduce the size of the checksum file. For smaller media, like a floppy disk, you might want to use a smaller blocksize. We recommend not to use blocksizes smaller than 64 kB for the Adler-32 checkusum because the checksums might not be distinguishing enough with smaller blocksizes.

Refereces:

Error recovery

Most copying software read files or devices in blocks, using a certain blocksize. When they encounter a read error, the whole block of e.g. 256 kB, will be lost. Even though only one sector of 512 bytes was damaged and is responsible for the read errors. In this case nearly 256 kB of data is lost unnecessary.

Rdd will reduce its blocksize when it encounters a read error when the option for error recovery is chosen. Reducing the blocksize and retrieving as much data as possible was one of the major design goals rdd.

Choosing error-recovery will set the default values. To what blocksize rdd reduces its blocksize, can be set in the Error-recocery Advanced screen. The deault size is 512 bytes.

When rdd is unable to read the block, it will replace the block with zero bytes in the image.

Error recovery, Advanced

When rdd encounters a read error it will try to read the block it was reading with a blocksize of the retry blocksize. The default value is 512 bytes. This is the sector size of a hard disk drive. Setting a smaller blocksize when imaging a hard disk drive is useless because a standard hard disk drive will never read less bytes than 512.

The operating system might try to read a damaged block a couple of times. Rdd can drop the block after a certain number of retries and proceed to the next block.

Trying to recover as much as possible can take a lot of time. Rdd can give up after processing a certain number of damaged blocks or rdd can proceed until a crash of the operating system or a power brownout.

Statistics

Rdd can calculate the entropy and the MD5 hash value of blocks of bytes it reads. These entropy and MD5 hash values are stored in textfiles. Rdd comes with programs that can produce a plot of the entropy and block-MD5 values from these textfiles.

The entropy of a group of bytes is a measure of the amount of randomness of the bytes in the group. Good predictability (poor randomness) results in a low entropy and poor predictability (good randomness) results in a high entropy. An expample of good predictability is a block containing zeroes. Examples of poor predictability are files that are crypted with a good crypto algorithm or files that are heavily compressed. Calculating the entropy can help distinguishing between unused areas and areas that might contain a crypto container or heavily compressed data.

Besides calculating an MD5 hash over the complete image, rdd can calculate an MD5 hash over blocks it reads. Calculating MD5 hash values over blocks can show if the evidence contains much re-occurring blocks. In most cases, blocks that have a high entropy cannot be discarded. Although a series of blocks have a high entropy, the blocks might be exactly the same. Analyzing the block-MD5 plot together with the entropy plot might reduce the amount of bytes worth researching.

How to make the plots?

This document describes how to make and interpret the plots. It also gives some examples.

Statistics, advanced

In this screen you can set the blocksizes and the ouput files for the data to generate the entropy and block MD5 plots from. Please refer to the help on the Statistics screen for an explanation of these values.

Imaging

This screen provides information on the progress of making an image. The following information is available:

  • Mode: this item tells wheather rdd is imaging in local mode or in client mode.
  • Progress: this item shows the progress. Keep in mind that progress information cannot be relied on when imaging media with bad blocks.
  • Read errors: The amount of read errors so far.
  • Zero-block substitutions: The amount of blocks that could not be read. Note that this value can differ from the amount of read errors because it can take multiple read errors to find out a block cannot be read and has to be substituted. When imaging media with blocks that sometimes cannot be read, but sometimes can, you can have the situation that rdd can read the bad block after some retries. You end up with some read errors but no substitutions. You should manually check the blocks that produced read errors.
  • Bytes substituted: The number of substituted bytes equals the number of zero-block substitutions times the retry blocksize.
  • Elapsed time: The time from the moment rdd started imaging until now.

Pressing the Cancel button will stop the imaging in progress.

Finished imaging

This screen provides information on the completed image. The following information is available:

  • Mode: this item tells wheather rdd imaged in local mode or in client mode. This item also provides information on wheather rdd stopped after finishing imaging, or that it was interrupted by the user.
  • Read errors: The amount of read errors.
  • Zero-block substitutions: The amount of blocks that could not be read. Note that this value can differ from the amount of read errors because it can take multiple read errors to find out a block cannot be read and has to be substituted. When imaging media with blocks that sometimes cannot be read, but sometimes can, you can have the situation that rdd can read the bad block after some retries. You end up with some read errors but no substitutions. You should manually check the blocks that produced read errors.
  • Bytes substituted: The number of substituted bytes equals the number of zero-block substitutions times the retry blocksize.
  • Total time: The time from the moment rdd started imaging until all bytes were imaged.
  • MD5: The MD5 value of the image. This field will be left blank or invisible when rdd was not configured to calculate an MD5 hash value.
  • SHA-1: The SHA-1 value of the image. This field will be left blank or invisible when rdd was not configured to calculate an SHA-1 hash value.

Rdd logs everything it does. Click the 'Show logfile' button to view the logfile.

The button 'Image or verify another file or device' will return to the 'image or verify' screen.

Networking

Rdd can use a network to transprort an image from one computer to another. Rdd uses the TCP/IP protocol over an ethernet connection. Before you try to establish a connection, make sure you have a computer with a network card installed and your computer supports the TCP/IP and ethernet protocols.

When rdd runs in client mode, rdd reads the file or device that must be imaged. Instead of storing the image locally, all data is sent over a network to another computer that runs rdd in server mode. Rdd in server mode receives the image and stores it locally. To minimize the network load the image can be sent in a compressed format.

All settings like selecting the file or device to image, the blockize, etc. are configured in rdd running in client mode. Even the location where to store the file on the server is selected in client mode. Before the image is sent, the rdd client notifies the rdd server where to store the image.

Rdd in client mode will try to establish a connection to the specified rdd server. The server must therefore be configured first. It must be 'listening' on the network for an rdd client that wants to establish a connection.

Make sure there is a network route from the rdd client to the rdd server and that it is not blocked by a firewall. If a firewall is blocking the route you will have to open a port on the firewall. You can configure rdd to use any TCP port.

Client mode settings

Please refer to the Networking section of for the basics of rdd in client mode and rdd in server mode.

In this screen you can configure rdd in client mode. You can enter the name or the IP address of the computer that is running rdd in server mode. The image can be compressed to minimize the network load and increase the speed. In most cases the network speed will be lower than the speed of the hard disk drive. Reducing the number of bytes to send will reduce the time that is needed to perform an imaging operation over a network.

Rdd in client mode will write a log file on the connection and transferring the image locally. This file is not sent over the network. This logfile will look much the same as the logfile rdd makes in local mode. Note that the compression option does not apply to the logfile. It only applies to the image that is sent over the network.

Client mode settings, advanced

Rdd can use any TCP port in the range from 0 to 65535. Make sure the rdd client and the rdd server both use the same TCP port.

Client mode, connecting

This screen shows rdd is running in client mode trying to connect to a computer that is running in server mode. When the connection is established, this screen will disappear and be replaced by a progess screen. If no connection can be established, make sure the computer that is running rdd in server mode is waiting for a connection and there is a network route from the rdd client to the rdd server.

Server mode settings

Please refer to the Networking section of for the basics of rdd in client mode and rdd in server mode.

Rdd in server mode will write a logfile on the connection and transferring the image.

Server mode settings, advanced

Rdd can use any TCP port in the range from 0 to 65535. Make sure the rdd client and the rdd server both use the same TCP port.

Server mode, waiting

This screen shows rdd is running in server mode, waiting for an rdd client trying to establish a connection. When the connection is established, this screen will disappear and be replaced by a progress screen. If no connection can be established, make sure the computer that is running rdd in client mode is trying to connect and that there is a network route from the rdd client to the rdd server.

Sever mode, connected

This screen shows there is a connection between the rdd client and the rdd server. The following information is avialable:

  • Elapsed time: The time from the moment rdd started imaging until now.
  • Progress: This item shows the progress. Keep in mind that progress information cannot be relied on when imaging media with bad blocks.
  • Processed: The number of bytes processed so far.

Server mode, finished

This screen provides information on the completed image. The following information is available:

  • Mode: this item tells wheather rdd imaged in local mode or in client mode. This item also provides information on wheather rdd stopped after finishing imaging, or that it was interrupted by the user.
  • Total time: The time from the moment rdd started imaging until all bytes were imaged.
  • Processed: The number of bytes processed.

Rdd logs everything it does. Click the 'Show logfile' button to view the logfile.

The button 'Image or verify another file or device' will return to the 'image or verify' screen.

Verify an image

Rdd can canculate MD5 and SHA-1 hashes over all bytes it reads. Besides these hashes over the complete image, rdd can calculate Adler-32 and CRC-32 checksums over blocks of data it reads. All these hashes and checksums can be used, up to a certain extent, to verify the integrity of an image produced by rdd.

Please refer to the sections Integrity and Integrity, advanced for a discussion on these hashes and checksums.

In this screen you can conofigure the following items:

  • The image to verify.
  • The file to write the logging information on verifying an image to.
  • Wheather or not an MD5 hash must be calculated
  • Wheather or not a SHA-1 hash must be calculated

Note that rdd does not verify the hashes. Verification must be done by comparing the hash rdd calculates at verifying with the hash rdd calculated at imaging.

The default is that rdd expects an Adler-32 checksum file is available named like the image file, but with the extension a32. This setting can be changed in the Verify, Advanced screen.

Verify an image, advanced

In this screen you can select the correct Adler-32 checksum file and the correct CRC-32 checksum file. If rdd did not make these files during imaging, you should not use them in verifying an image. Information that is not available can not be verified.

Verifying an image

This screen shows rdd is verifying and image file. The following information is avialable:

  • Progress: This item shows the progress. Keep in mind that progress information cannot be relied on when imaging media with bad blocks.
  • Elapsed time: The time from the moment rdd started imaging until now.
  • Adler-32 errors: The number of blocks that have a different Adler-32 checksum than rdd calculated during imaging.
  • CRC-32 errors: The number of blocks that have a different CRC-32 checksum than rdd calculated during imaging.

Finished verifying

This screen is shown when rdd has finished verifying an image file. The following information is avialable:

  • Image file: The name of the image file that has been verified
  • Adler-32 errors: The number of blocks that have a different Adler-32 checksum than rdd calculated during imaging.
  • CRC-32 errors: The number of blocks that have a different CRC-32 checksum than rdd calculated during imaging.
  • MD5: The MD5 hash of the image
  • SHA-1: The SHA-1 hash of the image

Rdd logs everything it does. Click the 'Show logfile' button to view the logfile.

The button 'Image or verify another file or device' will return to the 'image or verify' screen.

rdd-2.0.7/gui/html/minjusnl.gif010064400000000000000000000240741042173111100152250ustar00rootwheelGIF89an¼Õÿÿÿÿÿÿýýýüüüûûûþþþúúúùùùõõõòòòðððñññôôô÷÷÷ïïïîîîéééåååâââãããäääçççìììíííáááèèèóóóøøøàààöööêêêæææëëëßßßÝÝÝÜÜÜÞÞÞÛÛÛÚÚÚØØØÙÙÙþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýüþýü,n¼ÿ@€pH,ȤrÉl:ŸÐ¨tJ­Z¯Ø¬öèz¿à°X0 ˜Ïè  n»ßð¸|N¯Ûïø¼~Ïïûÿvd ‡ˆ‰ €‘’“”•–—˜€ ¦§¦‹j™°±²³´µ¶r !"#ÃÄÅ"$ ®l·ÑÒÓÔÕ·¹¾$Ã%&à&ãääà%Ç ¯Öñòóôõ`ØÚ$"%âå gb„ˆ"°bpà‘½‡#J„O¿ÿjÔøo Ê4p8±¤É“'HÀKBŒcÆüw0ƒ‘(sêÜIM@ÿû^”Ità?n’Cf€S§–òœJµª›<ˆ ´¨×™"&<ذTP Ò¦m¶Á‘Õ·pyªLàa‰¡_óD'¶ƒS:$xàá ©Ö1{·±cˆ68¨€¦ÞËùZH á“( „ áÃÆS«–æskW̰ˡKÁWèxq#½ÐAêêßÀ)@pÂ]¼±a—0(,£LÍ~ƒKŸîG傺þ’kß‹\æˆ §¡QON™“1dßÎ>¶ˆ ”ŸOÿ‹! \-·ß¯·ˆW߀Ó¦ž~ü…Û‚Ú‰@ò(apÄt—`fdž†@ÿ‡þX¸‘ 4 à„(6v¡‚%S0ÆcŒâ¡ë=G â*®È‘G e‚ t ä’K"àÉ|Pw5ƒ©%UBrwx m©Õ™h:u@ hàp0Âs8`À–xòÔe8è ´N; pâUdÖ]ä˜Ü™ç£'­Ø -“@¸•G wWú×(¤¤Nt!:E2C¦#ƒâz¨g£Y–j+= –@Â,°ê‘pz€ $š[ŽÞªl<üéJ ¬%0`]C•€ì²ÜV³Ÿ³ Pë%g@ÚÚÙÿíºÑ´nt² Ð@q륛,»øÆÂÞ»>Ò"@׊0޽ù ËvüÞR.ÌI°ÁW¢]ÂÑ À€•°mÄG’ÅÒ”ë?wlr±éoýRC€H@º'׬‡r$Øo5@— ŒkóÐr`¦ò;[£R›8í´ F-õ‚9#ݲ<ØhúôÖn|èõ×`ÍÁÊIsm¶I¤­öÚl§ý¢eŸ-wD Ôm÷ÝxÛÝYs÷=š€• ­úmøáˆ'®øâŒ7îøãG.ùä”Wnùå˜g®ùæœwîùç ‡.ú褗nú騧®úꬷîúë°Ç.ûì´×nÿûí¸ç®ûî¼÷îûïU|äjOÂ_Þ %O §°ÁÒ*/á(À·4Я©Á X`µõŽ0öMW[‚üúl˜5X” …@AxäÓÎn~9ÏÇ&làÿÿ‚ Å€áû} >õ›ÏÀ @›2€6,@A z JÀ‘lþ ’§#À@ö6Á;ø„aHa oª1 }N@Ì÷•°ÿÊÀqŠq>áf`9K c¸˜Ï$”D€1qx¢ ¡Å`$<"S3d ƒ’ð™(> <àŒ<ã.` DÀAܶÈExÿŒÁg0e€>úÑ(„à+ÜŽSéâYèŽPÑ3€ÖùEâ‘’\ëâ^ˆÉ³ ä;x`'39xÀDÏ‹ÞV)IߌÒ1AP l nb£øÆT½WÖQ "¨\¬è5€oªÀ¢øÄ @@{ŒôeIb ¡QĘnÁ>8à™¯=’&,?‰ $¶Äe2]ÒÍ8H÷§U6\réüž¶)ç8g ¥<ã²Tàžz(×›>o ã + Á š tž1(ˆi‡@˜€ 9 Ñ„@ |Á>'P „ó¢ÿu'؇žiÀ†!#J°€½­r•À¥àF¦õ,@K>ôL0 ¸Ôô¨÷H/@¯0R«“;U œ2CUãðÕ­&µ -+:õǬªÕ¬gÍh8I- UE%\ß“£5m~ ø gÒu¯\‰>Ê·ºá_àÀ‚Þ³-"%DÁâ⩉ X 2çXìK/›Èçp A›V4vŠ@Lu,i§A”åüç°è” ”Ò-kÎ6RE S-‹ONæR†œôÐÀÜæ:W’gPƒls÷¡ŽìóÈp€c*`à ¯xÇ;H¢:àlÿnt§åÁ¼ä,\½LM÷¼ >e’â¾øÍ¯~ñÄRL`⯯ڲÞé¢N/”‚Àa`žq—¾Pf»9µ [x9Çà€~)PFó:  h {yw™„@! ØqK©["³¾ËäfˆD”2©¥¿Ê¸@Q1bÜ]†&¥¹@´´{¯€–3B½PIuÇz¦€ DZH稃tTC½6Û®˜·5Nô½T!P^„ÿ òdW›¾¸/*Xú q—â00O‹ÿÕCǼÁ)À(pó¢ÈÄج€*.ŠÛ˜ýí™YÎGrlQL¥b†8Ľɜ û—Ý…FoˆÅÚo|‰}/úr8P }è€ÚÞm¸[žO¢÷NfñÝÈ8EÖ/lwH+*†_â/v ¸”z’ºÛYO{ÙDmÒ!FæSQ|˜·¾•ØÉ^{£hÌ÷¡ @0oy©÷ñˆŸ<ÝÓÓ/kø@•ž/›×"föÜá1:´!¯áˆùáÿ1M$ßk Òûj|Yôk|9™À«ÓŽ<¹pAð""ÂîÒ'`r$¶Vx[rÿ ögoºBhP,À56Z§l €J‚Ù´mÈMý°€¨rÇOR_xB5Wv´‡ á` Ó‚økïG=Y%=`‚oB#)ØN-˜p¼¶!ƒà[a7v8xyº"°`‚b1P@øP¦ ¬ÀokpUp„ÈT.Á‚(kb~ã— `€vxRŽ'qxWøv‹gÑ X‘hvGÆKZ†ì2|؈ ¦«øXÀ0ù†³G—òxaP-!‰yAŽ¥8Œžøií$Ø P<‚ëc3SÛGt‹§Cƒ1)ð v ¹‹ã(}."€i6‚Ùi&£‡ÊrB’¥x Æ…Ô3„hˆ°xvaäJ2ùm&…dt“:)b‚ã“C?xo(dÔèoàðŠIi|ÿÈðL\. “P™-†ª ƒI2gØ9¦x’§re ¦bxà`sg9&¶ƒ>w/iuE2S‡i†<ÆŒ™ƒÔ6h€hy0Ó•ƒÉÈ=ùÓXá–,Ed´òh¤sxâhf'¶’~ÉÕÒD}‡#õ6˜!ùf‡y °{r©Ãš¸'„¦k)[6¥MnSiãj¶Y›3–~©ÈhUª”U’9:”k&F+IŠyyã&uçœjÉo ¢#îy›ˆHCo–_ •3 ð•·g„7l‰N‚“ à$yã „žéY# õž­91”’=ÿºYA))»4â Ž˜‘ÆU  ›h#¶Ù Fó€$e¢‘¶Ã•$úIòÓ[ö©)  †ï#%.1¢•y° ÊÖŽX9£Bz&ȳ9yy!4$ÌVÚ¡7ê ì•ÍÒ"ÿ•‰ìè¡Xš7‰‘wI9ÝÉŸ[ˆ™ÁÃ?lò¤9*m‡aö_mÓ¦nPW:‚)º~Çßr¡yøÝS¦$¢hš¦Òéž„Z¨†º¦§Ô§#Ø’35×¢qbáòŸªÑ§%€*¥“ØwÁ¦ž61Ê-zŠóMYF˜ú> ¥’*¨ƒÏtN‹ó¥Êaœ¨µ›ªÊ]ÿ~ºmëÙ¯Ú,q™½‡œTx§ª§—3¡§b*!«zg Ÿñ‰¨e¤l˜r‡Ã¢)ãf `©?Ò§ƒ±RTò ÷ǘªà{Í0£Ú-XÁ€”?–¤¨A*Øà=PÐÉ©ûò‚9f­Å³®ëR`-‚ùcÆ™v´z+éÄhP—£úZ¢³ö€RV&‹/ ËPû¹¬  «ÊÒbú>"úªq©î‡)Ù¶8o4®è,ÐÒ¬ø‚<Æå&ò¶|ƒŸš~v­1ßв&ÆXó:s]6yÊ—±#‚³;x=Û1)3k[˜°5ÃvÊ÷°rçµ&K:9·*Ú´=vRL8$ÿ³ÆaÀo`[3Fí0û4ÑÃPrb!WD¾ç ){9fvZüx¬N#ð*&†=iKŸŸ³¸Ú±{[3Fi’FD©Ë–:_Áë±\ƒ ¸ʇ¸Š$ØV¤¥ãÎÒ@o»¹òrS”ñ‘²ádÔdò¯¤ : B©ââ7aãÚWk§àgù µ»9ÏQŒ§¤}³»­Ë|䃙ÈÍ µl°¶ù"´j6Ì{O‹¨XT[:V”3"Ìj½ò”Þ»gà{²™‚¾Êâ™àÙ­r£¾„s–ˆtÒ˳’c»b°µc¿Êê.Ò&eäØö8™±+á"Àÿù m÷때Y•¡гÀª{(pÒ»p7¬|­k3² Á1û’<@ŒŠ\F,¹À~S»áÁN3š/,ÂáGÂÅXÃl6@´2:<4<Â1Ì€@ìg;yÂ×[X$P¼,<ŒS>|–M\CŒÂ;¢½U|+›° €ÅKܙ߱a²³94š•º3Æ `Æœ”$\kð×ų…š[0c\ÆqrÆh|v–¼¦¿©1’&Ó)‡‚SÜÔyƒÌ"_"§=•i~|2ðÈÁz–²Èa‹aÉ¿åoÑ|6Éßbb aÈŽ:ÊaoR§ŒÊH:É P}†„Èÿ¶˲Œ´´¼iñ'5ì­pÅËúçË¿<¥HgÈ"¶W° ÇÜÉÉìÌ´;P-†ͳ<ÍåjœG½¾$,ÚÌÍÈìͰæ€aB‹v:<ä¼Íьεwµ=zËüCÙËñ,ÏÜ÷‚Šñqº\9õZÎûÌÏü§´¦Á’ļ;õ*·A·|ÒlÐ{âPÒ›¼ÓСÍ-ÑzFÑí@Ø*;¹àÐíу Ò`ÆÜÙ -ÒöFÑ ¹Ð¬³4ú¬2É· –Ë®ƒÓ²ü°;}–à|Ë­Œ:‚LCÓEÝ|É ýh:B­DýÔƒü“†ƒa^EÞýáBÐm†^:í=Aåeè ^~?ëâ%BY6ã«ãˆœTvµß:ÎÝ<®Ö(ýZ 6´£lâè=  €ä;¾‚>k€ØB;RÞ?Þ¥âŸá!LþØš¸, Së£J5:ëMa¥}¸½2Õ®üD.= ëFÀPæ¿’ÒÈåu>-†Ýu÷hýðÝÅ—…1®¸~cŒãznEu­+¼²×èr€ß‚%fEˆ~y5_iþ[ø]:oe+Ó˜K”˜ÞQ›àbI8oÃðÔZ.dyÿœ2êšcKdqvδLZ˜¸]‚K&,,:ȾNoE-疮뵰DoÝÅ>4«öl¿^ÇYm™¡Ò ‚«X"×N4Œül¨}•ŽÑa @ÿÑT»Ü›e¼MÜ>ÈZÎ<Œ^ ^ö~;£‰L1 (íî³îص9 õTð¸cK& ~üÜ'ðíp< /ã‘ÿ0ñç>7]v¯GûéHé}™ì™ñ?¨+?ò¢Ù"—U÷2/wqf)Ϩ²å_ ðêU)ajiØ Àu'§¦ç9_ ›àeuẊ‚] àk²„PAÿÇdU~€‰Šë6‡±örúaIâVæbõý°ôz€ï Á´QÜ §w!3 Š2Ò?"/°î ¯åÑ÷x ®È÷ÂYó°ÔøíᢠnTy$éÊòå1žK÷Þò6!.ð[ Ä"äSRØÒ “2†:+Òôy'ûŽ›HÑ+Ò  k9³Yô0õ×Qµ<)=úí6ý#>qü€òhœŒué²Ðm!4ûñð*¼ÉÀ¾kz ïx‚sý•´• ¶AY¾]K.“#ÒÄ“8ÿYí–Ûõ~¹'”²„ñt`õšÝ¡hT‚ÞïRªf3hÿ6@&HìðKD026Ò3Å–H"®2C· : $Hê Y‘JF0*°DoqsÿH;"B[…‡ñ^C>0u×6ÉB*˜A(BV‰‡õ@úl©ÇÉ3 >€¹×Ù£B":¦Ë»Æ˜F8<üè¿H|à°­]«W±Ðê·á|‘(8q7  >!‚e ÀI´ˆ"1oàˆk¸’ž¡F””ÉJ%K*Ë=)A‚Âe+ %€0$ØLš“d)d¹´Ü€ 85ÿ:µ‰$È6à¥Ä»düèýó¥ªÉ¾]ÒÊ”m& *,;—̯YûÝéá­µ¸BjÀ¦Ž®°šIçµUœ©À0 G>²“‚¼9õN©bào(C PÉuõJªd%v)T9  ób×^t° !¦éÈ;áuKÍDé%‡4H™«À€k'yÅa‚¶]mDÜúuõ,4dˆ ½0e 3 Ån VSWSà ƒÁ¾‹tÍpÁB†TÁ7ÄEÖÖ좀ˆ`<„# ÂËåýÈØ‚4h€þkƒ=6`ÀTD€p„ h ° ‚ B BºÿjÊÀyÔ ­¸`"œKA4àŒ™ hsĘ >A Øà¿6l€.È`‚ž ¡ R€€4pÀƒ$hñ9Ûø¯F—Š „"{,KA2âz±.˜‹`¾°ÃØÀ)¡ ð;“ .¸,€âè  ÓLk¢ó6m$®ã”é  ê\s .À@O&^ (HrILD@ƒD?¸2¿WMÑ`€J5Àô¾K¶$>e¡Tëp„ÊÙR‡Y.ƒ>½e€(àѰ¤è³<°ïJ‚vã¢Pd«d”Y4ÏúÎÎiÿ]3à8±MÐ.¬>"D2 Õ d Øe…„ B4FÚá^aØæ6‘ëS’£èpGlD5„äã(\fÄKN¥Ÿ˜ä€„BMŒq^ƒÛ”È"»Ab~ ÐÍ$ûV-µÍÒ(ÇXÀov€ì)‚%)ÞØ¾ Åíƒu“™‘Þq%¾Ò ~l3grM à†» .` fQE‘(¤ÆÀë9k' R 9»PÉj¢“"#"2 €8àºLg(Ûy9œaŠÞtÖ$d$-€f¡ˆˆ$h¨··m`PÄ<­©¸^¾’”äƒBˆÒj­?éÙhlÄøQ9IàÖÛä;ÿ}%kòtÕB¡Æ§€úøJ„-Ä茠iO…K§‚‹FD¡PT`™¤ÔŒ*¯_*uQ1MýƒÐ׈*]­êPߨÖ,¸Ä’Ó’\ ÐmS€ÃŒ2¼ËÅf6}+Þ±€})-L£H,йJ´ƒÉÊT{s´Ú´yM4Ðaç‚ÅåõЀc7a…uÇÂçe7%UB5ÀÒaXÐ.!‰ð)!H™‰¸Ë†¬Íªk/õRoºckèÉÈŠƒlg·s )iÙ`ZÔ¶c'îq¹ÐÒä:²(s2fTC…€Ùœ³º3áâàh0|@4ÁfQÁkÿצÈJ;³>ÌãÜi…„¼co{grW¬j(ŒB5  ØüŠ ksòÓ›dà 0ÀwrÐlÁÝ!ªZ!2²¢ÎÅXU”Å#A !¶ÎZ–82ë·Àu`š¨Ä.^{ 7eaÀL|¢Î;ÙMÂáÙX1­9¨!Ô´ôXͤldŽî—ŽL& 8”„YC±±œN <`±ƒÐî•ñá‹y“Œ,_B X€xnø0Ä!luÇq¾MÍŠì†Óâ¹-æs96tòe ¢ À|4Ð €)!qrx¢€€Ónut‚8‚>ÿˆ¢Ëpçh/½½*5Sø<‚ 8 Põ“N- B-{Ù†ÒáX SU¼Ú6Zò0­ñTßHÌù·¹ß­€ ¤+˜€Ÿ€í (WÆ>€©­hlyË»ɲè‚ SMZÆ/c Pš+(®·ý·M—[à@h•t€B¹¢’@€.{ß¾’¿9…ÝÂØ¥i„f¬õê! í0 |]êz¸¾ahˆ©äž…·kk½¸1¾+O8‡,\f3‘+ç;×mÏчM¼í´B'–ëgôÅlsÓö²Ûӡ޼X/è xßµg­ƒÄÿÏœfrøk~ãm=;¬´´ÒµÇ1‡.]VˆÀ÷n¨¶T¯À' Bt6ïýÅ}§ÒKß.SÁ÷¨»J E|÷ÓhYŒ绦ÿwžO¾,°°€&Eá2‹\ò¼/9 Ä”ôûùjçA€l—˜*Uûë?:EÍ~ßµ/ ‘_¬/ÓREþ( åÁÓÞøîÕ`épÑeÍ»Âà¸þ€á¦éC,ð‚—ë“ova¤üû_D27UÔfI¾úCö™ó 6éVÀ’mÿ+‹#É,ìâÏáá›ê/8`[<çm²mÿ°îÿ6jC’lW ­¿FfÊ´®)‚„ÍJà¶ÿ¯Fà{$µ(0nÄmø P0 (AÊ¡äN¬MåN²@Ú* áÌjÉÈ…d°)vÏê`0›rÐÈ(PJzPQš#'/V”Èû<£êˆ‰ó–0ך0L.0 EÆÉLÈ ¯Pý¡Ei ½-Óå °©x¬YìB"ÀŒ hZÂîl0¦ˆ ×Î =įDßä´†9þD£¢ÖÒ°ùñõ±=`E. Å}^A 0 h HmñÀ§È¢ê)/Ó:„-‘\ÑŽ¾)õ‚eÅ1`þlŒ-üeõLÑQñÿ&ш‘Õ¢ð1Q2d†é\ÿ‘h@À.€ÝH saiîN p-s0ÓàÞ°/«Cè94Ð[èË‹aÆŸ,¥qšä `]à ¹оqP‡1Îí.æÈ‘—Ž\R Úñ qNæ</@GŸÄFð1no÷Ñe¿ñƇJ@ ã‚ ã:X²%‘$ØRãL2€"CÒÐ(€˜ê9\ôKÕ“J+…®´L#àL=N!éÍ &”M÷ÑXÀq4àJ“ëèôa(•^E¾*Cù47@UYδ¢ô€ɾÎ`O5 õL‰ïPqj‰Q755Õ¯~‚ ³TC“.z ûXU5a3V[•.LHm53£(kWoFò¡€•W#Ã]|«Xÿµ;¨§V•Õ0÷ÃtõYóÒ4pãW©Z­uX­1[s:•T½(¡Ã.'JÇu CWIVÓ5(‰oôë®ó]%¢H^ ÂôˆÕ^9RÓÀ` ñ¤‡m@\ý• –šÄPú5aûTÓâ^J¯2Vb–¤LªøÒiÑSc¹1$ŽÃb9G"«[EÖó>vD_ ƒm°ue9’dƒŠ`‹[i6(ÏÁep& ¶^wöûìfŸîš0shûtNá¤tKXºMiÑK"ȰºbKÐUj“i}öN‰!ƒ"KS¹ö,  j¯}:á?Ë–#?£cÁÖ bMOÛÿ(ÿácŒLó`ë–gIj(pÖ0TUeûvïnÙ!‰à‹l ¼x!ž\l A(µj.ˆÿè¶r—Væà‚Ü…o9wbÀ¤ð2Wut·ðn-q –qU—µ´ê`ö7šukc—e™vºe±3w%ð!J—Ä Âv vwÏÖä kæns“/·!!h£—ÏAÇF°ïz¥Wš:v‹TË]½wuоâVhwËW/ÏaÒpn‘·}Éi@ Making and interpreting the plots

Making plots

Software

Rdd does not make plots itself. Rdd produces files that contain the information to generate plots from. The scripts plot-entropy.py and plot-md5.py produce the plots. These scripts are written in the Python scripting language. You can freely download Python and view the documentation on Python here.

Both scripts use Gnuplot to draw the plot. You must have Gnuplot installed to draw the plots. You can freely download Gnuplot and view the documentation on Gnuplot here.

Making an entropy plot

The plot-entropy script builds a plot of the entropy of all blocks that are read by rdd. The plot is displayed or saved as a PNG graphics file. To let the script display the plot you need to have a running X-window environment.

The usage of plot-entropy: plot-entropy <options> infile [lo hi]

  • infile: This is the input file, the file rdd generated.
  • lo: This is the first block of the optional range of blocks to be plotted.
  • hi: This is the last block of the optional range of blocks to be plotted.

The options:

  • -o: The PNG output file. If an output file is given, the script will not try to draw the plot on the screen.
  • -t: This will be the title of the plot. This not the filename of the PNG file.
  • -b: This is the blocksize rdd used to calculate the entropy on a block. The script needs this blocksize to correctly print the locations of the blocks of which the entropies are calculated.
  • -x: This is the name of an optional file that contains a list of blocks that must not be plotted.

An example:

# rdd-copy -h 32768 -H entropy.txt
# plot-entropy -o entropy-plot.png -t "Entropy plot of suspect's harddisk" -b 32768 entropy.txt

This will make a PNG file with a plot of all blocks rdd read. The title will be "Entropy plot of suspect's harddisk". We specify that rdd used a blocksize of 32768 bytes.

Making an MD5 plot

Making an MD5 plot is very similar to making an entropy plot, although the script has fewer options. Please refer to 'Making an entropy plot'.

Interpreting the plots

The entropy plot is straightforward. The X axis covers all blocks in the image. The Y axis covers the entropy values. The entropy ranges from 0 to 8, where 8 stands for high entropy and 0 stands for low entropy. Every block of which the entropy has been calculated is plotted with a '+' symbol.

link to an entropy plot
Figure 1: An entropy plot

This is an example of an entropy plot. The first 0.17 GB contains data with various entropy levels. This indicates lots of different types of data. The rest of the disk contains data with a very high entropy. This could be a crypto container or a heavily compressed file.

Correctly interpreting the block-MD5 plot is more difficult. In the block-MD5 plot the X axis covers the number of unique MD5 hash values of blocks. The Y axis covers the number of blocks that are covered by a single hash value. The Y axis is cummulative, which means every new value is added to the values that are already processed.

link to a block-MD5 plot
Figure 2: A block-MD5 plot

This is an example of a block-MD5 plot. The plot consists roughly of 2 straight lines. The left line shows that approximately 4900 different MD5 hash values on the X axis are used to cover approximately 4900 blocks on the Y axis. This means that all these 4900 blocks from the image have a different MD5 hash value. From (4900, 4900) on the line goes straight up. This line tells us that only 8 MD5 hash values are used to cover appox. 47000 blocks (52000 - 4900). This means that these 47000 blocks contain a lot of duplicated information. The block-MD5 plot is a cumulative plot and gives no information on the locations of the plotted blocks on the evidence material.

Both plots are actually from the same harddisk drive. By looking only to the entropy plot you might assume that you are dealing with some kind of crypto container or a large, heavily compressed file. By combining both plots you see that the blocks of the disk with a high entropy are covered by just 8 blocks. You might want to put your effort in the other part of the harddisk drive first.

The plots are meant to give an indication on the type of data on a disk. They are not intended to be used as a strict rule out mechanism to limit the amount of data to process. A low entropy does not guarantee that there is no important evidence nor does a high entropy guarantee data worth a deeper investigation.

rdd-2.0.7/gui/html/entropy-example-small.png010064400000000000000000000036371042173111100176460ustar00rootwheel‰PNG  IHDR@ðFóMY)PLTEÿÿÿ   ÿÀ€ÿÀÿÀÿ@À@@ÿ€ À€À`€€€@€€À`ÀÀÿ € 0`€@@@@€€€`€`€``€`€Àÿ`@À€` À`À`À €€€` €```ÿÿ @@ @€`€ `€``€€€€@€€€    ÐàÀ À`€ÀàÀ`ÀÀ€À€`ÿ@ÿ@@€Àÿÿ€`ÿ€€À ÀÀÀÀÿÀÿÿÿÿ€ ÿ€ÿÀÀ ÿ``ÿ€ÿ €àà àà ÿ ÀÀÀ    ÿ€ € €@€@ €@€€`À€`ÿ€€ €ÿÀ`€ÀÀÿ€@ÿ @ÿ `ÿ pÿÀ ÿÀÀÿÿÿÿ€ÿÿÀÀ7³bKGDˆH pHYs  ÒÝ~ütIMEÔ  9€côÐüIDATxœí‹’ã( Eqñÿÿ¼; ñ²%È4Í䜮š$v:¥¾#²ãläÚmÀá\=}ø÷ÿŸ¯áƒ†Üû÷ü8³ý¼p»×Ç}à“¿‰$Õ'ÿk¾‰àuεÓÞnÓÎ@¨…Îðö¿?j1‚çzànÃN!Daß$1» ;„ì|8ETÊÇ aA)1 :ô3ÔÊ9ùánËN!ú^È b >>Tꡟ’$T‘¢Ÿš$”P)PO­bàDLTs ™ _aGž¦.Éì¶ç,|QReÔSW²^{rä1j¢«•" Ÿ–Ãiè2j¸®×¾fR@€€z|ºUVb‚"øÆ§¨¦Ì£úY‰i³Œ\­i¡^Š8áðLÍ5¢ Ž*–÷±ƒŒ€#ªMµÉÕ„=Ö@#`Ž»åí·Xw¾hjsøD]a­¢°#¹§÷­Ì¹–@óÈUWù«ëPÐHŽõçnË~'íöùëœÃŸhl.h¤È "ò—9ˆ –ðž«~šÆmu± þ¡íLhŽdtxài;rÝ•Hq±aX#aŸ^³‘(b¥|'´á³€Œâ{Ú†·Ü˜ðrEÊ1·t†pÝVgß7î:-—Y@¹¹„€Z¤~r‡{\Í öbJ„–VÀ°d§Ë‰5hðµ€qE·×¬ƒHßåš߇A‡X;QÙ-y7=z Ãÿ,Ä–“âƒjâò£ìÊB?=1mÉ=ªŽeˆjK È(’\p³MG<ÏÅKåÞ‘ÐFÑR‰x6Òàub5 Šåí½ZÂ]U½Ê2¡5áºÄBŽZtâž ²Á‰´´ä$¹)·Ûªƒæ™ µäB~^ͽlµê$|©'4"ö3Å2Õ” “ ™Tǃ˜lЀ3ŸÀè§%ßòDÉzXMP¯Ú\=!¿7ÖeMk·agáËU0êÉ"ñj°ác«¯86 Ɉ&vÊúé«_ÏNÊ™©bMáGÅ„=æHÊZD5 ” 8Q^¹­²<„-ÏjK½yCŠMc±­¹ÉœÓho ãÐBh[@¯Ï”‹ à *¡¶“ƒ 8´àÙY$%Ðù ºJ]ÆBK3Ýú2ª© Z©ë|ŸE§Ñz ©´šœÃÔ"  º*W¡"=Mëx¨Ç0Öàÿ5âe"4vÌ“{ÊsÐÓ¶@×éðDrcÅ&ˆÛÂtMrs;Ð@cÂGà>1kÈ+ r„ƒ_. zˆ+ Þ”¡WaW¾¾½~x ÀÑôÛ~ÜŒÓÈûÂ=Yâ=ÑûºõLyû“A aÛ•¤ýî]¾ûT÷»½óý÷¢Ÿù^@Wô]"`Z;þ¦B퇬œžÿå§¾ªÇÁùáÇh ¿ýÖ›ôž§7¬ýþíyűپE÷¹Þ³øÇ}äüß´à®úÙ5:_{Ц_C"¤WIGùòÊùÕ^¡Þ›G/ù*ŸÃáËùÜt)7Þ´ÏçIEND®B`‚rdd-2.0.7/gui/html/md5-example-small.png010064400000000000000000000017501042173111100166250ustar00rootwheel‰PNG  IHDR@ðFóMY)PLTEÿÿÿ   ÿÀ€ÿÀÿÀÿ@À@@ÿ€ À€À`€€€@€€À`ÀÀÿ € 0`€@@@@€€€`€`€``€`€Àÿ`@À€` À`À`À €€€` €```ÿÿ @@ @€`€ `€``€€€€@€€€    ÐàÀ À`€ÀàÀ`ÀÀ€À€`ÿ@ÿ@@€Àÿÿ€`ÿ€€À ÀÀÀÀÿÀÿÿÿÿ€ ÿ€ÿÀÀ ÿ``ÿ€ÿ €àà àà ÿ ÀÀÀ    ÿ€ € €@€@ €@€€`À€`ÿ€€ €ÿÀ`€ÀÀÿ€@ÿ @ÿ `ÿ pÿÀ ÿÀÀÿÿÿÿ€ÿÿÀÀ7³bKGDˆH pHYs  ÒÝ~ütIMEÔ  :&FªæEIDATxœíÝNê0†á5»ÿ{>G'bÇÚéÏãbKyíä'[&*ÿ¿Êå†&eùV> .Z\·»ðñ;÷¸§´Â{÷ƒ=çàÛ͸w3^Ü<Á‹€?RN›r±¡ÅR®ü²a±šãzê™ôCÀAX„6eÚ~§¯¶,BË/Âûç-/ƒ™€W¤§ôc(^›c8ãeLJ?ºyÉø@5¥C9„C-šZŠY„v…Eh.y’ ¼±âo cyÇÁLÀŒC8¥ƒ™‚ ‹K0˜·Â‡pHÀ&þŸHH@à˜¾—®´‚eŸëTlT¦Ÿ iò¹Š¯C~ò‘~H@àù¼ 0$`HÀ€!C† 0$`èNÀ¯5T-Zµ- Eh«æõfà=þ† 0$`HÀ€!C† 0$`HÀ€‰ùÃèA¼ ùÊèѼ€yÍèÁíÑj0ånm &ÙÙÖ`Š}¬•`k$X#Á ÖH°F‚5ÚL±ÁýY°ÎêÞCöø½“§Í°C\N°|î!yô€Øë;q†/@ídýR¿¹ToY»iª_p纞»­ ¤TÜʃ®ª_Q½Œäêr“í7•ú¥)+w›ºîv*QÙcýÁµ_;ÓúkŸV»½3°ón÷.x©ÏÀÞ=À”ó‹ ú•۟ί$Øàœ©Ü¾6“·÷NB £õ¦IEND®B`‚rdd-2.0.7/gui/imageorverifywizwin.c010064400000000000000000000043641042173111100162170ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "rdd.h" #include "rddgui.h" static void imageorverify_init(RDD_WIZWIN *ww) { const char *verify = "radVerify"; ww->help = "rddgui.html#imageorverify"; rddgui_widgets_set_sensitive(ww, &verify, 1, FALSE); rddgui_focus(ww, "butNext"); } static int imageorverify_next(RDD_WIZWIN *ww) { ww->next = 0; if (rddgui_radio_selected(ww, "radMake")) { ww->next = rddgui_input_win; return 1; } else if (rddgui_radio_selected(ww, "radVerify")) { rddgui_warn(GTK_WINDOW(ww->window), "verification not yet implemented"); return 0; } return 0; } RDD_WIZWIN_OPS rddgui_imageorverify_ops = { imageorverify_init, imageorverify_next, 0 }; rdd-2.0.7/gui/confirmationwizwin.c010064400000000000000000000165311042173111100160360ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "rdd.h" #include "rddgui.h" static void set_values(RDD_WIZWIN *ww); static void confirmation_dialog_shown(GtkWidget *widget, gpointer data) { set_values((RDD_WIZWIN *) data); } static void confirmation_init(RDD_WIZWIN *ww) { set_values(ww); ww->help = "rddgui.html#confirmation"; rddgui_focus(ww, "butFinish"); glade_xml_signal_connect_data(ww->xml, "on_dlgConfirmation_show", G_CALLBACK(confirmation_dialog_shown), ww); } static int confirmation_next(RDD_WIZWIN *ww) { ww->next = 0; return 1; } RDD_WIZWIN_OPS rddgui_confirmation_ops = { confirmation_init, confirmation_next, 0 }; static void set_label_text(GladeXML *xml, const char *name, const char *fmt, ...) { va_list ap; GtkWidget *label; char textbuf[128]; va_start(ap, fmt); vsnprintf(textbuf, sizeof textbuf, fmt, ap); textbuf[(sizeof textbuf) - 1] = '\000'; va_end(ap); label = glade_xml_get_widget(xml, name); gtk_label_set_text(GTK_LABEL(label), textbuf); } static void set_sensitive(RDD_WIZWIN *ww, const char *name, int sensitive) { GtkWidget *widget; widget = glade_xml_get_widget(ww->xml, name); gtk_widget_set_sensitive(widget, sensitive ? TRUE : FALSE); } static void set_na_label(RDD_WIZWIN *ww, char *label) { set_label_text(ww->xml, label, "N/A"); set_sensitive(ww, label, 0); } static void set_path_label(RDD_WIZWIN *ww, char *label, char *path) { if (path != 0) { set_label_text(ww->xml, label, "%s", path); set_sensitive(ww, label, 1); } else { set_na_label(ww, label); } } static void set_bool_label(RDD_WIZWIN *ww, char *label, int val) { set_label_text(ww->xml, label, "%s", val ? "yes" : "no"); } static void hide_widget(RDD_WIZWIN *ww, const char *name) { GtkWidget *widget; widget = glade_xml_get_widget(ww->xml, name); gtk_widget_hide(widget); } static void set_values(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; /* Input options */ set_path_label(ww, "lblInput", opts->input_path); set_label_text(ww->xml, "lblInputSize", "%lld", opts->input_size); set_label_text(ww->xml, "lblRead", "%lld", opts->count); set_label_text(ww->xml, "lblBlockSize", "%lld", opts->block_size); set_label_text(ww->xml, "lblOffset", "%lld", opts->offset); /* Output options */ set_path_label(ww, "lblOutput", opts->output_path); set_path_label(ww, "lblLogfile", opts->log_path); if (opts->split_output) { set_label_text(ww->xml, "lblSegmentSize", "%lld", opts->split_size); set_sensitive(ww, "lblSegmentSize", 1); set_sensitive(ww, "lblSegmentSizeBytes", 1); } else { set_na_label(ww, "lblSegmentSize"); hide_widget(ww, "lblSegmentSizeBytes"); } /* Integrity options */ set_bool_label(ww, "lblMD5", opts->md5_stream_filter); set_bool_label(ww, "lblSHA1", opts->sha1_stream_filter); if (opts->enable_adler32) { set_label_text(ww->xml, "lblAdlerBlockSize", "%lld", opts->adler32_block_size); set_sensitive(ww, "lblAdlerBlockSize", 1); set_sensitive(ww, "lblAdlerBlockSizeBytes", 1); set_path_label(ww, "lblAdlerFile", opts->adler32_path); } else { set_na_label(ww, "lblAdlerBlockSize"); hide_widget(ww, "lblAdlerBlockSizeBytes"); set_na_label(ww, "lblAdlerFile"); } if (opts->enable_crc32) { set_label_text(ww->xml, "lblCRCBlockSize", "%lld", opts->crc32_block_size); set_sensitive(ww, "lblCRCBlockSize", 1); set_sensitive(ww, "lblCRCBlockSizeBytes", 1); set_path_label(ww, "lblCRCFile", opts->crc32_path); set_sensitive(ww, "lblCRCFile", 1); } else { set_na_label(ww, "lblCRCBlockSize"); hide_widget(ww, "lblCRCBlockSizeBytes"); set_na_label(ww, "lblCRCFile"); } /* Recovery options */ if (opts->enable_recovery) { set_label_text(ww->xml, "lblRetryBlockSize", "%lld", opts->retry_block_size); set_sensitive(ww, "lblRetryBlockSize", 1); set_sensitive(ww, "lblRetryBlockSizeBytes", 1); set_label_text(ww->xml, "lblDrop", "%u", opts->max_retry_count); set_sensitive(ww, "lblDrop", 1); set_sensitive(ww, "lblDropRetries", 1); set_sensitive(ww, "lblGiveUp", 1); set_sensitive(ww, "lblGiveUpBlocks", 1); if (opts->never_give_up) { set_label_text(ww->xml, "lblGiveUpLabel", "Give up:"); set_label_text(ww->xml, "lblGiveUp", "never"); set_label_text(ww->xml, "lblGiveUpBlocks", ""); } else { set_label_text(ww->xml, "lblGiveUpLabel", "Give up after:"); set_label_text(ww->xml, "lblGiveUp", "%u", opts->max_drop_count); set_label_text(ww->xml, "lblGiveUpBlocks", "blocks dropped"); } } else { set_na_label(ww, "lblRetryBlockSize"); hide_widget(ww, "lblRetryBlockSizeBytes"); set_na_label(ww, "lblDrop"); hide_widget(ww, "lblDropRetries"); set_label_text(ww->xml, "lblGiveUpLabel", "Give up after:"); set_na_label(ww, "lblGiveUp"); hide_widget(ww, "lblGiveUpBlocks"); } /* Statistical options */ if (opts->enable_stats) { if (opts->enable_entropy) { set_label_text(ww->xml, "lblEntropyBlockSize", "%lld", opts->entropy_block_size); set_sensitive(ww, "lblEntropyBlockSize", 1); set_path_label(ww, "lblEntropyFile", opts->entropy_path); } else { set_na_label(ww, "lblEntropyBlockSize"); hide_widget(ww, "lblEntropyBlockSizeBytes"); set_na_label(ww, "lblEntropyFile"); } if (opts->enable_blockmd5) { set_label_text(ww->xml, "lblBlockMD5BlockSize", "%lld", opts->blockmd5_block_size); set_sensitive(ww, "lblBlockMD5BlockSize", 1); set_path_label(ww, "lblBlockMD5File", opts->blockmd5_path); } else { set_na_label(ww, "lblBlockMD5BlockSize"); hide_widget(ww, "lblBlockMD5BlockSizeBytes"); set_na_label(ww, "lblBlockMD5File"); } } else { set_na_label(ww, "lblEntropyBlockSize"); hide_widget(ww, "lblEntropyBlockSizeBytes"); set_na_label(ww, "lblEntropyFile"); set_na_label(ww, "lblBlockMD5BlockSize"); hide_widget(ww, "lblBlockMD5BlockSizeBytes"); set_na_label(ww, "lblBlockMD5File"); } } rdd-2.0.7/gui/simple-dialog.gladep010064400000000000000000000004371042173111100156340ustar00rootwheel simple-dialog simple-dialog FALSE rdd-2.0.7/gui/networkwizwin.c010064400000000000000000000043441042173111100150360ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "rdd.h" #include "rddgui.h" static int network_next(RDD_WIZWIN *ww) { ww->next = 0; if (rddgui_radio_selected(ww, "radLocal")) { ww->opts->mode = RDDGUI_LOCAL; ww->next = rddgui_input_win; return 1; } else if (rddgui_radio_selected(ww, "radClient")) { ww->opts->mode = RDDGUI_CLIENT; rddgui_warn(GTK_WINDOW(ww->window), "client mode not yet implemented"); return 0; } else if (rddgui_radio_selected(ww, "radServer")) { ww->opts->mode = RDDGUI_SERVER; rddgui_warn(GTK_WINDOW(ww->window), "server mode not yet implemented"); } return 0; } RDD_WIZWIN_OPS rddgui_network_ops = { 0, network_next, 0 }; rdd-2.0.7/gui/inputadvwizwin.c010064400000000000000000000071561042173111100152030ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "rdd.h" #include "rdd_internals.h" #include "rddgui.h" /** \brief Disables the split size input widgets when the user * indicates that he wants his output in a single file. */ static gboolean allbytes_toggled(GtkWidget *wdgt, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; static const char *names[] = {"entBytesToRead", "cboBytesToRead"}; rddgui_widgets_set_sensitive(ww, names, (sizeof names)/sizeof(char*), FALSE); return TRUE; } /** \brief Enables the split size input widgets when the user * indicates that he wants to split his output. */ static gboolean bytestoread_toggled(GtkWidget *wdgt, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; static const char *names[] = {"entBytesToRead", "cboBytesToRead"}; rddgui_widgets_set_sensitive(ww, names, (sizeof names)/sizeof(char*), TRUE); return TRUE; } static void inputadv_init(RDD_WIZWIN *ww) { ww->help = "rddgui.html#input-advanced"; glade_xml_signal_connect_data(ww->xml, "on_radAllBytes_toggled", G_CALLBACK(allbytes_toggled), ww); glade_xml_signal_connect_data(ww->xml, "on_radBytesToRead_toggled", G_CALLBACK(bytestoread_toggled), ww); rddgui_radio_select(ww, "radAllBytes"); rddgui_set_multnum(ww, ww->opts->block_size, "entBlocksize", "cboBlocksize"); } int inputadv_next(RDD_WIZWIN *ww) { int rc = RDD_OK; /* How much should we read? */ if (rddgui_radio_selected(ww, "radBytesToRead")) { rc = rddgui_get_multnum(ww, "bytes to read", "entBytesToRead", "cboBytesToRead", &ww->opts->count); if (rc != RDD_OK) { return 0; } } else { ww->opts->count = RDD_WHOLE_FILE; } /* Block size. */ rc = rddgui_get_multnum(ww, "block size", "entBlocksize", "cboBlocksize", &ww->opts->block_size); if (rc != RDD_OK) { return 0; } /* Offset. */ rc = rddgui_get_multnum(ww, "offset", "entOffset", "cboOffset", &ww->opts->offset); if (rc != RDD_OK) { return 0; } ww->next = 0; return 1; } RDD_WIZWIN_OPS rddgui_inputadv_ops = { inputadv_init, inputadv_next, 0 }; rdd-2.0.7/gui/init.c010064400000000000000000000101761042173111100130400ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rdd.h" #include "rddgui.h" #define RDDGUI_DUMMY int #define CREATE_WIZWIN(varname, gladename, winstatetype) \ do { \ int __rc = rdd_new_wizwin(&rddgui_##varname##_win, \ rddgui_xml_path, \ #gladename, \ &rddgui_options, \ &rddgui_##varname##_ops, \ sizeof(RDDGUI_##winstatetype)); \ if (__rc != RDD_OK) return __rc; \ } while (0) RDDGUI_OPTS rddgui_options; #define RDD_DECL_WIN(varname) \ RDD_WIZWIN *rddgui_##varname##_win; RDD_DECL_WIN(imageorverify) RDD_DECL_WIN(network) RDD_DECL_WIN(input) RDD_DECL_WIN(inputadv) RDD_DECL_WIN(output) RDD_DECL_WIN(outputadv) RDD_DECL_WIN(integrity) RDD_DECL_WIN(integrityadv) RDD_DECL_WIN(recovery) RDD_DECL_WIN(recoveryadv) RDD_DECL_WIN(stats) RDD_DECL_WIN(statsadv) RDD_DECL_WIN(confirmation) RDD_DECL_WIN(client) RDD_DECL_WIN(server) RDD_DECL_WIN(serveradv) char *rddgui_xml_path; static void init_options(void) { memset(&rddgui_options, 0, sizeof rddgui_options); rddgui_options.mode = RDDGUI_LOCAL; rddgui_options.offset = 0; rddgui_options.count = RDD_WHOLE_FILE; rddgui_options.input_size = RDD_WHOLE_FILE; rddgui_options.split_output = 0; rddgui_options.split_size = 0; rddgui_options.block_size = 128 * 1024; rddgui_options.enable_recovery = 1; rddgui_options.retry_block_size = 512; rddgui_options.max_retry_count = 2; rddgui_options.enable_stats = 1; rddgui_options.never_give_up = 1; } static int init_windows(void) { /* Initialization order is important! One window may * refer to another window at initialization time. * If window A is referenced by window B at init time * then A must be created first. */ CREATE_WIZWIN(imageorverify, dlgImageOrVerify, DUMMY); CREATE_WIZWIN(network, dlgNetwork, DUMMY); CREATE_WIZWIN(inputadv, dlgInputAdv, DUMMY); CREATE_WIZWIN(input, dlgInput, DUMMY); CREATE_WIZWIN(outputadv, dlgOutputAdv, DUMMY); CREATE_WIZWIN(output, dlgOutput, DUMMY); CREATE_WIZWIN(integrityadv, dlgIntegrityAdv, DUMMY); CREATE_WIZWIN(integrity, dlgIntegrity, DUMMY); CREATE_WIZWIN(recoveryadv, dlgErrorRecoveryAdv, DUMMY); CREATE_WIZWIN(recovery, dlgErrorRecovery, DUMMY); CREATE_WIZWIN(statsadv, dlgStatisticsAdv, DUMMY); CREATE_WIZWIN(stats, dlgStatistics, DUMMY); CREATE_WIZWIN(confirmation, dlgConfirmation, DUMMY); return RDD_OK; } int rddgui_init(void) { char *xmlpath; int rc; xmlpath = getenv("RDDGUI_XML_PATH"); rddgui_xml_path = (xmlpath != 0 ? xmlpath : RDDGUI_GLADE_XML_PATH); init_options(); if ((rc = init_windows()) != RDD_OK) { return rc; } return RDD_OK; } rdd-2.0.7/gui/recoverywizwin.c010064400000000000000000000123411042173111100151770ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rdd.h" #include "rdd_internals.h" #include "numparser.h" #include "rddgui.h" static int get_advanced(RDD_WIZWIN *ww); static gboolean yes_toggled(GtkWidget *w, gpointer data) { GtkWidget *advanced_button = (GtkWidget *) data; gtk_widget_set_sensitive(advanced_button, TRUE); return TRUE; } static gboolean no_toggled(GtkWidget *w, gpointer data) { GtkWidget *advanced_button = (GtkWidget *) data; gtk_widget_set_sensitive(advanced_button, FALSE); return TRUE; } static void recovery_init(RDD_WIZWIN *ww) { GtkWidget *advanced_button = 0; ww->help = "rddgui.html#error-recovery"; ww->advanced = rddgui_recoveryadv_win; advanced_button = glade_xml_get_widget(ww->xml, "butAdvanced"); glade_xml_signal_connect_data(ww->xml, "on_radYes_toggled", G_CALLBACK(yes_toggled), advanced_button); glade_xml_signal_connect_data(ww->xml, "on_radNo_toggled", G_CALLBACK(no_toggled), advanced_button); rddgui_focus(ww, "butNext"); } static int recovery_next(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; if (rddgui_radio_selected(ww, "radYes")) { opts->enable_recovery = 1; } else if (rddgui_radio_selected(ww, "radNo")) { opts->enable_recovery = 0; } else { rddgui_fatal(0, "No selected value for radio button"); } /* Ignore the data in the advanced window if we're not * doing error recovery */ if (opts->enable_recovery == 1) { if (! get_advanced(ww->advanced)) { return 0; } } ww->next = rddgui_stats_win; return 1; } static void recovery_advanced(RDD_WIZWIN *ww) { ww->advanced = rddgui_recoveryadv_win; } RDD_WIZWIN_OPS rddgui_recovery_ops = { recovery_init, recovery_next, recovery_advanced }; static gboolean giveup_toggled(GtkWidget *widget, gpointer data) { GtkWidget *entry = (GtkWidget *) data; gtk_widget_set_sensitive(entry, TRUE); return TRUE; } static gboolean never_toggled(GtkWidget *widget, gpointer data) { GtkWidget *entry = (GtkWidget *) data; gtk_widget_set_sensitive(entry, FALSE); return TRUE; } static void recoveryadv_init(RDD_WIZWIN *ww) { GtkWidget *giveup_entry = 0; rddgui_radio_select(ww, "radNever"); ww->help = "rddgui.html#error-recovery-advanced"; ww->advanced = 0; rddgui_set_multnum(ww, ww->opts->retry_block_size, "entRetryBlocksize", "cboRetryBlocksize"); rddgui_set_uint(ww, "entDrop", ww->opts->max_retry_count); giveup_entry = glade_xml_get_widget(ww->xml, "entGiveUp"); gtk_widget_set_sensitive(giveup_entry, FALSE); glade_xml_signal_connect_data(ww->xml, "on_radGiveUp_toggled", G_CALLBACK(giveup_toggled), giveup_entry); glade_xml_signal_connect_data(ww->xml, "on_radNever_toggled", G_CALLBACK(never_toggled), giveup_entry); } static int get_advanced(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; int rc; rc = rddgui_get_multnum(ww, "retry block size", "entRetryBlocksize", "cboRetryBlocksize", &opts->retry_block_size); if (rc != RDD_OK) { return 0; } rc = rddgui_get_uint(ww, "maximum retry count", "entDrop", &opts->max_retry_count); if (rc != RDD_OK) { return 0; } if (rddgui_radio_selected(ww, "radNever")) { opts->never_give_up = 1; opts->max_drop_count = 0; } else { opts->never_give_up = 0; rc = rddgui_get_uint(ww, "maximum drop count", "entGiveUp", &opts->max_drop_count); if (rc != RDD_OK) { return 0; } if (opts->max_drop_count == 0) { rddgui_error(GTK_WINDOW(ww->window), "Drop count must be greater than zero."); return 0; } } return 1; } static int recoveryadv_next(RDD_WIZWIN *ww) { ww->next = 0; return get_advanced(ww); } RDD_WIZWIN_OPS rddgui_recoveryadv_ops = { recoveryadv_init, recoveryadv_next, 0 }; rdd-2.0.7/gui/inputwizwin.c010064400000000000000000000106421042173111100145020ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "rddgui.h" static void input_init(RDD_WIZWIN *ww) { ww->help = "rddgui.html#input"; ww->advanced = rddgui_inputadv_win; } static int input_next(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; struct stat pathinfo; rdd_count_t devsize; char *path = 0; int rc = RDD_OK; int fd = -1; if (opts->input_path != 0) { free(opts->input_path); opts->input_path = 0; } ww->next = 0; opts->input_path = path = rddgui_get_text(ww, "entDevice", 1); /* Did the user select an input file at all? */ if (path == 0 || strlen(path) == 0) { rddgui_error(GTK_WINDOW(ww->window), "No input file specified"); return 0; } if (stat(path, &pathinfo) < 0) { rddgui_error(GTK_WINDOW(ww->window), "Bad input path %s", path); return 0; } if (S_ISDIR(pathinfo.st_mode)) { rddgui_error(GTK_WINDOW(ww->window), "%s is a directory", path); return 0; } /* Can we open the path for reading? */ if ((fd = open(path, O_RDONLY)) < 0) { rddgui_error(GTK_WINDOW(ww->window), "Cannot open %s", path); return 0; } (void) close(fd); /* Obtain the file/device size. */ rc = rdd_device_size(path, &devsize); if (rc != RDD_OK) { rddgui_error(GTK_WINDOW(ww->window), "Cannot compute size of %s", path); return 0; } opts->input_size = devsize; /* Process the data in the advanced window. RDD-GUI can be run twice * without the user opening and closing the advanced window. */ (ww->advanced->ops->next)(ww->advanced); /* Process the offset option. If the user did not set * this option explicitly then its value should be 0. */ if (opts->offset > devsize) { rddgui_error(GTK_WINDOW(ww->window), "Offset %llu exceeds input size ( %s )", opts->offset, rdd_strsize(devsize)); return 0; } /* Process the count option. If the user did not set * this option explicitly then its value should be RDD_WHOLE_FILE. */ if ( (opts->count != RDD_WHOLE_FILE) && ((opts->offset + opts->count) > devsize)) { rdd_count_t total = opts->offset + opts->count; rddgui_error(GTK_WINDOW(ww->window), "Illegal offset/byte-count ( %llu and %llu ) " "combination. The offset and the bytes to read " "together exceed the input size ( %llu to %s )", opts->offset, opts->count, total, rdd_strsize(devsize)); return 0; } /* Update the count option to reflect our knowledge of the * size of the input file/device. */ if (devsize != RDD_WHOLE_FILE && opts->count == RDD_WHOLE_FILE) { opts->count = devsize - opts->offset; } ww->next = rddgui_output_win; return 1; } static void input_advanced(RDD_WIZWIN *ww) { ww->advanced = rddgui_inputadv_win; } RDD_WIZWIN_OPS rddgui_input_ops = { input_init, input_next, input_advanced }; rdd-2.0.7/gui/finishedwin.c010064400000000000000000000112561042173111100144040ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "rdd.h" #include "rddgui.h" static gboolean help_clicked(GtkWidget *widget, gpointer data) { RDDGUI_FINISHEDWIN *win = (RDDGUI_FINISHEDWIN *) data; win->action = RDDGUI_FINISH_HELP; return TRUE; } static gboolean exit_clicked(GtkWidget *widget, gpointer data) { RDDGUI_FINISHEDWIN *win = (RDDGUI_FINISHEDWIN *) data; win->action = RDDGUI_FINISH_EXIT; return TRUE; } static gboolean new_clicked(GtkWidget *widget, gpointer data) { RDDGUI_FINISHEDWIN *win = (RDDGUI_FINISHEDWIN *) data; win->action = RDDGUI_FINISH_NEW; return TRUE; } static gboolean logfile_clicked(GtkWidget *widget, gpointer data) { RDDGUI_FINISHEDWIN *win = (RDDGUI_FINISHEDWIN *) data; win->action = RDDGUI_FINISH_LOGFILE; return TRUE; } static void set_label_text(GladeXML *xml, const char *name, const char *fmt, ...) { va_list ap; GtkWidget *label; char textbuf[128]; va_start(ap, fmt); vsnprintf(textbuf, sizeof textbuf, fmt, ap); textbuf[(sizeof textbuf) - 1] = '\000'; va_end(ap); label = glade_xml_get_widget(xml, name); gtk_label_set_text(GTK_LABEL(label), textbuf); } RDDGUI_FINISHEDWIN * rddgui_create_finished_window(RDDGUI_IMGSTATS *stats) { RDDGUI_FINISHEDWIN *win = 0; GtkWidget *exit_button = 0; if ((win = calloc(1, sizeof(RDDGUI_FINISHEDWIN))) == 0) { rddgui_fatal(0, "out of memory"); } win->xml = glade_xml_new(rddgui_xml_path, "dlgFinishedImaging", NULL); win->win = glade_xml_get_widget(win->xml, "dlgFinishedImaging"); gtk_widget_hide_all(win->win); /* Display elapsed times. */ set_label_text(win->xml, "lblShowTime", "%uh %um %us", stats->elapsed / 3600, /* hours */ (stats->elapsed % 3600) / 60, /* minutes */ stats->elapsed % 60); /* seconds */ /* Display error statistics. */ set_label_text(win->xml, "lblShowErrors", "%llu", stats->nreaderr); set_label_text(win->xml, "lblShowSubstBlocks", "%llu", stats->nsubst); set_label_text(win->xml, "lblShowSubstBytes", "%llu", stats->bytes_dropped); /* Display hash values. */ set_label_text(win->xml, "lblShowMD5", "%s", stats->md5); set_label_text(win->xml, "lblShowSHA1", "%s", stats->sha1); /* Connect signals. */ glade_xml_signal_connect_data(win->xml, "on_butHelp_clicked", G_CALLBACK(help_clicked), win); glade_xml_signal_connect_data(win->xml, "on_butExit_clicked", G_CALLBACK(exit_clicked), win); glade_xml_signal_connect_data(win->xml, "on_butNew_clicked", G_CALLBACK(new_clicked), win); glade_xml_signal_connect_data(win->xml, "on_butLogfile_clicked", G_CALLBACK(logfile_clicked), win); exit_button = glade_xml_get_widget(win->xml, "butExit"); gtk_widget_grab_focus(exit_button); return win; } rddgui_finish_action_t rddgui_run_finished_window(RDDGUI_FINISHEDWIN *win) { gboolean quit; win->action = RDDGUI_FINISH_NONE; gtk_widget_show_all(win->win); while (win->action == RDDGUI_FINISH_NONE) { quit = gtk_main_iteration_do(TRUE); } return win->action; } void rddgui_destroy_finished_window(RDDGUI_FINISHEDWIN *win) { gtk_widget_destroy(win->win); free(win); } rdd-2.0.7/gui/rddgui.glade010064400000000000000000022771701042173111100142200ustar00rootwheel Input GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 6 4 False 0 0 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 3 4 10 fill True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-preferences 4 0.5 0.5 0 0 0 False False True _Advanced True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 4 5 10 10 fill True I want to image this file or device False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 3 2 3 10 fill True True True True True 256 /dev/ True * False 50 2 3 3 4 10 0 1 0 6 10 10 fill 0 True True Output GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 7 4 False 0 0 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 3 4 10 fill True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 5 6 10 fill True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-preferences 4 0.5 0.5 0 0 0 False False True _Advanced True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 6 7 10 10 fill 0 1 0 7 10 10 fill True True True True 256 True * False 50 2 3 3 4 10 True True True True 256 True * False 50 2 3 5 6 10 True Output image False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 3 2 3 10 fill True Logfile False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 3 4 5 10 fill 0 True True Confirmation GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 305 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-ok 4 0.5 0.5 0 0 0 False False True _Finish True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 31 4 False 0 0 0 1 0 30 10 10 True Input size: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True Read: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True Block size: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 5 6 10 fill True Offset: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 6 7 10 fill True Segment size: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 10 11 10 fill True MD5: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 12 13 10 fill True SHA-1: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 13 14 10 fill True Adler-32 block size: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 15 16 10 fill True CRC-32 block size: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 18 19 10 fill True Retry block size: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 21 22 10 fill True Drop block after: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 22 23 10 fill True Give up after: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 23 24 10 fill True Entropy block size: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 25 26 10 fill True Block MD5 block size: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 28 29 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 3 4 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 4 5 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 5 6 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 6 7 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 10 11 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 12 13 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 13 14 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 15 16 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 18 19 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 21 22 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 22 23 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 23 24 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 25 26 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 28 29 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 3 4 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 4 5 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 5 6 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 6 7 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 10 11 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 15 16 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 18 19 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 21 22 10 fill True retries False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 22 23 10 fill True dropped blocks False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 23 24 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 25 26 10 fill True bytes False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 28 29 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 0 1 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 1 2 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 30 31 fill True CRC-32 file: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 19 20 10 fill True Input: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 fill True Output: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 8 9 10 fill True Log file: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 9 10 10 fill True Adler-32 file: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 16 17 10 fill True Entropy file: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 26 27 10 fill True Block MD5 file: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 29 30 10 fill 32 True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 4 2 3 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 4 8 9 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 4 9 10 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 4 16 17 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 4 19 20 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 4 26 27 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 4 29 30 10 fill True 1 4 7 8 5 fill fill True 1 4 11 12 5 fill fill True 1 4 14 15 5 fill fill True 1 4 17 18 5 fill fill True 1 4 20 21 5 fill fill True 1 4 24 25 5 fill fill True 1 4 27 28 5 fill fill 0 True True Imaging GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-stop 4 0.5 0.5 0 0 0 False False True _Stop True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 9 3 False 0 0 0 1 0 9 10 10 True Read errors False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 5 6 10 fill True Zero-block substitutions False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 6 7 10 fill True Bytes substituted False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 7 8 10 fill True Imaging in local mode False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 3 2 3 10 20 fill True Progress False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True Elapsed time False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 2 3 3 4 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 4 5 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 5 6 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 6 7 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 7 8 fill 0 True True Finished imaging GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-quit 4 0.5 0.5 0 0 0 False False True _Exit True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 8 3 False 4 0 0 1 0 8 10 10 True Blocks substituted: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True Read errors: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 fill True Elapsed time: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 1 2 10 fill True Bytes substituted: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True MD5: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 5 6 10 fill True SHA-1: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 6 7 10 fill True False 0 True GTK_BUTTONBOX_DEFAULT_STYLE 5 True False True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-dnd 4 0.5 0.5 0 0 0 False False True _Show logfile True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-goto-first 4 0.5 0.5 0 0 0 False False True _Image or verify another file or device True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 20 True True 2 3 7 8 10 fill fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 1 2 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 2 3 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 3 4 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 4 5 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 5 6 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 6 7 10 fill 0 True True rdd GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True True gtk-ok True GTK_RELIEF_NORMAL True -5 0 False True GTK_PACK_END 0 True True True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True False False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False Choose profile GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 3 3 False 0 0 0 1 0 3 10 10 True I want to image a False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 1 2 10 fill True False False False True True True True True True 0 True * False True GTK_SELECTION_BROWSE True True CD / DVD True True DVD-RAM True True flashcard True True floppy True True harddisk True True LS 120 True True MO 512 bytes / sector True True MO 1024 bytes / sector True True MO 2048 bytes / sector True True MO 4096 bytees / sector True True Other 2 3 1 2 10 0 True True Input, Advanced GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-ok 4 0.5 0.5 0 0 0 False False True _OK True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 7 4 False 0 0 True 1 4 3 4 fill fill 0 1 0 6 10 10 True True Read until end-of-file or end-of-device True GTK_RELIEF_NORMAL True False False True 1 4 1 2 10 fill True True Read True GTK_RELIEF_NORMAL True False False True radAllBytes 1 2 2 3 10 fill 100 True False True True True 24 True * False 15 2 3 2 3 10 100 True False True True False True False 100 True True False True 0 True * True True GTK_SELECTION_BROWSE True True bytes True True kB True True MB True True GB 3 4 2 3 10 True Blocksize False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True Offset False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 5 6 10 fill 100 True True True True 24 128 True * False 15 2 3 4 5 10 100 True True True True 24 0 True * False 15 2 3 5 6 10 100 True True False False True False True True False True 0 True * False True GTK_SELECTION_BROWSE True True bytes True True kB True True MB True True GB 3 4 4 5 10 100 True True False False True False True True False True 0 True * False True GTK_SELECTION_BROWSE True True bytes True True kB True True MB True True GB 3 4 5 6 10 0 True True Output, Advanced GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-ok 4 0.5 0.5 0 0 0 False False True _OK True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 3 4 False 0 0 0 1 0 3 10 10 100 True True True False True False 100 True True False True 0 True * False True GTK_SELECTION_BROWSE True True bytes True True kB True True MB True True GB 3 4 1 2 10 100 True True True True 24 True * False 15 2 3 1 2 10 True True Split the output into segments of at most True GTK_RELIEF_NORMAL True False False True 1 2 1 2 fill True True Do not split the output (single output file) True GTK_RELIEF_NORMAL True False False True radSplit 1 2 0 1 fill 0 True True Integrity GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 7 3 False 0 0 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-preferences 4 0.5 0.5 0 0 0 False False True _Advanced True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 2 3 5 6 10 10 fill True Use these hash algorithms False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 fill True True _MD5 True GTK_RELIEF_NORMAL True True False True 1 2 3 4 10 fill True True _SHA-1 True GTK_RELIEF_NORMAL True True False True 1 2 4 5 10 fill 0 1 0 7 10 10 0 True True Integrity, advanced GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-ok 4 0.5 0.5 0 0 0 False False True _OK True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 9 5 False 0 0 0 1 0 9 10 10 True False True True True 256 True * False 15 2 3 3 4 True True _Adler-32 True GTK_RELIEF_NORMAL True False False True 1 2 2 3 10 fill True Blocksize False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True File False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True False True True True 256 True * False 50 2 4 4 5 100 True False True True False True False True True False True 0 True * False True GTK_SELECTION_BROWSE True True bytes True True kB True True MB True True GB 3 5 3 4 10 True False True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 4 5 4 5 10 fill True File False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 7 8 10 fill True Blocksize False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 6 7 10 fill True False True True True 256 True * False 15 2 3 6 7 100 True False True True False True False True True False True 0 True * False True GTK_SELECTION_BROWSE True True bytes True True kB True True MB True True GB 3 5 6 7 10 True False True True True 256 True * False 50 2 4 7 8 True False True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 4 5 7 8 10 fill True True _CRC-32 True GTK_RELIEF_NORMAL True False False True 1 2 5 6 10 fill 0 True True Error recovery, Advanced GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-ok 4 0.5 0.5 0 0 0 False False True _OK True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 8 4 False 0 0 True True True True 24 512 True * False 15 2 3 2 3 True Retry blocksize False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 fill 100 True True True False True False True True False True 0 True * False True GTK_SELECTION_BROWSE True True bytes True True kB True True MB True True GB 3 4 2 3 10 True Drop block after False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True True True True 24 2 True * False 15 2 3 3 4 True retries False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 3 4 10 fill 0 1 0 7 10 10 True True True True 24 True * False 15 2 3 5 6 True 1 4 4 5 fill fill True dropped blocks False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 3 4 5 6 10 fill True True _Give up after True GTK_RELIEF_NORMAL True True False True 1 2 5 6 10 fill True True _Never give up True GTK_RELIEF_NORMAL True False False True radGiveUp 1 2 6 7 10 fill 0 True True Statistics GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 7 3 False 0 0 True Do you want to compute statistics? False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 fill True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-preferences 4 0.5 0.5 0 0 0 False False True _Advanced True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 2 3 5 6 10 fill True True Yes True GTK_RELIEF_NORMAL True True False True 1 2 3 4 10 fill True True No True GTK_RELIEF_NORMAL True False False True radYes 1 2 4 5 10 fill 0 1 0 7 10 10 0 True True Statistics, Advanced GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-ok 4 0.5 0.5 0 0 0 False False True _OK True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 9 5 False 0 0 True True _Entropy True GTK_RELIEF_NORMAL True True False True 1 2 2 3 10 fill True True True True 24 32 True * False 15 2 3 3 4 True True True True 24 32 True * False 15 2 3 6 7 100 True True True False True False True True False True 0 True * False True GTK_SELECTION_BROWSE True True bytes True True kB True True MB True True GB 3 5 3 4 10 100 True True True False True False 100 True True False True 0 True * False True GTK_SELECTION_BROWSE True True bytes True True kB True True MB True True GB 3 5 6 7 10 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 4 5 4 5 10 fill True True True True 256 True * False 50 2 4 4 5 True True True True 256 True * False 50 2 4 7 8 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 4 5 7 8 10 fill True Blocksize False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True File False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True Blocksize False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 6 7 10 fill True File False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 7 8 10 fill True True _Block-MD5 True GTK_RELIEF_NORMAL True True False True 1 2 5 6 10 fill 0 1 0 9 10 10 0 True True Make an image or verify an image? GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 6 3 False 0 0 0 1 0 6 10 10 True True _make an image True GTK_RELIEF_NORMAL True True False True 1 2 3 4 10 fill True True _verify an image True GTK_RELIEF_NORMAL True False False True radMake 1 2 4 5 10 fill True I want to False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 3 2 3 10 fill 0 True True Network GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 7 2 False 0 0 True On this computer I want to False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 fill True True _make an image and save it True GTK_RELIEF_NORMAL True True False True 1 2 3 4 10 fill True True _send an image to rdd running on another computer True GTK_RELIEF_NORMAL True False False True radLocal 1 2 4 5 10 fill True True _receive an image sent by rdd running on another computer True GTK_RELIEF_NORMAL True False False True radLocal 1 2 5 6 10 fill 0 1 0 7 10 10 0 True True Client GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 10 10 False 0 0 0 1 0 10 10 10 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-preferences 4 0.5 0.5 0 0 0 False False True _Advanced True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 9 10 8 9 10 fill True This is the computer that will be receiving the image over the network False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 10 2 3 10 fill True True True True 256 True * False 50 2 10 3 4 10 True Write logging info to this file False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 10 4 5 10 fill True True True True 256 True * False 50 2 10 5 6 10 True True _Compress data before transmitting True GTK_RELIEF_NORMAL True False False True 1 10 6 7 10 fill 0 True True Client, Advanced GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-ok 4 0.5 0.5 0 0 0 False False True _OK True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 3 3 False 0 0 0 1 0 3 10 10 True The receiving computer will be using this TCP port False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 1 2 10 fill True True True True 24 4832 True * False 15 2 3 1 2 10 0 True True Client, Waiting GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-cancel 4 0.5 0.5 0 0 0 False False True _Cancel True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 4 2 False 0 0 0 1 0 4 10 10 True Connecting to server.... False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 1 2 10 fill 250 True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 1 2 2 3 10 fill 0 True True Server GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 6 4 False 0 0 0 1 0 6 10 10 True Write logging information to this file False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 3 2 3 10 fill True True True True 256 True * False 50 2 3 3 4 10 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 3 4 10 fill True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-preferences 4 0.5 0.5 0 0 0 False False True _Advanced True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 4 5 10 fill 0 True True Server, Advanced GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-ok 4 0.5 0.5 0 0 0 False False True _OK True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 3 3 False 0 0 0 1 0 3 10 10 True Listen for incoming rdd connection on this port False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 1 2 10 fill True True True True 24 4832 True * False 15 2 3 1 2 10 0 True True Server, Waiting GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-cancel 4 0.5 0.5 0 0 0 False False True _Cancel True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 4 2 False 0 0 0 1 0 4 10 10 True Waiting for client to set up a connection.... False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 1 2 10 fill True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 1 2 2 3 10 fill 0 True True Connected to client GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-stop 4 0.5 0.5 0 0 0 False False True _Stop True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 9 3 False 0 0 True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 1 3 7 8 10 fill True Processed False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 5 6 10 fill True Connected False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 20 fill 0 1 0 9 10 10 True Elapsed time False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True Progress False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 2 3 3 4 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 4 5 10 fill 0 True True Finished receiving image GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-quit 4 0.5 0.5 0 0 0 False False True _Exit True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 6 3 False 0 0 0 1 0 6 10 10 True Total time: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True Processed: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True Finished False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 20 fill True GTK_BUTTONBOX_DEFAULT_STYLE 5 True True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-dnd 4 0.5 0.5 0 0 0 False False True _View logfile True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-goto-first 4 0.5 0.5 0 0 0 False False True _Image or verify new file or device True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 2 3 5 6 10 20 fill fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 3 4 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 4 5 10 fill 0 True True Verify an image GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 10 4 False 0 0 0 1 0 10 10 10 True Verify this image False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 3 2 3 10 fill True True True True 256 True * False 50 2 3 3 4 10 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 3 4 10 fill True Write logging information to this file False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 3 4 5 10 fill True True True True 256 True * False 50 2 3 5 6 10 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 5 6 10 fill True True _Calculate MD5 hash True GTK_RELIEF_NORMAL True True False True 1 3 6 7 10 fill True True _Calculate SHA-1 hash True GTK_RELIEF_NORMAL True True False True 1 3 7 8 10 fill True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-preferences 4 0.5 0.5 0 0 0 False False True _Advanced True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 8 9 10 fill 0 True True Verify an image, Advanced GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-ok 4 0.5 0.5 0 0 0 False False True _OK True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 7 4 False 0 0 0 1 0 7 10 10 True True True True 256 True * False 50 2 3 3 4 10 True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 3 4 10 fill True True _Use this _Adler-32 file True GTK_RELIEF_NORMAL True True False True 1 3 2 3 10 fill True True _Use this _CRC-32 file True GTK_RELIEF_NORMAL True False False True 1 3 4 5 10 fill True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-open 4 0.5 0.5 0 0 0 False False True Br_owse True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 3 4 5 6 10 fill True True True True 0 True * False 50 2 3 5 6 10 0 True True Busy verifying GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-stop 4 0.5 0.5 0 0 0 False False True Stop True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 7 3 False 0 0 0 1 0 7 10 10 True CRC-32 errors False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 5 6 10 fill True Adler-32 errors False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True Elapsed time False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True Progress False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 fill True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 2 3 2 3 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 3 4 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 4 5 10 fill True False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 5 6 10 fill 0 True True Finished verifying GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-quit 4 0.5 0.5 0 0 0 False False True _Exit True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 10 6 False 0 0 True Imagefile: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True Adler-32: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True CRC-32: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 5 6 10 fill True MD5: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 6 7 10 fill True SHA-1: False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 7 8 10 fill True GTK_BUTTONBOX_DEFAULT_STYLE 5 True True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-dnd 4 0.5 0.5 0 0 0 False False True _View logfile True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-goto-first 4 0.5 0.5 0 0 0 False False True _Image or verify new file or device True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 5 6 8 9 10 20 fill fill True Finished verifying False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 20 fill 0 1 0 10 10 10 True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 6 3 4 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 6 4 5 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 6 5 6 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 6 7 8 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 6 6 7 10 fill 0 True True Error recovery GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True True False 0 True GTK_BUTTONBOX_SPREAD True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-back 4 0.5 0.5 0 0 0 False False True _Back True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True True GTK_RELIEF_NORMAL True 0 True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-go-forward 4 0.5 0.5 0 0 0 False False True _Next True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 False True GTK_PACK_END True 7 3 False 0 0 0 1 0 7 10 10 True Do you want error recovery? False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 fill True True Yes True GTK_RELIEF_NORMAL True True False True 1 2 3 4 10 fill True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-preferences 4 0.5 0.5 0 0 0 False False True _Advanced True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 2 3 5 6 10 fill True True No True GTK_RELIEF_NORMAL True False False True radYes 1 2 4 5 10 fill 0 True True Imaging GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True 11 4 False 0 0 True Imaging in local mode False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 4 2 3 10 20 fill True Progress False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 3 4 10 fill True Elapsed time False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 4 5 10 fill True Read errors False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 5 6 10 fill True Zero-block substitutions False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 6 7 10 fill True Bytes substituted False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 2 3 7 8 10 fill True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 3 4 3 4 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 3 4 4 5 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 3 4 5 6 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 3 4 6 7 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 3 4 7 8 10 fill True 0 3 9 10 fill 0 1 0 9 10 10 fill True GTK_BUTTONBOX_SPREAD 0 True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-stop 4 0.5 0.5 0 0 0 False False True _Stop True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 3 10 11 6 True 2 4 0 1 3 332 True True GTK_POLICY_ALWAYS GTK_POLICY_ALWAYS GTK_SHADOW_NONE GTK_CORNER_TOP_LEFT True True False False True GTK_JUSTIFY_LEFT GTK_WRAP_NONE True 0 0 0 0 0 0 1 2 0 9 True Connected to client GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True 11 3 False 0 0 0 1 0 9 10 10 True GTK_BUTTONBOX_SPREAD 0 True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-stop 4 0.5 0.5 0 0 0 False False True _Stop True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 3 10 11 6 fill True 0 3 9 10 fill True Connected False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 20 fill True Progress False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True Elapsed time False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True Processed False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 5 6 10 fill True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 1 3 7 8 10 fill True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 2 3 3 4 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 4 5 10 fill True Busy verifying GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True 10 3 False 0 0 True GTK_BUTTONBOX_SPREAD 0 True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-help 4 0.5 0.5 0 0 0 False False True _Help True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False True True True GTK_RELIEF_NORMAL True True 0.5 0.5 0 0 0 0 0 0 True False 2 True gtk-stop 4 0.5 0.5 0 0 0 False False True _Stop True False GTK_JUSTIFY_LEFT False False 0.5 0.5 0 0 0 False False 0 3 9 10 6 0 1 0 8 10 10 fill True 0 3 8 9 fill True Progress False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 2 3 10 fill True Elapsed time False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 3 4 10 fill True Adler-32 errors False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 4 5 10 fill True CRC-32 errors False False GTK_JUSTIFY_LEFT False False 0 0.5 0 0 1 2 5 6 10 fill True GTK_PROGRESS_LEFT_TO_RIGHT 0 0.1 2 3 2 3 10 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 3 4 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 4 5 fill True True False False GTK_JUSTIFY_LEFT False True 0 0.5 0 0 2 3 5 6 fill True RDD-GUI GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False True False True False False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST True False 0 True True GNOMEUIINFO_MENU_FILE_TREE True Create a new image _New True True gtk-new 1 0.5 0.5 0 0 True GNOMEUIINFO_MENU_OPEN_ITEM True GNOMEUIINFO_MENU_SAVE_ITEM True GNOMEUIINFO_MENU_SAVE_AS_ITEM True True Exit the program Quit True True gtk-quit 1 0.5 0.5 0 0 True GNOMEUIINFO_MENU_EDIT_TREE True GNOMEUIINFO_MENU_CUT_ITEM True GNOMEUIINFO_MENU_COPY_ITEM True GNOMEUIINFO_MENU_PASTE_ITEM True GNOMEUIINFO_MENU_CLEAR_ITEM True True GNOMEUIINFO_MENU_PROPERTIES_ITEM True True GNOMEUIINFO_MENU_PREFERENCES_ITEM True GNOMEUIINFO_MENU_VIEW_TREE True GNOMEUIINFO_MENU_HELP_TREE True Display information about this program About True True gnome-stock-about 1 0.5 0.5 0 0 0 False False True True GTK_POLICY_ALWAYS GTK_POLICY_ALWAYS GTK_SHADOW_NONE GTK_CORNER_TOP_LEFT 4 True True False False True GTK_JUSTIFY_LEFT GTK_WRAP_CHAR True 0 0 0 0 0 0 The log file 0 True True True True 0 False False 200 80 True 2 True True rdd-2.0.7/gui/util.c010064400000000000000000000217551042173111100130570ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "numparser.h" #include "rddgui.h" #define KILOBYTE 1024 #define MEGABYTE (KILOBYTE * KILOBYTE) #define GIGABYTE (KILOBYTE * KILOBYTE * KILOBYTE) static void show_message(GtkWindow *parent, GtkButtonsType buttons, const char *fmt, va_list ap) { GtkWidget *dialog; char buf[256]; vsnprintf(buf, sizeof buf, fmt, ap); dialog = gtk_message_dialog_new(parent, GTK_DIALOG_DESTROY_WITH_PARENT, buttons, GTK_BUTTONS_CLOSE, buf); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } void rddgui_fatal(GtkWindow *parent, const char *fmt, ...) { va_list ap; va_start(ap, fmt); show_message(parent, GTK_MESSAGE_ERROR, fmt, ap); va_end(ap); exit(EXIT_FAILURE); } void rddgui_error(GtkWindow *parent, const char *fmt, ...) { va_list ap; va_start(ap, fmt); show_message(parent, GTK_MESSAGE_ERROR, fmt, ap); va_end(ap); } void rddgui_warn(GtkWindow *parent, const char *fmt, ...) { va_list ap; va_start(ap, fmt); show_message(parent, GTK_MESSAGE_WARNING, fmt, ap); va_end(ap); } void rddgui_info(GtkWindow *parent, const char *fmt, ...) { va_list ap; va_start(ap, fmt); show_message(parent, GTK_MESSAGE_INFO, fmt, ap); va_end(ap); } int rddgui_yesno_dialog(GtkWindow *parent, const char *fmt, ...) { GtkWidget *dialog; va_list ap; char buf[256]; gint answer = GTK_RESPONSE_NONE; va_start(ap, fmt); vsnprintf(buf, sizeof buf, fmt, ap); va_end(ap); dialog = gtk_message_dialog_new(parent, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, buf); answer = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); return (answer == GTK_RESPONSE_YES ? 1 : 0); } int rddgui_radio_selected(RDD_WIZWIN *ww, const char *name) { GtkWidget *w = glade_xml_get_widget(ww->xml, name); return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)) ? 1 : 0; } void rddgui_radio_select(RDD_WIZWIN *ww, const char *name) { GtkWidget *w = glade_xml_get_widget(ww->xml, name); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), TRUE); } char * rddgui_get_text(RDD_WIZWIN *ww, const char *name, int copy) { GtkWidget *w = glade_xml_get_widget(ww->xml, name); const char *txt; char *cpy; txt = gtk_entry_get_text(GTK_ENTRY(w)); if (txt == 0 || !copy) return (char *) txt; if ((cpy = malloc(strlen(txt) + 1)) == 0) { rddgui_fatal(GTK_WINDOW(ww), "Out of memory"); } strcpy(cpy, txt); return cpy; } void rddgui_set_text(RDD_WIZWIN *ww, const char *name, const char *text) { GtkWidget *w = glade_xml_get_widget(ww->xml, name); gtk_entry_set_text(GTK_ENTRY(w), text); } int rddgui_get_checked(RDD_WIZWIN *ww, const char *name) { GtkWidget *w = glade_xml_get_widget(ww->xml, name); return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)) ? 1 : 0; } int rddgui_get_uint(RDD_WIZWIN *ww, const char *label, const char *name, unsigned *num) { GtkWidget *num_wdgt = glade_xml_get_widget(ww->xml, name); rdd_count_t n = 0; int rc = RDD_OK; rc = rdd_parse_bignum( gtk_entry_get_text(GTK_ENTRY(num_wdgt)), 0, &n); if (rc != RDD_OK) { rddgui_error(GTK_WINDOW(ww->window), "Bad %s", label); return rc; } if (n >= UINT_MAX) { rddgui_error(GTK_WINDOW(ww->window), "Number too large"); return RDD_ERANGE; } *num = (unsigned) n; return RDD_OK; } void rddgui_set_uint(RDD_WIZWIN *ww, const char *entryname, unsigned num) { GtkWidget *num_wdgt = glade_xml_get_widget(ww->xml, entryname); char buf[32]; snprintf(buf, (sizeof buf) - 1, "%u", num); buf[(sizeof buf) - 1] = '\000'; gtk_entry_set_text(GTK_ENTRY(num_wdgt), buf); } int rddgui_get_multnum(RDD_WIZWIN *ww, const char *label, const char *num, const char *mult, rdd_count_t *np) { GtkWidget *num_wdgt = glade_xml_get_widget(ww->xml, num); GtkWidget *mult_cbo = glade_xml_get_widget(ww->xml, mult); rdd_count_t n = 0; const char *m = 0; int rc = RDD_OK; const char *numtext = gtk_entry_get_text(GTK_ENTRY(num_wdgt)); if (numtext == 0 || strlen(numtext) == 0) { rddgui_error(GTK_WINDOW(ww->window), "Empty %s field", label); return RDD_ESYNTAX; } rc = rdd_parse_bignum(numtext, 0, &n); if (rc != RDD_OK) { rddgui_error(GTK_WINDOW(ww->window), "Bad number in the %s " "field", label); return rc; } m = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(mult_cbo)->entry)); if (tolower(m[0]) == 'b') { /* multiply by 1 */ } else if (tolower(m[0]) == 'k') { n *= 1 << 10; } else if (tolower(m[0]) == 'm') { n *= 1 << 20; } else if (tolower(m[0]) == 'g') { n *= 1 << 30; } else { rddgui_fatal(GTK_WINDOW(ww->window), "Bad multiplier"); } *np = n; return RDD_OK; } void rddgui_set_multnum(RDD_WIZWIN *ww, rdd_count_t n, const char *numname, const char *multname) { GtkWidget *mult_cbo = glade_xml_get_widget(ww->xml, multname); rdd_count_t entry_value = 0; char entry_buf[32]; char *multiplier = 0; if (n / GIGABYTE > 0 && n % GIGABYTE == 0) { entry_value = n / GIGABYTE; multiplier = "GB"; } else if (n / MEGABYTE > 0 && n % MEGABYTE == 0) { entry_value = n / MEGABYTE; multiplier = "MB"; } else if (n / KILOBYTE > 0 && n % KILOBYTE == 0) { entry_value = n / KILOBYTE; multiplier = "kB"; } else { entry_value = n; multiplier = "bytes"; } snprintf(entry_buf, (sizeof entry_buf) - 1, "%llu", entry_value); entry_buf[(sizeof entry_buf) - 1] = '\000'; /* always null-terminate */ rddgui_set_text(ww, numname, entry_buf); gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(mult_cbo)->entry), multiplier); } void rddgui_widgets_set_sensitive(RDD_WIZWIN *ww, const char **names, unsigned nname, gboolean sensitive) { GtkWidget *widget = 0; unsigned i = 0; for (i = 0; i < nname; i++) { widget = glade_xml_get_widget(ww->xml, names[i]); if (widget != 0) { gtk_widget_set_sensitive(widget, sensitive); } } } void rddgui_focus(RDD_WIZWIN *ww, const char *name) { GtkWidget *wdgt = glade_xml_get_widget(ww->xml, name); gtk_widget_grab_focus(wdgt); } int rddgui_get_dir(const char *path, char *dir){ char copy[RDDGUI_MAX_FILENAME_SIZE]; int rc; struct stat pathinfo; rc = stat(path, &pathinfo); /* Ignore stat errors. It is normal that output files do * not exist yet. */ if (rc == 0) { if (S_ISDIR(pathinfo.st_mode)) { /* path is already a dir. Just copy. */ sprintf(dir, "%s", path); return 1; } } /* Function dirname changes the argument! */ if (strlen(path) < RDDGUI_MAX_FILENAME_SIZE) { strcpy(copy, path); sprintf(dir, "%s", dirname(copy)); return 1; } else { sprintf(dir, ""); return 0; } } void build_part_path(RDD_WIZWIN *ww, char *widget, char *filename) { GtkWidget *wdg; gchar *path; char *dir; char new_path[RDDGUI_MAX_FILENAME_SIZE]; int ret; /* If the entry for the entropy file is empty, make up a name * from the log file path and a filename. */ wdg = glade_xml_get_widget(ww->xml, widget); path = (gchar *)gtk_entry_get_text(GTK_ENTRY(wdg)); if (! path) { path = ""; } if (strlen(path) == 0) { if (rddgui_get_dir(ww->opts->log_path, dir)) { if (strlen(dir) < (RDDGUI_MAX_FILENAME_SIZE - 11)) { sprintf(new_path, "%s/%s", dir, filename); gtk_entry_set_text(GTK_ENTRY(wdg), (gchar *)new_path); } else { gtk_entry_set_text(GTK_ENTRY(wdg), (gchar *)""); } } else { gtk_entry_set_text(GTK_ENTRY(wdg), (gchar *)""); } } } rdd-2.0.7/gui/serverwizwin.c010064400000000000000000000112301042173111100146430ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "rdd.h" #include "rddgui.h" static void server_init(RDD_WIZWIN *ww) { ww->help = "rddgui.html#server"; ww->advanced = rddgui_serveradv_win; } /* REFACTOR Duplicate code * Code copied from outputwizwin.c. Code in outputwizwin has been changed. * Changes should be applied here too. Better is to move this function * to utils.c.*/ static int validate_output_file(RDD_WIZWIN *ww, const char *guiname, const char *path) { struct stat fileinfo; /* Did the user specify an output file at all? */ if (path == 0 || strlen(path) == 0) { rddgui_error(GTK_WINDOW(ww->window), "No %s specified", guiname); return 0; } if (ww->opts->split_output) { /* If the output is to be split, we are not dealing with * a single output path, but with a set of output paths * and we cannot always know the number of output paths * in that set. All checks below assume a single output * path and do not apply to the case that the output is * split. */ return 1; } /* Get file status and deal with it. */ memset(&fileinfo, 0, sizeof fileinfo); if (stat(path, &fileinfo) >= 0) { /* path exists. */ int remove; /* Is it a regular file? */ if (! S_ISREG(fileinfo.st_mode)) { rddgui_error(GTK_WINDOW(ww->window), "%s is not a regular file", path); return 0; } /* Should we really overwrite this existing file? */ remove = rddgui_yesno_dialog(GTK_WINDOW(ww->window), "Output file %s exists.\nRemove %s?", path, path); if (! remove) { return 0; } if (unlink(path) < 0) { rddgui_error(GTK_WINDOW(ww->window), "Cannot remove %s", path); return 0; } } else if (errno != ENOENT) { /* Some unexpected error. */ rddgui_error(GTK_WINDOW(ww->window), "File status error for %s", path); return 0; } #if 0 /* Do we have write access to the output file's directory? */ if ((fd = open(path, O_RDONLY)) < 0) { rddgui_error(GTK_WINDOW(ww->window), "cannot open %s", path); return 0; } (void) close(fd); #endif return 1; } static int server_next(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; if (opts->log_path != 0) { free(opts->log_path); opts->log_path = 0; } ww->next = 0; opts->log_path = rddgui_get_text(ww, "entLogfile", 1); if (! validate_output_file(ww, "server log file", opts->log_path)) { return 0; } #if 0 ww->next = rddgui_server_waiting_win; #else ww->next = 0; #endif return 1; } RDD_WIZWIN_OPS rddgui_server_ops = { server_init, server_next, 0 }; static void serveradv_init(RDD_WIZWIN *ww) { /* set standard port? */ } static int serveradv_next(RDD_WIZWIN *ww) { unsigned port; if (! rddgui_get_uint(ww, "server port", "name", &port)) { return 0; } if (port >= 65536) { rddgui_error(GTK_WINDOW(ww->window), "Port number too large.\n\n" "Choose a port number smaller than 65536."); return 0; } ww->opts->server_port = port; return 1; } RDD_WIZWIN_OPS rddgui_serveradv_ops = { serveradv_init, serveradv_next, 0 }; rdd-2.0.7/gui/integritywizwin.c010064400000000000000000000131461042173111100153630ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "rdd.h" #include "rddgui.h" static int get_advanced(RDD_WIZWIN *ww); static void set_values(RDD_WIZWIN *ww); static void integrityadv_dialog_shown(GtkWidget *widget, gpointer data) { set_values((RDD_WIZWIN *) data); } static void integrity_init(RDD_WIZWIN *ww) { ww->help = "rddgui.html#integrity"; ww->advanced = rddgui_integrityadv_win; rddgui_focus(ww, "butNext"); } static int integrity_next(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; opts->md5_stream_filter = rddgui_get_checked(ww, "chkMD5"); opts->sha1_stream_filter = rddgui_get_checked(ww, "chkSHA1"); if (! get_advanced(ww->advanced)) { return 0; } ww->next = rddgui_recovery_win; return 1; } static void integrity_advanced(RDD_WIZWIN *ww) { ww->advanced = rddgui_integrityadv_win; } RDD_WIZWIN_OPS rddgui_integrity_ops = { integrity_init, integrity_next, integrity_advanced }; static gboolean adler32_toggled(GtkWidget *wdgt, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; const char *widget_names[] = { "entAdlerBlocksize", "cboAdler", "entAdlerFile", "butAdler" }; gboolean onoff = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wdgt)); rddgui_widgets_set_sensitive(ww, widget_names, (sizeof widget_names) / sizeof(char *), onoff); return TRUE; } static gboolean crc32_toggled(GtkWidget *wdgt, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; const char *widget_names[] = { "entCRCBlocksize", "cboCRC", "entCRCFile", "butCRC" }; gboolean onoff = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wdgt)); rddgui_widgets_set_sensitive(ww, widget_names, (sizeof widget_names) / sizeof(char *), onoff); return TRUE; } static void integrityadv_init(RDD_WIZWIN *ww) { ww->help = "rddgui.html#integrity-advanced"; glade_xml_signal_connect_data(ww->xml, "on_chkAdler_toggled", G_CALLBACK(adler32_toggled), ww); glade_xml_signal_connect_data(ww->xml, "on_chkCRC_toggled", G_CALLBACK(crc32_toggled), ww); glade_xml_signal_connect_data(ww->xml, "on_dlgIntegrityAdv_show", G_CALLBACK(integrityadv_dialog_shown), ww); } static int get_path_and_block_size(RDD_WIZWIN *ww, const char *size_description, const char *size_entry_name, const char *size_combo_name, rdd_count_t *block_size, const char *path_description, const char *path_entry_name, char **path) { char *path_copy; int rc; rc = rddgui_get_multnum(ww, size_description, size_entry_name, size_combo_name, block_size); if (rc != RDD_OK) { return 0; } path_copy = rddgui_get_text(ww, path_entry_name, 1); if (! rddgui_add_output_file(ww, path_description, path_copy)) { free(path_copy); return 0; } *path = path_copy; return 1; } static int get_advanced(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; if (opts->adler32_path != 0) { free(opts->adler32_path); opts->adler32_path = 0; } if (opts->crc32_path != 0) { free(opts->crc32_path); opts->crc32_path = 0; } opts->enable_adler32 = rddgui_get_checked(ww, "chkAdler"); if (opts->enable_adler32) { if (! get_path_and_block_size(ww, "Adler32 block size", "entAdlerBlocksize", "cboAdler", &opts->adler32_block_size, "Adler-32 output file", "entAdlerFile", &opts->adler32_path)) { return 0; } } else { opts->adler32_block_size = 0; opts->adler32_path = 0; } opts->enable_crc32 = rddgui_get_checked(ww, "chkCRC"); if (opts->enable_crc32) { if (! get_path_and_block_size(ww, "CRC32 block size", "entCRCBlocksize", "cboCRC", &opts->crc32_block_size, "CRC32 output file", "entCRCFile", &opts->crc32_path)) { return 0; } } else { opts->crc32_block_size = 0; opts->crc32_path = 0; } return 1; } static int integrityadv_next(RDD_WIZWIN *ww) { if (! get_advanced(ww)) { return 0; } ww->next = 0; return 1; } RDD_WIZWIN_OPS rddgui_integrityadv_ops = { integrityadv_init, integrityadv_next, 0 }; static void set_values(RDD_WIZWIN *ww) { build_part_path(ww, "entAdlerFile", "adler32.dat"); build_part_path(ww, "entCRCFile", "crc32.dat"); } rdd-2.0.7/gui/minjuslogo.png010075500000000000000000000250731042173111100146320ustar00rootwheel‰PNG  IHDR,,y}ŽutIMEÔ&;ÈÓuÿ pHYs ð ðB¬4˜)ÚIDATxÚí´Õõ‡E@Q1hbÅÞÀAŒ,Á•("j FMTÔ &–¨¸T4j˜e0"¶X0"(ØAl¨Ø°€ (†"±""jrÿï;ÿœ·æ 3wæÖ¹3÷÷­5ë½wgîÌ™ö{ûì³ÏÞÍr !„HÍ“n€BÄE‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒKXþóŸÿ˜§žzÊœp ¦uëÖ¦Y³fviÕª•éÕ«—y衇̊+’n¦¨sš©jŽX´h‘0`€™8q¢YµjUà6×`î¾ûnÓ¶m[óÙgŸ™ÿþ÷¿fíµ×6k­µVÒ§ ê V³téRó‹_üÂLš4)rÛæÍ››?üáæ{ßûž™:uªùæ›oÌ{ìaÎ=÷\³îºë&}*¢`Õ!K–,1Ÿ~ú©µ’®¾újóðÃÛ.a°¨¾þúkóÝwßÙ¿±®Î;ï*Dê£>2»îºkAßÝÿým7°°ª‹È×u¢\¨K˜ð!9ÒÜu×]6øsË-·4'žx¢ÙqÇcïc½õÖ³1VBÔ*¬ŒðïÿÛŠ£vÀˆÞÏ~ö33lØ0ë—" (p&#|øá‡b„3Æpæ™gš… &Ý°ŽøgŸ}6¯uÆûìFq)ø«ØßÊ•+ÍìÙ³ÍO<Ñ$¢^ˆj¢l ‚,¡t ñ;1 :Njòf…UÊåË—Ûò_“'O¶á3f̰Y}ôѤOWÔ!êf|Lï¼ó޹öÚkÍ?ÿùÏÈíÙîw¿û]àº;î¸Ã†Bl¼ñƦS§NV P=î¸ã’>MQ‡H°2 Öó(È›5mÚ´ÀœVN È¯Åˆâ¾ûîk¶Øb‹¤OMÔ)òae˜­·Þ:Vb½Y³f™W^y%pe½pÌÓ8p Íã.DRÈÂÊ0¤•!ª=Ž¿ià 7´Ô6Ûl¸_¾1üÅAb»°Îø5Åyóæ5NÂ߯È$ ¡ë¬³Ž › Â´aH°2uO;í4;×0 I‡ â'Â+ˆízþùçmÈŽú| –¤ÒÝdéÚµ«µê„ð#ÁÊ8Œò=òÈ#fÔ¨Qæõ×_·ÖNØ-§¾ þ,òº3eá¢"Š«ŠŠÏ„4—õýï¿Éw±æ¦L™b#âÉ 1wî\[I§8Ó‹vÚi'Ó­[7ó£ýÈtïÞݶK`Õ ”§GH¨Ðì¬-²”þ"…xm°Á¦}ûöVL"å»XD7Þx£ýŒ@R„êÊ+¯4O?ýtYS×lºé¦6%ÎÉ'Ÿlç>"€ï½÷ÞjTéF©Ï(¦Šad VA± '*äÆ:ðÀ­èþ§|Ðìµ×^6ëÃ5×\c–-[V‘ö´ºË.»XkVž?n ‹+ VYïÞ½M—.]¬°ªVb¶`Õ1Lj¦ë… ‚€#~Μ9 QÏž=mד®#!ø½hG¡û ñÂ/Få bÆ”]"(¬¡Žadk©èrtÐAæá‡¶ET‹é‚!tDÏãS;âˆ#l=]Õ+®¸ÂvC -ÊŠuÅHã&›lÒ8òHHâwï½÷š¡C‡–ME²ÈªcðGñr“ã*äÇyPÑÕ¢{yôÑGÛîa± xÍŸþô'søá‡Û. â5hÐ ;« C\%"îqÄã˜§íø­˜ïH·Å ¨÷oU¥Î¬:'6/VñZ#FŒ0÷Üsµº~üãÛL»í¶[Ò—M$ˆ«ŽáÖo¾ùæyëb¡P&ìŒ3Î0=zôX-Ä€° 2—b¥a !4 I$Mˆª§‹Èt"¬',8|dXUªH-@‚Uç0ªF€gtù®ºê*ëŠ QîÄ{!X,óçÏ7Ï=÷œ•$,!ÊÁ£€¥’5'¢‡0¢†ÃŸî)]>Q_H°êÊÙ“UÔݾ>}ú˜áÇ[S)~ 1òia!XLzì±ÇÌ»ï¾ÈʱˆtwÓtÃpiœ] >ø`sì±ÇZõ‚Tê„ (ó>$BÈá^ŽpÇ8 ±[,^x¡µœÞzë-„JÐ)V£yXX./œý¤kÆñŽ`k%êYXu–Ö –AŸÞy†ŒÒp Öá]Í)1d‹9r¤yà*ºˆŒ$2‚Hô½¨?$Xu"5nÜ8+ ‹-Z-6‰i88¼ H(€³¬ˆ›ÂêÂÚ"ÿ¼ó㣄šzSçäDæi\C÷.·Ë.»äš7oÎ?¨ÀeðàÁ¹•+W&ÝÜÜܹss]»vµmêÕ«W®ÁúJºI¢F…•a5 Û7vìX[<"Ì/„ÏŠâçž{® ÎL ¦ Ý}÷Ý6ŠžüYX€týpú3JÙ¹sg³çž{šýöÛÏN½õ‡+£P7èqÄ*_$;£n$ù£–ä|;7…†Ð‡|Ö§ý‘Gi'9ûÓ܈l#ÁÊ $ÏÃ1M:™|sè+¦ÙŒ=ÚN}©6„*àW#ià„ lä}ÜÇ‘F ½èÛ·¯ m`Rd V†àV’›ŠÌ¡QÓm«“N:ÉVÌ©ö‹Žˆ¾ÿþû68”IÐäÙ*Ä‹ˆýßüæ7¦_¿~VÈ Ô-Ò+#äþ—š‹iñâÅ‘Û3âF„{9‹®Æïø¨èþ½úê«eß?¾®_ÿú×vФE¶`eòJ‘û +Š}öÙdž/&¦Z,]ºÔNÏ!³QîLÙ©X\t ,åg¦ôˆ ô0¥(ÂÎ>ûìÐpïÒ¡C‡Ü3Ï=ÚDqâDsýõ×[?X9ät›IȼÊ$&€‹Iz˜R”1EC† i¶1bDìáú†—ß.i`ÅŠ¹‘#Gæ:wîœk°ÊêpüñÇçfÏžô)Šdae,æÍq;Ÿ|òÉXÖ–ÊE]d ˜bi¤rÒSzذaæ™gž‰Œð õIµC™1ùµj VFà6â°&…OãÀè\¯^½lÖ^ÖRøæ›o¬ß‰˜+jVÞqǶ`ÝÆr@wšLâPÝÃÚC‚•!œo'®u@|Us^{í5;ÒX(„$*k‡° Ä’9zÔ $d gÏž¶W%­•U«VÙ45X[T܉*ÒF^Ä e´ÊˆÕI÷IErì°ÃvÚÎ=÷ÜSðw) qøá‡‡f``¿:uÊ5ˆbUæí-[¶,wÊ)§Øãš2úµ–,Y’Ä­!H°ê”åË—7NLîÑ£G®¡Kë{8èŸ~úé\ÇŽóVàq s ûôé“ûì³Ï*~N¤Ù9úè£ËæçúšæóÏ?Oúv‰ÿ!ÁªS(¥å¬„‡ Q™°”XÔÄæÝvÛ-7mÚ´ŠH6ts?ÿùÏc‰i\ÑÚgŸ}rüqÒ·Lä$Xu ™ ü/ç¸qãBÃ!¾øâ‹ÜСC…`‹-¶(Ø’éÒ¥KîñǯxŠÂ8V¹º†ûþûï/Ѫ$Xu ¾¿¿§U«V¶û†˜ó_}õ•ípÀbÕ²eKûò²ÝÉ'ŸœÛ|óÍc¿ümÚ´ÉqÆ6-N%ñÆ¥•kÙ~û핹4a4JX§0¢Èe8)hÈLúÓŸþÔæEgNßøñãíÄdÇŽ;îhçý£tÔ$~‰Q:2DÁ4¦¹^©Ô3=ô9üðÃ˾_2»’EU9â"iÅÉ1f̘¼þ(Fƒ|A”´÷ƒÿµ×^Ë5*×»wï܆n˜×Zi­Ü 'œ›7o^EÎí­·ÞªHò?¬Ë«®ºÊv‘Eõ‘`Õ1+W®ÌtÐAgëœ4iRÞý.]º47aÂ;bG73l_tI{öì™ûä“OÊ~n –aÅ2–n°Á¹‹2éÛW—H°êœ Øx¬¸/kCW(–‡tÌbC×ÑZRm´Q`~wDëC±í(g ç™3gVL°XºwïnEQT –°ø^½zÙîNÔ‹ºé¦›ÚÐB@ˆ>üðÃÜØ±c­EÕ®]»Õþ;í´SYËQ£’‚Eû;ì0³¨2š,%ìÄgJqyä‘‘Óhºuëf •Ž|æ6tÍ#ø`ÙŽG<Ö-·Ü’Ûwß}s âe­¬¯É“'—`:þ|›‚ÆTÐÂr ÿX¢:È´iÓÆ4tùB×ްÃ;”íxL”>ñÄm²AŠ@e‚49L<&,¡X˜].K-  Ž5ª*ÇÊÖ |4X<6ûf[l±…yýõ×m ¯rCþv*éÌš5Ë– Cp8Þ9çœcS¾ÄôÊ—^z©¹ñÆm¥žj±í¶ÛÚx5QyT„B4*¢),Ѻ_ŒÜù_|>cJN5á˜íÚµ³Óx\FSFé¶òûŠ+Ê’°O¤9ÝE˜ÛGÍ>?íÛ··VRJA&S²€’å”J7”š¯…9}k­µVÒM¨da‰&0R¸ÕV[ÙêÌ^èžíºë®I7ÏBû.b¹HLÌÕ”)SÌÌ™3mMÃjB}þ}û&}Iê –h‚EñU20xaÄŽ¥VÀÏ…ˆ²ôéÓÇÖd¤Í?þ¸ ‰À _ vß}wså•W&}9ê –h±VA#r;w®éÒWtY>ø`óÇ?þцEL›6ͼñÆæÅ_,{åhFL©¬súé§—\qHÄG‚%š€¯Èÿâü¦–ði±l¾ùæ¶6¥À°¾¨ìC Cº»Œìåþ.m¬ýr °êèöîÝÛ·âC«DLšG‚%šÀ‹éÔÄâ"820€À‚ÿí´ÓN³£ŠÄxay1pîܹ6È”Ï ‹X¹reãw#ºÈ|Ÿd†»ì²‹AF.E2H°Äjl²É&MþæeM«`ùÁBB€YŽ9æûÙwß}g--²°zcª˜:D7¸–»Âõ†K¬†?T€î`–­ „ 3QÛ(K¬†¿Úq9'< Q ,±Ìt9¯5dšŒµ€K¬> {÷î5%ê –X †ïH!\d ¢`‰ÕÀÂr‚EíÂJÕ¢P$Xb5¬ÝvÛÍþN쑵‚K¬Á£L=!ÿ”¦ˆZBqXu òæÍ›gKÌ¿ûî»fÑ¢EfñâÅföìÙ6.©ÚÙ;…ȇ«A^~ùe;¿ŽòZˆ™;IŠçŸ[Çô•$ó` áEE(2ÓNH·Be,)Ä «Š ž,LGÉÇÖ[omÆŽ+_–¨ dae²ï|òäÉ63æòåË J+ü¯ýËæ˜"¼¡ù܅ȇžÀŒCj•gŸ}ÖVl~òÉ'ÍE]dºvíj³Äü¾ûî³Â%DÒH°2Î+¯¼b‹“â‹"“èàÁƒmB;þF¸âd"À×uÓM7©:ŒH V†¡ëGžs@lð_9öØc[ÃoàÀ±Š(P#PV–H V†!Láù矷¿ÓµC¼¼c,de¸ì²ËÌøñãÍQGÕ˜f%ˆ3fX_˜I"ÁÊ0ÄR¶9Îýw¬«ƒ:È\ýõ í‚Xµj•yì±Çšdä¢ÚH°2 bEè‚ãÑG ¬­¿ýío¶|)e‚˜5kV£Å&DH°2 ùÉ©Ùç….!Á¡aP,uÈ!vTП׿³Î:ˆF‘¬ŒòÖ[oY–º…æƒé8½zõ2cÆŒi,[ïå½÷Þ³x!’@‚•Qž~úiëÃò3}úôÈèvDªGæ‘G±£^ÑÂÖ¿óå—_&}Š¢‘`e¿uå@°âvéöÜsOsÅWØé9^(O0ªfu‰j#ÁÊ ”i§î^D»ôÑG±÷E%ån¸Áì»ï¾M>¿à‚ Ì|ô©Š:C‚•Aˆn÷‰zAdH%b³è^xá…Mr»c©1/D5‘`eʱç Äq^LzÆÿ÷¿ÿ½Iºä뮻Φª¢ZH°2~%r]åƒDÒÎÊO~ò3jÔ¨Fѱc^ˆj!ÁÊ8Ô£Bðocaiõë×Ïœzê©6üqdZO1â'D1H°2£ƒäÀÊ¥óçÏ/jÿÕµ×^kN>ùdû;VÖý÷ߟôi‹:A‚•1^zé%;ï/d-Õ÷Dš2>0Õ‡n¢BD5`eBqŒÇy¥@EÛn»Íì³Ï>fÊ”)æHúôE ÁÊ„,Ì™3'Ö¶a¥…@qŠSN9Åú°† Öd¢µ•@‚•!ÈÎ×^hhC}úô1Ç{¬™|óÍ7“¾"ã¨jNFÀouÚi§™[o½5ÖöäÁbŠM«V­J>6µ ÷Úk/;ç`Ò°ô4B”Š,¬Œ€ó{Ò¤I±·'ýL©~,-\iÜ.©Å ÁÊä[/tä¼Wåbï½÷6:t0#GŽLúRˆ #ÁÊ.r!0…'*ÕL\è.A­Ï>û,éË!2Š+(ZŒµDDüŠ+ÊÒ† Ø,Ÿ|ò‰M=#D%`e€eË–Yk©P˜ ]®D|d€À/F91ïË•@‚•pžÓ cdÑŸ÷½Xˆ°wÝK ¯.]º4éË"2ˆ+岸”J6wÞygYÚq÷Ýw7þŽ`Q¤Uˆr#ÁJ9d%a_±¼þúë‘s£ [é ‘ .+*ÅÅ ÁJ9š(¥[‡“¼”ÉA0ÍÇ/zt‹¹"¬”C2¾Rçø¾­R`´g»H•ÜO” VÊ™:ujIßÇQ>vìØ¢¿O÷oâĉ«}ŽÅõàƒ&}yDÆ`¥,¬RApŠ C`JÐO<¸Ž®"x!Ê…+ÅûTlæP/ï¼óNÑÝJbÀæÎ¸Ž®¦²‘Šr"ÁJ1#FŒ°a ¥B·Ž¹ˆÅϱNÛÆWò(¤ VJ!ïñWåˆ('ñ^±)“ßÿý¼ë©XJØ…^$X)….\9üWàªß3:*t+‹¢åšd-ê VJ¡TWTuœB „½?4!Qù¯Ãçž{Îv;…( VJ=ztY'ã8/TéFi“¬•ØO” V !% õËM¡‘édˆˆ;ÉYÎwQ$X)„ê8X-å¦ÐÂ3f̰Iû‬mõ…+…»=®PTÓ¦M‹íLg€ ”¬B€+…”3»—… Vt{û‘äOˆb‘`¥ ¢ÛË•tÏQóq»…ŒRšå¡-ÔŠ‹+e0š·|ùòŠìSÜØ.æ2°"Už,Q ¬AÃäÉ“cWw.¦OŸk[üQÅŒú“U ÿ›¨$X)‚¨qæV ètõ¢@8ÉTZLØ£>jüñŠ^'‘]$X)‚î`©ÙA£ÀeÁ1÷0jaL)¢[XLT½¬USiˆñв²Z-%Ë)ù³¨c(D¡H°RD5"ÅqèGeW`Þa)0M§˜:ŠBH°Dˆ“Â1~´R+;ãt衇’>U‘B$X¢ 8ÒÃ2ˆ¡ q&Øl³Í6?¥¿Â²A0‰¹¹­èz^|ñÅeM‘#²+E¬·ÞzæÏþ³YwÝu+züTa‚UªÿÊ ÑòŸ~úiEÏEd VÊ8ôÐCÍ]wÝeºuëV±c@+…UTÎÐ ªê<õÔS;‘=$X)c5Ö0‡v˜5j”9ðÀM³fÍ*rüXþŠ<L9Ó2ã'ã<Ô-q‘`¥Djçw¶¡·ß~»éÞ½{Ùäx'ºÿV9ašu…ˆƒ+Å´nÝÚôë×ÏÜsÏ=¶2Í–[niZµjU–}c]ù-FõÊ]ý†nç”)STUGÄB‚•rZ¶li6Ûl3sÖYgY‡ø…^höØc³öÚk›-Z½ß¶mÛšæÍ›>óæÍ«È9à“S VF ›¸É&›˜ÁƒÛÔųgÏ6Ç·þ®m·Ý¶ ñZk­µÌÀÍšk®Ùø%éãdr(,¬J%%Ù¢eÒ •aÓM75gžy¦ùÕ¯~efΜiElêÔ©VÈX‚’ïaQuêÔÉôïßßZl^‡>“¢‹-g«GÖb"Œf9 ÑÔ 8̉T'Ó‚ñsÙK]×+mã7^-ªžôÆÇwœM-S ¶Ûn;3aÂûSˆ0ô﬎ ð”¥p¸WJ¬€‘Bºœ,‘ù°D,âæz/…‡~8éÓ5ŽKDÂDåJz!—?XU/,ɬY³*êpw˜ªÄ~", ¹«/^\ñã0WñꫯV¾wŠKDRlÁ‰b@õ.Â`‰¼ûŠ8®j±téRsË-·$}Ú¢F‘`‰¼àlÇé^- =z´œï" –È • Ë‘¹f̘Q–¼ñ"{H°D^˜ÒCT|5!"¿’®Ez‘`‰¼$U(bܸqÓ†„pH°D(”ázûí·96#“/½ôRÒ—@Ô, £Iå©"Û)z„ð"Á¡Lž<9Ѫ6wÞy§œï¢ , žW­Z•Øñña1J)„C‚%B©Æ„ç|0E‡Ú…B8$X"”jŒ†1qâDóÞ{ï%Ý Q#H°D(ÕŽ¿ ‚Ä~Êà ,QÓ|þùç¶þ¢&D `‰P(V ¼ûûÓDm Á¡Pß°@°”ÁA€K„Ò·o_Ó®]»¤›aƒHŸþy%ö,N¿~ýÌî»ïÞ¤>aRPK‘ä~¢¾‘`‰PZµjeþú׿š]wÝ5馘>úȦOõKä¥sçÎfÀ€f£6J´$ö£[(ê –ˆäøã7×]w]âNø%K–˜)S¦$}9D‚H°D$k®¹¦éÝ»·¹æškÌ:묓X;ˆÅzöÙg“¾"A$X"-[¶4ûï¿¿™3gŽ9ÿüóMëÖ­iG- ˆä`‰‚Øpà Í%—\bsUÑEÄ1_-Z´haºwïžô% Ò,‡7Sˆ" +(¹×ï½÷^›·ª’©h°¬¶Þzk›ò¦š")j –(j’ƒý®»î²E+A(7:u27Ýt“í–ŠúE‚%ÊÙIÅ3fŒÍVJQÔrÐ¥KÛ =ꨣ’>E‘0,QvÈ¿lÙ2³`Á뤧òÕ£çÏŸo»ŽüqÞﯿþú¶ûG”}Ïž=M×®]Íf›mfš7—˵ޑ`‰ŠÃ\@ŒT1_~ù¥ùꫯònOEûöí­ƒ¿mÛ¶I7_Ô,!Dj-„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔPVÁ>|¸éر£-]Ä‹/¾hºwïnúöí›ôy !RHYëì³Ï6 . ]ß­[7[S!ŠA]B!Djhg#ºrtó°ŽöÞ{o3lØ0»ð÷¢E‹×ñ{tÝzYYBˆbˆ%Xtå('L„ Ôûï¿oÿFŒ Ô仸´ÆŒc÷aþ-!„ˆ"–`9cŽ9Æ.€Xá·rø-'gY9± ÚF!âR’ë…^È+@Që…¢ätB¤†’ ¼×'åwºû×m#„q)ȇåñø±Î9çë§Â ïÝÿ‚E°(¿»QB!„(†f¹¢6Bˆ¼¡Îéî@”:tè`EËYTXWÎå¾Ï÷Üïn{!„ˆK,ÁBˆZ@Nw!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘bekpò%ãcR³&3ÇÃ;™Ü;IÜ¿®˜ âdye:tèj“ÔãÀ½æûdâ¨Ô4ÓbÚ˜/µ¶ÿÖ.ƒI1÷\úqöAŠñB¯O±Ç­ä9•…\ +×ÐÀ¨Ír /Y®áÁ±?óí‹mø9hР\ÃKÑd½ûŒ…ßýßå3×ïq¢öÛ±·¿^x¡É¹¸uî˜qÛé`]¾ËëÖ][·ïba¿þ6ßñh”D1mäZù¯WÐý©þÙ„>¥œo>xXÊ…÷;'ÿ6•8®—ȧ² À¶g©~ò·k/¨÷»üî^Z·­û®wÛ¨ýÁE÷‹ýq3 =¶[Û²¿|/½C¶ñŸu¥¼„õ$XP‰—¦(T° Ý> ï;×½œÇ‹sܼ>,•æ<ë0ùݹH÷ œiëöç~ºîûóššüîÌ\~zÍ~Öqº/Qû ‚d‚ty|ÇmÏ>Ù·k‹+mæmKX;T¢»…«FÄöQ‰ ½×Ü%Jt¸në½÷#h=ßwÇb?îº.HX;ܾý÷œÏÝ÷Ü>‚öÕF¾ëö_He%÷ ¸ßÝ÷ý×ɵÓ{œ|×Öµ×mÇï.YeÐyy·õ^×|Û?ìÚ°ŽãrmâÞw|ï¶$Ýäà3÷|xÛ箇ۯ+è~÷ž³«ôt]¼ß :îjäSº sEõ[Þm\W* ¿eäß÷¿|ÐòÚ¿ß8x-® ëÂ{ü|í® mˆ²R¼VÇöþWñ[XÞklë¬ ~z¿ë¿'ÎÚs×ÿ=ûæooWÛßvïõ ²`ùÛëpûôÞ“¨6z­Ö°®”ÿ9p]wïyzÛåÜÞvºk鎑ïÚºëà¶uÇð¶Ï{ÞþϽm Û.ßûä½7Þö„Y”aïI¾{ãu?¸çÖ{,/þs ºþ÷ÃïñïÃÿ¨÷&¯…å·R\ÑT¯õáµF «Âk•‹B÷ëÎ)Žc3ξ¸…:Êݱýÿy½íó–Ss–™;ß|¥Öø.Û»ÏùûêýOí©a×Í­óâ6hƒ×ö®j£³–Ýfï¶~¼–‚ûÏíÎÓ_RŽvø¯)Ÿ±,à¨këpÖ²Û¿÷Üh»»–Qçèß.Îûäur»ŸùzAä»7ÏÛ[¡7FÔ;´ÞÿYÔßQÖàº{Þƒúr:³ œ£ aûu&i‰éº‚-‡pr ÿÃŽÍKáŠÕzq×Üÿ’º+N©5ÿKÎõa2.®«_hwÍÛ†|mt÷‹s¢ðn˜[Áµ…{Ì2uêÔÆó:†·«Ö®|×6ˆ1K³fÍ‚»0y¶+ÇûT*´É¥8§;VëT„¢T\Ÿ6È¿Ãó÷­ÝÃÈÏ ‡Ø­Ï·_¯ïËû’ºÏÿï>½’·-AítÛ»Ê×n^>‹z]ZDÁûÑQŠwh< dÚãöá¯î]ø§áü[\³¸–j_a¥\šAÛÝ?« 6mW a@^‹›kϽv•Ük‘¼/»×qéþóø‰Þmø;ì¿7ßó›ûN8œ#Ýû¹×ö¯óÆ(åÛ¯·Zµ×9K›½–˜ûŒmüÕ>s/´[\{ø=îƒé^ïõu×ÜoÙx‹}Zjó,¤zQ±Ýþ°6øÍ:>óv= íö¸'þóÌg-E]Û8p¯¸¿û kwÐvqÞ§J㪳ó¼²zÝ£ˆzÎ ®¢•ËCP˜N1œv8Ó‚b´Â†$3Í¿xŽÎ9ìwû“^gjÔ~Ü“AßqÇsq]Îièwæk§Ã…,„9ÿÃb­Ü ßqé¿æ~'º •pñ9¬÷ÇŽ±¯ {ì}4¼Î_·oìšÿxþïGµÑû¹ç+ˆ¨8#öáÎÍ=»Þëô\ä»¶î<üÏ¡÷yð? îšÄÝ.ßûä¿7ÎAöl]Ÿ¨{ã$ó_?ó¿ïzoûÜ}d½÷¼Ý³âÞÿ»åÚô,×KdÕ| ø ¼]ç\öGb£Ö¬ 2‰ý¥Âþ(e¯Å¶ bQûõöÔoqc!í Ú¯}ÐþYOÛƒ®yØ1ã–Zó/¨ÞãxåÝ¿·l›÷ZzýjA瞯޶„_œû¶ï÷ý×<èÚ]‡ ûæÝε)èXAÛå{Ö‚Žå¿ÖAï·½qïÛÎ]Âî³w;oÇ»?ÿóäŽçÞ… ç R°8 > úÝù§”•ç „A¨.¡"5([ƒ"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5H°„©A‚%„H ,!Dj` !RƒK‘$XBˆÔ ÁB¤ –"5üI¯ÔžËÍ\¹IEND®B`‚rdd-2.0.7/gui/splash.c010064400000000000000000000051161042173111100133650ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "rdd.h" #include "rddgui.h" #define SPLASH_TIMEOUT 10000 /* milliseconds */ static gboolean splash_timeout(gpointer data) { GtkDialog *splash = GTK_DIALOG(data); /* A timeout occurred. Act as though the user * pressed the OK/close button. */ gtk_dialog_response(splash, GTK_RESPONSE_OK); return FALSE; } void rddgui_splash(const char *path) { GladeXML *xml = 0; GtkWidget *splash = 0; GtkWidget *version_label = 0; guint timeout_id; gint result; gchar version[255]; xml = glade_xml_new(path, "dlgSplash", NULL); splash = glade_xml_get_widget(xml, "dlgSplash"); version_label = glade_xml_get_widget(xml, "lblVersion"); sprintf(version, "%s %s", "rdd-gui", VERSION); gtk_label_set_text(version_label, version); timeout_id = gtk_timeout_add(SPLASH_TIMEOUT, splash_timeout, GTK_DIALOG(splash)); result = gtk_dialog_run(GTK_DIALOG(splash)); gtk_widget_destroy(splash); gtk_timeout_remove(timeout_id); } rdd-2.0.7/gui/outputfile.c010064400000000000000000000116371042173111100143000ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "rdd.h" #include "rddgui.h" #include #include #include #include #include #include #include #define MAX_OUTFILE 8 typedef struct _RDDGUI_OUTFILE { const char *label; char *path; } RDDGUI_OUTFILE; static RDDGUI_OUTFILE outfiles[MAX_OUTFILE]; static unsigned num_outfile; int rddgui_add_output_file(RDD_WIZWIN *ww, const char *label, const char *path) { RDDGUI_OUTFILE *outfile = 0; RDDGUI_OUTFILE *replace = 0; char *copy = 0; struct stat pathinfo; unsigned i; int rc; int fd; /* Do not allow empty paths. */ if (path == 0 || strlen(path) == 0) { rddgui_error(GTK_WINDOW(ww->window), "Empty %s field", label); return 0; } /* Find out where to insert the path. If label matches an * existing label, then we will overwrite the entry for that * existing label. */ for (i = 0; i < num_outfile; i++) { outfile = &outfiles[i]; if (outfile->label == 0 || outfile->path == 0) { continue; } if (strcmp(outfile->label, label) == 0) { replace = outfile; continue; } if (strcmp(outfile->path, path) == 0) { rddgui_error(GTK_WINDOW(ww->window), "%s %s already specified as %s", label, path, outfile->label); #if 1 rddgui_dump_output_files(); #endif return 0; } } rc = stat(path, &pathinfo); if (rc < 0 && errno != ENOENT) { rddgui_error(GTK_WINDOW(ww->window), "Cannot get information on %s ", path); return 0; } if (rc == 0) { /* File or directory exists. */ if (S_ISDIR(pathinfo.st_mode)) { rddgui_error(GTK_WINDOW(ww->window), "%s is a directory", path); return 0; } /* File exists. Ask user whether we can remove it. */ int remove = rddgui_yesno_dialog(GTK_WINDOW(ww->window), "%s exists.\nRemove %s?\n\nCheck the " "regular screen and the advanced screen " "for this file entry.", path, path); if (! remove) return 0; rc = unlink(path); if (rc < 0) { rddgui_error(GTK_WINDOW(ww->window), "Cannot remove %s", path); return 0; } } /* Make sure we can create the output file. */ if ((fd = open(path, O_WRONLY|O_CREAT)) < 0) { rddgui_error(GTK_WINDOW(ww->window), "Cannot create %s", path); return 0; } (void) close(fd); (void) unlink(path); if (!replace && num_outfile >= MAX_OUTFILE) { rddgui_error(GTK_WINDOW(ww->window), "Too many output files"); return 0; } copy = malloc(strlen(path) + 1); if (copy == 0) { rddgui_fatal(GTK_WINDOW(ww->window), "Out of memory"); } strcpy(copy, path); if (replace) { if (replace->path != 0) { free(replace->path); } replace->path = copy; } else { outfile = &outfiles[num_outfile++]; outfile->label = label; outfile->path = copy; } return 1; } void rddgui_clear_output_files(void) { RDDGUI_OUTFILE *outfile = 0; unsigned i; for (i = 0; i < (sizeof outfiles)/(sizeof outfiles[0]); i++) { outfile = &outfiles[i]; if (outfile->path != 0) { free(outfile->path); } outfiles->label = 0; outfiles->path = 0; } num_outfile = 0; } void rddgui_dump_output_files(void) { RDDGUI_OUTFILE *outfile = 0; int i; for (i = 0; i < MAX_OUTFILE; i++) { outfile = &outfiles[i]; printf("Entry: %u\n", i); printf("Label: %s\n", outfile->label ? outfile->label : "(empty)"); printf("Path: %s\n", outfile->path ? outfile->path : "(empty)"); printf("\n"); } } rdd-2.0.7/gui/winmain.c010064400000000000000000000070741042173111100135420ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rdd.h" #include "rddgui.h" static char * about_message = "rdd-gui version " VERSION "\n" "Netherlands Forensic Institute\n" "The Hague, The Netherlands\n"; static GtkWidget *logwin; static GtkWidget *canvas; static GdkGC *gcontext; static gboolean new_image_clicked(GtkWidget *widget, gpointer data) { /* write log message to logwin */ return TRUE; } static gboolean quit_clicked(GtkWidget *widget, gpointer data) { /* Ask for confirmation? */ gtk_main_quit(); return TRUE; } static gboolean about_clicked(GtkWidget *widget, gpointer data) { rddgui_info(0, "%s", about_message); return TRUE; } static gint canvas_exposed(GtkWidget *widget, GdkEventExpose *event, gpointer data) { int w, h; int i; gdk_window_get_geometry(widget->window, NULL, NULL, &w, &h, NULL); printf("%u x %u\n", w, h); for (i = 0; i < w; i++) { gdk_draw_point(widget->window, gcontext, i, (h*i)/h); } return 0; } static void rddgui_winmain_run(void) { GladeXML *xml; GtkWidget *mainwin; printf("XML\n"); xml = glade_xml_new(rddgui_xml_path, "winMain", NULL); printf("WIDGET GET MAIN\n"); mainwin = glade_xml_get_widget(xml, "winMain"); printf("WIDGET GET LOG\n"); logwin = glade_xml_get_widget(xml, "txtLog"); canvas = glade_xml_get_widget(xml, "canvas"); gtk_drawing_area_size(GTK_DRAWING_AREA(canvas), 100, 100); gcontext = gdk_gc_new(canvas->window); printf("HIDE\n"); gtk_widget_hide_all(mainwin); printf("CONNECT\n"); glade_xml_signal_connect_data(xml, "on_quit_clicked", G_CALLBACK(quit_clicked), mainwin); glade_xml_signal_connect_data(xml, "on_about_clicked", G_CALLBACK(about_clicked), mainwin); glade_xml_signal_connect_data(xml, "on_canvas_expose_event", G_CALLBACK(canvas_exposed), canvas); printf("SHOW\n"); gtk_widget_show_all(mainwin); printf("MAIN\n"); gtk_main(); } int main(int argc, char **argv) { gtk_init(&argc, &argv); glade_init(); printf("RUN\n"); rddgui_winmain_run(); return 0; } rdd-2.0.7/gui/statswizwin.c010064400000000000000000000155431042173111100145060ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "rdd.h" #include "rddgui.h" static int get_advanced(RDD_WIZWIN *ww); static void set_values(RDD_WIZWIN *ww); static void statsadv_dialog_shown(GtkWidget *widget, gpointer data) { set_values((RDD_WIZWIN *) data); } static gboolean yes_toggled(GtkWidget *w, gpointer data) { GtkWidget *advanced_button = (GtkWidget *) data; gtk_widget_set_sensitive(advanced_button, TRUE); return TRUE; } static gboolean no_toggled(GtkWidget *w, gpointer data) { GtkWidget *advanced_button = (GtkWidget *) data; gtk_widget_set_sensitive(advanced_button, FALSE); return TRUE; } static void stats_init(RDD_WIZWIN *ww) { GtkWidget *advanced_button = 0; ww->help = "rddgui.html#statistics"; ww->advanced = rddgui_statsadv_win; advanced_button = glade_xml_get_widget(ww->xml, "butAdvanced"); glade_xml_signal_connect_data(ww->xml, "on_radYes_toggled", G_CALLBACK(yes_toggled), advanced_button); glade_xml_signal_connect_data(ww->xml, "on_radNo_toggled", G_CALLBACK(no_toggled), advanced_button); rddgui_focus(ww, "butNext"); } static int stats_next(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; if (rddgui_radio_selected(ww, "radYes")) { opts->enable_stats = 1; } else if (rddgui_radio_selected(ww, "radNo")) { opts->enable_stats = 0; } else { rddgui_fatal(0, "No selected value for radio button"); } /* Ignore the data in the advanced screen if we're not doing * statistics. */ if (opts->enable_stats == 1) { if (! get_advanced(ww->advanced)) { return 0; } } ww->next = rddgui_confirmation_win; return 1; } static void stats_advanced(RDD_WIZWIN *ww) { ww->advanced = rddgui_statsadv_win; } RDD_WIZWIN_OPS rddgui_stats_ops = { stats_init, stats_next, stats_advanced }; static gboolean entropy_toggled(GtkWidget *wdgt, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; const char *widget_names[] = { "entEntropyBlocksize", "entEntropyFile", "butEntropy", "cboEntropy" }; gboolean onoff = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wdgt)); rddgui_widgets_set_sensitive(ww, widget_names, (sizeof widget_names) / sizeof(char *), onoff); return TRUE; } static gboolean md5_toggled(GtkWidget *wdgt, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; const char *widget_names[] = { "entMD5Blocksize", "entMD5File", "butMD5", "cboMD5" }; gboolean onoff = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wdgt)); rddgui_widgets_set_sensitive(ww, widget_names, (sizeof widget_names) / sizeof(char *), onoff); return TRUE; } static void statsadv_init(RDD_WIZWIN *ww) { GtkWidget *combo; ww->help = "rddgui.html#statistics-advanced"; rddgui_set_text(ww, "entEntropyBlocksize", "32"); combo = glade_xml_get_widget(ww->xml, "cboEntropy"); gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), "kB"); rddgui_set_text(ww, "entMD5Blocksize", "32"); combo = glade_xml_get_widget(ww->xml, "cboMD5"); gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combo)->entry), "kB"); glade_xml_signal_connect_data(ww->xml, "on_chkEntropy_toggled", G_CALLBACK(entropy_toggled), ww); glade_xml_signal_connect_data(ww->xml, "on_chkMD5_toggled", G_CALLBACK(md5_toggled), ww); glade_xml_signal_connect_data(ww->xml, "on_dlgStatisticsAdv_show", G_CALLBACK(statsadv_dialog_shown), ww); } static int get_path_and_block_size(RDD_WIZWIN *ww, const char *size_description, const char *size_entry_name, const char *size_combo_name, rdd_count_t *block_size, const char *path_description, const char *path_entry_name, char **path) { char *path_copy; int rc; rc = rddgui_get_multnum(ww, size_description, size_entry_name, size_combo_name, block_size); if (rc != RDD_OK) { return 0; } path_copy = rddgui_get_text(ww, path_entry_name, 1); if (! rddgui_add_output_file(ww, path_description, path_copy)) { free(path_copy); return 0; } *path = path_copy; return 1; } static int get_advanced(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; if (opts->entropy_path != 0) { free(opts->entropy_path); opts->entropy_path = 0; } if (opts->blockmd5_path != 0) { free(opts->blockmd5_path); opts->blockmd5_path = 0; } opts->enable_entropy = rddgui_get_checked(ww, "chkEntropy"); if (opts->enable_entropy) { if (! get_path_and_block_size(ww, "entropy block size", "entEntropyBlocksize", "cboEntropy", &opts->entropy_block_size, "block entropy output file", "entEntropyFile", &opts->entropy_path)) { return 0; } } else { opts->entropy_block_size = 0; opts->entropy_path = 0; } opts->enable_blockmd5 = rddgui_get_checked(ww, "chkMD5"); if (opts->enable_blockmd5) { if (! get_path_and_block_size(ww, "MD5 block size", "entMD5Blocksize", "cboMD5", &opts->blockmd5_block_size, "block MD5 output file", "entMD5File", &opts->blockmd5_path)) { return 0; } } else { opts->blockmd5_block_size = 0; opts->blockmd5_path = 0; } return 1; } static int statsadv_next(RDD_WIZWIN *ww) { if (! get_advanced(ww)) { return 0; } ww->next = 0; return 1; } RDD_WIZWIN_OPS rddgui_statsadv_ops = { statsadv_init, statsadv_next, 0 }; static void set_values(RDD_WIZWIN *ww) { build_part_path(ww, "entEntropyFile", "entropy.dat"); build_part_path(ww, "entMD5File", "block-md5.dat"); } rdd-2.0.7/gui/outputwizwin.c010064400000000000000000000131751043501323200147110ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include "rdd.h" #include "rddgui.h" static void output_init(RDD_WIZWIN *ww) { ww->help = "rddgui.html#output"; ww->advanced = rddgui_outputadv_win; } /* * Much of this checking is done in add_output_file() in outputfile.c. */ static int validate_output_file(RDD_WIZWIN *ww, const char *guiname, const char *label, const char *path) { struct stat fileinfo; int fd; int remove = 0; if (ww->opts->split_output) { /* If the output is to be split, we are not dealing with * a single output path, but with a set of output paths * and we cannot always know the number of output paths * in that set. All checks below assume a single output * path and do not apply to the case that the output is * split. */ return 1; } /* Add file to the list of output files */ if (! rddgui_add_output_file(ww, label, path)) { return 0; } return 1; } static int output_next(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; if (opts->output_path != 0) { free(opts->output_path); opts->output_path = 0; } if (opts->log_path != 0) { free(opts->log_path); opts->log_path = 0; } ww->next = 0; opts->output_path = rddgui_get_text(ww, "entOutput", 1); if (strcmp(opts->output_path, opts->input_path) == 0) { rddgui_error(GTK_WINDOW(ww->window), "The output file has the same name as the " " input file"); return 0; } if (! validate_output_file(ww, "output file", "output image file", opts->output_path)) { return 0; } opts->log_path = rddgui_get_text(ww, "entLogfile", 1); if (strcmp(opts->log_path, opts->input_path) == 0) { rddgui_error(GTK_WINDOW(ww->window), "The log file has the same name as the " " input file"); return 0; } if (! validate_output_file(ww, "log file", "log file", opts->log_path)) { return 0; } if (strcmp(opts->output_path, opts->log_path) == 0) { rddgui_error(GTK_WINDOW(ww->window), "The output file and the log file have " "the same name"); return 0; } /* Process the data in the advanced window. RDD-GUI can be run twice * without the user opening and closing the advanced window. */ ww->advanced->ops->next(ww->advanced); ww->next = rddgui_integrity_win; return 1; } RDD_WIZWIN_OPS rddgui_output_ops = { output_init, output_next, 0 }; /** \brief Disables the split size input widgets when the user * indicates that he wants his output in a single file. */ static gboolean single_toggled(GtkWidget *wdgt, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; static const char *names[] = {"entSplit", "cboSplit"}; rddgui_widgets_set_sensitive(ww, names, (sizeof names)/sizeof(char*), FALSE); return TRUE; } /** \brief Enables the split size input widgets when the user * indicates that he wants to split his output. */ static gboolean split_toggled(GtkWidget *wdgt, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; static const char *names[] = {"entSplit", "cboSplit"}; rddgui_widgets_set_sensitive(ww, names, (sizeof names)/sizeof(char*), TRUE); return TRUE; } static void outputadv_init(RDD_WIZWIN *ww) { ww->help = "rddgui.html#output-advanced"; glade_xml_signal_connect_data(ww->xml, "on_radSingle_toggled", G_CALLBACK(single_toggled), ww); glade_xml_signal_connect_data(ww->xml, "on_radSplit_toggled", G_CALLBACK(split_toggled), ww); rddgui_radio_select(ww, "radSingle"); } static int outputadv_next(RDD_WIZWIN *ww) { RDDGUI_OPTS *opts = ww->opts; int rc = RDD_OK; if (rddgui_radio_selected(ww, "radSingle")) { opts->split_output = 0; opts->split_size = 0; return 1; } else if (rddgui_radio_selected(ww, "radSplit")) { opts->split_output = 1; rc = rddgui_get_multnum(ww, "split size", "entSplit", "cboSplit", &opts->split_size); return rc == RDD_OK ? 1 : 0; } else { rddgui_fatal(GTK_WINDOW(ww->window), "No radio button selected"); return 0; /* NOT REACHED */ } } RDD_WIZWIN_OPS rddgui_outputadv_ops = { outputadv_init, outputadv_next, 0 }; rdd-2.0.7/gui/rddgui.c010064400000000000000000000757501042173111100133640ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_PWD_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_UTSNAME_H #include #endif #include "rdd.h" #include "rdd_internals.h" #include "reader.h" #include "writer.h" #include "filter.h" #include "filterset.h" #include "copier.h" #include "error.h" #include "msgprinter.h" #include "rddgui.h" #if defined(HAVE_LIBCRYPTO) && defined(HAVE_OPENSSL_CRYPTO_H) #include #endif #define MAX_ENTROPY_POINTS 1000 typedef struct _RDDGUI_IMAGINGWIN { struct { const char *help; /* help page */ rdd_count_t size; /* input size (bytes) */ rdd_count_t pos; /* current position (bytes) */ time_t start; /* start time */ unsigned elapsed; /* elapsed time (secs) */ int cancelled; /* copy cancelled flag */ rdd_count_t nreaderr; /* read error count */ rdd_count_t nsubst; /* substitution count */ rdd_count_t bytes_dropped; /* #bytes substituted */ #if defined(PLOT_ENTROPY) double *entropy_points; unsigned next_point; #endif } model; struct { GtkWidget *win; /* progress window */ GtkWidget *bar; /* progress bar */ GtkWidget *elapsed; /* elapsed-time label */ GtkWidget *readerrs; /* read error count label */ GtkWidget *substs; /* subst. count label */ GtkWidget *nbyte; /* #bytes substituted label */ #if defined(PLOT_ENTROPY) GtkWidget *canvas; /* entropy plot */ #endif GtkWidget *logwin; /* log window */ } view; } RDDGUI_IMAGINGWIN; #if defined(PLOT_ENTROPY) static void add_entropy(unsigned blocknum, double entropy, void *data); #endif static RDD_MSGPRINTER *gui_printer = 0; static RDD_MSGPRINTER *log_printer = 0; static void fatal_rddgui_error(int rc, char *fmt, ...) { exit(EXIT_FAILURE); } static RDD_MSGPRINTER * open_gui_printer(void) { RDD_MSGPRINTER *printer = 0; int rc = RDD_OK; rc = rdd_mp_open_gui_printer(&printer); if (rc != RDD_OK) { rddgui_fatal(0, "cannot open GUI printer"); } return printer; } static RDD_MSGPRINTER * open_log_printer(const char *path, GtkWidget *logwin) { RDD_MSGPRINTER *printers[2]; RDD_MSGPRINTER *p1 = 0; RDD_MSGPRINTER *p2 = 0; RDD_MSGPRINTER *printer = 0; char hostname[128]; int rc = RDD_OK; struct passwd *pwd = 0; struct utsname sysinfo; GtkTextBuffer *textbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin)); rc = rdd_mp_open_file_printer(&p1, path); if (rc != RDD_OK) { rddgui_fatal(0, "cannot open log file (%s)", path); } rc = rdd_mp_open_guilog_printer(&p2, textbuf); if (rc != RDD_OK) { rddgui_fatal(0, "cannot open log window"); } printers[0] = p1; printers[1] = p2; rc = rdd_mp_open_bcast_printer(&printer, 2, printers); if (rc != RDD_OK) { rddgui_fatal(0, "cannot open broadcast printer"); } rc = rdd_mp_open_log_printer(&printer, printer); if (rc != RDD_OK) { rddgui_fatal(0, "cannot stack log printer"); } rdd_mp_message(printer, RDD_MSG_INFO, "%s", rdd_ctime()); /* Rdd-gui version number. */ rdd_mp_message(printer, RDD_MSG_INFO, "rdd-gui version " VERSION); rdd_mp_message(printer, RDD_MSG_INFO, "Copyright (c) 2002 Nederlands " "Forensisch Instituut"); /* GTK library version. */ rdd_mp_message(printer, RDD_MSG_INFO, "GTK+ library version %u.%u.%u", gtk_major_version, gtk_minor_version, gtk_micro_version); #if defined(HAVE_LIBCRYPTO) rdd_mp_message(printer, RDD_MSG_INFO, "openssl version %s", OPENSSL_VERSION_TEXT); rdd_mp_message(printer, RDD_MSG_INFO, "Copyright (c) 1995-1998 Eric Young"); #else rdd_mp_message(printer, RDD_MSG_INFO, "NOT using openssl"); #endif /* Host name. */ if (gethostname(hostname, sizeof hostname) < 0) { rdd_mp_message(printer, RDD_MSG_INFO, "hostname: " "unknown (gethostname() failed)"); } else { hostname[(sizeof hostname) - 1] = '\000'; rdd_mp_message(printer, RDD_MSG_INFO, "hostname: %s", hostname); } /* Operating system. */ if (uname(&sysinfo) < 0) { rdd_mp_message(printer, RDD_MSG_INFO, "operating system: " "unknown (uname() failed)"); } else { rdd_mp_message(printer, RDD_MSG_INFO, "operating system: %s version %s release %s", sysinfo.sysname, sysinfo.version, sysinfo.release); } /* User id and user name. */ rdd_mp_message(printer, RDD_MSG_INFO, "user id: %d", getuid()); if ((pwd = getpwuid(getuid())) == 0) { rdd_mp_message(printer, RDD_MSG_INFO, "user name: " "unknown (getpwuid() failed)"); } else { rdd_mp_message(printer, RDD_MSG_INFO, "user name: %s", pwd->pw_name); } return printer; } static void close_printer(RDD_MSGPRINTER *printer, const char *printer_name) { int rc; if (printer == 0) return; rc = rdd_mp_close(printer, RDD_MP_RECURSE|RDD_MP_READONLY); if (rc != RDD_OK) { rddgui_fatal(0, "cannot close %s printer", printer_name); } } static RDD_READER * open_disk_input(rdd_count_t *inputlen) { RDD_READER *reader = 0; int rc; rc = rdd_open_file_reader(&reader, rddgui_options.input_path, 0 /* not raw */); if (rc != RDD_OK) { rdd_error(rc, "cannot open %s", rddgui_options.input_path); } if ((rc = rdd_reader_seek(reader, 0)) != RDD_OK) { rdd_error(rc, "cannot seek on %s", rddgui_options.input_path); } *inputlen = RDD_WHOLE_FILE; rc = rdd_device_size(rddgui_options.input_path, inputlen); if (rc != RDD_OK) { rdd_error(rc, "%s: cannot determine device size", rddgui_options.input_path); } return reader; } #if 0 static RDD_READER * open_net_input(rdd_count_t *inputlen) { RDD_READER *reader = 0; int server_sock = -1; unsigned flags; int fd = -1; int rc; *inputlen = RDD_WHOLE_FILE; /* In server mode, we read from the network */ if (opts.inetd) { /* started by (x)inetd */ fd = STDIN_FILENO; } else { rc = rdd_init_server(opts.server_port, &server_sock); if (rc != RDD_OK) { rdd_error(rc, "cannot start rdd-copy server"); } fd = rdd_await_connection(server_sock); } rc = rdd_open_fd_reader(&reader, fd); if (rc != RDD_OK) { rdd_error(rc, "cannot open reader on server socket"); } rc = rdd_recv_info(reader, &opts.outpath, inputlen, &opts.blocklen, &opts.splitlen, &flags); if (rc != RDD_OK) { rdd_error(rc, "bad client request"); } if (opts.verbose) { errlognl("Received rdd request:"); errlognl("\tfile name: %s", opts.outpath); errlognl("\tfile size: %s", rdd_strsize(*inputlen)); errlognl("\tblock size: %llu", opts.blocklen); errlognl("\tsplit size: %llu", opts.splitlen); } #if defined(DEBUG) errlognl("file=%s size=%llu bsize=%llu splitsize=%llu", opts.outpath, rdd_strsize(*filelen), *blocklen, *splitlen); #endif if ((flags & RDD_NET_COMPRESS) != 0) { if ((rc = rdd_open_zlib_reader(&reader, reader)) != RDD_OK) { rdd_error(rc, "cannot open zlib reader"); } } return reader; } #endif /* Creates a reader stack that corresponds to the user's options. */ static RDD_READER * open_input(rdd_count_t *inputlen) { if (rddgui_options.mode == RDDGUI_SERVER) { #if 0 return open_net_input(inputlen); #else return 0; #endif } else { return open_disk_input(inputlen); } } static RDD_WRITER * open_disk_output(rdd_count_t outputsize) { RDD_WRITER *writer = 0; rdd_write_mode_t wrmode; int rc; if (rddgui_options.output_path == 0) return 0; wrmode = RDD_OVERWRITE; if (rddgui_options.split_output) { rc = rdd_open_part_writer(&writer, rddgui_options.output_path, outputsize, rddgui_options.split_size, wrmode); if (rc != RDD_OK) { rdd_error(rc, "cannot add multipart write filter"); } } else { rc = rdd_open_safe_writer(&writer, rddgui_options.output_path, wrmode); if (rc != RDD_OK) { rdd_error(rc, "cannot add safe write filter"); } } return writer; } #if 0 static RDD_WRITER * open_net_output(rdd_count_t outputsize) { RDD_WRITER *writer = 0; unsigned flags = 0; int rc; char *server = opts.server_host; unsigned port = opts.server_port; assert(opts.outpath != 0); rc = rdd_open_tcp_writer(&writer, server, port); if (rc != RDD_OK) { rdd_error(rc, "cannot connect to %s:%u", server, port); } flags = (opts.compress ? RDD_NET_COMPRESS : 0); rc = rdd_send_info(writer, opts.outpath, outputsize, opts.blocklen, opts.splitlen, flags); if (rc != RDD_OK) { rdd_error(rc, "cannot send header to %s:%u", server, port); } if (opts.compress) { /* Stack a zlib writer on top of the TCP writer. */ rc = rdd_open_zlib_writer(&writer, writer); if (rc != RDD_OK) { rdd_error(rc, "cannot compress network traffic to " " %s:%u", server, port); } } return writer; } #endif /** Creates a writer stack that corresponds to the user's options. * The outputsize argument contains the size of the output in * bytes if that size is known or RDD_WHOLE_FILE if is not known. */ static RDD_WRITER * open_output(rdd_count_t outputsize) { if (rddgui_options.mode == RDDGUI_CLIENT) { #if 0 return open_net_output(outputsize); #else return 0; #endif } else { return open_disk_output(outputsize); } } static void add_filter(RDD_FILTERSET *fset, const char *name, RDD_FILTER *f) { int rc; if ((rc = rdd_fset_add(fset, name, f)) != RDD_OK) { rddgui_fatal(0, "Cannot install %s filter", name); } } static void install_stats_filters(RDD_FILTERSET *fset, RDDGUI_IMAGINGWIN *imgwin) { RDD_FILTER *f; int rc; /* MD5 */ f = 0; if (rddgui_options.enable_blockmd5) { rc = rdd_new_md5_blockfilter(&f, rddgui_options.blockmd5_block_size, rddgui_options.blockmd5_path, 0 /* do not overwrite existing file */); if (rc != RDD_OK) { rddgui_fatal(0, "Cannot create MD5 block filter"); } add_filter(fset, "MD5 block", f); } /* Entropy */ f = 0; if (rddgui_options.enable_entropy) { rc = rdd_new_stats_blockfilter(&f, rddgui_options.entropy_block_size, rddgui_options.entropy_path, 0 /* do not overwrite existing file */); if (rc != RDD_OK) { rddgui_fatal(0, "Cannot create statistics block filter"); } add_filter(fset, "statistical block", f); #if defined(PLOT_ENTROPY) rc = rddgui_new_plotentropy_blockfilter(&f, rddgui_options.entropy_block_size, add_entropy, imgwin); if (rc != RDD_OK) { rddgui_fatal(0, "Cannot create entropy-plot block filter"); } add_filter(fset, "entropy-plot block", f); #endif } } static void install_filters(RDD_FILTERSET *fset, RDD_WRITER *writer, RDDGUI_IMAGINGWIN *imgwin) { RDD_FILTER *f = 0; RDDGUI_OPTS *opts = &rddgui_options; int rc; if ((rc = rdd_fset_init(fset)) != RDD_OK) { rdd_error(rc, "cannot create filter fset"); } if (writer != 0) { rc = rdd_new_write_streamfilter(&f, writer); if (rc != RDD_OK) { rdd_error(rc, "cannot create write filter"); } add_filter(fset, "write", f); } if (opts->md5_stream_filter) { rc = rdd_new_md5_streamfilter(&f); if (rc != RDD_OK) { rddgui_error(0, "cannot create MD5 filter"); } add_filter(fset, "MD5 stream", f); } if (opts->sha1_stream_filter) { rc = rdd_new_sha1_streamfilter(&f); if (rc != RDD_OK) { rddgui_error(0, "cannot create SHA-1 filter"); } add_filter(fset, "SHA-1 stream", f); } if (opts->enable_adler32) { rc = rdd_new_adler32_blockfilter(&f, opts->adler32_block_size, opts->adler32_path, RDD_OVERWRITE); if (rc != RDD_OK) { rddgui_error(0, "cannot create Adler32 filter"); } add_filter(fset, "Adler32 block", f); } if (opts->enable_crc32) { rc = rdd_new_crc32_blockfilter(&f, opts->crc32_block_size, opts->crc32_path, RDD_OVERWRITE); if (rc != RDD_OK) { rddgui_error(0, "cannot create CRC-32 filter"); } add_filter(fset, "CRC-32 block", f); } if (opts->enable_stats) { install_stats_filters(fset, imgwin); } } /** Updates the GUI by processing pending events. Quits when * all events have been processed or when the user presses * the 'Stop' button. */ static int imgwin_update(RDDGUI_IMAGINGWIN *imgwin) { gboolean quit = FALSE; while (gtk_events_pending()) { quit = gtk_main_iteration_do(FALSE); #if 0 if (quit) return RDD_ABORTED; #endif /* Check whether user pressed the 'stop' button. */ if (imgwin->model.cancelled) return RDD_ABORTED; } return RDD_OK; } static void draw_number(GtkWidget *w, rdd_count_t num) { char buf[32]; snprintf(buf, sizeof buf, "%llu", num); buf[(sizeof buf) - 1] = '\000'; gtk_label_set_text(GTK_LABEL(w), buf); } static void draw_progress(RDDGUI_IMAGINGWIN *imgwin) { gdouble fraction; if (imgwin->model.size > 0) { fraction = ((gdouble) imgwin->model.pos) / ((gdouble) imgwin->model.size); } else { fraction = 0.0; } gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(imgwin->view.bar), fraction); } static void draw_elapsed(RDDGUI_IMAGINGWIN *imgwin) { unsigned hours = imgwin->model.elapsed / 3600; unsigned mins = (imgwin->model.elapsed % 3600) / 60; unsigned secs = imgwin->model.elapsed % 60; char buf[128]; snprintf(buf, sizeof buf, "%3u hours %2.2u mins %2.2u secs", hours, mins, secs); gtk_label_set_text(GTK_LABEL(imgwin->view.elapsed), buf); } #if defined(PLOT_ENTROPY) static void add_entropy(unsigned blocknum, double entropy, void *data) { RDDGUI_IMAGINGWIN *imgwin = (RDDGUI_IMAGINGWIN *) data; double *points = imgwin->model.entropy_points; points[imgwin->model.next_point] = entropy; imgwin->model.next_point = (imgwin->model.next_point + 1) % MAX_ENTROPY_POINTS; } static void draw_entropy(RDDGUI_IMAGINGWIN *imgwin) { double *points = imgwin->model.entropy_points; GtkWidget *canvas = imgwin->view.canvas; int w, h; int x, y; int i, j; gdk_window_get_geometry(canvas->window, NULL, NULL, &w, &h, NULL); for (i = 0; i < MAX_ENTROPY_POINTS; i++) { j = (imgwin->model.next_point + i) % MAX_ENTROPY_POINTS; x = (i * w) / MAX_ENTROPY_POINTS; y = h - (points[j] * h / 8.0); if (y >= h) y = h - 1; /* Delete the previous point at this x location by * drawing a line. This way we do not have to remember * the y coordinate of the previous point. */ gdk_draw_line(canvas->window, canvas->style->bg_gc[GTK_STATE_NORMAL], x, 0, x, h-1); /* Draw the new point. */ gdk_draw_point(canvas->window, canvas->style->fg_gc[GTK_STATE_NORMAL], x, y); } } #endif static void imgwin_draw(RDDGUI_IMAGINGWIN *imgwin) { draw_number(imgwin->view.readerrs, imgwin->model.nreaderr); draw_number(imgwin->view.substs, imgwin->model.nsubst); draw_number(imgwin->view.nbyte, imgwin->model.bytes_dropped); draw_progress(imgwin); draw_elapsed(imgwin); } static void handle_read_error(rdd_count_t offset, unsigned nbyte, void *env) { RDDGUI_IMAGINGWIN *imgwin = (RDDGUI_IMAGINGWIN *) env; imgwin->model.nreaderr++; draw_number(imgwin->view.readerrs, imgwin->model.nreaderr); (void) imgwin_update(imgwin); } static void handle_substitution(rdd_count_t offset, unsigned nbyte, void *env) { RDDGUI_IMAGINGWIN *imgwin = (RDDGUI_IMAGINGWIN *) env; imgwin->model.nsubst++; imgwin->model.bytes_dropped += nbyte; if (log_printer != 0) { rdd_mp_message(log_printer, RDD_MSG_ERROR, "unrecoverable read failure: " "dropping %u input bytes at offset %llu", nbyte, offset); } draw_number(imgwin->view.substs, imgwin->model.nsubst); draw_number(imgwin->view.nbyte, imgwin->model.bytes_dropped); (void) imgwin_update(imgwin); } static int handle_progress(rdd_count_t pos, void *env) { RDDGUI_IMAGINGWIN *imgwin = (RDDGUI_IMAGINGWIN *) env; imgwin->model.pos = pos; imgwin->model.elapsed = time(NULL) - imgwin->model.start; draw_progress(imgwin); draw_elapsed(imgwin); #if defined(PLOT_ENTROPY) draw_entropy(imgwin); #endif return imgwin_update(imgwin); } static RDD_COPIER * create_copier(RDDGUI_IMAGINGWIN *imgwin) { RDD_COPIER *copier = 0; rdd_count_t offset = rddgui_options.offset; rdd_count_t count = rddgui_options.count; int rc = RDD_OK; if (rddgui_options.mode == RDDGUI_SERVER || !rddgui_options.enable_recovery) { RDD_SIMPLE_PARAMS p; memset(&p, 0, sizeof p); p.progressfun = handle_progress; p.progressenv = imgwin; rc = rdd_new_simple_copier(&copier, &p); if (rc != RDD_OK) { rdd_error(rc, "cannot create simple copier"); } } else { RDD_ROBUST_PARAMS p; memset(&p, 0, sizeof p); p.minblocklen = rddgui_options.retry_block_size; p.maxblocklen = rddgui_options.block_size; p.nretry = rddgui_options.max_retry_count; p.maxsubst = rddgui_options.max_drop_count; p.readerrfun = handle_read_error; p.readerrenv = imgwin; p.substfun = handle_substitution; p.substenv = imgwin; p.progressfun = handle_progress; p.progressenv = imgwin; rc = rdd_new_robust_copier(&copier, offset, count, &p); if (rc != RDD_OK) { rdd_error(rc, "cannot create robust copier"); } } return copier; } static gboolean cancel_clicked(GtkWidget *widget, gpointer data) { RDDGUI_IMAGINGWIN *imgwin = (RDDGUI_IMAGINGWIN *) data; imgwin->model.cancelled = 1; return TRUE; } static gboolean help_clicked(GtkWidget *widget, gpointer data) { RDDGUI_IMAGINGWIN *imgwin = (RDDGUI_IMAGINGWIN *) data; int rc; if (imgwin->model.help) { rc = rddgui_showhtml(imgwin->model.help); if (rc == RDD_NOTFOUND) { rddgui_error(GTK_WINDOW(imgwin->view.win), "No browser found"); } } return TRUE; } #if defined(PLOT_ENTROPY) static gint canvas_exposed(GtkWidget *widget, GdkEventExpose *event, gpointer data) { return 0; } #endif static RDDGUI_IMAGINGWIN * imgwin_create(GladeXML *xml, rdd_count_t input_size) { RDDGUI_IMAGINGWIN *imgwin = 0; if ((imgwin = calloc(1, sizeof(RDDGUI_IMAGINGWIN))) == 0) { rddgui_fatal(0, "out of memory"); } imgwin->view.win = glade_xml_get_widget(xml, "winImaging"); imgwin->view.bar = glade_xml_get_widget(xml, "prgProgress"); imgwin->view.elapsed = glade_xml_get_widget(xml, "lblShowTime"); imgwin->view.readerrs = glade_xml_get_widget(xml, "lblShowReadErrors"); imgwin->view.substs = glade_xml_get_widget(xml, "lblShowSubstBlocks"); imgwin->view.nbyte = glade_xml_get_widget(xml, "lblShowSubstBytes"); #if defined(PLOT_ENTROPY) imgwin->view.canvas = glade_xml_get_widget(xml, "daEntropyPlot"); gtk_drawing_area_size(GTK_DRAWING_AREA(imgwin->view.canvas), 200, 80); #endif imgwin->view.logwin = glade_xml_get_widget(xml, "tvLog"); imgwin->model.help = "rddgui.html#imaging"; imgwin->model.size = input_size; imgwin->model.pos = 0; imgwin->model.elapsed = 0; imgwin->model.nreaderr = 0; imgwin->model.nsubst = 0; imgwin->model.bytes_dropped = 0; #if defined(PLOT_ENTROPY) imgwin->model.entropy_points = calloc(sizeof(double), MAX_ENTROPY_POINTS); if (imgwin->model.entropy_points == 0) { rddgui_fatal(0, "out of memory"); } #endif imgwin_draw(imgwin); gtk_widget_hide_all(imgwin->view.win); /* Connect signals. */ glade_xml_signal_connect_data(xml, "on_butStop_clicked", G_CALLBACK(cancel_clicked), imgwin); glade_xml_signal_connect_data(xml, "on_butHelp_clicked", G_CALLBACK(help_clicked), imgwin); #if defined(PLOT_ENTROPY) glade_xml_signal_connect_data(xml, "on_daEntropyPlot_exposed", G_CALLBACK(canvas_exposed), imgwin); #endif gtk_widget_show_all(imgwin->view.win); return imgwin; } static char hexchar(unsigned val) { return (val < 10 ? '0' + val : 'a' + (val - 10)); } static void bin2hex(unsigned char *bin, unsigned binlen, char *text) { unsigned i, k; unsigned byteval; for (i = k = 0; i < binlen; i++) { byteval = (bin[i] >> 4) & 0xf; text[k++] = hexchar(byteval); byteval = bin[i] & 0xf; text[k++] = hexchar(byteval); } text[k++] = '\000'; } static void imgwin_get_stats(RDDGUI_IMGSTATS *stats, RDDGUI_IMAGINGWIN *imgwin, RDD_FILTERSET *fset) { unsigned char md5buf[16]; unsigned char sha1buf[20]; RDD_FILTER *f = 0; int rc; stats->elapsed = imgwin->model.elapsed; stats->nreaderr = imgwin->model.nreaderr; stats->nsubst = imgwin->model.nsubst; stats->bytes_dropped = imgwin->model.bytes_dropped; /* Retrieve hash values (if any). */ rc = rdd_fset_get(fset, "MD5 stream", &f); if (rc == RDD_OK) { rdd_filter_get_result(f, md5buf, sizeof md5buf); bin2hex(md5buf, sizeof md5buf, stats->md5); } else if (rc == RDD_NOTFOUND) { snprintf(stats->md5, sizeof stats->md5, "N/A"); } else { strcpy(stats->md5, ""); } rc = rdd_fset_get(fset, "SHA-1 stream", &f); if (rc == RDD_OK) { rdd_filter_get_result(f, sha1buf, sizeof sha1buf); bin2hex(sha1buf, sizeof sha1buf, stats->sha1); } else if (rc == RDD_NOTFOUND) { snprintf(stats->sha1, sizeof stats->sha1, "N/A"); } else { strcpy(stats->md5, ""); } } #define bool2str(b) ((b) ? "yes" : "no") #define str2str(s) ((s) == 0? "N/A" : (s)) static void log_opts(void) { RDDGUI_OPTS *opts = &rddgui_options; rdd_mp_message(log_printer, RDD_MSG_INFO, ""); rdd_mp_message(log_printer, RDD_MSG_INFO, "========== Parameter settings =========="); /* Input */ rdd_mp_message(log_printer, RDD_MSG_INFO, "Input file: %s", str2str(opts->input_path)); rdd_mp_message(log_printer, RDD_MSG_INFO, "Input size: %llu", opts->count); rdd_mp_message(log_printer, RDD_MSG_INFO, "Read: %llu bytes", opts->count); rdd_mp_message(log_printer, RDD_MSG_INFO, "Block size: %llu bytes", opts->block_size); rdd_mp_message(log_printer, RDD_MSG_INFO, "Offset: %llu bytes", opts->offset); /* Output */ rdd_mp_message(log_printer, RDD_MSG_INFO, ""); rdd_mp_message(log_printer, RDD_MSG_INFO, "Output file: %s", str2str(opts->output_path)); rdd_mp_message(log_printer, RDD_MSG_INFO, "Log file: %s", str2str(opts->log_path)); if (opts->split_output) { rdd_mp_message(log_printer, RDD_MSG_INFO, "Segment size: %llu bytes", opts->split_size); } else { rdd_mp_message(log_printer, RDD_MSG_INFO, "Segment size: N/A"); } /* Hashing */ rdd_mp_message(log_printer, RDD_MSG_INFO, ""); rdd_mp_message(log_printer, RDD_MSG_INFO, "compute MD5: %s", bool2str(opts->md5_stream_filter)); rdd_mp_message(log_printer, RDD_MSG_INFO, "compute SHA1: %s", bool2str(opts->sha1_stream_filter)); /* Integrity options */ rdd_mp_message(log_printer, RDD_MSG_INFO, ""); if (opts->enable_adler32) { rdd_mp_message(log_printer, RDD_MSG_INFO, "Adler32 file: %s", str2str(opts->adler32_path)); rdd_mp_message(log_printer, RDD_MSG_INFO, "Adler32 block size: %llu bytes", opts->adler32_block_size); } else { rdd_mp_message(log_printer, RDD_MSG_INFO, "Adler32 file: N/A"); rdd_mp_message(log_printer, RDD_MSG_INFO, "Adler32 block size: N/A"); } rdd_mp_message(log_printer, RDD_MSG_INFO, ""); if (opts->enable_crc32) { rdd_mp_message(log_printer, RDD_MSG_INFO, "CRC32 file: %s", str2str(opts->crc32_path)); rdd_mp_message(log_printer, RDD_MSG_INFO, "CRC32 block size: %llu bytes", opts->crc32_block_size); } else { rdd_mp_message(log_printer, RDD_MSG_INFO, "CRC32 file: N/A"); rdd_mp_message(log_printer, RDD_MSG_INFO, "CRC32 block size: N/A"); } /* Recovery */ rdd_mp_message(log_printer, RDD_MSG_INFO, ""); if (opts->enable_recovery){ rdd_mp_message(log_printer, RDD_MSG_INFO, "Retry block size: %llu bytes", opts->retry_block_size); rdd_mp_message(log_printer, RDD_MSG_INFO, "Drop block after: %u retries", opts->max_retry_count); if (opts->never_give_up) { rdd_mp_message(log_printer, RDD_MSG_INFO, "Never give up"); } else { rdd_mp_message(log_printer, RDD_MSG_INFO, "Give up after: %llu blocks dropped", opts->max_drop_count); } } else { rdd_mp_message(log_printer, RDD_MSG_INFO, "No recovery"); } /* Statistics */ rdd_mp_message(log_printer, RDD_MSG_INFO, ""); if (opts->enable_stats && opts->enable_entropy) { rdd_mp_message(log_printer, RDD_MSG_INFO, "Entropy file: %s", str2str(opts->entropy_path)); rdd_mp_message(log_printer, RDD_MSG_INFO, "Entropy block size: %llu bytes", opts->entropy_block_size); } else { rdd_mp_message(log_printer, RDD_MSG_INFO, "Entropy file: N/A", str2str(opts->entropy_path)); rdd_mp_message(log_printer, RDD_MSG_INFO, "Entropy block size: N/A"); } rdd_mp_message(log_printer, RDD_MSG_INFO, ""); if (opts->enable_stats && opts->enable_blockmd5) { rdd_mp_message(log_printer, RDD_MSG_INFO, "Block MD5 file: %s", str2str(opts->blockmd5_path)); rdd_mp_message(log_printer, RDD_MSG_INFO, "MD5 block size: %llu bytes", opts->blockmd5_block_size); } rdd_mp_message(log_printer, RDD_MSG_INFO, "========================================"); rdd_mp_message(log_printer, RDD_MSG_INFO, ""); } static void log_stats(RDDGUI_IMGSTATS *stats) { rdd_mp_message(log_printer, RDD_MSG_INFO, "read errors: %llu", stats->nreaderr); rdd_mp_message(log_printer, RDD_MSG_INFO, "substitutions: %llu blocks", stats->nsubst); rdd_mp_message(log_printer, RDD_MSG_INFO, "dropped: %llu bytes", stats->bytes_dropped); rdd_mp_message(log_printer, RDD_MSG_INFO, "MD5: %s", stats->md5); rdd_mp_message(log_printer, RDD_MSG_INFO, "SHA-1: %s", stats->sha1); } static void imgwin_destroy(RDDGUI_IMAGINGWIN *imgwin) { gtk_widget_destroy(imgwin->view.win); free(imgwin); } static int image_or_verify(void) { RDD_READER *reader; RDD_WRITER *writer; RDD_COPIER *copier; RDD_FILTERSET filterset; RDD_COPIER_RETURN copier_ret; rdd_count_t input_size; RDDGUI_IMAGINGWIN *imgwin; RDDGUI_IMGSTATS imgstats; RDDGUI_FINISHEDWIN *donewin; rddgui_finish_action_t finish_action; double start, end; GladeXML *xml; int rc; RDDGUI_OPTS *opts = &rddgui_options; while (1) { xml = glade_xml_new(rddgui_xml_path, "winImaging", NULL); rddgui_clear_output_files(); /* Collect rdd arguments. */ rc = rdd_wizwin_run(rddgui_imageorverify_win); if (rc != RDD_OK) { exit(EXIT_FAILURE); } /* XXX For now, assume that we must copy data. Keep * in mind that the user may also select the verification * path. */ log_printer = open_log_printer(rddgui_options.log_path, glade_xml_get_widget(xml, "tvLog")); log_opts(); /* Run rdd. */ reader = open_input(&input_size); writer = open_output(RDD_WHOLE_FILE); /* The input size from open_input() is the size of the * device. That is not necessarily the number of bytes * we'll be reading */ if (opts->input_size == opts->count) { if (opts->offset == 0) { /* No offset, no limited count. */ input_size = opts->input_size; } else { /* Offset, no limited count. */ input_size = opts->input_size - opts->offset; } } else { /* Limited count. */ input_size = opts->count; } imgwin = imgwin_create(xml, input_size); install_filters(&filterset, writer, imgwin); copier = create_copier(imgwin); /* Run dialog in a nonblocking manner? */ imgwin->model.start = time(NULL); rdd_mp_message(log_printer, RDD_MSG_INFO, "starting copy"); start = rdd_gettime(); rc = rdd_copy_exec(copier, reader, &filterset, &copier_ret); end = rdd_gettime(); if (rc == RDD_OK) { rdd_mp_message(log_printer, RDD_MSG_INFO, "copy done"); rddgui_info(GTK_WINDOW(imgwin->view.win), "Copy done"); } else if (rc == RDD_ABORTED) { rdd_mp_message(log_printer, RDD_MSG_WARN, ""); rdd_mp_message(log_printer, RDD_MSG_WARN, "COPY ABORTED BY USER"); rdd_mp_message(log_printer, RDD_MSG_WARN, ""); rddgui_error(GTK_WINDOW(imgwin->view.win), "Copy aborted"); } else { int errcode = rc; char msg[64]; rc = rdd_strerror(errcode, msg, sizeof msg); if (rc == RDD_OK) { rdd_mp_message(log_printer, RDD_MSG_WARN, ""); rdd_mp_message(log_printer, RDD_MSG_ERROR, "COPY ERROR: %s", msg); rdd_mp_message(log_printer, RDD_MSG_WARN, ""); rddgui_fatal(GTK_WINDOW(imgwin->view.win), "Copy error: %s", msg); } else { rdd_mp_message(log_printer, RDD_MSG_WARN, ""); rdd_mp_message(log_printer, RDD_MSG_ERROR, "UNKNOWN COPY ERROR [%d]", errcode); rdd_mp_message(log_printer, RDD_MSG_WARN, ""); rddgui_fatal(GTK_WINDOW(imgwin->view.win), "Unknown copy error [%d]", errcode); } } /* Clean up. */ if ((rc = rdd_copy_free(copier)) != RDD_OK) { rdd_mp_rddmsg(gui_printer, RDD_MSG_ERROR, rc, "cannot clean up copier"); exit(EXIT_FAILURE); } if (writer != 0) { if ((rc = rdd_writer_close(writer)) != RDD_OK) { rdd_mp_rddmsg(gui_printer, RDD_MSG_ERROR, rc, "cannot clean up writer"); exit(EXIT_FAILURE); } } if ((rc = rdd_reader_close(reader, 1)) != RDD_OK) { rdd_mp_rddmsg(gui_printer, RDD_MSG_ERROR, rc, "cannot clean up reader"); exit(EXIT_FAILURE); } imgwin_get_stats(&imgstats, imgwin, &filterset); log_stats(&imgstats); close_printer(log_printer, "log-file"); imgwin_destroy(imgwin); donewin = rddgui_create_finished_window(&imgstats); if ((rc = rdd_fset_clear(&filterset)) != RDD_OK) { rdd_mp_rddmsg(gui_printer, RDD_MSG_ERROR, rc, "cannot clean up filters"); exit(EXIT_FAILURE); } again: finish_action = rddgui_run_finished_window(donewin); switch (finish_action) { case RDDGUI_FINISH_NONE: goto again; case RDDGUI_FINISH_NEW: break; case RDDGUI_FINISH_HELP: rddgui_showhtml("rddgui.html#finished-imaging"); goto again; case RDDGUI_FINISH_EXIT: rddgui_destroy_finished_window(donewin); goto done; case RDDGUI_FINISH_LOGFILE: rddgui_error(GTK_WINDOW(donewin->win), "SHOW LOGFILE: NOT IMPLEMENTED"); /* XXX HOW TO SHOW LOGFILE */ goto again; } rddgui_destroy_finished_window(donewin); } done: return 0; } int main(int argc, char **argv) { int rc; int again = 0; gtk_init(&argc, &argv); glade_init(); set_progname(argv[0]); rdd_init(); rdd_cons_open(); if ((rc = rddgui_init()) != RDD_OK) { rdd_error(rc, "cannot initialize GUI"); } gui_printer = open_gui_printer(); rddgui_splash(rddgui_xml_path); do { again = image_or_verify(); } while(again); close_printer(gui_printer, "GUI"); return 0; } rdd-2.0.7/gui/rddgui.h010064400000000000000000000212761042173111100133630ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __rddgui_h__ #define __rddgui_h__ #ifdef __cplusplus__ extern "C" { #endif #include #include #include #include "msgprinter.h" #include "writer.h" #include "filter.h" #include "filterset.h" #define __rddgui_str(dirmac) #dirmac #define __rddgui_path(dirmac, filemac) ( __rddgui_str(dirmac) "/" #filemac ) #define RDDGUI_GLADE_XML_PATH __rddgui_path(PKGDATADIR, rddgui.glade) #define __rddgui_dir(dirmac) (__rddgui_str(dirmac)) #define RDDGUI_DATADIR __rddgui_dir(PKGDATADIR) #define RDDGUI_MAX_FILENAME_SIZE 256 typedef enum _rddgui_mode_t { RDDGUI_LOCAL, RDDGUI_CLIENT, RDDGUI_SERVER } rddgui_mode_t; typedef enum _rddgui_wizbutton_t { RDDGUI_NONE, RDDGUI_NEXT, RDDGUI_BACK, RDDGUI_ADVANCED, RDDGUI_FINISH } rddgui_wizbutton_t; typedef struct _RDDGUI_OPTS { rddgui_mode_t mode; /* Input options. */ char *input_path; rdd_count_t input_size; rdd_count_t offset; rdd_count_t count; rdd_count_t block_size; /* Output options. */ char *output_path; char *log_path; int split_output; rdd_count_t split_size; /* Network options. */ unsigned server_port; /* Integrity options. */ int md5_stream_filter; int sha1_stream_filter; int enable_adler32; rdd_count_t adler32_block_size; char *adler32_path; int enable_crc32; rdd_count_t crc32_block_size; char *crc32_path; /* Recovery options. */ int enable_recovery; rdd_count_t retry_block_size; unsigned max_retry_count; unsigned max_drop_count; int never_give_up; /* Statistical options. */ int enable_stats; int enable_entropy; rdd_count_t entropy_block_size; char *entropy_path; int enable_blockmd5; rdd_count_t blockmd5_block_size; char *blockmd5_path; } RDDGUI_OPTS; struct _RDD_WIZWIN; #define RDD_MAX_WIDGET_NAME_LEN 256 /* The max length of a name for a widget */ typedef void (*rdd_wizwin_init_fun)(struct _RDD_WIZWIN *ww); typedef int (*rdd_wizwin_next_fun)(struct _RDD_WIZWIN *ww); typedef void (*rdd_wizwin_advanced_fun)(struct _RDD_WIZWIN *ww); typedef struct _RDD_WIZWIN_OPS { rdd_wizwin_init_fun init; /**< Initialize wizard window */ rdd_wizwin_next_fun next; /**< Validate input and give successor */ rdd_wizwin_advanced_fun advanced; /**< Gives advanced window */ } RDD_WIZWIN_OPS; /** \brief An \c RDD_WIZWIN structure describes a single wizard window. * Each wizard window type is described in XML generated by the Glade * GUI designer. Each wizard window type supplies a number of type-specific * operations. These operations are described in a \c RDD_WIZWIN_OPS structure. */ typedef struct _RDD_WIZWIN { GladeXML *xml; /**< in-memory XML */ GtkWidget *window; /**< root widget (a dialog window) */ char name[RDD_MAX_WIDGET_NAME_LEN]; /**< Glade name of the window */ const char *help; /**< address of HTML help */ RDDGUI_OPTS *opts; /**< rdd options */ RDD_WIZWIN_OPS *ops; /**< type-specific operation table */ void *state; /**< type-specific state */ rddgui_wizbutton_t result; /**< dialog result */ struct _RDD_WIZWIN *prev; /**< dynamic predecessor window */ struct _RDD_WIZWIN *next; /**< dynamic successor window */ struct _RDD_WIZWIN *advanced; /**< advanced-options window */ } RDD_WIZWIN; typedef struct _RDDGUI_IMGSTATS { unsigned elapsed; rdd_count_t nreaderr; rdd_count_t nsubst; rdd_count_t bytes_dropped; char md5[33]; char sha1[41]; } RDDGUI_IMGSTATS; typedef enum _rddgui_finish_action_t { RDDGUI_FINISH_NONE, RDDGUI_FINISH_HELP, RDDGUI_FINISH_EXIT, RDDGUI_FINISH_LOGFILE, RDDGUI_FINISH_NEW } rddgui_finish_action_t; typedef struct _RDDGUI_FINISHEDWIN { GladeXML *xml; GtkWidget *win; rddgui_finish_action_t action; } RDDGUI_FINISHEDWIN; extern RDDGUI_OPTS rddgui_options; /* Declare dialog windows and their operation tables as global variables. */ #define RDD_EXTDECL_WIN(varname) \ extern RDD_WIZWIN_OPS rddgui_##varname##_ops; \ extern struct _RDD_WIZWIN *rddgui_##varname##_win; RDD_EXTDECL_WIN(imageorverify) RDD_EXTDECL_WIN(network) RDD_EXTDECL_WIN(input) RDD_EXTDECL_WIN(inputadv) RDD_EXTDECL_WIN(output) RDD_EXTDECL_WIN(outputadv) RDD_EXTDECL_WIN(integrity) RDD_EXTDECL_WIN(integrityadv) RDD_EXTDECL_WIN(recovery) RDD_EXTDECL_WIN(recoveryadv) RDD_EXTDECL_WIN(stats) RDD_EXTDECL_WIN(statsadv) RDD_EXTDECL_WIN(confirmation) RDD_EXTDECL_WIN(client) RDD_EXTDECL_WIN(clientadv) RDD_EXTDECL_WIN(server) RDD_EXTDECL_WIN(serveradv) RDD_EXTDECL_WIN(verify) RDD_EXTDECL_WIN(verifyadv) extern char *rddgui_xml_path; int rddgui_init(void); void rddgui_splash(const char *path); int rddgui_showhtml(const char *htmlfile); void rddgui_fatal(GtkWindow *parent, const char *fmt, ...); void rddgui_error(GtkWindow *parent, const char *fmt, ...); void rddgui_warn(GtkWindow *parent, const char *fmt, ...); void rddgui_info(GtkWindow *parent, const char *fmt, ...); int rddgui_add_output_file(RDD_WIZWIN *ww, const char *label, const char *path); void rddgui_clear_output_files(void); void rddgui_dump_output_files(void); int rddgui_yesno_dialog(GtkWindow *parent, const char *fmt, ...); int rddgui_radio_selected(RDD_WIZWIN *ww, const char *name); void rddgui_radio_select(RDD_WIZWIN *ww, const char *name); void rddgui_widgets_set_sensitive(RDD_WIZWIN *ww, const char **names, unsigned nname, gboolean sensitive); char *rddgui_get_text(RDD_WIZWIN *ww, const char *name, int copy); void rddgui_set_text(RDD_WIZWIN *ww, const char *name, const char *text); int rddgui_get_uint(RDD_WIZWIN *ww, const char *label, const char *name, unsigned *num); void rddgui_set_uint(RDD_WIZWIN *ww, const char *entryname, unsigned num); int rddgui_get_checked(RDD_WIZWIN *ww, const char *name); int rddgui_get_multnum(RDD_WIZWIN *ww, const char *label, const char *num, const char *mult, rdd_count_t *np); void rddgui_set_multnum(RDD_WIZWIN *ww, rdd_count_t n, const char *numname, const char *multname); void rddgui_focus(RDD_WIZWIN *ww, const char *name); int rdd_mp_open_gui_printer(RDD_MSGPRINTER **printer); int rdd_mp_open_guilog_printer(RDD_MSGPRINTER **printer, GtkTextBuffer *textbuf); int rdd_new_wizwin(RDD_WIZWIN **self, const char *path, const char *name, RDDGUI_OPTS *opts, RDD_WIZWIN_OPS *ops, unsigned statesize); int rdd_free_wizwin(RDD_WIZWIN *ww); int rdd_wizwin_run(RDD_WIZWIN *ww); int rdd_wizwin_next(RDD_WIZWIN *ww); void rdd_wizwin_advanced(RDD_WIZWIN *ww); RDDGUI_FINISHEDWIN *rddgui_create_finished_window(RDDGUI_IMGSTATS *stats); rddgui_finish_action_t rddgui_run_finished_window(RDDGUI_FINISHEDWIN *win); void rddgui_destroy_finished_window(RDDGUI_FINISHEDWIN *win); int rddgui_get_dir(const char *path, char *dir); void build_part_path(RDD_WIZWIN *ww, char *widget, char *filename); #if defined(PLOT_ENTROPY) int rddgui_new_plotentropy_blockfilter(RDD_FILTER **self, unsigned blocksize, void (*entropy_handler)(unsigned blocknum, double entropy, void *env), void *env); #endif #ifdef __cplusplus__ } #endif #endif /* __rddgui_h__ */ rdd-2.0.7/gui/Makefile.am010064400000000000000000000031171042173111100137620ustar00rootwheel## Process this file with automake to produce Makefile.in AM_CFLAGS = $(GTK_CFLAGS) $(LIBGLADE_CFLAGS) if GCC_COMPILER AM_CFLAGS += -W -Wall -Wmissing-prototypes endif AM_CPPFLAGS = -DPKGDATADIR=$(pkgdatadir) -I../src -DPLOT_ENTROPY # Unfortunately, I have not found m4 macros for libglade-2.0, # so I had to add these paths manually AM_LDFLAGS = $(GTK_LDFLAGS) $(LIBGLADE_LIBS) # AM_LDFLAGS += -Wl,--export-dynamic # AM_LDFLAGS += -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lz -lgdk-x11-2.0 \ # -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 \ # -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 \ # -ldl -lglib-2.0 bin_PROGRAMS = rdd-gui noinst_PROGRAMS = rdd-main rdd_gui_SOURCES = rddgui.c \ wizwin.c rddgui.h init.c \ inputwizwin.c inputadvwizwin.c outputwizwin.c \ confirmationwizwin.c networkwizwin.c imageorverifywizwin.c \ integritywizwin.c recoverywizwin.c statswizwin.c \ serverwizwin.c \ finishedwin.c \ util.c splash.c help.c \ guiprinter.c guilogprinter.c \ outputfile.c plotentropyblockfilter.c rdd_gui_LDADD = ../src/librdd.a rdd_gui_LDFLAGS = $(AM_LDFLAGS) rdd_main_SOURCES = winmain.c \ wizwin.c rddgui.h init.c \ inputwizwin.c inputadvwizwin.c outputwizwin.c \ confirmationwizwin.c networkwizwin.c imageorverifywizwin.c \ integritywizwin.c recoverywizwin.c statswizwin.c \ finishedwin.c \ util.c splash.c help.c \ guiprinter.c \ outputfile.c rdd_main_LDADD = ../src/librdd.a rdd_main_LDFLAGS = $(AM_LDFLAGS) dist_pkgdata_DATA = rddgui.glade minjuslogo.png minjuslogo-200.png \ html/rddgui.html html/helpstyle.css rdd-2.0.7/gui/plotentropyblockfilter.c010064400000000000000000000117611043501254300167240ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "rddgui.h" #include "error.h" #include "writer.h" #include "filter.h" #include "msgprinter.h" #define NUM_BYTE_VAL 256 #define RDD_LN2 0.69314718055994530942 typedef struct _RDD_PLOTENTROPY_BLOCKFILTER { rdd_count_t blocknum; unsigned histogram[NUM_BYTE_VAL]; void (*handler)(unsigned blocknum, double entropy, void *env); void *env; } RDD_PLOTENTROPY_BLOCKFILTER; static int plotentropy_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); static int plotentropy_block(RDD_FILTER *f, unsigned nbyte); static int plotentropy_close(RDD_FILTER *f); static int plotentropy_free(RDD_FILTER *f); static RDD_FILTER_OPS plotentropy_ops = { plotentropy_input, plotentropy_block, plotentropy_close, 0, plotentropy_free }; int rddgui_new_plotentropy_blockfilter(RDD_FILTER **self, unsigned blocksize, void (*entropy_handler)(unsigned blocknum, double entropy, void *env), void *env) { RDD_FILTER *f = 0; RDD_PLOTENTROPY_BLOCKFILTER *state = 0; int rc; rc = rdd_new_filter(&f, &plotentropy_ops, sizeof(RDD_PLOTENTROPY_BLOCKFILTER), blocksize); if (rc != RDD_OK) { goto error; } state = (RDD_PLOTENTROPY_BLOCKFILTER *) f->state; state->handler = entropy_handler; state->env = env; state->blocknum = 0; memset(state->histogram, 0, sizeof(state->histogram)); *self = f; return RDD_OK; error: *self = 0; if (state != 0) free(state); if (f != 0) free(f); return rc; } /** Computes block statistics based on the byte-value histogram. * The modus is the byte value that occurs most in the block. * Entropy measures randomness in a block. It is computed as * sum(-Pi * (log2(Pi))), where Pi is the occurrence frequency of * byte value i and where i ranges over all byte values with positive Pi. */ static void compute_histogram_stats(RDD_PLOTENTROPY_BLOCKFILTER *state, unsigned block_size, double *entropy) { unsigned byte, count; double p, ent; ent = 0.0; for (byte = 0; byte < NUM_BYTE_VAL; byte++) { count = state->histogram[byte]; if (count > 0) { p = ((double) count) / ((double) block_size); ent += -p * (log(p) / RDD_LN2); } } *entropy = ent; } /** Uses the byte values in buf to update the histogramming * statistics for the current block. */ static int plotentropy_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { RDD_PLOTENTROPY_BLOCKFILTER *state = (RDD_PLOTENTROPY_BLOCKFILTER *) f->state; unsigned byte; unsigned i; for (i = 0; i < nbyte; i++) { byte = buf[i]; state->histogram[byte]++; } return RDD_OK; } /** Computes and outputs the per-block histogramming statistics: * entropy, mininum byte value, maximum byte value, and modus. */ static int plotentropy_block(RDD_FILTER *f, unsigned nbyte) { RDD_PLOTENTROPY_BLOCKFILTER *state = (RDD_PLOTENTROPY_BLOCKFILTER *) f->state; double entropy; compute_histogram_stats(state, nbyte, &entropy); (*state->handler)(state->blocknum, entropy, state->env); state->blocknum++; memset(state->histogram, 0, sizeof(state->histogram)); return RDD_OK; } static int plotentropy_close(RDD_FILTER *f) { return RDD_OK; } static int plotentropy_free(RDD_FILTER *f) { return RDD_OK; } rdd-2.0.7/gui/simple-dialog.c010064400000000000000000000327721042173111100146310ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #include #include #include #include #include #include #define SPLASH_DURATION 1800 /* milliseconds */ void showOutput(); void showInput(); void showSplash(); void showConfirmation(); void showImaging(); void showFinishedImaging(); typedef struct _PROGRESS { GtkWidget *progressbar; GtkWidget *copiedLabel; int cancelled; } PROGRESS; #define WINDOW_INPUT 1 #define WINDOW_OUTPUT 2 #define WINDOW_CONFIRMATION 3 #define WINDOW_IMAGING 4 #define WINDOW_FINISHED 5 struct { int exitStatus; int window; }exitData; #define UNDEFINED 0 #define NEXT 1 #define BACK 2 #define FINISH 3 #define EXIT 4 #define CANCEL 4 int exitStatus; typedef unsigned long long rdd_count_t; static char *input_file; static void report_progress(rdd_count_t filesize, rdd_count_t copied, void *env) { PROGRESS *p = (PROGRESS *) env; double frac; char buf[16]; frac = ((double) copied) / ((double) filesize); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(p->progressbar), frac); snprintf(buf, 15, "%llu", copied); buf[15] = '\000'; gtk_label_set_text(GTK_LABEL(p->copiedLabel), buf); } static void read_file(char *path, void *env) { PROGRESS *p = (PROGRESS *) env; unsigned char buf[131072]; struct stat statbuf; rdd_count_t filesize = 0; rdd_count_t copied = 0; int fd; int n; if (stat(path, &statbuf) < 0) { perror("stat"); exit(EXIT_FAILURE); } filesize = statbuf.st_size; if ((fd = open(path, O_RDONLY)) < 0) { perror("open"); exit(EXIT_FAILURE); } while (1) { n = read(fd, buf, sizeof buf); if (n == 0) { break; } else if (n < 0) { if (errno == EINTR) continue; perror("read"); exit(EXIT_FAILURE); } copied += n; report_progress(filesize, copied, p); gtk_main_iteration_do(0); if (p->cancelled) { break; } } (void) close(fd); } static gboolean splash_timeout(gpointer data) { volatile int *timed_out = (volatile int *) data; *timed_out = 1; return FALSE; } static void show_splash_screen(void) { volatile int timed_out = 0; guint timeout_id; GtkWidget *winSplash; GladeXML *xml; xml = glade_xml_new("rddgui.glade", "winSplash", NULL); winSplash = glade_xml_get_widget(xml, "winSplash"); glade_xml_signal_autoconnect(xml); timeout_id = gtk_timeout_add(SPLASH_DURATION, splash_timeout, (int *) &timed_out); while (! timed_out) { gtk_main_iteration_do(1); } gtk_timeout_remove(timeout_id); gtk_widget_hide(winSplash); } gboolean bCancel_clicked(GtkObject *obj, gpointer env) { PROGRESS *p = (PROGRESS *) env; p->cancelled = 1; printf("CANCEL\n"); return TRUE; } static void show_progress(GladeXML *xml) { GtkWidget *copywin; GtkWidget *cancel; GtkWidget *msgDone; GtkWidget *msgCancelled; PROGRESS progress_info; gint result; progress_info.progressbar = glade_xml_get_widget(xml, "pbCopyProgress"); progress_info.copiedLabel = glade_xml_get_widget(xml, "lblBytesCopied"); progress_info.cancelled = 0; glade_xml_signal_connect_data(xml, "bCancel_clicked", GTK_SIGNAL_FUNC(bCancel_clicked), &progress_info); cancel = glade_xml_get_widget(xml, "bCancel"); gtk_widget_set_sensitive(cancel, TRUE); copywin = glade_xml_get_widget(xml, "copying"); gtk_widget_show(copywin); read_file(input_file, &progress_info); gtk_widget_set_sensitive(cancel, FALSE); if (progress_info.cancelled) { msgCancelled = glade_xml_get_widget(xml, "msgCopyCancelled"); (void) gtk_dialog_run(GTK_DIALOG(msgCancelled)); gtk_widget_hide(msgCancelled); } else { msgDone = glade_xml_get_widget(xml, "msgCopyDone"); (void) gtk_dialog_run(GTK_DIALOG(msgDone)); gtk_widget_hide(msgDone); } gtk_widget_hide(copywin); } gboolean Next_clicked(GtkWidget *widget, gpointer data){ GladeXML *xml; g_print("Next clicked\n"); //gtk_widget_hide(GTK_WIDGET(data)); exitStatus = NEXT; } gboolean Advanced_clicked(GtkWidget *widget, gpointer data){ GladeXML *xml; g_print("Advanced clicked\n"); //gtk_widget_hide(GTK_WIDGET(data)); exitStatus = 0; } gboolean Back_clicked(GtkWidget *widget, gpointer data){ GladeXML *xml; g_print("Back clicked\n"); //gtk_widget_hide(GTK_WIDGET(data)); exitStatus = BACK; } gboolean finishClicked(GtkWidget *widget, gpointer data){ GladeXML *xml; g_print("Finish clicked\n"); gtk_widget_hide(GTK_WIDGET(data)); exitStatus = FINISH; } gboolean cancelClicked(GtkWidget *widget, gpointer data){ GladeXML *xml; g_print("Cancel clicked\n"); gtk_widget_hide(GTK_WIDGET(data)); exitStatus = CANCEL; } gboolean exitClicked(GtkWidget *widget, gpointer data){ GladeXML *xml; g_print("Exit clicked\n"); gtk_widget_hide(GTK_WIDGET(data)); exitStatus = EXIT; } void showInput(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgInput", NULL); window = glade_xml_get_widget(xml, "dlgInput"); glade_xml_signal_connect_data(xml, "on_butNext_clicked", GTK_SIGNAL_FUNC(Next_clicked), window); glade_xml_signal_connect_data(xml, "on_butBack_clicked", GTK_SIGNAL_FUNC(Back_clicked), window); glade_xml_signal_connect_data(xml, "on_butAdv_clicked", GTK_SIGNAL_FUNC(Advanced_clicked), window); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); /* exitStatus = 0; while (!exitStatus) gtk_main_iteration(); if (exitStatus == NEXT){ g_print ("Exit status was NEXT\n"); showOutput(); } */ /* else if (exitStatus == BACK){ g_print ("Exit status was BACK\n"); } */ } void showOutput(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgOutput", NULL); window = glade_xml_get_widget(xml, "dlgOutput"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); /* glade_xml_signal_connect_data(xml, "on_butNext_clicked", GTK_SIGNAL_FUNC(Next_clicked), window); glade_xml_signal_connect_data(xml, "on_butBack_clicked", GTK_SIGNAL_FUNC(Back_clicked), window); exitStatus = 0; while (!exitStatus) gtk_main_iteration(); if (exitStatus == NEXT){ g_print ("Exit status was NEXT\n"); showConfirmation(); } else if (exitStatus == BACK){ g_print ("Exit status was BACK\n"); showInput(); } */ } void showConfirmation(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgConfirmation", NULL); window = glade_xml_get_widget(xml, "dlgConfirmation"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); /* glade_xml_signal_connect_data(xml, "on_butFinish_clicked", GTK_SIGNAL_FUNC(finishClicked), window); glade_xml_signal_connect_data(xml, "on_butBack_clicked", GTK_SIGNAL_FUNC(Back_clicked), window); exitStatus = 0; while (!exitStatus) gtk_main_iteration(); if (exitStatus == FINISH){ g_print ("Exit status was FINISH\n"); showImaging(); } else if (exitStatus == BACK){ g_print ("Exit status was BACK\n"); showOutput(); } */ } void showImaging(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgImaging", NULL); window = glade_xml_get_widget(xml, "dlgImaging"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); /* glade_xml_signal_connect_data(xml, "on_butCancel_clicked", GTK_SIGNAL_FUNC(cancelClicked), window); exitStatus = 0; while (!exitStatus) gtk_main_iteration(); if (exitStatus == CANCEL){ g_print ("Exit status was CANCEL\n"); showFinishedImaging(); } */ } void showFinishedImaging(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgFinishedImaging", NULL); window = glade_xml_get_widget(xml, "dlgFinishedImaging"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); /* glade_xml_signal_connect_data(xml, "on_butExit_clicked", GTK_SIGNAL_FUNC(exitClicked), window); glade_xml_signal_connect_data(xml, "on_butBack_clicked", GTK_SIGNAL_FUNC(Back_clicked), window); exitStatus = 0; while (!exitStatus) gtk_main_iteration(); if (exitStatus == EXIT){ g_print ("Exit status was EXIT\n"); //will be quitting app. } else if (exitStatus == BACK){ g_print ("Exit status was BACK\n"); showConfirmation(); } */ } void showSplash(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgSplash", NULL); window = glade_xml_get_widget(xml, "dlgSplash"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } void showProfile(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgProfile", NULL); window = glade_xml_get_widget(xml, "dlgProfile"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } void showInputAdv(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgInputAdv", NULL); window = glade_xml_get_widget(xml, "dlgInputAdv"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } void showOutputAdv(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgOutputAdv", NULL); window = glade_xml_get_widget(xml, "dlgOutputAdv"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } void showIntegrity(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgIntegrity", NULL); window = glade_xml_get_widget(xml, "dlgIntegrity"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } void showIntegrityAdv(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgIntegrityAdv", NULL); window = glade_xml_get_widget(xml, "dlgIntegrityAdv"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } void showErrorRecovery(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgErrorRecovery", NULL); window = glade_xml_get_widget(xml, "dlgErrorRecovery"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } void showErrorRecoveryAdv(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgErrorRecoveryAdv", NULL); window = glade_xml_get_widget(xml, "dlgErrorRecoveryAdv"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } void showStatistics(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgStatistics", NULL); window = glade_xml_get_widget(xml, "dlgStatistics"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } void showStatisticsAdv(){ GladeXML *xml; GtkWidget *window; int res; xml = glade_xml_new("simple-dialog.glade", "dlgStatisticsAdv", NULL); window = glade_xml_get_widget(xml, "dlgStatisticsAdv"); do{ res = gtk_dialog_run(GTK_DIALOG(window)); g_print("gtk_dialog_run returned %i\n", res); } while (res == 30); } int main(int argc, char **argv) { int rc; input_file = argv[1]; gtk_init(&argc, &argv); glade_init(); g_print("Start\n"); showInput(); #if 0 showSplash(); showProfile(); showInputAdv(); showOutput(); showConfirmation(); showImaging(); showFinishedImaging(); showOutputAdv(); showIntegrity(); showIntegrityAdv(); #endif showErrorRecovery(); showErrorRecoveryAdv(); showStatistics(); showStatisticsAdv(); //xml = glade_xml_new("copying/copying.glade", NULL, NULL); //show_progress(xml); g_print("End\n"); return 0; } rdd-2.0.7/gui/wizwin.c010064400000000000000000000243501042173111100134230ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "rdd.h" #include "rddgui.h" static void next_clicked(GtkWidget *widget, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; if (rdd_wizwin_next(ww)) { ww->result = RDDGUI_NEXT; } else { ww->result = RDDGUI_NONE; } } static void back_clicked(GtkWidget *widget, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; ww->result = RDDGUI_BACK; } static void finish_clicked(GtkWidget *widget, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; if (rdd_wizwin_next(ww)) { assert(ww->next == 0); ww->result = RDDGUI_FINISH; } else { ww->result = RDDGUI_NONE; } } static void advanced_clicked(GtkWidget *widget, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; ww->result = RDDGUI_ADVANCED; #if 0 rdd_wizwin_advanced(ww); #endif if (ww->advanced == 0) { rddgui_fatal(GTK_WINDOW(ww->window), "no advanced options (not implemented?)"); } (void) rdd_wizwin_run(ww->advanced); } static void ok_clicked(GtkWidget *widget, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; if (rdd_wizwin_next(ww)) { ww->result = RDDGUI_FINISH; } else { ww->result = RDDGUI_NONE; } } static void help_clicked(GtkWidget *widget, gpointer data) { RDD_WIZWIN *ww = (RDD_WIZWIN *) data; int rc; if (ww->help) { rc = rddgui_showhtml(ww->help); if (rc == RDD_NOTFOUND) { rddgui_error(GTK_WINDOW(ww->window), "No browser found"); } } ww->result = RDDGUI_NONE; } static void set_start_path(GtkFileSelection *filesel, const char *path) { struct stat pathinfo; size_t pathlen; char *dirpath; if (path == 0 /* no path given */ || (pathlen = strlen(path)) == 0 /* empty path */ || stat(path, &pathinfo) < 0) /* invalid path */ { return; /* do not set path; use current dir */ } if (! S_ISDIR(pathinfo.st_mode)) { /* The path refers to some sort of (special) file. */ gtk_file_selection_set_filename(filesel, path); return; } /* The path refers to a directory. Make sure the path ends * with a '/' character. */ if (path[pathlen-1] == '/') { gtk_file_selection_set_filename(filesel, path); return; } if ((dirpath = malloc(pathlen + 2)) == 0) { return; /* out of memory (ignored) */ } sprintf(dirpath, "%s/", path); gtk_file_selection_set_filename(filesel, dirpath); free(dirpath); } #if 0 static void path_entered(GtkFileSelection *filesel) { struct stat pathinfo; const char *path; path = gtk_entry_get_text(GTK_ENTRY(entry)); if (stat(path, &pathinfo) == 0) { /* Valid path. */ if (! S_ISDIR(pathinfo.st_mode)) return; set_start_path(filesel, path); } else { /* Bad path: assume it is a prefix of a valid path. */ char *pattern; if ((pattern = malloc(strlen(path) + 2)) == 0) { return; /* out of memory (ignored) */ } sprintf(pattern, "%s*", path); gtk_file_selection_complete(filesel, pattern); free(pattern); } browse_path(filesel); } #endif static void file_dialog(GtkWidget *widget, GtkEntry *entry, int save) { GtkWidget *filedialog; const char *title; gint result; char path[RDDGUI_MAX_FILENAME_SIZE]; title = save ? "Select output file" : "Select input file"; /* Use a GtkFileSelection. GtkFileChooser may be nicer, but * it requires a higher version of GTK. */ filedialog = gtk_file_selection_new(title); if (! save) { gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION(filedialog)); } if (rddgui_get_dir(gtk_entry_get_text(GTK_ENTRY(entry)), (char *)&path)) { set_start_path(GTK_FILE_SELECTION(filedialog), path); } else { set_start_path(GTK_FILE_SELECTION(filedialog), ""); } result = gtk_dialog_run(GTK_DIALOG(filedialog)); if (result == GTK_RESPONSE_OK) { const char *path = gtk_file_selection_get_filename( GTK_FILE_SELECTION(filedialog)); gtk_entry_set_text(entry, path); /* Bug fix: path must _not_ be freed! */ } gtk_widget_destroy(filedialog); } static void open_file_dialog(GtkWidget *widget, GtkEntry *entry) { file_dialog(widget, (GtkEntry *) entry, 0); } static void save_file_dialog(GtkWidget *widget, gpointer *entry) { file_dialog(widget, (GtkEntry *) entry, 1); } int rdd_new_wizwin(RDD_WIZWIN **self, const char *path, const char *name, #if 0 const char *help, #endif RDDGUI_OPTS *opts, RDD_WIZWIN_OPS *ops, unsigned statesize) { GladeXML *xml = 0; GtkWidget *widget = 0; RDD_WIZWIN *ww = 0; int rc = RDD_OK; void *state = 0; if ((ww = calloc(1, sizeof(RDD_WIZWIN))) == 0) { rc = RDD_NOMEM; goto error; } if ((state = calloc(1, statesize)) == 0) { rc = RDD_NOMEM; goto error; } /* How to release this stuff */ xml = glade_xml_new(path, name, NULL); widget = glade_xml_get_widget(xml, name); gtk_widget_hide_all(widget); if (strlen(name) > (RDD_MAX_WIDGET_NAME_LEN - 1)){ rc = RDD_ERANGE; goto error; } else { strcpy(ww->name, name); } ww->xml = xml; ww->window = widget; ww->opts = opts; ww->ops = ops; ww->state = state; /* Connect signals. A wizard window typically handles only * a subset of the signals connected below, but that's all * right. */ glade_xml_signal_connect_data(xml, "on_butNext_clicked", G_CALLBACK(next_clicked), ww); glade_xml_signal_connect_data(xml, "on_butBack_clicked", G_CALLBACK(back_clicked), ww); glade_xml_signal_connect_data(xml, "on_butFinish_clicked", G_CALLBACK(finish_clicked), ww); glade_xml_signal_connect_data(xml, "on_butAdv_clicked", G_CALLBACK(advanced_clicked), ww); glade_xml_signal_connect_data(xml, "on_butOK_clicked", G_CALLBACK(ok_clicked), ww); glade_xml_signal_connect_data(xml, "on_butHelp_clicked", G_CALLBACK(help_clicked), ww); /* Connect browse button signals. I assume that there is * a one-to-one correspondence between the name of a * browse button and the name of the text entry widget * that will hold the path name. */ glade_xml_signal_connect_data(xml, "on_butBrowse_clicked", G_CALLBACK(open_file_dialog), glade_xml_get_widget(xml, "entDevice")); glade_xml_signal_connect_data(xml, "on_butLogfile_clicked", G_CALLBACK(save_file_dialog), glade_xml_get_widget(xml, "entLogfile")); glade_xml_signal_connect_data(xml, "on_butOutput_clicked", G_CALLBACK(save_file_dialog), glade_xml_get_widget(xml, "entOutput")); glade_xml_signal_connect_data(xml, "on_butAdler_clicked", G_CALLBACK(save_file_dialog), glade_xml_get_widget(xml, "entAdlerFile")); glade_xml_signal_connect_data(xml, "on_butCRC_clicked", G_CALLBACK(save_file_dialog), glade_xml_get_widget(xml, "entCRCFile")); glade_xml_signal_connect_data(xml, "on_butEntropy_clicked", G_CALLBACK(save_file_dialog), glade_xml_get_widget(xml, "entEntropyFile")); glade_xml_signal_connect_data(xml, "on_butMD5_clicked", G_CALLBACK(save_file_dialog), glade_xml_get_widget(xml, "entMD5File")); if (ops->init) { (*ops->init)(ww); } *self = ww; return RDD_OK; error: *self = 0; if (state != 0) free(state); if (ww != 0) free(ww); return rc; } int rdd_free_wizwin(RDD_WIZWIN *ww) { return RDD_OK; } int rdd_wizwin_run(RDD_WIZWIN *ww) { RDD_WIZWIN *next = 0; gint result; while (1) { gtk_widget_show_all(ww->window); result = gtk_dialog_run(GTK_DIALOG(ww->window)); if (result == GTK_RESPONSE_DELETE_EVENT) { /* The user is deleting the dialog window. */ gtk_widget_hide_all(ww->window); return RDD_ABORTED; } if (result != 0) { /* Hmm, does this really make any sense? */ gtk_widget_hide_all(ww->window); return RDD_OK; } if (ww->result == RDDGUI_NONE) { continue; } next = ww->next; switch (ww->result) { case RDDGUI_NONE: break; case RDDGUI_ADVANCED: break; case RDDGUI_NEXT: next->prev = ww; gtk_widget_hide_all(ww->window); ww = next; next = 0; break; case RDDGUI_BACK: if (ww->prev != 0) { gtk_widget_hide_all(ww->window); ww = ww->prev; } break; case RDDGUI_FINISH: gtk_widget_hide_all(ww->window); return RDD_OK; } } return RDD_OK; } int rdd_wizwin_next(RDD_WIZWIN *ww) { RDD_WIZWIN_OPS *ops = ww->ops; RDD_WIZWIN *next; int rc; /* handler should set ww->next to an appropriate value */ ww->next = 0; if (ops->next != 0) { rc = (*ops->next)(ww); if (rc != RDD_OK){ return rc; } #if 0 if (strcmp(ww->next->name, "dlgConfirmation") == 0){ /* dlgConfirmation has to be updated every time * before it is shown. */ (ww->next->ops->init)(ww->next); } #endif } else { rc = 1; } next = ww->next; #if 0 if (next != 0 && next->ops->activated != 0) { (*next->ops->activated)(next); } #endif return rc; } void rdd_wizwin_advanced(RDD_WIZWIN *ww) { RDD_WIZWIN_OPS *ops = ww->ops; ww->advanced = 0; if (ops->advanced != 0) { (*ops->advanced)(ww); } } rdd-2.0.7/gui/help.c010064400000000000000000000126121042173111100130220ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include "rdd.h" #include "rddgui.h" static char *browsers[] = { "firefox", "konqueror", "mozilla", "mozilla-gtk2", "netscape", "galeon", "opera", 0 }; /* Checks whether browser exists in a directory on the user's PATH. * If there is no PATH, a default path is searched (/bin:/usr/bin). */ static int find_executable(const char *browser) { char *origpath = getenv("PATH"); char *path = 0; char *dir; unsigned bpathlen; char *bpath = 0; char *save = 0; int rc = RDD_NOTFOUND; if (origpath == NULL) { origpath = "/bin:/usr/bin"; /* default path */ } /* Strtok (used below) will modify the path, so we * copy the path. */ if ((path = malloc(strlen(origpath) + 1)) == 0) { rc = RDD_NOMEM; goto done; } strcpy(path, origpath); /* Try all directories. */ for (dir = strtok_r(path, ":", &save); dir; dir = strtok_r(NULL, ":", &save) ) { bpathlen = strlen(dir) + 1 + strlen(browser) + 1; if ((bpath = malloc(bpathlen)) == 0) { rc = RDD_NOMEM; goto done; } snprintf(bpath, bpathlen, "%s/%s", dir, browser); if (access(bpath, R_OK|X_OK) == 0) { rc = RDD_OK; goto done; } free(bpath); bpath = 0; } done: if (path != 0) free(path); if (bpath != 0) free(bpath); return rc; } /** \brief Starts a browser in a new process. */ static void start_browser(char *browser, char *url) { pid_t pid; char *newargv[3]; pid = fork(); if (pid < 0) { return; /* Fork failed. */ } else if (pid == 0) { /* This is the level-1 child process. We will fork again * to prevent the creation of a zombie process. (The * browser may exit before our parent process. Since * the parent will not wait() for the browser process, * the browser would become a zombie.) See [W.R. Stevens, * Advanced Programming in the Unix Environment, pp. 201-202, * Addison-Wesley, 1992]. */ pid = fork(); if (pid < 0) { return; /* Fork failed. */ } else if (pid > 0) { /* This is the level-2 parent process. It will exit * immediately; the root process will wait * for this process. */ exit(EXIT_SUCCESS); } /* This is the level-2 child process. This process * will run the browser. */ newargv[0] = browser; newargv[1] = url; newargv[2] = NULL; execvp(browser, newargv); _exit(EXIT_FAILURE); /* See the Unix programming FAQ */ } /* This is the level-1 parent process. It waits for the * level-2 parent process and then resumes GUI execution. */ if (waitpid(pid, NULL, 0) != pid) { /* XXX FIXME Error. */ } } /** Appends string s to buffer *p which has room for *len bytes. * Returns RDD_OK on success and RDD_ESPACE if there is insufficient * space in the buffer. Updates *p and *len. */ static int append(char **p, unsigned *len, const char *s) { unsigned slen = strlen(s); if ((slen + 1) > *len) { return RDD_ESPACE; } strcpy(*p, s); *p += slen; *len -= slen; return RDD_OK; } int rddgui_showhtml(const char *htmlfile) { char urlbuf[1024]; int buflen = sizeof urlbuf; char *p = urlbuf; unsigned i; int rc; /* Create a suitable URL. */ *p = '\000'; if ((rc = append(&p, &buflen, "file://")) != RDD_OK) { return rc; } if (htmlfile[0] != '/') { /* Relative path: prepend shared dir */ if ((rc = append(&p, &buflen, RDDGUI_DATADIR)) != RDD_OK) { return rc; } if ((rc = append(&p, &buflen, "/")) != RDD_OK) { return rc; } } if ((rc = append(&p, &buflen, htmlfile)) != RDD_OK) { return rc; } /* Find a browser. */ for (i = 0; browsers[i] != 0; i++) { rc = find_executable(browsers[i]); if (rc == RDD_OK) { start_browser(browsers[i], urlbuf); return RDD_OK; } else if (rc != RDD_NOTFOUND) { return rc; } } return RDD_NOTFOUND; } rdd-2.0.7/gui/minjuslogo-200.png010064400000000000000000000233751042173111100151310ustar00rootwheel‰PNG  IHDRÈÈ­X®ž pHYs ï ï}vŠHtIMEÔ ¨ÍžÏ IDATxœíÝ{XSwž?ðw‚ "H( 6ʈƒ7¬¶¶§nѹµvgwªÓÙ:Ýée;ÖÖiY§u¦Ï¶ÝVmŸ^ìØÙŽL»eÊ.U Šà¥x!´* DI Äá–ä„äûûÃ_Î !7Àêçõ<ù#''ßó='yŸó=ç|Ï9Æ!Ä£°é®!×2 !^P@ñ‚BˆB¼ €â„/( „xA!Ä !^P@ñ‚BˆB¼ €L’öövìÙ³ .DXXÂÂÂ0wî\ìÞ½p8†Óéœîª/ÔÝ=ôl6¶lÙ‚ýû÷Ãf³¹}ßüæ7X´hZ[[qçwâöÛo‡P(œ¦Úo( !ÒÞÞŽÆÆF´´´àÈ‘#(..ÆèE+ •J‘˜˜ˆ°°0  cþüùøðñbÅŠi¬=OøtWàÛŽã8=z»wïFSS`µZ݆þð‡¸÷Þ{‘žžŽãpìØ1ü×ý ŒF#äZÅH@œN'3ì'?ù ‰D €ÇWZZ+((`N§sLíííìöÛog………Ó0ÄÔÄ Ð¥K—ðïÿþïxÿý÷áp8<Ž#•JñöÛocÆ ˆŠŠò8NEEd2mA®Q?Y,ÔÔÔ ¡¡jµb±xÜqç΋‡~aaã,tÅò6™>´â§'NàñÇÇàà V¯^Ý»wC*•z7<<|Â?>ãÚFñ“V«…^¯A(â…^À¼yó¦·bdRP@ü¡P‡Ã§Ó‰¢¢"Øl6üíoƒD"™îê‘£í»ŸÿÞn·cÿþýøå/‰ššši¬™ ?Y,ŒŒŒŒ~ðàA<ýôÓP«ÕÓP+2Y( ~Љ‰ñØ-Än·ãøñãx衇pöìÙ1Ÿ;NX­VtttàÈ‘#hhh˜Šê’ Ña^?UUUáŸþéŸ`0<~. qË-· ¬¬ 2™Œn6›±gÏF¨Õjäææâ•W^™ªj“Q@ü488ˆßýîwxï½÷Æí‰‰ÖÖV( ~˜Óéä›fýýýp:˜5kÖ”Ô™ŽšX~ŠŽŽÆÓO?¥K—ŽÛ×étŽ9»Îƒ^¯Ço¼-[¶àèÑ£SQ]$ ˆŸ”J%ÊËËÇm"Ùíö10›Í¨««CZZ¶lÙ‚åË—OEuI( ’ËåX¼x±Û!ßÑ> ‹Å¿OHHÀOúS´¶¶B§ÓaÁ‚SUUÚ ‚ÅbÁÏ~ö3”——Ù‰ˆˆÀSO=…íÛ·»uT†@ €H$SžÍfCKK š››¡V«ÑÚÚŠžž„……A©T"55 ,Àüùó‘’’BÝT¦I‚T*Åoû[8œ:u —/_æ?³ÛíøË_þ‚¨¨(äååaáÂ…ˆ‰‰ADDl6ßÑÑb±àäÉ“¨¬¬Ä±cÇÐÖÖ†®®®1Ó‹ˆˆ€B¡@FF¾ÿýï#;;ÙÙÙt5â$¢-H âË/¿D[[úûûñÎ;ï¸ç‰DX°`ßMÅjµâ{ßûž}öYTWWc÷îÝ8|ø°ß×§K$üæ7¿Á~ð´··C¯×cxxÀ•ð*•J,X°)))J¥ã6Éø( !ƒÓéDoo/î¿ÿ~”••y?-- kÖ¬Á±cÇ ×ëÇ ‡@ @ZZ²³³¡ÕjqáÂØívþŠÅ¨¨(Èårôööºáˆˆˆ@jj*”J%îºë.Ü{ï½HNNÝLߨ‰"B¡ÑÑÑãv®toÏÈÈÀ³Ï>‹™3gâ“O>ñºå`Œá믿FVV}ôQÌ›7gΜÁþýûqþüy áÒ¥K˜1c¡P( “É ±XŒ3f@$¡«« åå娼y3mIü1Õ—0^ïìv;Û´iÓ¸—à._¾œ;vŒ9Næt:½Ž{õ+22’mÚ´‰577³ææföûßÿžedd°û￟°/¾ø‚µµµ1‹ÅÂ8Žcv»ŒŒ0‡Ãáñ’_21jbM‚ßþö·xýõ×݆EGGãž{îÁŽ;ššÊjooÇùóça±XÐÛÛ ½^ÖÖV\¸p&“ f³ÙíB¡ ,À®]»°téR˜ÍfDGG#<<R©ÔëÖ‹øšX“ÀS’7â¹çžÃܹs݆ßtÓM¸é¦›ø÷CCCDgg'Z[[qêÔ)?~çÏŸÇåË—áp8páÂ<üðÃÈÈÈ@XXÁC\\²²²p÷Ýw#++kÒçóF@ !§Ó‰ÎÎN ñÃbbb°yófìܹáá/n±X ±XŒ™3gbáÂ…X·nœN'ÚÛÛqâÄ ¼ÿþû8wîš››ÑÜÜ àÊþORRn½õV,\¸vÄCˆšX!¢V«ñ?ÿó?øì³Ï V«a6›!‹±}ûvlÙ²r¹<$ÓikkC}}=^yåTWWC.—cÆ ذa¾ûÝï†l:ä Ú‚addZ­û÷ïÇîÝ»ÝNîÅÄÄàÑGÅSO=åÓ–ÃWIIIà8·Ýv¾úê+Ü~ûíX»v-’’’²éÿo:|›]¾|™íß¿Ÿ­X±‚͘1Ãíh“@ `O=õëìì ùt ÙwÜÁ¢££&‹Ù¬Y³Ø-·ÜÂüqVSSÃ8Ž ùtoTô÷÷³Gy„ÅÄÄŒ9+‘H؃>Ȇ‡‡C6½¡¡!vðàAöóŸÿÜë]]ÉÍÍeo¾ù&ûòË/ÙåË—éo( ~²Z­ì…^`ÿ ?ÿùÏCºåhoog/¿ü2‹gÀçs&L©T²üü|vîܹÕçFCñƒÃá`/¿ü²Ç-‡P(dk×®ez½>$Ó2 ìµ×^cK—.7Œ¾¼KJJb>ø Û¿? Iýn?´´´°ÔÔTÄÜÜ\VUUô4Yyy9ûñÌ$IÀÁ¸úÆ’““Ù3Ï<ÃNž<ÉG–Èõ⣑‘¶wï^¾¤¤$¦V«ƒj댌0FÃ~ñ‹_0©T²`xÚ¢Èd2¶uëVÖÜÜLû' €øh``€ýë¿þë˜?œT*e¯¿þzÐ岻ロÉd2&‹™P(œ´`"‘ˆåää°0›Í‚%t}¢ó >r:nDW.`z衇°iÓ¦ ÊfŒñb3›Í0›ÍüõZ­ƒÝÝÝèïïG__l6[ÐÏ6ä8õõõxõÕW!‹±fÍš Ê»^Q@|5æÕË–-Ãã?îvÿ«@¾ÿ–«›c ÇÁf³ahh}}}èîîFmm-ª««qôèQ˜Í性ŽM›6á±ÇÃìÙ³ƒªÿumº7aß&555üyˆÅ‹‡d§<v»]ºt‰}ñÅlûöíì¶Ûn›ðüÈÕ/@ÀRSSÙž={XOOÏ´ÌÇ·Ä‹…ååå1ìÍ7ß÷©ëZ©`³ÙXKK {ë­·Xvv6 ó+( ìßþíß($ã €øéÌ™3ì÷L9Çqìµ×^c½½½>—ét:™Íf úЫÝngeeeì§?ý)‹ŠŠò+(999¬²²2¨é_¨7¯Ÿ†‡‡ÑÓÓãv[ÑÑôz=þå_þ}ô½–eµZQQQÆÆFtvv"!!·Ür n½õVÄÆÆT?§Ó £Ñˆ×_ûÛß<ÞÅ“°°0,Z´¯¾ú*V­Z…ˆˆˆ€¦Ý™î„^o8À¢££Yqq±×fÖÙ³gÙ½÷Þ;æ,yTTûÞ÷¾ÇÔjuP[»ÝÎJJJ˜\.÷«‹ÊÌ™3Ùo¼ÁFFFžöõ„bï¾û.ìî»ïöØíÄáp°cÇŽ±eË–±ðððqÏzçää°#G޵/ãp8ØÛo¿Íýjn%%%±}ûö1»ÝÌ¢¸.Ÿþùç§bKu£8}ú4ÊÊÊ ÓéÐÒÒ‚E‹!66B¡øàƒ°uëVp‡U«V¡¿¿6›ÍíºsÆŒF#ÿ…Ù³gcÆŒ~×E  33—/_Fee¥Ïß³Z­8qâFFFpë­·†ôz–oéNèõ¦¨¨ˆßAlÙ²eìü#Û¿?{ì±ÇXll,Àzè!f±XاŸ~Ê~ñ‹_Œ¹¦Äõ’Édì±Ç ªÉsòäɀζ‹ÅböÑGÝÐÍ- Hˆuuu± 6Œù³]½¯qèÐ!þ;DZóçϳ·ß~›ÝvÛmcÂÎxàÖÚÚPÚÚÚî’róÍ7³„hé|ûP@BÌét2•JÅâãã½öƒò´Âqklldýë_ÙâÅ‹Ydd¤ÛÎûý÷ßÏúûûý®“Ñh 8 aaa,//ï†=OB™$_~ù%»óÎ;=Aš3g΄ÍŽãØ… Ø#<Â233ùú»îº‹?Þ¯ºœ8q"à€¸^=öf‘|+Q@&‰Óédjµš-]ºtÌŸíW¿ú•Ïå ²úúzöÎ;ï°;ÅÄİ; Ÿ¾ùòe¶}ûö rÓM7±²²²@Ç·d’]}kQ‘HÄÞ{ï½€Êdü1»ï¾ûØÆÙ±cǼޠÁáp°ÿþïÿfsæÌ : €Ýu×].†o­øøÝÔˆ‹‹s{/‹Ç= ?×íKïºë.455A­VÃétbåÊ•né®tgÿôÓOñì³ÏÂh4\ÆΜ9t9ß6I–””äö~æÌ™c†ùC("..999ÈÉÉ៻ît:Ñ×ׇÞÞ^ôõõáСC8wîܘ‡‰cô#oI‡ˆˆØívWîŲò“““ñ£ýf³*• û÷ïGUUº»»C6 —ñ„á7ÇSL¡P ..€ÜÜÜ ¶ žÌœ9?üá±fÍ\¼x§N‰'PUU…o¾ù&è-IdddÐWN~Q@&Ù¬Y³ËdáÂ…cöB)** ‹-ÂÂ… ±aÃÔÖÖ¢®®*• õõõhmmõ»L±XŒÍ›7ãÉ'Ÿœ„_Û( “,!!111®üÑ.\8%Ó …HLLÄÚµk±víZŒŒŒ ³³UUUP©TP«Õèèè@ww7ìv;ìv;œN'©TŠÄÄD,_¾?ùÉO°jÕªòÞ¿I6cÆ ¾£áüùóqóÍ7OK=ÂÃÑœœŒ 6àÞ{ïEoo/.]º„îîn óÏ …ˆŠŠBll,0gΜú)ºIæzÞp¥yÊô@ ÄÇÇ_u¹ÖÑ“è'YTTf̘°°°1wE!×> È$ …ÈÈÈ€B¡Àm·Ý6ÝÕ!~¢€L2@€9sæ@.—#--mº«CüD™daaaX¼x1RRRB~þƒL>ÚIŸÇÁ`0Àh4¢µµõõõˆ‹‹»!ÏDÛÑ/$›Í†ææf|óÍ7èêê™3gPWW‡ÖÖVtwwƒã8Àw¾óœ?¹¹¹Ó\câ Hjkkñûßÿ:½½½à8Îã¥u:>þøcäää@ LCMI h$HGE{{;8€;v`ÅŠÏ8ŒŒàïÿ;êëë§¡–$P 8NÔ××Ã`0`öìÙØºu+öíÛ‡_ÿú×÷7L&Š‹‹ÇøÀc/`2½( ~ª©©ÁÅ‹Çý¼©© —.]ò¹¼ÄÄDüçþ'ÊÊÊ`2™BQEB?i4þ"(Oôz½ßw/T(Ðétøê«¯‚­ 1 ˆz{{qðàA¯ãtuuA¯×ûUnGGt:ÊÊÊ‚¨™ ?´··C§Óy‡ã8¿Oþét:p‡ššØl¶`ªHBŒâ#»ÝÎ?;ÜÆŠŠŠ|ÞáfŒ¡¸¸Œ1œ={åå塨.  ˆpêÔ)ŸÆmkksëúîÍàà ¿Ï222‚ªª*ÚŠ\C( >êèèÀùóç}·¯¯o¦˜‹ÉdBGGÿ¾¤¤Äc72=( >êììôؽÄÆ***|·©©Éíì{[[jkkª# = ˆT*•[÷ö‰œ={Ö§›3\¸pÁíB«ÁÁAüõ¯¥“†× ˆœN'JKKý:CÞÝÝíS÷‘«Ï™0ÆPSSãÖì"Ó‡â³Ùì÷Hššš|ê¥ë©ï–ÍfßÿügÚŠ\( >8yò¤ß@îììœð„¡Õj÷æuuut4ë@™Çq8tèßß™ð¨WUUÕ¸ý¶êëëigý@™@WW—×ΉÞ477{ý\­VcxxØãgíííøì³Ïš.  Èêêê V«úîÅ‹Ç=’e·Û¡ÑhÆÝñ·Ûí8tè_GÎHèQ@&ÐØØðÅL—.]w+âí3—¯¾ú*àp’Р€xát:qàÀ€oðf6›QSSãñ3ƒÁ0áQ.ŽãðÉ'ŸøÜm…„Ä‹ÞÞ^¨Tª€¿ÏÃÅ‹=6£ºººÐÓÓ3a'Nœ@[[[Àu Á¡€xÑÐлÝTçÎóØEåøñããî ¦ÓépìØ± ê@Gñ"÷ÎÕétc.¥u:>ßá}pp‡º$0/F?¶ P&“iÌÜ]Ï5ô…ÓéÄ矎þþþ ëBüGñB©TB&“UÆàà 4Û°††¿ŽŒõööÒVdšP@¼¸é¦›ðÚk¯A©T\†Ãáp»Öœ1†òòr¿úY9NÁb±\ È6n܈7ß|sæÌ èûŒ1455ñ—êrçsój´úúzºjP@&µk×âóÏ?Ç«¯¾ŠyóæñO‹òÕ×_ͤ¯¯ÏﻞWº­:tˆnt=Å( >JJJ£>Š>ø>ú( …Ç'Ùz" ùg£÷÷÷£¯¯/ :=zÔ§CÃ$t( ~ˆŒŒÄ­·ÞŠ;wB¯×ãÌ™3غu+òòò P(<>]¡P`Û¶müg ~Ýyq´“'OÒÍ妘o«@2†H$Bvv6-Z„®®.\¸pmmmhooÇÀÀœN'bcc±|ùr¬\¹’ÿÞùóçÞ‚@ii)–.] ±XŠÙ  €I,cΜ9>ïÄ×ÕÕÕL*--ÅæÍ›1þü€Ë ¾£&Ö²Z­A?r­­­ÍëÝåIhQ@¦Z­øâ+—ÞÞ^üýïQÈD( S¨µµ5è®ë®;¬Ð3Ö§dŠp‡sçÎ…¤,“É„?þ˜Î‰L Èéééñúu=zÔësJHhP@¦HGG‡ÏÏ/ôÅÑ£GǽZ‘„dŠtvvút¡¯L&>ÿüó•G<£€L•J…ÁÁÁ•g·Ûñá‡R3k’Q@¦ÈçŸôå»W««« ¨ã#ñdŠ455…ü¨ÓÈÈŽ=:áS¯Hà( S¤»»{RÊ=räˆÏÏ-!þ£€L‘É:gQ]]úúúI)›P@¦LJJʤ”Û×ׇÒÒÒI)›P@¦Ì¯~õ+̘1#äår‡’’’!#ÿ‡2E~ö³Ÿ!//oRÊnoo§»žL ÈIKKË/¾ˆììlˆD¢–m·ÛqðàAºwP@¦Pff&víÚ…%K–„¼ìÆÆF´··‡¼Üd ………áþáðÙgŸaÇŽ˜;w.3rm¢€Lƒèèh<ù䓨»w/V®\‰èèè ËÌÈÈ@rrrjGF0º¨`Z9N466âÝwßÅñãÇÑÔÔäW—”ˆˆ¬X±………˜={ö$ÖôÆD¹FX,455¡ªª :hmmE[[›ÇǸ%$$ ==k׮źuë°lÙ²i¨õõrF__,‹Ç-Jtt4är9$É4ÔîÆA!Ä ÚI'Ä !^P@ñ‚BˆB¼ €â„/( „xA!Ä !^P@ñ‚BˆB¼ð; &“ ;vì€V«u^QQ—^z)d#äZàw@ Ôj5Ìf³Ûp‰D‚ÚÚÚUŒkÁ¸®®®FGGär9¤R)233Q[[‹ááa˜L&~<“É­V‹ÚÚZº?¹îŒ»aŒa×®]°X,€;v`xx¹¹¹Ë宄#??Ë—/GVVÖÔÔ˜)䵉¥P(°~ýzdeeA¥R!-- "‘ˆ¿ñYII æÏŸ‰Dâ6œë…Ïû Çaxx‡ÃíÄ®Ç_=œë×€Œ~¦wnn. PQQƒÁ«ÕŠõë×C¥R¡¸¸'OžtÛ7!äz0îMÔj5, är9ÒÓÓZ­R©‹Ç!==ÇA«Õ"==Z­ … …bJg‚ÉBw5!Ä :“NˆB¼ €â„/( „xA!Ä‹q244äñÌøè“‡ßf0|KŽã`2™`2™&ìti2™púôi ù4²²²€ëi±XPYY9¦÷ôhf³F£Ñí5ÙGûúú Óé|×jµ¢¢¢bÜy]ÿ@i4Ÿ~y ˆV«EII‰Ç/¨T*TWW^\\ŒââbògÔ+++QZZŠÂÂB~¼ŠŠ TTT ¸¸ÇÁl6ã­·Þâ‡yRYY‰‚‚ðe×ÖÖ¢¤¤ÅÅÅü‚÷4=׸»vírf2™°uëV·ù¬­­õ¹Ë~~~¾×?­‹ÙlÆsÏ=çS™ãÙµkטëo®¶sçN~œÊÊÊ ÇVmm-vïÞíóøÍC~~>Ôjµ_uÝs#??z½~Ìð@Ës¡¡!¼ÿþû¸ï¾û  a±X`0ø3ë¹¹¹Ø»w«««±~ýz aÏž=¨««Ãûï¿uëÖÁd2¡  Z­ûöíêU«PWW‡Ã‡£¬¬ )))Xµj Æ,¤––”••aÓ¦MP(ÈÏÏÇqxñűtéR¾¾ž¦çª[AAT*•[¹r¹¹¹¹xã7púôiˆD"ÄÇÇ#>>"‘ˆŸo­Vë¶•Ñét°Ùlü0‡Ã£ÑN‡ÎÎN¾gk™‰D"DFFòÓu wýZ­&“ ƒ*•jL¹===nO¯5™Lc®Ç‘Ëå0‹ÅHIIÁ}÷ݹ\Žã Ñh Ñhø-¿«n†þÈèù4›Íüo][[ ƒÁàV×÷ÒÓÓñðÃóËE«Õºýv:&“ ‰‰V«µµµc‚"—Ëa³Ù‹¡¡!ÔÕÕÁjµB­VC£Ñð-×¥&“ ---øõ¯ÚÚZ˜L&¼ð HIIAee%ž~úi~«Õj~¾\—d¸Ê½Á`3Ÿf³ùùù8yò$, òóóùP«T* þ½k¹¹æÉU§’’ÔÖÖÂjµò[ZW8\å{[ËïܹûöíÇqرc×ïà*ǵŮ\ŽqñâE˜L&ttt_³ÙÌ·\õuµ***°oß¾1幌 H__„B!€+k»ÊÊJ,_¾[¶lÁæÍ›\IüÕÍ ™L†––8<ðÀnm`Wp¬V+¿6u ‹Å …8~üÖÚâ°IDAT8xद¦Âd2A¥RA­VC(òe766âÅ_„ÅbP(ä_£×è£Ëv5SSSÇý1þùŸÿ+V¬Àþð¾ k0øÈqJJJpúôitvvB©Tº=ƹ¨¨6› 6› :Ž_‹¦§§ã•W^q[Ù¸™& QWW‡¾¾>~­Ÿ™™‰uëÖñ²½{÷â»ßý.ÒÓÓù2:::pðàAÔÕÕaùòånóá ÏÎ;ù&–J¥ÂêÕ«‘‘‘¶¶6œ>}b±‰‰‰xöÙg!“ÉÆÌgtt4:;;±nÝ:¬Zµ ÃÃÃèèèà·ÄÃÃÃP(ˆ…ÍfÔÔÔ ¨¨J¥}}}xã7ðýï+V¬ÀŸþô'þIXwÜqÖ¬YÿŒ ‹144„¬¬,deeA¡P@¯×Ãl6£¤¤7ß|3 ¤R)?på©\©©©ËåÈÌÌDzz::;;áp8 “É044‘H©Tʯ¸Ñ××çVÞè•´×£Xüu®Íäx\kñGyr¹"‘ÈíO+•JùŽŽ£‡q‡ŠŠ dffâž{îðM6ןM«ÕB¯×ãᇆD"á¿ç*_*•Ž™^dd$ÊËË¡ÕjQXX­Vëq­+‰ðÈ#ð[×|»ÌŸ?O<ñ, ¯Þq÷4ŸãÉÉÉÁ=÷܃]»vÙŸûÝï~ŽãŸŸÏ¯å]󪎫éé騲e ñôÓO‡¤L_Œ Hrr2ÿ£/Z´V«¥¥¥P«Õü¬ÉdBZZÿ׎¶ÉdÂðá‡òßBYY6n܈uëÖA«Õòk÷5kÖàðáÃøâ‹/PSSƒââbTVV"++ O<ñ6nܓɄ·ß~f³(**BJJ d2¿ÆÎÍÍ3½M›6aûöíØ¶mÖ¯_¥R‰•+Wòuv8üC.—㥗^BQQ?ß‘‘‘°Z­üÖR©T¢¥¥_~ù%ýË’%KÐÙÙ‰ääd·?ìèý—ÊÊJ~íd³ÙÐÙÙ 8)•J?~†ß·Q©TX²d þüç?ãâÅ‹nÓ}Ô155éééJ¥ü¥ V«•¯kzžæÓåê:µ´´ ##[·nåëíRQQ?ýéOXµjV®\‰]»vñ-«ÕÊ//×ëêò¯>jzõçZ­‰ÿñÿ›ÍÆ·®>z޾¾>þh¤P(ä÷‡úúúÀqär9ôz=ßTtç©<áóÏ?ÿüèŠDGGãÀ¸óÎ;!‘H‘‘ƒÁÀï7ô÷÷£ººš_Û»Þ… `2™`4‘––†ÜÜ\Ìž=:ÉÉÉÈË˃L&ƒ\.‡Éd¼yóºº:èõzþ0_^^ž[³Äd2A£Ñ µµF£2™ ÙÙÙP*•èììDll,V¯^¤¤¤1Ó …°Z­Ðh4H$HOOÇŒ30›ÍHLL„T*Ebb"±páB$&&B©TÂ`0Àf³aÑ¢EHKKƒR©DCCär9”J%òòòÐÓÓƒ®®.Ìœ9‰‰‰0™L …HKKCoo/’’’››‹††Ìš5 ‰J¥½½½ˆŒŒÄ¼yó`2™Žôôt¬X±‚ßñ–ÉdˆGzz:¿ƒþãÿJ¥’ÿó @*•"%%"‘ÑÑÑÈÈÈ@cc#L&òòò™™ FƒÈÈHÌ™3r¹|Ì| Àáp !!‡ýýýHLLDrr2¿Ã¾víZ˜L&DGGó+ʯ¿þr¹?úÑ““£Ñ«ÕÊ7o{{{ùeÝÓÓƒ„„Ìž=B¡Ð­þ èéé\.‡L&Ã7ß|ƒèèh,^¼:CCCX½z5¿pÕwdd„ÿý†††ÄÄDþ†R©„D"\.GVV Äb1âââŽeË–A.—c``J¥ÆéînµZQ^^Žõë×¹Œ¶¢¢ééé^Ûõ„\/èzB¼ ®&„xA!Ä !^P@ñ‚BˆB¼ €â„/( „xA!Ä !^P@ñ‚BˆB¼ €â„/þ+ZÉ·Xƒ:‘IEND®B`‚rdd-2.0.7/gui/guilogprinter.c010064400000000000000000000107631042173111100147710ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "rdd.h" #include "rddgui.h" #include "rdd_internals.h" #include "msgprinter.h" typedef struct _RDD_GUILOG_MSGPRINTER { GtkTextBuffer *textbuf; GtkTextTag *info_tag; GtkTextTag *warn_tag; GtkTextTag *debug_tag; GtkTextTag *error_tag; gint maxline; } RDD_GUILOG_MSGPRINTER; static void guilog_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg); static int guilog_close(RDD_MSGPRINTER *printer, unsigned flags); static RDD_MSGPRINTER_OPS guilog_ops = { guilog_print, guilog_close }; int rdd_mp_open_guilog_printer(RDD_MSGPRINTER **printer, GtkTextBuffer *textbuf) { RDD_GUILOG_MSGPRINTER *gui = 0; RDD_MSGPRINTER *p = 0; int rc = RDD_OK; GtkTextIter start; GtkTextIter end; rc = rdd_mp_open_printer(&p, &guilog_ops, sizeof(RDD_GUILOG_MSGPRINTER)); if (rc != RDD_OK) { goto error; } gui = (RDD_GUILOG_MSGPRINTER *) p->state; gui->textbuf = textbuf; gui->maxline = 1000; gui->info_tag = gtk_text_buffer_create_tag(textbuf, "info", "foreground", "black", NULL); gui->warn_tag = gtk_text_buffer_create_tag(textbuf, "warn", "foreground", "blue", NULL); gui->debug_tag = gtk_text_buffer_create_tag(textbuf, "debug", "foreground", "brown", NULL); gui->error_tag = gtk_text_buffer_create_tag(textbuf, "error", "foreground", "red", NULL); /* Delete all text in the text buffer. */ gtk_text_buffer_get_start_iter(textbuf, &start); gtk_text_buffer_get_end_iter(textbuf, &end); gtk_text_buffer_delete(textbuf, &start, &end); *printer = p; return RDD_OK; error: *printer = 0; if (gui != 0) free(gui); return rc; } static void guilog_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg) { RDD_GUILOG_MSGPRINTER *gui = (RDD_GUILOG_MSGPRINTER *) printer->state; GtkTextBuffer *textbuf = gui->textbuf; GtkTextIter end; GtkTextTag *tag; gint nline; switch (type) { case RDD_MSG_INFO: tag = gui->info_tag; break; case RDD_MSG_WARN: tag = gui->warn_tag; break; case RDD_MSG_DEBUG: tag = gui->debug_tag; break; case RDD_MSG_ERROR: tag = gui->error_tag; break; default: return; } nline = gtk_text_buffer_get_line_count(textbuf); if (nline >= gui->maxline) { /* Too many lines; delete the oldest line. */ GtkTextIter line0; GtkTextIter line1; gtk_text_buffer_get_iter_at_line(textbuf, &line0, 0); gtk_text_buffer_get_iter_at_line(textbuf, &line1, 1); gtk_text_buffer_delete(textbuf, &line0, &line1); } /* Append new line. */ gtk_text_buffer_get_end_iter(textbuf, &end); gtk_text_buffer_insert_with_tags(textbuf, &end, msg, strlen(msg), tag, NULL); gtk_text_buffer_insert_at_cursor(textbuf, "\n", 1); } static int guilog_close(RDD_MSGPRINTER *printer, unsigned flags) { RDD_GUILOG_MSGPRINTER *gui = (RDD_GUILOG_MSGPRINTER *) printer->state; memset(gui, 0, sizeof *gui); return RDD_OK; } rdd-2.0.7/gui/guiprinter.c010064400000000000000000000057221042173111100142660ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rdd.h" #include "rddgui.h" #include "rdd_internals.h" #include "msgprinter.h" typedef struct _RDD_GUI_MSGPRINTER { int dummy; /* prevent empty struct */ } RDD_GUI_MSGPRINTER; static void gui_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg); static int gui_close(RDD_MSGPRINTER *printer, unsigned flags); static RDD_MSGPRINTER_OPS gui_ops = { gui_print, gui_close }; int rdd_mp_open_gui_printer(RDD_MSGPRINTER **printer) { RDD_GUI_MSGPRINTER *gui = 0; RDD_MSGPRINTER *p = 0; int rc = RDD_OK; rc = rdd_mp_open_printer(&p, &gui_ops, sizeof(RDD_GUI_MSGPRINTER)); if (rc != RDD_OK) { goto error; } gui = (RDD_GUI_MSGPRINTER *) p->state; gui->dummy = -1; *printer = p; return RDD_OK; error: *printer = 0; if (gui != 0) free(gui); return rc; } static void gui_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg) { switch (type) { case RDD_MSG_INFO: rddgui_info(0, "%s", msg); break; case RDD_MSG_ERROR: rddgui_error(0, "%s", msg); break; case RDD_MSG_WARN: rddgui_warn(0, "%s", msg); break; case RDD_MSG_DEBUG: rddgui_info(0, "%s", msg); break; } } static int gui_close(RDD_MSGPRINTER *printer, unsigned flags) { RDD_GUI_MSGPRINTER *gui = (RDD_GUI_MSGPRINTER *) printer->state; memset(gui, 0, sizeof *gui); return RDD_OK; } rdd-2.0.7/gui/Makefile.in010064400000000000000000000430171042173154100140050ustar00rootwheel# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : @GCC_COMPILER_TRUE@am__append_1 = -W -Wall -Wmissing-prototypes bin_PROGRAMS = rdd-gui$(EXEEXT) noinst_PROGRAMS = rdd-main$(EXEEXT) subdir = gui DIST_COMMON = $(dist_pkgdata_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_rdd_gui_OBJECTS = rddgui.$(OBJEXT) wizwin.$(OBJEXT) init.$(OBJEXT) \ inputwizwin.$(OBJEXT) inputadvwizwin.$(OBJEXT) \ outputwizwin.$(OBJEXT) confirmationwizwin.$(OBJEXT) \ networkwizwin.$(OBJEXT) imageorverifywizwin.$(OBJEXT) \ integritywizwin.$(OBJEXT) recoverywizwin.$(OBJEXT) \ statswizwin.$(OBJEXT) serverwizwin.$(OBJEXT) \ finishedwin.$(OBJEXT) util.$(OBJEXT) splash.$(OBJEXT) \ help.$(OBJEXT) guiprinter.$(OBJEXT) guilogprinter.$(OBJEXT) \ outputfile.$(OBJEXT) plotentropyblockfilter.$(OBJEXT) rdd_gui_OBJECTS = $(am_rdd_gui_OBJECTS) rdd_gui_DEPENDENCIES = ../src/librdd.a am_rdd_main_OBJECTS = winmain.$(OBJEXT) wizwin.$(OBJEXT) \ init.$(OBJEXT) inputwizwin.$(OBJEXT) inputadvwizwin.$(OBJEXT) \ outputwizwin.$(OBJEXT) confirmationwizwin.$(OBJEXT) \ networkwizwin.$(OBJEXT) imageorverifywizwin.$(OBJEXT) \ integritywizwin.$(OBJEXT) recoverywizwin.$(OBJEXT) \ statswizwin.$(OBJEXT) finishedwin.$(OBJEXT) util.$(OBJEXT) \ splash.$(OBJEXT) help.$(OBJEXT) guiprinter.$(OBJEXT) \ outputfile.$(OBJEXT) rdd_main_OBJECTS = $(am_rdd_main_OBJECTS) rdd_main_DEPENDENCIES = ../src/librdd.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(rdd_gui_SOURCES) $(rdd_main_SOURCES) DIST_SOURCES = $(rdd_gui_SOURCES) $(rdd_main_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; dist_pkgdataDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_pkgdata_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBGLADE_CFLAGS = @LIBGLADE_CFLAGS@ LIBGLADE_LIBS = @LIBGLADE_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RDD_GUI_FALSE = @RDD_GUI_FALSE@ RDD_GUI_TRUE = @RDD_GUI_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AM_CFLAGS = $(GTK_CFLAGS) $(LIBGLADE_CFLAGS) $(am__append_1) AM_CPPFLAGS = -DPKGDATADIR=$(pkgdatadir) -I../src -DPLOT_ENTROPY # Unfortunately, I have not found m4 macros for libglade-2.0, # so I had to add these paths manually AM_LDFLAGS = $(GTK_LDFLAGS) $(LIBGLADE_LIBS) rdd_gui_SOURCES = rddgui.c \ wizwin.c rddgui.h init.c \ inputwizwin.c inputadvwizwin.c outputwizwin.c \ confirmationwizwin.c networkwizwin.c imageorverifywizwin.c \ integritywizwin.c recoverywizwin.c statswizwin.c \ serverwizwin.c \ finishedwin.c \ util.c splash.c help.c \ guiprinter.c guilogprinter.c \ outputfile.c plotentropyblockfilter.c rdd_gui_LDADD = ../src/librdd.a rdd_gui_LDFLAGS = $(AM_LDFLAGS) rdd_main_SOURCES = winmain.c \ wizwin.c rddgui.h init.c \ inputwizwin.c inputadvwizwin.c outputwizwin.c \ confirmationwizwin.c networkwizwin.c imageorverifywizwin.c \ integritywizwin.c recoverywizwin.c statswizwin.c \ finishedwin.c \ util.c splash.c help.c \ guiprinter.c \ outputfile.c rdd_main_LDADD = ../src/librdd.a rdd_main_LDFLAGS = $(AM_LDFLAGS) dist_pkgdata_DATA = rddgui.glade minjuslogo.png minjuslogo-200.png \ html/rddgui.html html/helpstyle.css all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu gui/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) rdd-gui$(EXEEXT): $(rdd_gui_OBJECTS) $(rdd_gui_DEPENDENCIES) @rm -f rdd-gui$(EXEEXT) $(LINK) $(rdd_gui_LDFLAGS) $(rdd_gui_OBJECTS) $(rdd_gui_LDADD) $(LIBS) rdd-main$(EXEEXT): $(rdd_main_OBJECTS) $(rdd_main_DEPENDENCIES) @rm -f rdd-main$(EXEEXT) $(LINK) $(rdd_main_LDFLAGS) $(rdd_main_OBJECTS) $(rdd_main_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/confirmationwizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finishedwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guilogprinter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guiprinter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/help.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imageorverifywizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inputadvwizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inputwizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/integritywizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networkwizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/outputfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/outputwizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plotentropyblockfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rddgui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recoverywizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serverwizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statswizwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winmain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wizwin.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: install-dist_pkgdataDATA: $(dist_pkgdata_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)" @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ $(dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ done uninstall-dist_pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/html @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dist_pkgdataDATA install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_pkgdataDATA \ uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dist_pkgdataDATA install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-dist_pkgdataDATA \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: rdd-2.0.7/src004075500000000000000000000000001043501433500116625ustar00rootwheelrdd-2.0.7/src/fileprinter.c010064400000000000000000000076121042173111100144240ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rdd.h" #include "rdd_internals.h" #include "msgprinter.h" typedef struct _RDD_FILE_MSGPRINTER { char *path; FILE *stream; } RDD_FILE_MSGPRINTER; static void file_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg); static int file_close(RDD_MSGPRINTER *printer, unsigned flags); static RDD_MSGPRINTER_OPS file_ops = { file_print, file_close }; int rdd_mp_open_file_printer(RDD_MSGPRINTER **printer, const char *path) { RDD_FILE_MSGPRINTER *file = 0; RDD_MSGPRINTER *p = 0; char *path_copy = 0; int rc = RDD_OK; FILE *fp = NULL; rc = rdd_mp_open_printer(&p, &file_ops, sizeof(RDD_FILE_MSGPRINTER)); if (rc != RDD_OK) { goto error; } if ((path_copy = malloc(strlen(path) + 1)) == 0) { rc = RDD_NOMEM; goto error; } strcpy(path_copy, path); file = (RDD_FILE_MSGPRINTER *) p->state; if ((fp = fopen(path, "rb")) != NULL) { /* File exists */ rc = RDD_EEXISTS; goto error; } if ((fp = fopen(path, "w")) == NULL) { rc = RDD_EOPEN; goto error; } file->stream = fp; file->path = path_copy; *printer = p; return RDD_OK; error: *printer = 0; if (fp != NULL) (void) fclose(fp); if (path_copy != 0) free(path_copy); if (file != 0) free(file); return rc; } static void file_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg) { RDD_FILE_MSGPRINTER *file = (RDD_FILE_MSGPRINTER *) printer->state; fprintf(file->stream, "%s\n", msg); } static int file_close(RDD_MSGPRINTER *printer, unsigned flags) { RDD_FILE_MSGPRINTER *file = (RDD_FILE_MSGPRINTER *) printer->state; struct stat fileinfo; mode_t ro_mode; if (file->stream != NULL) (void) fclose(file->stream); if (file->path != 0) { if ((flags & RDD_MP_READONLY) != 0) { /* Make the file read-only. */ memset(&fileinfo, 0, sizeof fileinfo); if (stat(file->path, &fileinfo) < 0) { return RDD_ECLOSE; } /* fileinfo.st_mode holds the permission bits _and_ * the file-type bits. Get rid of the file-type bits * and switch off the write-permission bits. */ ro_mode = fileinfo.st_mode; ro_mode &= ~(S_IFMT|S_IWUSR|S_IWGRP|S_IWOTH); if (chmod(file->path, ro_mode) < 0) { return RDD_ECLOSE; } } free(file->path); } memset(file, 0, sizeof *file); return RDD_OK; } rdd-2.0.7/src/console.c010064400000000000000000000103341042173111100135360ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "error.h" #define MAX_WRITEBUF 256 #define MAX_LINE 80 static int console_fd = -1; static int quiet = 0; void rdd_set_quiet(int q) { quiet = q; } static void cons_write(char *buf, unsigned buf_size) { #if defined(RDD_CONSOLE) int n; if (console_fd < 0) return; while (buf_size > 0) { if ((n = write(console_fd, buf, buf_size)) < 0) { (void) close(console_fd); console_fd = -1; /* prevents recursion */ unix_error("cannot write to tty"); } buf += n; buf_size -= n; } #endif } void rdd_cons_open(void) { #if defined(RDD_CONSOLE) if ((console_fd = open("/dev/tty", O_RDWR)) < 0) { unix_error("cannot open terminal"); } #endif } void rdd_cons_close(void) { #if defined(RDD_CONSOLE) if (console_fd < 0) return; (void) close(console_fd); console_fd = -1; #endif } /* Interactive routine that poses a question and that takes * only 'yes' or 'no' for an answer. */ static int rdd_vask(char *fmt, va_list ap) { char line[MAX_LINE]; int answer = RDD_NO; ssize_t n; while (1) { rdd_cons_vprintf(fmt, ap); rdd_cons_printf(" "); n = read(console_fd, line, sizeof line); if (n < 0) { unix_error("cannot read from terminal"); } else if (n == 0) { error("terminal closed?"); } if (line[n-1] != '\n') { error("line too long"); } line[n-1] = '\000'; /* strip newline character */ if (strcmp(line, "yes") == 0 || strcmp(line, "YES") == 0) { answer = RDD_YES; break; } if (strcmp(line, "no") == 0 || strcmp(line, "NO") == 0) { answer = RDD_NO; break; } rdd_cons_printf("Please answer yes or no.\n"); } return answer; } int rdd_ask(char *fmt, ...) { va_list ap; int rc; va_start(ap, fmt); rc = rdd_vask(fmt, ap); va_end(ap); return rc; } void rdd_quit_if(int quit_answer, char *fmt, ...) { va_list ap; va_start(ap, fmt); if (!quiet && rdd_vask(fmt, ap) == quit_answer) { exit(EXIT_FAILURE); } va_end(ap); } /** Writes a formatted message to the console if the console is open. * Be careful: do not (recursively) invoke any error routines here. */ void rdd_cons_vprintf(char *fmt, va_list ap) { #if defined(RDD_CONSOLE) char promptbuf[MAX_WRITEBUF+1]; if (console_fd < 0) { return; } vsnprintf(promptbuf, MAX_WRITEBUF, fmt, ap); promptbuf[MAX_WRITEBUF] = '\000'; /* truncate if too long */ cons_write(promptbuf, strlen(promptbuf)); #endif } void rdd_cons_printf(char *fmt, ...) { #if defined(RDD_CONSOLE) va_list ap; va_start(ap, fmt); rdd_cons_vprintf(fmt, ap); va_end(ap); #endif } rdd-2.0.7/src/writer.c010064400000000000000000000051451042173111100134140ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "rdd.h" #include "writer.h" int rdd_new_writer(RDD_WRITER **self, RDD_WRITE_OPS *ops, unsigned statesize) { RDD_WRITER *w = 0; unsigned char *state = 0; int rc = RDD_OK; if (self == 0 || ops == 0) return RDD_BADARG; if ((w = calloc(1, sizeof(RDD_WRITER))) == 0) { rc = RDD_NOMEM; goto error; } if ((state = calloc(1, statesize)) == 0) { rc = RDD_NOMEM; goto error; } w->state = state; w->ops = ops; *self = w; return RDD_OK; error: *self = 0; if (state != 0) free(state); if (w != 0) free(w); return rc; } int rdd_writer_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte) { return (*(w->ops->write))(w, buf, nbyte); } int rdd_writer_close(RDD_WRITER *w) { int rc; rc = (*(w->ops->close))(w); if (rc != RDD_OK) { return rc; } free(w->state); w->state = 0; free(w); return RDD_OK; } rdd-2.0.7/src/rdd.h010064400000000000000000000061401042173111100126520ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __rdd_h__ #define __rdd_h__ #include #include "rsysint.h" rsys_decl_ints(RDD) typedef RDD_UINT64 rdd_count_t; #define RDD_CHECKSUM_MAGIC 0xdefd #define RDD_CHECKSUM_VERSION 0x0100 typedef RDD_UINT32 rdd_checksum_t; /* = 32 bits */ typedef enum { RDD_ADLER32 = 0x1, RDD_CRC32 = 0x2 } rdd_checksum_algorithm_t; typedef struct _RDD_CHECKSUM_FILE_HEADER { RDD_UINT16 magic; RDD_UINT16 version; RDD_UINT16 flags; RDD_UINT16 reserved; RDD_UINT32 blocksize; off_t offset; off_t imagesize; } RDD_CHECKSUM_FILE_HEADER; #define RDD_COUNT_MAX 18446744073709551615ULL /* rdd error codes */ #define RDD_OK 0 /* no error */ #define RDD_NOMEM 1 /* out of memory */ #define RDD_BADARG 2 /* bad function argument */ #define RDD_ECOMPRESS 3 /* (de)compression error */ #define RDD_EWRITE 4 /* write error */ #define RDD_ECLOSE 5 /* close error */ #define RDD_EEXISTS 6 /* file already exists */ #define RDD_EOPEN 7 /* cannot open file */ #define RDD_ECONNECT 8 /* cannot connect */ #define RDD_ETELL 9 /* cannot determine current file position */ #define RDD_ESEEK 10 /* seek error */ #define RDD_EREAD 11 /* read error */ #define RDD_ESPACE 12 /* insufficient space in buffer */ #define RDD_ESYNTAX 13 /* syntax error */ #define RDD_ERANGE 14 /* number out of range */ #define RDD_EAGAIN 15 /* try again later */ #define RDD_NOTFOUND 16 /* not found */ #define RDD_ABORTED 17 /* operation has been aborted */ #define RDD_WHOLE_FILE ((rdd_count_t) ~(0ULL)) #endif /* __rdd_h__ */ rdd-2.0.7/src/md5streamfilter.c010064400000000000000000000067121043500722700152210ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "rdd.h" #include "rdd_internals.h" #if defined(HAVE_LIBCRYPTO) && defined(HAVE_OPENSSL_MD5_H) && defined(HAVE_OPENSSL_SHA_H) #include #else /* Use local versions to allow stand-alone compilation. */ #include "md5.h" #endif /* HAVE_LIBCRYPTO */ #include "writer.h" #include "filter.h" typedef struct _RDD_MD5_STREAM_FILTER { MD5_CTX md5_state; unsigned char result[MD5_DIGEST_LENGTH]; } RDD_MD5_STREAM_FILTER; static int md5_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); static int md5_close(RDD_FILTER *f); static int md5_get_result(RDD_FILTER *f, unsigned char *buf, unsigned nbyte); static RDD_FILTER_OPS md5_ops = { md5_input, 0, md5_close, md5_get_result, 0 }; int rdd_new_md5_streamfilter(RDD_FILTER **self) { RDD_FILTER *f; RDD_MD5_STREAM_FILTER *state; int rc; rc = rdd_new_filter(&f, &md5_ops, sizeof(RDD_MD5_STREAM_FILTER), 0); if (rc != RDD_OK) { return rc; } state = (RDD_MD5_STREAM_FILTER *) f->state; MD5_Init(&state->md5_state); *self = f; return RDD_OK; } static int md5_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { RDD_MD5_STREAM_FILTER *state = (RDD_MD5_STREAM_FILTER *) f->state; MD5_Update(&state->md5_state, buf, nbyte); return RDD_OK; } static int md5_close(RDD_FILTER *f) { RDD_MD5_STREAM_FILTER *state = (RDD_MD5_STREAM_FILTER *) f->state; MD5_Final(state->result, &state->md5_state); return RDD_OK; } static int md5_get_result(RDD_FILTER *f, unsigned char *buf, unsigned nbyte) { RDD_MD5_STREAM_FILTER *state = (RDD_MD5_STREAM_FILTER *) f->state; if (nbyte < MD5_DIGEST_LENGTH) return RDD_ESPACE; memcpy(buf, state->result, MD5_DIGEST_LENGTH); return RDD_OK; } rdd-2.0.7/src/msgsink.h010064400000000000000000000042141042173111100135540ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __msgsink_h__ #define __msgsink_h__ typedef void (*rdd_msgsink_put_fun)( struct _RDD_MSGSINK *sink, const char *fmt, ...); typedef void (*rdd_msgsink_close_fun)(struct _RDD_MSGSINK *sink); typedef struct _RDD_MSGSINK_OPS { rdd_msgsink_put_fun put; rdd_msgsink_close_fun close; } RDD_MSGSINK_OPS; typedef struct _RDD_MSGSINK { void *state; RDD_MSGSINK_OPS *ops; } RDD_MSG_SINK; RDD_MSGSINK *rdd_sink_open(RDD_MSGSINK_OPS *ops, unsigned size); void rdd_sink_put(RDD_MSGSINK *sink, const char *fmt, ...); void rdd_sink_close(RDD_MSGSINK *sink); #endif /* __msgsink_h__ */ rdd-2.0.7/src/writer.h010064400000000000000000000225301042173111100134160ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __writer_h__ #define __writer_h__ /** @file * \brief Generic writer interface. * * Uniform writer interface. An implementation of this interface * must supply a constructor and implement all \c RDD_WRITE_OPS (see * the structure definition below). * *

Writer types

* * There are two types of writers: bottom writers and * stackable writers. * A stackable writer receives input, optionally transforms it in some way, * and passes the transformed data on to a lower-level parent writer. The * parent writer is passed to the stackable writer at the time the stackable * writer is constructed. The zlib writer is a stackable writer. * * A bottom writer receives input, optionally transforms it in some way, * and passes the transformed data on to some output device (e.g. a * file descriptor), but not to another writer. A bottom writer may * well use other writer types in its implementation, but that does * not make it a stackable writer. * * *

Constructors

* * Each constructor must be listed in this header file. * Once a writer has been constructed, it should be accessed * through the generic writer routines, \c rdd_writer_write() and * \c rdd_writer_close(). */ struct _RDD_WRITER; struct _RDD_WRITE_OPS; /** Values of type \c rdd_write_mode_t determine the behavior * of writers that try to write to an existing file. */ typedef enum _rdd_write_mode_t { RDD_NO_OVERWRITE = 0, /**< do not overwrite existing files */ RDD_OVERWRITE = 1, /**< truncate and overwrite existing files */ RDD_OVERWRITE_ASK = 2 /**< ask before overwriting existing files */ } rdd_write_mode_t; typedef int (*rdd_wr_write_fun)(struct _RDD_WRITER *w, const unsigned char *buf, unsigned nbyte); typedef int (*rdd_wr_close_fun)(struct _RDD_WRITER *w); /** All writer implementations provide a structure of type \c RDD_WRITE_OPS. * This structure contains pointers to the routines that implement * the interface. */ typedef struct _RDD_WRITE_OPS { rdd_wr_write_fun write; /**< writes data to the output channel */ rdd_wr_close_fun close; /**< closes the writer */ } RDD_WRITE_OPS; /** Writer object. A writer object consists of a pointer to a state * buffer and a pointer to an operation table. */ typedef struct _RDD_WRITER { void *state; /**< implementation-specific writer state */ RDD_WRITE_OPS *ops; /**< implementation-specific writer routines */ } RDD_WRITER; /** \brief Allocates and partially initializes a new writer object. * \param w output value: a new writer object. * \param ops pointers to implementation-specific writer functions. * \param statesize size in bytes of implementation-specific state. * \return Returns \c RDD_OK on success. Returns \c RDD_NOMEM when * there is insufficient memory to allocate the writer object or its state * buffer. * * \c rdd_new_writer() allocates a writer object and initializes its * \c ops field to argument \ops. The \c state field is set to point * to a new buffer (allocated with \c malloc()) with size \c statesize. * The state buffer is zeroed. */ int rdd_new_writer(RDD_WRITER **w, RDD_WRITE_OPS *ops, unsigned statesize); /* Constructor routines that create writers of specific types */ /** \brief Creates a writer that compresses its input before writing it. * \param w output value: the new writer object * \param parent: all compressed output is written to \c parent * \return Returns \c RDD_OK on success. * * A zlib writer is stacked on top of a parent writer. Any data * written to the zlib writer is written through to the parent * writer in compressed zlib format. */ int rdd_open_zlib_writer(RDD_WRITER **w, RDD_WRITER *parent); /** \brief Creates a writer that writes to an open file descriptor. * \param w output value: the new writer object * \param fd the open file descriptor that the new writer will write to * \return Returns \c RDD_OK on success. */ int rdd_open_fd_writer(RDD_WRITER **w, int fd); /** \brief Creates a writer that writes to a file. * \param w output value: the new writer object * \param path the name of the file that the new writer will write to * \return Returns \c RDD_OK on success. * * Routine \c rdd_open_file_writer() will create file \c path if * it does not exist. It will fail if the directory in which \c * path must be created does not exist. If \c path already exists * then \c rdd_open_file_writer() will silently truncate the existing * file. */ int rdd_open_file_writer(RDD_WRITER **w, const char *path); /** \brief Creates a writer that writes to a TCP server. * \param w output value: the new writer object * \param host the name of the server host * \param port the TCP port number on the server host * \return Returns \c RDD_OK on success. * * Routine \c rdd_open_tcp_writer() connects to a TCP server that runs * on \c host and listens to TCP port \c port. Any data written to * the TCP writer is passed on to the server process at the other * end of the TCP connection. */ int rdd_open_tcp_writer(RDD_WRITER **w, const char *host, unsigned port); /** \brief Creates a writer that does not blindly overwrite existing files. * \param w output value: the new writer object * \param path the name of the file that the new writer will write to * \param overwrite indicates what to do when \c path exists * \return Returns \c RDD_OK on success. * * A safe writer behaves almost exactly like a file writer. The key * difference is that a safe writer will only overwrite an existing * file if \c overwrite equals \c RDD_OVERWRITE. Otherwise * \c rdd_open_safe_writer() will fail. */ int rdd_open_safe_writer(RDD_WRITER **w, const char *path, rdd_write_mode_t overwrite); /** \brief Creates a writer that can split its output over multiple files. * \param w output value: the new writer object * \param basepath template for output file names * \param maxlen maximum number of bytes that will be written * \param splitlen maximum size in bytes of each output file * \param overwrite indicates what to do when an output file already exists * \return Returns \c RDD_OK on success. * * Routine \c rdd_open_part_writer() splits the data stream it receives * over a sequence of output files. The first \c splitlen bytes are * written to output file number one, the next \c splitlen bytes to * output file number two, and so on. The name of each output file * consists of: * - the directory part of \c basepath; * - the output file's sequence number; * - a dash; * - the base name of \c basepath. */ int rdd_open_part_writer(RDD_WRITER **w, const char *basepath, rdd_count_t maxlen, rdd_count_t splitlen, rdd_write_mode_t overwrite); /* Generic writer routines */ /** \brief Writes a data buffer to the output channel associated with a writer. * \param w a pointer to the writer object. * \param buf a pointer to the data buffer. * \param nbyte the number of bytes to write * \return Returns \c RDD_OK on success. * * Routine \c rdd_writer_write() writes the first \c nbyte bytes * in buffer \c buf to an output channel. The identity and the * nature of the output channel is determined by the type of writer * object is used and by the arguments that were passed to the writer's * constructor. * * When rdd_writer_write() returns, data buffer \c buf can safely be * reused. */ int rdd_writer_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte); /** \brief Closes a writer AND all writers that are below it in the * writer stack. * \param w a pointer to the writer object. * * When writer \c w is closed its resources are released and * no further writes can be issued to writer \c w. At present, * all writers stacked below \c w are closed as well. This behavior * may change in the future. */ int rdd_writer_close(RDD_WRITER *w); #endif /* __writer_h__ */ rdd-2.0.7/src/copier.c010064400000000000000000000052431042173111100133600ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "rdd.h" #include "rdd_internals.h" #include "reader.h" #include "writer.h" #include "filter.h" #include "filterset.h" #include "copier.h" int rdd_new_copier(RDD_COPIER **self, RDD_COPY_OPS *ops, unsigned statesize) { RDD_COPIER *c = 0; unsigned char *state = 0; int rc; if (self == 0 || ops == 0) return RDD_BADARG; if ((c = calloc(1, sizeof(RDD_COPIER))) == 0) { rc = RDD_NOMEM; goto error; } if ((state = calloc(1, statesize)) == 0) { rc = RDD_NOMEM; goto error; } c->state = state; c->ops = ops; *self = c; return RDD_OK; error: *self = 0; if (state != 0) free(state); if (c != 0) free(c); return rc; } int rdd_copy_exec(RDD_COPIER *c, RDD_READER *r, RDD_FILTERSET *fset, RDD_COPIER_RETURN *ret) { RDD_COPY_OPS *ops = c->ops; return (*ops->exec)(c, r, fset, ret); } int rdd_copy_free(RDD_COPIER *c) { RDD_COPY_OPS *ops = c->ops; int rc; if (ops->free != 0) { rc = (*ops->free)(c); if (rc != RDD_OK) { return rc; } } free(c->state); c->state = 0; free(c); return RDD_OK; } rdd-2.0.7/src/strerror.c010064400000000000000000000056731042173111100137700ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include #endif #include #include "rdd.h" #include "rdd_internals.h" static int copymsg(char *buf, unsigned bufsize, char *msg) { if ((strlen(msg) + 1) > bufsize) { return RDD_NOMEM; } strncpy(buf, msg, bufsize); return RDD_OK; } static char * get_message(int rc) { switch (rc) { case RDD_OK: return "ok"; case RDD_NOMEM: return "out of memory"; case RDD_BADARG: return "bad argument"; case RDD_ECOMPRESS: return "compression error"; case RDD_EWRITE: return "write error"; case RDD_ECLOSE: return "close error"; case RDD_EEXISTS: return "output file already exists"; case RDD_EOPEN: return "cannot open file"; case RDD_ECONNECT: return "cannot connect"; case RDD_ETELL: return "cannot determine current position"; case RDD_EREAD: return "read error"; case RDD_ESEEK: return "seek error"; case RDD_ESPACE: return "insufficient space in buffer or on device"; case RDD_ESYNTAX: return "syntax error"; case RDD_ERANGE: return "number out of range"; case RDD_EAGAIN: return "try again later"; case RDD_NOTFOUND: return "not found"; case RDD_ABORTED: return "operation has been aborted"; default: return 0; } } int rdd_strerror(int rc, char *buf, unsigned bufsize) { char *msg; if (buf == 0) return RDD_BADARG; if ((msg = get_message(rc)) == 0) return RDD_BADARG; return copymsg(buf, bufsize, msg); } rdd-2.0.7/src/checksumblockfilter.c010064400000000000000000000137351043500666200161420ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "error.h" #include "writer.h" #include "filter.h" #include "filterset.h" #include "outfile.h" /* State maintained by a checksum filter. */ typedef struct _RDD_CHECKSUM_BLOCKFILTER { char *path; /* output file */ FILE *fp; /* output stream */ rdd_checksum_t checksum; /* running checksum */ rdd_checksum_algorithm_t algorithm; /* checksum algorithm */ } RDD_CHECKSUM_BLOCKFILTER; /* Forward declarations. */ static int checksum_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); static int checksum_block(RDD_FILTER *f, unsigned nbyte); static int checksum_close(RDD_FILTER *f); static int checksum_free(RDD_FILTER *f); static RDD_FILTER_OPS checksum_ops = { checksum_input, checksum_block, checksum_close, 0, checksum_free }; static void reset_checksum(RDD_CHECKSUM_BLOCKFILTER *state) { switch (state->algorithm) { case RDD_ADLER32: state->checksum = adler32(0, NULL, 0); break; case RDD_CRC32: state->checksum = crc32(0, NULL, 0); break; } } static void init_header(RDD_CHECKSUM_FILE_HEADER* rec, int type, size_t blocksize, off_t offset, off_t imgsize) { memset(rec, '\000', sizeof(RDD_CHECKSUM_FILE_HEADER)); rec->magic = RDD_CHECKSUM_MAGIC; rec->version = RDD_CHECKSUM_VERSION; rec->flags |= type; rec->blocksize = blocksize; rec->offset = offset; rec->reserved = 0x0000; rec->imagesize = imgsize; } static int checksum_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { RDD_CHECKSUM_BLOCKFILTER *state = (RDD_CHECKSUM_BLOCKFILTER *) f->state; switch (state->algorithm) { case RDD_ADLER32: state->checksum = adler32(state->checksum, buf, nbyte); break; case RDD_CRC32: state->checksum = crc32(state->checksum, buf, nbyte); break; } return RDD_OK; } static int checksum_block(RDD_FILTER *f, unsigned pos) { RDD_CHECKSUM_BLOCKFILTER *state = (RDD_CHECKSUM_BLOCKFILTER *) f->state; rdd_checksum_t checksum = state->checksum; if (fwrite(&checksum, sizeof checksum, 1, state->fp) < 1) { return RDD_EWRITE; } reset_checksum(state); return RDD_OK; } static int checksum_close(RDD_FILTER *f) { RDD_CHECKSUM_BLOCKFILTER *state = (RDD_CHECKSUM_BLOCKFILTER *) f->state; outfile_fclose(state->fp, state->path); state->fp = NULL; return RDD_OK; } static int checksum_free(RDD_FILTER *f) { RDD_CHECKSUM_BLOCKFILTER *state = (RDD_CHECKSUM_BLOCKFILTER *) f->state; free(state->path); state->path = 0; return RDD_OK; } static int new_checksum_blockfilter(RDD_FILTER **self, rdd_checksum_algorithm_t alg, unsigned blocksize, const char *outpath, int overwrite) { RDD_FILTER *f = 0; RDD_CHECKSUM_BLOCKFILTER *state = 0; RDD_CHECKSUM_FILE_HEADER header; char *path = 0; FILE *fp = NULL; int rc = RDD_OK; if (blocksize <= 0) return RDD_BADARG; if (alg != RDD_ADLER32 && alg != RDD_CRC32) return RDD_BADARG; rc = rdd_new_filter(&f, &checksum_ops, sizeof(RDD_CHECKSUM_BLOCKFILTER), blocksize); if (rc != RDD_OK) { goto error; } state = (RDD_CHECKSUM_BLOCKFILTER *)f->state; if ((path = malloc(strlen(outpath) + 1)) == 0) { rc = RDD_NOMEM; goto error; } strcpy(path, outpath); if ((rc = outfile_fopen(&fp, outpath, overwrite)) != RDD_OK) { goto error; } state->path = path; state->fp = fp; state->algorithm = alg; reset_checksum(state); init_header(&header, alg, blocksize, 0, 0); if (fwrite((const void *) &header, sizeof(header), 1, state->fp) < 1) { rc = RDD_EWRITE; goto error; } *self = f; return RDD_OK; error: *self = 0; if (fp != NULL) fclose(fp); if (path != 0) free(path); if (state != 0) free(state); if (f != 0) free(f); return rc; } int rdd_new_adler32_blockfilter(RDD_FILTER **f, unsigned blocksize, const char *outpath, int overwrite) { return new_checksum_blockfilter(f, RDD_ADLER32, blocksize, outpath, overwrite); } int rdd_new_crc32_blockfilter(RDD_FILTER **f, unsigned blocksize, const char *outpath, int overwrite) { return new_checksum_blockfilter(f, RDD_CRC32, blocksize, outpath, overwrite); } rdd-2.0.7/src/verifyblockfilter.c010064400000000000000000000145771043500776300156540ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "error.h" #include "writer.h" #include "filter.h" #include "filterset.h" /* State maintained by a checksum filter. */ typedef struct _RDD_VERIFY_BLOCKFILTER { FILE *fp; /* stream with checksums */ rdd_checksum_t checksum; /* running checksum */ rdd_checksum_algorithm_t algorithm; /* checksum algorithm */ int swap; rdd_count_t blocknum; unsigned blocksize; rdd_count_t num_error; /* error count */ rdd_fltr_error_fun error_fun; /* callback function */ void *error_env; /* callback environment */ } RDD_VERIFY_BLOCKFILTER; /* Forward declarations. */ static int verify_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); static int verify_block(RDD_FILTER *f, unsigned nbyte); static int verify_get_result(RDD_FILTER *f, unsigned char *buf, unsigned nbyte); static RDD_FILTER_OPS verify_ops = { verify_input, verify_block, 0, /* close */ verify_get_result, 0 /* free */ }; static void reset_checksum(RDD_VERIFY_BLOCKFILTER *state) { switch (state->algorithm) { case RDD_ADLER32: state->checksum = adler32(0, NULL, 0); break; case RDD_CRC32: state->checksum = crc32(0, NULL, 0); break; } } static int verify_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { RDD_VERIFY_BLOCKFILTER *state = (RDD_VERIFY_BLOCKFILTER *) f->state; switch (state->algorithm) { case RDD_ADLER32: state->checksum = adler32(state->checksum, buf, nbyte); break; case RDD_CRC32: state->checksum = crc32(state->checksum, buf, nbyte); break; } return RDD_OK; } static u_int32_t swap32(u_int32_t n) { return ((n << 24) & 0xff000000) | ((n << 8) & 0x00ff0000) | ((n >> 8) & 0x0000ff00) | ((n >> 24) & 0x000000ff) ; } static int read_chksum(RDD_VERIFY_BLOCKFILTER *state, rdd_checksum_t *result) { rdd_checksum_t chksum; if (fread(&chksum, sizeof chksum, 1, state->fp) != 1) { return RDD_EREAD; } if (state->swap) { chksum = swap32(chksum); } *result = chksum; return RDD_OK; } static void verify_checksum(RDD_VERIFY_BLOCKFILTER *state, u_int32_t stored_checksum) { rdd_count_t offset; if (state->checksum == stored_checksum) { return; /* checksum ok */ } state->num_error++; if (state->error_fun != 0) { offset = state->blocknum * state->blocksize; (*state->error_fun)(offset, stored_checksum, state->checksum, state->error_env); } } static int verify_block(RDD_FILTER *f, unsigned pos) { RDD_VERIFY_BLOCKFILTER *state = (RDD_VERIFY_BLOCKFILTER *) f->state; rdd_checksum_t stored_checksum; int rc; if ((rc = read_chksum(state, &stored_checksum)) != RDD_OK) { return rc; } verify_checksum(state, stored_checksum); reset_checksum(state); state->blocknum++; return RDD_OK; } static int verify_get_result(RDD_FILTER *f, unsigned char *buf, unsigned nbyte) { RDD_VERIFY_BLOCKFILTER *state = (RDD_VERIFY_BLOCKFILTER *) f->state; if (nbyte < sizeof(unsigned)) { return RDD_NOMEM; } memcpy(buf, &state->num_error, sizeof(state->num_error)); return RDD_OK; } static int new_verify_checksum_blockfilter(RDD_FILTER **self, rdd_checksum_algorithm_t alg, FILE *fp, unsigned blocksize, int swap, rdd_fltr_error_fun error_fun, void *error_env) { RDD_FILTER *f = 0; RDD_VERIFY_BLOCKFILTER *state = 0; int rc = RDD_OK; if (blocksize <= 0) return RDD_BADARG; if (alg != RDD_ADLER32 && alg != RDD_CRC32) return RDD_BADARG; rc = rdd_new_filter(&f, &verify_ops, sizeof(RDD_VERIFY_BLOCKFILTER), blocksize); if (rc != RDD_OK) { goto error; } state = (RDD_VERIFY_BLOCKFILTER *)f->state; state->fp = fp; state->algorithm = alg; state->swap = swap; state->blocknum = 0; state->blocksize = blocksize; state->num_error = 0; state->error_fun = error_fun; state->error_env = error_env; reset_checksum(state); *self = f; return RDD_OK; error: *self = 0; if (fp != NULL) fclose(fp); if (state != 0) free(state); if (f != 0) free(f); return rc; } int rdd_new_verify_adler32_blockfilter(RDD_FILTER **f, FILE *fp, unsigned blocksize, int swap, rdd_fltr_error_fun err, void *env) { return new_verify_checksum_blockfilter(f, RDD_ADLER32, fp, blocksize, swap, err, env); } int rdd_new_verify_crc32_blockfilter(RDD_FILTER **f, FILE *fp, unsigned blocksize, int swap, rdd_fltr_error_fun err, void *env) { return new_verify_checksum_blockfilter(f, RDD_CRC32, fp, blocksize, swap, err, env); } rdd-2.0.7/src/md5.c010064400000000000000000000272051043500717100125750ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include "rdd.h" #include "rdd_internals.h" #if !defined(HAVE_LIBCRYPTO) /* Most of this code comes directly from RFC 1321. If you * want a fast MD5, use openssl or another implementation that * performs platform-specific optimizations. * * As suggested, I replaced MD5_memcpy and MD5_memset with their * equivalents from . */ /* * The implementation is portable and should work on many different * plaforms. However, it is not difficult to optimize the implementation * on particular platforms, an exercise left to the reader. For example * on "little-endian" platforms where the lowest-addressed byte in a * bit word is the least significant and there are no alignment * restrictions, the call to Decode in MD5Transform can be replaced with * a typecast. */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. * All rights reserved. * * License to copy and use this software is granted provided that it * is identified as the "RSA Data Security, Inc. MD5 Message-Digest * Algorithm" in all material mentioning or referencing this software * or this function. * * License is also granted to make and use derivative works provided * that such works are identified as "derived from the RSA Data * * Security, Inc. MD5 Message-Digest Algorithm" in all material * mentioning or referencing the derived work. * * RSA Data Security, Inc. makes no representations concerning either * the merchantability of this software or the suitability of this * software for any particular purpose. It is provided "as is" * without express or implied warranty of any kind. * * These notices must be retained in any copies of any part of this * documentation and/or software. */ #include #include "md5.h" /* Constants for MD5Transform routine. */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define S41 6 #define S42 10 #define S43 15 #define S44 21 static void MD5Transform(UINT4 [4], unsigned char [64]); static void Encode(unsigned char *, UINT4 *, unsigned int); static void Decode(UINT4 *, unsigned char *, unsigned int); static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G, H and I are basic MD5 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) /* Is this ROTATE_LEFT ok? Hmm, it is as long as x is an * unsigned quantity... (see K&R) */ /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. * Rotation is separate from addition to prevent recomputation. */ #define FF(a, b, c, d, x, s, ac) { \ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } /* MD5 initialization. Begins an MD5 operation, writing a new context */ void MD5_Init(MD5_CTX *context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; } /* MD5 block update operation. Continues an MD5 message-digest * operation, processing another message block, and updating the * context. */ void MD5_Update(MD5_CTX *context, unsigned char *input, unsigned int inputLen) { unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) { context->count[1]++; } context->count[1] += ((UINT4)inputLen >> 29); partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { memcpy(&context->buffer[index], input, partLen); MD5Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) { MD5Transform (context->state, &input[i]); } index = 0; } else { i = 0; } /* Buffer remaining input */ memcpy(&context->buffer[index], &input[i], inputLen-i); } /* MD5 finalization. Ends an MD5 message-digest operation, writing * the message digest and zeroizing the context. */ void MD5_Final(unsigned char digest[16], MD5_CTX *context) { unsigned char bits[8]; unsigned int index, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int)((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); MD5_Update(context, PADDING, padLen); /* Append length (before padding) */ MD5_Update(context, bits, 8); /* Store state in digest */ Encode (digest, context->state, 16); /* Zeroize sensitive information. */ memset(context, 0, sizeof (*context)); } /* MD5 basic transformation. Transforms state based on block. */ static void MD5Transform(UINT4 state[4], unsigned char block[64]) { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode (x, block, 64); /* Round 1 */ FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ /* Round 2 */ GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ /* Round 3 */ HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ /* Round 4 */ II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ memset (x, 0, sizeof (x)); } /* Encodes input (UINT4) into output (unsigned char). Assumes len is * a multiple of 4. */ static void Encode (unsigned char *output, UINT4 *input, unsigned int len) { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (unsigned char)(input[i] & 0xff); output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (UINT4). Assumes len is * a multiple of 4. */ static void Decode (UINT4 *output, unsigned char *input, unsigned int len) { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } } #endif /* HAVE_LIBCRYPTO */ rdd-2.0.7/src/stdioprinter.c010064400000000000000000000054011042173111100146210ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "rdd.h" #include "rdd_internals.h" #include "msgprinter.h" typedef struct _RDD_STDIO_MSGPRINTER { FILE *stream; } RDD_STDIO_MSGPRINTER; static void stdio_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg); static int stdio_close(RDD_MSGPRINTER *printer, unsigned flags); static RDD_MSGPRINTER_OPS stdio_ops = { stdio_print, stdio_close }; int rdd_mp_open_stdio_printer(RDD_MSGPRINTER **printer, FILE *stream) { RDD_STDIO_MSGPRINTER *stdio = 0; RDD_MSGPRINTER *p = 0; int rc = RDD_OK; rc = rdd_mp_open_printer(&p, &stdio_ops, sizeof(RDD_STDIO_MSGPRINTER)); if (rc != RDD_OK) { return rc; } stdio = (RDD_STDIO_MSGPRINTER *) p->state; stdio->stream = stream; *printer = p; return RDD_OK; } static void stdio_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg) { RDD_STDIO_MSGPRINTER *stdio = (RDD_STDIO_MSGPRINTER *) printer->state; fprintf(stdio->stream, "%s\n", msg); } static int stdio_close(RDD_MSGPRINTER *printer, unsigned flags) { RDD_STDIO_MSGPRINTER *stdio = (RDD_STDIO_MSGPRINTER *) printer->state; memset(stdio, 0, sizeof *stdio); return RDD_OK; } rdd-2.0.7/src/msgdistributor.h010064400000000000000000000042721042173111100151660ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __msgdistributor_h__ #define __msgdistributor_h__ #include typedef unsigned rdd_sinkset_t typedef unsigned rdd_sinkid_t #define RDD_MSGSINK_MAX (CHAR_BIT * sizeof(rdd_sinkset_t)) #define RDD_MSGSINK_ALL ( ~((unsigned) 0) ) typedef struct _RDD_MSG_DISTRIBUTOR { struct _RDD_MSGSINK *sinktab[RDD_MAX_MSGSINK]; unsigned nsink; } RDD_MSG_DISTRIBUTOR; void rdd_msgdist_init(RDD_MSG_DISTRIBUTOR *mdist); rdd_sinkid_t rdd_msgdist_addsink(RDD_MSG_DISTRIBUTOR *mdist, struct _RDD_MSGSINK *sink); void rdd_msgdist_put(RDD_MSG_DISTRIBUTOR *mdist, rdd_sinkset_t sinks, const char *fmt, ...); #endif /* __msgdistributor_h__ */ rdd-2.0.7/src/commandline.c010064400000000000000000000102501043500670000143630ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "error.h" #include "commandline.h" static RDD_OPTION *opttab; static const char *usage_message; void rdd_opt_init(RDD_OPTION *tab, const char *usage_msg) { opttab = tab; usage_message = usage_msg; } /* Verify whether argv[*i] is an option name (short or long) and * whether its argument, if any, is present. */ RDD_OPTION * rdd_get_opt_with_arg(char **argv, int argc, unsigned *i, char **opt, char **arg) { RDD_OPTION *od; char *optname; optname = argv[*i]; for (od = &opttab[0]; od->short_name != 0; od++) { if (! streq(od->short_name, optname) && (od->long_name == 0 || !streq(od->long_name, optname))) { continue; } if (++od->count > 1) { error("option %s specified multiple times", optname); } *opt = optname; if (od->arg_descr == 0) { /* no argument */ *arg = 0; } else { (*i)++; if ((*i) >= (unsigned) argc) { error("option %s requires an argument", optname); } od->arg_value = *arg = argv[*i]; } return od; } return 0; } int rdd_opt_set_arg(char *longname, char **argp) { RDD_OPTION *od; for (od = &opttab[0]; od->short_name != 0; od++) { if (streq(od->long_name+2, longname)) { if (od->count == 0) { return 0; /* option not set */ } if (argp != 0) { *argp = od->arg_value; } return 1; } } bug("opt_set_arg: %s is not a known option", longname); return 0; /* NOTREACHED */ } int rdd_opt_set(char *longname) { return rdd_opt_set_arg(longname, 0); } void rdd_opt_usage(void) { RDD_OPTION *od; char optnames[80]; fprintf(stderr, "Usage: %s", usage_message); fprintf(stderr, "Options:\n"); for (od = &opttab[0]; od->short_name != 0; od++) { if (od->long_name != 0) { snprintf(optnames, sizeof optnames, "%s, %s %s", od->short_name, od->long_name, od->arg_descr == 0 ? "" : od->arg_descr); } else { snprintf(optnames, sizeof optnames, "%s %s", od->short_name, od->arg_descr == 0 ? "" : od->arg_descr); } optnames[(sizeof optnames)-1] = '\000'; if (strlen(optnames) <= 32) { fprintf(stderr, "%-32.32s %s\n", optnames, od->description); } else { fprintf(stderr, "%s\n", optnames); fprintf(stderr, "%-32.32s %s\n", "", od->description); } } exit(EXIT_FAILURE); } rdd-2.0.7/src/copier.h010064400000000000000000000175471042173111100133770ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __copier_h__ #define __copier_h__ /** @file * \brief Generic copier interface. * * Copier objects, or copiers, implement a data copy algorithm. * All copiers implement the interface that is defined here. */ struct _RDD_COPIER; struct _RDD_COPY_OPS; typedef struct _RDD_COPIER { struct _RDD_COPY_OPS *ops; void *state; } RDD_COPIER; typedef struct _RDD_COPIER_RETURN { rdd_count_t nbyte; rdd_count_t nlost; rdd_count_t nread_err; rdd_count_t nsubst; } RDD_COPIER_RETURN; typedef int (*rdd_copy_exec_fun)(RDD_COPIER *c, RDD_READER *reader, RDD_FILTERSET *fset, RDD_COPIER_RETURN *ret); typedef int (*rdd_copy_free_fun)(RDD_COPIER *c); /** Each copier must supply an \c RDD_COPY_OPS structure that * contains its specific copy routines. */ typedef struct _RDD_COPY_OPS { rdd_copy_exec_fun exec; /**< copy data */ rdd_copy_free_fun free; /**< release the copier and its resources */ } RDD_COPY_OPS; /** \brief Read error callback type. */ typedef void (*rdd_readerrhandler_t)(rdd_count_t offset, unsigned nbyte, void *env); /** \brief Substitution callback type. */ typedef void (*rdd_substhandler_t)(rdd_count_t offset, unsigned nbyte, void *env); /** \brief Progress callback type. */ typedef int (*rdd_proghandler_t)(rdd_count_t ncopied, void *env); /** \brief Simple copier configuration parameters. */ typedef struct _RDD_SIMPLE_PARAMS { rdd_proghandler_t progressfun; /**< progress callback */ void *progressenv; /**< progress callback environment */ } RDD_SIMPLE_PARAMS; /** \brief Robust copier configuration parameters. */ typedef struct _RDD_ROBUST_PARAMS { unsigned minblocklen; /**< minimum block length (during retries) */ unsigned maxblocklen; /**< maximum block length */ unsigned nretry; /**< retry a failed read \c nretry times */ unsigned maxsubst; /**< give up after \c maxsubst substitutions */ rdd_readerrhandler_t readerrfun; /**< read-error callback */ void *readerrenv; /**< read-error callback environment */ rdd_substhandler_t substfun; /**< data-block substitution callback */ void *substenv; /**< substitution callback environment */ rdd_proghandler_t progressfun; /**< progress callback */ void *progressenv; /**< progress callback environment */ } RDD_ROBUST_PARAMS; /* Constructors */ /** \brief Allocates a copier object and space for its implementation-specific * state. * \param c output value: will be set to a pointer to the new copier object. * \param ops a pointer to a copiers implementation-specific copy routines. * \param statesize the size in bytes of the copier's state. * \return Returns \c RDD_OK on success. Returns \c RDD_NOMEM if there * is insufficient memory to create the object. * * This is a utility routine that does \b not belong to the copy interface. * It is used to prevent code duplication in copier implementations, which * must all allocate a copier object and some implementation-specific state. * This routine allocates the object and that state. The state buffer is * zeroed. Initializing it with sensible values is, of course, a job left to * the copier implementation. */ int rdd_new_copier(RDD_COPIER **c, RDD_COPY_OPS *ops, unsigned statesize); /** \brief Creates a new simple copier. * \param c output value: will be set to a pointer to the new simple copier object. * \param params the copier's parameters * \return Returns \c RDD_OK on success. Returns \c RDD_NOMEM if there * is insufficient memory to create the object. * * A simple copier reads data from its reader (see \c rdd_copy_exec()) * until it reached end-of-file or until it encounters any error, * including a read error. * * The parameters \c params specify a callback function and its * environment. This function is called periodically and can be * used to report or track progress. */ int rdd_new_simple_copier(RDD_COPIER **c, RDD_SIMPLE_PARAMS *params); /** \brief Creates a new robust copier. * \param c output value: will be set to a pointer to the new robust copier object. * \param offset byte offset; where to start copying * \param count the maximum number of bytes to copy * \param params the copier's error-handling parameters * \return Returns \c RDD_OK on success. Returns \c RDD_NOMEM if there * is insufficient memory to create the object. * * A robust copier behaves like a simple copier as long as no errors * occur and if the \c offset and \c count arguments are both set to zero. * * The \c offset and \c count arguments are used to read a contiguous * segment from the input stream supplied to \c rdd_copy_exec(): * \c offset bytes from the input stream are skipped before the copier * starts copying data and copying stops when \c count bytes have been * copied or when end-of-file is encountered. * * The parameters \c params specify the copier's behavior when * read errors occur. A robust copier will enter a retry phase when * a read fails. In that phase it reduces the amount of data it reads * at a time and it will retry reads that fail. */ int rdd_new_robust_copier(RDD_COPIER **c, rdd_count_t offset, rdd_count_t count, RDD_ROBUST_PARAMS *params); /* Generic routines */ /** \brief Generic copy routine that instructs a copier to start copying. * \param c a pointer to the copier object. * \param r a reader object from which the copier will read its source data. * \param fset a filter set; the copier will push the data it reads from * the reader to all filters in the filter set. * \return Returns \c RDD_OK on success. * * Every copier reads, or tries to read, data from reader \c r. * The data it reads, or the data that it substitutes, is passed * to the filter set \c fset. The current copier implementation * differ in how they handle read errors. A simple copier will * give up after the first read error, but a robust copier will * retry and eventually substitute data if a read fails repeatedly. */ int rdd_copy_exec(RDD_COPIER *c, RDD_READER *r, RDD_FILTERSET *fset, RDD_COPIER_RETURN *ret); /** \brief Deallocates the copier object and releases its resources. * \param c a pointer to the copier object. * \return Returns \c RDD_OK on success. */ int rdd_copy_free(RDD_COPIER *c); #endif /* __copier_h__ */ rdd-2.0.7/src/fdwriter.c010064400000000000000000000056131042173111100137260ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "rdd.h" #include "writer.h" /* Forward declarations */ static int fd_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte); static int fd_close(RDD_WRITER *w); static RDD_WRITE_OPS fd_write_ops = { fd_write, fd_close }; typedef struct _RDD_FD_WRITER { int fd; } RDD_FD_WRITER; int rdd_open_fd_writer(RDD_WRITER **self, int fd) { RDD_WRITER *w = 0; RDD_FD_WRITER *state = 0; int rc = RDD_OK; rc = rdd_new_writer(&w, &fd_write_ops, sizeof(RDD_FD_WRITER)); if (rc != RDD_OK) { return rc; } state = (RDD_FD_WRITER *) w->state; state->fd = fd; *self = w; return RDD_OK; } /* Writes the entire input buffer to the output file descriptor. */ static int fd_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte) { RDD_FD_WRITER *state = w->state; int n; while (nbyte > 0) { if ((n = write(state->fd, buf, nbyte)) < 0) { #if defined(RDD_SIGNALS) if (errno == EINTR) continue; #endif if (errno == ENOSPC) { return RDD_ESPACE; } else { return RDD_EWRITE; } } buf += n; nbyte -= n; } return RDD_OK; } static int fd_close(RDD_WRITER *self) { RDD_FD_WRITER *state = self->state; int rc; if ((rc = close(state->fd)) < 0) { return RDD_ECLOSE; } return RDD_OK; } rdd-2.0.7/src/alignedreader.c010064400000000000000000000142411042173111100146630ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "alignedbuf.h" #include "reader.h" #define MOD_ALIGN(r, n) ((n) % ((r)->align)) typedef struct _RDD_ALIGNED_READER { RDD_READER *parent; unsigned align; } RDD_ALIGNED_READER; /* Forward declarations */ static int rdd_aligned_read(RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread); static int rdd_aligned_tell(RDD_READER *r, rdd_count_t *pos); static int rdd_aligned_seek(RDD_READER *r, rdd_count_t pos); static int rdd_aligned_close(RDD_READER *r, int recurse); static RDD_READ_OPS aligned_read_ops = { rdd_aligned_read, rdd_aligned_tell, rdd_aligned_seek, rdd_aligned_close }; int rdd_open_aligned_reader(RDD_READER **self, RDD_READER *parent, unsigned align) { RDD_READER *r = 0; RDD_ALIGNED_READER *state = 0; int rc = RDD_OK; rc = rdd_new_reader(&r, &aligned_read_ops, sizeof(RDD_ALIGNED_READER)); if (rc != RDD_OK) { return rc; } state = (RDD_ALIGNED_READER *) r->state; state->parent = parent; state->align = align; *self = r; return RDD_OK; } static int rdd_aligned_read(RDD_READER *self, unsigned char *buf, unsigned nbyte, unsigned *nread) { RDD_ALIGNED_READER *state = self->state; unsigned char *p = 0; rdd_count_t start_pos = 0; rdd_count_t file_pos = 0; unsigned sector_offset; unsigned sector_extra; unsigned done; int rc = RDD_OK; int all_aligned = 0; unsigned nparentread = 0; unsigned char *alignedbuf = 0; RDD_ALIGNEDBUF abuf; int todo; /* Record current position. */ if ((rc = rdd_aligned_tell(self, &start_pos)) != RDD_OK) { return rc; } file_pos = start_pos; all_aligned = MOD_ALIGN(state, (unsigned) buf) == 0 && MOD_ALIGN(state, nbyte) == 0 && MOD_ALIGN(state, start_pos) == 0; if (all_aligned) { alignedbuf = buf; } else { rc = rdd_new_alignedbuf(&abuf, nbyte, state->align); if (rc != RDD_OK) { return rc; } alignedbuf = abuf.aligned; return RDD_BADARG; } todo = nbyte; /* Move the file pointer back to the nearest sector boundary. */ if ((sector_offset = MOD_ALIGN(state, file_pos)) > 0) { file_pos -= sector_offset; todo += sector_offset; if (rdd_aligned_seek(self, file_pos) != RDD_OK) { return RDD_ESEEK; } } /* Round up the read size, so that we will read a * multiple of the sector size. */ if ((sector_extra = MOD_ALIGN(state, todo)) > 0) { todo += RDD_SECTOR_SIZE - sector_extra; } assert(todo >= (signed) sector_offset); /* Read all sectors necessary to satisfy the user's request. */ done = 0; p = buf; while (todo > 0) { assert(MOD_ALIGN(state, todo) == 0); assert(MOD_ALIGN(state, (unsigned) (p)) == 0); rc = rdd_reader_read(state->parent, p, todo, &nparentread); if (rc == RDD_EAGAIN) { continue; } else if (rc != RDD_OK) { return rc; } if (nparentread == 0) { break; /* EOF */ } if (MOD_ALIGN(state, nparentread) != 0) { #if 0 error("raw device returned an incomplete sector"); #endif return RDD_EREAD; /* read error */ } done += nparentread; todo -= nparentread; p += nparentread; } /* We got data or we reached EOF. We should at least be able * to read up to the point where we were when we entered this * routine (start_pos). */ file_pos += done; if (file_pos < start_pos) { #if 0 bug("fd %d: raw device does not supply enough data", state->fd); #endif return RDD_EREAD; } if (file_pos > start_pos + nbyte) { /* We read beyond the point requested by the caller. * Return only the bytes that the caller asked for and * move back the file pointer. */ file_pos = start_pos + nbyte; if ((rc = rdd_aligned_seek(self, file_pos)) != RDD_OK) { return rc; } } *nread = file_pos - start_pos; if (alignedbuf != buf) { memcpy(buf, alignedbuf, *nread); rdd_free_alignedbuf(&abuf); } return RDD_OK; } static int rdd_aligned_tell(RDD_READER *self, rdd_count_t *pos) { RDD_ALIGNED_READER *state = self->state; return rdd_reader_tell(state->parent, pos); } static int rdd_aligned_seek(RDD_READER *self, rdd_count_t pos) { RDD_ALIGNED_READER *state = self->state; return rdd_reader_seek(state->parent, pos); } static int rdd_aligned_close(RDD_READER *self, int recurse) { RDD_ALIGNED_READER *state = self->state; int rc = RDD_OK; if (recurse) { rc = rdd_reader_close(state->parent, recurse); if (rc != RDD_OK) { return rc; } } return RDD_OK; } rdd-2.0.7/src/rddi.py010075500000000000000000000362661043501373500132550ustar00rootwheel#!/usr/bin/env python # Copyright (c) 2002 - 2006, Netherlands Forensic Institute # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the Institute nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. import os, re, string, sys, types DEFAULT_PORT = "4832" DEFAULT_INTERVAL = "5" DEFAULT_OUT = None DEFAULT_LOG = "rdd-%u.log" % os.getpid() DEFAULT_BLKSIZE = "512k" DEFAULT_MINBLKSIZE = "512" DEFAULT_MAXERR = 0 DEFAULT_RECOVERYLEN = 3 class Cmd: def __init__(self): self.mode = None self.verb = None self.progress = None self.md5 = None self.sha1 = None self.host = None self.src = None self.dst = None self.log = None self.blksize = None self.offset = None self.count = None self.short = "rdd" self.long = "rdd" self.minblksize = None self.maxerr = None def add_opt(self, sopt, lopt, arg=None): if arg: self.short = self.short + (" %s %s" % (sopt, arg)) self.long = self.long + (" %s %s" % (lopt, arg)) else: self.short = self.short + (" %s" % sopt) self.long = self.long + (" %s" % lopt) def add_raw(self, str): self.short = self.short + (" %s" % str) self.long = self.long + (" %s" % str) def build_cmdline(self): cmd = "rdd" if self.mode == "client": self.add_opt("-C", "--client") elif self.mode == "server": self.add_opt("-S", "--server") if self.verb: self.add_opt("-v", "--verbose") if self.progress: self.add_opt("-P", "--progress", self.progress) if self.md5: self.add_opt("--md5", "--md5") if self.sha1: self.add_opt("--sha1", "--sha1") if self.blksize: self.add_opt("-b", "--block-size", self.blksize) if self.minblksize: self.add_opt("-m", "--min-block-size", self.minblksize) if self.maxerr: self.add_opt("-M", "--max-error", self.maxerr) if self.offset: self.add_opt("-o", "--offset", self.offset) if self.count: self.add_opt("-c", "--count", self.count) if self.port: self.add_opt("-p", "--port", self.port) if self.log: self.add_opt("-l", "--log-file", self.log) if self.src: self.add_raw(self.src) if self.host and self.dst: self.add_raw("%s:%s" % (self.host, self.dst)) elif self.dst: self.add_raw("%s" % self.dst) def long_cmd(self): return self.long def short_cmd(self): return self.short intro_text = """ This is the rdd command-line wizard. It will help you construct a sensible rdd command line. The wizard will ask a series of questions and will eventually print a command line that is based on your answers. Optionally, the wizard will also run this command. Type '?' to obtain help information about a question. Rdd comes with a man page. Type 'man rdd' in another window to read it. """ size_help = """ The %s is given in bytes. You may use the following multipliers: b or B (512-byte block or sector); k or K (kilobyte); m or M (megabyte); g or G (gigabyte). There should be no space between a number and its multiplier. """ mode_text = """ In which mode do you want to run rdd [local|client|server]? """ mode_help = """ In local mode, you can copy data within a single file system. (If you have NFS mount points, your file system may span multiple hosts.) In client mode, you can copy a file across the network to a server host. On the server host, you must start a server process that will receive and process the data that you send to it. In server mode, you can receive a file from an rdd client on another host. """ verb_text = """Do you want rdd to be verbose?""" verb_help = """ In verbose mode, rdd prints more informative messages than it normally does. This may be useful for debugging a problem or just for understanding what's happening. """ source_text = """Input file:""" source_help = """ This is the name of the file from which data will be read. """ desthost_text = """Destination host:""" desthost_help = """ You can specify the destination host's DNS host name (e.g., foo.bar) or its IPv4 address in dotted quad notation (e.g., 192.168.1.1). The DNS host name will work only if your client host knows how to resolve DNS host names to IPv4 addresses. """ port_text = """At which TCP port does the rdd server listen?""" port_help = """ By default, rdd clients and servers assume that rdd requests must be sent to TCP port 3482 on the server host. If you want to use another port, then you should specify another number, both at the client and the server side. Remember that ports 0-1023 are reserved for privileged uses. Port numbers higher than 65535 are invalid. """ destfile_text = """Output file:""" destfile_help = """ This is the name of the output file. All directories leading up to the output file should already exist; rdd will not create missing directories. If you do not want to create an output file, just hit ENTER. If you use output splitting, rdd will prefix the name of each output file with a sequence number. Do not specify such prefixes manually. For example, /tmp/disk.img will automatically be converted to /tmp/000-disk.img, /tmp/001-disk.img, and so on. """ hash_text = """Hash the data?""" hash_help = """ A (cryptographic) hash is a fixed-length, digital finger print of a sequence of bytes that is computed by a well-defined hash algorithm. It is very difficult to find two inputs that have the same hash value (in a reasonable amount of time). Computing a cryptographic hash over the data allows you to verify the data's integrity at another time by recomputing the hash value. The hash is computed only over the data that is read. Rdd does not guarantee that the data that it reads will be written to disk (or to the network correctly). To make sure that you have stored the data correctly, we recommend that you recompute the hash value over the stored data and compare it to the hash value computed by rdd. They should be equal. You can use the following hash algorithms: MD5 and SHA1. """ logfile_text = """Log file:""" logfile_help = """ This is the name of file in which rdd's messages will be logged. These messages will always be visible on your screen. If you do not wish to log rdd messages to a file, just hit ENTER. """ md5_text = """Use MD5?""" md5_help = """ MD5 is a cryptographic hash algorithm. It generates a 128-bit hash value from an arbitrary input stream. For a full description, see RFC 1321. MD5 is widely used, but has known weaknesses. SHA1 is considered stronger, but is not used as widely. Many hash-value databases consist only of MD5 hash values. """ sha1_text = """Use SHA1?""" sha1_help = """ SHA-1 is a cryptographic hash algorithm. It generates a 160-bit hash value from an arbitrary input stream. For a full description, see FIP 180 (a U.S. Federal Information Processing standard). SHA1 is considered a strong hash algorithm. """ inetd_text = """Use (x)inetd to start the rdd server process?""" inetd_help = """ If you say yes here, you will have to configure (x)inetd to start rdd. Make sure that (x)inetd passes the options '-S' (server mode) and '-i' (inetd) to rdd. """ overwrite_text = """Overwrite existing files?""" overwrite_help = """ If you say no here, rdd will refuse to overwrite existing files. This is the default behavior, because it prevents silly accidents. If you say yes, rdd will overwrite existing files without asking for your confirmation. """ progress_text = """ How often should rdd report progress [seconds; 0 means never]? """ progress_help = """ If you say 0 here, rdd will not print periodic progress messages. If you specify some positive number s, rdd will print a progress line every s seconds (approximately). The progress line tells you how much of the data has already been copied and gives the current copy speed. """ section_text = """ Do you wish to copy all input data or do you wish to select a section of the input data? """ section_help = """ With rdd, you can choose to copy a subsequence of the input data. You can select a single, contiguous range of bytes. If you wish to select a subsequence of your input data for copying, say yes. Otherwise, say no. """ run_text = """Run now?""" run_help = """ Type 'yes' to run your rdd command now. Type 'no' to quit. """ blksize_text = """Block size?""" blksize_help = """ The block size specifies how much data rdd will read and write at a time. The block size should be (significantly) less than the size of your machine's physical memory. I cannot give exact guidelines, but very small block sizes will slow down the copying and very large block sizes waste memory without improving performance. """ + (size_help % "block size") minblksize_text = """Minimum block size?""" minblksize_help = """ When read errors occur, rdd will progressively reduce its block size. This way, the amount of data lost to read errors is reduced. You must specify the minimum block size. Rdd will not use blocks that are smaller than this size. If a read error occurs, at least this many bytes of data will be lost. """ + (size_help % "block size") maxerr_text = """Quit after how many read errors?""" maxerr_help = """ By default, rdd will not exit after read errors. With this option, you can force rdd to exit after a specified number of read errors. If you specify 0, rdd allows infinitely many read errors. """ slice_text = """Process entire input file?""" slice_help = """ Say 'yes' if you want to process all bytes in the input file. Say 'no' if you want to process a subsequence of the input file. """ offset_text = """Input file offset (in bytes)?""" offset_help = """ Specify at which input file offset rdd should start reading data. """ + (size_help % "offset") count_text = """How many bytes to read?""" count_help = """ Specify how many input bytes should be read. """ + (size_help % "count") recover_text = """Do you want to modify any recovery options?""" recover_help = """ Recovery options include the minimum recovery block size, the retry count, and the maximum number of read errors. """ Q = { "blksize" : (blksize_text, blksize_help), "count" : (count_text, count_help), "destfile" : (destfile_text, destfile_help), "desthost" : (desthost_text, desthost_help), "hash" : (hash_text, hash_help), "logfile" : (logfile_text, logfile_help), "maxerr" : (maxerr_text, maxerr_help), "md5" : (md5_text, md5_help), "minblksize" : (minblksize_text, minblksize_help), "mode" : (mode_text, mode_help), "offset" : (offset_text, offset_help), "port" : (port_text, port_help), "progress" : (progress_text, progress_help), "recover" : (recover_text, recover_help), "run" : (run_text, run_help), "sha1" : (sha1_text, sha1_help), "slice" : (slice_text, slice_help), "source" : (source_text, source_help), "verb" : (verb_text, verb_help), } def ask(elt, answers, default=None): q, help = Q[elt] q = string.strip(q) if default: q = q + (" [%s]" % default) q = "\n*** " + q + " " sys.stdout.write(q) fp = sys.stdin while 1: ans = fp.readline() ans = string.strip(ans) if ans == "?": fprint(help, 4) elif ans == "": if default != None: return default elif type(answers) == types.StringType: if re.match(answers, ans, re.I) != None: return ans elif type(answers) in (types.TupleType, types.ListType): ans = string.lower(ans) if ans in answers: return ans else: assert 0 # No valid or no final answer; ask again sys.stdout.write(q) return ans def ask_yn(elt, default=None): ans = ask(elt, ("([yY]|[yY][eE][sS]|[nN]|[nN][oO])"), default) ans = string.lower(ans) if ans[0] == "y": return 1 else: return 0 def ask_num(elt, default=None): return ask(elt, "\d+", default) def ask_file(elt, default=None): return ask(elt, ".+", default) def ask_opt_file(elt, default=None): if default == None: default = "" f = ask_file(elt, default) if len(f) == 0: return None else: return f def format(str, indent): spaces = " " * indent width = 75 - indent fp_wr, fp_rd = os.popen2("fmt -%u" % width) fp_wr.write(str) fp_wr.close() formatted = "" for line in fp_rd.readlines(): formatted = formatted + spaces + line fp_rd.close() return formatted def fprint(txt, indent=0): print string.rstrip(format(txt, indent)) def ask_hash(cmd): if not ask_yn("hash", "yes"): cmd.md5 = None cmd.sha1 = None return if not ask_yn("md5", "yes"): cmd.md5 = None sha_default = "yes" else: cmd.md5 = 1 sha_default = "no" if not ask_yn("sha1", sha_default): cmd.sha1 = None else: cmd.sha1 = 1 def ask_size(elt, default=None): return ask(elt, "\d+[bBkKmMgG]?", default) def ask_recover(cmd): if ask_yn("recover", "no"): cmd.blksize = ask_size("minblksize", DEFAULT_MINBLKSIZE) cmd.max_err = ask_num("maxerr", DEFAULT_MAXERR) def ask_slice(cmd): if not ask_yn("slice", "yes"): cmd.offset = ask_size("offset") cmd.count = ask_size("count") else: cmd.offset = None cmd.count = None def toplevel(): global mode, verb, src, dst, host, port, progress, log global blksize, offset, count cmd = Cmd() print fprint(intro_text) cmd.mode = ask("mode", ("local", "client", "server"), "local") cmd.verb = ask_yn("verb", "no") cmd.progress = ask_num("progress", DEFAULT_INTERVAL) ask_hash(cmd) if cmd.mode == "local": cmd.src = ask_file("source") cmd.port = None cmd.host = None cmd.dst = ask_opt_file("destfile", DEFAULT_OUT) cmd.log = ask_opt_file("logfile", DEFAULT_LOG) cmd.blksize = ask_size("blksize", DEFAULT_BLKSIZE) ask_recover(cmd) ask_slice(cmd) elif cmd.mode == "client": cmd.src = ask_file("source") cmd.host = ask_file("desthost", "localhost") cmd.port = ask_num("port", DEFAULT_PORT) cmd.dst = ask_opt_file("destfile", DEFAULT_OUT) cmd.log = ask_opt_file("logfile", DEFAULT_LOG) cmd.blksize = ask_size("blksize", DEFAULT_BLKSIZE) ask_recover(cmd) ask_slice(cmd) elif cmd.mode == "server": cmd.src = None cmd.host = None cmd.port = ask_num("port", DEFAULT_PORT) cmd.dst = None cmd.log = ask_opt_file("logfile", DEFAULT_LOG) cmd.blksize = None cmd.offset, cmd.count = None, None cmd.build_cmdline() cmd_short = cmd.short_cmd() cmd_long = cmd.long_cmd() print "Command lines:\n\n\t%s\n\n\t%s" % (cmd_short, cmd_long) if ask_yn("run", "no"): os.system(cmd_short) toplevel() rdd-2.0.7/src/rdd-verify.1010064400000000000000000000045341043500747400141070ustar00rootwheel.TH VERIFIER "1" "February 2002" "rdd-verify" .SH NAME rdd-verify \- verifies checksums and hash values generated by \fBrdd-copy(1)\fR .SH SYNOPSIS .B rdd-verify [\fIOPTION\fR] \fIfile1\fR ... .SH DESCRIPTION .\" Add any additional description here .PP \fBRdd-verify\fR verifies checksums and hash values generated by \fBrdd-copy(1)\fR. Rdd stores checksums (Adler32 or CRC32) in files. These files must be passed to \fBrdd-verify\fR for verification. Hash values (MD5 or SHA1) computed by \fBrdd-copy(1)\fR must be passed to \fBrdd-verify\fR on the command line as hexadecimal strings. \fBRdd-verify\fR reads all input files (\fIfile1\fR, ...) and recomputes the checksums and hash values that the user wishes to verify. The verification will very likely fail if the concatenation of the input files is different from the source that was copied by \fBrdd-copy(1)\fR. .SH OUTPUT All verification errors are reported on \fBstderr\fR. .SH OPTIONS .TP \fB\-?, \-\-help\fR Print a usage message. .TP \fB\-V, \-\-version\fR Report version number and exit. .TP \fB\-v, \-\-verbose\fR Be verbose (more messages). .TP \fB\-v, \-\-verbose\fR Be verbose (more messages). .TP \fB\-\-checksum, \-\-adler32\fR \fIfile\fR Verify the Adler32 checksums stored in \fIfile\fR. .TP \fB\-\-crc, \-\-crc32\fR \fIfile\fR Verify the CRC32 checksums stored in \fIfile\fR. .TP \fB-\-md5, \-\-md5\fR \fIdigest\fR Recompute the MD5 hash value. It should be equal to \fIdigest\fR. .TP \fB-\-sha, \-\-sha1 \fIdigest\fR Recompute the SHA1 hash value. It should be equal to \fIdigest\fR. .PP A \fIdigest\fR argument is a hexadecimal string. Leading zeroes may not be omitted. .SH EXAMPLES .TP rdd-verify --md5 0123456789abcdef0123456789abcdef disk.img Compute the MD5 hash value over disk.img and verify whether it equals 0123456789abcdef0123456789abcdef. .TP rdd-verify --adler32 checksums.a32 disk.img Compute the adler32 checksums over disk.img and compare each checksum to the corresponding checksum in checksums.a32. .SH SEE ALSO .TP \fBrdd-copy(1)\fR .SH "REPORTING BUGS" Report bugs to . .SH ACKNOWLEDGEMENTS Many thanks to all who reported bugs and successes, and who suggested improvements. You know who you are. .SH COPYRIGHT Copyright \(co 2002-2003 Netherlands Forensic Institute .br This software comes with NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. rdd-2.0.7/src/error.c010064400000000000000000000133631043500674000132420ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "rdd.h" #include "error.h" #define NO_CONSOLE 0 #define CONSOLE 1 static char *progname = ""; static char *email_addr = PACKAGE_BUGREPORT; static char *bug_message_fmt = "Rdd has crashed. Please do the following:\n" " 1. Write down the time of day reported by your computer.\n" " 2. If rdd dumped core, save a copy of the core file.\n" " 3. Save a copy of /var/log/messages.\n" " 4. Save a copy of your rdd binary.\n" " 4. Report this problem to %s.\n"; static FILE *logfp = NULL; static int new_line = 1; #if defined(RDD_CONSOLE) #define LOGFP (logfp) #else #define LOGFP ((logfp) == NULL ? stderr : (logfp)) #endif /** \brief Sends a formatted message to a log file and optionally * to the console. */ static void log_vprintf(int console, char *fmt, va_list ap) { if (console) { #if defined(RDD_CONSOLE) rdd_cons_vprintf(fmt, ap); #else /* No true console access. Use stderr instead. */ vfprintf(stderr, fmt, ap); #endif } if (logfp != NULL) { /* There is a log file. Write the message to the * log file. */ vfprintf(logfp, fmt, ap); } else if (! console) { /* There is no log file and this message was not * explicitly sent to the console. Since we do not * want messages to get lost we will send it to the * console anyway. */ #if defined(RDD_CONSOLE) rdd_cons_vprintf(fmt, ap); #else /* No true console access. Use stderr instead. */ vfprintf(stderr, fmt, ap); #endif } } static void log_printf(int console, char *fmt, ...) { va_list ap; va_start(ap, fmt); log_vprintf(console, fmt, ap); va_end(ap); } static void log_flush(void) { if (logfp != NULL) fflush(logfp); } void set_progname(char *name) { progname = name; } void set_logfile(FILE *fp) { if (logfp != NULL) { fflush(logfp); } logfp = fp; } void bug(char *fmt, ...) { va_list ap; va_start(ap, fmt); log_printf(CONSOLE, "%s: bug: ", progname); log_vprintf(CONSOLE, fmt, ap); log_printf(CONSOLE, "\n\n"); log_printf(CONSOLE, bug_message_fmt, email_addr); log_flush(); va_end(ap); abort(); } void error(char *fmt, ...) { va_list ap; va_start(ap, fmt); log_printf(CONSOLE, "%s: ", progname); log_vprintf(CONSOLE, fmt, ap); log_printf(CONSOLE, "\n"); log_flush(); va_end(ap); exit(EXIT_FAILURE); } void warn(char *fmt, ...) { va_list ap; va_start(ap, fmt); log_printf(CONSOLE, "(warning) %s: ", progname); log_vprintf(CONSOLE, fmt, ap); log_printf(CONSOLE, "\n"); log_flush(); va_end(ap); } void unix_warn(char *fmt, ...) { va_list ap; int err = errno; va_start(ap, fmt); log_printf(CONSOLE, "%s: ", progname); log_vprintf(CONSOLE, fmt, ap); log_printf(CONSOLE, ": %s\n", strerror(err)); log_flush(); va_end(ap); } void unix_error(char *fmt, ...) { va_list ap; int err = errno; va_start(ap, fmt); log_printf(CONSOLE, "%s: ", progname); log_vprintf(CONSOLE, fmt, ap); log_printf(CONSOLE, ": %s\n", strerror(err)); log_flush(); va_end(ap); exit(EXIT_FAILURE); } void errlog(char *fmt, ...) { va_list ap; if (new_line) log_printf(CONSOLE, "%s: ", rdd_ctime()); va_start(ap, fmt); log_vprintf(CONSOLE, fmt, ap); va_end(ap); new_line = 0; } void errlognl(char *fmt, ...) { va_list ap; if (new_line) log_printf(CONSOLE, "%s: ", rdd_ctime()); va_start(ap, fmt); log_vprintf(CONSOLE, fmt, ap); log_printf(CONSOLE, "\n"); log_flush(); va_end(ap); new_line = 1; } void rdd_error(int errcode, char *fmt, ...) { char msg[1024]; va_list ap; int rc; va_start(ap, fmt); log_printf(CONSOLE, "%s: ", progname); log_vprintf(CONSOLE, fmt, ap); va_end(ap); log_printf(CONSOLE, ": "); rc = rdd_strerror(errcode, msg, sizeof msg); if (rc == RDD_NOMEM) { log_printf(CONSOLE, ""); } else if (rc == RDD_OK) { log_printf(CONSOLE, msg); } else { log_printf(CONSOLE, "internal error: " "unknown error code [%d]\n", errcode); abort(); } log_printf(CONSOLE, "\n"); log_flush(); exit(EXIT_FAILURE); } rdd-2.0.7/src/md5.h010064400000000000000000000062301042173111100125660ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __md5_h__ #define __md5_h__ /* The MD5 code used by rdd has been copied from RFC 1321 has therefore * been derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm. * See below for the original copyright notice as it appears in RFC 1321. */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. * All rights reserved. * * License to copy and use this software is granted provided that it * is identified as the "RSA Data Security, Inc. MD5 Message-Digest * Algorithm" in all material mentioning or referencing this software * or this function. * * License is also granted to make and use derivative works provided * that such works are identified as "derived from the RSA Data * Security, Inc. MD5 Message-Digest Algorithm" in all material * mentioning or referencing the derived work. * * RSA Data Security, Inc. makes no representations concerning either * the merchantability of this software or the suitability of this * software for any particular purpose. It is provided "as is" * without express or implied warranty of any kind. * * These notices must be retained in any copies of any part of this * documentation and/or software. */ #define MD5_DIGEST_LENGTH 16 typedef struct { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } MD5_CTX; void MD5_Init(MD5_CTX *); void MD5_Update(MD5_CTX *, unsigned char *, unsigned int); void MD5_Final(unsigned char [MD5_DIGEST_LENGTH], MD5_CTX *); #endif /* __md5_h__ */ rdd-2.0.7/src/commandline.h010064400000000000000000000044531043500671600144070ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __commandline_h__ #define __commandline_h__ #define flag_set(word, bit) (((word) & (bit)) != 0) typedef struct _RDD_OPTION { char *short_name; char *long_name; char *arg_descr; unsigned valid_modes; char *description; unsigned count; char *arg_value; } RDD_OPTION; /** * Verify whether argv[*i] is an option name (short or long) and * whether its argument, if any, is present. */ void rdd_opt_init(RDD_OPTION *opttab, const char *usage_msg); RDD_OPTION *rdd_get_opt_with_arg(char **argv, int argc, unsigned *i, char **opt, char **arg); int rdd_opt_set_arg(char *longname, char **argp); int rdd_opt_set(char *longname); void rdd_opt_usage(void); #endif /* __commandline_h__ */ rdd-2.0.7/src/zlibwriter.c010064400000000000000000000117321042173111100142740ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #if defined(HAVE_LIBZ) #include #include #include #include #else #error: libz not present #endif #include "rdd.h" #include "writer.h" #define ZBUF_SIZE 32768 #define z_inbuf_empty(z) ((z)->avail_in <= 0) #define z_outbuf_full(z) ((z)->avail_out <= 0) /* Forward declarations */ static int zlib_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte); static int zlib_close(RDD_WRITER *w); static RDD_WRITE_OPS zlib_write_ops = { zlib_write, zlib_close }; typedef struct _RDD_ZLIB_WRITER { RDD_WRITER *parent; z_stream zstate; unsigned char *zbuf; } RDD_ZLIB_WRITER; int rdd_open_zlib_writer(RDD_WRITER **self, RDD_WRITER *parent) { RDD_WRITER *w = 0; RDD_ZLIB_WRITER *state = 0; unsigned char *zbuf = 0; int rc = RDD_OK; rc = rdd_new_writer(&w, &zlib_write_ops, sizeof(RDD_ZLIB_WRITER)); if (rc != RDD_OK) { goto error; } state = (RDD_ZLIB_WRITER *) w->state; if ((zbuf = malloc(ZBUF_SIZE)) == 0) { rc = RDD_NOMEM; goto error; } state->zbuf = zbuf; state->parent = parent; memset(&state->zstate, 0, sizeof(z_stream)); state->zstate.zalloc = Z_NULL; state->zstate.zfree = Z_NULL; state->zstate.opaque = 0; state->zstate.next_out = zbuf; state->zstate.avail_out = ZBUF_SIZE; rc = deflateInit(&state->zstate, Z_DEFAULT_COMPRESSION); switch (rc) { case Z_OK: break; case Z_MEM_ERROR: rc = RDD_NOMEM; goto error; default: rc = RDD_ECOMPRESS; goto error; } *self = w; return RDD_OK; error: *self = 0; if (zbuf != 0) free(zbuf); if (state != 0) free(state); if (w != 0) free(w); return rc; } /* Flushes the output that the compressor has generated so far * to the parent writer. */ static int flush(RDD_ZLIB_WRITER *state) { z_stream *z = &state->zstate; unsigned filled; int rc; filled = ZBUF_SIZE - z->avail_out; if ((rc = rdd_writer_write(state->parent, state->zbuf, filled)) != 0) { return rc; } z->next_out = state->zbuf; z->avail_out = ZBUF_SIZE; return RDD_OK; } /* Pushes the entire input buffer into the compressor. */ static int zlib_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte) { RDD_ZLIB_WRITER *state = w->state; z_stream *z = &state->zstate; int rc; z->next_in = (unsigned char *) buf; z->avail_in = nbyte; while (z->avail_in > 0) { if (z_outbuf_full(z)) { if ((rc = flush(state)) != RDD_OK) { return rc; } } assert(! z_outbuf_full(z)); rc = deflate(z, Z_NO_FLUSH); if (rc != Z_OK && rc != Z_STREAM_END) { return RDD_ECOMPRESS; } } return RDD_OK; } static int zlib_close(RDD_WRITER *self) { RDD_ZLIB_WRITER *state = self->state; z_stream *z = &state->zstate; int rc = RDD_OK; assert(z_inbuf_empty(z)); /* Flush any pending output to the parent. */ while (1) { if (z_outbuf_full(z)) { if ((rc = flush(state)) != RDD_OK) { return rc; } } assert(! z_outbuf_full(z)); rc = deflate(z, Z_FINISH); if (rc == Z_STREAM_END) { break; } else if (rc != Z_OK) { return RDD_ECOMPRESS; } } if ((rc = flush(state)) != RDD_OK) { return rc; } /* Close parent. */ if ((rc = rdd_writer_close(state->parent)) != RDD_OK) { return rc; } /* Clean up. */ free(state->zbuf); state->zbuf = 0; return RDD_OK; } rdd-2.0.7/src/error.h010064400000000000000000000116701042173111100132360ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __error_h__ #define __error_h__ /** @file * \brief Module that handles messages (errors, warnings, etc.). */ #include #include /** \brief Sets the program name that is used in future error messages. * \param name the program's name * * This function must be called before any routine that produces * a message. */ void set_progname(char *name); /** \brief Sets the log file. * \param fp a valid file pointer (open for writing) * * This function sets the log file. All messages produced by this * module are sent to the console or, if there is no console, * to the standard error stream (\c stderr). If a valid log file * (not \c NULL) is specified then all messages are also written * to that log file. */ void set_logfile(FILE *fp); /** \brief Reports a bug and aborts program execution. * \param fmt a printf-style message format string * * The format string must be followed by its arguments, * just like a printf-style format string. This function * prints the message and then calls \c abort() to terminate * the program. */ void bug(char *fmt, ...); /** \brief Prints an error message and terminates the program. * \param fmt a printf-style message format string * * The format string must be followed by its arguments, * just like a printf-style format string. This function * prints the message and then calls \c exit() to terminate * the program. */ void error(char *fmt, ...); /** \brief Reports an warning message and terminates the program. * \param fmt a printf-style message format string * * The format string must be followed by its arguments, * just like a printf-style format string. This function * prints the message. It does \b not terminate the program. */ void warn(char *fmt, ...); /** \brief Prints a Unix error message. * \param fmt a printf-style message format string * * The format string must be followed by its arguments, * just like a printf-style format string. This function * prints the message and then calls \c exit() to terminate * the program. The message is followed by the error message that * corresponds with the current value of Unix error variable \c errno. */ void unix_error(char *fmt, ...); /** \brief Prints a Unix warning message. * \param fmt a printf-style message format string * * The format string must be followed by its arguments, * just like a printf-style format string. This function * prints the message. The message is followed by the error message that * the program. The message is followed the error message that * corresponds with the current value of Unix error variable \c errno. * This function does \b not terminate the program. */ void unix_warn(char *fmt, ...); /** \brief Prints a message. */ void errlog(char *fmt, ...); /** \brief Appends a newline to a message and then prints that message. */ void errlognl(char *fmt, ...); /** \brief Prints an rdd error message and terminates the program. * \param errcode an rdd error code * \param fmt a printf-style message format string * * The format string \c fmt must be followed by its arguments, * just like a printf-style format string. This function * prints the message and then calls \c exit() to terminate * the program. The message is followed by the error message that * corresponds with rdd error code \c rc. */ void rdd_error(int errcode, char *fmt, ...); #endif /* __error_h__ */ rdd-2.0.7/src/filterset.c010064400000000000000000000110551043500677600141170ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #if defined(HAVE_CONFIG_H) #include #endif #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "writer.h" #include "filter.h" #include "filterset.h" #define is_stream_filter(fltr) ((fltr)->block_size <= 0) #define is_block_filter(fltr) ((fltr)->block_size > 0) int rdd_fset_init(RDD_FILTERSET *fset) { fset->head = 0; fset->tail = &fset->head; return RDD_OK; } int rdd_fset_add(RDD_FILTERSET *fset, const char *name, RDD_FILTER *f) { RDD_FSET_NODE *node = 0; char *filtername = 0; int rc = RDD_OK; if (name == 0 || strlen(name) < 1 || f == 0) return RDD_BADARG; rc = rdd_fset_get(fset, name, 0); if (rc == RDD_OK) { return RDD_EEXISTS; /* already in list */ } else if (rc != RDD_NOTFOUND) { return rc; } /* Create new list node. */ if ((node = calloc(1, sizeof(*node))) == 0) { rc = RDD_NOMEM; goto error; } if ((filtername = malloc(strlen(name) + 1)) == 0) { rc = RDD_NOMEM; goto error; } strcpy(filtername, name); node->name = filtername; node->filter = f; node->next = 0; /* Append new node to list. */ *(fset->tail) = node; fset->tail = &node->next; return RDD_OK; error: if (filtername != 0) free(filtername); if (node != 0) free(node); return rc; } int rdd_fset_get(RDD_FILTERSET *fset, const char *name, RDD_FILTER **f) { RDD_FSET_NODE *node; /* Linear search. */ for (node = fset->head; node != 0; node = node->next) { if (strcmp(node->name, name) == 0) { if (f != 0) *f = node->filter; return RDD_OK; } } if (f != 0) *f = 0; return RDD_NOTFOUND; } int rdd_fset_open_cursor(RDD_FILTERSET *fset, RDD_FSET_CURSOR *c) { c->current = fset->head; return RDD_OK; } int rdd_fset_cursor_next(RDD_FSET_CURSOR *c, RDD_FILTER **f) { if (c->current == 0) { if (f != 0) *f = 0; return RDD_NOTFOUND; } if (f != 0) *f = c->current->filter; c->current = c->current->next; return RDD_OK; } int rdd_fset_cursor_close(RDD_FSET_CURSOR *c) { c->current = 0; return RDD_OK; } int rdd_fset_push(RDD_FILTERSET *fset, const unsigned char *buf, unsigned nbyte) { RDD_FSET_NODE *node; int rc; for (node = fset->head; node != 0; node = node->next) { rc = rdd_filter_push(node->filter, buf, nbyte); if (rc != RDD_OK) { return rc; } } return RDD_OK; } int rdd_fset_close(RDD_FILTERSET *fset) { RDD_FSET_NODE *node; int rc; for (node = fset->head; node != 0; node = node->next) { rc = rdd_filter_close(node->filter); if (rc != RDD_OK) { return rc; } } return RDD_OK; } int rdd_fset_clear(RDD_FILTERSET *fset) { RDD_FSET_NODE *node; RDD_FSET_NODE *next; int rc; for (node = fset->head; node != 0; node = next) { next = node->next; free(node->name); node->name = 0; if ((rc = rdd_filter_free(node->filter)) != RDD_OK) { return rc; } free(node); } memset(fset, 0, sizeof(*fset)); return RDD_OK; } rdd-2.0.7/src/filterset.h010064400000000000000000000141561042173111100141100ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __filterset_h__ #define __filterset_h__ /** @file * \brief Filter collection module. * * This header file defines routines that allow a client to * create a collection of filters ---a filter set--- and to pass data to all * filters in such a filter set with a single function call. */ /** \brief Representation of a filter node. * * A filter set is implemented as a linked list of filters. * This structure defines the representation of a list node. */ typedef struct _RDD_FSET_NODE { char *name; /**< filter name */ RDD_FILTER *filter; /**< the filter */ struct _RDD_FSET_NODE *next; /**< list link */ } RDD_FSET_NODE; /** \brief Representation of a filter collection. * * A filter set is implemented as a linked list of \c RDD_FSET_NODE nodes. * This structure defines the list structure that gives access to * the list nodes. */ typedef struct _RDD_FILTERSET { RDD_FSET_NODE *head; /**< head of the filter list */ RDD_FSET_NODE **tail; /**< tail of the filter list */ } RDD_FILTERSET; /** \brief Representation of a filter cursor. * * A filter cursor is used to visit all filters in a filter set. * The cursor keeps track of the current position in the filter set. */ typedef struct _RDD_FSET_CURSOR { RDD_FSET_NODE *current; } RDD_FSET_CURSOR; /** \brief Initializes a filter set. * \param fset a pointer to the filter set that is to be initialized * \return Returns \c RDD_OK on success. */ int rdd_fset_init(RDD_FILTERSET *fset); /** \brief Adds a named filter to a filter set. * \param fset the filter set * \param name the name that will be associated with the filter that is * added to the filter set * \param f the filter that is added * \return Returns \c RDD_OK on success (the filter has been added * to the filter set). Returns \c RDD_EEXISTS if * the filter set already contains a filter named \c name. In this * case the filter is \b not added to the filter set. */ int rdd_fset_add(RDD_FILTERSET *fset, const char *name, RDD_FILTER *f); /** \brief Looks up a filter by name in a filter set. * \param fset the filter set * \param name the name * \param f output value: the filter that is associated with \c name * \return Returns \c RDD_OK on success (filter set \c fset * contains a filter named \c name). Returns \c RDD_NOTFOUND if * filter set \c fset contains no filter named \c name. */ int rdd_fset_get(RDD_FILTERSET *fset, const char *name, RDD_FILTER **f); /** \brief Opens a cursor that can be used to iterate over a filter set. * \param fset the filter set * \param c the cursor * \return Returns \c RDD_OK on success. * * A filter cursor is used to visit all filters in a filter set. * The order in which filters are visited is not defined. A filter * set must not be modified (no insertions or deletions) while * it is being visited by a filter cursor. */ int rdd_fset_open_cursor(RDD_FILTERSET *fset, RDD_FSET_CURSOR *c); /** \brief Retrieves the filter stored at a filter cursor's current position * and advances the filter cursor. * \param c the filter cursor * \param f output value: the filter stored at the current position * \return Returns \c RDD_OK on success. Returns \c RDD_NOTFOUND * if the cursor has already visited all filters. */ int rdd_fset_cursor_next(RDD_FSET_CURSOR *c, RDD_FILTER **f); /** \brief Closes a filter cursor. * \param c the filter cursor * \return Returns \c RDD_OK on success. */ int rdd_fset_cursor_close(RDD_FSET_CURSOR *c); /** \brief Pushes a data buffer into all filters in a filter set. * \param fset the filter set * \param buf the data buffer * \param nbyte the size in bytes of the data buffer * \return Returns \c RDD_OK on success. * * This function passes data buffer \c buf to each filter in the filter * set by calling \c rdd_filter_push(f, buf, nbyte) for each filter \c f * in the filter set. */ int rdd_fset_push(RDD_FILTERSET *fset, const unsigned char *buf, unsigned nbyte); /** \brief Closes all filters in a filter set. * \param fset the filter set * \return Returns \c RDD_OK on success. * * This function closes all filters in the filters by calling * \c rdd_filter_close(f) for each filter \c f in the filter set. */ int rdd_fset_close(RDD_FILTERSET *fset); /** \brief Destroys all resources associated with a filter set. * \param fset the filter set * \return Returns \c RDD_OK on success. * * This function will also destroy all filters stored in the filter set * by calling \c rdd_filter_free() for each filter. */ int rdd_fset_clear(RDD_FILTERSET *fset); #endif /* __filterset_h__ */ rdd-2.0.7/src/outfile.c010064400000000000000000000100031043500730100135360ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "error.h" #include "outfile.h" /* Check whether path is a valid path name in the file system. */ static int path_exists(const char *path, struct stat *info) { return stat(path, info) != -1 || errno != ENOENT; } /* Opens a new output file, but refuses to overwrite * an existing file, unless the user specified -f. */ int outfile_open(int *fdp, const char *path, int force_overwrite) { struct stat statinfo; int open_flags; int fd = -1; open_flags = O_CREAT|O_WRONLY; if (path_exists(path, &statinfo)) { if (S_ISDIR(statinfo.st_mode)) { unix_error("%s is a directory", path); } if (! force_overwrite) { error("refusing to overwrite %s; use -f", path); } if (S_ISREG(statinfo.st_mode)) { open_flags |= O_TRUNC; } } if ((fd = open(path, open_flags, S_IRUSR|S_IWUSR)) < 0) { unix_error("cannot open output file %s", path); } *fdp = fd; return RDD_OK; } int outfile_fopen(FILE **fpp, const char *path, int force_overwrite) { FILE *fp; int fd = -1; int rc = RDD_OK; if ((rc = outfile_open(&fd, path, force_overwrite)) != RDD_OK) { return rc; } if ((fp = fdopen(fd, "wb")) == NULL) { return RDD_EOPEN; } *fpp = fp; return RDD_OK; } /* Try to make the current output file read-only, then close it. */ void outfile_close(int fd, char *path) { struct stat statinfo; if (fd < 0) return; /* nothing open */ if (fstat(fd, &statinfo) < 0) { unix_error("cannot fstat current output file"); } if (close(fd) < 0) { unix_error("cannot close %s", path); } if (S_ISREG(statinfo.st_mode) && chmod(path, S_IRUSR|S_IRGRP|S_IROTH) < 0) { /* This need not be an error; we may not own * the output file. */ errlognl("cannot make %s read-only", path); } } void outfile_fclose(FILE *fp, char *path) { int fd, fd2; fflush(fp); if ((fd = fileno(fp)) < 0) { unix_error("no file descriptor for stream (%s)", path); } if ((fd2 = dup(fd)) < 0) { unix_error("cannot copy file descriptor (%s)", path); } if (fclose(fp) < 0) { /* This also closes fd! */ unix_error("cannot close stream (%s)", path); } outfile_close(fd2, path); } rdd-2.0.7/src/writestreamfilter.c010064400000000000000000000057741043501000400156600ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* The writefilter module implements a filter that writes * a data stream to one or more output files. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "error.h" #include "writer.h" #include "filter.h" #include "writer.h" typedef struct _RDD_WRITE_STREAM_FILTER { RDD_WRITER *writer; } RDD_WRITE_STREAM_FILTER; static int write_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); static int write_close(RDD_FILTER *f); static RDD_FILTER_OPS write_ops = { write_input, 0, write_close, 0, 0 }; int rdd_new_write_streamfilter(RDD_FILTER **self, RDD_WRITER *writer) { RDD_FILTER *f; RDD_WRITE_STREAM_FILTER *state; int rc; rc = rdd_new_filter(&f, &write_ops, sizeof(RDD_WRITE_STREAM_FILTER), 0); if (rc != RDD_OK) { return rc; } state = (RDD_WRITE_STREAM_FILTER *) f->state; state->writer = writer; *self = f; return RDD_OK; } static int write_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { RDD_WRITE_STREAM_FILTER *state = (RDD_WRITE_STREAM_FILTER *) f->state; return rdd_writer_write(state->writer, buf, nbyte); } static int write_close(RDD_FILTER *f) { return RDD_OK; } rdd-2.0.7/src/filewriter.c010064400000000000000000000042031042173111100142460ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "rdd.h" #include "writer.h" int rdd_open_file_writer(RDD_WRITER **w, const char *path) { int fd = -1; if ((fd = open(path, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR)) < 0) { return RDD_EOPEN; } return rdd_open_fd_writer(w, fd); } rdd-2.0.7/src/numparser.c010064400000000000000000000102441043500726300141210ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "numparser.h" #define flags_set(flags, bit) (((flags) & (bit)) == (bit)) static struct _RDD_MULTIPLIER { char mchar; unsigned factor; } multtab[] = { {'c', 1<<0}, /* single byte/character */ {'w', 1<<1}, /* two-byte word */ {'b', 1<<9}, /* sector/block */ {'k', 1<<10}, /* kilobyte (2^10 bytes) */ {'m', 1<<20}, /* megabyte (2^20 bytes) */ {'g', 1<<30}, /* gigabyte (2^30 bytes) */ {'\000', 0} /* sentinel */ }; /* Parse size specifications of the form 32k, 4M, etc. Don't * use atoi(), because we have to be able to process numbers * that won't fit in a 32-bit integer. */ int rdd_parse_bignum(const char *str, rdd_num_flags_t flags, rdd_count_t *result) { rdd_count_t sz; rdd_count_t multiplier; unsigned d, i, j; unsigned n; *result = 0; n = (unsigned) strlen(str); sz = 0; for (i = 0; i < n && isdigit(str[i]); i++) { d = str[i] - '0'; if (sz > (RDD_COUNT_MAX - d) / 10) { return RDD_ERANGE; /* overflow */ } sz = 10 * sz + d; } if ((i == 0) || (i < n - 1)) { return RDD_ESYNTAX; /* no digits or too many nondigits */ } /* i==n-1 or i==n */ if (i == n - 1) { /* Search for multiplier. */ multiplier = 0; for (j = 0; multtab[j].mchar != '\0'; j++) { if (tolower(str[i]) == multtab[j].mchar) { multiplier = multtab[j].factor; break; } } if (multiplier == 0) { return RDD_ESYNTAX; /* bad multiplier */ } if (sz > (RDD_COUNT_MAX / multiplier)) { return RDD_ERANGE; /* overflow */ } sz *= multiplier; } if (flags_set(flags, RDD_POSITIVE) && sz <= 0) return RDD_ERANGE; if (flags_set(flags, RDD_POWER2)) { /* sz should be a power of 2. */ rdd_count_t x; for (x = sz; x != 0 && (x & 1) == 0; x /= 2) { } if (x != 1) return RDD_ERANGE; } *result = sz; return RDD_OK; } /* Parse a nonnegative number. Standard library call atoi(3) cannot * handle 64-bit numbers. */ int rdd_parse_uint(const char *str, unsigned *result) { unsigned n; const char *p; *result = 0; n = 0; for (p = str; *p != '\0'; p++) { n *= 10; if (! isdigit(*p)) return RDD_ESYNTAX; n += *p - '0'; } *result = n; return RDD_OK; } int rdd_parse_tcp_port(const char *str, unsigned *result) { unsigned n; int rc; if ((rc = rdd_parse_uint(str, &n)) != RDD_OK) { return rc; } if (n > 65535) return RDD_ERANGE; *result = n; return RDD_OK; } rdd-2.0.7/src/outfile.h010064400000000000000000000035331042173111100135530ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __outfile_h__ #define __outfile_h__ int outfile_open(int *fd, const char *path, int force_overwrite); void outfile_close(int fd, char *path); int outfile_fopen(FILE **fp, const char *path, int force_overwrite); void outfile_fclose(FILE *fp, char *path); #endif /* __outfile_h__ */ rdd-2.0.7/src/rawreader.c010064400000000000000000000114511042173111100140510ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "reader.h" #define MOD_SECTOR(n) ((n) & (RDD_SECTOR_SIZE - 1)) typedef struct _RDD_RAW_READER { int fd; } RDD_RAW_READER; /* Forward declarations */ static int rdd_raw_read(RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread); static int rdd_raw_tell(RDD_READER *r, rdd_count_t *pos); static int rdd_raw_seek(RDD_READER *r, rdd_count_t pos); static int rdd_raw_close(RDD_READER *r, int recurse); static RDD_READ_OPS raw_read_ops = { rdd_raw_read, rdd_raw_tell, rdd_raw_seek, rdd_raw_close }; int rdd_open_raw_reader(RDD_READER **self, int fd) { RDD_READER *r = 0; RDD_RAW_READER *state = 0; int rc = RDD_OK; rc = rdd_new_reader(&r, &raw_read_ops, sizeof(RDD_RAW_READER)); if (rc != RDD_OK) { return rc; } state = (RDD_RAW_READER *) r->state; state->fd = fd; *self = r; return RDD_OK; } static int rdd_raw_read(RDD_READER *self, unsigned char *buf, unsigned nbyte, unsigned *nread) { RDD_RAW_READER *state = self->state; unsigned char *p = 0; rdd_count_t start_pos = 0; unsigned done; int rc = RDD_OK; int all_aligned = 0; /* Record current position. */ if ((rc = rdd_raw_tell(self, &start_pos)) != RDD_OK) { return rc; } /* Check whether the alignment constraints are met. */ all_aligned = MOD_SECTOR((unsigned) buf) == 0 && MOD_SECTOR(nbyte) == 0 && MOD_SECTOR(start_pos) == 0; if (! all_aligned) { return RDD_BADARG; } /* Read all sectors necessary to satisfy the user's request. */ done = 0; p = buf; while (nbyte > 0) { assert(MOD_SECTOR(nbyte) == 0); assert(MOD_SECTOR((unsigned) (p)) == 0); rc = read(state->fd, p, nbyte); if (rc < 0) { #if defined(__linux) if (errno == ENXIO) { rc = 0; /* assume EOF on raw device */ break; } #endif #if defined(RDD_SIGNALS) if (errno == EINTR) { continue; } #endif #if 0 fprintf(stderr, "offset %llu, buf %p, %u bytes:" " raw device read error [errno %d]:" " %s\n", file_pos, p, nbyte, errno, strerror(errno)); #endif return RDD_EREAD; /* read error */ } else if (rc == 0) { break; /* EOF */ } else if (MOD_SECTOR(rc) != 0) { #if 0 error("raw device returned an incomplete sector"); #endif return RDD_EREAD; /* read error */ } done += rc; nbyte -= rc; p += rc; } *nread = done; return RDD_OK; } static int rdd_raw_tell(RDD_READER *self, rdd_count_t *pos) { RDD_RAW_READER *state = self->state; off_t offset; if ((offset = lseek(state->fd, (off_t) 0, SEEK_CUR)) == (off_t) -1) { return RDD_ETELL; } *pos = (rdd_count_t) offset; return RDD_OK; } static int rdd_raw_seek(RDD_READER *self, rdd_count_t pos) { RDD_RAW_READER *state = self->state; if ((lseek(state->fd, (off_t) pos, SEEK_SET)) == (off_t) -1) { return RDD_ESEEK; } return RDD_OK; } static int rdd_raw_close(RDD_READER *self, int recurse /* ignored */) { RDD_RAW_READER *state = self->state; if (close(state->fd) < 0) { return RDD_ECLOSE; } return RDD_OK; } rdd-2.0.7/src/sha1streamfilter.c010064400000000000000000000067661043500772500154040ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "rdd.h" #include "rdd_internals.h" #if defined(HAVE_LIBCRYPTO) && defined(HAVE_OPENSSL_SHA1_H) && defined(HAVE_OPENSSL_SHA_H) #include #else /* Use local versions to allow stand-alone compilation. */ #include "sha1.h" #endif /* HAVE_LIBCRYPTO */ #include "writer.h" #include "filter.h" typedef struct _RDD_SHA1_STREAM_FILTER { SHA_CTX sha1_state; unsigned char result[SHA_DIGEST_LENGTH]; } RDD_SHA1_STREAM_FILTER; static int sha1_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); static int sha1_close(RDD_FILTER *f); static int sha1_get_result(RDD_FILTER *f, unsigned char *buf, unsigned nbyte); static RDD_FILTER_OPS sha1_ops = { sha1_input, 0, sha1_close, sha1_get_result, 0 }; int rdd_new_sha1_streamfilter(RDD_FILTER **self) { RDD_FILTER *f; RDD_SHA1_STREAM_FILTER *state; int rc; rc = rdd_new_filter(&f, &sha1_ops, sizeof(RDD_SHA1_STREAM_FILTER), 0); if (rc != RDD_OK) { return rc; } state = (RDD_SHA1_STREAM_FILTER *) f->state; SHA1_Init(&state->sha1_state); *self = f; return RDD_OK; } static int sha1_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { RDD_SHA1_STREAM_FILTER *state = (RDD_SHA1_STREAM_FILTER *) f->state; SHA1_Update(&state->sha1_state, (unsigned char *) buf, nbyte); return RDD_OK; } static int sha1_close(RDD_FILTER *f) { RDD_SHA1_STREAM_FILTER *state = (RDD_SHA1_STREAM_FILTER *) f->state; SHA1_Final(state->result, &state->sha1_state); return RDD_OK; } static int sha1_get_result(RDD_FILTER *f, unsigned char *buf, unsigned nbyte) { RDD_SHA1_STREAM_FILTER *state = (RDD_SHA1_STREAM_FILTER *) f->state; if (nbyte < SHA_DIGEST_LENGTH) return RDD_ESPACE; memcpy(buf, state->result, SHA_DIGEST_LENGTH); return RDD_OK; } rdd-2.0.7/src/netio.c010064400000000000000000000154151043500724500132300ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ /* * TCP support * * TODO: add checksumming. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "error.h" #include "msgprinter.h" #include "reader.h" #include "writer.h" #include "netio.h" #if !defined(HAVE_SOCKLEN_T) typedef int socklen_t; #endif /* Holds a 64-bit number in network format. */ struct netnum { unsigned lo; unsigned hi; }; static int net_verbose; static void pack_netnum(struct netnum *packed, rdd_count_t num) { packed->hi = htonl((num >> 32) & 0xffffffff); packed->lo = htonl(num & 0xffffffff); } static void unpack_netnum(struct netnum *packed, rdd_count_t *num) { rdd_count_t lo, hi; hi = (rdd_count_t) ntohl(packed->hi); lo = (rdd_count_t) ntohl(packed->lo); *num = (hi << 32) | lo; } /* Before any data is sent from the client to the server, the * client sends some metadata to the server. The following information * is sent: * - length of output file name including terminating null byte (64 bits) * - file size (64 bits) * - block size (64 bits) * - output file name, including terminating null byte * * These items are transmitted by rdd_send_info and received by * rdd_recv_info. */ int rdd_send_info(RDD_WRITER *writer, char *file_name, rdd_count_t file_size, rdd_count_t block_size, rdd_count_t split_size, unsigned flags) { struct netnum hdr[5]; unsigned flen; int rc; flen = strlen(file_name) + 1; if (flen > RDD_MAX_FILENAMESIZE) { return RDD_ERANGE; } pack_netnum(&hdr[0], (rdd_count_t) flen); pack_netnum(&hdr[1], file_size); pack_netnum(&hdr[2], block_size); pack_netnum(&hdr[3], split_size); pack_netnum(&hdr[4], (rdd_count_t) flags); rc = rdd_writer_write(writer, (const unsigned char *) hdr, sizeof hdr); if (rc != RDD_OK) { return rc; } rc = rdd_writer_write(writer, (unsigned char *) file_name, flen); if (rc != RDD_OK) { return rc; } /* TODO: add header checksum */ return RDD_OK; } /* Reads exactly buflen bytes into buffer buf using reader. */ static int receive(RDD_READER *reader, unsigned char *buf, unsigned buflen) { unsigned nread = 0; int rc; rc = rdd_reader_read(reader, buf, buflen, &nread); if (rc != RDD_OK) { return rc; } if (nread != buflen) { return RDD_ESYNTAX; } return RDD_OK; } /* Receives a copy request header from an rdd client and extracts * all information from that header. */ int rdd_recv_info(RDD_READER *reader, char **filename, rdd_count_t *file_size, rdd_count_t *block_size, rdd_count_t *split_size, unsigned *flagp) { struct netnum hdr[5]; rdd_count_t flen; rdd_count_t flags; int rc; rc = receive(reader, (unsigned char *) &hdr, sizeof hdr); if (rc != RDD_OK) { return rc; } /* TODO: verify header checksum */ unpack_netnum(&hdr[0], &flen); unpack_netnum(&hdr[1], file_size); unpack_netnum(&hdr[2], block_size); unpack_netnum(&hdr[3], split_size); unpack_netnum(&hdr[4], &flags); *flagp = (unsigned) flags; if (flen > RDD_MAX_FILENAMESIZE) { return RDD_ERANGE; } if (flen <= 1) { return RDD_ESYNTAX; } if ((*filename = malloc(flen)) == 0) { return RDD_NOMEM; } rc = receive(reader, (unsigned char *) *filename, flen); if (rc != RDD_OK) { return rc; } if ((*filename)[flen-1] != '\0') { return RDD_ESYNTAX; } return RDD_OK; } int rdd_init_server(RDD_MSGPRINTER *printer, unsigned port, int *server_sock) { struct sockaddr_in addr; int sock = -1; int on = 1; if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { rdd_mp_unixmsg(printer, RDD_MSG_ERROR, errno, "cannot create TCP socket"); goto error; } memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); addr.sin_port = htons(port); if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) { rdd_mp_unixmsg(printer, RDD_MSG_ERROR, errno, "cannot set socket option SO_REUSEADDR"); goto error; } if (bind(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) { rdd_mp_unixmsg(printer, RDD_MSG_ERROR, errno, "cannot bind TCP socket to local port %u", port); goto error; } if (listen(sock, 5) < 0) { rdd_mp_unixmsg(printer, RDD_MSG_ERROR, errno, "cannot listen to TCP socket"); goto error; } *server_sock = sock; return RDD_OK; error: if (sock != -1) (void) close(sock); *server_sock = -1; return RDD_EOPEN; } int rdd_await_connection(RDD_MSGPRINTER *printer, int server_sock, int *client_sock) { struct sockaddr_in addr; socklen_t len = sizeof(addr); int clsock = -1; if ((clsock = accept(server_sock, (struct sockaddr *)&addr, &len)) < 0) { rdd_mp_unixmsg(printer, RDD_MSG_ERROR, errno, "cannot accept client connection"); goto error; } if (net_verbose) { rdd_mp_message(printer, RDD_MSG_INFO, "Accepted inbound connection from %s", inet_ntoa(addr.sin_addr)); } *client_sock = clsock; return RDD_OK; error: if (clsock != -1) (void) close(clsock); *client_sock = -1; return RDD_EOPEN; } rdd-2.0.7/src/statsblockfilter.c010064400000000000000000000136061043500774400154750ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "rdd.h" #include "rdd_internals.h" #include "error.h" #include "writer.h" #include "filter.h" #include "msgprinter.h" #define NUM_BYTE_VAL 256 #define RDD_LN2 0.69314718055994530942 typedef struct _RDD_STATS_BLOCKFILTER { rdd_count_t blocknum; unsigned histogram[NUM_BYTE_VAL]; unsigned minbyte; unsigned maxbyte; char *path; RDD_MSGPRINTER *printer; } RDD_STATS_BLOCKFILTER; static int stats_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); static int stats_block(RDD_FILTER *f, unsigned nbyte); static int stats_close(RDD_FILTER *f); static int stats_free(RDD_FILTER *f); static RDD_FILTER_OPS stats_ops = { stats_input, stats_block, stats_close, 0, stats_free }; int rdd_new_stats_blockfilter(RDD_FILTER **self, unsigned blocksize, const char *outpath, int force_overwrite) { RDD_FILTER *f = 0; RDD_STATS_BLOCKFILTER *state = 0; char *path = 0; RDD_MSGPRINTER *prn = 0; int rc; rc = rdd_new_filter(&f, &stats_ops, sizeof(RDD_STATS_BLOCKFILTER), blocksize); if (rc != RDD_OK) { goto error; } state = (RDD_STATS_BLOCKFILTER *) f->state; if ((path = malloc(strlen(outpath) + 1)) == 0) { rc = RDD_NOMEM; goto error; } strcpy(path, outpath); if ((rc = rdd_mp_open_file_printer(&prn, outpath)) != RDD_OK) { goto error; } state->blocknum = 0; memset(state->histogram, 0, sizeof(state->histogram)); state->minbyte = NUM_BYTE_VAL - 1; state->maxbyte = 0; state->path = path; state->printer = prn; *self = f; return RDD_OK; error: *self = 0; if (path != 0) free(path); if (state != 0) free(state); if (f != 0) free(f); return rc; } /** Computes block statistics based on the byte-value histogram. * The modus is the byte value that occurs most in the block. * Entropy measures randomness in a block. It is computed as * sum(-Pi * (log2(Pi))), where Pi is the occurrence frequency of * byte value i and where i ranges over all byte values with positive Pi. */ static void compute_histogram_stats(RDD_STATS_BLOCKFILTER *state, unsigned block_size, double *entropy, unsigned *modus_byteval, unsigned *modus_count) { unsigned byte, count; unsigned mval, mcount; double p, ent; ent = 0.0; mval = 0; mcount = state->histogram[mval]; for (byte = 0; byte < NUM_BYTE_VAL; byte++) { count = state->histogram[byte]; if (count > 0) { p = ((double) count) / ((double) block_size); ent += -p * (log(p) / RDD_LN2); } if (count > mcount) { mval = byte; mcount = count; } } *entropy = ent; *modus_byteval = mval; *modus_count = mcount; } /** Uses the byte values in buf to update the histogramming * statistics for the current block. */ static int stats_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { RDD_STATS_BLOCKFILTER *state = (RDD_STATS_BLOCKFILTER *) f->state; unsigned byte; unsigned i; for (i = 0; i < nbyte; i++) { byte = buf[i]; state->histogram[byte]++; if (byte < state->minbyte) state->minbyte = byte; if (byte > state->maxbyte) state->maxbyte = byte; } return RDD_OK; } /** Computes and outputs the per-block histogramming statistics: * entropy, mininum byte value, maximum byte value, and modus. */ static int stats_block(RDD_FILTER *f, unsigned nbyte) { RDD_STATS_BLOCKFILTER *state = (RDD_STATS_BLOCKFILTER *) f->state; unsigned modus, fmodus; double entropy; compute_histogram_stats(state, nbyte, &entropy, &modus, &fmodus); rdd_mp_message(state->printer, RDD_MSG_INFO, "%llu\t%u\t%u\t%u\t%u\t%lf", state->blocknum, state->minbyte, state->maxbyte, modus, fmodus, entropy); state->blocknum++; memset(state->histogram, 0, sizeof(state->histogram)); state->minbyte = NUM_BYTE_VAL - 1; state->maxbyte = 0; return RDD_OK; } static int stats_close(RDD_FILTER *f) { RDD_STATS_BLOCKFILTER *state = (RDD_STATS_BLOCKFILTER *) f->state; int rc; rc = rdd_mp_close(state->printer, RDD_MP_RECURSE|RDD_MP_READONLY); if (rc != RDD_OK) { return rc; } return RDD_OK; } static int stats_free(RDD_FILTER *f) { RDD_STATS_BLOCKFILTER *state = (RDD_STATS_BLOCKFILTER *) f->state; free(state->path); return RDD_OK; } rdd-2.0.7/src/numparser.h010064400000000000000000000036651042173111100141260ustar00rootwheel/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __numparser_h__ #define __numparser_h__ /* Flags */ typedef enum _rdd_num_flags_t { RDD_POSITIVE = 0x1, RDD_POWER2 = 0x2 } rdd_num_flags_t; int rdd_parse_bignum(const char *str, rdd_num_flags_t flags, rdd_count_t *result); int rdd_parse_uint(const char *str, unsigned *result); int rdd_parse_tcp_port(const char *str, unsigned *result); #endif /* __numparser_h__ */ rdd-2.0.7/src/plot-entropy.py010064400000000000000000000123601042173111100147570ustar00rootwheel#!/usr/bin/env python # Copyright (c) 2002 - 2006, Netherlands Forensic Institute # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the Institute nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # import getopt, os, re, string, sys USAGE = "python plot.py file range" KBYTE = 1024 MBYTE = KBYTE * KBYTE GBYTE = KBYTE * MBYTE DEFAULT_BLOCKSIZE = 256 * KBYTE infile = None outfile = None title = None debug = 0 blocksize = None xlo = None xhi = None exclude = None def error(msg): sys.stderr.write(msg + "\n") sys.exit(1) def warn(msg): sys.stderr.write(msg + "\n") def usage(): sys.stderr.write("Usage: plot-entropy.py infile [lo hi]\n" + "\t-o \n" + "\t-t \n" + "\t-b <block size>\n" + "\t-x <exclude file>\n") sys.exit(1) def commandLine(): global debug, exclude, infile, outfile, xlo, xhi, blocksize, title opts, args = getopt.getopt(sys.argv[1:], "b:do:t:x:") for opt, val in opts: if opt == "-b": blocksize = long(val) if opt == "-d": debug = 1 elif opt == "-o": outfile = val elif opt == "-t": title = val elif opt == "-x": exclude = val if len(args) == 1: infile, = args elif len(args) == 3: infile, xlo, xhi = args xlo = long(xlo) xhi = long(xhi) else: usage() def readExcludeFile(path): fp = file(path) xblocks = [] for line in fp: line = line.strip() blocknum, nblock = line.split() xblocks.append((long(blocknum), long(nblock))) fp.close() return xblocks def getFileInfo(infile): bsize = None ncol = None try: fp = file(infile, "r") hdrline = fp.readline() dataline = fp.readline() cols = dataline.split() ncol = len(cols) fp.close() m = re.match("# blocksize (\d+)", hdrline) if m != None: bsize = long(m.group(1)) else: warn("old-style input file; no block size comment") except: raise pass return bsize, ncol def plotRange(fp, path, lo, hi, mult, col): fp.write(" \"%s\"" % path) # fp.write(" using ($0 * %f):%u" % (mult, col)) if hi != None: fp.write(" using (($0 >= %lu) && ($0 < %lu) ? $0* %f : 1/0):%u" % (lo, hi, mult, col)) else: fp.write(" using ($0 >= %lu ? $0* %f : 1/0):%u" % (lo, mult, col)) fp.write(" with points pointtype 2, \\") fp.write("\n") def plot(infile, xlist, outfile, title, xlo, xhi): if outfile == None: outfile = "/dev/null" persist = 1 output = "x11" else: persist = 0 output = "png" if title == None: title = infile bs, ncol = getFileInfo(infile) if bs != None and blocksize != None: if bs != blocksize: error("Block size in file differs " + "from command-line block size") if bs == None: bs = blocksize if bs == None: warn("Assuming default block size (%u)" % DEFAULT_BLOCKSIZE) bs = DEFAULT_BLOCKSIZE gbmult = float(bs) / float(GBYTE) if ncol == None: error("Unknown column count in %s" % infile) entropyCol = ncol if debug: fp = sys.stdout elif persist: fp = os.popen("gnuplot -persist >%s" % outfile, "w") else: fp = os.popen("gnuplot >%s" % outfile, "w") fp.write("set title \"%s (block size: %u Kbyte)\"\n" \ % (title, float(bs) / KBYTE)) fp.write("set nokey\n") fp.write("set terminal %s\n" % output) fp.write("set xzeroaxis\n") fp.write("set xlabel \"Disk Location (GB)\"\n") fp.write("set ylabel \"Entropy\"\n") if xlo == None: fp.write("set xrange [0:]\n") else: print ("set xrange [%d:%d]\n" % (xlo, xhi)) fp.write("set xrange [%d:%d]\n" % (xlo, xhi)) # fp.write("set yrange [0.0:16.1]\n") # fp.write("plot \"< awk '{print $1, $6}' %s\"" % infile) prevnum = 0L fp.write("plot ") for blocknum, nblock in xlist: plotRange(fp, infile, prevnum, blocknum, gbmult, entropyCol) prevnum = blocknum + nblock plotRange(fp, infile, prevnum, None, gbmult, entropyCol) fp.write("0\n") fp.close() def main(): commandLine() if exclude != None: excludeList = readExcludeFile(exclude) else: excludeList = [] plot(infile, excludeList, outfile, title, xlo, xhi) if __name__ == "__main__": main() ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/netio.h�������������������������������������������������������������������������������0100644�0000000�0000000�00000004265�10421731111�0013225�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __netio_h__ #define __netio_h__ #include "msgprinter.h" typedef enum _rdd_net_flags_t { RDD_NET_COMPRESS = 0x1 } rdd_net_flags_t; int rdd_init_server(RDD_MSGPRINTER *printer, unsigned port, int *server_sock); int rdd_await_connection(RDD_MSGPRINTER *printer, int server_sock, int *client_sock); int rdd_recv_info(RDD_READER *reader, char **filename, rdd_count_t *file_size, rdd_count_t *block_size, rdd_count_t *split_size, unsigned *flags); int rdd_send_info(RDD_WRITER *writer, char *file_name, rdd_count_t file_size, rdd_count_t block_size, rdd_count_t split_size, unsigned flags); #endif /* __netio_h__ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/tcpwriter.c���������������������������������������������������������������������������0100644�0000000�0000000�00000005045�10421731111�0014122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdarg.h> #include <sys/types.h> #include <netdb.h> #include <netinet/in.h> #include <arpa/inet.h> #include <sys/socket.h> #include <string.h> #include <signal.h> #include <stdlib.h> #include "rdd.h" #include "writer.h" int rdd_open_tcp_writer(RDD_WRITER **w, const char *host, unsigned port) { struct sockaddr_in addr; struct hostent *he = 0; int sock = -1; if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { return RDD_ECONNECT; } if ((he = gethostbyname(host)) == NULL) { return RDD_ECONNECT; } memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; memcpy(&addr.sin_addr, he->h_addr_list[0], he->h_length); addr.sin_port = htons(port); if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) { return RDD_ECONNECT; } return rdd_open_fd_writer(w, sock); } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/filter.c������������������������������������������������������������������������������0100644�0000000�0000000�00000011326�10435006756�0013402�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include "rdd.h" #include "writer.h" #include "filter.h" #define is_stream_filter(fltr) ((fltr)->ops->block == 0) #define is_block_filter(fltr) ((fltr)->ops->block != 0) /** This is a convenience routine that can (and should) be used * by filter implementations to initialize the 'base' filter. */ int rdd_new_filter(RDD_FILTER **new, RDD_FILTER_OPS *ops, unsigned statesize, unsigned blocksize) { RDD_FILTER *f = 0; unsigned char *state = 0; int rc = RDD_OK; if (new == 0 || ops == 0) return RDD_BADARG; if (ops->block != 0 && blocksize == 0) return RDD_BADARG; if ((f = calloc(1, sizeof(RDD_FILTER))) == 0) { rc = RDD_NOMEM; goto error; } if ((state = calloc(1, statesize)) == 0) { rc = RDD_NOMEM; goto error; } f->ops = ops; f->state = state; f->pos = 0; f->blocksize = blocksize; *new = f; return RDD_OK; error: *new = 0; if (state != 0) free(state); if (f != 0) free(f); return rc; } static int stream_filter_push(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { RDD_FILTER_OPS *ops = f->ops; return (*ops->input)(f, buf, nbyte); } static int block_filter_push(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { RDD_FILTER_OPS *ops = f->ops; unsigned todo; int rc; while (nbyte > 0) { if (f->pos + nbyte > f->blocksize) { todo = f->blocksize - f->pos; } else { todo = nbyte; } rc = (*ops->input)(f, buf, todo); if (rc != RDD_OK) { return rc; } buf += todo; nbyte -= todo; f->pos += todo; if (f->pos >= f->blocksize) { /* Pushed a full block; notify client. */ rc = (*ops->block)(f, f->pos); if (rc != RDD_OK) { return rc; } f->pos = 0; } } return RDD_OK; } /** Passes a buffer of nbyte bytes to a filter. If the filter is a * stream filter it will simply pass the buffer to the client's * handler. If the filter is a block filter, it processes the * buffer block by block, calling the client's block handler at * each block boundary. */ int rdd_filter_push(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte) { if (is_stream_filter(f)) { return stream_filter_push(f, buf, nbyte); } else { return block_filter_push(f, buf, nbyte); } } int rdd_filter_close(RDD_FILTER *f) { RDD_FILTER_OPS *ops = f->ops; int rc; if (is_block_filter(f) && f->pos > 0) { rc = (*ops->block)(f, f->pos); /* final block() call */ if (rc != RDD_OK) { return rc; } f->pos = 0; } if (ops->close != 0) { return (*ops->close)(f); } return RDD_OK; } int rdd_filter_get_result(RDD_FILTER *f, unsigned char *buf, unsigned nbyte) { RDD_FILTER_OPS *ops = f->ops; if (buf == 0) return RDD_BADARG; if (ops->get_result == 0) return RDD_NOTFOUND; return (*ops->get_result)(f, buf, nbyte); } int rdd_filter_free(RDD_FILTER *f) { RDD_FILTER_OPS *ops = f->ops; int rc; if (ops->free != 0) { rc = (*ops->free)(f); if (rc != RDD_OK) { return rc; } } free(f->state); f->state = 0; free(f); return RDD_OK; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/cdromreader.c�������������������������������������������������������������������������0100644�0000000�0000000�00000010120�10421731111�0014354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <errno.h> #include <unistd.h> #include <fcntl.h> #include "rdd.h" #include "reader.h" typedef struct _RDD_CDROM_READER { char *path; rdd_count_t pos; } RDD_CDROM_READER; /* Forward declarations */ static int rdd_cdrom_read(RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread); static int rdd_cdrom_tell(RDD_READER *r, rdd_count_t *pos); static int rdd_cdrom_seek(RDD_READER *r, rdd_count_t pos); static int rdd_cdrom_close(RDD_READER *r, int recurse); static RDD_READ_OPS fd_read_ops = { rdd_cdrom_read, rdd_cdrom_tell, rdd_cdrom_seek, rdd_cdrom_close }; int rdd_open_cdrom_reader(RDD_READER **self, const char *path) { RDD_READER *r = 0; RDD_CDROM_READER *state = 0; char *devpath = 0; int rc = RDD_OK; rc = rdd_new_reader(&r, &fd_read_ops, sizeof(RDD_CDROM_READER)); if (rc != RDD_OK) { return rc; } if ((devpath = malloc(strlen(path) + 1)) == 0) { rc = RDD_NOMEM; goto error; } strcpy(devpath, path); state = (RDD_CDROM_READER *) r->state; state->path = devpath; state->pos = 0; *self = r; return RDD_OK; error: *self = 0; if (devpath != 0) free(devpath); return rc; } static int rdd_cdrom_read(RDD_READER *self, unsigned char *buf, unsigned nbyte, unsigned *nread) { RDD_CDROM_READER *state = self->state; unsigned char *next = buf; off_t offset; int fd = -1; int rc = RDD_OK; int n; if ((fd = open(state->path, O_RDONLY)) < 0) { rc = RDD_EOPEN; goto error; } if ((offset = lseek(fd, (off_t) state->pos, SEEK_SET)) == (off_t) -1) { rc = RDD_ESEEK; goto error; } while (nbyte > 0) { n = read(fd, next, nbyte); if (n < 0) { #if defined(RDD_SIGNALS) if (errno == EINTR) continue; #endif rc = RDD_EREAD; goto error; } else if (n == 0) { break; /* reached EOF */ } nbyte -= n; next += n; } (void) close(fd); *nread = next - buf; return RDD_OK; error: if (fd >= 0) (void) close(fd); return rc; } static int rdd_cdrom_tell(RDD_READER *self, rdd_count_t *pos) { RDD_CDROM_READER *state = self->state; *pos = (rdd_count_t) state->pos; return RDD_OK; } static int rdd_cdrom_seek(RDD_READER *self, rdd_count_t pos) { RDD_CDROM_READER *state = self->state; state->pos = pos; return RDD_OK; } static int rdd_cdrom_close(RDD_READER *self, int recurse /* ignored */) { return RDD_OK; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/rdd_internals.c�����������������������������������������������������������������������0100644�0000000�0000000�00000014607�10435007551�0014744�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <limits.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/time.h> #include <sys/types.h> #include <fcntl.h> #include <unistd.h> #include <time.h> #include <signal.h> #include "rdd.h" #include "rdd_internals.h" #include "error.h" #define MAX_SIZE_BUF_LEN 64 #define TIME_BUF_SIZE 64 #define TIME_FORMAT "%Y-%m-%d %H:%M:%S %Z" #define bitcount(t) (sizeof(t) * CHAR_BIT) /* Performs size checks on critical integer types. */ static void check_type_sizes(void) { if (bitcount(off_t) < 64) { error("configuration problem: off_t not wide enough"); } if (bitcount(rdd_count_t) < 64) { error("configuration problem: rdd_count_t not wide enough"); } if (bitcount(RDD_UINT32) < 32) { error("configuration problem: RDD_UINT32 is not 32 bits wide"); } if (bitcount(RDD_UINT64) < 64) { error("configuration problem: RDD_UINT64 is not 64 bits wide"); } if (bitcount(unsigned char) != 8) { error("configuration problem: unsigned char is not 8 bits wide"); } if (bitcount(rdd_checksum_t) != 32) { error("configuration problem: rdd_checksum_t is not 32 bits wide"); } } void rdd_init(void) { check_type_sizes(); } /** Allocates memory and clears it. */ void * rdd_malloc(size_t nbyte) { void *p; if ((p = malloc(nbyte)) == 0) { error("out of memory (%u bytes requested)", nbyte); } memset(p, 0, nbyte); /* expensive but safer */ return p; } void rdd_free(void *p) { free(p); } int rdd_buf2hex(const unsigned char *buf, unsigned bufsize, char *hexbuf, unsigned hexbuflen) { static char *hexdigits = "0123456789abcdef"; unsigned d, k, i; if (2*bufsize + 1 > hexbuflen) { return RDD_ESPACE; } for (i = k = 0; i < bufsize; i++) { d = (buf[i] >> 4) & 0xf; hexbuf[k++] = hexdigits[d]; d = buf[i] & 0xf; hexbuf[k++] = hexdigits[d]; } hexbuf[k] = '\000'; return RDD_OK; } char * rdd_ctime(void) { static char timebuf[TIME_BUF_SIZE]; time_t now; struct tm *now_local; now = time(NULL); if (now == (time_t) -1) { unix_error("cannot retrieve current time"); } if ((now_local = localtime(&now)) == NULL) { error("cannot convert Unix ticks to local time"); } if (strftime(timebuf, TIME_BUF_SIZE, TIME_FORMAT, now_local) == 0) { error("cannot convert local time to a string"); } return timebuf; } double rdd_gettime(void) { struct timeval now; if (gettimeofday(&now, 0) < 0) { unix_error("cannot read time-of-day"); } return ((double) now.tv_sec) + (1e-6 * now.tv_usec); } char * rdd_strsize(rdd_count_t size) { static char sizestr[MAX_SIZE_BUF_LEN]; if (size == RDD_WHOLE_FILE) { snprintf(sizestr, MAX_SIZE_BUF_LEN - 1, "unknown size"); } else { snprintf(sizestr, MAX_SIZE_BUF_LEN - 1, "%llu", size); } sizestr[MAX_SIZE_BUF_LEN-1] = '\000'; /* always null-terminate */ if (strlen(sizestr) >= MAX_SIZE_BUF_LEN - 1) { bug("rdd_strsize: size too large for string conversion?"); } return sizestr; } static void signal_exit(int signum) { char buf[128]; /* This is a signal handler. Use write(2), not printf. */ sprintf(buf, "rdd received signal %d and exits\n", signum); write(2, buf, strlen(buf)); _exit(EXIT_FAILURE); /* exit _now_ */ } static void set_signal_handler(int signum, void (*handler)(int sig)) { struct sigaction siginfo; siginfo.sa_handler = handler; sigemptyset(&siginfo.sa_mask); siginfo.sa_flags = 0; if (sigaction(signum, &siginfo, 0) < 0) { unix_error("cannot install signal handler for signal %d", signum); } } void rdd_catch_signals(void) { /* The following signals may be generated during * a write(2) system call. We ignore them, so * that the write will set errno and return -1. */ #if defined(SIGPIPE) set_signal_handler(SIGPIPE, SIG_IGN); #endif #if defined(SIGXFSZ) set_signal_handler(SIGXFSZ, SIG_IGN); #endif /* These signals are received when rdd is terminated * externally. In this case we exit gracefully. */ #if defined(SIGINT) set_signal_handler(SIGINT, signal_exit); #endif #if defined(SIGTERM) set_signal_handler(SIGTERM, signal_exit); #endif } int rdd_device_size(const char *path, rdd_count_t *size) { off_t offset; int fd; #if 0 /* Use stat to determine the file type. Use the size stored * in the stat buffer if we are dealing with a regular file. * Use platform-specific magic to deal with devices. */ if (stat(&pathinfo, path) < 0) { } if ((pathinfo.st_mode & S_ISREG) != 0) { *size = pathinfo.st_size; return RDD_OK; } /* Platform-specific code. */ #if defined(0) #else *size = RDD_WHOLE_FILE; return RDD_OK; #endif #endif if ((fd = open(path, O_RDONLY)) < 0) { return RDD_EOPEN; } if ((offset = lseek(fd, 0, SEEK_END)) == (off_t) -1) { return RDD_ESEEK; } *size = offset; return RDD_OK; } �������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/msgprinter.c��������������������������������������������������������������������������0100644�0000000�0000000�00000013026�10421731111�0014267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdarg.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include "rdd.h" #include "rdd_internals.h" #include "msgprinter.h" typedef struct _RDD_MSGPRINTER_POS { char *msgbuf; unsigned buflen; } RDD_MSGPRINTER_POS; int rdd_mp_open_printer(RDD_MSGPRINTER **printer, RDD_MSGPRINTER_OPS *ops, unsigned statesize) { RDD_MSGPRINTER *p = 0; void *state = 0; int rc = RDD_OK; if ((p = calloc(1, sizeof(RDD_MSGPRINTER))) == 0) { rc = RDD_NOMEM; goto error; } if ((state = calloc(1, statesize)) == 0) { rc = RDD_NOMEM; goto error; } p->ops = ops; p->state = state; p->mask = RDD_MSG_INFO|RDD_MSG_WARN|RDD_MSG_ERROR|RDD_MSG_DEBUG; *printer = p; return RDD_OK; error: *printer = 0; if (state != 0) free(state); if (p != 0) free(p); return rc; } int rdd_mp_close(RDD_MSGPRINTER *printer, unsigned flags) { RDD_MSGPRINTER_OPS *ops = printer->ops; if (ops->close != 0) { return (*ops->close)(printer, flags); } return RDD_OK; } RDD_UINT32 rdd_mp_get_mask(RDD_MSGPRINTER *printer) { return printer->mask; } void rdd_mp_set_mask(RDD_MSGPRINTER *printer, RDD_UINT32 mask) { printer->mask = mask; } static int mp_accept_message(RDD_MSGPRINTER *printer, rdd_message_t type) { if (printer == 0) return 0; if (printer->ops->print == 0) return 0; if ((printer->mask & type) == 0) return 0; return 1; } void rdd_mp_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *fmt, ...) { va_list ap; if (! mp_accept_message(printer, type)) return; va_start(ap, fmt); vsnprintf(printer->printbuf, sizeof(printer->printbuf), fmt, ap); printer->printbuf[sizeof(printer->printbuf) - 1] = '\000'; va_end(ap); (*printer->ops->print)(printer, type, errcode, printer->printbuf); } void rdd_mp_vmessage(RDD_MSGPRINTER *printer, rdd_message_t type, const char *fmt, va_list ap) { if (! mp_accept_message(printer, type)) return; vsnprintf(printer->printbuf, sizeof(printer->printbuf), fmt, ap); printer->printbuf[sizeof(printer->printbuf) - 1] = '\000'; (*printer->ops->print)(printer, type, 0, printer->printbuf); } void rdd_mp_message(RDD_MSGPRINTER *printer, rdd_message_t type, const char *fmt, ...) { va_list ap; va_start(ap, fmt); rdd_mp_vmessage(printer, type, fmt, ap); va_end(ap); } static void mp_init(RDD_MSGPRINTER_POS *pos, RDD_MSGPRINTER *printer) { printer->printbuf[0] = '\000'; pos->msgbuf = printer->printbuf; pos->buflen = sizeof(printer->printbuf); } static void mp_vprintf(RDD_MSGPRINTER_POS *pos, const char *fmt, va_list ap) { unsigned msglen; if (pos->buflen <= 0) return; /* out of space */ vsnprintf(pos->msgbuf, pos->buflen, fmt, ap); pos->msgbuf[pos->buflen - 1] = '\000'; msglen = strlen(pos->msgbuf); pos->msgbuf += msglen; pos->buflen -= msglen; } static void mp_printf(RDD_MSGPRINTER_POS *pos, const char *fmt, ...) { va_list ap; va_start(ap, fmt); mp_vprintf(pos, fmt, ap); va_end(ap); } void rdd_mp_unixmsg(RDD_MSGPRINTER *printer, rdd_message_t type, int unix_errno, const char *fmt, ...) { RDD_MSGPRINTER_POS pos; va_list ap; if (! mp_accept_message(printer, type)) return; va_start(ap, fmt); mp_init(&pos, printer); mp_vprintf(&pos, fmt, ap); mp_printf(&pos, ": %s", strerror(unix_errno)); va_end(ap); (*printer->ops->print)(printer, type, unix_errno, printer->printbuf); } void rdd_mp_vrddmsg(RDD_MSGPRINTER *printer, rdd_message_t type, int rdd_errno, const char *fmt, va_list ap) { RDD_MSGPRINTER_POS pos; char rddbuf[128]; if (! mp_accept_message(printer, type)) return; mp_init(&pos, printer); mp_vprintf(&pos, fmt, ap); if (rdd_strerror(rdd_errno, rddbuf, sizeof rddbuf) == RDD_OK) { rddbuf[(sizeof rddbuf) - 1] = '\000'; mp_printf(&pos, ": %s", rddbuf); } (*printer->ops->print)(printer, type, rdd_errno, printer->printbuf); } void rdd_mp_rddmsg(RDD_MSGPRINTER *printer, rdd_message_t type, int rdd_errno, const char *fmt, ...) { va_list ap; va_start(ap, fmt); rdd_mp_vrddmsg(printer, type, rdd_errno, fmt, ap); va_end(ap); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/filter.h������������������������������������������������������������������������������0100644�0000000�0000000�00000013665�10421731111�0013400�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __filter_h__ #define __filter_h__ /** @file * \brief Generic filter interface. * * A filter is an object that reads a data stream. A filter can * perform computations using the data stream's contents, but it * is _not_ allowed to modify the data stream that is passed to it. * The data that is sent to one filter may later be passed to another * filter. * * Two types of filters are distinguished: stream filters and block * filters. Both filters receive their input through successive * calls to their input() routine. Block filters must also supply * a block size B and a block() routine. The block routine is called * after every B bytes of input data. These B bytes, however, may be * passed to the filter through multiple calls to the filter's input() * routine. */ struct _RDD_FILTER; struct _RDD_FILTER_OPS; typedef int (*rdd_fltr_input_fun)(struct _RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); typedef int (*rdd_fltr_block_fun)(struct _RDD_FILTER *f, unsigned nbyte); typedef int (*rdd_fltr_close_fun)(struct _RDD_FILTER *f); typedef int (*rdd_fltr_rslt_fun)(struct _RDD_FILTER *f, unsigned char *buf, unsigned pos); typedef int (*rdd_fltr_free_fun)(struct _RDD_FILTER *f); typedef struct _RDD_FILTER_OPS { rdd_fltr_input_fun input; /* used to pass data to the filter */ rdd_fltr_block_fun block; /* used to mark block boundaries */ rdd_fltr_close_fun close; /* used to mark end of input */ rdd_fltr_rslt_fun get_result; /* used to obtain final result */ rdd_fltr_free_fun free; /* deallocate filter state */ } RDD_FILTER_OPS; typedef struct _RDD_FILTER { void *state; RDD_FILTER_OPS *ops; unsigned blocksize; /* zero for stream filters */ unsigned pos; /* position in current block */ } RDD_FILTER; typedef void (*rdd_fltr_error_fun)(rdd_count_t pos, rdd_checksum_t expected, rdd_checksum_t computed, void *env); /* Constructors */ int rdd_new_filter(RDD_FILTER **f, RDD_FILTER_OPS *ops, unsigned statesize, unsigned blocksize); int rdd_new_md5_streamfilter(RDD_FILTER **f); int rdd_new_sha1_streamfilter(RDD_FILTER **f); int rdd_new_write_streamfilter(RDD_FILTER **f, RDD_WRITER *writer); int rdd_new_md5_blockfilter(RDD_FILTER **f, unsigned blocksize, const char *outpath, int overwrite); int rdd_new_stats_blockfilter(RDD_FILTER **f, unsigned blocksize, const char *outpath, int overwrite); int rdd_new_adler32_blockfilter(RDD_FILTER **f, unsigned blocksize, const char *outpath, int overwrite); int rdd_new_crc32_blockfilter(RDD_FILTER **f, unsigned blocksize, const char *outpath, int overwrite); int rdd_new_verify_adler32_blockfilter(RDD_FILTER **f, FILE *fp, unsigned blocksize, int swap, rdd_fltr_error_fun err, void *env); int rdd_new_verify_crc32_blockfilter(RDD_FILTER **f, FILE *fp, unsigned blocksize, int swap, rdd_fltr_error_fun err, void *env); /* Generic routines */ /** \brief Pushes a data buffer into a filter. * \param f the filter * \param buf the data buffer * \param nbyte the size in bytes of data buffer \c buf * \return Returns \c RDD_OK on success. * * This function pushes buffer \c buf into filter \c f. The filter * must not modify buffer \c buf. The filter will process the buffer * as it sees fit. */ int rdd_filter_push(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); /** \brief Closes a filter for input. * \param f the filter * \return Returns \c RDD_OK on success. * * This function must be called exactly once after the last data buffer * has been pushed into the filter (with \c rdd_filter_push()). */ int rdd_filter_close(RDD_FILTER *f); /** \brief Obtains a filter's result. * \param f the filter * \param buf the client's result buffer * \param nbyte the size of the client's result buffer * \return Returns \c RDD_OK on success. * * This function copies a filter's result value to a client buffer. * A result is simply an array of bytes. The interpretation of the * result bytes is filter-specific. Not all filters compute a result. */ int rdd_filter_get_result(RDD_FILTER *f, unsigned char *buf, unsigned nbyte); /** \brief Deallocates a filter and its resources. * \param f the filter * \return Returns \c RDD_OK on success. * * This function destroys a filter. No operations can be performed on * a filter after this function has been called. */ int rdd_filter_free(RDD_FILTER *f); #endif /* __filter_h__ */ ���������������������������������������������������������������������������rdd-2.0.7/src/sha1.c��������������������������������������������������������������������������������0100644�0000000�0000000�00000013604�10435007703�0012743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ /* Straightforward implementation of SHA-1, based on the description * in FIPS 180-1 (see http://www.itl.nist.gov/div897/pubs/fip180-1.htm). * * No serious optimizations were performed. If you want something faster, * check out the openssl source code. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "rdd.h" #include "rdd_internals.h" #if !defined(HAVE_LIBCRYPTO) #include <string.h> #include "sha1.h" #define ROTL(n, w) (((w) << (n)) | ((w) >> (32 - (n)))) #define F1(B, C, D) (((B) & (C)) | (((~(B)) & (D)))) #define F2(B, C, D) ((B) ^ (C) ^ (D)) #define F3(B, C, D) (((B) & (C)) | ((B) & (D)) | ((C) & (D))) #define F4(B, C, D) ((B) ^ (C) ^ (D)) #define K1 0x5a827999 #define K2 0x6ed9eba1 #define K3 0x8f1bbcdc #define K4 0xca62c1d6 #define encode_word(p) (((p)[0]<<24) | ((p)[1]<<16) | ((p)[2]<<8) | (p)[3]) #define decode_word(w, p) do { \ (p)[0] = (w >> 24) & 0xff; \ (p)[1] = (w >> 16) & 0xff; \ (p)[2] = (w >> 8) & 0xff; \ (p)[3] = (w >> 0) & 0xff; \ } while (0) #define decode_quad(w, p) do { \ (p)[0] = (w >> 56) & 0xff; \ (p)[1] = (w >> 48) & 0xff; \ (p)[2] = (w >> 40) & 0xff; \ (p)[3] = (w >> 32) & 0xff; \ (p)[4] = (w >> 24) & 0xff; \ (p)[5] = (w >> 16) & 0xff; \ (p)[6] = (w >> 8) & 0xff; \ (p)[7] = (w >> 0) & 0xff; \ } while (0) void SHA1_Init(SHA_CTX *c) { c->msglen = 0; c->buflen = 0; memset(c->buf, 0, 64); c->H[0] = 0x67452301; c->H[1] = 0xefcdab89; c->H[2] = 0x98badcfe; c->H[3] = 0x10325476; c->H[4] = 0xc3d2e1f0; } /* Fold a full 512-bit chunk into the running digest value. */ static void compress(SHA_CTX *c, unsigned char *buf) { uint32 A, B, C, D, E; uint32 TEMP; uint32 *W; uint32 *H; unsigned t; c->buflen = 0; W = c->W; H = c->H; for (t = 0; t < 16; t++) { W[t] = encode_word(buf + 4*t); } for (; t < 80; t++) { W[t] = ROTL(1, W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]); } A = H[0]; B = H[1]; C = H[2]; D = H[3]; E = H[4]; for (t = 0; t < 20; t++) { TEMP = ROTL(5, A) + F1(B, C, D) + E + W[t] + K1; E = D; D = C; C = ROTL(30, B); B = A; A = TEMP; } for (; t < 40; t++) { TEMP = ROTL(5, A) + F2(B, C, D) + E + W[t] + K2; E = D; D = C; C = ROTL(30, B); B = A; A = TEMP; } for (; t < 60; t++) { TEMP = ROTL(5, A) + F3(B, C, D) + E + W[t] + K3; E = D; D = C; C = ROTL(30, B); B = A; A = TEMP; } for (; t < 80; t++) { TEMP = ROTL(5, A) + F4(B, C, D) + E + W[t] + K4; E = D; D = C; C = ROTL(30, B); B = A; A = TEMP; } H[0] += A; H[1] += B; H[2] += C; H[3] += D; H[4] += E; } void SHA1_Update(SHA_CTX *c, unsigned char *input, unsigned len) { c->msglen += 8 * len; /* If we don't have enough to fill a chunk, then just * append the new data to the partial-chunk buffer. */ if (c->buflen + len < 64) { memcpy(c->buf + c->buflen, input, len); c->buflen += len; return; } /* Append to existing partial chunk and process resulting * full chunk. */ if (c->buflen > 0) { memcpy(c->buf + c->buflen, input, 64 - c->buflen); input += 64 - c->buflen; len -= 64 - c->buflen; compress(c, c->buf); } /* Process all 512-bit chunks. */ while (len >= 64) { compress(c, input); input += 64; len -= 64; } /* Buffer all remaining input. */ if (len > 0) { memcpy(c->buf, input, len); c->buflen = len; } } /* SHA1 finalization. Ends a SHA1 message-digest operation, writing * the message digest and clearing the context. */ void SHA1_Final(unsigned char digest[SHA_DIGEST_LENGTH], SHA_CTX *c) { unsigned free_bits; unsigned zero_bits; unsigned char padbuf[64]; unsigned padlen; /* Figure out how much space is left in the * input buffer. */ free_bits = 512 - (c->msglen % 512); if (free_bits >= 65) { /* We have room for the '1' bit and the length field. */ zero_bits = free_bits - 65; } else { zero_bits = free_bits + 512 - 65; } memset(padbuf, 0, 64); padbuf[0] = 0x80; padlen = 1 + (zero_bits - 7) / 8; /* bytes */ decode_quad(c->msglen, padbuf + padlen); padlen += 8; SHA1_Update(c, padbuf, padlen); decode_word(c->H[0], digest + 0); decode_word(c->H[1], digest + 4); decode_word(c->H[2], digest + 8); decode_word(c->H[3], digest + 12); decode_word(c->H[4], digest + 16); memset(c, 0, sizeof (*c)); /* Clear sensitive information. */ } #endif /* HAVE_LIBCRYPTO */ ����������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/rdd_internals.h�����������������������������������������������������������������������0100644�0000000�0000000�00000005227�10421731111�0014736�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __rdd_internals_h__ #define __rdd_internals_h__ #include <stdarg.h> #include <stdlib.h> #include <sys/types.h> #include "rsysint.h" rsys_decl_ints(RDD_HASH) typedef RDD_HASH_UINT16 UINT2; typedef RDD_HASH_UINT32 UINT4; #define streq(s1, s2) (strcmp(s1, s2) == 0) #define RDD_MAX_FILENAMESIZE 256 #define RDD_SECTOR_SIZE 512 #define RDD_NO 0 #define RDD_YES 1 void rdd_init(void); void rdd_set_quiet(int q); void *rdd_malloc(size_t sz); void rdd_free(void *p); int rdd_buf2hex(const unsigned char *buf, unsigned bufsize, char *hexbuf, unsigned hexbuflen); char *rdd_ctime(void); double rdd_gettime(void); void rdd_cons_open(void); void rdd_cons_close(void); void rdd_cons_printf(char *fmt, ...); void rdd_cons_vprintf(char *fmt, va_list ap); int rdd_ask(char *fmt, ...); void rdd_quit_if(int quit_answer, char *fmt, ...); char *rdd_strsize(rdd_count_t sz); void rdd_catch_signals(void); int rdd_device_size(const char *path, rdd_count_t *size); int rdd_strerror(int rc, char *buf, unsigned bufsize); #endif /* __rdd_internals_h__ */ �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/msgprinter.h��������������������������������������������������������������������������0100644�0000000�0000000�00000021210�10421731111�0014266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __msgprinter_h__ #define __msgprinter_h__ /** @file * \brief Generic printer interface. * * Uniform printer interface. An implementation of this interface * must supply a constructor and implement all \c RDD_MSGPRINTER_OPS (see * the structure definition below). * * <h3>Printer types</h3> * * There are two types of writers: <em>bottom printers</em> and * <em>stackable printers</em>. * A stackable printer receives input, optionally transforms it in some way, * and passes the transformed data on to a lower-level parent printer. The * parent printer is passed to the stackable printer at the time the stackable * printer is constructed. The broadcast printer is a stackable writer. * * A bottom printer receives input, optionally transforms it in some way, * and passes the transformed data on to some output device (e.g. a * file stream), but not to another printer. A bottom printer may * well use other printer types in its implementation, but that does * <strong>not</strong> make it a stackable printer. * * * <h3>Constructors</h3> * * Each constructor must be listed in this header file. * Once a printer has been constructed, it should be accessed * through the generic printer routines, \c rdd_mp_close(), * \c rdd_mp_print(), or one of the routines that are layered * on top of \c rdd_mp_print(). */ #include <stdarg.h> #include <stdio.h> /** Values of type \c rdd_message_t specify the type of * message that is passed to a printer instance. The * message type is used to format or display the message in an * appropriate manner. */ typedef enum _rdd_message_t { RDD_MSG_INFO = 0x1, /*<< informative message */ RDD_MSG_ERROR = 0x2, /*<< error message */ RDD_MSG_DEBUG = 0x4, /*<< debug message */ RDD_MSG_WARN = 0x8 /*<< warning message */ } rdd_message_t; /** Values of type \c rdd_mp_flags_t determine the behavior * of a printer's \c close operation. If \c RDD_MP_RECURSE * is set, then a (stackable) printer will automatically * close all parent printers. If \c RDD_MP_READONLY is * specified, then a printer that writes its messages to an * output file will make that output file read-only when the * printer is closed. */ typedef enum _rdd_mp_flags_t { RDD_MP_RECURSE = 0x1, /*<< close all children */ RDD_MP_READONLY = 0x2 /*<< make output read-only */ } rdd_mp_flags_t; struct _RDD_MSGPRINTER; typedef void (*rdd_mp_print_fun)(struct _RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg); typedef int (*rdd_mp_close_fun)(struct _RDD_MSGPRINTER *printer, unsigned flags); /** All printer implementations provide a structure of type \c RDD_WRITE_OPS. * This structure contains pointers to the routines that implement * the interface. */ typedef struct _RDD_MSGPRINTER_OPS { rdd_mp_print_fun print; /*<< prints a message */ rdd_mp_close_fun close; /*<< closes the printer instance */ } RDD_MSGPRINTER_OPS; /** Printer object. A printer object consists of a print buffer * (\c printbuf), a pointer to an operation table (\c ops), * a pointer to a state buffer (\c state), and a message mask. */ typedef struct _RDD_MSGPRINTER { char printbuf[1024]; /*<< print buffer */ RDD_MSGPRINTER_OPS *ops; /*<< operation table */ void *state; /*<< printer state */ RDD_UINT32 mask; /*<< message mask */ } RDD_MSGPRINTER; /** \brief Allocates and partially initializes a new printer object. * \param printer output value: a new printer object. * \param ops pointers to implementation-specific printer functions. * \param statesize size in bytes of implementation-specific state. * \return Returns \c RDD_OK on success. Returns \c RDD_NOMEM when * there is insufficient memory to allocate the writer object or its state * buffer. * * \c rdd_mp_open_printer() allocates a writer object and initializes its * \c ops field to argument \ops. The \c state field is set to point * to a new buffer (allocated with \c malloc()) with size \c statesize. * The state buffer is zeroed. The mask is set so that it allows all * message types to be printed. */ int rdd_mp_open_printer(RDD_MSGPRINTER **printer, RDD_MSGPRINTER_OPS *ops, unsigned statesize); /* Constructor routines that create writers of specific types */ /** \brief Opens a broadcast printer. A broadcast printer is a stackable * printer that prints all its messages to all its parent printers. */ int rdd_mp_open_bcast_printer(RDD_MSGPRINTER **printer, unsigned nprinter, RDD_MSGPRINTER **printers); /** \brief Opens a stream printer. A stream printer prints all its * messages to a standard I/O file stream (\c stream). */ int rdd_mp_open_stdio_printer(RDD_MSGPRINTER **printer, FILE *stream); /** \brief Opens a log printer. A log printer is a stackable printer * that prepends to each message a timestamp. The resulting, concatenated * message is forwarded to parent printer \c next. */ int rdd_mp_open_log_printer(RDD_MSGPRINTER **printer, RDD_MSGPRINTER *next); /** \brief Opens a file printer. A file printer prints all its messages * to a named output file. */ int rdd_mp_open_file_printer(RDD_MSGPRINTER **printer, const char *path); /** \brief Closes a printer instance. */ int rdd_mp_close(RDD_MSGPRINTER *printer, unsigned flags); /** \brief Retrieves a printer's current message mask. */ RDD_UINT32 rdd_mp_get_mask(RDD_MSGPRINTER *printer); /** \brief Sets a printer's current message mask to value \c mask. */ void rdd_mp_set_mask(RDD_MSGPRINTER *printer, RDD_UINT32 mask); /** \brief Formats and prints a message. */ void rdd_mp_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *fmt, ...); /** \brief Formats and prints a message for a varargs routine. */ void rdd_mp_vmessage(RDD_MSGPRINTER *printer, rdd_message_t type, const char *fmt, va_list ap); /** \brief Formats and prints a message. */ void rdd_mp_message(RDD_MSGPRINTER *printer, rdd_message_t type, const char *fmt, ...); /** \brief Formats and prints a Unix error message. The value of * \c unix_errno must be one of the values defined in <errno.h>. * This routine will append the error message that corresponds to * \c unix_errno to the user's message and print the resulting, * concatenated message. */ void rdd_mp_unixmsg(RDD_MSGPRINTER *printer, rdd_message_t type, int unix_errno, const char *fmt, ...); /** \brief Formats and prints an RDD error message. The value of * \c rdd_errno must be one of the values defined in rdd.h. * This routine will append the error message that corresponds to * \c rdd_errno to the user's message and print the resulting, * concatenated message. */ void rdd_mp_vrddmsg(RDD_MSGPRINTER *printer, rdd_message_t type, int rdd_errno, const char *fmt, va_list ap); /** \brief Formats and prints an RDD error message. The value of * \c rdd_errno must be one of the values defined in rdd.h. * This routine will append the error message that corresponds to * \c rdd_errno to the user's message and print the resulting, * concatenated message. */ void rdd_mp_rddmsg(RDD_MSGPRINTER *printer, rdd_message_t type, int rdd_errno, const char *fmt, ...); #endif /* __msgprinter_h__ */ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/alignedbuf.c��������������������������������������������������������������������������0100644�0000000�0000000�00000005441�10435006646�0014214�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdlib.h> #include <string.h> #include <stddef.h> #include "rdd.h" #include "alignedbuf.h" int rdd_new_alignedbuf(RDD_ALIGNEDBUF *buf, unsigned bufsize, unsigned align) { ptrdiff_t unaligned; ptrdiff_t aligned; if (align <= 0) return RDD_BADARG; bufsize += align; /* for buffer alignment below */ bufsize += align; /* for read-count alignment in unix_read() */ memset(buf, 0, sizeof(*buf)); if ((buf->unaligned = malloc(bufsize)) == 0) { return RDD_NOMEM; } unaligned = buf->unaligned - (unsigned char *) 0; if ((unaligned % align) == 0) { aligned = unaligned; } else { aligned = unaligned + align - (unaligned % align); } buf->aligned = (unsigned char *) aligned; buf->align = align; buf->asize = bufsize - (aligned - unaligned); return RDD_OK; } int rdd_free_alignedbuf(RDD_ALIGNEDBUF *buf) { free(buf->unaligned); memset(buf, 0, sizeof(*buf)); return RDD_OK; } unsigned rdd_abuf_get_size(RDD_ALIGNEDBUF *buf) { return buf->asize; } unsigned rdd_abuf_get_alignment(RDD_ALIGNEDBUF *buf) { return buf->align; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/sha1.h��������������������������������������������������������������������������������0100644�0000000�0000000�00000004016�10421731111�0012735�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __sha1_h__ #define __sha1_h__ #define SHA_DIGEST_LENGTH 20 typedef unsigned long uint32; typedef unsigned long long uint64; typedef struct { unsigned char buf[64]; uint32 buflen; /* bytes */ uint64 msglen; /* bits */ uint32 H[5]; uint32 W[80]; } SHA_CTX; void SHA1_Init(SHA_CTX *); void SHA1_Update(SHA_CTX *, unsigned char *, unsigned int); void SHA1_Final(unsigned char [SHA_DIGEST_LENGTH], SHA_CTX *); #endif /* __sha1_h__ */ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/reader.c������������������������������������������������������������������������������0100644�0000000�0000000�00000006065�10421731111�0013344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdlib.h> #include "rdd.h" #include "reader.h" int rdd_new_reader(RDD_READER **self, RDD_READ_OPS *ops, unsigned statesize) { RDD_READER *r = 0; unsigned char *state = 0; int rc = RDD_OK; if (self == 0 || ops == 0) return RDD_BADARG; if ((r = calloc(1, sizeof(RDD_READER))) == 0) { rc = RDD_NOMEM; goto error; } if ((state = calloc(1, statesize)) == 0) { rc = RDD_NOMEM; goto error; } r->ops = ops; r->state = state; *self = r; return RDD_OK; error: *self = 0; if (state != 0) free(state); if (r != 0) free(r); return rc; } int rdd_reader_read(RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread) { return (*(r->ops->read))(r, buf, nbyte, nread); } int rdd_reader_tell(RDD_READER *r, rdd_count_t *pos) { return (*(r->ops->tell))(r, pos); } int rdd_reader_seek(RDD_READER *r, rdd_count_t pos) { return (*(r->ops->seek))(r, pos); } int rdd_reader_skip(RDD_READER *r, rdd_count_t skip) { rdd_count_t pos; int rc; if ((rc = rdd_reader_tell(r, &pos)) != RDD_OK) { return rc; } if ((rc = rdd_reader_seek(r, pos + skip)) != RDD_OK) { return rc; } return RDD_OK; } int rdd_reader_close(RDD_READER *r, int recurse) { int rc; rc = (*(r->ops->close))(r, recurse); if (rc != RDD_OK) { return rc; } free(r->state); r->state = 0; free(r); return RDD_OK; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/partwriter.c��������������������������������������������������������������������������0100644�0000000�0000000�00000015737�10421731111�0014313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ /* * Implements the generic writer interface (see writer.h) * * A partwriter distributes its input data over multiple * files, each of which has a maximum size that is specified * at construction time. When one file has been filled, the * partwriter closes it and opens a new file. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <assert.h> #include <errno.h> #include <fcntl.h> #include <stdarg.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <sys/stat.h> #include "rdd.h" #include "writer.h" #define GIGABYTE (1024*1024*1024) /* Forward declarations */ static int part_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte); static int part_close(RDD_WRITER *w); static RDD_WRITE_OPS part_write_ops = { part_write, part_close }; typedef struct _RDD_PART_WRITER { char *path; char *pathbuf; unsigned maxpathlen; rdd_count_t splitlen; unsigned next_partnum; /* next part number */ rdd_write_mode_t writemode; unsigned ndigit; /* #decimal digits in sequence no. */ rdd_count_t written; /* #bytes in current part */ RDD_WRITER *parent; } RDD_PART_WRITER; /* Counts the number of decimal digits required to represent * the sequence number of the last part of a split file. * For example: splitting a 1 MB (maxlen) file into 2 Kbyte * (splitlen) parts yields 512 parts. It takes three digits * to represents the number 512. */ static unsigned count_digits(rdd_count_t maxlen, rdd_count_t splitlen) { rdd_count_t npart; unsigned ndigit; if (maxlen == RDD_WHOLE_FILE) { /* File size unknown. Pick some big number. */ maxlen = ((rdd_count_t) 1000) * ((rdd_count_t) GIGABYTE); } npart = (maxlen + splitlen - 1) / splitlen; for (ndigit = 0; npart != 0; ndigit++, npart /= 10) { } return ndigit; } /* Opens a new file. Each file's name includes a sequence number * that is prepended to the basename of the template file name * specified at construction time (stored in state->path). */ static int open_next_part(RDD_PART_WRITER *state) { char *sep; int rc; assert(state->path != 0); sep = strrchr(state->path, '/'); if (sep == 0) { /* Simple path, no '/' separators. * Example: foo.img -> 002-foo.img. */ snprintf(state->pathbuf, state->maxpathlen, "%0*d-%s", state->ndigit, state->next_partnum, state->path); state->pathbuf[state->maxpathlen-1] = '\000'; } else { /* Multipart path, path components separated by '/' chars. * Example: /tmp/foo.img -> /tmp/002-foo.img. */ char *dir = state->path; char *file = sep + 1; *sep = '\000'; /* overwrites last '/' in state->path */ snprintf(state->pathbuf, state->maxpathlen, "%s/%0*d-%s", dir, state->ndigit, state->next_partnum, file); state->pathbuf[state->maxpathlen-1] = '\000'; *sep = '/'; /* restores last '/' in state->path */ } rc = rdd_open_safe_writer(&state->parent, state->pathbuf, state->writemode); if (rc != RDD_OK) { return rc; } state->next_partnum++; return RDD_OK; } int rdd_open_part_writer(RDD_WRITER **self, const char *path, rdd_count_t maxlen, rdd_count_t splitlen, rdd_write_mode_t wrmode) { RDD_WRITER *w = 0; RDD_PART_WRITER *state = 0; char *pathcopy = 0; char *pathbuf = 0; int rc = RDD_OK; if (splitlen <= 0) return RDD_BADARG; if (maxlen <= 0) return RDD_BADARG; rc = rdd_new_writer(&w, &part_write_ops, sizeof(RDD_PART_WRITER)); if (rc != RDD_OK) { goto error; } state = (RDD_PART_WRITER *) w->state; state->ndigit = count_digits(maxlen, splitlen); state->next_partnum = 0; state->splitlen = splitlen; state->written = 0; state->writemode = wrmode; if ((pathcopy = malloc(strlen(path) + 1)) == 0) { rc = RDD_NOMEM; goto error; } strcpy(pathcopy, path); state->path = pathcopy; state->maxpathlen = strlen(state->path) + 128; if ((pathbuf = malloc(state->maxpathlen)) == 0) { goto error; } memset(pathbuf, 0, state->maxpathlen); state->pathbuf = pathbuf; if ((rc = open_next_part(state)) != RDD_OK) { goto error; } *self = w; return RDD_OK; error: *self = 0; if (pathbuf != 0) free(pathbuf); if (pathcopy != 0) free(pathcopy); if (state != 0) free(state); if (w != 0) free(w); return rc; } static int part_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte) { RDD_PART_WRITER *state = w->state; unsigned to_write; int rc; while (nbyte > 0) { if (state->written >= state->splitlen) { /* Current part is full; close, then open next part. */ if ((rc = rdd_writer_close(state->parent)) != RDD_OK) { return rc; } state->parent = 0; if ((rc = open_next_part(state)) != RDD_OK) { return rc; } state->written = 0; } /* Figure out how much space is left in the current * output file. */ if (state->written + nbyte > state->splitlen) { to_write = state->splitlen - state->written; } else { to_write = nbyte; } rc = rdd_writer_write(state->parent, buf, to_write); if (rc != RDD_OK) { return rc; } buf += to_write; nbyte -= to_write; state->written += to_write; } return RDD_OK; } static int part_close(RDD_WRITER *self) { RDD_PART_WRITER *state = self->state; int rc; assert(state->parent != 0); if ((rc = rdd_writer_close(state->parent)) != RDD_OK) { return rc; } free(state->pathbuf); state->pathbuf = 0; free(state->path); state->path = 0; return RDD_OK; } ���������������������������������rdd-2.0.7/src/progress.c����������������������������������������������������������������������������0100644�0000000�0000000�00000005740�10435007321�0013751�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ /* * Periodic progress reporting. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <string.h> #include <sys/time.h> #include "rdd.h" #include "rdd_internals.h" #include "error.h" #include "progress.h" #define INIT_POLL_BYTES 1048576 int rdd_progress_init(RDD_PROGRESS *p, rdd_count_t size, unsigned secs) { memset(p, 0, sizeof(*p)); p->input_size = size; p->period = (double) secs; p->start_time = rdd_gettime(); p->last_time = p->start_time; p->poll_delta = INIT_POLL_BYTES; p->curpos = 0; p->last_pos = 0; return RDD_OK; } int rdd_progress_update(RDD_PROGRESS *p, rdd_count_t pos) { p->curpos = pos; return RDD_OK; } int rdd_progress_poll(RDD_PROGRESS *p, RDD_PROGRESS_INFO *info) { double now; double speed; if (p->curpos - p->last_pos < p->poll_delta) { return RDD_EAGAIN; /* too early to report progress */ } now = rdd_gettime(); speed = p->curpos / (now - p->start_time); /* bytes/sec */ p->poll_delta = p->period * speed; if ((now - p->last_time) < p->period) { return RDD_EAGAIN; } p->last_time = now; p->last_pos = p->curpos; info->pos = p->curpos; info->speed = speed; if (p->input_size == RDD_WHOLE_FILE) { info->fraction = -1.0; } else { info->fraction = ((double) p->curpos) / ((double) p->input_size); } return RDD_OK; } ��������������������������������rdd-2.0.7/src/alignedbuf.h��������������������������������������������������������������������������0100644�0000000�0000000�00000007771�10421731111�0014214�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __alignedbuf_h__ #define __alignedbuf_h__ /** @file */ /** \brief Aligned-buffer descriptor. * * RDD_ALIGNEDBUF contains two pointer members. Member \c unaligned * contains a pointer to a buffer allocated with \c malloc(). * Member \c aligned points to a location within the same buffer, * but has been aligned to a user-specified byte count. * The following equations should always hold:\n * (1) <tt> 0 <= aligned - unaligned < user_alignment </tt>;\n * (2) <tt> (aligned % align) == 0</tt>. */ typedef struct RDD_ALIGNEDBUF { unsigned char *unaligned; /*<< actual buffer */ unsigned char *aligned; /*<< aligned buffer */ unsigned asize; /*<< aligned buffer size */ unsigned align; /*<< alignment in bytes */ } RDD_ALIGNEDBUF; /** \brief Allocates a buffer of \c sz bytes and returns * two pointers in \c buf: a pointer to the buffer and * a pointer that has been aligned to \c align bytes. * * \param buf pointer to an \c RDD_ALIGNEDBUF structure allocated by * the client. * \param sz size in bytes of the data buffer that will be allocated; * there will be at least \c sz bytes of free space in the aligned buffer. * \param align alignment in bytes. * \return Returns \c RDD_OK on success. Returns \c RDD_NOMEM if * there is insufficient memory to allocate the buffer. Returns * \c RDD_BADARG if a bad alignment argument is given. */ int rdd_new_alignedbuf(RDD_ALIGNEDBUF *buf, unsigned sz, unsigned align); /** \brief Deallocates the data buffer associated with \c buf and * invalidates both pointer fields in \c buf. * * \param buf pointer to an \c RDD_ALIGNEDBUF structure that was * allocated by the client and initialized by calling * \c rdd_new_aligned_buf(). * \return Always returns RDD_OK. */ int rdd_free_alignedbuf(RDD_ALIGNEDBUF *buf); /** \brief Returns the size in bytes of an aligned buffer. * * \param buf pointer to an \c RDD_ALIGNEDBUF structure that was * allocated by the client and initialized by calling * \c rdd_new_aligned_buf(). * \return The size in bytes of the aligned buffer */ unsigned rdd_abuf_get_size(RDD_ALIGNEDBUF *buf); /** \brief Returns the alignment in bytes of an aligned buffer. * * \param buf pointer to an \c RDD_ALIGNEDBUF structure that was * allocated by the client and initialized by calling * \c rdd_new_aligned_buf(). * \return the alignment in bytes of the aligned buffer */ unsigned rdd_abuf_get_alignment(RDD_ALIGNEDBUF *buf); #endif /* __alignedbuf_h__ */ �������rdd-2.0.7/src/plot-md5.py���������������������������������������������������������������������������0100644�0000000�0000000�00000006620�10421731111�0013746�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env python # Copyright (c) 2002 - 2006, Netherlands Forensic Institute # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. Neither the name of the Institute nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. import getopt, os, re, string, sys KBYTE = 1024 DEFAULT_BLOCKSIZE = 256 * KBYTE infile = None outfile = None title = None debug = 0 def error(msg): sys.stderr.write(msg + "\n") sys.exit(1) def warn(msg): sys.stderr.write(msg + "\n") def usage(): sys.stderr.write("Usage: plot-md5.py <options> infile\n" + "\t-o <output file>\n" + "\t-t <title>\n" ) sys.exit(1) def commandLine(): global debug, infile, outfile, title opts, args = getopt.getopt(sys.argv[1:], "do:t:") for opt, val in opts: if opt == "-d": debug = 1 elif opt == "-o": outfile = val elif opt == "-t": title = val if len(args) == 1: infile, = args else: usage() def readHashes(path): hashes = {} fp = file(path, "r") for line in fp: line = line.strip() id, md5 = line.split() if not (md5 in hashes): hashes[md5] = 1 else: hashes[md5] += 1 fp.close() return hashes def byCount((m1, c1), (m2, c2)): return cmp(c1, c2) def plot(hashes, outfile, title): if outfile == None: outfile = "/dev/null" persist = 1 output = "x11" else: persist = 0 output = "png" if title == None: title = infile if debug: fp = sys.stdout elif persist: fp = os.popen("gnuplot -persist >%s" % outfile, "w") else: fp = os.popen("gnuplot >%s" % outfile, "w") fp.write("set title \"%s\"\n" % title) fp.write("set nokey\n") fp.write("set terminal %s\n" % output) fp.write("set xzeroaxis\n") fp.write("set xlabel \"MD5 values\"\n") fp.write("set ylabel \"Blocks covered\"\n") fp.write("set xrange [0:]\n") fp.write("plot \"-\" using ($0 + 1):1 with linespoints\n") items = hashes.items() items.sort(byCount) cum = 0 for md5, count in items: assert count > 0 cum += count fp.write("%u\n" % cum) # print md5, count fp.close() def main(): commandLine() hashes = readHashes(infile); plot(hashes, outfile, title) if __name__ == "__main__": main() ����������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/reader.h������������������������������������������������������������������������������0100644�0000000�0000000�00000021751�10421731111�0013350�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __reader_h__ #define __reader_h__ /** @file * \brief Generic reader interface. * * This header file defines rdd's uniform reader interface. * The rdd package contains multiple implementations of this * interface (see the files named <tt>*reader.c</tt>). */ /** Forward declarations. */ struct _RDD_READER; struct _RDD_READ_OPS; typedef int (*rdd_rd_read_fun)(struct _RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread); typedef int (*rdd_rd_tell_fun)(struct _RDD_READER *r, rdd_count_t *pos); typedef int (*rdd_rd_seek_fun)(struct _RDD_READER *r, rdd_count_t pos); typedef int (*rdd_rd_close_fun)(struct _RDD_READER *r, int recurse); /** All reader implementations provide a structure of type \c RDD_READ_OPS. * This structure contains pointers to the routines that implement * the interface. */ typedef struct _RDD_READ_OPS { rdd_rd_read_fun read; rdd_rd_tell_fun tell; rdd_rd_seek_fun seek; rdd_rd_close_fun close; } RDD_READ_OPS; /** A reader object consists of a pointer to implementation-defined state and * a pointer to the routines that implement the uniform interface. */ typedef struct _RDD_READER { void *state; /**< implementation-specific state */ RDD_READ_OPS *ops; /**< implementation's operation table */ } RDD_READER; /** \brief Allocates and partially initializes a reader object. * \param r output value: a new reader object. * \param ops pointers to implementation-specific reader functions. * \param statesize size in bytes of implementation-specific state. * \return Returns \c RDD_OK on success. Returns \c RDD_NOMEM when * there is insufficient memory to allocate the reader object or its state * buffer. * * \c rdd_new_reader allocates a reader object and initializes its * \c ops field to argument \ops. The \c state field is set to point * to a new buffer (allocated with \c malloc()) with size \c statesize. * The state buffer is zeroed. */ int rdd_new_reader(RDD_READER **r, RDD_READ_OPS *ops, unsigned statesize); /** Constructors */ /** \brief Instantiates a reader that reads from an open file descriptor. * \param r output value: a new reader object. * \param fd the open file descriptor that the reader will read from. * \return Returns \c RDD_OK on success. * * A file descriptor reader is a simple reader that simply reads * bytes from a file descriptor. */ int rdd_open_fd_reader(RDD_READER **r, int fd); /** \brief Instantiates a reader that reads from an open file descriptor * that refers to a raw block device. * \param r output value: a new reader object. * \param fd the open file descriptor that the reader will read from. * \return Returns \c RDD_OK on success. * * A file descriptor reader is a simple reader that simply reads * bytes from a file descriptor. */ int rdd_open_raw_reader(RDD_READER **r, int fd); /** \brief Instantiates a reader that reads from a reader that expects * aligned accesses and aligned user buffers. * \param r output value: a new reader object. * \param parent output value: the parent reader. * \param align alignment in bytes. * \return Returns \c RDD_OK on success. * * A file descriptor reader is a simple reader that simply reads * bytes from a file descriptor. */ int rdd_open_aligned_reader(RDD_READER **r, RDD_READER *parent, unsigned align); /** \brief Instantiates a reader that reads from a file. * \param r output value: a new reader object. * \param path the name of the file that the reader will read from. * \param raw true iff \c path refers to a raw-device file * \return Returns \c RDD_OK on success. * * A file reader opens a file and reads from it. */ int rdd_open_file_reader(RDD_READER **r, const char *path, int raw); /** \brief Instantiates a reader that does not move the file pointer * when a read error occurs. * \param r output value: a new reader object. * \param p an existing parent reader. * * An atomic reader adds predictability to an existing reader \c p. * All read requests received by \c r are forwarded to \c p. If a * read on \c p fails with error code \c RDD_EREAD, then \c r will * restore the file position to the same value it had before the * read was issued. * * \b Note: the parent reader \c p \b MUST implement the \c seek() * and \c tell() operations. */ int rdd_open_atomic_reader(RDD_READER **r, RDD_READER *p); /** \brief Instantiates a reader that decompresses zlib-compressed data. * \param r output value: a new reader object. * \param p an existing parent reader. * * A zlib reader adds transparent decompression to an existing * parent reader \c p that reads zlib-compressed data. * * \b Note: a zlib reader does not implement the \c seek() routine. */ int rdd_open_zlib_reader(RDD_READER **r, RDD_READER *p); int rdd_open_cdrom_reader(RDD_READER **r, const char *path); /** \brief Instantiates a reader that simulates read errors. * \param r output value: a new reader object. * \param p an existing parent reader. * \param specfile a file that specifies the file positions at which * read errors should be simulated by this reader. */ int rdd_open_faulty_reader(RDD_READER **r, RDD_READER *p, char *specfile); #if 0 int rdd_open_aligned_reader(RDD_READER **r, RDD_READER *p, unsigned alignment, unsigned bufsize); #endif /* Generic dispatch routines */ /** \brief Generic read routine. * \param r pointer to the reader object. * \param buf pointer to the target buffer; the size of this buffer * must be at least \c nbyte bytes. * \param nbyte the number of bytes to read * \param nread output value: the number of bytes actually read; * the value in \c *read is valid only if \c RDD_OK is returned. * \return Returns RDD_OK if the read succeeds. If the read succeeds, * \c *nread will be equal to \c nbyte except when there are fewer * than \c nbyte bytes left until the end of the file is reached. * In that case \c *nread will be equal to the number of bytes left. * If \c *nread equals \c 0, then end-of-file has been reached. */ int rdd_reader_read(RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread); /** \brief Returns the current file position in bytes. * \param r pointer to the reader object. * \param pos output value: the current file position in bytes. * The value in \c *pos is valid only if \c RDD_OK is returned. * \return Returns RDD_OK on success. */ int rdd_reader_tell(RDD_READER *r, rdd_count_t *pos); /** \brief Updates the current file position. * \param r pointer to the reader object. * \param pos the new (absolute) file position in bytes. * \return Returns RDD_OK on success. * * \b Note: not all readers implement the \c seek() routine. */ int rdd_reader_seek(RDD_READER *r, rdd_count_t pos); /** \brief Moves the file pointer \c skip bytes forward. * \param r pointer to the reader object. * \param skip the number of bytes to move forward. * \return Returns RDD_OK on success. * * \b Note: not all readers implement the \c skip() routine. */ int rdd_reader_skip(RDD_READER *r, rdd_count_t skip); /** \brief Closes and deallocates the reader object. * \param r pointer to the reader object. * \param recurse recursive-close flag * \return Returns RDD_OK on success. * * All resources associated with the reader are released. * If this reader is stacked on top of other readers, then * those readers will also be closed iff \c recurse is nonzero. */ int rdd_reader_close(RDD_READER *r, int recurse); #endif /* __reader_h__ */ �����������������������rdd-2.0.7/src/progress.h����������������������������������������������������������������������������0100644�0000000�0000000�00000010030�10421731111�0013736�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __progres_h__ #define __progres_h__ /** @file * \brief Progress class; used to track copy speed and progres. */ typedef struct _RDD_PROGRESS { double period; /**< progress reporting interval (seconds) */ rdd_count_t input_size; /**< size of input file or RDD_WHOLE_FILE */ double start_time; /**< time at which copying started */ double last_time; /**< time of last poll */ rdd_count_t poll_delta; /**< poll every poll_delta bytes */ rdd_count_t curpos; /**< current position in bytes */ rdd_count_t last_pos; /**< position of last successful poll */ } RDD_PROGRESS; typedef struct _RDD_PROGRESS_INFO { rdd_count_t pos; /* bytes */ double speed; /* bytes/s */ double fraction; } RDD_PROGRESS_INFO; /** \brief Initializes a progress object. * \param p a pointer to the progress object (allocated by the client). * \param size the number of bytes to be copied (or RDD_WHOLE_FILE). * \param secs the progress update interval in seconds. * \return Returns RDD_OK on success. */ int rdd_progress_init(RDD_PROGRESS *p, rdd_count_t size, unsigned secs); /** \brief Tells the progress object how much data has been copied so far. * \param p a pointer to the progress object. * \param pos the current position in the input stream (in bytes). * \return Returns RDD_OK on success. * * Successive calls to \c rdd_progress_update should pass monotonically * nondecreasing \c pos values. */ int rdd_progress_update(RDD_PROGRESS *p, rdd_count_t pos); /** \brief Obtains progress information from a progress object. * \param p a pointer to the progress object. * \param info a pointer to the progress information * \return Returns RDD_OK on success. Returns RDD_EAGAIN if no new * progress information is available; new information is made available * at approximately the rate specified by the user's update interval. * * If \c rdd_progress_update() returns \c RDD_OK then \c *info * will contain new progress information. Field \c info->pos will * be set to the last position passed to \c rdd_progress_update(). * Field \c info->speed will be set to the average copying speed in * bytes per second. The value of \c info->fraction * (the fraction of work completed) can be computed only if the input * size is known. If \c RDD_WHOLE_FILE was passed to \c rdd_progress_init() * as the input size then \c info->fraction will invalid and will * be set to a negative number. */ int rdd_progress_poll(RDD_PROGRESS *p, RDD_PROGRESS_INFO *info); #endif /* __progres_h__ */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/safewriter.c��������������������������������������������������������������������������0100644�0000000�0000000�00000007542�10421731112�0014257�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <errno.h> #include <fcntl.h> #include <stdarg.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/stat.h> #include "rdd.h" #include "writer.h" /* Forward declarations */ static int safe_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte); static int safe_close(RDD_WRITER *w); static RDD_WRITE_OPS safe_write_ops = { safe_write, safe_close }; typedef struct _RDD_SAFE_WRITER { char *path; RDD_WRITER *parent; } RDD_SAFE_WRITER; /* Check whether path is a valid path name in the file system. */ static int path_exists(const char *path, struct stat *info) { return stat(path, info) != -1 || errno != ENOENT; } int rdd_open_safe_writer(RDD_WRITER **self, const char *path, rdd_write_mode_t wmode) { RDD_WRITER *w = 0; RDD_SAFE_WRITER *state = 0; struct stat statinfo; int rc = RDD_OK; char *pathcopy = 0; if (wmode == RDD_NO_OVERWRITE && path_exists(path, &statinfo)) { rc = RDD_EEXISTS; goto error; } rc = rdd_new_writer(&w, &safe_write_ops, sizeof(RDD_SAFE_WRITER)); if (rc != RDD_OK) { goto error; } state = (RDD_SAFE_WRITER *) w->state; if ((pathcopy = malloc(strlen(path) + 1)) == 0) { rc = RDD_NOMEM; goto error; } strcpy(pathcopy, path); state->path = pathcopy; rc = rdd_open_file_writer(&state->parent, path); if (rc != RDD_OK) { goto error; } *self = w; return RDD_OK; error: *self = 0; if (pathcopy != 0) free(pathcopy); if (state != 0) free(state); if (w != 0) free(w); return rc; } static int safe_write(RDD_WRITER *w, const unsigned char *buf, unsigned nbyte) { RDD_SAFE_WRITER *state = w->state; return rdd_writer_write(state->parent, buf, nbyte); } static int safe_close(RDD_WRITER *self) { RDD_SAFE_WRITER *state = self->state; struct stat statinfo; int rc; if ((rc = rdd_writer_close(state->parent)) != RDD_OK) { return rc; } if (stat(state->path, &statinfo) < 0) { return RDD_ECLOSE; } if (S_ISREG(statinfo.st_mode) && chmod(state->path, S_IRUSR|S_IRGRP|S_IROTH) < 0) { /* This need not be an error; we may not own * the output file. */ } free(state->path); state->path = 0; return RDD_OK; } ��������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/fdreader.c����������������������������������������������������������������������������0100644�0000000�0000000�00000007263�10421731112�0013660�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdlib.h> #include <sys/types.h> #include <errno.h> #include <unistd.h> #include "rdd.h" #include "reader.h" typedef struct _RDD_FD_READER { int fd; } RDD_FD_READER; /* Forward declarations */ static int rdd_fd_read(RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread); static int rdd_fd_tell(RDD_READER *r, rdd_count_t *pos); static int rdd_fd_seek(RDD_READER *r, rdd_count_t pos); static int rdd_fd_close(RDD_READER *r, int recurse); static RDD_READ_OPS fd_read_ops = { rdd_fd_read, rdd_fd_tell, rdd_fd_seek, rdd_fd_close }; int rdd_open_fd_reader(RDD_READER **self, int fd) { RDD_READER *r = 0; RDD_FD_READER *state = 0; int rc = RDD_OK; rc = rdd_new_reader(&r, &fd_read_ops, sizeof(RDD_FD_READER)); if (rc != RDD_OK) { return rc; } state = (RDD_FD_READER *) r->state; state->fd = fd; *self = r; return RDD_OK; } static int rdd_fd_read(RDD_READER *self, unsigned char *buf, unsigned nbyte, unsigned *nread) { RDD_FD_READER *state = self->state; unsigned char *next = buf; int n; while (nbyte > 0) { n = read(state->fd, next, nbyte); if (n < 0) { #if defined(RDD_SIGNALS) if (errno == EINTR) continue; #endif return RDD_EREAD; } else if (n == 0) { break; /* reached EOF */ } nbyte -= n; next += n; } *nread = next - buf; return RDD_OK; } static int rdd_fd_tell(RDD_READER *self, rdd_count_t *pos) { RDD_FD_READER *state = self->state; off_t offset; if ((offset = lseek(state->fd, (off_t) 0, SEEK_CUR)) == (off_t) -1) { return RDD_ETELL; } *pos = (rdd_count_t) offset; return RDD_OK; } static int rdd_fd_seek(RDD_READER *self, rdd_count_t pos) { RDD_FD_READER *state = self->state; if ((lseek(state->fd, (off_t) pos, SEEK_SET)) == (off_t) -1) { return RDD_ESEEK; } return RDD_OK; } static int rdd_fd_close(RDD_READER *self, int recurse /* ignored */) { RDD_FD_READER *state = self->state; if (close(state->fd) < 0) { return RDD_ECLOSE; } return RDD_OK; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/robustcopier.c������������������������������������������������������������������������0100644�0000000�0000000�00000030013�10435007662�0014624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ /* * Rdd copies data from one (special) file to another (regular) file. * In client-server mode, the data stream will cross a TCP connection. * Rdd will not read from stdin, because it cannot seek on stdin. * Error messages are sent to a log stream. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <assert.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include "rdd.h" #include "rdd_internals.h" #include "commandline.h" #include "reader.h" #include "writer.h" #include "filter.h" #include "filterset.h" #include "copier.h" #include "error.h" #include "netio.h" #include "alignedbuf.h" #define KNOWN_INPUT_SIZE(s) ((s)->count != RDD_WHOLE_FILE) typedef enum _read_mode_t { READ_OK, READ_ERROR, READ_RECOVERY } read_mode_t; typedef struct _RDD_ROBUST_COPIER { read_mode_t mode; rdd_count_t offset; /* start reading at this position */ rdd_count_t count; /* number of bytes to read */ unsigned minblocklen; unsigned maxblocklen; unsigned curblocklen; unsigned recovery_threshold; /* determines recovery completion */ int verbose; unsigned nretry; unsigned maxsubst; rdd_count_t nbyte; /* bytes read so far */ rdd_count_t nlost; /* bytes discarded so far */ unsigned nread_err; /* number of persistent read errors */ unsigned nsubst; unsigned nok; /* only valid in READ_RECOVERY mode */ unsigned ntry; /* only valid in READ_ERROR mode */ rdd_readerrhandler_t readerrfun; void *readerrenv; rdd_substhandler_t substfun; void *substenv; rdd_proghandler_t progressfun; void *progressenv; RDD_ALIGNEDBUF readbuf; } RDD_ROBUST_COPIER; static int robust_exec(RDD_COPIER *c, RDD_READER *r, RDD_FILTERSET *fset, RDD_COPIER_RETURN *ret); static int robust_free(RDD_COPIER *c); static RDD_COPY_OPS robust_ops = { robust_exec, robust_free }; int rdd_new_robust_copier(RDD_COPIER **self, rdd_count_t offset, rdd_count_t count, RDD_ROBUST_PARAMS *p) { RDD_COPIER *c = 0; RDD_ROBUST_COPIER *state = 0; int rc = RDD_OK; if (p->maxblocklen <= 0) return RDD_BADARG; if (p->minblocklen <= 0) return RDD_BADARG; if (p->minblocklen > p->maxblocklen) return RDD_BADARG; rc = rdd_new_copier(&c, &robust_ops, sizeof(RDD_ROBUST_COPIER)); if (rc != RDD_OK) { goto error; } state = (RDD_ROBUST_COPIER *) c->state; state->mode = READ_OK; state->offset = offset; state->count = count; state->minblocklen = p->minblocklen; state->maxblocklen = p->maxblocklen; state->curblocklen = p->maxblocklen; state->recovery_threshold = (p->maxblocklen + p->minblocklen - 1) / p->minblocklen; state->readerrfun = p->readerrfun; state->readerrenv = p->readerrenv; state->substfun = p->substfun; state->substenv = p->substenv; state->progressfun = p->progressfun; state->progressenv = p->progressenv; state->verbose = 1; state->nretry = p->nretry; state->maxsubst = p->maxsubst; state->nbyte = 0; state->nlost = 0; state->nread_err = 0; state->nsubst = 0; state->nok = 0; state->ntry = 0; /* Allocate a sector-aligned buffer. Alignment is required * when rdd access a raw device (Linux: /dev/raw/raw1, ...). * It never hurts, so we always do this. */ rc = rdd_new_alignedbuf(&state->readbuf, p->maxblocklen, RDD_SECTOR_SIZE); if (rc != RDD_OK) { goto error; } #if 0 progress_init(&state->progress, state->count, 10); rdd_copy_set_progress_handler(state, progress_update, &state->progress); #endif *self = c; return RDD_OK; error: *self = 0; if (state != 0) free(state); if (c != 0) free(c); return rc; } static void handle_eof(RDD_ROBUST_COPIER *state) { if (KNOWN_INPUT_SIZE(state)) { /* If we know the input size, then we should never hit EOF. */ error("unexpected end-of-file after %llu bytes " "(expected %s bytes)", state->nbyte, rdd_strsize(state->count)); } } static void handle_read_ok(RDD_ROBUST_COPIER *state, unsigned rsize, unsigned nread) { /* Read appears to have succeeded. Make sure it really did. */ if (KNOWN_INPUT_SIZE(state) && nread != rsize) { bug("rdd: read fewer bytes (%u) than expected (%u)", nread, rsize); } /* Read really succeeded, so process what we got. */ switch (state->mode) { case READ_OK: if (nread >= state->curblocklen && state->curblocklen < state->maxblocklen) { unsigned oldsize = state->curblocklen; state->curblocklen *= 2; if (state->curblocklen > state->maxblocklen) { state->curblocklen = state->maxblocklen; } if (state->verbose) { errlognl("increasing block size %u -> %u: " "offset %llu bytes", oldsize, state->curblocklen, state->offset + state->nbyte); } } break; case READ_ERROR: state->mode = READ_RECOVERY; state->nok = 0; if (state->verbose) { errlognl("entered READ_RECOVERY mode, " "block size %u bytes, offset %llu bytes", state->curblocklen, state->offset + state->nbyte); } break; case READ_RECOVERY: if (++state->nok >= state->recovery_threshold) { state->mode = READ_OK; if (state->verbose) { errlognl("entered READ_OK mode, " "block size %u bytes, " "offset %llu bytes", state->curblocklen, state->offset + state->nbyte); } } break; } } /* Handles a read error; returns * - RDD_EAGAIN if the caller should retry the read; * - RDD_EREAD if the block is dropped (caller should not retry); * - RDD_ABORTED if a fatal system error occurred. * retry the read. */ static int handle_read_error(RDD_ROBUST_COPIER *state, RDD_READER *reader, unsigned char *buf, unsigned rsize) { int rc = RDD_EAGAIN; state->nread_err++; switch (state->mode) { case READ_OK: case READ_RECOVERY: state->mode = READ_ERROR; state->curblocklen = state->minblocklen; state->ntry = 0; if (state->verbose) { errlognl("entered READ_ERROR mode, " "block size %u bytes, offset %llu bytes", state->curblocklen, state->offset + state->nbyte); } break; case READ_ERROR: if (++state->ntry >= state->nretry) { /* Reached maximum retry count, so there is no hope * left for this block. Tell caller to skip this * block. */ errlognl("read error: offset %llu bytes, count %u bytes", state->offset + state->nbyte, rsize); rc = rdd_reader_skip(reader, rsize); if (rc != RDD_OK) { errlognl("cannot skip bad data block, aborting"); return RDD_ABORTED; } state->mode = READ_RECOVERY; state->nok = 0; if (state->verbose) { errlognl("entered READ_RECOVERY mode, " "block size %u bytes, " "offset %llu bytes", state->curblocklen, state->offset + state->nbyte); } rc = RDD_EREAD; } break; } return rc; } /* Below follows the key copy routine. Most complexity results * from the need to handle (disk) read errors properly. In general * rdd makes no attempt to recover from TCP errors or disk-write errors. * * There are three states: READ_OK, READ_ERROR, READ_RECOVERY. * In state READ_OK, rdd reads at full speed and tries to double * the current read-block size until the default block size * is reached. * * State READ_ERROR is entered whenever a read error occurs. * In this state, rdd repeatedly tries to read a minimum-sized * block. Variable ntry is valid in this state only. * * In state READ_RECOVERY, rdd recovers from a previous read * error. This state is used to prevent rdd from increasing * its block size too quickly after a previous read error. * Variable nok is valid in this state only. */ static int robust_exec(RDD_COPIER *c, RDD_READER *reader, RDD_FILTERSET *fset, RDD_COPIER_RETURN *ret) { RDD_ROBUST_COPIER *s = (RDD_ROBUST_COPIER *) c->state; RDD_READER *areader = 0; RDD_UINT32 rsize; unsigned nread; unsigned char *buf = 0; int aborted = 0; int rc = RDD_OK; ret->nbyte = 0; ret->nlost = 0; ret->nread_err = 0; ret->nsubst = 0; if ((rc = rdd_open_atomic_reader(&areader, reader)) != RDD_OK) { return rc; } if (s->offset > 0) { if ((rc = rdd_reader_skip(areader, s->offset)) != RDD_OK) { return rc; } } while (s->nbyte < s->count) { if (s->nbyte + s->curblocklen < s->count) { /* Read a full block. */ rsize = s->curblocklen; } else { /* Read the last block. */ rsize = (RDD_UINT32) (s->count - s->nbyte); } buf = s->readbuf.aligned; nread = 0; rc = rdd_reader_read(areader, buf, rsize, &nread); if (rc == RDD_OK && nread == 0) { handle_eof(s); break; } else if (rc == RDD_OK && nread > 0) { handle_read_ok(s, rsize, nread); rc = rdd_fset_push(fset, buf, nread); if (rc != RDD_OK) { return rc; } s->nbyte += nread; } else if (rc == RDD_EREAD) { /* Read failure. When the read is fatal, * substitute zeroes and apply the filters. */ rc = handle_read_error(s, areader, buf, rsize); if (s->readerrfun != 0) { (*s->readerrfun)(s->offset + s->nbyte, rsize, s->readerrenv); } switch (rc) { case RDD_EREAD: if (s->maxsubst > 0 && (s->nsubst+1) >= s->maxsubst){ return RDD_ABORTED; } /* Substitute a zero-filled block for the * block that we have failed to read. */ memset(buf, 0, rsize); s->nlost += rsize; /* XXX to subst handler */ rc = rdd_fset_push(fset, buf, rsize); if (rc != RDD_OK) { return rc; } if (s->substfun != 0) { (*s->substfun)(s->offset + s->nbyte, rsize, s->substenv); } s->nbyte += rsize; s->nsubst++; break; case RDD_EAGAIN: break; default: return rc; } } else { return RDD_EREAD; } if (s->progressfun != 0) { rc = (*s->progressfun)(s->nbyte, s->progressenv); if (rc == RDD_ABORTED) { aborted = 1; break; } else if (rc != RDD_OK) { return rc; } } } if (s->progressfun != 0) { rc = (*s->progressfun)(s->nbyte, s->progressenv); if (rc == RDD_ABORTED) { aborted = 1; } else if (rc != RDD_OK) { return rc; } } if ((rc = rdd_fset_close(fset)) != RDD_OK) { return rc; } /* Close the atomic reader that was stacked on top of * the input reader. The caller must close its own * readers. */ if ((rc = rdd_reader_close(areader, 0)) != RDD_OK) { return rc; } ret->nbyte = s->nbyte; ret->nlost = s->nlost; ret->nread_err = s->nread_err; ret->nsubst = s->nsubst; return aborted ? RDD_ABORTED : RDD_OK; } static int robust_free(RDD_COPIER *c) { RDD_ROBUST_COPIER *state = (RDD_ROBUST_COPIER *) c->state; return rdd_free_alignedbuf(&state->readbuf); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/simplecopier.c������������������������������������������������������������������������0100644�0000000�0000000�00000010431�10421731112�0014566�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include "rdd.h" #include "rdd_internals.h" #include "reader.h" #include "writer.h" #include "filter.h" #include "filterset.h" #include "copier.h" /** \brief Size of the read buffer in bytes; a simple copier reads at most * \c SIMPLE_READ_SIZE bytes at a time from its reader. */ #define SIMPLE_READ_SIZE 65536 /* bytes */ /** \brief State structure for a simple copier. * * At present, a simple reader's state consists only of * a read buffer. The read buffer could also be allocated on the * stack in \c simple_exec(), which would eliminate all state, * but I prefer to keep large data objects off the stack. */ typedef struct _RDD_SIMPLE_COPIER { unsigned char readbuf[SIMPLE_READ_SIZE]; /**< read buffer */ rdd_proghandler_t progressfun; /**< progress callback */ void *progressenv; /**< progress environment */ } RDD_SIMPLE_COPIER; static int simple_exec(RDD_COPIER *c, RDD_READER *r, RDD_FILTERSET *fset, RDD_COPIER_RETURN *ret); static RDD_COPY_OPS simple_ops = { simple_exec, 0 }; int rdd_new_simple_copier(RDD_COPIER **self, RDD_SIMPLE_PARAMS *params) { RDD_COPIER *c = 0; RDD_SIMPLE_COPIER *state = 0; int rc; rc = rdd_new_copier(&c, &simple_ops, sizeof(RDD_SIMPLE_COPIER)); if (rc != RDD_OK) { return rc; } state = (RDD_SIMPLE_COPIER *) c->state; memset(state->readbuf, 0, sizeof(state->readbuf)); if (params) { state->progressfun = params->progressfun; state->progressenv = params->progressenv; } else { state->progressfun = 0; state->progressenv = 0; } *self = c; return RDD_OK; } static int simple_exec(RDD_COPIER *c, RDD_READER *r, RDD_FILTERSET *fset, RDD_COPIER_RETURN *ret) { RDD_SIMPLE_COPIER *s = (RDD_SIMPLE_COPIER *) c->state; rdd_count_t copied = 0; int aborted = 0; unsigned nread; int rc; ret->nbyte = 0; ret->nlost = 0; ret->nread_err = 0; ret->nsubst = 0; while (1) { nread = 0; rc = rdd_reader_read(r, s->readbuf, SIMPLE_READ_SIZE, &nread); if (rc != RDD_OK) return rc; /* read error */ if (nread == 0) break; /* reached end-of-file */ if ((rc = rdd_fset_push(fset, s->readbuf, nread)) != RDD_OK) { return rc; } copied += nread; if (s->progressfun != 0) { rc = (*s->progressfun)(copied, s->progressenv); if (rc == RDD_ABORTED) { aborted = 1; break; } else if (rc != RDD_OK) { return rc; } } } if (s->progressfun != 0) { rc = (*s->progressfun)(copied, s->progressenv); if (rc == RDD_ABORTED) { aborted = 1; } else if (rc != RDD_OK) { return rc; } } if ((rc = rdd_fset_close(fset)) != RDD_OK) { return rc; } ret->nbyte = copied; return aborted ? RDD_ABORTED : RDD_OK; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/zlibreader.c��������������������������������������������������������������������������0100644�0000000�0000000�00000011635�10421731112�0014225�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <assert.h> #include <stdlib.h> #include <sys/types.h> #include <errno.h> #include <string.h> #include <unistd.h> #include <zlib.h> #include "rdd.h" #include "reader.h" #define ZBUF_SIZE 32768 #define z_inbuf_empty(z) ((z)->avail_in <= 0) #define z_outbuf_full(z) ((z)->avail_out <= 0) typedef struct _RDD_ZLIB_READER { RDD_READER *parent; unsigned char *zbuf; z_stream zstate; rdd_count_t pos; } RDD_ZLIB_READER; /* Forward declarations */ static int rdd_zlib_read(RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread); static int rdd_zlib_tell(RDD_READER *r, rdd_count_t *pos); static int rdd_zlib_seek(RDD_READER *r, rdd_count_t pos); static int rdd_zlib_close(RDD_READER *r, int recurse); static RDD_READ_OPS zlib_read_ops = { rdd_zlib_read, rdd_zlib_tell, rdd_zlib_seek, rdd_zlib_close }; int rdd_open_zlib_reader(RDD_READER **self, RDD_READER *parent) { RDD_READER *r = 0; RDD_ZLIB_READER *state = 0; unsigned char *zbuf = 0; int rc = RDD_OK; rc = rdd_new_reader(&r, &zlib_read_ops, sizeof(RDD_ZLIB_READER)); if (rc != RDD_OK) { goto error; } state = (RDD_ZLIB_READER *) r->state; if ((zbuf = malloc(ZBUF_SIZE)) == 0) { rc = RDD_NOMEM; goto error; } state->parent = parent; state->zbuf = zbuf; state->pos = 0; memset(&state->zstate, 0, sizeof(z_stream)); state->zstate.zalloc = Z_NULL; state->zstate.zfree = Z_NULL; state->zstate.opaque = 0; state->zstate.next_in = Z_NULL; state->zstate.avail_in = 0; state->zstate.next_out = Z_NULL; state->zstate.avail_out = 0; rc = inflateInit(&state->zstate); if (rc == Z_MEM_ERROR) { rc = RDD_NOMEM; goto error; } else if (rc != Z_OK) { rc = RDD_ECOMPRESS; goto error; } *self = r; return RDD_OK; error: *self = 0; if (zbuf != 0) free(zbuf); if (state != 0) free(state); if (r != 0) free(r); return rc; } static int rdd_zlib_read(RDD_READER *self, unsigned char *buf, unsigned nbyte, unsigned *nread) { RDD_ZLIB_READER *state = self->state; z_stream *z = &state->zstate; int rc; *nread = 0; z->next_out = buf; z->avail_out = nbyte; while (z->avail_out > 0) { if (z->avail_in == 0) { /* Input buffer (zbuf) is empty: refill it with * compressed data that is obtained from the parent * reader. */ z->next_in = state->zbuf; rc = rdd_reader_read(state->parent, state->zbuf, ZBUF_SIZE, &z->avail_in); if (rc != RDD_OK) { return rc; } } rc = inflate(z, Z_NO_FLUSH); if (rc == Z_STREAM_END) { break; } else if (rc != Z_OK) { return RDD_ECOMPRESS; } } *nread = z->next_out - buf; state->pos += *nread; return RDD_OK; } static int rdd_zlib_tell(RDD_READER *self, rdd_count_t *pos) { RDD_ZLIB_READER *state = self->state; *pos = state->pos; return RDD_OK; } static int rdd_zlib_seek(RDD_READER *self, rdd_count_t pos) { return RDD_ESEEK; /* not implemented */ } static int rdd_zlib_close(RDD_READER *self, int recurse) { RDD_ZLIB_READER *state = self->state; int rc; if ((rc = inflateEnd(&state->zstate)) != Z_OK) { return RDD_ECOMPRESS; } if (recurse) { if ((rc = rdd_reader_close(state->parent, 1)) != RDD_OK) { return rc; } } free(state->zbuf); state->zbuf = 0; return RDD_OK; } ���������������������������������������������������������������������������������������������������rdd-2.0.7/src/logprinter.c��������������������������������������������������������������������������0100644�0000000�0000000�00000007175�10421731112�0014273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_STRING_H #include <string.h> #endif #ifdef HAVE_TIME_H #include <time.h> #endif #include "rdd.h" #include "rdd_internals.h" #include "msgprinter.h" typedef struct _RDD_LOG_MSGPRINTER { RDD_MSGPRINTER *next; } RDD_LOG_MSGPRINTER; static void log_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg); static int log_close(RDD_MSGPRINTER *printer, unsigned flags); static RDD_MSGPRINTER_OPS log_ops = { log_print, log_close }; int rdd_mp_open_log_printer(RDD_MSGPRINTER **printer, RDD_MSGPRINTER *next) { RDD_LOG_MSGPRINTER *log = 0; RDD_MSGPRINTER *p = 0; int rc = RDD_OK; rc = rdd_mp_open_printer(&p, &log_ops, sizeof(RDD_LOG_MSGPRINTER)); if (rc != RDD_OK) { return rc; } log = (RDD_LOG_MSGPRINTER *) p->state; log->next = next; *printer = p; return RDD_OK; } static void log_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg) { RDD_LOG_MSGPRINTER *log = (RDD_LOG_MSGPRINTER *) printer->state; time_t now_unix; char now_buf[64]; struct tm *now_local; size_t n; if ((now_unix = time(NULL)) == (time_t) -1) goto error; if ((now_local = localtime(&now_unix)) == NULL) goto error; n = strftime(now_buf, sizeof now_buf, "%Y-%m-%d %T %z", now_local); if (n == 0 || n >= (sizeof now_buf)) goto error; now_buf[(sizeof now_buf) - 1] = '\000'; rdd_mp_print(log->next, type, errcode, "%s: %s", now_buf, msg); return; error: /* This error condition seems rather unlikely and I * do not want this routine to return an error code * that needs to be tested, especially not since * this routine may well be called if you are already * in trouble. Instead I settle for a missing timestamp. */ rdd_mp_print(log->next, type, errcode, "???: %s", msg); } static int log_close(RDD_MSGPRINTER *printer, unsigned flags) { RDD_LOG_MSGPRINTER *log = (RDD_LOG_MSGPRINTER *) printer->state; int rc; if ((flags & RDD_MP_RECURSE) != 0) { if ((rc = rdd_mp_close(log->next, flags)) != RDD_OK) { return rc; } } memset(log, 0, sizeof *log); return RDD_OK; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/rdd.1���������������������������������������������������������������������������������0100644�0000000�0000000�00000000346�10435007526�0012600�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH RDD "1" "April 2006" "rdd 2.0" .SH NAME rdd-copy \- copy a file, even if read errors occur .P rdd-verify \- verifies checksums and hash values generated by \fBrdd-copy(1)\fR .SH SEE ALSO \fBrdd-copy(1)\fR, \fBrdd-verify(1)\fR ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/atomicreader.c������������������������������������������������������������������������0100644�0000000�0000000�00000007373�10421731112�0014545�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdlib.h> #include <sys/types.h> #include <errno.h> #include <unistd.h> #include "rdd.h" #include "reader.h" /** \brief Atomic reader state. * * An atomic reader forwards all operations to its parent * in the reader stack, so it only needs to keep track of * that parent. */ typedef struct _RDD_ATOMIC_READER { RDD_READER *parent; } RDD_ATOMIC_READER; /* Forward declarations */ static int rdd_atomic_read(RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread); static int rdd_atomic_tell(RDD_READER *r, rdd_count_t *pos); static int rdd_atomic_seek(RDD_READER *r, rdd_count_t pos); static int rdd_atomic_close(RDD_READER *r, int recurse); static RDD_READ_OPS atomic_read_ops = { rdd_atomic_read, rdd_atomic_tell, rdd_atomic_seek, rdd_atomic_close }; int rdd_open_atomic_reader(RDD_READER **self, RDD_READER *p) { RDD_READER *r = 0; RDD_ATOMIC_READER *state = 0; int rc; rc = rdd_new_reader(&r, &atomic_read_ops, sizeof(RDD_ATOMIC_READER)); if (rc != RDD_OK) { *self = 0; return rc; } state = (RDD_ATOMIC_READER *) r->state; state->parent = p; *self = r; return RDD_OK; } static int rdd_atomic_read(RDD_READER *self, unsigned char *buf, unsigned nbyte, unsigned *nread) { RDD_ATOMIC_READER *state = self->state; rdd_count_t pos; int rc1; int rc2; /* Save current position. */ if ((rc1 = rdd_reader_tell(state->parent, &pos)) != RDD_OK) { return rc1; } rc2 = rdd_reader_read(state->parent, buf, nbyte, nread); if (rc2 == RDD_OK) { return RDD_OK; } /* Error occurred: restore current position. */ if ((rc1 = rdd_reader_seek(state->parent, pos)) != RDD_OK) { return rc1; } return rc2; } static int rdd_atomic_tell(RDD_READER *self, rdd_count_t *pos) { RDD_ATOMIC_READER *state = self->state; return rdd_reader_tell(state->parent, pos); } static int rdd_atomic_seek(RDD_READER *self, rdd_count_t pos) { RDD_ATOMIC_READER *state = self->state; return rdd_reader_seek(state->parent, pos); } static int rdd_atomic_close(RDD_READER *self, int recurse) { RDD_ATOMIC_READER *state = self->state; if (recurse) { return rdd_reader_close(state->parent, 1 /* recurse */); } else { return RDD_OK; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/rddverify.c���������������������������������������������������������������������������0100644�0000000�0000000�00000035600�10435007612�0014104�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <ctype.h> #include <errno.h> #include <limits.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <assert.h> #if defined(HAVE_LIBCRYPTO) && defined(HAVE_OPENSSL_MD5_H) && defined(HAVE_OPENSSL_SHA_H) #include <openssl/md5.h> #include <openssl/sha.h> #else /* Use local versions to allow stand-alone compilation. */ #include "md5.h" #include "sha1.h" #endif /* HAVE_LIBCRYPTO */ #if defined(HAVE_LIBCRYPTO) && defined(HAVE_OPENSSL_CRYPTO_H) #include <openssl/crypto.h> #else #error "Sorry, we need the openssl crypto lib to compile" #endif #if defined(HAVE_LIBZ) #include <zlib.h> #else #error "Sorry, we need zlib to compile" #endif #include "rdd.h" #include "reader.h" #include "writer.h" #include "filter.h" #include "filterset.h" #include "msgprinter.h" #include "rdd_internals.h" #include "error.h" #include "commandline.h" /* Types of verication checks to perform. */ #define VFY_MD5 0x1 #define VFY_SHA1 0x2 #define VFY_ADLER32 0x4 #define VFY_CRC32 0x8 #define READ_SIZE 262144 /* bytes */ #define bool2str(b) ((b) ? "yes" : "no") static struct verifier_opts { char **files; /* input files */ unsigned nfile; /* #input files */ char *crc32file; /* output file for CRC32 checksums */ char *adler32file; /* output file for Adler32 checksums */ int verbose; /* Be verbose? */ int md5; /* MD5-hash all data? */ int sha1; /* SHA1-hash all data? */ rdd_count_t progresslen; /* progress reporting interval (s) */ char *md5digest; char *sha1digest; } opts; typedef rdd_checksum_t (*checksum_fun)(rdd_checksum_t, const unsigned char *, size_t); static char *usage_message = "rdd-verify [local options] file1 ... \n"; static RDD_OPTION opttab[] = { {"-?", "--help", 0, 0, "Print this message", 0, 0}, {"-V", "--version", 0, 0, "Report version number and exit", 0, 0}, {"-v", "--verbose", 0, 0, "Be verbose", 0, 0}, {"--checksum", "--adler32", "<file>", 0, "verify Adler32 checksums in <file> against input files", 0, 0}, {"--crc", "--crc32", "<file>", 0, "verify CRC32 checksums in <file> against input files", 0, 0}, {"--md5", "--md5", "<md5 digest>", 0, "verify MD5 hash", 0, 0}, {"--sha", "--sha1", "<sha-1 digest>", 0, "verify SHA1 hash", 0, 0}, {0, 0, 0, 0, 0, 0, 0} /* sentinel */ }; static RDD_MSGPRINTER *the_printer; static void process_options(void) { char *arg; if (rdd_opt_set("help")) { rdd_opt_usage(); } if (rdd_opt_set("version")) { fprintf(stderr, "%s version %s\n", PACKAGE, VERSION); exit(EXIT_SUCCESS); } opts.verbose = rdd_opt_set("verbose"); if (rdd_opt_set_arg("md5",&arg)) { opts.md5 = 1; opts.md5digest = arg; } if (rdd_opt_set_arg("sha1", &arg)) { opts.sha1 = 1; opts.sha1digest = arg; } if (rdd_opt_set_arg("adler32", &arg)) { opts.adler32file = arg; } if (rdd_opt_set_arg("crc32", &arg)) { opts.crc32file = arg; } if ((!opts.md5) && (!opts.sha1) && (opts.adler32file == NULL) && (opts.crc32file == NULL)) { error("Nothing to do. No options given"); } } static void command_line(int argc, char **argv) { RDD_OPTION *od; unsigned i; char *opt; char *arg; for (i = 1; i < (unsigned) argc; i++) { if ((od = rdd_get_opt_with_arg(argv, argc, &i, &opt, &arg)) == 0) { break; } } process_options(); if (argc - i < 1) { rdd_opt_usage(); } opts.files = &argv[i]; opts.nfile = argc - i; } static u_int16_t swap16(u_int16_t n) { return ((n << 8) & 0xff00) | ((n >> 8) & 0x00ff); } static u_int32_t swap32(u_int32_t n) { return ((n << 24) & 0xff000000) | ((n << 8) & 0x00ff0000) | ((n >> 8) & 0x0000ff00) | ((n >> 24) & 0x000000ff) ; } static u_int64_t swap64(u_int64_t n) { u_int64_t lo_swapped, hi_swapped; u_int32_t lo, hi; lo = (u_int32_t) (n & 0xffffffff); hi = (u_int32_t) ((n >> 32) & 0xffffffff); lo_swapped = (u_int64_t) swap32(lo); hi_swapped = (u_int64_t) swap32(hi); return (lo_swapped << 32) | hi_swapped; } static RDD_READER * open_image_file(const char *path) { RDD_READER *reader = 0; int rc; if ((rc = rdd_open_file_reader(&reader, path, 0)) != RDD_OK) { rdd_error(rc, "cannot open %s", path); } return reader; } static void close_image_file(const char *path, RDD_READER *reader) { int rc; if ((rc = rdd_reader_close(reader, 1)) != RDD_OK) { rdd_error(rc, "cannot close %s", path); } } static void swap_header(RDD_CHECKSUM_FILE_HEADER *hdr) { hdr->magic = swap16(hdr->magic); hdr->version = swap16(hdr->version); hdr->flags = swap16(hdr->flags); hdr->reserved = swap16(hdr->reserved); hdr->blocksize = swap32(hdr->blocksize); hdr->offset = swap64(hdr->offset); hdr->imagesize = swap64(hdr->imagesize); } static void check_header(char *path, RDD_CHECKSUM_FILE_HEADER *header, int type, int *swap) { if (header->magic != RDD_CHECKSUM_MAGIC) { swap_header(header); *swap = 1; } else { *swap = 0; } if (header->magic != RDD_CHECKSUM_MAGIC) { error("%s: header magic value is incorrect; " "expected %04x, got %04x", path, RDD_CHECKSUM_MAGIC, header->magic); } if (header->version != RDD_CHECKSUM_VERSION) { error("%s: header version is incorrect; " "expected %04x, got %04x", path, RDD_CHECKSUM_VERSION, header->version); } if ((header->flags & type) != type) { error("%s: the type found in the file is wrong; " "expected %04x got %04x", path, type, header->flags); } } static FILE * open_checksum_file(char *path, int type, RDD_CHECKSUM_FILE_HEADER *hdr, int *swap) { FILE *fp; if ((fp = fopen(path, "rb")) == NULL) { unix_error("cannot open checksum file %s", path); } if (fread(hdr, sizeof(*hdr), 1, fp) < 1) { unix_error("cannot read header from %s", path); } check_header(path, hdr, type, swap); return fp; } static void close_checksum_file(const char *path, FILE *fp) { if (fp == NULL) { return; } if (fgetc(fp) != EOF) { warn("unprocessed data in %s", path); } if (fclose(fp) == EOF) { unix_error("cannot close %s", path); } } static void verify_file(RDD_FILTERSET *filters, const char *path) { RDD_READER *reader = 0; unsigned char buf[READ_SIZE]; unsigned nread; int rc; reader = open_image_file(path); while (1) { rc = rdd_reader_read(reader, buf, READ_SIZE, &nread); if (rc != RDD_OK) { rdd_error(rc, "%s: read error", path); } if (nread == 0) break; /* EOF */ if ((rc = rdd_fset_push(filters, buf, nread)) != RDD_OK) { rdd_error(rc, "cannot push buffer into filter"); } } if ((rc = rdd_fset_close(filters)) != RDD_OK) { rdd_error(rc, "cannot close filters"); } close_image_file(path, reader); } static void add_filter(RDD_FILTERSET *fset, const char *name, RDD_FILTER *f) { int rc; if ((rc = rdd_fset_add(fset, name, f)) != RDD_OK) { rdd_error(rc, "cannot install %s filter", name); } } static void handle_checksum_error(rdd_count_t pos, rdd_checksum_t expected, rdd_checksum_t computed, void *env) { char *algorithm = (char *) env; errlognl("%s checksum error; block offset %llu; " "expected 0x%08x, got 0x%08x", algorithm, pos, expected, computed); } static void get_checksum_result(RDD_FILTERSET *fset, const char *name, unsigned *num_error) { RDD_FILTER *f = 0; int rc; *num_error = 0; if ((rc = rdd_fset_get(fset, name, &f)) != RDD_OK) { rdd_error(rc, "cannot find %s filter", name); } rc = rdd_filter_get_result(f, (unsigned char *) num_error, sizeof(*num_error)); if (rc != RDD_OK) { rdd_error(rc, "cannot get result for %s filter", name); } } static void get_hash_result(RDD_FILTERSET *fset, const char *name, unsigned char *md, unsigned mdsize) { RDD_FILTER *f = 0; int rc; memset(md, 0, mdsize); if ((rc = rdd_fset_get(fset, name, &f)) != RDD_OK) { rdd_error(rc, "cannot find %s filter", name); } if ((rc = rdd_filter_get_result(f, md, mdsize)) != RDD_OK) { rdd_error(rc, "cannot get result for %s filter", name); } } static int equal_digest(char *md1, char *md2, unsigned mdlen) { unsigned i; for (i = 0; i < mdlen; i++) { if (tolower(md1[i]) != tolower(md2[i])) { return 0; } } return 1; } static int verify_files(char **files, unsigned nfile, FILE* adler32file, rdd_count_t a32len, int a32swap, FILE* crc32file, rdd_count_t crc32len, int crc32swap) { RDD_FILTERSET filters; RDD_FILTER *f = 0; unsigned num_error; int broken = 0; int rc; unsigned i; if ((rc = rdd_fset_init(&filters)) != RDD_OK) { rdd_error(rc, "cannot initialize filter set"); } if (opts.md5) { rc = rdd_new_md5_streamfilter(&f); if (rc != RDD_OK) { rdd_error(rc, "cannot create MD5 filter"); } add_filter(&filters, "MD5 stream", f); } if (opts.sha1) { rc = rdd_new_sha1_streamfilter(&f); if (rc != RDD_OK) { rdd_error(rc, "cannot create SHA-1 filter"); } add_filter(&filters, "SHA-1 stream", f); } if (adler32file != 0) { rc = rdd_new_verify_adler32_blockfilter(&f, adler32file, a32len, a32swap, handle_checksum_error, "Adler32"); if (rc != RDD_OK) { rdd_error(rc, "cannot create Adler32 verification filter"); } add_filter(&filters, "Adler32 verification block", f); } if (crc32file != 0) { rc = rdd_new_verify_crc32_blockfilter(&f, crc32file, crc32len, crc32swap, handle_checksum_error, "CRC-32"); if (rc != RDD_OK) { rdd_error(rc, "cannot create CRC-32 verification filter"); } add_filter(&filters, "CRC-32 verification block", f); } /* Run verification. */ for (i = 0; i < nfile; i++) { if (opts.verbose) { errlognl("verifying %s ...", files[i]); } verify_file(&filters, files[i]); } /* Check results. */ if (adler32file != 0) { get_checksum_result(&filters, "Adler32 verification block", &num_error); if (num_error > 0) { broken |= VFY_ADLER32; } } if (crc32file != 0) { get_checksum_result(&filters, "CRC-32 verification block", &num_error); if (num_error > 0) { broken |= VFY_CRC32; } } if (opts.sha1) { unsigned char md[20]; char hexmd[2*20 + 1]; int rc; get_hash_result(&filters, "SHA-1 stream", md, sizeof md); rc = rdd_buf2hex(md, sizeof md, hexmd, sizeof hexmd); if (rc != RDD_OK) { rdd_error(rc, "cannot print SHA-1 digest"); } if (opts.verbose) { errlognl("Found SHA1 digest: [%s]", hexmd); } if (! equal_digest(hexmd, opts.sha1digest, 2*SHA_DIGEST_LENGTH)) { errlognl("SHA1 values do not match:"); errlognl("\texpected: %s", opts.sha1digest); errlognl("\tfound: %s", hexmd); broken |= VFY_SHA1; } } if (opts.md5) { unsigned char md[16]; char hexmd[2*16 + 1]; int rc; get_hash_result(&filters, "MD5 stream", md, sizeof md); rc = rdd_buf2hex(md, sizeof md, hexmd, sizeof hexmd); if (rc != RDD_OK) { rdd_error(rc, "cannot print MD5 digest"); } if (opts.verbose) { errlognl("Found MD5 digest: [%s]", hexmd); } if (! equal_digest(hexmd, opts.md5digest, 2*MD5_DIGEST_LENGTH)) { errlognl("MD5 values do not match:"); errlognl("\texpected: %s", opts.md5digest); errlognl("\tfound: %s", hexmd); broken |= VFY_MD5; } } if ((rc = rdd_fset_clear(&filters)) != RDD_OK) { rdd_error(rc, "cannot clean up filter set"); } return broken; } int main(int argc, char** argv) { RDD_CHECKSUM_FILE_HEADER adler32hdr; RDD_CHECKSUM_FILE_HEADER crc32hdr; FILE *adler32file = NULL; FILE *crc32file = NULL; int adler32swap = 0; int crc32swap = 0; int res; int i; rdd_opt_init(opttab, usage_message); set_progname(argv[0]); set_logfile(stderr); memset(&opts, '\000', sizeof opts); command_line(argc, argv); memset(&adler32hdr, 0, sizeof adler32hdr); memset(&crc32hdr, 0, sizeof crc32hdr); if (opts.adler32file) { adler32file = open_checksum_file(opts.adler32file, RDD_ADLER32, &adler32hdr, &adler32swap); } if (opts.crc32file) { crc32file = open_checksum_file(opts.crc32file, RDD_CRC32, &crc32hdr, &crc32swap); } errlognl(""); errlognl("%s", rdd_ctime()); errlognl("%s version %s (Internal rev $Rev: 252 $)", PACKAGE, VERSION); errlognl("Copyright (c) 2002 Nederlands Forensisch Instituut"); #if defined(HAVE_LIBZ) errlognl("zlib version %s", zlibVersion()); errlognl("Copyright (c) 1995-2002 Jean-loup Gailyy and Mark Adler"); #endif #if defined(HAVE_LIBCRYPTO) errlognl("openssl version %s", OPENSSL_VERSION_TEXT); errlognl("Copyright (c) 1995-1998 Eric Young"); #endif errlog("%s", argv[0]); for (i = 1; i < argc; i++) { errlog(" %s", argv[i]); } errlognl(""); errlognl(""); if (opts.verbose) { errlognl("verbose: %s", bool2str(opts.verbose)); } res = verify_files(opts.files, opts.nfile, adler32file, adler32hdr.blocksize, adler32swap, crc32file, crc32hdr.blocksize, crc32swap); if (res == 0) { errlognl("Verification complete: NO ERRORS"); } else { errlognl("Verification complete: FAILURE DETECTED"); if ((res & VFY_ADLER32) != 0) { errlognl("Adler32 verification failed"); } if ((res & VFY_CRC32) != 0) { errlognl("CRC32 verification failed"); } if ((res & VFY_SHA1) != 0) { errlognl("SHA1 verification failed"); } if ((res & VFY_MD5) != 0) { errlognl("MD5 verification failed"); } } close_checksum_file(opts.crc32file, crc32file); close_checksum_file(opts.adler32file, adler32file); return (res == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } ��������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/rdd-copy.1����������������������������������������������������������������������������0100644�0000000�0000000�00000032632�10435007443�0013551�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.TH RDD "1" "December 2004" "rdd 2.0" .SH NAME rdd-copy \- copy a file, even if read errors occur .SH SYNOPSIS .B rdd-copy [\fIOPTION\fR] src [dst] .B rdd-copy -C [\fICLIENT OPTION\fR] src [host:]dst .B rdd-copy -S [\fISERVER OPTION\fR] .SH DESCRIPTION .\" Add any additional description here .PP Rdd-copy is a file and device copying utility that includes features that are useful in a forensic environment. In particular, rdd-copy can compute cryptographic hashes over the data it copies, is robust with respect to read errors, and can copy data across a network. Rdd-copy is best understood as a program that consists of a reader stage and one or more processing stages. The reader stage reads input data in a robust way. It will retry failed reads. If a read error persists, the reader stage substitutes zero bytes for the input bytes that it fails to read. The resulting bytes are passed to all subsequent processing stages. The processing stages are enabled through command-line options. The current stages are: checksumming (Adler32 and CRC32), hashing (MD5 and SHA1), file output, network output, and statistics. Rdd-copy can be run in \fBlocal mode\fR, in \fBclient mode\fR, and in \fBserver mode\fR. The mode is indicated by the first command-line argument. Copying data across a network requires two rdd-copy processes: a client process that reads the data from disk and transmits it across the network, and a server process that reads the data from the network and writes it to a file or device. .SH LOCAL MODE In local mode, rdd-copy copies source file \fBsrc\fR to destination file \fBdst\fR, handling read errors according to the options. If \fBdst\fR is not specified, the data in \fBsrc\fR will be read and optionally hashed, but it will not be written. To write to standard output, specify \fB-\fR as \fBdst\fR. Rdd-copy will optionally compute an MD5 or a SHA1 hash value over the input bytes and the zero bytes it substitutes for blocks it cannot read. These hash values should be interpreted with care (see below). Rdd-copy does NOT guarantee that the bytes it reads are the same bytes that are stored on the input medium. It simply takes what \fBread(2)\fR returns. Any hash values (see options) are computed over the bytes that \fBread(2)\fR returns or, if \fBread(2)\fR fails, over zero-valued fill bytes. Rdd-copy does NOT guarantee that the bytes that it reads into memory (or the zero-valued bytes that it substitutes when a read error occurs) will be written to the output file correctly. If you wish to verify the correspondence between what rdd-copy saw and what got written to disk, you will have to recompute the MD5 and/or SHA1 hash values over the output file and compare them with the hash values reported by rdd-copy. This is a useful verification step, but beware that even this step cannot guarantee perfect correspondence with the data stored on the source medium. The best end-to-end test is probably to read back the output file and compare each output byte to the corresponding input byte, unless that input byte was part of a block for which rdd-copy reported a read error. Rdd-copy does NOT recover from persisting write errors. Rdd-copy was designed to handle unfriendly source media only. If you get write errors, you should replace your target medium. .SH READ ERRORS In local mode and in client mode, rdd-copy reads from disk. Rdd-copy assumes that the source disk may be faulty and tries to be robust with respect to disk-read errors. In server mode, rdd-copy reads from the network and makes no attempt to survive read errors. The explanation below applies only to read errors that occur in local mode and in client mode. When a read error occurs, rdd-copy reduces the block size to the minimum block size (see \fB\-\-min\-block\-size\fR) and resets the read pointer to the location at which it started the read that failed. Next, rdd-copy tries to read a series of minimum-sized blocks (see \fB\-\-min\-block\-size\fR). When such a read fails, it is retried a user-specified number of times (see \fB\-\-nretry\fR). If the read failure persists, rdd-copy normally will skip a minimum-sized block of input data and will write a minimum-sized block of zero bytes to the destination file. These zero bytes are also passed to all other rdd-copy processing stages (checksumming, hashing, and statistics). Any persistent read failure counts toward the maximum number of read errors that the user will tolerate (see \fB\-\-max\-read\-err\fR). If this maximum is reached, rdd-copy will exit immediately. By default, however, an infinite number of read errors is allowed. After a read failure, rdd-copy continues to use the minimum block size to read data until it has read \fIblock-size\fR bytes of data without errors. (\fIblock-size\fR is the user-specified block size, see \fB\-\-block\-size\fR.) Only then will rdd-copy increase its block size again, doubling the size at each successful read, until it reaches the default block size. .SH CLIENT MODE In client mode, rdd-copy operates as in local mode, except that the data will not be copied to a file, but will be written to a TCP connection to an rdd-copy server process. In client mode, a destination file, \fBdst\fR, on a destination \fBhost\fR must be specified. If no \fBhost\fR is specified, \fBlocalhost\fR will be used. .SH SERVER MODE In server mode, rdd-copy accepts one TCP connection from an rdd-copy client. The server process must be started before the client process. In server mode, rdd-copy will read data from a TCP connection and write it to a target file. For now, the target file must always be specified by the client. The main reason for this decision is to keep open the option of having \fBinetd(8)\fR or \fBxinetd(8)\fR start an rdd-copy server process. .SH OUTPUT Informative messages, error messages, and statistics are all written to \fBstderr\fR. .SH OPTIONS .TP \fB\-C, \-\-client\fR Run rdd-copy in client mode. If you use this option, it must come first. .TP \fB\-S, \-\-server\fR Run rdd-copy in server mode. If you use this option, it must come first. .TP \fB-p, \-\-port <portnum>\fR Modes: client, server. Specifies the port number \fB<portnum>\fR at which the server listens for an incoming connection. The default port is 4832. .TP \fB\-?, \-\-help\fR Modes: all. Print a usage message that includes this list of options. .TP \fB\-V, \-\-version\fR Modes: all. Print version information and exit .TP \fB\-v, \-\-verbose\fR Modes: all. Be verbose. .TP \fB\-q, \-\-quiet\fR Modes: all. Do not pose interactive questions. .TP \fB\-l, \-\-log\-file <logfile>\fR Modes: all. Log all messages except progress messages to \fB<logfile>\fR. .TP \fB\-f, \-\-force\fR Modes: local, server. Force existing files to be overwritten. The default behavior is to bail out when the output file already exists. .TP \fB\-b, \-\-block\-size <size>\fR Modes: local, client. Specify the default block size; <size> must be a power of two. While no read errors occur, rdd-copy will read and write blocks of <size> bytes. .TP \fB\-m, \-\-min\-block\-size <size>\fR Modes: local, client. Specify the minimum read size; <size> must be a power of two. When a persistent read error occurs, at least this many bytes of data will be skipped and replaced with zero bytes in the destination file. .TP \fB\-n, \-\-nretry <count>\fR Modes: local, client. Retry failed reads up to <count> times. In many cases, using a large retry value makes little sense, because the operating system's device driver will not indicate a failed read until it has, itself, retried the read several times. .TP \fB\-o, \-\-offset <size>\fR Modes: local, client. Skip <size> bytes from the start of the input file before reading any data. The bytes that are skipped will not be included in any hash computation and will not be written to the output file. .TP \fB\-c, \-\-count <size>\fR Modes: local, client. Read at most <size> input bytes or read until end-of-file. .TP \fB\-z, \-\-compress\fR Modes: client. Compress network data. .TP \fB\-s, \-\-split <size>\fR Modes: local, server. If necessary, create multiple output files, none of which will be larger than <size> bytes. Each output file will have a name that consists of a sequence number followed by a dash and the name specified on the command line. .TP \fB\-r, \-\-raw\fR Modes: local, client. Access the device using the raw device. The data will not travel through the buffer cache. .TP \fB\-P, \-\-progress <sec>\fR Modes: all. Report progress (bytes read and percentage of data covered) every <sec> seconds. .TP \fB\-M, \-\-max\-read\-err <count>\fR Modes: local, client. Give up after <count> read errors. .TP \fB\-\-md5\fR Modes: all. Compute an MD5 hash value over all data that was read without errors and over the zero-filled blocks that are used to replace bad blocks. .TP \fB\-\-sha, \-\-sha1\fR Modes: all. Compute a SHA1 hash value over all data that was read without errors and over the zero-filled blocks that are used to replace bad blocks. .TP \fB\-\-checksum, \-\-adler32 <file>\fR Modes: all. Compute an Adler32 checksum value over blocks of data produced by the reader stage. The last block to be checksummed may be smaller than the the block size that is used. All checksum values are written to <file>. .TP \fB\-\-checksum\-block\-size, \-\-adler32\-block\-size <size>\fR Modes: all. Compute Adler32 checksum values over data blocks with a size of <size> bytes. Only the last data block to be checksummed may be smaller than <size>. The default block size is 32 Kbyte. .TP \fB\-\-crc32 <file>\fR Modes: all. Compute a CRC32 checksum value over blocks of data produced by the reader stage. The last block to be checksummed may be smaller than the the block size that is used. All checksum values are written to <file>. .TP \fB\-\-crc32\-block\-size <size>\fR Modes: all. Compute CRC32 checksum values over data blocks with a size of <size> bytes. Only the last data block to be checksummed may be smaller than <size>. The default block size is 32 Kbyte. .TP \fB\-H, \-\-histogram <file>\fR Modes: all. Compute a histogram over each block of data produced by the reader stage. The histogramming block size can be set by the user (see \fB\-\-hist-block-size\fR). For each block, write a single text line of statistics to <file>. .TP \fB\-h, \-\-hist-block-size <size>\fR Modes: all. Set the histogramming block size to <size> bytes. The default block size is 256 Kbyte. .TP \fB\-\-block\-md5 <file>\fR Modes: all. Compute the MD5 hash value over blocks of data produced by the reader stage. The last block to be hashed may be smaller than the block size. All MD5 values are written to text file <file>. Each line in this file contains a block number, followed by a space, followed by the hash value of the corresponding block. .TP \fB\-\-block\-md5\-size <size>\fR Modes: all. Sets the block size of the block-wise MD5 computation. The default block size is 4 Kbyte. .PP A <size> argument may be followed by one of the following multiplicative suffixes: c 1, w 2, b 512, k 1024, M 1,048,576, and G 1,073,741,824. .SH EXAMPLES .TP rdd-copy --md5 /dev/hda1 Compute and print the MD5 hash value over \fB/dev/hda1\fR. On Linux, \fB/dev/hda1\fR denotes the first partition of the primary master disk. .TP rdd-copy -b 16k -m 512 -l rdd-log.txt /dev/fd0 f.img Create an image of a floppy disk (\fB/dev/fd0\fR). Copy 16 Kbyte at a time, but use blocks as small as a single sector (512 bytes) when read errors occur. Write all log messages to the file \fBrdd-log.txt\fR. .TP On the server: rdd-copy -S --sha1 .TP On the client: rdd-copy -C --sha1 /dev/hdb snake:/images/disk.img Copy the primary slave disk to host snake and store the data in file \fB/images/disk.img\fR. The client host computes a SHA1 hash over the data it reads from the disk; the server host computes a SHA1 hash over the data it receives from the network. .TP rdd-copy --count 512 /dev/hda mbr.img Copy the master boot record (MBR) from the primary master disk to file \fBmbr.img\fR. .SH SEE ALSO .TP \fBrdd-verify(1)\fR, \fBraw(8)\fR .SH NOTES If you encounter read errors, do examine \fB/var/log/messages\fR (or the equivalent file on your operating system). It may contain useful device driver error messages. .PP On Linux (kernel 2.4 and lower) rdd-copy and other programs that read from a block device may yield an I/O error when they reach the end of the device, even if there's nothing wrong with the device. To the best of my knowledge, this is a Linux problem rather than an rdd-copy problem; the same problem occurs with GNU dd-copy and other programs. The problem is described in the following document: http://www.cftt.nist.gov/Notes_on_dd_and_Odd_Sized_Disks4.doc. The problem has apparently been solved in the Linux 2.6 kernel. .PP If you use \fBrdd-copy\fR to access a device, consider using the \fIraw\fR device (see \fBraw(8)\fR). This way, your data will not travel through the buffer cache. .SH BUGS Server-side errors are not reported back to the client. Users must watch the server's output. .SH "REPORTING BUGS" Report bugs to <rdd@holmes.nl>. .SH ACKNOWLEDGEMENTS Many thanks to all who reported bugs and successes, and who suggested improvements. You know who you are. .SH COPYRIGHT Copyright \(co 2002-2003 Netherlands Forensic Institute .br This software comes with NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH HISTORY Up to version 1.2-7a rdd-copy (then called rdd) used a different error recovery strategy. With the new strategy, users can no longer set the recovery threshold, so the \fB\-\-recovery\-len\fR option has been retired. ������������������������������������������������������������������������������������������������������rdd-2.0.7/src/Makefile.in���������������������������������������������������������������������������0100644�0000000�0000000�00000051056�10421731541�0014012�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = rdd-copy$(EXEEXT) rdd-verify$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru librdd_a_AR = $(AR) $(ARFLAGS) librdd_a_LIBADD = am_librdd_a_OBJECTS = strerror.$(OBJEXT) console.$(OBJEXT) \ error.$(OBJEXT) rdd_internals.$(OBJEXT) commandline.$(OBJEXT) \ md5.$(OBJEXT) sha1.$(OBJEXT) outfile.$(OBJEXT) \ numparser.$(OBJEXT) alignedbuf.$(OBJEXT) writer.$(OBJEXT) \ zlibwriter.$(OBJEXT) fdwriter.$(OBJEXT) filewriter.$(OBJEXT) \ tcpwriter.$(OBJEXT) safewriter.$(OBJEXT) partwriter.$(OBJEXT) \ reader.$(OBJEXT) fdreader.$(OBJEXT) filereader.$(OBJEXT) \ atomicreader.$(OBJEXT) zlibreader.$(OBJEXT) \ faultyreader.$(OBJEXT) rawreader.$(OBJEXT) \ alignedreader.$(OBJEXT) filterset.$(OBJEXT) filter.$(OBJEXT) \ md5streamfilter.$(OBJEXT) sha1streamfilter.$(OBJEXT) \ writestreamfilter.$(OBJEXT) statsblockfilter.$(OBJEXT) \ md5blockfilter.$(OBJEXT) checksumblockfilter.$(OBJEXT) \ verifyblockfilter.$(OBJEXT) copier.$(OBJEXT) \ robustcopier.$(OBJEXT) simplecopier.$(OBJEXT) \ progress.$(OBJEXT) msgprinter.$(OBJEXT) stdioprinter.$(OBJEXT) \ fileprinter.$(OBJEXT) bcastprinter.$(OBJEXT) \ logprinter.$(OBJEXT) netio.$(OBJEXT) librdd_a_OBJECTS = $(am_librdd_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_rdd_copy_OBJECTS = rddcopy.$(OBJEXT) rdd_copy_OBJECTS = $(am_rdd_copy_OBJECTS) rdd_copy_DEPENDENCIES = librdd.a am_rdd_verify_OBJECTS = rddverify.$(OBJEXT) rdd_verify_OBJECTS = $(am_rdd_verify_OBJECTS) rdd_verify_DEPENDENCIES = librdd.a DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(librdd_a_SOURCES) $(rdd_copy_SOURCES) \ $(rdd_verify_SOURCES) DIST_SOURCES = $(librdd_a_SOURCES) $(rdd_copy_SOURCES) \ $(rdd_verify_SOURCES) man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBGLADE_CFLAGS = @LIBGLADE_CFLAGS@ LIBGLADE_LIBS = @LIBGLADE_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RDD_GUI_FALSE = @RDD_GUI_FALSE@ RDD_GUI_TRUE = @RDD_GUI_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ @GCC_COMPILER_FALSE@AM_CFLAGS = @GCC_COMPILER_TRUE@AM_CFLAGS = -pedantic -Wno-long-long -g3 -Wall -Wmissing-prototypes AM_LDFLAGS = -static noinst_LIBRARIES = librdd.a librdd_a_SOURCES = rdd.h rsysint.h \ strerror.c \ console.c error.h error.c \ rdd_internals.c rdd_internals.h \ commandline.c commandline.h \ md5.c md5.h \ sha1.c sha1.h \ outfile.h outfile.c \ numparser.h numparser.c \ alignedbuf.h alignedbuf.c \ writer.h writer.c \ zlibwriter.c fdwriter.c filewriter.c \ tcpwriter.c safewriter.c partwriter.c \ reader.h reader.c \ fdreader.c filereader.c atomicreader.c \ zlibreader.c faultyreader.c rawreader.c \ alignedreader.c \ filterset.h filterset.c \ filter.h filter.c \ md5streamfilter.c sha1streamfilter.c writestreamfilter.c \ statsblockfilter.c md5blockfilter.c checksumblockfilter.c \ verifyblockfilter.c \ copier.h copier.c robustcopier.c simplecopier.c \ progress.c progress.h \ msgprinter.h msgprinter.c stdioprinter.c fileprinter.c \ bcastprinter.c logprinter.c \ netio.c netio.h rdd_copy_SOURCES = rddcopy.c rdd_copy_LDADD = librdd.a rdd_verify_SOURCES = rddverify.c rdd_verify_LDADD = librdd.a man_MANS = rdd-copy.1 rdd-verify.1 EXTRA_DIST = $(man_MANS) rddi.py plot-entropy.py plot-md5.py all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) librdd.a: $(librdd_a_OBJECTS) $(librdd_a_DEPENDENCIES) -rm -f librdd.a $(librdd_a_AR) librdd.a $(librdd_a_OBJECTS) $(librdd_a_LIBADD) $(RANLIB) librdd.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) rdd-copy$(EXEEXT): $(rdd_copy_OBJECTS) $(rdd_copy_DEPENDENCIES) @rm -f rdd-copy$(EXEEXT) $(LINK) $(rdd_copy_LDFLAGS) $(rdd_copy_OBJECTS) $(rdd_copy_LDADD) $(LIBS) rdd-verify$(EXEEXT): $(rdd_verify_OBJECTS) $(rdd_verify_DEPENDENCIES) @rm -f rdd-verify$(EXEEXT) $(LINK) $(rdd_verify_LDFLAGS) $(rdd_verify_OBJECTS) $(rdd_verify_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alignedbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alignedreader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomicreader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bcastprinter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checksumblockfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copier.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faultyreader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdreader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdwriter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileprinter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filereader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filewriter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filterset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logprinter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5blockfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5streamfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msgprinter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/outfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/partwriter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawreader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdd_internals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rddcopy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rddverify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/robustcopier.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safewriter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1streamfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simplecopier.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statsblockfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdioprinter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpwriter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verifyblockfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/writer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/writestreamfilter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zlibreader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zlibwriter.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-man install-exec-am: install-binPROGRAMS install-exec-local install-info: install-info-am install-man: install-man1 installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-local \ uninstall-man uninstall-man: uninstall-man1 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-exec \ install-exec-am install-exec-local install-info \ install-info-am install-man install-man1 install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am \ uninstall-local uninstall-man uninstall-man1 install-exec-local: $(INSTALL) $(srcdir)/rddi.py $(bindir)/rddi $(INSTALL) $(srcdir)/plot-entropy.py $(bindir)/plot-entropy $(INSTALL) $(srcdir)/plot-md5.py $(bindir)/plot-md5 uninstall-local: rm -f $(bindir)/rddi rm -f $(bindir)/plot-entropy rm -f $(bindir)/plot-md5 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/rddcopy.c�����������������������������������������������������������������������������0100644�0000000�0000000�00000103601�10435007570�0013552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ /* * This program, rdd, copies data from one file to another. It is * more robust with respect to read errors than most Unix utilities. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <assert.h> #include <ctype.h> #include <errno.h> #include <limits.h> #include <stdarg.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include "rdd.h" #include "rdd_internals.h" /* PLEASE keep the includes for crypto.h and zlib.h in this * order (crypto.h first); zlib.h introduces a typedef (free_func) * that conflicts with a parameter name in crypto.h. This problem * occurs only in older versions. */ #if defined(HAVE_LIBCRYPTO) && defined(HAVE_OPENSSL_CRYPTO_H) #include <openssl/crypto.h> #endif #if defined(HAVE_LIBZ) #include <zlib.h> #else #error Sorry, need libz to compile #endif #include "numparser.h" #include "reader.h" #include "commandline.h" #include "error.h" #include "writer.h" #include "filter.h" #include "filterset.h" #include "copier.h" #include "netio.h" #include "progress.h" #include "msgprinter.h" #define DEFAULT_BLOCK_LEN 262144 /* bytes */ #define DEFAULT_MIN_BLOCK_SIZE 32768 /* bytes */ #define DEFAULT_HIST_BLOCK_SIZE 262144 /* bytes */ #define DEFAULT_CHKSUM_BLOCK_SIZE 32768 /* bytes */ #define DEFAULT_BLOCKMD5_SIZE 4096 /* bytes */ #define DEFAULT_NRETRY 1 #define DEFAULT_RECOVERY_LEN 4 /* read blocks */ #define DEFAULT_MAX_READ_ERR 0 /* 0 = infinity */ #define DEFAULT_RDD_SERVER_PORT 4832 #define RDD_MAX_DIGEST_LENGTH 20 /* bytes */ /* Mode bits */ typedef enum _rdd_copy_mode_t { RDD_LOCAL = 0x1, /* read file, write file */ RDD_CLIENT = 0x2, /* read file, write network */ RDD_SERVER = 0x4 /* read network, write file */ } rdd_copy_mode_t; #define ALL_MODES (RDD_LOCAL|RDD_CLIENT|RDD_SERVER) /* rdd's command-line arguments */ typedef struct _rdd_copy_opts { int compress; /* compression enabled? */ int quiet; /* batch mode (no questions)? */ char *infile; /* input file (source of copy) */ char *logfile; /* log file */ char *outpath; /* output file or its prefix */ char *simfile; /* read-fault simulation config file */ char *crc32file; /* output file for CRC32 checksums */ char *adler32file; /* output file for Adler32 checksums */ char *histfile; /* output file for histogram stats */ char *blockmd5file; /* output file for blockwise MD5 */ int verbose; /* Be verbose? */ int raw; /* Reading from a raw device? */ unsigned mode; /* local, client, or server mode */ int inetd; /* read from file desc. 0? */ char *server_host; /* host name of rdd server */ unsigned server_port; /* TCP port of rdd server */ int force_overwrite; /* output overwrites existing files */ int md5; /* MD5-hash all data? */ int sha1; /* SHA1-hash all data? */ unsigned nretry; /* Max. # read retries for bad blocks */ rdd_count_t blocklen; /* default copy-block size */ rdd_count_t adler32len; /* block size for Adler32 */ rdd_count_t crc32len; /* block size for CRC32 */ rdd_count_t histblocklen; /* histogramming block size */ rdd_count_t blockmd5len; /* block size for block-wise MD5 */ rdd_count_t minblocklen; /* unit of data loss */ rdd_count_t offset; /* start copying here */ rdd_count_t count; /* copy this many bytes */ rdd_count_t splitlen; /* create new output file every splitlen bytes */ rdd_count_t progresslen; /* progress reporting interval (s) */ rdd_count_t max_read_err; /* Max. # read errors allowed */ } rdd_copy_opts; static rdd_copy_opts opts; static char* usage_message = "\n" "\trdd-copy [local options] infile [outfile]\n" "\trdd-copy -C [client options] <local file> <remote file>\n" "\trdd-copy -S [server options]\n"; static RDD_OPTION opttab[] = { {"-?", "--help", 0, ALL_MODES, "Print this message", 0, 0}, {"-C", "--client", 0, 0, "Run rdd as a network client", 0, 0}, {"-F", "--fault-simulation", "<file>", RDD_LOCAL|RDD_CLIENT, "simulate read errors specified in <file>", 0, 0}, {"-M", "--max-read-err", "<count>", RDD_LOCAL|RDD_CLIENT, "Give up after <count> read errors", 0, 0}, {"-P", "--progress", "<sec>", ALL_MODES, "Report progress every <sec> seconds", 0, 0}, {"-S", "--server", 0, 0, "Run rdd as a network server", 0, 0}, {"-V", "--version", 0, ALL_MODES, "Report version number and exit", 0, 0}, {"-b", "--block-size", "<count>[kKmMgG]", RDD_LOCAL|RDD_CLIENT, "Read blocks of <count> [KMG]byte at a time", 0, 0}, {"-c", "--count", "<count>[kKmMgG]", ALL_MODES, "Read at most <count> [KMG]bytes", 0, 0}, {"-f", "--force", 0, RDD_LOCAL|RDD_SERVER, "Ruthlessly overwrite existing files", 0, 0}, {"-i", "--inetd", 0, RDD_SERVER, "rdd is started by (x)inetd", 0, 0}, {"-l", "--log-file", "<file>", ALL_MODES, "Log messages in <file>", 0, 0}, {"-m", "--min-block-size", "<count>[kKmMgK]", RDD_LOCAL|RDD_CLIENT, "Minimum read-block size is <count> [KMG]byte", 0, 0}, {"-n", "--nretry", "<count>", RDD_LOCAL|RDD_CLIENT, "Retry failed reads <count> times", 0, 0}, {"-o", "--offset", "<count>[kKmMgG]", ALL_MODES, "Skip <count> [KMG] input bytes", 0, 0}, {"-p", "--port", "<portnum>", RDD_CLIENT|RDD_SERVER, "Set server port to <port>", 0, 0}, {"-q", "--quiet", 0, ALL_MODES, "Do not ask questions", 0, 0}, {"-r", "--raw", 0, RDD_LOCAL|RDD_CLIENT, "Read from a raw device (/dev/raw/raw[0-9])", 0, 0}, {"-s", "--split", "<count>[kKmMgG]", RDD_LOCAL|RDD_CLIENT, "Split output, all files < <count> [KMG]bytes", 0, 0}, {"-v", "--verbose", 0, ALL_MODES, "Be verbose", 0, 0}, {"-z", "--compress", 0, RDD_CLIENT, "Compress data sent across the network", 0, 0}, {"-H", "--histogram", "<file>", ALL_MODES, "Store histogram-derived stats in <file>", 0, 0}, {"-h", "--histogram-block-size", "<size>", ALL_MODES, "Histogramming block size", 0, 0}, {"--checksum", "--adler32", "<file>", ALL_MODES, "Compute and store Adler32 checksums in <file>", 0, 0}, {"--checksum-block-size", "--adler32-block-size", "<size>", ALL_MODES, "Adler32 uses <size>-byte blocks", 0, 0}, {"--crc32", "--crc32", "<file>", ALL_MODES, "Compute and store CRC32 checksums in <file>", 0, 0}, {"--crc32-block-size", "--crc32-block-size", "<size>", ALL_MODES, "CRC32 uses <size>-byte blocks", 0, 0}, {"--md5", "--md5", 0, ALL_MODES, "Compute and print MD5 hash", 0, 0}, {"--sha", "--sha1", 0, ALL_MODES, "Compute and print SHA1 hash", 0, 0}, {"--block-md5-size", "--block-md5-size", "<size>", ALL_MODES, "block-wise MD5 block size", 0, 0}, {"--block-md5", "--block-md5", "<file>", ALL_MODES, "Store block-wise MD5 hash values in <file>", 0, 0}, {0, 0, 0, 0, 0, 0, 0} /* sentinel */ }; static RDD_MSGPRINTER *the_printer; static void fatal_rdd_error(int rdd_errno, char *fmt, ...) { va_list ap; va_start(ap, fmt); rdd_mp_vrddmsg(the_printer, RDD_MSG_ERROR, rdd_errno, fmt, ap); va_end(ap); exit(EXIT_FAILURE); } static void logmsg(const char *fmt, ...) { va_list ap; va_start(ap, fmt); rdd_mp_vmessage(the_printer, RDD_MSG_INFO, fmt, ap); va_end(ap); } /* Wrappers around the number-parsing routines. */ static rdd_count_t scan_size(char *str, unsigned flags) { rdd_count_t sz; int rc; if ((rc = rdd_parse_bignum((const char *) str, flags, &sz)) != RDD_OK) { fatal_rdd_error(rc, "bad number %s", str); } return sz; } static unsigned scan_uint(char *str) { unsigned n; int rc; if ((rc = rdd_parse_uint((const char *) str, &n)) != RDD_OK) { fatal_rdd_error(rc, "%s", str); } return n; } static unsigned scan_tcp_port(char *str) { unsigned port; int rc; if ((rc = rdd_parse_tcp_port((const char *) str, &port)) != RDD_OK) { fatal_rdd_error(rc, "%s", str); } return port; } static void init_options(void) { memset(&opts, 0, sizeof opts); opts.mode = RDD_LOCAL; opts.server_port = DEFAULT_RDD_SERVER_PORT; opts.nretry = DEFAULT_NRETRY; opts.max_read_err = DEFAULT_MAX_READ_ERR; opts.blocklen = DEFAULT_BLOCK_LEN; opts.minblocklen = DEFAULT_MIN_BLOCK_SIZE; opts.histblocklen = DEFAULT_HIST_BLOCK_SIZE; opts.adler32len = DEFAULT_CHKSUM_BLOCK_SIZE; opts.crc32len = DEFAULT_CHKSUM_BLOCK_SIZE; opts.blockmd5len = DEFAULT_BLOCKMD5_SIZE; } /* Split host.dom.topdom:/tmp/d.img in host.dom.topdom and /tmp/d.img */ static void split_host_file(const char *host_file, char **host, char **file) { char *p; const char *h; const char *f; int hlen, flen; p = strchr(host_file, ':'); if (p == 0) { /* no ':' in host_file */ h = "localhost"; hlen = strlen(h); f = host_file; flen = strlen(f); } else if (p == host_file) { /* host_file starts with ':' */ h = "localhost"; hlen = strlen(h); f = p + 1; flen = strlen(f); } else { h = host_file; hlen = p - host_file; f = p + 1; flen = strlen(f); } if (flen == 0) { error("missing file name in target %s", host_file); } *host = rdd_malloc(hlen + 1); memcpy(*host, h, hlen); (*host)[hlen] = '\000'; *file = rdd_malloc(flen + 1); memcpy(*file, f, flen); (*file)[flen] = '\000'; } static void process_options(void) { char *arg; if (rdd_opt_set("help")) rdd_opt_usage(); if (rdd_opt_set("version")) { fprintf(stdout, "%s version %s\n", PACKAGE, VERSION); exit(EXIT_SUCCESS); } opts.compress = rdd_opt_set("compress"); opts.quiet = rdd_opt_set("quiet"); rdd_set_quiet(opts.quiet); #if !defined(HAVE_LIBZ) error("rdd not configured with compression support"); #endif opts.raw = rdd_opt_set("raw"); #if !defined(__linux) || !defined(RDD_RAW) if (opts.raw) { error("rdd not configured with raw-device support"); } #endif opts.inetd = rdd_opt_set("inetd"); opts.verbose = rdd_opt_set("verbose"); opts.raw = rdd_opt_set("raw"); if (opts.raw && opts.mode == RDD_SERVER) { error("raw-device input cannot be used in server mode"); } opts.md5 = rdd_opt_set("md5"); opts.sha1 = rdd_opt_set("sha1"); opts.force_overwrite = rdd_opt_set("force"); if (rdd_opt_set_arg("fault-simulation", &arg)) { opts.simfile = arg; } if (rdd_opt_set_arg("log-file", &arg)) { opts.logfile = arg; } if (rdd_opt_set_arg("adler32", &arg)) { opts.adler32file = arg; } if (rdd_opt_set_arg("adler32-block-size", &arg)) { opts.adler32len= scan_size(arg, RDD_POSITIVE); if (opts.adler32file == 0) { error("missing Adler-32 output file name " "(use --adler32)"); } } if (rdd_opt_set_arg("crc32", &arg)) { opts.crc32file = arg; } if (rdd_opt_set_arg("crc32-block-size", &arg)) { opts.crc32len= scan_size(arg, RDD_POSITIVE); if (opts.crc32file == 0) { error("missing CRC-32 output file name " "(use --crc32)"); } } if (rdd_opt_set_arg("histogram", &arg)) { opts.histfile = arg; } if (rdd_opt_set_arg("histogram-block-size", &arg)) { opts.histblocklen = scan_size(arg, RDD_POSITIVE); if (opts.histfile == 0) { error("missing histogram output file name " "(use --histogram)"); } } if (rdd_opt_set_arg("block-md5", &arg)) { opts.blockmd5file = arg; } if (rdd_opt_set_arg("block-md5-size", &arg)) { opts.blockmd5len = scan_size(arg, RDD_POSITIVE); if (opts.blockmd5file == 0) { error("missing block-MD5 output file name " "(use --block-md5)"); } } if (rdd_opt_set_arg("progress", &arg)) { opts.progresslen = scan_uint(arg); } if (rdd_opt_set_arg("nretry", &arg)) { opts.nretry = scan_uint(arg); } if (rdd_opt_set_arg("block-size", &arg)) { opts.blocklen = scan_size(arg, RDD_POSITIVE); } if (rdd_opt_set_arg("min-block-size", &arg)) { opts.minblocklen = scan_size(arg, RDD_POSITIVE); } if (rdd_opt_set_arg("offset", &arg)) { opts.offset = scan_size(arg, 0); } if (rdd_opt_set_arg("count", &arg)) { opts.count = scan_size(arg, RDD_POSITIVE); } if (rdd_opt_set_arg("max-read-err", &arg)) { opts.max_read_err = scan_uint(arg); } if (rdd_opt_set_arg("split", &arg)) { opts.splitlen = scan_size(arg, 0); } if (rdd_opt_set_arg("port", &arg)) { opts.server_port = scan_tcp_port(arg); } } static void command_line(int argc, char **argv) { RDD_OPTION *od; unsigned i; char *opt; char *arg; /* Rdd operates in one of three modes (RDD_LOCAL, RDD_CLIENT, RDD_SERVER). * The mode is determined by argv[1]: -C, -S, or something else. */ i = 1; opts.mode = RDD_LOCAL; if (argc > 1) { if (streq(argv[i], "-C") || streq(argv[i], "--client")) { opts.mode = RDD_CLIENT; i++; } else if (streq(argv[i], "-S") || streq(argv[i], "--server")) { opts.mode = RDD_SERVER; i++; } } /* Collect all other options and their arguments (if any). */ for (; i < (unsigned) argc; i++) { if ((od = rdd_get_opt_with_arg(argv, argc, &i, &opt, &arg)) == 0) { break; } /* Check whether the option is allowed in the current rdd mode. */ if (! flag_set(od->valid_modes, opts.mode)) { error("option %s not valid in %s mode", opt, opts.mode == RDD_LOCAL ? "local" : opts.mode == RDD_CLIENT ? "client" : opts.mode == RDD_SERVER ? "server": "unknown"); } } process_options(); /* Figure out the names of the input and output file (if any). */ switch (opts.mode) { case RDD_LOCAL: if (argc - i == 1) { opts.infile = argv[i++]; } else if (argc - i == 2) { opts.infile = argv[i++]; opts.outpath = argv[i++]; } else { rdd_opt_usage(); } break; case RDD_CLIENT: if (argc - i == 2) { opts.infile = argv[i++]; split_host_file(argv[i++], &opts.server_host, &opts.outpath); } else { rdd_opt_usage(); } break; case RDD_SERVER: if (argc - i != 0) { rdd_opt_usage(); } break; } /* Artificial Intelligence */ if (rdd_opt_set("block-size") && !rdd_opt_set("min-block-size") && opts.blocklen < opts.minblocklen) { opts.minblocklen = opts.blocklen; } /* Sanity checks. */ if (opts.blocklen >= (rdd_count_t) INT_MAX) { error("block size (%llu) too large (larger than INT_MAX)", opts.blocklen); } if (opts.minblocklen > opts.blocklen) { error("minimum block length (%llu) cannot exceed " "block length (%llu)", opts.minblocklen, opts.blocklen); } if (opts.splitlen > 0 && opts.splitlen < opts.blocklen) { error("split size (%llu) must be larger than or " "equal to block size (%llu)", opts.splitlen, opts.blocklen); } if (opts.splitlen > 0 && opts.outpath == 0) { error("--split requires an output file name"); } } static RDD_READER * open_disk_input(rdd_count_t *inputlen) { RDD_READER *reader = 0; int rc; rc = rdd_open_file_reader(&reader, opts.infile, opts.raw); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot open %s", opts.infile); } if ((rc = rdd_reader_seek(reader, 0)) != RDD_OK) { fatal_rdd_error(rc, "cannot seek on %s", opts.infile); } if (opts.raw) { rc = rdd_open_aligned_reader(&reader, reader, RDD_SECTOR_SIZE); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot open %s for aligned access", opts.infile); } } *inputlen = RDD_WHOLE_FILE; if ((rc = rdd_device_size(opts.infile, inputlen)) != RDD_OK) { fatal_rdd_error(rc, "%s: cannot determine device size", opts.infile); } if (opts.simfile != 0) { rc = rdd_open_faulty_reader(&reader, reader, opts.simfile); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot initialize fault simulator"); } } return reader; } static RDD_READER * open_net_input(rdd_count_t *inputlen) { RDD_READER *reader = 0; int server_sock = -1; unsigned flags; int fd = -1; int rc; *inputlen = RDD_WHOLE_FILE; /* In server mode, we read from the network */ if (opts.inetd) { /* started by (x)inetd */ fd = STDIN_FILENO; } else { rc = rdd_init_server(the_printer, opts.server_port, &server_sock); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot start rdd-copy server"); } rc = rdd_await_connection(the_printer, server_sock, &fd); if (rc != RDD_OK) { fatal_rdd_error(rc, "no connection"); } } rc = rdd_open_fd_reader(&reader, fd); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot open reader on server socket"); } rc = rdd_recv_info(reader, &opts.outpath, inputlen, &opts.blocklen, &opts.splitlen, &flags); if (rc != RDD_OK) { fatal_rdd_error(rc, "bad client request"); } if (opts.verbose) { logmsg("Received rdd request:"); logmsg("\tfile name: %s", opts.outpath); logmsg("\tfile size: %s", rdd_strsize(*inputlen)); logmsg("\tblock size: %llu", opts.blocklen); logmsg("\tsplit size: %llu", opts.splitlen); } #if defined(DEBUG) logmsg("file=%s size=%llu bsize=%llu splitsize=%llu", opts.outpath, rdd_strsize(*filelen), *blocklen, *splitlen); #endif if ((flags & RDD_NET_COMPRESS) != 0) { if ((rc = rdd_open_zlib_reader(&reader, reader)) != RDD_OK) { fatal_rdd_error(rc, "cannot open zlib reader"); } } return reader; } /* Creates a reader stack that corresponds to the user's options. */ static RDD_READER * open_input(rdd_count_t *inputlen) { if (opts.mode == RDD_SERVER) { return open_net_input(inputlen); } else { return open_disk_input(inputlen); } } static RDD_WRITER * open_disk_output(rdd_count_t outputsize) { RDD_WRITER *writer = 0; rdd_write_mode_t wrmode; int rc; if (opts.outpath == 0) return 0; wrmode = (opts.force_overwrite ? RDD_OVERWRITE_ASK : RDD_NO_OVERWRITE); if (strcmp(opts.outpath, "-") == 0) { if (opts.splitlen > 0) { error("cannot split standard output stream"); } rc = rdd_open_fd_writer(&writer, STDOUT_FILENO); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot write to standard output?"); } } else if (opts.splitlen > 0) { rc = rdd_open_part_writer(&writer, opts.outpath, outputsize, opts.splitlen, wrmode); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot open multipart output file"); } } else { rc = rdd_open_safe_writer(&writer, opts.outpath, wrmode); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot open output file %s", opts.outpath); } } return writer; } static RDD_WRITER * open_net_output(rdd_count_t outputsize) { RDD_WRITER *writer = 0; unsigned flags = 0; int rc; char *server = opts.server_host; unsigned port = opts.server_port; assert(opts.outpath != 0); rc = rdd_open_tcp_writer(&writer, server, port); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot connect to %s:%u", server, port); } flags = (opts.compress ? RDD_NET_COMPRESS : 0); rc = rdd_send_info(writer, opts.outpath, outputsize, opts.blocklen, opts.splitlen, flags); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot send header to %s:%u", server, port); } if (opts.compress) { /* Stack a zlib writer on top of the TCP writer. */ rc = rdd_open_zlib_writer(&writer, writer); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot compress network traffic " "to %s:%u", server, port); } } return writer; } /** Creates a writer stack that corresponds to the user's options. * The outputsize argument contains the size of the output in * bytes if that size is known or RDD_WHOLE_FILE if is not known. */ static RDD_WRITER * open_output(rdd_count_t outputsize) { if (opts.mode == RDD_CLIENT) { return open_net_output(outputsize); } else { return open_disk_output(outputsize); } } static void open_logfile(void) { RDD_MSGPRINTER *log_printer = 0; RDD_MSGPRINTER *bcast_printer = 0; RDD_MSGPRINTER *printers[2]; unsigned nprinter = 0; int rc = RDD_OK; /* Keep the current (stderr) printer only if the user * specified the verbose flag or if the user did not * specify a log file. */ if (the_printer != 0 && (opts.verbose || opts.logfile == 0)) { printers[nprinter++] = the_printer; } /* If the user specified a log file then create a printer for * it and add that printer to the printer list. */ if (opts.logfile != 0) { rc = rdd_mp_open_file_printer(&log_printer, opts.logfile); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot open log file (%s)", opts.logfile); } rc = rdd_mp_open_log_printer(&log_printer, log_printer); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot stack log printer"); } printers[nprinter++] = log_printer; } /* Create a broadcast printer and make it the current printer. */ rc = rdd_mp_open_bcast_printer(&bcast_printer, nprinter, printers); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot open bcast printer"); } the_printer = bcast_printer; } static void close_printer(void) { int rc; if (the_printer == 0) return; rc = rdd_mp_close(the_printer, RDD_MP_RECURSE|RDD_MP_READONLY); if (rc != RDD_OK) { /* Cannot trust the_printer any more... */ fprintf(stderr, "cannot close message printer\n"); exit(EXIT_FAILURE); } the_printer = 0; } #define bool2str(b) ((b) ? "yes" : "no") #define str2str(s) ((s) == 0? "<none>" : (s)) static void log_header(char **argv, int argc) { char cmdline[1024]; char *p; int i; logmsg(""); logmsg("%s", rdd_ctime()); logmsg("%s version %s", PACKAGE, VERSION); logmsg("Copyright (c) 2002 Nederlands Forensisch Instituut"); #if defined(__linux) && defined(RDD_RAW) logmsg("Compile-time flag RDD_RAW is set"); #endif #if defined(RDD_TRACE) logmsg("Compile-time flag RDD_TRACE is set"); #endif #if defined(HAVE_LIBZ) logmsg("zlib version %s", zlibVersion()); logmsg("Copyright (c) 1995-2002 Jean-loup Gailly and Mark Adler"); #endif #if defined(HAVE_LIBCRYPTO) logmsg("openssl version %s", OPENSSL_VERSION_TEXT); logmsg("Copyright (c) 1995-1998 Eric Young"); #else logmsg("NOT using openssl"); #endif p = cmdline; snprintf(p, sizeof cmdline, "%s", argv[0]); cmdline[(sizeof cmdline) - 1] = '\000'; p += strlen(argv[0]); for (i = 1; i < argc; i++) { snprintf(p, (sizeof cmdline) - (p - cmdline), " %s", argv[i]); cmdline[(sizeof cmdline) - 1] = '\000'; p += 1 + strlen(argv[i]); } logmsg("%s", cmdline); } static void log_params(rdd_copy_opts *opts) { logmsg("========== Parameter settings =========="); logmsg("mode: %s", opts->mode == RDD_LOCAL ? "local" : opts->mode == RDD_CLIENT ? "client" : "server"); logmsg("verbose: %s", bool2str(opts->verbose)); logmsg("quiet: %s", bool2str(opts->quiet)); logmsg("server host: %s", str2str(opts->server_host)); logmsg("server port: %u", opts->server_port); logmsg("input file: %s", str2str(opts->infile)); logmsg("log file: %s", str2str(opts->logfile)); logmsg("output file: %s", str2str(opts->outpath)); logmsg("CRC32 file: %s", str2str(opts->crc32file)); logmsg("Adler32 file: %s", str2str(opts->adler32file)); logmsg("Statistics file: %s", str2str(opts->histfile)); logmsg("Block MD5 file: %s", str2str(opts->blockmd5file)); logmsg("raw-device input: %s", bool2str(opts->raw)); logmsg("compress network data: %s", bool2str(opts->compress)); logmsg("use (x)inetd: %s", bool2str(opts->inetd)); logmsg("force overwrite: %s", bool2str(opts->force_overwrite)); logmsg("compute MD5: %s", bool2str(opts->md5)); logmsg("compute SHA1: %s", bool2str(opts->sha1)); logmsg("max #retries: %u", opts->nretry); logmsg("block size: %llu", opts->blocklen); logmsg("minimum block size: %llu", opts->minblocklen); logmsg("Adler32 block size: %llu", opts->adler32len); logmsg("CRC32 block size: %llu", opts->crc32len); logmsg("statistics block size: %llu", opts->histblocklen); logmsg("MD5 block size: %llu", opts->blockmd5len); logmsg("input offset: %llu", opts->offset); logmsg("input count: %llu", opts->count); logmsg("segment size: %llu", opts->splitlen); logmsg("progress reporting interval: %llu", opts->progresslen); logmsg("max #errors to tolerate: %llu", opts->max_read_err); logmsg("========================================"); logmsg(""); } static void handle_read_error(rdd_count_t offset, unsigned nbyte, void *env) { logmsg("read error: offset %llu bytes, count %u bytes", offset, nbyte); } static void handle_substitution(rdd_count_t offset, unsigned nbyte, void *env) { logmsg("input dropped: offset %llu bytes, count %u bytes", offset, nbyte); } static int handle_progress(rdd_count_t pos, void *env) { RDD_PROGRESS *p = (RDD_PROGRESS *) env; RDD_PROGRESS_INFO info; double megabytes_per_sec; double gigabytes_done; double perc_done; #if 0 double secs_left; #endif int rc; if ((rc = rdd_progress_update(p, pos)) != RDD_OK) { fatal_rdd_error(rc, "cannot update progress object"); } rc = rdd_progress_poll(p, &info); if (rc == RDD_EAGAIN) { return RDD_OK; } else if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot obtain progress information"); } /* The poll succeeded. Print progress information. */ gigabytes_done = (double) info.pos / (double) (1 << 30); megabytes_per_sec = info.speed / (double) (1 << 20); if (info.fraction >= 0.0) { /* If we know the input size, we can give a more * detailed progress report. */ perc_done = 100.0 * info.fraction; #if 0 secs_left = ((double)(p->input_size - pos)) / speed; #endif fprintf(stderr, "%.3f GB done (%6.2f%%), " "average speed %.3f MB/s " #if 0 "(%.0f seconds remaining)" #endif "\n", gigabytes_done, perc_done, megabytes_per_sec #if 0 , secs_left #endif ); } else { /* Unknown input size, so we cannot make any * predictions. */ fprintf(stderr, "%.3f GB done, average speed %.3f MB/s\n", gigabytes_done, megabytes_per_sec); } return RDD_OK; } static void add_filter(RDD_FILTERSET *fset, const char *name, RDD_FILTER *f) { int rc; if ((rc = rdd_fset_add(fset, name, f)) != RDD_OK) { fatal_rdd_error(rc, "cannot install %s filter", name); } } static void install_filters(RDD_FILTERSET *fset, RDD_WRITER *writer) { RDD_FILTER *f = 0; int rc; if ((rc = rdd_fset_init(fset)) != RDD_OK) { fatal_rdd_error(rc, "cannot create filter fset"); } if (writer != 0) { rc = rdd_new_write_streamfilter(&f, writer); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot create write filter"); } add_filter(fset, "write", f); } if (opts.md5) { rc = rdd_new_md5_streamfilter(&f); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot create MD5 filter"); } add_filter(fset, "MD5 stream", f); } if (opts.sha1) { rc = rdd_new_sha1_streamfilter(&f); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot create SHA-1 filter"); } add_filter(fset, "SHA-1 stream", f); } if (opts.blockmd5file != 0) { rc = rdd_new_md5_blockfilter(&f, opts.blockmd5len, opts.blockmd5file, opts.force_overwrite); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot create MD5 block filter"); } add_filter(fset, "MD5 block", f); } if (opts.histfile != 0) { rc = rdd_new_stats_blockfilter(&f, opts.histblocklen, opts.histfile, opts.force_overwrite); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot create statistics filter"); } add_filter(fset, "statistical block", f); } if (opts.adler32file != 0) { rc = rdd_new_adler32_blockfilter(&f, opts.adler32len, opts.adler32file, opts.force_overwrite); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot create Adler32 filter"); } add_filter(fset, "Adler32 block", f); } if (opts.crc32file != 0) { rc = rdd_new_crc32_blockfilter(&f, opts.crc32len, opts.crc32file, opts.force_overwrite); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot create CRC-32 filter"); } add_filter(fset, "CRC-32 block", f); } } static RDD_COPIER * create_copier(rdd_count_t input_size, RDD_PROGRESS *progress) { RDD_COPIER *copier = 0; rdd_count_t count = 0; int rc; /* Process the offset option. */ if (opts.offset > input_size) { error("offset %llu larger than input file size (%s)", opts.offset, rdd_strsize(input_size)); } /* Process the count option. */ if (input_size == RDD_WHOLE_FILE) { count = RDD_WHOLE_FILE; } else { count = input_size - opts.offset; } if (opts.count > 0) { if (opts.count <= count) { count = opts.count; /* Use user-specified count */ } else { logmsg("User count (%llu) too large; ignored", opts.count); } } if (opts.verbose) { logmsg("input size: %s", rdd_strsize(input_size)); logmsg("read size: %s", rdd_strsize(count)); } if (opts.mode == RDD_SERVER) { RDD_SIMPLE_PARAMS p; memset(&p, 0, sizeof p); if (progress != 0) { p.progressfun = handle_progress; p.progressenv = progress; } rc = rdd_new_simple_copier(&copier, &p); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot create simple copier"); } } else { RDD_ROBUST_PARAMS p; memset(&p, 0, sizeof p); p.minblocklen = opts.minblocklen; p.maxblocklen = opts.blocklen; p.nretry = opts.nretry; p.maxsubst = opts.max_read_err; p.readerrfun = handle_read_error; p.substfun = handle_substitution; if (progress != 0) { p.progressfun = handle_progress; p.progressenv = progress; } rc = rdd_new_robust_copier(&copier, opts.offset, count, &p); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot create robust copier"); } } return copier; } static void log_hash_result(RDD_FILTERSET *fset, const char *hash_name, const char *filter_name, unsigned mdsize) { unsigned char md[RDD_MAX_DIGEST_LENGTH]; char hexdigest[2*RDD_MAX_DIGEST_LENGTH + 1]; RDD_FILTER *f = 0; int rc; memset(md, 0, mdsize); if (mdsize > (sizeof md)) { fatal_rdd_error(RDD_ESPACE, "digest size exceeds buffer size"); } if ((rc = rdd_fset_get(fset, filter_name, &f)) != RDD_OK) { fatal_rdd_error(rc, "cannot find %s filter", filter_name); } if ((rc = rdd_filter_get_result(f, md, mdsize)) != RDD_OK) { fatal_rdd_error(rc, "cannot get result for %s filter", filter_name); } rc = rdd_buf2hex(md, mdsize, hexdigest, sizeof hexdigest); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot convert binary digest"); } logmsg("%s: %s", hash_name, hexdigest); } int main(int argc, char **argv) { double start, end; RDD_READER *reader; RDD_WRITER *writer; RDD_PROGRESS progress; RDD_COPIER_RETURN copier_ret; RDD_COPIER *copier; RDD_FILTERSET filterset; RDD_MSGPRINTER *printer = 0; rdd_count_t input_size; int rc; set_progname(argv[0]); rdd_cons_open(); rdd_init(); /* Setup initial printer (stderr). */ rc = rdd_mp_open_stdio_printer(&printer, stderr); if (rc != RDD_OK) { fprintf(stderr, "cannot open stderr message printer\n"); exit(EXIT_FAILURE); } #if 0 rc = rdd_mp_open_log_printer(&printer, printer); if (rc != RDD_OK) { exit(EXIT_FAILURE); } #endif the_printer = printer; init_options(); rdd_opt_init(opttab, usage_message); command_line(argc, argv); open_logfile(); rdd_catch_signals(); log_header(argv, argc); log_params(&opts); if (!opts.md5 && !opts.sha1) { rdd_quit_if(RDD_NO, "Continue without hashing (yes/no)?"); } if (opts.logfile == 0) { rdd_quit_if(RDD_NO, "Continue without logging (yes/no)?"); } reader = open_input(&input_size); writer = open_output(RDD_WHOLE_FILE); install_filters(&filterset, writer); if (opts.progresslen > 0) { rc = rdd_progress_init(&progress, input_size, opts.progresslen); if (rc != RDD_OK) { fatal_rdd_error(rc, "cannot initialize progress object"); } copier = create_copier(input_size, &progress); } else { copier = create_copier(input_size, 0); } start = rdd_gettime(); rc = rdd_copy_exec(copier, reader, &filterset, &copier_ret); if (rc != RDD_OK) { fatal_rdd_error(rc, "copy failed"); } end = rdd_gettime(); rdd_mp_message(the_printer, RDD_MSG_INFO, "=== done ***"); rdd_mp_message(the_printer, RDD_MSG_INFO, "seconds: %.3f", end - start); rdd_mp_message(the_printer, RDD_MSG_INFO, "bytes written: %llu", copier_ret.nbyte); rdd_mp_message(the_printer, RDD_MSG_INFO, "bytes lost: %llu", copier_ret.nlost); rdd_mp_message(the_printer, RDD_MSG_INFO, "read errors: %lu", copier_ret.nread_err); rdd_mp_message(the_printer, RDD_MSG_INFO, "zero-block substitutions: " "%lu", copier_ret.nsubst); if (opts.md5) { log_hash_result(&filterset, "MD5", "MD5 stream", 16); } else { logmsg("MD5: <none>"); } if (opts.sha1) { log_hash_result(&filterset, "SHA-1", "SHA-1 stream", 20); } else { logmsg("SHA1: <none>"); } if ((rc = rdd_copy_free(copier)) != RDD_OK) { fatal_rdd_error(rc, "cannot clean up copier"); } if ((rc = rdd_fset_clear(&filterset)) != RDD_OK) { fatal_rdd_error(rc, "cannot clean up filters"); } if (writer != 0) { if ((rc = rdd_writer_close(writer)) != RDD_OK) { fatal_rdd_error(rc, "cannot clean up writer"); } } if ((rc = rdd_reader_close(reader, 1)) != RDD_OK) { fatal_rdd_error(rc, "cannot clean up reader"); } close_printer(); if (copier_ret.nread_err > 0) { logmsg("%u read errors occurred", copier_ret.nread_err); exit(EXIT_FAILURE); } logmsg("no read errors"); rdd_cons_close(); return 0; } �������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/bcastprinter.c������������������������������������������������������������������������0100644�0000000�0000000�00000006740�10421731112�0014603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <string.h> #include "rdd.h" #include "rdd_internals.h" #include "msgprinter.h" typedef struct _RDD_BCAST_MSGPRINTER { unsigned nprinter; RDD_MSGPRINTER **printers; } RDD_BCAST_MSGPRINTER; static void bcast_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg); static int bcast_close(RDD_MSGPRINTER *printer, unsigned flags); static RDD_MSGPRINTER_OPS bcast_ops = { bcast_print, bcast_close }; int rdd_mp_open_bcast_printer(RDD_MSGPRINTER **printer, unsigned nprinter, RDD_MSGPRINTER **printers) { RDD_BCAST_MSGPRINTER *bcast = 0; RDD_MSGPRINTER **printertab = 0; RDD_MSGPRINTER *p = 0; int rc = RDD_OK; unsigned i; *printer = 0; printertab = malloc(nprinter * sizeof(RDD_MSGPRINTER *)); if (printertab == 0) { rc = RDD_NOMEM; goto error; } for (i = 0; i < nprinter; i++) { printertab[i] = printers[i]; } rc = rdd_mp_open_printer(&p, &bcast_ops, sizeof(RDD_BCAST_MSGPRINTER)); if (rc != RDD_OK) { goto error; } bcast = (RDD_BCAST_MSGPRINTER *) p->state; bcast->nprinter = nprinter; bcast->printers = printertab; *printer = p; return RDD_OK; error: *printer = 0; if (printertab != 0) free(printertab); return rc; } static void bcast_print(RDD_MSGPRINTER *printer, rdd_message_t type, int errcode, const char *msg) { RDD_BCAST_MSGPRINTER *bcast = (RDD_BCAST_MSGPRINTER *) printer->state; unsigned i; for (i = 0; i < bcast->nprinter; i++) { rdd_mp_message(bcast->printers[i], type, "%s", msg); } } static int bcast_close(RDD_MSGPRINTER *printer, unsigned flags) { RDD_BCAST_MSGPRINTER *bcast = (RDD_BCAST_MSGPRINTER *) printer->state; unsigned i; int rc; if ((flags & RDD_MP_RECURSE) != 0) { for (i = 0; i < bcast->nprinter; i++) { rc = rdd_mp_close(bcast->printers[i], flags); if (rc != RDD_OK) { return rc; } } } free(bcast->printers); memset(bcast, 0, sizeof *bcast); return RDD_OK; } ��������������������������������rdd-2.0.7/src/filereader.c��������������������������������������������������������������������������0100644�0000000�0000000�00000004105�10421731112�0014176�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <unistd.h> #include <fcntl.h> #include "rdd.h" #include "reader.h" int rdd_open_file_reader(RDD_READER **r, const char *path, int raw) { int fd = -1; if ((fd = open(path, O_RDONLY)) < 0) { return RDD_EOPEN; } if (raw) { return rdd_open_raw_reader(r, fd); } else { return rdd_open_fd_reader(r, fd); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/md5blockfilter.c����������������������������������������������������������������������0100644�0000000�0000000�00000011537�10435007212�0015013�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "rdd.h" #include "rdd_internals.h" #include <math.h> #include <string.h> #include <stdio.h> #if defined(HAVE_LIBCRYPTO) && defined(HAVE_OPENSSL_MD5_H) && defined(HAVE_OPENSSL_SHA_H) #include <openssl/md5.h> #include <openssl/sha.h> #else /* Use local versions to allow stand-alone compilation. */ #include "md5.h" #include "sha1.h" #endif /* HAVE_LIBCRYPTO */ #include "error.h" #include "writer.h" #include "filter.h" #include "msgprinter.h" typedef struct _RDD_BLOCKHASH_FILTER { rdd_count_t blocknum; MD5_CTX md5_state; char *path; RDD_MSGPRINTER *printer; } RDD_BLOCKHASH_FILTER; static int blockhash_input(RDD_FILTER *f, const unsigned char *buf, unsigned nbyte); static int blockhash_block(RDD_FILTER *f, unsigned nbyte); static int blockhash_close(RDD_FILTER *f); static int blockhash_free(RDD_FILTER *f); static RDD_FILTER_OPS blockhash_ops = { blockhash_input, blockhash_block, blockhash_close, 0, blockhash_free }; int rdd_new_md5_blockfilter(RDD_FILTER **self, unsigned blocksize, const char *outpath, int force_overwrite) { RDD_FILTER *f = 0; RDD_BLOCKHASH_FILTER *state = 0; RDD_MSGPRINTER *prn = 0; char *path = 0; int rc; rc = rdd_new_filter(&f, &blockhash_ops, sizeof(RDD_BLOCKHASH_FILTER), blocksize); if (rc != RDD_OK) { goto error; } state = (RDD_BLOCKHASH_FILTER *)f->state; if ((path = malloc(strlen(outpath) + 1)) == 0) { rc = RDD_NOMEM; goto error; } strcpy(path, outpath); if ((rc = rdd_mp_open_file_printer(&prn, outpath)) != RDD_OK) { goto error; } state->path = path; state->printer = prn; MD5_Init(&state->md5_state); *self = f; return RDD_OK; error: *self = 0; if (path != 0) free(path); if (state != 0) free(state); if (f != 0) free(f); return rc; } /** Updates the running MD5 hash value for the current block. */ static int blockhash_input(RDD_FILTER *self, const unsigned char *buf, unsigned nbyte) { RDD_BLOCKHASH_FILTER *state = (RDD_BLOCKHASH_FILTER *) self->state; MD5_Update(&state->md5_state, buf, nbyte); return RDD_OK; } /** Outputs the MD5 hash value of the block that has just been * completed. */ static int blockhash_block(RDD_FILTER *self, unsigned block_size) { RDD_BLOCKHASH_FILTER *state = (RDD_BLOCKHASH_FILTER *) self->state; unsigned char md5bytes[MD5_DIGEST_LENGTH]; char digest[2*MD5_DIGEST_LENGTH + 1]; int rc; MD5_Final(md5bytes, &state->md5_state); rc = rdd_buf2hex(md5bytes, sizeof md5bytes, digest, sizeof digest); if (rc != RDD_OK) { return rc; } rdd_mp_message(state->printer, RDD_MSG_INFO, "%llu\t%s", state->blocknum, digest); state->blocknum++; MD5_Init(&state->md5_state); return RDD_OK; } static int blockhash_close(RDD_FILTER *self) { RDD_BLOCKHASH_FILTER *state = (RDD_BLOCKHASH_FILTER *) self->state; unsigned char md5bytes[MD5_DIGEST_LENGTH]; int rc; MD5_Final(md5bytes, &state->md5_state); rc = rdd_mp_close(state->printer, RDD_MP_RECURSE|RDD_MP_READONLY); if (rc != RDD_OK) { return rc; } return RDD_OK; } static int blockhash_free(RDD_FILTER *self) { RDD_BLOCKHASH_FILTER *state = (RDD_BLOCKHASH_FILTER *) self->state; free(state->path); return RDD_OK; } �����������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/rsysint.h�����������������������������������������������������������������������������0100644�0000000�0000000�00000006366�10421731112�0013627�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef __rsysint_h__ #define __rsysint_h__ /** \brief This header file allows a module to define * integer types of known size with names that have * a module-specific prefix. * * Usage: * * ================================== * #include "rsystypes.h" * * rsys_decl_ints(YOUR_PREFIX) * ================================== * * Do NOT add a semicolon to the macro invocation! */ #if defined(_WIN32) || defined(__WIN32__) #include <windows.h> /* Windows defines integer types that are exactly N bits wide * (N = 16, 32, 64). */ #define rsys_decl_ints(prefix) \ typedef WORD prefix##_UINT16; \ typedef DWORD prefix##_UINT32; \ typedef DWORD64 prefix##_UINT64; #elif defined(__STDC__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 defines integer types that are exactly N bits wide (N = 16, 32, 64). */ #include <inttypes.h> #define rsys_decl_ints(prefix) \ typedef uint16_t prefix##_UINT16; \ typedef uint32_t prefix##_UINT32; \ typedef uint64_t prefix##_UINT64; #elif defined(HAVE_INTTYPES_H) && defined(HAVE_UINT16_T) && defined(HAVE_UINT32_T) && defined(HAVE_UINT64_T) #include <inttypes.h> #define rsys_decl_ints(prefix) \ typedef uint16_t prefix##_UINT16; \ typedef uint32_t prefix##_UINT32; \ typedef uint64_t prefix##_UINT64; #elif defined(HAVE_SYS_TYPES_H) && defined(HAVE_U_INT16_T) && defined(HAVE_U_INT32_T) && defined(HAVE_U_INT64_T) #include <sys/types.h> #define rsys_decl_ints(prefix) \ typedef u_int16_t prefix##_UINT16; \ typedef u_int32_t prefix##_UINT32; \ typedef u_int64_t prefix##_UINT64; #else /* not Windows, not standard C */ #error Configuration problem: unknown integer sizes #endif /* Windows, standard C, other */ #endif /* __rsysint_h__ */ ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/faultyreader.c������������������������������������������������������������������������0100644�0000000�0000000�00000016573�10421731112�0014577�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Copyright (c) 2002 - 2006, Netherlands Forensic Institute * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Institute nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef lint static char copyright[] = "@(#) Copyright (c) 2002-2004\n\ Netherlands Forensic Institute. All rights reserved.\n"; #endif /* not lint */ #if defined(HAVE_CONFIG_H) #include <config.h> #endif #include <stdlib.h> #include <stdio.h> #include <string.h> #include "rdd.h" #include "reader.h" #define MAX_LINE 128 #define MAX_FAULT 8 typedef unsigned short rngstate_t[3]; typedef unsigned long seed_t; typedef struct _RDDFAULT { rdd_count_t meanpos; /* mean read-error position (block offset) */ rdd_count_t sigmapos; /* stddev of read-error position (blocks) */ rngstate_t rngpos; /* state of random-number generator */ seed_t pos_seed; double errprob; /* probability of occurrence of this fault */ rngstate_t rngerr; /* state of random-number generator */ seed_t err_seed; } RDDFAULT; typedef struct _RDD_FAULTY_READER { RDD_READER *parent; RDDFAULT faults[MAX_FAULT]; unsigned nfault; } RDD_FAULTY_READER; /* Forward declarations */ static int rdd_faulty_read(RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread); static int rdd_faulty_tell(RDD_READER *r, rdd_count_t *pos); static int rdd_faulty_seek(RDD_READER *r, rdd_count_t pos); static int rdd_faulty_close(RDD_READER *r, int recurse); static RDD_READ_OPS faulty_read_ops = { rdd_faulty_read, rdd_faulty_tell, rdd_faulty_seek, rdd_faulty_close }; /* Returns a random number in [0.0, 1.0). */ static double uniform_random(rngstate_t state) { return 0.0; } #if 0 /* Returns a number drawn from a normal distribution with mean * mean and standard deviation sigma. */ static double gauss_random(rngstate_t state) { return 0.0; } #endif static int fault_compare(const void *p1, const void *p2) { const RDDFAULT *f1 = p1; const RDDFAULT *f2 = p2; if (f1->meanpos < f2->meanpos) { return -1; } else if (f1->meanpos > f2->meanpos) { return 1; } else { return 0; } } static void fault_init(RDDFAULT *f, rdd_count_t meanpos, rdd_count_t sigmapos, seed_t pos_seed, double errprob, seed_t err_seed) { memset(f, '\000', sizeof(*f)); f->meanpos = meanpos; f->sigmapos = sigmapos; f->pos_seed = pos_seed; f->errprob = errprob; f->err_seed = err_seed; } /* Reads fault specifications from a configuration file. */ static int read_faults(FILE *fp, RDD_FAULTY_READER *state) { char line[MAX_LINE]; unsigned lineno; rdd_count_t pos; double probability; for (lineno = 1; fgets(line, MAX_LINE, fp) != NULL; lineno++) { if (strlen(line) >= MAX_LINE - 1) { return RDD_ESYNTAX; /* line too long */ } if (sscanf(line, "%llu %lf", &pos, &probability) != 2) { return RDD_ESYNTAX; /* bad item count on line */ } if (state->nfault >= MAX_FAULT) { return RDD_ESPACE; /* too many lines */ } fault_init(&state->faults[state->nfault], pos, 0, 0, probability, 0); state->nfault++; } if (! feof(fp)) { return RDD_ESYNTAX; } return RDD_OK; } /* Reads a list of fault specification from the configuration file. */ int rdd_open_faulty_reader(RDD_READER **self, RDD_READER *parent, char *path) { RDD_READER *r = 0; RDD_FAULTY_READER *state = 0; FILE *fp = 0; int rc = RDD_OK; rc = rdd_new_reader(&r, &faulty_read_ops, sizeof(RDD_FAULTY_READER)); if (rc != RDD_OK) { goto error; } state = (RDD_FAULTY_READER *) r->state; state->parent = parent; if ((fp = fopen(path, "r")) == NULL) { rc = RDD_EOPEN; goto error; } if ((rc = read_faults(fp, state)) != RDD_OK) { goto error; } if (fclose(fp) == EOF) { rc = RDD_ECLOSE; goto error; } /* Sort fault specifications by mean fault position. */ qsort(state->faults, state->nfault, sizeof(RDDFAULT), &fault_compare); *self = r; return RDD_OK; error: *self = 0; if (fp != NULL) fclose(fp); if (state != 0) free(state); if (r != 0) free(r); return rc; } /* Simulates a faulty reader. * * The algorithm is as follows. For each user-specified fault * we have a location of occurrence and a (fixed) probability * of occurrence. For each fault covered by the read request, * we check if the fault 'occurs' this time. If none of the * covered faults occur, we pass the request to the parent reader. * Otherwise we select the fault with the lowest position and let * it occur. * * If a fault occurs, we still execute a partial read * up to the location of the fault. This allows us to check * whether rdd's saving and restoring of the current file position * works all right: flt_read will return -1, but it will also * have modified the file position. */ int rdd_faulty_read(RDD_READER *self, unsigned char *buf, unsigned nbyte, unsigned *nread) { RDD_FAULTY_READER *state = self->state; rdd_count_t pos; RDDFAULT *f; unsigned i; int rc; if ((rc = rdd_reader_tell(state->parent, &pos)) != RDD_OK) { return rc; } for (i = 0; i < state->nfault; i++) { f = &state->faults[i]; if ((f->meanpos >= pos && f->meanpos < (pos + nbyte)) /* The read request covers the fault. */ && (uniform_random(f->rngerr) < f->errprob)) /* The fault occurs. */ { rc = rdd_reader_read(state->parent, buf, nbyte, nread); if (rc != RDD_OK) { return rc; /* Hmm, true read error */ } if (f->meanpos < (pos + *nread)) { /* The read result covers the fault. */ return RDD_EREAD; } else { return RDD_OK; } } } /* No fault occurred; forward the read request to the parent reader. */ return rdd_reader_read(state->parent, buf, nbyte, nread); } int rdd_faulty_tell(RDD_READER *self, rdd_count_t *pos) { RDD_FAULTY_READER *state = self->state; return rdd_reader_tell(state->parent, pos); } int rdd_faulty_seek(RDD_READER *self, rdd_count_t pos) { RDD_FAULTY_READER *state = self->state; return rdd_reader_seek(state->parent, pos); } int rdd_faulty_close(RDD_READER *self, int recurse) { RDD_FAULTY_READER *state = self->state; if (recurse) { return rdd_reader_close(state->parent, 1); } else { return RDD_OK; } } �������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/src/Makefile.am���������������������������������������������������������������������������0100644�0000000�0000000�00000003134�10421731112�0013765�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Process this file with automake to produce Makefile.in if GCC_COMPILER AM_CFLAGS = -pedantic -Wno-long-long -g3 -Wall -Wmissing-prototypes else AM_CFLAGS = endif AM_LDFLAGS = -static bin_PROGRAMS = rdd-copy rdd-verify noinst_LIBRARIES=librdd.a librdd_a_SOURCES = rdd.h rsysint.h \ strerror.c \ console.c error.h error.c \ rdd_internals.c rdd_internals.h \ commandline.c commandline.h \ md5.c md5.h \ sha1.c sha1.h \ outfile.h outfile.c \ numparser.h numparser.c \ alignedbuf.h alignedbuf.c \ writer.h writer.c \ zlibwriter.c fdwriter.c filewriter.c \ tcpwriter.c safewriter.c partwriter.c \ reader.h reader.c \ fdreader.c filereader.c atomicreader.c \ zlibreader.c faultyreader.c rawreader.c \ alignedreader.c \ filterset.h filterset.c \ filter.h filter.c \ md5streamfilter.c sha1streamfilter.c writestreamfilter.c \ statsblockfilter.c md5blockfilter.c checksumblockfilter.c \ verifyblockfilter.c \ copier.h copier.c robustcopier.c simplecopier.c \ progress.c progress.h \ msgprinter.h msgprinter.c stdioprinter.c fileprinter.c \ bcastprinter.c logprinter.c \ netio.c netio.h rdd_copy_SOURCES = rddcopy.c rdd_copy_LDADD = librdd.a rdd_verify_SOURCES = rddverify.c rdd_verify_LDADD = librdd.a man_MANS = rdd-copy.1 rdd-verify.1 install-exec-local: $(INSTALL) $(srcdir)/rddi.py $(bindir)/rddi $(INSTALL) $(srcdir)/plot-entropy.py $(bindir)/plot-entropy $(INSTALL) $(srcdir)/plot-md5.py $(bindir)/plot-md5 uninstall-local: rm -f $(bindir)/rddi rm -f $(bindir)/plot-entropy rm -f $(bindir)/plot-md5 EXTRA_DIST = $(man_MANS) rddi.py plot-entropy.py plot-md5.py ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/doc���������������������������������������������������������������������������������������0040755�0000000�0000000�00000000000�10421732374�0011645�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/doc/checksum.txt��������������������������������������������������������������������������0100644�0000000�0000000�00000001530�10421731112�0014250�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������File format A checksum file contains checksums computed over fixed-size data blocks. A checksum file contains exactly one type of checksum. A checksum file consists of a header followed by zero or more checksum records. The header format is as follows: enum _checksum_algorithm { TYPE_ADLER32 = 1, TYPE_CRC32 = 2, TYPE_MD5 = 4, TYPE_SHA1 = 8 }; typedef enum _checksum_algorithm checksum_algoritm; extern const u_int16_t CHECKSUM_MAGIC; extern const u_int16_t CHECKSUM_VERSION; typedef struct _checksum_file_header { u_int16_t magic; u_int16_t version; u_int16_t flags; u_int16_t reserved; u_int32_t blocksize; off_t offset; off_t imagesize; } checksum_file_header; typedef struct _checksum_record { u_int32_t checksum; } checksum_record; The magic field contains the value CHECKSUM_MAGIC (0xdefd). ������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/doc/raw.txt�������������������������������������������������������������������������������0100644�0000000�0000000�00000001342�10421731112�0013240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Linux has raw-device support. See raw(8). Raw devices introduce two complications: 1. A read(2) on a raw device does *not* return 0 when EOF is reached. Instead, -1 is returned and errno is set to ENXIO. This makes it difficult to use the raw device transparently. This is why I added the --raw/-r option. 2. To use a raw device, the read buffer must be sector-aligned in memory, and all read sizes must be a multiple of the sector size. Aligning the buffer and rounding up all read sizes is straightforward. The real problem is that the data requested by the user may not start at the beginning of the user's (sector-aligned) read buffer. (This is because the user can specify an offset.) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/README������������������������������������������������������������������������������������0100644�0000000�0000000�00000004530�10421731112�0012023�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������INSTALLATION Configuration and installation details are discussed in the INSTALLATION file in this directory. FAQ Q. Rdd used to report "time left to completion". Now it only reports how much has already been copied. Why? A. To report an estimated time of completion rdd needs to know the size of the data that is to be copied. It's easy to obtain the size of a regular file, and for regular files rdd still estimates the time of completion. Few people use rdd to copy regular files, so they don't notice this. For special files, and that includes /dev/hda and /dev/sda, there appears to be no portable way to determine their size. On Linux rdd used an lseek(2) to the end of the special file, but this trick fails miserably on platforms such as FreeBSD. For this reason, rdd now reads from a special file until it reaches end-of-file, without knowing in advance how many bytes it will read. Q. What's all this about raw devices? A. Under Linux, direct disk access is normally achieved by reading from /dev/hda or from /dev/sda. Data that is returned when you read from /dev/hda travels through the kernel's buffer cache system. This is unnecessary. More importantly, when a disk contains a bad sector, you may loose more data than just that particular sector. I have not yet figured this out in detail, but it probably has to do with reading full pages instead of individual sectors. This problem appears to go away when the disk is accessed as a raw device (e.g. /dev/raw/raw1). Support for raw-device access is entirely experimental, available only for Linux, and disabled by default. To experiment with raw devices specify --enable-raw-device when you configure rdd. To bind a raw device to a block device such as /dev/hda type raw /dev/raw/raw1 /dev/hda Q. Why do I have to specify -r when I read from a raw device (e.g. /dev/raw/raw1)? A. When applied to a raw device, read(2) does not return zero when end-of-file is reached. Instead, read(2) returns -1 and sets errno to ENXIO. This is now used as the end-of-file test for raw devices. I do not want to include this into the general-purpose test for all inputs, because it may cause rdd to ignore true errors reported by non-raw devices. Therefore, this test is activated only when you specify the -r option. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/missing�����������������������������������������������������������������������������������0100755�0000000�0000000�00000025406�10421731776�0012567�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to <bug-automake@gnu.org>." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/aclocal.m4��������������������������������������������������������������������������������0100644�0000000�0000000�00000114237�10421731535�0013022�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar <conftest.tar]) grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR # Configure paths for GTK+ # Owen Taylor 1997-2001 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, dnl pass to pkg-config dnl AC_DEFUN([AM_PATH_GTK_2_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], , enable_gtktest=yes) pkg_config_args=gtk+-2.0 for module in . $4 do case "$module" in gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done no_gtk="" AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo "*** pkg-config too old; version 0.7 or better required." no_gtk=yes PKG_CONFIG=no fi else no_gtk=yes fi min_gtk_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then : else no_gtk=yes fi fi if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl dnl Now check if the installed GTK+ is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.gtktest AC_TRY_RUN([ #include <gtk/gtk.h> #include <stdio.h> #include <stdlib.h> int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else echo "*** Could not run GTK+ test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ #include <gtk/gtk.h> #include <stdio.h> ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/depcomp�����������������������������������������������������������������������������������0100755�0000000�0000000�00000037100�10421732037�0012526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to <bug-automake@gnu.org>. EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/configure.ac������������������������������������������������������������������������������0100644�0000000�0000000�00000005205�10421731143�0013435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AC_PREREQ(2.57) AC_INIT(rdd, [2.0.7], [rdd@holmes.nl]) AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) AC_ARG_ENABLE([tracing], AC_HELP_STRING([--enable-tracing], [enable tracing (default: no)]), [if test $enableval = yes; then AC_DEFINE(RDD_TRACING, 1, [Define to enable tracing.]) fi]) AC_ARG_ENABLE([console], AC_HELP_STRING([--disable-console], [do not use the console device /dev/tty (default: no)]), [if test $enableval = yes; then AC_DEFINE(RDD_CONSOLE, 1, [Define for console usage.]) fi], AC_DEFINE(RDD_CONSOLE, 1, [Define for console usage.])) AC_ARG_ENABLE([raw-device], AC_HELP_STRING([--enable-raw-device], [Experimental support reading from raw devices (Linux-specific) (default: no)]), [if test $enableval = yes; then AC_DEFINE(RDD_RAW, 1, [Define for raw-device support.]) fi]) AC_ARG_ENABLE([gui], AC_HELP_STRING([--enable-gui], [Enable GTK-2.0 GUI for rdd (default: no)]), [case $enableval in yes) gui=yes AC_DEFINE(RDD_GUI, 1, [Define for GUI support.]) ;; no) gui=no ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-gui) ;; esac]) AC_DEFUN([AM_PATH_LIBGLADE_2_0], [ AC_PATH_PROG(PKG_CONFIG, pkg-config, no) LIBGLADE_CFLAGS=`$PKG_CONFIG --cflags libglade-2.0` LIBGLADE_LIBS=`$PKG_CONFIG --libs libglade-2.0` AC_SUBST(LIBGLADE_CFLAGS) AC_SUBST(LIBGLADE_LIBS) ]) AM_PATH_GTK_2_0 AM_PATH_LIBGLADE_2_0 AC_PROG_CC AC_PROG_RANLIB AC_ISC_POSIX AM_CONDITIONAL(GCC_COMPILER, test x${GCC} = xyes) AM_CONDITIONAL(RDD_GUI, test x$gui = xyes) AC_CHECK_PROGS(PYTHON, [python python2.4 python2.3 python2.2], [python]) AC_STDC_HEADERS AC_CHECK_HEADERS([pwd.h]) AC_CHECK_HEADERS([string.h]) AC_CHECK_HEADERS([time.h]) AC_CHECK_HEADERS([sys/types.h]) AC_CHECK_HEADERS([sys/utsname.h]) AC_CHECK_HEADERS([openssl/blowfish.h]) AC_CHECK_HEADERS([fcntl.h], [], [], [#include <sys/types.h> #include <sys/stat.h> ]) AC_CHECK_HEADERS([openssl/crypto.h], [], [], [#include <sys/types.h> ]) AC_CHECK_HEADERS([openssl/md5.h], [], [], [#include <sys/types.h> ]) AC_CHECK_HEADERS([openssl/sha.h], [], [], [#include <sys/types.h> ]) AC_CHECK_HEADERS([inttypes.h]) AC_CHECK_TYPES([uint16_t, uint32_t, uint64_t], [], [], [#include <inttypes.h> ]) AC_SYS_LARGEFILE AC_CHECK_LIB(crypto, MD5_Init) AC_CHECK_LIB(z, gzdopen) AC_CHECK_LIB(m, log) AC_CHECK_TYPES([socklen_t], , , [#include <sys/types.h> #include <sys/socket.h> ]) AC_CHECK_TYPES([u_int16_t, u_int32_t, u_int64_t], , , [#include <sys/types.h> ]) AC_CONFIG_FILES([Makefile src/Makefile gui/Makefile test/Makefile]) AC_CONFIG_FILES([test/trunmd5blockfilter.sh test/ttcpwriter.sh test/tmsgprinter.sh], [chmod +x test/*.sh]) AC_OUTPUT �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/config.h.in�������������������������������������������������������������������������������0100644�0000000�0000000�00000006230�10421731537�0013200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `crypto' library (-lcrypto). */ #undef HAVE_LIBCRYPTO /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the <openssl/blowfish.h> header file. */ #undef HAVE_OPENSSL_BLOWFISH_H /* Define to 1 if you have the <openssl/crypto.h> header file. */ #undef HAVE_OPENSSL_CRYPTO_H /* Define to 1 if you have the <openssl/md5.h> header file. */ #undef HAVE_OPENSSL_MD5_H /* Define to 1 if you have the <openssl/sha.h> header file. */ #undef HAVE_OPENSSL_SHA_H /* Define to 1 if you have the <pwd.h> header file. */ #undef HAVE_PWD_H /* Define to 1 if the system has the type `socklen_t'. */ #undef HAVE_SOCKLEN_T /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the <sys/utsname.h> header file. */ #undef HAVE_SYS_UTSNAME_H /* Define to 1 if you have the <time.h> header file. */ #undef HAVE_TIME_H /* Define to 1 if the system has the type `uint16_t'. */ #undef HAVE_UINT16_T /* Define to 1 if the system has the type `uint32_t'. */ #undef HAVE_UINT32_T /* Define to 1 if the system has the type `uint64_t'. */ #undef HAVE_UINT64_T /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `u_int16_t'. */ #undef HAVE_U_INT16_T /* Define to 1 if the system has the type `u_int32_t'. */ #undef HAVE_U_INT32_T /* Define to 1 if the system has the type `u_int64_t'. */ #undef HAVE_U_INT64_T /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define for console usage. */ #undef RDD_CONSOLE /* Define for GUI support. */ #undef RDD_GUI /* Define for raw-device support. */ #undef RDD_RAW /* Define to enable tracing. */ #undef RDD_TRACING /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/install-sh��������������������������������������������������������������������������������0100755�0000000�0000000�00000022021�10421732057�0013153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/INSTALL�����������������������������������������������������������������������������������0100644�0000000�0000000�00000004513�10435010345�0012200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Content 1. Introduction 2. Platforms 2.1 RedHat Linux 2.2 MacOS 3. Configuration Options 3.1 Tracing 3.2 Console 3.3 Interactive Prompting 3.4 Raw Device 3.5 GUI 1. Introduction At present, rdd is distributed as a source package only. I develop and test on a RedHat9 Linux distribution. This may change. I have little time to test the distribution on other systems, so I depend on other users' input for installation instructions for those systems. If you are lucky, then configuration and installation can be as easy as ./configure make make install You must be root to install rdd, unless you change the installation directories. 2. Platforms 2.1 RedHat Linux 2.2 Mandrake Linux 3. Configuration Options You may wish to customize your rdd configuration. Besides the standard configuration options (such as --prefix), you can set rdd-specific options. Type ./configure --help Rdd-specific options are discussed in the following subsections. 3.1 Tracing --enable-tracing This is a developer option. If you enable tracing rdd will print debug messages. You should not need this option. This option is disabled by default. 3.2 Console --disable-console By default, rdd will send certain messages to the console device (/dev/console) and will read a user's answer to interactive questions from the console device. 3.3 Interactive Prompting --disable-prompting By default, rdd will try to behave in a safe manner. When you are about that is something potentially harmful, such as overwriting an existing file, rdd will ask whether you are sure about that action. This is called prompting. Prompting can be disabled at run time through the -q option. If you wish to disable prompting at compile time then use --disable-prompting. In GUI mode, rdd will always prompt. GUI prompting cannot be disabled. 3.4 Raw Device --enable-raw By enabling raw-device support you can let rdd read from a raw device. A raw device is a pseudo device that is connected to a block device (e.g. /dev/hda). If the block device is accessed through the corresponding raw device, then error recovery will work better. Read the rdd manual page to learn more about raw-device support. 3.5 GUI --enable-gui Enable GUI support if you wish to use rdd's graphical user interface. To build the GUI you will need the GTK-2 and Glade-2 development packages for your Linux system. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/COPYING�����������������������������������������������������������������������������������0100644�0000000�0000000�00000002721�10421731112�0012176�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(c) 2002-2006 Netherlands Forensic Institute All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the Institute nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTIUTE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. �����������������������������������������������rdd-2.0.7/Makefile.am�������������������������������������������������������������������������������0100644�0000000�0000000�00000001032�10421731112�0013171�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Process this file with automake to produce Makefile.in if RDD_GUI SUBDIRS = src test gui else SUBDIRS = src test endif EXTRA_DIST = test/test001 \ test/test002 \ test/test003 \ test/test004 \ test/test005 \ test/test006 \ test/blockhash.py \ test/driver-writer \ test/errorcodes.txt \ test/simfile.txt \ test/tmsgprinter.py \ test/tmsgprinter.sh \ test/tmsgprinter.sh.in \ test/trunmd5blockfilter.sh \ test/trunmd5blockfilter.sh.in \ test/ttcpwriter.py \ test/ttcpwriter.sh \ test/ttcpwriter.sh.in ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rdd-2.0.7/Makefile.in�������������������������������������������������������������������������������0100644�0000000�0000000�00000044650�10421731541�0013225�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = src test gui DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@ GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBGLADE_CFLAGS = @LIBGLADE_CFLAGS@ LIBGLADE_LIBS = @LIBGLADE_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PYTHON = @PYTHON@ RANLIB = @RANLIB@ RDD_GUI_FALSE = @RDD_GUI_FALSE@ RDD_GUI_TRUE = @RDD_GUI_TRUE@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ @RDD_GUI_FALSE@SUBDIRS = src test @RDD_GUI_TRUE@SUBDIRS = src test gui EXTRA_DIST = test/test001 \ test/test002 \ test/test003 \ test/test004 \ test/test005 \ test/test006 \ test/blockhash.py \ test/driver-writer \ test/errorcodes.txt \ test/simfile.txt \ test/tmsgprinter.py \ test/tmsgprinter.sh \ test/tmsgprinter.sh.in \ test/trunmd5blockfilter.sh \ test/trunmd5blockfilter.sh.in \ test/ttcpwriter.py \ test/ttcpwriter.sh \ test/ttcpwriter.sh.in all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/test @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-recursive ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-recursive distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ����������������������������������������������������������������������������������������rdd-2.0.7/configure���������������������������������������������������������������������������������0100755�0000000�0000000�00000775421�10421731542�0013077�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������wheel������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for rdd 2.0.7. # # Report bugs to <rdd@holmes.nl>. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='rdd' PACKAGE_TARNAME='rdd' PACKAGE_VERSION='2.0.7' PACKAGE_STRING='rdd 2.0.7' PACKAGE_BUGREPORT='rdd@holmes.nl' # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> #if HAVE_SYS_TYPES_H # include <sys/types.h> #endif #if HAVE_SYS_STAT_H # include <sys/stat.h> #endif #if STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # if HAVE_STDLIB_H # include <stdlib.h> # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #if HAVE_STRINGS_H # include <strings.h> #endif #if HAVE_INTTYPES_H # include <inttypes.h> #else # if HAVE_STDINT_H # include <stdint.h> # endif #endif #if HAVE_UNISTD_H # include <unistd.h> #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar PKG_CONFIG CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE GTK_CFLAGS GTK_LIBS LIBGLADE_CFLAGS LIBGLADE_LIBS RANLIB ac_ct_RANLIB GCC_COMPILER_TRUE GCC_COMPILER_FALSE RDD_GUI_TRUE RDD_GUI_FALSE PYTHON CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures rdd 2.0.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of rdd 2.0.7:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-tracing enable tracing (default: no) --disable-console do not use the console device /dev/tty (default: no) --enable-raw-device Experimental support reading from raw devices (Linux-specific) (default: no) --enable-gui Enable GTK-2.0 GUI for rdd (default: no) --disable-gtktest do not try to compile and run a test GTK+ program --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-largefile omit support for large files Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to <rdd@holmes.nl>. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF rdd configure 2.0.7 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by rdd $as_me 2.0.7, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version="1.9" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='rdd' VERSION='2.0.7' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" # Check whether --enable-tracing or --disable-tracing was given. if test "${enable_tracing+set}" = set; then enableval="$enable_tracing" if test $enableval = yes; then cat >>confdefs.h <<\_ACEOF #define RDD_TRACING 1 _ACEOF fi fi; # Check whether --enable-console or --disable-console was given. if test "${enable_console+set}" = set; then enableval="$enable_console" if test $enableval = yes; then cat >>confdefs.h <<\_ACEOF #define RDD_CONSOLE 1 _ACEOF fi else cat >>confdefs.h <<\_ACEOF #define RDD_CONSOLE 1 _ACEOF fi; # Check whether --enable-raw-device or --disable-raw-device was given. if test "${enable_raw_device+set}" = set; then enableval="$enable_raw_device" if test $enableval = yes; then cat >>confdefs.h <<\_ACEOF #define RDD_RAW 1 _ACEOF fi fi; # Check whether --enable-gui or --disable-gui was given. if test "${enable_gui+set}" = set; then enableval="$enable_gui" case $enableval in yes) gui=yes cat >>confdefs.h <<\_ACEOF #define RDD_GUI 1 _ACEOF ;; no) gui=no ;; *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-gui" >&5 echo "$as_me: error: bad value ${enableval} for --enable-gui" >&2;} { (exit 1); exit 1; }; } ;; esac fi; DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include <stdlib.h> int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # Check whether --enable-gtktest or --disable-gtktest was given. if test "${enable_gtktest+set}" = set; then enableval="$enable_gtktest" else enable_gtktest=yes fi; pkg_config_args=gtk+-2.0 for module in . do case "$module" in gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done no_gtk="" # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x$PKG_CONFIG != xno ; then if pkg-config --atleast-pkgconfig-version 0.7 ; then : else echo "*** pkg-config too old; version 0.7 or better required." no_gtk=yes PKG_CONFIG=no fi else no_gtk=yes fi min_gtk_version=2.0.0 echo "$as_me:$LINENO: checking for GTK+ - version >= $min_gtk_version" >&5 echo $ECHO_N "checking for GTK+ - version >= $min_gtk_version... $ECHO_C" >&6 if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then : else no_gtk=yes fi fi if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" rm -f conf.gtktest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <gtk/gtk.h> #include <stdio.h> #include <stdlib.h> int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_gtk=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then echo "$as_me:$LINENO: result: yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&5 echo "${ECHO_T}yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)" >&6 : else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else echo "*** Could not run GTK+ test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <gtk/gtk.h> #include <stdio.h> int main () { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed." fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" : fi rm -f conf.gtktest # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi LIBGLADE_CFLAGS=`$PKG_CONFIG --cflags libglade-2.0` LIBGLADE_LIBS=`$PKG_CONFIG --libs libglade-2.0` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include <stdlib.h> int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_strerror=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); int main () { strerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_strerror="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_strerror" = no; then for ac_lib in cposix; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); int main () { strerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_strerror="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6 if test "$ac_cv_search_strerror" != no; then test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" fi if test x${GCC} = xyes; then GCC_COMPILER_TRUE= GCC_COMPILER_FALSE='#' else GCC_COMPILER_TRUE='#' GCC_COMPILER_FALSE= fi if test x$gui = xyes; then RDD_GUI_TRUE= RDD_GUI_FALSE='#' else RDD_GUI_TRUE='#' RDD_GUI_FALSE= fi for ac_prog in python python2.4 python2.3 python2.2 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_PYTHON+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$PYTHON"; then ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi PYTHON=$ac_cv_prog_PYTHON if test -n "$PYTHON"; then echo "$as_me:$LINENO: result: $PYTHON" >&5 echo "${ECHO_T}$PYTHON" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$PYTHON" && break done test -n "$PYTHON" || PYTHON="python" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ctype.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in pwd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to rdd@holmes.nl ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in string.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to rdd@holmes.nl ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to rdd@holmes.nl ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/types.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to rdd@holmes.nl ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/utsname.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to rdd@holmes.nl ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in openssl/blowfish.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to rdd@holmes.nl ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/stat.h> #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in openssl/crypto.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in openssl/md5.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in openssl/sha.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to rdd@holmes.nl ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for uint16_t" >&5 echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 if test "${ac_cv_type_uint16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <inttypes.h> int main () { if ((uint16_t *) 0) return 0; if (sizeof (uint16_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_uint16_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uint16_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 if test $ac_cv_type_uint16_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_UINT16_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for uint32_t" >&5 echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 if test "${ac_cv_type_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <inttypes.h> int main () { if ((uint32_t *) 0) return 0; if (sizeof (uint32_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_uint32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uint32_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 if test $ac_cv_type_uint32_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_UINT32_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for uint64_t" >&5 echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 if test "${ac_cv_type_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <inttypes.h> int main () { if ((uint64_t *) 0) return 0; if (sizeof (uint64_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_uint64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uint64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 if test $ac_cv_type_uint64_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_UINT64_T 1 _ACEOF fi # Check whether --enable-largefile or --disable-largefile was given. if test "${enable_largefile+set}" = set; then enableval="$enable_largefile" fi; if test "$enable_largefile" != no; then echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 if test "$ac_cv_sys_file_offset_bits" != no; then cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF fi rm -f conftest* echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGE_FILES 1 #include <sys/types.h> /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6 if test "$ac_cv_sys_large_files" != no; then cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF fi rm -f conftest* fi echo "$as_me:$LINENO: checking for MD5_Init in -lcrypto" >&5 echo $ECHO_N "checking for MD5_Init in -lcrypto... $ECHO_C" >&6 if test "${ac_cv_lib_crypto_MD5_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char MD5_Init (); int main () { MD5_Init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_crypto_MD5_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypto_MD5_Init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_MD5_Init" >&5 echo "${ECHO_T}$ac_cv_lib_crypto_MD5_Init" >&6 if test $ac_cv_lib_crypto_MD5_Init = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" fi echo "$as_me:$LINENO: checking for gzdopen in -lz" >&5 echo $ECHO_N "checking for gzdopen in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_gzdopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gzdopen (); int main () { gzdopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_gzdopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_gzdopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzdopen" >&5 echo "${ECHO_T}$ac_cv_lib_z_gzdopen" >&6 if test $ac_cv_lib_z_gzdopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" fi echo "$as_me:$LINENO: checking for log in -lm" >&5 echo $ECHO_N "checking for log in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_log+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char log (); int main () { log (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_log=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_log=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_log" >&5 echo "${ECHO_T}$ac_cv_lib_m_log" >&6 if test $ac_cv_lib_m_log = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> int main () { if ((socklen_t *) 0) return 0; if (sizeof (socklen_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test $ac_cv_type_socklen_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for u_int16_t" >&5 echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6 if test "${ac_cv_type_u_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { if ((u_int16_t *) 0) return 0; if (sizeof (u_int16_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_u_int16_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int16_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6 if test $ac_cv_type_u_int16_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_U_INT16_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for u_int32_t" >&5 echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6 if test "${ac_cv_type_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { if ((u_int32_t *) 0) return 0; if (sizeof (u_int32_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_u_int32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int32_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6 if test $ac_cv_type_u_int32_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_U_INT32_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for u_int64_t" >&5 echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6 if test "${ac_cv_type_u_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> int main () { if ((u_int64_t *) 0) return 0; if (sizeof (u_int64_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_u_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6 if test $ac_cv_type_u_int64_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_U_INT64_T 1 _ACEOF fi ac_config_files="$ac_config_files Makefile src/Makefile gui/Makefile test/Makefile" ac_config_files="$ac_config_files test/trunmd5blockfilter.sh test/ttcpwriter.sh test/tmsgprinter.sh" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GCC_COMPILER_TRUE}" && test -z "${GCC_COMPILER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GCC_COMPILER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GCC_COMPILER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${RDD_GUI_TRUE}" && test -z "${RDD_GUI_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"RDD_GUI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"RDD_GUI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by rdd $as_me 2.0.7, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ rdd config.status 2.0.7 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES gui/Makefile" ;; "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/trunmd5blockfilter.sh" ) CONFIG_FILES="$CONFIG_FILES test/trunmd5blockfilter.sh" ;; "test/ttcpwriter.sh" ) CONFIG_FILES="$CONFIG_FILES test/ttcpwriter.sh" ;; "test/tmsgprinter.sh" ) CONFIG_FILES="$CONFIG_FILES test/tmsgprinter.sh" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t s,@GTK_LIBS@,$GTK_LIBS,;t t s,@LIBGLADE_CFLAGS@,$LIBGLADE_CFLAGS,;t t s,@LIBGLADE_LIBS@,$LIBGLADE_LIBS,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@GCC_COMPILER_TRUE@,$GCC_COMPILER_TRUE,;t t s,@GCC_COMPILER_FALSE@,$GCC_COMPILER_FALSE,;t t s,@RDD_GUI_TRUE@,$RDD_GUI_TRUE,;t t s,@RDD_GUI_FALSE@,$RDD_GUI_FALSE,;t t s,@PYTHON@,$PYTHON,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi # Run the commands associated with the file. case $ac_file in test/trunmd5blockfilter.sh ) chmod +x test/*.sh ;; test/ttcpwriter.sh ) chmod +x test/*.sh ;; test/tmsgprinter.sh ) chmod +x test/*.sh ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������