From 1f2c6d833c579c8c3169e22ef8af00265a438406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Thu, 18 Jul 2019 21:35:33 +0000 Subject: add :hostmask() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Asbjørn Sloth Tønnesen --- README.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'README.rst') diff --git a/README.rst b/README.rst index df955e2..186fca3 100644 --- a/README.rst +++ b/README.rst @@ -80,6 +80,7 @@ Operator Description ``:ipstring()`` ip as string without prefix ``:cidrstring()`` format CIDR notation ``:netmask()`` generate netmask as an address +``:hostmask()`` generate hostmask as an address ``:flip()`` flip the least significant network bit ================= ====================================== @@ -239,6 +240,19 @@ Build an IP address mask with the netmask of ``foo``. inet('2001:db8::/64'):netmask() -- returns inet('ffff:ffff:ffff:ffff::') +``foo:hostmask()`` +~~~~~~~~~~~~~~~~~ + +Build an IP address mask with the netmask of ``foo``. + +:: + + inet('192.0.2.0/24'):hostmask() -- returns inet('0.0.0.255') + inet('2001:db8::/64'):hostmask() -- returns inet('::ffff:ffff:ffff:ffff') + inet('2001:db8::/116'):hostmask() -- returns inet('::fff') + inet('2001:db8::/112'):hostmask() -- returns inet('::ffff') + + ``foo:flip()`` ~~~~~~~~~~~~~~ -- cgit v1.2.1