netdisco (1.0-1) debian-dir only changes

Summary

 debian/changelog                                 |   38 ++
 debian/compat                                    |    1 
 debian/control                                   |   52 +++
 debian/copyright                                 |   49 ++
 debian/netdisco-backend.README.Debian            |  148 ++++++++
 debian/netdisco-backend.crontab                  |   34 +
 debian/netdisco-backend.postinst                 |   52 +++
 debian/netdisco-common.README.Debian             |   43 ++
 debian/netdisco-frontend.README.Debian           |   91 +++++
 debian/netdisco-frontend.crontab                 |   11 
 debian/netdisco-frontend.postinst                |   54 +++
 debian/patches/00list                            |    3 
 debian/patches/01_fhs.dpatch                     |  397 +++++++++++++++++++++++
 debian/patches/02_oui_location.dpatch            |   21 +
 debian/patches/03_getip_subnet.dpatch            |   22 +
 debian/patches/04_textentry_size.dpatch          |  107 ++++++
 debian/patches/05_graphviz_defaults.dpatch       |   21 +
 debian/patches/06_no_pg_vacuum.dpatch            |   25 +
 debian/patches/07_device_root_override.dpatch    |   52 +++
 debian/patches/08_device_routes.dpatch           |  130 +++++++
 debian/patches/09_graphs_column.dpatch           |   48 ++
 debian/patches/10_connected_devices_limit.dpatch |   55 +++
 debian/rules                                     |  178 ++++++++++
 23 files changed, 1632 insertions(+)

    
download this patch

Patch contents

