Commits

Jing Conan Wang  committed 6c5d97d

cont add pcap2netflow support

  • Participants
  • Parent commits 1cd3959

Comments (0)

Files changed (68)

File res/__placeholder__

Empty file removed.

File res/trace-node-3-5.flow

Empty file added.

File tools/pcap2netflow/.hg_archival.txt

+repo: ce4e8d5d0ada9287c7c66d24e04c5a11e25ed83c
+node: 2fbe497d110b5b269ddd0749897492797fadc8c4
+branch: default
+latesttag: null
+latesttagdistance: 3

File tools/pcap2netflow/USAGE

+use softflowd to export the pcap file to 
+this tool is only usable at **ix system
+
+the command will be like
+softflowd -r [PCAP_FILE_NAME] -n [host:port]
+
+softflowd will send the flow data to [host:port], we need to use flowd to
+capture the data
+
+visit this website for the installation and configuraion of flowd
+http://www.isrcomputing.com/knowledge-base/networking-tips/256-flowd-and-cisco-asa-firewall.html
+
+basically you need to edit the configure file: /usr/local/etc/flowd.conf
+
+log "var/log/flowd"
+listen on [host:port]  # the same port with softflowd
+flow source [IP] 
+store ALL
+dicard all
+
+

File tools/pcap2netflow/best_malware_protection.flow

Empty file added.

File tools/pcap2netflow/clean.sh

+#!/usr/bin/env sh
+rm -r softflowd-0.9.9*
+rm -r flowd-0.9.1*

File tools/pcap2netflow/flowd.conf

+logfile "/home/wangjing/flowd.log"
+listen on 127.0.0.1:12345
+pidfile "/var/run/flowd.pid"
+store ALL

File tools/pcap2netflow/install.sh

+#!/usr/bin/env sh
+python install_pack.py
+
+sudo mkdir -p /var/empty/flowd
+sudo groupadd _flowd
+sudo useradd -g _flowd -c "flowd privsep" -d /var/empty/flowd _flowd

File tools/pcap2netflow/install_pack.py

+#!/usr/bin/env python
+import os
+from subprocess import call, check_call
+def install_pack(packages_info):
+    name = packages_info['name']
+    url = packages_info.get('url', None)
+    path = packages_info.get('path', None)
+    print 'installing package %s'%(name)
+    if path is not None:
+        folder_name = path
+    elif url is not None:
+        print 'wget %s'%(url)
+        call('wget %s'%(url), shell=True)
+
+        print 'tar -xzvf %s'%(url.rsplit('/')[-1])
+        tar_file = url.rsplit('/')[-1]
+        call('tar -xzvf %s'%(tar_file), shell=True)
+
+        folder_name = tar_file.rsplit('.tar.gz')[0]
+    else:
+        print 'you should either specify path for url in the packeage info'
+
+    print('cd %s && python setup.py install'%(folder_name))
+    try:
+        check_call('cd %s && python setup.py install'%(folder_name), shell=True)
+    except:
+        print 'not python installer, try configure ...'
+        try:
+            call('cd %s && ./configure'%(folder_name), shell=True)
+            call('cd %s && make'%(folder_name), shell=True)
+            call('cd %s && sudo make install'%(folder_name), shell=True)
+        except:
+            print "I don't know how to install this"
+
+def install_debain(packages):
+    print 'sudo apt-get install %s'%(' '.join(packages))
+    call('sudo apt-get install %s'%(' '.join(packages)), shell=True)
+
+
+if __name__ == "__main__":
+    install_debain(['bison', 'yacc'])
+    install_pack( dict(name='softflowd', path='../softflowd-0.9.8-revised-for-ns3-pcap/') )
+    install_pack( dict(name='flowd', url='http://flowd.googlecode.com/files/flowd-0.9.1.tar.gz') )
+

File tools/pcap2netflow/makefile

