2 Replies - 4152 Views - Last Post: 28 May 2009 - 03:36 AM Rate Topic: -----

#1 Raghu66   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-May 09

Need Help for Java snippet for IP Calculator

Posted 27 May 2009 - 10:01 PM

Request to All if somebody can confirm me for Java code snippet for IP Calculator.

Logic Should be like :

Broadcast IP Address calculation.
Broadcast IP = network address + wildcard
wildcard = negation of bitmask

ex :
if BitMask is 24 then binary format is : 11111111.11111111.11111111.00000000
Negation would result to : 00000000.00000000.00000000.11111111

Finally we need to add network address(10.1.1.0) + wildcard
00001010.00000001.00000001.00000000
+00000000.00000000.00000000.11111111
____________________________________
=00001010.00000001.00000001.11111111

Convert this back to Decimal to get the output as : 10.1.1.255

Related links for tool

http://www.subnet-ca...php?net_class=A

http://www.faqintosh...webapps/ipcalc/

Please reply to me incase anybody gets this snippet

Is This A Good Question/Topic? 0
  • +

Replies To: Need Help for Java snippet for IP Calculator

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Need Help for Java snippet for IP Calculator

Posted 27 May 2009 - 10:21 PM

What exactly is your question here? Also, the links you provided are Javascript samples, not Java. Are you working with Javascript or Java?
Was This Post Helpful? 0
  • +
  • -

#3 g00se   User is online

  • D.I.C Lover
  • member icon

Reputation: 3622
  • View blog
  • Posts: 16,641
  • Joined: 20-September 08

Re: Need Help for Java snippet for IP Calculator

Posted 28 May 2009 - 03:36 AM

Quote

+ wildcard

?

Don't you mean the netmask?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1