NetmaskGroup

newNMG() → NetmaskGroup

Returns a NetmaskGroup

class NetmaskGroup
Represents a group of netmasks that can be used to match ComboAddresses against.
:addMask(mask)
:addMask(masks)

Add one or more masks to the NMG.

Parameters:
  • 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 values are integers, as returned by exceed* functions.
:match(address) → bool

Checks if address is matched by this NetmaskGroup.

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

Clears the NetmaskGroup.

:size() → int

Returns number of netmasks in this NetmaskGroup.