Network Address Type

Network Address Type mk Sat, 01/14/2012 - 14:49

The SQL type inet describes IPv4 network addresses. The inet module contains a collection of functions that operate on IPv4 addresses.  The most relevant functions are the `containment' functions that deal with subnet masks.

  Description
  sys.broadcast(p inet) returns inet
  sys.host(p inet) returns clob
  sys.masklen(p inet) returns int
  sys.setmasklen(p inet, mask int) returns inet
  sys.netmask(p inet) returns inet
  sys.hostmask(p inet) returns inet
  sys.network(p inet) returns inet
  sys.text(p inet) returns clob
  sys.abbrev(p inet) returns clob
  sys."left_shift"(i1 inet, i2 inet) returns boolean
  sys."right_shift"(i1 inet, i2 inet) returns boolean
  sys."left_shift_assign"(i1 inet, i2 inet) returns boolean
  sys."right_shift_assign"(i1 inet, i2 inet) returns boolean

The functionality of this module is greatly inspired by the PostgreSQL inet atom. It should be extended to also support IPv6.