Giter VIP home page Giter VIP logo

subnetcalc's Introduction

SubNetCalc

An IPv4/IPv6 Subnet Calculator

Description

SubNetCalc is an IPv4/IPv6 subnet address calculator. For given IPv4 or IPv6 address and netmask or prefix length, it calculates network address, broadcast address, maximum number of hosts and host address range. Also, it prints the addresses in binary format for better understandability. Furthermore, it prints useful information on specific address types (e.g. type, scope, interface ID, etc.).

See the manpage of subnetcalc for details!

Usage Examples

subnetcalc 172.31.255.254 255.255.255.0
subnetcalc 172.31.255.254 24
subnetcalc fec0:2345:6789:1111:221:6aff:fe0b:2674 56
subnetcalc www.iem.uni-due.de 24
subnetcalc fd00:: 64 -uniquelocal
subnetcalc fd00::9876:256:7bff:fe1b:3255 56 -uniquelocalhq

My host has IP 132.252.150.254 and netmask 255.255.255.240. What are the details of its network?

user@host:~$ subnetcalc 132.252.150.254 255.255.255.240
Address       = 132.252.150.254
                   10000100 . 11111100 . 10010110 . 11111110
Network       = 132.252.150.240 / 28
Netmask       = 255.255.255.240
Broadcast     = 132.252.150.255
Wildcard Mask = 0.0.0.15
Hosts Bits    = 4
Max. Hosts    = 14   (2^4 - 2)
Host Range    = { 132.252.150.241 - 132.252.150.254 }
Properties    =
   - 132.252.150.254 is a HOST address in 132.252.150.240/28
   - Class B
GeoIP Country = Germany (DE)
DNS Hostname  = dummy.iem.uni-duisburg-essen.de

Consider host www.six.heise.de uses a 64-bit prefix length. What are the details of its network?

user@host:~$ subnetcalc www.six.heise.de 64
Address       = 2a02:2e0:3fe:100::6
                   2a02 = 00101010 00000010
                   02e0 = 00000010 11100000
                   03fe = 00000011 11111110
                   0100 = 00000001 00000000
                   0000 = 00000000 00000000
                   0000 = 00000000 00000000
                   0000 = 00000000 00000000
                   0006 = 00000000 00000110
Network       = 2a02:2e0:3fe:100:: / 64
Netmask       = ffff:ffff:ffff:ffff::
Wildcard Mask = ::ffff:ffff:ffff:ffff
Hosts Bits    = 64
Max. Hosts    = 18446744073709551616   (2^64 - 1)
Host Range    = { 2a02:2e0:3fe:100::1 - 2a02:2e0:3fe:100:ffff:ffff:ffff:ffff }
Properties    =
   - 2a02:2e0:3fe:100::6 is a HOST address in 2a02:2e0:3fe:100::/64
   - Global Unicast Properties:
      + Interface ID = 0000:0000:0000:0006
      + Sol. Node MC = ff02::1:ff00:0006
GeoIP Country = Germany (DE)
DNS Hostname  = www.six.heise.de

My new host should use Interface ID 0x100 and Subnet ID 0x1234. Generate a Unique Local IPv6 prefix (40-bit Global ID) for my intranet, using high-quality random numbers!

user@host:~$ subnetcalc 0:0:0:1234::1 56 -uniquelocalhq
Address       = fded:30d0:1072:1234::1
                   fded = 11111101 11101101
                   30d0 = 00110000 11010000
                   1072 = 00010000 01110010
                   1234 = 00010010 00110100
                   0000 = 00000000 00000000
                   0000 = 00000000 00000000
                   0000 = 00000000 00000000
                   0001 = 00000000 00000001
Network       = fded:30d0:1072:1200:: / 56
Netmask       = ffff:ffff:ffff:ff00::
Wildcard Mask = ::ff:ffff:ffff:ffff:ffff
Hosts Bits    = 72
Max. Hosts    = 4722366482869645213696   (2^72 - 1)
Host Range    = { fded:30d0:1072:1200::1 - fded:30d0:1072:12ff:ffff:ffff:ffff:ffff }
Properties    =
   - fded:30d0:1072:1234::1 is a HOST address in fded:30d0:1072:1200::/56
   - Unique Local Unicast Properties:
      + Locally chose
      + Global ID    = ed30d01072
      + Subnet ID    = 1234
      + Interface ID = 0000:0000:0000:0001
      + Sol. Node MC = ff02::1:ff00:0001
GeoIP Country = Unknown (??)
DNS Hostname  = (Name or service not known)