+run:
+	sudo ./pcap2netflow.py
+show:
+	sudo vi ../OpenPacket/*.flow
+p:
+	ps aux | grep flowd
+k:
+	sudo killall flowd

File tools/pcap2netflow/pcap2netflow.py

+#!/usr/bin/env python
+from subprocess import call, Popen
+import os, signal
+import time
+
+SOFT_FLOWD = '../softflowd-0.9.8-revised-for-ns3-pcap/softflowd'
+
+def start_flowd(host_port, log_file, daemon=True):
+    # create tmp conf file
+    conf_file_name = './tmp_conf_file.conf'
+    fid = open(conf_file_name, 'w')
+    fid.write('logfile "%s"\nlisten on %s\npidfile "/var/run/flowd.pid"\nstore ALL\n'%(log_file, host_port))
+    fid.close()
+    print '*' * 100
+    print '--> configure file has been written'
+    call(['cat', conf_file_name])
+    print '*' * 100
+    # create flowd collector process
+    # flowd_pid = Popen(['flowd', '-f', conf_file_name, '-d']).pid
+    if daemon:
+        flowd_pid = Popen(['sudo', 'flowd', '-f', conf_file_name, '-d']).pid
+    else:
+        flowd_pid = call(['sudo', 'flowd', '-f', conf_file_name, '-d']).pid
+    print '--> flowd process has been started, its pid is %d'%(flowd_pid)
+    print '*' * 100
+    return flowd_pid
+
+def pcap2flow(pcap_file_name, host_port, log_file=None, flowd=True):
+    # start flowd process
+    if not log_file:
+        log_file = pcap_file_name.rsplit('.pcap')[0] + '.log'
+
+    flowd_pid = None
+    if flowd:
+        flowd_pid = start_flowd(host_port, log_file)
+
+    time.sleep(1)
+
+    # start softflowd process
+    softflowd_pid = Popen([SOFT_FLOWD, '-r', pcap_file_name, '-n', host_port]).pid
+
+    # create flowd-reader process
+    # flowreader_pid = Popen(['flowd-reader', log_file]).pid
+    # flowreader_pid = call(['flowd-reader', log_file]).pid
+    # flowreader_pid = Popen(['flowd-reader', log_file]).pid
+    time.sleep(1)
+    output_file_name = pcap_file_name.rsplit('.pcap')[0] + '.flow'
+    print "--> run 'flowd-reader %s > %s'%(log_file, output_file_name)"
+    # call('sudo flowd-reader %s > %s'%(log_file, output_file_name), shell=True)
+    flowreader_pid = Popen('sudo flowd-reader %s > %s'%(log_file, output_file_name), shell=True).pid
+    # flowreader_pid = None
+
+    return flowd_pid, softflowd_pid, flowreader_pid
+
+    # print 'softflowd pid: %s \n flowd pid: %s \n flowreader pid: %s \n' %(softflowd_pid, flowd_pid, flowreader_pid)
+
+def loop_folder(folder_name):
+    """is not quite sucessful right now"""
+    import glob
+    i = 0
+    start_port = 40035
+    for pcap_file_name in glob.glob( os.path.join(folder_name, '*.pcap') ):
+        print "--> start to process pcap_file_nam: " + pcap_file_name
+        i += 1
+        # flowd = True if i == 1 else False
+        flowd_pid, softflowd_pid, flowreader_pid = pcap2flow(pcap_file_name, "127.0.0.1:%d"%(start_port + 30*i))
+        time.sleep(1)
+
+    # os.system('sudo killall flowd')
+
+HOST_PORT_DEFAULT = '127.0.0.1:12345'
+if __name__ == "__main__":
+    import argparse
+    parser = argparse.ArgumentParser(description='pcap2netflow')
+    parser.add_argument('-p', '--pcap', default=None,
+            help='specify the pcap file you want to process')
+    parser.add_argument('-f', '--folder', default=None,
+            help='specify the folder you want to loop through')
+    parser.add_argument('-n', '--host_port', default=HOST_PORT_DEFAULT,
+            help='host:port')
+    parser.add_argument('--start_flowd', default=False, action="store_true",
+            help='start flowd damon process')
+    parser.add_argument('-l', '--log', default='tmp.log',
+            help='log file')
+
+
+
+    args, remains = parser.parse_known_args()
+    if args.host_port:
+        host_port = args.host_port
+    else:
+        host_port = HOST_PORT_DEFAULT
+
+    if args.start_flowd:
+        start_flowd(args.host_port, args.log, False)
+        import sys
+        sys.exit()
+
+    if args.pcap:
+        pcap2flow(args.pcap, host_port)
+    elif args.folder:
+        loop_folder(args.folder)
+    else:
+        parser.print_help()
+
+    # pcap_file_name = '/home/wangjing/LocalResearch/CyberData/pcap2netflow/best_malware_protection.pcap'
+    # host_port = '127.0.0.1:12345'
+    # logfile =  '/home/wangjing/LocalResearch/CyberData/flowd.log'
+    # pcap2flow(pcap_file_name, host_port)
+    # loop_folder('/home/wangjing/LocalResearch/CyberData/OpenPacket/')
+    # loop_folder('/home/wangjing/LocalResearch/CyberData/ppa-capture-files/')
+

File tools/pcap2netflow/tmp.flow

+FLOW recv_time 2012-09-11T01:19:10.610454 proto 6 tcpflags 12 tos 00 agent [127.0.0.1] src [10.0.9.5]:49153 dst [10.0.12.4]:3333 packets 10 octets 400 
+FLOW recv_time 2012-09-11T01:19:10.610454 proto 6 tcpflags 12 tos 00 agent [127.0.0.1] src [10.0.12.4]:3333 dst [10.0.9.5]:49153 packets 14 octets 1235 
+FLOW recv_time 2012-09-11T01:19:10.610454 proto 6 tcpflags 12 tos 00 agent [127.0.0.1] src [10.0.12.4]:3333 dst [10.0.15.5]:49153 packets 14 octets 1235 
+FLOW recv_time 2012-09-11T01:19:10.610454 proto 6 tcpflags 12 tos 00 agent [127.0.0.1] src [10.0.15.5]:49153 dst [10.0.12.4]:3333 packets 10 octets 400 
+FLOW recv_time 2012-09-11T01:19:10.610454 proto 17 tcpflags 00 tos 00 agent [127.0.0.1] src [10.0.15.5]:443 dst [10.0.9.4]:54105 packets 1564 octets 844560 
+FLOW recv_time 2012-09-11T01:19:10.610454 proto 17 tcpflags 00 tos 00 agent [127.0.0.1] src [10.0.15.4]:443 dst [10.0.11.4]:59424 packets 1564 octets 844560 

File tools/pcap2netflow/tmp_conf_file.conf

+logfile "tmp.log"
+listen on 127.0.0.1:12345
+pidfile "/var/run/flowd.pid"
+store ALL

File tools/softflowd-0.9.8-revised-for-ns3-pcap/.cvsignore

+softflowd
+softflowctl

File tools/softflowd-0.9.8-revised-for-ns3-pcap/ChangeLog

+20061101
+ - (djm) Collect licenses into LICENSE file
+ - (djm) malloc(x*y) -> calloc(x, y)
+ - (djm) Sync sys-tree.h
+ - (djm) Release 0.9.8
+
+20060315
+ - (djm) Add "send-template" softflowctl command to resend a NetFlow 9
+   template record immediately
+
+20060315
+ - (djm) Fix DLT_RAW support, from jhanna AT shaw.ca 
+ - (djm) Support ${DESTDIR} in Makefile install target, from
+   ssnodgra AT pheran.com
+ - (djm) Encode ICMP type and code into port numbers (apparently this is
+   what Cisco exporters do), patch from ssnodgra AT pheran.com slightly
+   tweaked by me
+ - (djm) Crank version number to 0.9.8
+ - (djm) Add RPM packaging files from ssnodgra AT pheran.com
+
+20060214
+ - (djm) Add missing getopt() bit for flowtrack mode
+
+20060211
+ - (djm) Add option to ignore port and protocol information from flows,
+   allowing flows from the same IP addresses to be automatically
+   coalesced
+
+20060126
+ - (djm) Correctly expire quiescent flows when they hit maximum_lifetime; 
+   bug noticed and patch tested by andreas.brillisauer AT hetzner.de
+
+20051206
+ - (djm) Make sure installation directories exist, spotted by
+   alshu AT tut.by
+
+20051118
+ - (djm) Some extra paranoia and verbosity on malloc failures
+ - (djm) Support Linux "cooked socket" datalink type, from Tony Lewis 
+   gnutered AT yahoo.com.au
+
+20051001
+ - (djm) Fix typo, from rbreathe AT brookes.ac.uk
+
+20050505
+ - (djm) Fix time printing bug in debug mode
+ - (djm) Fix reversed NetFlow v.9 first_switched and last_switched times
+
+20050505
+ - (djm) Fix bug in sequence number generation. Reported by 
+   b.ghita AT jack.see.plymouth.ac.uk and mwlucas AT blackhelicopters.org
+ - (djm) Report pcap stats in statistics display
+
+20050114
+ - (djm) Release 0.9.7
+
+20050110
+ - (djm) Fix endianness problem in NetFlow v.9 port number export. Found and 
+   fixed by paolo.lucente AT ic.cnr.it
+ - (djm) Add option to set hoplimit/TTL in support of multicast export support
+ - (djm) Document multicast export
+
+20041109
+ - (djm) Test for struct ip6_ext in autoconf and define a replacement if 
+   missing, some systems lack it
+
+20040930
+ - (djm) Increase caplen a little for IPv6
+ - (djm) Remove unused debugging code from NetFlow v.9 support
+ - (djm) Add a timeout to cluster expiry expiry events, so we get more flows 
+    per packet. Default is to check for expiries every 60s
+ - (djm) Allow timouts to be disabled (by setting them to 0)
+ - (djm) Include IP_PROTOCOL_VERSION field in NetFlow v.9 packets
+ - (djm) Don't bother tracking IPv6 flows if NetFlow export version 
+   doesn't support it
+ - (djm) Don't crank up pcap snaplen unless we are interested in IPv6 either
+ - (djm) Unbreak v6 flow export
+ - (djm) Unbreak compilation on non-OpenBSD
+ - (djm) Update README with recent changes (NetFlow v.9, v6 flows)
+ - (djm) Release 0.9.6
+
+20040929
+ - (djm) Improve IPv6 code: track flowlables bidirectionally (but don't key on 
+   them for now), print addresses:port tuples unambiguously and apply correct 
+   timeout for ICMPv6 flows
+ - (djm) Remove NetFlow v.1 types from NetFlow v.5 code
+ - (djm) NetFlow v.9 support
+ 
+20040913
+ - (djm) Split out netflow send functions into separate files
+ - (djm) Switch to a table of netflow exporter functions in preparation for 
+   additional export protocols
+ - (djm) Collect netflow export target information together in a struct, in 
+   preparation for more export protocols and support for multiple export targets
+ - (djm) Optimise the datalink_check function, by caching the last datalink type
+   used.
+
+20040909
+ - (djm) Implement IPv6 flow tracking. Currently no export functionality.
+ - (djm) Portability fixes for Linux, add closefrom()
+ - (djm) Use strlcat/strlcpy instead of strn* functions
+ - (djm) Comment out dump_packet (uncomment when debugging)
+
+20040909
+ - (djm) inline is unnecessary
+ - (djm) Rework datalink processing, in preparation of IPv6 support
+ - (djm) Next step in preparation of IPv6 support: make flow structure and
+   lookup function support both IPv4 and IPv6 addresses (v6 addrs aren't yet
+   used)
+ - (djm) Another step on the road: factor out transport-layer protocol parsing
+   from IPv4 parsing code
+ - (djm) Be more careful about putting flows into canonical format
+ - (djm) Prepare for IPv6 packet to flow conversion routine
+
+20040901
+ - (djm) Fix a tiny, stupid bug that prevents flow export
+ - (djm) Release version 0.9.2
+
+20040827
+ - (djm) NetFlow v.5 supports 30 flows per packet
+ - (djm) Use struct sockaddr in arguments (not sockaddr_storage), properly 
+   check length
+ - (djm) Mention NetFlow v.5 support in manpage
+ - (djm) Release version 0.9.1
+
+20040716
+ - (djm) Fix collector.pl when no address family specified on commandline
+   spotted by pgennai AT netstarnetworks.com
+
+20040710
+ - (djm) Tidy up code: remove some debugging gunk, kill a global
+ - (djm) Add support for NetFlow v.5 export format to softflowd
+ - (djm) Add support for NetFlow v.5 export format to collector.pl
+
+20040430
+ - (djm) Release version 0.9
+
+20040417
+ - (djm) Fix invalid packet bug
+
+20040417
+ - (djm) Eliminate periodic expiry scans, wait in poll() only until the next 
+   scheduled expiry event
+ - (djm) Separate timeout for ICMP traffic, generic timeout is too long
+
+20040416
+ - (djm) A bunch of changes necessary to support building on Solaris 9 (though
+   the resultant binary doesn't seem to work properly):
+        - Use getaddrinfo instead of inet_aton to parse host/port for export
+        - Use setreuid if setresuid isn't around (ditto for gid)
+        - Add replacement daemon() function from OpenBSD
+        - Provide our own logit() function, because Solaris syslog() doesn't 
+          support LOG_PERROR
+        - A heap of configure and common.h additions and fixes
+ - (djm) Fix busted preprocessor
+ - (djm) Support "[host]:port" syntax to specify numeric IPv6 export target
+ - (djm) Fix connect() for IPv6 export targets
+ - (djm) IPv6 listen support for collector.pl
+ - (djm) Allow v4 operation of collector.pl if v6 modules aren't present
+ - (djm) More flow export fixes
+ - (djm) Tidy manpage and mention v6 export syntax
+ - (djm) Unbreak Solaris, pass socklen around instead of using sa_len
+ - (djm) Unbreak "make install"
+
+20040415
+ - (djm) Clear socket errors before UDP send; from pfflowd
+ - (djm) Print flow start and finish times in collector.pl
+ - (djm) Linux needs grp.h for setgroups()
+ - (djm) Never endprotoent()
+ - (djm) Use autoconf to detect various things; in preparation of more 
+   portability
+ - (djm) Detect int and define standard int types in configure
+
+20031111
+ - (djm) Remove -Werror from CFLAGS, it causes problems in released software
+
+20031109
+ - (djm) Give compile-time choice over flow and expiry event tree type
+   default is splay tree for flows and red-black tree for expiry events
+   (limited benchmarking indicates that this is the fastest)
+ - (djm) Lock the BPF device to prevent changes should the unpriv child
+   be compromised (only OpenBSD supports this ioctl for now)
+
+20031001
+ - (djm) Realloc audit
+ - (djm) Chroot to /var/empty and drop privileges on daemonisation
+ - (djm) More things TODO
+
+20030620
+ - (djm) Fixup collector timestamp printing
+ - (djm) Rework TODO, add section on planned fragment handling
+ - (djm) Add "strip" target to Makefile
+ - (djm) Add "help" keyword to recognised softflowctl responses
+ - (djm) Fix fragment handling bug: we would try to look into fragmented
+   payload on later fragments. This could cause random tcp/udp  port numbers
+   to be recorded.
+ - (djm) Fix malicious fragment handling bug: deliberately tiny fragments 
+   (e.g. http://citeseer.nj.nec.com/ptacek98insertion.html) would be ignored
+   and would not create flow entries.
+ - (djm) Count fragments that we have seen
+ - (djm) Release version 0.8.1
+
+20030307
+ - (djm) Add basic perl netflow collector
+
+20021110
+ - (djm) Refactor, dramatically shrink mainloop
+
+20021105
+ - (djm) Don't exit on failure to lookup net/mask. From Alejandro Roman 
+   <aroman@uyr.com.ar>
+
+20021031
+ - (djm) Add some examples to the manpage
+
+20021030
+ - (djm) New user-friendly time specification code from OpenSSH/Kevin Steves
+ - (djm) Always use local sys-tree.h (for older OpenBSD's)
+
+20021029
+ - (djm) Multiple fixes and improvements from Octavian Cerna <tavy@ylabs.com>
+    - softflowd.c (connsock): Fix arguments to `connect': addr is a pointer, 
+	not a structure.
+      (flow_update_expiry): Properly compute the flow lifetime.
+      (send_netflow_v1): Count the leftover packet.
+	Send flow_start, flow_finish and uptime_ms as Cisco equipment 
+	does: milliseconds since system boot.
+      (timeval_sub_ms): New function.
+      (main): Changed POLL_WAIT to be (EXPIRY_WAIT/2) as stated in the 
+	comment above `poll': twice per recheck.
+	`poll' takes the last argument in milliseconds.
+	Initialize system_boot_time as the time at the start of capture
+	(fixme: how does this affect reading from capture files?)
+
+20021024
+ - (djm) Release softflowd-0.7.1
+
+$Id: ChangeLog,v 1.87 2006/11/02 06:36:16 djm Exp $

File tools/softflowd-0.9.8-revised-for-ns3-pcap/LICENSE

+Original code is licensed under the following BSD-style license:
+
+/*
+ * Copyright 2002-2006 Damien Miller <djm@mindrot.org> 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+closefrom.c:
+
+/*
+ * Copyright (c) 2004 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+convtime.c:
+
+/*
+ * Copyright (c) 2001 Kevin Steves.  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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+daemon.c:
+
+/*-
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  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 University 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 REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+strlcat.c, strlcpy.c:
+
+/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+sys-tree.h:
+
+/*
+ * Copyright 2002 Niels Provos <provos@citi.umich.edu>
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+

File tools/softflowd-0.9.8-revised-for-ns3-pcap/Makefile

+# $Id: Makefile.in,v 1.9 2006/03/14 22:55:41 djm Exp $
+
+prefix=/usr/local
+exec_prefix=${prefix}
+bindir=${exec_prefix}/bin
+sbindir=${exec_prefix}/sbin
+libexecdir=${exec_prefix}/libexec
+datadir=${prefix}/share
+mandir=${prefix}/share/man
+sysconfdir=${prefix}/etc
+srcdir=.
+top_srcdir=.
+
+CC=gcc
+LDFLAGS=
+CFLAGS=-g -O2
+CPPFLAGS=-I$(srcdir) 
+LIBS=-lpcap 
+EXEEXT=
+INSTALL=/usr/bin/install -c
+
+#CFLAGS+=-DFLOW_RB		# Use red-black tree for flows
+CFLAGS+=-DFLOW_SPLAY		# Use splay tree for flows
+CFLAGS+=-DEXPIRY_RB		# Use red-black tree for expiry events
+#CFLAGS+=-DEXPIRY_SPLAY		# Use splay tree for expiry events
+
+TARGETS=softflowd${EXEEXT} softflowctl${EXEEXT}
+
+COMMON=convtime.o strlcpy.o strlcat.o closefrom.o daemon.o
+
+all: $(TARGETS)
+
+softflowd${EXEEXT}: log.o softflowd.o netflow1.o netflow5.o netflow9.o $(COMMON)
+	$(CC) $(LDFLAGS) -o $@ log.o netflow1.o netflow5.o netflow9.o softflowd.o $(COMMON) $(LIBS)
+
+softflowctl${EXEEXT}: softflowctl.o $(COMMON)
+	$(CC) $(LDFLAGS) -o $@ softflowctl.o $(COMMON) $(LIBS)
+
+clean:
+	rm -f $(TARGETS) *.o core *.core
+
+realclean: clean
+	rm -rf autom4te.cache Makefile config.log config.status
+
+distclean: realclean
+	rm -f config.h* configure
+
+strip:
+	strip $(TARGETS)
+
+install:
+	[ -d $(DESTDIR)$(sbindir) ] || \
+	    $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir)
+	[ -d $(DESTDIR)$(mandir)/man8 ] || \
+	    $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man8
+	$(INSTALL) -m 0755 -s softflowd $(DESTDIR)$(sbindir)/softflowd
+	$(INSTALL) -m 0755 -s softflowctl $(DESTDIR)$(sbindir)/softflowctl
+	$(INSTALL) -m 0644 softflowd.8 $(DESTDIR)$(mandir)/man8/softflowd.8
+	$(INSTALL) -m 0644 softflowctl.8 $(DESTDIR)$(mandir)/man8/softflowctl.8

File tools/softflowd-0.9.8-revised-for-ns3-pcap/Makefile.in

+# $Id: Makefile.in,v 1.9 2006/03/14 22:55:41 djm Exp $
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+libexecdir=@libexecdir@
+datadir=@datadir@
+mandir=@mandir@
+sysconfdir=@sysconfdir@
+srcdir=@srcdir@
+top_srcdir=@top_srcdir@
+VPATH=@srcdir@
+CC=@CC@
+LDFLAGS=@LDFLAGS@
+CFLAGS=@CFLAGS@
+CPPFLAGS=-I$(srcdir) @CPPFLAGS@
+LIBS=@LIBS@
+EXEEXT=@EXEEXT@
+INSTALL=@INSTALL@
+
+#CFLAGS+=-DFLOW_RB		# Use red-black tree for flows
+CFLAGS+=-DFLOW_SPLAY		# Use splay tree for flows
+CFLAGS+=-DEXPIRY_RB		# Use red-black tree for expiry events
+#CFLAGS+=-DEXPIRY_SPLAY		# Use splay tree for expiry events
+
+TARGETS=softflowd${EXEEXT} softflowctl${EXEEXT}
+
+COMMON=convtime.o strlcpy.o strlcat.o closefrom.o daemon.o
+
+all: $(TARGETS)
+
+softflowd${EXEEXT}: log.o softflowd.o netflow1.o netflow5.o netflow9.o $(COMMON)
+	$(CC) $(LDFLAGS) -o $@ log.o netflow1.o netflow5.o netflow9.o softflowd.o $(COMMON) $(LIBS)
+
+softflowctl${EXEEXT}: softflowctl.o $(COMMON)
+	$(CC) $(LDFLAGS) -o $@ softflowctl.o $(COMMON) $(LIBS)
+
+clean:
+	rm -f $(TARGETS) *.o core *.core
+
+realclean: clean
+	rm -rf autom4te.cache Makefile config.log config.status
+
+distclean: realclean
+	rm -f config.h* configure
+
+strip:
+	strip $(TARGETS)
+
+install:
+	[ -d $(DESTDIR)$(sbindir) ] || \
+	    $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir)
+	[ -d $(DESTDIR)$(mandir)/man8 ] || \
+	    $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man8
+	$(INSTALL) -m 0755 -s softflowd $(DESTDIR)$(sbindir)/softflowd
+	$(INSTALL) -m 0755 -s softflowctl $(DESTDIR)$(sbindir)/softflowctl
+	$(INSTALL) -m 0644 softflowd.8 $(DESTDIR)$(mandir)/man8/softflowd.8
+	$(INSTALL) -m 0644 softflowctl.8 $(DESTDIR)$(mandir)/man8/softflowctl.8

File tools/softflowd-0.9.8-revised-for-ns3-pcap/Obsolete_Packets.cap

Binary file added.

File tools/softflowd-0.9.8-revised-for-ns3-pcap/README

+Welcome to softflowd, a flow-based network monitor.
+
+Introduction
+------------
+
+softflowd listens promiscuously on a network interface and semi-statefully
+tracks network flows. These flows can be reported using NetFlow version 1, 5 
+or 9 datagrams. softflowd is fully IPv6 capable: it can track IPv6 flows and 
+export to IPv6 hosts.
+
+More details about softflowd's function and usage may be found in the
+supplied manpages, which you can view prior to installation using
+
+/usr/bin/nroff -c -mandoc softflowd.8 | less
+/usr/bin/nroff -c -mandoc softflowctl.8 | less
+
+If you are in need of a NetFlow collector, you may be interested in 
+softflowd's companion project "flowd" (http://www.mindrot.org/flowd.html). 
+flowd is a NetFlow collector that is maintained in parallel with
+softflowd and includes a few handy features, such as the ability
+to filter flows it receives as well as Perl and Python APIs to its
+storage format. NB. You don't have to use flowd: any NetFlow compatible 
+collector should work with softflowd. An example Perl collector is included 
+for testing purposes as collector.pl, but it doesn't yet support NetFlow v.9
+
+Installing
+----------
+
+Building softflowd should be as simple as typing:
+
+./configure
+make
+make install
+
+Unfortunately some systems like to make life complicated. Things work
+fine on the systems that I develop and test on (OpenBSD and Linux).
+There is peliminary support for Solaris 9 (i.e. it compiled), but no
+testing on this platform has been performed.
+
+Licensing
+---------
+
+Softflowd is licensed under a two-term BSD license (see the source
+files for details). The code in sys-tree.h is Copyright Niels Provos
+<provos@citi.umich.edu> and comes straight from OpenBSD CVS, convtime.c
+comes is Copyright Kevin Steves and comes from OpenSSH (misc.c). Both
+of these files are licensed under two-term BSD licenses too. strlcpy.c,
+strlcat.c and closefrom.c also come from OpenBSD CVS and are Copyright
+Todd C. Miller. Please refer to the LICENSE file for full details.
+
+Reporting Bugs
+--------------
+
+Please report bugs in softflowd to http://bugzilla.mindrot.org/ If you
+find a security bug, please report it directly by email. If you have any
+feedback or questions, please email me:
+
+Contributing
+------------
+
+Softflowd has an extensive TODO list of interesting features, large and
+small, that are waiting to be implemented. If you are interested in
+helping, please contact me.
+
+Damien Miller <djm@mindrot.org>
+
+$Id: README,v 1.7 2006/11/02 06:34:18 djm Exp $

File tools/softflowd-0.9.8-revised-for-ns3-pcap/TODO

+Things yet to do:
+
+softflowd
+---------
+
+ - Use strtonum()
+
+ Flow tracking engine
+  - Verify checksums (maybe. perhaps bad for accounting, good for flow tracking)
+  - Fragment processing
+    - We don't handle fragments right
+      - This shouldn't be too hard or too memory intensive. We just need to 
+	keep a tree of fragment entries. Each entry would need to contain 
+	enough information to reconstruct the flow (source/dest addr, etc), 
+	but also fragment related info: IP id, list of fragment offsets. etc.
+      - When we receive a new fragment, we add an entry to this tree (keyed 
+	by source IP, protocol, IP id)
+      - Each new fragment matched in the tree gets its offset added to the 
+	list, until all fragments have been seen
+      - Must be careful, as later fragments may arrive before inital one
+      - When does accounting occur? 
+	- Upon receipt of inital fragment? (and thus for ever frag thereafter)
+	- When we have seen all fragments? (what if we don't?)
+      - Must limit size of tree
+      - Must have fragment timeout (what happens then, apart from removal?)
+   - Timeouts
+    - Timeout for unanswered TCP connection
+    - Ditto orphaned connections (one packet in one direction only)
+    - Track ICMP generated by TCP/UDP session (painful, probably unecessary)
+    - More datalink types
+    - Improve fast-expiry of TCP session by tracking FIN sequence numbers
+  - Multiple interface support
+    - Requires some way to avoid duplicate recording of flows (IP ID)
+  - Track IPsec SPIs
+  - Track ToS / DSCP
+  - Make counters 64 bits
+    - We can report these directly for NetFlow v.9
+    - For older NetFlow, report by sending multiple flows until counter < 2^32
+
+ Misc features
+  - Ability to open more than one interface (maybe)
+  - Ability to read more than one pcap file (maybe)
+  - Fork for ctlsock actions? (don't block mainloop)
+  - Remote control over network (requires SSL)
+
+ Performance
+  - Profile and see where the hot spots are
+  - Fast "new flow" test using a bloom filter
+  - See if we can reduce per-packet overhead more
+    - Cost of expiry remove and re-add per packet
+  - Stop run-time malloc (maybe)
+    - Preallocate a pool of expiry events and flow entries
+      - keep a queue, pick/push first from head
+
+ Exporter features
+  - sflow support (www.sflow.org)
+    - Needs XDR encoding
+  - Ability to export to multiple hosts
+    - Partly done, just need to keep a list of targets instead of a single one
+  - Ability to directly write to file (maybe. If so, reuse flowd store code)
+  - NetFlow v.9 field selection
+
+ Statistics code
+  - Collect more statistics (maybe)
+    - Advanced packet analysis: store hash of packet payload, keep 
+      statistics on traffic similarity
+       - Bloom filter?
+    - Option to record histograms of
+      - Flow lifetime and size, packet size
+    - Flow bandwidth
+    - Per well-known-port
+      - How to do this quicky? Memory efficiently?
+    - Per IP address/range
+      - How to do this quicky? Memory efficiently?
+    - Moving averages
+  - Track traffic over lifetime of flow
+    - Maintain linked list traffic counts, keyed by time interval
+    - E.g. key by (now / 300)
+      - Or (now - start_time) / 300 (better)
+    - When new packet comes in:
+      - If timestamp of HEAD of list == (now / xxx), then counter += octets
+      - Otherwise create new traffic counter at HEAD and update it
+        - Then trim tail if the list length is too big
+    - Maybe store "hunks" of data, rather than individual counts in the 
+      list, as storing a single int is a huge waste of space
+    - Maybe a rrdtool-like heirarchy of timespans
+      - 300 seconds (5 minutes)       (2400 bytes)
+      - 360 1-minute blocks (6 hours) (2880 bytes)
+      - 288 10-minute blocks (2 days) (2304 bytes)
+      - 336 1-hour blocks (2 weeks)   (2688 bytes)
+        - Total 10kb worst-case per-flow (scary, probably overkill)
+
+softflowctl
+-----------
+
+  - Extend interface
+    - Query for specific flows (e.g. by address)
+      - Do this in softflowd or softflowctl?
+    - Expire/delete specific flows (maybe)
+  - Runtime respecify timeouts
+  - Real-time binary dump of flowtable (shm/mmap fd pass?)
+    - ntop like view
+    - Spiffy GUI (separate tool)
+

File tools/softflowd-0.9.8-revised-for-ns3-pcap/aclocal.m4

+dnl Nothing here

File tools/softflowd-0.9.8-revised-for-ns3-pcap/closefrom.c

+/*
+ * Copyright (c) 2004 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "common.h"
+
+#ifndef HAVE_CLOSEFROM
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <stddef.h>
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# ifdef HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# ifdef HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# ifdef HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+#endif
+
+#ifndef OPEN_MAX
+# define OPEN_MAX	256
+#endif
+
+RCSID("$Id: closefrom.c,v 1.1 2004/09/10 09:08:08 djm Exp $");
+
+#ifndef lint
+static const char rcsid[] = "$Sudo: closefrom.c,v 1.6 2004/06/01 20:51:56 millert Exp $";
+#endif /* lint */
+
+/*
+ * Close all file descriptors greater than or equal to lowfd.
+ */
+void
+closefrom(int lowfd)
+{
+    long fd, maxfd;
+#if defined(HAVE_DIRFD) && defined(HAVE_PROC_PID)
+    char fdpath[PATH_MAX], *endp;
+    struct dirent *dent;
+    DIR *dirp;
+    int len;
+
+    /* Check for a /proc/$$/fd directory. */
+    len = snprintf(fdpath, sizeof(fdpath), "/proc/%ld/fd", (long)getpid());
+    if (len != -1 && len <= sizeof(fdpath) && (dirp = opendir(fdpath))) {
+	while ((dent = readdir(dirp)) != NULL) {
+	    fd = strtol(dent->d_name, &endp, 10);
+	    if (dent->d_name != endp && *endp == '\0' &&
+		fd >= 0 && fd < INT_MAX && fd >= lowfd && fd != dirfd(dirp))
+		(void) close((int) fd);
+	}
+	(void) closedir(dirp);
+    } else
+#endif
+    {
+	/*
+	 * Fall back on sysconf() or getdtablesize().  We avoid checking
+	 * resource limits since it is possible to open a file descriptor
+	 * and then drop the rlimit such that it is below the open fd.
+	 */
+#ifdef HAVE_SYSCONF
+	maxfd = sysconf(_SC_OPEN_MAX);
+#else
+	maxfd = getdtablesize();
+#endif /* HAVE_SYSCONF */
+	if (maxfd < 0)
+	    maxfd = OPEN_MAX;
+
+	for (fd = lowfd; fd < maxfd; fd++)
+	    (void) close((int) fd);
+    }
+}
+
+#endif /* HAVE_CLOSEFROM */
+

