Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

P_HostDBProcessor.h File Reference

A brief file description. More...

#include "I_HostDBProcessor.h"
Include dependency graph for P_HostDBProcessor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  HostDBCache
struct  HostDBMD5
 Container for an MD5 hash and its dependent data. More...
struct  HostDBContinuation
struct  HostDBContinuation::Options
 Optional values for init. More...

Defines

#define HOST_DB_HITS_BITS   3
#define HOST_DB_TAG_BITS   56
#define CONFIGURATION_HISTORY_PROBE_DEPTH   1
#define HOST_DB_CACHE_MAJOR_VERSION   3
#define HOST_DB_CACHE_MINOR_VERSION   0
#define DEFAULT_HOST_DB_FILENAME   "host.db"
#define DEFAULT_HOST_DB_SIZE   (1<<14)
#define HOST_DB_TIMEOUT_INTERVAL   HRTIME_SECOND
#define HOST_DB_IP_TIMEOUT   (24*60*60)
#define HOST_DB_IP_STALE   (12*60*60)
#define HOST_DB_IP_FAIL_TIMEOUT   (60*60)
#define HOST_DB_MAX_TTL   (0x1FFFFF)
#define HOST_DB_CLUSTER_TIMEOUT   HRTIME_MSECONDS(5000)
#define HOST_DB_RETRY_PERIOD   HRTIME_MSECONDS(20)
#define TEST(_x)
#define HOSTDB_DEBUG_COUNT_DYN_STAT(_x, _y)   RecIncrRawStatCount(hostdb_rsb, mutex->thread_holding, (int)_x, _y)
#define HOSTDB_INCREMENT_DYN_STAT(_x)   RecIncrRawStatSum(hostdb_rsb, mutex->thread_holding, (int)_x, 1)
#define HOSTDB_DECREMENT_DYN_STAT(_x)   RecIncrRawStatSum(hostdb_rsb, mutex->thread_holding, (int)_x, -1)
#define HOSTDB_SUM_DYN_STAT(_x, _r)   RecIncrRawStatSum(hostdb_rsb, mutex->thread_holding, (int)_x, _r)
#define HOSTDB_READ_DYN_STAT(_x, _count, _sum)
#define HOSTDB_SET_DYN_COUNT(_x, _count)   RecSetRawStatCount(hostdb_rsb, _x, _count);
#define HOSTDB_INCREMENT_THREAD_DYN_STAT(_s, _t)   RecIncrRawStatSum(hostdb_rsb, _t, (int) _s, 1);
#define HOSTDB_DECREMENT_THREAD_DYN_STAT(_s, _t)   RecIncrRawStatSum(hostdb_rsb, _t, (int) _s, -1);

Typedefs

typedef int(HostDBContinuation::* HostDBContHandler )(int, void *)

Enumerations

enum  { TTL_OBEY, TTL_IGNORE, TTL_MIN, TTL_MAX }
enum  HostDBMark { HOSTDB_MARK_GENERIC, HOSTDB_MARK_IPV4, HOSTDB_MARK_IPV6, HOSTDB_MARK_SRV }
 

Host DB record mark.

More...
enum  HostDB_Stats {
  hostdb_total_entries_stat, hostdb_total_lookups_stat, hostdb_total_hits_stat, hostdb_ttl_stat,
  hostdb_ttl_expires_stat, hostdb_re_dns_on_reload_stat, hostdb_bytes_stat, HostDB_Stat_Count
}

Functions

char const * string_for (HostDBMark mark)
 Convert a HostDB mark to a string.
unsigned int HOSTDB_CLIENT_IP_HASH (sockaddr const *lhs, sockaddr const *rhs)
unsigned int master_hash (INK_MD5 const &md5)
bool is_dotted_form_hostname (const char *c)

Variables

