add doc/mod/ipcalc

This commit is contained in:
Christian Hesse 2021-11-16 16:03:10 +01:00
parent 002315035c
commit e9953c3612
4 changed files with 54 additions and 0 deletions

View file

@ -225,6 +225,7 @@ Available modules
* [Manage ports in bridge](doc/mod/bridge-port-to.md) * [Manage ports in bridge](doc/mod/bridge-port-to.md)
* [Manage VLANs on bridge ports](doc/mod/bridge-port-vlan.md) * [Manage VLANs on bridge ports](doc/mod/bridge-port-vlan.md)
* [Inspect variables](doc/mod/inspectvar.md) * [Inspect variables](doc/mod/inspectvar.md)
* [IP address calculation](doc/mod/ipcalc.md)
* [Send notifications via Matrix](doc/mod/notification-matrix.md) * [Send notifications via Matrix](doc/mod/notification-matrix.md)
* [Send notifications via Telegram](doc/mod/notification-telegram.md) * [Send notifications via Telegram](doc/mod/notification-telegram.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

53
doc/mod/ipcalc.md Normal file
View file

@ -0,0 +1,53 @@
IP address calculation
======================
[◀ Go back to main README](../../README.md)
> **Info**: This module can not be used on its own but requires the base
> installation. See [main README](../../README.md) for details.
Description
-----------
This module adds functions for IP address calculation.
Requirements and installation
-----------------------------
Just install the module:
$ScriptInstallUpdate mod/ipcalc;
Usage and invocation
--------------------
### IPCalc
The function `$IPCalc` prints information to terminal, including:
* address
* netmask
* network in CIDR notation
* minimum host address
* maximum host address
* broadcast address
It expects an IP address in CIDR notation as argument.
$IPCalc 192.168.88.1/24;
![IPCalc](ipcalc.d/ipcalc.avif)
### IPCalcReturn
The function `$IPCalcReturn` expects an IP address in CIDR notation as
argument as well. But it does not print to terminal, instead it returns
the information in a named array.
:put ([ $IPCalcReturn 192.168.88.1/24 ]->"broadcast");
![IPCalcReturn](ipcalc.d/ipcalcreturn.avif)
---
[◀ Go back to main README](../../README.md)
[▲ Go back to top](#top)