File tools/softflowd-0.9.8-revised-for-ns3-pcap/closefrom.o

Binary file added.

File tools/softflowd-0.9.8-revised-for-ns3-pcap/collector.pl

+#!/usr/bin/perl -w
+
+# This is a Cisco NetFlow datagram collector
+
+# Netflow protocol reference:
+# http://www.cisco.com/univercd/cc/td/doc/product/rtrmgmt/nfc/nfc_3_0/nfc_ug/nfcform.htm
+
+# XXX Doesn't support NetFlow 9
+
+my $af;
+
+BEGIN {
+	use strict;
+	use warnings;
+	use IO qw(Socket);
+	use Socket;
+	use Carp;
+	use POSIX qw(strftime);
+	use Getopt::Long;
+	eval "use IO::Socket::INET6;";
+	eval "use Socket6;";
+}
+
+############################################################################
+
+sub timestamp()
+{
+	return strftime "%Y-%m-%dT%H:%M:%S", localtime;
+}
+
+sub fuptime($)
+{
+	my $t = shift;
+	my $r = "";
+	my $tmp;
+	
+	# Milliseconds
+	$tmp = $t % 1000;
+	$r = sprintf ".%03u%s", $tmp, $r;
+
+	# Seconds
+	$t = int($t / 1000);
+	$tmp = $t % 60;
+	$r = "${tmp}s${r}";
+
+	# Minutes
+	$t = int($t / 60);
+	$tmp = $t % 60;
+	$r = "${tmp}m${r}" if $tmp;
+
+	# Hours
+	$t = int($t / 60);
+	$tmp = $t % 24;
+	$r = "${tmp}h${r}" if $tmp;
+
+	# Days
+	$t = int($t / 24);
+	$tmp = $t % 7;
+	$r = "${tmp}d${r}" if $tmp;
+
+	# Weeks
+	$t = int($t / 7);
+	$tmp = $t % 52;
+	$r = "${tmp}w${r}" if $tmp;
+
+	# Years
+	$t = int($t / 52);
+	$r = "${tmp}y${r}" if $tmp;
+
+	return $r;
+}
+
+sub do_listen($$)
+{
+	my $port = shift
+		or confess "No UDP port specified";
+
+        my $socket;
+
+	if ($af == 4) {
+		$socket = IO::Socket::INET->new(Proto=>'udp', LocalPort=>$port)
+			or croak "Couldn't open UDP socket: $!";
+	} elsif ($af == 6) {
+		$socket = IO::Socket::INET6->new(Proto=>'udp', LocalPort=>$port)
+			or croak "Couldn't open UDP socket: $!";
+ 	} else {
+		croak "Unsupported AF";
+	}
+
+	return $socket;
+}
+
+sub process_nf_v1($$)
+{
+	my $sender = shift;
+	my $pkt = shift;
+	my %header;
+	my %flow;
+	my $sender_s;
+
+	%header = qw();
+
+	$sender_s = inet_ntoa($sender) if $af == 4;
+	$sender_s = inet_ntop(AF_INET6, $sender) if $af == 6;
+
+	($header{ver}, $header{flows}, $header{uptime}, $header{secs}, 
+	 $header{nsecs}) = unpack("nnNNN", $pkt);
+
+	if (length($pkt) < (16 + (48 * $header{flows}))) {
+		printf STDERR timestamp()." Short Netflow v.1 packet: %d < %d\n",
+		    length($pkt), 16 + (48 * $header{flows});
+		return;
+	}
+
+	printf timestamp() . " HEADER v.%u (%u flow%s)\n", $header{ver},
+	    $header{flows}, $header{flows} == 1 ? "" : "s";
+
+	for(my $i = 0; $i < $header{flows}; $i++) {
+		my $off = 16 + (48 * $i);
+		my $ptr = substr($pkt, $off, 52);
+
+		%flow = qw();
+
+		(my $src1, my $src2, my $src3, my $src4,
+		 my $dst1, my $dst2, my $dst3, my $dst4, 
+		 my $nxt1, my $nxt2, my $nxt3, my $nxt4, 
+		 $flow{in_ndx}, $flow{out_ndx}, $flow{pkts}, $flow{bytes}, 
+		 $flow{start}, $flow{finish}, $flow{src_port}, $flow{dst_port}, 
+		 my $pad1, $flow{protocol}, $flow{tos}, $flow{tcp_flags}) =
+		    unpack("CCCCCCCCCCCCnnNNNNnnnCCC", $ptr);
+
+		$flow{src} = sprintf "%u.%u.%u.%u", $src1, $src2, $src3, $src4;
+		$flow{dst} = sprintf "%u.%u.%u.%u", $dst1, $dst2, $dst3, $dst4;
+		$flow{nxt} = sprintf "%u.%u.%u.%u", $nxt1, $nxt2, $nxt3, $nxt4;
+
+		printf timestamp() . " " .
+		    "from %s started %s finish %s proto %u %s:%u > %s:%u %u " . 
+		    "packets %u octets\n",
+		    $sender_s,
+		    fuptime($flow{start}), fuptime($flow{finish}), 
+		    $flow{protocol}, 
+		    $flow{src}, $flow{src_port}, $flow{dst}, $flow{dst_port}, 
+		    $flow{pkts}, $flow{bytes};
+	}
+}
+
+sub process_nf_v5($$)
+{
+	my $sender = shift;
+	my $pkt = shift;
+	my %header;
+	my %flow;
+	my $sender_s;
+
+	%header = qw();
+
+	$sender_s = inet_ntoa($sender) if $af == 4;
+	$sender_s = inet_ntop(AF_INET6, $sender) if $af == 6;
+
+	($header{ver}, $header{flows}, $header{uptime}, $header{secs}, 
+	 $header{nsecs}, $header{flow_seq}, ) = unpack("nnNNNN", $pkt);
+
+	if (length($pkt) < (24 + (48 * $header{flows}))) {
+		printf STDERR timestamp()." Short Netflow v.1 packet: %d < %d\n",
+		    length($pkt), 24 + (48 * $header{flows});
+		return;
+	}
+
+	printf timestamp() . " HEADER v.%u (%u flow%s) seq %u\n", $header{ver},
+	    $header{flows}, $header{flows} == 1 ? "" : "s", $header{flow_seq};
+
+	for(my $i = 0; $i < $header{flows}; $i++) {
+		my $off = 24 + (48 * $i);
+		my $ptr = substr($pkt, $off, 52);
+
+		%flow = qw();
+
+		(my $src1, my $src2, my $src3, my $src4,
+		 my $dst1, my $dst2, my $dst3, my $dst4, 
+		 my $nxt1, my $nxt2, my $nxt3, my $nxt4, 
+		 $flow{in_ndx}, $flow{out_ndx}, $flow{pkts}, $flow{bytes}, 
+		 $flow{start}, $flow{finish}, $flow{src_port}, $flow{dst_port}, 
+		 my $pad1, $flow{tcp_flags}, $flow{protocol}, $flow{tos},
+		 $flow{src_as}, $flow{dst_as},
+		 $flow{src_mask}, $flow{dst_mask}) =
+		    unpack("CCCCCCCCCCCCnnNNNNnnCCCCnnCC", $ptr);
+
+		$flow{src} = sprintf "%u.%u.%u.%u", $src1, $src2, $src3, $src4;
+		$flow{dst} = sprintf "%u.%u.%u.%u", $dst1, $dst2, $dst3, $dst4;
+		$flow{nxt} = sprintf "%u.%u.%u.%u", $nxt1, $nxt2, $nxt3, $nxt4;
+
+		printf timestamp() . " " .
+		    "from %s started %s finish %s proto %u %s:%u > %s:%u %u " . 
+		    "packets %u octets\n",
+		    $sender_s,
+		    fuptime($flow{start}), fuptime($flow{finish}), 
+		    $flow{protocol}, 
+		    $flow{src}, $flow{src_port}, $flow{dst}, $flow{dst_port}, 
+		    $flow{pkts}, $flow{bytes};
+	}
+}
+
+############################################################################
+
+# Commandline options
+my $debug = 0;
+my $af4 = 0;
+my $af6 = 0;
+my $port;
+
+#		Long option		Short option
+GetOptions(	'debug+' => \$debug,	'd+' => \$debug,
+					'4+' => \$af4,
+					'6+' => \$af6,
+		'port=i' => \$port,	'p=i' => \$port);
+
+# Unbuffer output
+$| = 1;
+
+die "The -4 and -6 are mutually exclusive\n" if $af4 && $af6;
+die "You must specify a port (collector.pl -p XXX).\n" unless $port;
+
+$af4 = $af = 4 if $af4 || (!$af4 && !$af6);
+$af6 = $af = 6 if $af6;
+
+# These modules aren't standard everywhere, so load them only if necessary
+
+# Main loop - receive and process a packet
+for (;;) {
+	my $socket;
+	my $from;
+	my $payload;
+	my $ver;
+	my $failcount = 0;
+	my $netflow;
+	my $junk;
+	my $sender;
+
+	# Open the listening port if we haven't already
+	$socket = do_listen($port, $af) unless defined $socket;
+
+	# Fetch a packet
+	$from = $socket->recv($payload, 8192, 0);
+	
+	($junk, $sender) = unpack_sockaddr_in($from) if $af4;
+	($junk, $sender) = unpack_sockaddr_in6($from) if $af6;
+
+	# Reopen listening socket on error
+	if (!defined $from) {
+		$socket->close;
+		undef $socket;
+
+		$failcount++;
+		die "Couldn't recv: $!\n" if ($failcount > 5);
+		next; # Socket will be reopened at start of loop
+	}
+	
+	if (length($payload) < 16) {
+		printf STDERR timestamp()." Short packet recevied: %d < 16\n",
+		    length($payload);
+		next;
+	}
+
+	# The version is always the first 16 bits of the packet
+	($ver) = unpack("n", $payload);
+
+	if	($ver == 1)	{ process_nf_v1($sender, $payload); }
+	elsif	($ver == 5)	{ process_nf_v5($sender, $payload); }
+	else {
+		printf STDERR timestamp()." Unsupported netflow version %d\n",
+		    $ver;
+		next;
+	}
+	
+	undef $payload;
+	next;	
+}
+
+exit 0;

File tools/softflowd-0.9.8-revised-for-ns3-pcap/common.h

+/*
+ * Copyright (c) 2002 Damien Miller.  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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _SFD_COMMON_H
+#define _SFD_COMMON_H
+
+#include "config.h"
+
+#define _BSD_SOURCE /* Needed for BSD-style struct ip,tcp,udp on Linux */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/poll.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/un.h>
+
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip6.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
+#include <arpa/inet.h>
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <grp.h>
+#include <netdb.h>
+#include <limits.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include <syslog.h>
+#include <time.h>
+
+#if defined(HAVE_NET_BPF_H)
+#include <net/bpf.h>
+#elif defined(HAVE_PCAP_BPF_H)
+#include <pcap-bpf.h>
+#endif
+#if defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
+
+/* The name of the program */
+#define PROGNAME		"softflowd"
+
+/* The name of the program */
+#define PROGVER			"0.9.8"
+
+/* Default pidfile */
+#define DEFAULT_PIDFILE		"/var/run/" PROGNAME ".pid"
+
+/* Default control socket */
+#define DEFAULT_CTLSOCK		"/var/run/" PROGNAME ".ctl"
+
+#define RCSID(msg) \
+	static /**/const char *const flowd_rcsid[] =		\
+	    { (const char *)flowd_rcsid, "\100(#)" msg }	\
+
+#ifndef IP_OFFMASK
+# define IP_OFFMASK		0x1fff	/* mask for fragmenting bits */
+#endif
+#ifndef IPV6_VERSION
+#define IPV6_VERSION		0x60
+#endif
+#ifndef IPV6_VERSION_MASK
+#define IPV6_VERSION_MASK	0xf0
+#endif
+#ifndef IPV6_FLOWINFO_MASK
+#define IPV6_FLOWINFO_MASK	ntohl(0x0fffffff)
+#endif
+#ifndef IPV6_FLOWLABEL_MASK
+#define IPV6_FLOWLABEL_MASK	ntohl(0x000fffff)
+#endif
+
+#ifndef _PATH_DEVNULL
+# define _PATH_DEVNULL		"/dev/null"
+#endif
+
+#ifndef MIN
+# define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+#ifndef MAX
+# define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+#ifndef offsetof
+# define offsetof(type, member) ((size_t) &((type *)0)->member)
+#endif
+
+#if defined(__GNUC__)
+# ifndef __dead
+#  define __dead                __attribute__((__noreturn__))
+# endif
+# ifndef __packed
+#  define __packed              __attribute__((__packed__))
+# endif
+#endif
+
+#if !defined(HAVE_INT8_T) && defined(OUR_CFG_INT8_T)
+typedef OUR_CFG_INT8_T int8_t;
+#endif
+#if !defined(HAVE_INT16_T) && defined(OUR_CFG_INT16_T)
+typedef OUR_CFG_INT16_T int16_t;
+#endif
+#if !defined(HAVE_INT32_T) && defined(OUR_CFG_INT32_T)
+typedef OUR_CFG_INT32_T int32_t;
+#endif
+#if !defined(HAVE_INT64_T) && defined(OUR_CFG_INT64_T)
+typedef OUR_CFG_INT64_T int64_t;
+#endif
+#if !defined(HAVE_U_INT8_T) && defined(OUR_CFG_U_INT8_T)
+typedef OUR_CFG_U_INT8_T u_int8_t;
+#endif
+#if !defined(HAVE_U_INT16_T) && defined(OUR_CFG_U_INT16_T)
+typedef OUR_CFG_U_INT16_T u_int16_t;
+#endif
+#if !defined(HAVE_U_INT32_T) && defined(OUR_CFG_U_INT32_T)
+typedef OUR_CFG_U_INT32_T u_int32_t;
+#endif
+#if !defined(HAVE_U_INT64_T) && defined(OUR_CFG_U_INT64_T)
+typedef OUR_CFG_U_INT64_T u_int64_t;
+#endif
+
+#ifndef HAVE_STRLCPY
+size_t strlcpy(char *dst, const char *src, size_t siz);
+#endif
+#ifndef HAVE_STRLCAT
+size_t strlcat(char *dst, const char *src, size_t siz);
+#endif
+#ifndef HAVE_CLOSEFROM
+void closefrom(int lowfd);
+#endif
+
+#ifndef HAVE_STRUCT_IP6_EXT
+struct ip6_ext {
+	u_int8_t ip6e_nxt;
+	u_int8_t ip6e_len;
+} __packed;
+#endif
+
+#endif /* _SFD_COMMON_H */

