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.
: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.