int hostdb_enable
int hostdb_migrate_on_demand
int hostdb_cluster
int hostdb_cluster_round_robin
int hostdb_lookup_timeout
int hostdb_insert_timeout
int hostdb_re_dns_on_reload
int hostdb_ttl_mode
unsigned int hostdb_current_interval
unsigned int hostdb_ip_stale_interval
unsigned int hostdb_ip_timeout_interval
unsigned int hostdb_ip_fail_timeout_interval
int hostdb_size
int hostdb_srv_enabled
char hostdb_filename [PATH_NAME_MAX+1]
int hostdb_sync_frequency
int hostdb_disable_reverse_lookup
HostDBCache hostDB
RecRawStatBlockhostdb_rsb

Detailed Description

A brief file description.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file P_HostDBProcessor.h.


Define Documentation

#define CONFIGURATION_HISTORY_PROBE_DEPTH   1

Definition at line 110 of file P_HostDBProcessor.h.

#define DEFAULT_HOST_DB_FILENAME   "host.db"

Definition at line 117 of file P_HostDBProcessor.h.

#define DEFAULT_HOST_DB_SIZE   (1<<14)

Definition at line 118 of file P_HostDBProcessor.h.

#define HOST_DB_CACHE_MAJOR_VERSION   3

Definition at line 113 of file P_HostDBProcessor.h.

#define HOST_DB_CACHE_MINOR_VERSION   0

Definition at line 114 of file P_HostDBProcessor.h.

#define HOST_DB_CLUSTER_TIMEOUT   HRTIME_MSECONDS(5000)

Definition at line 136 of file P_HostDBProcessor.h.

Referenced by HostDBContinuation::do_get_response().

#define HOST_DB_HITS_BITS   3

Definition at line 107 of file P_HostDBProcessor.h.

#define HOST_DB_IP_FAIL_TIMEOUT   (60*60)

Definition at line 126 of file P_HostDBProcessor.h.

#define HOST_DB_IP_STALE   (12*60*60)

Definition at line 124 of file P_HostDBProcessor.h.

#define HOST_DB_IP_TIMEOUT   (24*60*60)

Definition at line 122 of file P_HostDBProcessor.h.

#define HOST_DB_MAX_TTL   (0x1FFFFF)

Definition at line 129 of file P_HostDBProcessor.h.

Referenced by HostDBContinuation::do_dns(), and HostDBContinuation::insert().

#define HOST_DB_RETRY_PERIOD   HRTIME_MSECONDS(20)
#define HOST_DB_TAG_BITS   56

Definition at line 108 of file P_HostDBProcessor.h.

#define HOST_DB_TIMEOUT_INTERVAL   HRTIME_SECOND

Definition at line 120 of file P_HostDBProcessor.h.

Referenced by HostDBProcessor::start().

#define HOSTDB_DEBUG_COUNT_DYN_STAT (   _x,
  _y 
)    RecIncrRawStatCount(hostdb_rsb, mutex->thread_holding, (int)_x, _y)

Definition at line 170 of file P_HostDBProcessor.h.

#define HOSTDB_DECREMENT_DYN_STAT (   _x  )     RecIncrRawStatSum(hostdb_rsb, mutex->thread_holding, (int)_x, -1)

Definition at line 176 of file P_HostDBProcessor.h.

#define HOSTDB_DECREMENT_THREAD_DYN_STAT (   _s,
  _t 
)    RecIncrRawStatSum(hostdb_rsb, _t, (int) _s, -1);

Definition at line 193 of file P_HostDBProcessor.h.

#define HOSTDB_INCREMENT_DYN_STAT (   _x  )     RecIncrRawStatSum(hostdb_rsb, mutex->thread_holding, (int)_x, 1)
#define HOSTDB_INCREMENT_THREAD_DYN_STAT (   _s,
  _t 
)    RecIncrRawStatSum(hostdb_rsb, _t, (int) _s, 1);

Definition at line 190 of file P_HostDBProcessor.h.