File tools/softflowd-0.9.8-revised-for-ns3-pcap/config.h

+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the `closefrom' function. */
+/* #undef HAVE_CLOSEFROM */
+
+/* Define to 1 if you have the `daemon' function. */
+#define HAVE_DAEMON 1
+
+/* Define to 1 if the system has the type `int16_t'. */
+#define HAVE_INT16_T 1
+
+/* Define to 1 if the system has the type `int32_t'. */
+#define HAVE_INT32_T 1
+
+/* Define to 1 if the system has the type `int64_t'. */
+#define HAVE_INT64_T 1
+
+/* Define to 1 if the system has the type `int8_t'. */
+#define HAVE_INT8_T 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `pcap' library (-lpcap). */
+#define HAVE_LIBPCAP 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <net/bpf.h> header file. */
+/* #undef HAVE_NET_BPF_H */
+
+/* Define to 1 if you have the <pcap-bpf.h> header file. */
+#define HAVE_PCAP_BPF_H 1
+
+/* Define to 1 if you have the <pcap.h> header file. */
+#define HAVE_PCAP_H 1
+
+/* Define to 1 if you have the `setgid' function. */
+#define HAVE_SETGID 1
+
+/* Define to 1 if you have the `setresgid' function. */
+#define HAVE_SETRESGID 1
+
+/* Define to 1 if you have the `setresuid' function. */
+#define HAVE_SETRESUID 1
+
+/* Define to 1 if you have the `setreuid' function. */
+#define HAVE_SETREUID 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcat' function. */
+/* #undef HAVE_STRLCAT */
+
+/* Define to 1 if you have the `strlcpy' function. */
+/* #undef HAVE_STRLCPY */
+
+/* struct ip6_ext.ip6e_nxt exists */
+#define HAVE_STRUCT_IP6_EXT 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#define HAVE_UINT16_T 1
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#define HAVE_UINT32_T 1
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#define HAVE_UINT64_T 1
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#define HAVE_UINT8_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if the system has the type `u_int16_t'. */
+#define HAVE_U_INT16_T 1
+
+/* Define to 1 if the system has the type `u_int32_t'. */
+#define HAVE_U_INT32_T 1
+
+/* Define to 1 if the system has the type `u_int64_t'. */
+#define HAVE_U_INT64_T 1
+
+/* Define to 1 if the system has the type `u_int8_t'. */
+#define HAVE_U_INT8_T 1
+
+/* 16-bit signed int */
+#define OUR_CFG_INT16_T short int
+
+/* 32-bit signed int */
+#define OUR_CFG_INT32_T int
+
+/* 64-bit signed int */
+#define OUR_CFG_INT64_T long int
+
+/* 8-bit signed int */
+#define OUR_CFG_INT8_T signed char
+
+/* 16-bit unsigned int */
+#define OUR_CFG_U_INT16_T uint16_t
+
+/* 32-bit unsigned int */
+#define OUR_CFG_U_INT32_T uint32_t
+
+/* 64-bit unsigned int */
+#define OUR_CFG_U_INT64_T uint64_t
+
+/* 8-bit unsigned int */
+#define OUR_CFG_U_INT8_T uint8_t
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* The size of `char', as computed by sizeof. */
+#define SIZEOF_CHAR 1
+
+/* The size of `int', as computed by sizeof. */
+#define SIZEOF_INT 4
+
+/* The size of `long int', as computed by sizeof. */
+#define SIZEOF_LONG_INT 8
+
+/* The size of `long long int', as computed by sizeof. */
+#define SIZEOF_LONG_LONG_INT 8
+
+/* The size of `short int', as computed by sizeof. */
+#define SIZEOF_SHORT_INT 2
+
+/* struct sockaddr contains length */
+/* #undef SOCK_HAS_LEN */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1

