tor  0.4.2.1-alpha-dev
Data Fields
addr_policy_t Struct Reference

#include <addr_policy_st.h>

Data Fields

int refcnt
 
addr_policy_action_bitfield_t policy_type:2
 
unsigned int is_private:1
 
unsigned int is_canonical:1
 
maskbits_t maskbits
 
tor_addr_t addr
 
uint16_t prt_min
 
uint16_t prt_max
 

Detailed Description

A reference-counted address policy rule.

Definition at line 21 of file addr_policy_st.h.

Field Documentation

◆ addr

tor_addr_t addr_policy_t::addr

Base address to accept or reject.

Note that wildcards are treated differntly depending on address family. An AF_UNSPEC address means "All addresses, IPv4 or IPv6." An AF_INET address with maskbits==0 means "All IPv4 addresses" and an AF_INET6 address with maskbits == 0 means "All IPv6 addresses".

Definition at line 41 of file addr_policy_st.h.

Referenced by addr_policy_append_reject_addr(), addr_policy_covers(), addr_policy_intersects(), policy_expand_private(), policy_hash(), and policy_write_item().

◆ is_canonical

unsigned int addr_policy_t::is_canonical

True iff this policy is the canonical copy (stored in a hash table to avoid duplication of common policies)

Definition at line 27 of file addr_policy_st.h.

Referenced by addr_policy_free_(), policy_expand_private(), and policy_expand_unspec().

◆ is_private

unsigned int addr_policy_t::is_private

True iff this is the pseudo-address, "private".

Definition at line 25 of file addr_policy_st.h.

Referenced by policy_expand_private(), policy_hash(), and policy_write_item().

◆ maskbits

maskbits_t addr_policy_t::maskbits

Accept/reject all addresses a such that the first maskbits bits of a match addr.

Definition at line 30 of file addr_policy_st.h.

Referenced by addr_policy_append_reject_addr(), addr_policy_covers(), addr_policy_intersects(), policy_expand_private(), policy_hash(), and policy_write_item().

◆ policy_type

addr_policy_action_bitfield_t addr_policy_t::policy_type

What to do when the policy matches.

Definition at line 24 of file addr_policy_st.h.

Referenced by addr_policy_append_reject_addr(), policy_hash(), and policy_write_item().

◆ prt_max

uint16_t addr_policy_t::prt_max

Highest port number to accept/reject.

Definition at line 43 of file addr_policy_st.h.

Referenced by addr_policy_append_reject_addr(), policy_hash(), and policy_write_item().

◆ prt_min

uint16_t addr_policy_t::prt_min

Lowest port number to accept/reject.

Definition at line 42 of file addr_policy_st.h.

Referenced by addr_policy_append_reject_addr(), policy_hash(), and policy_write_item().

◆ refcnt

int addr_policy_t::refcnt

Reference count

Definition at line 22 of file addr_policy_st.h.

Referenced by addr_policy_free_().


The documentation for this struct was generated from the following file: