GSK Reference Manual | ||||
---|---|---|---|---|
GskDnsClient; GskDnsClientClass; enum GskDnsClientFlags; GskDnsClient* gsk_dns_client_new (GskPacketQueue *packet_queue, GskDnsRRCache *rr_cache, GskDnsClientFlags flags); void gsk_dns_client_add_searchpath (GskDnsClient *client, const char *searchpath); void gsk_dns_client_add_ns (GskDnsClient *client, GskSocketAddressIpv4 *address); void gsk_dns_client_set_cache (GskDnsClient *client, GskDnsRRCache *rr_cache); void gsk_dns_client_set_flags (GskDnsClient *client, GskDnsClientFlags flags); GskDnsClientFlags gsk_dns_client_get_flags (GskDnsClient *client); gboolean gsk_dns_client_parse_system_files (GskDnsClient *client);
This is a flexible DNS client. It has (1) a transport for packets and (2) a cache of resource records.
This code is almost always used indirectly, from gsk_name_resolve()
,
since the default name resolver uses DNS.
typedef enum { GSK_DNS_CLIENT_STUB_RESOLVER = (1<<0) } GskDnsClientFlags;
Flags which affect how the DNS client operates.
GskDnsClient* gsk_dns_client_new (GskPacketQueue *packet_queue, GskDnsRRCache *rr_cache, GskDnsClientFlags flags);
Create a new DNS client. This implements the GskDnsResolver interface.
packet_queue : |
underlying transport layer to use. The client will keep a reference to this packet-queue. |
rr_cache : |
cache of resource-records. The client will keep a reference to this cache. |
flags : |
whether you want this client to be a recursive or stub resolver. |
Returns : | the newly allocated DNS client. |
void gsk_dns_client_add_searchpath (GskDnsClient *client, const char *searchpath);
Add a new implicit domain to the list the client keeps.
A searchpath entry is simply a domain to try post-fixing to any request. For example, if you have "sourceforce.net" in your searchpath, then looking "cvs.gsk" should resolve "cvs.gsk.sourceforge.net".
Searchpath entries take priority, EXCEPT if the requested domain name ends in ".". If you have "sourceforce.net" in your searchpath, then looking "cvs.com" should resolve "cvs.com.sourceforge.net" then "cvs.com" if the former does not exist. However, looking up "cvs.com." will ONLY search the global namespace.
client : |
the client to affect. |
searchpath : |
the new path to search. |
void gsk_dns_client_add_ns (GskDnsClient *client, GskSocketAddressIpv4 *address);
Add a new nameserver to query. All nameservers will be queried simultaneously.
client : |
the client to affect. |
address : |
the numeric address of the nameserver. |
void gsk_dns_client_set_cache (GskDnsClient *client, GskDnsRRCache *rr_cache);
Switch the client to use a new resource-record cache.
client : |
the client to affect. |
rr_cache : |
the new resource-record cache to use. |
void gsk_dns_client_set_flags (GskDnsClient *client, GskDnsClientFlags flags);
client : |
|
flags : |
GskDnsClientFlags gsk_dns_client_get_flags (GskDnsClient *client);
client : |
|
Returns : |
gboolean gsk_dns_client_parse_system_files (GskDnsClient *client);
Parse system DNS configuration.
Currently, this parses /etc/hosts and /etc/resolv.conf .
client : |
the client which should add the system configuration information. |
Returns : | whether the files were parsed successfully. |