Merge 5a01d82b6fc6ff7379da67dcda23b2086345853c into 8329d4add71cc6a49fe76867df3e786b147bc194
44
calculations.js
Normal file
@ -0,0 +1,44 @@
|
||||
function inet_ntoa(mode, addrint) {
|
||||
var fn = "inet_ntoa_" + mode;
|
||||
return window[fn](addrint);
|
||||
}
|
||||
|
||||
function inet_aton(mode, addrint) {
|
||||
var fn = "inet_aton_" + mode;
|
||||
return window[fn](addrint);
|
||||
}
|
||||
|
||||
function network_address(mode, addrint) {
|
||||
var fn = "network_address_" + mode;
|
||||
return window[fn](addrint);
|
||||
}
|
||||
|
||||
function subnet_addresses(mode, addrint) {
|
||||
var fn = "subnet_addresses_" + mode;
|
||||
return window[fn](addrint);
|
||||
}
|
||||
|
||||
function subnet_first_address_useable(mode, addrint) {
|
||||
var fn = "subnet_first_address_useable_" + mode;
|
||||
return window[fn](addrint);
|
||||
}
|
||||
|
||||
function subnet_last_address_useable(mode, addrint) {
|
||||
var fn = "subnet_last_address_useable_" + mode;
|
||||
return window[fn](addrint);
|
||||
}
|
||||
|
||||
function subnet_last_address(mode, subnet, mask) {
|
||||
var fn = "subnet_last_address_" + mode;
|
||||
return window[fn](mode, subnet, mask);
|
||||
}
|
||||
|
||||
function subnet_netmask(mode, addrint) {
|
||||
var fn = "subnet_netmask_" + mode;
|
||||
return window[fn](addrint);
|
||||
}
|
||||
|
||||
function num_hosts(mode, useableFirst, useableLast) {
|
||||
var fn = "num_hosts_" + mode;
|
||||
return window[fn](useableFirst, useableLast);
|
||||
}
|
60
calculations_4.js
Normal file
@ -0,0 +1,60 @@
|
||||
function inet_ntoa_4(addrint) {
|
||||
return (
|
||||
((addrint >> 24) & 0xff) +
|
||||
"." +
|
||||
((addrint >> 16) & 0xff) +
|
||||
"." +
|
||||
((addrint >> 8) & 0xff) +
|
||||
"." +
|
||||
(addrint & 0xff)
|
||||
);
|
||||
};
|
||||
|
||||
function inet_aton_4(addrstr) {
|
||||
var re = /^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/;
|
||||
var res = re.exec(addrstr);
|
||||
|
||||
if (res === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (var i = 1; i <= 4; i++) {
|
||||
if (res[i] < 0 || res[i] > 255) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return (res[1] << 24) | (res[2] << 16) | (res[3] << 8) | res[4];
|
||||
}
|
||||
|
||||
function network_address_4(ip, mask) {
|
||||
var maskbits = 0;
|
||||
for (var i = 31 - mask; i >= 0; i--) {
|
||||
ip &= ~1 << i;
|
||||
}
|
||||
return ip;
|
||||
}
|
||||
|
||||
function subnet_addresses_4(mask) {
|
||||
return 1 << (32 - mask);
|
||||
}
|
||||
|
||||
function subnet_first_address_useable_4(addrint) {
|
||||
return addrint + 1;
|
||||
}
|
||||
|
||||
function subnet_last_address_useable_4(addrint) {
|
||||
return addrint - 1;
|
||||
}
|
||||
|
||||
function subnet_last_address_4(mode, subnet, mask) {
|
||||
return subnet + subnet_addresses(mode, mask) - 1;
|
||||
}
|
||||
|
||||
function subnet_netmask_4(mask) {
|
||||
return network_address(4, 0xffffffff, mask);
|
||||
}
|
||||
|
||||
function num_hosts_4(useableFirst, useableLast) {
|
||||
return 1 + useableLast - useableFirst;
|
||||
}
|
79
calculations_6.js
Normal file
@ -0,0 +1,79 @@
|
||||
function inet_ntoa_6(addrint) {
|
||||
return "" +
|
||||
((addrint >> 112n) & BigInt(0xffff)).toString(16) +
|
||||
":" +
|
||||
((addrint >> 96n) & BigInt(0xffff)).toString(16) +
|
||||
":" +
|
||||
((addrint >> 80n) & BigInt(0xffff)).toString(16) +
|
||||
":" +
|
||||
((addrint >> 64n) & BigInt(0xffff)).toString(16) +
|
||||
":" +
|
||||
((addrint >> 48n) & BigInt(0xffff)).toString(16) +
|
||||
":" +
|
||||
((addrint >> 32n) & BigInt(0xffff)).toString(16) +
|
||||
":" +
|
||||
((addrint >> 16n) & BigInt(0xffff)).toString(16) +
|
||||
":" +
|
||||
(addrint & BigInt(0xffff)).toString(16);
|
||||
}
|
||||
|
||||
function inet_aton_6(addrstr) {
|
||||
var re =
|
||||
/^([0-9a-f]{1,4})\:([0-9a-f]{1,4})\:([0-9a-f]{1,4})\:([0-9a-f]{1,4})\:([0-9a-f]{1,4})\:([0-9a-f]{1,4})\:([0-9a-f]{1,4})\:([0-9a-f]{1,4})$/;
|
||||
var res = re.exec(addrstr);
|
||||
|
||||
if (res === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (var i = 1; i <= 8; i++) {
|
||||
if (res[i] < 0 || res[i] > 0xffff) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var r1 = BigInt(parseInt(res[1], 16)) << 112n;
|
||||
var r2 = BigInt(parseInt(res[2], 16)) << 96n;
|
||||
var r3 = BigInt(parseInt(res[3], 16)) << 80n;
|
||||
var r4 = BigInt(parseInt(res[4], 16)) << 64n;
|
||||
var r5 = BigInt(parseInt(res[5], 16)) << 48n;
|
||||
var r6 = BigInt(parseInt(res[6], 16)) << 32n;
|
||||
var r7 = BigInt(parseInt(res[7], 16)) << 16n;
|
||||
var r8 = BigInt(parseInt(res[8], 16));
|
||||
|
||||
var rt = r1 | r2 | r3 | r4 | r5 | r6 | r7 | r8;
|
||||
|
||||
return rt;
|
||||
}
|
||||
|
||||
function network_address_6(ip, mask) {
|
||||
var maskbits = 0;
|
||||
for (var i = 128 - mask; i >= 0; i--) {
|
||||
ip &= ~1 << i;
|
||||
}
|
||||
return ip;
|
||||
}
|
||||
|
||||
function subnet_addresses_6(mask) {
|
||||
return 1n << (128n - BigInt(mask));
|
||||
}
|
||||
|
||||
function subnet_first_address_useable_6(addrint) {
|
||||
return addrint + 1n;
|
||||
}
|
||||
|
||||
function subnet_last_address_useable_6(addrint) {
|
||||
return addrint - 1n;
|
||||
}
|
||||
|
||||
function subnet_last_address_6(mode, subnet, mask) {
|
||||
return subnet + subnet_addresses(mode, mask) - 1n;
|
||||
}
|
||||
|
||||
function subnet_netmask_6(mask) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function num_hosts_6(useableFirst, useableLast) {
|
||||
return 1n + useableLast - useableFirst;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?
|
||||
for ($i=0;$i<=32; $i++) {
|
||||
<?php
|
||||
for ($i=0;$i<=128; $i++) {
|
||||
|
||||
$str = '/'.$i;
|
||||
$font = 2;
|
||||
@ -20,4 +20,4 @@ ImageGIF($im, 'tmp/'.$i.'.gif');
|
||||
|
||||
|
||||
//for i in tmp/*; do convert -rotate 90 $i img/`basename $i`; done
|
||||
}
|
||||
}
|
||||
|
BIN
img/0.gif
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 64 B |
BIN
img/1.gif
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 63 B |
BIN
img/10.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 72 B |
BIN
img/100.gif
Normal file
After Width: | Height: | Size: 80 B |
BIN
img/101.gif
Normal file
After Width: | Height: | Size: 80 B |
BIN
img/102.gif
Normal file
After Width: | Height: | Size: 83 B |
BIN
img/103.gif
Normal file
After Width: | Height: | Size: 81 B |
BIN
img/104.gif
Normal file
After Width: | Height: | Size: 80 B |
BIN
img/105.gif
Normal file
After Width: | Height: | Size: 83 B |
BIN
img/106.gif
Normal file
After Width: | Height: | Size: 82 B |
BIN
img/107.gif
Normal file
After Width: | Height: | Size: 81 B |
BIN
img/108.gif
Normal file
After Width: | Height: | Size: 84 B |
BIN
img/109.gif
Normal file
After Width: | Height: | Size: 81 B |
BIN
img/11.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 72 B |
BIN
img/110.gif
Normal file
After Width: | Height: | Size: 80 B |
BIN
img/111.gif
Normal file
After Width: | Height: | Size: 81 B |
BIN
img/112.gif
Normal file
After Width: | Height: | Size: 83 B |
BIN
img/113.gif
Normal file
After Width: | Height: | Size: 83 B |
BIN
img/114.gif
Normal file
After Width: | Height: | Size: 80 B |
BIN
img/115.gif
Normal file
After Width: | Height: | Size: 84 B |
BIN
img/116.gif
Normal file
After Width: | Height: | Size: 83 B |
BIN
img/117.gif
Normal file
After Width: | Height: | Size: 80 B |
BIN
img/118.gif
Normal file
After Width: | Height: | Size: 83 B |
BIN
img/119.gif
Normal file
After Width: | Height: | Size: 81 B |
BIN
img/12.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 74 B |
BIN
img/120.gif
Normal file
After Width: | Height: | Size: 84 B |
BIN
img/121.gif
Normal file
After Width: | Height: | Size: 84 B |
BIN
img/122.gif
Normal file
After Width: | Height: | Size: 85 B |
BIN
img/123.gif
Normal file
After Width: | Height: | Size: 84 B |
BIN
img/124.gif
Normal file
After Width: | Height: | Size: 84 B |
BIN
img/125.gif
Normal file
After Width: | Height: | Size: 84 B |
BIN
img/126.gif
Normal file
After Width: | Height: | Size: 85 B |
BIN
img/127.gif
Normal file
After Width: | Height: | Size: 83 B |
BIN
img/128.gif
Normal file
After Width: | Height: | Size: 85 B |
BIN
img/13.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 74 B |
BIN
img/14.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 73 B |
BIN
img/15.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 74 B |
BIN
img/16.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 74 B |
BIN
img/17.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 73 B |
BIN
img/18.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 75 B |
BIN
img/19.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 75 B |
BIN
img/2.gif
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 66 B |
BIN
img/20.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 75 B |
BIN
img/21.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 75 B |
BIN
img/22.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 76 B |
BIN
img/23.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 76 B |
BIN
img/24.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 75 B |
BIN
img/25.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 78 B |
BIN
img/26.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 76 B |
BIN
img/27.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 75 B |
BIN
img/28.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 77 B |
BIN
img/29.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 76 B |
BIN
img/3.gif
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 65 B |
BIN
img/30.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 74 B |
BIN
img/31.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 75 B |
BIN
img/32.gif
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 76 B |
BIN
img/33.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/34.gif
Normal file
After Width: | Height: | Size: 75 B |
BIN
img/35.gif
Normal file
After Width: | Height: | Size: 78 B |
BIN
img/36.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/37.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
img/38.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/39.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/4.gif
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 64 B |
BIN
img/40.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
img/41.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
img/42.gif
Normal file
After Width: | Height: | Size: 75 B |
BIN
img/43.gif
Normal file
After Width: | Height: | Size: 75 B |
BIN
img/44.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
img/45.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/46.gif
Normal file
After Width: | Height: | Size: 75 B |
BIN
img/47.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
img/48.gif
Normal file
After Width: | Height: | Size: 75 B |
BIN
img/49.gif
Normal file
After Width: | Height: | Size: 75 B |
BIN
img/5.gif
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 65 B |
BIN
img/50.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
img/51.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
img/52.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/53.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/54.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
img/55.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/56.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/57.gif
Normal file
After Width: | Height: | Size: 75 B |
BIN
img/58.gif
Normal file
After Width: | Height: | Size: 78 B |
BIN
img/59.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/6.gif
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 66 B |
BIN
img/60.gif
Normal file
After Width: | Height: | Size: 75 B |
BIN
img/61.gif
Normal file
After Width: | Height: | Size: 73 B |
BIN
img/62.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/63.gif
Normal file
After Width: | Height: | Size: 77 B |
BIN
img/64.gif
Normal file
After Width: | Height: | Size: 74 B |
BIN
img/65.gif
Normal file
After Width: | Height: | Size: 77 B |
BIN
img/66.gif
Normal file
After Width: | Height: | Size: 77 B |
BIN
img/67.gif
Normal file
After Width: | Height: | Size: 76 B |
BIN
img/68.gif
Normal file
After Width: | Height: | Size: 77 B |
BIN
img/69.gif
Normal file
After Width: | Height: | Size: 76 B |