5 function h_countbitsfromleft(num) {
12 if (num == (bitpat & 0xff)){
21 function numberOfBitsOnNetMask(netmask) {
23 var t = netmask.split('.');
24 for (var i = 0; i<= 3 ; i++) {
25 total += h_countbitsfromleft(t[i]);
30 function getNetworkAddress(ipaddress, netmask) {
31 return fixIP(ntoa(aton(ipaddress) & aton(netmask)));
34 function getBroadcastAddress(network, netmask) {
35 return fixIP(ntoa(aton(network) ^ (~ aton(netmask))));
38 function getAddress(ipaddress, network) {
39 return fixIP(ntoa( (aton(network)) + (aton(ipaddress)) ));