Public Member Functions | Static Public Member Functions | Data Fields

HostDBRoundRobin Struct Reference

#include <I_HostDBProcessor.h>

Collaboration diagram for HostDBRoundRobin:
Collaboration graph
[legend]

Public Member Functions

int index_of (sockaddr const *addr)
 Find the index of addr in member info.
HostDBInfofind_ip (sockaddr const *addr)
HostDBInfofind_target (const char *target)
HostDBInfoselect_next (sockaddr const *addr)
 Select the next entry after addr.
HostDBInfoselect_best_http (sockaddr const *client_ip, ink_time_t now, int32_t fail_window)
HostDBInfoselect_best_srv (char *target, InkRand *rand, ink_time_t now, int32_t fail_window)
 HostDBRoundRobin ()

Static Public Member Functions

static unsigned size (unsigned count, unsigned srv_len=0)

Data Fields

short rrcount
 Total number (to compute space used).
short good
 Number which have not failed a connect.
unsigned short current
unsigned short length
ink_time_t timed_rr_ctime
HostDBInfo info []

Detailed Description

Definition at line 308 of file I_HostDBProcessor.h.


Constructor & Destructor Documentation

HostDBRoundRobin::HostDBRoundRobin (  )  [inline]

Definition at line 344 of file I_HostDBProcessor.h.


Member Function Documentation

HostDBInfo * HostDBRoundRobin::find_ip ( sockaddr const *  addr  )  [inline]

Definition at line 236 of file P_HostDBProcessor.h.

References index_of(), and info.

Referenced by HttpSM::process_hostdb_info(), and HttpSM::state_mark_os_down().

HostDBInfo * HostDBRoundRobin::find_target ( const char *  target  )  [inline]
int HostDBRoundRobin::index_of ( sockaddr const *  addr  )  [inline]

Find the index of addr in member info.

Returns:
The index if found, -1 if not found.

Definition at line 219 of file P_HostDBProcessor.h.

References ats_ip_addr_eq(), good, HOST_DB_MAX_ROUND_ROBIN_INFO, info, and ink_assert.

Referenced by find_ip(), and select_next().

HostDBInfo * HostDBRoundRobin::select_best_http ( sockaddr const *  client_ip,
ink_time_t  now,
int32_t  fail_window 
) [inline]
HostDBInfo * HostDBRoundRobin::select_best_srv ( char *  target,
InkRand rand,
ink_time_t  now,
int32_t  fail_window 
) [inline]
HostDBInfo * HostDBRoundRobin::select_next ( sockaddr const *  addr  )  [inline]

Select the next entry after addr.

Note:
If addr isn't an address in the round robin nothing is updated.
Returns:
The selected entry or NULL if addr wasn't present.

Definition at line 242 of file P_HostDBProcessor.h.

References good, index_of(), and info.

Referenced by HttpTransact::OSDNSLookup().

static unsigned HostDBRoundRobin::size ( unsigned  count,
unsigned  srv_len = 0 
) [inline, static]

Definition at line 324 of file I_HostDBProcessor.h.

References INK_ALIGN, and ink_assert.

Referenced by HostDBContinuation::dnsEvent().


Field Documentation

unsigned short HostDBRoundRobin::current
unsigned short HostDBRoundRobin::length

Definition at line 318 of file I_HostDBProcessor.h.

Referenced by select_best_http().


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