Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the network-addresses Reference Manual, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 14:29:46 2020 GMT+0.
• Introduction | What network-addresses is all about | |
• Systems | The systems documentation | |
• Modules | The modules documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Network addresses manipulation library.
This library lets you have an abstraction over IP addresses (ipv4 only for now) to manipulate them. Namely, there are 2 main abstractions:
An IP network consists of 2 things: a value and a subnet length,
e.g. 192.168.0.0/16
.
An IP address only consists of a value.
There exists 4 classes, best explained with their definitions:
(defclass network ()
((integer-value :initarg :integer-value :reader as-int)
(subnet-length :initarg :subnet-length :reader subnet-length)
(width :reader width :initform (error "Not implemented."))
(max-value :reader max-value :initform (error "Not implemented."))))
(defclass ipv4-network (na:network)
((na:width :reader na:width :initform 32)
(na:max-value :reader na:max-value :initform #xFFFFFFFF)))
(defclass address ()
((integer-value :initarg :integer-value :reader as-int)))
(defclass ipv4-address (na:address) ())
The network-addresses
system provides 2 packages:
network-addresses
(nicknamed na
) and network-addresses-ipv4
(nicknamed na4
). The na
package holds most of the public symbols,
while na4
has the ipv4-specific functions.
network-addresses-ipv4
packagemake-network-from-cidr
Takes a string representing a network in the CIDR notation, returns an
ipv4-network
.
Example:
CL-USER> (na4:make-network-from-cidr "192.168.0.0/16")
#<NETWORK-ADDRESSES-IPV4::IPV4-NETWORK 192.168.0.0/16>
network-addresses
packageThis package can raise the na:invalid-format
condition when an
invalid IP address is provided to make-network-from-cidr
.
network
methods/functionsList of methods and functions that act on network
objects. This list
does not include the slot readers.
####### as-str
Returns the network value as a string.
Example:
CL-USER> (na:as-str (na4:make-network-from-cidr "192.168.0.0/16"))
"192.168.0.0/16"
####### netmask
Returns the netmask of the network as an address
.
Example:
CL-USER> (na:netmask (na4:make-network-from-cidr "192.168.0.0/16"))
#<NETWORK-ADDRESSES-IPV4::IPV4-ADDRESS 255.255.0.0>
####### netmask-int
Returns the netmask of the network as an integer.
Example:
CL-USER> (na:netmask-int (na4:make-network-from-cidr "192.168.0.0/16"))
4294901760
####### hostmask
Returns the hostmask of the network as an address
.
Example:
CL-USER> (na:hostmask (na4:make-network-from-cidr "192.168.0.0/16"))
#<NETWORK-ADDRESSES-IPV4::IPV4-ADDRESS 0.0.255.255>
####### hostmask-int
Returns the hostmask of the network as an integer.
Example:
CL-USER> (na:hostmask-int (na4:make-network-from-cidr "192.168.0.0/16"))
65535
####### broadcast
Returns the broadcast of the network as an address
.
Example:
CL-USER> (na:broadcast (na4:make-network-from-cidr "192.168.0.0/16"))
#<NETWORK-ADDRESSES-IPV4::IPV4-ADDRESS 192.168.255.255>
####### broadcast-int
Returns the broadcast of the network as an integer.
Example:
CL-USER> (na:broadcast-int (na4:make-network-from-cidr "192.168.0.0/16"))
3232301055
####### addresses
Returns the list of IP addresses (excluding first and last) of the
network as a list of address
.
Example:
CL-USER> (na:addresses (na4:make-network-from-cidr "192.168.0.0/30"))
(#<NETWORK-ADDRESSES-IPV4::IPV4-ADDRESS 192.168.0.1>
#<NETWORK-ADDRESSES-IPV4::IPV4-ADDRESS 192.168.0.2>)
####### addresses-int
Returns the list of IP addresses (excluding first and last) of the network as a list of integers.
Example:
CL-USER> (na:addresses-int (na4:make-network-from-cidr "192.168.0.0/30"))
(3232235521 3232235522)
####### first-address
Returns the first IP address of the network as an address
.
Example:
CL-USER> (na:first-address (na4:make-network-from-cidr "192.168.0.0/30"))
#<NETWORK-ADDRESSES-IPV4::IPV4-ADDRESS 192.168.0.0>
####### first-address-int
Returns the first IP address of the network as an integer.
Example:
CL-USER> (na:first-address-int (na4:make-network-from-cidr "192.168.0.0/30"))
3232235520
####### last-address
Returns the last IP address of the network as an address
.
Example:
CL-USER> (na:last-address (na4:make-network-from-cidr "192.168.0.0/30"))
#<NETWORK-ADDRESSES-IPV4::IPV4-ADDRESS 192.168.0.3>
####### last-address-int
Returns the last IP address of the network as an integer.
Example:
CL-USER> (na:last-address-int (na4:make-network-from-cidr "192.168.0.0/30"))
3232235523
address
methods/functionsList of methods and functions that act on address
objects. This list
does not include the slot readers.
####### as-str
Returns the address value as a string.
Example:
CL-USER> (na:as-str (na:first-address (na4:make-network-from-cidr "192.168.0.0/16")))
"192.168.0.0"
This software is provided under the MIT license. Please see the LICENSE file.
Next: Modules, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The network-addresses system |
Florian Margaine <florian@margaine.com>
MIT
A network addresses manipulation library.
cl-ppcre
network-addresses.asd (file)
src (module)
Modules are listed depth-first from the system components tree.
• The network-addresses/src module |
network-addresses (system)
src/
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The network-addresses/src/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
network-addresses.asd
network-addresses (system)
Next: The network-addresses/src/generic․lisp file, Previous: The network-addresses․asd file, Up: Lisp files [Contents][Index]
src (module)
src/package.lisp
Next: The network-addresses/src/conditions․lisp file, Previous: The network-addresses/src/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
src (module)
src/generic.lisp
as-str (generic function)
Next: The network-addresses/src/address․lisp file, Previous: The network-addresses/src/generic․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
src (module)
src/conditions.lisp
invalid-format (condition)
Next: The network-addresses/src/network․lisp file, Previous: The network-addresses/src/conditions․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
src (module)
src/address.lisp
Next: The network-addresses/src/ipv4․lisp file, Previous: The network-addresses/src/address․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/network.lisp
range (function)
Previous: The network-addresses/src/network․lisp file, Up: Lisp files [Contents][Index]
src (module)
src/ipv4.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The network-addresses-ipv4 package | ||
• The network-addresses package |
Next: The network-addresses package, Previous: Packages, Up: Packages [Contents][Index]
package.lisp (file)
na4
common-lisp
make-network-from-cidr (function)
Previous: The network-addresses-ipv4 package, Up: Packages [Contents][Index]
package.lisp (file)
na
common-lisp
range (function)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions | ||
• Exported generic functions | ||
• Exported conditions | ||
• Exported classes |
Next: Exported generic functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Returns the list of IP addresses of a network as integers.
network.lisp (file)
Returns the broadcast as an integer.
network.lisp (file)
Returns the first address of this network.
network.lisp (file)
Returns the hostmask as an integer.
network.lisp (file)
Returns the last address of this network.
network.lisp (file)
Return a IPv4 network object based on the cidr.
ipv4.lisp (file)
Returns the netmask as an integer.
network.lisp (file)
Next: Exported conditions, Previous: Exported functions, Up: Exported definitions [Contents][Index]
Returns the list of IP addresses of a network.
network.lisp (file)
ipv4.lisp (file)
automatically generated reader method
network.lisp (file)
automatically generated reader method
address.lisp (file)
Returns the IP address/network in its string representation.
generic.lisp (file)
ipv4.lisp (file)
ipv4.lisp (file)
Returns the broadcast as an IP address.
network.lisp (file)
ipv4.lisp (file)
Returns the first IP address of this network.
network.lisp (file)
ipv4.lisp (file)
Returns the hostmask as an IP address.
network.lisp (file)
ipv4.lisp (file)
Returns the last IP address of this network.
network.lisp (file)
ipv4.lisp (file)
automatically generated reader method
ipv4.lisp (file)
automatically generated reader method
network.lisp (file)
Returns the netmask as an IP address.
network.lisp (file)
ipv4.lisp (file)
automatically generated reader method
network.lisp (file)
automatically generated reader method
ipv4.lisp (file)
automatically generated reader method
network.lisp (file)
Next: Exported classes, Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
conditions.lisp (file)
error (condition)
Previous: Exported conditions, Up: Exported definitions [Contents][Index]
address.lisp (file)
standard-object (class)
ipv4-address (class)
as-int (method)
:integer-value
as-int (generic function)
network.lisp (file)
standard-object (class)
ipv4-network (class)
:integer-value
as-int (generic function)
:subnet-length
subnet-length (generic function)
(error "not implemented.")
width (generic function)
(error "not implemented.")
max-value (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal functions | ||
• Internal classes |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
ipv4.lisp (file)
Next: Internal classes, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
Transforms a list of integers in strings into a single integer, by having each integer going through its byte representation, then concatenating all the bytes, and returning the value of these bits. With math.
ipv4.lisp (file)
network.lisp (file)
Previous: Internal functions, Up: Internal definitions [Contents][Index]
ipv4.lisp (file)
network (class)
32
width (generic function)
4294967295
max-value (generic function)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L M N |
---|
Jump to: | F L M N |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | A B F G H I L M N R S W |
---|
Jump to: | A B F G H I L M N R S W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
I M S W |
---|
Jump to: | *
I M S W |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | A C I N P S |
---|
Jump to: | A C I N P S |
---|