Documentation ¶
Overview ¶
Package veild is the main veil package for handling DNS to DNS-over-TLS connections.
Index ¶
Constants ¶
const ( // PacketLength is the maximum allowed packet length for a DNS packet. PacketLength int = 512 // HeaderLength is the length of a normal DNS request/response header (in bytes). HeaderLength int = 12 )
Variables ¶
var ( // ErrInvalidRType is returned when a mapping cannot be found between // the numeric representation of an RR type and it's string. ErrInvalidRType = errors.New("invalid rtype") )
Errors in the DNS parse phase.
var ( // ErrProblemParsingOffsets is returned when a TTL offset cannot be parsed. ErrProblemParsingOffsets = errors.New("problem parsing TTL offsets") )
Errors in the query cache.
var ResourceTypes = map[uint16]string{
1: "A",
2: "NS",
5: "CNAME",
6: "SOA",
12: "PTR",
15: "MX",
16: "TXT",
28: "AAAA",
33: "SRV",
257: "CAA",
}
ResourceTypes maps resource record (RR) types to string representations.
Functions ¶
Types ¶
type Blacklist ¶
type Blacklist struct {
// contains filtered or unexported fields
}
Blacklist represents a blacklist.
func NewBlacklist ¶
NewBlacklist creates a new Blacklist from a given hosts file.
type Config ¶
type Config struct { ListenAddr string Caching bool OutboundPort uint BlacklistFile string ResolversFile string }
Config represents the command line options.
type PConn ¶
type PConn struct {
// contains filtered or unexported fields
}
PConn holds persistent connections.
type Packet ¶
type Packet struct {
// contains filtered or unexported fields
}
Packet represents the structure of a client request.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents a new connection pool.
func (*Pool) ConnectionManagement ¶
func (p *Pool) ConnectionManagement()
ConnectionManagement management handles reconnects.
func (*Pool) Dispatch ¶
func (p *Pool) Dispatch()
Dispatch handles dispatching requests to the underlying workers.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query holds the structure for the raw response data and offsets of TTLs.
type QueryCache ¶
type QueryCache struct {
// contains filtered or unexported fields
}
QueryCache holds the main structure of the query cache.
func NewQueryCache ¶
func NewQueryCache() *QueryCache
NewQueryCache handles QueryCache initialization.
func (*QueryCache) Get ¶
func (r *QueryCache) Get(key [sha1.Size]byte) (interface{}, bool)
Get gets an entry from the query cache.
func (*QueryCache) Put ¶
func (r *QueryCache) Put(key [sha1.Size]byte, value Query)
Put puts an entry into the query cache.
func (*QueryCache) Reaper ¶
func (r *QueryCache) Reaper()
Reaper ticks over every second and runs through the TTL decrements.
type RR ¶
type RR struct {
// contains filtered or unexported fields
}
RR represents a domain name and resource type.
type Resolvers ¶
type Resolvers struct {
Resolvers []Resolver
}
Resolvers implements a list of resolvers.
func NewResolvers ¶
NewResolvers loads of a list of resolvers from a file.
type ResponseCache ¶
type ResponseCache struct {
// contains filtered or unexported fields
}
ResponseCache represents a response cache.
func NewResponseCache ¶
func NewResponseCache() *ResponseCache
NewResponseCache handles ResponseCache initialization.
func (*ResponseCache) Get ¶
func (r *ResponseCache) Get(key uint16) (interface{}, bool)
Get gets an entry from the response cache.
func (*ResponseCache) Put ¶
func (r *ResponseCache) Put(key uint16, value Packet)
Put puts an entry into the response cache.