WvStreams
debian/libwvstreams-dev/usr/include/wvstreams/wvresolver.h
1/* -*- Mode: C++ -*-
2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4 *
5 * DNS name resolver with support for background lookups.
6 */
7#ifndef __WVRESOLVER_H
8#define __WVRESOLVER_H
9
10#include "wvaddr.h"
11#include "wvstream.h"
12#include "wvlinklist.h"
13#include "wvhashtable.h"
14
15class WvResolverHost;
16class WvResolverAddr;
17
18DeclareWvDict(WvResolverHost, WvString, name);
19DeclareWvDict(WvResolverAddr, WvIPAddr, addr[0]);
20
21DeclareWvList(WvIPAddr);
22
25{
26 static int numresolvers;
27 static WvResolverHostDict *hostmap;
28 static WvResolverAddrDict *addrmap;
29public:
30 WvResolver();
32
39 int findaddr(int msec_timeout, WvStringParm name,
40 WvIPAddr const **addr, WvIPAddrList *addrlist = NULL);
41 int findname(int msec_timeout, WvIPAddr *ipaddr, char **name);
42
43 void clearhost(WvStringParm hostname);
44
47
50};
51
52#endif // __WVRESOLVER_H
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
An IP address is made up of a "dotted quad" – four decimal numbers in the form www....
ASynchronous DNS resolver functions, so that we can do non-blocking lookups.
bool post_select(WvStringParm hostname, WvStream::SelectInfo &si)
determines whether the resolving process is complete.
int findaddr(int msec_timeout, WvStringParm name, WvIPAddr const **addr, WvIPAddrList *addrlist=NULL)
Return -1 on timeout, or the number of addresses found, which may be 0 if the address does not exist.
void pre_select(WvStringParm hostname, WvStream::SelectInfo &si)
add all of our waiting fds to an fd_set for use with select().
WvString is an implementation of a simple and efficient printable-string class.
WvString hostname()
Do gethostname() without a fixed-length buffer.
Definition strutils.cc:870
the data structure used by pre_select()/post_select() and internally by select().