From 39871f22210d6b48775bef4f78c73a78626fa7ba Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 16 Nov 2021 16:03:10 +0100 Subject: [PATCH] add doc/mod/ipcalc (cherry picked from commit e9953c361267f10fd15d3280ccd985062c1dde28) --- README.md | 1 + doc/mod/ipcalc.d/ipcalc.avif | Bin 0 -> 1791 bytes doc/mod/ipcalc.d/ipcalcreturn.avif | Bin 0 -> 1283 bytes doc/mod/ipcalc.md | 53 +++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 doc/mod/ipcalc.d/ipcalc.avif create mode 100644 doc/mod/ipcalc.d/ipcalcreturn.avif create mode 100644 doc/mod/ipcalc.md diff --git a/README.md b/README.md index 80e4693..f9a4fb1 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,7 @@ Available modules * [Manage ports in bridge](doc/mod/bridge-port-to.md) * [Manage VLANs on bridge ports](doc/mod/bridge-port-vlan.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 Telegram](doc/mod/notification-telegram.md) diff --git a/doc/mod/ipcalc.d/ipcalc.avif b/doc/mod/ipcalc.d/ipcalc.avif new file mode 100644 index 0000000000000000000000000000000000000000..022f325bc4637fbb9e4cee8a8d9ad66eab3ba49e GIT binary patch literal 1791 zcmXv|3p~>c8~&RSjTz}+iOmv~bJ|KLa&M?;Tg+XqL$)?sEaEE;$#MHIq@&1mIbY2E zk{q{`+i|}XK5RlR=V;TAYxp+b@4WBt_df6YJkRfaUjP6Q0nBiQPbfJ65QP|N=S^qz*vZ=WtuSKL*yv7%!Y|UxGXNf*x z45sGa1W9*6w8LBLRCefI@A%0vuLcxBSLgON+KC5=le}DCpgRBs?=qY?8gOr%EK82<+EcD0E-GkjOm|k<|dp56PhQ7PJHXpq3wB8^o2leDnK2k5d=6f4Y(KPN{ zXikb}as9KN`Jizw!BGEC)nCcy^RUxXWT>!skOXQ6(&(BuS zZB^j^$}!d2rJ&r^Fs{hwr;XG~+FNEex4c*OG?Cs5ijn=fZ^9dLIJQOHxy0lVa89P> zI=gNZl+fc?o!HTo6-G!2PGX!<^IlRkN1o@Uv)MhFN(G@`93td2V0u@vr2Na>IMif{ zj2RHKcEsW2>$gjWfjG7ua%t<>vQ%2n;Xih|z9QvTAJ z90*6xc;%s%qpJ2pS^hgHCP8~bYQsoPEdzZAXaD(l%uCNR!3%6MR%*Cfnv&h_N7+tx zzz{EUIS+;l_;73Qz9w_7hE_akLK@-JD%kXhtJ_=t{o(-+e|b46XtCT(2LxAhZF$ zBa-^H^KND%XSFUV$&lh!XQpUXrlJV-yO;R*EHsdRgxJ#&vW#LB{C2{sb-L`O9qc6K z=V}&}cs)6rbFi`1RVUYFgln$$vG0Q3YH;}ivc|ft^Mf^XCK~3?VW_ZP8yq4ow7A+XW3;3JbmIuqm`Xkond@VS*K(2K)Oz8@;_wILqxi%O{~ zzrOP*?YW*jTu=%bL6p(4y7`z#Beae}rz2*|LTT|PdWfx_SCKYc(gKNI8Sz@X6ku5Q_J(& zro0pU+9?+0)u+0|c+qwK1O!)C`p9tp5z-vESQbP>D?;59yg~af+Z(UvG z5x^Ym)s4PzJHk?pGYy(O>aFO4Wt_GO;Qj$FP!eUDxr#agRs$aDEoD`sJ)K!MuLx(%}dRt0uKApN5kshW3dQq4wZ z3|{JjY8lT_t@=*$y)COT7da^D;UC+;G*xU`T)^u2l7)KX)l&9*oAf!kt=7t+1#rKD4FAgS Oj1?32im|Lp#Qy*bWgj&F literal 0 HcmV?d00001 diff --git a/doc/mod/ipcalc.d/ipcalcreturn.avif b/doc/mod/ipcalc.d/ipcalcreturn.avif new file mode 100644 index 0000000000000000000000000000000000000000..d858bb12cd8b487f6d1dc8106f978304eae4f524 GIT binary patch literal 1283 zcmZQzU{FXasVqn=%S>Yc0uY^>nP!-qnV9D5Xy^zO`jnemk_eIm0*#E6oFWL5fuSHX zxdg@r(K(q(Fk|=%GD~v7a*RMyE;A=T8N_p8U|EXYj+$pHb-VJwVH%`8CEKIWz* zmIyI$aayPrS=?}Nc3fg~lilY8%bn(BD&gO!-N<|KGGNgpL6aqstR0KLlreOP^Kyjy zDa*f^=woKey#4LpoY{Fi+FCUV;ZH)B&x}?K;+`Amb$-#`laJWBX3Bo|o!KCNq~Kie z>F1LEt9J9J>e>Ezlb_r7-RkS3{rnbR5{(x&hqn8cFIWHmRxN1NqfS}9XV-;w7W~Qz z(B8^f*SspX*}6pX)|||rNtG{`N7(BNRJq(_u-Rs>`0{nwiLf(83#5*|>Nz88KmFOP z*`c1Vt=5%$-Pt;+=b7N_S94N$cS?zg?y5fZ_-|%*cHpggw_i!g?Dx}jx27Kd>n>wD zeO=pO$L4}RPhb2BT<|w%&5@LpGc)V+t=Xm>{g4~_!bFkvl6(5zzI`Suc^ccimRA|b z?l~{_tF2(p-zCSd+x+LXxlq{<{8s4fypTUo|ZC>&(|#oIU;NG@YbZXU{M3y7J^u_0Nc# zM>*=*jx()XBwwd5*}L?1nf;E8pXzMO|4p|4naZ{PqTv(kOm(dguH4+0Rev}H)idWu zAAWi1DAw%aX7-z9;VPNbK>y}Epj~iDu4ff zOK5pv8p+5r#X}`np#Jmk{g>}_RsZyPxch)KhgSmEHW?P>Yf{TEo{N2}$66zFRwrL; zWpMo|(Y2TEzghI`#9y~phpzn#$|^dywCJ_cIfuh~0UYZW@Hm`(@@#AOw`R>x{iRRz zublh&%I=u$Eil`*#5P9C&~5!( z=GD`FPiWc1Sr~cw-}?B>Fv@KiRH33D@k&9~^# z+PiC(*xIFfC*1`XEz`0nR+zBAq?9e~XJtjE?FXM8zU3t>!v4~n*BoOm%yfwhHtKJS zWdB;Q_+y>@C%ropF53AUu&PX3x?R9(ZWotlrkvx;Tw`D1thZd#d3 ℹ️️ **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)