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.
Modules§
- addrpolicy 🔒
- Implements address policies, based on a series of accept/reject rules.
- portpolicy 🔒
- Implement port-based policies
- summary 🔒
- Precise IP and port policy summarisation algorithm
Structs§
- Addr
Policy - Sequence of
acceptandrejectrules - Addr
Port Pattern - A pattern that may or may not match an address and port.
- Port
Policies - A pair of port policy summaries, one for IPv4 and one for IPv6
- 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.
- Port
Ranges 🔒 - A collection of port ranges in a sorted order.
- Port
Summary Thresholds - Thresholds for deciding whether a port counts as open, for a summary
Enums§
- IpPattern
- A pattern that matches one or more IP addresses.
- Policy
Error - Error from an unparsable or invalid policy.
- Rule
Kind - A kind of policy rule: either accepts or rejects addresses matching a pattern.