newNMG() → NetmaskGroup

Returns a NetmaskGroup

class NetmaskGroup
Represents a group of netmasks that can be used to match ComboAddresses against.

Add one or more masks to the NMG.

  • mask (string) – Add this mask, prefix with ! to exclude this mask from matching.
  • masks (table) – Adds the keys of the table to the NetmaskGroup. It should be a table whose keys are ComboAddress objects and whose values are integers. The integer values of the table entries are ignored. The table is of the same type as the table returned by the exceed* functions.

New in version 1.9.0.

Add all masks from an existing NMG to this NMG.

Parameters:otherNMG (NetmaskGroup) – Add the masks from a NetmaskGroup to this one.
:match(address) → bool

Checks if address is matched by this NetmaskGroup.

Parameters:address (ComboAddress) – The address to match.

Clears the NetmaskGroup.

:size() → int

Returns number of netmasks in this NetmaskGroup.