Which are DNS reverse lookup name and geo location country of IP 2401:3800:c001::68?

user@host:~$ subnetcalc 2401:3800:c001::68
Address       = 2401:3800:c001::68
                   2401 = 00100100 00000001
                   3800 = 00111000 00000000
                   c001 = 11000000 00000001
                   0000 = 00000000 00000000
                   0000 = 00000000 00000000
                   0000 = 00000000 00000000
                   0000 = 00000000 00000000
                   0068 = 00000000 01101000
Network       = 2401:3800:c001::68 / 128
Netmask       = ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
Wildcard Mask = ::
Hosts Bits    = 0
Max. Hosts    = 0   (2^0 - 1)
Host Range    = { 2401:3800:c001::69 - 2401:3800:c001::68 }
Properties    =
   - 2401:3800:c001::68 is a NETWORK address
   - Global Unicast Properties:
      + Interface ID = 0000:0000:0000:0068
      + Sol. Node MC = ff02::1:ff00:0068
GeoIP Country = China (CN)
DNS Hostname  = bg-in-x68.1e100.net

Which are the MAC address and Solicited Node Multicast address of 2001:638:501:4ef8:223:aeff:fea4:8ca9/64?

user@host:~$ subnetcalc 2001:638:501:4ef8:223:aeff:fea4:8ca9/64
Address       = 2001:638:501:4ef8:223:aeff:fea4:8ca9
                   2001 = 00100000 00000001
                   0638 = 00000110 00111000
                   0501 = 00000101 00000001
                   4ef8 = 01001110 11111000
                   0223 = 00000010 00100011
                   aeff = 10101110 11111111
                   fea4 = 11111110 10100100
                   8ca9 = 10001100 10101001
Network       = 2001:638:501:4ef8:: / 64
Netmask       = ffff:ffff:ffff:ffff::
Wildcard Mask = ::ffff:ffff:ffff:ffff
Hosts Bits    = 64
Max. Hosts    = 18446744073709551616   (2^64 - 1)
Host Range    = { 2001:638:501:4ef8::1 - 2001:638:501:4ef8:ffff:ffff:ffff:ffff }
Properties    =
   - 2001:638:501:4ef8:223:aeff:fea4:8ca9 is a HOST address in 2001:638:501:4ef8::/64
   - Global Unicast Properties:
      + Interface ID = 0223:aeff:fea4:8ca9
      + MAC address  = 00:23:ae:a4:8c:a9
      + Sol. Node MC = ff02::1:ffa4:8ca9
GeoIP Country = Germany (DE)
DNS Hostname  = (Name or service not known)

Binary Package Installation

Please use the issue tracker at https://github.com/dreibh/subnetcalc/issues to report bugs and issues!

Ubuntu Linux

For ready-to-install Ubuntu Linux packages of SubNetCalc, see Launchpad PPA for Thomas Dreibholz!

sudo apt-add-repository -sy ppa:dreibh/ppa
sudo apt-get update
sudo apt-get install subnetcalc

Fedora Linux

For ready-to-install Fedora Linux packages of SubNetCalc, see COPR PPA for Thomas Dreibholz!

sudo dnf copr enable -y dreibh/ppa
sudo dnf install subnetcalc

FreeBSD

For ready-to-install FreeBSD packages of SubNetCalc, it is included in the ports collection, see Index of /head/net/subnetcalc/!

pkg install subnetcalc

Alternatively, to compile it from the ports sources:

cd /usr/ports/net/subnetcalc
make
make install

Sources Download

SubNetCalc is released under the GNU General Public Licence (GPL).

Please use the issue tracker at https://github.com/dreibh/subnetcalc/issues to report bugs and issues!

Development Version

The Git repository of the SubNetCalc sources can be found at https://github.com/dreibh/subnetcalc:

Current Stable Release

See https://www.nntb.no/~dreibh/subnetcalc/#Download!

subnetcalc's People

Contributors

dreibh avatar dunn avatar silkeh avatar technologyclassroom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

subnetcalc's Issues

About artifact location