#define HOSTDB_READ_DYN_STAT (   _x,
  _count,
  _sum 
)
Value:
do {\
RecGetRawStatSum(hostdb_rsb, (int)_x, &_sum);          \
RecGetRawStatCount(hostdb_rsb, (int)_x, &_count);         \
} while (0)

Definition at line 182 of file P_HostDBProcessor.h.

#define HOSTDB_SET_DYN_COUNT (   _x,
  _count 
)    RecSetRawStatCount(hostdb_rsb, _x, _count);

Definition at line 187 of file P_HostDBProcessor.h.

Referenced by HostDBProcessor::start(), and HostDBCache::start().

#define HOSTDB_SUM_DYN_STAT (   _x,
  _r 
)    RecIncrRawStatSum(hostdb_rsb, mutex->thread_holding, (int)_x, _r)

Definition at line 179 of file P_HostDBProcessor.h.

Referenced by HostDBContinuation::lookup_done().

#define TEST (   _x  ) 

Definition at line 140 of file P_HostDBProcessor.h.


Typedef Documentation

typedef int(HostDBContinuation::* HostDBContHandler)(int, void *)

Definition at line 436 of file P_HostDBProcessor.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
TTL_OBEY 
TTL_IGNORE 
TTL_MIN 
TTL_MAX 

Definition at line 46 of file P_HostDBProcessor.h.

Enumerator:
hostdb_total_entries_stat 
hostdb_total_lookups_stat 
hostdb_total_hits_stat 
hostdb_ttl_stat 
hostdb_ttl_expires_stat 
hostdb_re_dns_on_reload_stat 
hostdb_bytes_stat 
HostDB_Stat_Count 

Definition at line 152 of file P_HostDBProcessor.h.

enum HostDBMark

Host DB record mark.

The records in the host DB are de facto segregated by roughly the DNS query type. We use an intermediate type to provide a little flexibility although the type is presumed to be a single byte.

Enumerator:
HOSTDB_MARK_GENERIC 

Anything that's not one of the other types.

HOSTDB_MARK_IPV4 

IPv4 / T_A.

HOSTDB_MARK_IPV6 

IPv6 / T_AAAA.

HOSTDB_MARK_SRV 

Service / T_SRV.

Definition at line 71 of file P_HostDBProcessor.h.


Function Documentation

unsigned int HOSTDB_CLIENT_IP_HASH ( sockaddr const *  lhs,
sockaddr const *  rhs 
) [inline]
bool is_dotted_form_hostname ( const char *  c  )  [inline]

Definition at line 543 of file P_HostDBProcessor.h.

References ink_inet_addr().

Referenced by probe().

unsigned int master_hash ( INK_MD5 const &  md5  )  [inline]
char const* string_for ( HostDBMark  mark  ) 

Convert a HostDB mark to a string.

Returns:
A static string.

Definition at line 151 of file HostDB.cc.


Variable Documentation

Definition at line 65 of file HostDB.cc.

Definition at line 59 of file HostDB.cc.

Referenced by HostDBProcessor::start().

char hostdb_filename[PATH_NAME_MAX+1]

Definition at line 55 of file HostDB.cc.

Referenced by HostDBCache::start().

Definition at line 47 of file HostDB.cc.

Referenced by HostDBContinuation::dnsEvent().

Definition at line 51 of file HostDB.cc.

Referenced by HostDBInfo::is_ip_stale(), and HostDBProcessor::start().

Definition at line 52 of file HostDB.cc.

Referenced by HostDBContinuation::lookup_done(), and HostDBProcessor::start().

Definition at line 46 of file HostDB.cc.

Referenced by HostDBContinuation::do_dns(), and HostDBProcessor::start().

Definition at line 2439 of file HostDB.cc.

Definition at line 56 of file HostDB.cc.

Referenced by HostDBCache::start().

Definition at line 49 of file HostDB.cc.

Referenced by HostDBContinuation::lookup_done(), and HostDBProcessor::start().