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

P_DNSProcessor.h File Reference

A brief file description. More...

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

Go to the source code of this file.

Data Structures

struct  DNSEntry
 One DNSEntry is allocated per outstanding request. More...
struct  DNSHandler
 One DNSHandler is allocated to handle all DNS traffic by polling a UDP port. More...
struct  DNSServer

Defines

#define MAX_NAMED   32
#define DEFAULT_DNS_RETRIES   5
#define MAX_DNS_RETRIES   9
#define DEFAULT_DNS_TIMEOUT   30
#define MAX_DNS_IN_FLIGHT   2048
#define DEFAULT_FAILOVER_NUMBER   (DEFAULT_DNS_RETRIES + 1)
#define DEFAULT_FAILOVER_PERIOD   (DEFAULT_DNS_TIMEOUT + 30)
#define DEFAULT_FAILOVER_TRY_PERIOD   (DEFAULT_DNS_TIMEOUT + 1)
#define DEFAULT_DNS_SEARCH   1
#define FAILOVER_SOON_RETRY   5
#define NO_NAMESERVER_SELECTED   -1
#define DNS_PERIOD   HRTIME_MSECONDS(-100)
#define DNS_DELAY_PERIOD   HRTIME_MSECONDS(10)
#define DNS_SEQUENCE_NUMBER_RESTART_OFFSET   4000
#define DNS_PRIMARY_RETRY_PERIOD   HRTIME_SECONDS(5)
#define DNS_PRIMARY_REOPEN_PERIOD   HRTIME_SECONDS(60)
#define BAD_DNS_RESULT   ((HostEnt*)(uintptr_t)-1)
#define DEFAULT_NUM_TRY_SERVER   8
#define HFIXEDSZ   12
#define QFIXEDSZ   4
#define DNS_EVENT_LOOKUP   DNS_EVENT_EVENTS_START
#define DNS_DEBUG_COUNT_DYN_STAT(_x, _y)   RecIncrRawStatCount(dns_rsb, mutex->thread_holding, (int)_x, _y)
#define DNS_INCREMENT_DYN_STAT(_x)   RecIncrRawStatSum(dns_rsb, mutex->thread_holding, (int)_x, 1)
#define DNS_DECREMENT_DYN_STAT(_x)   RecIncrRawStatSum(dns_rsb, mutex->thread_holding, (int)_x, -1)
#define DNS_SUM_DYN_STAT(_x, _r)   RecIncrRawStatSum(dns_rsb, mutex->thread_holding, (int)_x, _r)
#define DNS_READ_DYN_STAT(_x, _count, _sum)
#define DNS_SET_DYN_COUNT(_x, _count)   RecSetRawStatCount(dns_rsb, _x, _count);
#define DNS_INCREMENT_THREAD_DYN_STAT(_s, _t)   RecIncrRawStatSum(dns_rsb, _t, (int) _s, 1);
#define DNS_DECREMENT_THREAD_DYN_STAT(_s, _t)   RecIncrRawStatSum(dns_rsb, _t, (int) _s, -1);
#define DOT_SEPARATED(_x)

Typedefs

typedef int(DNSEntry::* DNSEntryHandler )(int, void *)

Enumerations

enum  DNS_Stats {
  dns_total_lookups_stat, dns_response_time_stat, dns_success_time_stat, dns_lookup_success_stat,
  dns_lookup_fail_stat, dns_fail_time_stat, dns_retries_stat, dns_max_retries_exceeded_stat,
  dns_sequence_number_stat, dns_in_flight_stat, DNS_Stat_Count
}

Functions

void * dns_udp_receiver (void *arg)

Variables

int dns_timeout
int dns_retries
int dns_search
int dns_failover_number
int dns_failover_period
int dns_failover_try_period
int dns_max_dns_in_flight
unsigned int dns_sequence_number
int dns_fd
RecRawStatBlockdns_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_DNSProcessor.h.


Define Documentation

#define BAD_DNS_RESULT   ((HostEnt*)(uintptr_t)-1)

Definition at line 71 of file P_DNSProcessor.h.

Referenced by dns_result().

#define DEFAULT_DNS_RETRIES   5

Definition at line 37 of file P_DNSProcessor.h.

#define DEFAULT_DNS_SEARCH   1

Definition at line 46 of file P_DNSProcessor.h.

#define DEFAULT_DNS_TIMEOUT   30

Definition at line 39 of file P_DNSProcessor.h.

#define DEFAULT_FAILOVER_NUMBER   (DEFAULT_DNS_RETRIES + 1)

Definition at line 41 of file P_DNSProcessor.h.

#define DEFAULT_FAILOVER_PERIOD   (DEFAULT_DNS_TIMEOUT + 30)

Definition at line 42 of file P_DNSProcessor.h.

#define DEFAULT_FAILOVER_TRY_PERIOD   (DEFAULT_DNS_TIMEOUT + 1)

Definition at line 45 of file P_DNSProcessor.h.

#define DEFAULT_NUM_TRY_SERVER   8

Definition at line 72 of file P_DNSProcessor.h.

Referenced by dns_process(), and DNSHandler::try_primary_named().

#define DNS_DEBUG_COUNT_DYN_STAT (   _x,
  _y 
)    RecIncrRawStatCount(dns_rsb, mutex->thread_holding, (int)_x, _y)

