debian/0000755000000000000000000000000012251604111007157 5ustar debian/compat0000644000000000000000000000000212065026507010367 0ustar 9 debian/control0000644000000000000000000000140112251601534010564 0ustar Source: ipcalc Section: net Priority: optional Maintainer: Bartosz Fenski Build-Depends: debhelper (>= 9) Standards-Version: 3.9.4 Homepage: http://jodies.de/ipcalc Package: ipcalc Architecture: all Depends: ${misc:Depends}, ${perl:Depends} Description: parameter calculator for IPv4 addresses ipcalc takes an IPv4 address and netmask and calculates the resulting broadcast, network, Cisco wildcard mask, and host range. By giving a second netmask, you can design sub- and supernetworks. It is also intended to be a teaching tool and presents the results as easy-to-understand binary values. . Originally, ipcalc was intended for use from the shell prompt, but a CGI wrapper is provided to enable colorful HTML display through a webserver. debian/copyright0000644000000000000000000000525412251603576011136 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ipcalc Source: http://jodies.de/ipcalc Files: * Copyright: 2000-2006 Krischan Jodies License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". Files: ipcalc.gif ipcalculator.png Copyright: 2002 Frank Quotschalla License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". Files: debian/* Copyright: 2001-2004 Martin F. Krafft 2005-2013 Bartosz Fenski License: GPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". debian/docs0000644000000000000000000000003312065025651010037 0ustar contributors debian/README debian/rules0000755000000000000000000000174312065026507010256 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 configure: configure-stamp configure-stamp: dh_testdir touch configure-stamp build-arch: build build-indep: build build: configure-stamp build-stamp build-stamp: dh_testdir touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs dh_install mv debian/ipcalc/usr/lib/cgi-bin/ipcalc.cgi \ debian/ipcalc/usr/lib/cgi-bin/ipcalc binary-indep: build install dh_testdir dh_testroot dh_installdocs dh_installman debian/ipcalc.1 debian/ipcalc_cgi.1 dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_perl dh_gencontrol dh_md5sums dh_builddeb binary-arch: build install binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure debian/dirs0000644000000000000000000000013012065025651010046 0ustar usr/bin usr/share/doc/ipcalc usr/lib/cgi-bin usr/share/man/man1 usr/share/images/ipcalc debian/ipcalc.10000644000000000000000000000362412065035170010507 0ustar .\" -*- nroff -*- .\" .\" ipcalc.1 .\" .\" This program was written by .\" Krischan Jodies .\" .\" This manpage was created by: .\" Nick Clifford .\" .\" The author of the program retains copyrights to the program, however .\" his manpage is Copyright (c) 2003 Nick Clifford .\" .\" This program and this manpage is distributed under the terms of the .\" GNU General Public License. See COPYING for additional information. .\" .TH ipcalc 1 .\" "ipcalc Manual" "Jan 25, 2003" .SH NAME ipcalc - An IPv4 Netmask/broadcast/etc calculator .SH SYNOPSIS \fB ipcalc \fR [options] \fIADDRESS\fR[[/]\fINETMASK\fR] [\fINETMASK\fR] .SH DESCRIPTION \fBipcalc\fR takes an IPv4 address and netmask and calculates the resulting broadcast, network, Cisco wildcard mask, and host range. By giving a second netmask, you can design sub- and supernetworks. It is also intended to be a teaching tool and presents the results as easy-to-understand binary values. .TP \fB--help\fR Display help usage .TP \fB-n\fR, \fB--nocolor\fR Don't display ANSI color codes .TP \fB-b\fR, \fB--nobinary\fR Suppress the bitwise output .TP \fB-c\fR, \fB--class\fR Just print bit-count-mask of given address .TP \fB-h\fR, \fB--html\fR Display results as HTML .TP \fB-v\fR, \fB--version\fR Print Version .TP \fB-s\fR, \fB--split\fR \fIn1\fR \fIn2\fR \fIn3\fR. Split into networks of size n1, n2, n3 .TP \fB-r\fR, \fB--range\fR Deaggregate address range .SH EXAMPLES ipcalc 192.168.0.1/24 .PP ipcalc 192.168.0.1/255.255.128.0 .PP ipcalc 192.168.0.1 255.255.128.0 255.255.192.0 .PP ipcalc 192.168.0.1 0.0.63.255 .PP deaggregate address range .RS \fBipcalc - \fP .RE .PP split network to subnets where a b c fits in .RS \fBipcalc
/ -s a b c\fP .RE .SH AUTHOR Written by Krischan Jodies .SH "SEE ALSO" .BR ipsc (1) .BR gipsc (1) .PP The ipcalc website: http://jodies.de/ipcalc debian/changelog0000644000000000000000000001211412251604035011035 0ustar ipcalc (0.41-4) unstable; urgency=low * The Akamai Technologies paid volunteer days release. * Fixes overzealous input checking (Closes: #332468) * Martin F Krafft removed as co-maintainer (Closes: #719098) + package now uses new copyright format * Bumped Standards-Version (no changes needed) -- Bartosz Fenski Tue, 10 Dec 2013 13:05:15 +0100 ipcalc (0.41-3) unstable; urgency=low * The Akamai Technologies paid volunteer days release. * ACK previous NMU, thanks Christopher! * Documents some missing features in the manpage (Closes: #588143) Thanks Tanguy Ortolo ! * Fixes other minor problems in manpage (Closes: #688148) * Description now says it's tool IPv4 only (Closes: #628955) * Fixes lack of tag when printing supernets (Closes: #600251) * The following changes are courtesy of Jari Aalto : - Remove deprecated dpatch and upgrade to packaging format "3.0 quilt". - Update to Standards-Version to 3.9.3 and debhelper to 9. - Add build-arch and build-indep targets; use dh_prep in rules file. - Patch 03: update with "quilt refresh" to make it apply cleanly. Thanks to these changes (Closes: #670737) -- Bartosz Fenski Fri, 21 Dec 2012 12:30:11 +0100 ipcalc (0.41-2.1) unstable; urgency=low * Non-maintainer upload. * Handle cases where $TERM is not set (like in cron) as well (Closes: #547321) -- Christoph Egger Mon, 12 Mar 2012 19:04:53 +0100 ipcalc (0.41-2) unstable; urgency=low * Doesn't activate colours in Emacs (Closes: #479877) * Doesn't refer to nonexistent background file (Closes: #436199) * Manpage doesn't refer to nonexistent --help option (Closes: #522523) * Adjusted output width (Closes: #479956, #479958) * Homepage moved to its header from description. * debian/copyright refers to certain version of GPL. * debian/rules removed DH_COMPAT. * Bumped Standards-Version to 3.8.2 (no changes needed). * Bumped DH compatibility level. -- Bartosz Fenski Tue, 14 Jul 2009 14:34:08 +0200 ipcalc (0.41-1) unstable; urgency=low * New upstream release. - fixes cross-site scripting (XSS) vulnerability (Closes: #381469) (see CVE-2006-3848 for details) * Bumped needed debhelper version. * Updated Standards-Version to 3.7.2 (no changes needed). -- Bartosz Fenski Thu, 7 Sep 2006 09:04:48 +0200 ipcalc (0.40-1) unstable; urgency=low * New upstream version. - option '-c' should finally work as one day. - includes stylesheet in cgi file. * Patch fixing paths has been fixed to work with new version. -- Bartosz Fenski Wed, 13 Jul 2005 11:47:32 +0200 ipcalc (0.39-1) unstable; urgency=low * New upstream version (Closes: #293918) - has properly working '-c' option again (Closes: #288867) - fixes problems on 64bit archs (Closes: #312991) - includes graphic files (Closes: #288332) * New co-maintainer (myself), thus changes in control file. * Copyright belongs to author and not to GPL license. Fixed. Also extended to include copyright info for graphics. * Added URL to homepage in control file. * We're now using dh_install instead of another Makefile. We also use DH_COMPAT=4 to make dh_fixperms behave more friendly. * Bumped Standards-Version (no changes needed) * ipcalc cgi script is patched with the help of dpatch. Hopefully most webservers will have /images/ alias soon, so we could use /usr/share/images/ipcalc for graphics. -- Bartosz Fenski Thu, 7 Jul 2005 11:37:36 +0200 ipcalc (0.37-1) unstable; urgency=low * New upstream release (closes: Bug#248872) Please see the note in README.Debian if you are using the CGI. * Updated the Standards-Version to 3.6.1 to conform with Debian Policy (no other changes though). -- martin f. krafft Thu, 20 May 2004 02:26:42 +0200 ipcalc (0.35-3) unstable; urgency=low * Corrected wrong path in ipcalc_cgi (closes: Bug#179471). * Moved ipcalc_cgi to /usr/lib/cgi-bin/ipcalc * Updated the Standards-Version to 3.5.9 to conform with Debian Policy (no other changes though). * Included manpages by Nick Clifford . Thanks! -- martin f. krafft Sun, 26 Jan 2003 20:45:22 +0100 ipcalc (0.35-2) unstable; urgency=low * Updated the Standards-Version to 3.5.8 to conform with Debian Policy. -- martin f. krafft Wed, 4 Dec 2002 10:52:38 +0100 ipcalc (0.35-1) unstable; urgency=low * Corrected the missing Debian version number. -- martin f. krafft Sun, 8 Sep 2002 18:35:25 +0200 ipcalc (0.35) unstable; urgency=low * New upstream release. -- martin f. krafft Sun, 8 Sep 2002 18:35:03 +0200 ipcalc (0.34-2) unstable; urgency=low * Updated the credits in various places. -- martin f. krafft Thu, 16 May 2002 18:00:26 +0200 ipcalc (0.34-1) unstable; urgency=low * Initial release. -- martin f. krafft Fri, 14 Sep 2001 20:24:21 +0200 debian/ipcalc_cgi.10000644000000000000000000000226312065035205011326 0ustar .\" -*- nroff -*- .\" .\" ipcalc_cgi.1 .\" .\" This program was written by .\" Krischan Jodies .\" .\" This manpage was created by: .\" Nick Clifford .\" .\" The author of the program retains copyrights to the program, however .\" his manpage is Copyright (c) 2003 Nick Clifford .\" .\" This program and this manpage is distributed under the terms of the .\" GNU General Public License. See COPYING for additional information. .\" .TH ipcalc_cgi 1 .\" "ipcalc_cgi Manual" "Jan 25, 2003" .SH NAME ipcalc_cgi - An IPv4 Netmask/broadcast/etc cgi calculator .SH SYNTAX \fBipcalc\fR should be called as a CGI application from a web server. .SH DESCRIPTION \fBipcalc_cgi\fR is the web based version of \fBipcalc\fR. It takes an IPv4 address and netmask and calculates the resulting broadcast, network, Cisco wildcard mask, and host range. By giving a second netmask, you can design sub- and supernetworks. It is also intended to be a teaching tool and presents the results as easy-to-understand binary values. .SH AUTHOR Written by Krischan Jodies .SH "SEE ALSO" .BR ipsc (1) .BR gipsc (1) .PP The ipcalc website: http://jodies.de/ipcalc debian/README0000644000000000000000000000410312065035145010045 0ustar ipcalc ------ Homepage: http://jodies.de/ipcalc Author: Krischan Jodies Contributors: Hermann J. Beckers Kevin Ivory Frank Quotschalla Sven Anderson Scott Davis Denis A. Hainsworth This README by: Martin F. Krafft WHAT IS IT? =========== : ipcalc takes an IPv4 address and netmask and calculates the resulting broadcast, network, Cisco wildcard mask, and host range. By giving a second netmask, you can design sub- and supernetworks. It is also intended to be a teaching tool and presents the results as easy-to-understand binary values. Enter your netmask(s) in CIDR notation (/25) or dotted decimals (255.255.255.0). Inverse netmasks are recognized. If you omit the netmask ipcalc uses the default netmask for the class of your network. Look at the space between the bits of the addresses: The bits before it are the network part of the address, the bits after it are the host part. You can see two simple facts: In a network address all host bits are zero, in a broadcast address they are all set. The class of your network is determined by its first bits. If your network is a private internet according to RFC 1918 this is remarked. When displaying subnets the new bits in the network part of the netmask are marked in a different color The wildcard is the inverse netmask as used for access control lists in Cisco routers. Do you want to split your network into subnets? Enter the address and netmask of your original network and play with the second netmask until the result matches your needs. You can have all this fun at your shell prompt. Originally ipcalc was not intended for creating HTML and still works happily in /usr/bin/ :-) DOCUMENTATION ============= There is none, and you shall find that none is necessary. The scripts provide verbose usage output when run without the correct arguments, so just go ahead and play with them. Keep the good times rollin' Martin debian/patches/0000755000000000000000000000000012251601505010612 5ustar debian/patches/03-width.patch0000644000000000000000000000730412065026507013204 0ustar From: Bartosz Fenski Subject: Adjust usage() text --- ipcalc | 62 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) --- a/ipcalc +++ b/ipcalc @@ -1050,10 +1050,11 @@ print << "EOF"; Usage: ipcalc [options]
[[/]] [NETMASK] -ipcalc takes an IP address and netmask and calculates the resulting broadcast, -network, Cisco wildcard mask, and host range. By giving a second netmask, you -can design sub- and supernetworks. It is also intended to be a teaching tool -and presents the results as easy-to-understand binary values. +ipcalc takes an IP address and netmask and calculates the resulting +broadcast, network, Cisco wildcard mask, and host range. By giving a +second netmask, you can design sub- and supernetworks. It is also +intended to be a teaching tool and presents the results as +easy-to-understand binary values. -n --nocolor Don't display ANSI color codes. -c --color Display ANSI color codes (default). @@ -1065,7 +1066,7 @@ Split into networks of size n1, n2, n3. -r --range Deaggregate address range. --help Longer help text. - + Examples: ipcalc 192.168.0.1/24 @@ -1088,37 +1089,36 @@ sub help { print << "EOF"; - -IP Calculator $version - -Enter your netmask(s) in CIDR notation (/25) or dotted decimals (255.255.255.0). -Inverse netmask are recognized. If you mmit the netmask, ipcalc uses the default -netmask for the class of your network. - -Look at the space between the bits of the addresses: The bits before it are -the network part of the address, the bits after it are the host part. You can -see two simple facts: In a network address all host bits are zero, in a -broadcast address they are all set. -The class of your network is determined by its first bits. - -If your network is a private internet according to RFC 1918 this is remarked. -When displaying subnets the new bits in the network part of the netmask are -marked in a different color. - -The wildcard is the inverse netmask as used for access control lists in Cisco -routers. You can also enter netmasks in wildcard notation. - -Do you want to split your network into subnets? Enter the address and netmask -of your original network and play with the second netmask until the result -matches your needs. +IP Calculator $version +Enter your netmask(s) in CIDR notation (/25) or dotted decimals +(255.255.255.0). Inverse netmask are recognized. If you mmit the +netmask, ipcalc uses the default netmask for the class of your +network. + +Look at the space between the bits of the addresses: The bits before +it are the network part of the address, the bits after it are the host +part. You can see two simple facts: In a network address all host bits +are zero, in a broadcast address they are all set. + +The class of your network is determined by its first bits. + +If your network is a private internet according to RFC 1918 this is +remarked. When displaying subnets the new bits in the network part of +the netmask are marked in a different color. + +The wildcard is the inverse netmask as used for access control lists +in Cisco routers. You can also enter netmasks in wildcard notation. + +Do you want to split your network into subnets? Enter the address and +netmask of your original network and play with the second netmask +until the result matches your needs. -Questions? Comments? Drop me a mail... -krischan at jodies.de +Questions? Comments? Drop me a mail: krischan at jodies.de http://jodies.de/ipcalc -Thanks for your nice ideas and help to make this tool more useful: +Thanks for your nice ideas and help to make this tool more useful: Bartosz Fenski Denis A. Hainsworth debian/patches/04-supernet.patch0000644000000000000000000000103512065037735013733 0ustar Description: add table tag at the end of supernets adds tag at the end of supernet output when in html mode Author: Bartosz Fenski Origin: Debian Bug-Debian: http://bugs.debian.org/600251 Forwarded: no Last-Update: 2012-12-21 --- ipcalc-0.41.orig/ipcalc +++ ipcalc-0.41/ipcalc @@ -225,6 +225,9 @@ EOF if ($mask1 > $mask2) { print "Supernet\n\n"; supernet($network,$mask1,$mask2); + if ($opt_html) { + html("\n"); + } } if ($opt_html) { print << 'EOF'; debian/patches/02-emacs.patch0000644000000000000000000000226112065026507013151 0ustar From: Bartosz Fenski Subject: If running inside Emacs M-x shell, turn of colors by default --- a/ipcalc +++ b/ipcalc @@ -708,7 +708,13 @@ sub getopts if (-t STDOUT) { $opt_color = 1; } - + + # Under Emacs, do not use colors by default. The TERM is for older + # Emacs versions. + if ( !defined($ENV{'TERM'}) or $ENV{'TERM'} =~ /dumb/i or $ENV{'INSIDE_EMACS'} ) { + $opt_color = 0; + } + while (has_opts()) { $arg = shift @ARGV; if ($arg =~ /^--(.+)/) { @@ -781,6 +787,9 @@ sub getopts elsif ($opt eq 'help') { $opt_help = 1; } + elsif ($opt eq 'c' || $opt eq 'color') { + $opt_color = 1; + } elsif ($opt eq 'n' || $opt eq 'nocolor') { $opt_color = 0; } @@ -1047,6 +1056,7 @@ can design sub- and supernetworks. It is also intended to be a teaching tool and presents the results as easy-to-understand binary values. -n --nocolor Don't display ANSI color codes. + -c --color Display ANSI color codes (default). -b --nobinary Suppress the bitwise output. -c --class Just print bit-count-mask of given address. -h --html Display results as HTML (not finished in this version). -- debian/patches/01-paths.patch0000644000000000000000000000462712065026507013207 0ustar From: Bartosz Fenski Subject: Correct absolute path, use plain background etc. --- a/ipcalc.cgi.orig 2006-09-22 12:33:45.000000000 +0200 +++ b/ipcalc.cgi 2006-09-22 12:35:58.000000000 +0200 @@ -40,7 +40,7 @@ # 0.26 27.07.2006 Replaced REQUEST_URI with SCRIPT_URL to prevent cross-site-scripting attacks $|=1; -$ipcalc = "/usr/local/bin/ipcalc"; +$ipcalc = "/usr/bin/ipcalc"; $MAIL_ADDRESS="ipcalc-200502@jodies.de"; # history: # 200404 @@ -137,7 +137,6 @@