diff options
author | Asbjørn Sloth Tønnesen <ast@2e8.dk> | 2019-07-18 21:35:33 +0000 |
---|---|---|
committer | Asbjørn Sloth Tønnesen <ast@2e8.dk> | 2019-07-18 21:35:33 +0000 |
commit | 1f2c6d833c579c8c3169e22ef8af00265a438406 (patch) | |
tree | 1ab27f5e85da78f1b67e001c22b9015260cbdfd1 /README.rst | |
parent | cfec9c2570b9f185447025a17c735f44a7b9f525 (diff) | |
download | lua-inet-1f2c6d833c579c8c3169e22ef8af00265a438406.tar.gz lua-inet-1f2c6d833c579c8c3169e22ef8af00265a438406.tar.xz lua-inet-1f2c6d833c579c8c3169e22ef8af00265a438406.zip |
add :hostmask()
Signed-off-by: Asbjørn Sloth Tønnesen <ast@2e8.dk>
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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()`` ~~~~~~~~~~~~~~ |