--- netdisco-1.0.orig/debian/netdisco-frontend.README.Debian
+++ netdisco-1.0/debian/netdisco-frontend.README.Debian
@@ -0,0 +1,91 @@
+NetDisco web front-end for Debian
+---------------------------------
+
+What you have here is a chunk of the NetDisco system which provides the web
+front-end only. On another system you'll need to install the back-end poller
+to gather data from your network devices, and insert it into a database. This
+system only speaks to the database, and runs within Apache2.
+
+IMPORTANT NOTE: This package does not get your front-end up and running by
+itself! Read this document to find out what still needs to be done.
+
+
+== Where things are in the filesystem
+
+The "home" of NetDisco has been set to /usr/lib/netdisco, although in fact
+this is unused if other configuration options are correctly set. The main
+configuration file is located at [/etc/netdisco/netdisco.conf] and the
+topology file at [/etc/netdisco/netdisco-toplogy.txt].
+
+Examples of these two files, tweaked for Debian systems, are provided in the
+/usr/share/doc/netdisco-common/contrib directory.
+
+A crontab file is placed at [/etc/cron.d/netdisco-frontend] which will rebuild
+the network map PNG once a day.
+
+Last but not least, the front-end Mason, image and HTML files are all located
+under /usr/share/netdisco/html (the Apache conf files refer to this location).
+
+
+== Optional Components
+
+Because of the large number of modules required by it, I've chosen to not
+depend on the network map generation tools (i.e. GraphVis). If you want to
+have the network map, then install these other modules:
+
+    libgraph-perl (>= 0.50)
+    graphviz (>= 2.2.0)
+    libgraphviz-perl (>= 2.02)
+
+You will then also need to uncomment the line in your crontab file, more
+details of which are below.
+
+
+== POST-INSTALL SETUP
+
+First, before you go any further, please make sure you have a fully working
+netdisco-backend system, which has succeeded in populating the database.
+
+Second, if you use Apache1.3, sorry, you're on your own... I've only tested
+this with Apache2. Please send a documentation patch to the address below.
+
+If your NetDisco backend is on another host, copy the [netdisco.conf] and
+[netdisco-topology.txt] files from that system into the /etc/netdisco
+directory on this system.
+
+Enable the Apache2 configuration by having the following in your Apache
+VirtualHost configuration somewhere:
+
+   Include /etc/netdisco/netdisco_apache2_dir.conf
+
+Also enable the apreq Apache module by running the following command:
+
+   a2enmod apreq
+
+And then load the config by creating a symlink:
+
+   ln -s /etc/netdisco/netdisco_apache2.conf /etc/apache2/conf.d/netdisco
+
+If you don't use Apache VirtualHosts, sorry, you're on your own... please send
+a documentation patch to the address below.
+
+Edit the [/etc/netdisco/netdisco_apache2.conf] file to contain your database's
+user, password and connetion string (in session_data_source, etc).
+
+Restart your Apache process. Look at [/var/log/apache2/error.log] if you think
+something is going wrong.
+
+Hopefully you should now have a working NetDisco front-end!
+
+Please consider registering your installation of NetDisco, to help motivate
+the developers and provide feedback on the types of installation:
+
+   http://netdisco.org/register.html
+
+
+== Final words
+
+My thanks go to everyone in the #netdisco IRC channel for helping me out, and
+especially to fenestro for sending me his initial Debian package description.
+
+ -- Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>  Tue, 13 Mar 2007 14:29:32 +0000
--- netdisco-1.0.orig/debian/netdisco-backend.postinst
+++ netdisco-1.0/debian/netdisco-backend.postinst
@@ -0,0 +1,52 @@
+#!/bin/sh
+# postinst script for netdisco-backend
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+        if ! getent group netdisco > /dev/null 2>&1 ; then
+            addgroup --system --quiet netdisco
+        fi
+
+        if ! getent passwd netdisco > /dev/null 2>&1 ; then
+            adduser --quiet \
+                --system --disabled-login --ingroup netdisco \
+                --quiet --shell /bin/bash --home /home/netdisco netdisco
+        fi
+
+        chown -R netdisco:netdisco /var/log/netdisco
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- netdisco-1.0.orig/debian/control
+++ netdisco-1.0/debian/control
@@ -0,0 +1,52 @@
+Source: netdisco
+Section: net
+Priority: extra
+Maintainer: Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>
+Uploaders: Christoph Martin <christoph.martin@uni-mainz.de>
+Build-Depends: debhelper (>= 5), dpatch
+Standards-Version: 3.8.0
+XS-Vcs-Svn: svn://svn.debian.org/svn/collab-maint/ext-maint/netdisco/
+XS-Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/ext-maint/netdisco/
+
+Package: netdisco-backend
+Architecture: all
+Depends: ${perl:Depends}, netdisco-common, adduser, libcompress-zlib-perl
+Suggests: netdisco-mibs-installer, libnet-nbname-perl
+Description: Gather data about network devices and connected nodes
+ Netdisco is an Open Source web-based network management
+ tool designed for moderate-large networks. Using SNMP it
+ locates the switch port of an end-user system by IP or MAC
+ address. Layer2 topology discovery via CDP. Device inventory
+ by OS/model + more.
+ .
+ This package contains the back-end poller scripts which gather
+ data and insert records into a database.
+
+Package: netdisco-frontend
+Architecture: all
+Depends: netdisco-common, adduser, perl, apache2, libmasonx-request-withapachesession-perl (>= 0.30), libhtml-mason-perl (>= 1.32), libapache2-mod-perl2 (>= 2.0.2), libapache2-request-perl (>= 2.06), libapache-dbi-perl (>= 0.94)
+Suggests: libgraph-perl (>= 0.50), graphviz (>= 2.2.0), libgraphviz-perl (>= 2.02)
+Description: Web front-end for the NetDisco network manager
+ Netdisco is an Open Source web-based network management
+ tool designed for moderate-large networks. Using SNMP it
+ locates the switch port of an end-user system by IP or MAC
+ address. Layer2 topology discovery via CDP. Device inventory
+ by OS/model + more.
+ .
+ This package contains the HTML::Mason web front-end to
+ Netdisco which displays information from a populated database.
+
+Package: netdisco-common
+Architecture: all
+Depends: ${perl:Depends}, libsnmp-info-perl (>= 2.01), libdbi-perl (>= 1.46), libdbd-pg-perl (>= 1.41)
+Suggests: netdisco-backend, netdisco-frontend
+Description: Gather and report data about network devices and nodes
+ Netdisco is an Open Source web-based network management
+ tool designed for moderate-large networks. Using SNMP it
+ locates the switch port of an end-user system by IP or MAC
+ address. Layer2 topology discovery via CDP. Device inventory
+ by OS/model + more.
+ .
+ This package contains files which are common to both the frontend
+ and backend distributions.
+
--- netdisco-1.0.orig/debian/compat
+++ netdisco-1.0/debian/compat
@@ -0,0 +1 @@
+5
--- netdisco-1.0.orig/debian/netdisco-backend.crontab
+++ netdisco-1.0/debian/netdisco-backend.crontab
@@ -0,0 +1,34 @@
+# Netdisco - crontab
+#       This is the crontab for the netdisco user
+#       Output is found in /data/netdisco/logs
+# $Id: netdisco.crontab,v 1.7 2004/12/05 02:14:26 maxbaker Exp $
+
+#MAILTO=max
+PATH=/bin:/usr/bin:/usr/local/bin:/usr/lib/netdisco
+
+# -- Weekly --
+
+# Walk network for new devices once a week (Wed @ 14:00)
+# 0 14  * * 3   netdisco    [ -f /etc/netdisco/netdisco.conf ] && /usr/bin/netdisco -b -r FIXME_a_device_FIXME
+
+# -- Daily --
+
+# Backup at 1am every day
+# 0 1     * * *   netdisco    [ -f /etc/netdisco/netdisco.conf ] && /usr/bin/netdisco -b -B
+
+# Restart admin panel daemon nightly
+# 0 2   * * *   netdisco    [ -f /etc/netdisco/netdisco.conf ] && /usr/bin/netdisco -p restart
+
+# Refresh Devices at 9:00 every day
+# 0 9     * * *   netdisco    [ -f /etc/netdisco/netdisco.conf ] && /usr/bin/netdisco -b -R
+
+# -- Hourly --
+
+# Arp Nip every hour on the half hour
+# 30 *    * * *   netdisco    [ -f /etc/netdisco/netdisco.conf ] && /usr/bin/netdisco -b -a 
+
+# Mac Suck every 2 hours
+# 0 */2   * * *   netdisco    [ -f /etc/netdisco/netdisco.conf ] && /usr/bin/netdisco -b -m 
+
+# Grab NetBios Info from Nodes three times a day
+# 0 8,13,21     * * *   netdisco    [ -f /etc/netdisco/netdisco.conf ] && /usr/bin/netdisco -b -w
--- netdisco-1.0.orig/debian/netdisco-backend.README.Debian
+++ netdisco-1.0/debian/netdisco-backend.README.Debian
@@ -0,0 +1,148 @@
+NetDisco poller back-end for Debian
+-----------------------------------
+
+What you have here is a chunk of the NetDisco system which provides the
+back-end polling system, which gathers data from your network devices and
+inserts it into a database. There is another package which is the web
+front-end, and you may install that on a separate host, or the same host.
+
+IMPORTANT NOTE: This package does not get your back-end up and running by
+itself! Read this document to find out what still needs to be done.
+
+
+== Where things are in the filesystem
+
+The "home" of NetDisco has been set to /usr/lib/netdisco, although in fact
+this is unused if other configuration options are correctly set. The main
+configuration file is located at [/etc/netdisco/netdisco.conf] and the
+topology file at [/etc/netdisco/netdisco-toplogy.txt].
+
+Examples of these two files, tweaked for Debian systems, are provided in the
+/usr/share/doc/netdisco-common/contrib directory.
+
+Some utility scripts which ship with NetDisco have been placed in
+/usr/lib/netdisco, although I'm not altogether sure what they are used for.
+
+The SQL snippets used to bootstrap or upgrade the database are located in
+/usr/share/doc/netdisco-backend/sql. The NetDisco pgsql shell wrapper has been
+installed in [/usr/bin/npg] (NOTE: npg not just pg).
+
+Logs are created under /var/log/netdisco, and a crontab file is placed at
+[/etc/cron.d/netdisco-backend] which has some duties enabled but other
+disabled by default, so you probably want to check that out sometime.
+
+
+== Optional Components
+
+In case you were not aware, NetDisco uses only MIB alias names and not actual
+OID numbers when performing SNMP. You therefore need to have a complete set of
+MIBs installed on your back-end system.
+
+Debian provides the netdisco-mibs-installer package to help you obtain a
+bundle of vendor MIB files. Install that package then run the
+netdisco-mibs-download and netdisco-mibs-install programs. If you have a
+custom MIB location, set up the [netdisco.conf] file to find it (more detail
+below).
+
+Further, some administrators have no need to poll end devices for their
+NetBIOS name, because they are under someone else's administrative control. If
+you do want this polling to go ahead, then install the libnet-nbname-perl
+Debian package.
+
+Check out the installed crontab file for other jobs which may be disabled.
+
+
+== POST-INSTALL SETUP
+
+The first thing to do is set up your postgres server. Don't bother with the
+npg (pg) script. Go to your database server, connect as the db admin, and
+create a "netdisco" user and a "netdisco" database, and assign full rights on
+the database to the user.
+
+    postgres:~$ createuser -S -D -R -P netdisco
+    password: ********
+
+    postgres:~$ psql template1
+    template1=> CREATE DATABASE netdisco WITH OWNER netdisco;
+    CREATE DATABASE.
+
+Make a note of the password you have set on the "netdisco" account, and also
+make sure that account can access the "netdisco" database from both your
+back-end and web front-end servers (look in the [pg_hba.conf] file).
+
+From your back-end server, test the connection to the "netdisco" database:
+
+    $ psql -h my.db.server -U netdisco -W netdisco
+    Password for user netdisco:
+
+    netdisco=>
+
+Then, we need to bootstrap the "netdisco" database with its tables:
+
+    $ psql -h my.db.server -U netdisco -W netdisco < \
+        /usr/share/doc/netdisco-backend/sql/complete_bootstrap.sql
+
+There's one last part of the database setup, but we'll come back to that in a
+minute.
+
+Copy the example NetDisco configuration file into /etc/netdisco from
+[/usr/share/doc/netdisco-common/contrib/netdisco.conf.example], and open it
+in your favourite editor.
+
+Set the domain field at the top of the file. Check the community strings are
+suitable for your devices.
+
+If you installed netdisco-mibs-installer and ran its helper programs
+(recommended!) then you don't actually need to update the NetDisco config,
+otherwise find that section (mibhome and mibdirs) and change it.
+
+Now, for the database, you'll need to enter the connection string, username
+and password. The connection string ought to have a "host" field if your
+database is on a different machine, for example:
+
+    db_Pg = dbi:Pg:dbname=netdisco;host=my.db.server
+
+If you're not using a pre-set topology, then just touch(1) a file at
+[/etc/netdisco/netdisco-topology.txt]. If you are, then you need to populate
+that file with details as per the NetDisco README (it's alongside this file).
+
+Okay, back to the database, we can now populate the OUI (MAC/Vendor) tables,
+using the netdisco tool:
+
+    $ wget http://standards.ieee.org/regauth/oui/oui.txt
+    $ netdisco -O
+
+If this runs okay, move on to a single device discovery:
+
+    $ netdisco -D -d a.device.name
+
+If this runs okay, move on to a complete network discovery, which will be one
+of the following commands:
+
+    # for auto discovery (using CDP, etc)
+    $ netdisco -r a.device.name
+
+    # for pre-configured topology
+    $ netdisco -F /etc/netdisco/netdisco-topology.txt
+
+Finally, go and look at the crontab file at [/etc/cron.d/netdisco-backend] and
+uncomment the jobs you want. My recommendation would be to have at least the
+Device Refresh, Arp Nip, Mac Suck and Backup jobs running.
+
+Hopefully you should now have a working NetDisco back-end! I seriously
+recommend that you read the NetDisco README (and possibly the INSTALL as
+well), and configure other options in [netdisco.conf]. Some of these pertain
+to security and are important (such as "{arpnip,macsuck,discover}_only").
+
+Please consider registering your installation of NetDisco, to help motivate
+the developers and provide feedback on the types of installation:
+
+   http://netdisco.org/register.html
+
+
+== Final words
+
+My thanks go to everyone in the #netdisco IRC channel for helping me out, and
+especially to fenestro for sending me his initial Debian package description.
+
+ -- Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>  Tue, 13 Mar 2007 14:29:32 +0000
--- netdisco-1.0.orig/debian/changelog
+++ netdisco-1.0/debian/changelog
@@ -0,0 +1,38 @@
+netdisco (1.0-1) unstable; urgency=low
+
+  [ Oliver Gorwits ]
+  * Bump to Netdisco version 1.0, patches clean 
+  * Add some unofficial patches that users may wish to apply
+  * Depend on SNMP::Info 2.01 or later
+
+ -- Christoph Martin <christoph.martin@uni-mainz.de>  Thu, 29 Oct 2009 15:49:13 +0100
+
+netdisco (0.95-3) unstable; urgency=low
+
+  [ Oliver Gorwits ]
+  * Closes: #497938: daily cronjobs fails because of permission problems
+  * Closes: #497939: noisy output of cronjob
+  * Update standards version to 3.8.0
+  * Move crontab files into .../debian as they are not part of upstream.
+
+ -- Christoph Martin <christoph.martin@uni-mainz.de>  Wed, 17 Sep 2008 18:44:16 +0200
+
+netdisco (0.95-2) unstable; urgency=low
+
+  [ Oliver Gorwits ]
+  * No longer include packaging of NetDisco MIB bundle, it is not
+    redistributable (see netdisco-mibs-installer in contrib/net)
+
+ -- Christoph Martin <christoph.martin@uni-mainz.de>  Wed,  5 Dec 2007 10:34:52 +0100
+
+netdisco (0.95-1) unstable; urgency=low
+
+  [ Oliver Gorwits ]
+  * Initial release as a Debianized package.
+
+  [ Christoph Martin ]
+  * correcting Depends lines (perl ..)
+  * Closes ITP Bug (closes: #434532)
+
+ -- Christoph Martin <christoph.martin@uni-mainz.de>  Tue, 30 Oct 2007 11:00:58 +0100
+
--- netdisco-1.0.orig/debian/netdisco-frontend.postinst
+++ netdisco-1.0/debian/netdisco-frontend.postinst
@@ -0,0 +1,54 @@
+#!/bin/sh
+# postinst script for netdisco
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+        if ! getent group netdisco > /dev/null 2>&1 ; then
+            addgroup --system --quiet netdisco
+        fi
+
+        if ! getent passwd netdisco > /dev/null 2>&1 ; then
+            adduser --quiet \
+                --system --disabled-login --ingroup netdisco \
+                --quiet --shell /bin/bash --home /home/netdisco netdisco
+        fi
+
+        chown -R netdisco:www-data /var/lib/netdisco
+        chmod -R u=rwX,g=rwX,o=rX /var/lib/netdisco
+        usermod --groups netdisco www-data
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- netdisco-1.0.orig/debian/copyright
+++ netdisco-1.0/debian/copyright
@@ -0,0 +1,49 @@
+This package was debianized by Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk> on
+Tue, 13 Mar 2007 14:29:32 +0000.
+
+It was downloaded from
+    http://sourceforge.net/project/showfiles.php?group_id=80033
+
+The Debian packaging is Copyright (c) 2007, University of Oxford. All Rights
+Reserved.
+
+The Debian packaging is free software; you can redistribute it and/or modify it
+under the terms of version 2 of the GNU General Public License as published by
+the Free Software Foundation. The Debian packaging is distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details. You should have received a copy of the
+GNU General Public License along with this program; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+USA. Alternatively, you may have a copy at /usr/share/common-licenses/GPL-2.
+
+Upstream Authors: Eric Miller, Bill Fenner and Max Baker, plus others.
+
+Upstream Copyright: 2003,2004 Max Baker
+Upstream Copyright: 2002,2003 Regents of the University of California
+
+Upstream License:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * 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.
+    * Neither the name of the University of California, Santa Cruz 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 COPYRIGHT OWNER 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.
+
--- netdisco-1.0.orig/debian/netdisco-common.README.Debian
+++ netdisco-1.0/debian/netdisco-common.README.Debian
@@ -0,0 +1,43 @@
+NetDisco for Debian
+-------------------
+
+IMPORTANT NOTE: This package does not get NetDisco up and running by itself!
+Read this document to find out what still needs to be done.
+
+
+== Where things are in the filesystem
+
+The "home" of NetDisco has been set to /usr/lib/netdisco, although in fact
+this is unused if other configuration options are correctly set. The main
+configuration file is located at [/etc/netdisco/netdisco.conf] and the
+topology file at [/etc/netdisco/netdisco-toplogy.txt].
+
+Examples of these two files, tweaked for Debian systems, are provided in the
+/usr/share/doc/netdisco-common/contrib directory.
+
+The main [netdisco] and [netdisco.pm] files have been installed in /usr/bin
+and /usr/share/perl5 respectively. Note that the latter is one of Debian's
+standard Perl lib directories, so you don't need to 'use lib...' to locate
+[netdisco.pm].
+
+
+== POST-INSTALL SETUP
+
+Please now install either netdisco-backend, or netdisco-frontend, or both, if
+you have not done so already.
+
+Then you should read the README.Debian files for each package, for further
+instructions.
+
+Please consider registering your installation of NetDisco, to help motivate
+the developers and provide feedback on the types of installation:
+
+   http://netdisco.org/register.html
+
+
+== Final words
+
+My thanks go to everyone in the #netdisco IRC channel for helping me out, and
+especially to fenestro for sending me his initial Debian package description.
+
+ -- Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>  Tue, 13 Mar 2007 14:29:32 +0000
--- netdisco-1.0.orig/debian/rules
+++ netdisco-1.0/debian/rules
@@ -0,0 +1,178 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+PKG_COMMON      = netdisco-common
+PKG_FRONTEND    = netdisco-frontend
+PKG_BACKEND     = netdisco-backend
+TMP_COMMON      = $(CURDIR)/debian/$(PKG_COMMON)
+TMP_FRONTEND    = $(CURDIR)/debian/$(PKG_FRONTEND)
+TMP_BACKEND     = $(CURDIR)/debian/$(PKG_BACKEND)
+
+INSTALL = install
+INSTALL_FILE    = $(INSTALL) -p    -oroot -groot -m644
+INSTALL_PROGRAM = $(INSTALL) -p    -oroot -groot -m755
+INSTALL_SCRIPT  = $(INSTALL) -p    -oroot -groot -m755
+INSTALL_DIR     = $(INSTALL) -p -d -oroot -groot -m755
+
+configure:
+
+build: patch
+	pod2man --section=1 $(CURDIR)/netdisco > $(CURDIR)/netdisco.1
+	pod2man --section=1 $(CURDIR)/sql/pg   > $(CURDIR)/npg.1
+	for i in `ls -1 $(CURDIR)/sql/*.sql | grep -v upgrade`; do cat $$i >> $(CURDIR)/sql/complete_bootstrap.sql; done
+
+clean: clean-patched unpatch
+
+clean-patched:
+	dh_testdir
+	dh_testroot
+	rm -f $(CURDIR)/netdisco.1
+	rm -f $(CURDIR)/npg.1
+	rm -f $(CURDIR)/sql/complete_bootstrap.sql
+	rm -f build-stamp configure-stamp
+	dh_clean
+
+unpatch:
+	dpatch deapply-all
+	rm -rf patch-stamp debian/patched
+
+install: install-frontend install-backend install-common
+
+install-common:
+	echo ""
+	echo $(PKG_COMMON)
+	dh_testdir
+	dh_testroot
+#	dh_clean -k 
+	dh_installdirs
+
+	$(INSTALL_DIR) $(TMP_COMMON)
+	$(INSTALL_DIR) $(TMP_COMMON)/usr/bin
+	$(INSTALL_DIR) $(TMP_COMMON)/etc/netdisco
+	$(INSTALL_DIR) $(TMP_COMMON)/usr/share/perl5
+	$(INSTALL_DIR) $(TMP_COMMON)/usr/share/man/man1
+	$(INSTALL_DIR) $(TMP_COMMON)/usr/share/doc/netdisco-common/contrib
+
+	$(INSTALL_FILE) netdisco.pm $(TMP_COMMON)/usr/share/perl5
+	$(INSTALL_PROGRAM) netdisco $(TMP_COMMON)/usr/bin
+
+	$(INSTALL_FILE) netdisco.1  $(TMP_COMMON)/usr/share/man/man1
+	$(INSTALL_FILE) debian/netdisco-common.README.Debian $(TMP_COMMON)/usr/share/doc/netdisco-common/README.Debian
+	$(INSTALL_FILE) doc/* $(TMP_COMMON)/usr/share/doc/netdisco-common
+	rm -f $(TMP_COMMON)/usr/share/doc/netdisco-common/INSTALL*
+
+	$(INSTALL_FILE) netdisco.conf $(TMP_COMMON)/usr/share/doc/netdisco-common/contrib/netdisco.conf.example
+	$(INSTALL_FILE) netdisco-topology.txt $(TMP_COMMON)/usr/share/doc/netdisco-common/contrib/netdisco-topology.txt.example
+
+	dh_install
+
+
+install-frontend:
+	echo ""
+	echo $(PKG_FRONTEND)
+	dh_testdir
+	dh_testroot
+#	dh_clean -k 
+	dh_installdirs
+
+	$(INSTALL_DIR) $(TMP_FRONTEND)
+	$(INSTALL_DIR) $(TMP_FRONTEND)/etc/cron.d
+	$(INSTALL_DIR) $(TMP_FRONTEND)/etc/netdisco
+	$(INSTALL_DIR) $(TMP_FRONTEND)/var/lib/netdisco/html
+	$(INSTALL_DIR) $(TMP_FRONTEND)/var/lib/netdisco/mason
+	$(INSTALL_DIR) $(TMP_FRONTEND)/usr/share/netdisco/html/doc
+	$(INSTALL_DIR) $(TMP_FRONTEND)/usr/share/doc/netdisco-frontend
+
+	for i in `find html/doc -maxdepth 1 -type f`; do $(INSTALL_FILE) $$i $(TMP_FRONTEND)/usr/share/netdisco/html/doc; done
+	for i in `find html -maxdepth 1 -type f`; do $(INSTALL_FILE) $$i $(TMP_FRONTEND)/usr/share/netdisco/html; done
+	ln -s /var/lib/netdisco/html/netmap.png $(TMP_FRONTEND)/usr/share/netdisco/html/netmap.png
+	ln -s /var/lib/netdisco/html/netmap.map $(TMP_FRONTEND)/usr/share/netdisco/html/netmap.map
+
+	$(INSTALL_FILE) debian/netdisco-frontend.crontab $(TMP_FRONTEND)/etc/cron.d/netdisco-frontend
+
+	$(INSTALL_FILE) debian/netdisco-frontend.README.Debian $(TMP_FRONTEND)/usr/share/doc/netdisco-frontend/README.Debian
+
+	$(INSTALL_FILE) netdisco_apache.conf $(TMP_FRONTEND)/etc/netdisco/netdisco_apache2.conf
+	$(INSTALL_FILE) netdisco_apache_dir.conf $(TMP_FRONTEND)/etc/netdisco/netdisco_apache2_dir.conf
+
+	dh_install
+
+
+install-backend:
+	echo ""
+	echo $(PKG_BACKEND)
+	dh_testdir
+	dh_testroot
+#	dh_clean -k
+	dh_installdirs
+
+	$(INSTALL_DIR) $(TMP_BACKEND)
+	$(INSTALL_DIR) $(TMP_BACKEND)/usr/bin
+	$(INSTALL_DIR) $(TMP_BACKEND)/etc/cron.d
+	$(INSTALL_DIR) $(TMP_BACKEND)/var/log/netdisco
+	$(INSTALL_DIR) $(TMP_BACKEND)/usr/lib/netdisco
+	$(INSTALL_DIR) $(TMP_BACKEND)/usr/share/man/man1
+	$(INSTALL_DIR) $(TMP_BACKEND)/usr/share/doc/netdisco-backend/sql
+
+	for i in `find bin -maxdepth 1 -type f`; do $(INSTALL_PROGRAM) $$i $(TMP_BACKEND)/usr/lib/netdisco; done
+	rm -f $(TMP_BACKEND)/usr/lib/netdisco/debian_install.sh
+	$(INSTALL_PROGRAM) sql/pg $(TMP_BACKEND)/usr/bin/npg
+
+	$(INSTALL_FILE) npg.1 $(TMP_BACKEND)/usr/share/man/man1
+
+	$(INSTALL_FILE) debian/netdisco-backend.crontab $(TMP_BACKEND)/etc/cron.d/netdisco-backend
+
+	$(INSTALL_FILE) debian/netdisco-backend.README.Debian $(TMP_BACKEND)/usr/share/doc/netdisco-backend/README.Debian
+
+	$(INSTALL_FILE) sql/*.sql $(TMP_BACKEND)/usr/share/doc/netdisco-backend/sql
+
+	dh_install
+
+
+patch: patch-stamp
+patch-stamp:
+	dpatch apply-all
+	dpatch cat-all >patch-stamp
+
+binary-arch:
+
+binary-indep: install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_installexamples
+#	dh_install
+#	dh_installmenu
+#	dh_installdebconf	
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_python
+#	dh_installinit
+#	dh_installcron
+#	dh_installinfo
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress -X.sql
+	dh_fixperms
+	dh_perl
+#	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep
+.PHONY: clean-patched unpatch patch patch-stamp build clean binary-indep binary-arch binary install configure install-backend install-frontend install-common
--- netdisco-1.0.orig/debian/netdisco-frontend.crontab
+++ netdisco-1.0/debian/netdisco-frontend.crontab
@@ -0,0 +1,11 @@
+# Netdisco - crontab
+#       This is the crontab for the netdisco user
+#       Output is found in /data/netdisco/logs
+# $Id: netdisco.crontab,v 1.7 2004/12/05 02:14:26 maxbaker Exp $
+
+#MAILTO=max
+PATH=/bin:/usr/bin:/usr/local/bin:/usr/lib/netdisco
+
+# Refresh Graph every day
+# 0 3     * * *   netdisco    [ -f /etc/netdisco/netdisco.conf ] && /usr/bin/netdisco -b -g 2>&1
+
--- netdisco-1.0.orig/debian/patches/07_device_root_override.dpatch
+++ netdisco-1.0/debian/patches/07_device_root_override.dpatch
@@ -0,0 +1,52 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 07_device_root_override.dpatch by Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Allow discovered Root IP to be overridden via a DB table
+
+@DPATCH@
+
+diff -urN netdisco.orig/html/device.html netdisco/html/device.html
+--- netdisco.orig/html/device.html	2009-09-08 22:19:51.000000000 +0100
++++ netdisco/html/device.html	2009-09-08 22:48:27.000000000 +0100
+@@ -719,7 +719,7 @@
+         # Resolve IP address squawked to root device
+         if (defined $alias) {
+             $remote_ip = $alias->{ip};
+-            $name = $alias->{dns};
++            $name = sql_scalar('device',['dns'],{'ip'=>$remote_ip});
+             $name = defined $name ? $name  : $remote_ip; 
+             $name =~ s/\Q$domain\E//;
+             $name .= " ($remote_port)";
+diff -urN netdisco.orig/netdisco netdisco/netdisco
+--- netdisco.orig/netdisco	2009-06-20 18:45:13.000000000 +0100
++++ netdisco/netdisco	2009-09-08 22:48:27.000000000 +0100
+@@ -1315,6 +1315,15 @@
+     
+     my $foundip = $device->{ip};
+ 
++    # check override database table
++    my $override1 = sql_scalar('root_override',['root_ip'],{'root_ip'=>$foundip});
++    return $override1 if (defined $override1 and length($override1));
++
++    # check override database table
++    my $override2 = sql_scalar('root_override',['root_ip'],{'ip'=>$foundip});
++    print "  device_root($foundip --> $override2)\n" if $DEBUG;
++    return $override2 if (defined $override2 and length($override2));
++
+     # use the device override
+     my $root_ip = $device->root_ip();
+     return $root_ip if (defined $root_ip and length($root_ip));
+diff -urN netdisco.orig/sql/root_override.sql netdisco/sql/root_override.sql
+--- netdisco.orig/sql/root_override.sql	1970-01-01 01:00:00.000000000 +0100
++++ netdisco/sql/root_override.sql	2009-09-08 22:48:41.000000000 +0100
+@@ -0,0 +1,9 @@
++
++DROP TABLE root_override;
++
++CREATE TABLE root_override (
++    ip              inet not null,
++    root_ip         inet not null,
++    PRIMARY KEY (ip) 
++);
++
--- netdisco-1.0.orig/debian/patches/01_fhs.dpatch
+++ netdisco-1.0/debian/patches/01_fhs.dpatch
@@ -0,0 +1,397 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_fhs.dpatch by Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Make paths in NetDisco conform to Debian File Hierarchy Standard
+
+@DPATCH@
+
+diff -urN netdisco-1.0.orig/bin/catalyst_mac_vlan.pl netdisco-1.0/bin/catalyst_mac_vlan.pl
+--- netdisco-1.0.orig/bin/catalyst_mac_vlan.pl	2003-05-13 20:20:08.000000000 +0100
++++ netdisco-1.0/bin/catalyst_mac_vlan.pl	2009-09-08 18:57:39.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl -w
++#!/usr/bin/perl -w
+ 
+ use SNMP;
+ &SNMP::initMib;
+diff -urN netdisco-1.0.orig/bin/parse_mac netdisco-1.0/bin/parse_mac
+--- netdisco-1.0.orig/bin/parse_mac	2003-06-10 18:02:27.000000000 +0100
++++ netdisco-1.0/bin/parse_mac	2009-09-08 18:57:39.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl -w
++#!/usr/bin/perl -w
+ #
+ # parse_mac - Used to chew up output from netsnort or other 
+ #       Wardriving programs to make lists of known Wireless 
+diff -urN netdisco-1.0.orig/bin/port_control netdisco-1.0/bin/port_control
+--- netdisco-1.0.orig/bin/port_control	2003-08-14 19:55:45.000000000 +0100
++++ netdisco-1.0/bin/port_control	2009-09-08 18:57:39.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl -w
++#!/usr/bin/perl -w
+ # port_control - Script that used to be called by front-end of netdisco to 
+ #                enable and disable ports.
+ # Max Baker
+diff -urN netdisco-1.0.orig/bin/test_cache.pl netdisco-1.0/bin/test_cache.pl
+--- netdisco-1.0.orig/bin/test_cache.pl	2003-05-13 20:20:08.000000000 +0100
++++ netdisco-1.0/bin/test_cache.pl	2009-09-08 18:57:39.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl -w
++#!/usr/bin/perl -w
+ 
+ use lib '/usr/local/netdisco';
+ use SNMP::Info;
+diff -urN netdisco-1.0.orig/bin/test_dev.pl netdisco-1.0/bin/test_dev.pl
+--- netdisco-1.0.orig/bin/test_dev.pl	2003-05-13 20:20:08.000000000 +0100
++++ netdisco-1.0/bin/test_dev.pl	2009-09-08 18:57:39.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl -w
++#!/usr/bin/perl -w
+ 
+ use lib qw(/usr/local/netdisco);
+ 
+diff -urN netdisco-1.0.orig/bin/test_stats.pl netdisco-1.0/bin/test_stats.pl
+--- netdisco-1.0.orig/bin/test_stats.pl	2003-05-13 20:20:08.000000000 +0100
++++ netdisco-1.0/bin/test_stats.pl	2009-09-08 18:57:39.000000000 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl -w
++#!/usr/bin/perl -w
+ 
+ use lib qw!/usr/local/netdisco/!;
+ use SNMP::Info;
+diff -urN netdisco-1.0.orig/netdisco netdisco-1.0/netdisco
+--- netdisco-1.0.orig/netdisco	2009-06-20 18:45:13.000000000 +0100
++++ netdisco-1.0/netdisco	2009-09-08 18:57:39.000000000 +0100
+@@ -19,8 +19,6 @@
+ 
+ use strict;
+ use Getopt::Long;
+-use FindBin;             # Add this directory for netdisco.pm
+-use lib $FindBin::Bin;
+ use IO::File;            # For batch_mode()
+ use POSIX qw/:errno_h setsid/;  # for Admin Daemon
+ use Compress::Zlib;
+@@ -113,7 +111,7 @@
+ &header if (grep(/^([aABdeEFgIikKmMOprRTu]|expire-nodes-subnet)$/,keys %args) and !$BatchMode);
+ 
+ # Parse Config File - Check for -C, then in current dir, then in default dir.
+-foreach my $c ($args{C},"$FindBin::Bin/netdisco.conf",'/usr/local/netdisco/netdisco.conf') {
++foreach my $c ($args{C},'/etc/netdisco/netdisco.conf') {
+     if (defined $c and -r $c){
+         $configfile = $c;
+         print "Using Config File : $configfile\n" if $DEBUG;
+@@ -237,7 +235,7 @@
+ 
+     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
+     my $month = sprintf("%d%02d",$year+1900,$mon+1);
+-    &batch_mode("logs/$month/refresh");
++    &batch_mode("$month/refresh");
+ 
+     my $now = localtime();
+     print "[Refresh All Devices]  Started at $now. \n";
+@@ -1156,7 +1154,7 @@
+     
+     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
+     my $month = sprintf("%d%02d",$year+1900,$mon+1);
+-    &batch_mode("logs/$month/arp",1);
++    &batch_mode("$month/arp",1);
+     print "Grabbing Arp Cache from all layer 3 devices (". localtime() . ")...\n";
+ 
+     # Get our old devices, IP->Layer mapping
+@@ -2149,7 +2147,7 @@
+     $start_time = time;
+     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
+     my $month = sprintf("%d%02d",$year+1900,$mon+1);
+-    &batch_mode("logs/$month/mac",1);
++    &batch_mode("$month/mac",1);
+     print "Grabbing Mac Addresses from all Layer 2 Devices (" . localtime() . ")...\n";
+ 
+     # Get our old devices, IP->Layer mapping
+@@ -3163,7 +3161,7 @@
+ 
+     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
+     my $month = sprintf("%d%02d",$year+1900,$mon+1);
+-    &batch_mode("logs/$month/netbios",1);
++    &batch_mode("$month/netbios",1);
+     
+     # Get nodes
+     my $days = $CONFIG{nbt_days} || 7;
+@@ -3866,7 +3864,7 @@
+     # Log backup
+     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
+     my $month = sprintf("%d%02d",$year+1900,$mon+1);
+-    &batch_mode("logs/$month/nightly",1) unless (defined $no_batch and $no_batch);
++    &batch_mode("$month/nightly",1) unless (defined $no_batch and $no_batch);
+     print "nightly() - Starting nightly cleanup and backup routines\n";
+ 
+     print "  Cleaning and clearing data...\n";
+@@ -4006,7 +4004,7 @@
+ 
+     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
+     my $month = sprintf("%d%02d",$year+1900,$mon+1);
+-    &batch_mode("logs/$month/graph") unless $no_batch;
++    &batch_mode("$month/graph") unless $no_batch;
+     print "graph() - Creating Graphs.\n";
+ 
+     tryuse('GraphViz', ver => '2.02', die => 1);
+diff -urN netdisco-1.0.orig/netdisco.conf netdisco-1.0/netdisco.conf
+--- netdisco-1.0.orig/netdisco.conf	2009-06-11 22:44:23.000000000 +0100
++++ netdisco-1.0/netdisco.conf	2009-09-08 18:57:39.000000000 +0100
+@@ -13,10 +13,10 @@
+ 
+ # ---- General Settings ----
+ domain          = .mycompany.com
+-home            = /usr/local/netdisco
++home            = /usr/lib/netdisco
+ #customer        = mycompany
+ #customericon    = mycompany.gif,88,31
+-topofile        = netdisco-topology.txt
++topofile        = /etc/netdisco/netdisco-topology.txt
+ timeout         = 180
+ macsuck_timeout = 240
+ #macsuck_all_vlans = true
+@@ -61,7 +61,7 @@
+ 
+ # ---- Admin Panel Daemon Settings ----
+ daemon_bg       = true
+-daemon_pid      = netdisco_daemon.pid
++daemon_pid      = /var/run/netdisco_daemon.pid
+ daemon_poll     = 2
+ 
+ # ---- Port Control Settings ---
+@@ -75,8 +75,8 @@
+ 
+ # Data Archiving and Logging
+ compresslogs    = true
+-compress        = /usr/bin/gzip -f
+-datadir         = data
++compress        = /bin/gzip -f
++datadir         = /var/log/netdisco
+ logextension    = txt
+ #nmis_dump       = netdisco_nmis
+ 
+@@ -127,24 +127,25 @@
+ # snmptimeout in micro-seconds before retry, 1000000 micro-seconds = 1 second
+ snmptimeout     = 1000000 
+ snmpretries     = 3
++mibhome         = /usr/share/netdisco/mibs
+ mibdirs         = \
+-    $home/mibs/allied, \
+-    $home/mibs/arista, \
+-    $home/mibs/aruba, \
+-    $home/mibs/asante, \
+-    $home/mibs/cabletron, \
+-    $home/mibs/cisco, \
+-    $home/mibs/cyclades, \
+-    $home/mibs/dell, \
+-    $home/mibs/enterasys, \
+-    $home/mibs/extreme, \
+-    $home/mibs/foundry, \
+-    $home/mibs/hp, \
+-    $home/mibs/juniper, \
+-    $home/mibs/netscreen, \
+-    $home/mibs/nortel, \
++    $mibhome/allied, \
++    $mibhome/arista, \
++    $mibhome/aruba, \
++    $mibhome/asante, \
++    $mibhome/cabletron, \
++    $mibhome/cisco, \
++    $mibhome/cyclades, \
++    $mibhome/dell, \
++    $mibhome/enterasys, \
++    $mibhome/extreme, \
++    $mibhome/foundry, \
++    $mibhome/hp, \
++    $mibhome/juniper, \
++    $mibhome/netscreen, \
++    $mibhome/nortel, \
+     # Do not remove rfc or net-snmp. \
+-    $home/mibs/rfc,     $home/mibs/net-snmp
++    $mibhome/rfc,     $mibhome/net-snmp
+ 
+ #bulkwalk_no    = vendor:foundry,model:blah,127.0.0.1/32,myswitch
+ #bulkwalk_off   = true
+@@ -167,22 +168,23 @@
+ # ---- Graph Settings ----
+ edge_color      = wheat
+ 
+-graph           = html/netmap.gif
+-#graph_png       = html/netmap.png
++outputdir       = /var/lib/netdisco/html
++#graph           = $outputdir/netmap.gif
++graph_png       = $outputdir/netmap.png
+ graph_bg        = black
+ graph_clusters  = false  # try fdp layout
+ graph_color     = white
+-#graph_default  = svg
++graph_default   = png
+ #graph_dir      = net_dir.gif
+ graph_epsilon   = 6
+ graph_layout    = twopi  # try neato or fdp too
+-graph_map       = html/netmap.map
++graph_map       = $outputdir/netmap.map
+ graph_overlap   = scale
+ graph_nodesep   = 2
+ graph_ranksep   = .3
+-#graph_raw      = graph_raw.dot
++#graph_raw      = $outputdir/graph_raw.dot
+ graph_splines   = false
+-graph_svg       = html/netmap.svg
++graph_svg       = $outputdir/netmap.svg
+ graph_timeout   = 90
+ graph_x         = 30
+ graph_y         = 30
+diff -urN netdisco-1.0.orig/netdisco.pm netdisco-1.0/netdisco.pm
+--- netdisco-1.0.orig/netdisco.pm	2009-06-11 01:23:40.000000000 +0100
++++ netdisco-1.0/netdisco.pm	2009-09-08 18:57:39.000000000 +0100
+@@ -2154,7 +2154,7 @@
+     my $cfgitem = shift;
+     my $default = shift;
+     my $item = $CONFIG{$cfgitem} || $default;
+-    my $home = $CONFIG{home} || '/usr/local/netdisco';
++    my $home = $CONFIG{home} || '/usr/lib/netdisco';
+     return undef unless defined($item);
+     if ($item =~ m,^/,) {
+         return $item;
+diff -urN netdisco-1.0.orig/netdisco_apache.conf netdisco-1.0/netdisco_apache.conf
+--- netdisco-1.0.orig/netdisco_apache.conf	2009-06-03 00:27:02.000000000 +0100
++++ netdisco-1.0/netdisco_apache.conf	2009-09-08 18:57:39.000000000 +0100
+@@ -13,18 +13,17 @@
+ # Pool Database Connections
+ PerlModule Apache::DBI
+ 
+-<Directory /usr/local/netdisco/html>
+-	order allow,deny
+-	allow from all
+-</Directory>
++#<Directory /usr/local/netdisco/html>
++#	order allow,deny
++#	allow from all
++#</Directory>
+ 
+ <Perl>
+ # Preload the netdisco module into global server space.
+ #   and parse the config file only once.
+ { package HTML::Mason::Commands;
+-    use lib '/usr/local/netdisco';
+     use netdisco qw/:all/;
+-    &netdisco::config('/usr/local/netdisco/netdisco.conf');
++    &netdisco::config('/etc/netdisco/netdisco.conf');
+ }
+ 
+ # Setup Mason and Session Handler
+@@ -35,8 +34,8 @@
+ 
+     my $ah = new HTML::Mason::ApacheHandler(
+         args_method            => 'mod_perl',
+-        comp_root              => '/usr/local/netdisco/html',
+-        data_dir               => '/usr/local/netdisco/mason',
++        comp_root              => '/usr/share/netdisco/html',
++        data_dir               => '/var/lib/netdisco/mason',
+         request_class          => 'MasonX::Request::WithApacheSession',
+         session_class          => 'Apache::Session::Postgres',
+         session_commit         => 1,
+diff -urN netdisco-1.0.orig/netdisco_apache_dir.conf netdisco-1.0/netdisco_apache_dir.conf
+--- netdisco-1.0.orig/netdisco_apache_dir.conf	2006-03-09 00:05:35.000000000 +0000
++++ netdisco-1.0/netdisco_apache_dir.conf	2009-09-08 18:57:39.000000000 +0100
+@@ -1,8 +1,7 @@
+ # Apache Configuration for Netdisco
+ # This is applied to each virtual server
+ 
+-Alias /netdisco                      "/usr/local/netdisco/html/"
+-Alias /netdisco/                     "/usr/local/netdisco/html/"
++Alias /netdisco  "/usr/share/netdisco/html/"
+ 
+ <Location /netdisco>
+ 	Options +Indexes
+diff -urN netdisco-1.0.orig/sql/pg netdisco-1.0/sql/pg
+--- netdisco-1.0.orig/sql/pg	2009-01-31 02:06:37.000000000 +0000
++++ netdisco-1.0/sql/pg	2009-09-08 18:57:39.000000000 +0100
+@@ -34,11 +34,9 @@
+ 	    $DefaultDir = $poss;
+ 	}
+     }
+-    $Dir        = $ARGS{d} || $DefaultDir;
+-    $ConfigFile = $ARGS{c} || "$Dir/netdisco.conf";
++    $Dir        = $ARGS{d} || '/usr/lib/netdisco';
++    $ConfigFile = $ARGS{c} || "/etc/netdisco/netdisco.conf";
+     $Psql       = $ARGS{p} || 'psql';
+-    eval "use lib '$Dir';";
+-    die "use lib '$Dir': $@." if ($@);
+ }
+ 
+ my $OS = $^O;
+@@ -304,7 +302,7 @@
+ 
+ OPTIONS
+    -b                        -- Batch mode, no override protection
+-   -d /usr/local/netdisco    -- Path to netdisco.pm
++   -d /usr/lib/netdisco      -- Path to netdisco "Home Directory" (can be ignored)
+    -c /path/to/netdisco.conf -- Netdisco Config file to use
+    -u pgsql                  -- Database UNIX user
+    -p /path/to/psql          -- psql cli executable
+@@ -314,3 +312,62 @@
+ 
+ end_usage
+ }
++
++__END__
++
++=head1 NAME npg
++
++npg - NetDisco Postgres shell
++
++=head1 SYNOPSIS
++
++ npg [options] [file.sql]
++
++=head1 DESCRIPTION
++
++Specify an SQL file to be run in batch mode, or don't give any arguments to
++launch the psql shell.
++
++=head1 OPTIONS
++
++ -b                        -- Batch mode, no override protection
++ -d /usr/lib/netdisco      -- Path to netdisco "Home Directory" (can be ignored)
++ -c /path/to/netdisco.conf -- Netdisco Config file to use
++ -u pgsql                  -- Database UNIX user
++ -p /path/to/psql          -- psql cli executable
++ -i                        -- Init all tables (Will delete all existing data!)
++ --back                    -- Create Backup of database
++
++=head1 AUTHOR
++
++Max Baker
++
++=head1 COPYRIGHT & LICENSE
++
++Copyright (c) 2006 Max Baker.
++
++Redistribution and use in source and binary forms, with or without 
++modification, are permitted provided that the following conditions are met:
++
++    * Redistributions of source code must retain the above copyright notice,
++      this list of conditions and the following disclaimer.
++    * 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.
++    * Neither the name of the University of California, Santa Cruz 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 COPYRIGHT OWNER 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.
++
++=cut
++
--- netdisco-1.0.orig/debian/patches/04_textentry_size.dpatch
+++ netdisco-1.0/debian/patches/04_textentry_size.dpatch
@@ -0,0 +1,107 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05_textentry_sizes.dpatch by Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Some web interface text entry boxes which are supposed to be able to 
+## DP: accept host names have maxlength set such that they're way to short to 
+## DP: be useful. This patch extends maxlength to 255 chars (the RFC max value 
+## DP: for FQDN) and widens some entry boxes for aesthetics.
+## DP: This bug is fixed in NetDisco 0.96
+
+@DPATCH@
+
+diff -urN netdisco-0.95.orig/html/device.html netdisco-0.95/html/device.html
+--- netdisco-0.95.orig/html/device.html	2007-03-17 23:36:29.000000000 +0000
++++ netdisco-0.95/html/device.html	2007-03-19 15:17:31.000000000 +0000
+@@ -2,7 +2,7 @@
+ <& SELF:show_device &>
+ <h4>Device Search - Quick</h4>
+ <FORM ACTION="<%$r->uri%>" METHOD=GET>
+-Device name or IP :<INPUT TYPE="text" name="ip" maxlength=20 size=20>
++Device name or IP :<INPUT TYPE="text" name="ip" maxlength=255 size=30>
+ <INPUT TYPE="submit" Value="Search">
+ <A HREF="<%$r->uri%>">[Reset Page]</A>
+ </FORM>
+diff -urN netdisco-0.95.orig/html/device_search.html netdisco-0.95/html/device_search.html
+--- netdisco-0.95.orig/html/device_search.html	2007-03-17 23:36:29.000000000 +0000
++++ netdisco-0.95/html/device_search.html	2007-03-19 15:18:07.000000000 +0000
+@@ -10,7 +10,7 @@
+ </TR>
+ <TR>
+     <TD colspan=4>
+-        <INPUT TYPE="text" size=30 maxlength=60 NAME="text" VALUE="<%$text%>">
++        <INPUT TYPE="text" size=30 maxlength=255 NAME="text" VALUE="<%$text%>">
+         <INPUT TYPE="submit" VALUE="Search All">
+         <FONT size=-1>(non-exact)</font>
+     </TD>
+@@ -20,15 +20,15 @@
+ </TR>
+ <TR>
+     <TD> IP: </TD>
+-    <TD><INPUT TYPE="text" size=30 maxlength=60 NAME="ip" VALUE="<%$ip%>"></TD>
++    <TD><INPUT TYPE="text" size=30 maxlength=255 NAME="ip" VALUE="<%$ip%>"></TD>
+     <TD>Location:</TD>
+-    <TD><INPUT TYPE="text" size=30 maxlength=60 NAME="loc" VALUE="<%$loc%>"></TD>
++    <TD><INPUT TYPE="text" size=30 maxlength=255 NAME="loc" VALUE="<%$loc%>"></TD>
+ </TR>
+ <TR>
+     <TD> DNS: </TD>
+-    <TD><INPUT TYPE="text" size=30 maxlength=60 NAME="dns" VALUE="<%$dns%>"> </TD>
++    <TD><INPUT TYPE="text" size=30 maxlength=255 NAME="dns" VALUE="<%$dns%>"> </TD>
+     <TD>Description: </TD>
+-    <TD><INPUT TYPE="text" size=30 maxlength=60 NAME="desc" VALUE="<%$desc%>"> </TD>
++    <TD><INPUT TYPE="text" size=30 maxlength=255 NAME="desc" VALUE="<%$desc%>"> </TD>
+ </TR>
+ <TR>
+     <TD> Vendor:</TD>
+@@ -68,7 +68,7 @@
+ </TR>
+ <TR>
+     <TD> sysName: </TD>
+-    <TD><INPUT TYPE="text" size=30 maxlength=60 NAME="name" VALUE="<%$name%>"></TD>
++    <TD><INPUT TYPE="text" size=30 maxlength=255 NAME="name" VALUE="<%$name%>"></TD>
+     <TD VALIGN=TOP> Exact Match: </TD>
+     <TD><INPUT TYPE="radio" NAME="exact" VALUE="1"<% $exact ? 'CHECKED' : ''%>>On
+         <INPUT TYPE="radio" NAME="exact" VALUE="0"<% !$exact ? 'CHECKED' : ''%>>Off
+@@ -103,7 +103,7 @@
+ <DL>
+     <DT>
+     <DD><INPUT TYPE="submit" name="specific" VALUE="SSID Search">
+-        <B>SSID:</B><INPUT TYPE="text" size=30 maxlength=60 NAME="ssid" VALUE="<%$ssid%>">
++        <B>SSID:</B><INPUT TYPE="text" size=30 maxlength=255 NAME="ssid" VALUE="<%$ssid%>">
+         <INPUT TYPE="radio" NAME="ssidbcast" value="1" <% defined $ssidbcast && $ssidbcast  ? ' CHECKED' : ''%>>Broadcast
+         <INPUT TYPE="radio" NAME="ssidbcast" value="0" <% defined $ssidbcast && !$ssidbcast ? ' CHECKED' : ''%>>Stealth
+         <INPUT TYPE="radio" NAME="ssidbcast" value="" <% !defined $ssidbcast ? ' CHECKED' : ''%>>Either
+diff -urN netdisco-0.95.orig/html/node.html netdisco-0.95/html/node.html
+--- netdisco-0.95.orig/html/node.html	2007-03-17 23:36:29.000000000 +0000
++++ netdisco-0.95/html/node.html	2007-03-19 15:18:21.000000000 +0000
+@@ -6,7 +6,7 @@
+ <TR>
+     <TD ROWSPAN=5 WIDTH="8">&nbsp;</TD>
+     <TD>MAC, Hostname, IP, NetBIOS: &nbsp;</TD>
+-    <TD><INPUT TYPE="text" name="node" maxlength=20 size=20 VALUE="<%$node%>">
++    <TD><INPUT TYPE="text" name="node" maxlength=255 size=30 VALUE="<%$node%>">
+         <BR><font size=-2><B>*</B> and <B>?</B> are wildcards.</font>
+     </TD>
+     <TD ROWSPAN=5 WIDTH="8">&nbsp;</TD>
+diff -urN netdisco-0.95.orig/html/sidebar.html netdisco-0.95/html/sidebar.html
+--- netdisco-0.95.orig/html/sidebar.html	2007-03-17 23:36:29.000000000 +0000
++++ netdisco-0.95/html/sidebar.html	2007-03-19 15:17:05.000000000 +0000
+@@ -13,7 +13,7 @@
+     <TD CLASS="sidebar-<% ++$odd%2 %>">
+     <FORM ACTION="<%$path%>/device.html" METHOD=GET>
+     [<A HREF="<%$path%>/device_search.html">Device Search</A>]<BR>
+-    <INPUT TYPE="text" size=10 maxlength=60 NAME="ip" TITLE="Enter the DNS or IP of a device and hit return.">
++    <INPUT TYPE="text" size=15 maxlength=255 NAME="ip" TITLE="Enter the DNS or IP of a device and hit return.">
+     </FORM>
+     </TD>
+ </TR>
+@@ -26,7 +26,7 @@
+     <TD CLASS="sidebar-<% ++$odd%2 %>">
+     <FORM ACTION="<%$path%>/node.html" METHOD=GET>
+     [<A HREF="<%$path%>/node.html">Node Search</A>]<BR>
+-    <INPUT TYPE="text" size=10 maxlength=60 NAME="node" TITLE="IP, DNS, MAC, NetBios  * and ? are wildcards.">
++    <INPUT TYPE="text" size=15 maxlength=255 NAME="node" TITLE="IP, DNS, MAC, NetBios  * and ? are wildcards.">
+     </FORM>
+     </TD>
+ </TR>
--- netdisco-1.0.orig/debian/patches/10_connected_devices_limit.dpatch
+++ netdisco-1.0/debian/patches/10_connected_devices_limit.dpatch
@@ -0,0 +1,55 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_connected_devices_limit.dpatch by oliver.gorwits@oucs.ox.ac.uk
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: limit the number of connected device shown to about 3 or so
+
+@DPATCH@
+
+diff -urN netdisco.orig/html/device.html netdisco/html/device.html
+--- netdisco.orig/html/device.html	2009-09-08 22:19:51.000000000 +0100
++++ netdisco/html/device.html	2009-09-09 00:06:50.000000000 +0100
+@@ -155,12 +155,16 @@
+         # Get count of log entries for this port
+         $portreq->{logs} = sql_scalar('device_port_log',['count(id)'],{'ip'=>$switch,'port'=>$port});
+ 
++# XXX
+         # Get Nodes Attached
+         my $nodes = sql_rows('node',
+             ['mac','active','extract (epoch from time_first) as time_first',
+              'extract (epoch from time_last) as time_last'],
+-            {'switch' => $switch, 'port' => $port } );
++            {'switch' => $switch, 'port' => $port },
++            undef, 'limit 3');
+         $portreq->{macs} = (defined $nodes and scalar @$nodes) ? $nodes : undef;
++#        my $nodes = [];
++#        $portreq->{macs} = undef;
+ 
+         # Get Power info
+         $portreq->{power} = sql_hash('device_port_power',['*'],{'ip'=>$switch,'port'=>$port});
+@@ -219,7 +223,15 @@
+         foreach my $macip (@$ips){
+             my $mac = $macip->{mac};
+             my $ip  = $macip->{ip};
+-            push ( @{$node_ips->{$mac}},$ip);
++            if (ref $node_ips->{$mac} eq 'ARRAY' and scalar @{$node_ips->{$mac}} > 11) {
++                next;
++            }
++            elsif (ref $node_ips->{$mac} eq 'ARRAY' and scalar @{$node_ips->{$mac}} == 11) {
++                push (@{$node_ips->{$mac}},'(more than...)');
++            }
++            else {
++                push (@{$node_ips->{$mac}},$ip);
++            }
+         }
+     }
+ 
+@@ -612,9 +619,9 @@
+     <TH><%$desc%></TH>
+ %}
+     <TH>VLAN <BR>Membership</TH>
+-    <TH>Connected<BR>Devices<% $arg_age eq 'on' ? '<BR><span class="smaller">(Last Seen)</span>' : ''%></TH>
++    <TH>Connected<BR>Devices (max 3)<% $arg_age eq 'on' ? '<BR><span class="smaller">(Last Seen)</span>' : ''%></TH>
+ %# if ($port_control) {
+     <TH>Port<BR>Control</TH>
+ %#}
--- netdisco-1.0.orig/debian/patches/02_oui_location.dpatch
+++ netdisco-1.0/debian/patches/02_oui_location.dpatch
@@ -0,0 +1,21 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_oui_location.dpatch by Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Make the -O option look for oui.txt in the cwd, rather than in the 
+## DP: config dir, so it can be called by any user.
+
+@DPATCH@
+
+diff -urN netdisco-1.0.orig/netdisco netdisco-1.0/netdisco
+--- netdisco-1.0.orig/netdisco	2009-06-20 18:45:13.000000000 +0100
++++ netdisco-1.0/netdisco	2009-09-08 18:51:30.000000000 +0100
+@@ -973,7 +973,7 @@
+ 
+ sub parse_oui {
+     print "parse_oui()\n";
+-    my $oui_file = "$CONFIG{home}/oui.txt";
++    my $oui_file = "./oui.txt";
+     unless (-r $oui_file){
+         print "  $oui_file not found!\n";
+         die "Please run ''make oui'' to download oui.txt.  Or read INSTALL\n";
--- netdisco-1.0.orig/debian/patches/05_graphviz_defaults.dpatch
+++ netdisco-1.0/debian/patches/05_graphviz_defaults.dpatch
@@ -0,0 +1,21 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05_graphviz_defaults.dpatch by Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Alter the default options for GraphViz to omit less warnings
+## DP: Bug#497939
+
+@DPATCH@
+
+diff -urN netdisco-1.0.orig/netdisco netdisco-1.0/netdisco
+--- netdisco-1.0.orig/netdisco	2009-06-20 18:45:13.000000000 +0100
++++ netdisco-1.0/netdisco	2009-09-08 18:55:57.000000000 +0100
+@@ -4095,7 +4095,7 @@
+                     'style'     => $CONFIG{node_style}     || 'filled',
+                     'fontname'  => $CONFIG{node_font}      || 'lucon',
+                     'fontsize'  => $CONFIG{node_fontsize}  || 12,
+-                    'fixedsize' => $CONFIG{node_fixedsize} || 'true',
++                    'fixedsize' => $CONFIG{node_fixedsize} ? 'true' : 'false',
+                     };
+     $node_defs->{height} = $CONFIG{node_height} if defined $CONFIG{node_height};
+     $node_defs->{width}  = $CONFIG{node_width}  if defined $CONFIG{node_width};
--- netdisco-1.0.orig/debian/patches/06_no_pg_vacuum.dpatch
+++ netdisco-1.0/debian/patches/06_no_pg_vacuum.dpatch
@@ -0,0 +1,25 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 06_no_pg_vacuum.dpatch by Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Disable NEtdisco's database vacuum - this is buggy in 0.95 as it
+## DP: attempts to vacuum all tables including those netdisco does not have
+## DP: permissions upon.
+## DP: Bug#497938
+
+@DPATCH@
+
+diff -urN netdisco-0.95.orig/netdisco netdisco-0.95/netdisco
+--- netdisco-0.95.orig/netdisco	2008-09-11 15:42:18.000000000 +0100
++++ netdisco-0.95/netdisco	2008-09-11 15:46:30.000000000 +0100
+@@ -3079,8 +3079,8 @@
+ 
+     &netbios_dump("netbios/$month");
+ 
+-    print "  Running Database Vacuum...\n";
+-    sql_vacuum('','print'=>1);
++    # print "  Running Database Vacuum...\n";
++    # sql_vacuum('','print'=>1);
+ 
+     &batch_mode_end unless $no_batch;
+ }
--- netdisco-1.0.orig/debian/patches/08_device_routes.dpatch
+++ netdisco-1.0/debian/patches/08_device_routes.dpatch
@@ -0,0 +1,130 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 08_device_routes.dpatch by Arizona State University
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Retrieve route information from device and store in DB
+
+@DPATCH@
+
+diff -urN netdisco.orig/netdisco netdisco/netdisco
+--- netdisco.orig/netdisco	2009-06-20 18:45:13.000000000 +0100
++++ netdisco/netdisco	2009-09-08 22:46:05.000000000 +0100
+@@ -203,6 +203,7 @@
+     # Walk Interfaces
+     store_interfaces($device);
+     store_vlans($device);
++    get_routes($device);
+     store_power($device);
+ 
+     # Walk Modules
+@@ -2880,6 +2881,79 @@
+     print "[$ip]   $v_count VLAN Interfaces, $v_ncount names.\n";
+ }
+ 
++=item get_routes() 
++
++ASU mod to pull routes from devices
++
++=cut
++
++sub get_routes
++{
++  my $device = shift;
++  my $devip = $device->{ip};
++  my $layers = $device->layers() if defined $device;
++  return unless (has_layer($layers,3));
++
++  tryuse('NetAddr::IP', die => 1);
++  sql_begin();
++
++  # remove old values
++  sql_do(qq/DELETE from device_route where ip = '$devip'/);
++
++  print "[$devip]  Fetching Route Information:\n";
++
++  my $interfaces = $device->interfaces();
++
++  foreach my $network (@{$CONFIG{route_networks}})
++  {
++   $network =~ s/\s//g;
++   $network =~ s/(\.0)+$//;
++
++   my $ipr_route = $device->ipr_route($network);
++   my $ipr_proto = $device->ipr_proto($network);
++   my $ipr_mask  = $device->ipr_mask($network);
++   my $ipr_dest  = $device->ipr_dest($network);
++   my $ipr_type  = $device->ipr_type($network);
++
++   foreach my $iid (keys %$ipr_proto)
++   {
++    if ($ipr_dest->{$iid} eq '0.0.0.0')
++    {
++     $DEBUG and print "Skipping route $ipr_route->{$iid}/$ipr_mask->{$iid} ($ipr_dest->{$iid}) (routes to 0.0.0.0)\n";
++     next;
++    }
++
++    unless ($ipr_proto->{$iid} eq 'local')
++    {
++     $DEBUG and print "Skipping route $ipr_route->{$iid}/$ipr_mask->{$iid} ($ipr_dest->{$iid}) (remote route)\n";
++     next;
++    }
++
++    unless ($ipr_type->{$iid} eq 'indirect')
++    {
++      $DEBUG and print "Skipping route $ipr_route->{$iid}/$ipr_mask->{$iid} ($ipr_dest->{$iid}) (direct route)\n";
++      next;
++    }
++
++    my $net = new NetAddr::IP("$ipr_route->{$iid}", "$ipr_mask->{$iid}")->network();
++
++    $DEBUG and print "    Inserting route $ipr_route->{$iid}/$ipr_mask->{$iid} ($ipr_dest->{$iid})\n";
++
++    my %store;
++
++    $store{ip}      = "$devip";
++    $store{network} = "$net";
++    $store{dest}    = "$ipr_dest->{$iid}";
++    $store{last_discover} = 'now';
++    insert_or_update('device_route', { 'ip' => "$devip", 'network' => "$net" },
++                     \%store );
++   }
++  }
++ print "\n";
++ sql_commit();
++}
++
++
+ =item store_power()
+ 
+ Gets all the Power-over-Ethernet information using Table Methods in SNMP::Info.  
+diff -urN netdisco.orig/netdisco.pm netdisco/netdisco.pm
+--- netdisco.orig/netdisco.pm	2009-09-08 22:17:02.000000000 +0100
++++ netdisco/netdisco.pm	2009-09-08 22:43:33.000000000 +0100
+@@ -317,7 +317,7 @@
+                         macsuck_only arpnip_only discover_only
+                         snmpforce_v1 snmpforce_v2 snmpforce_v3 db_tables
+                         v3_users v3_users_rw
+-                        ldap_server /;
++                        ldap_server route_networks /;
+ 
+     # these will make a reference to a hash:
+     #      keys :comma separated list entries value : number > 0
+diff -urN netdisco.orig/sql/device_routes.sql netdisco/sql/device_routes.sql
+--- netdisco.orig/sql/device_routes.sql	1970-01-01 01:00:00.000000000 +0100
++++ netdisco/sql/device_routes.sql	2009-09-08 22:46:59.000000000 +0100
+@@ -0,0 +1,15 @@
++
++DROP TABLE device_route;
++
++CREATE TABLE device_route (
++    ip              inet NOT NULL,
++    network         cidr NOT NULL,
++    creation        TIMESTAMP DEFAULT now(),
++    dest            inet,
++    last_discover   TIMESTAMP DEFAULT now()
++);
++
++-- Indexing for robustness and speed
++ALTER TABLE device_route ADD PRIMARY KEY (ip, network);
++ALTER TABLE device_route ADD CONSTRAINT idx_device_route_network UNIQUE (network);
++
--- netdisco-1.0.orig/debian/patches/00list
+++ netdisco-1.0/debian/patches/00list
@@ -0,0 +1,3 @@
+01_fhs
+02_oui_location
+05_graphviz_defaults
--- netdisco-1.0.orig/debian/patches/09_graphs_column.dpatch
+++ netdisco-1.0/debian/patches/09_graphs_column.dpatch
@@ -0,0 +1,48 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 09_graphs_column.dpatch by oliver.gorwits@oucs.ox.ac.uk
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: replace the port control column with a graphs link column
+
+@DPATCH@
+
+diff -urN netdisco.orig/html/device.html netdisco/html/device.html
+--- netdisco.orig/html/device.html	2009-09-08 22:19:51.000000000 +0100
++++ netdisco/html/device.html	2009-09-09 00:06:50.000000000 +0100
+@@ -612,9 +624,10 @@
+     <TH><%$desc%></TH>
+ %}
+     <TH>VLAN <BR>Membership</TH>
+-    <TH>Connected<BR>Devices<% $arg_age eq 'on' ? '<BR><span class="smaller">(Last Seen)</span>' : ''%></TH>
++    <TH>Graphs</TH>
++    <TH>Connected<BR>Devices<% $arg_age eq 'on' ? '<BR><span class="smaller">(Last Seen)</span>' : ''%></TH>
+ %# if ($port_control) {
+-    <TH>Port<BR>Control</TH>
++%#    <TH>Port<BR>Control</TH>
+ %#}
+ </TR>
+ </%method>
+@@ -705,6 +718,23 @@
+ &nbsp; \
+ % }
+ </SPAN></TD>
++<%perl>
++    # Graph Column
++    my $GRAPH_URL = $netdisco::CONFIG{graph_base_url} || '';
++    my $IMAGE_URL = $netdisco::CONFIG{graph_icon} || '';
++    my $graph_link = "<A HREF='$GRAPH_URL?ip=". $m->interp->apply_escapes($device->{ip},'u').
++            '&dns='. $m->interp->apply_escapes($device->{dns},'u').
++            '&name='. $m->interp->apply_escapes($port->{name},'u').
++            '&port='. $m->interp->apply_escapes($port->{port},'u').
++            "'><IMG SRC='$IMAGE_URL'/></A>";
++</%perl>
++        <TD CLASS="<%$rowclass%>"><SPAN CLASS="<%$class%>"> \
++% if (defined $graph_link) {
++<% $graph_link %> \
++% } else {
++&nbsp; \
++% }
++</SPAN></TD>
+ % # Connected Devices Column
+         <TD CLASS="<%$rowclass%> connected">
+ <%perl>
--- netdisco-1.0.orig/debian/patches/03_getip_subnet.dpatch
+++ netdisco-1.0/debian/patches/03_getip_subnet.dpatch
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03_getip_subnet.dpatch by Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Although getip() is called as part of looking for hosts or IPs in the 
+## DP: _only and _no config options, it cannot handle subnets (e.g. /20) which 
+## DP: are also allowed, so this is a tiny hack to enable that.
+## DP: This bug is fixed in NetDisco 0.96
+
+@DPATCH@
+
+--- trunk/netdisco.pm.orig	2007-03-18 01:50:48.000000000 +0000
++++ trunk/netdisco.pm	2007-03-18 01:51:26.000000000 +0000
+@@ -481,7 +481,7 @@
+ 
+     my $ip;
+ 
+-    if ($hostname =~ /^\d+\.\d+\.\d+\.\d+$/) {
++    if ($hostname =~ /^\d+\.\d+\.\d+\.\d+(?:\/\d+)?$/) {
+         $ip = $hostname;
+     } else {
+         my $testhost = inet_aton($hostname);