Annotation of libwww/Library/src/HTDNS.html, revision 2.13

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.13    ! frystyk     3:   <!-- Changed by: Henrik Frystyk Nielsen,  2-Apr-1996 -->
        !             4:   <TITLE>W3C Reference Library libwww DNS Class</TITLE>
2.1       frystyk     5: </HEAD>
                      6: <BODY>
2.13    ! frystyk     7: <H1>
        !             8:   Domain Name Service Class
        !             9: </H1>
2.1       frystyk    10: <PRE>
                     11: /*
                     12: **     (c) COPYRIGHT MIT 1995.
                     13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
2.13    ! frystyk    16: <P>
        !            17: The DNS Class defines generic access to &nbsp;the DNS system. It maintains
        !            18: a cache of all visited hosts so that subsequent connects to the same host
        !            19: doesn't imply a new request to the DNS every time. Multihomed hosts are treated
        !            20: specially in that the time spend on every connect is measured and kept in
        !            21: the cache. On the next request to the same host, the IP-address with the
        !            22: lowest average connect time is chosen. If one IP-address fails completely,
        !            23: e.g. <EM>connection refused</EM> then it disabled and HTDoConnect tries one
        !            24: of the other IP-addresses to the same host.
        !            25: <P>
        !            26: Every entry in the cache has its own time to live (TTL) and hence the cache
        !            27: manages its own automatic garbage collection. Currently the TTL is <B>not</B>
        !            28: bound to the DNS records which should be changed. You can set the DNS object
        !            29: TTL
        !            30: <P>
        !            31: This module is implemented by <A HREF="HTDNS.c">HTDNS.c</A>, and it is a
        !            32: part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Reference
        !            33: Library</A>.
2.1       frystyk    34: <PRE>
                     35: #ifndef HTDNS_H
                     36: #define HTDNS_H
2.13    ! frystyk    37: 
2.1       frystyk    38: </PRE>
2.13    ! frystyk    39: <PRE>typedef struct _HTdns HTdns;
2.1       frystyk    40: </PRE>
2.13    ! frystyk    41: <H2>
        !            42:   DNS Cache Expiration Time
        !            43: </H2>
        !            44: <P>
2.12      frystyk    45: When to remove an entry in the cache. The default value is 12h.
2.1       frystyk    46: <PRE>
                     47: extern void HTDNS_setTimeout (time_t timeout);
                     48: extern time_t HTDNS_timeout  (time_t timeout);
                     49: </PRE>
2.13    ! frystyk    50: <H2>
        !            51:   Creation and Deletion Methods
        !            52: </H2>
        !            53: <H3>
        !            54:   Add a DNS Object
        !            55: </H3>
        !            56: <P>
        !            57: Add an element to the cache of visited hosts. The <CODE>homes</CODE> variable
        !            58: indicates the number of IP addresses found when looking up the name. A host
        !            59: name must <B>NOT</B> contain a port number.
        !            60: <PRE>
        !            61: extern HTdns * HTDNS_add (HTList * list, struct hostent * element,
        !            62:                          char * host, int * homes);
        !            63: </PRE>
        !            64: <H3>
        !            65:   Delete a DNS object
        !            66: </H3>
        !            67: <P>
        !            68: This function flushes the DNS object from the cache and frees up memory
2.1       frystyk    69: <PRE>
2.9       frystyk    70: extern BOOL HTDNS_delete (const char * host);
2.1       frystyk    71: </PRE>
2.13    ! frystyk    72: <H3>
        !            73:   Delete ALL DNS objects
        !            74: </H3>
        !            75: <P>
2.1       frystyk    76: This function is called from <A HREF="HTAccess.html#Library">
2.13    ! frystyk    77: HTLibTerminate</A>. It can be called at any point in time if the DNS cache
        !            78: is going to be flushed.
2.1       frystyk    79: <PRE>
                     80: extern BOOL HTDNS_deleteAll (void);
                     81: </PRE>
2.13    ! frystyk    82: <H2>
        !            83:   DNS Class Methods
        !            84: </H2>
        !            85: <H3>
        !            86:   Recalculating the Time Weights on Multihomed Host
        !            87: </H3>
        !            88: <P>
        !            89: On every connect to a multihomed host, the average connect time is updated
        !            90: exponentially for all the entries.
        !            91: <PRE>
        !            92: extern BOOL HTDNS_updateWeigths (HTdns *dns, int cur, time_t deltatime);
        !            93: </PRE>
        !            94: <H2>
        !            95:   Resolver Functions
        !            96: </H2>
        !            97: <P>
        !            98: These are the functions that resolve a host name
        !            99: <H3>
        !           100:   Get Host By Socket
        !           101: </H3>
        !           102: <P>
        !           103: This function should have been called HTGetHostByAddr but for historical
        !           104: reasons this is not the case.
2.1       frystyk   105: <PRE>
2.7       frystyk   106: extern char * HTGetHostBySock (int soc);
2.1       frystyk   107: </PRE>
2.13    ! frystyk   108: <H3>
        !           109:   Get Host By Name
        !           110: </H3>
        !           111: <P>
        !           112: This function gets the address of the host and puts it in to the socket
        !           113: structure. It maintains its own cache of connections so that the communication
        !           114: to the Domain Name Server is minimized. Returns the number of homes or -1
        !           115: if error.
2.1       frystyk   116: <PRE>
                    117: extern int HTGetHostByName (struct _HTNet *net, char *host);
                    118: </PRE>
                    119: <PRE>
                    120: #endif
                    121: </PRE>
2.13    ! frystyk   122: <P>
        !           123:   <HR>
2.12      frystyk   124: <ADDRESS>
2.13    ! frystyk   125:   @(#) $Id: HTDNS.html,v 2.12 1996/04/12 17:46:22 frystyk Exp $
2.12      frystyk   126: </ADDRESS>
2.13    ! frystyk   127: </BODY></HTML>

Webmaster