Data Structures | Defines | Typedefs | Functions | Variables

HostDB.cc File Reference

A brief file description. More...

#include "P_HostDB.h"
#include "I_Layout.h"
#include "Show.h"
#include "ink_apidefs.h"
Include dependency graph for HostDB.cc:

Go to the source code of this file.

Data Structures

struct  HostDBTestRR
struct  HostDBSyncer
struct  HostDB_get_message
struct  HostDB_put_message
struct  ShowHostDB
struct  HostDBTestReverse

Defines

#define _HOSTDB_CC_
#define STR_LEN_EQ_PREFIX(_x, _l, _s)   (!ptr_len_ncasecmp(_x,_l,_s,sizeof(_s)-1))
#define HOSTDB_TEST_MAX_OUTSTANDING   100
#define HOSTDB_TEST_LENGTH   100000

Typedefs

typedef int(ShowHostDB::* ShowHostDBEventHandler )(int event, Event *data)
typedef int(HostDBTestReverse::* HostDBTestReverseHandler )(int, void *)

Functions

static int corrupt_debugging_callout (HostDBInfo *e, RebuildMC &r)
static bool is_addr_valid (uint8_t af, void *ptr)
static void ip_addr_set (sockaddr *ip, uint8_t af, void *ptr)
static void ip_addr_set (IpAddr &ip, uint8_t af, void *ptr)
void hostdb_cont_free (HostDBContinuation *cont)
static bool check_for_retry (HostDBMark &mark, HostResStyle style)
char const * string_for (HostDBMark mark)
 Convert a HostDB mark to a string.
static Actionregister_ShowHostDB (Continuation *c, HTTPHdr *h)
void make_md5 (INK_MD5 &md5, const char *hostname, int len, int port, char const *pDNSServers, HostDBMark mark)
static bool reply_to_cont (Continuation *cont, HostDBInfo *r, bool is_srv=false)
HostResStyle host_res_style_for (sockaddr const *ip)
HostResStyle host_res_style_for (HostDBMark mark)
HostDBMark db_mark_for (HostResStyle style)
HostDBMark db_mark_for (sockaddr const *ip)
HostDBInfoprobe (ProxyMutex *mutex, HostDBMD5 const &md5, bool ignore_timeout)
static void do_setby (HostDBInfo *r, HostDBApplicationInfo *app, const char *hostname, IpAddr const &ip, bool is_srv=false)
static int remove_round_robin (HostDBInfo *r, const char *hostname, IpAddr const &ip)
static int restore_info (HostDBInfo *r, HostDBInfo *old_r, HostDBInfo &old_info, HostDBRoundRobin *old_rr_data)
void get_hostinfo_ClusterFunction (ClusterHandler *ch, void *data, int)
void put_hostinfo_ClusterFunction (ClusterHandler *ch, void *data, int)
void ink_hostdb_init (ModuleVersion v)

Variables

HostDBProcessor hostDBProcessor
int hostdb_enable = true
int hostdb_migrate_on_demand = true
int hostdb_cluster = false
int hostdb_cluster_round_robin = false
int hostdb_lookup_timeout = 120
int hostdb_insert_timeout = 160
int hostdb_re_dns_on_reload = false
int hostdb_ttl_mode = TTL_OBEY
unsigned int hostdb_current_interval = 0
unsigned int hostdb_ip_stale_interval = HOST_DB_IP_STALE
unsigned int hostdb_ip_timeout_interval = HOST_DB_IP_TIMEOUT
unsigned int hostdb_ip_fail_timeout_interval = HOST_DB_IP_FAIL_TIMEOUT
unsigned int hostdb_serve_stale_but_revalidate = 0
char hostdb_filename [PATH_NAME_MAX+1] = DEFAULT_HOST_DB_FILENAME
int hostdb_size = DEFAULT_HOST_DB_SIZE
int hostdb_sync_frequency = 120
int hostdb_srv_enabled = 0
int hostdb_disable_reverse_lookup = 0
ClassAllocator
< HostDBContinuation
hostDBContAllocator ("hostDBContAllocator")
HostDBCache hostDB
static Queue< HostDBContinuationremoteHostDBQueue [MULTI_CACHE_PARTITIONS]
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 HostDB.cc.


Define Documentation

#define _HOSTDB_CC_

Definition at line 24 of file HostDB.cc.

#define HOSTDB_TEST_LENGTH   100000

Definition at line 2373 of file HostDB.cc.

Referenced by HostDBTestReverse::mainEvent().

#define HOSTDB_TEST_MAX_OUTSTANDING   100

Definition at line 2372 of file HostDB.cc.

Referenced by HostDBTestReverse::mainEvent().

#define STR_LEN_EQ_PREFIX (   _x,
  _l,
  _s 
)    (!ptr_len_ncasecmp(_x,_l,_s,sizeof(_s)-1))

