Expand description
§Written down, and read back
The grammars that turn what a person typed into the values in
crate::model. ip handles the address half, covering literals,
ranges, CIDR blocks, zones and keywords. target handles an address with
a port specification after it.
Every way of naming a target ends here: a command-line argument, a form field, a line of a target list, a CSV row and a hostname read from an nmap report are one grammar, so the file formats only decide where the tokens come from.
Resolution that has to ask the machine, such as what lan means or which interface
a %zone names, arrives as a caller-supplied callback (ip::ResolverFn,
ip::ZoneResolverFn). The engine passes crate::system::interface’s answers in,
which keeps this module a leaf.
Re-exports§
pub use ip::IpParseError;pub use ip::Keyword;pub use ip::names_keyword;pub use ip::to_set;pub use target::HostLookup;pub use target::TargetContext;pub use target::TargetExpr;pub use target::TargetMapBuilder;pub use target::TargetParseError;
Modules§
Functions§
- to_
target_ map - Parses target expressions such as
["1.1.1.1:80,443", "8.8.8.8"]into aTargetMap, giving each one the ports it names orglobal_portsif it names none.