๐Ÿ‘‹ it looks like the old website is not accessible anymore (https://www.uni-due.de/~be0001/subnetcalc -> https://www.uni-due.org/~be0001/subnetcalc/), where is the de facto artifact location moving forward? Thanks!

error log
$ curl -I https://www.uni-due.de/~be0001/subnetcalc/download/subnetcalc-2.4.20.tar.xz
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Sun, 22 Jan 2023 17:10:19 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://www.uni-due.org/~be0001/subnetcalc/download/subnetcalc-2.4.20.tar.xz
$ curl -I https://www.uni-due.org/~be0001/subnetcalc/download/subnetcalc-2.4.20.tar.xz
HTTP/1.1 404 Not Found
Server: nginx
Date: Sun, 22 Jan 2023 17:10:25 GMT
Content-Type: text/html
Content-Length: 548
Connection: keep-alive

Feature request - Show IPV6 in expanded mode

First of all, thanks for creating and continuing to support this useful program.

If possible, would be very useful if the program show expanded IPV6, in one line.
To read and collect the information using one string.

Thanks a lot.

IPV6 range -1

First of all, thanks for creating and continuing to support this useful program.

The IPV6 range starts on number one:
Max. Hosts = 2^96 - 1
Host Range = { 2001:cafe::1 - 2001:cafe:ffff:ffff:ffff:ffff:ffff:ffff }
Like the first IPV6 address is already in use, would be very useful if it shows with the first one available, to read, check and compare IPV6 data, like range, gatetway, etc.

Thanks a lot.

Calculate IP Prefix from Range

First, thank you so much for making this utility, it is awesome for what it does.

I would love to see the ability to calculate prefixes based on an IP range. I have used ipcalc (http://jodies.de/ipcalc) before finding this, and I found its range calculator extremely useful for finding out the prefix to an IP address range I found in whois.

Examples:

$ ipcalc 192.168.160.0 - 192.168.175.255
deaggregate 192.168.160.0 - 192.168.175.255
192.168.160.0/20
$ ipcalc 192.168.160.0 - 192.168.173.255
deaggregate 192.168.160.0 - 192.168.173.255
192.168.160.0/21
192.168.168.0/22
192.168.172.0/23

Does subnetcalc support GeoIP 2?

On FreeBSD, subnetcalc depends on GeoIP which has been marked deprecated. This begs me the question if we can simply change the depend of the port to GeoIP 2?

Message from GeoIP-1.6.12_3:
This port is deprecated; you may wish to reconsider installing it:
Legacy databases no longer available. Switch to GeoIP2 instead.
It is scheduled to be removed on or after 2019-02-01.

tar.gz files differs on homepage and on GH

Downloaded source packages from homepage (subnetcalc-2.4.9.tar.gz) and from github (subnetcalc-subnetcalc-2.4.9.tar.gz) differs in content (and then in size of course), see:

-rw-r--r-- 1 user group  69257 Jun  9 07:31 subnetcalc-2.4.9.tar.gz
-rw-r--r-- 1 user group  77616 Jun  9 07:25 subnetcalc-subnetcalc-2.4.9.tar.gz

Which one is the right to build it?

And no one has the configure script, as described in INSTALL.

IPv6 calulation Host Range for /127 and /128 seem wrong

subnetcalc 2001:db8::1/127
Network = 2001:db8:: / 127
Netmask = ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe
Wildcard Mask = ::1
Hosts Bits = 1
Max. Hosts = 1 (2^1 - 1)
Host Range = { 2001:db8::1 - 2001:db8::1 }
Properties = - 2001:db8::1 is a HOST address in 2001:db8::/127

subnetcalc 2001:db8::1/128
Network = 2001:db8::1 / 128
Netmask = ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
Wildcard Mask = ::
Hosts Bits = 0
Max. Hosts = 0 (2^0 - 1)
Host Range = { 2001:db8::2 - 2001:db8::1 }
Properties = - 2001:db8::1 is a NETWORK address

Seems the host range for the /128 loopback is wrong ( :2 > :1)
Using /128 for loopback and /127 for router <--> router is a valid usage

Compilation failure with GeoIP-1.6.4 and 1.6.5

Hi!
It seems, there is no more GeoIP_new in latest GeoIP releases, because when I trying to configure subnetcalc to build with GeoIP, I see following:

./configure --with-geoip
<...>
checking whether to use the GeoIP IP address mapping library if available... yes
checking for GeoIP_new in -lGeoIP... no

While

$ readelf -a /usr/lib64/libGeoIP.so.1.6.5 | grep GeoIP
 0x000000000000000e (SONAME)             Library soname: [libGeoIP.so.1]
000000234f98  008000000006 R_X86_64_GLOB_DAT 0000000000235960 GeoIP_utf8_country_nam + 0
000000234fa0  004d00000006 R_X86_64_GLOB_DAT 0000000000236178 GeoIP_custom_directory + 0
000000234fa8  008d00000006 R_X86_64_GLOB_DAT 0000000000236170 GeoIPDBFileName + 0
000000234fb0  009800000006 R_X86_64_GLOB_DAT 0000000000235020 GeoIPDBDescription + 0
000000234fb8  002700000006 R_X86_64_GLOB_DAT 0000000000023480 GeoIP_country_code3 + 0
000000234fc8  00b300000006 R_X86_64_GLOB_DAT 0000000000023180 GeoIP_country_continen + 0
000000234fd8  002900000006 R_X86_64_GLOB_DAT 0000000000235160 GeoIP_country_name + 0
000000234ff0  002a00000006 R_X86_64_GLOB_DAT 0000000000023880 GeoIP_country_code + 0
000000234cc8  008100000007 R_X86_64_JUMP_SLO 0000000000008470 _GeoIP_setup_dbfilenam + 0
000000234cd0  00b800000007 R_X86_64_JUMP_SLO 000000000000aa30 GeoIP_name_by_name_v6_ + 0
000000234cd8  007800000007 R_X86_64_JUMP_SLO 000000000000b9b0 GeoIP_country_name_by_ + 0
000000234ce8  009700000007 R_X86_64_JUMP_SLO 00000000000096d0 _GeoIP_lookupaddress_v + 0
000000234cf8  003600000007 R_X86_64_JUMP_SLO 000000000000aca0 GeoIP_country_code_by_ + 0
000000234d00  009600000007 R_X86_64_JUMP_SLO 000000000000b100 GeoIP_region_by_name_g + 0
000000234d08  005c00000007 R_X86_64_JUMP_SLO 000000000000bb50 GeoIP_country_name_by_ + 0
000000234d10  008800000007 R_X86_64_JUMP_SLO 000000000000b600 GeoIP_region_by_ipnum_ + 0
000000234d18  007900000007 R_X86_64_JUMP_SLO 000000000000a1e0 _GeoIP_seek_record_v6_ + 0
000000234d20  004a00000007 R_X86_64_JUMP_SLO 000000000000a4a0 GeoIP_id_by_name_v6_gl + 0
000000234d30  007f00000007 R_X86_64_JUMP_SLO 000000000000a9b0 GeoIP_name_by_addr_v6_ + 0
000000234d38  00c000000007 R_X86_64_JUMP_SLO 0000000000009d80 GeoIP_range_by_ip_gl + 0
000000234d50  003a00000007 R_X86_64_JUMP_SLO 000000000000a190 GeoIP_teredo + 0
000000234d60  007500000007 R_X86_64_JUMP_SLO 000000000000abc0 GeoIP_country_code_by_ + 0
000000234d78  004b00000007 R_X86_64_JUMP_SLO 000000000000b450 GeoIP_region_by_addr_v + 0
000000234d80  006400000007 R_X86_64_JUMP_SLO 000000000000ac30 GeoIP_country_code_by_ + 0
000000234d88  005f00000007 R_X86_64_JUMP_SLO 000000000000ad10 GeoIP_country_code_by_ + 0
000000234da0  007400000007 R_X86_64_JUMP_SLO 000000000000bc10 GeoIP_country_name_by_ + 0
000000234da8  008c00000007 R_X86_64_JUMP_SLO 0000000000008a50 _GeoIP_seek_record_gl + 0
000000234db0  004f00000007 R_X86_64_JUMP_SLO 000000000000ab60 GeoIP_code_by_id + 0
000000234db8  00ab00000007 R_X86_64_JUMP_SLO 000000000000b940 GeoIP_country_code3_by + 0
000000234dc0  007000000007 R_X86_64_JUMP_SLO 00000000000098b0 GeoIP_id_by_addr_gl + 0
000000234dc8  00b500000007 R_X86_64_JUMP_SLO 000000000000bbb0 GeoIP_country_name_by_ + 0
000000234dd0  005000000007 R_X86_64_JUMP_SLO 000000000000a070 GeoIP_name_by_name_gl + 0
000000234dd8  004800000007 R_X86_64_JUMP_SLO 00000000000088a0 GeoIP_is_private_ipnum + 0
000000234de0  00ae00000007 R_X86_64_JUMP_SLO 000000000000b6b0 GeoIP_code3_by_id + 0
000000234de8  007600000007 R_X86_64_JUMP_SLO 00000000000095a0 _GeoIP_lookupaddress + 0
000000234df8  005800000007 R_X86_64_JUMP_SLO 000000000000adf0 GeoIP_country_code_by_ + 0
000000234e00  005100000007 R_X86_64_JUMP_SLO 00000000000089e0 _GeoIP_addr_to_num_v6 + 0
000000234e08  008900000007 R_X86_64_JUMP_SLO 000000000000b520 GeoIP_region_by_name_v + 0
000000234e10  00bf00000007 R_X86_64_JUMP_SLO 000000000000a970 GeoIP_name_by_ipnum_v6 + 0
000000234e30  006300000007 R_X86_64_JUMP_SLO 000000000000ba90 GeoIP_country_name_by_ + 0
000000234e38  005700000007 R_X86_64_JUMP_SLO 000000000000a6f0 GeoIP_id_by_ipnum_v6_g + 0
000000234e48  007100000007 R_X86_64_JUMP_SLO 0000000000009780 GeoIP_id_by_name_gl + 0
000000234e50  003000000007 R_X86_64_JUMP_SLO 000000000000b860 GeoIP_country_code3_by + 0
000000234e60  00a400000007 R_X86_64_JUMP_SLO 00000000000099d0 GeoIP_id_by_ipnum_gl + 0
000000234e78  008300000007 R_X86_64_JUMP_SLO 000000000000ae60 GeoIP_assign_region_by + 0
000000234e80  009200000007 R_X86_64_JUMP_SLO 000000000000b8d0 GeoIP_country_code3_by + 0
000000234e90  00a300000007 R_X86_64_JUMP_SLO 000000000000b1e0 GeoIP_region_by_ipnum_ + 0
000000234e98  00b000000007 R_X86_64_JUMP_SLO 000000000000a5e0 GeoIP_id_by_addr_v6_gl + 0
000000234ea0  003100000007 R_X86_64_JUMP_SLO 000000000000b780 GeoIP_country_code3_by + 0
000000234eb0  004000000007 R_X86_64_JUMP_SLO 0000000000009fa0 GeoIP_name_by_ipnum_gl + 0
000000234ec0  008500000007 R_X86_64_JUMP_SLO 000000000000b290 GeoIP_assign_region_by + 0
000000234ed0  005200000007 R_X86_64_JUMP_SLO 000000000000b710 GeoIP_country_code3_by + 0
000000234ed8  003300000007 R_X86_64_JUMP_SLO 0000000000008ec0 GeoIP_addr_to_num + 0
000000234ee8  003d00000007 R_X86_64_JUMP_SLO 0000000000008380 _GeoIP_full_path_to + 0
000000234ef0  006900000007 R_X86_64_JUMP_SLO 000000000000ad80 GeoIP_country_code_by_ + 0
000000234ef8  002800000007 R_X86_64_JUMP_SLO 000000000000ba30 GeoIP_country_name_by_ + 0
000000234f00  004e00000007 R_X86_64_JUMP_SLO 0000000000009fe0 GeoIP_name_by_addr_gl + 0
000000234f08  004700000007 R_X86_64_JUMP_SLO 0000000000009c90 GeoIP_num_to_addr + 0
000000234f20  00b600000007 R_X86_64_JUMP_SLO 000000000000b7f0 GeoIP_country_code3_by + 0
000000234f30  003800000007 R_X86_64_JUMP_SLO 000000000000c110 _GeoIP_seek_record_v6 + 0
000000234f38  008a00000007 R_X86_64_JUMP_SLO 000000000000baf0 GeoIP_country_name_by_ + 0
000000234f40  009400000007 R_X86_64_JUMP_SLO 000000000000b020 GeoIP_region_by_addr_g + 0
000000234f60  00af00000007 R_X86_64_JUMP_SLO 000000000000c160 _GeoIP_seek_record + 0
000000234f68  005500000007 R_X86_64_JUMP_SLO 00000000000087d0 _GeoIP_iso_8859_1__utf + 0
000000234f70  007300000007 R_X86_64_JUMP_SLO 0000000000008fd0 GeoIP_open + 0
000000234f80  00a000000007 R_X86_64_JUMP_SLO 00000000000093f0 GeoIP_delete + 0
    38: 000000000000a100    64 FUNC    GLOBAL DEFAULT   12 GeoIP_database_edition
    39: 0000000000023480  1024 OBJECT  GLOBAL DEFAULT   14 GeoIP_country_code3
    40: 000000000000ba30    83 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_nam
    41: 0000000000235160  2048 OBJECT  GLOBAL DEFAULT   22 GeoIP_country_name
    42: 0000000000023880   768 OBJECT  GLOBAL DEFAULT   14 GeoIP_country_code
    43: 0000000000008330    70 FUNC    GLOBAL DEFAULT   12 GeoIP_setup_custom_direct
    45: 000000000000c5c0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_add
    46: 000000000000c200    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_nam
    47: 000000000000ca70    69 FUNC    GLOBAL DEFAULT   12 GeoIP_assign_region_by_in
    48: 000000000000b860   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_ad
    49: 000000000000b780   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_na
    51: 0000000000008ec0   179 FUNC    GLOBAL DEFAULT   12 GeoIP_addr_to_num
    52: 000000000000ab10    66 FUNC    GLOBAL DEFAULT   12 GeoIP_set_charset
    53: 000000000000cac0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_assign_region_by_in
    54: 000000000000aca0   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_add
    55: 000000000000c7f0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_id_by_addr_
    56: 000000000000c110    69 FUNC    GLOBAL DEFAULT   12 _GeoIP_seek_record_v6
    58: 000000000000a190    66 FUNC    GLOBAL DEFAULT   12 GeoIP_teredo
    59: 000000000000bdc0    64 FUNC    GLOBAL DEFAULT   12 GeoIP_num_countries
    60: 000000000000c890    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_id_by_name_
    61: 0000000000008380   237 FUNC    GLOBAL DEFAULT   12 _GeoIP_full_path_to
    62: 000000000000d660   105 FUNC    GLOBAL DEFAULT   12 GeoIP_record_by_name
    63: 000000000000bef0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_org_by_ipnum
    64: 0000000000009fa0    64 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_ipnum_gl
    65: 000000000000c7a0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_ip
    66: 000000000000c980    69 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_addr
    67: 000000000000cb60    69 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_addr_v6
    68: 000000000000ce80    69 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_name
    69: 000000000000cc00    69 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_name_v6
    71: 0000000000009c90   229 FUNC    GLOBAL DEFAULT   12 GeoIP_num_to_addr
    72: 00000000000088a0   172 FUNC    GLOBAL DEFAULT   12 GeoIP_is_private_ipnum_v4
    74: 000000000000a4a0   250 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_name_v6_gl
    75: 000000000000b450   197 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_addr_v6_g
    76: 000000000000c340    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_nam
    77: 0000000000236178     8 OBJECT  GLOBAL DEFAULT   23 GeoIP_custom_directory
    78: 0000000000009fe0   135 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_addr_gl
    79: 000000000000ab60    89 FUNC    GLOBAL DEFAULT   12 GeoIP_code_by_id
    80: 000000000000a070   143 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_name_gl
    81: 00000000000089e0   111 FUNC    GLOBAL DEFAULT   12 _GeoIP_addr_to_num_v6
    82: 000000000000b710   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_na
    83: 000000000000cca0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_ipnum_v6
    84: 000000000000c9d0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_ipnum_v6
    85: 00000000000087d0   198 FUNC    GLOBAL DEFAULT   12 _GeoIP_iso_8859_1__utf8
    87: 000000000000a6f0   165 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_ipnum_v6_gl
    88: 000000000000adf0   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_ipn
    89: 000000000000d890    69 FUNC    GLOBAL DEFAULT   12 GeoIP_init_record_iter
    90: 0000000000009a90   444 FUNC    GLOBAL DEFAULT   12 GeoIP_database_info
    91: 000000000000a140    80 FUNC    GLOBAL DEFAULT   12 GeoIP_enable_teredo
    92: 000000000000bb50    83 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_add
    93: 000000000000d960   103 FUNC    GLOBAL DEFAULT   12 GeoIPRecord_delete
    94: 000000000000aad0    63 FUNC    GLOBAL DEFAULT   12 GeoIP_charset
    95: 000000000000ad10   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_add
    97: 000000000000d740   175 FUNC    GLOBAL DEFAULT   12 GeoIP_record_id_by_addr
    98: 000000000000ca20    69 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_ipnum
    99: 000000000000ba90    83 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_nam
   100: 000000000000ac30   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_nam
   101: 000000000000bf90    69 FUNC    GLOBAL DEFAULT   12 GeoIP_org_by_addr
   102: 000000000000d530    69 FUNC    GLOBAL DEFAULT   12 GeoIP_record_by_ipnum_v6
   103: 000000000000be50   145 FUNC    GLOBAL DEFAULT   12 GeoIP_cleanup
   104: 000000000000c660    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_ipn
   105: 000000000000ad80   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_ipn
   106: 000000000000c520    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_ad
   107: 0000000000009c50    64 FUNC    GLOBAL DEFAULT   12 GeoIPRegion_delete
   108: 000000000000c390    69 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_name
   109: 000000000000bd30   137 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_code
   110: 0000000000008950   138 FUNC    GLOBAL DEFAULT   12 GeoIP_db_avail
   111: 000000000000be00    67 FUNC    GLOBAL DEFAULT   12 GeoIP_lib_version
   112: 00000000000098b0   217 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_addr_gl
   113: 0000000000009780   225 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_name_gl
   114: 0000000000009390    93 FUNC    GLOBAL DEFAULT   12 GeoIP_new
   115: 0000000000008fd0   949 FUNC    GLOBAL DEFAULT   12 GeoIP_open
   116: 000000000000bc10    83 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_ipn
   117: 000000000000abc0   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_nam
   118: 00000000000095a0   292 FUNC    GLOBAL DEFAULT   12 _GeoIP_lookupaddress
   119: 000000000000cb10    69 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_addr
   120: 000000000000b9b0   113 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_id
   121: 000000000000a1e0   702 FUNC    GLOBAL DEFAULT   12 _GeoIP_seek_record_v6_gl
   122: 0000000000008f80    72 FUNC    GLOBAL DEFAULT   12 GeoIP_is_private_v4
   123: 000000000000c700    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_ipn
   124: 000000000000c4d0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_ad
   125: 000000000001df90 16186 FUNC    GLOBAL DEFAULT   12 GeoIP_time_zone_by_countr
   126: 000000000000c250    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_na
   127: 000000000000a9b0   113 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_addr_v6_gl
   128: 0000000000235960  2048 OBJECT  GLOBAL DEFAULT   22 GeoIP_utf8_country_name
   129: 0000000000008470   863 FUNC    GLOBAL DEFAULT   12 _GeoIP_setup_dbfilename
   130: 000000000000c840    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_id_by_addr
   131: 000000000000ae60   308 FUNC    GLOBAL DEFAULT   12 GeoIP_assign_region_by_in
   132: 000000000000d9d0 66996 FUNC    GLOBAL DEFAULT   12 GeoIP_region_name_by_code
   133: 000000000000b290   300 FUNC    GLOBAL DEFAULT   12 GeoIP_assign_region_by_in
   134: 000000000000a6b0    64 FUNC    GLOBAL DEFAULT   12 GeoIP_country_id_by_addr_
   135: 000000000000c030    69 FUNC    GLOBAL DEFAULT   12 GeoIP_org_by_name
   136: 000000000000b600   166 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_ipnum_v6_
   137: 000000000000b520   223 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_name_v6_g
   138: 000000000000baf0    83 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_add
   139: 0000000000009990    64 FUNC    GLOBAL DEFAULT   12 GeoIP_country_id_by_addr_
   140: 0000000000008a50   633 FUNC    GLOBAL DEFAULT   12 _GeoIP_seek_record_gl
   141: 0000000000236170     8 OBJECT  GLOBAL DEFAULT   23 GeoIPDBFileName
   142: 000000000000d4e0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_record_by_ipnum
   143: 000000000000c2a0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_na
   144: 0000000000009870    64 FUNC    GLOBAL DEFAULT   12 GeoIP_country_id_by_name_
   145: 000000000000cd90    69 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_ipnum_v6
   146: 000000000000b8d0   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_ip
   147: 000000000000cc50    69 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_ipnum
   148: 000000000000b020   213 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_addr_gl
   149: 000000000000d8e0   113 FUNC    GLOBAL DEFAULT   12 GeoIP_next_record
   150: 000000000000b100   221 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_name_gl
   151: 00000000000096d0   170 FUNC    GLOBAL DEFAULT   12 _GeoIP_lookupaddress_v6
   152: 0000000000235020   312 OBJECT  GLOBAL DEFAULT   22 GeoIPDBDescription
   153: 000000000000cbb0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_name
   154: 000000000000bc70    89 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_id
   155: 000000000000ce30    69 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_addr_v6
   156: 000000000000c750    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_ip
   157: 000000000000ced0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_name_v6
   158: 000000000000bfe0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_org_by_addr_v6
   159: 000000000000c480    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_add
   160: 00000000000093f0   219 FUNC    GLOBAL DEFAULT   12 GeoIP_delete
   161: 000000000000c080    69 FUNC    GLOBAL DEFAULT   12 GeoIP_org_by_name_v6
   162: 000000000000c0d0    63 FUNC    GLOBAL DEFAULT   12 GeoIP_last_netmask
   163: 000000000000b1e0   166 FUNC    GLOBAL DEFAULT   12 GeoIP_region_by_ipnum_gl
   164: 00000000000099d0   181 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_ipnum_gl
   165: 000000000000cd40    69 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_ipnum
   166: 000000000000d5f0   105 FUNC    GLOBAL DEFAULT   12 GeoIP_record_by_addr_v6
   167: 000000000000c8e0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_id_by_name
   168: 000000000000c570    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_add
   169: 000000000000d6d0   105 FUNC    GLOBAL DEFAULT   12 GeoIP_record_by_name_v6
   170: 000000000000c430    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_add
   171: 000000000000b940   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_ip
   172: 000000000000c2f0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_nam
   173: 000000000000c1b0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_nam
   174: 000000000000b6b0    89 FUNC    GLOBAL DEFAULT   12 GeoIP_code3_by_id
   175: 000000000000c160    69 FUNC    GLOBAL DEFAULT   12 _GeoIP_seek_record
   176: 000000000000a5e0   201 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_addr_v6_gl
   177: 000000000000d7f0   155 FUNC    GLOBAL DEFAULT   12 GeoIP_record_id_by_addr_v
   178: 000000000000c6b0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code_by_ipn
   179: 0000000000023180   768 OBJECT  GLOBAL DEFAULT   14 GeoIP_country_continent
   180: 000000000000bcd0    89 FUNC    GLOBAL DEFAULT   12 GeoIP_continent_by_id
   181: 000000000000bbb0    83 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_ipn
   182: 000000000000b7f0   104 FUNC    GLOBAL DEFAULT   12 GeoIP_country_code3_by_ad
   183: 000000000000d580   105 FUNC    GLOBAL DEFAULT   12 GeoIP_record_by_addr
   184: 000000000000aa30   145 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_name_v6_gl
   185: 0000000000009f10   139 FUNC    GLOBAL DEFAULT   12 GeoIP_range_by_ip_delete
   186: 00000000000094d0   197 FUNC    GLOBAL DEFAULT   12 GeoIP_open_type
   187: 000000000000c930    69 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_addr_v6
   188: 000000000000cde0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_addr
   189: 000000000000bf40    69 FUNC    GLOBAL DEFAULT   12 GeoIP_org_by_ipnum_v6
   190: 000000000000ccf0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_range_by_ip
   191: 000000000000a970    64 FUNC    GLOBAL DEFAULT   12 GeoIP_name_by_ipnum_v6_gl
   192: 0000000000009d80   400 FUNC    GLOBAL DEFAULT   12 GeoIP_range_by_ip_gl
   193: 000000000000c3e0    69 FUNC    GLOBAL DEFAULT   12 GeoIP_id_by_name_v6
   194: 000000000000c610    69 FUNC    GLOBAL DEFAULT   12 GeoIP_country_name_by_ipn
   195: 000000000000a5a0    64 FUNC    GLOBAL DEFAULT   12 GeoIP_country_id_by_name_

show version

Thanks for creating and continuing to support this useful program!

Would it be possible to somehow print the version when either running the program with no args, or a -v or something, just to help check if one has the latest installed.

Thanks!

2.5.0 build failure

๐Ÿ‘‹ trying to build the latest release, but run into some build issue. The error log is as below:

error build log
  /tmp/subnetcalc-20240210-3255-d4xokh/subnetcalc-subnetcalc-2.5.0/src/tools.cc:132:36: error: no member named 's6_addr16' in 'in6_addr'
     return ntohs(address->sin6_addr.s6_addr16[0]) == 0x64 &&
                  ~~~~~~~~~~~~~~~~~~ ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/sys/_endian.h:132:46: note: expanded from macro 'ntohs'
  #define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                               ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/libkern/_OSByteOrder.h:85:40: note: expanded from macro '__DARWIN_OSSwapInt16'
      ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                         ^
  /tmp/subnetcalc-20240210-3255-d4xokh/subnetcalc-subnetcalc-2.5.0/src/tools.cc:132:36: error: no member named 's6_addr16' in 'in6_addr'
     return ntohs(address->sin6_addr.s6_addr16[0]) == 0x64 &&
                  ~~~~~~~~~~~~~~~~~~ ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/sys/_endian.h:132:46: note: expanded from macro 'ntohs'
  #define ntohs(x)        __DARWIN_OSSwapInt16(x)
                                               ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/libkern/_OSByteOrder.h:85:71: note: expanded from macro '__DARWIN_OSSwapInt16'
      ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))
                                                                        ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/libkern/_OSByteOrder.h:44:34: note: expanded from macro '__DARWIN_OSSwapConstInt16'
      ((__uint16_t)((((__uint16_t)(x) & 0xff00U) >> 8) | \
                                   ^

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/7855958025/job/21438280388?pr=162285
relates to Homebrew/homebrew-core#162285

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.