salbahra / cordova-plugin-networkinterface

Provide a method for Cordova applications to retrieve the device IP Address.
http://albahra.com/projects
72 stars 51 forks source link

Feature Request: Netmask #12

Closed JohannesHoffmann closed 7 years ago

JohannesHoffmann commented 8 years ago

Would it be possible to add a function to also get the netmask of the network? I use this plugin to get the ip address to scan a network for a server. To get the whole range of the network i use this plugin: IPSubnetCalculator To geht the range i need the netmask. Would be nice to get this feature in here ;)

schulti commented 8 years ago

Hi! I agree it would be great to have the netmask available through this plugin.

salbahra commented 7 years ago

I think to avoid a soup of callbacks we can probably return the netmask in the IP request as a seperate argument in the callback.

wangshug commented 7 years ago

I had the similar case, I need a netmask to calculate broadcast address

dharders commented 7 years ago

Just added PR #24 that adds the requested netmask/subnet support. For now, only iOS and Android have been added.

Please test it out on your devices (by following the PR instructions) and let me know if you find an issue. Hopefully this PR is approved and merged soon. Enjoy!