File tools/softflowd-0.9.8-revised-for-ns3-pcap/config.h.in

+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the `closefrom' function. */
+#undef HAVE_CLOSEFROM
+
+/* Define to 1 if you have the `daemon' function. */
+#undef HAVE_DAEMON
+
+/* Define to 1 if the system has the type `int16_t'. */
+#undef HAVE_INT16_T
+
+/* Define to 1 if the system has the type `int32_t'. */
+#undef HAVE_INT32_T
+
+/* Define to 1 if the system has the type `int64_t'. */
+#undef HAVE_INT64_T
+
+/* Define to 1 if the system has the type `int8_t'. */
+#undef HAVE_INT8_T
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `pcap' library (-lpcap). */
+#undef HAVE_LIBPCAP
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <net/bpf.h> header file. */
+#undef HAVE_NET_BPF_H
+
+/* Define to 1 if you have the <pcap-bpf.h> header file. */
+#undef HAVE_PCAP_BPF_H
+
+/* Define to 1 if you have the <pcap.h> header file. */
+#undef HAVE_PCAP_H
+
+/* Define to 1 if you have the `setgid' function. */
+#undef HAVE_SETGID
+
+/* Define to 1 if you have the `setresgid' function. */
+#undef HAVE_SETRESGID
+
+/* Define to 1 if you have the `setresuid' function. */
+#undef HAVE_SETRESUID
+
+/* Define to 1 if you have the `setreuid' function. */
+#undef HAVE_SETREUID
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* struct ip6_ext.ip6e_nxt exists */
+#undef HAVE_STRUCT_IP6_EXT
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#undef HAVE_UINT16_T
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#undef HAVE_UINT32_T
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#undef HAVE_UINT64_T
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#undef HAVE_UINT8_T
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if the system has the type `u_int16_t'. */
+#undef HAVE_U_INT16_T
+
+/* Define to 1 if the system has the type `u_int32_t'. */
+#undef HAVE_U_INT32_T
+
+/* Define to 1 if the system has the type `u_int64_t'. */
+#undef HAVE_U_INT64_T
+
+/* Define to 1 if the system has the type `u_int8_t'. */
+#undef HAVE_U_INT8_T
+
+/* 16-bit signed int */
+#undef OUR_CFG_INT16_T
+
+/* 32-bit signed int */
+#undef OUR_CFG_INT32_T
+
+/* 64-bit signed int */
+#undef OUR_CFG_INT64_T
+
+/* 8-bit signed int */
+#undef OUR_CFG_INT8_T
+
+/* 16-bit unsigned int */
+#undef OUR_CFG_U_INT16_T
+
+/* 32-bit unsigned int */
+#undef OUR_CFG_U_INT32_T
+
+/* 64-bit unsigned int */
+#undef OUR_CFG_U_INT64_T
+
+/* 8-bit unsigned int */
+#undef OUR_CFG_U_INT8_T
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT