ipcalc tool, obsolete version and new url.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I became aware of this intersting tool: cer@Telcontar:~> rpm -qi ipcalc Name : ipcalc Version : 0.41 Release : lp152.3.2 Architecture: noarch Install Date: 2021-04-02T14:44:29 CEST Group : Productivity/Networking/System Size : 32578 License : GPL-2.0+ Signature : RSA/SHA256, 2019-09-20T18:23:50 CEST, Key ID b88b2fd43dbdc284 Source RPM : ipcalc-0.41-lp152.3.2.src.rpm Build Date : 2019-09-20T18:23:45 CEST Build Host : build85 Relocations : (not relocatable) Packager : https://bugs.opensuse.org Vendor : openSUSE URL : http://jodies.de/ipcalc Summary : IPv4 Address Calculator Description : 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 subnets and supernets. It is also presents the subnetting 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. Distribution: openSUSE Leap 15.2 cer@Telcontar:~> However, our version is obsolete, from 2005: Mageia 8 has version 1.0.0. The current repo is (apparently) https://gitlab.com/ipcalc/ipcalc, updated past year. (Sorry, I don't have the knowledge to do packages) - -- Cheers Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCYGeB0Rwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVEKwAniG84xnPdIPNO1REcYsr yXoVf/LEAJ9SNwibswnmSUoCtXymRr8Eh7JzPw== =ngpb -----END PGP SIGNATURE-----
Hello Carlos Am Freitag, 2. April 2021, 22:42:57 CEST schrieb Carlos E. R.:
I became aware of this intersting tool:
cer@Telcontar:~> rpm -qi ipcalc
....
However, our version is obsolete, from 2005: Mageia 8 has version 1.0.0. The current repo is (apparently) https://gitlab.com/ipcalc/ipcalc, updated past year.
I had a quick look at it, it would probably be a complete rewrite of the spec file, as it uses the 'meson' build system (which I dont know anything about) Sorry.... Axel
On Sat, 03 Apr 2021 18:55:05 +0200
Axel Braun
Hello Carlos
Am Freitag, 2. April 2021, 22:42:57 CEST schrieb Carlos E. R.:
I became aware of this intersting tool:
cer@Telcontar:~> rpm -qi ipcalc
....
However, our version is obsolete, from 2005: Mageia 8 has version 1.0.0. The current repo is (apparently) https://gitlab.com/ipcalc/ipcalc, updated past year.
I had a quick look at it, it would probably be a complete rewrite of the spec file, as it uses the 'meson' build system (which I dont know anything about)
meson seems to be a coming thing? Not that I know anything about it either!
Sorry.... Axel
On Fri, 2021-04-02 at 22:42 +0200, Carlos E. R. wrote:
Hi,
I became aware of this intersting tool:
cer@Telcontar:~> rpm -qi ipcalc
[snip]
However, our version is obsolete, from 2005: Mageia 8 has version 1.0.0. The current repo is (apparently) https://gitlab.com/ipcalc/ipcalc, updated past year.
Here's a first attempt at the update: https://build.opensuse.org/package/show/home:badshah400:branches:network:uti.... Would be very grateful if you can try it out and let me know if it needs more work before I send an sr to the devel project. Cheers, -- Atri Bhattacharya Sat 3 Apr 23:50:46 CEST 2021 Sent from openSUSE Tumbleweed on my laptop.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2021-04-03 at 23:54 +0200, Atri Bhattacharya wrote:
On Fri, 2021-04-02 at 22:42 +0200, Carlos E. R. wrote:
Hi,
I became aware of this intersting tool:
cer@Telcontar:~> rpm -qi ipcalc
[snip]
However, our version is obsolete, from 2005: Mageia 8 has version 1.0.0. The current repo is (apparently) https://gitlab.com/ipcalc/ipcalc, updated past year.
Here's a first attempt at the update: https://build.opensuse.org/package/show/home:badshah400:branches:network:uti....
Would be very grateful if you can try it out and let me know if it needs more work before I send an sr to the devel project.
Thanks, but I don't know how to download an rpm from there :-? I suppose it is: http://download.opensuse.org/repositories/home:/badshah400:/branches:/networ... I installed that one, and it works. I don't have a test suite to check it fully, but it seems to work. It supports some switches the old version did not have, like "-i" (which is why I noticed the version was old). cer@Telcontar:~> ipcalc -v ipcalc 1.0.0 cer@Telcontar:~> cer@Telcontar:~> ipcalc ipcalc: ip address expected Usage: ipcalc [OPTION...] -c, --check Validate IP address -r, --random-private=PREFIX Generate a random private IP network using the supplied prefix or mask. -S, --split=PREFIX Split the provided network using the provided prefix/netmask -d, --deagrregate=IP1-IP2 Deaggregate the provided address range -i, --info Print information on the provided IP address (default) --all-info Print verbose information on the provided IP address Specific info options: --reverse-dns Print network in a the reverse DNS format -a, --address Display IP address -b, --broadcast Display calculated broadcast address -m, --netmask Display netmask for IP -n, --network Display network address -p, --prefix Display network prefix --minaddr Display the minimum address in the network --maxaddr Display the maximum address in the network --addresses Display the maximum number of addresses in the network --addrspace Display the address space the network resides on -h, --hostname Show hostname determined via DNS -o, --lookup-host=STRING Show IP as determined via DNS -g, --geoinfo Show Geographic information about the provided IP Other options: -4, --ipv4 Explicitly specify the IPv4 address family -6, --ipv6 Explicitly specify the IPv6 address family --class-prefix When specified the default prefix will be determined by the IPv4 address class --no-decorate Print only the requested information -j, --json JSON output -s, --silent Don't ever display error messages -v, --version Display program version -?, --help Show this help message --usage Display brief usage message cer@Telcontar:~> I notice something that some people will not like, but this is for upstream: it prints text in colour, and colours that even for me are difficult to read (dark blue on black terminal). I don't see an option to supress color. I notice that the "--geoinfo" option does not produce output, but it would surprise me if it actually worked. Thanks :-) - -- Cheers, Carlos E. R. (from openSUSE 15.2 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCYGmezhwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVRKkAni0XzJSwPVMw2gr9IoEc gFeq82iEAJ4uQdWeE2QZgE8oW7hNc1O+dx41ZA== =7+YN -----END PGP SIGNATURE-----
Am Sonntag, 4. April 2021, 13:11:08 CEST schrieb Carlos E. R.:
Here's a first attempt at the update: <https://build.opensuse.org/package/show/home:badshah400:branches:network: utilities/ipcalc>.
Would be very grateful if you can try it out and let me know if it needs more work before I send an sr to the devel project.
Thanks, but I don't know how to download an rpm from there :-?
I suppose it is:
<http://download.opensuse.org/repositories/home:/badshah400:/branches:/netwo rk:/utilities/openSUSE_Leap_15.2/x86_64/ipcalc-1.0.0-lp152.17.1.x86_64.rpm>
yes....you could as well do a zypper ar -f http://download.opensuse.org/repositories/home:/badshah400:/ branches:/network:/utilities/openSUSE_Leap_15.2 ipcalctest and use zypper as usual.
I installed that one, and it works. I don't have a test suite to check it fully, but it seems to work.
The test suite is run during the build process, but as OBS does not allow networking to the outside (or downloads during build process) that part was disabled. @Atri - thanks for the build. Meson build looks much easier than C++ packaging! Axel
On 04/04/2021 13.19, Axel Braun wrote:
Am Sonntag, 4. April 2021, 13:11:08 CEST schrieb Carlos E. R.:
Here's a first attempt at the update: <https://build.opensuse.org/package/show/home:badshah400:branches:network: utilities/ipcalc>.
Would be very grateful if you can try it out and let me know if it needs more work before I send an sr to the devel project.
Thanks, but I don't know how to download an rpm from there :-?
I suppose it is:
<http://download.opensuse.org/repositories/home:/badshah400:/branches:/netwo rk:/utilities/openSUSE_Leap_15.2/x86_64/ipcalc-1.0.0-lp152.17.1.x86_64.rpm>
yes....you could as well do a zypper ar -f http://download.opensuse.org/repositories/home:/badshah400:/ branches:/network:/utilities/openSUSE_Leap_15.2 ipcalctest and use zypper as usual.
I did: "rpm --install http://download.opensuse.org/repositories/home:/badshah400:/branches:/networ..." I copied the URL from FF, because I went looking to find the repo equivalent to the build service link. And no repo added yet, I have too many.
I installed that one, and it works. I don't have a test suite to check it fully, but it seems to work.
The test suite is run during the build process, but as OBS does not allow networking to the outside (or downloads during build process) that part was disabled.
There is a test suite on the sources? Maybe I can run that locally. Where is it, a script perhaps?
@Atri - thanks for the build. Meson build looks much easier than C++ packaging!
-- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
Am Sonntag, 4. April 2021, 13:25:20 CEST schrieb Carlos E.R.:
There is a test suite on the sources? Maybe I can run that locally. Where is it, a script perhaps?
On 04/04/2021 13.40, Axel Braun wrote:
Am Sonntag, 4. April 2021, 13:25:20 CEST schrieb Carlos E.R.:
There is a test suite on the sources? Maybe I can run that locally. Where is it, a script perhaps?
Hum. How does one run that? Download it all to a directory, then run one of the scripts? I don't see a readme :-? On "https://gitlab.com/ipcalc/ipcalc/-/blob/master/README.md" it says: +++·················· Running unit tests After the application has been configured and built for the host platform (default), you may run the unit test suite against the ipcalc binary as follows: $ ninja -C build test ··················++- Doesn't look feasible. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 04/04/2021 13.47, Carlos E.R. wrote:
On 04/04/2021 13.40, Axel Braun wrote:
Am Sonntag, 4. April 2021, 13:25:20 CEST schrieb Carlos E.R.:
There is a test suite on the sources? Maybe I can run that locally. Where is it, a script perhaps?
Hum. How does one run that?
Download it all to a directory, then run one of the scripts? I don't see a readme :-?
Is there a command to download that directory? I would try to run the scripts and see what happens. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 2021-04-04 13:11, Carlos E. R. wrote:
I notice that the "--geoinfo" option does not produce output, but it would surprise me if it actually worked.
It's sort of useless if you want accuracy but if you just want to see if it's 80% "certain" which country it thinks it knows about you can use it. But you need the GeoLite2-City.mmdb and GeoLite2-Country.mmdb. It should be in /usr/share/GeoIP/ An strace without them gives: openat(AT_FDCWD, "/usr/share/GeoIP/GeoLite2-Country.mmdb", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/GeoIP/GeoLite2-City.mmdb", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) $ ipcalc -g 79.158.162.23 COUNTRYCODE=ES COUNTRY=Spain COORDINATES="40.417200,-3.684000" -- /bengan
On Sun, 2021-04-04 at 13:11 +0200, Carlos E. R. wrote:
On Saturday, 2021-04-03 at 23:54 +0200, Atri Bhattacharya wrote:
Here's a first attempt at the update: < https://build.opensuse.org/package/show/home:badshah400:branches:network:uti...
.
Would be very grateful if you can try it out and let me know if it needs more work before I send an sr to the devel project.
Thanks, but I don't know how to download an rpm from there :-?
I suppose it is:
< http://download.opensuse.org/repositories/home:/badshah400:/branches:/networ...
Hi, that page should show a "Download packages" link (near the right edge of the page) from where you can click on "Grab the binaries directly" and get it that way too. Indeed, that leads to the same link you have used, but gets you there with less guess-work.
I installed that one, and it works. I don't have a test suite to check it fully, but it seems to work. It supports some switches the old version did not have, like "-i" (which is why I noticed the version was old).
Great, thanks for the checks. I run most of the checks when building already, except for four tests which require access to the network (can't access the network from obs workers).
I notice that the "--geoinfo" option does not produce output, but it would surprise me if it actually worked.
This doesn't work because it relies on non-free GeoIP data, which you can nonetheless install on individual systems by following the procedure outlined here: https://build.opensuse.org/package/view_file/openSUSE:Factory/geoipupdate/RE... See also Bengt Gördén's message in this thread. Might be worthwhile to package the free GeoIP data from https://db-ip.com/ and then to patch ipcalc to use these, but that's probably for later. Cheers, -- Atri Bhattacharya Sun 4 Apr 14:39:37 CEST 2021 Sent from openSUSE Tumbleweed on my laptop.
On Sun, 2021-04-04 at 13:19 +0200, Axel Braun wrote:
@Atri - thanks for the build. Meson build looks much easier than C++ packaging!
Thanks for the feedback Axel; yes, with the rpm macros that are available for packagers meson based builds have become quite trivial these days. Purely as a build tool too, I find meson shines in its simplicity and readability. Cheers, -- Atri Bhattacharya Sun 4 Apr 14:53:17 CEST 2021 Sent from openSUSE Tumbleweed on my laptop.
On 04/04/2021 13.59, Bengt Gördén wrote:
On 2021-04-04 13:11, Carlos E. R. wrote:
I notice that the "--geoinfo" option does not produce output, but it would surprise me if it actually worked.
It's sort of useless if you want accuracy but if you just want to see if it's 80% "certain" which country it thinks it knows about you can use it. But you need the GeoLite2-City.mmdb and GeoLite2-Country.mmdb. It should be in /usr/share/GeoIP/
An strace without them gives: openat(AT_FDCWD, "/usr/share/GeoIP/GeoLite2-Country.mmdb", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/usr/share/GeoIP/GeoLite2-City.mmdb", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
Maybe it should print that those files are missing if the --geoinfo option is given. But that is something for upstream.
$ ipcalc -g 79.158.162.23 COUNTRYCODE=ES COUNTRY=Spain COORDINATES="40.417200,-3.684000"
Heh - the country is correct :-) -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On 04/04/2021 14.53, Atri Bhattacharya wrote:
On Sun, 2021-04-04 at 13:11 +0200, Carlos E. R. wrote:
On Saturday, 2021-04-03 at 23:54 +0200, Atri Bhattacharya wrote:
Here's a first attempt at the update: < https://build.opensuse.org/package/show/home:badshah400:branches:network:uti...
.
Would be very grateful if you can try it out and let me know if it needs more work before I send an sr to the devel project.
Thanks, but I don't know how to download an rpm from there :-?
I suppose it is:
< http://download.opensuse.org/repositories/home:/badshah400:/branches:/networ...
Hi, that page should show a "Download packages" link (near the right edge of the page) from where you can click on "Grab the binaries directly" and get it that way too. Indeed, that leads to the same link you have used, but gets you there with less guess-work.
Ahhem, now I see it. I told FF to search for "download" ;.) https://software.opensuse.org//download.html?project=home%3Abadshah400%3Abranches%3Anetwork%3Autilities&package=ipcalc
I installed that one, and it works. I don't have a test suite to check it fully, but it seems to work. It supports some switches the old version did not have, like "-i" (which is why I noticed the version was old).
Great, thanks for the checks. I run most of the checks when building already, except for four tests which require access to the network (can't access the network from obs workers).
I notice that the "--geoinfo" option does not produce output, but it would surprise me if it actually worked.
This doesn't work because it relies on non-free GeoIP data, which you can nonetheless install on individual systems by following the procedure outlined here: https://build.opensuse.org/package/view_file/openSUSE:Factory/geoipupdate/RE... See also Bengt Gördén's message in this thread.
Yes, I figured it would be something of the sort.
Might be worthwhile to package the free GeoIP data from https://db-ip.com/ and then to patch ipcalc to use these, but that's probably for later.
I heard it is problematic, reading from other discussions about geoip on the lists. I can't explain what the problem are, didn't pay enough attention to memorize it. -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
"AB" == Atri Bhattacharya
writes: AB> Might be worthwhile to package the free GeoIP data from AB> https://db-ip.com/ and then to patch ipcalc to use these, but that's AB> probably for later.
xtables-geoip already has the data albeit not up-to date , nevertheless maybe one can use the data from the package rather then creating another one.
Hi Togan, On Sun, 2021-04-04 at 20:23 +0200, Togan Muftuoglu wrote:
"AB" == Atri Bhattacharya
writes: AB> Might be worthwhile to package the free GeoIP data from AB> https://db-ip.com/ and then to patch ipcalc to use these, but that's AB> probably for later. xtables-geoip already has the data albeit not up-to date , nevertheless maybe one can use the data from the package rather then creating another one.
Many thanks for the pointer. I just had a look at that package and it does install the db-ip data. However, it installs only the country-lite data files in csv format, probably because that is how xtables needs it, whereas ipcalc would need the data in the mmdb (maxmind database) format and both the city-lite and country-lite sets. Cheers, -- Atri Bhattacharya Sun 4 Apr 20:41:22 CEST 2021 Sent from openSUSE Tumbleweed on my laptop.
Hi Atri
"AB" == Atri Bhattacharya
writes:
AB> Many thanks for the pointer. I just had a look at that package and it does AB> install the db-ip data. However, it installs only the country-lite data AB> files in csv format, probably because that is how xtables needs it, AB> whereas ipcalc would need the data in the mmdb (maxmind database) format AB> and both the city-lite and country-lite sets. Maxmind requires user to register hence it can't be packaged. https://dev.maxmind.com/geoip/geoip2/geolite2/ https://www.maxmind.com/en/geolite2/signup
On Sun, 2021-04-04 at 21:21 +0200, Togan Muftuoglu wrote:
Hi Atri
"AB" == Atri Bhattacharya
writes: AB> Many thanks for the pointer. I just had a look at that package and it does AB> install the db-ip data. However, it installs only the country-lite data AB> files in csv format, probably because that is how xtables needs it, AB> whereas ipcalc would need the data in the mmdb (maxmind database) format AB> and both the city-lite and country-lite sets.
Maxmind requires user to register hence it can't be packaged.
The same db-ip data is also available freely in mmdb format [1], which can be read by the still free libmaxminddb library that ipcalc links to. [1] https://db-ip.com/db/lite.php -- Atri Bhattacharya Sun 4 Apr 21:31:19 CEST 2021 Sent from openSUSE Tumbleweed on my laptop.
On Friday 2021-04-02 22:42, Carlos E. R. wrote:
cer(a)Telcontar:~> rpm -qi ipcalc Name : ipcalc Version : 0.41 URL : http://jodies.de/ipcalc
However, our version is obsolete, from 2005: Mageia 8 has version 1.0.0. The current repo is (apparently) https://gitlab.com/ipcalc/ipcalc, updated past year.
Absolutely not. The versions are all different if you look at Jodies's download directory vs. that git repository (0.zz vs x.y.z), and there is no trace of Jodies's code or authorship in that gitlab repo - instead, some Redhat guys have their name in there. It is not a successor by history or spirit, and if you or anyone else plans on packaging this, a new package name for the openSUSE SRPM needs to be chosen.
On 04/04/2021 22.58, Jan Engelhardt wrote:
On Friday 2021-04-02 22:42, Carlos E. R. wrote:
cer(a)Telcontar:~> rpm -qi ipcalc Name : ipcalc Version : 0.41 URL : http://jodies.de/ipcalc
However, our version is obsolete, from 2005: Mageia 8 has version 1.0.0. The current repo is (apparently) https://gitlab.com/ipcalc/ipcalc, updated past year.
Absolutely not.
The versions are all different if you look at Jodies's download directory vs. that git repository (0.zz vs x.y.z), and there is no trace of Jodies's code or authorship in that gitlab repo - instead, some Redhat guys have their name in there.
It is not a successor by history or spirit, and if you or anyone else plans on packaging this, a new package name for the openSUSE SRPM needs to be chosen.
Well, I don't know. All I know is that Mageia 7 had 0.2.0, and Mageia 8 has 1.0.0, and they are obtaining it from (quote): DVH> Correct. On Mageia 7 ... DVH> $ rpm -q -i ipcalc|grep ^URL DVH> URL : https://github.com/nmav/ipcalc DVH> On Mageia 8 ... DVH> $ rpm -q -i ipcalc|grep ^URL DVH> URL : https://gitlab.com/ipcalc/ipcalc On the other hand, our version has been abandoned on Jul 2006, looking at http://jodies.de/ipcalc-archive/, so somebody branched it or created a new one. Whatever :-) And then, there are other tools with the same name, as the package "netcalc" from network:utilities repo which contains: /usr/bin/ipcalc /usr/bin/netcalc There is also "subnetcalc" in the oss repo. It is not for me to decide which package you people prefer to package in the distro :-) -- Cheers / Saludos, Carlos E. R. (from 15.2 x86_64 at Telcontar)
On Sun, 2021-04-04 at 22:58 +0200, Jan Engelhardt wrote:
On Friday 2021-04-02 22:42, Carlos E. R. wrote:
cer(a)Telcontar:~> rpm -qi ipcalc Name : ipcalc Version : 0.41 URL : http://jodies.de/ipcalc
However, our version is obsolete, from 2005: Mageia 8 has version 1.0.0. The current repo is (apparently) https://gitlab.com/ipcalc/ipcalc, updated past year.
Absolutely not.
The versions are all different if you look at Jodies's download directory vs. that git repository (0.zz vs x.y.z), and there is no trace of Jodies's code or authorship in that gitlab repo - instead, some Redhat guys have their name in there.
It is not a successor by history or spirit, and if you or anyone else plans on packaging this, a new package name for the openSUSE SRPM needs to be chosen.
Jodies' seems to be unmaintained: last release was 15 years ago. The new ipcalc tool seems to be its successor whilst maintaining compatibility as far as possible. See discussion in https://gitlab.com/ipcalc/ipcalc/-/issues/18. The maintained fork of ipcalc seems to already have a new name: netcalc https://github.com/troglobit/netcalc. Indeed it also installs a symlink called ipcalc pointing to `/usr/bin/netcalc`. We could supersede the current version of ipcalc with the RH version of ipcalc (1.0.0) knowing that there is netcalc already provides the old ipcalc's functionality. Cheers, -- Atri Bhattacharya Sun 4 Apr 23:11:28 CEST 2021 Sent from openSUSE Tumbleweed on my laptop.
participants (8)
-
Atri Bhattacharya
-
Axel Braun
-
Bengt Gördén
-
Carlos E. R.
-
Carlos E.R.
-
Dave Howorth
-
Jan Engelhardt
-
Togan Muftuoglu