diff options
| author | Yuval Adam <yuval@y3xz.com> | 2015-12-09 13:39:47 +0200 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2015-12-09 13:39:47 +0200 |
| commit | 41ae79e2699118120b976eb657782d614089aec4 (patch) | |
| tree | e67af8c2882e4cec43e0810acd2200f0f1584fb1 | |
| parent | 758d6f2c4a6db148fe1912ce28f88465e3e79d26 (diff) | |
Add address count
| -rw-r--r-- | index.js | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -49,6 +49,13 @@ class IPAddress extends React.Component { } } + getCount = () => { + if (this.state.cidr == 32) { + return 1; + } + return ((0xFFFFFFFF >>> this.state.cidr) >>> 0) + 1 + } + render() { return <div className="ip-address"> <div className="address"> @@ -76,7 +83,7 @@ class IPAddress extends React.Component { </div> <div className="details"> - <span className="netmask">Netmask: {this.getNetmask()}</span> + <span className="netmask">Netmask: {this.getNetmask()}</span>, <span className="count">Address Count: {this.getCount()}</span> </div> </div> |