Definition at line 2332 of file HostDB.cc.

Referenced by register_ShowHostDB().


Typedef Documentation

typedef int(HostDBTestReverse::* HostDBTestReverseHandler)(int, void *)

Definition at line 2376 of file HostDB.cc.

typedef int(ShowHostDB::* ShowHostDBEventHandler)(int event, Event *data)

Definition at line 2227 of file HostDB.cc.


Function Documentation

static bool check_for_retry ( HostDBMark mark,
HostResStyle  style 
) [inline, static]
static int corrupt_debugging_callout ( HostDBInfo e,
RebuildMC r 
) [inline, static]
HostDBMark db_mark_for ( HostResStyle  style  )  [inline]
HostDBMark db_mark_for ( sockaddr const *  ip  )  [inline]

Definition at line 615 of file HostDB.cc.

References ats_is_ip6(), and HOSTDB_MARK_IPV6.

static void do_setby ( HostDBInfo r,
HostDBApplicationInfo app,
const char *  hostname,
IpAddr const &  ip,
bool  is_srv = false 
) [static]
void get_hostinfo_ClusterFunction ( ClusterHandler ch,
void *  data,
int   
)
HostResStyle host_res_style_for ( sockaddr const *  ip  )  [inline]
HostResStyle host_res_style_for ( HostDBMark  mark  )  [inline]

Definition at line 597 of file HostDB.cc.

References HOST_RES_IPV4_ONLY, HOST_RES_IPV6_ONLY, HOSTDB_MARK_IPV4, and HOSTDB_MARK_IPV6.

void hostdb_cont_free ( HostDBContinuation cont  )  [inline]
void ink_hostdb_init ( ModuleVersion  v  ) 
static void ip_addr_set ( IpAddr ip,
uint8_t  af,
void *  ptr 
) [inline, static]
Parameters:
ip Target storage.
af Address format.
ptr Raw address data

Definition at line 111 of file HostDB.cc.

References IpAddr::invalidate().

static void ip_addr_set ( sockaddr *  ip,
uint8_t  af,
void *  ptr 
) [inline, static]
Parameters:
ip Target storage, sockaddr compliant.
af Address format.
ptr Raw address data

Definition at line 98 of file HostDB.cc.

References ats_ip4_set(), ats_ip6_set(), and ats_ip_invalidate().

Referenced by HostDBContinuation::dnsEvent().

static bool is_addr_valid ( uint8_t  af,
void *  ptr 
) [inline, static]
Parameters:
af Address family (format of data)
ptr Raw address data (not a sockaddr variant!)

Definition at line 87 of file HostDB.cc.

Referenced by HostDBContinuation::dnsEvent().

void make_md5 ( INK_MD5 md5,
const char *  hostname,
int  len,
int  port,
char const *  pDNSServers,
HostDBMark  mark 
)
HostDBInfo* probe ( ProxyMutex mutex,
HostDBMD5 const &  md5,
bool  ignore_timeout 
)
void put_hostinfo_ClusterFunction ( ClusterHandler ch,
void *  data,
int   
)
static Action * register_ShowHostDB ( Continuation c,
HTTPHdr h 
) [static]
static int remove_round_robin ( HostDBInfo r,
const char *  hostname,
IpAddr const &  ip 
) [static]
static bool reply_to_cont ( Continuation cont,
HostDBInfo r,
bool  is_srv = false 
) [static]
static int restore_info ( HostDBInfo r,
HostDBInfo old_r,
HostDBInfo old_info,
HostDBRoundRobin old_rr_data 
) [static]
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.

int hostdb_cluster = false
unsigned int hostdb_current_interval = 0

Definition at line 59 of file HostDB.cc.

Referenced by HostDBProcessor::start().

int hostdb_enable = true
char hostdb_filename[PATH_NAME_MAX+1] = DEFAULT_HOST_DB_FILENAME

Definition at line 55 of file HostDB.cc.

Referenced by HostDBCache::start().

Definition at line 47 of file HostDB.cc.

Referenced by HostDBContinuation::dnsEvent().

unsigned int hostdb_ip_fail_timeout_interval = HOST_DB_IP_FAIL_TIMEOUT
unsigned int hostdb_ip_stale_interval = HOST_DB_IP_STALE

Definition at line 51 of file HostDB.cc.

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

unsigned int hostdb_ip_timeout_interval = HOST_DB_IP_TIMEOUT

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 54 of file HostDB.cc.

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

int hostdb_size = DEFAULT_HOST_DB_SIZE

Definition at line 56 of file HostDB.cc.

Referenced by HostDBCache::start().

int hostdb_ttl_mode = TTL_OBEY

Definition at line 49 of file HostDB.cc.

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

Queue<HostDBContinuation > remoteHostDBQueue[MULTI_CACHE_PARTITIONS] [static]

Definition at line 67 of file HostDB.cc.