Monday, May 2, 2011

vCO - convert decimal net mask to decimal octet

I had to calculate the dotted subnet mask from normal formatted network string like:

192.168.12.0/23 --> 255.255.254.0

In vCO pow(x,y) is not available, so I had to build an action which transform the decimal part (here 23) into a dotted format by using a function to calculate pow(2,x).
Because the decimal part was got by .split("/") the input parameter is also string. You an easily rewrite this action for number input usage.


Feel free to leave a comment - Regards, Andreas

1 comment:

  1. Thanks for sharing such an important post for students. Your post is easy to understand the concept of netmask calculator. The detailed explanation of netmask calculator is very good.

    ReplyDelete