Next: , Previous: Address Predicates, Up: Addresses


2.3.3 Address Arithmetic

— Function: sockets:make-netmask &key cidr class

Create a subnet mask by specifying either its class(:A, :b or :C) or a cidr suffix(a number between 0 and 32).

— Function: sockets:ensure-netmask thing

If thing is of type IPV4-ADDRESS it is returned as is; if keyword it must be one of :a, :b or :c otherwise it's treated as a cidr suffix.

— Generic Function: sockets:inet-address-network-portion address netmask

Apply network netmask netmask to address in order to calculate the network part of address.

— Generic Function: sockets:inet-address-host-portion address netmask

Apply network netmask netmask to address in order to calculate the host part of address.

— Generic Function: sockets:inet-address-in-network-p address network

Return t if address is part of the subnet specified by network.

— Generic Function: sockets:inet-addresses-in-same-network-p address1 address2 network

Return t if ADDRESS1 and ADDRESS2 are both part part of the subnet specified by network.

— Generic Function: sockets:inet-address-network-class address

Return the network class of address: one of :a, :b, :c, :d or :e .

— Generic Function: sockets:inet-address-private-p address

Returns t if address is in a private network range. Private IPv4 networks are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. See http://en.wikipedia.org/wiki/Private_network for details.