Expand description
Exit policies: match patterns of addresses and/or ports.
Every Tor relays has a set of address:port combinations that it actually allows connections to. The set, abstractly, is the relay’s “exit policy”.
Address policies can be transmitted in two forms. One is a “full policy”, that includes a list of rules that are applied in order to represent addresses and ports. We represent this with the AddrPolicy type.
In microdescriptors, and for IPv6 policies, policies are just given a list of ports for which most addresses are permitted. We represent this kind of policy with the PortPolicy type.
TODO: This module probably belongs in a crate of its own, with possibly only the parsing code in this crate.
Structs§
- Addr
Policy - A sequence of rules that are applied to an address:port until one matches.
- Addr
Port Pattern - A pattern that may or may not match an address and port.
- Port
Policy - A policy to match zero or more TCP/UDP ports.
- Port
Range - A PortRange is a set of consecutively numbered TCP or UDP ports.
Enums§
- Policy
Error - Error from an unparsable or invalid policy.
- Rule
Kind - A kind of policy rule: either accepts or rejects addresses matching a pattern.