HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

342 HP-UX C SIP Stack Programmers Guide
DNS Caching
DNS CACHING
C
OMPILATION FLAGS
Several compilation flags are used to configure the DNS caching feature. All the
compilation flags are located in the common/config/rvusrconfig.h file and are
described below:
RV_DNS_USES_CACHING
To enable caching, the RV_DNS_USES_CACHING compile time constant
should be set to RV_YES.
RV_DNS_CACHE_HASH_SIZE
Cache lookup is implemented using static open hashing. The size of hash table
is given by the compile time constant, RV_DNS_CACHE_HASH_SIZE.
RV_DNS_CACHE_PAGE_SIZE
All memory needed for caching is pre-allocated statically on initialization. The
actual data is kept on memory pages. The page size (in bytes) is determined by
the compile time constant, RV_DNS_CACHE_PAGE_SIZE, and should be
>= 512. If the page size is too small to accommodate a single DNS record, this
record will not be cached.
DNS_CACHE_PAGES_NUMBER
The number of pages used for caching data is given by
RV_DNS_CACHE_PAGES_NUMBER. There is no lower limit on the number
of pages, but if the number of pages is too low, new records will not be cached.
RV_DNS_USES_HOSTS
When DNS caching is enabled, the DNS module can be configured to look for
host name resolution in the operating system host file (/etc/hosts for example).
To instruct the SIP Stack to search the host file, the RV_DNS_USES_HOSTS
should be set to RV_TRUE.