Definition at line 116 of file P_DNSProcessor.h.

#define DNS_DECREMENT_DYN_STAT (   _x  )     RecIncrRawStatSum(dns_rsb, mutex->thread_holding, (int)_x, -1)

Definition at line 122 of file P_DNSProcessor.h.

Referenced by dns_process(), DNSEntry::mainEvent(), and DNSHandler::rr_failure().

#define DNS_DECREMENT_THREAD_DYN_STAT (   _s,
  _t 
)    RecIncrRawStatSum(dns_rsb, _t, (int) _s, -1);

Definition at line 139 of file P_DNSProcessor.h.

#define DNS_DELAY_PERIOD   HRTIME_MSECONDS(10)

Definition at line 67 of file P_DNSProcessor.h.

Referenced by DNSEntry::delayEvent().

#define DNS_EVENT_LOOKUP   DNS_EVENT_EVENTS_START
#define DNS_INCREMENT_DYN_STAT (   _x  )     RecIncrRawStatSum(dns_rsb, mutex->thread_holding, (int)_x, 1)

Definition at line 119 of file P_DNSProcessor.h.

Referenced by dns_process(), dns_result(), write_dns(), and write_dns_event().

#define DNS_INCREMENT_THREAD_DYN_STAT (   _s,
  _t 
)    RecIncrRawStatSum(dns_rsb, _t, (int) _s, 1);

Definition at line 136 of file P_DNSProcessor.h.

#define DNS_PERIOD   HRTIME_MSECONDS(-100)
#define DNS_PRIMARY_REOPEN_PERIOD   HRTIME_SECONDS(60)

Definition at line 70 of file P_DNSProcessor.h.

Referenced by DNSHandler::retry_named(), and DNSHandler::try_primary_named().

#define DNS_PRIMARY_RETRY_PERIOD   HRTIME_SECONDS(5)

Definition at line 69 of file P_DNSProcessor.h.

Referenced by DNSHandler::mainEvent(), and DNSHandler::try_primary_named().

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

Definition at line 128 of file P_DNSProcessor.h.

#define DNS_SEQUENCE_NUMBER_RESTART_OFFSET   4000

Definition at line 68 of file P_DNSProcessor.h.

#define DNS_SET_DYN_COUNT (   _x,
  _count 
)    RecSetRawStatCount(dns_rsb, _x, _count);

Definition at line 133 of file P_DNSProcessor.h.

#define DNS_SUM_DYN_STAT (   _x,
  _r 
)    RecIncrRawStatSum(dns_rsb, mutex->thread_holding, (int)_x, _r)

Definition at line 125 of file P_DNSProcessor.h.

Referenced by dns_process(), and dns_result().

#define DOT_SEPARATED (   _x  ) 
Value:
((unsigned char*)&(_x))[0], ((unsigned char*)&(_x))[1],   \
    ((unsigned char*)&(_x))[2], ((unsigned char*)&(_x))[3]

Definition at line 343 of file P_DNSProcessor.h.

#define FAILOVER_SOON_RETRY   5

Definition at line 47 of file P_DNSProcessor.h.

Referenced by DNSHandler::failover_soon().

#define HFIXEDSZ   12

Definition at line 76 of file P_DNSProcessor.h.

Referenced by dns_process(), and ink_res_mkquery().

#define MAX_DNS_IN_FLIGHT   2048

Definition at line 40 of file P_DNSProcessor.h.

#define MAX_DNS_RETRIES   9

Definition at line 38 of file P_DNSProcessor.h.

#define MAX_NAMED   32
#define NO_NAMESERVER_SELECTED   -1

Definition at line 48 of file P_DNSProcessor.h.

#define QFIXEDSZ   4

Definition at line 79 of file P_DNSProcessor.h.

Referenced by ink_res_mkquery().


Typedef Documentation

typedef int(DNSEntry::* DNSEntryHandler)(int, void *)

Definition at line 194 of file P_DNSProcessor.h.


Enumeration Type Documentation

enum DNS_Stats
Enumerator:
dns_total_lookups_stat 
dns_response_time_stat 
dns_success_time_stat 
dns_lookup_success_stat 
dns_lookup_fail_stat 
dns_fail_time_stat 
dns_retries_stat 
dns_max_retries_exceeded_stat 
dns_sequence_number_stat 
dns_in_flight_stat 
DNS_Stat_Count 

Definition at line 93 of file P_DNSProcessor.h.


Function Documentation

void* dns_udp_receiver ( void *  arg  ) 

Variable Documentation

Definition at line 45 of file DNS.cc.

Referenced by DNSHandler::sent_one(), and DNSProcessor::start().

Definition at line 46 of file DNS.cc.

Referenced by DNSHandler::failover_now(), and DNSProcessor::start().

Definition at line 47 of file DNS.cc.

Referenced by DNSHandler::failover_soon(), and DNSProcessor::start().

int dns_fd

Definition at line 48 of file DNS.cc.

Referenced by DNSProcessor::start(), and write_dns().

Definition at line 1602 of file DNS.cc.

Definition at line 44 of file DNS.cc.

Referenced by DNSEntry::mainEvent(), and DNSProcessor::start().

unsigned int dns_sequence_number

Definition at line 42 of file DNS.cc.

Referenced by DNSProcessor::start(), and write_dns_event().