Git Product home page Git Product logo

ipsubnet's Introduction

ip subnet calculator

IPsubnet calculator IPv4 IPv6 in HTML 5 and css originally created im 2006 in HTML4 . multi-language

IPsubnet_overview1 IPsubnet_open_close_section IPsubnet_how_import IPsubnet_show_info IPsubnet_select_history

ipsubnet's People

Contributors

jmpep avatar

Stargazers

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

Watchers

 avatar  avatar

ipsubnet's Issues

Missing IPv4/6 range input

I have these ranges:
2600:380:F510::1 - 2600:380:F51F:FFFF:FFFF:FFFF:FFFF:FFFE
32.0.0.0 - 32.255.255.255

And I want to be able to insert them and get the right CIDR for them.

Not install on Cacti 1.0.0

Cacti plugin manager write that:
Not Compatible
I Change setup.php and add file INFO.
After this I install plugin, but have html and jquery error.
Help fix and prepare the plug-in to the new version Cacti.
I have make some change. Now plugin install and work? but i think that I have some mistake. Please repear me.
ipsubnet.zip

Missing IPv4 inside an IPv6 bytes to IPv4 converted

It would be nice to have the next function below embedded into this project in some way.
I am working with maxmind Country lite DB and they store IPv4 and IPv6 on the same DB.
For the data structure too stay consistent the library or the DB file stores the IPv4 in a 16 Bytes array instead of a 4 Bytes array.
The original IPv4 CIDR address is: 1.0.128.0/17 However when I represent it as an IPv6 I recieve the next string: ::100:8000/113 .
The Bytes array of this address is : [0 0 0 0 0 0 0 0 0 0 0 0 1 0 128 0]
Since I am working with GoLang the only way I found was to write my own functions to convert this value into a visible IPv4 CIDR.

The next is my functions sources:

var v4InV6Array = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

func hasEmptyLeadingBytes(ip net.IP) bool {
	return equal(v4InV6Array, ip[0:12])
}

func fakeIPv6ToIPv4(ip net.IP) net.IP {
	if hasEmptyLeadingBytes(ip.To16()) {
		return ip[12:16]
	}
	return nil
}

func convertFakeV6ToV4(ip *net.IPNet) *net.IPNet {
	if hasEmptyLeadingBytes(ip.IP.To16()) {
		return &net.IPNet{IP: ip.IP[12:16], Mask: ip.Mask}
	}
	return ip
}

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.