ion-open-source/0000775000175000017500000000000012356652357014250 5ustar jschendejschendeion-open-source/ionstart.awk0000755000175000017500000002645212356652303016620 0ustar jschendejschende#ionstart.awk # David Young # 20 AUG 2008 # # This awk script takes, from standard input, a text configuration file. # The file will contain configuration commands for several ion node # administration programs. # Each section will be dilineated by a pair of Marker lines: ## begin programname # This line will appear at the start of a section. ## end programname # This line will appear at the end of a section. # # An option is permitted: tag # Defining "tag" will limit which begin and end lines will match. # For instance, you can have 2 node's configuration commands in different # sets of sections, such as: ## begin ionadmin host1 ## begin ionadmin host2 # the tag will allow the command to consider only host1's lines. # A side effect of this is that section coherence will not be checked with # files containing multiple tags. This could mean that "host1"'s ionadmin # section could overlap with "host2"'s bpadmin section, causing errors. # BUT it can also mean that host1 and host2's ionadmin files both overlap # completely, saving the user typing time by sending the same topology # information to both nodes with the same file. # # program names accepted are: # ionadmin ionsecadmin ltpadmin bpadmin cfdpadmin ipnadmin dtn2admin acsadmin imcadmin bssadmin # # Program sections may not overlap. # Lines with unsupported program names will be ignored. # In the case of an end line immediately following a begin line # (where there are no lines in between) will result in the program # not being called. # # Optional variable "echo" will, if set, create files for each # section matching the current tag. It will create the following: # configfile.tag.ionrc # configfile.tag.ionsecrc # configfile.tag.ltprc # configfile.tag.bprc # configfile.tag.cfdprc # configfile.tag.ipnrc # configfile.tag.dtn2rc # configfile.tag.acsrc # configfile.tag.imcrc # configfile.tag.bssrc # it will NOT check for the file existence beforehand. # it will NOT run the program. # # SCRIPT REQUIRES A VARIABLE TO BE SET: configfile # SCRIPT HAS OPTIONAL VARIABLES: tag echo # initialize variables BEGIN { ION_OPEN_SOURCE=1 # linenumber for reporting syntax errors and helping out the sed call linenumber = 0 # programs lists the accepted packages in ion in the order they should # be executed programs[1] = "ionadmin" programs[2] = "ionsecadmin" programs[3] = "ltpadmin" programs[4] = "bpadmin" programs[5] = "cfdpadmin" programs[6] = "ipnadmin" programs[7] = "dtn2admin" programs[8] = "acsadmin" programs[9] = "imcadmin" programs[10] = "bssadmin" # programoptions are special options for certain programs that take them # rcname is the name of an rc file associated with the program rcname["ionadmin"] = ionrc rcname["ionsecadmin"] = ionsecrc rcname["bpadmin"] = bprc rcname["cfdpadmin"] = cfdprc rcname["ipnadmin"] = ipnrc rcname["dtn2admin"] = dtn2rc rcname["ltpadmin"] = ltprc rcname["acsadmin"] = acsrc rcname["imcadmin"] = imcrc rcname["bssadmin"] = bssrc # firstline is associative array of the "first line" for a program # lastline is associative array of the "last line" for a program # currentsection is the state of the program section we are in currentsection = "" # error tells if there are any fatal errors error = 0 # warn tells if there are any warnings errors warn = 0 if (configfile == "") { print "The variable configfile has not been defined." print "\tRun again with option -v configfile=filename" exit 1 } } # keep track of the line number { linenumber++ } #{ print "line " linenumber " section " currentsection } #lines with the s command in bpadmin #/^s/ { # if we are currently in bpadmin section, this is a warning. # if (currentsection == "bpadmin") { # print "Warning: Line " linenumber " contains the start command for bpadmin." # print "\tIf dtn2admin/ipnadmin are run as separate programs after bpadmin," # print "\tthere may be warnings/errors when this command is run." # print "\tDisregard this warning if dtn2admin/ipnadmin are run with" # print "\tthe \"r\" commands in bpadmin." # warn++ # next # } #} # lines that start with begin /^## begin/ { # ignore if there is no program if ( $3 == "" ) next # check that the program in this line is part of ION exists = 0 for (n in programs) { if ($3 == programs[n]) exists = 1 } if (exists == 0) { print "WARNING: Line " linenumber " contains unaccepted program, \"" $3 "\"." printf ("\tAccepted programs are: "); for (n in programs) { printf ("%s ",programs[n]) } print "\n\tThis line will be ignored." warn++ next } # if the 4th item matches the tag # or it doesn't exist and there is no tag # then the line has effect if ( $4 == tag ) { # process the line as a starting point # if we are currently in a section, this is an error if (currentsection != "") { print "ERROR: Line " linenumber " begins a new section \"" $3 "\" within section \"" currentsection "\"." print "\tNo nested sections." error++ next } # if this section was already defined, this is an error if (firstline[$3] != "") { print "ERROR: Line " linenumber " begins section \"" $3 "\" which has already been defined at line " firstline[$3] "." error++ next } # set this starting line # offset by one to not send the degin line itself. currentsection = $3 firstline[currentsection] = linenumber + 1 next } # this line doesn't really have any effect, but it should be considered # a random line starting a section that doesn't match the current tag is ignored if (currentsection == "") next if (currentsection == $3) { print "WARNING: Line " linenumber " begins a section for \"" $3 "\" for a different tag." print "\tThere is the possibility that you will send the same commands to two" print "\tdifferent tags: \"" $4 "\" and \"" tag "\"." warn++ next } # the program noted is different from the current section # this should be an error- because it is possible to send incompatible # commands to 2 different programs print "ERROR: Line " linenumber " begins a new section \"" $3 "\" within section \"" currentsection "\"." print "\tEven though the tag doesn't match, overlapped commands may be sent to" print "\ttwo different, incompatible programs." error++ next } # lines that start with end /^## end/ { # ignore if there is no program if ( $3 == "" ) next # check that the program in this line is part of ION exists = 0 for (n in programs) { if ($3 == programs[n]) exists = 1 } if (exists == 0) { print "WARNING: Line " linenumber " contains unaccepted program, \"" $3 "\"." printf ("\tAccepted programs are: "); for (n in programs) { printf ("%s ",programs[n]) } print ".\n\tThis line will be ignored." warn++ next } # if the 4th item matches the tag # or it doesn't exist and there is no tag # then the line has effect if ( $4 == tag ) { # process the line as a starting point # if we are not currently in a section, this is an error if (currentsection == "") { print "ERROR: Line " linenumber " ends section \"" $3 "\" without a valid begin section." error++ next } # if we in a different section, this is an error if (currentsection != $3) { print "ERROR: Line " linenumber " ends section \"" $3 "\" within section \"" currentsection "\"." print "\tNo nested sections." error++ next } # if this section was already defined, this is an error if (lastline[$3] != "") { print "ERROR: Line " linenumber " ends section \"" $3 "\" which has already been defined at line " lastline[currentsection] "." error++ next } # set this ending line # offset by one to not send the end line itself lastline[currentsection] = linenumber - 1 # clear the current section currentsection = "" next } # this line doesn't really have any effect, but it should be considered # a random line ending a section that doesn't match the current tag is ignored if (currentsection == "") next if (currentsection == $3) { print "WARNING: Line " linenumber " ends a section for \"" $3 "\" but for a different tag." print "\tThere is the possibility that you will send the same commands to two" print "\tdifferent tags: \"" $4 "\" and \"" tag "\"." warn++ next } # the program noted is different from the current section # this should be an error- because it is possible to send incompatible # commands to 2 different programs print "ERROR: Line " linenumber " ends a new section \"" $3 "\" within section \"" currentsection "\"." print "\tEven though the tag doesn't match, overlapped commands will be sent to" print "\ttwo different, incompatible programs." error++ next } # end script calls the programs when necessary END { # if we are still in a section, this is an error if (currentsection != "") { print "ERROR: File ends without ending section \"" currentsection "\"." error++ } print "There were " warn " warning(s) and " error " error(s) in your config file." if ( error > 0 ) { print "ION node startup will not be attempted" exit 1 } if(firstline["bssadmin"] > 0 && firstline["ipnadmin"]>0){ print "\nError: bss and ipn are mutually exclusive!" exit 1 } print "Sanity check of file \"" configfile "\" has been cleared." # start the programs # a firstline/lastline with an undefined value is = 0 = "" so you must check that the # firstline has a value > 0. # ignore sections with first and last lines equal (could be undefined, or could be an # empty entry. # ignore sections with last line one greater than first line. # run programs in order- but only if they have defined linenumbers for (x = 1; x <= 10; x++) { if (firstline[programs[x]] > 0 && firstline[programs[x]] <= lastline[programs[x]]) { if(ION_OPEN_SOURCE==0 && programs[x]=="cfdpadmin"){ print "\nSkipping CFDP section. CFDP is not supported." continue } if (echo == "") { # if ipnadmin/dtn2admin are run as separate sections, then bpadmin should be run again later with the "s" command # if (programs[x] == "ipnadmin" || programs[x] == "dtn2admin") runlater = 1 print "\nRunning " programs[x] " using input lines " firstline[programs[x]] " through " lastline[programs[x]] "" if (0 != system (" sed -n '" firstline[programs[x]] "," lastline[programs[x]] "p' <\"" configfile "\" >iontemprun ")) { print "Could not create temporary file iontemprun in this directory; this program will not be run." } else { if (0 != system(programs[x] " iontemprun")) { print "Program: " programs[x] " exited in error." } system("rm iontemprun" ) system("sleep 1" ) } } else { if (append == "TRUE") { appendop=">>" print "\nAppending to " rcname[programs[x]] " using input lines " firstline[programs[x]] " through " lastline[programs[x]] "." } else { appendop=">" print "\nCreating " rcname[programs[x]] " using input lines " firstline[programs[x]] " through " lastline[programs[x]] "." } #use sed to print the lines that matter #use grep to print out lines that don't begin with "##" if (0 != system (" sed -n '" firstline[programs[x]] "," lastline[programs[x]] "p' <\"" configfile "\" | grep -v \"^##\" " appendop "\"" rcname[programs[x]] "\"")) { print "Could not write to " rcname[programs[x]] " in this directory" } } } } # if (runlater == 1) { # print("\nRunning bpadmin again to start the node.") # if (0 != system("echo \"s\" | bpadmin")) { # print "Program: bpadmin exited in error." # } # } } ion-open-source/compile0000755000175000017500000001624512356652343015627 0ustar jschendejschende#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ion-open-source/.stamp_staging_installed0000644000175000017500000000000012356652302021122 0ustar jschendejschendeion-open-source/README.txt0000644000175000017500000000627112356652302015740 0ustar jschendejschende******************************************************************* NO WARRANTY: DISCLAIMER THE SOFTWARE AND/OR RELATED MATERIALS ARE PROVIDED "AS-IS" WITHOUT WARRANTY OF ANY KIND INCLUDING ANY WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE OR PURPOSE (AS SET FORTH IN UCC 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE LICENSED PRODUCT, HOWEVER USED. IN NO EVENT SHALL CALTECH/JPL BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING BUT NOT LIMITED TO INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER CALTECH/JPL SHALL BE ADVISED, HAVE REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY. USER BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF THE SOFTWARE AND/OR RELATED MATERIALS. ******************************************************************* Copyright 2002-2013, by the California Institute of Technology. ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledged. This software and/or related materials may be subject to U.S. export control laws. By accepting this software and related materials, the user agrees to comply with all applicable U.S. export laws and regulations. User has the responsibility to obtain export licenses or other export authority as may be required before exporting the software or related materials to foreign countries or providing access to foreign persons. ******************************************************************* To build the entire ION system on a Linux, OS/X, or Solaris platform, just cd into ion-open-source and enter two commands: ./configure ./make NOTE: if you want to set overriding compile-time switches for a build, the place to do this is in the ./configure command. For details, ./configure -h To build ION for Android, cd into ion-open-source/arch-android and see the instructions in the README.bionic text file. To build ION for RTEMS, cd into ion-open-source/arch-rtems and see the instructions in the README text file. To build ION for Windows, see the instructions in the winion.pdf document. To build ION for the ARM-based AT91SAM9G20 board, cd into ion-open-source/arch-uClibc and see the instructions in the "ARM build.pdf" file. It's also possible to build the individual packages of ION, using platform-specific Makefiles in the package subdirectories. If you choose this option, be aware of the dependencies among the packages: The "ici" package must be built ("make" and "make install") before any other package. The "bp" package is dependent on "dgr" and "ltp" and "bssp" as well as "ici". The "cfdp", "ams", "bss", and "dtpc" packages are dependent on "bp". The "restart" package is dependent on "cfdp", "bp", "ltp", and "ici". Also, be aware that these Makefiles install everything into subdirectories of /opt. To override this behavior, change the value of OPT in the top-level Makefile of each package. Additional details are provided in the README.txt files in the root directories of some of the subsystems. Note that all Makefiles are for gmake; on a freebsd platform, be sure to install gmake before trying to build ION. Scott Burleigh, JPL scott.c.burleigh@jpl.nasa.gov ion-open-source/Makefile0000644000175000017500000000200112356652302015665 0ustar jschendejschendeall: gmake -C ici $@ gmake -C ici install gmake -C ltp $@ gmake -C ltp install gmake -C dgr $@ gmake -C dgr install gmake -C bss $@ gmake -C bss install gmake -C bp $@ gmake -C bp install gmake -C ams $@ gmake -C ams install gmake -C cfdp $@ gmake -C cfdp install clean: gmake -C ici $@ gmake -C ltp $@ gmake -C dgr $@ gmake -C bss $@ gmake -C bp $@ gmake -C ams $@ gmake -C cfdp $@ test: cd tests && ./runtestset normaltests test-all: cd tests && ./runtestset alltests test-branch: @echo @echo "You need mercurial (hg) installed for this." @echo cd tests && hg branch | xargs -L1 ./runtestset test-%: cd tests && ./runtestset $* retest: cd tests && ./runtestset retest vxworks5: ldppc -r -o ionModule.o \ ./ici/arch-vxworks5/icilib.o \ ./ltp/arch-vxworks5/ltplib.o \ ./ams/arch-vxworks5/amslib.o \ ./bp/arch-vxworks5/bplib.o \ ./dgr/arch-vxworks5/dgrlib.o \ ./vxworks-utils/arch-vxworks5/vxwutils.o \ ./vxwork-utils/vxwork-expat/libexpat.obj chmod 755 ionModule.o ion-open-source/ionstop0000755000175000017500000000073412356652303015662 0ustar jschendejschende#!/bin/bash # # ionstop # David Young # Aug 20, 2008 # # will quickly and completely stop an ion node. ION_OPEN_SOURCE=1 echo "IONSTOP will now stop ion and clean up the node for you..." echo "acsadmin ." acsadmin . sleep 1 echo "bpadmin ." bpadmin . sleep 1 if [ "$ION_OPEN_SOURCE" == "1" ]; then echo "cfdpadmin ." cfdpadmin . sleep 1 fi echo "ltpadmin ." ltpadmin . sleep 1 echo "ionadmin ." ionadmin . sleep 1 echo "killm" killm echo "ION node ended. Log file: ion.log" ion-open-source/configs/0000775000175000017500000000000012356652303015667 5ustar jschendejschendeion-open-source/configs/bsp-loopback/0000775000175000017500000000000012356652303020243 5ustar jschendejschendeion-open-source/configs/bsp-loopback/bsp+ltp_loopback.rc0000644000175000017500000001332312356652303024022 0ustar jschendejschende ## begin ionadmin # ionrc configuration file for loopback test. # This uses ltp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, July 2009 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin ltpadmin # ltprc configuration file for the loopback test. # Command: % ltpadmin loopback.ltprc # This command should be run AFTER ionadmin and BEFORE bpadmin. # # Ohio University, July 2009 # # A warning: the ltp configuration is not ideal in this case. # please consult manual pages and other documentation for a # better description. # Initialization command (command 1). # Establishes the LTP retransmission window. # (Prohibiting LTP from seizing all available storage). # A maximum of 32 sessions. A session is assumed to be around one # second of transmission. This value should be estimated at the sum # of maximum round-trip times (in seconds) for all "spans." # Suggest throwing 20% higher number of sessions to account for extra- # long sessions which contain an actual retransmission. # Set a total LTP memory space usage limit as the sum of the memory # space usage of all spans (more or less the number of bytes in transit # on all links for their duration). 1 128 262144 # Add a span. (a connection) # Identify the span as engine number 1. That is the ipn node number # of the node on the other end of this span. # Use 128 as the maximum number of export sessions. # Use 1024 as the maximum size of an export block. This more or less # limits the maximum size of a bundle in the system. # The next two items are the maximum number of import sessions and the # maximum size of an imported block. Since this is loopback, we just # copy the export numbers here. # 1024 is the maximum segment size- more or less, the amount of data # that can be held in a single frame of the underlying protocol. In # this case, UDP packets are the frame, and we will give a conservative # limit. # Limit the aggregation size to 1024 bytes, and set a time limit on # aggregation to 1 second. # Use the command 'udplso localhost:1113' to implement the link # itself. In this case, we use udp to connect to localhost (this is # loopback) using port 1113 (defined by IANA as the default UDP port # for Licklider Transmission Protocol). The single quote is # important, don't use double quotes. a span 1 128 1024 128 1024 1024 1024 1 'udplso localhost:1113' # Start command. # This command actually runs the link service output commands # (defined above, in the "a span" commands). # Also starts the link service INPUT task 'udplsi localhost:1113' to # listen locally on UDP port 1113 for incoming LTP traffic. s 'udplsi localhost:1113' ## end ltpadmin ## begin bpadmin # bprc configuration file for the loopback test. # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). # Note that the custodian endpoint ipn:1.0 is automatically generated. a endpoint ipn:1.1 q a endpoint ipn:1.2 q # Add a protocol. # Add the protocol named ltp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, udp on ethernet) for payload, and 100 bytes for overhead. a protocol ltp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # induct). # The induct itself is implemented by the 'ltpcli' command. a induct ltp 1 ltpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # outduct). # The outduct itself is implemented by the 'ltpclo' command. a outduct ltp 1 ltpclo # Start the daemons s ## end bpadmin ## begin ipnadmin # ipnrc configuration file for the loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # The plan is to queue for transmission (x) on protocol 'ltp' using # the outduct identified as '1.' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 ltp/1 ## end ipnadmin ## begin ionsecadmin 1 e 1 a bspbabrule ipn:1.* ipn:1.* 'HMAC-SHA1' testkey a key 'testkey' testkey.bin ## end ionsecadmin ion-open-source/configs/bsp-loopback/README0000644000175000017500000000016712356652303021125 0ustar jschendejschendeNote: The ion1/ion2 rc files assume that ion-1, and ion-2 are in the /etc/hosts file for each machine, respectively. ion-open-source/configs/bsp-loopback/bsp+stcp_loopback.rc0000644000175000017500000000732412356652303024200 0ustar jschendejschende## File created by /usr/local/bin/ionscript ## Tue Jul 14 13:56:36 EDT 2009 ## Run the following command to start ION node: ## % ionstart -I "loopback.rc" ## begin ionadmin # ionrc configuration file for loopback test. # This uses stcp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, July 2009 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin bpadmin # bprc configuration file for the loopback test. # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, July 2009 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). # Note that the custodian endpoint "ipn:1.0" is automatically generated. a endpoint ipn:1.1 q a endpoint ipn:1.2 q # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, tcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at the loopback IP address. # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. #a induct stcp 127.0.0.1:4556 stcpcli a induct stcp localhost.localdomain:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the localhost IP using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. #a outduct stcp 127.0.0.1:4556 stcpclo a outduct stcp localhost.localdomain:4556 stcpclo # Start the Daemons. s ## end bpadmin ## begin ipnadmin # ipnrc configuration file for the loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, July 2009 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # Transmission should use the stcp convergence layer for 127.0.0.1:4556 # See your bprc file or bpadmin for outducts/protocols you can use. #a plan 1 stcp/127.0.0.1:4556 a plan 1 stcp/localhost.localdomain:4556 ## end ipnadmin ## begin ionsecadmin 1 e 1 a bspbabrule ipn:1.* ipn:1.* 'HMAC-SHA1' testkey a key 'testkey' testkey.bin ## end ionsecadmin ion-open-source/configs/bsp-loopback/stcp_ion1.rc0000644000175000017500000000742012356652303022471 0ustar jschendejschende## File created by /usr/local/bin/ionscript ## Tue Jul 14 13:56:36 EDT 2009 ## Run the following command to start ION node: ## % ionstart -I "loopback.rc" ## begin ionadmin # ionrc configuration file for loopback test. # This uses stcp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, July 2009 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin bpadmin # bprc configuration file for the loopback test. # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, July 2009 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). # Note that the custodian endpoint "ipn:1.0" is automatically generated. a endpoint ipn:1.1 q a endpoint ipn:1.2 q # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, tcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at the loopback IP address. # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. #a induct stcp 127.0.0.1:4556 stcpcli a induct stcp ion-1:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the localhost IP using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. #a outduct stcp 127.0.0.1:4556 stcpclo a outduct stcp ion-2:4556 stcpclo a outduct stcp ion-1:4556 stcpclo # Start the Daemons. s ## end bpadmin ## begin ipnadmin # ipnrc configuration file for the loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, July 2009 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # Transmission should use the stcp convergence layer for 127.0.0.1:4556 # See your bprc file or bpadmin for outducts/protocols you can use. #a plan 1 stcp/127.0.0.1:4556 a plan 1 stcp/ion-1:4556 a plan 2 stcp/ion-2:4556 ## end ipnadmin ## begin ionsecadmin 1 e 1 a bspbabrule ipn:1.* ipn:1.* 'HMAC-SHA1' testkey a bspbabrule ipn:2.* ipn:2.* 'HMAC-SHA1' testkey a key 'testkey' testkey.bin ## end ionsecadmin ion-open-source/configs/bsp-loopback/stcp_ion2.rc0000644000175000017500000000742012356652303022472 0ustar jschendejschende## File created by /usr/local/bin/ionscript ## Tue Jul 14 13:56:36 EDT 2009 ## Run the following command to start ION node: ## % ionstart -I "loopback.rc" ## begin ionadmin # ionrc configuration file for loopback test. # This uses stcp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, July 2009 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 2 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin bpadmin # bprc configuration file for the loopback test. # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, July 2009 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). # Note that the custodian endpoint "ipn:1.0" is automatically generated. a endpoint ipn:2.1 q a endpoint ipn:2.2 q # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, tcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at the loopback IP address. # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. #a induct stcp 127.0.0.1:4556 stcpcli a induct stcp ion-2:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the localhost IP using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. #a outduct stcp 127.0.0.1:4556 stcpclo a outduct stcp ion-2:4556 stcpclo a outduct stcp ion-1:4556 stcpclo # Start the Daemons. s ## end bpadmin ## begin ipnadmin # ipnrc configuration file for the loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, July 2009 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # Transmission should use the stcp convergence layer for 127.0.0.1:4556 # See your bprc file or bpadmin for outducts/protocols you can use. #a plan 1 stcp/127.0.0.1:4556 a plan 1 stcp/ion-1:4556 a plan 2 stcp/ion-2:4556 ## end ipnadmin ## begin ionsecadmin 1 e 2 a bspbabrule ipn:1.* ipn:1.* 'HMAC-SHA1' testkey a bspbabrule ipn:2.* ipn:2.* 'HMAC-SHA1' testkey a key 'testkey' testkey.bin ## end ionsecadmin ion-open-source/configs/bsp-loopback/testkey.bin0000644000175000017500000000040012356652303022415 0ustar jschendejschendeܻ`Gu*]Bzq6˗4:*4|hӖ$V}5i0"e6x)mBTF4*uP,Ƨ'KdTSx2: $?K5+~Ifr6H@ŗetݲ kP<:g4q#/˻Х[)^ C5T&231T4tߞ85}aO7swtt*eGJeC!aq:cion-open-source/configs/loopback-udp/0000775000175000017500000000000012356652303020247 5ustar jschendejschendeion-open-source/configs/loopback-udp/loopback.rc0000644000175000017500000000475012356652303022373 0ustar jschendejschende ## begin ionadmin # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 a range +1 +3600 1 2 1 a range +1 +3600 2 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 # Disable congestion forecasting m horizon +0 ## end ionadmin ## begin bpadmin # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). a endpoint ipn:1.1 q a endpoint ipn:1.2 q a endpoint ipn:1.3 q # Add a protocol. a protocol udp 1400 100 # Add an induct. (listen) a induct udp 0.0.0.0:4556 udpcli # Add an outduct. (since one UDP socket can address any IP, use '*' # for the destination address, then this clo can send to any udp cli) a outduct udp * udpclo s ## end bpadmin ## begin ipnadmin # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # This element is named 'node1.' # The plan is to queue for transmission (x) on protocol 'udp' using # the outduct identified as '*,127.0.0.1:4556'. This specification # will match the udpclo '*' and pass it an auxiliary parameter # (destination address) of '127.0.0.1:4556' a plan 1 udp/*,127.0.0.1:4556 ## end ipnadmin ion-open-source/configs/ion-dtn2-example/0000775000175000017500000000000012356652303020752 5ustar jschendejschendeion-open-source/configs/ion-dtn2-example/ion-host.rc0000644000175000017500000000306612356652303023043 0ustar jschendejschende ## begin ionadmin # Initialization command 1 1 "" # Start ION s # Add contacts (1-2 connected for 1 hr, 100 kbps) a contact +1 +3600 1 1 100000 a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 # Assign ranges (for the next hour, 1 second or less OWLT) a range +1 +3600 1 1 1 a range +1 +3600 1 2 1 a range +1 +3600 2 2 1 # Assign production/consumption rates (dummy) m production 100000 m consumption 100000 ## end ionadmin ## begin bpadmin 1 # Add scheme (DTN w/EIDs) a scheme dtn 'dtn2fw' 'dtn2adminep' # the scheme will use the "gethostname" command and # automatically create the custodian eid dtn://.dtn # NOTE: in this situation, the host was named host1. your # configuration will be different. # Alert ION which endpoints are on this host a endpoint dtn://host1.dtn/sink q a endpoint dtn://host1.dtn/ping q # add the tcp convergence layer and outducts # note that your IPs will be different a protocol tcp 1400 100 a induct tcp 0.0.0.0:4556 tcpcli #loopback outduct a outduct tcp 10.1.1.8:4556 tcpclo # outduct to dtn2 node a outduct tcp 10.1.1.7:4556 tcpclo # start daemons s ## end bpadmin ## begin ipnadmin # this may not be necessary a plan 1 tcp/10.1.1.8:4556 a plan 2 tcp/10.1.1.7:4556 ## end ipnadmin ## begin dtn2admin # note that the "dtn:" is omitted from the routing plans. a plan //host1.dtn x tcp/10.1.1.8:4556 a plan //dtn2box.dtn x tcp/10.1.1.7:4556 # plans support an * character as a wildcard. # a default route would look like this # a plan //* f dtn://dtn2box.dtn # this will use dtn2box.dtn as the "next hop" ## end dtn2admin ion-open-source/configs/ion-dtn2-example/dtn2-host.conf0000644000175000017500000001300712356652303023442 0ustar jschendejschende# # dtn.conf # # Default configuration file for Internet-connected DTN nodes. The # daemon uses a tcl interpreter to parse this file, thus any standard # tcl commands are valid, and all settings are get/set using a single # 'set' functions as: set # log /dtnd info "dtnd parsing configuration..." ######################################## # # Daemon Console Configuration # ######################################## # # console set stdio [ true | false ] # # If set to false, disable the interactive console on stdin/stdout. # The default is set to true (unless the dtnd process is run as a # daemon). # # console set stdio false # # console set addr # console set port # # Settings for the socket based console protocol. # (this interprets user commands) # console set addr 127.0.0.1 console set port 5050 # # console set prompt # # Set the prompt string. Helps if running multiple dtnd's # set shorthostname [lindex [split [info hostname] .] 0] console set prompt "$shorthostname dtn% " ######################################## # # Storage Configuration # ######################################## # # storage set type [ berkeleydb | external | memorydb ] # # Set the storage system to be used # storage set type berkeleydb # the following are for use with external data stores # # The server port to connect to (on localhost) # Note that 62345 has no special significance -- chosen randomly storage set server_port 62345 # The external data store schema location, which can be # found in dtn2/oasys/storage/DS.xsd. storage set schema /etc/DS.xsd # # Do a runtime check for the standard locations for the persistent # storage directory # set dbdir "" foreach dir {/var/dtn /var/tmp/dtn} { if {[file isdirectory $dir]} { set dbdir $dir break } } if {$dbdir == ""} { puts stderr "Must create /var/dtn or /var/tmp/dtn storage directory" exit 1 } # # storage set payloaddir # # Set the directory to be used for bundle payload files # #storage set payloaddir $dbdir/bundles storage set payloaddir /home/mrajan/work/irg/dtn2/test/dtn/bundles # # storage set dbname # # Set the database name (appended with .db as the filename in berkeley # db, used as-is for SQL variants # storage set dbname DTN # # storage set dbdir # # # When using berkeley db, set the directory to be used for the # database files and the name of the files and error log. # #storage set dbdir $dbdir/db storage set dbdir /home/mrajan/work/irg/dtn2/test/dtn/db ######################################## # # Routing configuration # ######################################## # # Set the algorithm used for dtn routing. # # route set type [static | flood | neighborhood | linkstate | external] # route set type static # # route local_eid # # Set the local administrative id of this node. The default just uses # the internet hostname plus the appended string ".dtn" to make it # clear that the hostname isn't really used for DNS lookups. # route local_eid "dtn://[info hostname].dtn" # # External router specific options # # route set server_port 8001 # route set hello_interval 30 # route set schema "/etc/router.xsd" ######################################## # # TCP convergence layer configuration # ######################################## # # interface add [name] [CL] # # Add an input interface to listen on addr:port for incoming bundles # from other tcp / udp convergence layers # # For IP-based interfaces, interfaces listen on INADDR_ANY port 4556 # by default. These can be overridden by using the local_addr and/or # local_port arguments. interface add tcp0 tcp #interface add udp0 udp local_addr=10.1.1.7 local_port=4556 # # link add # # Add a link to a peer node. # # For IP-based links (tcp or udp), the nexthop should contain a DNS # hostname or IP address, followed optionally by a : and a port. If # the port is not specified, the default of 4556 is used. # # e.g. link add link1 dtn.dtnrg.org ONDEMAND tcp # link add link2 dtn2.dtnrg.org:10000 ONDEMAND tcp link add link_tcp 10.1.1.8:4556 ONDEMAND tcp # # route add # # Add a route to the given bundle endpoint id pattern using the # specified link name or peer endpoint. # # e.g. route add dtn://host.domain/* tcp0 route add dtn://host1.dtn/* link_tcp ######################################## # # Service discovery # ######################################## # # discovery add # discovery announce # # Add a local neighborhood discovery module # # e.g. discovery add discovery_bonjour bonjour ######################################## # # Parameter Tuning # ######################################## # # Set the size threshold for the daemon so any bundles smaller than this # size maintain a shadow copy in memory to minimize disk accesses. # # param set payload_mem_threshold 16384 # # Test option to keep all bundle files in the filesystem, even after the # bundle is no longer present at the daemon. # # param set payload_test_no_remove true # # Set the size for which the tcp convergence layer sends partial reception # acknowledgements. Used with reactive fragmentation # # param set tcpcl_partial_ack_len 4096 # # Set if bundles are automatically deleted after transmission # # param set early_deletion true # (others exist but are not fully represented here) log /dtnd info "dtnd configuration parsing complete" ## emacs settings to use tcl-mode by default ## Local Variables: *** ## mode:tcl *** ## End: *** ion-open-source/configs/loopback-ltp/0000775000175000017500000000000012356652303020256 5ustar jschendejschendeion-open-source/configs/loopback-ltp/loopback.bprc0000644000175000017500000000315412356652303022721 0ustar jschendejschende# bprc configuration file for the loopback test. # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). # Note that the custodian endpoint ipn:1.0 is automatically generated. a endpoint ipn:1.1 q a endpoint ipn:1.2 q # Add a protocol. # Add the protocol named ltp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, udp on ethernet) for payload, and 100 bytes for overhead. a protocol ltp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # induct). # The induct itself is implemented by the 'ltpcli' command. a induct ltp 1 ltpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # outduct). # The outduct itself is implemented by the 'ltpclo' command. a outduct ltp 1 ltpclo # Start the daemons s ion-open-source/configs/loopback-ltp/loopback.rc0000644000175000017500000001312212356652303022373 0ustar jschendejschende ## begin ionadmin # ionrc configuration file for loopback test. # This uses ltp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, July 2009 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 0 seconds to reach the other # end (One Way Light Time). a range +1 +3600 1 1 0 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin ltpadmin # ltprc configuration file for the loopback test. # Command: % ltpadmin loopback.ltprc # This command should be run AFTER ionadmin and BEFORE bpadmin. # # Ohio University, July 2009 # # A warning: the ltp configuration is not ideal in this case. # please consult manual pages and other documentation for a # better description. # Initialization command (command 1). # Establishes the LTP retransmission window. # (Prohibiting LTP from seizing all available storage). # A maximum of 32 sessions. A session is assumed to be around one # second of transmission. This value should be estimated at the sum # of maximum round-trip times (in seconds) for all "spans." # Suggest throwing 20% higher number of sessions to account for extra- # long sessions which contain an actual retransmission. # Set a total LTP memory space usage limit as the sum of the memory # space usage of all spans (more or less the number of bytes in transit # on all links for their duration). 1 128 262144 # Add a span. (a connection) # Identify the span as engine number 1. That is the ipn node number # of the node on the other end of this span. # Use 128 as the maximum number of export sessions. # Use 1024 as the maximum size of an export block. This more or less # limits the maximum size of a bundle in the system. # The next two items are the maximum number of import sessions and the # maximum size of an imported block. Since this is loopback, we just # copy the export numbers here. # 1024 is the maximum segment size- more or less, the amount of data # that can be held in a single frame of the underlying protocol. In # this case, UDP packets are the frame, and we will give a conservative # limit. # Limit the aggregation size to 1024 bytes, and set a time limit on # aggregation to 1 second. # Use the command 'udplso localhost:1113' to implement the link # itself. In this case, we use udp to connect to localhost (this is # loopback) using port 1113 (defined by IANA as the default UDP port # for Licklider Transmission Protocol). The single quote is # important, don't use double quotes. a span 1 128 1024 128 1024 1024 1024 1 'udplso localhost:1113' # Start command. # This command actually runs the link service output commands # (defined above, in the "a span" commands). # Also starts the link service INPUT task 'udplsi localhost:1113' to # listen locally on UDP port 1113 for incoming LTP traffic. s 'udplsi 0.0.0.0:1113' ## end ltpadmin ## begin bpadmin # bprc configuration file for the loopback test. # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). # Note that the custodian endpoint ipn:1.0 is automatically generated. a endpoint ipn:1.1 q a endpoint ipn:1.2 q # Add a protocol. # Add the protocol named ltp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, udp on ethernet) for payload, and 100 bytes for overhead. a protocol ltp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # induct). # The induct itself is implemented by the 'ltpcli' command. a induct ltp 1 ltpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # outduct). # The outduct itself is implemented by the 'ltpclo' command. a outduct ltp 1 ltpclo # Start the daemons s ## end bpadmin ## begin ipnadmin # ipnrc configuration file for the loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # The plan is to queue for transmission (x) on protocol 'ltp' using # the outduct identified as '1.' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 ltp/1 ## end ipnadmin ion-open-source/configs/loopback-ltp/loopback.ionrc0000644000175000017500000000173312356652303023106 0ustar jschendejschende# ionrc configuration file for loopback test. # This uses ltp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, July 2009 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 0 seconds to reach the other # end (One Way Light Time). a range +1 +3600 1 1 0 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ion-open-source/configs/loopback-ltp/loopback.ipnrc0000644000175000017500000000100412356652303023076 0ustar jschendejschende# ipnrc configuration file for the loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # The plan is to queue for transmission (x) on protocol 'ltp' using # the outduct identified as '1.' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 ltp/1 ion-open-source/configs/loopback-ltp/loopback.ltprc0000644000175000017500000000456612356652303023127 0ustar jschendejschende# ltprc configuration file for the loopback test. # Command: % ltpadmin loopback.ltprc # This command should be run AFTER ionadmin and BEFORE bpadmin. # # Ohio University, July 2009 # # A warning: the ltp configuration is not ideal in this case. # please consult manual pages and other documentation for a # better description. # Initialization command (command 1). # Establishes the LTP retransmission window. # (Prohibiting LTP from seizing all available storage). # A maximum of 32 sessions. A session is assumed to be around one # second of transmission. This value should be estimated at the sum # of maximum round-trip times (in seconds) for all "spans." # Suggest throwing 20% higher number of sessions to account for extra- # long sessions which contain an actual retransmission. # Set a total LTP memory space usage limit as the sum of the memory # space usage of all spans (more or less the number of bytes in transit # on all links for their duration). 1 128 262144 # Add a span. (a connection) # Identify the span as engine number 1. That is the ipn node number # of the node on the other end of this span. # Use 128 as the maximum number of export sessions. # Use 1024 as the maximum size of an export block. This more or less # limits the maximum size of a bundle in the system. # The next two items are the maximum number of import sessions and the # maximum size of an imported block. Since this is loopback, we just # copy the export numbers here. # 1024 is the maximum segment size- more or less, the amount of data # that can be held in a single frame of the underlying protocol. In # this case, UDP packets are the frame, and we will give a conservative # limit. # Limit the aggregation size to 1024 bytes, and set a time limit on # aggregation to 1 second. # Use the command 'udplso localhost:1113' to implement the link # itself. In this case, we use udp to connect to localhost (this is # loopback) using port 1113 (defined by IANA as the default UDP port # for Licklider Transmission Protocol). The single quote is # important, don't use double quotes. a span 1 128 1024 128 1024 1024 1024 1 'udplso localhost:1113' # Start command. # This command actually runs the link service output commands # (defined above, in the "a span" commands). # Also starts the link service INPUT task 'udplsi localhost:1113' to # listen on UDP port 1113 for incoming LTP traffic. s 'udplsi 0.0.0.0:1113' ion-open-source/configs/loopback-ltp/loopback.ionsecrc0000644000175000017500000000000612356652303023571 0ustar jschendejschende1 e 1 ion-open-source/configs/loopback-stcp/0000775000175000017500000000000012356652303020430 5ustar jschendejschendeion-open-source/configs/loopback-stcp/loopback.bprc0000644000175000017500000000327712356652303023101 0ustar jschendejschende# bprc configuration file for the loopback test. # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, July 2009 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). # Note that the custodian endpoint "ipn:1.0" is automatically generated. a endpoint ipn:1.1 q a endpoint ipn:1.2 q # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, tcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 0.0.0.0:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the localhost IP using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 127.0.0.1:4556 stcpclo # Start the Daemons. s ion-open-source/configs/loopback-stcp/loopback.rc0000644000175000017500000000705512356652303022555 0ustar jschendejschende## File created by /usr/local/bin/ionscript ## Tue Jul 14 13:56:36 EDT 2009 ## Run the following command to start ION node: ## % ionstart -I "loopback.rc" ## begin ionadmin # ionrc configuration file for loopback test. # This uses stcp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, July 2009 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin bpadmin # bprc configuration file for the loopback test. # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, July 2009 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). # Note that the custodian endpoint "ipn:1.0" is automatically generated. a endpoint ipn:1.1 q a endpoint ipn:1.2 q # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, tcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 0.0.0.0:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the localhost IP using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 127.0.0.1:4556 stcpclo # Start the Daemons. s ## end bpadmin ## begin ipnadmin # ipnrc configuration file for the loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, July 2009 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # Transmission should use the stcp convergence layer for 127.0.0.1:4556 # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 stcp/127.0.0.1:4556 ## end ipnadmin ## begin ionsecadmin 1 e 1 a bspbabrule ipn:1.* ipn:1.* 'HMAC-SHA1' testkey a key 'testkey' testkey.bin a key 'testkey2' testkey2.bin ## end ionsecadmin ion-open-source/configs/loopback-stcp/loopback.ionrc0000644000175000017500000000173312356652303023260 0ustar jschendejschende# ionrc configuration file for loopback test. # This uses stcp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, July 2009 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ion-open-source/configs/loopback-stcp/loopback.ipnrc0000644000175000017500000000076612356652303023266 0ustar jschendejschende# ipnrc configuration file for the loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, July 2009 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # Transmission should use the stcp convergence layer for 127.0.0.1:4556 # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 stcp/127.0.0.1:4556 ion-open-source/configs/2node-stcp/0000775000175000017500000000000012356652303017645 5ustar jschendejschendeion-open-source/configs/2node-stcp/host2.ipnrc0000644000175000017500000000230512356652303021737 0ustar jschendejschende# ipnrc configuration file for host1 in the 2node stcp network. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host2.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:2.0) called 'admin.' # Add service 1 (ipn:2.1) called 'test1.' # Add service 2 (ipn:2.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. (to yourself) # Bundles to be transmitted to element number 2 (that is, yourself). # This element is named 'host2.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.2:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 2 host2 x stcp/10.1.1.2:4556 # Add an egress plan. (to the other host) # Bundles to be transmitted to element number 1 (the other node). # This element is named 'host1.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.1:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 host1 x stcp/10.1.1.1:4556 ion-open-source/configs/2node-stcp/host1.ionrc0000644000175000017500000000266512356652303021746 0ustar jschendejschende# ionrc configuration file for host1 in a 2node stcp test. # This uses stcp as the primary convergence layer. # command: % ionadmin host1.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # They will connect 1 to 2, 2 to 1, and 2 to itself # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 2 2 1 a range +1 +3600 2 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ion-open-source/configs/2node-stcp/host1.bprc0000644000175000017500000000500712356652303021553 0ustar jschendejschende# bprc configuration file for host1 in a 2node test. # Command: % bpadmin host1.bprc # This command should be run AFTER ionadmin and BEFORE ipnadmin # or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:1.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 1 and service number 0 # (ipn requires custodian service to be zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:1.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.0 ipn:1.1 and ipn:1.2 on the local node. # ipn:1.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to dump them 'x', as opposed to # queueing them (use 'q' instead of 'x' to queue). a endpoint ipn 1.0 x a endpoint ipn 1.1 x a endpoint ipn 1.2 x # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, tcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at this host's IP address (private testbed). # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 10.1.1.1:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.1 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.1:4556 stcpclo # Add an outduct. (send to host2) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.2 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.2:4556 stcpclo ion-open-source/configs/2node-stcp/host2.ionrc0000644000175000017500000000266512356652303021747 0ustar jschendejschende# ionrc configuration file for host2 in a 2node stcp test. # This uses stcp as the primary convergence layer. # command: % ionadmin host2.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 2 (as in ipn:2). # Use default sdr configuration (empty configuration file name ""). 1 2 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # They will connect 1 to 2, 2 to 1, and 2 to itself # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 2 2 1 a range +1 +3600 2 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ion-open-source/configs/2node-stcp/host2.bprc0000644000175000017500000000501012356652303021546 0ustar jschendejschende# bprc configuration file for host2 in a 2node test. # Command: % bpadmin host2.bprc # This command should be run AFTER ionadmin and BEFORE ipnadmin # or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:2.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 2 and service number 0 # (ipn requires custodian service to be zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:2.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:2.0 ipn:2.1 and ipn:2.2 on the local node. # ipn:2.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to dump them 'x', as opposed to # queueing them (use 'q' instead of 'x' to queue). a endpoint ipn 2.0 x a endpoint ipn 2.1 x a endpoint ipn 2.2 x # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, stcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at this host's IP address (private testbed). # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 10.1.1.2:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.2 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.2:4556 stcpclo # Add an outduct. (send to host1) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.1 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.1:4556 stcpclo ion-open-source/configs/2node-stcp/host1.rc0000644000175000017500000001257412356652303021240 0ustar jschendejschende## File created by ../../../../branches/release-1.0_r203/ionscript ## Wed Oct 29 17:28:46 EDT 2008 ## Run the following command to start ION node: ## % ionstart -I "host1.rc" ## begin ionadmin # ionrc configuration file for host1 in a 2node stcp test. # This uses stcp as the primary convergence layer. # command: % ionadmin host1.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # They will connect 1 to 2, 2 to 1, and 2 to itself # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 2 2 1 a range +1 +3600 2 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin bpadmin # bprc configuration file for host1 in a 2node test. # Command: % bpadmin host1.bprc # This command should be run AFTER ionadmin and BEFORE ipnadmin # or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:1.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 1 and service number 0 # (ipn requires custodian service to be zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:1.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.0 ipn:1.1 and ipn:1.2 on the local node. # ipn:1.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to dump them 'x', as opposed to # queueing them (use 'q' instead of 'x' to queue). a endpoint ipn 1.0 x a endpoint ipn 1.1 x a endpoint ipn 1.2 x # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, tcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at this host's IP address (private testbed). # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 10.1.1.1:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.1 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.1:4556 stcpclo # Add an outduct. (send to host2) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.2 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.2:4556 stcpclo ## end bpadmin ## begin ipnadmin # ipnrc configuration file for host1 in the 2node stcp network. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host1.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:1.0) called 'admin.' # Add service 1 (ipn:1.1) called 'test1.' # Add service 2 (ipn:1.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. (to yourself) # Bundles to be transmitted to element number 1 (that is, yourself). # This element is named 'host1.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.1:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 host1 x stcp/10.1.1.1:4556 # Add an egress plan. (to the second host) # Bundles to be transmitted to element number 2 (the other node). # This element is named 'host2.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.2:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 2 host2 x stcp/10.1.1.2:4556 ## end ipnadmin ion-open-source/configs/2node-stcp/host2.rc0000644000175000017500000001257412356652303021241 0ustar jschendejschende## File created by ../../../../branches/release-1.0_r203/ionscript ## Wed Oct 29 17:28:46 EDT 2008 ## Run the following command to start ION node: ## % ionstart -I "host2.rc" ## begin ionadmin # ionrc configuration file for host2 in a 2node stcp test. # This uses stcp as the primary convergence layer. # command: % ionadmin host2.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 2 (as in ipn:2). # Use default sdr configuration (empty configuration file name ""). 1 2 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # They will connect 1 to 2, 2 to 1, and 2 to itself # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 2 2 1 a range +1 +3600 2 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin bpadmin # bprc configuration file for host2 in a 2node test. # Command: % bpadmin host2.bprc # This command should be run AFTER ionadmin and BEFORE ipnadmin # or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:2.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 2 and service number 0 # (ipn requires custodian service to be zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:2.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:2.0 ipn:2.1 and ipn:2.2 on the local node. # ipn:2.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to dump them 'x', as opposed to # queueing them (use 'q' instead of 'x' to queue). a endpoint ipn 2.0 x a endpoint ipn 2.1 x a endpoint ipn 2.2 x # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, stcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at this host's IP address (private testbed). # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 10.1.1.2:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.2 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.2:4556 stcpclo # Add an outduct. (send to host1) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.1 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.1:4556 stcpclo ## end bpadmin ## begin ipnadmin # ipnrc configuration file for host1 in the 2node stcp network. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host2.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:2.0) called 'admin.' # Add service 1 (ipn:2.1) called 'test1.' # Add service 2 (ipn:2.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. (to yourself) # Bundles to be transmitted to element number 2 (that is, yourself). # This element is named 'host2.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.2:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 2 host2 x stcp/10.1.1.2:4556 # Add an egress plan. (to the other host) # Bundles to be transmitted to element number 1 (the other node). # This element is named 'host1.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.1:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 host1 x stcp/10.1.1.1:4556 ## end ipnadmin ion-open-source/configs/2node-stcp/host1.ipnrc0000644000175000017500000000230612356652303021737 0ustar jschendejschende# ipnrc configuration file for host1 in the 2node stcp network. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host1.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:1.0) called 'admin.' # Add service 1 (ipn:1.1) called 'test1.' # Add service 2 (ipn:1.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. (to yourself) # Bundles to be transmitted to element number 1 (that is, yourself). # This element is named 'host1.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.1:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 host1 x stcp/10.1.1.1:4556 # Add an egress plan. (to the second host) # Bundles to be transmitted to element number 2 (the other node). # This element is named 'host2.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.2:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 2 host2 x stcp/10.1.1.2:4556 ion-open-source/configs/loopback-brs/0000775000175000017500000000000012356652303020245 5ustar jschendejschendeion-open-source/configs/loopback-brs/loopback.bprc0000644000175000017500000000356712356652303022720 0ustar jschendejschende# bprc configuration file for BRS loopback # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, July 2009 and University of Colorado, Nov 2010 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). # Note that the custodian endpoint "ipn:1.0" is automatically generated. a endpoint ipn:1.1 q a endpoint ipn:1.2 q # Add a protocol. # Add the protocol named brss. # Estimate transmission capacity assuming 1450 bytes of each frame (in # this case, tcp on ethernet) for payload, and 68 bytes for overhead. a protocol brss 1450 68 # Add BRS server induct and outduct. a induct brss 0.0.0.0:4556 brsscla a outduct brss 0.0.0.0:4556 '' # Add a protocol. # Add the protocol named brsc. # Estimate transmission capacity assuming 1450 bytes of each frame (in # this case, tcp on ethernet) for payload, and 68 bytes for overhead. a protocol brsc 1450 68 # Add BRS client induct and outduct. # Add an induct to receive bundles using the brsc protocol. # Add an outduct to send bundles using the brsc protocol. # Both the induct and outduct are implemented in one 'brsccla' task. # The task will connect to the BRS server on port 4556, and # identify itself as node 1. a induct brsc localhost:4556_1 brsccla a outduct brsc localhost:4556_1 '' # Start the bp daemons and defined ducts. s ion-open-source/configs/loopback-brs/1.brs0000644000175000017500000000002412356652303021107 0ustar jschendejschende1ܱB=FvGa-ion-open-source/configs/loopback-brs/loopback.ionrc0000644000175000017500000000173312356652303023075 0ustar jschendejschende# ionrc configuration file for loopback test. # This uses stcp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, July 2009 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ion-open-source/configs/loopback-brs/loopback.ipnrc0000644000175000017500000000074112356652303023074 0ustar jschendejschende# ipnrc configuration file for the loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, July 2009 # Add an egress plan. # Bundles to be transmitted to element number 1. # Transmission should use the BRS convergence layer for 0.0.0.0:4556 # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 brsc/localhost:4556_1 ion-open-source/configs/loopback-brs/loopback.ionsecrc0000644000175000017500000000135712356652303023572 0ustar jschendejschende# loopback-brs/loopback.ionsecrc # # The BRS system uses HMAC to authenticate clients that connect, so we # must initialize the ION security database before using HMAC. # The BRS server must have a key "X.brs" for each BRS client wishing to # connect to duct X. # Each client X must have that same key "X.brs" # In this loopback configuration, there is one server and one client with # one key ("1.brs") for duct 1. # Initialize the ION security database. 1 # Add a key named "1.brs" for the BRS server to use for authenticating # BRS clients. Note that some versions of ION may not come with ciphersuites, # in which case this authentication is trivially insecure. a key 1.brs ../1.brs # Don't require or transmit BABs a bspbabrule * * '' '' ion-open-source/configs/loopback-brs/restart-brsc.bprc0000644000175000017500000000063512356652303023532 0ustar jschendejschende# loopback-brs/restart-brsc.bprc # Restarts the BRS client CLA task, in case it started before the # BRS server was ready to serve. # # If you get an error message like this: # bp/brs/brsccla.c, Can't connect to server. (localhost:4556) # then you should pass this snippet to bpadmin to restart the BRS client CLA: # bpadmin restart-brsc.bprc # x induct brsc localhost:4556_1 s induct brsc localhost:4556_1 ion-open-source/configs/3node-stcp-ltp/0000775000175000017500000000000012356652303020443 5ustar jschendejschendeion-open-source/configs/3node-stcp-ltp/host2.ipnrc0000644000175000017500000000276012356652303022542 0ustar jschendejschende# ipnrc configuration file for host2 in a 3node ltp/stcp test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host2.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:2.0) called 'admin.' # Add service 1 (ipn:2.1) called 'test1.' # Add service 2 (ipn:2.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. (to yourself) # Bundles to be transmitted to element number 2 (that is, yourself). # This element is named 'host2.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.2:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 2 host2 x stcp/10.1.1.2:4556 # Add an egress plan. (to host3) # Bundles to be transmitted to element number 3 (the other node). # This element is named 'host3.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.3:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 3 host3 x stcp/10.1.1.3:4556 # Add an egress plan. (to host1) # Bundles to be transmitted to element number 1. # This element is named 'host1.' # The plan is to queue for transmission (x) on protocol 'ltp' using # the outduct identified as '1.' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 host1 x ltp/1 ion-open-source/configs/3node-stcp-ltp/host1.ionrc0000644000175000017500000000307612356652303022541 0ustar jschendejschende# ionrc configuration file for host1 in a 3node tcp/ltp test. # This uses ltp from 1 to 2 and ltp from 2 to 3. # command: % ionadmin host1.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # The network goes 1--2--3 # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 a contact +1 +3600 2 3 100000 a contact +1 +3600 3 2 100000 a contact +1 +3600 3 3 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 1 2 1 a range +1 +3600 2 2 1 a range +1 +3600 2 3 1 a range +1 +3600 3 3 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ion-open-source/configs/3node-stcp-ltp/host1.bprc0000644000175000017500000000503612356652303022353 0ustar jschendejschende# bprc configuration file for host1 in a 3node ltp/tcp test. # Command: % bpadmin host1.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:1.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 1 and service number 0 # (ipn requires custodian service is zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:1.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.0 ipn:1.1 and ipn:1.2 on the local node. # ipn:1.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). a endpoint ipn 1.0 x a endpoint ipn 1.1 x a endpoint ipn 1.2 x # Add a protocol. # Add the protocol named ltp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, udp on ethernet) for payload, and 100 bytes for overhead. a protocol ltp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # induct). # The induct itself is implemented by the 'ltpcli' command. a induct ltp 1 ltpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # outduct). The name should correspond to a span (in your ltprc). # The outduct itself is implemented by the 'ltpclo' command. a outduct ltp 1 ltpclo # NOTE: what happens if 1 does not match the id of an ltp span? # Add an outduct. (send to host2) # Add an outduct to send bundles using the ltp protocol. # The duct's name is 2 (this is for future changing/deletion of the # outduct). The name should correpsond to a span (in your ltprc). # The outduct itself is implemented by the 'ltpclo' command. a outduct ltp 2 ltpclo ion-open-source/configs/3node-stcp-ltp/host1.ltprc0000644000175000017500000000436212356652303022552 0ustar jschendejschende# ltprc configuration file for host1 in a 3node ltp/tcp test. # Command: % ltpadmin host1.ltprc # This command should be run AFTER ionadmin and BEFORE bpadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Establishes the LTP retransmission window. # (Prohibiting LTP from seizing all available storage). # A maximum of 32 sessions. A session is assumed to be around one # second of transmission. This value should be estimated at the sum # of maximum round-trip times (in seconds) for all "spans." # Suggest throwing 20% higher number of sessions to account for extra- # long sessions which contain an actual retransmission. # Set a block size limit of 131072 bytes. The block size is around # the amount of data expected to be sent in a session. Determine # this with the maximum amount of data (in bytes) transferred in one # second on your fastest available link. 1 32 131072 # Add a span. (a connection) # Identify the span as engine number 1. # Use 1400 byte segments (assuming a standard ethernet frame # underlying this link and accounting for ip/udp/eth header overhead). # Use a nominal block size of 10000 bytes. This is the amount of data # (which can span several bundles) sent in a session. You should # consider this to be the maximum number of bytes sent in one second # on the link. (you can also use the block size limit in the # initialization command). # Use the command 'udplso 10.1.1.1:1113' to implement the link # itself. In this case, we use udp to connect to the local machine # (loopback) using port 1113 (defined by IANA as the default UDP port # for Licklider Transmission Protocol). The single quote is # important, don't use double quotes. a span 1 1400 10000 'udplso 10.1.1.1:1113' # Add another span. (to host2) # Identify the span as engine number 2. # Use the command 'udplso 10.1.1.2:1113' to implement the link # itself. In this case, we use udp to connect to host2 using the # default port. a span 2 1400 10000 'udplso 10.1.1.2:1113' # Start command. # This command actually runs the link service output commands # (defined above, in the "a span" commands). # Also starts the link service INPUT task 'udplsi 10.1.1.1:1113' to # listen locally on UDP port 1113 for incoming LTP traffic. s 'udplsi 10.1.1.1:1113' ion-open-source/configs/3node-stcp-ltp/host2.ionrc0000644000175000017500000000307712356652303022543 0ustar jschendejschende# ionrc configuration file for host2 in a 3node stcp/ltp test. # This uses ltp from 1 to 2 and ltp from 2 to 3. # command: % ionadmin host2.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 2 (as in ipn:2). # Use default sdr configuration (empty configuration file name ""). 1 2 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # The network goes 1--2--3 # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 a contact +1 +3600 2 3 100000 a contact +1 +3600 3 2 100000 a contact +1 +3600 3 3 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 1 2 1 a range +1 +3600 2 2 1 a range +1 +3600 2 3 1 a range +1 +3600 3 3 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ion-open-source/configs/3node-stcp-ltp/host2.bprc0000644000175000017500000000650012356652303022351 0ustar jschendejschende# bprc configuration file for host2 in a 3node ltp/stcp test. # Command: % bpadmin host2.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:2.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 2 and service number 0 # (ipn requires custodian service is zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:2.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:2.0 ipn:2.1 and ipn:2.2 on the local node. # ipn:2.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). a endpoint ipn 2.0 x a endpoint ipn 2.1 x a endpoint ipn 2.2 x # Add a protocol. # Add the protocol named ltp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, udp on ethernet) for payload, and 100 bytes for overhead. a protocol ltp 1400 100 # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, stcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the ltp protocol. # The duct's name is 2 (this is for future changing/deletion of the # induct). # The induct itself is implemented by the 'ltpcli' command. a induct ltp 2 ltpcli # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at this host's IP address (private testbed). # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 10.1.1.2:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.2 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.2:4556 stcpclo # Add an outduct. (send to host3) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.3 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.3:4556 stcpclo # Add an outduct. (send to host1) # Add an outduct to send bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # outduct). The name should correpsond to a span (in your ltprc). # The outduct itself is implemented by the 'ltpclo' command. a outduct ltp 1 ltpclo ion-open-source/configs/3node-stcp-ltp/host1.rc0000644000175000017500000001731012356652303022027 0ustar jschendejschende## File created by ../../ionscript ## Wed Oct 29 17:33:43 EDT 2008 ## Run the following command to start ION node: ## % ionstart -I "host1.rc" ## begin ionadmin # ionrc configuration file for host1 in a 3node stcp/ltp test. # This uses ltp from 1 to 2 and ltp from 2 to 3. # command: % ionadmin host1.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # The network goes 1--2--3 # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 a contact +1 +3600 2 3 100000 a contact +1 +3600 3 2 100000 a contact +1 +3600 3 3 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 1 2 1 a range +1 +3600 2 2 1 a range +1 +3600 2 3 1 a range +1 +3600 3 3 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin ltpadmin # ltprc configuration file for host1 in a 3node ltp/stcp test. # Command: % ltpadmin host1.ltprc # This command should be run AFTER ionadmin and BEFORE bpadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Establishes the LTP retransmission window. # (Prohibiting LTP from seizing all available storage). # A maximum of 32 sessions. A session is assumed to be around one # second of transmission. This value should be estimated at the sum # of maximum round-trip times (in seconds) for all "spans." # Suggest throwing 20% higher number of sessions to account for extra- # long sessions which contain an actual retransmission. # Set a block size limit of 131072 bytes. The block size is around # the amount of data expected to be sent in a session. Determine # this with the maximum amount of data (in bytes) transferred in one # second on your fastest available link. 1 32 131072 # Add a span. (a connection) # Identify the span as engine number 1. # Use 1400 byte segments (assuming a standard ethernet frame # underlying this link and accounting for ip/udp/eth header overhead). # Use a nominal block size of 10000 bytes. This is the amount of data # (which can span several bundles) sent in a session. You should # consider this to be the maximum number of bytes sent in one second # on the link. (you can also use the block size limit in the # initialization command). # Use the command 'udplso 10.1.1.1:1113' to implement the link # itself. In this case, we use udp to connect to the local machine # (loopback) using port 1113 (defined by IANA as the default UDP port # for Licklider Transmission Protocol). The single quote is # important, don't use double quotes. a span 1 1400 10000 'udplso 10.1.1.1:1113' # Add another span. (to host2) # Identify the span as engine number 2. # Use the command 'udplso 10.1.1.2:1113' to implement the link # itself. In this case, we use udp to connect to host2 using the # default port. a span 2 1400 10000 'udplso 10.1.1.2:1113' # Start command. # This command actually runs the link service output commands # (defined above, in the "a span" commands). # Also starts the link service INPUT task 'udplsi 10.1.1.1:1113' to # listen locally on UDP port 1113 for incoming LTP traffic. s 'udplsi 10.1.1.1:1113' ## end ltpadmin ## begin bpadmin # bprc configuration file for host1 in a 3node ltp/stcp test. # Command: % bpadmin host1.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:1.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 1 and service number 0 # (ipn requires custodian service is zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:1.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.0 ipn:1.1 and ipn:1.2 on the local node. # ipn:1.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). a endpoint ipn 1.0 x a endpoint ipn 1.1 x a endpoint ipn 1.2 x # Add a protocol. # Add the protocol named ltp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, udp on ethernet) for payload, and 100 bytes for overhead. a protocol ltp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # induct). # The induct itself is implemented by the 'ltpcli' command. a induct ltp 1 ltpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # outduct). The name should correspond to a span (in your ltprc). # The outduct itself is implemented by the 'ltpclo' command. a outduct ltp 1 ltpclo # NOTE: what happens if 1 does not match the id of an ltp span? # Add an outduct. (send to host2) # Add an outduct to send bundles using the ltp protocol. # The duct's name is 2 (this is for future changing/deletion of the # outduct). The name should correpsond to a span (in your ltprc). # The outduct itself is implemented by the 'ltpclo' command. a outduct ltp 2 ltpclo ## end bpadmin ## begin ipnadmin # ipnrc configuration file for host1 in a 3node ltp/stcp test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host1.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:1.0) called 'admin.' # Add service 1 (ipn:1.1) called 'test1.' # Add service 2 (ipn:1.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # This element is named 'host1.' # The plan is to queue for transmission (x) on protocol 'ltp' using # the outduct identified as '1.' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 host1 x ltp/1 # Add other egress plans. # Bundles for elemetn 2 can be transmitted directly to host2 using # ltp outduct identified as '2.' See bprc file for available outducts # and/or protocols. a plan 2 host2 x ltp/2 # Add a group static route # host 3 is not a neighbor to host1, but it is a neighbor to host2. # send bundles for 3 via 2. a group 3 3 2 ## end ipnadmin ion-open-source/configs/3node-stcp-ltp/host3.rc0000644000175000017500000001316512356652303022035 0ustar jschendejschende## File created by ../../ionscript ## Wed Oct 29 17:33:43 EDT 2008 ## Run the following command to start ION node: ## % ionstart -I "host3.rc" ## begin ionadmin # ionrc configuration file for host3 in a 3node stcp/ltp test. # This uses ltp from 1 to 2 and ltp from 2 to 3. # command: % ionadmin host3.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 3 (as in ipn:3). # Use default sdr configuration (empty configuration file name ""). 1 3 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # The network goes 1--2--3 # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 a contact +1 +3600 2 3 100000 a contact +1 +3600 3 2 100000 a contact +1 +3600 3 3 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 1 2 1 a range +1 +3600 2 2 1 a range +1 +3600 2 3 1 a range +1 +3600 3 3 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin bpadmin # bprc configuration file for host3 in a 3node ltp/stcp test. # Command: % bpadmin host3.bprc # This command should be run AFTER ionadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:3.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 3 and service number 0 # (ipn requires custodian service is zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:3.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:3.0 ipn:3.1 and ipn:3.2 on the local node. # ipn:3.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). a endpoint ipn 3.0 x a endpoint ipn 3.1 x a endpoint ipn 3.2 x # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, stcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at this host's IP address (private testbed). # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 10.1.1.3:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.3 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.3:4556 stcpclo # Add an outduct. (send to host2) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.2 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.2:4556 stcpclo ## end bpadmin ## begin ipnadmin # ipnrc configuration file for host3 in a 3node ltp/stcp test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host3.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:3.0) called 'admin.' # Add service 1 (ipn:3.1) called 'test1.' # Add service 2 (ipn:3.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. (to yourself) # Bundles to be transmitted to element number 3 (that is, yourself). # This element is named 'host3.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.3:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 3 host3 x stcp/10.1.1.3:4556 # Add an egress plan. (to host2) # Bundles to be transmitted to element number 2 (the other node). # This element is named 'host2.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.2:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 2 host2 x stcp/10.1.1.2:4556 # Add a group static route. # Host1 is not a neigbor to host3, but is is a neighbor to host 2; # send bundles for 1 via 2. a group 1 1 2 ## end ipnadmin ion-open-source/configs/3node-stcp-ltp/host2.rc0000644000175000017500000002151412356652303022031 0ustar jschendejschende## File created by ../../ionscript ## Wed Oct 29 17:33:43 EDT 2008 ## Run the following command to start ION node: ## % ionstart -I "host2.rc" ## begin ionadmin # ionrc configuration file for host2 in a 3node stcp/ltp test. # This uses ltp from 1 to 2 and ltp from 2 to 3. # command: % ionadmin host2.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 2 (as in ipn:2). # Use default sdr configuration (empty configuration file name ""). 1 2 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # The network goes 1--2--3 # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 a contact +1 +3600 2 3 100000 a contact +1 +3600 3 2 100000 a contact +1 +3600 3 3 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 1 2 1 a range +1 +3600 2 2 1 a range +1 +3600 2 3 1 a range +1 +3600 3 3 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ## end ionadmin ## begin ltpadmin # ltprc configuration file for host2 in a 3node ltp/stcp test. # Command: % ltpadmin host2.ltprc # This command should be run AFTER ionadmin and BEFORE bpadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Establishes the LTP retransmission window. # (Prohibiting LTP from seizing all available storage). # A maximum of 32 sessions. A session is assumed to be around one # second of transmission. This value should be estimated at the sum # of maximum round-trip times (in seconds) for all "spans." # Suggest throwing 20% higher number of sessions to account for extra- # long sessions which contain an actual retransmission. # Set a block size limit of 131072 bytes. The block size is around # the amount of data expected to be sent in a session. Determine # this with the maximum amount of data (in bytes) transferred in one # second on your fastest available link. 1 32 131072 # Add a span. (a connection) # Identify the span as engine number 1. # Use 1400 byte segments (assuming a standard ethernet frame # underlying this link and accounting for ip/udp/eth header overhead). # Use a nominal block size of 10000 bytes. This is the amount of data # (which can span several bundles) sent in a session. You should # consider this to be the maximum number of bytes sent in one second # on the link. (you can also use the block size limit in the # initialization command). # Use the command 'udplso 10.1.1.1:1113' to implement the link # itself. In this case, we use udp to connect to the local machine # (loopback) using port 1113 (defined by IANA as the default UDP port # for Licklider Transmission Protocol). The single quote is # important, don't use double quotes. a span 1 1400 10000 'udplso 10.1.1.1:1113' # Add another span. (to yourself) # Identify the span as engine number 2. # Use the command 'udplso 10.1.1.2:1113' to implement the link # itself. In this case, we use udp to connect to host2 using the # default port. a span 2 1400 10000 'udplso 10.1.1.2:1113' # Start command. # This command actually runs the link service output commands # (defined above, in the "a span" commands). # Also starts the link service INPUT task 'udplsi 10.1.1.2:1113' to # listen locally on UDP port 1113 for incoming LTP traffic. s 'udplsi 10.1.1.2:1113' ## end ltpadmin ## begin bpadmin # bprc configuration file for host2 in a 3node ltp/stcp test. # Command: % bpadmin host2.bprc # This command should be run AFTER ionadmin and ltpadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:2.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 2 and service number 0 # (ipn requires custodian service is zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:2.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:2.0 ipn:2.1 and ipn:2.2 on the local node. # ipn:2.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). a endpoint ipn 2.0 x a endpoint ipn 2.1 x a endpoint ipn 2.2 x # Add a protocol. # Add the protocol named ltp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, udp on ethernet) for payload, and 100 bytes for overhead. a protocol ltp 1400 100 # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, stcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the ltp protocol. # The duct's name is 2 (this is for future changing/deletion of the # induct). # The induct itself is implemented by the 'ltpcli' command. a induct ltp 2 ltpcli # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at this host's IP address (private testbed). # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 10.1.1.2:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.2 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.2:4556 stcpclo # Add an outduct. (send to host3) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.3 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.3:4556 stcpclo # Add an outduct. (send to host1) # Add an outduct to send bundles using the ltp protocol. # The duct's name is 1 (this is for future changing/deletion of the # outduct). The name should correpsond to a span (in your ltprc). # The outduct itself is implemented by the 'ltpclo' command. a outduct ltp 1 ltpclo ## end bpadmin ## begin ipnadmin # ipnrc configuration file for host2 in a 3node ltp/stcp test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host2.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:2.0) called 'admin.' # Add service 1 (ipn:2.1) called 'test1.' # Add service 2 (ipn:2.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. (to yourself) # Bundles to be transmitted to element number 2 (that is, yourself). # This element is named 'host2.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.2:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 2 host2 x stcp/10.1.1.2:4556 # Add an egress plan. (to host3) # Bundles to be transmitted to element number 3 (the other node). # This element is named 'host3.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.3:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 3 host3 x stcp/10.1.1.3:4556 # Add an egress plan. (to host1) # Bundles to be transmitted to element number 1. # This element is named 'host1.' # The plan is to queue for transmission (x) on protocol 'ltp' using # the outduct identified as '1.' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 host1 x ltp/1 ## end ipnadmin ion-open-source/configs/3node-stcp-ltp/host1.ipnrc0000644000175000017500000000221712356652303022536 0ustar jschendejschende# ipnrc configuration file for host1 in a 3node ltp/tcp test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host1.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:1.0) called 'admin.' # Add service 1 (ipn:1.1) called 'test1.' # Add service 2 (ipn:1.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # This element is named 'host1.' # The plan is to queue for transmission (x) on protocol 'ltp' using # the outduct identified as '1.' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 host1 x ltp/1 # Add other egress plans. # Bundles for elemetn 2 can be transmitted directly to host2 using # ltp outduct identified as '2.' See bprc file for available outducts # and/or protocols. a plan 2 host2 x ltp/2 # Add a group static route # host 3 is not a neighbor to host1, but it is a neighbor to host2. # send bundles for 3 via 2. a group 3 3 2 ion-open-source/configs/3node-stcp-ltp/host3.ipnrc0000644000175000017500000000250612356652303022541 0ustar jschendejschende# ipnrc configuration file for host3 in a 3node ltp/stcp test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin host3.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add services # Add service 0 (i.e. ipn:3.0) called 'admin.' # Add service 1 (ipn:3.1) called 'test1.' # Add service 2 (ipn:3.2) called 'test2.' # See your bprc file for endpoint IDs you should use. a service 0 admin a service 1 test1 a service 2 test2 # Add an egress plan. (to yourself) # Bundles to be transmitted to element number 3 (that is, yourself). # This element is named 'host3.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.3:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 3 host3 x stcp/10.1.1.3:4556 # Add an egress plan. (to host2) # Bundles to be transmitted to element number 2 (the other node). # This element is named 'host2.' # The plan is to queue for transmission (x) on protocol 'stcp' using # the outduct identified as '10.1.1.2:4556' # See your bprc file or bpadmin for outducts/protocols you can use. a plan 2 host2 x stcp/10.1.1.2:4556 # Add a group static route. # Host1 is not a neigbor to host3, but is is a neighbor to host 2; # send bundles for 1 via 2. a group 1 1 2 ion-open-source/configs/3node-stcp-ltp/host3.ionrc0000644000175000017500000000307712356652303022544 0ustar jschendejschende# ionrc configuration file for host3 in a 3node stcp/ltp test. # This uses ltp from 1 to 2 and ltp from 2 to 3. # command: % ionadmin host3.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 3 (as in ipn:3). # Use default sdr configuration (empty configuration file name ""). 1 3 "" # start ion node s # Add a contact. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # It will transmit 100000 bytes/second. a contact +1 +3600 1 1 100000 # Add more contacts. # The network goes 1--2--3 # Note that contacts are unidirectional, so order matters. a contact +1 +3600 1 2 100000 a contact +1 +3600 2 1 100000 a contact +1 +3600 2 2 100000 a contact +1 +3600 2 3 100000 a contact +1 +3600 3 2 100000 a contact +1 +3600 3 3 100000 # Add a range. This is the physical distance between nodes. # It will start at +1 seconds from now, ending +3600 seconds from now. # It will connect node 1 to itself. # Data on the link is expected to take 1 second to reach the other # end (One Way Light Time). a range +1 +3600 1 1 1 # Add more ranges. # We will assume every range is one second. # Note that ranges cover both directions, so you only need define # one range for any combination of nodes. a range +1 +3600 1 2 1 a range +1 +3600 2 2 1 a range +1 +3600 2 3 1 a range +1 +3600 3 3 1 # set this node to consume and produce a mean of 1000000 bytes/second. m production 1000000 m consumption 1000000 ion-open-source/configs/3node-stcp-ltp/host3.bprc0000644000175000017500000000505612356652303022357 0ustar jschendejschende# bprc configuration file for host3 in a 3node ltp/stcp test. # Command: % bpadmin host3.bprc # This command should be run AFTER ionadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Use ipn:3.0 as the custodian endpoint of this node. # That is, scheme IPN with element_number 3 and service number 0 # (ipn requires custodian service is zero). # Note that this EID must be understood by the node itself, so be sure # to add the scheme below. 1 ipn:3.0 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 1 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:3.0 ipn:3.1 and ipn:3.2 on the local node. # ipn:3.0 is expected for custodian traffic. The rest are usually # used for specific applications (such as bpsink). # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). a endpoint ipn 3.0 x a endpoint ipn 3.1 x a endpoint ipn 3.2 x # Add a protocol. # Add the protocol named stcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, stcp on ethernet) for payload, and 100 bytes for overhead. a protocol stcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the stcp protocol. # The induct will listen at this host's IP address (private testbed). # The induct will listen on port 4556, the IANA assigned default DTN # TCP convergence layer port. # The induct itself is implemented by the 'stcpcli' command. a induct stcp 10.1.1.3:4556 stcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.3 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.3:4556 stcpclo # Add an outduct. (send to host2) # Add an outduct to send bundles using the stcp protocol. # The outduct will connect to the IP address 10.1.1.2 using the # IANA assigned default DTN TCP port of 4556. # The outduct itself is implemented by the 'stcpclo' command. a outduct stcp 10.1.1.2:4556 stcpclo ion-open-source/configs/3node-stcp-ltp/host2.ltprc0000644000175000017500000000436612356652303022557 0ustar jschendejschende# ltprc configuration file for host2 in a 3node ltp/stcp test. # Command: % ltpadmin host2.ltprc # This command should be run AFTER ionadmin and BEFORE bpadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). # Establishes the LTP retransmission window. # (Prohibiting LTP from seizing all available storage). # A maximum of 32 sessions. A session is assumed to be around one # second of transmission. This value should be estimated at the sum # of maximum round-trip times (in seconds) for all "spans." # Suggest throwing 20% higher number of sessions to account for extra- # long sessions which contain an actual retransmission. # Set a block size limit of 131072 bytes. The block size is around # the amount of data expected to be sent in a session. Determine # this with the maximum amount of data (in bytes) transferred in one # second on your fastest available link. 1 32 131072 # Add a span. (a connection) # Identify the span as engine number 1. # Use 1400 byte segments (assuming a standard ethernet frame # underlying this link and accounting for ip/udp/eth header overhead). # Use a nominal block size of 10000 bytes. This is the amount of data # (which can span several bundles) sent in a session. You should # consider this to be the maximum number of bytes sent in one second # on the link. (you can also use the block size limit in the # initialization command). # Use the command 'udplso 10.1.1.1:1113' to implement the link # itself. In this case, we use udp to connect to the local machine # (loopback) using port 1113 (defined by IANA as the default UDP port # for Licklider Transmission Protocol). The single quote is # important, don't use double quotes. a span 1 1400 10000 'udplso 10.1.1.1:1113' # Add another span. (to yourself) # Identify the span as engine number 2. # Use the command 'udplso 10.1.1.2:1113' to implement the link # itself. In this case, we use udp to connect to host2 using the # default port. a span 2 1400 10000 'udplso 10.1.1.2:1113' # Start command. # This command actually runs the link service output commands # (defined above, in the "a span" commands). # Also starts the link service INPUT task 'udplsi 10.1.1.2:1113' to # listen locally on UDP port 1113 for incoming LTP traffic. s 'udplsi 10.1.1.2:1113' ion-open-source/configs/3node-ltp-brs/0000775000175000017500000000000012356652303020260 5ustar jschendejschendeion-open-source/configs/3node-ltp-brs/iontest.ipn.node7/0000775000175000017500000000000012356652303023545 5ustar jschendejschendeion-open-source/configs/3node-ltp-brs/iontest.ipn.node7/node7.ipnrc0000644000175000017500000000024112356652303025611 0ustar jschendejschende# Node 7 has no loopback route. It talks to node 5 by LTP/UDP/IP. # Routes to all other nodes are computed dynamically from the contact graph. # a plan 5 ltp/5 ion-open-source/configs/3node-ltp-brs/iontest.ipn.node7/ionconfig0000644000175000017500000000030312356652303025435 0ustar jschendejschendewmSize 5000000 wmAddress 0 # configFlags = 1 means ION data store is in DRAM only, no SDR # transaction reversibility, no object bounds checking configFlags 1 heapWords 5000000 pathName /usr/ion ion-open-source/configs/3node-ltp-brs/iontest.ipn.node7/node7.bprc0000644000175000017500000000030312356652303025423 0ustar jschendejschende1 a scheme ipn 'ipnfw' 'ipnadminep' a endpoint ipn:7.0 x a endpoint ipn:7.1 x a endpoint ipn:7.2 x a protocol ltp 1400 100 a induct ltp 7 ltpcli a outduct ltp 5 ltpclo r 'ipnadmin node7.ipnrc' s ion-open-source/configs/3node-ltp-brs/iontest.ipn.node7/node7.ltprc0000644000175000017500000000014012356652303025620 0ustar jschendejschende1 128 262144 a span 5 128 1024 128 1024 1024 1024 1 'udplso host5:1113' s 'udplsi 0.0.0.0:1113' ion-open-source/configs/3node-ltp-brs/iontest.ipn.node7/node7.ionrc0000644000175000017500000000040512356652303025612 0ustar jschendejschende1 7 ionconfig s a range +0 2009/01/01-00:00:00 5 7 600 a contact +0 2009/01/01-00:00:00 5 7 10000 a contact +0 2009/01/01-00:00:00 7 5 10000 a contact +0 2009/01/01-00:00:00 5 10 100000 a contact +0 2009/01/01-00:00:00 10 5 100000 ion-open-source/configs/3node-ltp-brs/iontest.ipn.node7/ionstart0000755000175000017500000000017512356652303025337 0ustar jschendejschende# shell script to get node running #!/bin/bash ionadmin node7.ionrc sleep 1 ltpadmin node7.ltprc sleep 1 bpadmin node7.bprc ion-open-source/configs/3node-ltp-brs/README.txt0000644000175000017500000000375012356652303021761 0ustar jschendejschende******************************************************************* NO WARRANTY: DISCLAIMER THE SOFTWARE AND/OR RELATED MATERIALS ARE PROVIDED "AS-IS" WITHOUT WARRANTY OF ANY KIND INCLUDING ANY WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE OR PURPOSE (AS SET FORTH IN UCC 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE LICENSED PRODUCT, HOWEVER USED. IN NO EVENT SHALL CALTECH/JPL BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING BUT NOT LIMITED TO INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER CALTECH/JPL SHALL BE ADVISED, HAVE REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY. USER BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF THE SOFTWARE AND/OR RELATED MATERIALS. ******************************************************************* Copyright 2004-2007, by the California Institute of Technology. ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledged. Any commercial use must be negotiated with the Office of Technology Transfer at the California Institute of Technology. This software and/or related materials may be subject to U.S. export control laws. By accepting this software and related materials, the user agrees to comply with all applicable U.S. export laws and regulations. User has the responsibility to obtain export licenses or other export authority as may be required before exporting the software or related materials to foreign countries or providing access to foreign persons. ******************************************************************* These sample ION configuration files establish a simple network of three nodes: 7 <--> 5 <--> 10 Nodes 7 and 5 communicate via LTP over UDP/IP. Nodes 5 and 10 communicate via Bundle Relay Service using TCP/IP, and node 10 also has an LTP/UDP/IP loopback link to itself. Node 5 can send messages to itself only via node 10, and node 7 has no loopback route at all. ion-open-source/configs/3node-ltp-brs/iontest.ipn.node10/0000775000175000017500000000000012356652303023617 5ustar jschendejschendeion-open-source/configs/3node-ltp-brs/iontest.ipn.node10/node10.ipnrc0000644000175000017500000000035112356652303025737 0ustar jschendejschende# Node 10 has an LTP/UDP/IP loopback route. # It talks to node 5 by BRSS -- it is the BRS server. # Routes to all other nodes are computed dynamically from the contact graph. # a plan 10 ltp/10 a plan 5 brss/brss.jpl.nasa.gov:5001,5 ion-open-source/configs/3node-ltp-brs/iontest.ipn.node10/node10.bprc0000644000175000017500000000047012356652303025554 0ustar jschendejschende1 a scheme ipn 'ipnfw' 'ipnadminep' a endpoint ipn:10.0 x a endpoint ipn:10.1 x a endpoint ipn:10.2 x a protocol ltp 1400 100 a induct ltp 10 ltpcli a outduct ltp 10 ltpclo a protocol brss 1400 100 a induct brss brss.jpl.nasa.gov:5001 brsscla a outduct brss brss.jpl.nasa.gov:5001 '' r 'ipnadmin node10.ipnrc' s ion-open-source/configs/3node-ltp-brs/iontest.ipn.node10/ionconfig0000644000175000017500000000037112356652303025514 0ustar jschendejschendewmSize 5000000 wmAddress 0 # configFlags = 15 means that ION's data store is in DRAM with # automatic write-through to a file, SDR transactions are reversible, # and object boundaries are enforced. configFlags 15 heapWords 5000000 pathName /usr/ion ion-open-source/configs/3node-ltp-brs/iontest.ipn.node10/node10.ltprc0000644000175000017500000000016712356652303025755 0ustar jschendejschende1 128 262144 a span 10 128 1024 128 1024 1024 1024 1 'udplso brss.jpl.nasa.gov:1113' s 'udplsi brss.jpl.nasa.gov:1113' ion-open-source/configs/3node-ltp-brs/iontest.ipn.node10/ionstart0000755000175000017500000000020012356652303025376 0ustar jschendejschende# shell script to get node running #!/bin/bash ionadmin node10.ionrc sleep 1 ltpadmin node10.ltprc sleep 1 bpadmin node10.bprc ion-open-source/configs/3node-ltp-brs/iontest.ipn.node10/node10.ionrc0000644000175000017500000000052312356652303025737 0ustar jschendejschende1 10 ionconfig s m production 10 m consumption 0 a range +0 2009/01/01-00:00:00 5 7 600 a range +0 2009/01/01-00:00:00 5 10 1 a contact +0 2009/01/01-00:00:00 5 7 10000 a contact +0 2009/01/01-00:00:00 7 5 10000 a contact +0 2009/01/01-00:00:00 5 10 100000 a contact +0 2009/01/01-00:00:00 10 5 100000 ion-open-source/configs/3node-ltp-brs/iontest.ipn.node5/0000775000175000017500000000000012356652303023543 5ustar jschendejschendeion-open-source/configs/3node-ltp-brs/iontest.ipn.node5/node5.ipnrc0000644000175000017500000000064312356652303025613 0ustar jschendejschende# Node 5 has a BRSC loopback route (i.e., it sends bundles to itself via # the BRS server at node 10). It also talks to node 10 by BRSC to # the BRS server at node 10. # It talks to node 7 by LTP/UDP/IP. # For all other nodes it uses a default route: via node 7. There is no # dynamic route computation. # a plan 5 brsc/brss.jpl.nasa.gov:5001_5 a plan 10 brsc/brss.jpl.nasa.gov:5001_5 a plan 7 ltp/7 a group 1 9999 7 ion-open-source/configs/3node-ltp-brs/iontest.ipn.node5/ionconfig0000644000175000017500000000033612356652303025441 0ustar jschendejschendewmSize 5000000 wmAddress 0 # configFlags = 14 means the ION data store is in a file (in /usr/ion) # only, transactions are reversible, and object boundaries are enforced. configFlags 14 heapWords 5000000 pathName /usr/ion ion-open-source/configs/3node-ltp-brs/iontest.ipn.node5/node5.ionrc0000644000175000017500000000046212356652303025611 0ustar jschendejschende1 5 ionconfig s a range +0 2009/01/01-00:00:00 5 7 600 a range +0 2009/01/01-00:00:00 5 10 1 a contact +0 2009/01/01-00:00:00 5 7 10000 a contact +0 2009/01/01-00:00:00 7 5 10000 a contact +0 2009/01/01-00:00:00 5 10 100000 a contact +0 2009/01/01-00:00:00 10 5 100000 ion-open-source/configs/3node-ltp-brs/iontest.ipn.node5/node5.ltprc0000644000175000017500000000014012356652303025614 0ustar jschendejschende1 128 262144 a span 7 128 1024 128 1024 1024 1024 1 'udplso host7:1113' s 'udplsi 0.0.0.0:1113' ion-open-source/configs/3node-ltp-brs/iontest.ipn.node5/ionstart0000755000175000017500000000017512356652303025335 0ustar jschendejschende# shell script to get node running #!/bin/bash ionadmin node5.ionrc sleep 1 ltpadmin node5.ltprc sleep 1 bpadmin node5.bprc ion-open-source/configs/3node-ltp-brs/iontest.ipn.node5/node5.bprc0000644000175000017500000000046712356652303025432 0ustar jschendejschende1 a scheme ipn 'ipnfw' 'ipnadminep' a endpoint ipn:5.0 x a endpoint ipn:5.1 x a endpoint ipn:5.2 x a protocol ltp 1400 100 a induct ltp 5 ltpcli a outduct ltp 7 ltpclo a protocol brsc 1400 100 a induct brsc brss.jpl.nasa.gov:5001_5 brsccla a outduct brsc brss.jpl.nasa.gov:5001_5 '' r 'ipnadmin node5.ipnrc' s ion-open-source/configs/loopback-tcp/0000775000175000017500000000000012356652303020245 5ustar jschendejschendeion-open-source/configs/loopback-tcp/loopback.bprc0000644000175000017500000000307712356652303022714 0ustar jschendejschende# bprc configuration file for the tcpcl dos loopback test. # Command: % bpadmin loopback.bprc # This command should be run AFTER ionadmin and # BEFORE ipnadmin or dtnadmin. # # Ohio University, Oct 2008 # Initialization command (command 1). 1 # Add an EID scheme. # The scheme's name is ipn. # The scheme's number is 1. Note that this number is defined for # Compressed Bundle Header Encoding (CBHE) schemes ONLY. All other # schemes (dtn for example) should use number -1. # This scheme's forwarding engine is handled by the program 'ipnfw.' # This scheme's administration program (acting as the custodian # daemon) is 'ipnadminep.' a scheme ipn 'ipnfw' 'ipnadminep' # Add endpoints. # Establish endpoints ipn:1.1 and ipn:1.2 on the local node. # The behavior for receiving a bundle when there is no application # currently accepting bundles, is to queue them 'q', as opposed to # immediately and silently discarding them (use 'x' instead of 'q' to # discard). a endpoint ipn:1.1 q a endpoint ipn:1.2 q # Add a protocol. # Add the protocol named tcp. # Estimate transmission capacity assuming 1400 bytes of each frame (in # this case, udp on ethernet) for payload, and 100 bytes for overhead. a protocol tcp 1400 100 # Add an induct. (listen) # Add an induct to accept bundles using the tcp protocol. # The induct itself is implemented by the 'tcpcli' command. a induct tcp 0.0.0.0:4556 tcpcli # Add an outduct. (send to yourself) # Add an outduct to send bundles using the tcp protocol. # The outduct itself is implemented by the 'tcpclo' command. a outduct tcp 127.0.0.1:4556 tcpclo s ion-open-source/configs/loopback-tcp/loopback.ionrc0000644000175000017500000000060612356652303023073 0ustar jschendejschende# ionrc configuration file for tcpcl dos loopback test. # This uses tcp as the primary convergence layer. # command: % ionadmin loopback.ionrc # This command should be run FIRST. # # Ohio University, Oct 2008 # Initialization command (command 1). # Set this node to be node 1 (as in ipn:1). # Use default sdr configuration (empty configuration file name ""). 1 1 "" # start ion node s ion-open-source/configs/loopback-tcp/loopback.ipnrc0000644000175000017500000000111412356652303023067 0ustar jschendejschende# ipnrc configuration file for the tcpcl dos loopback test. # Essentially, this is the IPN scheme's routing table. # Command: % ipnadmin loopback.ipnrc # This command should be run AFTER bpadmin (likely to be run last). # # Ohio University, Oct 2008 # Add an egress plan. # Bundles to be transmitted to element number 1 (that is, yourself). # This element is named 'node1.' # The plan is to queue for transmission (x) on protocol 'tcp' using # the outduct identified by IP address 127.0.0.1 # See your bprc file or bpadmin for outducts/protocols you can use. a plan 1 tcp/127.0.0.1:4556 ion-open-source/configs/loopback-tcp/loopback.ionsecrc0000644000175000017500000000000612356652303023560 0ustar jschendejschende1 e 1 ion-open-source/arch-uClibc/0000775000175000017500000000000012356652302016352 5ustar jschendejschendeion-open-source/arch-uClibc/ion.package/0000775000175000017500000000000012356652302020531 5ustar jschendejschendeion-open-source/arch-uClibc/ion.package/ion.mk0000755000175000017500000000771712356652302021664 0ustar jschendejschende############################################################# # # ion # ############################################################# #ION_VERSION_MAJOR=3 #ION_VERSION_MINOR=2.1 #ION_VERSION:=$(ION_VERSION_MAJOR).$(ION_VERSION_MINOR) ION_VERSION:=open-source ION_SOURCE:=ion-$(ION_VERSION).tar.gz #ION_SITE:=http://sourceforge.net/projects/ion-dtn/files define ION_BUILD_CMDS mkdir -p $(TARGET_DIR)/opt mkdir -p $(TARGET_DIR)/opt/bin mkdir -p $(TARGET_DIR)/opt/lib mkdir -p $(TARGET_DIR)/opt/include mkdir -p $(TARGET_DIR)/opt/man mkdir -p $(TARGET_DIR)/opt/man/man1 mkdir -p $(TARGET_DIR)/opt/man/man3 mkdir -p $(TARGET_DIR)/opt/man/man5 $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ici/arm-uClibc all $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ici/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/dgr/arm-uClibc all $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/dgr/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ltp/arm-uClibc all $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ltp/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bssp/arm-uClibc all $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bssp/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bp/arm-uClibc all $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bp/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/cfdp/arm-uClibc all $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/cfdp/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ams/arm-uClibc all $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ams/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bss/arm-uClibc all $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bss/arm-uClibc install endef define ION_INSTALL_TARGET_CMDS $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ici/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/dgr/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ltp/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bssp/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bp/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/cfdp/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ams/arm-uClibc install $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bss/arm-uClibc install endef define ION_CLEAN_CMDS $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ici/arm-uClibc clean $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/dgr/arm-uClibc clean $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ltp/arm-uClibc clean $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bssp/arm-uClibc clean $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bp/arm-uClibc clean $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/cfdp/arm-uClibc clean $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/ams/arm-uClibc clean $(MAKE) TCC="$(TARGET_CC)" TLD="$(TARGET_CC)" ROOT="$(TARGET_DIR)/opt" -C $(@D)/bss/arm-uClibc clean endef $(eval $(call GENTARGETS,package,ion)) ion-open-source/arch-uClibc/ion.package/Config.in0000755000175000017500000000071512356652302022272 0ustar jschendejschendeconfig BR2_PACKAGE_ION bool "ion" help ION is an implementation of DTN that is designed to run efficiently in embedded systems, including robotic spacecraft. It includes full implementations of Contact Graph Routing, Bundle Streaming Service, and the Licklider Transmission Protocol. It also includes implementations of the CCSDS standard protocols for file transfer (CFDP) and messaging middleware (AMS). https://ion.ocp.ohiou.edu/ ion-open-source/missing0000755000175000017500000001533012356652343015642 0ustar jschendejschende#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 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, see . # 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 case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." 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 # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ion-open-source/.stamp_downloaded0000644000175000017500000000000012356652302017547 0ustar jschendejschendeion-open-source/configure.ac0000644000175000017500000002756212356652303016537 0ustar jschendejschende# configure.ac for ION # Samuel Jero # June 14, 2013 # Process this file with autoconf to produce a configure script. AC_PREREQ(2.60) AC_INIT(ion, open source 3.2.1, http://korgano.eecs.ohiou.edu/mailman/listinfo/ion-bugs) IS_NASA_B=0 # Josh Schendel removed the -Werror on 05/15/2012 per issue #355 to deal with # all of the portability warnings introduced by autoconf v2.69 and # automake v1.12. #AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign]) AM_INIT_AUTOMAKE([subdir-objects -Wall foreign]) # some source file that will ensure that you are in the right directory. AC_CONFIG_SRCDIR([ici/include/ion.h]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([m4]) # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O #Automake v1.12 wants AM_PROG_AR, but it doesn't exist =3.2.0])], []) # # Control building /contrib utlities # AC_ARG_ENABLE( contrib, [AC_HELP_STRING([--disable-contrib],[Disable building third-party contributed utilities])], [case "${enableval}" in yes) BUILD_CONTRIB=yes;; no) BUILD_CONTRIB=no;; *) AC_MSG_ERROR([bad value ${enableval} for --enable-contrib]);; esac], [BUILD_CONTRIB=yes]) AM_CONDITIONAL(BUILD_CONTRIB, test "x$BUILD_CONTRIB" = "xyes") # # Allow user to disable crypto... if crypto is even enabled # if test "$IS_NASA_B" = "1"; then # To Disable crypto, use "./configure --disable-crypto" AC_ARG_ENABLE([crypto], [ --disable-crypto Turn off cryptography], [case "${enableval}" in yes) crypto=true ;; no) crypto=false ;; *) AC_MSG_ERROR([bad value ${enableval} for --disable-crypto]) ;; esac],[crypto=true]) AM_CONDITIONAL([CRYPTO], [test x$crypto = xtrue]) if test x$crypto = xtrue; then echo "" #DoStuff else AC_SUBST( [CRYPTO_LIBS], [""] ) fi AC_DEFINE([NASA_PROTECTED_FLIGHT_CODE],[1],[Build ION NASA protected flight code]) else AM_CONDITIONAL([CRYPTO], [false]) AC_SUBST( [CRYPTO_LIBS], [""] ) fi # # Control whether AMS debugging info is printed. # if test "$IS_NASA_B" = "0"; then AC_ARG_ENABLE([ams-debug], [ --enable-ams-debug Enable AMS debugging info], [ AC_DEFINE([AMSDEBUG], 1, [Enable AMS debugging info]) ]) fi # # Dynamically choose whether or not to instrument code for gcov code coverage # Default is not to instrument the code for gcov code coverage. # AC_ARG_WITH([gcov], [AS_HELP_STRING([--with-gcov], [Turn on code coverage instrumentation])], [gcov=yes;], []) if test "x$gcov" = "xyes" ; then echo "Instrument code for gcov coverage analysis... yes" CFLAGS="$CFLAGS -g -O0 -fprofile-arcs -ftest-coverage" LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage -lgcov" else echo "Instrument code for gcov coverage analysis... no" fi AM_CONDITIONAL([ENABLE_GCOV], [test "x$gcov" = "xyes"]) # # Dynamically choose whether or not to build against expat libraries. # Expat is needed by AMS if XML configuration files are used. # Default is not to build against libexpat. # AC_ARG_WITH([expat], [AS_HELP_STRING([--with-expat], [Turn on libexpat requirements])], [expat=yes;], []) if test "x$expat" = "xyes" ; then echo "Build against libexpat... yes" else echo "Build against libexpat... no" CFLAGS="$CFLAGS -DNOEXPAT" fi AM_CONDITIONAL([ENABLE_EXPAT], [test "x$expat" = "xyes"]) # # If valgrind is present, allow special MTAKE/MRELEASE valgrind tutors. # AC_ARG_ENABLE([valgrind], AC_HELP_STRING([--disable-valgrind],[Do not enable valgrind debugging [default=check]]), [ ], [ enable_valgrind=check ]) if test "x$enable_valgrind" != xno; then AC_CHECK_HEADER(valgrind/valgrind.h, [AC_DEFINE([HAVE_VALGRIND_VALGRIND_H], [1], [enable valgrind macros]) valgrind_present=yes], [valgrind_present=no]) if test "x$enable_valgrind" == xyes && test "x$valgrind_present" == xno; then # User specifically requested valgrind but we can't find it. AC_MSG_ERROR([valgrind/valgrind.h not found but --enable-valgrind requested]) fi if test "x$valgrind_present" == xyes; then # Valgrind < 3.6.1-1 (Debian/Ubuntu) and gcc >= 4.6 triggers "unused-but-set-variable" # warnings in the valgrind macros. This version is present in debian unstable # 10/11, and Ubuntu 11.10. AC_MSG_CHECKING([if valgrind is compatible with -Wunused-but-set]) ORIGCFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wall -Werror" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[VALGRIND_MALLOCLIKE_BLOCK(1, 100, 0, 1); VALGRIND_FREELIKE_BLOCK(1, 0);]])], [AC_MSG_RESULT([yes]); valgrind_wunused_but_set_compat=yes], [AC_MSG_RESULT([no]); valgrind_wunused_but_set_compat=no]) CFLAGS="$ORIGCFLAGS" # If not compatible with -Wset-but-not-used, then disable this warning. if test "x$valgrind_wunused_but_set_compat" == "xno"; then AC_MSG_NOTICE([adding -Wno-unused-but-set-variable to VALGRIND_COMPAT_CFLAGS]) AC_SUBST([VALGRIND_COMPAT_CFLAGS], [-Wno-unused-but-set-variable]) fi fi fi # Check for libraries. ORIGCFLAGS="$CFLAGS" CFLAGS="$AM_CFLAGS $CFLAGS" AC_CHECK_LIB( [expat], [XML_GetCurrentLineNumber], [ AC_SUBST( [EXPAT_LIBS], ["-lexpat"] ) ], [ AM_COND_IF([ENABLE_EXPAT], AC_MSG_ERROR([You need to install the libexpat1-dev library to build with expat.]), AC_MSG_WARN([If you wish to use XML configuration files for AMS you will need to compile against the Expat XML development libraries. To do this install the libexpat1-dev library then recompile ION using the "./configure --with-expat" flag.]) )] ) AC_CHECK_LIB( [pthread], [pthread_create], [ AM_LDFLAGS="$AM_LDFLAGS -lpthread" ], [AC_MSG_ERROR([You need pthread library.]) ] ) CFLAGS="$ORIGCFLAGS" # Check for programs to build documentation AC_CHECK_PROGS([POD_DOCUMENTATION], [pod2man pod2html], [1] ) if test "$POD_DOCUMENTATION" = 1; then echo "ERROR: You need to have pod2man for documentation." exit -1 fi # Check for tools to compile documentation into ION.pdf AC_PATH_PROG([PS2PDF], [ps2pdf]) AC_PATH_PROG([PDF2PS], [pdf2ps]) AC_PATH_PROG([PSJOIN], [psjoin]) AC_MSG_CHECKING([for fallback included psjoin]) if test -x "$PWD/doc/psjoin"; then PSJOIN="$PWD/doc/psjoin" AC_MSG_RESULT($PSJOIN) else AC_MSG_RESULT([not found]) fi AC_PATH_PROG([GROFF], [groff]) AC_MSG_CHECKING([if groff suports -ms]) if test "$GROFF" && echo | $GROFF -ms - >/dev/null 2>/dev/null; then AC_MSG_RESULT($GROFF) GROFFMS="$GROFF" else AC_MSG_RESULT([not found]) AC_MSG_NOTICE([try installing groff and the ms plugin]) fi AC_SUBST([GROFFMS], $GROFFMS) AC_PATH_PROG([MANOPTS], [man]) AC_MSG_CHECKING([if man supports -l]) if test "$MANOPTS" && echo | $MANOPTS -l - >/dev/null 2>/dev/null; then AC_MSG_RESULT($MANOPTS) else MANOPTS="" AC_MSG_RESULT([not found]) AC_MSG_NOTICE([try installing a version of man that supports -l]) fi AC_SUBST([MANOPTS], $MANOPTS) AC_MSG_CHECKING([for tools to build autodoc]) if test "$PS2PDF" && test "$PDF2PS" && test "$PSJOIN" && test "$GROFFMS" && test -n "$MANOPTS"; then AC_MSG_RESULT([found]) buildautodoc="yes" else AC_MSG_RESULT([not found (skipping autodoc)]) AC_MSG_NOTICE([Ensure the ghostscript, psutils, groff-base and groff packages are installed.]) fi AM_CONDITIONAL([ENABLE_AUTODOC], [ test "$buildautodoc" ]) # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fcntl.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h]) AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_UID_T # Checks for library functions. # commented out library functions that should exist everywhere. # otherwise, autoconf insisted that malloc.c, mktime.c were included in distro... AC_FUNC_FORK AC_PROG_GCC_TRADITIONAL #AC_FUNC_MALLOC #AC_FUNC_MEMCMP #AC_FUNC_MKTIME #AC_FUNC_SELECT_ARGTYPES AC_TYPE_SIGNAL #AC_FUNC_STAT #AC_FUNC_STRFTIME AC_CHECK_FUNCS([alarm ftruncate getcwd gethostbyaddr gethostbyname gethostname gettimeofday memset mkdir mkfifo rmdir select socket strcasecmp strchr strerror strncasecmp strstr strtoul uname]) #Write AM_* flag variables AC_SUBST([AM_LDFLAGS],"$AM_LDFLAGS") AC_SUBST([AM_CFLAGS],"$AM_CFLAGS") AC_SUBST([AM_LIBTOOLFLAGS],"$AM_LIBTOOLFLAGS") AM_CONDITIONAL([ION_NASA_B],[test "$IS_NASA_B" = "1"]) AM_CONDITIONAL([LINUX_BUILD], [test "x$PLATFORM" = "xlinux"]) #Output! AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([contrib/Makefile]) AC_OUTPUT ion-open-source/contrib/0000775000175000017500000000000012356652345015705 5ustar jschendejschendeion-open-source/contrib/README.txt0000644000175000017500000000277512356652303017406 0ustar jschendejschende******************************************************************* NO WARRANTY: DISCLAIMER THE SOFTWARE AND/OR RELATED MATERIALS ARE PROVIDED "AS-IS" WITHOUT WARRANTY OF ANY KIND INCLUDING ANY WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE OR PURPOSE (AS SET FORTH IN UCC 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE LICENSED PRODUCT, HOWEVER USED. IN NO EVENT SHALL CALTECH/JPL BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING BUT NOT LIMITED TO INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER CALTECH/JPL SHALL BE ADVISED, HAVE REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY. USER BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF THE SOFTWARE AND/OR RELATED MATERIALS. ******************************************************************* Copyright 2002-2011, by the California Institute of Technology. ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledged. This software and/or related materials may be subject to U.S. export control laws. By accepting this software and related materials, the user agrees to comply with all applicable U.S. export laws and regulations. User has the responsibility to obtain export licenses or other export authority as may be required before exporting the software or related materials to foreign countries or providing access to foreign persons. ******************************************************************* ion-open-source/contrib/cgr-viewer/0000775000175000017500000000000012356652303017751 5ustar jschendejschendeion-open-source/contrib/cgr-viewer/cgr-viewer.html0000644000175000017500000000726212356652303022716 0ustar jschendejschende CGR Viewer

Parameters

Route Path
Dispatch Time
Expiration Time
Bundle Size
Bundle Class

Legend

Circle Trapezium Upside-down Trapezium Red Arrow Black Arrow Grey Arrow
Node Local Destination Hop Active Inactive

Dispatch Time
Delivery Time
Max Capacity
Route Graph
ion-open-source/contrib/cgr-viewer/js/0000775000175000017500000000000012356652303020365 5ustar jschendejschendeion-open-source/contrib/cgr-viewer/js/cgr-viewer.js0000644000175000017500000001743012356652303023000 0ustar jschendejschende// How to format dates. var TIME_FMT = "ddd MMM DD YYYY hh:mm:ss A"; // Keycode of escape key. var ESCAPE_KEYCODE = 27; var win = $(window); var doc = $(document); var main = $("main"); var body = $("body"); var stars = $("#stars"); var cover = $("#cover"); var board = $("#board"); var boxes = $("#boxes"); var fileChooser = $("#fileChooser"); var bigButtonWrapper = $("#bigButtonWrapper"); var bigButton = $("#bigButton"); var pulldown = $("#pulldown"); var pulldownWrapper = $("#pulldownWrapper"); var pulldownDisplays = $(".pulldownDisplay"); var paramRoute = $("#paramRoute"); var paramDispatchTime = $("#paramDispatchTime"); var paramExpTime = $("#paramExpTime"); var paramBundleSize = $("#paramBundleSize"); var paramBundleClass = $("#paramBundleClass"); var navTabs = $("nav li"); var selectTabAnchor = $("#selectTab > a"); var routeTemplate = $("#routeTemplate"); // Create a clone of template. function cloneTemplate(template) { return template.clone(true).removeAttr("id"); } // Capitalize str. function cap(str) { return str.charAt(0).toUpperCase() + str.slice(1); } function simplifySize(x) { var UNITS = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]; var unit; unit = Math.floor(Math.log(x) / Math.log(1024)); unit = Math.max(unit, 0); unit = Math.min(unit, UNITS.length - 1); x /= Math.pow(1024, unit); return x.toPrecision(3) + " " + UNITS[unit]; } function hidePulldown() { navTabs.removeClass("selectedTab"); pulldownDisplays.addClass("isHidden"); pulldownWrapper.addClass("isHidden"); } function blurBackground() { cover.show(); main.addClass("blur"); } function unblurBackground() { cover.hide(); main.removeClass("blur"); } function closeZoomBox() { var zoomBox = $("#zoomBox"); if (!zoomBox[0]) return; zoomBox.remove(); unblurBackground(); } // Build a box for a route. function fillRoute(box, route, constants) { // Number of pixels to magnify the box. var MAGNIFY_PIXELS = 50; // Number of pixels to remove from all margins. var CONTRACT_PIXELS = -MAGNIFY_PIXELS / 2; var fromMoment = moment.unix(route.fromTime); var deliveryMoment = moment.unix(route.deliveryTime); var frame = $(".frame", box); var overlay = $(".overlay", box); var reason = $("p", box); var heading = $("h1", box); var graphDiv = $(".graph", box); var graph = $("img", box); $(".dispatchTime", box).html(fromMoment.format(TIME_FMT)); $(".deliveryTime", box).html(deliveryMoment.format(TIME_FMT)); $(".maxCapacity", box) .html(simplifySize(route.maxCapacity) + " (Payload Class " + (route.payloadClass + 1) + ")") .attr("title", route.maxCapacity + " bytes"); // Wait until the image is loaded before using its dimensions, else they read // as zero. graph.attr("src", route.graph).one("load", function() { var imgHeight = graph[0].height; var divHeight = graphDiv.height(); var divWidth = graphDiv.width(); // If the image is shorter than the div, then clamp the div's height. if (imgHeight && imgHeight <= divHeight) { divHeight = imgHeight; overlay.hide(); } graphDiv.height(divHeight); box .mouseenter(function(e) { graphDiv.width(divWidth + MAGNIFY_PIXELS); // If the image is taller than the div, then magnify on all sides. Else, // only magnify the width. if (imgHeight > divHeight) { graphDiv.height(divHeight + MAGNIFY_PIXELS); frame.css("margin", CONTRACT_PIXELS); } else { frame.css({ "margin-left": CONTRACT_PIXELS, "margin-right": CONTRACT_PIXELS, }); } }) .mouseleave(function(e) { graphDiv.width("").height(divHeight); frame.css("margin", ""); }) .click(function(e) { var clone = $(this).clone(true); $(".frame", clone).css("margin", ""); $(".graph", clone).width("").height(""); blurBackground(); clone .attr("id", "zoomBox") .css("top", window.pageYOffset) .off("mouseenter mouseleave click") .appendTo(body) .css("margin-left", -clone.width() / 2); cover .addClass("clickable") .one("click", function(e) { cover.removeClass("clickable"); }); }); }); if (route.flag == constants.SELECTED) reason.html("Best route found"); else reason.html(cap(route.ignoreReason)); switch (route.flag) { case constants.SELECTED: box.addClass("selectedRoute"); heading.html("Selected"); break; case constants.CONSIDERED: heading.html("Considered"); break; case constants.IDENTIFIED: heading.html("Not Considered"); break; default: heading.html("Ignored"); break; } } // Build boxes for all routes. function handleRoutes(routes, constants) { var selected = []; var considered = []; var identified = []; var ignored = []; $.each(routes, function(i, route) { var box = cloneTemplate(routeTemplate); fillRoute(box, route, constants); switch (route.flag) { case constants.SELECTED: selected.push(box); break; case constants.CONSIDERED: considered.push(box); break; case constants.IDENTIFIED: identified.push(box); break; default: ignored.push(box); break; } }); $.each([selected, considered, identified, ignored], function() { $.each(this, function() { boxes.append(this); }); }); } // Fill in global parameters. function handleParams(params) { var execMoment = moment.unix(params.execTime); var dispatchMoment = moment.unix(params.dispatchTime); var expMoment = moment.unix(params.expirationTime); paramRoute.html("Node " + params.localNode + " to Node " + params.destNode); paramDispatchTime.html(dispatchMoment.format(TIME_FMT)); paramExpTime.html(expMoment.format(TIME_FMT)); paramBundleSize .html(simplifySize(params.bundleSize)) .attr("title", params.bundleSize + " bytes"); paramBundleClass.html(params.minLatency ? "Minimum Latency" : "Best Effort"); } function handleJSON(cgr) { handleParams(cgr.params); handleRoutes(cgr.routes, cgr.constants); } fileChooser.change(function(e) { var file = fileChooser.get(0).files[0]; var reader = new FileReader(); reader.addEventListener("load", function(e) { blurBackground(); boxes.empty(); handleJSON(JSON.parse(reader.result)); win.off("resize").resize(function(e) { var boxDivs = $(".box", board); var width = boxDivs.outerWidth(true); // Snap boxes into columns depending on the width of the page. board.width(Math.max(Math.min(Math.floor(win.width() / width), boxDivs.length), 1) * width); }).resize().scrollTop(0); bigButtonWrapper.hide(); pulldown.show(); unblurBackground(); }); reader.readAsText(file); }) $.each([ ["#paramsTab", "#params"], ["#legendTab", "#legend"], ], function(i, pair) { var tab = $(pair[0]); var display = $(pair[1]); $("a", tab).click(function(e) { e.preventDefault(); $(this).blur(); if (tab.hasClass("selectedTab")) { hidePulldown(); } else { navTabs.removeClass("selectedTab"); tab.addClass("selectedTab"); pulldownWrapper.removeClass("isPeeking"); pulldownDisplays.addClass("isHidden"); display.removeClass("isHidden"); pulldownWrapper.removeClass("isHidden"); } }); }); stars.click(hidePulldown); cover.click(closeZoomBox); doc.keydown(function(e) { if (e.keyCode == ESCAPE_KEYCODE) closeZoomBox(); }); $.each([bigButton, selectTabAnchor], function() { this.click(function(e) { e.preventDefault(); fileChooser.click(); }); }); pulldownDisplays.addClass("isHidden"); pulldown.hide(); blurBackground(); bigButton.focus(); ion-open-source/contrib/cgr-viewer/Readme.md0000644000175000017500000000365112356652303021473 0ustar jschendejschende# CGR Viewer CGR Viewer takes a JSON file output by `cgrfetch` and builds a visualization of it in webpage form. # How to Use First, run `cgrfetch` to obtain a JSON file of a CGR simulation. This looks something like: ionstart -I CONFIG.rc cgrfetch -o cgr.json DEST-NODE See `cgrfetch --help` and `man cgrfetch` for more information on the tool. Then, load up `cgr-viewer.html` in a web browser and click the Choose JSON button. Browse to a cgrfetch JSON file and select it. The page will then be populated with routes from that simulation. At the very top of the page are three tab buttons -- Parameters, Legend, and Choose JSON. Click on the Parameters tab to view the parameters of the simulation -- the local and destination nodes, requested dispatch time, expiration time, and bundle size and class. Click on the Legend tab to see descriptions of the symbols used in the route graphs. Click again on the active tab or on the page background to close the tab menu. Below the tab menu, each route is represented by a box. At the top of each box is a classification as determined by CGR -- Selected, Considered, Not Considered, or Ignored. Directly beneath the classification is the reason CGR made its decision. Below the classification and reason are the calculated parameters of the route -- dispatch time, delivery time, and the max payload/payload class. Hover over the max payload to see the precise number of bytes. Finally at the base of each box is a graph of the route. Click anywhere on the box to view a full-size version of the graph. To return to the normal view, click anywhere outside the box or hit the escape key. Use the Choose JSON button to repopulate the page with a different JSON file. # Requirements CGR Viewer has been tested with Firefox 17-27 and Chrome 28-30. # Future Work - Test in more browsers - Add error handling for invalid JSON, etc. - Add specialized print stylesheet for saving to pdf/printing ion-open-source/contrib/cgr-viewer/img/0000775000175000017500000000000012356652303020525 5ustar jschendejschendeion-open-source/contrib/cgr-viewer/img/sink.svg0000644000175000017500000000124612356652303022213 0ustar jschendejschende %3 b ion-open-source/contrib/cgr-viewer/img/node.svg0000644000175000017500000000117312356652303022173 0ustar jschendejschende %3 c ion-open-source/contrib/cgr-viewer/img/bg.png0000644000175000017500000001752012356652303021626 0ustar jschendejschendePNG  IHDRIDATxKr9PQIm>4Bȉ{T$*[.pEjyO2INt)"(r֛U,,M1%i=fhr&{na[#+ȣఀ=c""B$PأA!βHHTD`b{ p4"h sXcq N-0Đ2qoL}5ؙSmӞ{뇦R8g`c 1"bcH㜣'Q2Cz.l l,@2L6 nXQb]{%kԼNn3`@Ώu#بo(耼 &Hqݬ+h}~o U(&E$I(> 0ii@m;^b -Z&ᄍ@ύP.=$ȵw. {"`@}&4XS3) '@ _@kLg@cuV@E{ֆ QP$NM"h$Dh,/M\`D, F_;BJ)ׁ`0@Mba ˸1pxw(a=P{k$AFvyR!:L9kC5 9H-v ވP0< I٩ۜxIpo +j3ԘaŽq hl~LqV?UO !h.Gǩ9Px]&)Hv4  plG=g Z5-8@QaB8`cj}C1gp'< ?;n )J)WQumݿfABg { 䰍&mF:4ŽX G<4,8Hz^(,`KYs+/odl@3gx / }L/`e0xA@3y{ >UHog+aBPh2&F7$D TKbUX|Szd~Avް&s $4e`W. =졔r?7cbq`}X\~-!AVQϡGQ豆7Hد)WbIMI@.@慄{ׇ@B8~Mi  5gZA=0! Z s>piXa殧Xa1ziP438 Ɂzb@0* jkpEl+'yO.'8haYUJw w' ?K , McO,m+- 4!UQpNy9M@D2"?X%:}@b+@C}``Pc@_3`x9 pÕHH+ Aп`ӋXo:%MlOvp1$0SNs^XZ[x4>D)YA+'O1v_D 4)K\r$'ϵ7w@n4u~ɻz د ,%* ؇$V-,`0H UY ፭ `mկd$؈sX,/yg;0m:Lhc@VD0pO* /[3R pט  44XgI bG9<C"ڞcr3HIoC!GdI#bnu" 10;p4H`c'bi & `7@!3nO fiX +8_}/`h$71k a8C| {`]b gq%W+a b @c9W@{pVP<PG7a>v z&Rb@WFb 4+h hH܀ @(.@  M,6^VuW+`?:gxsq&%UR4: FUJ:t%(w̰r<ଂ}NR#"k8К$@.?4 5n`B90ˎwoS"\+ ;A~=<kBW `Hy" &D* C @\8!NP&Pcn4i-vшVo$D1oq E]Q# ȍ+^ZAM"5Hȥ$wY!$[` PCa1DΡ=u4tq䯮gϭsr5V>WQ._(^s|f Q(M5;NM 3DxOQgi@șCp!2w@OEWKp XٔwRa!טh|x]p6XVmy ?R $q,a0H54M%0 kpFT18W`hD0A {yWEčvQ@f(e2Hh>cIO0x}Xܬa@SXEޜ&7A'Q;`mSE[/Ju8~4s l­h>H 9B 5Dׇ"mG }x`&u#  0Hp{.VD΀g^k @KMDһTt,(@/罔ru94HHN?Fm}+p*|)| T y;y<@+?n: e^ x7Hn(B>C7Y}b=(1`@S4\{@ X!VQg #0(d#JM#pwh}?ڣ86|Ej/4`XK/w0܉f4"bbn s0u4 bfYu_D'@# &@d9@Bv ÓȞ1`r0i AQ>)M:pXxL\:67\ !O(΀s  0(Z+ lFs&3r- gC5}'E ;KDw ,ÿ5Q4B puvitoVQ0i/ m* ghQ W l""x4398 Gum#E3uci!ùr+ eX,/`onY?xF"70BS 8&֙N 1΢}u4Þ! z 6-4 % 1ؼ%hЏHz96}/ h蝛@b (+4P4;K4,!`f! Ur- ÝAR2y@$6V:m@@ 8[asg!PJ3l(yal0L(NLCNܱ3i k2'^ U}3_s !>@  qgQ K{&mcazvgDD`VI ٨Y)* ,<9Ϊ;\r<". 0@]o @>ִ¿ }Oaϻ (qQExh˼¿75z#vzl͋-V^<_pox'%txnIWykt܉<!A -(02HC90* `0ý?i` u?WX(# !_YƸ$*Vg{n< Σ.: @ڻ`Cn(.}o,r!miHtwU Hx^kЄFc<.$hj& @7Hg!<p_#u54 yϾdN77+&@g' ,x `ATE] t@ )ns] tWܪ(AF4=w/ y10H4b4$hH/ߚ]D`ܡf7A`[tfe $ pF4<* `eЙ70  lM`}$?HРRUy2""D ^ t̝H2 +7M8pS p:I3p@v$t,"fQa Yy8NoxUQ! {krW$5FwL6=c!1H^`Us<%* 3Ddx oē( &Q@Ű1h W(hy؇U% *t:3?L<ב>swXypBc( N  r2 \A8~+* qw}r(ވl5 ,$@C* A 8쯔rHb>ۏesDHZaA { >|zN( [@3 !XhЯ d=~uX6DֳbNH$}6 Mjq rc 91E$ȃQfsW&7Hh8ocBWEfDD9  [$PDK;:HLe]@]d +I@0H` 88Ӏ&a MC%0lDr}$|u4u'Q8B&}{7tЬ&7 I?C$p(q`08obdIENDB`ion-open-source/contrib/cgr-viewer/img/source.svg0000644000175000017500000000127212356652303022546 0ustar jschendejschende %3 a ion-open-source/contrib/cgr-viewer/img/hop.svg0000644000175000017500000000156412356652303022040 0ustar jschendejschende %3 e->f ion-open-source/contrib/cgr-viewer/img/active.svg0000644000175000017500000000156412356652303022525 0ustar jschendejschende %3 c->d ion-open-source/contrib/cgr-viewer/img/blur.svg0000644000175000017500000000017212356652303022210 0ustar jschendejschende ion-open-source/contrib/cgr-viewer/img/inactive.svg0000644000175000017500000000156412356652303023054 0ustar jschendejschende %3 g->h ion-open-source/contrib/cgr-viewer/css/0000775000175000017500000000000012356652303020541 5ustar jschendejschendeion-open-source/contrib/cgr-viewer/css/normalize.css0000644000175000017500000001656412356652303023265 0ustar jschendejschende/*! normalize.css v2.1.2 | MIT License | git.io/normalize */ /* ========================================================================== HTML5 display definitions ========================================================================== */ /** * Correct `block` display not defined in IE 8/9. */ article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } /** * Correct `inline-block` display not defined in IE 8/9. */ audio, canvas, video { display: inline-block; } /** * Prevent modern browsers from displaying `audio` without controls. * Remove excess height in iOS 5 devices. */ audio:not([controls]) { display: none; height: 0; } /** * Address `[hidden]` styling not present in IE 8/9. * Hide the `template` element in IE, Safari, and Firefox < 22. */ [hidden], template { display: none; } /* ========================================================================== Base ========================================================================== */ /** * 1. Set default font family to sans-serif. * 2. Prevent iOS text size adjust after orientation change, without disabling * user zoom. */ html { font-family: sans-serif; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */ } /** * Remove default margin. */ body { margin: 0; } /* ========================================================================== Links ========================================================================== */ /** * Remove the gray background color from active links in IE 10. */ a { background: transparent; } /** * Address `outline` inconsistency between Chrome and other browsers. */ a:focus { outline: thin dotted; } /** * Improve readability when focused and also mouse hovered in all browsers. */ a:active, a:hover { outline: 0; } /* ========================================================================== Typography ========================================================================== */ /** * Address variable `h1` font-size and margin within `section` and `article` * contexts in Firefox 4+, Safari 5, and Chrome. */ h1 { font-size: 2em; margin: 0.67em 0; } /** * Address styling not present in IE 8/9, Safari 5, and Chrome. */ abbr[title] { border-bottom: 1px dotted; } /** * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. */ b, strong { font-weight: bold; } /** * Address styling not present in Safari 5 and Chrome. */ dfn { font-style: italic; } /** * Address differences between Firefox and other browsers. */ hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; } /** * Address styling not present in IE 8/9. */ mark { background: #ff0; color: #000; } /** * Correct font family set oddly in Safari 5 and Chrome. */ code, kbd, pre, samp { font-family: monospace, serif; font-size: 1em; } /** * Improve readability of pre-formatted text in all browsers. */ pre { white-space: pre-wrap; } /** * Set consistent quote types. */ q { quotes: "\201C" "\201D" "\2018" "\2019"; } /** * Address inconsistent and variable font size in all browsers. */ small { font-size: 80%; } /** * Prevent `sub` and `sup` affecting `line-height` in all browsers. */ sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } /* ========================================================================== Embedded content ========================================================================== */ /** * Remove border when inside `a` element in IE 8/9. */ img { border: 0; } /** * Correct overflow displayed oddly in IE 9. */ svg:not(:root) { overflow: hidden; } /* ========================================================================== Figures ========================================================================== */ /** * Address margin not present in IE 8/9 and Safari 5. */ figure { margin: 0; } /* ========================================================================== Forms ========================================================================== */ /** * Define consistent border, margin, and padding. */ fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } /** * 1. Correct `color` not being inherited in IE 8/9. * 2. Remove padding so people aren't caught out if they zero out fieldsets. */ legend { border: 0; /* 1 */ padding: 0; /* 2 */ } /** * 1. Correct font family not being inherited in all browsers. * 2. Correct font size not being inherited in all browsers. * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. */ button, input, select, textarea { font-family: inherit; /* 1 */ font-size: 100%; /* 2 */ margin: 0; /* 3 */ } /** * Address Firefox 4+ setting `line-height` on `input` using `!important` in * the UA stylesheet. */ button, input { line-height: normal; } /** * Address inconsistent `text-transform` inheritance for `button` and `select`. * All other form control elements do not inherit `text-transform` values. * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. * Correct `select` style inheritance in Firefox 4+ and Opera. */ button, select { text-transform: none; } /** * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` * and `video` controls. * 2. Correct inability to style clickable `input` types in iOS. * 3. Improve usability and consistency of cursor style between image-type * `input` and others. */ button, html input[type="button"], /* 1 */ input[type="reset"], input[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ } /** * Re-set default cursor for disabled elements. */ button[disabled], html input[disabled] { cursor: default; } /** * 1. Address box sizing set to `content-box` in IE 8/9. * 2. Remove excess padding in IE 8/9. */ input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ } /** * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome * (include `-moz` to future-proof). */ input[type="search"] { -webkit-appearance: textfield; /* 1 */ -moz-box-sizing: content-box; -webkit-box-sizing: content-box; /* 2 */ box-sizing: content-box; } /** * Remove inner padding and search cancel button in Safari 5 and Chrome * on OS X. */ input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } /** * Remove inner padding and border in Firefox 4+. */ button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } /** * 1. Remove default vertical scrollbar in IE 8/9. * 2. Improve readability and alignment in all browsers. */ textarea { overflow: auto; /* 1 */ vertical-align: top; /* 2 */ } /* ========================================================================== Tables ========================================================================== */ /** * Remove most spacing between table cells. */ table { border-collapse: collapse; border-spacing: 0; } ion-open-source/contrib/cgr-viewer/css/cgr-viewer.css0000644000175000017500000001072712356652303023332 0ustar jschendejschendebody { background: linear-gradient(#000f1a 80%, #001729); background-repeat: no-repeat; background-attachment: fixed; font: 10pt sans-serif; /* always show the scrollbar so there is no jittering */ overflow-y: scroll; } main { position: absolute; left: 0; right: 0; top: 0; bottom: 0; } .defs { margin: 0 auto; } .defs td { padding: 0 0 1px 0; } .defs td:last-child { font-family: monospace; padding-left: 2em; } tr:last-child td { padding-bottom: 0; } .clear { /* HACK to CSS-preload blur image */ filter: url(../img/blur.svg#blur); clear: both; } .clickable { cursor: pointer; } .blur { /* Blur is very laggy, so disable it for now. */ /* filter: url(../img/blur.svg#blur); */ } #stars { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: url(../img/bg.png); } #cover { background-color: #000; opacity: 0.5; position: fixed; top: 0; right: 0; bottom: 0; left: 0; } #templates, #fileChooser { display: none; } #stars { z-index: 0; } #pulldownWrapper { z-index: 1; } nav { z-index: 2; } .frame { z-index: 3; } #cover { z-index: 4; } #zoomBox, #bigButtonWrapper { z-index: 5; } #board { padding: 1em 0; margin: 0 auto; } .box { list-style: none; float: left; margin: 2em; cursor: pointer; } .frame { position: relative; background-clip: padding-box; box-shadow: 0 0 8px rgba(0, 0, 0, 0.5); border: 1px solid rgba(0, 0, 0, 0.5); background-color: #fff; } .overlay { position: absolute; top: 0; right: 0; bottom: 1.5ex; left: 0; background: linear-gradient(rgba(255, 255, 255, 0) 70%, #fff); } .box header { color: #fff; } .box h1 { padding: 1.5ex 0; background-color: #222; margin: 0; text-transform: uppercase; font: bold 12pt sans-serif; text-align: center; } .box p { background-color: #1d1d1d; margin: 0; text-align: center; padding: 0.5ex 0; } .data { background-color: #f1f1f1; padding: 1.5ex 2em; } .graphWrapper { position: relative; padding: 1.5ex 1.5em; } .graph { width: 400px; height: 400px; overflow: hidden; } .graph img { display: block; margin: 0 auto; } .selectedRoute h1 { background-color: #0B3D91; } .selectedRoute p { background-color: #0a3782; } #zoomBox { cursor: auto; position: absolute; left: 50%; margin: 0; padding: 1ex 0; } #zoomBox .graphWrapper { padding: 1.5ex 8em; } #zoomBox .graph { width: auto; height: auto; } #zoomBox .overlay { display: none; } #pulldownWrapper { position: relative; box-shadow: 0 0 8px rgba(0, 0, 0, 0.5); padding: 2ex 2em; background-color: #fff; border-bottom: 1px solid rgba(0, 0, 0, 0.3); margin-bottom: -1px; } #pulldownWrapper.isHidden { display: none; } #pulldownWrapper h1 { border-bottom: 1px solid #000; font: bold 11pt sans-serif; margin: 0 0 0.5ex 0; padding: 0 0 0.25ex 0; } .pulldownDisplay { display: inline-block; } .pulldownDisplay.isHidden { display: none; } #legend td { padding: 0; text-align: center; } nav { position: absolute; width: 100%; } nav ul { margin: 0; padding: 0 2em; } nav li { list-style: none; float: left; margin: 0; } nav a { background-clip: padding-box; box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.3); border: 1px solid rgba(0, 0, 0, 0.3); border-top: 2px solid #ccc; background-color: #f1f1f1; color: inherit; text-decoration: none; display: block; padding: 0.5ex 1em 0.75ex 1em; } nav a:hover { background-color: #fbfbfb; } .selectedTab a { background-color: #fff; border-top-color: #fff; } .selectedTab a:hover { background-color: #fff; } #selectTab a:hover { background-color: #0B3D91; } #selectTab { float: right; } #selectTab a { background-color: #0B3D91; border-top-color: #04255E; color: #fff; } #bigButtonWrapper { cursor: pointer; width: 290px; height: 100px; margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; } #bigButtonBacking { box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); margin-top: -25%; } #bigButton { border-left: 4px solid #04255E; border-right: 4px solid #04255E; border-top: 1px solid #04255E; border-bottom: 32px solid #04255E; background-color: #0B3D91; display: block; text-align: center; padding: 2ex 1em; color: #fff; text-decoration: none; font: bold 24pt sans-serif; } #bigButton:focus { outline: none; } #bigButton:hover { margin-top: 4px; border-bottom-width: 28px; } #bigButton:active { margin-top: 12px; border-bottom-width: 20px; } ion-open-source/contrib/cgr-viewer/css/blur.svg0000644000175000017500000000017212356652303022224 0ustar jschendejschende ion-open-source/contrib/Makefile.in0000664000175000017500000017710612356652345017766 0ustar jschendejschende# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # Makefile.am # # Samuel Jero # July 22, 2013 # # Makefile.am VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ @LINUX_BUILD_TRUE@bin_PROGRAMS = $(am__EXEEXT_1) subdir = contrib DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(am__noinst_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/./dccp_macro.m4 $(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 = CONFIG_CLEAN_VPATH_FILES = 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 = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" LTLIBRARIES = $(lib_LTLIBRARIES) libal_bp_vION_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_libal_bp_vION_la_OBJECTS = \ dtnperf/al_bp/src/libal_bp_vION_la-al_bp_api.lo \ dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn.lo \ dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn_conversions.lo \ dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion.lo \ dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion_conversions.lo libal_bp_vION_la_OBJECTS = $(am_libal_bp_vION_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libal_bp_vION_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libal_bp_vION_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ @LINUX_BUILD_TRUE@am_libal_bp_vION_la_rpath = -rpath $(libdir) am__EXEEXT_1 = dtnperf_vION$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_dtnperf_vION_OBJECTS = dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.$(OBJEXT) \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.$(OBJEXT) \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.$(OBJEXT) \ dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.$(OBJEXT) \ dtnperf/dtnperf/src/dtnperf_vION-csv_tools.$(OBJEXT) \ dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.$(OBJEXT) \ dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.$(OBJEXT) \ dtnperf/dtnperf/src/dtnperf_vION-utils.$(OBJEXT) dtnperf_vION_OBJECTS = $(am_dtnperf_vION_OBJECTS) dtnperf_vION_DEPENDENCIES = libal_bp_vION.la ../libici.la ../libbp.la dtnperf_vION_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(dtnperf_vION_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libal_bp_vION_la_SOURCES) $(dtnperf_vION_SOURCES) DIST_SOURCES = $(libal_bp_vION_la_SOURCES) $(dtnperf_vION_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__noinst_HEADERS_DIST = dtnperf/dtnperf/src/bundle_tools.h \ dtnperf/dtnperf/src/csv_tools.h \ dtnperf/dtnperf/src/definitions.h \ dtnperf/dtnperf/src/dtnperf_types.h \ dtnperf/dtnperf/src/file_transfer_tools.h \ dtnperf/dtnperf/src/includes.h dtnperf/dtnperf/src/utils.h \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.h \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.h \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.h \ dtnperf/al_bp/src/al_bp_api.h dtnperf/al_bp/src/al_bp_types.h \ dtnperf/al_bp/src/includes.h dtnperf/al_bp/src/types.h \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.h \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn.h \ dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.h \ dtnperf/al_bp/src/bp_implementations/al_bp_ion.h HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ # This will add CFLAGS to make the valgrind macros compile without # warnings/errors on some systems with specific versions of valgrind # and gcc (see configure.ac and issue #298 for details). If valgrind # support is not present, this variable is empty. AM_CFLAGS = @AM_CFLAGS@ -Wall -Werror -g -include \ $(srcdir)/../config.h $(VALGRIND_COMPAT_CFLAGS) AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ AM_LIBTOOLFLAGS = @AM_LIBTOOLFLAGS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CRYPTO_LIBS = @CRYPTO_LIBS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPAT_LIBS = @EXPAT_LIBS@ FGREP = @FGREP@ GREP = @GREP@ GROFF = @GROFF@ GROFFMS = @GROFFMS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MANOPTS = @MANOPTS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF2PS = @PDF2PS@ POD_DOCUMENTATION = @POD_DOCUMENTATION@ PS2PDF = @PS2PDF@ PSJOIN = @PSJOIN@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VALGRIND_COMPAT_CFLAGS = @VALGRIND_COMPAT_CFLAGS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ 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 = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @LINUX_BUILD_TRUE@lib_LTLIBRARIES = \ @LINUX_BUILD_TRUE@ $(dtnperf_lib) #include_HEADERS = @LINUX_BUILD_TRUE@noinst_HEADERS = \ @LINUX_BUILD_TRUE@ $(dtnperf_noinst) #man_MANS = ################ ################ dtnperf_bin = \ dtnperf_vION dtnperf_lib = \ libal_bp_vION.la dtnperf_noinst = \ dtnperf/dtnperf/src/bundle_tools.h \ dtnperf/dtnperf/src/csv_tools.h \ dtnperf/dtnperf/src/definitions.h \ dtnperf/dtnperf/src/dtnperf_types.h \ dtnperf/dtnperf/src/file_transfer_tools.h \ dtnperf/dtnperf/src/includes.h \ dtnperf/dtnperf/src/utils.h \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.h \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.h \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.h \ dtnperf/al_bp/src/al_bp_api.h \ dtnperf/al_bp/src/al_bp_types.h \ dtnperf/al_bp/src/includes.h \ dtnperf/al_bp/src/types.h \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.h \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn.h \ dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.h \ dtnperf/al_bp/src/bp_implementations/al_bp_ion.h dtnperf_vION_SOURCES = dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c \ dtnperf/dtnperf/src/bundle_tools.c \ dtnperf/dtnperf/src/csv_tools.c \ dtnperf/dtnperf/src/file_transfer_tools.c \ dtnperf/dtnperf/src/dtnperf_main.c \ dtnperf/dtnperf/src/utils.c dtnperf_vION_LDADD = libal_bp_vION.la ../libici.la ../libbp.la $(LIBSOBJS) dtnperf_vION_CFLAGS = -I$(srcdir)/dtnperf/al_bp/src/bp_implementations \ -I$(srcdir)/dtnperf/al_bp/src \ -I$(srcdir)/../bp/include \ -I$(srcdir)/../bp/library \ -fmessage-length=0 $(AM_CFLAGS) libal_bp_vION_la_SOURCES = dtnperf/al_bp/src/al_bp_api.c \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn.c \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.c \ dtnperf/al_bp/src/bp_implementations/al_bp_ion.c \ dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.c libal_bp_vION_la_CFLAGS = -I$(srcdir)/dtnperf/al_bp/src/bp_implementations \ -I$(srcdir)/../ici/include \ -I$(srcdir)/../bp/include \ -I$(srcdir)/../bp/library \ -I$(srcdir)/dtnperf/al_bp/src\ -DION_IMPLEMENTATION $(AM_CFLAGS) libal_bp_vION_la_NAME = libal_bp_vION.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign contrib/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 $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } dtnperf/al_bp/src/$(am__dirstamp): @$(MKDIR_P) dtnperf/al_bp/src @: > dtnperf/al_bp/src/$(am__dirstamp) dtnperf/al_bp/src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) dtnperf/al_bp/src/$(DEPDIR) @: > dtnperf/al_bp/src/$(DEPDIR)/$(am__dirstamp) dtnperf/al_bp/src/libal_bp_vION_la-al_bp_api.lo: \ dtnperf/al_bp/src/$(am__dirstamp) \ dtnperf/al_bp/src/$(DEPDIR)/$(am__dirstamp) dtnperf/al_bp/src/bp_implementations/$(am__dirstamp): @$(MKDIR_P) dtnperf/al_bp/src/bp_implementations @: > dtnperf/al_bp/src/bp_implementations/$(am__dirstamp) dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) dtnperf/al_bp/src/bp_implementations/$(DEPDIR) @: > dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/$(am__dirstamp) dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn.lo: \ dtnperf/al_bp/src/bp_implementations/$(am__dirstamp) \ dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/$(am__dirstamp) dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn_conversions.lo: \ dtnperf/al_bp/src/bp_implementations/$(am__dirstamp) \ dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/$(am__dirstamp) dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion.lo: \ dtnperf/al_bp/src/bp_implementations/$(am__dirstamp) \ dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/$(am__dirstamp) dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion_conversions.lo: \ dtnperf/al_bp/src/bp_implementations/$(am__dirstamp) \ dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/$(am__dirstamp) libal_bp_vION.la: $(libal_bp_vION_la_OBJECTS) $(libal_bp_vION_la_DEPENDENCIES) $(EXTRA_libal_bp_vION_la_DEPENDENCIES) $(AM_V_CCLD)$(libal_bp_vION_la_LINK) $(am_libal_bp_vION_la_rpath) $(libal_bp_vION_la_OBJECTS) $(libal_bp_vION_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list dtnperf/dtnperf/src/dtnperf_modes/$(am__dirstamp): @$(MKDIR_P) dtnperf/dtnperf/src/dtnperf_modes @: > dtnperf/dtnperf/src/dtnperf_modes/$(am__dirstamp) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR) @: > dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/$(am__dirstamp) dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.$(OBJEXT): \ dtnperf/dtnperf/src/dtnperf_modes/$(am__dirstamp) \ dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/$(am__dirstamp) dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.$(OBJEXT): \ dtnperf/dtnperf/src/dtnperf_modes/$(am__dirstamp) \ dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/$(am__dirstamp) dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.$(OBJEXT): \ dtnperf/dtnperf/src/dtnperf_modes/$(am__dirstamp) \ dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/$(am__dirstamp) dtnperf/dtnperf/src/$(am__dirstamp): @$(MKDIR_P) dtnperf/dtnperf/src @: > dtnperf/dtnperf/src/$(am__dirstamp) dtnperf/dtnperf/src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) dtnperf/dtnperf/src/$(DEPDIR) @: > dtnperf/dtnperf/src/$(DEPDIR)/$(am__dirstamp) dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.$(OBJEXT): \ dtnperf/dtnperf/src/$(am__dirstamp) \ dtnperf/dtnperf/src/$(DEPDIR)/$(am__dirstamp) dtnperf/dtnperf/src/dtnperf_vION-csv_tools.$(OBJEXT): \ dtnperf/dtnperf/src/$(am__dirstamp) \ dtnperf/dtnperf/src/$(DEPDIR)/$(am__dirstamp) dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.$(OBJEXT): \ dtnperf/dtnperf/src/$(am__dirstamp) \ dtnperf/dtnperf/src/$(DEPDIR)/$(am__dirstamp) dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.$(OBJEXT): \ dtnperf/dtnperf/src/$(am__dirstamp) \ dtnperf/dtnperf/src/$(DEPDIR)/$(am__dirstamp) dtnperf/dtnperf/src/dtnperf_vION-utils.$(OBJEXT): \ dtnperf/dtnperf/src/$(am__dirstamp) \ dtnperf/dtnperf/src/$(DEPDIR)/$(am__dirstamp) dtnperf_vION$(EXEEXT): $(dtnperf_vION_OBJECTS) $(dtnperf_vION_DEPENDENCIES) $(EXTRA_dtnperf_vION_DEPENDENCIES) @rm -f dtnperf_vION$(EXEEXT) $(AM_V_CCLD)$(dtnperf_vION_LINK) $(dtnperf_vION_OBJECTS) $(dtnperf_vION_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f dtnperf/al_bp/src/*.$(OBJEXT) -rm -f dtnperf/al_bp/src/*.lo -rm -f dtnperf/al_bp/src/bp_implementations/*.$(OBJEXT) -rm -f dtnperf/al_bp/src/bp_implementations/*.lo -rm -f dtnperf/dtnperf/src/*.$(OBJEXT) -rm -f dtnperf/dtnperf/src/dtnperf_modes/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/al_bp/src/$(DEPDIR)/libal_bp_vION_la-al_bp_api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_dtn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_dtn_conversions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_ion.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_ion_conversions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-bundle_tools.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-csv_tools.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-dtnperf_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-file_transfer_tools.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_server.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< dtnperf/al_bp/src/libal_bp_vION_la-al_bp_api.lo: dtnperf/al_bp/src/al_bp_api.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -MT dtnperf/al_bp/src/libal_bp_vION_la-al_bp_api.lo -MD -MP -MF dtnperf/al_bp/src/$(DEPDIR)/libal_bp_vION_la-al_bp_api.Tpo -c -o dtnperf/al_bp/src/libal_bp_vION_la-al_bp_api.lo `test -f 'dtnperf/al_bp/src/al_bp_api.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/al_bp_api.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/al_bp/src/$(DEPDIR)/libal_bp_vION_la-al_bp_api.Tpo dtnperf/al_bp/src/$(DEPDIR)/libal_bp_vION_la-al_bp_api.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/al_bp/src/al_bp_api.c' object='dtnperf/al_bp/src/libal_bp_vION_la-al_bp_api.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -c -o dtnperf/al_bp/src/libal_bp_vION_la-al_bp_api.lo `test -f 'dtnperf/al_bp/src/al_bp_api.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/al_bp_api.c dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn.lo: dtnperf/al_bp/src/bp_implementations/al_bp_dtn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -MT dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn.lo -MD -MP -MF dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_dtn.Tpo -c -o dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn.lo `test -f 'dtnperf/al_bp/src/bp_implementations/al_bp_dtn.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/bp_implementations/al_bp_dtn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_dtn.Tpo dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_dtn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/al_bp/src/bp_implementations/al_bp_dtn.c' object='dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -c -o dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn.lo `test -f 'dtnperf/al_bp/src/bp_implementations/al_bp_dtn.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/bp_implementations/al_bp_dtn.c dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn_conversions.lo: dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -MT dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn_conversions.lo -MD -MP -MF dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_dtn_conversions.Tpo -c -o dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn_conversions.lo `test -f 'dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_dtn_conversions.Tpo dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_dtn_conversions.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.c' object='dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn_conversions.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -c -o dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_dtn_conversions.lo `test -f 'dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.c dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion.lo: dtnperf/al_bp/src/bp_implementations/al_bp_ion.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -MT dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion.lo -MD -MP -MF dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_ion.Tpo -c -o dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion.lo `test -f 'dtnperf/al_bp/src/bp_implementations/al_bp_ion.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/bp_implementations/al_bp_ion.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_ion.Tpo dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_ion.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/al_bp/src/bp_implementations/al_bp_ion.c' object='dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -c -o dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion.lo `test -f 'dtnperf/al_bp/src/bp_implementations/al_bp_ion.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/bp_implementations/al_bp_ion.c dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion_conversions.lo: dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -MT dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion_conversions.lo -MD -MP -MF dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_ion_conversions.Tpo -c -o dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion_conversions.lo `test -f 'dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_ion_conversions.Tpo dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/libal_bp_vION_la-al_bp_ion_conversions.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.c' object='dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion_conversions.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libal_bp_vION_la_CFLAGS) $(CFLAGS) -c -o dtnperf/al_bp/src/bp_implementations/libal_bp_vION_la-al_bp_ion_conversions.lo `test -f 'dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.c' || echo '$(srcdir)/'`dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.c dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.o: dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.o -MD -MP -MF dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_client.Tpo -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.o `test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_client.Tpo dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c' object='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.o `test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.obj: dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.obj -MD -MP -MF dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_client.Tpo -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.obj `if test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_client.Tpo dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c' object='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_client.obj `if test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c'; fi` dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.o: dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.o -MD -MP -MF dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_monitor.Tpo -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.o `test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_monitor.Tpo dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_monitor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c' object='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.o `test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.obj: dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.obj -MD -MP -MF dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_monitor.Tpo -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.obj `if test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_monitor.Tpo dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_monitor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c' object='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_monitor.obj `if test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c'; fi` dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.o: dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.o -MD -MP -MF dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_server.Tpo -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.o `test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_server.Tpo dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c' object='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.o `test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.obj: dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.obj -MD -MP -MF dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_server.Tpo -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.obj `if test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_server.Tpo dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/dtnperf_vION-dtnperf_server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c' object='dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_modes/dtnperf_vION-dtnperf_server.obj `if test -f 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c'; fi` dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.o: dtnperf/dtnperf/src/bundle_tools.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.o -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-bundle_tools.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.o `test -f 'dtnperf/dtnperf/src/bundle_tools.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/bundle_tools.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-bundle_tools.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-bundle_tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/bundle_tools.c' object='dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.o `test -f 'dtnperf/dtnperf/src/bundle_tools.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/bundle_tools.c dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.obj: dtnperf/dtnperf/src/bundle_tools.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.obj -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-bundle_tools.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.obj `if test -f 'dtnperf/dtnperf/src/bundle_tools.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/bundle_tools.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/bundle_tools.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-bundle_tools.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-bundle_tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/bundle_tools.c' object='dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-bundle_tools.obj `if test -f 'dtnperf/dtnperf/src/bundle_tools.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/bundle_tools.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/bundle_tools.c'; fi` dtnperf/dtnperf/src/dtnperf_vION-csv_tools.o: dtnperf/dtnperf/src/csv_tools.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-csv_tools.o -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-csv_tools.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-csv_tools.o `test -f 'dtnperf/dtnperf/src/csv_tools.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/csv_tools.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-csv_tools.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-csv_tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/csv_tools.c' object='dtnperf/dtnperf/src/dtnperf_vION-csv_tools.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-csv_tools.o `test -f 'dtnperf/dtnperf/src/csv_tools.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/csv_tools.c dtnperf/dtnperf/src/dtnperf_vION-csv_tools.obj: dtnperf/dtnperf/src/csv_tools.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-csv_tools.obj -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-csv_tools.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-csv_tools.obj `if test -f 'dtnperf/dtnperf/src/csv_tools.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/csv_tools.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/csv_tools.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-csv_tools.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-csv_tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/csv_tools.c' object='dtnperf/dtnperf/src/dtnperf_vION-csv_tools.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-csv_tools.obj `if test -f 'dtnperf/dtnperf/src/csv_tools.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/csv_tools.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/csv_tools.c'; fi` dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.o: dtnperf/dtnperf/src/file_transfer_tools.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.o -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-file_transfer_tools.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.o `test -f 'dtnperf/dtnperf/src/file_transfer_tools.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/file_transfer_tools.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-file_transfer_tools.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-file_transfer_tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/file_transfer_tools.c' object='dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.o `test -f 'dtnperf/dtnperf/src/file_transfer_tools.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/file_transfer_tools.c dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.obj: dtnperf/dtnperf/src/file_transfer_tools.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.obj -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-file_transfer_tools.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.obj `if test -f 'dtnperf/dtnperf/src/file_transfer_tools.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/file_transfer_tools.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/file_transfer_tools.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-file_transfer_tools.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-file_transfer_tools.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/file_transfer_tools.c' object='dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-file_transfer_tools.obj `if test -f 'dtnperf/dtnperf/src/file_transfer_tools.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/file_transfer_tools.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/file_transfer_tools.c'; fi` dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.o: dtnperf/dtnperf/src/dtnperf_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.o -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-dtnperf_main.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.o `test -f 'dtnperf/dtnperf/src/dtnperf_main.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/dtnperf_main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-dtnperf_main.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-dtnperf_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/dtnperf_main.c' object='dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.o `test -f 'dtnperf/dtnperf/src/dtnperf_main.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/dtnperf_main.c dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.obj: dtnperf/dtnperf/src/dtnperf_main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.obj -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-dtnperf_main.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.obj `if test -f 'dtnperf/dtnperf/src/dtnperf_main.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/dtnperf_main.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/dtnperf_main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-dtnperf_main.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-dtnperf_main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/dtnperf_main.c' object='dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-dtnperf_main.obj `if test -f 'dtnperf/dtnperf/src/dtnperf_main.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/dtnperf_main.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/dtnperf_main.c'; fi` dtnperf/dtnperf/src/dtnperf_vION-utils.o: dtnperf/dtnperf/src/utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-utils.o -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-utils.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-utils.o `test -f 'dtnperf/dtnperf/src/utils.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-utils.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/utils.c' object='dtnperf/dtnperf/src/dtnperf_vION-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-utils.o `test -f 'dtnperf/dtnperf/src/utils.c' || echo '$(srcdir)/'`dtnperf/dtnperf/src/utils.c dtnperf/dtnperf/src/dtnperf_vION-utils.obj: dtnperf/dtnperf/src/utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -MT dtnperf/dtnperf/src/dtnperf_vION-utils.obj -MD -MP -MF dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-utils.Tpo -c -o dtnperf/dtnperf/src/dtnperf_vION-utils.obj `if test -f 'dtnperf/dtnperf/src/utils.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/utils.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-utils.Tpo dtnperf/dtnperf/src/$(DEPDIR)/dtnperf_vION-utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dtnperf/dtnperf/src/utils.c' object='dtnperf/dtnperf/src/dtnperf_vION-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dtnperf_vION_CFLAGS) $(CFLAGS) -c -o dtnperf/dtnperf/src/dtnperf_vION-utils.obj `if test -f 'dtnperf/dtnperf/src/utils.c'; then $(CYGPATH_W) 'dtnperf/dtnperf/src/utils.c'; else $(CYGPATH_W) '$(srcdir)/dtnperf/dtnperf/src/utils.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf dtnperf/al_bp/src/.libs dtnperf/al_bp/src/_libs -rm -rf dtnperf/al_bp/src/bp_implementations/.libs dtnperf/al_bp/src/bp_implementations/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)"; 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f dtnperf/al_bp/src/$(DEPDIR)/$(am__dirstamp) -rm -f dtnperf/al_bp/src/$(am__dirstamp) -rm -f dtnperf/al_bp/src/bp_implementations/$(DEPDIR)/$(am__dirstamp) -rm -f dtnperf/al_bp/src/bp_implementations/$(am__dirstamp) -rm -f dtnperf/dtnperf/src/$(DEPDIR)/$(am__dirstamp) -rm -f dtnperf/dtnperf/src/$(am__dirstamp) -rm -f dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR)/$(am__dirstamp) -rm -f dtnperf/dtnperf/src/dtnperf_modes/$(am__dirstamp) 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-libLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf dtnperf/al_bp/src/$(DEPDIR) dtnperf/al_bp/src/bp_implementations/$(DEPDIR) dtnperf/dtnperf/src/$(DEPDIR) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf dtnperf/al_bp/src/$(DEPDIR) dtnperf/al_bp/src/bp_implementations/$(DEPDIR) dtnperf/dtnperf/src/$(DEPDIR) dtnperf/dtnperf/src/dtnperf_modes/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES .MAKE: install-am install-data-am install-exec-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-data-hook install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-libLTLIBRARIES # EXTRA_DIST gets sent in the tarball, but isn't really a program # anything NOT compiled: scripts, readmes, tar files, config files. # An exception of something compiled which must be explicitly included is # man page source files. #EXTRA_DIST = \ # README.txt install-exec-hook: @echo @echo "You should now run 'sudo ldconfig' if available." @echo install-data-hook: @echo @echo "You should now run 'sudo ldconfig' if available." @echo # 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: ion-open-source/contrib/Makefile.am0000644000175000017500000000625412356652303017740 0ustar jschendejschende# Makefile.am # # Samuel Jero # July 22, 2013 # # Makefile.am AM_CFLAGS += \ -Wall -Werror -g \ -include $(srcdir)/../config.h # This will add CFLAGS to make the valgrind macros compile without # warnings/errors on some systems with specific versions of valgrind # and gcc (see configure.ac and issue #298 for details). If valgrind # support is not present, this variable is empty. AM_CFLAGS += $(VALGRIND_COMPAT_CFLAGS) # EXTRA_DIST gets sent in the tarball, but isn't really a program # anything NOT compiled: scripts, readmes, tar files, config files. # An exception of something compiled which must be explicitly included is # man page source files. #EXTRA_DIST = \ # README.txt install-exec-hook: @echo @echo "You should now run 'sudo ldconfig' if available." @echo install-data-hook: @echo @echo "You should now run 'sudo ldconfig' if available." @echo if LINUX_BUILD bin_PROGRAMS = \ $(dtnperf_bin) lib_LTLIBRARIES = \ $(dtnperf_lib) #include_HEADERS = noinst_HEADERS = \ $(dtnperf_noinst) #man_MANS = endif ################ ## DTN Perf ## ## Linux Only ## ################ dtnperf_bin= \ dtnperf_vION dtnperf_lib=\ libal_bp_vION.la dtnperf_noinst= \ dtnperf/dtnperf/src/bundle_tools.h \ dtnperf/dtnperf/src/csv_tools.h \ dtnperf/dtnperf/src/definitions.h \ dtnperf/dtnperf/src/dtnperf_types.h \ dtnperf/dtnperf/src/file_transfer_tools.h \ dtnperf/dtnperf/src/includes.h \ dtnperf/dtnperf/src/utils.h \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.h \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.h \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.h \ dtnperf/al_bp/src/al_bp_api.h \ dtnperf/al_bp/src/al_bp_types.h \ dtnperf/al_bp/src/includes.h \ dtnperf/al_bp/src/types.h \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.h \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn.h \ dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.h \ dtnperf/al_bp/src/bp_implementations/al_bp_ion.h dtnperf_vION_SOURCES = dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c \ dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c \ dtnperf/dtnperf/src/bundle_tools.c \ dtnperf/dtnperf/src/csv_tools.c \ dtnperf/dtnperf/src/file_transfer_tools.c \ dtnperf/dtnperf/src/dtnperf_main.c \ dtnperf/dtnperf/src/utils.c dtnperf_vION_LDADD = libal_bp_vION.la ../libici.la ../libbp.la $(LIBSOBJS) dtnperf_vION_CFLAGS = -I$(srcdir)/dtnperf/al_bp/src/bp_implementations \ -I$(srcdir)/dtnperf/al_bp/src \ -I$(srcdir)/../bp/include \ -I$(srcdir)/../bp/library \ -fmessage-length=0 $(AM_CFLAGS) libal_bp_vION_la_SOURCES = dtnperf/al_bp/src/al_bp_api.c \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn.c \ dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.c \ dtnperf/al_bp/src/bp_implementations/al_bp_ion.c \ dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.c libal_bp_vION_la_CFLAGS = -I$(srcdir)/dtnperf/al_bp/src/bp_implementations \ -I$(srcdir)/../ici/include \ -I$(srcdir)/../bp/include \ -I$(srcdir)/../bp/library \ -I$(srcdir)/dtnperf/al_bp/src\ -DION_IMPLEMENTATION $(AM_CFLAGS) libal_bp_vION_la_NAME = libal_bp_vION.la ion-open-source/contrib/dtnperf/0000775000175000017500000000000012356652303017341 5ustar jschendejschendeion-open-source/contrib/dtnperf/NOTES0000644000175000017500000000064212356652303020154 0ustar jschendejschendeThe dtnperf server listens on the hardcoded EIDs "ipn:x.2000" or "dtn://x/dtnperf:/dest". The dtnperf client sends data from EIDs "ipn:x." (process id ?) or "dtn://x/dtnperf:/src". Hence the following are the commands for an IPN dtnperf 10 second test over the local node: dtnperf_vION --server ./dtnperf_vION --client -d ipn:1.2000 -T 10s -m ipn:1.2 Samuel Jero Ohio University sj323707@ohio.edu July 8, 2013 ion-open-source/contrib/dtnperf/al_bp/0000775000175000017500000000000012356652303020416 5ustar jschendejschendeion-open-source/contrib/dtnperf/al_bp/Makefile0000755000175000017500000000344612356652303022066 0ustar jschendejschende# Makefile for compiling libbp_abstraction_layer.a LIB=static #LIB=dynamic LIB_NAME_BASE=libal_bp CC=gcc DIR_BP_IMPL=./src/bp_implementations/ SUFFIX= ifeq ($(or $(ION_DIR),$(DTN2_DIR)),) # NOTHING all: help else all: lib endif LIB_NAME=$(LIB_NAME_BASE) ifeq ($(strip $(DTN2_DIR)),) ifneq ($(strip $(ION_DIR)),) # ION LIB_NAME=$(LIB_NAME_BASE)_vION INC=-I$(ION_DIR) -I$(ION_DIR)/bp/include -I$(ION_DIR)/bp/library -I$(ION_DIR)/ici/include OPT=-DION_IMPLEMENTATION -fPIC -Wall -Werror endif else ifeq ($(strip $(ION_DIR)),) ifneq ($(strip $(DTN2_DIR)),) # DTN2 LIB_NAME=$(LIB_NAME_BASE)_vDTN2 INC=-I$(DTN2_DIR) -I$(DTN2_DIR)/applib/ OPT=-DDTN2_IMPLEMENTATION -fPIC -Wall -Werror endif else ifneq ($(strip $(ION_DIR)),) ifneq ($(strip $(DTN2_DIR)),) # BOTH LIB_NAME=$(LIB_NAME_BASE) INC=-I$(DTN2_DIR) -I$(DTN2_DIR)/applib/ -I$(ION_DIR)/bp/include -I$(ION_DIR)/bp/library -I$(ION_DIR)/ici/include OPT=-DION_IMPLEMENTATION -DDTN2_IMPLEMENTATION -fPIC -Wall -Werror endif #else ifeq ($(and $(strip $(DTN2_DIR)), $(strip $(ION_DIR))),) endif ifeq ($(strip $(LIB)),static) LIB_CC=ar crs $(LIB_NAME).a else LIB_CC=$(CC) -shared -Wl,-soname,$(LIB_NAME).so -o $(LIB_NAME).so endif INSTALLED=$(wildcard /usr/lib/$(LIB_NAME)*) lib: objs $(LIB_CC) *.o install: cp $(LIB_NAME)* /usr/lib/ uninstall: @if test `echo $(INSTALLED) | wc -w` -eq 1 -a -f "$(INSTALLED)"; then rm -rf $(INSTALLED); else if test -n "$(INSTALLED)"; then echo "MORE THAN 1 FILE, DELETE THEM MANUALLY: $(INSTALLED)"; else echo "NOT INSTALLED"; fi fi objs: $(CC) -I$(DIR_BP_IMPL) $(INC) $(OPT) -c src/*.c $(CC) $(INC) $(OPT) -c src/bp_implementations/*.c help: @echo "Usage:" @echo "For DTN2: make DTN2_DIR=" @echo "For ION: make ION_DIR=" @echo "For both: make DTN2_DIR= ION_DIR=" clean: @rm -rf *.o *.so *.a ion-open-source/contrib/dtnperf/al_bp/src/0000775000175000017500000000000012356652303021205 5ustar jschendejschendeion-open-source/contrib/dtnperf/al_bp/src/al_bp_api.h0000644000175000017500000002555612356652303023277 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * bp_abstraction_api.h * */ #ifndef BP_ABSTRACTION_API_H_ #define BP_ABSTRACTION_API_H_ #include "al_bp_types.h" /** * Find the underlying implementation of bundle protocol */ al_bp_implementation_t al_bp_get_implementation(); /** * Open a new connection to the router. * * On success, initializes the handle parameter as a new handle to the * daemon and returns BP_SUCCESS. On failure, sets handle to NULL and * returns a bp_errno error code. * * For ION this API attach the application to the bundle protocol */ al_bp_error_t al_bp_open(al_bp_handle_t* handle); /** * Open a new connection to the router witha given IP addr and port * * On success, initializes the handle parameter as a new handle to the * daemon and returns BP_SUCCESS. On failure, sets handle to NULL and * returns a bp_errno error code. */ al_bp_error_t al_bp_open_with_ip(char *daemon_api_IP,int daemon_api_port,al_bp_handle_t* handle); /** * Get the error associated with the given handle. */ al_bp_error_t al_bp_errno(al_bp_handle_t handle); /** * Build an appropriate local endpoint id by appending the specified * service tag to the daemon's preferred administrative endpoint id. * * For more information on building of endpoint id for ION implementation * go to the specific file (bp_ion.h) */ al_bp_error_t al_bp_build_local_eid(al_bp_handle_t handle, al_bp_endpoint_id_t* local_eid, const char* service_tag, char * type, char * eid_destination); /** * Create a bp registration. If the init_passive flag in the reginfo * struct is true, the registration is initially in passive state, * requiring a call to dtn_bind to activate it. Otherwise, the call to * dtn_bind is unnecessary as the registration will be created in the * active state and bound to the handle. */ al_bp_error_t al_bp_register(al_bp_handle_t * handle, al_bp_reg_info_t* reginfo, al_bp_reg_id_t* newregid); /** * Check for an existing registration on the given endpoint id, * returning BP_SUCCSS and filling in the registration id if it * exists, or returning ENOENT if it doesn't. */ al_bp_error_t al_bp_find_registration(al_bp_handle_t handle, al_bp_endpoint_id_t * eid, al_bp_reg_id_t * newregid); /** * Remove a registration */ al_bp_error_t al_bp_unregister(al_bp_handle_t handle, al_bp_reg_id_t regid,al_bp_endpoint_id_t eid); /** * Send a bundle either from memory or from a file. */ al_bp_error_t al_bp_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_t* payload, al_bp_bundle_id_t* id); /** * Blocking receive for a bundle, filling in the spec and payload * structures with the bundle data. The location parameter indicates * the manner by which the caller wants to receive payload data (i.e. * either in memory or in a file). The timeout parameter specifies an * interval in milliseconds to block on the server-side (-1 means * infinite wait). * * Note that it is advisable to call bp_free_payload on the returned * structure, otherwise the XDR routines will memory leak. */ al_bp_error_t al_bp_recv(al_bp_handle_t handle, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_location_t location, al_bp_bundle_payload_t* payload, al_bp_timeval_t timeout); /** * Close an open bp handle. Returns BP_SUCCESS on success. */ al_bp_error_t al_bp_close(al_bp_handle_t handle); /************************************************************* * * Utility Functions * *************************************************************/ /** * Copy the contents of one eid into another. */ void al_bp_copy_eid(al_bp_endpoint_id_t* dst, al_bp_endpoint_id_t* src); /** * Parse a string into an endpoint id structure, validating that it is * in fact a valid endpoint id (i.e. a URI). */ al_bp_error_t al_bp_parse_eid_string(al_bp_endpoint_id_t* eid, const char* str); /** * Returns the null endpoint */ al_bp_error_t al_bp_get_none_endpoint(al_bp_endpoint_id_t * eid_none); /** * Sets the value of the given payload structure to either a memory * buffer or a file location. * * Returns: 0 on success, bp_ESIZE if the memory location is * selected and the payload is too big. */ al_bp_error_t al_bp_set_payload(al_bp_bundle_payload_t* payload, al_bp_bundle_payload_location_t location, char* val, int len); /** * Frees dynamic storage allocated by the xdr for a bundle extension blocks in * bp_recv. */ void al_bp_free_extension_blocks(al_bp_bundle_spec_t* spec); /** * Frees dynamic storage allocated by the xdr for a bundle metadata blocks in * bp_recv. */ void al_bp_free_metadata_blocks(al_bp_bundle_spec_t* spec); /** * Frees dynamic storage allocated by the xdr for a bundle payload in * bp_recv. */ void al_bp_free_payload(al_bp_bundle_payload_t* payload); /** * Return a string version of a status report reason code. */ const char* al_bp_status_report_reason_to_str(al_bp_status_report_reason_t err); /** * Get a string value associated with the bp error code. */ char * al_bp_strerror(int err); /******************************************************************** * * HIGHER LEVEL FUNCTIONS * ********************************************************************/ /** * Send bundle * Bundle source, destination and reply to eid must be valid bp endpoints */ al_bp_error_t al_bp_bundle_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_object_t * bundle_object); /** * Receive bundle */ al_bp_error_t al_bp_bundle_receive(al_bp_handle_t handle, al_bp_bundle_object_t bundle_object, al_bp_bundle_payload_location_t payload_location, al_bp_timeval_t timeout); /** * Initialize a bundle object */ al_bp_error_t al_bp_bundle_create(al_bp_bundle_object_t * bundle_object); /** * Deallocate memory allocated with bp_bundle_create() */ al_bp_error_t al_bp_bundle_free(al_bp_bundle_object_t * bundle_object); /** * Get bundle id */ al_bp_error_t al_bp_bundle_get_id(al_bp_bundle_object_t bundle_object, al_bp_bundle_id_t ** bundle_id); /** * Get Bundle payload location */ al_bp_error_t al_bp_bundle_set_payload_location(al_bp_bundle_object_t * bundle_object, al_bp_bundle_payload_location_t location); /** * Get Bundle payload location */ al_bp_error_t al_bp_bundle_get_payload_location(al_bp_bundle_object_t bundle_object, al_bp_bundle_payload_location_t * location); /** * Get payload size * if payload location is BP_PAYLOAD_FILE gets the size of the file */ al_bp_error_t al_bp_bundle_get_payload_size(al_bp_bundle_object_t bundle_object, u32_t * size); /** * Get filename of payload */ al_bp_error_t al_bp_bundle_get_payload_file(al_bp_bundle_object_t bundle_object, char_t ** filename, u32_t * filename_len); /** * Get pointer of payload buffer */ al_bp_error_t al_bp_bundle_get_payload_mem(al_bp_bundle_object_t bundle_object, char ** buf, u32_t * buf_len); /** * Set payload from a file */ al_bp_error_t al_bp_bundle_set_payload_file(al_bp_bundle_object_t * bundle_object, char_t * filename, u32_t filename_len); /** * Set payload from memory */ al_bp_error_t al_bp_bundle_set_payload_mem(al_bp_bundle_object_t * bundle_object, char * buf, u32_t buf_len); /** * Get bundle source eid */ al_bp_error_t al_bp_bundle_get_source(al_bp_bundle_object_t bundle_object, al_bp_endpoint_id_t * source); /** * Set Bundle Source eid */ al_bp_error_t al_bp_bundle_set_source(al_bp_bundle_object_t * bundle_object, al_bp_endpoint_id_t source); /** * Get bundle destination eid */ al_bp_error_t al_bp_bundle_get_dest(al_bp_bundle_object_t bundle_object, al_bp_endpoint_id_t * dest); /** * Set bundle destination eid */ al_bp_error_t al_bp_bundle_set_dest(al_bp_bundle_object_t * bundle_object, al_bp_endpoint_id_t dest); /** * Get bundle reply-to eid */ al_bp_error_t al_bp_bundle_get_replyto(al_bp_bundle_object_t bundle_object, al_bp_endpoint_id_t * replyto); /** * Set bundle reply-to eid */ al_bp_error_t al_bp_bundle_set_replyto(al_bp_bundle_object_t * bundle_object, al_bp_endpoint_id_t replyto); /** * Get bundle priority */ al_bp_error_t al_bp_bundle_get_priority(al_bp_bundle_object_t bundle_object, al_bp_bundle_priority_t * priority); /** * Set bundle priority */ al_bp_error_t al_bp_bundle_set_priority(al_bp_bundle_object_t * bundle_object, al_bp_bundle_priority_t priority); /** * Set bundle unreliable */ al_bp_error_t al_bp_bundle_set_unreliable(al_bp_bundle_object_t * bundle_object, boolean_t unreliable); /** * Get bundle unreliable */ al_bp_error_t al_bp_bundle_get_unreliable(al_bp_bundle_object_t bundle_object, boolean_t * unreliable); /** * Set bundle critical */ al_bp_error_t al_bp_bundle_set_critical(al_bp_bundle_object_t * bundle_object, boolean_t critical); /** * Get bundle critical */ al_bp_error_t al_bp_bundle_get_critical(al_bp_bundle_object_t bundle_object, boolean_t * critical); /** * Set bundle flow label */ al_bp_error_t al_bp_bundle_set_flow_label(al_bp_bundle_object_t * bundle_object, u32_t flow_label); /** * Get bundle flow label */ al_bp_error_t al_bp_bundle_get_flow_label(al_bp_bundle_object_t bundle_object, u32_t * flow_label); /** * Get bundle expiration time */ al_bp_error_t al_bp_bundle_get_expiration(al_bp_bundle_object_t bundle_object, al_bp_timeval_t * exp); /** * Set bundle expiration time */ al_bp_error_t al_bp_bundle_set_expiration(al_bp_bundle_object_t * bundle_object, al_bp_timeval_t exp); /** * Get bundle creation timestamp */ al_bp_error_t al_bp_bundle_get_creation_timestamp(al_bp_bundle_object_t bundle_object, al_bp_timestamp_t * ts); /** * Set bundle creation timestamp */ al_bp_error_t al_bp_bundle_set_creation_timestamp(al_bp_bundle_object_t * bundle_object, al_bp_timestamp_t ts); /** * Get bundle delivery options */ al_bp_error_t al_bp_bundle_get_delivery_opts(al_bp_bundle_object_t bundle_object, al_bp_bundle_delivery_opts_t * dopts); /** * Set bundle delivery options */ al_bp_error_t al_bp_bundle_set_delivery_opts(al_bp_bundle_object_t * bundle_object, al_bp_bundle_delivery_opts_t dopts); /** * Get status report. * If bundle_object is a status report, status_report is filled with a pointer to the status report structure * Otherwise status_report is set to NULL. * Returns BP_SUCCESS. * Returns BP_EINTERNAL if the bundle is malformed */ al_bp_error_t al_bp_bundle_get_status_report(al_bp_bundle_object_t bundle_object, al_bp_bundle_status_report_t ** status_report); #endif /* BP_ABSTRACTION_API_H_ */ ion-open-source/contrib/dtnperf/al_bp/src/al_bp_types.h0000644000175000017500000002432412356652303023662 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * bp_types.h * */ #ifndef BP_TYPES_H_ #define BP_TYPES_H_ #include "types.h" #define AL_BP_MAX_ENDPOINT_ID 256 #define AL_BP_MAX_ORDINAL_NBR 254 /** * Bundle protocol implementation */ typedef enum { BP_NONE = 0, BP_DTN, BP_ION, } al_bp_implementation_t; /** * Specification of a bp endpoint id, i.e. a URI, implemented as a * fixed-length char buffer. Note that for efficiency reasons, this * fixed length is relatively small (256 bytes). * * The alternative is to use the string XDR type but then all endpoint * ids would require malloc / free which is more prone to leaks / bugs. */ struct al_bp_endpoint_id_t { char uri[AL_BP_MAX_ENDPOINT_ID]; //256 }; typedef struct al_bp_endpoint_id_t al_bp_endpoint_id_t; /** * *************************************************************************CONTROLLA DESCRZIONE * The basic handle for communication with the bp router. */ typedef int * al_bp_handle_t; /** * BP timeouts are specified in seconds. */ typedef u32_t al_bp_timeval_t; struct al_bp_timestamp_t { u32_t secs; u32_t seqno; }; typedef struct al_bp_timestamp_t al_bp_timestamp_t; typedef u32_t al_bp_reg_token_t; /** * A registration cookie. */ typedef u32_t al_bp_reg_id_t; /** * Registration state. */ struct al_bp_reg_info_t { al_bp_endpoint_id_t endpoint; al_bp_reg_id_t regid; u32_t flags; u32_t replay_flags; al_bp_timeval_t expiration; boolean_t init_passive; al_bp_reg_token_t reg_token; struct { u32_t script_len; char *script_val; } script; }; typedef struct al_bp_reg_info_t al_bp_reg_info_t; /** * Registration flags are a bitmask of the following: * Delivery failure actions (exactly one must be selected): * BP_REG_DROP - drop bundle if registration not active * BP_REG_DEFER - spool bundle for later retrieval * BP_REG_EXEC - exec program on bundle arrival * * Session flags: * BP_SESSION_CUSTODY - app assumes custody for the session * BP_SESSION_PUBLISH - creates a publication point * BP_SESSION_SUBSCRIBE - create subscription for the session * * Other flags: * BP_DELIVERY_ACKS - application will acknowledge delivered * bundles with bp_ack() * */ enum al_bp_reg_flags_t { BP_REG_DROP = 1, BP_REG_DEFER = 2, BP_REG_EXEC = 3, BP_SESSION_CUSTODY = 4, BP_SESSION_PUBLISH = 8, BP_SESSION_SUBSCRIBE = 16, BP_DELIVERY_ACKS = 32, }; typedef enum al_bp_reg_flags_t al_bp_reg_flags_t; /** * Value for an unspecified registration cookie (i.e. indication that * the daemon should allocate a new unique id). */ #define BP_REGID_NONE 0 /** * Bundle delivery option flags. Note that multiple options may be * selected for a given bundle. * * BP_DOPTS_NONE - no custody, etc * BP_DOPTS_CUSTODY - custody xfer * BP_DOPTS_DELIVERY_RCPT - end to end delivery (i.e. return receipt) * BP_DOPTS_RECEIVE_RCPT - per hop arrival receipt * BP_DOPTS_FORWARD_RCPT - per hop departure receipt * BP_DOPTS_CUSTODY_RCPT - per custodian receipt * BP_DOPTS_DELETE_RCPT - request deletion receipt * BP_DOPTS_SINGLETON_DEST - destination is a singleton * BP_DOPTS_MULTINODE_DEST - destination is not a singleton * BP_DOPTS_DO_NOT_FRAGMENT - set the do not fragment bit */ enum al_bp_bundle_delivery_opts_t { BP_DOPTS_NONE = 0, BP_DOPTS_CUSTODY = 1, BP_DOPTS_DELIVERY_RCPT = 2, BP_DOPTS_RECEIVE_RCPT = 4, BP_DOPTS_FORWARD_RCPT = 8, BP_DOPTS_CUSTODY_RCPT = 16, BP_DOPTS_DELETE_RCPT = 32, BP_DOPTS_SINGLETON_DEST = 64, BP_DOPTS_MULTINODE_DEST = 128, BP_DOPTS_DO_NOT_FRAGMENT = 256, }; typedef enum al_bp_bundle_delivery_opts_t al_bp_bundle_delivery_opts_t; /** * Bundle priority specifier. * BP_PRIORITY_BULK - lowest priority * BP_PRIORITY_NORMAL - regular priority * BP_PRIORITY_EXPEDITED - important * BP_PRIORITY_RESERVED - TBD * Only for ION implementation there is ordinal number * ordinal [0 - AL_MAX_ORDINAL_NBR] */ enum al_bp_bundle_priority_enum { BP_PRIORITY_BULK = 0, BP_PRIORITY_NORMAL = 1, BP_PRIORITY_EXPEDITED = 2, BP_PRIORITY_RESERVED = 3, }; typedef enum al_bp_bundle_priority_enum al_bp_bundle_priority_enum; struct al_bp_bundle_priority_t { al_bp_bundle_priority_enum priority; u32_t ordinal; }; typedef struct al_bp_bundle_priority_t al_bp_bundle_priority_t; /** * Extension block. */ struct al_bp_extension_block_t { u32_t type; u32_t flags; struct { u32_t data_len; char *data_val; } data; }; typedef struct al_bp_extension_block_t al_bp_extension_block_t; /** * Bundle specifications. The delivery_regid is ignored when sending * bundles, but is filled in by the daemon with the registration * id where the bundle was received. */ struct al_bp_bundle_spec_t { al_bp_endpoint_id_t source; al_bp_endpoint_id_t dest; al_bp_endpoint_id_t replyto; al_bp_bundle_priority_t priority; al_bp_bundle_delivery_opts_t dopts; al_bp_timeval_t expiration; al_bp_timestamp_t creation_ts; al_bp_reg_id_t delivery_regid; struct { u32_t blocks_len; al_bp_extension_block_t *blocks_val; } blocks; struct { u32_t metadata_len; al_bp_extension_block_t *metadata_val; } metadata; boolean_t unreliable; boolean_t critical; u32_t flow_label; }; typedef struct al_bp_bundle_spec_t al_bp_bundle_spec_t; /** * The payload of a bundle can be sent or received either in a file, * in which case the payload structure contains the filename, or in * memory where the struct contains the data in-band, in the 'buf' * field. * * When sending a bundle, if the location specifies that the payload * is in a temp file, then the daemon assumes ownership of the file * and should have sufficient permissions to move or rename it. * * When receiving a bundle that is a status report, then the * status_report pointer will be non-NULL and will point to a * bp_bundle_status_report_t structure which contains the parsed fields * of the status report. * * BP_PAYLOAD_MEM - payload contents in memory * BP_PAYLOAD_FILE - payload contents in file * BP_PAYLOAD_TEMP_FILE - in file, assume ownership (send only) */ enum al_bp_bundle_payload_location_t { BP_PAYLOAD_FILE = 0, BP_PAYLOAD_MEM = 1, BP_PAYLOAD_TEMP_FILE = 2, }; typedef enum al_bp_bundle_payload_location_t al_bp_bundle_payload_location_t; /** * Bundle Status Report "Reason Code" flags */ enum al_bp_status_report_reason_t { BP_SR_REASON_NO_ADDTL_INFO = 0x00, BP_SR_REASON_LIFETIME_EXPIRED = 0x01, BP_SR_REASON_FORWARDED_UNIDIR_LINK = 0x02, BP_SR_REASON_TRANSMISSION_CANCELLED = 0x03, BP_SR_REASON_DEPLETED_STORAGE = 0x04, BP_SR_REASON_ENDPOINT_ID_UNINTELLIGIBLE = 0x05, BP_SR_REASON_NO_ROUTE_TO_DEST = 0x06, BP_SR_REASON_NO_TIMELY_CONTACT = 0x07, BP_SR_REASON_BLOCK_UNINTELLIGIBLE = 0x08, }; typedef enum al_bp_status_report_reason_t al_bp_status_report_reason_t; /** * Bundle Status Report status flags that indicate which timestamps in * the status report structure are valid. */ enum al_bp_status_report_flags_t { BP_STATUS_RECEIVED = 0x01, BP_STATUS_CUSTODY_ACCEPTED = 0x02, BP_STATUS_FORWARDED = 0x04, BP_STATUS_DELIVERED = 0x08, BP_STATUS_DELETED = 0x10, BP_STATUS_ACKED_BY_APP = 0x20, }; typedef enum al_bp_status_report_flags_t al_bp_status_report_flags_t; /** * Type definition for a unique bundle identifier. Returned from bp_send * after the daemon has assigned the creation_secs and creation_subsecs, * in which case orig_length and frag_offset are always zero, and also in * status report data in which case they may be set if the bundle is * fragmented. */ struct al_bp_bundle_id_t { al_bp_endpoint_id_t source; al_bp_timestamp_t creation_ts; u32_t frag_offset; u32_t orig_length; }; typedef struct al_bp_bundle_id_t al_bp_bundle_id_t; /** * Type definition for a bundle status report. */ struct al_bp_bundle_status_report_t { al_bp_bundle_id_t bundle_id; al_bp_status_report_reason_t reason; al_bp_status_report_flags_t flags; al_bp_timestamp_t receipt_ts; al_bp_timestamp_t custody_ts; al_bp_timestamp_t forwarding_ts; al_bp_timestamp_t delivery_ts; al_bp_timestamp_t deletion_ts; al_bp_timestamp_t ack_by_app_ts; }; typedef struct al_bp_bundle_status_report_t al_bp_bundle_status_report_t; struct al_bp_bundle_payload_t { al_bp_bundle_payload_location_t location; struct { u32_t filename_len; char *filename_val; } filename; struct { uint32_t buf_crc; u32_t buf_len; char *buf_val; } buf; al_bp_bundle_status_report_t *status_report; }; typedef struct al_bp_bundle_payload_t al_bp_bundle_payload_t; /** * AL BP API error codes */ typedef enum al_bp_error_t { //Both Error BP_SUCCESS = 0, /* ok */ BP_ERRBASE, /* Base error code */ BP_ENOBPI, /* error NO Bundle Protocol Implementation */ BP_EINVAL, /* invalid argument */ BP_ENULLPNTR, /* operation on a null pointer */ BP_EUNREG, /* errot to unregister eid*/ BP_ECONNECT, /* error connecting to server */ BP_ETIMEOUT, /* operation timed out */ BP_ESIZE, /* payload / eid too large */ BP_ENOTFOUND, /* not found (e.g. reg) */ BP_EINTERNAL, /* misc. internal error */ BP_EBUSY, /* registration already in use */ BP_ENOSPACE, /* no storage space */ BP_ENOTIMPL, /* function not yet implemented */ BP_EATTACH, /* error to attach bp protocol */ BP_EBUILDEID, /* error to buil a local eid */ BP_EOPEN, /* error to open */ BP_EREG, /* error to register a eid */ BP_EPARSEEID, /* error to parse a endpoint id string */ BP_ESEND, /* error to send bundle*/ BP_ERECV, /* error to receive bundle*/ BP_ERECVINT /* reception interrupted*/ } al_bp_error_t; /**************************************************************** * * HIGHER LEVEL TYPES * ****************************************************************/ struct al_bp_bundle_object_t { al_bp_bundle_id_t * id; al_bp_bundle_spec_t * spec; al_bp_bundle_payload_t * payload; }; typedef struct al_bp_bundle_object_t al_bp_bundle_object_t; #endif /* BP_TYPES_H_ */ ion-open-source/contrib/dtnperf/al_bp/src/includes.h0000644000175000017500000000135612356652303023167 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ #ifndef INCLUDES_H_ #define INCLUDES_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /*INCLUDES_H_*/ ion-open-source/contrib/dtnperf/al_bp/src/al_bp_api.c0000644000175000017500000005267112356652303023270 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico2@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * bp_abstraction_layer.c * */ #include "includes.h" #include "al_bp_api.h" /* Implementations API */ #include "al_bp_dtn.h" #include "al_bp_ion.h" static al_bp_implementation_t bp_implementation = BP_NONE; al_bp_implementation_t al_bp_get_implementation() { if (bp_implementation == BP_NONE) { char* find_dtnd = "ps ax | grep -w dtnd | grep -v grep > /dev/null"; char* find_ion = "ps ax | grep -w rfxclock | grep -v grep > /dev/null"; if (system(find_dtnd) == 0) bp_implementation = BP_DTN; else if (system(find_ion) == 0) bp_implementation = BP_ION; } return bp_implementation; } al_bp_error_t al_bp_open(al_bp_handle_t* handle) { if (handle == NULL) return BP_ENULLPNTR; switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_open(handle); case BP_ION: return bp_ion_attach(); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_open_with_ip(char *daemon_api_IP,int daemon_api_port,al_bp_handle_t* handle) { if (handle == NULL) return BP_ENULLPNTR; switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_open_with_IP(daemon_api_IP, daemon_api_port, handle); case BP_ION: return bp_ion_open_with_IP(daemon_api_IP, daemon_api_port, handle); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_errno(al_bp_handle_t handle) { switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_errno(handle); case BP_ION: return bp_ion_errno(handle); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_build_local_eid(al_bp_handle_t handle, al_bp_endpoint_id_t* local_eid, const char* service_tag, char * type, char * eid_destination) { if (local_eid == NULL) return BP_ENULLPNTR; switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_build_local_eid(handle, local_eid, service_tag); case BP_ION: return bp_ion_build_local_eid(local_eid, service_tag,type,eid_destination); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_register(al_bp_handle_t * handle, al_bp_reg_info_t* reginfo, al_bp_reg_id_t* newregid) { if (reginfo == NULL) return BP_ENULLPNTR; if (newregid == NULL) return BP_ENULLPNTR; switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_register(*handle, reginfo, newregid); case BP_ION: return bp_ion_register(handle, reginfo, newregid); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_find_registration(al_bp_handle_t handle, al_bp_endpoint_id_t * eid, al_bp_reg_id_t * newregid) { if (eid == NULL) return BP_ENULLPNTR; switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_find_registration(handle, eid, newregid); case BP_ION: return bp_ion_find_registration(handle, eid, newregid); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_unregister(al_bp_handle_t handle, al_bp_reg_id_t regid,al_bp_endpoint_id_t eid){ switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_unregister(handle, regid); case BP_ION: return bp_ion_unregister(eid); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_t* payload, al_bp_bundle_id_t* id) { if (spec == NULL) return BP_ENULLPNTR; if (payload == NULL) return BP_ENULLPNTR; if (id == NULL) return BP_ENULLPNTR; switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_send(handle, regid, spec, payload, id); case BP_ION: return bp_ion_send(handle, regid, spec, payload, id); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_recv(al_bp_handle_t handle, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_location_t location, al_bp_bundle_payload_t* payload, al_bp_timeval_t timeout) { if (spec == NULL) return BP_ENULLPNTR; if (payload == NULL) return BP_ENULLPNTR; switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_recv(handle, spec, location, payload, timeout); case BP_ION: return bp_ion_recv(handle, spec, location, payload, timeout); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_close(al_bp_handle_t handle) { switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_close(handle); case BP_ION: return bp_ion_close(handle); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_parse_eid_string(al_bp_endpoint_id_t* eid, const char* str) { if (eid == NULL) return BP_ENULLPNTR; switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_parse_eid_string(eid, str); case BP_ION: return bp_ion_parse_eid_string(eid, str); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } void al_bp_copy_eid(al_bp_endpoint_id_t* dst, al_bp_endpoint_id_t* src) { switch (al_bp_get_implementation()) { case BP_DTN: bp_dtn_copy_eid(dst, src); break; case BP_ION: bp_ion_copy_eid(dst, src); break; default: // cannot find bundle protocol implementation return ; } } al_bp_error_t al_bp_get_none_endpoint(al_bp_endpoint_id_t * eid_none) { switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_parse_eid_string(eid_none, "dtn:none"); case BP_ION: return bp_ion_parse_eid_string(eid_none, "dtn:none"); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } al_bp_error_t al_bp_set_payload(al_bp_bundle_payload_t* payload, al_bp_bundle_payload_location_t location, char* val, int len) { if (payload == NULL) return BP_ENULLPNTR; switch (al_bp_get_implementation()) { case BP_DTN: return bp_dtn_set_payload(payload, location, val, len); case BP_ION: return bp_ion_set_payload(payload, location, val, len); default: // cannot find bundle protocol implementation return BP_ENOBPI; } } void al_bp_free_extension_blocks(al_bp_bundle_spec_t* spec) { switch (al_bp_get_implementation()) { case BP_DTN: bp_dtn_free_extension_blocks(spec); break; case BP_ION: // NOT IMPLEMENTED break; default: // cannot find bundle protocol implementation return ; } } void al_bp_free_metadata_blocks(al_bp_bundle_spec_t* spec) { switch (al_bp_get_implementation()) { case BP_DTN: bp_dtn_free_metadata_blocks(spec); break; case BP_ION: // NOT IMPLEMENTED break; default: // cannot find bundle protocol implementation return ; } } void al_bp_free_payload(al_bp_bundle_payload_t* payload) { payload->status_report = NULL; switch (al_bp_get_implementation()) { case BP_DTN: bp_dtn_free_payload(payload); break; case BP_ION: bp_ion_free_payload(payload); break; default: // cannot find bundle protocol implementation return ; } } const char* al_bp_status_report_reason_to_str(al_bp_status_report_reason_t err) { switch (err) { case BP_SR_REASON_NO_ADDTL_INFO: return "no additional information"; case BP_SR_REASON_LIFETIME_EXPIRED: return "lifetime expired"; case BP_SR_REASON_FORWARDED_UNIDIR_LINK: return "forwarded over unidirectional link"; case BP_SR_REASON_TRANSMISSION_CANCELLED: return "transmission cancelled"; case BP_SR_REASON_DEPLETED_STORAGE: return "depleted storage"; case BP_SR_REASON_ENDPOINT_ID_UNINTELLIGIBLE: return "endpoint id unintelligible"; case BP_SR_REASON_NO_ROUTE_TO_DEST: return "no known route to destination"; case BP_SR_REASON_NO_TIMELY_CONTACT: return "no timely contact"; case BP_SR_REASON_BLOCK_UNINTELLIGIBLE: return "block unintelligible"; default: return "(unknown reason)"; } } char * al_bp_strerror(int err){ switch(err) { case BP_SUCCESS: return "success"; case BP_EINVAL: return "invalid argument"; case BP_ENULLPNTR: return "operation on a null pointer"; case BP_ECONNECT: return "error connecting to server"; case BP_ETIMEOUT: return "operation timed out"; case BP_ESIZE: return "payload too large"; case BP_ENOTFOUND: return "not found"; case BP_EINTERNAL: return "internal error"; case BP_EBUSY: return "registration already in use"; case BP_ENOSPACE: return "no storage space"; case BP_ENOTIMPL: return "function not yet implemented"; case BP_ENOBPI: return "cannot find bundle protocol implementation"; case BP_EATTACH: return "cannot attach bundle protocol"; case BP_EBUILDEID: return "cannot build local eid"; case BP_EOPEN : return "cannot open the connection whit bp"; case BP_EREG: return "cannot register the eid"; case BP_EPARSEEID: return "cannot parse the endpoint string"; case BP_ESEND: return "cannot send Bundle"; case BP_EUNREG: return "cannot unregister eid"; case BP_ERECV: return "cannot receive bundle"; case BP_ERECVINT: return "receive bundle interrupted"; case -1: return "(invalid error code -1)"; default: break; } // there's a small race condition here in case there are two // simultaneous calls that will clobber the same buffer, but this // should be rare and the worst that happens is that the output // string is garbled static char buf[128]; snprintf(buf, sizeof(buf), "(unknown error %d)", err); return buf; } /******************************************************************** * * HIGHER LEVEL FUNCTIONS * ******************************************************************** */ al_bp_error_t al_bp_bundle_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_object_t * bundle_object) { if (bundle_object == NULL) return BP_ENULLPNTR; memset(bundle_object->id, 0, sizeof(al_bp_bundle_id_t)); return al_bp_send(handle, regid, bundle_object->spec, bundle_object->payload, bundle_object->id); } al_bp_error_t al_bp_bundle_receive(al_bp_handle_t handle, al_bp_bundle_object_t bundle_object, al_bp_bundle_payload_location_t payload_location, al_bp_timeval_t timeout) { al_bp_free_payload(bundle_object.payload); al_bp_free_extension_blocks(bundle_object.spec); al_bp_free_metadata_blocks(bundle_object.spec); memset(bundle_object.id, 0, sizeof(al_bp_bundle_id_t)); memset(bundle_object.payload, 0, sizeof(al_bp_bundle_payload_t)); memset(bundle_object.spec, 0, sizeof(al_bp_bundle_spec_t)); return al_bp_recv(handle, bundle_object.spec, payload_location, bundle_object.payload, timeout); } al_bp_error_t al_bp_bundle_create(al_bp_bundle_object_t * bundle_object) { if (bundle_object == NULL) return BP_ENULLPNTR; bundle_object->id = (al_bp_bundle_id_t*) malloc(sizeof(al_bp_bundle_id_t)); bundle_object->spec = (al_bp_bundle_spec_t*) malloc(sizeof(al_bp_bundle_spec_t)); bundle_object->spec->blocks.blocks_val = (al_bp_extension_block_t*) malloc(sizeof(al_bp_extension_block_t)); bundle_object->spec->metadata.metadata_val = (al_bp_extension_block_t*) malloc(sizeof(al_bp_extension_block_t)); bundle_object->payload = (al_bp_bundle_payload_t*) malloc(sizeof(al_bp_bundle_payload_t)); memset(bundle_object->id, 0, sizeof(al_bp_bundle_id_t)); memset(bundle_object->spec, 0, sizeof(al_bp_bundle_spec_t)); memset(bundle_object->payload, 0, sizeof(al_bp_bundle_payload_t)); return BP_SUCCESS; } al_bp_error_t al_bp_bundle_free(al_bp_bundle_object_t * bundle_object) { if (bundle_object == NULL) return BP_ENULLPNTR; free(bundle_object->id); free(bundle_object->spec); al_bp_free_payload(bundle_object->payload); free(bundle_object->payload); return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_id(al_bp_bundle_object_t bundle_object, al_bp_bundle_id_t ** bundle_id) { if (bundle_object.id == NULL) return BP_ENULLPNTR; *bundle_id = bundle_object.id; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_payload_location(al_bp_bundle_object_t bundle_object, al_bp_bundle_payload_location_t * location) { if (bundle_object.payload == NULL) return BP_ENULLPNTR; * location = bundle_object.payload->location; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_payload_location(al_bp_bundle_object_t * bundle_object, al_bp_bundle_payload_location_t location) { if (bundle_object == NULL) return BP_ENULLPNTR; if (bundle_object->payload == NULL) return BP_ENULLPNTR; bundle_object->payload->location = location; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_payload_size(al_bp_bundle_object_t bundle_object, u32_t * size) { if (bundle_object.payload == NULL) return BP_ENULLPNTR; if (bundle_object.payload->location == BP_PAYLOAD_MEM) { if (bundle_object.payload->buf.buf_val != NULL) { * size = bundle_object.payload->buf.buf_len; return BP_SUCCESS; } else { // buffer is null return BP_ENULLPNTR; } } else if (bundle_object.payload->location == BP_PAYLOAD_FILE || bundle_object.payload->location == BP_PAYLOAD_TEMP_FILE) { if (bundle_object.payload->filename.filename_val == NULL) // filename is null return BP_ENULLPNTR; struct stat st; memset(&st, 0, sizeof(st)); if (stat(bundle_object.payload->filename.filename_val, &st) < 0) { perror("Error in checking bundle payload file"); return BP_EINTERNAL; } *size = st.st_size; return BP_SUCCESS; } else { // wrong payload location return BP_EINTERNAL; } } al_bp_error_t al_bp_bundle_get_payload_file(al_bp_bundle_object_t bundle_object, char_t ** filename, u32_t * filename_len) { if (bundle_object.payload->location == BP_PAYLOAD_FILE || bundle_object.payload->location == BP_PAYLOAD_TEMP_FILE) { if (bundle_object.payload->filename.filename_val == NULL) // filename is null { return BP_ENULLPNTR; } if (bundle_object.payload->filename.filename_len <= 0) // filename size error return BP_EINTERNAL; * filename_len = bundle_object.payload->filename.filename_len; (* filename) = bundle_object.payload->filename.filename_val; return BP_SUCCESS; } else // bundle location is not file return BP_EINVAL; } al_bp_error_t al_bp_bundle_get_payload_mem(al_bp_bundle_object_t bundle_object, char ** buf, u32_t * buf_len) { if (bundle_object.payload->location == BP_PAYLOAD_MEM) { if (bundle_object.payload->buf.buf_val != NULL) { *buf_len = bundle_object.payload->buf.buf_len; (*buf) = bundle_object.payload->buf.buf_val; return BP_SUCCESS; } else { // buffer is null return BP_ENULLPNTR; } } else // bundle location is not memory return BP_EINVAL; } al_bp_error_t al_bp_bundle_set_payload_file(al_bp_bundle_object_t * bundle_object, char_t * filename, u32_t filename_len) { if (bundle_object == NULL) return BP_ENULLPNTR; if (filename == NULL) return BP_ENULLPNTR; if (filename_len <= 0 ) return BP_EINVAL; al_bp_error_t err; if (bundle_object->payload == NULL){ al_bp_bundle_payload_t bundle_payload; memset(&bundle_payload, 0, sizeof(bundle_payload)); err = al_bp_set_payload(& bundle_payload, BP_PAYLOAD_FILE, filename, filename_len); bundle_object->payload = & bundle_payload; } else // payload not null { memset(bundle_object->payload, 0, sizeof(al_bp_bundle_payload_t)); err = al_bp_set_payload(bundle_object->payload, BP_PAYLOAD_FILE, filename, filename_len); } return err; } al_bp_error_t al_bp_bundle_set_payload_mem(al_bp_bundle_object_t * bundle_object, char * buf, u32_t buf_len) { if (bundle_object == NULL) return BP_ENULLPNTR; if (buf_len < 0) return BP_EINVAL; al_bp_error_t err; if (bundle_object->payload == NULL){ al_bp_bundle_payload_t bundle_payload; memset(&bundle_payload, 0, sizeof(bundle_payload)); err = al_bp_set_payload(& bundle_payload, BP_PAYLOAD_MEM, buf, buf_len); bundle_object->payload = & bundle_payload; } else //payload not null { memset(bundle_object->payload, 0, sizeof(al_bp_bundle_payload_t)); err = al_bp_set_payload(bundle_object->payload, BP_PAYLOAD_MEM, buf, buf_len); } return err; } al_bp_error_t al_bp_bundle_get_source(al_bp_bundle_object_t bundle_object, al_bp_endpoint_id_t * source) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; * source = bundle_object.spec->source; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_source(al_bp_bundle_object_t * bundle_object, al_bp_endpoint_id_t source) { if (bundle_object == NULL) return BP_ENULLPNTR; if (bundle_object->spec == NULL) return BP_ENULLPNTR; al_bp_copy_eid(&(bundle_object->spec->source), &source); return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_dest(al_bp_bundle_object_t bundle_object, al_bp_endpoint_id_t * dest) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; * dest = bundle_object.spec->dest; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_dest(al_bp_bundle_object_t * bundle_object, al_bp_endpoint_id_t dest) { if (bundle_object == NULL) return BP_ENULLPNTR; if (bundle_object->spec == NULL) return BP_ENULLPNTR; al_bp_copy_eid(&(bundle_object->spec->dest), &dest); return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_replyto(al_bp_bundle_object_t bundle_object, al_bp_endpoint_id_t * replyto) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; * replyto = bundle_object.spec->replyto; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_replyto(al_bp_bundle_object_t * bundle_object, al_bp_endpoint_id_t replyto) { if (bundle_object == NULL) return BP_ENULLPNTR; if (bundle_object->spec == NULL) return BP_ENULLPNTR; al_bp_copy_eid(&(bundle_object->spec->replyto), &replyto); return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_priority(al_bp_bundle_object_t bundle_object,al_bp_bundle_priority_t * priority) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; * priority = bundle_object.spec->priority; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_priority(al_bp_bundle_object_t * bundle_object, al_bp_bundle_priority_t priority) { if (bundle_object == NULL) return BP_ENULLPNTR; if(bundle_object->spec == NULL) return BP_ENULLPNTR; bundle_object->spec->priority = priority; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_unreliable(al_bp_bundle_object_t * bundle_object, boolean_t unreliable) { if (bundle_object == NULL) return BP_ENULLPNTR; if(bundle_object->spec == NULL) return BP_ENULLPNTR; bundle_object->spec->unreliable = unreliable; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_unreliable(al_bp_bundle_object_t bundle_object, boolean_t * unreliable) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; *unreliable = bundle_object.spec->unreliable; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_critical(al_bp_bundle_object_t * bundle_object, boolean_t critical) { if (bundle_object == NULL) return BP_ENULLPNTR; if(bundle_object->spec == NULL) return BP_ENULLPNTR; bundle_object->spec->critical = critical; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_critical(al_bp_bundle_object_t bundle_object, boolean_t * critical) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; *critical = bundle_object.spec->critical; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_flow_label(al_bp_bundle_object_t * bundle_object, u32_t flow_label) { if (bundle_object == NULL) return BP_ENULLPNTR; if(bundle_object->spec == NULL) return BP_ENULLPNTR; bundle_object->spec->flow_label = flow_label; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_flow_label(al_bp_bundle_object_t bundle_object, u32_t * flow_label) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; *flow_label = bundle_object.spec->flow_label; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_expiration(al_bp_bundle_object_t bundle_object, al_bp_timeval_t * exp) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; *exp = bundle_object.spec->expiration; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_expiration(al_bp_bundle_object_t * bundle_object, al_bp_timeval_t exp) { if (bundle_object == NULL) return BP_ENULLPNTR; if(bundle_object->spec == NULL) return BP_ENULLPNTR; bundle_object->spec->expiration = exp; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_creation_timestamp(al_bp_bundle_object_t bundle_object, al_bp_timestamp_t * ts) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; *ts = bundle_object.spec->creation_ts; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_creation_timestamp(al_bp_bundle_object_t * bundle_object, al_bp_timestamp_t ts) { if (bundle_object == NULL) return BP_ENULLPNTR; if(bundle_object->spec == NULL) return BP_ENULLPNTR; bundle_object->spec->creation_ts = ts; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_delivery_opts(al_bp_bundle_object_t bundle_object, al_bp_bundle_delivery_opts_t * dopts) { if (bundle_object.spec == NULL) return BP_ENULLPNTR; * dopts = bundle_object.spec->dopts; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_set_delivery_opts(al_bp_bundle_object_t * bundle_object, al_bp_bundle_delivery_opts_t dopts) { if (bundle_object == NULL) return BP_ENULLPNTR; if(bundle_object->spec == NULL) return BP_ENULLPNTR; bundle_object->spec->dopts = dopts; return BP_SUCCESS; } al_bp_error_t al_bp_bundle_get_status_report(al_bp_bundle_object_t bundle_object, al_bp_bundle_status_report_t ** status_report) { *status_report = bundle_object.payload->status_report; return BP_SUCCESS; } ion-open-source/contrib/dtnperf/al_bp/src/types.h0000644000175000017500000000225012356652303022517 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ #ifndef TYPES_H_ #define TYPES_H_ #ifndef NULL #define NULL ((void*)0) #endif #include typedef char char_t; typedef char * string_t; typedef const char* cstring_t; #ifndef TRUE #define TRUE (1 == 1) #endif #ifndef true #define true TRUE #endif #ifndef FALSE #define FALSE (0 == 1) #endif #ifndef false #define false FALSE #endif typedef char boolean_t; typedef signed char s8_t; typedef float float32_t; typedef signed long s32_t; typedef long double float128_t; typedef unsigned long u32_t; typedef double float64_t; typedef unsigned char u8_t; typedef unsigned short u16_t; typedef unsigned long long u64_t; typedef signed short s16_t; #endif //TYPES_H_ ion-open-source/contrib/dtnperf/al_bp/src/bp_implementations/0000775000175000017500000000000012356652303025076 5ustar jschendejschendeion-open-source/contrib/dtnperf/al_bp/src/bp_implementations/al_bp_dtn.c0000644000175000017500000002263012356652303027165 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * bp_dtn.c * */ #include "al_bp_dtn.h" /* * if there is the DTN2 implementation on the * machine the API are implemented */ #ifdef DTN2_IMPLEMENTATION #include "al_bp_dtn_conversions.h" al_bp_error_t bp_dtn_open(al_bp_handle_t* handle) { dtn_handle_t dtn_handle = al_dtn_handle(*handle); int result = dtn_open(& dtn_handle); * handle = dtn_al_handle(dtn_handle); return bp_dtn_error(result); } al_bp_error_t bp_dtn_open_with_IP(char * daemon_api_IP, int daemon_api_port, al_bp_handle_t * handle) { dtn_handle_t dtn_handle = al_dtn_handle(*handle); int result = dtn_open_with_IP(daemon_api_IP, daemon_api_port, & dtn_handle); * handle = dtn_al_handle(dtn_handle); return bp_dtn_error(result); } al_bp_error_t bp_dtn_errno(al_bp_handle_t handle) { dtn_handle_t dtn_handle = al_dtn_handle(handle); int result = dtn_errno(dtn_handle); handle = dtn_al_handle(dtn_handle); return bp_dtn_error(result); } al_bp_error_t bp_dtn_build_local_eid(al_bp_handle_t handle, al_bp_endpoint_id_t* local_eid, const char* service_tag) { dtn_handle_t dtn_handle = al_dtn_handle(handle); dtn_endpoint_id_t dtn_local_eid = al_dtn_endpoint_id(*local_eid); int result = dtn_build_local_eid(dtn_handle, & dtn_local_eid, service_tag); handle = dtn_al_handle(dtn_handle); * local_eid = dtn_al_endpoint_id(dtn_local_eid); return bp_dtn_error(result); } al_bp_error_t bp_dtn_register(al_bp_handle_t handle, al_bp_reg_info_t* reginfo, al_bp_reg_id_t* newregid) { dtn_handle_t dtn_handle = al_dtn_handle(handle); dtn_reg_info_t dtn_reginfo = al_dtn_reg_info(*reginfo); dtn_reg_id_t dtn_newregid = al_dtn_reg_id(*newregid); int result = dtn_register(dtn_handle, & dtn_reginfo, & dtn_newregid); handle = dtn_al_handle(dtn_handle); *reginfo = dtn_al_reg_info(dtn_reginfo); *newregid = dtn_al_reg_id(dtn_newregid); return bp_dtn_error(result); } al_bp_error_t bp_dtn_find_registration(al_bp_handle_t handle, al_bp_endpoint_id_t * eid, al_bp_reg_id_t * newregid) { dtn_handle_t dtn_handle = al_dtn_handle(handle); dtn_endpoint_id_t dtn_eid = al_dtn_endpoint_id(*eid); dtn_reg_id_t dtn_newregid = al_dtn_reg_id(*newregid); int result = dtn_find_registration(dtn_handle, & dtn_eid, & dtn_newregid); handle = dtn_al_handle(dtn_handle); * eid = dtn_al_endpoint_id(dtn_eid); *newregid = dtn_al_reg_id(dtn_newregid); return bp_dtn_error(result); } al_bp_error_t bp_dtn_unregister(al_bp_handle_t handle,al_bp_reg_id_t regid){ dtn_handle_t dtn_handle = al_dtn_handle(handle); dtn_reg_id_t dtn_regid = al_dtn_reg_id(regid); int result = dtn_unregister(dtn_handle,dtn_regid); if(result != 0) return BP_EUNREG; return BP_SUCCESS; } al_bp_error_t bp_dtn_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_t* payload, al_bp_bundle_id_t* id) { dtn_handle_t dtn_handle = al_dtn_handle(handle); dtn_reg_id_t dtn_regid = al_dtn_reg_id(regid); dtn_bundle_spec_t dtn_spec = al_dtn_bundle_spec(*spec); dtn_bundle_payload_t dtn_payload = al_dtn_bundle_payload(*payload); dtn_bundle_id_t dtn_id = al_dtn_bundle_id(*id); int result = dtn_send(dtn_handle, dtn_regid, & dtn_spec, & dtn_payload, & dtn_id); handle = dtn_al_handle(dtn_handle); regid = dtn_al_reg_id(dtn_regid); *spec = dtn_al_bundle_spec(dtn_spec); *payload = dtn_al_bundle_payload(dtn_payload); *id = dtn_al_bundle_id(dtn_id); return bp_dtn_error(result); } al_bp_error_t bp_dtn_recv(al_bp_handle_t handle, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_location_t location, al_bp_bundle_payload_t* payload, al_bp_timeval_t timeout) { dtn_handle_t dtn_handle = al_dtn_handle(handle); dtn_bundle_spec_t dtn_spec = al_dtn_bundle_spec(*spec); dtn_bundle_payload_location_t dtn_location = al_dtn_bundle_payload_location(location); dtn_bundle_payload_t dtn_payload = al_dtn_bundle_payload(*payload); dtn_timeval_t dtn_timeout = al_dtn_timeval(timeout); int result = dtn_recv(dtn_handle, & dtn_spec, dtn_location, & dtn_payload, dtn_timeout); handle = dtn_al_handle(dtn_handle); *spec = dtn_al_bundle_spec(dtn_spec); location = dtn_al_bundle_payload_location(dtn_location); *payload = dtn_al_bundle_payload(dtn_payload); timeout = dtn_al_timeval(dtn_timeout); return bp_dtn_error(result); } al_bp_error_t bp_dtn_close(al_bp_handle_t handle) { dtn_handle_t dtn_handle = al_dtn_handle(handle); int result = dtn_close(dtn_handle); handle = dtn_al_handle(dtn_handle); return bp_dtn_error(result); } void bp_dtn_copy_eid(al_bp_endpoint_id_t* dst, al_bp_endpoint_id_t* src) { dtn_endpoint_id_t dtn_dst = al_dtn_endpoint_id(*dst); dtn_endpoint_id_t dtn_src = al_dtn_endpoint_id(*src); dtn_copy_eid(& dtn_dst, & dtn_src); *dst = dtn_al_endpoint_id(dtn_dst); *src = dtn_al_endpoint_id(dtn_src); } al_bp_error_t bp_dtn_parse_eid_string(al_bp_endpoint_id_t* eid, const char* str) { dtn_endpoint_id_t dtn_eid = al_dtn_endpoint_id(*eid); int result = dtn_parse_eid_string(& dtn_eid, str); *eid = dtn_al_endpoint_id(dtn_eid); return bp_dtn_error(result); } al_bp_error_t bp_dtn_set_payload(al_bp_bundle_payload_t* payload, al_bp_bundle_payload_location_t location, char* val, int len) { dtn_bundle_payload_t dtn_payload = al_dtn_bundle_payload(*payload); dtn_bundle_payload_location_t dtn_location = al_dtn_bundle_payload_location(location); int result = dtn_set_payload(& dtn_payload, dtn_location, val, len); *payload = dtn_al_bundle_payload(dtn_payload); return bp_dtn_error(result); } void bp_dtn_free_payload(al_bp_bundle_payload_t* payload) { dtn_bundle_payload_t dtn_payload = al_dtn_bundle_payload(*payload); dtn_free_payload(&dtn_payload); *payload = dtn_al_bundle_payload(dtn_payload); } void bp_dtn_free_extension_blocks(al_bp_bundle_spec_t* spec) { int i; for ( i=0; iblocks.blocks_len; i++ ) { printf("Freeing extension block [%d].data at 0x%08X\n", i, spec->blocks.blocks_val[i].data.data_val); free(spec->blocks.blocks_val[i].data.data_val); } free(spec->blocks.blocks_val); spec->blocks.blocks_val = NULL; spec->blocks.blocks_len = 0; } void bp_dtn_free_metadata_blocks(al_bp_bundle_spec_t* spec) { int i; for ( i=0; imetadata.metadata_len; i++ ) { printf("Freeing metadata block [%d].data at 0x%08X\n", i, spec->metadata.metadata_val[i].data.data_val); free(spec->metadata.metadata_val[i].data.data_val); } free(spec->metadata.metadata_val); spec->metadata.metadata_val = NULL; spec->metadata.metadata_len = 0; } al_bp_error_t bp_dtn_error(int err) { switch (err) { case DTN_SUCCESS: return BP_SUCCESS; case DTN_EINVAL: return BP_EINVAL; case DTN_ECONNECT: return BP_ECONNECT; case DTN_ETIMEOUT: return BP_ETIMEOUT; case DTN_ESIZE: return BP_ESIZE; case DTN_ENOTFOUND: return BP_ENOTFOUND; case DTN_EINTERNAL: return BP_EINTERNAL; case DTN_EBUSY: return BP_EBUSY; case DTN_ENOSPACE: return BP_ENOSPACE; default: return -1; } } /* * if there isn't the DTN2 implementation * the API don't have any implementation */ #else al_bp_error_t bp_dtn_open(al_bp_handle_t* handle) { return BP_ENOTIMPL; } al_bp_error_t bp_dtn_open_with_IP(char * daemon_api_IP, int daemon_api_port, al_bp_handle_t * handle) { return BP_ENOTIMPL; } al_bp_error_t bp_dtn_errno(al_bp_handle_t handle) { return BP_ENOTIMPL; } al_bp_error_t bp_dtn_build_local_eid(al_bp_handle_t handle, al_bp_endpoint_id_t* local_eid, const char* service_tag) { return BP_ENOTIMPL; } al_bp_error_t bp_dtn_register(al_bp_handle_t handle, al_bp_reg_info_t* reginfo, al_bp_reg_id_t* newregid) { return BP_ENOTIMPL; } al_bp_error_t bp_dtn_find_registration(al_bp_handle_t handle, al_bp_endpoint_id_t * eid, al_bp_reg_id_t * newregid) { return BP_ENOTIMPL; } al_bp_error_t bp_dtn_unregister(al_bp_handle_t handle,al_bp_reg_id_t regid){ return BP_ENOTIMPL; } al_bp_error_t bp_dtn_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_t* payload, al_bp_bundle_id_t* id) { return BP_ENOTIMPL; } al_bp_error_t bp_dtn_recv(al_bp_handle_t handle, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_location_t location, al_bp_bundle_payload_t* payload, al_bp_timeval_t timeout) { return BP_ENOTIMPL; } al_bp_error_t bp_dtn_close(al_bp_handle_t handle) { return BP_ENOTIMPL; } void bp_dtn_copy_eid(al_bp_endpoint_id_t* dst, al_bp_endpoint_id_t* src) { } al_bp_error_t bp_dtn_parse_eid_string(al_bp_endpoint_id_t* eid, const char* str) { return BP_ENOTIMPL; } al_bp_error_t bp_dtn_set_payload(al_bp_bundle_payload_t* payload, al_bp_bundle_payload_location_t location, char* val, int len) { return BP_ENOTIMPL; } void bp_dtn_free_payload(al_bp_bundle_payload_t* payload) { } void bp_dtn_free_extension_blocks(al_bp_bundle_spec_t* spec) { } void bp_dtn_free_metadata_blocks(al_bp_bundle_spec_t* spec) { } al_bp_error_t bp_dtn_error(int err) { return BP_ENOTIMPL; } #endif /* DTN2_IMPLEMENTATION */ ion-open-source/contrib/dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.h0000644000175000017500000000724312356652303031625 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * al_bp_dtn_conversions.h * * Conversions from bp abstract types to dtn types and viceversa * */ #ifndef AL_BP_DTN_CONVERSIONS_H_ #define AL_BP_DTN_CONVERSIONS_H_ #ifdef DTN2_IMPLEMENTATION #include "../al_bp_types.h" #include #include /* * These functions convert bp abstract types in dtn types and viceversa * The prefix bp_dtn means the function takes a bp abstract type in and returns a dtn type * so the conversion is bp -> dtn * The prefix dtn_bp means the function takes a dtn type in and returns a bp abstract type * so the conversion is dtn -> bp */ dtn_handle_t al_dtn_handle(al_bp_handle_t handle); al_bp_handle_t dtn_al_handle(dtn_handle_t handle); dtn_endpoint_id_t al_dtn_endpoint_id(al_bp_endpoint_id_t endpoint_id); al_bp_endpoint_id_t dtn_al_endpoint_id(dtn_endpoint_id_t endpoint_id); dtn_timeval_t al_dtn_timeval(al_bp_timeval_t timeval); al_bp_timeval_t dtn_al_timeval(dtn_timeval_t); dtn_timestamp_t al_dtn_timestamp(al_bp_timestamp_t timestamp); al_bp_timestamp_t dtn_al_timestamp(dtn_timestamp_t timestamp); dtn_reg_token_t al_dtn_reg_token(al_bp_reg_token_t reg_token); al_bp_reg_token_t dtn_al_reg_token(dtn_reg_token_t reg_token); dtn_reg_id_t al_dtn_reg_id(al_bp_reg_id_t reg_id); al_bp_reg_id_t dtn_al_reg_id(dtn_reg_id_t reg_id); dtn_reg_info_t al_dtn_reg_info(al_bp_reg_info_t reg_info); al_bp_reg_info_t dtn_al_reg_info(dtn_reg_info_t reg_info); dtn_reg_flags_t al_dtn_reg_flags(al_bp_reg_flags_t reg_flags); al_bp_reg_flags_t dtn_al_reg_flags(dtn_reg_flags_t reg_flags); dtn_bundle_delivery_opts_t al_dtn_bundle_delivery_opts(al_bp_bundle_delivery_opts_t bundle_delivery_opts); al_bp_bundle_delivery_opts_t dtn_al_bundle_delivery_opts(dtn_bundle_delivery_opts_t bundle_delivery_opts); dtn_bundle_priority_t al_dtn_bundle_priority(al_bp_bundle_priority_t bundle_priority); al_bp_bundle_priority_t dtn_al_bunlde_priority(dtn_bundle_priority_t bundle_priority); dtn_bundle_spec_t al_dtn_bundle_spec(al_bp_bundle_spec_t bundle_spec); al_bp_bundle_spec_t dtn_al_bundle_spec(dtn_bundle_spec_t bundle_spec); dtn_bundle_payload_location_t al_dtn_bundle_payload_location(al_bp_bundle_payload_location_t bundle_payload_location); al_bp_bundle_payload_location_t dtn_al_bundle_payload_location(dtn_bundle_payload_location_t bundle_payload_location); dtn_status_report_reason_t al_dtn_status_report_reason(al_bp_status_report_reason_t status_report_reason); al_bp_status_report_reason_t dtn_al_status_report_reason(dtn_status_report_reason_t status_report_reason); dtn_status_report_flags_t al_dtn_status_report_flags(al_bp_status_report_flags_t status_repot_flags); al_bp_status_report_flags_t dtn_al_status_report_flags(dtn_status_report_flags_t status_repot_flags); dtn_bundle_id_t al_dtn_bundle_id(al_bp_bundle_id_t bundle_id); al_bp_bundle_id_t dtn_al_bundle_id(dtn_bundle_id_t bundle_id); dtn_bundle_status_report_t al_dtn_bundle_status_report(al_bp_bundle_status_report_t bundle_status_report); al_bp_bundle_status_report_t dtn_al_bundle_status_report(dtn_bundle_status_report_t bundle_status_report); al_bp_bundle_payload_t dtn_al_bundle_payload(dtn_bundle_payload_t bundle_payload); dtn_bundle_payload_t al_dtn_bundle_payload(al_bp_bundle_payload_t bundle_payload); #endif /* AL_BP_DTN_CONVERSIONS_H_ */ #endif /* DTN2_IMPLEMENTATION*/ ion-open-source/contrib/dtnperf/al_bp/src/bp_implementations/al_bp_ion.h0000644000175000017500000000570412356652303027175 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * bp_ion.h * * Functions interfacing the ion api * */ #ifndef BP_ION_H_ #define BP_ION_H_ #include "../al_bp_types.h" #define CBHESCHEMENAME "ipn" #define DTN2SCHEMENAME "dtn" al_bp_error_t bp_ion_attach(); al_bp_error_t bp_ion_open_with_IP(char * daemon_api_IP, int daemon_api_port, al_bp_handle_t * handle); al_bp_error_t bp_ion_errno(al_bp_handle_t handle); /* The local eid is built with different rule according to the type: * Client : * if the eid_destination is ipn:nn.ns then the local eid is: * ipn:ownNodeNbr.ownPid * if the eid_destination is dtn://name.dtn then the local eid is: * dtn://ownNodeNbr.dtn/service_tag * Server-CBHE or Monitor-CBHE : * the service tag is converted to long unsigned integer and the local eid is: * ipn:ownNodeNbr.service_tag * Server-DTN or Monitor-DTN: * the local eid is : * dtn://ownNodeNbr.dtn/service_tag * */ al_bp_error_t bp_ion_build_local_eid(al_bp_endpoint_id_t* local_eid, const char* service_tag, const char * type, char * eid_destination); /* This API register the eid and open the connection initializing the handle*/ al_bp_error_t bp_ion_register(al_bp_handle_t * handle, al_bp_reg_info_t* reginfo, al_bp_reg_id_t* newregid); al_bp_error_t bp_ion_find_registration(al_bp_handle_t handle, al_bp_endpoint_id_t * eid, al_bp_reg_id_t * newregid); al_bp_error_t bp_ion_unregister(al_bp_endpoint_id_t eid); al_bp_error_t bp_ion_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_t* payload, al_bp_bundle_id_t* id); al_bp_error_t bp_ion_recv(al_bp_handle_t handle, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_location_t location, al_bp_bundle_payload_t* payload, al_bp_timeval_t timeout); al_bp_error_t bp_ion_close(al_bp_handle_t handle); void bp_ion_copy_eid(al_bp_endpoint_id_t* dst, al_bp_endpoint_id_t* src); al_bp_error_t bp_ion_parse_eid_string(al_bp_endpoint_id_t* eid, const char* str); al_bp_error_t bp_ion_set_payload(al_bp_bundle_payload_t* payload, al_bp_bundle_payload_location_t location, char* val, int len); void bp_ion_free_payload(al_bp_bundle_payload_t* payload); /** * converts DTN errors in the corresponding al_bp_error_t values */ al_bp_error_t bp_ion_error(int err); #endif /* BP_ION_H_ */ ion-open-source/contrib/dtnperf/al_bp/src/bp_implementations/al_bp_dtn_conversions.c0000644000175000017500000003646612356652303031631 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * al_al_dtn_conversions.c * */ #ifdef DTN2_IMPLEMENTATION #include "al_bp_dtn_conversions.h" dtn_handle_t al_dtn_handle(al_bp_handle_t handle) { return (dtn_handle_t) handle; } al_bp_handle_t dtn_al_handle(dtn_handle_t handle) { return (al_bp_handle_t) handle; } dtn_endpoint_id_t al_dtn_endpoint_id(al_bp_endpoint_id_t endpoint_id) { dtn_endpoint_id_t dtn_eid; strncpy(dtn_eid.uri, endpoint_id.uri, DTN_MAX_ENDPOINT_ID); return dtn_eid; } al_bp_endpoint_id_t dtn_al_endpoint_id(dtn_endpoint_id_t endpoint_id) { al_bp_endpoint_id_t bp_eid; strncpy(bp_eid.uri, endpoint_id.uri, AL_BP_MAX_ENDPOINT_ID); return bp_eid; } dtn_timeval_t al_dtn_timeval(al_bp_timeval_t timeval) { return (al_bp_timeval_t) timeval; } al_bp_timeval_t dtn_al_timeval(dtn_timeval_t timeval) { return (dtn_timeval_t) timeval; } dtn_timestamp_t al_dtn_timestamp(al_bp_timestamp_t timestamp) { dtn_timestamp_t dtn_timestamp; dtn_timestamp.secs = timestamp.secs; dtn_timestamp.seqno = timestamp.seqno; return dtn_timestamp; } al_bp_timestamp_t dtn_al_timestamp(dtn_timestamp_t timestamp) { al_bp_timestamp_t bp_timestamp; bp_timestamp.secs = timestamp.secs; bp_timestamp.seqno = timestamp.seqno; return bp_timestamp; } dtn_reg_token_t al_dtn_reg_token(al_bp_reg_token_t reg_token) { return (dtn_reg_token_t) reg_token; } al_bp_reg_token_t dtn_al_reg_token(dtn_reg_token_t reg_token) { return (al_bp_reg_token_t) reg_token; } dtn_reg_id_t al_dtn_reg_id(al_bp_reg_id_t reg_id) { return (dtn_reg_id_t) reg_id; } al_bp_reg_id_t dtn_al_reg_id(dtn_reg_id_t reg_id) { return (al_bp_reg_id_t) reg_id; } dtn_reg_info_t al_dtn_reg_info(al_bp_reg_info_t reg_info) { dtn_reg_info_t dtn_reginfo; memset(&dtn_reginfo, 0, sizeof(dtn_reg_info_t)); dtn_reginfo.endpoint = al_dtn_endpoint_id(reg_info.endpoint); dtn_reginfo.regid = al_dtn_reg_id(reg_info.regid); dtn_reginfo.flags = reg_info.flags; dtn_reginfo.replay_flags = reg_info.replay_flags; dtn_reginfo.expiration = al_dtn_timeval(reg_info.expiration); dtn_reginfo.reg_token = al_dtn_reg_token(reg_info.reg_token); dtn_reginfo.init_passive = reg_info.init_passive; dtn_reginfo.script.script_len = reg_info.script.script_len; if (reg_info.script.script_len == 0) { dtn_reginfo.script.script_val = NULL; } else { dtn_reginfo.script.script_val = (char*) malloc(reg_info.script.script_len + 1); strncpy(dtn_reginfo.script.script_val, reg_info.script.script_val, reg_info.script.script_len + 1); } return dtn_reginfo; } al_bp_reg_info_t dtn_al_reg_info(dtn_reg_info_t reg_info) { al_bp_reg_info_t bp_reginfo; memset(&bp_reginfo, 0, sizeof(al_bp_reg_info_t)); bp_reginfo.endpoint = dtn_al_endpoint_id(reg_info.endpoint); bp_reginfo.regid = dtn_al_reg_id(reg_info.regid); bp_reginfo.flags = reg_info.flags; bp_reginfo.replay_flags = reg_info.replay_flags; bp_reginfo.expiration = dtn_al_timeval(reg_info.expiration); bp_reginfo.reg_token = dtn_al_reg_token(reg_info.reg_token); bp_reginfo.init_passive = reg_info.init_passive; bp_reginfo.script.script_len = reg_info.script.script_len; if (reg_info.script.script_len == 0) { bp_reginfo.script.script_val = NULL; } else { bp_reginfo.script.script_val = (char*) malloc(reg_info.script.script_len + 1); strncpy(bp_reginfo.script.script_val, reg_info.script.script_val, reg_info.script.script_len + 1); } return bp_reginfo; } dtn_reg_flags_t al_dtn_reg_flags(al_bp_reg_flags_t reg_flags) { return (dtn_reg_flags_t) reg_flags; } al_bp_reg_flags_t dtn_al_reg_flags(dtn_reg_flags_t reg_flags) { return (al_bp_reg_flags_t) reg_flags; } dtn_bundle_delivery_opts_t al_dtn_bundle_delivery_opts(al_bp_bundle_delivery_opts_t bundle_delivery_opts) { return (dtn_bundle_delivery_opts_t) bundle_delivery_opts; } al_bp_bundle_delivery_opts_t dtn_al_bundle_delivery_opts(dtn_bundle_delivery_opts_t bundle_delivery_opts) { return (al_bp_bundle_delivery_opts_t) bundle_delivery_opts; } dtn_bundle_priority_t al_dtn_bundle_priority(al_bp_bundle_priority_t bundle_priority) { return (dtn_bundle_priority_t) bundle_priority.priority; } al_bp_bundle_priority_t dtn_al_bundle_priority(dtn_bundle_priority_t bundle_priority) { al_bp_bundle_priority_t bp_priority; bp_priority.priority = (al_bp_bundle_priority_enum) bundle_priority; bp_priority.ordinal = 0; return bp_priority; } dtn_bundle_spec_t al_dtn_bundle_spec(al_bp_bundle_spec_t bundle_spec) { dtn_bundle_spec_t dtn_bundle_spec; int i; al_bp_extension_block_t dtn_bundle_block; memset(&dtn_bundle_spec, 0, sizeof(dtn_bundle_spec)); memset(&dtn_bundle_block, 0, sizeof(dtn_bundle_block)); dtn_bundle_spec.source = al_dtn_endpoint_id(bundle_spec.source); dtn_bundle_spec.dest = al_dtn_endpoint_id(bundle_spec.dest); dtn_bundle_spec.replyto = al_dtn_endpoint_id(bundle_spec.replyto); dtn_bundle_spec.priority = al_dtn_bundle_priority(bundle_spec.priority); dtn_bundle_spec.dopts = al_dtn_bundle_delivery_opts(bundle_spec.dopts); dtn_bundle_spec.expiration = al_dtn_timeval(bundle_spec.expiration); dtn_bundle_spec.creation_ts = al_dtn_timestamp(bundle_spec.creation_ts); dtn_bundle_spec.delivery_regid = al_dtn_reg_id(bundle_spec.delivery_regid); dtn_bundle_spec.blocks.blocks_len = bundle_spec.blocks.blocks_len; dtn_bundle_spec.metadata.metadata_len = bundle_spec.metadata.metadata_len; if(dtn_bundle_spec.blocks.blocks_len == 0) dtn_bundle_spec.blocks.blocks_val = NULL; else { dtn_bundle_spec.blocks.blocks_val = (dtn_extension_block_t*) malloc(bundle_spec.blocks.blocks_len); for(i=0; i int albp_parseAdminRecord(int *adminRecordType, BpStatusRpt *rpt,BpCtSignal *csig, void **otherPtr, Object payload); int albp_parseStatusRpt(BpStatusRpt *rpt, unsigned char *cursor,int unparsedBytes, int isFragment); /*********************************/ al_bp_error_t bp_ion_attach(){ int result; result = bp_attach(); if(result == -1) { return BP_EATTACH; } return BP_SUCCESS; } al_bp_error_t bp_ion_open_with_IP(char * daemon_api_IP, int daemon_api_port, al_bp_handle_t * handle) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_errno(al_bp_handle_t handle) { printf("%s\n",system_error_msg()); return BP_SUCCESS; } al_bp_error_t bp_ion_build_local_eid(al_bp_endpoint_id_t* local_eid, const char* service_tag, const char * type, char * eid_destination) { char * eidString, * hostname; int result; VScheme * scheme; PsmAddress psmAddress; eidString = (char *)malloc(sizeof(char)*AL_BP_MAX_ENDPOINT_ID); /*Client*/ if(strcmp(type,"Client") == 0) { if(strncmp(eid_destination,CBHESCHEMENAME,3) == 0) { findScheme(CBHESCHEMENAME,&scheme,&psmAddress); if(psmAddress == 0) { /*Unknow scheme*/ result = addScheme(CBHESCHEMENAME,"ipnfw","ipnadmin"); if(result == 0) return BP_EBUILDEID; } unsigned long int service_num = getpid(); sprintf(eidString, "%s:%lu", CBHESCHEMENAME,(unsigned long int)getOwnNodeNbr()); sprintf(eidString, "%s.%lu", eidString,service_num); (*local_eid) = ion_al_endpoint_id(eidString); } else { findScheme(DTN2SCHEMENAME,&scheme,&psmAddress); if(psmAddress == 0) { /*Unknow scheme*/ result = addScheme(DTN2SCHEMENAME,"dtn2fw","dtn2admin"); if(result == 0) return BP_EBUILDEID; } hostname = (char *)malloc(sizeof(char)*50); result = gethostname(hostname, sizeof(hostname)); if(result == -1) return BP_EBUILDEID; sprintf(eidString,"%s://%s.dtn%s",DTN2SCHEMENAME,hostname,service_tag); (*local_eid) = ion_al_endpoint_id(eidString); free(hostname); } } /* Server and Monitor CBHE*/ else if(strcmp(type,"Server-CBHE")==0 || strcmp(type,"Monitor-CBHE") == 0) { findScheme(CBHESCHEMENAME,&scheme,&psmAddress); if(psmAddress == 0) { /*Unknow scheme*/ result = addScheme(CBHESCHEMENAME,"ipnfw","ipnadmin"); if(result == 0) return BP_EBUILDEID; } long int service_num = strtol(service_tag,NULL,10); sprintf(eidString, "%s:%lu", CBHESCHEMENAME,(unsigned long int) getOwnNodeNbr()); sprintf(eidString, "%s.%lu", eidString,service_num); (*local_eid) = ion_al_endpoint_id(eidString); } /* Server and Monitor DTN*/ else if(strcmp(type,"Server-DTN")==0 || strcmp(type,"Monitor-DTN") == 0) { findScheme(DTN2SCHEMENAME,&scheme,&psmAddress); if(psmAddress == 0) { /*Unknow scheme*/ result = addScheme(DTN2SCHEMENAME,"dtn2fw","dtn2admin"); if(result == 0) return BP_EBUILDEID; } hostname = (char *)malloc(sizeof(char)*50); result = gethostname(hostname, sizeof(hostname)); if(result == -1) return BP_EBUILDEID; sprintf(eidString,"%s://%s.dtn%s",DTN2SCHEMENAME,hostname,service_tag); (*local_eid) = ion_al_endpoint_id(eidString); free(hostname); } else return BP_EBUILDEID; //Free resource free(eidString); return BP_SUCCESS; } al_bp_error_t bp_ion_register(al_bp_handle_t * handle, al_bp_reg_info_t* reginfo, al_bp_reg_id_t* newregid) { int result; BpSAP bpSap; char * eid; bpSap = al_ion_handle(*handle); eid = al_ion_endpoint_id(reginfo->endpoint); /* switch(reginfo->flags) { case BP_REG_DEFER: rule = EnqueueBundle;break; case BP_REG_DROP: rule = DiscardBundle;break; default: return BP_EINVAL; }*/ //If the eid is not registrated then it will be registrated if(bp_ion_find_registration(*handle,&(reginfo->endpoint),newregid) == BP_ENOTFOUND) { result = addEndpoint(eid, DiscardBundle ,NULL); if(result == 0) return BP_EREG; } result = bp_open(eid,&bpSap); if(result == -1) return BP_EREG; //Free resource free(eid); (*handle) = ion_al_handle(bpSap); return BP_SUCCESS; } al_bp_error_t bp_ion_find_registration(al_bp_handle_t handle, al_bp_endpoint_id_t * eid, al_bp_reg_id_t * newregid) { char * schemeName, * endpoint; VEndpoint * veid; PsmAddress psmAddress; MetaEid metaEid; VScheme * vscheme; endpoint = al_ion_endpoint_id((*eid)); schemeName = (char *)malloc(sizeof(char)*4); if(strncmp(endpoint,"ipn",3) == 0) strncpy(schemeName,"ipn",4); else strncpy(schemeName,"dtn",4); if(parseEidString(endpoint,&metaEid,&vscheme,&psmAddress) == 0) return BP_EPARSEEID; findEndpoint(schemeName,metaEid.nss,vscheme,&veid,&psmAddress); if(psmAddress == 0) return BP_ENOTFOUND; if (sm_TaskExists(veid->appPid)) { if (veid->appPid != -1) return BP_EBUSY; } //Free resource free(schemeName); free(endpoint); return BP_SUCCESS; } al_bp_error_t bp_ion_unregister(al_bp_endpoint_id_t eid) { char * ion_eid = al_ion_endpoint_id(eid); int result = removeEndpoint(ion_eid); free(ion_eid); if(result != 1) { return BP_EUNREG; } return BP_SUCCESS; } al_bp_error_t bp_ion_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_t* payload, al_bp_bundle_id_t* id) { BpSAP bpSap = al_ion_handle(handle); char * destEid = al_ion_endpoint_id(spec->dest); char * reportEid = NULL; char * tokenClassOfService; int result, tmpCustody, tmpPriority, lifespan, ackRequested; unsigned char srrFlags; BpCustodySwitch custodySwitch; BpExtendedCOS extendedCOS = { 0, 0, 0 }; /* Set option bundle */ reportEid = al_ion_endpoint_id(spec->replyto); lifespan = (int) spec->expiration; custodySwitch = NoCustodyRequested; srrFlags = al_ion_bundle_srrFlags(spec->dopts); ackRequested = 0; Payload ion_payload = al_ion_bundle_payload((*payload)); Object adu = ion_payload.content; Object newBundleObj; /* Create String for parse class of service */ if(spec->dopts & BP_DOPTS_CUSTODY) { tmpCustody = 1; } else { tmpCustody = 0; } tmpPriority = al_ion_bundle_priority(spec->priority); if(tmpPriority == -1) return BP_EINVAL; tokenClassOfService = (char *)malloc(sizeof(char)*255); sprintf(tokenClassOfService,"%1u.%1u.%lu.%1u.%1u.%lu", tmpCustody, tmpPriority, (unsigned long) spec->priority.ordinal, spec->unreliable==TRUE?1:0, spec->critical==TRUE?1:0, (unsigned long) spec->flow_label); //printf("COS is: %s\n", tokenClassOfService); result = bp_parse_class_of_service(tokenClassOfService,&extendedCOS,&custodySwitch,&tmpPriority); if(result == 0) return BP_EINVAL; /* Send Bundle*/ result = bp_send(bpSap,destEid,reportEid,lifespan,tmpPriority, custodySwitch,srrFlags,ackRequested,&extendedCOS,adu,&newBundleObj); if(result == 0) return BP_ENOSPACE; if(result == -1) return BP_ESEND; /* Set Id Bundle Sent*/ Bundle bundleION; Sdr bpSdr = bp_get_sdr(); sdr_begin_xn(bpSdr); sdr_read(bpSdr,(char*)&bundleION,(SdrAddress) newBundleObj,sizeof(Bundle)); sdr_end_xn(bpSdr); char * tmpEidSource; printEid(&(bundleION.id.source),retrieveDictionary(&bundleION),&tmpEidSource); id->source = ion_al_endpoint_id(tmpEidSource); id->creation_ts = ion_al_timestamp(bundleION.id.creationTime); id->frag_offset = bundleION.id.fragmentOffset; id->orig_length = bundleION.totalAduLength; // handle = ion_al_handle(bpSap); //Free resource free(destEid); free(reportEid); free(tokenClassOfService); return BP_SUCCESS; } al_bp_error_t bp_ion_recv(al_bp_handle_t handle, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_location_t location, al_bp_bundle_payload_t* payload, al_bp_timeval_t timeout) { BpSAP bpSap = al_ion_handle(handle); BpDelivery dlv; DtnTime ion_timeout = al_ion_timeval(timeout); int second_timeout = (int) ion_timeout.seconds; int result; result = bp_receive(bpSap ,&dlv, second_timeout); if(result < 0) { return BP_ERECV; } if(dlv.result == BpReceptionTimedOut) { //printf("\nAL-BP: Result Timeout\n"); return BP_ETIMEOUT; } if(dlv.result == BpReceptionInterrupted) { printf("\nAL-BP: Reception Interrupted\n"); return BP_ERECVINT; } /* Set Bundle Spec */ spec->creation_ts = ion_al_timestamp(dlv.bundleCreationTime); spec->source = ion_al_endpoint_id(dlv.bundleSourceEid); char * tmp = "dtn:none"; spec->replyto = ion_al_endpoint_id(tmp); /* Payload */ Sdr bpSdr = bp_get_sdr(); Payload ion_payload; ion_payload.content = dlv.adu; ion_payload.length = zco_source_data_length(bpSdr, dlv.adu); /* File Name if payload is saved in a file */ char * filename = (char *) malloc(sizeof(char)*256); char * tmp_eid = (char *) malloc(sizeof(char) * (strlen(dlv.bundleSourceEid)+1)); strcpy(tmp_eid,dlv.bundleSourceEid); /* Take EID from Source*/ if(strncmp(dlv.bundleSourceEid,"ipn",3) != 0) { strtok(tmp_eid, "/"); tmp = strtok(NULL, "/"); /* tmp_eid = "dtn://vm1.dtn/src_2222" * after * tmp_eid = "vm1.dtn" * */ } else { strtok(tmp_eid,":"); tmp = strtok(NULL,":"); /* tmp_eid = "ipn:1.2222" * after * tmp_eid = "1.2222" * */ } sprintf(filename,"/tmp/ion%s_%u_%u",tmp, dlv.bundleCreationTime.seconds,dlv.bundleCreationTime.count); (*payload) = ion_al_bundle_payload(ion_payload,location,filename); free(filename); free(tmp_eid); /* Status Report */ BpStatusRpt statusRpt; BpCtSignal ctSignal; void * acsptr; if(albp_parseAdminRecord(&dlv.adminRecord,&statusRpt,&ctSignal,&acsptr,dlv.adu) == 1) { al_bp_bundle_status_report_t bp_statusRpt = ion_al_bundle_status_report(statusRpt); if(payload->status_report == NULL) { payload->status_report = (al_bp_bundle_status_report_t *) malloc(sizeof(al_bp_bundle_status_report_t)); } (*payload->status_report) = bp_statusRpt; } /* Release Delivery */ bp_release_delivery(&dlv, 1); // handle = ion_al_handle(bpSap); return BP_SUCCESS; } al_bp_error_t bp_ion_close(al_bp_handle_t handle) { BpSAP bpSap = al_ion_handle(handle); bp_close(bpSap); handle = ion_al_handle(bpSap); return BP_SUCCESS; } void bp_ion_copy_eid(al_bp_endpoint_id_t* dst, al_bp_endpoint_id_t* src) { char * ion_dst; char * ion_src; int length; ion_src = al_ion_endpoint_id((*src)); length = strlen(ion_src)+1; ion_dst = (char *)malloc(sizeof(char)*length); strncpy(ion_dst,ion_src,length); (*dst) = ion_al_endpoint_id(ion_dst); free(ion_dst); free(ion_src); } al_bp_error_t bp_ion_parse_eid_string(al_bp_endpoint_id_t* eid, const char* str) { char * endpoint; PsmAddress psmAddress; MetaEid metaEid; VScheme * vscheme; endpoint = (char *) malloc(sizeof(char)*AL_BP_MAX_ENDPOINT_ID); strncpy(endpoint,str,strlen(str)+1); if(parseEidString(endpoint,&metaEid,&vscheme,&psmAddress) == 0) return BP_EPARSEEID; (*eid) = ion_al_endpoint_id((char *)str); free(endpoint); return BP_SUCCESS; } al_bp_error_t bp_ion_set_payload(al_bp_bundle_payload_t* payload, al_bp_bundle_payload_location_t location, char* val, int len) { memset(payload,0,sizeof(al_bp_bundle_payload_t)); payload->location = location; if(location == BP_PAYLOAD_MEM) { payload->buf.buf_len = len; payload->buf.buf_val= val; } else { payload->filename.filename_len = len; payload->filename.filename_val = val; } return BP_SUCCESS; } void bp_ion_free_payload(al_bp_bundle_payload_t* payload) { if(payload->status_report != NULL) { free(payload->status_report); } if(payload->location != BP_PAYLOAD_MEM && payload->filename.filename_val != NULL) { int type = 0; Sdr bpSdr = bp_get_sdr(); sdr_begin_xn(bpSdr); Object fileRef = sdr_find(bpSdr, payload->filename.filename_val, &type); if(fileRef != 0) zco_destroy_file_ref(bpSdr, fileRef); sdr_end_xn(bpSdr); } } al_bp_error_t bp_ion_error(int err) { return BP_ENOTIMPL; } /***************** PRIVATE FUNCTION ****************** * There are 2 private function to parse the payload * and have the status report. * This function are a copy of private function of ION *****************************************************/ /* * * Parse the admin record to have a status report. * Return 1 on success * */ int albp_parseAdminRecord(int *adminRecordType, BpStatusRpt *rpt, BpCtSignal *csig, void **otherPtr, Object payload) { Sdr bpSdr = bp_get_sdr(); unsigned int buflen; char *buffer; ZcoReader reader; char *cursor; int bytesToParse; int unparsedBytes; int bundleIsFragment; int result; sdr_begin_xn(bpSdr); buflen = zco_source_data_length(bpSdr, payload); buffer = (char *) malloc(sizeof(char)*buflen); if ( buffer == NULL ) { sdr_end_xn(bpSdr); return -1; } zco_start_receiving(payload, &reader); bytesToParse = zco_receive_source(bpSdr, &reader, buflen, buffer); if (bytesToParse < 0) { sdr_end_xn(bpSdr); free(buffer); return -1; } cursor = buffer; unparsedBytes = bytesToParse; if (unparsedBytes < 1) { sdr_end_xn(bpSdr); free(buffer); return -1; } *adminRecordType = (*cursor >> 4 ) & 0x0f; bundleIsFragment = *cursor & 0x01; cursor++; unparsedBytes--; switch (*adminRecordType) { case BP_STATUS_REPORT: result = albp_parseStatusRpt(rpt, (unsigned char *) cursor,unparsedBytes, bundleIsFragment); break; case BP_CUSTODY_SIGNAL: result = 0; break; default: result = 0; break; } sdr_end_xn(bpSdr); free(buffer); return result; } /* * * Parse cursor to have a status report * Return 1 on success * */ int albp_parseStatusRpt(BpStatusRpt *rpt, unsigned char *cursor,int unparsedBytes, int isFragment) { unsigned int eidLength; memset((char *) rpt, 0, sizeof(BpStatusRpt)); rpt->isFragment = isFragment; if (unparsedBytes < 1) { return 0; } rpt->flags = *cursor; cursor++; rpt->reasonCode = *cursor; cursor++; unparsedBytes -= 2; if (isFragment) { extractSmallSdnv(&(rpt->fragmentOffset), &cursor, &unparsedBytes); extractSmallSdnv(&(rpt->fragmentLength), &cursor, &unparsedBytes); } if (rpt->flags & BP_RECEIVED_RPT) { extractSmallSdnv(&(rpt->receiptTime.seconds), &cursor,&unparsedBytes); extractSmallSdnv(&(rpt->receiptTime.nanosec), &cursor,&unparsedBytes); } if (rpt->flags & BP_CUSTODY_RPT) { extractSmallSdnv(&(rpt->acceptanceTime.seconds), &cursor,&unparsedBytes); extractSmallSdnv(&(rpt->acceptanceTime.nanosec), &cursor,&unparsedBytes); } if (rpt->flags & BP_FORWARDED_RPT) { extractSmallSdnv(&(rpt->forwardTime.seconds), &cursor,&unparsedBytes); extractSmallSdnv(&(rpt->forwardTime.nanosec), &cursor,&unparsedBytes); } if (rpt->flags & BP_DELIVERED_RPT) { extractSmallSdnv(&(rpt->deliveryTime.seconds), &cursor,&unparsedBytes); extractSmallSdnv(&(rpt->deliveryTime.nanosec), &cursor,&unparsedBytes); } if (rpt->flags & BP_DELETED_RPT) { extractSmallSdnv(&(rpt->deletionTime.seconds), &cursor,&unparsedBytes); extractSmallSdnv(&(rpt->deletionTime.nanosec), &cursor,&unparsedBytes); } extractSmallSdnv(&(rpt->creationTime.seconds), &cursor, &unparsedBytes); extractSmallSdnv(&(rpt->creationTime.count), &cursor, &unparsedBytes); extractSmallSdnv(&eidLength, &cursor, &unparsedBytes); if (unparsedBytes != eidLength) { return 0; } rpt->sourceEid = MTAKE(eidLength + 1); if (rpt->sourceEid == NULL) { return -1; } memcpy(rpt->sourceEid, cursor, eidLength); rpt->sourceEid[eidLength] = '\0'; return 1; } /*****************************************************/ /* * If there isn't the ION implementation * the API there are not implementation */ #else al_bp_error_t bp_ion_attach() { return BP_ENOTIMPL; } al_bp_error_t bp_ion_open_with_IP(char * daemon_api_IP, int daemon_api_port, al_bp_handle_t * handle) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_errno(al_bp_handle_t handle) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_build_local_eid(al_bp_endpoint_id_t* local_eid, const char* service_tag, const char * type, char * eid_destination) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_register(al_bp_handle_t * handle, al_bp_reg_info_t* reginfo, al_bp_reg_id_t* newregid) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_find_registration(al_bp_handle_t handle, al_bp_endpoint_id_t * eid, al_bp_reg_id_t * newregid) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_unregister(al_bp_endpoint_id_t eid) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_t* payload, al_bp_bundle_id_t* id) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_recv(al_bp_handle_t handle, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_location_t location, al_bp_bundle_payload_t* payload, al_bp_timeval_t timeout) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_close(al_bp_handle_t handle) { return BP_ENOTIMPL; } void bp_ion_copy_eid(al_bp_endpoint_id_t* dst, al_bp_endpoint_id_t* src) { } al_bp_error_t bp_ion_parse_eid_string(al_bp_endpoint_id_t* eid, const char* str) { return BP_ENOTIMPL; } al_bp_error_t bp_ion_set_payload(al_bp_bundle_payload_t* payload, al_bp_bundle_payload_location_t location, char* val, int len) { return BP_ENOTIMPL; } void bp_ion_free_payload(al_bp_bundle_payload_t* payload) { } al_bp_error_t bp_ion_error(int err) { return BP_ENOTIMPL; } #endif /* ION_IMPLEMENTATION */ ion-open-source/contrib/dtnperf/al_bp/src/bp_implementations/al_bp_dtn.h0000644000175000017500000000447012356652303027174 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * bp_dtn.h * * Functions interfacing the dtn2 api * */ #ifndef BP_DTN_H_ #define BP_DTN_H_ #include "../al_bp_types.h" #ifdef DTN2_IMPLEMENTATION #ifdef HAVE_CONFIG_H # include #endif #endif al_bp_error_t bp_dtn_open(al_bp_handle_t* handle); al_bp_error_t bp_dtn_open_with_IP(char * daemon_api_IP, int daemon_api_port, al_bp_handle_t * handle); al_bp_error_t bp_dtn_errno(al_bp_handle_t handle); al_bp_error_t bp_dtn_build_local_eid(al_bp_handle_t handle, al_bp_endpoint_id_t* local_eid, const char* service_tag); al_bp_error_t bp_dtn_register(al_bp_handle_t handle, al_bp_reg_info_t* reginfo, al_bp_reg_id_t* newregid); al_bp_error_t bp_dtn_find_registration(al_bp_handle_t handle, al_bp_endpoint_id_t * eid, al_bp_reg_id_t * newregid); al_bp_error_t bp_dtn_unregister(al_bp_handle_t handle,al_bp_reg_id_t regid); al_bp_error_t bp_dtn_send(al_bp_handle_t handle, al_bp_reg_id_t regid, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_t* payload, al_bp_bundle_id_t* id); al_bp_error_t bp_dtn_recv(al_bp_handle_t handle, al_bp_bundle_spec_t* spec, al_bp_bundle_payload_location_t location, al_bp_bundle_payload_t* payload, al_bp_timeval_t timeout); al_bp_error_t bp_dtn_close(al_bp_handle_t handle); void bp_dtn_copy_eid(al_bp_endpoint_id_t* dst, al_bp_endpoint_id_t* src); al_bp_error_t bp_dtn_parse_eid_string(al_bp_endpoint_id_t* eid, const char* str); al_bp_error_t bp_dtn_set_payload(al_bp_bundle_payload_t* payload, al_bp_bundle_payload_location_t location, char* val, int len); void bp_dtn_free_payload(al_bp_bundle_payload_t* payload); void bp_dtn_free_extension_blocks(al_bp_bundle_spec_t* spec); void bp_dtn_free_metadata_blocks(al_bp_bundle_spec_t* spec); /** * converts DTN errors in the corresponding al_bp_error_t values */ al_bp_error_t bp_dtn_error(int err); #endif /* BP_DTN_H_ */ ion-open-source/contrib/dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.c0000644000175000017500000002422312356652303031615 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /************* * * bp_ion_conversion.c * * Conversions bp abstract types to ion types and viceversa * *************/ #ifdef ION_IMPLEMENTATION #include "al_bp_ion_conversions.h" BpSAP al_ion_handle(al_bp_handle_t handle){ return (BpSAP) handle; } al_bp_handle_t ion_al_handle(BpSAP handle){ return (al_bp_handle_t) handle; } char * al_ion_endpoint_id(al_bp_endpoint_id_t endpoint_id) { char * eid_ion; int length_eid = strlen(endpoint_id.uri)+1; eid_ion = (char *)(malloc(sizeof(char)*length_eid)); strncpy(eid_ion,endpoint_id.uri,length_eid); return eid_ion; } al_bp_endpoint_id_t ion_al_endpoint_id(char * endpoint_id) { al_bp_endpoint_id_t eid_bp; int length = strlen(endpoint_id)+1; strncpy(eid_bp.uri,endpoint_id,length); return eid_bp; } BpTimestamp al_ion_timestamp(al_bp_timestamp_t timestamp) { BpTimestamp ion_timestamp; ion_timestamp.seconds = timestamp.secs; ion_timestamp.count = timestamp.seqno; return ion_timestamp; } al_bp_timestamp_t ion_al_timestamp(BpTimestamp timestamp) { al_bp_timestamp_t bp_timestamp; bp_timestamp.secs = timestamp.seconds; bp_timestamp.seqno = timestamp.count; return bp_timestamp; } DtnTime al_ion_timeval(al_bp_timeval_t timeval){ DtnTime dtntime; dtntime.seconds = timeval; dtntime.nanosec = 0; return dtntime; } al_bp_timeval_t ion_al_timeval(DtnTime timeval){ al_bp_timeval_t time; time = timeval.seconds; return time; } unsigned char al_ion_bundle_srrFlags(al_bp_bundle_delivery_opts_t bundle_delivery_opts){ int opts = 0; if(bundle_delivery_opts & BP_DOPTS_RECEIVE_RCPT) opts |= BP_RECEIVED_RPT; if(bundle_delivery_opts & BP_DOPTS_CUSTODY_RCPT) opts |= BP_CUSTODY_RPT; if(bundle_delivery_opts & BP_DOPTS_DELIVERY_RCPT) opts |= BP_DELIVERED_RPT; if(bundle_delivery_opts & BP_DOPTS_FORWARD_RCPT) opts |= BP_FORWARDED_RPT; if(bundle_delivery_opts & BP_DOPTS_DELETE_RCPT) opts |= BP_DELETED_RPT; return opts; } al_bp_bundle_delivery_opts_t ion_al_bundle_srrFlags(unsigned char srrFlags){ al_bp_bundle_delivery_opts_t opts = BP_DOPTS_NONE; if(srrFlags & BP_RECEIVED_RPT) opts |= BP_DOPTS_RECEIVE_RCPT; if(srrFlags & BP_CUSTODY_RPT) opts |= BP_DOPTS_CUSTODY_RCPT; if(srrFlags & BP_DELIVERED_RPT) opts |= BP_DOPTS_DELIVERY_RCPT; if(srrFlags & BP_FORWARDED_RPT) opts |= BP_DOPTS_FORWARD_RCPT; if(srrFlags & BP_DELETED_RPT) opts |= BP_DOPTS_DELETE_RCPT; return opts; } int al_ion_bundle_priority(al_bp_bundle_priority_t bundle_priority){ switch(bundle_priority.priority) { case BP_PRIORITY_BULK : return BP_BULK_PRIORITY; case BP_PRIORITY_NORMAL : return BP_STD_PRIORITY; case BP_PRIORITY_EXPEDITED :return BP_EXPEDITED_PRIORITY; default : return -1; } } al_bp_bundle_priority_t ion_al_bunlde_priority(int bundle_priority){ al_bp_bundle_priority_t bp_priority; bp_priority.ordinal=0; switch(bundle_priority) { case BP_BULK_PRIORITY: bp_priority.priority = BP_PRIORITY_BULK; break; case BP_STD_PRIORITY : bp_priority.priority = BP_PRIORITY_NORMAL; break; case BP_EXPEDITED_PRIORITY : bp_priority.priority = BP_PRIORITY_EXPEDITED; break; default : bp_priority.priority = -1; break; } return bp_priority; } int al_ion_status_report_flags(al_bp_status_report_flags_t status_repot_flags){ int ion_statusRpt_flags =0; if(status_repot_flags & BP_STATUS_RECEIVED) ion_statusRpt_flags |= BP_STATUS_RECEIVE; if(status_repot_flags & BP_STATUS_CUSTODY_ACCEPTED) ion_statusRpt_flags |= BP_STATUS_ACCEPT; if(status_repot_flags & BP_STATUS_FORWARDED) ion_statusRpt_flags |= BP_STATUS_FORWARD; if(status_repot_flags & BP_STATUS_DELIVERED) ion_statusRpt_flags |= BP_STATUS_DELIVER; if(status_repot_flags & BP_STATUS_DELETED) ion_statusRpt_flags |= BP_STATUS_DELETE; if(status_repot_flags & BP_STATUS_ACKED_BY_APP) ion_statusRpt_flags |= BP_STATUS_STATS; return ion_statusRpt_flags; } al_bp_status_report_flags_t ion_al_status_report_flags(int status_repot_flags) { al_bp_status_report_flags_t bp_statusRpt_flags = 0; if(status_repot_flags & BP_RECEIVED_RPT) // { bp_statusRpt_flags |= BP_STATUS_RECEIVED; // printf("\tRECEIVED %d\n",bp_statusRpt_flags); // } if(status_repot_flags & BP_CUSTODY_RPT) // { bp_statusRpt_flags |= BP_STATUS_CUSTODY_ACCEPTED; // printf("\tCUSTODY %d\n",bp_statusRpt_flags); // } if(status_repot_flags & BP_FORWARDED_RPT) // { bp_statusRpt_flags |= BP_STATUS_FORWARDED; // printf("\tFORWARDED %d\n",bp_statusRpt_flags); // } if(status_repot_flags & BP_DELIVERED_RPT) // { bp_statusRpt_flags |= BP_STATUS_DELIVERED; // printf("\tDELIVERED %d\n",bp_statusRpt_flags); // } if(status_repot_flags & BP_DELETED_RPT) // { bp_statusRpt_flags |= BP_STATUS_DELETED; // printf("\tDELETE %d\n",bp_statusRpt_flags); // } /* if(status_repot_flags & BP_STATUS_STATS) { bp_statusRpt_flags |= BP_STATUS_ACKED_BY_APP; printf("\tACKED BY APP\n"); } printf("\n\tflags al_bp: %d\n",bp_statusRpt_flags);*/ return bp_statusRpt_flags; } BpSrReason al_ion_status_report_reason(al_bp_status_report_reason_t status_report_reason) { return (BpSrReason) status_report_reason; } al_bp_status_report_reason_t ion_al_status_report_reason(BpSrReason status_report_reason) { return (al_bp_status_report_reason_t) status_report_reason; } BpStatusRpt al_ion_bundle_status_report(al_bp_bundle_status_report_t bundle_status_report) { BpStatusRpt ion_statusRpt; memset(&ion_statusRpt,0,sizeof(BpStatusRpt)); ion_statusRpt.acceptanceTime = al_ion_timeval(bundle_status_report.ack_by_app_ts.secs); ion_statusRpt.creationTime = al_ion_timestamp(bundle_status_report.bundle_id.creation_ts); ion_statusRpt.deletionTime = al_ion_timeval(bundle_status_report.deletion_ts.secs); ion_statusRpt.deliveryTime = al_ion_timeval(bundle_status_report.delivery_ts.secs); ion_statusRpt.flags = al_ion_bundle_srrFlags(bundle_status_report.flags); ion_statusRpt.forwardTime = al_ion_timeval(bundle_status_report.forwarding_ts.secs); if(bundle_status_report.flags & BDL_IS_FRAGMENT ) ion_statusRpt.isFragment = 1; ion_statusRpt.fragmentOffset = bundle_status_report.bundle_id.frag_offset; ion_statusRpt.fragmentLength = bundle_status_report.bundle_id.orig_length; ion_statusRpt.reasonCode = al_ion_status_report_reason(bundle_status_report.reason); ion_statusRpt.receiptTime = al_ion_timeval(bundle_status_report.receipt_ts.secs); ion_statusRpt.sourceEid = al_ion_endpoint_id(bundle_status_report.bundle_id.source); return ion_statusRpt; } al_bp_bundle_status_report_t ion_al_bundle_status_report(BpStatusRpt bundle_status_report) { al_bp_bundle_status_report_t bp_statusRpt; memset(&bp_statusRpt,0,sizeof(al_bp_bundle_status_report_t)); bp_statusRpt.custody_ts.secs = ion_al_timeval(bundle_status_report.acceptanceTime); bp_statusRpt.deletion_ts.secs = ion_al_timeval(bundle_status_report.deletionTime); bp_statusRpt.delivery_ts.secs = ion_al_timeval(bundle_status_report.deliveryTime); bp_statusRpt.flags = ion_al_status_report_flags(bundle_status_report.flags); bp_statusRpt.forwarding_ts.secs = ion_al_timeval(bundle_status_report.forwardTime); bp_statusRpt.receipt_ts.secs = ion_al_timeval(bundle_status_report.receiptTime); bp_statusRpt.reason = ion_al_status_report_reason(bundle_status_report.reasonCode); bp_statusRpt.bundle_id.creation_ts = ion_al_timestamp(bundle_status_report.creationTime); bp_statusRpt.bundle_id.frag_offset = (u32_t) bundle_status_report.fragmentOffset; bp_statusRpt.bundle_id.orig_length = (u32_t) bundle_status_report.fragmentLength; bp_statusRpt.bundle_id.source = ion_al_endpoint_id(bundle_status_report.sourceEid); return bp_statusRpt; } Payload al_ion_bundle_payload(al_bp_bundle_payload_t bundle_payload) { Payload payload; memset(&payload,0,sizeof(Payload)); Sdr bpSdr = bp_get_sdr(); sdr_begin_xn(bpSdr); if(bundle_payload.location == BP_PAYLOAD_MEM) { Object buff; buff = sdr_malloc(bpSdr, bundle_payload.buf.buf_len); sdr_write(bpSdr, buff, bundle_payload.buf.buf_val, bundle_payload.buf.buf_len); payload.content = zco_create(bpSdr, ZcoSdrSource, buff, 0, bundle_payload.buf.buf_len); payload.length = zco_length(bpSdr,payload.content); } else { u32_t dimFile = 0; struct stat st; int type = 0; memset(&st, 0, sizeof(st)); stat(bundle_payload.filename.filename_val, &st); dimFile = st.st_size; Object fileRef = sdr_find(bpSdr, bundle_payload.filename.filename_val, &type); if(fileRef == 0) { fileRef = zco_create_file_ref(bpSdr, bundle_payload.filename.filename_val, ""); sdr_catlg(bpSdr, bundle_payload.filename.filename_val, 0, fileRef); } payload.content = zco_create(bpSdr, ZcoFileSource, fileRef, 0, (unsigned int) dimFile); payload.length = zco_length(bpSdr,payload.content); } sdr_end_xn(bpSdr); return payload; } al_bp_bundle_payload_t ion_al_bundle_payload(Payload bundle_payload, al_bp_bundle_payload_location_t location,char * filename){ al_bp_bundle_payload_t payload; memset(&payload,0,sizeof(al_bp_bundle_payload_t)); char *buffer = (char*) malloc(sizeof(char) * bundle_payload.length); ZcoReader zcoReader; memset(&zcoReader,0,sizeof(ZcoReader)); Sdr sdr = bp_get_sdr(); zco_start_receiving(bundle_payload.content,&zcoReader); sdr_begin_xn(sdr); zco_receive_source(sdr,&zcoReader,bundle_payload.length,buffer); sdr_end_xn(sdr); payload.location = location; if(location == BP_PAYLOAD_MEM) { payload.buf.buf_len = bundle_payload.length; payload.buf.buf_val = (char *)malloc(sizeof(char)*bundle_payload.length); memcpy(payload.buf.buf_val, buffer, bundle_payload.length); } else { int fd = open(filename,O_CREAT|O_WRONLY, S_IRUSR | S_IWUSR); if(write(fd,buffer,bundle_payload.length)<0){ printf("\nAL-BP: Error writing bundle payload data to file\n"); } close(fd); payload.filename.filename_len = strlen(filename)+1; payload.filename.filename_val = (char *)malloc(sizeof(char)*(strlen(filename)+1)); strcpy(payload.filename.filename_val,filename); } free(buffer); return payload; } #endif /* ION_IMPLEMENTATION */ ion-open-source/contrib/dtnperf/al_bp/src/bp_implementations/al_bp_ion_conversions.h0000644000175000017500000000515212356652303031622 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* ************ * * al_ion_conversion.h * * Conversions bp abstract types to ion types and viceversa * ************ */ #ifndef AL_al_ion_CONVERSIONS_H_ #define AL_al_ion_CONVERSIONS_H_ #ifdef ION_IMPLEMENTATION #include "../al_bp_types.h" #include /* * These functions convert bp abstract types in ion types and viceversa * The prefix al_ion means the function takes a bp abstract type in and returns a ion type * so the conversion is bp -> ion * The prefix ion_al means the function takes a ion type in and returns a bp abstract type * so the conversion is ion -> bp */ BpSAP al_ion_handle(al_bp_handle_t handle); al_bp_handle_t ion_al_handle(BpSAP handle); char * al_ion_endpoint_id(al_bp_endpoint_id_t endpoint_id); al_bp_endpoint_id_t ion_al_endpoint_id(char * endpoint_id); BpTimestamp al_ion_timestamp(al_bp_timestamp_t timestamp); al_bp_timestamp_t ion_al_timestamp(BpTimestamp timestamp); DtnTime al_ion_timeval(al_bp_timeval_t timeval); al_bp_timeval_t ion_al_timeval(DtnTime timeval); unsigned char al_ion_bundle_srrFlags(al_bp_bundle_delivery_opts_t bundle_delivery_opts); al_bp_bundle_delivery_opts_t ion_al_bundle_srrFlags(unsigned char ssrFlag); /* * * This conversion convert only the al_bundle_priority_enum * The ordinal number is setted in bp_ion_send() * */ int al_ion_bundle_priority(al_bp_bundle_priority_t bundle_priority); al_bp_bundle_priority_t ion_al_bunlde_priority(int bundle_priority); BpSrReason al_ion_status_report_reason(al_bp_status_report_reason_t status_report_reason); al_bp_status_report_reason_t ion_al_status_report_reason(BpSrReason status_report_reason); int al_ion_status_report_flags(al_bp_status_report_flags_t status_repot_flags); al_bp_status_report_flags_t ion_al_status_report_flags(int status_repot_flags); BpStatusRpt al_ion_bundle_status_report(al_bp_bundle_status_report_t bundle_status_report); al_bp_bundle_status_report_t ion_al_bundle_status_report(BpStatusRpt bundle_status_report); al_bp_bundle_payload_t ion_al_bundle_payload(Payload bundle_payload,al_bp_bundle_payload_location_t location,char * filename); Payload al_ion_bundle_payload(al_bp_bundle_payload_t bundle_payload); #endif /* AL_BP_DTN_CONVERSIONS_H_ */ #endif /* ION_IMPLEMENTAION */ ion-open-source/contrib/dtnperf/LICENSE0000644000175000017500000000304612356652303020347 0ustar jschendejschendeCopyright (c) 2013, Alma Mater Studiorum, University of Bologna. 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 Alma Mater Studiorum - University of Bologna, 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 COPYRIGHT HOLDERS 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 ALMA MATER STUDIORUM - UNIVERSITY OF BOLOGNA 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. ion-open-source/contrib/dtnperf/dtnperf/0000775000175000017500000000000012356652303021003 5ustar jschendejschendeion-open-source/contrib/dtnperf/dtnperf/Makefile0000755000175000017500000000344512356652303022452 0ustar jschendejschende# Makefile for compiling DTNPerf3 # NAME OF BIN USED FOR INSTALL/UNINSTALL (NEVER LEAVE IT BLANK!!!) BIN_NAME_BASE=dtnperf CC=gcc LIB_PATHS=-L/usr/local/lib -L$(AL_BP_DIR) CFLAGS=-O0 -Wall -fmessage-length=0 -Werror INSTALLED=$(wildcard /usr/bin/$(BIN_NAME_BASE)*) ifeq ($(strip $(AL_BP_DIR)),) all: help else ifeq ($(or $(ION_DIR),$(DTN2_DIR)),) # NOTHING all: help else all: bin endif ifeq ($(strip $(DTN2_DIR)),) # ION INC=-I$(AL_BP_DIR)/src/bp_implementations -I$(AL_BP_DIR)/src -I$(ION_DIR)/include -I$(ION_DIR)/library LIBS=$(AL_BP_DIR)/libal_bp_vION.a -lbp -lici -lpthread #LIBS=-lal_bp_vION -lbp -lici -lpthread BIN_NAME=$(BIN_NAME_BASE)_vION else ifeq ($(strip $(ION_DIR)),) # DTN INC=-I$(AL_BP_DIR)/src/bp_implementations -I$(AL_BP_DIR)/src -I$(DTN2_DIR) -I$(DTN2_DIR)/applib LIBS=$(AL_BP_DIR)/libal_bp_vDTN2.a -ldtnapi -lpthread #LIBS=-lal_bp_vDTN2 -ldtnapi -lpthread BIN_NAME=$(BIN_NAME_BASE)_vDTN2 else ifneq ($(and $(ION_DIR),$(DTN2_DIR)),) # BOTH INC=-I$(AL_BP_DIR)/src/bp_implementations -I$(AL_BP_DIR)/src -I$(DTN2_DIR) -I$(DTN2_DIR)/applib -I$(ION_DIR)/include -I$(ION_DIR)/library LIBS=$(AL_BP_DIR)/libal_bp.a -ldtnapi -lbp -lici -lpthread #LIBS=-lal_bp -ldtnapi -lbp -lici -lpthread BIN_NAME=$(BIN_NAME_BASE) endif bin: $(CC) $(INC) $(LIB_PATHS) $(CFLAGS) -o $(BIN_NAME) src/*.c src/dtnperf_modes/*.c $(LIBS) install: cp $(BIN_NAME_BASE)* /usr/bin/ uninstall: @if test `echo $(INSTALLED) | wc -w` -eq 1 -a -f "$(INSTALLED)"; then rm -rf $(INSTALLED); else echo "MORE THAN 1 FILE, DELETE THEM MANUALLY: $(INSTALLED)"; fi help: @echo "Usage:" @echo "For DTN2: make DTN2_DIR= AL_BP_DIR=" @echo "For ION: make ION_DIR= AL_BP_DIR=" @echo "For both: make DTN2_DIR= ION_DIR= AL_BP_DIR=" clean: @rm -rf $(BIN_NAME_BASE)* ion-open-source/contrib/dtnperf/dtnperf/src/0000775000175000017500000000000012356652303021572 5ustar jschendejschendeion-open-source/contrib/dtnperf/dtnperf/src/utils.c0000644000175000017500000003674212356652303023110 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ #include "utils.h" #include /* ------------------------------------------ * mega2byte * * Converts MBytes into Bytes * ------------------------------------------ */ long mega2byte(double n) { return (n * 1000 *1000); } // end mega2byte /* ------------------------------------------ * kilo2byte * * Converts KBytes into Bytes * ------------------------------------------ */ long kilo2byte(double n) { return (n * 1000); } // end kilo2byte /** * byte2mega * Converts Bytes in MBytes */ double byte2mega(long n) { double result; result = (double) n / (1000 * 1000); return result; } /** * byte2kilo * Converts Bytes in KBytes */ double byte2kilo(long n) { double result; result = (double) n / (1000); return result; } /* ------------------------------------------ * findDataUnit * * Extracts the data unit from the given string. * If no unit is specified, returns 'Z'. * ------------------------------------------ */ char find_data_unit(const char *inarg) { // units are B (Bytes), K (KBytes) and M (MBytes) const char unitArray[] = {'B', 'k', 'K', 'M' }; char * unit = malloc(sizeof(char)); if ((unit = strpbrk(inarg, unitArray)) == NULL) { unit = "Z"; } if (unit[0] == 'K') return 'k'; return unit[0]; } // end find_data_unit /* ------------------------------------------ * findRateUnit * * Extracts the rate unit from the given string. * If no unit is specified, returns kbit/sec. * ------------------------------------------ */ char find_rate_unit(const char *inarg) { // units are b (bundles/sec), K (Kbit/sec), and M (Mbit/sec) const char unitArray[] = {'k', 'K', 'M', 'b' }; char * ptr; char unit; if ((ptr = strpbrk(inarg, unitArray)) == NULL) { printf("\nWARNING: (-R option) invalid rate unit, assuming 'k' (kb/s)\n\n"); return 'k'; } unit = ptr[0]; if (unit == 'K') return 'k'; return unit; } // end find_data_unit char find_forced_eid(const char *inarg) { // value of forced unit are CBHE or URI if(strcmp("DTN", inarg) == 0) return 'D'; else if(strcmp("IPN", inarg) == 0) return 'I'; else return '?'; } // end find_force_eid /* ------------------------------------------ * add_time * ------------------------------------------ */ struct timeval add_time(struct timeval * time_1, struct timeval * time_2) { struct timeval result; result.tv_sec = time_1->tv_sec + time_2->tv_sec; result.tv_usec = time_1->tv_usec + time_2->tv_usec; if (result.tv_usec >= 1000000) { result.tv_sec++; result.tv_usec -= 1000000; } return result; } // end add_time /* ------------------------------------------ * sub_time * Subtract time sub from time min and put the result in result * Result is set to NULL result is a negative value * ------------------------------------------ */ void sub_time(struct timeval min, struct timeval sub, struct timeval * result) { if (result == NULL) return; if (min.tv_sec < sub.tv_sec) result = NULL; else if (min.tv_sec == sub.tv_sec && min.tv_usec < sub.tv_usec) result = NULL; else { if (min.tv_usec < sub.tv_usec) { min.tv_usec += 1000 * 1000; min.tv_sec -= 1; } result->tv_sec = min.tv_sec - sub.tv_sec; result->tv_usec = min.tv_usec - sub.tv_usec; } } // end add_time /* -------------------------------------------------- * csv_time_report * -------------------------------------------------- */ void csv_time_report(int b_sent, int payload, struct timeval start, struct timeval end, FILE* csv_log) { const char* time_report_hdr = "BUNDLE_SENT,PAYLOAD (byte),TIME (s),DATA_SENT (Mbyte),GOODPUT (Mbit/s)"; double g_put, data; data = (b_sent * payload)/1000000.0; fprintf(csv_log, "\n\n%s\n", time_report_hdr); g_put = (data * 8 * 1000) / ((double)(end.tv_sec - start.tv_sec) * 1000.0 + (double)(end.tv_usec - start.tv_usec) / 1000.0); double time_s = ((double)(end.tv_sec - start.tv_sec) * 1000.0 + (double)(end.tv_usec - start.tv_usec) / 1000.0) / 1000; fprintf(csv_log, "%d,%d,%.1f,%E,%.3f\n", b_sent, payload, time_s, data, g_put); } // end csv_time_report /* -------------------------------------------------- * csv_data_report * -------------------------------------------------- */ void csv_data_report(int b_id, int payload, struct timeval start, struct timeval end, FILE* csv_log) { const char* data_report_hdr = "BUNDLE_ID,PAYLOAD (byte),TIME (s),GOODPUT (Mbit/s)"; // const char* time_hdr = "BUNDLES_SENT,PAYLOAD,TIME,GOODPUT"; double g_put; fprintf(csv_log, "\n\n%s\n", data_report_hdr); g_put = (payload * 8) / ((double)(end.tv_sec - start.tv_sec) * 1000.0 + (double)(end.tv_usec - start.tv_usec) / 1000.0) / 1000.0; double time_s = ((double)(end.tv_sec - start.tv_sec) * 1000.0 + (double)(end.tv_usec - start.tv_usec) / 1000.0) / 1000; fprintf(csv_log, "%d,%d,%.1f,%.3f\n", b_id, payload, time_s, g_put); } // end csv_data_report /* ------------------------------------------------------------------- * pattern * * Initialize the buffer with a pattern of (index mod 10). * ------------------------------------------------------------------- */ void pattern(char *outBuf, int inBytes) { assert (outBuf != NULL); while (inBytes-- > 0) { outBuf[inBytes] = (inBytes % 10) + '0'; } } // end pattern /* ------------------------------------------------------------------- * Set timestamp to the given seconds * ------------------------------------------------------------------- */ struct timeval set( double sec ) { struct timeval mTime; mTime.tv_sec = (long) sec; mTime.tv_usec = (long) ((sec - mTime.tv_sec) * 1000000); return mTime; } // end set /* ------------------------------------------------------------------- * Add seconds to my timestamp. * ------------------------------------------------------------------- */ struct timeval add( double sec ) { struct timeval mTime; mTime.tv_sec = (long) sec; mTime.tv_usec = (long) ((sec - ((long) sec )) * 1000000); // watch for overflow if ( mTime.tv_usec >= 1000000 ) { mTime.tv_usec -= 1000000; mTime.tv_sec++; } assert( mTime.tv_usec >= 0 && mTime.tv_usec < 1000000 ); return mTime; } // end add /* -------------------------------------------------- * show_report * -------------------------------------------------- */ void show_report (u_int buf_len, char* eid, struct timeval start, struct timeval end, long data, FILE* output) { double g_put; double time_s = ((double)(end.tv_sec - start.tv_sec) * 1000.0 + (double)(end.tv_usec - start.tv_usec) / 1000.0) / 1000.0; double data_MB = data / 1000000.0; if (output == NULL) printf("got %d byte report from [%s]: time=%.1f s - %E Mbytes sent", buf_len, eid, time_s, data_MB); else fprintf(output, "\n total time=%.1f s - %E Mbytes sent", time_s, data_MB); // report goodput (bits transmitted / time) g_put = (data_MB * 8) / time_s; if (output == NULL) printf(" (goodput = %.3f Mbit/s)\n", g_put); else fprintf(output, " (goodput = %.3f Mbit/s)\n", g_put); // report start - end time if (output == NULL) printf(" started at %u sec - ended at %u sec\n", (u_int)start.tv_sec, (u_int)end.tv_sec); else fprintf(output, " started at %u sec - ended at %u sec\n", (u_int)start.tv_sec, (u_int)end.tv_sec); } // end show_report char* get_filename(char* s) { int i = 0, k; char* temp; char c = 'a'; k = strlen(s) - 1; temp = malloc(strlen(s)); strcpy(temp, s); while ((c != '/') && (k >= 0)) { c = temp[k]; k--; } if (c == '/') k += 2; else return temp; while (k != (int)strlen(temp)) { temp[i] = temp[k]; i++; k++; } temp[i] = '\0'; return temp; } // end get_filename /* -------------------------------------------------- * file_exists * returns TRUE if file exists, FALSE otherwise * -------------------------------------------------- */ boolean_t file_exists(const char * filename) { FILE * file; if ((file = fopen(filename, "r")) != NULL) { fclose(file); return TRUE; } return FALSE; } // end file_exists char * correct_dirname(char * dir) { if (dir[0] == '~') { char * result, buffer[100]; char * home = getenv("HOME"); strcpy(buffer, home); strcat(buffer, dir + 1); result = strdup(buffer); return result; } else return dir; } int find_proc(char * cmd) { DIR * proc; struct dirent * item; char cmdline_file[100]; char buf[256], cmdline[256]; char cmd_exe[256], cmdline_exe[256]; char cmd_args[256], cmdline_args[256]; char * cmdline_args_ptr; int item_len, i, fd, pid, length; int result = 0; boolean_t found_not_num, found_null; // prepare cmd memset(cmd_args, 0, sizeof(cmd_args)); memset(cmd_exe, 0, sizeof(cmd_exe)); strcpy(cmd_args, strchr(cmd, ' ')); strcpy(cmd_exe, get_exe_name(strtok(cmd, " "))); strncat(cmd_exe, cmd_args, strlen(cmd_args)); proc = opendir("/proc/"); while ((item = readdir(proc)) != NULL) { found_not_num = FALSE; item_len = strlen(item->d_name); for(i = 0; i < item_len; i++) { if (item->d_name[i] < '0' || item->d_name[i] > '9') { found_not_num = TRUE; break; } } if (found_not_num) continue; memset(cmdline_file, 0, sizeof(cmdline_file)); memset(cmdline, 0, sizeof(cmdline)); memset(buf, 0, sizeof(buf)); sprintf(cmdline_file, "/proc/%s/cmdline", item->d_name); fd = open(cmdline_file, O_RDONLY); length = read(fd, buf, sizeof(buf)); close(fd); found_null = FALSE; if(buf[0] == '\0') continue; for(i = 0; i < length; i++) { if(buf[i] == '\0') { if(found_null) { //reached end of cmdline cmdline[i -1] = '\0'; break; } else { found_null = TRUE; cmdline[i] = ' '; } } else { found_null = FALSE; cmdline[i] = buf[i]; } } memset(cmdline_args, 0, sizeof(cmdline_args)); memset(cmdline_exe, 0, sizeof(cmdline_exe)); cmdline_args_ptr = strchr(cmdline, ' '); strcpy(cmdline_args, cmdline_args_ptr != NULL ? cmdline_args_ptr : ""); strcpy(cmdline_exe, get_exe_name(strtok(cmdline, " "))); strncat(cmdline_exe, cmdline_args, sizeof(cmdline_exe) - strlen(cmdline_exe) - 2); if (strncmp(cmdline_exe, cmd_exe, strlen(cmd_exe)) == 0) { pid = atoi(item->d_name); if (pid == getpid()) continue; else { result = pid; break; } } } closedir(proc); return result; } char * get_exe_name(char * full_name) { char * buf1 = strdup(full_name); char * buf2; char * result; char * token = strtok(full_name, "/"); do { buf2 = strdup(token); } while ((token = strtok(NULL, "/")) != NULL); result = strdup(buf2); free (buf1); free (buf2); return result; } void pthread_sleep(double sec) { pthread_mutex_t fakeMutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t fakeCond = PTHREAD_COND_INITIALIZER; struct timespec abs_timespec; struct timeval current, time_to_wait; struct timeval abs_time; gettimeofday(¤t,NULL); time_to_wait = set(sec); abs_time = add_time(¤t, &time_to_wait); abs_timespec.tv_sec = abs_time.tv_sec; abs_timespec.tv_nsec = abs_time.tv_usec*1000; pthread_mutex_lock(&fakeMutex); pthread_cond_timedwait(&fakeCond, &fakeMutex, &abs_timespec); pthread_mutex_unlock(&fakeMutex); } uint32_t crc_table[256] = { 0x00000000U,0x04C11DB7U,0x09823B6EU,0x0D4326D9U, 0x130476DCU,0x17C56B6BU,0x1A864DB2U,0x1E475005U, 0x2608EDB8U,0x22C9F00FU,0x2F8AD6D6U,0x2B4BCB61U, 0x350C9B64U,0x31CD86D3U,0x3C8EA00AU,0x384FBDBDU, 0x4C11DB70U,0x48D0C6C7U,0x4593E01EU,0x4152FDA9U, 0x5F15ADACU,0x5BD4B01BU,0x569796C2U,0x52568B75U, 0x6A1936C8U,0x6ED82B7FU,0x639B0DA6U,0x675A1011U, 0x791D4014U,0x7DDC5DA3U,0x709F7B7AU,0x745E66CDU, 0x9823B6E0U,0x9CE2AB57U,0x91A18D8EU,0x95609039U, 0x8B27C03CU,0x8FE6DD8BU,0x82A5FB52U,0x8664E6E5U, 0xBE2B5B58U,0xBAEA46EFU,0xB7A96036U,0xB3687D81U, 0xAD2F2D84U,0xA9EE3033U,0xA4AD16EAU,0xA06C0B5DU, 0xD4326D90U,0xD0F37027U,0xDDB056FEU,0xD9714B49U, 0xC7361B4CU,0xC3F706FBU,0xCEB42022U,0xCA753D95U, 0xF23A8028U,0xF6FB9D9FU,0xFBB8BB46U,0xFF79A6F1U, 0xE13EF6F4U,0xE5FFEB43U,0xE8BCCD9AU,0xEC7DD02DU, 0x34867077U,0x30476DC0U,0x3D044B19U,0x39C556AEU, 0x278206ABU,0x23431B1CU,0x2E003DC5U,0x2AC12072U, 0x128E9DCFU,0x164F8078U,0x1B0CA6A1U,0x1FCDBB16U, 0x018AEB13U,0x054BF6A4U,0x0808D07DU,0x0CC9CDCAU, 0x7897AB07U,0x7C56B6B0U,0x71159069U,0x75D48DDEU, 0x6B93DDDBU,0x6F52C06CU,0x6211E6B5U,0x66D0FB02U, 0x5E9F46BFU,0x5A5E5B08U,0x571D7DD1U,0x53DC6066U, 0x4D9B3063U,0x495A2DD4U,0x44190B0DU,0x40D816BAU, 0xACA5C697U,0xA864DB20U,0xA527FDF9U,0xA1E6E04EU, 0xBFA1B04BU,0xBB60ADFCU,0xB6238B25U,0xB2E29692U, 0x8AAD2B2FU,0x8E6C3698U,0x832F1041U,0x87EE0DF6U, 0x99A95DF3U,0x9D684044U,0x902B669DU,0x94EA7B2AU, 0xE0B41DE7U,0xE4750050U,0xE9362689U,0xEDF73B3EU, 0xF3B06B3BU,0xF771768CU,0xFA325055U,0xFEF34DE2U, 0xC6BCF05FU,0xC27DEDE8U,0xCF3ECB31U,0xCBFFD686U, 0xD5B88683U,0xD1799B34U,0xDC3ABDEDU,0xD8FBA05AU, 0x690CE0EEU,0x6DCDFD59U,0x608EDB80U,0x644FC637U, 0x7A089632U,0x7EC98B85U,0x738AAD5CU,0x774BB0EBU, 0x4F040D56U,0x4BC510E1U,0x46863638U,0x42472B8FU, 0x5C007B8AU,0x58C1663DU,0x558240E4U,0x51435D53U, 0x251D3B9EU,0x21DC2629U,0x2C9F00F0U,0x285E1D47U, 0x36194D42U,0x32D850F5U,0x3F9B762CU,0x3B5A6B9BU, 0x0315D626U,0x07D4CB91U,0x0A97ED48U,0x0E56F0FFU, 0x1011A0FAU,0x14D0BD4DU,0x19939B94U,0x1D528623U, 0xF12F560EU,0xF5EE4BB9U,0xF8AD6D60U,0xFC6C70D7U, 0xE22B20D2U,0xE6EA3D65U,0xEBA91BBCU,0xEF68060BU, 0xD727BBB6U,0xD3E6A601U,0xDEA580D8U,0xDA649D6FU, 0xC423CD6AU,0xC0E2D0DDU,0xCDA1F604U,0xC960EBB3U, 0xBD3E8D7EU,0xB9FF90C9U,0xB4BCB610U,0xB07DABA7U, 0xAE3AFBA2U,0xAAFBE615U,0xA7B8C0CCU,0xA379DD7BU, 0x9B3660C6U,0x9FF77D71U,0x92B45BA8U,0x9675461FU, 0x8832161AU,0x8CF30BADU,0x81B02D74U,0x857130C3U, 0x5D8A9099U,0x594B8D2EU,0x5408ABF7U,0x50C9B640U, 0x4E8EE645U,0x4A4FFBF2U,0x470CDD2BU,0x43CDC09CU, 0x7B827D21U,0x7F436096U,0x7200464FU,0x76C15BF8U, 0x68860BFDU,0x6C47164AU,0x61043093U,0x65C52D24U, 0x119B4BE9U,0x155A565EU,0x18197087U,0x1CD86D30U, 0x029F3D35U,0x065E2082U,0x0B1D065BU,0x0FDC1BECU, 0x3793A651U,0x3352BBE6U,0x3E119D3FU,0x3AD08088U, 0x2497D08DU,0x2056CD3AU,0x2D15EBE3U,0x29D4F654U, 0xC5A92679U,0xC1683BCEU,0xCC2B1D17U,0xC8EA00A0U, 0xD6AD50A5U,0xD26C4D12U,0xDF2F6BCBU,0xDBEE767CU, 0xE3A1CBC1U,0xE760D676U,0xEA23F0AFU,0xEEE2ED18U, 0xF0A5BD1DU,0xF464A0AAU,0xF9278673U,0xFDE69BC4U, 0x89B8FD09U,0x8D79E0BEU,0x803AC667U,0x84FBDBD0U, 0x9ABC8BD5U,0x9E7D9662U,0x933EB0BBU,0x97FFAD0CU, 0xAFB010B1U,0xAB710D06U,0xA6322BDFU,0xA2F33668U, 0xBCB4666DU,0xB8757BDAU,0xB5365D03U,0xB1F740B4U, }; /* ------------------------------------------ * calc_crc32_d8 * * Create 32b of CRC * ------------------------------------------ */ uint32_t calc_crc32_d8(uint32_t crc, uint8_t *data, int len) { while (len > 0) { crc = crc_table[*data ^ ((crc >> 24) & 0xff)] ^ (crc << 8); data++; len--; } return crc; } ion-open-source/contrib/dtnperf/dtnperf/src/bundle_tools.h0000644000175000017500000000662112356652303024437 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ #ifndef BUNDLE_TOOLS_H_ #define BUNDLE_TOOLS_H_ #include "includes.h" #include "dtnperf_types.h" #include typedef struct { al_bp_bundle_id_t bundle_id; struct timeval send_time; u_int relative_id; } send_information_t; /* * extension/metadata block information */ typedef struct extension_block_info { boolean_t metadata; u_int64_t metadata_type; al_bp_extension_block_t block; } extension_block_info_t; long bundles_needed (long data, long pl); void print_eid(char * label, al_bp_endpoint_id_t *eid); void init_info(send_information_t *send_info, int window); long add_info(send_information_t* send_info, al_bp_bundle_id_t bundle_id, struct timeval p_start, int window); int is_in_info(send_information_t* send_info, al_bp_timestamp_t timestamp, int window); int count_info(send_information_t* send_info, int window); void remove_from_info(send_information_t* send_info, int position); void set_bp_options(al_bp_bundle_object_t *bundle, dtnperf_connection_options_t *opt); int open_payload_stream_read(al_bp_bundle_object_t bundle, FILE ** f); int close_payload_stream_read(FILE * f); int open_payload_stream_write(al_bp_bundle_object_t bundle, FILE ** f); int close_payload_stream_write(al_bp_bundle_object_t * bundle, FILE * f); al_bp_error_t prepare_payload_header_and_ack_options(dtnperf_options_t *opt, FILE * f, uint32_t *crc, int *bytes_written); int get_bundle_header_and_options(al_bp_bundle_object_t * bundle, HEADER_TYPE * header, dtnperf_bundle_ack_options_t * options); u32_t get_header_size(char mode, uint16_t filename_len, uint16_t monitor_eid_len); al_bp_error_t prepare_generic_payload(dtnperf_options_t *opt, FILE * f, uint32_t *crc, int *bytes_written); al_bp_error_t prepare_force_stop_bundle(al_bp_bundle_object_t * start, al_bp_endpoint_id_t monitor, al_bp_timeval_t expiration, al_bp_bundle_priority_t priority); al_bp_error_t prepare_stop_bundle(al_bp_bundle_object_t * stop, al_bp_endpoint_id_t monitor, al_bp_timeval_t expiration, al_bp_bundle_priority_t priority, int sent_bundles); al_bp_error_t get_info_from_stop(al_bp_bundle_object_t * stop, int * sent_bundles); al_bp_error_t prepare_server_ack_payload(dtnperf_server_ack_payload_t ack, dtnperf_bundle_ack_options_t *bundle_ack_options, char ** payload, size_t * payload_size); /** * Get reported eid and timestamp from bundle ack * If you don't need either eid or timestamp, just put NULL in eid or timestamp. */ al_bp_error_t get_info_from_ack(al_bp_bundle_object_t * ack, al_bp_endpoint_id_t * reported_eid, al_bp_timestamp_t * report_timestamp, uint32_t *extension_ack); /** * MetaBlock utility funtions */ boolean_t check_metadata(extension_block_info_t* ext_block); void set_metadata_type(extension_block_info_t* ext_block, u_int64_t metadata_type); void get_extension_block(extension_block_info_t* ext_block, al_bp_extension_block_t * extension_block); void set_block_buf(extension_block_info_t* ext_block, char * buf, u32_t len); u32_t get_current_dtn_time(); #endif /*BUNDLE_TOOLS_H_*/ ion-open-source/contrib/dtnperf/dtnperf/src/includes.h0000644000175000017500000000152612356652303023553 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ #ifndef INCLUDES_H_ #define INCLUDES_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif /*INCLUDES_H_*/ ion-open-source/contrib/dtnperf/dtnperf/src/definitions.h0000644000175000017500000001266612356652303024267 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * definitions.h */ #ifndef DEFINITIONS_H_ #define DEFINITIONS_H_ #include // dtnperf version #define DTNPERF_VERSION "3.0" // dtnperf server mode string #define SERVER_STRING "--server" // dtnperf client mode string #define CLIENT_STRING "--client" // dtnperf monitor mode string #define MONITOR_STRING "--monitor" // dir where are saved incoming bundles #define BUNDLE_DIR_DEFAULT "/tmp/" // dir where are saved transfered files #define FILE_DIR_DEFAULT "~/dtnperf/files/" // dir where are saved client and monitor logs #define LOGS_DIR_DEFAULT "." // source file for bundle in client with use_file option #define SOURCE_FILE "/tmp/dtnperfbuf" // source file for bundle ack in server [ONLY ION implementation] #define SOURCE_FILE_ACK "/tmp/dtnperfack" // default client log filename #define LOG_FILENAME "dtnperf_client.log" // output file: stdin and stderr redirect here if daemon is TRUE; #define SERVER_OUTPUT_FILE "dtnperf_server.log" #define MONITOR_OUTPUT_FILE "dtnperf_monitor.log" /* * FIXED SIZE HEADERS */ // header type #define HEADER_TYPE uint32_t // header size #define HEADER_SIZE sizeof(HEADER_TYPE) // header of bundles sent in time mode #define TIME_HEADER 0x1 // header of bundles sent in data mode #define DATA_HEADER 0x2 // header of bundles sent in file mode #define FILE_HEADER 0x4 // header of dtnperf server bundle ack #define DSA_HEADER 0x8 // header of force stop bundle sent by client to monitor #define FORCE_STOP_HEADER 0x10 // header of stop bundle sent by client to monitor #define STOP_HEADER 0x20 // bundle options type #define BUNDLE_OPT_TYPE uint16_t // bundle options size #define BUNDLE_OPT_SIZE sizeof(uint16_t) // bundle crc size #define BUNDLE_CRC_SIZE sizeof(uint32_t) // congestion control options // window based #define BO_ACK_CLIENT_YES 0x8000 // rate based #define BO_ACK_CLIENT_NO 0x0000 // congestion control option mask (first 2 bits) #define BO_ACK_CLIENT_MASK 0xC000 // acks to monitor options // default behavior #define BO_ACK_MON_NORMAL 0x0000 // force server to send acks to monitor #define BO_ACK_MON_FORCE_YES 0x2000 // force server to not send acks to monitor #define BO_ACK_MON_FORCE_NO 0x1000 // acks to monitor options mask #define BO_ACK_MON_MASK 0x3000 // set ack expiration time as this bundle one #define BO_SET_EXPIRATION 0x0080 // ack priority options // set ack priority bit #define BO_SET_PRIORITY 0x0040 // priorities indicated #define BO_PRIORITY_BULK 0x0000 #define BO_PRIORITY_NORMAL 0x0010 #define BO_PRIORITY_EXPEDITED 0x0020 #define BO_PRIORITY_RESERVED 0x0030 // priority mask #define BO_PRIORITY_MASK 0x0030 // crc options (BO HEADER) // IF IN BUNDLE FROM CLIENT TO SERVER // BIT 4 -> 0 : CRC DISABLED, 1: CRC ENABLED // ELSE IF IN BUNDLE FROM SERVER TO CLIENT // BIT 4 -> 0 : CRC CHECK OK (OR NOT ENABLED), 1: CRC CHECK FAILED #define BO_CRC_DISABLED 0x0000 #define BO_CRC_ENABLED 0x0800 // max payload (in bytes) if bundles are stored into memory #define MAX_MEM_PAYLOAD 50000 // illegal number of bytes for the bundle payload #define ILLEGAL_PAYLOAD 0 // default value (in bytes) for bundle payload #define DEFAULT_PAYLOAD 50000 // server endpoint demux string #define SERV_EP_STRING "/dtnperf:/dest" #define SERV_EP_NUM_SERVICE "2000" // client endpoint demux string #define CLI_EP_STRING "/dtnperf:/src" // monitor endpoint demux string #define MON_EP_STRING "/dtnperf:/mon" #define MON_EP_NUM_SERVICE "1000" // generic payload pattern #define PL_PATTERN "0123456789" // unix time of 1/1/2000 #define DTN_EPOCH 946684800 /** * Metadata type code numbers used in Metadata Blocks - see RFC 6258 */ typedef enum { METADATA_TYPE_URI = 0x01, ///< Metadata block carries URI METADATA_TYPE_EXPT_MIN = 0xc0, ///< Low end of experimental range METADATA_TYPE_EXPT_MAX = 0xff, ///< High end of experimental range } metadata_type_code_t; /** * Valid type codes for bundle blocks. * (See http://www.dtnrg.org/wiki/AssignedNamesAndNumbers) * THis is copied from servlib/bundling/BundleProtcocol.h */ typedef enum { PRIMARY_BLOCK = 0x000, ///< INTERNAL ONLY -- NOT IN SPEC PAYLOAD_BLOCK = 0x001, ///< Defined in RFC5050 BUNDLE_AUTHENTICATION_BLOCK = 0x002, ///< Defined in RFC6257 PAYLOAD_SECURITY_BLOCK = 0x003, ///< Defined in RFC6257 CONFIDENTIALITY_BLOCK = 0x004, ///< Defined in RFC6257 PREVIOUS_HOP_BLOCK = 0x005, ///< Defined in RFC6259 METADATA_BLOCK = 0x008, ///< Defined in RFC6258 EXTENSION_SECURITY_BLOCK = 0x009, ///< Defined in RFC6257 SESSION_BLOCK = 0x00c, ///< NOT IN SPEC YET AGE_BLOCK = 0x00a, ///< draft-irtf-dtnrg-bundle-age-block-01 QUERY_EXTENSION_BLOCK = 0x00b, ///< draft-irtf-dtnrg-bpq-00 SEQUENCE_ID_BLOCK = 0x010, ///< NOT IN SPEC YET OBSOLETES_ID_BLOCK = 0x011, ///< NOT IN SPEC YET API_EXTENSION_BLOCK = 0x100, ///< INTERNAL ONLY -- NOT IN SPEC UNKNOWN_BLOCK = 0x101, ///< INTERNAL ONLY -- NOT IN SPEC } bundle_block_type_t; #endif /* DEFINITIONS_H_ */ ion-open-source/contrib/dtnperf/dtnperf/src/file_transfer_tools.c0000644000175000017500000002733112356652303026005 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * file_transfer_tools.c */ #include #include #include #include #include #include #include #include #include "file_transfer_tools.h" #include "bundle_tools.h" #include "utils.h" file_transfer_info_list_t file_transfer_info_list_create() { file_transfer_info_list_t * list; list = (file_transfer_info_list_t *) malloc(sizeof(file_transfer_info_list_t)); list->first = NULL; list->last = NULL; list->count = 0; return * list; } void file_transfer_info_list_destroy(file_transfer_info_list_t * list) { free(list); } file_transfer_info_t * file_transfer_info_create(al_bp_endpoint_id_t client_eid, int filename_len, char * filename, char * full_dir, u32_t file_dim, u32_t bundle_time, u32_t expiration) { file_transfer_info_t * info; info = (file_transfer_info_t *) malloc(sizeof(file_transfer_info_t)); al_bp_copy_eid(&(info->client_eid), &client_eid); info->filename_len = filename_len; info->full_dir = (char*) malloc(strlen(full_dir) + 1); strncpy(info->full_dir, full_dir, strlen(full_dir) + 1); info->filename = (char*) malloc(filename_len + 1); strncpy(info->filename, filename, filename_len +1); info->file_dim = file_dim; info->bytes_recvd = 0; info->first_bundle_time = bundle_time; info->last_bundle_time = bundle_time; info->expiration = expiration; return info; } void file_transfer_info_destroy(file_transfer_info_t * info) { free(info->filename); free(info->full_dir); free(info); } void file_transfer_info_put(file_transfer_info_list_t * list, file_transfer_info_t * info) { file_transfer_info_list_item_t * new; new = (file_transfer_info_list_item_t *) malloc(sizeof(file_transfer_info_list_item_t)); new->info = info; new->next = NULL; if (list->first == NULL) // empty list { new->previous = NULL; list->first = new; list->last = new; } else { new->previous = list->last; list->last->next = new; list->last = new; } list->count ++; } file_transfer_info_list_item_t * file_transfer_info_get_list_item(file_transfer_info_list_t * list, al_bp_endpoint_id_t client) { file_transfer_info_list_item_t * item = list->first; while (item != NULL) { if (strcmp(item->info->client_eid.uri, client.uri) == 0) { return item; } item = item->next; } return NULL; } file_transfer_info_t * file_transfer_info_get(file_transfer_info_list_t * list, al_bp_endpoint_id_t client) { file_transfer_info_list_item_t * item; item = file_transfer_info_get_list_item(list, client); if (item != NULL) return item->info; return NULL; } void file_transfer_info_del(file_transfer_info_list_t * list, al_bp_endpoint_id_t client) { file_transfer_info_list_item_t * item; item = file_transfer_info_get_list_item(list, client); if (item != NULL) { file_transfer_info_list_item_delete(list, item); } } void file_transfer_info_list_item_delete(file_transfer_info_list_t * list, file_transfer_info_list_item_t * item) { if (item->next == NULL && item->previous == NULL) // unique element of the list { list->first = NULL; list->last = NULL; } else if (item->next == NULL) // last element of list { item->previous->next = NULL; list->last = item->previous; } else if (item->previous == NULL) // first element of list { item->next->previous = NULL; list->first = item->next; } else // generic element of list { item->next->previous = item->previous; item->previous->next = item->next; } file_transfer_info_destroy(item->info); free(item); list->count --; } int assemble_file(file_transfer_info_t * info, FILE * pl_stream, u32_t pl_size, u32_t timestamp_secs, u32_t expiration, uint16_t monitor_eid_len, uint32_t *crc) { char * transfer; u32_t transfer_len; int fd; uint32_t offset; uint32_t local_crc=0; // transfer length is total payload length without header, // congestion control char and file fragment offset transfer_len = get_file_fragment_size(pl_size, info->filename_len, monitor_eid_len); // read file fragment offset if(fread(&offset, sizeof(offset), 1, pl_stream) != 1) return -1; // read remaining file fragment transfer = (char*) malloc(transfer_len); memset(transfer, 0, transfer_len); if (fread(transfer, transfer_len, 1, pl_stream) != 1) return -1; // calculate CRC if (crc!=NULL) { local_crc = calc_crc32_d8(local_crc, (uint8_t*) transfer, transfer_len); if (local_crc!=*crc) return -2; } // open or create destination file char* filename = (char*) malloc(info->filename_len + strlen(info->full_dir) +1); strcpy(filename, info->full_dir); strcat(filename, info->filename); fd = open(filename, O_WRONLY | O_CREAT, 0755); if (fd < 0) { return -1; } // write fragment lseek(fd, offset, SEEK_SET); if (write(fd, transfer, transfer_len) < 0) return -1; close(fd); // deallocate resources free(filename); free(transfer); // update info info->bytes_recvd += transfer_len; info->expiration = expiration; info->last_bundle_time = timestamp_secs; // if transfer completed return 1 if (info->bytes_recvd >= info->file_dim) return 1; return 0; } int process_incoming_file_transfer_bundle(file_transfer_info_list_t *info_list, al_bp_bundle_object_t * bundle, char * dir, uint32_t *crc) { al_bp_endpoint_id_t client_eid; al_bp_timestamp_t timestamp; al_bp_timeval_t expiration; file_transfer_info_t * info; FILE * pl_stream; int result; uint16_t filename_len; char * filename; uint32_t file_dim; u32_t pl_size; char * eid, temp[256]; char * full_dir; // get info from bundle al_bp_bundle_get_source(*bundle, &client_eid); al_bp_bundle_get_creation_timestamp(*bundle, ×tamp); // if(al_bp_get_implementation() != BP_ION) // al_bp_bundle_get_expiration(*bundle, &expiration); al_bp_bundle_get_payload_size(*bundle, &pl_size); // create stream from incoming bundle payload if (open_payload_stream_read(*bundle, &pl_stream) < 0) return -1; // skip header - congestion control char - lifetime ack fseek(pl_stream, HEADER_SIZE + BUNDLE_OPT_SIZE + sizeof(al_bp_timeval_t) + BUNDLE_CRC_SIZE, SEEK_SET); // skip monitor eid uint16_t monitor_eid_len; char monitor_eid[256]; if(fread(&monitor_eid_len, sizeof(monitor_eid_len), 1, pl_stream) != 1){return -1;} if(fread(monitor_eid, monitor_eid_len, 1, pl_stream) != 1){return -1;} info = file_transfer_info_get(info_list, client_eid); // get expiration time result = fread(&expiration, sizeof(expiration), 1, pl_stream); if( result < 1) perror("fread expiration time"); if (info == NULL) // this is the first bundle { // get filename len result = fread(&filename_len, sizeof(filename_len), 1, pl_stream); // get filename filename = (char *) malloc(filename_len + 1); memset(filename, 0, filename_len + 1); result = fread(filename, filename_len, 1, pl_stream); if(result < 1 ) perror("fread filename"); filename[filename_len] = '\0'; //get file size if(fread(&file_dim, sizeof(file_dim), 1, pl_stream)!=1){return -1;} // create destination dir for file strncpy(temp, client_eid.uri, strlen(client_eid.uri) + 1); // if is a URI endpoint remove service tag if(strncmp(temp,"ipn",3) !=0 ) { strtok(temp, "/"); eid = strtok(NULL, "/"); } else { strtok(temp, ":"); eid = strtok(NULL, ""); } full_dir = (char*) malloc(strlen(dir) + strlen(eid) + 20); sprintf(full_dir, "%s%s/", dir, eid); sprintf(temp, "mkdir -p %s", full_dir); if(system(temp)<0){ printf(" Error: Couldn't create temporary file\n"); return -1; } sprintf(temp, "%lu_", timestamp.secs); strcat(full_dir, temp); // create file transfer info object info = file_transfer_info_create(client_eid, filename_len, filename, full_dir, file_dim, timestamp.secs, expiration); // insert info into info list file_transfer_info_put(info_list, info); free(full_dir); } else // first bundle of transfer already received { // skip filename_len and filename fseek(pl_stream, sizeof(filename_len) + strlen(info->filename), SEEK_CUR); // skip file_size fseek(pl_stream, sizeof(file_dim), SEEK_CUR); } // assemble file result = assemble_file(info, pl_stream, pl_size, timestamp.secs, expiration, monitor_eid_len, crc); close_payload_stream_read(pl_stream); if (result < 0)// error return result; if (result == 1) // transfer completed { printf(" Successfully transfered file: %s%s\n", info->full_dir, info->filename); // remove info from list file_transfer_info_del(info_list, client_eid); return 1; } return 0; } u32_t get_file_fragment_size(u32_t payload_size, uint16_t filename_len, uint16_t monitor_eid_len) { u32_t result; /* long header_dtnperf, header_file; // size header + congestion ctrl char + ack lifetime + monitor eid len + monitor eid header_dtnperf = HEADER_SIZE + BUNDLE_OPT_SIZE + sizeof(al_bp_timeval_t) + monitor_eid_len + sizeof(monitor_eid_len); // bundle lifetime + filename + filename len + dim file + offset header_file = sizeof(al_bp_timeval_t) + filename_len + sizeof(filename_len) + sizeof(uint32_t) + sizeof(uint32_t); // fragment size is without dtnperf header and file header*/ result = payload_size - get_header_size('F', filename_len, monitor_eid_len); return result; } al_bp_error_t prepare_file_transfer_payload(dtnperf_options_t *opt, FILE * f, int fd, char * filename, uint32_t file_dim, al_bp_timeval_t expiration_time, boolean_t * eof, uint32_t *crc, int *bytes_written) { if (f == NULL) return BP_ENULLPNTR; al_bp_error_t result; uint32_t fragment_len; char * fragment; uint32_t offset; long bytes_read; uint16_t filename_len = strlen(filename); uint16_t monitor_eid_len = strlen(opt->mon_eid); // get size of fragment and allocate fragment fragment_len = get_file_fragment_size(opt->bundle_payload, filename_len, monitor_eid_len); fragment = (char *) malloc(fragment_len); memset(fragment, 0, fragment_len); // get offset of fragment offset = lseek(fd, 0, SEEK_CUR); // read fragment from file bytes_read = read(fd, fragment, fragment_len); if (bytes_read < fragment_len)// reached EOF { *eof = TRUE; fragment[bytes_read] = EOF; } else *eof = FALSE; // RESET CRC *crc= 0; *bytes_written=0; // prepare header and congestion control result = prepare_payload_header_and_ack_options(opt, f, crc, bytes_written); // write expiration time fwrite(&expiration_time, sizeof(expiration_time), 1, f); *bytes_written+=sizeof(expiration_time); if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) &expiration_time, sizeof(expiration_time)); // write filename length fwrite(&filename_len, sizeof(filename_len), 1, f); *bytes_written+=sizeof(filename_len); if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) &filename_len, sizeof(filename_len)); // write filename fwrite(filename, filename_len, 1, f); *bytes_written+=filename_len; if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) filename, filename_len); //write file size fwrite(&file_dim, sizeof(file_dim), 1, f); *bytes_written+=sizeof(file_dim); if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) &file_dim, sizeof(file_dim)); // write offset in the bundle fwrite(&offset, sizeof(offset), 1, f); *bytes_written+=sizeof(offset); if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) &offset, sizeof(offset)); // write fragment in the bundle fwrite(fragment, bytes_read, 1, f); *bytes_written+=bytes_read; if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) fragment, bytes_read); //printf("\n\tFRAGMENT:\n\t%s\n", fragment); return result; } ion-open-source/contrib/dtnperf/dtnperf/src/csv_tools.c0000644000175000017500000000636312356652303023757 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * csv_tools.c */ #include "utils.h" #include "csv_tools.h" #include void csv_print_rx_time(FILE * file, struct timeval time, struct timeval start_time) { struct timeval * result = malloc(sizeof(struct timeval)); char buf[50]; sub_time(time, start_time, result); sprintf(buf, "%ld.%ld;", result->tv_sec, result->tv_usec); fwrite(buf, strlen(buf), 1, file); } void csv_print_eid(FILE * file, al_bp_endpoint_id_t eid) { char buf[256]; sprintf(buf, "%s;", eid.uri); fwrite(buf, strlen(buf), 1, file); } void csv_print_timestamp(FILE * file, al_bp_timestamp_t timestamp) { char buf[50]; sprintf(buf, "%lu;%lu;", timestamp.secs, timestamp.seqno); fwrite(buf, strlen(buf), 1, file); } void csv_print_status_report_timestamps_header(FILE * file) { char buf[300]; memset(buf, 0, 300); strcat(buf, "Dlv;"); strcat(buf, "Ct;"); strcat(buf, "Rcv;"); strcat(buf, "Fwd;"); strcat(buf, "Del;"); // not useful for now // strcat(buf, "ACKED_BY_APP_TIMESTAMP"); // status report reason strcat(buf, "Reason;"); fwrite(buf, strlen(buf), 1, file); } void csv_print_status_report_timestamps(FILE * file, al_bp_bundle_status_report_t status_report) { char buf1[256]; char buf2[50]; memset(buf1, 0, 256); if (status_report.flags & BP_STATUS_DELIVERED) sprintf(buf2, "%lu;", status_report.delivery_ts.secs); else sprintf(buf2, " ; "); strcat(buf1, buf2); if (status_report.flags & BP_STATUS_CUSTODY_ACCEPTED) sprintf(buf2, "%lu;", status_report.custody_ts.secs); else sprintf(buf2, " ;"); strcat(buf1, buf2); if (status_report.flags & BP_STATUS_RECEIVED) sprintf(buf2, "%lu;", status_report.receipt_ts.secs); else sprintf(buf2, " ;"); strcat(buf1, buf2); if (status_report.flags & BP_STATUS_FORWARDED) sprintf(buf2, "%lu;", status_report.forwarding_ts.secs); else sprintf(buf2, " ;"); strcat(buf1, buf2); if (status_report.flags & BP_STATUS_DELETED) sprintf(buf2, "%lu;", status_report.deletion_ts.secs); else sprintf(buf2, " ;"); strcat(buf1, buf2); // not useful for now /* if (status_report.flags & BP_STATUS_ACKED_BY_APP) sprintf(buf2, "%lu;", status_report.ack_by_app_ts.secs); else sprintf(buf2, " ;"); strcat(buf1, buf2); */ // status report reason strcat(buf1, al_bp_status_report_reason_to_str(status_report.reason)); strcat(buf1, ";"); fwrite(buf1, strlen(buf1), 1, file); } void csv_print_long(FILE * file, long num) { char buf[50]; sprintf(buf, "%ld", num); csv_print(file, buf); } void csv_print_ulong(FILE * file, unsigned long num) { char buf[50]; sprintf(buf, "%lu", num); csv_print(file, buf); } void csv_print(FILE * file, char * string) { char buf[256]; memset(buf, 0, 256); strcat(buf, string); if (buf[strlen(buf) -1] != ';') strcat(buf, ";"); fwrite(buf, strlen(buf), 1, file); } void csv_end_line(FILE * file) { char c = '\n'; fwrite(&c, 1, 1, file); fflush(file); } ion-open-source/contrib/dtnperf/dtnperf/src/bundle_tools.c0000644000175000017500000004651212356652303024435 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ #define _GNU_SOURCE #include #include "bundle_tools.h" #include "definitions.h" #include #include #include "utils.h" // static variables for stream operations static char * buffer = NULL; static u32_t buffer_len = 0; /* ---------------------------------------------- * bundles_needed * ---------------------------------------------- */ long bundles_needed (long data, long pl) { long res = 0; ldiv_t r; r = ldiv(data, pl); res = r.quot; if (r.rem > 0) res += 1; return res; } // end bundles_needed /* ---------------------------- * print_eid * ---------------------------- */ void print_eid(char * label, al_bp_endpoint_id_t * eid) { printf("%s [%s]\n", label, eid->uri); } // end print_eid void init_info(send_information_t *send_info, int window) { int i; for (i = 0; i < window; i++) { send_info[i].bundle_id.creation_ts.secs = 0; send_info[i].bundle_id.creation_ts.seqno = 0; } } // end init_info long add_info(send_information_t* send_info, al_bp_bundle_id_t bundle_id, struct timeval p_start, int window) { int i; static u_int id = 0; static int last_inserted = -1; for (i = (last_inserted + 1); i < window ; i++) { if ((send_info[i].bundle_id.creation_ts.secs == 0) && (send_info[i].bundle_id.creation_ts.seqno == 0)) { send_info[i].bundle_id.creation_ts.secs = bundle_id.creation_ts.secs; send_info[i].bundle_id.creation_ts.seqno = bundle_id.creation_ts.seqno; send_info[i].send_time.tv_sec = p_start.tv_sec; send_info[i].send_time.tv_usec = p_start.tv_usec; send_info[i].relative_id = id; last_inserted = i; return id++; } } for (i = 0; i <= last_inserted ; i++) { if ((send_info[i].bundle_id.creation_ts.secs == 0) && (send_info[i].bundle_id.creation_ts.seqno == 0)) { send_info[i].bundle_id.creation_ts.secs = bundle_id.creation_ts.secs; send_info[i].bundle_id.creation_ts.seqno = bundle_id.creation_ts.seqno; send_info[i].send_time.tv_sec = p_start.tv_sec; send_info[i].send_time.tv_usec = p_start.tv_usec; send_info[i].relative_id = id; last_inserted = i; return id++; } } return -1; } // end add_info int is_in_info(send_information_t* send_info, al_bp_timestamp_t bundle_timestamp, int window) { int i; static int last_collected = -1; for (i = (last_collected + 1); i < window; i++) { if ((send_info[i].bundle_id.creation_ts.secs == bundle_timestamp.secs) && (send_info[i].bundle_id.creation_ts.seqno == bundle_timestamp.seqno)) { last_collected = i; return i; } } for (i = 0; i <= last_collected; i++) { if ((send_info[i].bundle_id.creation_ts.secs == bundle_timestamp.secs) && (send_info[i].bundle_id.creation_ts.seqno == bundle_timestamp.seqno)) { last_collected = i; return i; } } return -1; } // end is_in_info int count_info(send_information_t* send_info, int window) { int i, count = 0; for (i = 0; i < window; i++) { if (send_info[i].bundle_id.creation_ts.secs != 0) { count++; } } return count; } void remove_from_info(send_information_t* send_info, int position) { send_info[position].bundle_id.creation_ts.secs = 0; send_info[position].bundle_id.creation_ts.seqno = 0; } // end remove_from_info void set_bp_options(al_bp_bundle_object_t *bundle, dtnperf_connection_options_t *opt) { al_bp_bundle_delivery_opts_t dopts = BP_DOPTS_NONE; // Bundle expiration al_bp_bundle_set_expiration(bundle, opt->expiration); // Bundle priority al_bp_bundle_set_priority(bundle, opt->priority); // Bundle unreliable al_bp_bundle_set_unreliable(bundle, opt->unreliable); // Bundle critical al_bp_bundle_set_critical(bundle, opt->critical); // Bundle flow label al_bp_bundle_set_flow_label(bundle, opt->flow_label); // Delivery receipt option if (opt->delivery_receipts) dopts |= BP_DOPTS_DELIVERY_RCPT; // Forward receipt option if (opt->forwarding_receipts) dopts |= BP_DOPTS_FORWARD_RCPT; // Custody transfer if (opt->custody_transfer && (opt->critical == FALSE)) dopts |= BP_DOPTS_CUSTODY; // Custody receipts if (opt->custody_receipts) dopts |= BP_DOPTS_CUSTODY_RCPT; // Receive receipt if (opt->receive_receipts) dopts |= BP_DOPTS_RECEIVE_RCPT; // Deleted receipts if (opt->deleted_receipts) dopts |= BP_DOPTS_DELETE_RCPT; //Disable bundle fragmentation if (opt->disable_fragmentation) dopts |= BP_DOPTS_DO_NOT_FRAGMENT; //Set options al_bp_bundle_set_delivery_opts(bundle, dopts); } // end set_bp_options int open_payload_stream_read(al_bp_bundle_object_t bundle, FILE ** f) { al_bp_bundle_payload_location_t pl_location; char * buffer; u32_t buffer_len; al_bp_bundle_get_payload_location(bundle, &pl_location); if (pl_location == BP_PAYLOAD_MEM) { al_bp_bundle_get_payload_mem(bundle, &buffer, &buffer_len); *f = fmemopen(buffer, buffer_len, "rb"); if (*f == NULL) return -1; } else { al_bp_bundle_get_payload_file(bundle, &buffer, &buffer_len); *f = fopen(buffer, "rb"); if (*f == NULL) { perror("open"); return -1; } } return 0; } int close_payload_stream_read(FILE * f) { return fclose(f); } int open_payload_stream_write(al_bp_bundle_object_t bundle, FILE ** f) { al_bp_bundle_payload_location_t pl_location; al_bp_bundle_get_payload_location(bundle, &pl_location); if (pl_location == BP_PAYLOAD_MEM) { al_bp_bundle_get_payload_mem(bundle, &buffer, &buffer_len); *f= open_memstream(&buffer, (size_t *) &buffer_len); if (*f == NULL) return -1; } else { al_bp_bundle_get_payload_file(bundle, &buffer, &buffer_len); *f = fopen(buffer, "wb"); if (*f == NULL) return -1; } return 0; } int close_payload_stream_write(al_bp_bundle_object_t * bundle, FILE *f) { al_bp_bundle_payload_location_t pl_location; al_bp_bundle_get_payload_location(*bundle, &pl_location); fclose(f); if (pl_location == BP_PAYLOAD_MEM) { al_bp_bundle_set_payload_mem(bundle, buffer, buffer_len); } else { al_bp_bundle_set_payload_file(bundle, buffer, buffer_len); } return 0; } al_bp_error_t prepare_payload_header_and_ack_options(dtnperf_options_t *opt, FILE * f, uint32_t *crc, int *bytes_written) { if (f == NULL) return BP_ENULLPNTR; HEADER_TYPE header; BUNDLE_OPT_TYPE options; uint16_t eid_len; uint32_t tmp_crc = 0; // header switch(opt->op_mode) { case 'T': header = TIME_HEADER; break; case 'D': header = DATA_HEADER; break; case 'F': header = FILE_HEADER; break; default: return BP_EINVAL; } // options options = 0; // ack to client if (opt->bundle_ack_options.ack_to_client) options |= BO_ACK_CLIENT_YES; else options |= BO_ACK_CLIENT_NO; //ack to monitor if (opt->bundle_ack_options.ack_to_mon == ATM_NORMAL) options |= BO_ACK_MON_NORMAL; else if (opt->bundle_ack_options.ack_to_mon == ATM_FORCE_YES) options |= BO_ACK_MON_FORCE_YES; else if (opt->bundle_ack_options.ack_to_mon == ATM_FORCE_NO) options |= BO_ACK_MON_FORCE_NO; // bundle ack expiration time if (opt->bundle_ack_options.set_ack_expiration) options |= BO_SET_EXPIRATION; // bundle ack priority if (opt->bundle_ack_options.set_ack_priority) { options |= BO_SET_PRIORITY; switch (opt->bundle_ack_options.ack_priority.priority) { case BP_PRIORITY_BULK: options |= BO_PRIORITY_BULK; break; case BP_PRIORITY_NORMAL: options |= BO_PRIORITY_NORMAL; break; case BP_PRIORITY_EXPEDITED: options |= BO_PRIORITY_EXPEDITED; break; case BP_PRIORITY_RESERVED: options |= BO_PRIORITY_RESERVED; break; default: break; } } if (opt->crc==TRUE) options |= BO_CRC_ENABLED; // write in payload fwrite(&header, HEADER_SIZE, 1, f); *bytes_written+=HEADER_SIZE; if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) &header, HEADER_SIZE); fwrite(&options, BUNDLE_OPT_SIZE, 1, f); *bytes_written+=BUNDLE_OPT_SIZE; if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) &options, BUNDLE_OPT_SIZE); // write lifetime of ack fwrite(&(opt->bundle_ack_options.ack_expiration),sizeof(al_bp_timeval_t), 1, f); *bytes_written+=sizeof(al_bp_timeval_t); if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) &(opt->bundle_ack_options.ack_expiration), sizeof(al_bp_timeval_t)); // write CRC fwrite(&tmp_crc, BUNDLE_CRC_SIZE, 1, f); *bytes_written+=BUNDLE_CRC_SIZE; // write reply-to eid eid_len = strlen(opt->mon_eid); fwrite(&eid_len, sizeof(eid_len), 1, f); *bytes_written+=sizeof(eid_len); if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) &eid_len, sizeof(eid_len)); fwrite(opt->mon_eid, eid_len, 1, f); *bytes_written+=eid_len; if (opt->crc==TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) opt->mon_eid, eid_len); return BP_SUCCESS; } int get_bundle_header_and_options(al_bp_bundle_object_t * bundle, HEADER_TYPE * header, dtnperf_bundle_ack_options_t * options) { if (bundle == NULL) return -1; BUNDLE_OPT_TYPE opt; al_bp_timeval_t ack_lifetime; FILE * pl_stream = NULL; open_payload_stream_read(*bundle, &pl_stream); uint16_t eid_len; if (header != NULL) { // read header if(fread(header, HEADER_SIZE, 1, pl_stream) != 1){ return BP_EINVAL;} } else { // skip header fseek(pl_stream, HEADER_SIZE, SEEK_SET); } if (options != NULL) { // initiate options options->ack_to_client = FALSE; options->ack_to_mon = ATM_NORMAL; options->set_ack_expiration = FALSE; options->set_ack_priority = FALSE; options->crc_enabled = FALSE; // read options if(fread(&opt, BUNDLE_OPT_SIZE, 1, pl_stream) != 1){ return BP_EINVAL;} // ack to client if ((opt & BO_ACK_CLIENT_MASK) == BO_ACK_CLIENT_YES) options->ack_to_client = TRUE; else if ((opt & BO_ACK_CLIENT_MASK) == BO_ACK_CLIENT_NO) options->ack_to_client = FALSE; // ack to mon if ((opt & BO_ACK_MON_MASK) == BO_ACK_MON_NORMAL) options->ack_to_mon = ATM_NORMAL; if ((opt & BO_ACK_MON_MASK) == BO_ACK_MON_FORCE_YES) options->ack_to_mon = ATM_FORCE_YES; else if ((opt & BO_ACK_MON_MASK) == BO_ACK_MON_FORCE_NO) options->ack_to_mon = ATM_FORCE_NO; // expiration if (opt & BO_SET_EXPIRATION) options->set_ack_expiration = TRUE; // priority if (opt & BO_SET_PRIORITY) { options->set_ack_priority = TRUE; options->ack_priority.ordinal = 0; if ((opt & BO_PRIORITY_MASK) == BO_PRIORITY_BULK) options->ack_priority.priority = BP_PRIORITY_BULK; else if ((opt & BO_PRIORITY_MASK) == BO_PRIORITY_NORMAL) options->ack_priority.priority = BP_PRIORITY_NORMAL; else if ((opt & BO_PRIORITY_MASK) == BO_PRIORITY_EXPEDITED) options->ack_priority.priority = BP_PRIORITY_EXPEDITED; else if ((opt & BO_PRIORITY_MASK) == BO_PRIORITY_RESERVED) options->ack_priority.priority = BP_PRIORITY_RESERVED; } // CRC if (opt & BO_CRC_ENABLED) options->crc_enabled=TRUE; // lifetime if(fread(&ack_lifetime,sizeof(al_bp_timeval_t), 1, pl_stream) != 1){ return BP_EINVAL;} options->ack_expiration = ack_lifetime; // crc bundle->payload->buf.buf_crc=0; if(fread(&bundle->payload->buf.buf_crc, BUNDLE_CRC_SIZE, 1, pl_stream) != 1){ return BP_EINVAL;} // monitor if(fread(&eid_len, sizeof(eid_len), 1, pl_stream) != 1){ return BP_EINVAL;} if(fread(bundle->spec->replyto.uri, eid_len, 1, pl_stream) != 1){ return BP_EINVAL;} bundle->spec->replyto.uri[eid_len] = '\0'; } else { // skip option fseek(pl_stream, BUNDLE_OPT_SIZE, SEEK_SET); } return 0; } u32_t get_header_size(char mode, uint16_t filename_len, uint16_t monitor_eid_len) { u32_t result = 0; // Header Type, congenstion char, ack lifetime, crc, monitor eid, monitor eid length result = HEADER_SIZE + BUNDLE_OPT_SIZE + sizeof(al_bp_timeval_t) + BUNDLE_CRC_SIZE + sizeof(monitor_eid_len) + monitor_eid_len; if(mode == 'F') { // bundle lifetime, filename, filename len, dim file, offset result += sizeof(al_bp_timeval_t) + filename_len + sizeof(filename_len) + sizeof(uint32_t) + sizeof(uint32_t); } return result; } al_bp_error_t prepare_generic_payload(dtnperf_options_t *opt, FILE * f, uint32_t *crc, int *bytes_written) { if (f == NULL) return BP_ENULLPNTR; char * pattern = PL_PATTERN; long remaining; int i; uint16_t monitor_eid_len; al_bp_error_t result; // RESET CRC *crc= 0; *bytes_written=0; monitor_eid_len = strlen(opt->mon_eid); remaining = opt->bundle_payload - get_header_size(opt->op_mode, 0, monitor_eid_len); // prepare header and congestion control result = prepare_payload_header_and_ack_options(opt, f, crc, bytes_written); // fill remainig payload with a pattern for (i = remaining; i > strlen(pattern); i -= strlen(pattern)) { fwrite(pattern, strlen(pattern), 1, f); *bytes_written+=strlen(pattern); if (opt->crc == TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) pattern, strlen(pattern)); } fwrite(pattern, remaining % strlen(pattern), 1, f); *bytes_written+=remaining%strlen(pattern); if (opt->crc == TRUE) *crc = calc_crc32_d8(*crc, (uint8_t*) pattern, remaining % strlen(pattern)); return result; } al_bp_error_t prepare_force_stop_bundle(al_bp_bundle_object_t * start, al_bp_endpoint_id_t monitor, al_bp_timeval_t expiration, al_bp_bundle_priority_t priority) { FILE * start_stream; HEADER_TYPE start_header = FORCE_STOP_HEADER; al_bp_endpoint_id_t none; al_bp_bundle_delivery_opts_t opts = BP_DOPTS_NONE; al_bp_bundle_set_payload_location(start, BP_PAYLOAD_MEM); open_payload_stream_write(*start, &start_stream); fwrite(&start_header, HEADER_SIZE, 1, start_stream); close_payload_stream_write(start, start_stream); al_bp_bundle_set_dest(start, monitor); al_bp_get_none_endpoint(&none); al_bp_bundle_set_replyto(start, none); al_bp_bundle_set_delivery_opts(start, opts); al_bp_bundle_set_expiration(start, expiration); al_bp_bundle_set_priority(start, priority); return BP_SUCCESS; } al_bp_error_t prepare_stop_bundle(al_bp_bundle_object_t * stop, al_bp_endpoint_id_t monitor, al_bp_timeval_t expiration, al_bp_bundle_priority_t priority, int sent_bundles) { FILE * stop_stream; HEADER_TYPE stop_header = STOP_HEADER; al_bp_endpoint_id_t none; uint32_t buf; al_bp_bundle_delivery_opts_t opts = BP_DOPTS_NONE; al_bp_bundle_set_payload_location(stop, BP_PAYLOAD_MEM); open_payload_stream_write(*stop, &stop_stream); fwrite(&stop_header, HEADER_SIZE, 1, stop_stream); buf = htonl(sent_bundles); fwrite(&buf, sizeof(buf), 1, stop_stream); close_payload_stream_write(stop, stop_stream); al_bp_bundle_set_dest(stop, monitor); al_bp_get_none_endpoint(&none); al_bp_bundle_set_replyto(stop, none); al_bp_bundle_set_delivery_opts(stop, opts); al_bp_bundle_set_expiration(stop, expiration); al_bp_bundle_set_priority(stop, priority); return BP_SUCCESS; } al_bp_error_t get_info_from_stop(al_bp_bundle_object_t * stop, int * sent_bundles) { FILE * stop_stream; uint32_t buf; open_payload_stream_read(*stop, &stop_stream); // skip header fseek(stop_stream, HEADER_SIZE, SEEK_SET); // read sent bundles num if(fread(&buf, sizeof(buf), 1, stop_stream) != 1){ return BP_EINVAL;} * sent_bundles = (int) ntohl(buf); close_payload_stream_read(stop_stream); return BP_SUCCESS; } /** * */ al_bp_error_t prepare_server_ack_payload(dtnperf_server_ack_payload_t ack, dtnperf_bundle_ack_options_t *bundle_ack_options, char **payload, size_t *payload_size) { FILE * buf_stream; char * buf; size_t buf_size; HEADER_TYPE header = DSA_HEADER; uint16_t eid_len; uint32_t timestamp_secs; uint32_t timestamp_seqno; uint32_t extension_header; extension_header = 0; buf_stream = open_memstream(&buf, &buf_size); fwrite(&header, 1, HEADER_SIZE, buf_stream); eid_len = strlen(ack.bundle_source.uri); fwrite(&eid_len, sizeof(eid_len), 1, buf_stream); fwrite(&(ack.bundle_source.uri), 1, eid_len, buf_stream); timestamp_secs = (uint32_t) ack.bundle_creation_ts.secs; timestamp_seqno = (uint32_t) ack.bundle_creation_ts.seqno; fwrite(×tamp_secs, 1, sizeof(uint32_t), buf_stream); fwrite(×tamp_seqno, 1, sizeof(uint32_t), buf_stream); if (bundle_ack_options->crc_enabled == TRUE) { extension_header |= BO_CRC_ENABLED; fwrite(&extension_header, sizeof(uint32_t), 1, buf_stream); } fclose(buf_stream); *payload = (char*)malloc(buf_size); memcpy(*payload, buf, buf_size); *payload_size = buf_size; free(buf); return BP_SUCCESS; } al_bp_error_t get_info_from_ack(al_bp_bundle_object_t * ack, al_bp_endpoint_id_t * reported_eid, al_bp_timestamp_t * reported_timestamp, uint32_t *extension_ack) { al_bp_error_t error; HEADER_TYPE header; FILE * pl_stream; uint16_t eid_len; uint32_t timestamp_secs, timestamp_seqno; open_payload_stream_read(*ack, &pl_stream); if(fread(&header, HEADER_SIZE, 1, pl_stream) != 1){ return BP_EINVAL;} if (header == DSA_HEADER) { if(fread(&eid_len, sizeof(eid_len), 1, pl_stream) != 1){ return BP_EINVAL;} if (reported_eid != NULL) { if(fread(reported_eid->uri, eid_len, 1, pl_stream) != 1){ return BP_EINVAL;} reported_eid->uri[eid_len] = '\0'; } else fseek(pl_stream, eid_len, SEEK_CUR); if (reported_timestamp != NULL) { if(fread(×tamp_secs, sizeof(uint32_t), 1, pl_stream) != 1){ return BP_EINVAL;} if(fread(×tamp_seqno, sizeof(uint32_t), 1, pl_stream) != 1){ return BP_EINVAL;} reported_timestamp->secs = (u32_t) timestamp_secs; reported_timestamp->seqno = (u32_t) timestamp_seqno; } if (feof(pl_stream)==0) { if(fread(extension_ack, sizeof(uint32_t), 1, pl_stream) != 1){ return BP_EINVAL;} } else *extension_ack = 0; error = BP_SUCCESS; } else error = BP_ERRBASE; close_payload_stream_read(pl_stream); return error; } boolean_t check_metadata(extension_block_info_t* ext_block) { return ext_block->metadata; } // end check_metadata void set_metadata_type(extension_block_info_t* ext_block, u_int64_t metadata_type) { if (metadata_type > METADATA_TYPE_EXPT_MAX) { fprintf(stderr, "Value of metadata_type greater than maximum allowed\n"); exit(1); } ext_block->metadata = TRUE; ext_block->metadata_type = metadata_type; } // end set_metadata void get_extension_block(extension_block_info_t* ext_block, al_bp_extension_block_t * extension_block) { *extension_block = ext_block->block; } // end get_extension_block void set_block_buf(extension_block_info_t* ext_block, char * buf, u32_t len) { if (ext_block->block.data.data_val != NULL) { free(ext_block->block.data.data_val); ext_block->block.data.data_val = NULL; ext_block->block.data.data_len = 0; } if (ext_block->metadata) { ext_block->block.data.data_val = (char *)malloc(sizeof(char) * (len + 1)); ext_block->block.data.data_len = len; strncpy(ext_block->block.data.data_val, buf, len); free(buf); } else { ext_block->block.data.data_val = buf; ext_block->block.data.data_len = len; } } // end set_block_buf u32_t get_current_dtn_time() { u32_t result; time_t dtn_epoch = (time_t) DTN_EPOCH; time_t current = time(NULL); result = (u32_t) difftime(current, dtn_epoch); return result; } ion-open-source/contrib/dtnperf/dtnperf/src/dtnperf_main.c0000644000175000017500000002054612356652303024411 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * dtnperf_main.c */ #include "includes.h" #include "utils.h" #include "dtnperf_types.h" #include "definitions.h" #include "dtnperf_modes/dtnperf_client.h" #include "dtnperf_modes/dtnperf_server.h" #include "dtnperf_modes/dtnperf_monitor.h" #include /* --------------------------- * Global variables and options * --------------------------- */ dtnperf_global_options_t global_options; /* ------------------------------- * function interfaces * ------------------------------- */ void parse_options(int argc, char** argv, dtnperf_global_options_t * global_opt); void print_usage(char* progname); void init_dtnperf_global_options(dtnperf_global_options_t *, dtnperf_options_t *, dtnperf_connection_options_t *); void init_dtnperf_options(dtnperf_options_t *); void init_dtnperf_connection_options(dtnperf_connection_options_t*); /* ------------------------------- * MAIN * ------------------------------- */ int main(int argc, char ** argv) { // variable declarations dtnperf_global_options_t global_options; dtnperf_options_t perf_opt; dtnperf_connection_options_t conn_opt; monitor_parameters_t mon_params; int fd, pid; // init options init_dtnperf_global_options(&global_options, &perf_opt, &conn_opt); // parse command line options parse_options(argc, argv, &global_options); switch (global_options.mode) { case DTNPERF_SERVER: if (perf_opt.daemon) { if ((fd = open(perf_opt.server_output_file,O_WRONLY | O_CREAT | O_TRUNC, 0644)) > 0) { pid = fork(); if (pid == 0) { close(1); close(2); dup2(fd,1); dup2(fd,2); run_dtnperf_server(&global_options); close(1); close(2); close(fd); } else { close(fd); printf("Started dtnperf server in daemon mode.\n"); printf("Pid = %d\n", pid); printf("To terminate the daemon use:\n"); printf("\t%s %s --stop\n", argv[0], SERVER_STRING); printf("See log at %s\n", perf_opt.server_output_file); } } else { printf("ERROR: failed to open output file %s: %s\n", perf_opt.server_output_file, strerror(errno)); exit(1); } } else { run_dtnperf_server(&global_options); } break; case DTNPERF_CLIENT_MONITOR: case DTNPERF_CLIENT: run_dtnperf_client(&global_options); break; case DTNPERF_MONITOR: mon_params.client_id = 0; mon_params.dedicated_monitor = FALSE; mon_params.perf_g_opt = &global_options; if (perf_opt.daemon) { if ((fd = open(perf_opt.monitor_output_file,O_WRONLY | O_CREAT | O_TRUNC, 0644)) > 0) { pid = fork(); if (pid == 0) { close(1); close(2); dup2(fd,1); dup2(fd,2); run_dtnperf_monitor(&mon_params); close(1); close(2); close(fd); } else { close(fd); printf("Started dtnperf monitor in daemon mode.\n"); printf("Pid = %d\n", pid); printf("To terminate the daemon use:\n"); printf("\t%s %s --stop\n", argv[0], MONITOR_STRING); printf("See log at %s\n", perf_opt.monitor_output_file); } } else { printf("ERROR: failed to open output file %s: %s\n", perf_opt.monitor_output_file, strerror(errno)); exit(1); } } else { run_dtnperf_monitor(&mon_params); } break; default: fprintf(stderr,"error in switching dtnperf mode"); exit(-1); } exit(0); } void print_usage(char* progname){ fprintf(stderr, "\n"); fprintf(stderr, "DTNperf version %s\n", DTNPERF_VERSION); fprintf(stderr, "SYNTAX: %s [options]\n", progname); fprintf(stderr, "\n"); fprintf(stderr, "operative modes:\n"); fprintf(stderr, " %s\n", SERVER_STRING); fprintf(stderr, " %s\n", CLIENT_STRING); fprintf(stderr, " %s\n", MONITOR_STRING); fprintf(stderr, "\n"); fprintf(stderr, "For more options see\n %s --help\n", progname); fprintf(stderr, " %s --help\tPrint this screen.\n", progname); fprintf(stderr, " %s --Version\tShow version information.\n", progname); fprintf(stderr, "\n"); exit(1); } void parse_options(int argc, char**argv, dtnperf_global_options_t * global_opt) { int i; dtnperf_mode_t perf_mode = 0; // find dtnperf mode (server, client or monitor) if (argc < 2) { print_usage(argv[0]); exit(1); } if (strcmp(argv[1], SERVER_STRING) == 0) { perf_mode = DTNPERF_SERVER; } else if (strcmp(argv[1], CLIENT_STRING) == 0) { perf_mode = DTNPERF_CLIENT; } else if (strcmp(argv[1], MONITOR_STRING) == 0) { perf_mode = DTNPERF_MONITOR; } else if (strcmp(argv[1], "--help") == 0) // general help option { print_usage(argv[0]); exit(0); } else if (strcmp(argv[1], "--version") == 0) // print program version { printf("DTNperf version %s\n", DTNPERF_VERSION); exit(0); } else { fprintf(stderr, "dtnperf mode must be specified as first argument\n"); print_usage(argv[0]); exit(1); } //scroll argv array for(i = 2; i < argc; i++) { argv[i-1] = argv[i]; } argc = argc -1; switch(perf_mode) { case DTNPERF_CLIENT: parse_client_options(argc, argv, global_opt); if (global_opt->perf_opt->mon_eid[0] == '\0') perf_mode = DTNPERF_CLIENT_MONITOR; break; case DTNPERF_SERVER: parse_server_options(argc, argv, global_opt); break; case DTNPERF_MONITOR: parse_monitor_options(argc, argv, global_opt); break; default: fprintf(stderr, "error in parsing options\n"); print_usage(argv[0]); exit(1); } // insert perf_mode in global options global_opt->mode = perf_mode; } // end parse_options void init_dtnperf_global_options(dtnperf_global_options_t *opt, dtnperf_options_t * perf_opt, dtnperf_connection_options_t * conn_opt) { opt->perf_opt = perf_opt; opt->conn_opt = conn_opt; init_dtnperf_options(opt->perf_opt); init_dtnperf_connection_options(opt->conn_opt); opt->mode = 0; } void init_dtnperf_options(dtnperf_options_t *opt) { opt->bp_implementation = al_bp_get_implementation(); opt->verbose = FALSE; opt->debug = FALSE; opt->debug_level = 0; opt->use_ip = FALSE; opt->ip_addr = "127.0.0.1"; opt->ip_port = 5010; opt->eid_format_forced = 'N'; opt->daemon = FALSE; opt->server_output_file = SERVER_OUTPUT_FILE; opt->monitor_output_file = MONITOR_OUTPUT_FILE; memset(opt->dest_eid, 0, AL_BP_MAX_ENDPOINT_ID); memset(opt->mon_eid, 0, AL_BP_MAX_ENDPOINT_ID); opt->op_mode = 'D'; opt->data_qty = 0; opt->D_arg = NULL; opt->F_arg = NULL; opt->P_arg = NULL; opt->use_file = 1; opt->data_unit = 'M'; opt->transmission_time = 0; opt->congestion_ctrl = 'w'; opt->window = 1; opt->rate_arg = NULL; opt->rate = 0; opt->rate_unit = 'b'; opt->wait_before_exit = 0; opt->bundle_payload = DEFAULT_PAYLOAD; opt->payload_type = BP_PAYLOAD_MEM; opt->dest_dir = BUNDLE_DIR_DEFAULT; opt->file_dir = FILE_DIR_DEFAULT; opt->create_log = FALSE; opt->log_filename = LOG_FILENAME; opt->acks_to_mon = FALSE; opt->no_acks = FALSE; opt->logs_dir = LOGS_DIR_DEFAULT; opt->bundle_ack_options.ack_to_client = TRUE; opt->bundle_ack_options.ack_to_mon = ATM_NORMAL; opt->bundle_ack_options.set_ack_expiration = FALSE; opt->bundle_ack_options.set_ack_priority = FALSE; opt->expiration_session = 120; opt->num_blocks = 0; opt->crc = FALSE; } void init_dtnperf_connection_options(dtnperf_connection_options_t* opt) { opt->expiration = 60; // expiration time (sec) [60] opt->delivery_receipts = TRUE; // request delivery receipts [1] opt->forwarding_receipts = FALSE; // request per hop departure [0] opt->custody_transfer = FALSE; // request custody transfer [0] opt->custody_receipts = FALSE; // request per custodian receipts [0] opt->receive_receipts = FALSE; // request per hop arrival receipt [0] opt->deleted_receipts = FALSE; // request per deleted bndl receipt [0] opt->wait_for_report = TRUE; // wait for bundle status reports [1] opt->disable_fragmentation = FALSE; //disable bundle fragmentation[0] opt->priority.priority = BP_PRIORITY_NORMAL; // bundle priority [BP_PRIORITY_NORMAL] opt->priority.ordinal = 0; opt->unreliable = FALSE; opt->critical = FALSE; opt->flow_label = 0; } ion-open-source/contrib/dtnperf/dtnperf/src/csv_tools.h0000644000175000017500000000207212356652303023755 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * csv_tools.h */ #ifndef CSV_TOOLS_H_ #define CSV_TOOLS_H_ #include void csv_print_rx_time(FILE * file, struct timeval time, struct timeval start_time); void csv_print_eid(FILE * file, al_bp_endpoint_id_t eid); void csv_print_timestamp(FILE * file, al_bp_timestamp_t timestamp); void csv_print_status_report_timestamps_header(FILE * file); void csv_print_status_report_timestamps(FILE * file, al_bp_bundle_status_report_t status_report); void csv_print_long(FILE * file, long num); void csv_print_ulong(FILE * file, unsigned long num); void csv_print(FILE * file, char * string); void csv_end_line(FILE * file); #endif /* CSV_TOOLS_H_ */ ion-open-source/contrib/dtnperf/dtnperf/src/dtnperf_modes/0000775000175000017500000000000012356652303024423 5ustar jschendejschendeion-open-source/contrib/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.c0000644000175000017500000010451212356652303027620 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * dtnperf_server.c */ #include "dtnperf_server.h" #include "../includes.h" #include "../definitions.h" #include "../bundle_tools.h" #include "../file_transfer_tools.h" #include "../utils.h" #include /* * Global variables */ // pthread variables pthread_t file_exp_timer; pthread_mutex_t mutexdata; file_transfer_info_list_t file_transfer_info_list; al_bp_handle_t handle; al_bp_reg_id_t regid; al_bp_endpoint_id_t local_eid; // flags to exit cleanly boolean_t bp_handle_open; /* ---------------------------- * SERVER CODE * ---------------------------- */ void run_dtnperf_server(dtnperf_global_options_t * perf_g_opt) { /* ------------------------ * variables * ------------------------ */ dtnperf_options_t * perf_opt = perf_g_opt->perf_opt; dtnperf_connection_options_t * conn_opt = perf_g_opt->conn_opt; al_bp_reg_info_t reginfo; al_bp_bundle_payload_location_t pl_location; al_bp_endpoint_id_t bundle_source_addr; al_bp_endpoint_id_t bundle_dest_addr; al_bp_endpoint_id_t bundle_replyto_addr; al_bp_error_t error; al_bp_bundle_object_t bundle_object; al_bp_bundle_object_t bundle_ack_object; al_bp_bundle_delivery_opts_t bundle_ack_dopts; al_bp_timestamp_t bundle_creation_timestamp; al_bp_timeval_t bundle_expiration; al_bp_bundle_priority_t bundle_priority; size_t bundle_payload_len; dtnperf_server_ack_payload_t server_ack_payload; HEADER_TYPE bundle_header; dtnperf_bundle_ack_options_t bundle_ack_options; time_t current; char* command = NULL; char* pl_filename = NULL; size_t pl_filename_len = 0; char* pl_buffer = NULL; size_t pl_buffer_size = 0; boolean_t is_file_transfer_bundle; int indicator; // for file transfer functions purposes int num_ack; // for name file bundle ack /* ------------------------ * initialize variables * ------------------------ */ boolean_t debug = perf_g_opt->perf_opt->debug; int debug_level = perf_g_opt->perf_opt->debug_level; perf_opt->dest_dir = correct_dirname(perf_opt->dest_dir); perf_opt->file_dir = correct_dirname(perf_opt->file_dir); bp_handle_open = FALSE; num_ack=0; // initialize structures for file transfers file_transfer_info_list = file_transfer_info_list_create(); // set out buffer size if daemon if (perf_opt->daemon) { setlinebuf(stdout); setlinebuf(stderr); } // show requested options (debug) if (debug) { printf("\nOptions;\n"); printf("\tendpoint:\t%s\n", perf_opt->bp_implementation == BP_ION ? SERV_EP_NUM_SERVICE : SERV_EP_STRING); printf("\tsave bundles to:\t%s\n", perf_opt->use_file ? "file":"memory"); if(perf_opt->use_file) printf("\tdestination dir:\t%s\n", perf_opt->dest_dir); printf("\tsend acks:\t%s\n", perf_opt->no_acks ? "no":"yes"); if (!perf_opt->no_acks) { //printf("\tsend acks to monitor: %s\n", perf_opt->acks_to_mon ? "yes":"no"); printf("\tacks expiration time: %d\n", (int) conn_opt->expiration); char * prior; switch(conn_opt->priority.priority) { case BP_PRIORITY_BULK: prior = "bulk"; break; case BP_PRIORITY_NORMAL: prior = "normal"; break; case BP_PRIORITY_EXPEDITED: prior = "expedited"; break; case BP_PRIORITY_RESERVED: prior = "reserved"; break; default: prior = "unknown"; break; } printf("\tacks priority : %s\n", prior); } printf("\n"); } //Ctrl+C handler signal(SIGINT, server_handler); // create dir where dtnperf server will save incoming bundles // command should be: mkdir -p "dest_dir" if(debug && debug_level > 0) printf("[debug] initializing shell command..."); command = malloc(sizeof(char) * (10 + strlen(perf_opt->dest_dir))); sprintf(command, "mkdir -p %s", perf_opt->dest_dir); if(debug && debug_level > 0) printf("done. Shell command = %s\n", command); // execute shell command if(debug && debug_level > 0) printf("[debug] executing shell command..."); if (system(command) < 0) { perror("[DTNperf error] in opening bundle destination dir"); exit(-1); } free(command); if(debug && debug_level > 0) printf("done\n"); // create dir where dtnperf server will save incoming files // command should be: mkdir -p "file_dir" if(debug && debug_level > 0) printf("[debug] initializing shell command..."); command = malloc(sizeof(char) * (10 + strlen(perf_opt->file_dir))); sprintf(command, "mkdir -p %s", perf_opt->file_dir); if(debug && debug_level > 0) printf("done. Shell command = %s\n", command); // execute shell command if(debug && debug_level > 0) printf("[debug] executing shell command..."); if (system(command) < 0) { perror("[DTNperf error] in opening transfered files destination dir"); exit(-1); } free(command); if(debug && debug_level > 0) printf("done\n"); //open the connection to the bundle protocol router if(debug && debug_level > 0) printf("[debug] opening connection to bundle protocol router..."); if (perf_opt->use_ip) error = al_bp_open_with_ip(perf_opt->ip_addr, perf_opt->ip_port, &handle); else error = al_bp_open(&handle); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in opening bp handle: %s\n", al_bp_strerror(error)); exit(1); } else { bp_handle_open = TRUE; } if(debug && debug_level > 0) printf("done\n"); //build a local eid if( perf_opt->eid_format_forced == 'D' || perf_opt->eid_format_forced == 'I') { if(debug && debug_level > 0) { printf("[debug] building local eid in format "); perf_opt->eid_format_forced == 'D' ? printf("DTN...") : printf("IPN..."); } if(perf_opt->eid_format_forced == 'I') al_bp_build_local_eid(handle, &local_eid, SERV_EP_NUM_SERVICE,"Server-CBHE",NULL); else al_bp_build_local_eid(handle, &local_eid, SERV_EP_STRING,"Server-DTN",NULL); } else { if(debug && debug_level > 0) printf("[debug] building a local eid..."); if(perf_opt->bp_implementation == BP_ION) al_bp_build_local_eid(handle, &local_eid, SERV_EP_NUM_SERVICE,"Server-CBHE",NULL); else if(perf_opt->bp_implementation == BP_DTN) al_bp_build_local_eid(handle, &local_eid, SERV_EP_STRING,"Server-DTN",NULL); } if(debug && debug_level > 0) printf("done\n"); if (debug) printf("local_eid = %s\n", local_eid.uri); // checking if there is already a registration if(debug && debug_level > 0) printf("[debug] checking for existing registration..."); error = al_bp_find_registration(handle, &local_eid, ®id); if ( (error == BP_SUCCESS && perf_opt->bp_implementation == BP_DTN) || (perf_opt->bp_implementation == BP_ION && (error == BP_EBUSY || error == BP_EPARSEEID))) { fflush(stdout); fprintf(stderr, "[DTNperf error] existing a registration with the same eid.\n"); fprintf(stderr, "regid 0x%x\n", (unsigned int) regid); server_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" done\n"); //create a new registration to the local router based on this eid if(debug && debug_level > 0) printf("[debug] registering to local daemon..."); memset(®info, 0, sizeof(reginfo)); al_bp_copy_eid(®info.endpoint, &local_eid); reginfo.flags = BP_REG_DEFER; reginfo.regid = BP_REGID_NONE; reginfo.expiration = 0; if ((error = al_bp_register(&handle, ®info, ®id)) != 0) { fflush(stdout); fprintf(stderr, "[DTNperf error] in creating registration: %d (%s)\n", error, al_bp_strerror(al_bp_errno(handle))); server_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" done\n"); if (debug) printf("regid 0x%x\n", (unsigned int) regid); // set bundle destination type if ((debug) && (debug_level > 0)) printf("[debug] choosing bundle destination type..."); if (perf_opt->use_file) pl_location = BP_PAYLOAD_FILE; else pl_location = BP_PAYLOAD_MEM; if ((debug) && (debug_level > 0)) printf(" done. Bundles will be saved into %s\n", perf_opt->use_file ? "file" : "memory"); // start thread pthread_mutex_init (&mutexdata, NULL); pthread_create(&file_exp_timer, NULL, file_expiration_timer, NULL); if ((debug) && (debug_level > 0)) printf("[debug] entering infinite loop...\n"); // start infinite loop while(1) { // create a bundle object if ((debug) && (debug_level > 0)) printf("[debug] initiating memory for bundles...\n"); error = al_bp_bundle_create(&bundle_object); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in initiating memory for bundles: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); // reset file transfer indicators is_file_transfer_bundle = FALSE; // wait until receive a bundle if ((debug) && (debug_level > 0)) printf("[debug] waiting for bundles...\n"); error = al_bp_bundle_receive(handle, bundle_object, pl_location, -1); if(error == BP_ERECVINT || error == BP_ETIMEOUT) { if(error == BP_ERECVINT ) fprintf(stderr, "[DTNperf warning] bundle reception interrupted\n"); if(error == BP_ETIMEOUT ) fprintf(stderr, "[DTNperf warning] bundle reception timeout expired\n"); // free memory for bundle al_bp_bundle_free(&bundle_object); } else { if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "error getting recv reply: %d (%s)\n", error, al_bp_strerror(al_bp_errno(handle))); server_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" bundle received\n"); // find payload size if ((debug) && (debug_level > 0)) printf("[debug] calculating bundle payload size..."); error = al_bp_bundle_get_payload_size(bundle_object, (u32_t *) &bundle_payload_len); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in getting bundle payload size: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); // mark current time if ((debug) && (debug_level > 0)) printf("[debug] marking time..."); current = time(NULL); if ((debug) && (debug_level > 0)) printf(" done\n"); // print bundle arrival printf("%s : %zu bytes from %s\n", ctime(¤t), bundle_payload_len, bundle_object.spec->source.uri); // get bundle header and options if ((debug) && (debug_level > 0)) printf("[debug]\tgetting bundle header and options..."); if (get_bundle_header_and_options(&bundle_object, &bundle_header, &bundle_ack_options) < 0) { printf("[DTNperf warning] in getting bundle header and options\n"); continue; } if ((debug) && (debug_level > 0)) { printf(" done.\n"); } // get SOURCE eid if ((debug) && (debug_level > 0)) printf("[debug]\tgetting source eid..."); error = al_bp_bundle_get_source(bundle_object, &bundle_source_addr); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in getting bundle source eid: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if ((debug) && (debug_level > 0)) { printf(" done:\n"); printf("\tbundle_source_addr = %s\n", bundle_source_addr.uri); printf("\n"); } // get DEST eid if ((debug) && (debug_level > 0)) printf("[debug]\tgetting destination eid..."); error = al_bp_bundle_get_dest(bundle_object, &bundle_dest_addr); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in getting bundle destination eid: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if ((debug) && (debug_level > 0)) { printf(" done:\n"); printf("\tbundle_dest_eid = %s\n", bundle_dest_addr.uri); printf("\n"); } // get REPLY TO eid if ((debug) && (debug_level > 0)) printf("[debug]\tgetting reply to eid..."); error = al_bp_bundle_get_replyto(bundle_object, &bundle_replyto_addr); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "error getting bundle reply to eid: %s\n", al_bp_strerror(error)); exit(1); } if ((debug) && (debug_level > 0)) { printf(" done:\n"); printf("\tbundle_replyto_eid = %s\n", bundle_replyto_addr.uri); printf("\n"); } // get bundle creation timestamp if ((debug) && (debug_level > 0)) printf("[debug]\tgetting bundle creation timestamp..."); error = al_bp_bundle_get_creation_timestamp(bundle_object, &bundle_creation_timestamp); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in getting bundle creation timestamp: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if ((debug) && (debug_level > 0)) { printf(" done:\n"); printf("\tbundle creation timestamp:\n" "\tsecs = %d\n\tseqno= %d\n", (int)bundle_creation_timestamp.secs, (int)bundle_creation_timestamp.seqno); printf("\n"); } // get bundle payload filename if(perf_opt->use_file) { if ((debug) && (debug_level > 0)) printf("[debug]\tgetting bundle payload filename..."); error = al_bp_bundle_get_payload_file(bundle_object, &pl_filename, (u32_t *) &pl_filename_len); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in getting bundle payload filename: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if ((debug) && (debug_level > 0)) { printf(" done:\n"); } } if ((debug)) { printf ("======================================\n"); printf (" Bundle received at %s\n", ctime(¤t)); printf (" source: %s\n", bundle_source_addr.uri); if (perf_opt->use_file) { printf (" saved into : %s\n", pl_filename); } printf ("--------------------------------------\n"); }; // check if is file transfer bundle if ((debug) && (debug_level > 0)) printf("[debug]\tchecking if this is a file transfer bundle..."); if (bundle_header == FILE_HEADER) { is_file_transfer_bundle = TRUE; } if ((debug) && (debug_level > 0)) { printf(" done.\n"); printf("\tbundle is%sa file transfer bundle\n", is_file_transfer_bundle ? " " : " not "); printf("\n"); } // process file transfer bundle if(is_file_transfer_bundle) { if ((debug) && (debug_level > 0)) printf("[debug]\tprocessing file transfer bundle..."); pthread_mutex_lock(&mutexdata); indicator = process_incoming_file_transfer_bundle(&file_transfer_info_list, &bundle_object,perf_opt->file_dir, (bundle_ack_options.crc_enabled == TRUE ? &bundle_object.payload->buf.buf_crc : (uint32_t *) NULL)); pthread_mutex_unlock(&mutexdata); sched_yield(); // WRONG CRC if (indicator == -2) { if (debug) printf("CRC differs from the received one.\n"); bundle_ack_options.crc_enabled=TRUE; } else bundle_ack_options.crc_enabled=FALSE; if (indicator < 0) // error in processing bundle { fprintf(stderr, "[DTNperf warning] in processing file transfer bundle: %s\n", strerror(errno)); } if ((debug) && (debug_level > 0)) { printf("done.\n"); if (indicator == 1) printf("Transfer Completed\n"); } } if (bundle_ack_options.crc_enabled==TRUE) { FILE *pl_stream; char *transfer; int transfer_len; u32_t pl_size; uint32_t local_crc; local_crc = 0; // get info about bundle size al_bp_bundle_get_payload_size(bundle_object, &pl_size); if (open_payload_stream_read(bundle_object, &pl_stream) < 0) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] i can't open the bundle file\n"); server_clean_exit(1); } /* fseek(pl_stream, HEADER_SIZE + BUNDLE_OPT_SIZE, SEEK_SET); if (is_file_transfer_bundle) { fseek }*/ transfer_len = HEADER_SIZE + BUNDLE_OPT_SIZE+sizeof(al_bp_timeval_t); transfer = (char*) malloc(transfer_len); memset(transfer, 0, transfer_len); if (fread(transfer, transfer_len, 1, pl_stream) != 1 && ferror(pl_stream)!=0) { fprintf(stderr, "[DTNperf warning] in processing file transfer bundle: %s\n", strerror(errno)); } local_crc = calc_crc32_d8(local_crc, (uint8_t*) transfer, transfer_len); free(transfer); fseek(pl_stream, BUNDLE_CRC_SIZE, SEEK_CUR); transfer_len = pl_size-transfer_len-BUNDLE_CRC_SIZE; transfer = (char*) malloc(transfer_len); memset(transfer, 0, transfer_len); if (fread(transfer, transfer_len, 1, pl_stream) != 1 && ferror(pl_stream)!=0) { fprintf(stderr, "[DTNperf warning] in processing file transfer bundle: %s\n", strerror(errno)); } local_crc = calc_crc32_d8(local_crc, (uint8_t*) transfer, transfer_len); if (debug) printf("CRC received: %"PRIu32" GENERATED: %"PRIu32"\n", bundle_object.payload->buf.buf_crc, local_crc); if (local_crc != bundle_object.payload->buf.buf_crc) bundle_ack_options.crc_enabled=TRUE; else bundle_ack_options.crc_enabled=FALSE; free(transfer); close_payload_stream_read(pl_stream); } // get bundle expiration time if (bundle_ack_options.set_ack_expiration) { // al_bp_bundle_get_expiration(bundle_object, &bundle_expiration); // is setted the smaller if( conn_opt->expiration < bundle_ack_options.ack_expiration) bundle_expiration = conn_opt->expiration; else bundle_expiration = bundle_ack_options.ack_expiration; } else bundle_expiration = conn_opt->expiration; // get bundle priority bundle_priority.ordinal = 0; if( bundle_ack_options.set_ack_priority) { // is setted the smaller if( conn_opt->priority.priority < bundle_ack_options.ack_priority.priority) bundle_priority.priority = conn_opt->priority.priority; else bundle_priority.priority = bundle_ack_options.ack_priority.priority; } else bundle_priority.priority = conn_opt->priority.priority; // send acks to the client only if requested by client // send acks to the monitor if: // ack requested by client AND ack-to-monitor option set AND bundle_ack_options.ack_to_mon == ATM_NORMAL // OR client forced server to send ack to monitor boolean_t send_ack_to_client = bundle_ack_options.ack_to_client; boolean_t send_ack_to_monitor = FALSE; send_ack_to_monitor = (bundle_ack_options.ack_to_client && (bundle_ack_options.ack_to_mon == ATM_NORMAL) && bundle_ack_options.ack_to_client && perf_opt->acks_to_mon) || (bundle_ack_options.ack_to_mon == ATM_FORCE_YES); if (send_ack_to_client || send_ack_to_monitor) { // create bundle ack to send if ((debug) && (debug_level > 0)) printf("[debug] initiating memory for bundle ack..."); error = al_bp_bundle_create(&bundle_ack_object); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in initiating memory for bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); // initiate server ack payload // set server ack payload source server_ack_payload.bundle_source = bundle_source_addr; // set server ack payload timestamp server_ack_payload.bundle_creation_ts = bundle_creation_timestamp; // preparing the bundle ack payload if ((debug) && (debug_level > 0)) printf("[debug] preparing the payload of the bundle ack..."); error = prepare_server_ack_payload(server_ack_payload, &bundle_ack_options, &pl_buffer, &pl_buffer_size); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in preparing the payload of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); // setting the bundle ack payload if ((debug) && (debug_level > 0)) printf("[debug] setting the payload of the bundle ack..."); // For DTN2 implementation ack payload in in memory if(perf_opt->bp_implementation == BP_DTN) { error = al_bp_bundle_set_payload_mem(&bundle_ack_object, pl_buffer, pl_buffer_size); } else if(perf_opt->bp_implementation == BP_ION) { char filename_ack[256]; int fd_ack; char * tmp,* tmp_eid; u32_t filename_ack_len; tmp_eid = (char *) malloc(sizeof(char) * strlen(bundle_source_addr.uri)+1); strcpy(tmp_eid,bundle_source_addr.uri); if( strncmp(bundle_source_addr.uri,"ipn",3) == 0) { strtok(tmp_eid,":"); tmp = strtok(NULL,":"); } else { strtok(tmp_eid, "/"); tmp = strtok(NULL, "/"); } sprintf(filename_ack,"%s_%s_%d",SOURCE_FILE_ACK,tmp,num_ack); filename_ack_len = strlen(filename_ack)+1; fd_ack = open(filename_ack,O_WRONLY|O_CREAT,0777); if(fd_ack < 0) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in creating the payload of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(write(fd_ack, pl_buffer, pl_buffer_size)<0){ fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in writing the payload of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } close(fd_ack); if (debug && debug_level > 0) { printf("\n[debug] bundle payload ack saved in: %s ... ", filename_ack); } num_ack++; error = al_bp_bundle_set_payload_file(&bundle_ack_object,filename_ack,filename_ack_len); free(tmp_eid); } if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "\n[DTNperf fatal error] in setting the payload of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); // setting the bundle ack options if (debug && debug_level > 0) { printf("[debug] setting source of the bundle ack: %s ...", local_eid.uri); } error = al_bp_bundle_set_source(& bundle_ack_object, local_eid); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in setting the source of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); if (debug && debug_level > 0) { printf("[debug] setting destination of the bundle ack: %s ...", bundle_source_addr.uri); } error = al_bp_bundle_set_dest(& bundle_ack_object, bundle_source_addr); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in setting the destination of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); if (debug && debug_level > 0) { printf("[debug] setting replyto eid of the bundle ack: %s ...", bundle_replyto_addr.uri); } error = al_bp_bundle_set_replyto(& bundle_ack_object, bundle_replyto_addr); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in setting the reply to eid of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); if (debug && debug_level > 0) { printf("[debug] setting priority of the bundle ack..."); } error = al_bp_bundle_set_priority(& bundle_ack_object, bundle_priority); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in setting priority of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); /**************************************************************/ bundle_ack_object.spec->priority.ordinal = 0; bundle_ack_object.spec->critical = FALSE; bundle_ack_object.spec->flow_label = 0; bundle_ack_object.spec->unreliable = FALSE; /**************************************************************/ if (debug && debug_level > 0) { printf("[debug] setting expiration time of the bundle ack..."); } error = al_bp_bundle_set_expiration(& bundle_ack_object, bundle_expiration); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in setting expiration time of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); if (debug && debug_level > 0) { printf("[debug] setting delivery options of the bundle ack..."); } //bundle_ack_dopts = BP_DOPTS_CUSTODY; bundle_ack_dopts = 0; al_bp_bundle_set_delivery_opts(& bundle_ack_object, bundle_ack_dopts); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in setting delivery options of the bundle ack: %s\n", al_bp_strerror(error)); server_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); // send the bundle ack to the client if (send_ack_to_client) { if ((debug) && (debug_level > 0)) printf("[debug] sending bundle ack to client..."); error = al_bp_bundle_send(handle, regid, & bundle_ack_object); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in sending bundle ack to client: %d (%s)\n", error, al_bp_strerror(al_bp_errno(handle))); server_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" bundle ack sent to client\n"); } printf("Send bundle to client ok\n"); // send the bundle ack to the monitor if (send_ack_to_monitor) { al_bp_bundle_set_dest(& bundle_ack_object, bundle_replyto_addr); if ((debug) && (debug_level > 0)) printf("[debug] sending bundle ack to monitor..."); error = al_bp_bundle_send(handle, regid, & bundle_ack_object); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in sending bundle ack to monitor: %d (%s)\n", error, al_bp_strerror(al_bp_errno(handle))); server_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" bundle ack sent to monitor\n"); } //free memory for bundle ack al_bp_bundle_free(&bundle_ack_object); free(pl_buffer); pl_buffer_size = 0; } // free memory for bundle al_bp_bundle_free(&bundle_object); free(pl_filename); pl_filename_len = 0; } }// while(1) al_bp_close(handle); //al_bp_unregister(handle,regid,local_eid); bp_handle_open = FALSE; } // end server code // file expiration timer thread void * file_expiration_timer(void * opt) { u32_t current_dtn_time; file_transfer_info_list_item_t * item, * next; while(1) { current_dtn_time = get_current_dtn_time(); pthread_mutex_lock(&mutexdata); for(item = file_transfer_info_list.first; item != NULL; item = next) { next = item->next; if (item->info->last_bundle_time + item->info->expiration < current_dtn_time) { char* filename = (char*) malloc(item->info->filename_len + strlen(item->info->full_dir) +1); strcpy(filename, item->info->full_dir); strcat(filename, item->info->filename); if (remove(filename) < 0) perror("[DTNperf error] in eliminating expired file:"); printf("Eliminated file %s because timer has expired\n", filename); file_transfer_info_list_item_delete(&file_transfer_info_list, item); free(filename); } } pthread_mutex_unlock(&mutexdata); sched_yield(); } pthread_exit(NULL); } void print_server_usage(char * progname) { fprintf(stderr, "\n"); fprintf(stderr, "dtnperf server mode\n"); fprintf(stderr, "SYNTAX: %s %s [options]\n", progname, SERVER_STRING); fprintf(stderr, "\n"); fprintf(stderr, "options:\n" " -a, --daemon Start the server as a daemon. Output is redirected to %s.\n" " -o, --output Change the default output file (only with -a option).\n" " -s, --stop Stop the server daemon.\n" " --ip-addr IP address of the BP daemon api. Default: 127.0.0.1\n" " --ip-port IP port of the BP daemon api. Default: 5010\n" " --force-eid <[DTN|IPN]> Force scheme of registration EID (ION only).\n" " --fdir Destination directory of files transferred. Default is %s .\n" " --debug[=level] Debug messages [1-2], if level is not indicated level = 2.\n" " -M, --memory Save received bundles into memory.\n" " -l, --lifetime Bundle ACKs lifetime (s). Default is 60.\n" " -p, --priority Bundle ACKs priority [bulk|normal|expedited|reserved]. Default: normal\n" " --acks-to-mon Send bundle ACKs in cc to the monitor.\n" " -v, --verbose Print some information message during the execution.\n" " -h, --help This help.\n", SERVER_OUTPUT_FILE, FILE_DIR_DEFAULT); fprintf(stderr, "\n"); exit(1); } void parse_server_options(int argc, char ** argv, dtnperf_global_options_t * perf_g_opt) { char c, done = 0; boolean_t output_set = FALSE; dtnperf_options_t * perf_opt = perf_g_opt->perf_opt; dtnperf_connection_options_t * conn_opt = perf_g_opt->conn_opt; // kill daemon variables int pid; char cmd[256]; while (!done) { static struct option long_options[] = { {"help", no_argument, 0, 'h'}, {"verbose", no_argument, 0, 'v'}, {"memory", no_argument, 0, 'M'}, {"lifetime", required_argument, 0, 'l'}, {"debug", optional_argument, 0, 33}, // 33 because D is for data mode {"priority", required_argument, 0, 'p'}, {"ddir", required_argument, 0, 34}, {"fdir", required_argument, 0, 39}, {"acks-to-mon", no_argument, 0, 35}, // server only option {"ip-addr", required_argument, 0, 37}, {"ip-port", required_argument, 0, 38}, {"force-eid", required_argument, 0, 50}, {"daemon", no_argument, 0, 'a'}, {"output", required_argument, 0, 'o'}, {"stop", no_argument, 0, 's'}, {0,0,0,0} // The last element of the array has to be filled with zeros. }; int option_index = 0; c = getopt_long(argc, argv, "hvMl:p:ao:s", long_options, &option_index); switch (c) { case 'h': print_server_usage(argv[0]); exit(0); return ; case 'v': perf_opt->verbose = TRUE; break; case 'M': perf_opt->use_file = 0; perf_opt->payload_type = BP_PAYLOAD_MEM; break; case 'l': conn_opt->expiration = atoi(optarg); break; case 'p': if (!strcasecmp(optarg, "bulk")) { conn_opt->priority.priority = BP_PRIORITY_BULK; } else if (!strcasecmp(optarg, "normal")) { conn_opt->priority.priority = BP_PRIORITY_NORMAL; } else if (!strcasecmp(optarg, "expedited")) { conn_opt->priority.priority = BP_PRIORITY_EXPEDITED; } else if (!strcasecmp(optarg, "reserved")) { conn_opt->priority.priority = BP_PRIORITY_RESERVED; } else { fprintf(stderr, "[DTNperf syntax error] Invalid priority value %s\n", optarg); exit(1); } break; case 33: // debug perf_opt->debug = TRUE; if (optarg != NULL){ int debug_level = atoi(optarg); if (debug_level >= 1 && debug_level <= 2) perf_opt->debug_level = atoi(optarg) - 1; else { fprintf(stderr, "[DTNperf syntax error] wrong --debug argument\n"); exit(1); return; } } else perf_opt->debug_level = 2; break; case 34: //incoming bundles destination directory perf_opt->dest_dir = strdup(optarg); break; case 35: //server send acks to monitor perf_opt->acks_to_mon = TRUE; break; case 36: //server do not send acks perf_opt->no_acks = TRUE; break; case 37: if(perf_opt->bp_implementation != BP_DTN) { fprintf(stderr, "[DTNperf error] --ip-addr supported only in DTN2\n"); exit(1); return; } perf_opt->ip_addr = strdup(optarg); perf_opt->use_ip = TRUE; break; case 38: if(perf_opt->bp_implementation != BP_DTN) { fprintf(stderr, "[DTNperf error] --ip-port supported only in DTN2\n"); exit(1); return; } perf_opt->ip_port = atoi(optarg); perf_opt->use_ip = TRUE; break; case 39: perf_opt->file_dir = strdup(optarg); break; case 50: if(perf_opt->bp_implementation != BP_ION) { fprintf(stderr, "[DTNperf error] --force-eid supported only in ION\n"); exit(1); return; } switch( find_forced_eid(strdup(optarg)) ) { case 'D': perf_opt->eid_format_forced = 'D'; break; case 'I': perf_opt->eid_format_forced = 'I'; break; case '?': fprintf(stderr, "[DTNperf syntax error] wrong --force-eid argument\n"); exit(1); } break; case 'a': perf_opt->daemon = TRUE; break; case 'o': perf_opt->server_output_file = strdup(optarg); output_set = TRUE; break; case 's': memset(cmd, 0, sizeof(cmd)); sprintf(cmd, "%s %s", argv[0], SERVER_STRING); pid = find_proc(cmd); if (pid) { printf("Closing dtnperf server pid: %d\n", pid); kill(pid, SIGINT); } else { fprintf(stderr, "[DTNperf error] cannot find a running instance of dtnperf server\n"); } exit(0); break; case '?': fprintf(stderr, "[DTNperf error] unknown option: %c\n", optopt); exit(1); break; case (char)(-1): done = 1; break; default: // getopt already prints an error message for unknown option characters print_server_usage(argv[0]); exit(1); } } if (output_set && !perf_opt->daemon) { fprintf(stderr, "\n[DTNperf syntax error] -o option can be used only with -a option\n"); \ print_server_usage(argv[0]); \ exit(1); } } // Ctrl+C handler void server_handler(int sig) { printf("\nDTNperf server received SIGINT: Exiting\n"); server_clean_exit(0); } void server_clean_exit(int status) { file_transfer_info_list_item_t * item; // terminate immediately all child threads pthread_cancel(file_exp_timer); // delete all incomplete files for(item = file_transfer_info_list.first; item != NULL; item = item->next) { char* filename = (char*) malloc(item->info->filename_len + strlen(item->info->full_dir) +1); strcpy(filename, item->info->full_dir); strcat(filename, item->info->filename); if (remove(filename) < 0) perror("[DTNperf error] in eliminating incomplete file:"); printf("Eliminated file %s because incomplete\n", filename); file_transfer_info_list_item_delete(&file_transfer_info_list, item); free(filename); } if (bp_handle_open) { al_bp_close(handle); //al_bp_unregister(handle,regid,local_eid); } printf("DTNperf server: Exit.\n"); exit(status); } ion-open-source/contrib/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.h0000644000175000017500000000430412356652303030004 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * dtnperf_monitor.h */ #ifndef DTNPERF_MONITOR_H_ #define DTNPERF_MONITOR_H_ #include "../dtnperf_types.h" #include typedef struct monitor_parameters { dtnperf_global_options_t * perf_g_opt; boolean_t dedicated_monitor; int client_id; } monitor_parameters_t; typedef enum { NONE, STATUS_REPORT, SERVER_ACK, CLIENT_STOP, CLIENT_FORCE_STOP } bundle_type_t; typedef struct session { al_bp_endpoint_id_t client_eid; char * full_filename; FILE * file; struct timeval * start; u32_t last_bundle_time; // secs of bp creation timestamp u32_t expiration; int delivered_count; int total_to_receive; struct timeval * stop_arrival_time; u32_t wait_after_stop; struct session * next; struct session * prev; long int wrong_crc; }session_t; typedef struct session_list { session_t * first; session_t * last; int count; }session_list_t; session_list_t * session_list_create(); void session_list_destroy(session_list_t * list); session_t * session_create(al_bp_endpoint_id_t client_eid, char * full_filename, FILE * file, struct timeval start, u32_t bundle_timestamp_secs, u32_t bundle_expiration_time); void session_destroy(session_t * session); void session_put(session_list_t * list, session_t * session); session_t * session_get(session_list_t * list, al_bp_endpoint_id_t client); void session_del(session_list_t * list, session_t * session); void session_close(session_list_t * list, session_t * session); void run_dtnperf_monitor(monitor_parameters_t * parameters); //session expiration timer thread void * session_expiration_timer(void * opt); void print_monitor_usage(char* progname); void parse_monitor_options(int argc, char ** argv, dtnperf_global_options_t * perf_g_opt); void monitor_clean_exit(int status); void monitor_handler(int signo); #endif /* DTNPERF_MONITOR_H_ */ ion-open-source/contrib/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_server.h0000644000175000017500000000172012356652303027622 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * dtnperf_server.h */ #ifndef DTNPERF_SERVER_H_ #define DTNPERF_SERVER_H_ #include "../dtnperf_types.h" #include "../bundle_tools.h" #include void run_dtnperf_server(dtnperf_global_options_t * global_options ); // file expiration timer thread void * file_expiration_timer(void * opt); void print_server_usage(char* progname); void parse_server_options(int argc, char ** argv, dtnperf_global_options_t * perf_g_opt); // Ctrl+C handler void server_handler(int signo); void server_clean_exit(int status); #endif /* DTNPERF_SERVER_H_ */ ion-open-source/contrib/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_monitor.c0000644000175000017500000006436012356652303030007 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * dtnperf_monitor.c */ #include #include "dtnperf_monitor.h" #include "../includes.h" #include "../utils.h" #include "../bundle_tools.h" #include "../csv_tools.h" /* * Global Variables */ // pthread variables pthread_t session_exp_timer; pthread_mutex_t mutexdata; session_list_t * session_list; al_bp_handle_t handle; al_bp_reg_id_t regid; al_bp_endpoint_id_t local_eid; // flags to exit cleanly boolean_t dedicated_monitor; boolean_t bp_handle_open; /* ---------------------------- * MONITOR CODE * ---------------------------- */ void run_dtnperf_monitor(monitor_parameters_t * parameters) { /* ------------------------ * variables * ------------------------ */ dtnperf_options_t * perf_opt = parameters->perf_g_opt->perf_opt; al_bp_error_t error; al_bp_reg_info_t reginfo; al_bp_bundle_object_t bundle_object; al_bp_bundle_status_report_t * status_report; al_bp_endpoint_id_t bundle_source_addr; al_bp_timestamp_t bundle_creation_timestamp; al_bp_timeval_t bundle_expiration; al_bp_endpoint_id_t relative_source_addr; al_bp_timestamp_t relative_creation_timestamp; HEADER_TYPE bundle_header; session_t * session; bundle_type_t bundle_type; struct timeval current, start; // struct stat file_stat; char * command; char temp[256]; char * filename; int filename_len; char * full_filename; FILE * file; uint32_t extension_ack; // int stat_res; /* ------------------------ * initialize variables * ------------------------ */ boolean_t debug = perf_opt->debug; int debug_level = perf_opt->debug_level; dedicated_monitor = parameters->dedicated_monitor; bp_handle_open = FALSE; perf_opt->logs_dir = correct_dirname(perf_opt->logs_dir); status_report = NULL; session_list = session_list_create(); // set out buffer size if daemon if (perf_opt->daemon) { setlinebuf(stdout); setlinebuf(stderr); } // create dir where dtnperf monitor will save logs // command should be: mkdir -p "logs_dir" if(debug && debug_level > 0) printf("[debug] initializing shell command..."); command = malloc(sizeof(char) * (10 + strlen(perf_opt->logs_dir))); sprintf(command, "mkdir -p %s", perf_opt->logs_dir); if(debug && debug_level > 0) printf("done. Shell command = %s\n", command); // execute shell command if(debug && debug_level > 0) printf("[debug] executing shell command..."); if (system(command) < 0) { perror("[DTNperf fatal error] in opening monitor logs dir"); monitor_clean_exit(-1); } free(command); if(debug && debug_level > 0) printf("done\n"); // signal handlers signal(SIGINT, monitor_handler); signal(SIGUSR1, monitor_handler); signal(SIGUSR2, monitor_handler); //open the connection to the bundle protocol router if(debug && debug_level > 0) printf("[debug] opening connection to bundle protocol router..."); if (perf_opt->use_ip) error = al_bp_open_with_ip(perf_opt->ip_addr, perf_opt->ip_port, &handle); else error = al_bp_open(&handle); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in opening bp handle: %s\n", al_bp_strerror(error)); monitor_clean_exit(1); } else { bp_handle_open = TRUE; } if(debug && debug_level > 0) printf("done\n"); //build a local eid if (parameters->dedicated_monitor) sprintf(temp, "%s_%d", MON_EP_STRING, parameters->client_id); else sprintf(temp, "%s", MON_EP_STRING); if( perf_opt->eid_format_forced == 'D' || perf_opt->eid_format_forced == 'I') { if(debug && debug_level > 0) { printf("[debug] building local eid in format "); perf_opt->eid_format_forced == 'D' ? printf("DTN...") : printf("IPN..."); } if(perf_opt->eid_format_forced == 'I') al_bp_build_local_eid(handle, &local_eid, MON_EP_NUM_SERVICE,"Monitor-CBHE",NULL); else { if(parameters->dedicated_monitor) al_bp_build_local_eid(handle, &local_eid, temp,"Monitor-DTN",NULL); else al_bp_build_local_eid(handle, &local_eid, MON_EP_STRING,"Monitor-DTN",NULL); } } else { if(debug && debug_level > 0) printf("[debug] building a local eid..."); if(perf_opt->bp_implementation == BP_ION) al_bp_build_local_eid(handle, &local_eid, MON_EP_NUM_SERVICE,"Monitor-CBHE",NULL); if(perf_opt->bp_implementation == BP_DTN) al_bp_build_local_eid(handle, &local_eid, MON_EP_STRING,"Monitor-DTN",NULL); } if(debug && debug_level > 0) printf("done\n"); if (debug) printf("local_eid = %s\n", local_eid.uri); // checking if there is already a registration if(debug && debug_level > 0) printf("[debug] checking for existing registration..."); error = al_bp_find_registration(handle, &local_eid, ®id); if ( (error == BP_SUCCESS && perf_opt->bp_implementation == BP_DTN) || (perf_opt->bp_implementation == BP_ION && (error == BP_EBUSY || error == BP_EPARSEEID))) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] existing a registration with the same eid.\n"); fprintf(stderr, "regid 0x%x\n", (unsigned int) regid); monitor_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" done\n"); //create a new registration to the local router based on this eid if(debug && debug_level > 0) printf("[debug] registering to local daemon..."); memset(®info, 0, sizeof(reginfo)); al_bp_copy_eid(®info.endpoint, &local_eid); reginfo.flags = BP_REG_DEFER; reginfo.regid = BP_REGID_NONE; reginfo.expiration = 0; if ((error = al_bp_register(&handle, ®info, ®id)) != 0) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in creating registration: %d (%s)\n", error, al_bp_strerror(al_bp_errno(handle))); monitor_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" done\n"); if (debug) printf("regid 0x%x\n", (unsigned int) regid); // start expiration timer thread pthread_mutex_init (&mutexdata, NULL); pthread_create(&session_exp_timer, NULL, session_expiration_timer, (void *) parameters); // start infinite loop while(1) { // reset variables bundle_type = NONE; // create a bundle object if ((debug) && (debug_level > 0)) printf("[debug] initiating memory for bundles...\n"); error = al_bp_bundle_create(&bundle_object); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in initiating memory for bundles: %s\n", al_bp_strerror(error)); monitor_clean_exit(1); } if(debug && debug_level > 0) printf("done\n"); // wait until receive a bundle if ((debug) && (debug_level > 0)) printf("[debug] waiting for bundles...\n"); error = al_bp_bundle_receive(handle, bundle_object, BP_PAYLOAD_MEM, -1); if(error == BP_ERECVINT || error == BP_ETIMEOUT) { if(error == BP_ERECVINT ) fprintf(stderr, "[DTNperf warning] bundle reception interrupted\n"); if(error == BP_ETIMEOUT ) fprintf(stderr, "[DTNperf warning] bundle reception timeout expired\n"); // free memory for bundle al_bp_bundle_free(&bundle_object); } else { if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in getting recv reply: %d (%s)\n", error, al_bp_strerror(al_bp_errno(handle))); monitor_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" bundle received\n"); // mark current time if ((debug) && (debug_level > 0)) printf("[debug] marking time..."); gettimeofday(¤t, NULL); if ((debug) && (debug_level > 0)) printf(" done\n"); // get SOURCE eid if ((debug) && (debug_level > 0)) printf("[debug]\tgetting source eid..."); error = al_bp_bundle_get_source(bundle_object, &bundle_source_addr); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in getting bundle source eid: %s\n", al_bp_strerror(error)); monitor_clean_exit(1); } if ((debug) && (debug_level > 0)) { printf(" done:\n"); printf("\tbundle_source_addr = %s\n", bundle_source_addr.uri); printf("\n"); } // get bundle CREATION TIMESTAMP if ((debug) && (debug_level > 0)) printf("[debug]\tgetting bundle creation timestamp..."); error = al_bp_bundle_get_creation_timestamp(bundle_object, &bundle_creation_timestamp); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in getting bundle creation timestamp: %s\n", al_bp_strerror(error)); monitor_clean_exit(1); } if ((debug) && (debug_level > 0)) { printf(" done:\n"); printf("\tbundle creation timestamp:\n" "\tsecs = %d\n\tseqno= %d\n", (int)bundle_creation_timestamp.secs, (int)bundle_creation_timestamp.seqno); printf("\n"); } // get bundle EXPIRATION TIME only in DTN2 if(perf_opt->bp_implementation == BP_DTN) { if ((debug) && (debug_level > 0)) printf("[debug]\tgetting bundle expiration time..."); error = al_bp_bundle_get_expiration(bundle_object, &bundle_expiration); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in getting bundle expiration time: %s\n", al_bp_strerror(error)); monitor_clean_exit(1); } if ((debug) && (debug_level > 0)) { printf(" done:\n"); printf("\tbundle expiration: %lu\n", bundle_expiration); printf("\n"); } } // check if bundle is a status report if ((debug) && (debug_level > 0)) printf("[debug] check if bundle is a status report...\n"); error = al_bp_bundle_get_status_report(bundle_object, &status_report); if (error != BP_SUCCESS) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in checking if bundle is a status report: %d (%s)\n", error, al_bp_strerror(al_bp_errno(handle))); continue; } if ((debug) && (debug_level > 0)) printf(" %s\n", status_report == NULL ? "no" : "yes"); // check for other bundle types if (status_report != NULL) bundle_type = STATUS_REPORT; else { get_bundle_header_and_options(&bundle_object, & bundle_header, NULL); if (bundle_header == FORCE_STOP_HEADER) bundle_type = CLIENT_FORCE_STOP; else if (bundle_header == STOP_HEADER) bundle_type = CLIENT_STOP; else if (bundle_header == DSA_HEADER) bundle_type = SERVER_ACK; else // unknown bundle type { fprintf(stderr, "[DTNperf warning] unknown bundle type\n"); continue; } } // retrieve or open log file pthread_mutex_lock(&mutexdata); session = NULL; extension_ack=0; switch (bundle_type) { case STATUS_REPORT: al_bp_copy_eid(&relative_source_addr, &(status_report->bundle_id.source)); relative_creation_timestamp = status_report->bundle_id.creation_ts; break; case SERVER_ACK: get_info_from_ack(&bundle_object, &relative_source_addr, &relative_creation_timestamp, &extension_ack); break; case CLIENT_STOP: case CLIENT_FORCE_STOP: al_bp_copy_eid(&relative_source_addr, &bundle_source_addr); relative_creation_timestamp = bundle_creation_timestamp; break; default: break; } session = session_get(session_list, relative_source_addr); if (session == NULL) // start a new session { // mark start time start = current; //if source eid of Status Report is CBHE Format if(strncmp(relative_source_addr.uri,"ipn",3) == 0) { filename_len = strlen(relative_source_addr.uri) - strlen("ipn:") + 15; } else { filename_len = strlen(relative_source_addr.uri) - strlen("dtn://") + 15; } filename = (char *) malloc(filename_len); memset(filename, 0, filename_len); sprintf(filename, "%lu_", relative_creation_timestamp.secs); strncpy(temp, relative_source_addr.uri, strlen(relative_source_addr.uri) + 1); if(strncmp(relative_source_addr.uri,"ipn",3) == 0) { strtok(temp, ":"); strcat(filename, strtok(NULL, "\0")); } else { char * ptr; strtok(temp, "/"); strcat(filename, strtok(NULL, "/")); // remove .dtn suffix from the filename ptr = strstr(filename, ".dtn"); if (ptr != NULL) ptr[0] = '\0'; } strcat(filename, ".csv"); full_filename = (char *) malloc(strlen(perf_opt->logs_dir) + strlen(filename) + 2); sprintf(full_filename, "%s/%s", perf_opt->logs_dir, filename); file = fopen(full_filename, "w"); session = session_create(relative_source_addr, full_filename, file, start, relative_creation_timestamp.secs, bundle_expiration); session_put(session_list, session); // write header in csv log file fprintf(file,"RX_TIME;Report_SRC;Report_TST;Report_SQN;" "Report_Type;Bndl_SRC;Bndl_TST;Bndl_SQN;" "Bndl_FO;Bndl_FL;"); csv_print_status_report_timestamps_header(file); csv_print(file, "CRC"); csv_end_line(file); session->wrong_crc=0; } // update session infos session->last_bundle_time = bundle_creation_timestamp.secs; if(perf_opt->bp_implementation == BP_ION) { session->expiration = perf_opt->expiration_session; } else { if(perf_opt->expiration_session > bundle_expiration) session->expiration = bundle_expiration; } file = session->file; memcpy(&start, session->start, sizeof(struct timeval)); if (bundle_type == STATUS_REPORT && (status_report->flags & BP_STATUS_DELIVERED)) { session->delivered_count++; } if (bundle_type == SERVER_ACK) { if (extension_ack & BO_CRC_ENABLED) session->wrong_crc++; } pthread_mutex_unlock(&mutexdata); // print rx time in csv log csv_print_rx_time(file, current, start); // print bundle source in csv log csv_print_eid(file, bundle_source_addr); //print bundle creation timestamp in csv log csv_print_timestamp(file, bundle_creation_timestamp); // print bundle type in csv log switch (bundle_type) { case CLIENT_STOP: csv_print(file, "CLIENT_STOP"); break; case CLIENT_FORCE_STOP: csv_print(file, "CLIENT_FORCE_STOP"); break; case SERVER_ACK: csv_print(file, "SERVER_ACK"); break; case STATUS_REPORT: csv_print(file, "STATUS_REPORT"); break; default: csv_print(file, "UNKNOWN"); break; } // print relative source and timestamp if (bundle_type == SERVER_ACK || bundle_type == STATUS_REPORT) { csv_print_eid(file, relative_source_addr); csv_print_timestamp(file, relative_creation_timestamp); } else csv_print(file, " ; ;"); // print status report infos in csv log if (bundle_type == STATUS_REPORT) { csv_print_ulong(file, status_report->bundle_id.frag_offset); csv_print_ulong(file, status_report->bundle_id.orig_length); csv_print_status_report_timestamps(file, * status_report); } else csv_print(file, " ; ; ; ; ; ; ; ;"); if (bundle_type == SERVER_ACK) { if (extension_ack & BO_CRC_ENABLED) csv_print(file, "1;"); else csv_print(file, "0;"); } else csv_print(file, " ;"); // end line in csv log csv_end_line(file); // close file if (bundle_type == CLIENT_STOP) { int total_to_receive; get_info_from_stop(&bundle_object, &total_to_receive); pthread_mutex_lock(&mutexdata); session->total_to_receive = total_to_receive; if(perf_opt->bp_implementation == BP_ION) session->wait_after_stop = 60; else session->wait_after_stop = bundle_expiration; gettimeofday(session->stop_arrival_time, NULL); pthread_mutex_unlock(&mutexdata); } else if (bundle_type == CLIENT_FORCE_STOP) { printf("DTNperf monitor: received forced end session bundle\n"); session_close(session_list, session); } } } // end loop session_list_destroy(session_list); al_bp_close(handle); if(parameters->dedicated_monitor == TRUE) al_bp_unregister(handle,regid,local_eid); bp_handle_open = FALSE; } // end monitor code // session expiration timer thread void * session_expiration_timer(void * opt) { u32_t current_dtn_time; struct timeval current_time; session_t * session, * next; while(1) { current_dtn_time = get_current_dtn_time(); gettimeofday(¤t_time, NULL); pthread_mutex_lock(&mutexdata); for(session = session_list->first; session != NULL; session = next) { next = session->next; // all status reports has been received: close session if (session->total_to_receive > 0 && session->delivered_count == session->total_to_receive) { // close monitor if dedicated if (dedicated_monitor) { kill(getpid(), SIGUSR2); } else { session_close(session_list, session); } } // stop bundle arrived but not all the status reports have arrived and the timer has expired else if (session->total_to_receive > 0 &&session->stop_arrival_time->tv_sec + session->wait_after_stop < current_time.tv_sec) { fprintf(stdout, "DTNperf monitor: Session Expired: Bundle stop arrived, but not all the status reports did\n"); // close monitor if dedicated if (dedicated_monitor) { kill(getpid(), SIGUSR2); } else { fprintf(stdout, "\tsaved log file: %s\n\n", session->full_filename); if (fclose(session->file) < 0) perror("[DTNperf warning] closing expired file:"); session_del(session_list, session); } } // stop bundle is not yet arrived and the last bundle has expired else if (session->last_bundle_time + session->expiration + 2 < current_dtn_time && (session->last_bundle_time + session->expiration != 0)) { fprintf(stdout, "DTNperf monitor: Session Expired: Bundle stop did not arrive\n"); // close monitor if dedicated if (dedicated_monitor) { kill(getpid(), SIGUSR2); } else { fprintf(stdout,"\tsaved log file: %s\n\n", session->full_filename); if (fclose(session->file) < 0) perror("[DTNperf warning] closing expired file:"); session_del(session_list, session); } } } pthread_mutex_unlock(&mutexdata); sched_yield(); } pthread_exit(NULL); } void monitor_clean_exit(int status) { session_t * session; // terminate all child thread pthread_cancel(session_exp_timer); // close all log files and delete all sessions if (dedicated_monitor) { session = session_list->first; session_close(session_list, session); } else { while (session_list->first != NULL) { session = session_list->first; session_close(session_list, session); } } session_list_destroy(session_list); // close bp_handle if (bp_handle_open) { al_bp_close(handle); //al_bp_unregister(handle,regid,local_eid); } printf("Dtnperf Monitor: exit.\n"); exit(status); } void session_close(session_list_t * list, session_t * session) { fclose(session->file); fprintf(stdout, "DTNperf monitor: saved log file: %s\n\n", session->full_filename); session_del(session_list, session); } void print_monitor_usage(char * progname) { fprintf(stderr, "\n"); fprintf(stderr, "DtnPerf3 monitor mode\n"); fprintf(stderr, "SYNTAX: %s %s [options]\n", progname, MONITOR_STRING); fprintf(stderr, "\n"); fprintf(stderr, "options:\n" " -a, --daemon Start the monitor as a daemon. Output is redirected to %s.\n" " -o, --output Change the default output file (Only with -a option).\n" " -s, --stop Stop the monitor daemon.\n" " -e, --session-expiration Max idle time of log files (s). Default: 120.\n" " --ip-addr Ip address of the bp daemon api. Default: 127.0.0.1 (DTN2 only)\n" " --ip-port Ip port of the bp daemon api. Default: 5010 (DTN2 only)\n" " --force-eid <[DTN|IPN] Force scheme of registration EID. (ION only)\n" " --ldir Logs directory. Default: %s .\n" " --debug[=level] Debug messages [0-1], if level is not indicated level = 1.\n" " -v, --verbose Print some information message during the execution.\n" " -h, --help This help.\n", MONITOR_OUTPUT_FILE, LOGS_DIR_DEFAULT); fprintf(stderr, "\n"); exit(1); } void parse_monitor_options(int argc, char ** argv, dtnperf_global_options_t * perf_g_opt) { char c, done = 0; boolean_t output_set = FALSE; dtnperf_options_t * perf_opt = perf_g_opt->perf_opt; // kill daemon variables int pid; char cmd[256]; while (!done) { static struct option long_options[] = { {"help", no_argument, 0, 'h'}, {"verbose", no_argument, 0, 'v'}, {"debug", optional_argument, 0, 33}, {"ldir", required_argument, 0, 40}, {"ip-addr", required_argument, 0, 37}, {"ip-port", required_argument, 0, 38}, {"force-eid", required_argument, 0, 51}, {"session-expiration", required_argument, 0,'e'}, {"daemon", no_argument, 0, 'a'}, {"output", required_argument, 0, 'o'}, {"stop", no_argument, 0, 's'}, {0,0,0,0} // The last element of the array has to be filled with zeros. }; int option_index = 0; c = getopt_long(argc, argv, "hvao:s", long_options, &option_index); switch (c) { case 'h': print_monitor_usage(argv[0]); exit(0); return ; case 'v': perf_opt->verbose = TRUE; break; case 'e': perf_opt->expiration_session = atoi(optarg); break; case 33: // debug perf_opt->debug = TRUE; if (optarg != NULL){ int debug_level = atoi(optarg); if (debug_level >= 1 && debug_level <= 2) perf_opt->debug_level = atoi(optarg) -1; else { fprintf(stderr, "[DTNperf syntax error] wrong --debug argument\n"); exit(1); return; } } else perf_opt->debug_level = 2; break; case 37: if(perf_opt->bp_implementation != BP_DTN) { fprintf(stderr, "[DTNperf error] --ip-addr supported only in DTN2\n"); exit(1); return; } perf_opt->ip_addr = strdup(optarg); perf_opt->use_ip = TRUE; break; case 38: if(perf_opt->bp_implementation != BP_DTN) { fprintf(stderr, "[DTNperf syntax error] --ip-port supported only in DTN2\n"); exit(1); return; } perf_opt->ip_port = atoi(optarg); perf_opt->use_ip = TRUE; break; case 40: perf_opt->logs_dir = strdup(optarg); break; case 51: if(perf_opt->bp_implementation != BP_ION) { fprintf(stderr, "[DTNperf error] --force-eid supported only in ION\n"); exit(1); return; } switch( find_forced_eid(strdup(optarg)) ) { case 'D': perf_opt->eid_format_forced = 'D'; break; case 'I': perf_opt->eid_format_forced = 'I'; break; case '?': fprintf(stderr, "[DTNperf syntax error] wrong --force-eid argument\n"); exit(1); } break; case 'a': perf_opt->daemon = TRUE; break; case 'o': perf_opt->monitor_output_file = strdup(optarg); output_set = TRUE; break; case 's': memset(cmd, 0, sizeof(cmd)); sprintf(cmd, "%s %s", argv[0], MONITOR_STRING); pid = find_proc(cmd); if (pid) { printf("Closing dtnperf monitor pid: %d\n", pid); kill(pid, SIGINT); } else { fprintf(stderr, "[DTNperf error] cannot find a running instance of dtnperf monitor\n"); } exit(0); break; case '?': break; case (char)(-1): done = 1; break; default: // getopt already prints an error message for unknown option characters print_monitor_usage(argv[0]); exit(1); } } if (output_set && !perf_opt->daemon) { fprintf(stderr, "\n[DTNperf syntax error] -o option can be used only with -a option\n"); \ print_monitor_usage(argv[0]); \ exit(1); } } session_list_t * session_list_create() { session_list_t * list; list = (session_list_t *) malloc(sizeof(session_list_t)); list->first = NULL; list->last = NULL; list->count = 0; return list; } void session_list_destroy(session_list_t * list) { free(list); } session_t * session_create(al_bp_endpoint_id_t client_eid, char * full_filename, FILE * file, struct timeval start, u32_t bundle_timestamp_secs, u32_t bundle_expiration_time) { session_t * session; session = (session_t *) malloc(sizeof(session_t)); session->start = (struct timeval *) malloc(sizeof(struct timeval)); session->stop_arrival_time = (struct timeval *) malloc(sizeof(struct timeval)); al_bp_copy_eid(&(session->client_eid), &client_eid); session->full_filename = strdup(full_filename); session->file = file; memcpy(session->start, &start, sizeof(struct timeval)); session->last_bundle_time = bundle_timestamp_secs; session->expiration = bundle_expiration_time; session->delivered_count = 0; session->total_to_receive = 0; session->wait_after_stop = 0; session->next = NULL; session->prev = NULL; return session; } void session_destroy(session_t * session) { free(session->start); free(session->stop_arrival_time); free(session->full_filename); free(session); } void session_put(session_list_t * list, session_t * session) { if (list->first == NULL) // empty list { list->first = session; list->last = session; } else { session->prev = list->last; list->last->next = session; list->last = session; } list->count ++; } session_t * session_get(session_list_t * list, al_bp_endpoint_id_t client) { session_t * item = list->first; while (item != NULL) { if (strcmp(item->client_eid.uri, client.uri) == 0) { return item; } item = item->next; } return NULL; } void session_del(session_list_t * list, session_t * session) { if (session->next == NULL && session->prev == NULL) // unique element of the list { list->first = NULL; list->last = NULL; } else if (session->next == NULL) // last item of list { list->last = session->prev; session->prev->next = NULL; } else if (session->prev == NULL) // first item of the list { list->first = session->next; session->next->prev = NULL; } else // generic element of list { session->next->prev = session->prev; session->prev->next = session->next; } session_destroy(session); list->count --; } void monitor_handler(int signo) { if (dedicated_monitor) { if (signo == SIGUSR1) { printf("\nDtnperf monitor: received signal from client. Exiting\n"); monitor_clean_exit(0); } else if (signo == SIGUSR2) { monitor_clean_exit(0); } } else { if (signo == SIGINT) { printf("\nDtnperf monitor: received SIGINT. Exiting\n"); monitor_clean_exit(0); } } } ion-open-source/contrib/dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c0000644000175000017500000020145412356652303027573 0ustar jschendejschende/******************************************************** ** Authors: Michele Rodolfi, michele.rodolfi@studio.unibo.it ** Anna d'Amico, anna.damico@studio.unibo.it ** Carlo Caini (DTNperf_3 project supervisor), carlo.caini@unibo.it ** ** ** Copyright (c) 2013, Alma Mater Studiorum, University of Bologna ** All rights reserved. ********************************************************/ /* * dtnperf_client.c */ #define _GNU_SOURCE #include "dtnperf_client.h" #include "dtnperf_monitor.h" #include "../includes.h" #include "../definitions.h" #include "../bundle_tools.h" #include "../file_transfer_tools.h" #include "../utils.h" #include #include #include #include /* pthread_yield() is not standard, so use sched_yield if necessary */ #ifndef HAVE_PTHREAD_YIELD # ifdef HAVE_SCHED_YIELD # include # define pthread_yield sched_yield # endif #endif // pthread variables pthread_t sender; pthread_t cong_ctrl; pthread_t cong_expir_timer; pthread_t wait_for_signal; pthread_mutex_t mutexdata; pthread_cond_t cond_ackreceiver; sem_t window; // semaphore for congestion control int monitor_status; int monitor_pid; // variables of client threads send_information_t * send_info; // array info of sent bundles long tot_bundles; // for data mode struct timeval start, end, now; // time variables struct timeval bundle_sent, ack_recvd; // time variables int sent_bundles = 0; // sent bundles counter unsigned int sent_data = 0; // sent byte counter int close_ack_receiver = 0; // to signal the ack receiver to close unsigned int data_written = 0; // num of bytes written on the source file long int wrong_crc; boolean_t process_interrupted; boolean_t expir_timer_cong_window; FILE * log_file = NULL; char source_file[256]; // complete name of source file: SOURCE_FILE_pid[_numBundle] char * transfer_filename; // basename of the file to transfer u32_t transfer_filedim; // size of the file to transfer int transfer_fd; // file descriptor // flags to exit cleanly boolean_t bp_handle_open; boolean_t log_open; boolean_t source_file_created; boolean_t dedicated_monitor; // if client must start a dedicated monitor // buffer settings char* buffer = NULL; // buffer containing data to be transmitted size_t bufferLen; // lenght of buffer // BP variables al_bp_error_t error; al_bp_handle_t handle; al_bp_reg_id_t regid; al_bp_reg_info_t reginfo; al_bp_bundle_id_t * bundle_id; al_bp_endpoint_id_t local_eid; al_bp_endpoint_id_t dest_eid; al_bp_endpoint_id_t mon_eid; al_bp_bundle_object_t bundle; char ** file_bundle_names; al_bp_bundle_object_t ack; dtnperf_options_t * perf_opt; dtnperf_connection_options_t * conn_opt; extension_block_info_t * ext_blocks; static u_int num_meta_blocks = 0; static u_int num_ext_blocks = 0; /* ---------------------------- * CLIENT CODE * ---------------------------- */ void run_dtnperf_client(dtnperf_global_options_t * perf_g_opt) { /* ------------------------ * variables * ------------------------ */ char * client_demux_string; int pthread_status; char temp1[256]; // buffer for various purpose char temp2[256]; // FILE * stream; // stream for preparing payolad al_bp_bundle_object_t bundle_stop; monitor_parameters_t mon_params; void * ext_buf; void * meta_buf; al_bp_extension_block_t * ext_bp; al_bp_extension_block_t * meta_bp; /* ------------------------ * initialize variables * ------------------------ */ perf_opt = perf_g_opt->perf_opt; conn_opt = perf_g_opt->conn_opt; boolean_t debug = perf_opt->debug; int debug_level = perf_opt->debug_level; boolean_t verbose = perf_opt->verbose; boolean_t create_log = perf_opt->create_log; log_open = FALSE; bp_handle_open = FALSE; source_file_created = FALSE; tot_bundles = 0; process_interrupted = FALSE; wrong_crc = 0; perf_opt->log_filename = correct_dirname(perf_opt->log_filename); // Create a new log file if (create_log) { if ((log_file = fopen(perf_opt->log_filename, "w")) == NULL) { fprintf(stderr, "[DTNperf fatal error] in opening log file\n"); client_clean_exit(1); } log_open = TRUE; } // Connect to BP Daemon if ((debug) && (debug_level > 0)) printf("[debug] opening connection to local BP daemon..."); if (perf_opt->use_ip) error = al_bp_open_with_ip(perf_opt->ip_addr,perf_opt->ip_port,&handle); else error = al_bp_open(&handle); if (error != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in opening BP handle: %s\n", al_bp_strerror(error)); if (create_log) fprintf(log_file, "[DTNperf fatal error] in opening BP handle: %s\n", al_bp_strerror(error)); client_clean_exit(1); } else { bp_handle_open = TRUE; } if ((debug) && (debug_level > 0)) printf("done\n"); // Ctrl+C handler signal(SIGINT, &client_handler); /* ----------------------------------------------------- * initialize and parse bundle src/dest/replyto EIDs * ----------------------------------------------------- */ // append process id to the client demux string client_demux_string = malloc (strlen(CLI_EP_STRING) + 10); sprintf(client_demux_string, "%s_%d", CLI_EP_STRING, getpid()); // parse SERVER EID // if the scheme is not "ipn" append server demux string to destination eid if(strncmp(perf_opt->dest_eid,"ipn",3) != 0) strcat(perf_opt->dest_eid, SERV_EP_STRING); if (verbose) fprintf(stdout, "%s (local)\n", perf_opt->dest_eid); // parse error = al_bp_parse_eid_string(&dest_eid, perf_opt->dest_eid); if (error != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in parsing BP EID: invalid eid string '%s'\n", perf_opt->dest_eid); if (create_log) fprintf(log_file, "\n[DTNperf fatal error] in parsing BP EID: invalid eid string '%s'", perf_opt->dest_eid); client_clean_exit(1); } if (debug) printf("Destination: %s\n", dest_eid.uri); if (create_log) fprintf(log_file, "Destination: %s\n", dest_eid.uri); //build a local EID if(debug && debug_level > 0) printf("[debug] building a local eid..."); al_bp_build_local_eid(handle, &local_eid,client_demux_string,"Client",dest_eid.uri); if(debug && debug_level > 0) printf("done\n"); if (debug) printf("Source : %s\n", local_eid.uri); if (create_log) fprintf(log_file, "\nSource : %s\n", local_eid.uri); // parse REPLY-TO (if not specified, the same as the source) if (strlen(perf_opt->mon_eid) == 0) { //if the scheme is not "ipn" copy from local EID only the URI (not the demux string) if(strncmp(dest_eid.uri,"ipn",3) != 0 || perf_opt->bp_implementation == BP_DTN){ perf_opt->eid_format_forced = 'D'; char * ptr; ptr = strstr(local_eid.uri, CLI_EP_STRING); // copy from local EID only the uri (not the demux string) strncpy(perf_opt->mon_eid, local_eid.uri, ptr - local_eid.uri); } else { perf_opt->eid_format_forced = 'I'; char * ptr, * temp; temp = (char *) malloc(sizeof(char)*AL_BP_MAX_ENDPOINT_ID); strcpy(temp,local_eid.uri); ptr = strtok(temp , "."); sprintf(temp,"%s.%s",ptr,MON_EP_NUM_SERVICE); strncpy(perf_opt->mon_eid, temp, strlen(temp)); free(temp); } } // if the scheme is not "ipn" append monitor demux string to reply-to EID if(strncmp(perf_opt->mon_eid,"ipn",3) != 0) strcat(perf_opt->mon_eid, MON_EP_STRING); // parse error = al_bp_parse_eid_string(&mon_eid, perf_opt->mon_eid); if (error != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in parsing BP EID: invalid eid string '%s'\n", perf_opt->dest_eid); if (create_log) fprintf(log_file, "\n[DTNperf fatal error] in parsing BP EID: invalid eid string '%s'", perf_opt->dest_eid); client_clean_exit(1); } // checking if there is a running monitor on this endpoint if(perf_g_opt->mode == DTNPERF_CLIENT_MONITOR) { if(debug && debug_level > 0) printf("[debug] checking for existing monitor on this endpoint...\n"); error = al_bp_find_registration(handle, &mon_eid, ®id); if ( (error == BP_SUCCESS && perf_opt->bp_implementation == BP_DTN) || (perf_opt->bp_implementation == BP_ION && (error == BP_EBUSY || error == BP_EPARSEEID))) { dedicated_monitor = FALSE; printf("there is already a monitor on this endpoint.\n"); printf("regid 0x%x\n", (unsigned int) regid); } else { dedicated_monitor = TRUE; mon_params.client_id = getpid(); mon_params.perf_g_opt = perf_g_opt; printf("there is not a monitor on this endpoint.\n"); // if the scheme is not "ipn", append monitor demux string to reply-to EID if(strncmp(perf_opt->mon_eid,"ipn",3) != 0) sprintf(temp1, "%s_%d", mon_eid.uri, mon_params.client_id); else sprintf(temp1, "%s", mon_eid.uri); al_bp_parse_eid_string(&mon_eid, temp1); // start dedicated monitor if ((monitor_pid = fork()) == 0) { start_dedicated_monitor((void *) &mon_params); exit(0); } printf("dedicated (internal) monitor started\n"); } if ((debug) && (debug_level > 0)) printf(" done\n"); } if(dedicated_monitor == TRUE) strcpy(mon_eid.uri, temp1); if (debug) printf("Reply-to : %s\n\n", mon_eid.uri); if (create_log) fprintf(log_file, "Reply-to : %s\n\n", mon_eid.uri); if(create_log) fflush(log_file); //create a new registration to the local router based on this eid if(debug && debug_level > 0) printf("[debug] registering to local BP daemon..."); memset(®info, 0, sizeof(reginfo)); al_bp_copy_eid(®info.endpoint, &local_eid); reginfo.flags = BP_REG_DEFER; reginfo.regid = BP_REGID_NONE; reginfo.expiration = 0; error = al_bp_register(&handle, ®info, ®id); if ( (error != BP_SUCCESS && perf_opt->bp_implementation == BP_DTN) || (perf_opt->bp_implementation == BP_ION && (error == BP_EBUSY || error == BP_EPARSEEID))) { fflush(stdout); fprintf(stderr, "[DTNperf fatal error] in registering eid: %s (%s)\n", reginfo.endpoint.uri, al_bp_strerror(al_bp_errno(handle))); if (create_log) fprintf(log_file, "[DTNperf fatal error] in registering eid: %s (%s)\n", reginfo.endpoint.uri, al_bp_strerror(al_bp_errno(handle))); client_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" done\n"); if (debug) printf("regid 0x%x\n", (unsigned int) regid); if (create_log) fprintf(log_file, "regid 0x%x\n", (unsigned int) regid); // if bundle payload > MAX_MEM_PAYLOAD, then memorize payload in file if (!perf_opt->use_file && perf_opt->bundle_payload > MAX_MEM_PAYLOAD) { perf_opt->use_file = 1; perf_opt->bundle_payload = BP_PAYLOAD_FILE; if (verbose) printf("[DTNperf warning] Payload %f > %d: using file instead of memory\n", perf_opt->bundle_payload, MAX_MEM_PAYLOAD); if (create_log) fprintf(log_file, "[DTNperf warning] Payload %f > %d: using file instead of memory\n", perf_opt->bundle_payload, MAX_MEM_PAYLOAD); } u32_t header_size; if(perf_opt->op_mode == 'F') header_size = get_header_size(perf_opt->op_mode, strlen(perf_opt->F_arg), strlen(perf_opt->mon_eid) ); else header_size = get_header_size(perf_opt->op_mode, 0, strlen(perf_opt->mon_eid) ); double dtnperf_payload = perf_opt->bundle_payload - header_size; if( dtnperf_payload <= 0 ) { fflush(stdout); fprintf(stderr, "[DTNperf warning] bundle payload too small. Extended to %d bytes\n", DEFAULT_PAYLOAD); if (create_log) fprintf(stderr, "[DTNperf warning] bundle payload too small. Extended to %d bytes\n", DEFAULT_PAYLOAD); client_clean_exit(1); } if ((debug) && (debug_level > 0)) { printf("[debug] dtnperf header length: %lu\n", header_size); printf("[debug] dtnperf payload length: %f\n", dtnperf_payload); } if (create_log) { printf("[debug] dtnperf header length: %lu\n", header_size); printf("[debug] dtnperf payload length: %f\n", dtnperf_payload); } /* ------------------------------------------------------------------------------ * select the operative-mode (between Time_mode, Data_mode and File_mode) * ------------------------------------------------------------------------------ */ if (perf_opt->op_mode == 'T') // Time mode { if (verbose) printf("Working in Time_mode\n"); if (create_log) fprintf(log_file, "Working in Time_mode\n"); if (verbose) printf("requested Tx lenght %d (s) \n", perf_opt->transmission_time); if (create_log) fprintf(log_file, "requested Tx lenght %d (s)\n", perf_opt->transmission_time); } else if (perf_opt->op_mode == 'D') // Data mode { if (verbose) printf("Working in Data_mode\n"); if (create_log) fprintf(log_file, "Working in Data_mode\n"); if (verbose) printf("requested Transmission of %f bytes of data\n", perf_opt->data_qty); if (create_log) fprintf(log_file, "requested Transmission of %f bytes of data\n", perf_opt->data_qty); } else if (perf_opt->op_mode == 'F') // File mode { if (verbose) printf("Working in File_mode\n"); if (create_log) fprintf(log_file, "Working in File_mode\n"); if (verbose) printf("requested transmission of file %s\n", perf_opt->F_arg); if (create_log) fprintf(log_file, "requested transmission of file %s\n", perf_opt->F_arg); } if (verbose) printf(" transmitting data %s\n", perf_opt->use_file ? "using a file" : "using memory"); if (create_log) fprintf(log_file, " transmitting data %s\n", perf_opt->use_file ? "using a file" : "using memory"); if (verbose) printf("%s based congestion control:\n", perf_opt->congestion_ctrl == 'w' ? "window" : "rate"); if (create_log) fprintf(log_file, "%s based congestion control:\n", perf_opt->congestion_ctrl == 'w' ? "window" : "rate"); if(perf_opt->congestion_ctrl == 'w') { if (verbose) printf("\twindow is %d bundle\n", perf_opt->window); if (create_log) fprintf(log_file, "\twindow is %d bundle\n", perf_opt->window); } else { if (verbose) printf("\trate is %f %c\n", perf_opt->rate, perf_opt->rate_unit); if (create_log) fprintf(log_file, "\trate is %f %c\n", perf_opt->rate, perf_opt->rate_unit); } if (verbose) printf("payload is %f byte\n", perf_opt->bundle_payload); if (create_log) fprintf(log_file, "payload is %f byte\n", perf_opt->bundle_payload); sent_bundles = 0; if (perf_opt->op_mode == 'D' || perf_opt->op_mode == 'F') // Data or File mode { if ((debug) && (debug_level > 0)) printf("[debug] calculating how many bundles are needed..."); if (perf_opt->op_mode == 'F') // File mode { struct stat file; if (stat(perf_opt->F_arg, &file) < 0) { fprintf(stderr, "[DTNperf fatal error] in stat (linux) of file %s : %s", perf_opt->F_arg, strerror(errno)); if (create_log) fprintf(log_file, "[DTNperf fatal error] in stat (linux) of file %s : %s", perf_opt->F_arg, strerror(errno)); client_clean_exit(1); } // get transfer file basename strcpy(temp1, perf_opt->F_arg); strcpy(temp2, basename(temp1)); transfer_filename = malloc(strlen(temp2) + 1); strcpy(transfer_filename, temp2); transfer_filedim = file.st_size; tot_bundles += bundles_needed(transfer_filedim, get_file_fragment_size(perf_opt->bundle_payload, strlen(transfer_filename), strlen(perf_opt->mon_eid))); file_bundle_names = (char * *) malloc(sizeof(char *) * tot_bundles); } else // Data mode tot_bundles += bundles_needed(perf_opt->data_qty, perf_opt->bundle_payload); if ((debug) && (debug_level > 0)) printf(" n_bundles = %ld\n", tot_bundles); } // Create the bundle object if ((debug) && (debug_level > 0)) printf("[debug] creating the bundle object..."); error = al_bp_bundle_create(& bundle); if (error != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in creating bundle object\n"); if (create_log) fprintf(log_file, "[DTNperf fatal error] in creating bundle object\n"); client_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" done\n"); if ((debug) && (debug_level > 0)) printf("[debug] number of blocks: %d\n", perf_opt->num_blocks); // set extension block information if (num_ext_blocks > 0) { ext_buf = malloc(num_ext_blocks * sizeof(al_bp_extension_block_t)); memset(ext_buf, 0, num_ext_blocks * sizeof(al_bp_extension_block_t)); int i=0; ext_bp = (al_bp_extension_block_t *)ext_buf; for (i = 0; i < num_ext_blocks; i++) { if (check_metadata(&ext_blocks[i])) { continue; } ext_bp->type = ext_blocks[i].block.type; ext_bp->flags = ext_blocks[i].block.flags; ext_bp->data.data_len = ext_blocks[i].block.data.data_len; ext_bp->data.data_val = ext_blocks[i].block.data.data_val;; ext_bp++; } bundle.spec->blocks.blocks_len = num_ext_blocks; bundle.spec->blocks.blocks_val = (al_bp_extension_block_t *)ext_buf; } // set metadata block information if (num_meta_blocks > 0) { meta_buf = malloc(num_meta_blocks * sizeof(al_bp_extension_block_t)); memset(meta_buf, 0, num_meta_blocks * sizeof(al_bp_extension_block_t)); int i=0; meta_bp = (al_bp_extension_block_t *)meta_buf; for (i = 0; i < num_meta_blocks; i++) { if (!check_metadata(&ext_blocks[i])) { continue; } meta_bp->type = ext_blocks[i].block.type; meta_bp->flags = ext_blocks[i].block.flags; meta_bp->data.data_len = ext_blocks[i].block.data.data_len; meta_bp->data.data_val = ext_blocks[i].block.data.data_val;; meta_bp++; } bundle.spec->metadata.metadata_len = num_meta_blocks; bundle.spec->metadata.metadata_val = (al_bp_extension_block_t *)meta_buf; } /****** METADATA prints if ((debug) && (debug_level > 0)) { int i=0; printf("==============================\n"); printf("[debug] number of metadata blocks: %lu\n", bundle.spec->metadata.metadata_len); for (i = 0; i < num_meta_blocks; i++) { if (!check_metadata(&ext_blocks[i])) { continue; } // printf("Metada Block[%d]\tmetadata_type [%L]\n", i, ext_blocks[i].metadata_type); printf("---type: %lu\n", bundle.spec->metadata.metadata_val[i].type); printf("---flags: %lu\n", bundle.spec->metadata.metadata_val[i].flags); printf("---data_len: %lu\n", bundle.spec->metadata.metadata_val[i].data.data_len); printf("---data_val: %s\n", bundle.spec->metadata.metadata_val[i].data.data_val); } printf("-------------------------------\n"); } *******/ // Create the array for the bundle send info (only for sliding window congestion control) if (perf_opt->congestion_ctrl == 'w') { if ((debug) && (debug_level > 0)) printf("[debug] creating structure for sending information..."); send_info = (send_information_t*) malloc(perf_opt->window * sizeof(send_information_t)); init_info(send_info, perf_opt->window); if ((debug) && (debug_level > 0)) printf(" done\n"); } // Open File Transfered if(perf_opt->op_mode == 'F') // File mode { // open file to transfer in read mode if ((transfer_fd = open(perf_opt->F_arg, O_RDONLY)) < 0) { fprintf(stderr, "[DTNperf fatal error] in stat (linux) of file %s : %s", perf_opt->F_arg, strerror(errno)); if (create_log) fprintf(log_file, "[DTNperf fatal error] in stat (linux) of file %s : %s", perf_opt->F_arg, strerror(errno)); client_clean_exit(2); } } // Setting the bundle options al_bp_bundle_set_source(&bundle, local_eid); al_bp_bundle_set_dest(&bundle, dest_eid); al_bp_bundle_set_replyto(&bundle, mon_eid); set_bp_options(&bundle, conn_opt); // intialize stop bundle; al_bp_bundle_create(&bundle_stop); if ((debug) && (debug_level > 0)) printf("[debug] entering in loop\n"); // Run threads if (perf_opt->congestion_ctrl == 'w') // sliding window congestion control sem_init(&window, 0, perf_opt->window); else // rate based congestion control sem_init(&window, 0, 0); sigset_t sigset; // blocking signals for the threads sigemptyset(&sigset); sigaddset(&sigset, SIGINT); sigaddset(&sigset, SIGUSR1); sigaddset(&sigset, SIGUSR2); pthread_sigmask(SIG_BLOCK, &sigset, NULL); pthread_cond_init(&cond_ackreceiver, NULL); pthread_mutex_init (&mutexdata, NULL); pthread_create(&sender, NULL, send_bundles, (void*)perf_g_opt); pthread_create(&cong_ctrl, NULL, congestion_control, (void*)perf_g_opt); pthread_create(&wait_for_signal, NULL, wait_for_sigint, (void*) client_demux_string); pthread_join(cong_ctrl, (void**)&pthread_status); pthread_join(sender, (void**)&pthread_status); pthread_mutex_destroy(&mutexdata); sem_destroy(&window); pthread_cond_destroy(&cond_ackreceiver); // if user sent Ctrl+C to the client, // let the wait_for_signal thread to terminate the execution if (process_interrupted) pause(); if ((debug) && (debug_level > 0)) printf("[debug] out from loop\n"); // Get the TOTAL end time if ((debug) && (debug_level > 0)) printf("[debug] getting total end-time..."); gettimeofday(&end, NULL); if ((debug) && (debug_level > 0)) printf(" end.tv_sec = %u s\n", (u_int)end.tv_sec); // Print final report print_final_report(NULL); if(perf_opt->create_log) print_final_report(log_file); // fill the stop bundle prepare_stop_bundle(&bundle_stop, mon_eid, conn_opt->expiration, conn_opt->priority, sent_bundles); al_bp_bundle_set_source(&bundle_stop, local_eid); // send stop bundle to monitor if (debug) printf("sending the stop bundle to the monitor..."); if ((error = al_bp_bundle_send(handle, regid, &bundle_stop)) != 0) { fprintf(stderr, "[DTNperf fatal error] in sending stop bundle: %d (%s)\n", error, al_bp_strerror(error)); if (create_log) fprintf(log_file, "[DTNperf fatal error] in sending stop bundle: %d (%s)\n", error, al_bp_strerror(error)); client_clean_exit(1); } if (debug) printf("done.\n"); // waiting monitor stops if (dedicated_monitor) { printf("\nWaiting for dedicated monitor to stop...\n"); wait(&monitor_status); } // Close the BP handle -- if ((debug) && (debug_level > 0)) printf("[debug] closing DTN handle..."); if (al_bp_close(handle) != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in closing bp handle: %s\n", strerror(errno)); if (create_log) fprintf(log_file, "[DTNperf fatal error] in closing bp handle: %s\n", strerror(errno)); client_clean_exit(1); } else { bp_handle_open = FALSE; } // Unregister Local Eid only For ION if(perf_opt->bp_implementation == BP_ION) { if (al_bp_unregister(handle,regid,local_eid) != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] unregisted endpoint: %s\n", strerror(errno)); if (create_log) fprintf(log_file, "[DTNperf fatal error] unregisted endpoint: %s\n", strerror(errno)); client_clean_exit(1); } else { //bp_local_eid_register = FALSE; bp_handle_open = FALSE; } } if ((debug) && (debug_level > 0)) printf(" done\n"); if (create_log) { fclose(log_file); log_open = FALSE; } // deallocate memory if (perf_opt->op_mode == 'F') { close(transfer_fd); } if (perf_opt->use_file) { // remove(source_file); source_file_created = FALSE; if (debug && debug > 1) { printf("[debug] removed file %s\n", source_file); } } // free resource free((void*)buffer); free(client_demux_string); free(transfer_filename); free(send_info); if(perf_opt->op_mode == 'F') { int i; al_bp_bundle_payload_t tmp_payload; tmp_payload.location = bundle.payload->location; if( perf_opt->bp_implementation == BP_ION) { for (i = 0; i< tot_bundles ; i++ ) { // The last bundle delivered is not deleted here // Is deleted with the free(&bundle) if( strcmp(bundle.payload->filename.filename_val,file_bundle_names[i]) != 0) { tmp_payload.filename.filename_len = strlen(file_bundle_names[i]); tmp_payload.filename.filename_val = file_bundle_names[i]; al_bp_free_payload(&tmp_payload); } } } else { for (i = 0; i< tot_bundles ; i++ ) { remove(file_bundle_names[i]); free(file_bundle_names[i]); } free(file_bundle_names); } } //structure bundle is always free in every op mode al_bp_bundle_free(&bundle); al_bp_bundle_free(&bundle_stop); if (perf_opt->num_blocks > 0) { /*free(ext_buf); free(meta_buf);*/ meta_buf = NULL; ext_buf = NULL; int i; for ( i=0; inum_blocks; i++ ) { /*printf("Freeing extension block info [%d].data at 0x%08X\n", i, ext_blocks[i].block.data.data_val);*/ //free(ext_blocks[i].block.data.data_val); ext_blocks[i].block.data.data_val = NULL; } ext_blocks = NULL; } if (perf_opt->create_log) printf("\nClient log saved: %s\n", perf_opt->log_filename); printf("\n"); exit(0); } // end client code /** * Create and Fill Buffer File Payload **/ void create_fill_payload_buf(boolean_t debug, int debug_level, boolean_t create_log, int num_bundle){ FILE * stream, *buf_stream; char *buf; boolean_t eof_reached; int bytes_written; if(perf_opt->op_mode == 'F')// File mode sprintf(source_file, "%s_%d_%d", SOURCE_FILE, getpid(),num_bundle); else // Time and Data mode sprintf(source_file, "%s_%d", SOURCE_FILE, getpid()); // Create the file if (perf_opt->use_file) { // create the file if ((debug) && (debug_level > 0)) printf("[debug] creating file %s...", source_file); stream = fopen(source_file, "wb"); if (stream == NULL) { fprintf(stderr, "[DTNperf fatal error] in creating file %s.\n \b Maybe you have not permissions\n", source_file); if (create_log) fprintf(log_file, "[DTNperf fatal error] in creating file %s.\n \b Maybe you have not permissions\n", source_file); client_clean_exit(2); } source_file_created = TRUE; fclose(stream); if ((debug) && (debug_level > 0)) printf(" done\n"); } // Fill the payload if ((debug) && (debug_level > 0)) printf("[debug] filling payload..."); if (perf_opt->use_file) error = al_bp_bundle_set_payload_file(&bundle, source_file, strlen(source_file)); else error = al_bp_bundle_set_payload_mem(&bundle, buffer, bufferLen); if (error != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in setting bundle payload\n"); if (create_log) fprintf(log_file, "[DTNperf fatal error] in setting bundle payload\n"); client_clean_exit(1); } if ((debug) && (debug_level > 0)) printf(" done\n"); // open payload stream in write mode if (open_payload_stream_write(bundle, &stream) < 0) { fprintf(stderr, "[DTNperf fatal error] in opening payload stream write mode\n"); if (create_log) fprintf(log_file, "[DTNperf fatal error] in opening payload stream write mode\n"); client_clean_exit(2); } buf = (char *) malloc(perf_opt->bundle_payload); buf_stream = open_memstream(&buf, (size_t *) &perf_opt->bundle_payload); // prepare the payload if(perf_opt->op_mode == 'F') // File mode { //open_payload_stream_write(bundle, &stream); error = prepare_file_transfer_payload(perf_opt, buf_stream, transfer_fd, transfer_filename, transfer_filedim, conn_opt->expiration , &eof_reached, &bundle.payload->buf.buf_crc, &bytes_written); if(error != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in preparing file transfer payload\n"); if (create_log) fprintf(log_file, "[DTNperf fatal error] in preparing file transfer payload"); client_clean_exit(2); } } else // Time and Data mode { error = prepare_generic_payload(perf_opt, buf_stream, &bundle.payload->buf.buf_crc, &bytes_written); if (error != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in preparing payload: %s\n", al_bp_strerror(error)); if (create_log) fprintf(log_file, "[DTNperf fatal error] in preparing payload: %s\n", al_bp_strerror(error)); client_clean_exit(1); } } fclose(buf_stream); if (perf_opt->crc==TRUE && debug) printf("[debug] CRC = %"PRIu32"\n", bundle.payload->buf.buf_crc); memcpy(buf+HEADER_SIZE+BUNDLE_OPT_SIZE+sizeof(al_bp_timeval_t), &bundle.payload->buf.buf_crc, BUNDLE_CRC_SIZE); fwrite(buf, bytes_written, 1, stream); // close the stream close_payload_stream_write(&bundle, stream); if(debug) printf("[debug] payload prepared\n"); /* if((debug) && (debug_level > 0)) { u32_t h_size; uint16_t filename_len, monitor_eid_len; monitor_eid_len = strlen(perf_opt->mon_eid); if(perf_opt->op_mode == 'F') { filename_len = strlen(transfer_filename); h_size = get_header_size(perf_opt->op_mode, filename_len, monitor_eid_len); } else h_size = get_header_size(perf_opt->op_mode, 0, monitor_eid_len); printf("[debug] dtnperf header size %lu byte\n", h_size); }*/ } // end create_fill_payload_buf /** * Client Threads code **/ void * send_bundles(void * opt) { dtnperf_options_t *perf_opt = ((dtnperf_global_options_t *)(opt))->perf_opt; boolean_t debug = perf_opt->debug; int debug_level = perf_opt->debug_level; boolean_t create_log = perf_opt->create_log; boolean_t condition; u32_t actual_payload; // Initialize timer if ((debug) && (debug_level > 0)) printf("[debug send thread] initializing timer..."); if (create_log) fprintf(log_file, " initializing timer..."); gettimeofday(&start, NULL); if ((debug) && (debug_level > 0)) printf(" start.tv_sec = %d s\n", (u_int)start.tv_sec); if (create_log) fprintf(log_file, " start.tv_sec = %d s\n", (u_int)start.tv_sec); if (perf_opt->op_mode == 'T') // TIME MODE { // Calculate end-time if ((debug) && (debug_level > 0)) printf("[debug send thread] calculating end-time..."); if (create_log) fprintf(log_file, " calculating end-time..."); end = set (0); end.tv_sec = start.tv_sec + perf_opt->transmission_time; if ((debug) && (debug_level > 0)) printf(" end.tv_sec = %d s\n", (u_int)end.tv_sec); if (create_log) fprintf(log_file, " end.tv_sec = %d s\n", (u_int)end.tv_sec); } if ((debug) && (debug_level > 0)) printf("[debug send thread] entering loop...\n"); if (create_log) fprintf(log_file, " entering loop...\n"); if (perf_opt->op_mode == 'T') // TIME MODE { // init variables for loop and setting condition now.tv_sec = start.tv_sec; condition = now.tv_sec <= end.tv_sec; } else // DATA and FILE MODE { // setting condition for loop condition = sent_bundles < tot_bundles; } //Only for DATA e TIME MODE is the payload is the same for all bundle if (perf_opt->op_mode == 'T' || perf_opt->op_mode == 'D') { create_fill_payload_buf(debug, debug_level, create_log, 0); } else //For FILE MODE created all the payload necessary { int i=0; for (i=0; iop_mode == 'F') { sprintf(source_file, "%s_%d_%d", SOURCE_FILE, getpid(),sent_bundles); if (perf_opt->use_file) error = al_bp_bundle_set_payload_file(&bundle, source_file, strlen(source_file)); else error = al_bp_bundle_set_payload_mem(&bundle, buffer, bufferLen); // memorized source_file file_bundle_names[sent_bundles] = (char *) malloc(sizeof(char) * bundle.payload->filename.filename_len); strcpy(file_bundle_names[sent_bundles], bundle.payload->filename.filename_val); } // window debug if ((debug) && (debug_level > 1)) { int cur; sem_getvalue(&window, &cur); printf("\t[debug send thread] window is %d\n", cur); } // wait for the semaphore sem_wait(&window); if (perf_opt->op_mode == 'T') // TIME MODE { // update time and condition gettimeofday(&now, NULL); condition = now.tv_sec <= end.tv_sec; } if(!condition) break; // Send the bundle if (debug) printf("passing the bundle to BP...\n"); if (perf_opt->congestion_ctrl == 'w') pthread_mutex_lock(&mutexdata); if ((error = al_bp_bundle_send(handle, regid, &bundle)) != 0) { fprintf(stderr, "[DTNperf fatal error] in passing the bundle to BP: %d (%s)\n", error, al_bp_strerror(error)); if (create_log) fprintf(log_file, "[DTNperf fatal error] in passing the bundle to BP: %d (%s)\n", error, al_bp_strerror(error)); client_clean_exit(1); } if ((error = al_bp_bundle_get_id(bundle, &bundle_id)) != 0) { fprintf(stderr, "[DTNperf fatal error] in getting bundle id: %s\n", al_bp_strerror(error)); if (create_log) fprintf(log_file, "[DTNperf fatal error] in getting bundle id: %s\n", al_bp_strerror(error)); client_clean_exit(1); } if (debug) printf("bundle passed to BP\n"); if ((debug) && (debug_level > 0)) printf("\t[debug send thread] "); printf("bundle timestamp: %llu.%llu\n", (unsigned long long) bundle_id->creation_ts.secs, (unsigned long long) bundle_id->creation_ts.seqno); if (create_log) fprintf(log_file, "\t bundle timestamp: %llu.%llu\n", (unsigned long long) bundle_id->creation_ts.secs, (unsigned long long) bundle_id->creation_ts.seqno); // put bundle id in send_info (only windowed congestion control) if (perf_opt->congestion_ctrl == 'w') { gettimeofday(&bundle_sent, NULL); add_info(send_info, *bundle_id, bundle_sent, perf_opt->window); if ((debug) && (debug_level > 0)) printf("\t[debug send thread] added info for bundle\n"); pthread_cond_signal(&cond_ackreceiver); pthread_mutex_unlock(&mutexdata); } // Increment sent_bundles ++sent_bundles; if ((debug) && (debug_level > 0)) printf("\t[debug send thread] now bundle passed is %d\n", sent_bundles); if (create_log) fprintf(log_file, "\t now bundle passed is %d\n", sent_bundles); // Increment data_qty al_bp_bundle_get_payload_size(bundle, &actual_payload); sent_data += actual_payload; if (perf_opt->op_mode == 'T') // TIME MODE { // update time and condition gettimeofday(&now, NULL); condition = now.tv_sec <= end.tv_sec; } else // DATA MODE { // update condition condition = sent_bundles < tot_bundles; } } // while if ((debug) && (debug_level > 0)) printf("[debug send thread] ...out from sending loop\n"); if (create_log) fprintf(log_file, " ...out from sending loop\n"); pthread_mutex_lock(&mutexdata); close_ack_receiver = 1; if (perf_opt->congestion_ctrl == 'r') { // terminate congestion control thread pthread_cancel(cong_ctrl); } else { pthread_cond_signal(&cond_ackreceiver); } pthread_mutex_unlock(&mutexdata); // close thread pthread_exit(NULL); } // end send_bundles void * congestion_control(void * opt) { dtnperf_options_t *perf_opt = ((dtnperf_global_options_t *)(opt))->perf_opt; boolean_t debug = perf_opt->debug; int debug_level = perf_opt->debug_level; boolean_t create_log = perf_opt->create_log; uint32_t extension_ack; al_bp_timestamp_t reported_timestamp; al_bp_endpoint_id_t ack_sender; HEADER_TYPE ack_header; al_bp_copy_eid(&ack_sender, &dest_eid); int position = -1; if (debug && debug_level > 0) printf("[debug cong ctrl] congestion control = %c\n", perf_opt->congestion_ctrl); pthread_sleep(0.5); if (perf_opt->congestion_ctrl == 'w') // window based congestion control { // gettimeofday(&temp, NULL); pthread_create(&cong_expir_timer, NULL, congestion_window_expiration_timer, NULL); while ((close_ack_receiver == 0) || count_info(send_info, perf_opt->window) != 0 /*|| (gettimeofday(&temp, NULL) == 0 && ack_recvd.tv_sec - temp.tv_sec <= perf_opt->wait_before_exit)*/) { // if there are no bundles without ack, wait pthread_mutex_lock(&mutexdata); al_bp_bundle_create(&ack); if (close_ack_receiver == 0 && count_info(send_info, perf_opt->window) == 0) { pthread_cond_wait(&cond_ackreceiver, &mutexdata); pthread_mutex_unlock(&mutexdata); // pthread_yield(); sched_yield(); continue; } // Wait for the reply if ((debug) && (debug_level > 0)) printf("\t[debug cong ctrl] waiting for the reply...\n"); error = al_bp_bundle_receive(handle, ack, BP_PAYLOAD_MEM, -1); if(error == BP_ERECVINT || error == BP_ETIMEOUT) { if(error == BP_ERECVINT ) { fprintf(stderr, "[DTNperf warning] bundle reception interrupted\n"); if (create_log) fprintf(log_file, "[DTNperf warning] bundle reception interrupted\n"); } if(error == BP_ETIMEOUT ) { fprintf(stderr, "[DTNperf warning] bundle reception timeout expired\n"); if (create_log) fprintf(log_file, "[DTNperf warning] bundle reception timeout expired\n"); } } else { if ( error != BP_SUCCESS) { if(count_info(send_info, perf_opt->window) == 0 && close_ack_receiver == 1) // send_bundles is terminated break; fprintf(stderr, "[DTNperf fatal error] in getting server ack: %d (%s)\n", error, al_bp_strerror(al_bp_errno(handle))); if (create_log) fprintf(log_file, "[DTNperf fatal error] in getting server ack: %d (%s)\n", error, al_bp_strerror(al_bp_errno(handle))); client_clean_exit(1); } // Check if is actually a server ack bundle get_bundle_header_and_options(&ack, &ack_header, NULL); if (ack_header != DSA_HEADER) { fprintf(stderr, "[DTNperf fatal error] in getting server ack: wrong bundle header\n"); if (create_log) fprintf(log_file, "[DTNperf fatal error] in getting server ack: wrong bundle header\n"); pthread_mutex_unlock(&mutexdata); //pthread_yield(); sched_yield(); continue; } gettimeofday(&ack_recvd, NULL); if ((debug) && (debug_level > 0)) printf("\t[debug cong ctrl] ack received\n"); // Get ack infos error = get_info_from_ack(&ack, NULL, &reported_timestamp, &extension_ack); if (error != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in getting info from ack: %s\n", al_bp_strerror(error)); if (create_log) fprintf(log_file, "[DTNperf fatal error] in getting info from ack: %s\n", al_bp_strerror(error)); client_clean_exit(1); } if (extension_ack & BO_CRC_ENABLED) wrong_crc++; if ((debug) && (debug_level > 0)) printf("\t[debug cong ctrl] ack received timestamp: %lu %lu\n", reported_timestamp.secs, reported_timestamp.seqno); position = is_in_info(send_info, reported_timestamp, perf_opt->window); if (position < 0) { fprintf(stderr, "[DTNperf fatal error] in removing bundle info\n"); if (create_log) fprintf(log_file, "[DTNperf fatal error] in removing bundle info\n"); //client_clean_exit(1); } remove_from_info(send_info, position); if ((debug) && (debug_level > 0)) printf("\t[debug cong ctrl] ack validated\n"); sem_post(&window); if ((debug) && (debug_level > 1)) { int cur; sem_getvalue(&window, &cur); printf("\t[debug cong ctrl] window is %d\n", cur); } } al_bp_bundle_free(&ack); pthread_mutex_unlock(&mutexdata); //pthread_yield(); sched_yield(); } // end while } else if (perf_opt->congestion_ctrl == 'r') // Rate based congestion control { double interval_secs; if (perf_opt->rate_unit == 'b') // rate is bundles per second { interval_secs = 1.0 / perf_opt->rate; } else // rate is bit or kbit per second { if (perf_opt->rate_unit == 'k') // Rate is kbit per second { perf_opt->rate = kilo2byte(perf_opt->rate); } else // rate is Mbit per second { perf_opt->rate = mega2byte(perf_opt->rate); } interval_secs = (double)perf_opt->bundle_payload * 8 / perf_opt->rate; } if (debug) printf("[debug cong ctrl] wait time for each bundle: %.4f s\n", interval_secs); pthread_mutex_lock(&mutexdata); while(close_ack_receiver == 0) { pthread_mutex_unlock(&mutexdata); sem_post(&window); //pthread_yield(); sched_yield(); if (debug && debug_level > 0) printf("[debug cong ctrl] increased window size\n"); pthread_sleep(interval_secs); pthread_mutex_lock(&mutexdata); } } else // wrong char for congestion control { client_clean_exit(1); } pthread_exit(NULL); return NULL; } // end congestion_control void * congestion_window_expiration_timer(void * opt) { struct timeval current_time; al_bp_timeval_t expiration = perf_opt->bundle_ack_options.ack_expiration + conn_opt->expiration; expir_timer_cong_window = FALSE; gettimeofday(¤t_time, NULL); if(ack_recvd.tv_sec == 0) ack_recvd.tv_sec = current_time.tv_sec; while(1) { gettimeofday(¤t_time, NULL); if( current_time.tv_sec - ack_recvd.tv_sec >= expiration) { expir_timer_cong_window = TRUE; printf("\nExpiration timer congestion window\n"); client_clean_exit(1); pthread_exit(NULL); return NULL; } sched_yield(); } pthread_exit(NULL); return NULL; } // end congestion_window_expiration_timer void * start_dedicated_monitor(void * params) { monitor_parameters_t * parameters = (monitor_parameters_t *) params; parameters->dedicated_monitor = TRUE; run_dtnperf_monitor(parameters); pthread_exit(NULL); return NULL; } // end start_dedicated_monitor void * wait_for_sigint(void * arg) { sigset_t sigset; int signo; al_bp_handle_t force_stop_handle; sigemptyset(&sigset); sigaddset(&sigset, SIGINT); pthread_sigmask(SIG_UNBLOCK, &sigset, NULL); sigwait(&sigset, &signo); if(expir_timer_cong_window) { printf("\nDTNperf client: Expired Timer to receive the Server's Ack\n"); if (perf_opt->create_log) fprintf(log_file, "\nDTNperf client: Expired Timer to receive the Server's Ack\n"); } else { printf("\nDTNperf client received SIGINT: Exiting\n"); if (perf_opt->create_log) fprintf(log_file, "\nDTNperf client received SIGINT: Exiting\n"); } // send a signal to the monitor to terminate it if (dedicated_monitor) { kill(monitor_pid, SIGUSR1); // wait for monitor to terminate wait(&monitor_status); } else { al_bp_bundle_object_t bundle_force_stop; // Open a new connection to BP Daemon if ((perf_opt->debug) && (perf_opt->debug_level > 0)) printf("[debug] opening a new connection to local BP daemon..."); if(perf_opt->bp_implementation == BP_DTN) { if (perf_opt->use_ip) error = al_bp_open_with_ip(perf_opt->ip_addr,perf_opt->ip_port,&force_stop_handle); else error = al_bp_open(&force_stop_handle); } if (error != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in opening a new bp handle: %s\n", al_bp_strerror(error)); if (perf_opt->create_log) fprintf(log_file, "[DTNperf fatal error] in opening a new bp handle: %s\n", al_bp_strerror(error)); client_clean_exit(1); } if ((perf_opt->debug) && (perf_opt->debug_level > 0)) printf("done\n"); // create the bundle force stop al_bp_bundle_create(&bundle_force_stop); // fill the force stop bundle prepare_force_stop_bundle(&bundle_force_stop, mon_eid, conn_opt->expiration, conn_opt->priority); al_bp_bundle_set_source(&bundle_force_stop, local_eid); // send force_stop bundle to monitor printf("Sending the force stop bundle to the monitor..."); if(perf_opt->bp_implementation == BP_DTN) error = al_bp_bundle_send(force_stop_handle, regid, &bundle_force_stop); else if(perf_opt->bp_implementation == BP_ION) error = al_bp_bundle_send(handle, regid, &bundle_force_stop); if ((error) != BP_SUCCESS) { fprintf(stderr, "[DTNperf fatal error] in sending force stop bundle: %d (%s)\n", error, al_bp_strerror(error)); if (perf_opt->create_log) fprintf(log_file, "[DTNperf fatal error] in sending force stop bundle: %d (%s)\n", error, al_bp_strerror(error)); al_bp_close(force_stop_handle); exit(1); } printf("done.\n"); if(perf_opt->bp_implementation == BP_DTN) al_bp_close(force_stop_handle); al_bp_bundle_free(&bundle_force_stop); } process_interrupted = TRUE; // terminate all child threads pthread_cancel(sender); pthread_cancel(cong_ctrl); pthread_cancel(cong_expir_timer); client_clean_exit(0); return NULL; } // end wait_for_sigint void print_final_report(FILE * f) { double goodput, sent = 0; struct timeval total; double total_secs; char * gput_unit, * sent_unit; if (f == NULL) f = stdout; timersub(&end, &start, &total); total_secs = (((double)total.tv_sec * 1000 *1000) + (double)total.tv_usec) / (1000 * 1000); if (sent_data / (1000 * 1000) >= 1) { sent = (double) sent_data / (1000 * 1000); sent_unit = "Mbyte"; } else if (sent_data / 1000 >= 1) { sent = (double) sent_data / 1000; sent_unit = "Kbyte"; } else sent_unit = "byte"; goodput = sent_data * 8 / total_secs; if (goodput / (1000 * 1000) >= 1) { goodput /= 1000 * 1000; gput_unit = "Mbit/s"; } else if (goodput / 1000 >= 1) { goodput /= 1000; gput_unit = "Kbit/s"; } else gput_unit = "bit/s"; fprintf(f, "\nBundles sent = %d ", sent_bundles); if (perf_opt->crc==TRUE && perf_opt->congestion_ctrl == 'w') fprintf(f, "(Wrong CRC = %ld) ", wrong_crc); fprintf(f, "total data sent = %.3f %s\n", sent, sent_unit); fprintf(f, "Total execution time = %.1f\n", total_secs); if(perf_opt->congestion_ctrl == 'w') fprintf(f, "Goodput = %.3f %s\n", goodput, gput_unit); else fprintf(f, "Throughput = %.3f %s\n", goodput, gput_unit); } // end print_final_report void print_client_usage(char* progname) { fprintf(stderr, "\n"); fprintf(stderr, "dtnperf client mode\n"); fprintf(stderr, "SYNTAX: %s %s -d <[-T | -D | -F ]> [-W | -R ] [options]\n", progname, CLIENT_STRING); fprintf(stderr, "\n"); fprintf(stderr, "options:\n" " -d, --destination Destination EID (i.e. server EID).\n" " -T, --time Time-mode: seconds of transmission.\n" " -D, --data Data-mode: amount data to transmit; B = Byte, k = kByte, M = MByte. Default 'M' (MB). According to the SI and the IEEE standards 1 MB=10^6 bytes\n" " -F, --file File-mode: file to transfer\n" " -W, --window Window-based congestion control: size of DTNperf transmission window, i.e. max number " " of bundles \"in flight\" (not still confirmed by a server ACK). Default: 1.\n" " -R, --rate Rate-based congestion control: Tx rate. k = kbit/s, M = Mbit/s, b = bundle/s. Default is kb/s\n" " -m, --monitor External monitor EID (without this option an internal dedicated monitor is started).\n" " -C, --custody Request of custody transfer (and of \"custody accepted\" status reports as well).\n" " -f, --forwarded Request of \"forwarded\" status reports.\n" " -r, --received Request of \"received\" status reports.\n" " --del Request of \"deleted\" stautus reports.\n" " -N, --nofragment Disable bundle fragmentation.\n" " -P, --payload Bundle payload size; B = Byte, k = kByte, M = MByte. Default= 'k' (kB). According to the SI and the IEEE standards 1 MB=10^6 bytes.\n" " -M, --memory Store the bundle into memory instead of file (if payload < 50KB).\n" " -L, --log[=log_filename] Create a log file. Default log filename is %s.\n" " --log-dir Directory where the client and the internal monitor save log and the csv files. Default \"%s\"\n" " --ip-addr IP address of the BP daemon api. Default is 127.0.0.1 (DTN2 only).\n" " --ip-port IP port of the BP daemon api. Default is 5010 (DTN2 only).\n" " --debug[=level] Debug messages [1-2]; if level is not indicated level = 2.\n" " -l, --lifetime